@internetarchive/bookreader
Advanced tools
Comparing version 4.17.0-alpha.e3dcd28 to 4.17.0
@@ -1,2 +0,2 @@ | ||
(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[73],{2728:function(e,t,r){"use strict";function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r(2222),r(2526),r(9826),r(1817),r(9554),r(2165),r(2772),r(9600),r(1249),r(4603),r(1038),r(4916),r(6992),r(9714),r(4986),r(5306),r(5827),r(4765),r(7042),r(4747),r(5212),r(8309),r(1539),r(8674),r(8783),r(3948),r(285),r(5666);var a,o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.selector?(this.br=t.br,this.matcher=new RegExp("{{{(.+?)}}}","g"),this.matches=[],this.cacheDOMElements(t.selector),this.bindEvents(),this.br.options.initialSearchTerm&&this.setQuery(t.query)):console.warn("BookReader::Search - SearchView must be passed a valid CSS selector")}var t,r;return t=e,(r=[{key:"cacheDOMElements",value:function(e){this.dom={},this.dom.searchTray=this.renderSearchTray(e),this.dom.results=this.dom.searchTray.querySelector('[data-id="results"]'),this.dom.resultsCount=this.dom.searchTray.querySelector('[data-id="results_count"]'),this.dom.searchField=this.dom.searchTray.querySelector('[name="query"]'),this.dom.searchPending=this.dom.searchTray.querySelector('[data-id="searchPending"]'),this.dom.mobileSearch=this.buildMobileDrawer(),this.dom.toolbarSearch=this.buildToolbarSearch()}},{key:"toggleSearchTray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dom.searchTray.classList.contains("hidden");this.dom.searchTray.classList.toggle("hidden",!e)}},{key:"toggleResultsCount",value:function(e){this.dom.resultsCount.classList.toggle("visible",e)}},{key:"updateResultsCount",value:function(e){this.dom.resultsCount.innerText="(".concat(e," result").concat(1!=e?"s":"",")"),this.toggleResultsCount(!0)}},{key:"setQuery",value:function(e){this.dom.searchField.value=e}},{key:"emptyMatches",value:function(){this.dom.results.innerHTML=""}},{key:"removeResultPins",value:function(){this.br.$(".BRnavpos .BRsearch").remove()}},{key:"clearSearchFieldAndResults",value:function(){this.toggleResultsCount(!1),this.removeResultPins(),this.emptyMatches(),this.setQuery(""),this.teardownSearchNavigation()}},{key:"renderSearchTray",value:function(e){var t=document.createElement("div");return t.setAttribute("id",e.replace(/^#/,"")),t.innerHTML='\n <header>\n <div>\n <h3>Search inside</h3>\n <p data-id="results_count"></p>\n </div>\n <a href="#" class="close"></a>\n </header>\n <form action="" method="get">\n <fieldset>\n <input name="all_files" id="all_files" type="checkbox" />\n <label class="checkbox" for="all_files">Search all files</label>\n <input type="search" name="query" placeholder="Enter a search term" />\n </fieldset>\n </form>\n <div data-id="searchPending" id="search_pending">\n <p>Your search results will appear below</p>\n <div class="loader tc mt20"></div>\n </div>\n <ul data-id="results"></ul>\n ',t}},{key:"renderSearchNavigation",value:function(){var e="BRsearch-navigation";$(".BRnav").before('\n <div class="'.concat(e,'">\n <h4>\n <span class="icon icon-search"></span>\n Results\n </h4>\n <div class="pagination">\n <a href="#" class="prev" title="Previous result"><span class="icon icon-chevron hflip"></span></a>\n <span data-id="resultsCount">').concat(this.resultsPosition(),'</span>\n <a href="#" class="next" title="Next result"><span class="icon icon-chevron"></a>\n </div>\n <a href="#" class="clear" title="Clear search results">\n <span class="icon icon-close"></span>\n </a>\n </div>\n ')),this.dom.searchNavigation=$(".".concat(e))}},{key:"resultsPosition",value:function(){var e="".concat(this.matches.length," result").concat(1===this.matches.length?"":"s");return~this.currentMatchIndex&&(e="".concat(this.currentMatchIndex+1," / ").concat(this.matches.length)),e}},{key:"bindSearchNavigationEvents",value:function(){if(this.dom.searchNavigation){var e="searchNavigation";this.dom.searchNavigation.on("click.".concat(e),".clear",this.clearSearchFieldAndResults.bind(this)).on("click.".concat(e),".prev",this.showPrevResult.bind(this)).on("click.".concat(e),".next",this.showNextResult.bind(this)).on("click.".concat(e),!1)}}},{key:"showPrevResult",value:function(){0!==this.currentMatchIndex&&(this.br.mode===this.br.constModeThumb&&this.br.switchMode(this.br.constMode1up),~this.currentMatchIndex||(this.currentMatchIndex=1),this.br.$(".BRnavline .BRsearch").eq(--this.currentMatchIndex).click(),this.updateResultsPosition())}},{key:"showNextResult",value:function(){this.currentMatchIndex+1!==this.matches.length&&(this.br.mode===this.br.constModeThumb&&this.br.switchMode(this.br.constMode1up),this.br.$(".BRnavline .BRsearch").eq(++this.currentMatchIndex).click(),this.updateResultsPosition())}},{key:"updateResultsPosition",value:function(){this.dom.searchNavigation.find("[data-id=resultsCount]").text(this.resultsPosition())}},{key:"teardownSearchNavigation",value:function(){this.dom.searchNavigation&&(this.dom.searchNavigation.off(".searchNavigation").remove(),this.dom.searchNavigation=null)}},{key:"setCurrentMatchIndex",value:function(){var e;this.br.mode!==this.br.constModeThumb?(e=this.br.mode===this.br.constMode2up?this.find2upMatchingSearchResult():this.find1upMatchingSearchResult(),this.currentMatchIndex=this.matches.indexOf(e)):this.currentMatchIndex=-1}},{key:"find1upMatchingSearchResult",value:function(){var e=this;return this.matches.find((function(t){return e.br.currentIndex()===t.par[0].page-1}))}},{key:"find2upMatchingSearchResult",value:function(){var e=this;return this.matches.find((function(t){return e.br._isIndexDisplayed(t.par[0].page-1)}))}},{key:"updateSearchNavigation",value:function(){this.matches.length&&(this.setCurrentMatchIndex(),this.updateResultsPosition())}},{key:"renderMatches",value:function(e){var t=this,r=e.map((function(e){return'\n <li data-page="'.concat(e.par[0].page,'" data-page-index="').concat(t.br.leafNumToIndex(e.par[0].page),'">\n <h4>Page ').concat(e.par[0].page,"</h4>\n <p>").concat(e.text.replace(t.matcher,"<mark>$1</mark>"),"</p>\n </li>\n ")}));this.dom.results.innerHTML=r.join("")}},{key:"togglePinsFor",value:function(e){var t=e?"visible":"hidden";this.br.refs.$BRfooter.find(".BRsearch").css({visibility:t})}},{key:"buildMobileDrawer",value:function(){var e=document.createElement("li");return e.innerHTML='\n <span>\n <span class="DrawerIconWrapper">\n <img class="DrawerIcon" src="'.concat(this.br.imagesBaseURL,'icon_search_button.svg" />\n </span>\n Search\n </span>\n <div data-id="search_slot">\n </div>\n '),e.querySelector('[data-id="search_slot"]').appendChild(this.dom.searchTray),e.classList.add("BRmobileMenu__search"),e}},{key:"buildToolbarSearch",value:function(){var e=document.createElement("span");return e.classList.add("BRtoolbarSection","BRtoolbarSectionSearch"),e.innerHTML='\n <form class="BRbooksearch desktop">\n <input type="search" name="query" class="BRsearchInput" val="" placeholder="Search inside"/>\n <button type="submit" class="BRsearchSubmit">\n <img src="'.concat(this.br.imagesBaseURL,'icon_search_button.svg" />\n </button>\n </form>\n '),e}},{key:"renderPins",value:function(e){var t=this;e.forEach((function(e){var r=e.text,n=t.br.leafNumToIndex(e.par[0].page),a=t.br.getPageNum(n),o=t.br.constructor.util.cssPercentage(n,t.br.getNumLeafs()-1),i=r.replace(t.matcher,"<b>$1</b>"),s="";r.length>100&&(s=r.replace(/^(.{100}[^\s]*).*/,"$1").replace(t.matcher,"<b>$1</b>")+"..."),$("<div>").addClass("BRsearch").css({left:o}).attr("title","Search result").append('\n <div class="BRquery">\n <div>'.concat(s||i,"</div>\n <div>").concat("Page"," ").concat(a,"</div>\n </div>\n ")).data({pageIndex:n}).appendTo(t.br.$(".BRnavline")).hover((function(e){var t=e.currentTarget,r=t.querySelector(".BRquery"),n=r.getBoundingClientRect(),a=t.getBoundingClientRect(),o=2*parseInt(getComputedStyle(r).paddingLeft);n.x-o<0&&r.style.setProperty("transform","translateX(-".concat(a.left-o,"px)")),$(".BRsearch,.BRchapter").removeClass("front"),$(e.target).addClass("front")}),(function(e){return $(e.target).removeClass("front")})).click(function(e){this.br._searchPluginGoToResult(+$(e.target).data("pageIndex")),this.br.updateSearchHilites()}.bind(t))}))}},{key:"toggleSearchPending",value:function(e){this.dom.searchPending.classList.toggle("visible",e),e?this.br.showProgressPopup('<img class="searchmarker" src="'.concat(this.br.imagesBaseURL,'marker_srch-on.svg" />\n Search results will appear below...')):this.br.removeProgressPopup()}},{key:"renderErrorModal",value:function(){this.renderModalMessage("Sorry, there was an error with your search.<br />The text may still be processing."),this.delayModalRemovalFor(4e3)}},{key:"renderBookNotIndexedModal",value:function(){this.renderModalMessage("\n <p>\n This book hasn't been indexed for searching yet.\n We've just started indexing it, so search should be available soon.\n Please try again later. Thanks!\n </p>\n "),this.delayModalRemovalFor(5e3)}},{key:"renderResultsEmptyModal",value:function(){this.renderModalMessage("No matches were found."),this.delayModalRemovalFor(2e3)}},{key:"renderModalMessage",value:function(e){var t=document.createElement("div");t.classList.add("BRprogresspopup","search_modal"),t.innerHTML=e,document.querySelector(this.br.el).append(t)}},{key:"delayModalRemovalFor",value:function(e){setTimeout(this.br.removeProgressPopup.bind(this.br),e)}},{key:"openMobileMenu",value:function(){this.br.refs.$mmenu.data("mmenu").open()}},{key:"closeMobileMenu",value:function(){this.br.refs.$mmenu.data("mmenu").close()}},{key:"submitHandler",value:function(e){e.preventDefault();var t=e.target.querySelector('[name="query"]').value;return!!t.length&&(this.br.search(t),this.dom.searchField.blur(),this.emptyMatches(),this.toggleSearchPending(!0),!1)}},{key:"handleSearchCallback",value:function(e,t){var r=t.results;this.matches=r.matches,this.setCurrentMatchIndex(),this.renderSearchNavigation(),this.bindSearchNavigationEvents(),this.renderMatches(r.matches),this.renderPins(r.matches),this.updateResultsCount(r.matches.length),this.toggleSearchPending(!1)}},{key:"handleNavToggledCallback",value:function(e){var t=this.br.navigationIsVisible();this.togglePinsFor(t),this.toggleSearchTray(!!t&&!!this.dom.results.querySelector("li"))}},{key:"handleSearchStarted",value:function(){this.br.removeSearchHilites(),this.removeResultPins(),this.toggleSearchPending(!0),this.teardownSearchNavigation(),this.setQuery(this.br.searchTerm)}},{key:"handleSearchCallbackError",value:function(){this.toggleSearchPending(!1),this.renderErrorModal()}},{key:"handleSearchCallbackBookNotIndexed",value:function(){this.toggleSearchPending(!1),this.renderBookNotIndexedModal()}},{key:"handleSearchCallbackEmpty",value:function(){this.toggleSearchPending(!1),this.renderResultsEmptyModal()}},{key:"bindEvents",value:function(){var e=this,t="BookReader:";$(document).on("".concat(t,"SearchCallback"),this.handleSearchCallback.bind(this)).on("".concat(t,"navToggled"),this.handleNavToggledCallback.bind(this)).on("".concat(t,"SearchStarted"),this.handleSearchStarted.bind(this)).on("".concat(t,"SearchCallbackError"),this.handleSearchCallbackError.bind(this)).on("".concat(t,"SearchCallbackBookNotIndexed"),this.handleSearchCallbackBookNotIndexed.bind(this)).on("".concat(t,"SearchCallbackEmpty"),this.handleSearchCallbackEmpty.bind(this)).on("".concat(t,"pageChanged"),this.updateSearchNavigation.bind(this)),this.dom.searchTray.addEventListener("submit",this.submitHandler.bind(this)),this.dom.toolbarSearch.querySelector("form").addEventListener("submit",this.submitHandler.bind(this)),this.dom.searchField.addEventListener("search",(function(){e.dom.searchField.value||(e.br.removeSearchResults(),e.clearSearchFieldAndResults())})),$(this.dom.results).on("click","li",(function(t){e.br._searchPluginGoToResult(+t.currentTarget.dataset.pageIndex),e.br.updateSearchHilites(),e.closeMobileMenu()}))}}])&&n(t.prototype,r),e}();function i(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,c=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){c=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(c)throw o}}}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t,r,n,a,o,i){try{var s=e[o](i),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,a)}jQuery.extend(BookReader.defaultOptions,{server:"ia600609.us.archive.org",bookId:"",subPrefix:"",bookPath:"",enableSearch:!0,searchInsideUrl:"/fulltext/inside.php",initialSearchTerm:null}),BookReader.prototype.setup=(a=BookReader.prototype.setup,function(e){a.call(this,e),this.searchTerm="",this.searchResults=null,this.searchInsideUrl=e.searchInsideUrl,this.enableSearch=e.enableSearch,this.goToFirstResult=!1,this.bookId=e.bookId,this.server=e.server,this.subPrefix=e.subPrefix,this.bookPath=e.bookPath,this.searchView=new o({br:this,selector:"#BRsearch_tray"})}),BookReader.prototype.init=function(e){return function(){e.call(this),this.options.enableSearch&&this.options.initialSearchTerm&&this.search(this.options.initialSearchTerm,{goToFirstResult:this.goToFirstResult,suppressFragmentChange:!0})}}(BookReader.prototype.init),BookReader.prototype.buildMobileDrawerElement=function(e){return function(){var t=e.call(this);if(this.enableSearch)return this.searchView.dom.mobileSearch&&t.find(".BRmobileMenu__moreInfoRow").after(this.searchView.dom.mobileSearch),t}}(BookReader.prototype.buildMobileDrawerElement),BookReader.prototype.buildToolbarElement=function(e){return function(){var t=e.call(this);if(this.enableSearch)return this.searchView.dom.toolbarSearch&&t.find(".BRtoolbarSectionInfo").after(this.searchView.dom.toolbarSearch),t}}(BookReader.prototype.buildToolbarElement),BookReader.prototype.search=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={goToFirstResult:!1,disablePopup:!1,suppressFragmentChange:!1,error:null,success:null},a=jQuery.extend({},n,r);this.suppressFragmentChange=a.suppressFragmentChange,this.searchTerm=t.replace(/\//g," "),a.suppressFragmentChange||this.trigger(BookReader.eventNames.fragmentChange);var o=this.server.replace(/:.+/,""),i="https://".concat(o).concat(this.searchInsideUrl,"?"),s=this.bookPath,c="/".concat(this.subPrefix);this.bookPath.length-this.bookPath.lastIndexOf(c)==c.length&&(s=this.bookPath.substr(0,this.bookPath.length-c.length));var h={item_id:this.bookId,doc:this.subPrefix,path:s,q:t},l=$.param(h).replace(/%2F/g,"/"),u="".concat(i).concat(l),d=function(t){var r=t.error||!t.matches.length,n="function"==typeof a.error,o="function"==typeof a.success;r?n?a.error.call(e,t,a):e.BRSearchCallbackError(t,a):o?a.success.call(e,t,a):e.BRSearchCallback(t,a)};return this.trigger("SearchStarted"),$.ajax({url:u,dataType:"jsonp"}).then(d)},BookReader.prototype.BRSearchCallback=function(e,t){this.searchResults=e,this.updateSearchHilites(),this.removeProgressPopup(),t.goToFirstResult&&this._searchPluginGoToResult(e.matches[0].par[0].page),this.trigger("SearchCallback",{results:e,options:t,instance:this})},BookReader.prototype.BRSearchCallbackError=function(e){this._BRSearchCallbackError(e)},BookReader.prototype._BRSearchCallbackError=function(e){if(this.searchResults=e,e.error)this.trigger("SearchCallbackError",{results:e,instance:this});else if(0==e.matches.length){if(!1===e.indexed)return void this.trigger("SearchCallbackBookNotIndexed",{instance:this});this.trigger("SearchCallbackEmpty",{instance:this})}},BookReader.prototype.updateSearchHilites=function(){this.constMode2up!=this.mode?this.updateSearchHilites1UP():this.updateSearchHilites2UP()},BookReader.prototype.updateSearchHilites1UP=function(){var e=this,t=this.searchResults;null!=t&&t.matches.forEach((function(t){t.par[0].boxes.forEach((function(t){var r=e.leafNumToIndex(t.page);if(jQuery.inArray(r,e.displayedIndices)>=0){t.div||(t.div=document.createElement("div"),$(t.div).prop("className","BookReaderSearchHilite").appendTo(e.$(".pagediv".concat(r))));var n={width:"".concat((t.r-t.l)/e.reduce,"px"),height:"".concat((t.b-t.t)/e.reduce,"px"),left:"".concat(t.l/e.reduce,"px"),top:"".concat(t.t/e.reduce,"px")};$(t.div).css(n)}else t.div&&($(t.div).remove(),t.div=null)}))}))},BookReader.prototype.updateSearchHilites2UP=function(){var e=this,t=this.searchResults;null!==t&&t.matches.forEach((function(t){t.par[0].boxes.forEach((function(r){var n=e.leafNumToIndex(t.par[0].page),a=jQuery.inArray(n,e.displayedIndices)>=0,o=e._models.book.getPage(n).isViewable;a&&o?(r.div||(r.div=document.createElement("div"),$(r.div).addClass("BookReaderSearchHilite").appendTo(e.refs.$brTwoPageView)),e.setHilightCss2UP(r.div,n,r.l,r.r,r.t,r.b)):r.div&&($(r.div).remove(),r.div=null)}))}))},BookReader.prototype.removeSearchHilites=function(){var e=this.searchResults;null!=e&&e.matches.forEach((function(e){e.par[0].boxes.forEach((function(e){null!=e.div&&($(e.div).remove(),e.div=null)}))}))},BookReader.prototype._searchPluginGoToResult=function(){var e,t=(e=regeneratorRuntime.mark((function e(t){var r,n,a,o,s,c,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this._models.book,n=r.getPage(t),a=!1,n.isViewable){e.next=10;break}return e.next=6,fetch("/services/bookreader/request_page?"+new URLSearchParams({id:this.options.bookId,subprefix:this.options.subPrefix,leafNum:n.leafNum})).then((function(e){return e.json()}));case 6:o=e.sent,s=i(o.value);try{for(s.s();!(c=s.n()).done;)h=c.value,r.getPage(r.leafNumToIndex(h)).makeViewable()}catch(e){s.e(e)}finally{s.f()}o.value.length||(r.getPage(t).makeViewable(),a=!0);case 10:this.jumpToIndex(t),a&&r.getPage(t).makeViewable(!1);case 12:case"end":return e.stop()}}),e,this)})),function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){c(o,n,a,i,s,"next",e)}function s(e){c(o,n,a,i,s,"throw",e)}i(void 0)}))});return function(e){return t.apply(this,arguments)}}(),BookReader.prototype.removeSearchResults=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.removeSearchHilites(),this.searchTerm=null,this.searchResults=null,e||this.trigger(BookReader.eventNames.fragmentChange)},BookReader.prototype.searchHighlightVisible=function(){var e=this,t=this.searchResults,r=[];if(null==t)return!1;if(this.constMode2up==this.mode)r=[this.twoPage.currentIndexL,this.twoPage.currentIndexR];else{if(this.constMode1up!=this.mode)return!1;r=[this.currentIndex()]}return t.matches.some((function(t){return t.par[0].boxes.some((function(t){var n=e.leafNumToIndex(t.page);if(jQuery.inArray(n,r)>=0)return!0}))})),!1}},8533:function(e,t,r){"use strict";var n=r(2092).forEach,a=r(9341),o=r(9207),i=a("forEach"),s=o("forEach");e.exports=i&&s?[].forEach:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}},6583:function(e,t,r){"use strict";var n=r(5656),a=r(9958),o=r(7466),i=r(9341),s=r(9207),c=Math.min,h=[].lastIndexOf,l=!!h&&1/[1].lastIndexOf(1,-0)<0,u=i("lastIndexOf"),d=s("indexOf",{ACCESSORS:!0,1:0}),f=l||!u||!d;e.exports=f?function(e){if(l)return h.apply(this,arguments)||0;var t=n(this),r=o(t.length),i=r-1;for(arguments.length>1&&(i=c(i,a(arguments[1]))),i<0&&(i=r+i);i>=0;i--)if(i in t&&t[i]===e)return i||0;return-1}:h},6833:function(e,t,r){var n=r(8113);e.exports=/(iphone|ipod|ipad).*applewebkit/i.test(n)},842:function(e,t,r){var n=r(7854);e.exports=function(e,t){var r=n.console;r&&r.error&&(1===arguments.length?r.error(e):r.error(e,t))}},9587:function(e,t,r){var n=r(111),a=r(7674);e.exports=function(e,t,r){var o,i;return a&&"function"==typeof(o=t.constructor)&&o!==r&&n(i=o.prototype)&&i!==r.prototype&&a(e,i),e}},408:function(e,t,r){var n=r(9670),a=r(7659),o=r(7466),i=r(9974),s=r(1246),c=r(3411),h=function(e,t){this.stopped=e,this.result=t};(e.exports=function(e,t,r,l,u){var d,f,p,v,m,g,b,y=i(t,r,l?2:1);if(u)d=e;else{if("function"!=typeof(f=s(e)))throw TypeError("Target is not iterable");if(a(f)){for(p=0,v=o(e.length);v>p;p++)if((m=l?y(n(b=e[p])[0],b[1]):y(e[p]))&&m instanceof h)return m;return new h(!1)}d=f.call(e)}for(g=d.next;!(b=g.call(d)).done;)if("object"==typeof(m=c(d,y,b.value,l))&&m&&m instanceof h)return m;return new h(!1)}).stop=function(e){return new h(!0,e)}},5948:function(e,t,r){var n,a,o,i,s,c,h,l,u=r(7854),d=r(1236).f,f=r(4326),p=r(261).set,v=r(6833),m=u.MutationObserver||u.WebKitMutationObserver,g=u.process,b=u.Promise,y="process"==f(g),k=d(u,"queueMicrotask"),S=k&&k.value;S||(n=function(){var e,t;for(y&&(e=g.domain)&&e.exit();a;){t=a.fn,a=a.next;try{t()}catch(e){throw a?i():o=void 0,e}}o=void 0,e&&e.enter()},y?i=function(){g.nextTick(n)}:m&&!v?(s=!0,c=document.createTextNode(""),new m(n).observe(c,{characterData:!0}),i=function(){c.data=s=!s}):b&&b.resolve?(h=b.resolve(void 0),l=h.then,i=function(){l.call(h,n)}):i=function(){p.call(u,n)}),e.exports=S||function(e){var t={fn:e,next:void 0};o&&(o.next=t),a||(a=t,i()),o=t}},3366:function(e,t,r){var n=r(7854);e.exports=n.Promise},8523:function(e,t,r){"use strict";var n=r(3099),a=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n})),this.resolve=n(t),this.reject=n(r)};e.exports.f=function(e){return new a(e)}},2534:function(e){e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},9478:function(e,t,r){var n=r(9670),a=r(111),o=r(8523);e.exports=function(e,t){if(n(e),a(t)&&t.constructor===e)return t;var r=o.f(e);return(0,r.resolve)(t),r.promise}},6340:function(e,t,r){"use strict";var n=r(5005),a=r(3070),o=r(5112),i=r(9781),s=o("species");e.exports=function(e){var t=n(e),r=a.f;i&&t&&!t[s]&&r(t,s,{configurable:!0,get:function(){return this}})}},261:function(e,t,r){var n,a,o,i=r(7854),s=r(7293),c=r(4326),h=r(9974),l=r(490),u=r(317),d=r(6833),f=i.location,p=i.setImmediate,v=i.clearImmediate,m=i.process,g=i.MessageChannel,b=i.Dispatch,y=0,k={},S=function(e){if(k.hasOwnProperty(e)){var t=k[e];delete k[e],t()}},R=function(e){return function(){S(e)}},x=function(e){S(e.data)},P=function(e){i.postMessage(e+"",f.protocol+"//"+f.host)};p&&v||(p=function(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return k[++y]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},n(y),y},v=function(e){delete k[e]},"process"==c(m)?n=function(e){m.nextTick(R(e))}:b&&b.now?n=function(e){b.now(R(e))}:g&&!d?(o=(a=new g).port2,a.port1.onmessage=x,n=h(o.postMessage,o,1)):!i.addEventListener||"function"!=typeof postMessage||i.importScripts||s(P)||"file:"===f.protocol?n="onreadystatechange"in u("script")?function(e){l.appendChild(u("script")).onreadystatechange=function(){l.removeChild(this),S(e)}}:function(e){setTimeout(R(e),0)}:(n=P,i.addEventListener("message",x,!1))),e.exports={set:p,clear:v}},9554:function(e,t,r){"use strict";var n=r(2109),a=r(8533);n({target:"Array",proto:!0,forced:[].forEach!=a},{forEach:a})},4986:function(e,t,r){var n=r(2109),a=r(6583);n({target:"Array",proto:!0,forced:a!==[].lastIndexOf},{lastIndexOf:a})},5212:function(e,t,r){"use strict";var n=r(2109),a=r(2092).some,o=r(9341),i=r(9207),s=o("some"),c=i("some");n({target:"Array",proto:!0,forced:!s||!c},{some:function(e){return a(this,e,arguments.length>1?arguments[1]:void 0)}})},8674:function(e,t,r){"use strict";var n,a,o,i,s=r(2109),c=r(1913),h=r(7854),l=r(5005),u=r(3366),d=r(1320),f=r(2248),p=r(8003),v=r(6340),m=r(111),g=r(3099),b=r(5787),y=r(4326),k=r(2788),S=r(408),R=r(7072),x=r(6707),P=r(261).set,w=r(5948),M=r(9478),T=r(842),E=r(8523),B=r(2534),C=r(9909),I=r(4705),N=r(5112),j=r(7392),_=N("species"),$="Promise",F=C.get,H=C.set,L=C.getterFor($),q=u,O=h.TypeError,A=h.document,U=h.process,V=l("fetch"),D=E.f,Q=D,G="process"==y(U),W=!!(A&&A.createEvent&&h.dispatchEvent),Y="unhandledrejection",K=I($,(function(){if(k(q)===String(q)){if(66===j)return!0;if(!G&&"function"!=typeof PromiseRejectionEvent)return!0}if(c&&!q.prototype.finally)return!0;if(j>=51&&/native code/.test(q))return!1;var e=q.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[_]=t,!(e.then((function(){}))instanceof t)})),X=K||!R((function(e){q.all(e).catch((function(){}))})),z=function(e){var t;return!(!m(e)||"function"!=typeof(t=e.then))&&t},J=function(e,t,r){if(!t.notified){t.notified=!0;var n=t.reactions;w((function(){for(var a=t.value,o=1==t.state,i=0;n.length>i;){var s,c,h,l=n[i++],u=o?l.ok:l.fail,d=l.resolve,f=l.reject,p=l.domain;try{u?(o||(2===t.rejection&&re(e,t),t.rejection=1),!0===u?s=a:(p&&p.enter(),s=u(a),p&&(p.exit(),h=!0)),s===l.promise?f(O("Promise-chain cycle")):(c=z(s))?c.call(s,d,f):d(s)):f(a)}catch(e){p&&!h&&p.exit(),f(e)}}t.reactions=[],t.notified=!1,r&&!t.rejection&&ee(e,t)}))}},Z=function(e,t,r){var n,a;W?((n=A.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),h.dispatchEvent(n)):n={promise:t,reason:r},(a=h["on"+e])?a(n):e===Y&&T("Unhandled promise rejection",r)},ee=function(e,t){P.call(h,(function(){var r,n=t.value;if(te(t)&&(r=B((function(){G?U.emit("unhandledRejection",n,e):Z(Y,e,n)})),t.rejection=G||te(t)?2:1,r.error))throw r.value}))},te=function(e){return 1!==e.rejection&&!e.parent},re=function(e,t){P.call(h,(function(){G?U.emit("rejectionHandled",e):Z("rejectionhandled",e,t.value)}))},ne=function(e,t,r,n){return function(a){e(t,r,a,n)}},ae=function(e,t,r,n){t.done||(t.done=!0,n&&(t=n),t.value=r,t.state=2,J(e,t,!0))},oe=function(e,t,r,n){if(!t.done){t.done=!0,n&&(t=n);try{if(e===r)throw O("Promise can't be resolved itself");var a=z(r);a?w((function(){var n={done:!1};try{a.call(r,ne(oe,e,n,t),ne(ae,e,n,t))}catch(r){ae(e,n,r,t)}})):(t.value=r,t.state=1,J(e,t,!1))}catch(r){ae(e,{done:!1},r,t)}}};K&&(q=function(e){b(this,q,$),g(e),n.call(this);var t=F(this);try{e(ne(oe,this,t),ne(ae,this,t))}catch(e){ae(this,t,e)}},(n=function(e){H(this,{type:$,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=f(q.prototype,{then:function(e,t){var r=L(this),n=D(x(this,q));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=G?U.domain:void 0,r.parent=!0,r.reactions.push(n),0!=r.state&&J(this,r,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),a=function(){var e=new n,t=F(e);this.promise=e,this.resolve=ne(oe,e,t),this.reject=ne(ae,e,t)},E.f=D=function(e){return e===q||e===o?new a(e):Q(e)},c||"function"!=typeof u||(i=u.prototype.then,d(u.prototype,"then",(function(e,t){var r=this;return new q((function(e,t){i.call(r,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof V&&s({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return M(q,V.apply(h,arguments))}}))),s({global:!0,wrap:!0,forced:K},{Promise:q}),p(q,$,!1,!0),v($),o=l($),s({target:$,stat:!0,forced:K},{reject:function(e){var t=D(this);return t.reject.call(void 0,e),t.promise}}),s({target:$,stat:!0,forced:c||K},{resolve:function(e){return M(c&&this===o?q:this,e)}}),s({target:$,stat:!0,forced:X},{all:function(e){var t=this,r=D(t),n=r.resolve,a=r.reject,o=B((function(){var r=g(t.resolve),o=[],i=0,s=1;S(e,(function(e){var c=i++,h=!1;o.push(void 0),s++,r.call(t,e).then((function(e){h||(h=!0,o[c]=e,--s||n(o))}),a)})),--s||n(o)}));return o.error&&a(o.value),r.promise},race:function(e){var t=this,r=D(t),n=r.reject,a=B((function(){var a=g(t.resolve);S(e,(function(e){a.call(t,e).then(r.resolve,n)}))}));return a.error&&n(a.value),r.promise}})},4603:function(e,t,r){var n=r(9781),a=r(7854),o=r(4705),i=r(9587),s=r(3070).f,c=r(8006).f,h=r(7850),l=r(7066),u=r(2999),d=r(1320),f=r(7293),p=r(9909).set,v=r(6340),m=r(5112)("match"),g=a.RegExp,b=g.prototype,y=/a/g,k=/a/g,S=new g(y)!==y,R=u.UNSUPPORTED_Y;if(n&&o("RegExp",!S||R||f((function(){return k[m]=!1,g(y)!=y||g(k)==k||"/a/i"!=g(y,"i")})))){for(var x=function(e,t){var r,n=this instanceof x,a=h(e),o=void 0===t;if(!n&&a&&e.constructor===x&&o)return e;S?a&&!o&&(e=e.source):e instanceof x&&(o&&(t=l.call(e)),e=e.source),R&&(r=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,""));var s=i(S?new g(e,t):g(e,t),n?this:b,x);return R&&r&&p(s,{sticky:r}),s},P=function(e){e in x||s(x,e,{configurable:!0,get:function(){return g[e]},set:function(t){g[e]=t}})},w=c(g),M=0;w.length>M;)P(w[M++]);b.constructor=x,x.prototype=b,d(a,"RegExp",x)}v("RegExp")},4747:function(e,t,r){var n=r(7854),a=r(8324),o=r(8533),i=r(8880);for(var s in a){var c=n[s],h=c&&c.prototype;if(h&&h.forEach!==o)try{i(h,"forEach",o)}catch(e){h.forEach=o}}}},0,[[2728,898]]]); | ||
(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[73],{2728:function(e,t,r){"use strict";function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r(2222),r(2526),r(9826),r(1817),r(9554),r(2165),r(2772),r(9600),r(1249),r(4603),r(1038),r(4916),r(6992),r(9714),r(4986),r(5306),r(5827),r(4765),r(7042),r(4747),r(5212),r(8309),r(1539),r(8674),r(8783),r(3948),r(285),r(5666);var a,o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.selector?(this.br=t.br,this.matcher=new RegExp("{{{(.+?)}}}","g"),this.matches=[],this.cacheDOMElements(t.selector),this.bindEvents(),this.br.options.initialSearchTerm&&this.setQuery(t.query)):console.warn("BookReader::Search - SearchView must be passed a valid CSS selector")}var t,r;return t=e,(r=[{key:"cacheDOMElements",value:function(e){this.dom={},this.dom.searchTray=this.renderSearchTray(e),this.dom.results=this.dom.searchTray.querySelector('[data-id="results"]'),this.dom.resultsCount=this.dom.searchTray.querySelector('[data-id="results_count"]'),this.dom.searchField=this.dom.searchTray.querySelector('[name="query"]'),this.dom.searchPending=this.dom.searchTray.querySelector('[data-id="searchPending"]'),this.dom.mobileSearch=this.buildMobileDrawer(),this.dom.toolbarSearch=this.buildToolbarSearch()}},{key:"toggleSearchTray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dom.searchTray.classList.contains("hidden");this.dom.searchTray.classList.toggle("hidden",!e)}},{key:"toggleResultsCount",value:function(e){this.dom.resultsCount.classList.toggle("visible",e)}},{key:"updateResultsCount",value:function(e){this.dom.resultsCount.innerText="(".concat(e," result").concat(1!=e?"s":"",")"),this.toggleResultsCount(!0)}},{key:"setQuery",value:function(e){this.dom.searchField.value=e}},{key:"emptyMatches",value:function(){this.dom.results.innerHTML="",this.matches=[]}},{key:"removeResultPins",value:function(){this.br.$(".BRnavpos .BRsearch").remove()}},{key:"clearSearchFieldAndResults",value:function(){this.br.removeSearchResults(),this.toggleResultsCount(!1),this.removeResultPins(),this.emptyMatches(),this.setQuery(""),this.teardownSearchNavigation()}},{key:"renderSearchTray",value:function(e){var t=document.createElement("div");return t.setAttribute("id",e.replace(/^#/,"")),t.innerHTML='\n <header>\n <div>\n <h3>Search inside</h3>\n <p data-id="results_count"></p>\n </div>\n <a href="#" class="close"></a>\n </header>\n <form action="" method="get">\n <fieldset>\n <input name="all_files" id="all_files" type="checkbox" />\n <label class="checkbox" for="all_files">Search all files</label>\n <input type="search" name="query" placeholder="Enter a search term" />\n </fieldset>\n </form>\n <div data-id="searchPending" id="search_pending">\n <p>Your search results will appear below</p>\n <div class="loader tc mt20"></div>\n </div>\n <ul data-id="results"></ul>\n ',t}},{key:"renderSearchNavigation",value:function(){var e="BRsearch-navigation";$(".BRnav").before('\n <div class="'.concat(e,'">\n <h4>\n <span class="icon icon-search"></span>\n Results\n </h4>\n <div class="pagination">\n <a href="#" class="prev" title="Previous result"><span class="icon icon-chevron hflip"></span></a>\n <span data-id="resultsCount">').concat(this.resultsPosition(),'</span>\n <a href="#" class="next" title="Next result"><span class="icon icon-chevron"></a>\n </div>\n <a href="#" class="clear" title="Clear search results">\n <span class="icon icon-close"></span>\n </a>\n </div>\n ')),this.dom.searchNavigation=$(".".concat(e))}},{key:"resultsPosition",value:function(){var e="".concat(this.matches.length," result").concat(1===this.matches.length?"":"s");return~this.currentMatchIndex&&(e="".concat(this.currentMatchIndex+1," / ").concat(this.matches.length)),e}},{key:"bindSearchNavigationEvents",value:function(){if(this.dom.searchNavigation){var e="searchNavigation";this.dom.searchNavigation.on("click.".concat(e),".clear",this.clearSearchFieldAndResults.bind(this)).on("click.".concat(e),".prev",this.showPrevResult.bind(this)).on("click.".concat(e),".next",this.showNextResult.bind(this)).on("click.".concat(e),!1)}}},{key:"showPrevResult",value:function(){0!==this.currentMatchIndex&&(this.br.mode===this.br.constModeThumb&&this.br.switchMode(this.br.constMode1up),~this.currentMatchIndex||(this.currentMatchIndex=1),this.br.$(".BRnavline .BRsearch").eq(--this.currentMatchIndex).click(),this.updateResultsPosition())}},{key:"showNextResult",value:function(){this.currentMatchIndex+1!==this.matches.length&&(this.br.mode===this.br.constModeThumb&&this.br.switchMode(this.br.constMode1up),this.br.$(".BRnavline .BRsearch").eq(++this.currentMatchIndex).click(),this.updateResultsPosition())}},{key:"updateResultsPosition",value:function(){this.dom.searchNavigation.find("[data-id=resultsCount]").text(this.resultsPosition())}},{key:"teardownSearchNavigation",value:function(){this.dom.searchNavigation&&(this.dom.searchNavigation.off(".searchNavigation").remove(),this.dom.searchNavigation=null)}},{key:"setCurrentMatchIndex",value:function(){var e;this.br.mode!==this.br.constModeThumb?(e=this.br.mode===this.br.constMode2up?this.find2upMatchingSearchResult():this.find1upMatchingSearchResult(),this.currentMatchIndex=this.matches.indexOf(e)):this.currentMatchIndex=-1}},{key:"find1upMatchingSearchResult",value:function(){var e=this;return this.matches.find((function(t){return e.br.currentIndex()===t.par[0].page-1}))}},{key:"find2upMatchingSearchResult",value:function(){var e=this;return this.matches.find((function(t){return e.br._isIndexDisplayed(t.par[0].page-1)}))}},{key:"updateSearchNavigation",value:function(){this.matches.length&&(this.setCurrentMatchIndex(),this.updateResultsPosition())}},{key:"renderMatches",value:function(e){var t=this,r=e.map((function(e){return'\n <li data-page="'.concat(e.par[0].page,'" data-page-index="').concat(t.br.leafNumToIndex(e.par[0].page),'">\n <h4>Page ').concat(e.par[0].page,"</h4>\n <p>").concat(e.text.replace(t.matcher,"<mark>$1</mark>"),"</p>\n </li>\n ")}));this.dom.results.innerHTML=r.join("")}},{key:"togglePinsFor",value:function(e){var t=e?"visible":"hidden";this.br.refs.$BRfooter.find(".BRsearch").css({visibility:t})}},{key:"buildMobileDrawer",value:function(){var e=document.createElement("li");return e.innerHTML='\n <span>\n <span class="DrawerIconWrapper">\n <img class="DrawerIcon" src="'.concat(this.br.imagesBaseURL,'icon_search_button.svg" />\n </span>\n Search\n </span>\n <div data-id="search_slot">\n </div>\n '),e.querySelector('[data-id="search_slot"]').appendChild(this.dom.searchTray),e.classList.add("BRmobileMenu__search"),e}},{key:"buildToolbarSearch",value:function(){var e=document.createElement("span");return e.classList.add("BRtoolbarSection","BRtoolbarSectionSearch"),e.innerHTML='\n <form class="BRbooksearch desktop">\n <input type="search" name="query" class="BRsearchInput" val="" placeholder="Search inside"/>\n <button type="submit" class="BRsearchSubmit">\n <img src="'.concat(this.br.imagesBaseURL,'icon_search_button.svg" />\n </button>\n </form>\n '),e}},{key:"renderPins",value:function(e){var t=this;e.forEach((function(e){var r=e.text,n=t.br.leafNumToIndex(e.par[0].page),a=t.br.getPageNum(n),o=t.br.constructor.util.cssPercentage(n,t.br.getNumLeafs()-1),i=r.replace(t.matcher,"<b>$1</b>"),s="";r.length>100&&(s=r.replace(/^(.{100}[^\s]*).*/,"$1").replace(t.matcher,"<b>$1</b>")+"..."),$("<div>").addClass("BRsearch").css({left:o}).attr("title","Search result").append('\n <div class="BRquery">\n <div>'.concat(s||i,"</div>\n <div>").concat("Page"," ").concat(a,"</div>\n </div>\n ")).data({pageIndex:n}).appendTo(t.br.$(".BRnavline")).hover((function(e){var t=e.currentTarget,r=t.querySelector(".BRquery"),n=r.getBoundingClientRect(),a=t.getBoundingClientRect(),o=2*parseInt(getComputedStyle(r).paddingLeft);n.x-o<0&&r.style.setProperty("transform","translateX(-".concat(a.left-o,"px)")),$(".BRsearch,.BRchapter").removeClass("front"),$(e.target).addClass("front")}),(function(e){return $(e.target).removeClass("front")})).click(function(e){this.br._searchPluginGoToResult(+$(e.target).data("pageIndex")),this.br.updateSearchHilites()}.bind(t))}))}},{key:"toggleSearchPending",value:function(e){this.dom.searchPending.classList.toggle("visible",e),e?this.br.showProgressPopup('<img class="searchmarker" src="'.concat(this.br.imagesBaseURL,'marker_srch-on.svg" />\n Search results will appear below...')):this.br.removeProgressPopup()}},{key:"renderErrorModal",value:function(){this.renderModalMessage("Sorry, there was an error with your search.<br />The text may still be processing."),this.delayModalRemovalFor(4e3)}},{key:"renderBookNotIndexedModal",value:function(){this.renderModalMessage("\n <p>\n This book hasn't been indexed for searching yet.\n We've just started indexing it, so search should be available soon.\n Please try again later. Thanks!\n </p>\n "),this.delayModalRemovalFor(5e3)}},{key:"renderResultsEmptyModal",value:function(){this.renderModalMessage("No matches were found."),this.delayModalRemovalFor(2e3)}},{key:"renderModalMessage",value:function(e){var t=document.createElement("div");t.classList.add("BRprogresspopup","search_modal"),t.innerHTML=e,document.querySelector(this.br.el).append(t)}},{key:"delayModalRemovalFor",value:function(e){setTimeout(this.br.removeProgressPopup.bind(this.br),e)}},{key:"openMobileMenu",value:function(){this.br.refs.$mmenu.data("mmenu").open()}},{key:"closeMobileMenu",value:function(){this.br.refs.$mmenu.data("mmenu").close()}},{key:"submitHandler",value:function(e){e.preventDefault();var t=e.target.querySelector('[name="query"]').value;return!!t.length&&(this.br.search(t),this.dom.searchField.blur(),this.emptyMatches(),this.toggleSearchPending(!0),!1)}},{key:"handleSearchCallback",value:function(e,t){var r=t.results;this.matches=r.matches,this.setCurrentMatchIndex(),this.renderSearchNavigation(),this.bindSearchNavigationEvents(),this.renderMatches(r.matches),this.renderPins(r.matches),this.updateResultsCount(r.matches.length),this.toggleSearchPending(!1)}},{key:"handleNavToggledCallback",value:function(e){var t=this.br.navigationIsVisible();this.togglePinsFor(t),this.toggleSearchTray(!!t&&!!this.dom.results.querySelector("li"))}},{key:"handleSearchStarted",value:function(){this.br.removeSearchHilites(),this.removeResultPins(),this.toggleSearchPending(!0),this.teardownSearchNavigation(),this.setQuery(this.br.searchTerm)}},{key:"handleSearchCallbackError",value:function(){this.toggleSearchPending(!1),this.renderErrorModal()}},{key:"handleSearchCallbackBookNotIndexed",value:function(){this.toggleSearchPending(!1),this.renderBookNotIndexedModal()}},{key:"handleSearchCallbackEmpty",value:function(){this.toggleSearchPending(!1),this.renderResultsEmptyModal()}},{key:"bindEvents",value:function(){var e=this,t="BookReader:";$(document).on("".concat(t,"SearchCallback"),this.handleSearchCallback.bind(this)).on("".concat(t,"navToggled"),this.handleNavToggledCallback.bind(this)).on("".concat(t,"SearchStarted"),this.handleSearchStarted.bind(this)).on("".concat(t,"SearchCallbackError"),this.handleSearchCallbackError.bind(this)).on("".concat(t,"SearchCallbackBookNotIndexed"),this.handleSearchCallbackBookNotIndexed.bind(this)).on("".concat(t,"SearchCallbackEmpty"),this.handleSearchCallbackEmpty.bind(this)).on("".concat(t,"pageChanged"),this.updateSearchNavigation.bind(this)),this.dom.searchTray.addEventListener("submit",this.submitHandler.bind(this)),this.dom.toolbarSearch.querySelector("form").addEventListener("submit",this.submitHandler.bind(this)),this.dom.searchField.addEventListener("search",(function(){e.dom.searchField.value||e.clearSearchFieldAndResults()})),$(this.dom.results).on("click","li",(function(t){e.br._searchPluginGoToResult(+t.currentTarget.dataset.pageIndex),e.br.updateSearchHilites(),e.closeMobileMenu()}))}}])&&n(t.prototype,r),e}();function i(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,c=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){c=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(c)throw o}}}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t,r,n,a,o,i){try{var s=e[o](i),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,a)}jQuery.extend(BookReader.defaultOptions,{server:"ia600609.us.archive.org",bookId:"",subPrefix:"",bookPath:"",enableSearch:!0,searchInsideUrl:"/fulltext/inside.php",initialSearchTerm:null}),BookReader.prototype.setup=(a=BookReader.prototype.setup,function(e){a.call(this,e),this.searchTerm="",this.searchResults=null,this.searchInsideUrl=e.searchInsideUrl,this.enableSearch=e.enableSearch,this.goToFirstResult=!1,this.bookId=e.bookId,this.server=e.server,this.subPrefix=e.subPrefix,this.bookPath=e.bookPath,this.searchView=new o({br:this,selector:"#BRsearch_tray"})}),BookReader.prototype.init=function(e){return function(){e.call(this),this.options.enableSearch&&this.options.initialSearchTerm&&this.search(this.options.initialSearchTerm,{goToFirstResult:this.goToFirstResult,suppressFragmentChange:!0})}}(BookReader.prototype.init),BookReader.prototype.buildMobileDrawerElement=function(e){return function(){var t=e.call(this);if(this.enableSearch)return this.searchView.dom.mobileSearch&&t.find(".BRmobileMenu__moreInfoRow").after(this.searchView.dom.mobileSearch),t}}(BookReader.prototype.buildMobileDrawerElement),BookReader.prototype.buildToolbarElement=function(e){return function(){var t=e.call(this);if(this.enableSearch)return this.searchView.dom.toolbarSearch&&t.find(".BRtoolbarSectionInfo").after(this.searchView.dom.toolbarSearch),t}}(BookReader.prototype.buildToolbarElement),BookReader.prototype.search=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={goToFirstResult:!1,disablePopup:!1,suppressFragmentChange:!1,error:null,success:null},a=jQuery.extend({},n,r);this.suppressFragmentChange=a.suppressFragmentChange,this.searchTerm=t.replace(/\//g," "),a.suppressFragmentChange||this.trigger(BookReader.eventNames.fragmentChange);var o=this.server.replace(/:.+/,""),i="https://".concat(o).concat(this.searchInsideUrl,"?"),s=this.bookPath,c="/".concat(this.subPrefix);this.bookPath.length-this.bookPath.lastIndexOf(c)==c.length&&(s=this.bookPath.substr(0,this.bookPath.length-c.length));var h={item_id:this.bookId,doc:this.subPrefix,path:s,q:t},l=$.param(h).replace(/%2F/g,"/"),u="".concat(i).concat(l),d=function(t){var r=t.error||!t.matches.length,n="function"==typeof a.error,o="function"==typeof a.success;r?n?a.error.call(e,t,a):e.BRSearchCallbackError(t,a):o?a.success.call(e,t,a):e.BRSearchCallback(t,a)};return this.trigger("SearchStarted"),$.ajax({url:u,dataType:"jsonp"}).then(d)},BookReader.prototype.BRSearchCallback=function(e,t){this.searchResults=e,this.updateSearchHilites(),this.removeProgressPopup(),t.goToFirstResult&&this._searchPluginGoToResult(e.matches[0].par[0].page),this.trigger("SearchCallback",{results:e,options:t,instance:this})},BookReader.prototype.BRSearchCallbackError=function(e){this._BRSearchCallbackError(e)},BookReader.prototype._BRSearchCallbackError=function(e){if(this.searchResults=e,e.error)this.trigger("SearchCallbackError",{results:e,instance:this});else if(0==e.matches.length){if(!1===e.indexed)return void this.trigger("SearchCallbackBookNotIndexed",{instance:this});this.trigger("SearchCallbackEmpty",{instance:this})}},BookReader.prototype.updateSearchHilites=function(){this.constMode2up!=this.mode?this.updateSearchHilites1UP():this.updateSearchHilites2UP()},BookReader.prototype.updateSearchHilites1UP=function(){var e=this,t=this.searchResults;null!=t&&t.matches.forEach((function(t){t.par[0].boxes.forEach((function(t){var r=e.leafNumToIndex(t.page);if(jQuery.inArray(r,e.displayedIndices)>=0){t.div||(t.div=document.createElement("div"),$(t.div).prop("className","BookReaderSearchHilite").appendTo(e.$(".pagediv".concat(r))));var n={width:"".concat((t.r-t.l)/e.reduce,"px"),height:"".concat((t.b-t.t)/e.reduce,"px"),left:"".concat(t.l/e.reduce,"px"),top:"".concat(t.t/e.reduce,"px")};$(t.div).css(n)}else t.div&&($(t.div).remove(),t.div=null)}))}))},BookReader.prototype.updateSearchHilites2UP=function(){var e=this,t=this.searchResults;null!==t&&t.matches.forEach((function(t){t.par[0].boxes.forEach((function(r){var n=e.leafNumToIndex(t.par[0].page),a=jQuery.inArray(n,e.displayedIndices)>=0,o=e._models.book.getPage(n).isViewable;a&&o?(r.div||(r.div=document.createElement("div"),$(r.div).addClass("BookReaderSearchHilite").appendTo(e.refs.$brTwoPageView)),e.setHilightCss2UP(r.div,n,r.l,r.r,r.t,r.b)):r.div&&($(r.div).remove(),r.div=null)}))}))},BookReader.prototype.removeSearchHilites=function(){var e=this.searchResults;null!=e&&e.matches.forEach((function(e){e.par[0].boxes.forEach((function(e){null!=e.div&&($(e.div).remove(),e.div=null)}))}))},BookReader.prototype._searchPluginGoToResult=function(){var e,t=(e=regeneratorRuntime.mark((function e(t){var r,n,a,o,s,c,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this._models.book,n=r.getPage(t),a=!1,n.isViewable){e.next=10;break}return e.next=6,fetch("/services/bookreader/request_page?"+new URLSearchParams({id:this.options.bookId,subprefix:this.options.subPrefix,leafNum:n.leafNum})).then((function(e){return e.json()}));case 6:o=e.sent,s=i(o.value);try{for(s.s();!(c=s.n()).done;)h=c.value,r.getPage(r.leafNumToIndex(h)).makeViewable()}catch(e){s.e(e)}finally{s.f()}o.value.length||(r.getPage(t).makeViewable(),a=!0);case 10:this.jumpToIndex(t),a&&r.getPage(t).makeViewable(!1);case 12:case"end":return e.stop()}}),e,this)})),function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){c(o,n,a,i,s,"next",e)}function s(e){c(o,n,a,i,s,"throw",e)}i(void 0)}))});return function(e){return t.apply(this,arguments)}}(),BookReader.prototype.removeSearchResults=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.removeSearchHilites(),this.searchTerm=null,this.searchResults=null,e||this.trigger(BookReader.eventNames.fragmentChange)},BookReader.prototype.searchHighlightVisible=function(){var e=this,t=this.searchResults,r=[];if(null==t)return!1;if(this.constMode2up==this.mode)r=[this.twoPage.currentIndexL,this.twoPage.currentIndexR];else{if(this.constMode1up!=this.mode)return!1;r=[this.currentIndex()]}return t.matches.some((function(t){return t.par[0].boxes.some((function(t){var n=e.leafNumToIndex(t.page);if(jQuery.inArray(n,r)>=0)return!0}))})),!1}},8533:function(e,t,r){"use strict";var n=r(2092).forEach,a=r(9341),o=r(9207),i=a("forEach"),s=o("forEach");e.exports=i&&s?[].forEach:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}},6583:function(e,t,r){"use strict";var n=r(5656),a=r(9958),o=r(7466),i=r(9341),s=r(9207),c=Math.min,h=[].lastIndexOf,l=!!h&&1/[1].lastIndexOf(1,-0)<0,u=i("lastIndexOf"),d=s("indexOf",{ACCESSORS:!0,1:0}),f=l||!u||!d;e.exports=f?function(e){if(l)return h.apply(this,arguments)||0;var t=n(this),r=o(t.length),i=r-1;for(arguments.length>1&&(i=c(i,a(arguments[1]))),i<0&&(i=r+i);i>=0;i--)if(i in t&&t[i]===e)return i||0;return-1}:h},6833:function(e,t,r){var n=r(8113);e.exports=/(iphone|ipod|ipad).*applewebkit/i.test(n)},842:function(e,t,r){var n=r(7854);e.exports=function(e,t){var r=n.console;r&&r.error&&(1===arguments.length?r.error(e):r.error(e,t))}},9587:function(e,t,r){var n=r(111),a=r(7674);e.exports=function(e,t,r){var o,i;return a&&"function"==typeof(o=t.constructor)&&o!==r&&n(i=o.prototype)&&i!==r.prototype&&a(e,i),e}},408:function(e,t,r){var n=r(9670),a=r(7659),o=r(7466),i=r(9974),s=r(1246),c=r(3411),h=function(e,t){this.stopped=e,this.result=t};(e.exports=function(e,t,r,l,u){var d,f,p,v,m,g,b,y=i(t,r,l?2:1);if(u)d=e;else{if("function"!=typeof(f=s(e)))throw TypeError("Target is not iterable");if(a(f)){for(p=0,v=o(e.length);v>p;p++)if((m=l?y(n(b=e[p])[0],b[1]):y(e[p]))&&m instanceof h)return m;return new h(!1)}d=f.call(e)}for(g=d.next;!(b=g.call(d)).done;)if("object"==typeof(m=c(d,y,b.value,l))&&m&&m instanceof h)return m;return new h(!1)}).stop=function(e){return new h(!0,e)}},5948:function(e,t,r){var n,a,o,i,s,c,h,l,u=r(7854),d=r(1236).f,f=r(4326),p=r(261).set,v=r(6833),m=u.MutationObserver||u.WebKitMutationObserver,g=u.process,b=u.Promise,y="process"==f(g),k=d(u,"queueMicrotask"),S=k&&k.value;S||(n=function(){var e,t;for(y&&(e=g.domain)&&e.exit();a;){t=a.fn,a=a.next;try{t()}catch(e){throw a?i():o=void 0,e}}o=void 0,e&&e.enter()},y?i=function(){g.nextTick(n)}:m&&!v?(s=!0,c=document.createTextNode(""),new m(n).observe(c,{characterData:!0}),i=function(){c.data=s=!s}):b&&b.resolve?(h=b.resolve(void 0),l=h.then,i=function(){l.call(h,n)}):i=function(){p.call(u,n)}),e.exports=S||function(e){var t={fn:e,next:void 0};o&&(o.next=t),a||(a=t,i()),o=t}},3366:function(e,t,r){var n=r(7854);e.exports=n.Promise},8523:function(e,t,r){"use strict";var n=r(3099),a=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n})),this.resolve=n(t),this.reject=n(r)};e.exports.f=function(e){return new a(e)}},2534:function(e){e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},9478:function(e,t,r){var n=r(9670),a=r(111),o=r(8523);e.exports=function(e,t){if(n(e),a(t)&&t.constructor===e)return t;var r=o.f(e);return(0,r.resolve)(t),r.promise}},6340:function(e,t,r){"use strict";var n=r(5005),a=r(3070),o=r(5112),i=r(9781),s=o("species");e.exports=function(e){var t=n(e),r=a.f;i&&t&&!t[s]&&r(t,s,{configurable:!0,get:function(){return this}})}},261:function(e,t,r){var n,a,o,i=r(7854),s=r(7293),c=r(4326),h=r(9974),l=r(490),u=r(317),d=r(6833),f=i.location,p=i.setImmediate,v=i.clearImmediate,m=i.process,g=i.MessageChannel,b=i.Dispatch,y=0,k={},S=function(e){if(k.hasOwnProperty(e)){var t=k[e];delete k[e],t()}},R=function(e){return function(){S(e)}},x=function(e){S(e.data)},P=function(e){i.postMessage(e+"",f.protocol+"//"+f.host)};p&&v||(p=function(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return k[++y]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},n(y),y},v=function(e){delete k[e]},"process"==c(m)?n=function(e){m.nextTick(R(e))}:b&&b.now?n=function(e){b.now(R(e))}:g&&!d?(o=(a=new g).port2,a.port1.onmessage=x,n=h(o.postMessage,o,1)):!i.addEventListener||"function"!=typeof postMessage||i.importScripts||s(P)||"file:"===f.protocol?n="onreadystatechange"in u("script")?function(e){l.appendChild(u("script")).onreadystatechange=function(){l.removeChild(this),S(e)}}:function(e){setTimeout(R(e),0)}:(n=P,i.addEventListener("message",x,!1))),e.exports={set:p,clear:v}},9554:function(e,t,r){"use strict";var n=r(2109),a=r(8533);n({target:"Array",proto:!0,forced:[].forEach!=a},{forEach:a})},4986:function(e,t,r){var n=r(2109),a=r(6583);n({target:"Array",proto:!0,forced:a!==[].lastIndexOf},{lastIndexOf:a})},5212:function(e,t,r){"use strict";var n=r(2109),a=r(2092).some,o=r(9341),i=r(9207),s=o("some"),c=i("some");n({target:"Array",proto:!0,forced:!s||!c},{some:function(e){return a(this,e,arguments.length>1?arguments[1]:void 0)}})},8674:function(e,t,r){"use strict";var n,a,o,i,s=r(2109),c=r(1913),h=r(7854),l=r(5005),u=r(3366),d=r(1320),f=r(2248),p=r(8003),v=r(6340),m=r(111),g=r(3099),b=r(5787),y=r(4326),k=r(2788),S=r(408),R=r(7072),x=r(6707),P=r(261).set,w=r(5948),M=r(9478),T=r(842),E=r(8523),B=r(2534),C=r(9909),I=r(4705),N=r(5112),j=r(7392),_=N("species"),$="Promise",F=C.get,H=C.set,L=C.getterFor($),q=u,O=h.TypeError,A=h.document,U=h.process,V=l("fetch"),D=E.f,Q=D,G="process"==y(U),W=!!(A&&A.createEvent&&h.dispatchEvent),Y="unhandledrejection",K=I($,(function(){if(k(q)===String(q)){if(66===j)return!0;if(!G&&"function"!=typeof PromiseRejectionEvent)return!0}if(c&&!q.prototype.finally)return!0;if(j>=51&&/native code/.test(q))return!1;var e=q.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[_]=t,!(e.then((function(){}))instanceof t)})),X=K||!R((function(e){q.all(e).catch((function(){}))})),z=function(e){var t;return!(!m(e)||"function"!=typeof(t=e.then))&&t},J=function(e,t,r){if(!t.notified){t.notified=!0;var n=t.reactions;w((function(){for(var a=t.value,o=1==t.state,i=0;n.length>i;){var s,c,h,l=n[i++],u=o?l.ok:l.fail,d=l.resolve,f=l.reject,p=l.domain;try{u?(o||(2===t.rejection&&re(e,t),t.rejection=1),!0===u?s=a:(p&&p.enter(),s=u(a),p&&(p.exit(),h=!0)),s===l.promise?f(O("Promise-chain cycle")):(c=z(s))?c.call(s,d,f):d(s)):f(a)}catch(e){p&&!h&&p.exit(),f(e)}}t.reactions=[],t.notified=!1,r&&!t.rejection&&ee(e,t)}))}},Z=function(e,t,r){var n,a;W?((n=A.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),h.dispatchEvent(n)):n={promise:t,reason:r},(a=h["on"+e])?a(n):e===Y&&T("Unhandled promise rejection",r)},ee=function(e,t){P.call(h,(function(){var r,n=t.value;if(te(t)&&(r=B((function(){G?U.emit("unhandledRejection",n,e):Z(Y,e,n)})),t.rejection=G||te(t)?2:1,r.error))throw r.value}))},te=function(e){return 1!==e.rejection&&!e.parent},re=function(e,t){P.call(h,(function(){G?U.emit("rejectionHandled",e):Z("rejectionhandled",e,t.value)}))},ne=function(e,t,r,n){return function(a){e(t,r,a,n)}},ae=function(e,t,r,n){t.done||(t.done=!0,n&&(t=n),t.value=r,t.state=2,J(e,t,!0))},oe=function(e,t,r,n){if(!t.done){t.done=!0,n&&(t=n);try{if(e===r)throw O("Promise can't be resolved itself");var a=z(r);a?w((function(){var n={done:!1};try{a.call(r,ne(oe,e,n,t),ne(ae,e,n,t))}catch(r){ae(e,n,r,t)}})):(t.value=r,t.state=1,J(e,t,!1))}catch(r){ae(e,{done:!1},r,t)}}};K&&(q=function(e){b(this,q,$),g(e),n.call(this);var t=F(this);try{e(ne(oe,this,t),ne(ae,this,t))}catch(e){ae(this,t,e)}},(n=function(e){H(this,{type:$,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=f(q.prototype,{then:function(e,t){var r=L(this),n=D(x(this,q));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=G?U.domain:void 0,r.parent=!0,r.reactions.push(n),0!=r.state&&J(this,r,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),a=function(){var e=new n,t=F(e);this.promise=e,this.resolve=ne(oe,e,t),this.reject=ne(ae,e,t)},E.f=D=function(e){return e===q||e===o?new a(e):Q(e)},c||"function"!=typeof u||(i=u.prototype.then,d(u.prototype,"then",(function(e,t){var r=this;return new q((function(e,t){i.call(r,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof V&&s({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return M(q,V.apply(h,arguments))}}))),s({global:!0,wrap:!0,forced:K},{Promise:q}),p(q,$,!1,!0),v($),o=l($),s({target:$,stat:!0,forced:K},{reject:function(e){var t=D(this);return t.reject.call(void 0,e),t.promise}}),s({target:$,stat:!0,forced:c||K},{resolve:function(e){return M(c&&this===o?q:this,e)}}),s({target:$,stat:!0,forced:X},{all:function(e){var t=this,r=D(t),n=r.resolve,a=r.reject,o=B((function(){var r=g(t.resolve),o=[],i=0,s=1;S(e,(function(e){var c=i++,h=!1;o.push(void 0),s++,r.call(t,e).then((function(e){h||(h=!0,o[c]=e,--s||n(o))}),a)})),--s||n(o)}));return o.error&&a(o.value),r.promise},race:function(e){var t=this,r=D(t),n=r.reject,a=B((function(){var a=g(t.resolve);S(e,(function(e){a.call(t,e).then(r.resolve,n)}))}));return a.error&&n(a.value),r.promise}})},4603:function(e,t,r){var n=r(9781),a=r(7854),o=r(4705),i=r(9587),s=r(3070).f,c=r(8006).f,h=r(7850),l=r(7066),u=r(2999),d=r(1320),f=r(7293),p=r(9909).set,v=r(6340),m=r(5112)("match"),g=a.RegExp,b=g.prototype,y=/a/g,k=/a/g,S=new g(y)!==y,R=u.UNSUPPORTED_Y;if(n&&o("RegExp",!S||R||f((function(){return k[m]=!1,g(y)!=y||g(k)==k||"/a/i"!=g(y,"i")})))){for(var x=function(e,t){var r,n=this instanceof x,a=h(e),o=void 0===t;if(!n&&a&&e.constructor===x&&o)return e;S?a&&!o&&(e=e.source):e instanceof x&&(o&&(t=l.call(e)),e=e.source),R&&(r=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,""));var s=i(S?new g(e,t):g(e,t),n?this:b,x);return R&&r&&p(s,{sticky:r}),s},P=function(e){e in x||s(x,e,{configurable:!0,get:function(){return g[e]},set:function(t){g[e]=t}})},w=c(g),M=0;w.length>M;)P(w[M++]);b.constructor=x,x.prototype=b,d(a,"RegExp",x)}v("RegExp")},4747:function(e,t,r){var n=r(7854),a=r(8324),o=r(8533),i=r(8880);for(var s in a){var c=n[s],h=c&&c.prototype;if(h&&h.forEach!==o)try{i(h,"forEach",o)}catch(e){h.forEach=o}}}},0,[[2728,898]]]); | ||
//# sourceMappingURL=plugin.search.js.map |
@@ -0,1 +1,5 @@ | ||
# 4.17.0 | ||
- Fix: text selection on Safari @cdrini | ||
- Feature: Search results navigation bar @shaneriley | ||
# 4.16.0 | ||
@@ -2,0 +6,0 @@ - Dev: Emit custom event to trigger @iisa |
{ | ||
"name": "@internetarchive/bookreader", | ||
"version": "4.17.0-alpha.e3dcd28", | ||
"version": "4.17.0", | ||
"description": "The Internet Archive BookReader.", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -83,2 +83,3 @@ class SearchView { | ||
this.dom.results.innerHTML = ''; | ||
this.matches = []; | ||
} | ||
@@ -91,2 +92,3 @@ | ||
clearSearchFieldAndResults() { | ||
this.br.removeSearchResults(); | ||
this.toggleResultsCount(false); | ||
@@ -481,3 +483,2 @@ this.removeResultPins(); | ||
if (this.dom.searchField.value) { return; } | ||
this.br.removeSearchResults(); | ||
this.clearSearchFieldAndResults(); | ||
@@ -484,0 +485,0 @@ }); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
5804841
50472
3