@internetarchive/bookreader 5.0.0-110 → 5.0.0-112
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BookReader/BookReader.css +59 -0
- package/BookReader/BookReader.js +1 -1
- package/BookReader/BookReader.js.map +1 -1
- package/BookReader/ia-bookreader-bundle.js +74 -77
- package/BookReader/ia-bookreader-bundle.js.map +1 -1
- package/BookReader/plugins/plugin.chapters.js +1 -1
- package/BookReader/plugins/plugin.chapters.js.map +1 -1
- package/BookReader/plugins/plugin.experiments.js +1 -1
- package/BookReader/plugins/plugin.experiments.js.map +1 -1
- package/BookReader/plugins/plugin.search.js.map +1 -1
- package/BookReader/plugins/plugin.text_selection.js +23 -1
- package/BookReader/plugins/plugin.text_selection.js.map +1 -1
- package/BookReader/plugins/plugin.translate.js +25 -3
- package/BookReader/plugins/plugin.translate.js.map +1 -1
- package/BookReader/plugins/plugin.tts.js.map +1 -1
- package/BookReader/plugins/plugin.url.js +2 -1
- package/BookReader/plugins/plugin.url.js.LICENSE.txt +1 -0
- package/BookReader/plugins/plugin.url.js.map +1 -1
- package/package.json +2 -1
- package/src/BookReader/Mode2UpLit.js +1 -3
- package/src/BookReader/Navbar/Navbar.js +9 -10
- package/src/BookReader/utils/SelectionObserver.js +9 -1
- package/src/BookReader.js +17 -2
- package/src/css/_TextSelection.scss +59 -0
- package/src/plugins/plugin.chapters.js +8 -3
- package/src/plugins/plugin.experiments.js +21 -3
- package/src/plugins/plugin.text_selection.js +17 -0
- package/src/plugins/translate/plugin.translate.js +68 -22
- package/src/plugins/tts/utils.js +1 -1
- package/src/plugins/url/UrlPlugin.js +23 -3
- package/src/plugins/url/plugin.url.js +63 -7
- package/src/util/TextSelectionManager.js +252 -2
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[479],{6098:function(t,e,r){var n=r(9504),o=2147483647,i=/[^\0-\u007E]/,a=/[.\u3002\uFF0E\uFF61]/g,s="Overflow: input needs wider integers to process",u=RangeError,l=n(a.exec),h=Math.floor,c=String.fromCharCode,f=n("".charCodeAt),p=n([].join),d=n([].push),m=n("".replace),g=n("".split),v=n("".toLowerCase),y=function(t){return t+22+75*(t<26)},b=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))},w=function(t){var e=[];t=function(t){for(var e=[],r=0,n=t.length;r<n;){var o=f(t,r++);if(o>=55296&&o<=56319&&r<n){var i=f(t,r++);56320==(64512&i)?d(e,((1023&o)<<10)+(1023&i)+65536):(d(e,o),r--)}else d(e,o)}return e}(t);var r,n,i=t.length,a=128,l=0,m=72;for(r=0;r<t.length;r++)(n=t[r])<128&&d(e,c(n));var g=e.length,v=g;for(g&&d(e,"-");v<i;){var w=o;for(r=0;r<t.length;r++)(n=t[r])>=a&&n<w&&(w=n);var P=v+1;if(w-a>h((o-l)/P))throw new u(s);for(l+=(w-a)*P,a=w,r=0;r<t.length;r++){if((n=t[r])<a&&++l>o)throw new u(s);if(n===a){for(var S=l,k=36;;){var R=k<=m?1:k>=m+26?26:k-m;if(S<R)break;var U=S-R,B=36-R;d(e,c(y(R+U%B))),S=h(U/B),k+=36}d(e,c(y(S))),m=b(l,P,v===g),l=0,v++}}l++,a++}return p(e,"")};t.exports=function(t){var e,r,n=[],o=g(m(v(t),a,"."),".");for(e=0;e<o.length;e++)r=o[e],d(n,l(i,r)?"xn--"+w(r):r);return p(n,".")}},706:function(t,e,r){var n=r(350).PROPER,o=r(9039),i=r(7452);t.exports=function(t){return o(function(){return!!i[t]()||"
"!=="
"[t]()||n&&i[t].name!==t})}},3921:function(t,e,r){var n=r(6518),o=r(2652),i=r(4659);n({target:"Object",stat:!0},{fromEntries:function(t){var e={};return o(t,function(t,r){i(e,t,r)},{AS_ENTRIES:!0}),e}})},2762:function(t,e,r){var n=r(6518),o=r(3802).trim;n({target:"String",proto:!0,forced:r(706)("trim")},{trim:function(){return o(this)}})},5806:function(t,e,r){r(7764);var n,o=r(6518),i=r(3724),a=r(7416),s=r(4576),u=r(6080),l=r(9504),h=r(6840),c=r(2106),f=r(679),p=r(9297),d=r(4213),m=r(7916),g=r(7680),v=r(8183).codeAt,y=r(6098),b=r(655),w=r(687),P=r(2812),S=r(8406),k=r(1181),R=k.set,U=k.getterFor("URL"),B=S.URLSearchParams,H=S.getState,L=s.URL,O=s.TypeError,j=s.encodeURIComponent,I=s.parseInt,q=Math.floor,T=Math.pow,A=l("".charAt),F=l(/./.exec),C=l([].join),_=l(1.1.toString),E=l([].pop),M=l([].push),x=l("".replace),z=l([].shift),$=l("".split),N=l("".slice),D=l("".toLowerCase),J=l([].unshift),W="Invalid scheme",Q="Invalid host",G="Invalid port",K=/[a-z]/i,V=/[\d+\-.a-z]/i,X=/\d/,Y=/^0x/i,Z=/^[0-7]+$/,tt=/^\d+$/,et=/^[\da-f]+$/i,rt=/[\0\t\n\r #%/:<>?@[\\\]^|]/,nt=/[\0\t\n\r #/:<>?@[\\\]^|]/,ot=/^[\u0000-\u0020]+/,it=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,at=/[\t\n\r]/g,st=function(t){var e,r,n,o;if("number"==typeof t){for(e=[],r=0;r<4;r++)J(e,t%256),t=q(t/256);return C(e,".")}if("object"==typeof t){for(e="",n=function(t){for(var e=null,r=1,n=null,o=0,i=0;i<8;i++)0!==t[i]?(o>r&&(e=n,r=o),n=null,o=0):(null===n&&(n=i),++o);return o>r?n: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},ut={},lt=d({},ut,{" ":1,'"':1,"#":1,"<":1,">":1}),ht=d({},lt,{"'":1}),ct=d({},ut,{" ":1,'"':1,"<":1,">":1,"`":1}),ft=d({},ct,{"#":1,"?":1,"{":1,"}":1,"^":1}),pt=d({},ft,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),dt=function(t,e){var r=v(t,0);return r>=32&&r<127&&!p(e,t)?t:"'"===t&&p(e,t)?"%27":j(t)},mt={ftp:21,file:null,http:80,https:443,ws:80,wss:443},gt=function(t,e){var r;return 2===t.length&&F(K,A(t,0))&&(":"===(r=A(t,1))||!e&&"|"===r)},vt=function(t){var e;return t.length>1&>(N(t,0,2))&&(2===t.length||"/"===(e=A(t,2))||"\\"===e||"?"===e||"#"===e)},yt=function(t){return"."===t||"%2e"===D(t)},bt=function(t){return".."===(t=D(t))||"%2e."===t||".%2e"===t||"%2e%2e"===t},wt={},Pt={},St={},kt={},Rt={},Ut={},Bt={},Ht={},Lt={},Ot={},jt={},It={},qt={},Tt={},At={},Ft={},Ct={},_t={},Et={},Mt={},xt={},zt=function(t,e,r){var n,o,i,a=b(t);if(e){if(o=this.parse(a))throw new O(o);this.searchParams=null}else{if(void 0!==r&&(n=new zt(r,!0)),o=this.parse(a,null,n))throw new O(o);(i=H(new B)).bindURL(this),this.searchParams=i}};zt.prototype={type:"URL",parse:function(t,e,r){var o,i,a,s,u=this,l=e||wt,h=0,c="",f=!1,d=!1,v=!1;for(t=b(t),e||(u.scheme="",u.username="",u.password="",u.host=null,u.port=null,u.path=[],u.query=null,u.fragment=null,u.cannotBeABaseURL=!1,t=x(t,ot,""),t=x(t,it,"$1")),t=x(t,at,""),o=m(t);h<=o.length;){switch(i=o[h],l){case wt:if(!i||!F(K,i)){if(e)return W;l=St;continue}c+=D(i),l=Pt;break;case Pt:if(i&&F(V,i))c+=D(i);else{if(":"!==i){if(e)return W;c="",l=St,h=0;continue}if(e&&(u.isSpecial()!==p(mt,c)||"file"===c&&(u.includesCredentials()||null!==u.port)||"file"===u.scheme&&""===u.host))return;if(u.scheme=c,e)return void(u.isSpecial()&&mt[u.scheme]===u.port&&(u.port=null));c="","file"===u.scheme?l=Tt:u.isSpecial()&&r&&r.scheme===u.scheme?l=kt:u.isSpecial()?l=Ht:"/"===o[h+1]?(l=Rt,h++):(u.cannotBeABaseURL=!0,M(u.path,""),l=Et)}break;case St:if(!r||r.cannotBeABaseURL&&"#"!==i)return W;if(r.cannotBeABaseURL&&"#"===i){u.scheme=r.scheme,u.path=g(r.path),u.query=r.query,u.fragment="",u.cannotBeABaseURL=!0,l=xt;break}l="file"===r.scheme?Tt:Ut;continue;case kt:if("/"!==i||"/"!==o[h+1]){l=Ut;continue}l=Lt,h++;break;case Rt:if("/"===i){l=Ot;break}l=_t;continue;case Ut:if(u.scheme=r.scheme,i===n)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=g(r.path),u.query=r.query;else if("/"===i||"\\"===i&&u.isSpecial())l=Bt;else if("?"===i)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=g(r.path),u.query="",l=Mt;else{if("#"!==i){u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=g(r.path),u.path.length&&u.path.length--,l=_t;continue}u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=g(r.path),u.query=r.query,u.fragment="",l=xt}break;case Bt:if(!u.isSpecial()||"/"!==i&&"\\"!==i){if("/"!==i){u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,l=_t;continue}l=Ot}else l=Lt;break;case Ht:if(l=Lt,"/"!==i||"/"!==o[h+1])continue;h++;break;case Lt:if("/"!==i&&"\\"!==i){l=Ot;continue}break;case Ot:if("@"===i){f&&(c="%40"+c),f=!0,a=m(c);for(var y=0;y<a.length;y++){var w=a[y];if(":"!==w||v){var P=dt(w,pt);v?u.password+=P:u.username+=P}else v=!0}c=""}else if(i===n||"/"===i||"?"===i||"#"===i||"\\"===i&&u.isSpecial()){if(f&&""===c)return"Invalid authority";h-=m(c).length+1,c="",l=jt}else c+=i;break;case jt:case It:if(e&&"file"===u.scheme){l=Ft;continue}if(":"!==i||d){if(i===n||"/"===i||"?"===i||"#"===i||"\\"===i&&u.isSpecial()){if(u.isSpecial()&&""===c)return Q;if(e&&""===c&&(u.includesCredentials()||null!==u.port))return;if(s=u.parseHost(c))return s;if(c="",l=Ct,e)return;continue}"["===i?d=!0:"]"===i&&(d=!1),c+=i}else{if(""===c)return Q;if(e===It)return;if(s=u.parseHost(c))return s;c="",l=qt}break;case qt:if(!F(X,i)){if(i===n||"/"===i||"?"===i||"#"===i||"\\"===i&&u.isSpecial()||e){if(""!==c){var S=I(c,10);if(S>65535)return G;u.port=u.isSpecial()&&S===mt[u.scheme]?null:S,c=""}if(e)return;l=Ct;continue}return G}c+=i;break;case Tt:if(u.scheme="file",u.host="","/"===i||"\\"===i)l=At;else{if(!r||"file"!==r.scheme){l=_t;continue}switch(i){case n:u.host=r.host,u.path=g(r.path),u.query=r.query;break;case"?":u.host=r.host,u.path=g(r.path),u.query="",l=Mt;break;case"#":u.host=r.host,u.path=g(r.path),u.query=r.query,u.fragment="",l=xt;break;default:u.host=r.host,vt(C(g(o,h),""))||(u.path=g(r.path),u.shortenPath()),l=_t;continue}}break;case At:if("/"===i||"\\"===i){l=Ft;break}r&&"file"===r.scheme&&(u.host=r.host,!vt(C(g(o,h),""))&>(r.path[0],!0)&&M(u.path,r.path[0])),l=_t;continue;case Ft:if(i===n||"/"===i||"\\"===i||"?"===i||"#"===i){if(!e&>(c))l=_t;else if(""===c){if(u.host="",e)return;l=Ct}else{if(s=u.parseHost(c))return s;if("localhost"===u.host&&(u.host=""),e)return;c="",l=Ct}continue}c+=i;break;case Ct:if(u.isSpecial()){if(l=_t,"/"!==i&&"\\"!==i)continue}else if(e||"?"!==i)if(e||"#"!==i){if(i!==n&&(l=_t,"/"!==i))continue}else u.fragment="",l=xt;else u.query="",l=Mt;break;case _t:if(i===n||"/"===i||"\\"===i&&u.isSpecial()||!e&&("?"===i||"#"===i)){if(bt(c)?(u.shortenPath(),"/"===i||"\\"===i&&u.isSpecial()||M(u.path,"")):yt(c)?"/"===i||"\\"===i&&u.isSpecial()||M(u.path,""):("file"===u.scheme&&!u.path.length&>(c)&&(null!==u.host&&""!==u.host&&(u.host=""),c=A(c,0)+":"),M(u.path,c)),c="","file"===u.scheme&&(i===n||"?"===i||"#"===i))for(;u.path.length>1&&""===u.path[0];)z(u.path);"?"===i?(u.query="",l=Mt):"#"===i&&(u.fragment="",l=xt)}else c+=dt(i,ft);break;case Et:"?"===i?(u.query="",l=Mt):"#"===i?(u.fragment="",l=xt):i!==n&&(u.path[0]+=dt(i,ut));break;case Mt:e||"#"!==i?i!==n&&(u.query+=dt(i,u.isSpecial()?ht:lt)):(u.fragment="",l=xt);break;case xt:i!==n&&(u.fragment+=dt(i,ct))}h++}},parseHost:function(t){var e,r,n;if("["===A(t,0)){if("]"!==A(t,t.length-1))return Q;if(e=function(t){var e,r,n,o,i,a,s,u=[0,0,0,0,0,0,0,0],l=0,h=null,c=0,f=function(){return A(t,c)};if(":"===f()){if(":"!==A(t,1))return;c+=2,h=++l}for(;f();){if(8===l)return;if(":"!==f()){for(e=r=0;r<4&&F(et,f());)e=16*e+I(f(),16),c++,r++;if("."===f()){if(0===r)return;if(c-=r,l>6)return;for(n=0;f();){if(o=null,n>0){if(!("."===f()&&n<4))return;c++}if(!F(X,f()))return;for(;F(X,f());){if(i=I(f(),10),null===o)o=i;else{if(0===o)return;o=10*o+i}if(o>255)return;c++}u[l]=256*u[l]+o,2!==++n&&4!==n||l++}if(4!==n)return;break}if(":"===f()){if(c++,!f())return}else if(f())return;u[l++]=e}else{if(null!==h)return;c++,h=++l}}if(null!==h)for(a=l-h,l=7;0!==l&&a>0;)s=u[l],u[l--]=u[h+a-1],u[h+--a]=s;else if(8!==l)return;return u}(N(t,1,-1)),!e)return Q;this.host=e}else if(this.isSpecial()){if(t=y(t),F(rt,t))return Q;if(function(t){var e,r,n=$(t,".");if(""===n[n.length-1]){if(1===n.length)return!1;n.length--}return e=n[n.length-1],!!F(tt,e)||!!F(Y,e)&&(""===(r=N(e,2))||!!F(et,r))}(t)){if(e=function(t){var e,r,n,o,i,a,s,u=$(t,".");if(u.length&&""===u[u.length-1]&&u.length--,(e=u.length)>4)return null;for(r=[],n=0;n<e;n++){if(""===(o=u[n]))return null;if(i=10,o.length>1&&"0"===A(o,0)&&(i=F(Y,o)?16:8,o=N(o,8===i?1:2)),""===o)a=0;else{if(!F(10===i?tt:8===i?Z:et,o))return null;a=I(o,i)}M(r,a)}for(n=0;n<e;n++)if(a=r[n],n===e-1){if(a>=T(256,5-e))return null}else if(a>255)return null;for(s=E(r),n=0;n<r.length;n++)s+=r[n]*T(256,3-n);return s}(t),null===e)return Q;this.host=e}else this.host=t}else{if(F(nt,t))return Q;for(e="",r=m(t),n=0;n<r.length;n++)e+=dt(r[n],ut);this.host=e}},cannotHaveUsernamePasswordPort:function(){return null===this.host||""===this.host||this.cannotBeABaseURL||"file"===this.scheme},includesCredentials:function(){return""!==this.username||""!==this.password},isSpecial:function(){return p(mt,this.scheme)},shortenPath:function(){var t=this.path,e=t.length;!e||"file"===this.scheme&&1===e&>(t[0],!0)||t.length--},serialize:function(){var t=this,e=t.scheme,r=t.username,n=t.password,o=t.host,i=t.port,a=t.path,s=t.query,u=t.fragment,l=e+":";return null!==o?(l+="//",t.includesCredentials()&&(l+=r+(n?":"+n:"")+"@"),l+=st(o),null!==i&&(l+=":"+i)):"file"===e&&(l+="//"),null===o&&!t.cannotBeABaseURL&&a.length>1&&""===a[0]&&(l+="/."),l+=t.cannotBeABaseURL?a[0]:a.length?"/"+C(a,"/"):"",null!==s&&(l+="?"+s),null!==u&&(l+="#"+u),l},setHref:function(t){var e=this.parse(t);if(e)throw new O(e);this.searchParams.update()},getOrigin:function(){var t=this.scheme,e=this.port;if("blob"===t)try{return new $t(this.path[0]).origin}catch(t){return"null"}return"file"!==t&&this.isSpecial()?t+"://"+st(this.host)+(null!==e?":"+e:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(t){this.parse(b(t)+":",wt)},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+=dt(e[r],pt)}},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+=dt(e[r],pt)}},getHost:function(){var t=this.host,e=this.port;return null===t?"":null===e?st(t):st(t)+":"+e},setHost:function(t){this.cannotBeABaseURL||this.parse(t,jt)},getHostname:function(){var t=this.host;return null===t?"":st(t)},setHostname:function(t){this.cannotBeABaseURL||this.parse(t,It)},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,qt))},getPathname:function(){var t=this.path;return this.cannotBeABaseURL?t[0]:t.length?"/"+C(t,"/"):""},setPathname:function(t){this.cannotBeABaseURL||(this.path=[],this.parse(t,Ct))},getSearch:function(){var t=this.query;return t?"?"+t:""},setSearch:function(t){""===(t=b(t))?this.query=null:("?"===A(t,0)&&(t=N(t,1)),this.query="",this.parse(t,Mt)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var t=this.fragment;return t?"#"+t:""},setHash:function(t){""!==(t=b(t))?("#"===A(t,0)&&(t=N(t,1)),this.fragment="",this.parse(t,xt)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var $t=function(t){var e=f(this,Nt),r=P(arguments.length,1)>1?arguments[1]:void 0,n=R(e,new zt(t,!1,r));i||(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())},Nt=$t.prototype,Dt=function(t,e){return{get:function(){return U(this)[t]()},set:e&&function(t){return U(this)[e](t)},configurable:!0,enumerable:!0}};if(i&&(c(Nt,"href",Dt("serialize","setHref")),c(Nt,"origin",Dt("getOrigin")),c(Nt,"protocol",Dt("getProtocol","setProtocol")),c(Nt,"username",Dt("getUsername","setUsername")),c(Nt,"password",Dt("getPassword","setPassword")),c(Nt,"host",Dt("getHost","setHost")),c(Nt,"hostname",Dt("getHostname","setHostname")),c(Nt,"port",Dt("getPort","setPort")),c(Nt,"pathname",Dt("getPathname","setPathname")),c(Nt,"search",Dt("getSearch","setSearch")),c(Nt,"searchParams",Dt("getSearchParams")),c(Nt,"hash",Dt("getHash","setHash"))),h(Nt,"toJSON",function(){return U(this).serialize()},{enumerable:!0}),h(Nt,"toString",function(){return U(this).serialize()},{enumerable:!0}),L){var Jt=L.createObjectURL,Wt=L.revokeObjectURL;Jt&&h($t,"createObjectURL",u(Jt,L)),Wt&&h($t,"revokeObjectURL",u(Wt,L))}w($t,"URL"),o({global:!0,constructor:!0,forced:!a,sham:!i},{URL:$t})},3296:function(t,e,r){r(5806)},7208:function(t,e,r){var n=r(6518),o=r(9565);n({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return o(URL.prototype.toString,this)}})},5857:function(t,e,r){function n(t){return n="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},n(t)}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function i(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,a(n.key),n)}}function a(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}r(2675),r(9463),r(2259),r(5700),r(8706),r(3792),r(2712),r(9572),r(8130),r(3851),r(875),r(6099),r(825),r(888),r(7495),r(7764),r(5440),r(2953),r(8408),r(2008),r(113),r(3418),r(8598),r(2062),r(4782),r(2010),r(5506),r(3921),r(9432),r(8781),r(1761),r(5746),r(2762),r(3500),r(3296),r(7208);var s,u=function(){return t=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(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},e=[{key:"urlStateToUrlString",value:function(t){var e=this,r=new URLSearchParams,n={};Object.keys(t).forEach(function(o){var i,a,s,u,l=e.urlSchema.find(function(t){return t.name===o});null!==(i=l)&&void 0!==i&&i.deprecated_for&&(l=e.urlSchema.find(function(t){return t.name===l.deprecated_for})),"path"==(null===(a=l)||void 0===a?void 0:a.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(encodeURIComponent(n[t.name])):""}).join("/"),i="".concat(o.replace(/\/+/g,"/").replace(/\/+$/,"")),a="".concat(i,"?").concat(r.toString());return r.toString()?a:"".concat(i)}},{key:"urlStringToUrlState",value:function(t){var e={},r=new URL(t,"http://example.com"),n=Object.fromEntries(r.searchParams.entries()),i=r.pathname.match(/[^\\/]+\/[^\\/]+/g),a=i?Object.fromEntries(i.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(a,t.name),n=s(t,"deprecated_for")&&r;if(r||n){var o=n?t.deprecated_for:t.name;e[o]=decodeURIComponent(a[t.name])}}),Object.entries(n).forEach(function(t){var r=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return o(t,e);var r={}.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)?o(t,e):void 0}}(t,e)||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.")}()}(t,2),n=r[0],i=r[1];e[n]=i}),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,"/");try{window.history.replaceState({},null,r)}catch(t){this.urlMode="hash"}}else this.options.urlMode="hash";"hash"==this.urlMode&&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)}}],e&&i(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function l(t){return l="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},l(t)}function h(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,c(n.key),n)}}function c(t){var e=function(t){if("object"!=l(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=l(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==l(e)?e:e+""}function f(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(f=function(){return!!t})()}function p(){return p="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=d(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},p.apply(null,arguments)}function d(t){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},d(t)}function m(t,e){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},m(t,e)}r(1669).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=(s=BookReader.prototype.setup,function(t){s.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,n=t.paramsFromFragment(e),o=function(){return t.updateFromParams(n)};t.trigger(BookReader.eventNames.stop),t.animating?(null===(r=t.plugins.autoplay)||void 0===r||r.stop(),t.animationFinishedCallback=o):o(),t.oldUserHash=e}},500)},BookReader.prototype.urlUpdateFragment=function(){var t=this.paramsFromCurrent(),e=this.options,r=e.urlTrackIndex0,n=e.urlTrackedParams;r||void 0===t.index||0!==t.index||(delete t.index,delete t.page);var o=n.reduce(function(e,r){return r in t&&(e[r]=t[r]),e},{}),i=this.fragmentFromParams(o,this.options.urlMode),a=this.urlReadFragment(),s=this.getLocationSearch(),u=this.queryStringFromParams(o,s,this.options.urlMode);if(a!==i||s!==u){if("history"===this.options.urlMode)if(window.history&&window.history.replaceState){var l=this.options.urlHistoryBasePath.replace(/\/+$/,""),h=""===i?"":"/".concat(i),c="".concat(l).concat(h).concat(u);try{window.history.replaceState({},null,c),this.oldLocationHash=i+u}catch(t){this.options.urlMode="hash"}}else this.options.urlMode="hash";if("hash"===this.options.urlMode){var f=this.urlParamsFiltersOnlySearch(this.readQueryString());window.location.replace("#"+i+f),this.oldLocationHash=i+f}}},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(){function t(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),function(t,e,r){return e=d(e),function(t,e){if(e&&("object"==l(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)}(t,f()?Reflect.construct(e,r||[],d(t).constructor):e.apply(t,r))}(this,t,arguments)}return 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&&m(t,e)}(t,BookReader),e=t,r=[{key:"init",value:function(){var e,r,n,o=this;this.options.enableUrlPlugin&&(this.urlPlugin=new u(this.options),this.bind(BookReader.eventNames.PostInit,function(){"hash"===o.options.urlMode&&o.urlPlugin.listenForHashChanges()})),(e=t,r=this,"function"==typeof(n=p(d(1&3?e.prototype:e),"init",r))?function(t){return n.apply(r,t)}:n)([])}}],r&&h(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();window.BookReader=g}},function(t){t(t.s=5857)}]);
|
|
1
|
+
/*! For license information please see plugin.url.js.LICENSE.txt */
|
|
2
|
+
"use strict";(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[479],{6098:function(t,e,r){var n=r(9504),o=2147483647,i=/[^\0-\u007E]/,a=/[.\u3002\uFF0E\uFF61]/g,s="Overflow: input needs wider integers to process",u=RangeError,l=n(a.exec),c=Math.floor,h=String.fromCharCode,f=n("".charCodeAt),p=n([].join),d=n([].push),m=n("".replace),g=n("".split),v=n("".toLowerCase),y=function(t){return t+22+75*(t<26)},b=function(t,e,r){var n=0;for(t=r?c(t/700):t>>1,t+=c(t/e);t>455;)t=c(t/35),n+=36;return c(n+36*t/(t+38))},w=function(t){var e=[];t=function(t){for(var e=[],r=0,n=t.length;r<n;){var o=f(t,r++);if(o>=55296&&o<=56319&&r<n){var i=f(t,r++);56320==(64512&i)?d(e,((1023&o)<<10)+(1023&i)+65536):(d(e,o),r--)}else d(e,o)}return e}(t);var r,n,i=t.length,a=128,l=0,m=72;for(r=0;r<t.length;r++)(n=t[r])<128&&d(e,h(n));var g=e.length,v=g;for(g&&d(e,"-");v<i;){var w=o;for(r=0;r<t.length;r++)(n=t[r])>=a&&n<w&&(w=n);var P=v+1;if(w-a>c((o-l)/P))throw new u(s);for(l+=(w-a)*P,a=w,r=0;r<t.length;r++){if((n=t[r])<a&&++l>o)throw new u(s);if(n===a){for(var S=l,k=36;;){var R=k<=m?1:k>=m+26?26:k-m;if(S<R)break;var U=S-R,O=36-R;d(e,h(y(R+U%O))),S=c(U/O),k+=36}d(e,h(y(S))),m=b(l,P,v===g),l=0,v++}}l++,a++}return p(e,"")};t.exports=function(t){var e,r,n=[],o=g(m(v(t),a,"."),".");for(e=0;e<o.length;e++)r=o[e],d(n,l(i,r)?"xn--"+w(r):r);return p(n,".")}},706:function(t,e,r){var n=r(350).PROPER,o=r(9039),i=r(7452);t.exports=function(t){return o(function(){return!!i[t]()||"
"!=="
"[t]()||n&&i[t].name!==t})}},3921:function(t,e,r){var n=r(6518),o=r(2652),i=r(4659);n({target:"Object",stat:!0},{fromEntries:function(t){var e={};return o(t,function(t,r){i(e,t,r)},{AS_ENTRIES:!0}),e}})},2762:function(t,e,r){var n=r(6518),o=r(3802).trim;n({target:"String",proto:!0,forced:r(706)("trim")},{trim:function(){return o(this)}})},5806:function(t,e,r){r(7764);var n,o=r(6518),i=r(3724),a=r(7416),s=r(4576),u=r(6080),l=r(9504),c=r(6840),h=r(2106),f=r(679),p=r(9297),d=r(4213),m=r(7916),g=r(7680),v=r(8183).codeAt,y=r(6098),b=r(655),w=r(687),P=r(2812),S=r(8406),k=r(1181),R=k.set,U=k.getterFor("URL"),O=S.URLSearchParams,B=S.getState,H=s.URL,L=s.TypeError,j=s.encodeURIComponent,F=s.parseInt,x=Math.floor,T=Math.pow,I=l("".charAt),q=l(/./.exec),_=l([].join),A=l(1.1.toString),E=l([].pop),C=l([].push),M=l("".replace),z=l([].shift),N=l("".split),$=l("".slice),G=l("".toLowerCase),D=l([].unshift),J="Invalid scheme",Q="Invalid host",W="Invalid port",V=/[a-z]/i,K=/[\d+\-.a-z]/i,X=/\d/,Y=/^0x/i,Z=/^[0-7]+$/,tt=/^\d+$/,et=/^[\da-f]+$/i,rt=/[\0\t\n\r #%/:<>?@[\\\]^|]/,nt=/[\0\t\n\r #/:<>?@[\\\]^|]/,ot=/^[\u0000-\u0020]+/,it=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,at=/[\t\n\r]/g,st=function(t){var e,r,n,o;if("number"==typeof t){for(e=[],r=0;r<4;r++)D(e,t%256),t=x(t/256);return _(e,".")}if("object"==typeof t){for(e="",n=function(t){for(var e=null,r=1,n=null,o=0,i=0;i<8;i++)0!==t[i]?(o>r&&(e=n,r=o),n=null,o=0):(null===n&&(n=i),++o);return o>r?n:e}(t),r=0;r<8;r++)o&&0===t[r]||(o&&(o=!1),n===r?(e+=r?":":"::",o=!0):(e+=A(t[r],16),r<7&&(e+=":")));return"["+e+"]"}return t},ut={},lt=d({},ut,{" ":1,'"':1,"#":1,"<":1,">":1}),ct=d({},lt,{"'":1}),ht=d({},ut,{" ":1,'"':1,"<":1,">":1,"`":1}),ft=d({},ht,{"#":1,"?":1,"{":1,"}":1,"^":1}),pt=d({},ft,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),dt=function(t,e){var r=v(t,0);return r>=32&&r<127&&!p(e,t)?t:"'"===t&&p(e,t)?"%27":j(t)},mt={ftp:21,file:null,http:80,https:443,ws:80,wss:443},gt=function(t,e){var r;return 2===t.length&&q(V,I(t,0))&&(":"===(r=I(t,1))||!e&&"|"===r)},vt=function(t){var e;return t.length>1&>($(t,0,2))&&(2===t.length||"/"===(e=I(t,2))||"\\"===e||"?"===e||"#"===e)},yt=function(t){return"."===t||"%2e"===G(t)},bt=function(t){return".."===(t=G(t))||"%2e."===t||".%2e"===t||"%2e%2e"===t},wt={},Pt={},St={},kt={},Rt={},Ut={},Ot={},Bt={},Ht={},Lt={},jt={},Ft={},xt={},Tt={},It={},qt={},_t={},At={},Et={},Ct={},Mt={},zt=function(t,e,r){var n,o,i,a=b(t);if(e){if(o=this.parse(a))throw new L(o);this.searchParams=null}else{if(void 0!==r&&(n=new zt(r,!0)),o=this.parse(a,null,n))throw new L(o);(i=B(new O)).bindURL(this),this.searchParams=i}};zt.prototype={type:"URL",parse:function(t,e,r){var o,i,a,s,u=this,l=e||wt,c=0,h="",f=!1,d=!1,v=!1;for(t=b(t),e||(u.scheme="",u.username="",u.password="",u.host=null,u.port=null,u.path=[],u.query=null,u.fragment=null,u.cannotBeABaseURL=!1,t=M(t,ot,""),t=M(t,it,"$1")),t=M(t,at,""),o=m(t);c<=o.length;){switch(i=o[c],l){case wt:if(!i||!q(V,i)){if(e)return J;l=St;continue}h+=G(i),l=Pt;break;case Pt:if(i&&q(K,i))h+=G(i);else{if(":"!==i){if(e)return J;h="",l=St,c=0;continue}if(e&&(u.isSpecial()!==p(mt,h)||"file"===h&&(u.includesCredentials()||null!==u.port)||"file"===u.scheme&&""===u.host))return;if(u.scheme=h,e)return void(u.isSpecial()&&mt[u.scheme]===u.port&&(u.port=null));h="","file"===u.scheme?l=Tt:u.isSpecial()&&r&&r.scheme===u.scheme?l=kt:u.isSpecial()?l=Bt:"/"===o[c+1]?(l=Rt,c++):(u.cannotBeABaseURL=!0,C(u.path,""),l=Et)}break;case St:if(!r||r.cannotBeABaseURL&&"#"!==i)return J;if(r.cannotBeABaseURL&&"#"===i){u.scheme=r.scheme,u.path=g(r.path),u.query=r.query,u.fragment="",u.cannotBeABaseURL=!0,l=Mt;break}l="file"===r.scheme?Tt:Ut;continue;case kt:if("/"!==i||"/"!==o[c+1]){l=Ut;continue}l=Ht,c++;break;case Rt:if("/"===i){l=Lt;break}l=At;continue;case Ut:if(u.scheme=r.scheme,i===n)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=g(r.path),u.query=r.query;else if("/"===i||"\\"===i&&u.isSpecial())l=Ot;else if("?"===i)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=g(r.path),u.query="",l=Ct;else{if("#"!==i){u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=g(r.path),u.path.length&&u.path.length--,l=At;continue}u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=g(r.path),u.query=r.query,u.fragment="",l=Mt}break;case Ot:if(!u.isSpecial()||"/"!==i&&"\\"!==i){if("/"!==i){u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,l=At;continue}l=Lt}else l=Ht;break;case Bt:if(l=Ht,"/"!==i||"/"!==o[c+1])continue;c++;break;case Ht:if("/"!==i&&"\\"!==i){l=Lt;continue}break;case Lt:if("@"===i){f&&(h="%40"+h),f=!0,a=m(h);for(var y=0;y<a.length;y++){var w=a[y];if(":"!==w||v){var P=dt(w,pt);v?u.password+=P:u.username+=P}else v=!0}h=""}else if(i===n||"/"===i||"?"===i||"#"===i||"\\"===i&&u.isSpecial()){if(f&&""===h)return"Invalid authority";c-=m(h).length+1,h="",l=jt}else h+=i;break;case jt:case Ft:if(e&&"file"===u.scheme){l=qt;continue}if(":"!==i||d){if(i===n||"/"===i||"?"===i||"#"===i||"\\"===i&&u.isSpecial()){if(u.isSpecial()&&""===h)return Q;if(e&&""===h&&(u.includesCredentials()||null!==u.port))return;if(s=u.parseHost(h))return s;if(h="",l=_t,e)return;continue}"["===i?d=!0:"]"===i&&(d=!1),h+=i}else{if(""===h)return Q;if(e===Ft)return;if(s=u.parseHost(h))return s;h="",l=xt}break;case xt:if(!q(X,i)){if(i===n||"/"===i||"?"===i||"#"===i||"\\"===i&&u.isSpecial()||e){if(""!==h){var S=F(h,10);if(S>65535)return W;u.port=u.isSpecial()&&S===mt[u.scheme]?null:S,h=""}if(e)return;l=_t;continue}return W}h+=i;break;case Tt:if(u.scheme="file",u.host="","/"===i||"\\"===i)l=It;else{if(!r||"file"!==r.scheme){l=At;continue}switch(i){case n:u.host=r.host,u.path=g(r.path),u.query=r.query;break;case"?":u.host=r.host,u.path=g(r.path),u.query="",l=Ct;break;case"#":u.host=r.host,u.path=g(r.path),u.query=r.query,u.fragment="",l=Mt;break;default:u.host=r.host,vt(_(g(o,c),""))||(u.path=g(r.path),u.shortenPath()),l=At;continue}}break;case It:if("/"===i||"\\"===i){l=qt;break}r&&"file"===r.scheme&&(u.host=r.host,!vt(_(g(o,c),""))&>(r.path[0],!0)&&C(u.path,r.path[0])),l=At;continue;case qt:if(i===n||"/"===i||"\\"===i||"?"===i||"#"===i){if(!e&>(h))l=At;else if(""===h){if(u.host="",e)return;l=_t}else{if(s=u.parseHost(h))return s;if("localhost"===u.host&&(u.host=""),e)return;h="",l=_t}continue}h+=i;break;case _t:if(u.isSpecial()){if(l=At,"/"!==i&&"\\"!==i)continue}else if(e||"?"!==i)if(e||"#"!==i){if(i!==n&&(l=At,"/"!==i))continue}else u.fragment="",l=Mt;else u.query="",l=Ct;break;case At:if(i===n||"/"===i||"\\"===i&&u.isSpecial()||!e&&("?"===i||"#"===i)){if(bt(h)?(u.shortenPath(),"/"===i||"\\"===i&&u.isSpecial()||C(u.path,"")):yt(h)?"/"===i||"\\"===i&&u.isSpecial()||C(u.path,""):("file"===u.scheme&&!u.path.length&>(h)&&(null!==u.host&&""!==u.host&&(u.host=""),h=I(h,0)+":"),C(u.path,h)),h="","file"===u.scheme&&(i===n||"?"===i||"#"===i))for(;u.path.length>1&&""===u.path[0];)z(u.path);"?"===i?(u.query="",l=Ct):"#"===i&&(u.fragment="",l=Mt)}else h+=dt(i,ft);break;case Et:"?"===i?(u.query="",l=Ct):"#"===i?(u.fragment="",l=Mt):i!==n&&(u.path[0]+=dt(i,ut));break;case Ct:e||"#"!==i?i!==n&&(u.query+=dt(i,u.isSpecial()?ct:lt)):(u.fragment="",l=Mt);break;case Mt:i!==n&&(u.fragment+=dt(i,ht))}c++}},parseHost:function(t){var e,r,n;if("["===I(t,0)){if("]"!==I(t,t.length-1))return Q;if(e=function(t){var e,r,n,o,i,a,s,u=[0,0,0,0,0,0,0,0],l=0,c=null,h=0,f=function(){return I(t,h)};if(":"===f()){if(":"!==I(t,1))return;h+=2,c=++l}for(;f();){if(8===l)return;if(":"!==f()){for(e=r=0;r<4&&q(et,f());)e=16*e+F(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(X,f()))return;for(;q(X,f());){if(i=F(f(),10),null===o)o=i;else{if(0===o)return;o=10*o+i}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(a=l-c,l=7;0!==l&&a>0;)s=u[l],u[l--]=u[c+a-1],u[c+--a]=s;else if(8!==l)return;return u}($(t,1,-1)),!e)return Q;this.host=e}else if(this.isSpecial()){if(t=y(t),q(rt,t))return Q;if(function(t){var e,r,n=N(t,".");if(""===n[n.length-1]){if(1===n.length)return!1;n.length--}return e=n[n.length-1],!!q(tt,e)||!!q(Y,e)&&(""===(r=$(e,2))||!!q(et,r))}(t)){if(e=function(t){var e,r,n,o,i,a,s,u=N(t,".");if(u.length&&""===u[u.length-1]&&u.length--,(e=u.length)>4)return null;for(r=[],n=0;n<e;n++){if(""===(o=u[n]))return null;if(i=10,o.length>1&&"0"===I(o,0)&&(i=q(Y,o)?16:8,o=$(o,8===i?1:2)),""===o)a=0;else{if(!q(10===i?tt:8===i?Z:et,o))return null;a=F(o,i)}C(r,a)}for(n=0;n<e;n++)if(a=r[n],n===e-1){if(a>=T(256,5-e))return null}else if(a>255)return null;for(s=E(r),n=0;n<r.length;n++)s+=r[n]*T(256,3-n);return s}(t),null===e)return Q;this.host=e}else this.host=t}else{if(q(nt,t))return Q;for(e="",r=m(t),n=0;n<r.length;n++)e+=dt(r[n],ut);this.host=e}},cannotHaveUsernamePasswordPort:function(){return null===this.host||""===this.host||this.cannotBeABaseURL||"file"===this.scheme},includesCredentials:function(){return""!==this.username||""!==this.password},isSpecial:function(){return p(mt,this.scheme)},shortenPath:function(){var t=this.path,e=t.length;!e||"file"===this.scheme&&1===e&>(t[0],!0)||t.length--},serialize:function(){var t=this,e=t.scheme,r=t.username,n=t.password,o=t.host,i=t.port,a=t.path,s=t.query,u=t.fragment,l=e+":";return null!==o?(l+="//",t.includesCredentials()&&(l+=r+(n?":"+n:"")+"@"),l+=st(o),null!==i&&(l+=":"+i)):"file"===e&&(l+="//"),null===o&&!t.cannotBeABaseURL&&a.length>1&&""===a[0]&&(l+="/."),l+=t.cannotBeABaseURL?a[0]:a.length?"/"+_(a,"/"):"",null!==s&&(l+="?"+s),null!==u&&(l+="#"+u),l},setHref:function(t){var e=this.parse(t);if(e)throw new L(e);this.searchParams.update()},getOrigin:function(){var t=this.scheme,e=this.port;if("blob"===t)try{return new Nt(this.path[0]).origin}catch(t){return"null"}return"file"!==t&&this.isSpecial()?t+"://"+st(this.host)+(null!==e?":"+e:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(t){this.parse(b(t)+":",wt)},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+=dt(e[r],pt)}},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+=dt(e[r],pt)}},getHost:function(){var t=this.host,e=this.port;return null===t?"":null===e?st(t):st(t)+":"+e},setHost:function(t){this.cannotBeABaseURL||this.parse(t,jt)},getHostname:function(){var t=this.host;return null===t?"":st(t)},setHostname:function(t){this.cannotBeABaseURL||this.parse(t,Ft)},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,xt))},getPathname:function(){var t=this.path;return this.cannotBeABaseURL?t[0]:t.length?"/"+_(t,"/"):""},setPathname:function(t){this.cannotBeABaseURL||(this.path=[],this.parse(t,_t))},getSearch:function(){var t=this.query;return t?"?"+t:""},setSearch:function(t){""===(t=b(t))?this.query=null:("?"===I(t,0)&&(t=$(t,1)),this.query="",this.parse(t,Ct)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var t=this.fragment;return t?"#"+t:""},setHash:function(t){""!==(t=b(t))?("#"===I(t,0)&&(t=$(t,1)),this.fragment="",this.parse(t,Mt)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var Nt=function(t){var e=f(this,$t),r=P(arguments.length,1)>1?arguments[1]:void 0,n=R(e,new zt(t,!1,r));i||(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())},$t=Nt.prototype,Gt=function(t,e){return{get:function(){return U(this)[t]()},set:e&&function(t){return U(this)[e](t)},configurable:!0,enumerable:!0}};if(i&&(h($t,"href",Gt("serialize","setHref")),h($t,"origin",Gt("getOrigin")),h($t,"protocol",Gt("getProtocol","setProtocol")),h($t,"username",Gt("getUsername","setUsername")),h($t,"password",Gt("getPassword","setPassword")),h($t,"host",Gt("getHost","setHost")),h($t,"hostname",Gt("getHostname","setHostname")),h($t,"port",Gt("getPort","setPort")),h($t,"pathname",Gt("getPathname","setPathname")),h($t,"search",Gt("getSearch","setSearch")),h($t,"searchParams",Gt("getSearchParams")),h($t,"hash",Gt("getHash","setHash"))),c($t,"toJSON",function(){return U(this).serialize()},{enumerable:!0}),c($t,"toString",function(){return U(this).serialize()},{enumerable:!0}),H){var Dt=H.createObjectURL,Jt=H.revokeObjectURL;Dt&&c(Nt,"createObjectURL",u(Dt,H)),Jt&&c(Nt,"revokeObjectURL",u(Jt,H))}w(Nt,"URL"),o({global:!0,constructor:!0,forced:!a,sham:!i},{URL:Nt})},3296:function(t,e,r){r(5806)},7208:function(t,e,r){var n=r(6518),o=r(9565);n({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return o(URL.prototype.toString,this)}})},5857:function(t,e,r){function n(t){return n="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},n(t)}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function i(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,a(n.key),n)}}function a(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}r(2675),r(9463),r(2259),r(5700),r(8706),r(4423),r(3792),r(2712),r(9572),r(8130),r(3851),r(875),r(6099),r(3362),r(825),r(888),r(7495),r(1699),r(7764),r(5440),r(2953),r(8408),r(2008),r(113),r(3418),r(8598),r(2062),r(4782),r(2010),r(5506),r(3921),r(9432),r(8781),r(1761),r(5746),r(2762),r(3500),r(3296),r(7208);var s,u=function(){return t=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(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},e=[{key:"urlStateToUrlString",value:function(t){var e=this,r=new URLSearchParams,n={};Object.keys(t).forEach(function(o){var i,a,s,u,l=e.urlSchema.find(function(t){return t.name===o});null!==(i=l)&&void 0!==i&&i.deprecated_for&&(l=e.urlSchema.find(function(t){return t.name===l.deprecated_for})),"path"==(null===(a=l)||void 0===a?void 0:a.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(encodeURIComponent(n[t.name])):""}).join("/"),i="".concat(o.replace(/\/+/g,"/").replace(/\/+$/,"")),a="".concat(i,"?").concat(r.toString());return r.toString()?a:"".concat(i)}},{key:"urlStringToUrlState",value:function(t){var e={},r=new URL(t,"http://example.com"),n=Object.fromEntries(r.searchParams.entries()),i=r.pathname.match(/[^\\/]+\/[^\\/]+/g),a=i?Object.fromEntries(i.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(a,t.name),n=s(t,"deprecated_for")&&r;if(r||n){var o=n?t.deprecated_for:t.name;e[o]=decodeURIComponent(a[t.name])}}),Object.entries(n).forEach(function(t){var r=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return o(t,e);var r={}.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)?o(t,e):void 0}}(t,e)||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.")}()}(t,2),n=r[0],i=r[1];e[n]=i}),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,"/");try{window.history.replaceState({},null,r)}catch(t){this.urlMode="hash"}}else this.options.urlMode="hash";"hash"==this.urlMode&&window.location.replace("#"+e),this.oldLocationHash=t}},{key:"listenForHashChanges",value:function(){var t=this;this.oldLocationHash=this.getHash(),this.urlLocationPollId&&(clearInterval(this.urlLocationPollId),this.urlLocationPollId=null),this.urlLocationPollId=setInterval(function(){var e=t.getHash();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)}},{key:"getHash",value:function(){var t=this.retrieveTextFragment(window.location.search),e=t?":~:text=".concat(t[0]):"";return"".concat(window.location.hash.slice(1)).concat(e)}},{key:"retrieveTextFragment",value:function(t){return t.match(/(?<=[&?]?text=)[^&]*/)}}],e&&i(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}(),l=r(8004);function c(t){return c="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},c(t)}function h(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,l=Object.create(u.prototype);return f(l,"_invoke",function(r,n,o){var i,s,u,l=0,c=o||[],h=!1,f={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return i=e,s=0,u=t,f.n=r,a}};function p(r,n){for(s=r,u=n,e=0;!h&&l&&!o&&e<c.length;e++){var o,i=c[e],p=f.p,d=i[2];r>3?(o=d===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=r<2&&p<i[1])?(s=0,f.v=n,f.n=i[1]):p<d&&(o=r<3||i[0]>n||n>d)&&(i[4]=r,i[5]=n,f.n=d,s=0))}if(o||r>1)return a;throw h=!0,n}return function(o,c,d){if(l>1)throw TypeError("Generator is already running");for(h&&1===c&&p(c,d),s=c,u=d;(e=s<2?t:u)||!h;){i||(s?s<3?(s>1&&(f.n=-1),p(s,u)):f.n=u:f.v=u);try{if(l=2,i){if(s||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,s<2&&(s=0)}else 1===s&&(e=i.return)&&e.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((e=(h=f.n<0)?u:r.call(n,f))!==a)break}catch(e){i=t,s=1,u=e}finally{l=1}}return{value:e,done:h}}}(r,o,i),!0),l}var a={};function s(){}function u(){}function l(){}e=Object.getPrototypeOf;var c=[][n]?e(e([][n]())):(f(e={},n,function(){return this}),e),p=l.prototype=s.prototype=Object.create(c);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,f(t,o,"GeneratorFunction")),t.prototype=Object.create(p),t}return u.prototype=l,f(p,"constructor",l),f(l,"constructor",u),u.displayName="GeneratorFunction",f(l,o,"GeneratorFunction"),f(p),f(p,o,"Generator"),f(p,n,function(){return this}),f(p,"toString",function(){return"[object Generator]"}),(h=function(){return{w:i,m:d}})()}function f(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}f=function(t,e,r,n){function i(e,r){f(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},f(t,e,r,n)}function p(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function d(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,m(n.key),n)}}function m(t){var e=function(t){if("object"!=c(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==c(e)?e:e+""}function g(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(g=function(){return!!t})()}function v(){return v="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=y(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},v.apply(null,arguments)}function y(t){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},y(t)}function b(t,e){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},b(t,e)}r(1669).extend(BookReader.defaultOptions,{enableUrlPlugin:!0,bookId:"",defaults:null,updateWindowTitle:!1,urlMode:"hash",urlHistoryBasePath:"/",urlTrackedParams:["page","search","mode","region","highlight","view","text"],urlTrackIndex0:!1}),BookReader.prototype.setup=(s=BookReader.prototype.setup,function(t){s.call(this,t),this.bookId=t.bookId,this.defaults=t.defaults,this.locationPollId=null,this.oldLocationHash=null,this.oldUserHash=null,this.textFragment=null,this.textFragmentPage=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,n=t.paramsFromFragment(e),o=function(){return t.updateFromParams(n)};t.trigger(BookReader.eventNames.stop),t.animating?(null===(r=t.plugins.autoplay)||void 0===r||r.stop(),t.animationFinishedCallback=o):o(),t.oldUserHash=e}},500)},BookReader.prototype.urlUpdateFragment=function(){var t=this.paramsFromCurrent(),e=this.options,r=e.urlTrackIndex0,n=e.urlTrackedParams;r||void 0===t.index||0!==t.index||(delete t.index,delete t.page);var o=n.reduce(function(e,r){return r in t&&(e[r]=t[r]),e},{}),i=this.fragmentFromParams(o,this.options.urlMode),a=""===i?"":"/".concat(i),s=this.urlReadFragment(),u=this.getLocationSearch(),l=this.queryStringFromParams(o,u,this.options.urlMode),c=this.urlPlugin.retrieveTextFragment(u);if(s!==i||u!==l||c){if("history"===this.options.urlMode)if(window.history&&window.history.replaceState){var h,f=this.options.urlHistoryBasePath.replace(/\/+$/,""),p=this.urlPlugin.retrieveTextFragment(l),d="".concat(f).concat(a).concat(l),m=null===(h=this.urlPlugin.urlStringToUrlState(a))||void 0===h?void 0:h.page;!this.textFragmentPage&&p&&(this.textFragmentPage=m||null,this.textFragment=":~:text=".concat(p));try{window.history.replaceState({},null,d),this.oldLocationHash=i+l,p&&(this.oldLocationHash+=":~:text=".concat(p[0]))}catch(t){this.options.urlMode="hash"}}else this.options.urlMode="hash";if("hash"===this.options.urlMode){var g,v=this.urlParamsFiltersOnlySearch(this.readQueryString()),y=this.urlPlugin.retrieveTextFragment(this.readQueryString()),b=null===(g=this.urlPlugin.urlStringToUrlState(a))||void 0===g?void 0:g.page;y=y?":~:text=".concat(y[0]):"",!this.textFragmentPage&&y?(this.textFragmentPage=b||null,this.textFragment=y):this.textFragmentPage&&b!=this.textFragmentPage&&(y=""),window.location.replace("#"+i+v+y),this.oldLocationHash=i+v+y}}},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):this.urlPlugin.getHash()},BookReader.prototype.urlReadHashFragment=function(){return window.location.hash.substr(1)};var w=function(){function t(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),function(t,e,r){return e=y(e),function(t,e){if(e&&("object"==c(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)}(t,g()?Reflect.construct(e,r||[],y(t).constructor):e.apply(t,r))}(this,t,arguments)}return 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&&b(t,e)}(t,BookReader),e=t,r=[{key:"init",value:function(){var e,r,n,o=this;this.options.enableUrlPlugin&&(this.urlPlugin=new u(this.options),this.getLocationSearch().includes("text=")&&this.on("textLayerVisible",function(){var t,e=(t=h().m(function t(e,r){var n,i;return h().w(function(t){for(;;)switch(t.n){case 0:return n=r.pageContainerEl,i=n.getAttribute("data-page-num"),t.n=1,(0,l.sleep)(1===o.mode?900:100);case 1:if(o.textFragment&&o.textFragmentPage===i){t.n=2;break}return t.a(2);case 2:"history"===o.options.urlMode?window.location.replace("#".concat(o.textFragment)):window.location.replace("#".concat(o.oldLocationHash));case 3:return t.a(2)}},t)}),function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){p(i,n,o,a,s,"next",t)}function s(t){p(i,n,o,a,s,"throw",t)}a(void 0)})});return function(t,r){return e.apply(this,arguments)}}()),this.bind(BookReader.eventNames.PostInit,function(){"hash"===o.options.urlMode&&o.urlPlugin.listenForHashChanges()})),(e=t,r=this,"function"==typeof(n=v(y(1&3?e.prototype:e),"init",r))?function(t){return n.apply(r,t)}:n)([])}}],r&&d(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();window.BookReader=w}},function(t){t(t.s=5857)}]);
|
|
2
3
|
//# sourceMappingURL=plugin.url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|