@tindtechnologies/universalviewer
Version:
The Universal Viewer is a community-developed open source project on a mission to help you share your 📚📜📰📽️📻🗿 with the 🌎
2 lines • 266 kB
JavaScript
/*! For license information please see 2568.29ebba2bbac47c978ee7.js.LICENSE.txt */
(self.webpackChunkUV=self.webpackChunkUV||[]).push([[2568],{3664:(e,t,n)=>{"use strict";n.d(t,{$:()=>r});var r=function(){function e(e){this.options=e,this.options.data=Object.assign({},this.data(),e.data)}return e.prototype._init=function(){return this.el=this.options.target,this.el?(this.el.innerHTML="",!0):(console.warn("element not found"),!1)},e.prototype.data=function(){return{}},e.prototype.on=function(e,t,n){var r=this._e||(this._e={});(r[e]||(r[e]=[])).push({fn:t,ctx:n})},e.prototype.fire=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=[].slice.call(arguments,1),i=((this._e||(this._e={}))[e]||[]).slice(),a=0,o=i.length;a<o;a++)i[a].fn.apply(i[a].ctx,r)},e.prototype._resize=function(){},e.prototype.set=function(e){},e}()},8210:(e,t,n)=>{"use strict";var r,i,a,o,l,s,u,c,f;n.d(t,{A:()=>_}),function(e){e.BOOKMARKING="oa:bookmarking",e.CLASSIFYING="oa:classifying",e.COMMENTING="oa:commenting",e.DESCRIBING="oa:describing",e.EDITING="oa:editing",e.HIGHLIGHTING="oa:highlighting",e.IDENTIFYING="oa:identifying",e.LINKING="oa:linking",e.MODERATING="oa:moderating",e.PAINTING="sc:painting",e.QUESTIONING="oa:questioning",e.REPLYING="oa:replying",e.TAGGING="oa:tagging",e.TRANSCRIBING="oad:transcribing"}(r||(r={})),function(e){e.AUTO_ADVANCE="auto-advance",e.CONTINUOUS="continuous",e.FACING_PAGES="facing-pages",e.HIDDEN="hidden",e.INDIVIDUALS="individuals",e.MULTI_PART="multi-part",e.NO_NAV="no-nav",e.NON_PAGED="non-paged",e.PAGED="paged",e.REPEAT="repeat",e.SEQUENCE="sequence",e.THUMBNAIL_NAV="thumbnail-nav",e.TOGETHER="together",e.UNORDERED="unordered"}(i||(i={})),function(e){e.CANVAS="canvas",e.CHOICE="choice",e.CONTENT_AS_TEXT="contentastext",e.DOCUMENT="document",e.IMAGE="image",e.MOVING_IMAGE="movingimage",e.PDF="pdf",e.PHYSICAL_OBJECT="physicalobject",e.SOUND="sound",e.TEXTUALBODY="textualbody",e.VIDEO="video"}(a||(a={})),function(e){e.ANNOTATION="annotation",e.CANVAS="canvas",e.COLLECTION="collection",e.MANIFEST="manifest",e.RANGE="range",e.SEQUENCE="sequence"}(o||(o={})),function(e){e.AUDIO_MP4="audio/mp4",e.CORTO="application/corto",e.DRACO="application/draco",e.GLTF="model/gltf+json",e.JPG="image/jpeg",e.M3U8="application/vnd.apple.mpegurl",e.MP3="audio/mp3",e.MPEG_DASH="application/dash+xml",e.OBJ="text/plain",e.PDF="application/pdf",e.PLY="application/ply",e.THREEJS="application/vnd.threejs+json",e.VIDEO_MP4="video/mp4",e.WEBM="video/webm"}(l||(l={})),function(e){e.DOC="application/msword",e.DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",e.PDF="application/pdf"}(s||(s={})),function(e){e.IMAGE_0_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/compliance.html#level0",e.IMAGE_0_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/compliance.html#level1",e.IMAGE_0_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/compliance.html#level2",e.IMAGE_0_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/conformance.html#level0",e.IMAGE_0_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/conformance.html#level1",e.IMAGE_0_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/conformance.html#level2",e.IMAGE_1_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",e.IMAGE_1_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",e.IMAGE_1_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",e.IMAGE_1_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",e.IMAGE_1_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",e.IMAGE_1_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",e.IMAGE_1_LEVEL_0="http://iiif.io/api/image/1/level0.json",e.IMAGE_1_PROFILE_LEVEL_0="http://iiif.io/api/image/1/profiles/level0.json",e.IMAGE_1_LEVEL_1="http://iiif.io/api/image/1/level1.json",e.IMAGE_1_PROFILE_LEVEL_1="http://iiif.io/api/image/1/profiles/level1.json",e.IMAGE_1_LEVEL_2="http://iiif.io/api/image/1/level2.json",e.IMAGE_1_PROFILE_LEVEL_2="http://iiif.io/api/image/1/profiles/level2.json",e.IMAGE_2_LEVEL_0="http://iiif.io/api/image/2/level0.json",e.IMAGE_2_PROFILE_LEVEL_0="http://iiif.io/api/image/2/profiles/level0.json",e.IMAGE_2_LEVEL_1="http://iiif.io/api/image/2/level1.json",e.IMAGE_2_PROFILE_LEVEL_1="http://iiif.io/api/image/2/profiles/level1.json",e.IMAGE_2_LEVEL_2="http://iiif.io/api/image/2/level2.json",e.IMAGE_2_PROFILE_LEVEL_2="http://iiif.io/api/image/2/profiles/level2.json",e.AUTH_0_CLICK_THROUGH="http://iiif.io/api/auth/0/login/clickthrough",e.AUTH_0_LOGIN="http://iiif.io/api/auth/0/login",e.AUTH_0_LOGOUT="http://iiif.io/api/auth/0/logout",e.AUTH_0_RESTRICTED="http://iiif.io/api/auth/0/login/restricted",e.AUTH_0_TOKEN="http://iiif.io/api/auth/0/token",e.AUTH_1_CLICK_THROUGH="http://iiif.io/api/auth/1/clickthrough",e.AUTH_1_EXTERNAL="http://iiif.io/api/auth/1/external",e.AUTH_1_KIOSK="http://iiif.io/api/auth/1/kiosk",e.AUTH_1_LOGIN="http://iiif.io/api/auth/1/login",e.AUTH_1_LOGOUT="http://iiif.io/api/auth/1/logout",e.AUTH_1_PROBE="http://iiif.io/api/auth/1/probe",e.AUTH_1_TOKEN="http://iiif.io/api/auth/1/token",e.SEARCH_0="http://iiif.io/api/search/0/search",e.SEARCH_0_AUTO_COMPLETE="http://iiif.io/api/search/0/autocomplete",e.SEARCH_1="http://iiif.io/api/search/1/search",e.SEARCH_1_AUTO_COMPLETE="http://iiif.io/api/search/1/autocomplete",e.TRACKING_EXTENSIONS="http://universalviewer.io/tracking-extensions-profile",e.UI_EXTENSIONS="http://universalviewer.io/ui-extensions-profile",e.PRINT_EXTENSIONS="http://universalviewer.io/print-extensions-profile",e.SHARE_EXTENSIONS="http://universalviewer.io/share-extensions-profile",e.OTHER_MANIFESTATIONS="http://iiif.io/api/otherManifestations.json",e.IXIF="http://wellcomelibrary.org/ld/ixif/0/alpha.json"}(u||(u={})),function(e){e.BOTTOM_TO_TOP="bottom-to-top",e.LEFT_TO_RIGHT="left-to-right",e.RIGHT_TO_LEFT="right-to-left",e.TOP_TO_BOTTOM="top-to-bottom"}(c||(c={})),function(e){e.CONTINUOUS="continuous",e.INDIVIDUALS="individuals",e.NON_PAGED="non-paged",e.PAGED="paged",e.TOP="top"}(f||(f={}));var d,p=n(3664),h=n(4342),g=n(4692),v=(d=function(e,t){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},d(e,t)},function(e,t){function n(){this.constructor=e}d(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),_=function(e){function t(t){var n=e.call(this,t)||this;return n._data=n.data(),n._data=n.options.data,n._init(),n._resize(),n}return v(t,e),t.prototype._init=function(){var t=this;e.prototype._init.call(this),this._$element=g(this.el),this._$header=g('<div class="header"></div>'),this._$element.append(this._$header),this._$leftOptions=g('<div class="left"></div>'),this._$header.append(this._$leftOptions),this._$rightOptions=g('<div class="right"></div>'),this._$header.append(this._$rightOptions),this._$sizeDownButton=g('<input class="btn btn-default size-down" type="button" value="-" />'),this._$leftOptions.append(this._$sizeDownButton),this._$sizeRange=g('<input type="range" name="size" min="1" max="10" value="'+this.options.data.initialZoom+'" />'),this._$leftOptions.append(this._$sizeRange),this._$sizeUpButton=g('<input class="btn btn-default size-up" type="button" value="+" />'),this._$leftOptions.append(this._$sizeUpButton),this._$multiSelectOptions=g('<div class="multiSelectOptions"></div>'),this._$rightOptions.append(this._$multiSelectOptions),this._$selectAllButton=g('<div class="multiSelectAll"><input id="multiSelectAll" type="checkbox" tabindex="0" /><label for="multiSelectAll">'+this.options.data.content.selectAll+"</label></div>"),this._$multiSelectOptions.append(this._$selectAllButton),this._$selectAllButtonCheckbox=g(this._$selectAllButton.find("input:checkbox")),this._$selectButton=g('<a class="select" href="#">'+this.options.data.content.select+"</a>"),this._$multiSelectOptions.append(this._$selectButton),this._$main=g('<div class="main"></div>'),this._$element.append(this._$main),this._$thumbs=g('<div class="thumbs"></div>'),this._$main.append(this._$thumbs),this._$sizeDownButton.on("click",(function(){var e=Number(t._$sizeRange.val())-1;e>=Number(t._$sizeRange.attr("min"))&&(t._$sizeRange.val(e.toString()),t._$sizeRange.trigger("change"),t.fire(m.DECREASE_SIZE))})),this._$sizeUpButton.on("click",(function(){var e=Number(t._$sizeRange.val())+1;e<=Number(t._$sizeRange.attr("max"))&&(t._$sizeRange.val(e.toString()),t._$sizeRange.trigger("change"),t.fire(m.INCREASE_SIZE))})),this._$sizeRange.on("change",(function(){t._updateThumbs(),t._scrollToThumb(t._getSelectedThumbIndex())})),this._$selectAllButton.checkboxButton((function(e){var n=t._getMultiSelectState();n&&(e?n.selectAll(!0):n.selectAll(!1)),t.set(t.options.data)})),this._$selectButton.on("click",(function(){var e=t._getMultiSelectState();if(e){var n=e.getAllSelectedCanvases().map((function(e){return e.id}));t.fire(m.MULTISELECTION_MADE,n)}})),this._setRange(),g.templates({galleryThumbsTemplate:'\t\t\t\t<div class="{{:~galleryThumbClassName()}}" data-src="{{>uri}}" data-index="{{>index}}" data-visible="{{>visible}}" data-width="{{>width}}" data-height="{{>height}}" data-initialwidth="{{>initialWidth}}" data-initialheight="{{>initialHeight}}">\t\t\t\t\t\t<div class="wrap" style="width:{{>initialWidth}}px; height:{{>initialHeight}}px" data-link="class{merge:multiSelected toggle=\'multiSelected\'}">\t\t\t\t\t\t{^{if multiSelectEnabled}}\t\t\t\t\t\t\t\t<input id="thumb-checkbox-{{>id}}" type="checkbox" data-link="checked{:multiSelected ? \'checked\' : \'\'}" class="multiSelect" />\t\t\t\t\t\t{{/if}}\t\t\t\t\t\t</div>\t\t\t\t\t\t<div class="info">\t\t\t\t\t\t\t\t<span class="index" style="width:{{>initialWidth}}px">{{:#index + 1}}</span>\t\t\t\t\t\t\t\t<span class="label" style="width:{{>initialWidth}}px" title="{{>label}}">{{>label}} </span>\t\t\t\t\t\t\t\t<span class="searchResults" title="{{:~galleryThumbSearchResultsTitle()}}">{{>data.searchResults}}</span>\t\t\t\t\t\t</div>\t\t\t\t</div>'});var n=this;return g.views.helpers({galleryThumbClassName:function(){var e="thumb preLoad";return 0===this.data.index&&(e+=" first"),this.data.uri||(e+=" placeholder"),e},galleryThumbSearchResultsTitle:function(){var e=Number(this.data.data.searchResults);return e?e>1?h.DH.format(n.options.data.content.searchResults,e.toString()):h.DH.format(n.options.data.content.searchResult,e.toString()):null}}),this._$main.on("scroll",(function(){t._updateThumbs()}),this.options.data.scrollStopDuration),this.options.data.sizingEnabled||this._$sizeRange.hide(),!0},t.prototype.data=function(){return{chunkedResizingThreshold:400,content:{searchResult:"{0} search result",searchResults:"{0} search results",select:"Select",selectAll:"Select All"},debug:!1,helper:null,imageFadeInDuration:300,initialZoom:6,minLabelWidth:20,pageModeEnabled:!1,scrollStopDuration:100,searchResults:[],sizingEnabled:!0,thumbHeight:320,thumbLoadPadding:3,thumbWidth:200,viewingDirection:c.LEFT_TO_RIGHT}},t.prototype.set=function(e){if(this._data=Object.assign(this._data,e),this._data.helper&&void 0!==this._data.thumbWidth&&void 0!==this._data.thumbHeight&&(this._thumbs=this._data.helper.getThumbs(this._data.thumbWidth,this._data.thumbHeight)),this._data.viewingDirection&&(this._data.viewingDirection===c.BOTTOM_TO_TOP&&this._thumbs.reverse(),this._$thumbs.addClass(this._data.viewingDirection)),this._data.searchResults&&this._data.searchResults.length)for(var t=0;t<this._data.searchResults.length;t++){var n=this._data.searchResults[t],r=this._thumbs.filter((function(e){return e.index===n.canvasIndex}))[0],i=g.extend(!0,{},r.data);i.searchResults=n.rects.length,r.data=i}this._thumbsCache=null,this._createThumbs(),this._data.helper&&this.selectIndex(this._data.helper.canvasIndex);var a=this._getMultiSelectState();if(a&&a.isEnabled){for(this._$multiSelectOptions.show(),this._$thumbs.addClass("multiSelect"),t=0;t<a.canvases.length;t++){var o=a.canvases[t];r=this._getThumbByCanvas(o),this._setThumbMultiSelected(r,o.multiSelected)}for(t=0;t<a.ranges.length;t++)for(var l=a.ranges[t],s=this._getThumbsByRange(l),u=0;u<s.length;u++)r=s[u],this._setThumbMultiSelected(r,l.multiSelected)}else this._$multiSelectOptions.hide(),this._$thumbs.removeClass("multiSelect")},t.prototype._update=function(){var e=this._getMultiSelectState();e&&e.isEnabled&&(this._$selectAllButtonCheckbox.prop("checked",e.allSelected()),e.getAll().filter((function(e){return e.multiSelected})).length>0?this._$selectButton.show():this._$selectButton.hide())},t.prototype._getMultiSelectState=function(){return this._data.helper?this._data.helper.getMultiSelectState():null},t.prototype._createThumbs=function(){var e=this;if(this._thumbs){this._$thumbs.undelegate(".thumb","click"),this._$thumbs.empty();for(var t=this._getMultiSelectState(),n=[],r=0;r<this._thumbs.length;r++){var i=(s=this._thumbs[r]).width,a=s.height;s.initialWidth=i,n.push(a),s.multiSelectEnabled=!!t&&t.isEnabled}for(var o=h.eC.median(n),l=0;l<this._thumbs.length;l++){var s;(s=this._thumbs[l]).initialHeight=o}if(this._$thumbs.link(g.templates.galleryThumbsTemplate,this._thumbs),t&&!t.isEnabled)this._$thumbs.delegate(".thumb","click",(function(t){t.preventDefault();var n=g.view(this).data;e.fire(m.THUMB_SELECTED,n)}));else for(var u=this._$thumbs.find(".thumb"),c=function(){var e=f;g(u[d]).checkboxButton((function(t){var n=g.view(this).data;e._setThumbMultiSelected(n,!n.multiSelected);var r=e.options.data.helper.getCanvasRange(n.data),i=e._getMultiSelectState();i&&(r?i.selectRange(r,n.multiSelected):i.selectCanvas(n.data,n.multiSelected)),e._update(),e.fire(m.THUMB_MULTISELECTED,n)}))},f=this,d=0;d<u.length;d++)c()}},t.prototype._getThumbByCanvas=function(e){return this._thumbs.filter((function(t){return t.data.id===e.id}))[0]},t.prototype._sizeThumb=function(e){var t=e.data().initialwidth,n=e.data().initialheight,r=Number(t),i=Number(n),a=Math.floor(r*this._range),o=Math.floor(i*this._range),l=e.find(".wrap"),s=e.find(".label"),u=e.find(".index"),c=e.find(".searchResults"),f=a;this._data.searchResults&&this._data.searchResults.length&&(c.show(),f=a-c.outerWidth(),void 0!==this._data.minLabelWidth&&f<this._data.minLabelWidth?(c.hide(),f=a):c.show()),this._data.pageModeEnabled?(u.hide(),s.show()):(u.show(),s.hide()),l.outerWidth(a),l.outerHeight(o),u.outerWidth(f),s.outerWidth(f)},t.prototype._loadThumb=function(e,t){var n=e.find(".wrap");if(!n.hasClass("loading")&&!n.hasClass("loaded")){e.removeClass("preLoad");var r=e.attr("data-visible"),i=this._data.imageFadeInDuration||0;if("false"!==r){n.addClass("loading");var a=e.attr("data-src"),o=g('<img class="thumbImage" src="'+a+'" />');o.hide(),o.on("load",(function(){g(this).fadeIn(i,(function(){g(this).parent().switchClass("loading","loaded")}))})),n.prepend(o),t&&t(o)}else n.addClass("hidden")}},t.prototype._getThumbsByRange=function(e){var t=[];if(!this._data.helper)return t;for(var n=0;n<this._thumbs.length;n++){var r=this._thumbs[n],i=r.data,a=this._data.helper.getCanvasRange(i,e.path);a&&a.id===e.id&&t.push(r)}return t},t.prototype._updateThumbs=function(){var e=!!this._data.debug;this._setRange();var t=this._$main.scrollTop(),n=t+this._$main.height();e&&console.log("scrollTop %s, scrollBottom %s",t,n);for(var r=this._getAllThumbs(),i=0,a=0;a<r.length;a++){var o=g(r[a]),l=o.position().top,s=o.outerHeight(),u=l+s,c=s*this._data.thumbLoadPadding;l<=n+c&&u>=t-c?(i+=1,this._sizeThumb(o),o.addClass("insideScrollArea"),this._loadThumb(o)):o.removeClass("insideScrollArea")}e&&console.log("number of thumbs to update: "+i)},t.prototype._getSelectedThumbIndex=function(){return Number(this._$selectedThumb.data("index"))},t.prototype._getAllThumbs=function(){return this._thumbsCache||(this._thumbsCache=this._$thumbs.find(".thumb")),this._thumbsCache},t.prototype._getThumbByIndex=function(e){return this._$thumbs.find('[data-index="'+e+'"]')},t.prototype._scrollToThumb=function(e){var t=this._getThumbByIndex(e);this._$main.scrollTop(t.position().top)},t.prototype.selectIndex=function(e){this._thumbs&&this._thumbs.length&&(this._getAllThumbs().removeClass("selected"),this._$selectedThumb=this._getThumbByIndex(e),this._$selectedThumb.addClass("selected"),this._scrollToThumb(e),this._updateThumbs())},t.prototype._setRange=function(){var e=h.eC.normalise(Number(this._$sizeRange.val()),0,10);this._range=h.eC.clamp(e,.05,1)},t.prototype._setThumbMultiSelected=function(e,t){g.observable(e).setProperty("multiSelected",t)},t.prototype._resize=function(){},t}(p.$),m=function(){function e(){}return e.DECREASE_SIZE="decreaseSize",e.INCREASE_SIZE="increaseSize",e.MULTISELECTION_MADE="multiSelectionMade",e.THUMB_SELECTED="thumbSelected",e.THUMB_MULTISELECTED="thumbMultiSelected",e}()},4427:function(e,t,n){var r=n(4692);"undefined"!=typeof self&&self,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t,n){"undefined"!=typeof self&&self,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(6)),r(n(7)),r(n(8)),r(n(9)),r(n(10)),r(n(11)),r(n(12)),r(n(13)),r(n(14)),r(n(15)),r(n(16)),r(n(17)),r(n(18)),r(n(19)),r(n(20)),r(n(21)),r(n(22)),r(n(23)),r(n(24)),r(n(25)),r(n(26)),r(n(27)),r(n(28)),r(n(29)),r(n(30)),r(n(31)),r(n(32)),r(n(2))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BOOKMARKING="oa:bookmarking",e.CLASSIFYING="oa:classifying",e.COMMENTING="oa:commenting",e.DESCRIBING="oa:describing",e.EDITING="oa:editing",e.HIGHLIGHTING="oa:highlighting",e.IDENTIFYING="oa:identifying",e.LINKING="oa:linking",e.MODERATING="oa:moderating",e.PAINTING="sc:painting",e.QUESTIONING="oa:questioning",e.REPLYING="oa:replying",e.TAGGING="oa:tagging",e.TRANSCRIBING="oad:transcribing"}(t.AnnotationMotivation||(t.AnnotationMotivation={})),function(e){e.AUTO_ADVANCE="auto-advance",e.CONTINUOUS="continuous",e.FACING_PAGES="facing-pages",e.HIDDEN="hidden",e.INDIVIDUALS="individuals",e.MULTI_PART="multi-part",e.NO_NAV="no-nav",e.NON_PAGED="non-paged",e.PAGED="paged",e.REPEAT="repeat",e.SEQUENCE="sequence",e.THUMBNAIL_NAV="thumbnail-nav",e.TOGETHER="together",e.UNORDERED="unordered"}(t.Behavior||(t.Behavior={})),function(e){e.CANVAS="canvas",e.CHOICE="choice",e.CONTENT_AS_TEXT="contentastext",e.DOCUMENT="document",e.IMAGE="image",e.MOVING_IMAGE="movingimage",e.PDF="pdf",e.PHYSICAL_OBJECT="physicalobject",e.SOUND="sound",e.TEXTUALBODY="textualbody",e.VIDEO="video"}(t.ExternalResourceType||(t.ExternalResourceType={})),function(e){e.ANNOTATION="annotation",e.CANVAS="canvas",e.COLLECTION="collection",e.MANIFEST="manifest",e.RANGE="range",e.SEQUENCE="sequence"}(t.IIIFResourceType||(t.IIIFResourceType={})),function(e){e.AUDIO_MP4="audio/mp4",e.CORTO="application/corto",e.DRACO="application/draco",e.GLTF="model/gltf+json",e.JPG="image/jpeg",e.M3U8="application/vnd.apple.mpegurl",e.MP3="audio/mp3",e.MPEG_DASH="application/dash+xml",e.OBJ="text/plain",e.PDF="application/pdf",e.PLY="application/ply",e.THREEJS="application/vnd.threejs+json",e.VIDEO_MP4="video/mp4",e.WEBM="video/webm"}(t.MediaType||(t.MediaType={})),function(e){e.DOC="application/msword",e.DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",e.PDF="application/pdf"}(t.RenderingFormat||(t.RenderingFormat={})),function(e){e.IMAGE_0_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/compliance.html#level0",e.IMAGE_0_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/compliance.html#level1",e.IMAGE_0_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/compliance.html#level2",e.IMAGE_0_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/conformance.html#level0",e.IMAGE_0_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/conformance.html#level1",e.IMAGE_0_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/conformance.html#level2",e.IMAGE_1_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",e.IMAGE_1_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",e.IMAGE_1_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",e.IMAGE_1_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",e.IMAGE_1_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",e.IMAGE_1_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",e.IMAGE_1_LEVEL_0="http://iiif.io/api/image/1/level0.json",e.IMAGE_1_PROFILE_LEVEL_0="http://iiif.io/api/image/1/profiles/level0.json",e.IMAGE_1_LEVEL_1="http://iiif.io/api/image/1/level1.json",e.IMAGE_1_PROFILE_LEVEL_1="http://iiif.io/api/image/1/profiles/level1.json",e.IMAGE_1_LEVEL_2="http://iiif.io/api/image/1/level2.json",e.IMAGE_1_PROFILE_LEVEL_2="http://iiif.io/api/image/1/profiles/level2.json",e.IMAGE_2_LEVEL_0="http://iiif.io/api/image/2/level0.json",e.IMAGE_2_PROFILE_LEVEL_0="http://iiif.io/api/image/2/profiles/level0.json",e.IMAGE_2_LEVEL_1="http://iiif.io/api/image/2/level1.json",e.IMAGE_2_PROFILE_LEVEL_1="http://iiif.io/api/image/2/profiles/level1.json",e.IMAGE_2_LEVEL_2="http://iiif.io/api/image/2/level2.json",e.IMAGE_2_PROFILE_LEVEL_2="http://iiif.io/api/image/2/profiles/level2.json",e.AUTH_0_CLICK_THROUGH="http://iiif.io/api/auth/0/login/clickthrough",e.AUTH_0_LOGIN="http://iiif.io/api/auth/0/login",e.AUTH_0_LOGOUT="http://iiif.io/api/auth/0/logout",e.AUTH_0_RESTRICTED="http://iiif.io/api/auth/0/login/restricted",e.AUTH_0_TOKEN="http://iiif.io/api/auth/0/token",e.AUTH_1_CLICK_THROUGH="http://iiif.io/api/auth/1/clickthrough",e.AUTH_1_EXTERNAL="http://iiif.io/api/auth/1/external",e.AUTH_1_KIOSK="http://iiif.io/api/auth/1/kiosk",e.AUTH_1_LOGIN="http://iiif.io/api/auth/1/login",e.AUTH_1_LOGOUT="http://iiif.io/api/auth/1/logout",e.AUTH_1_PROBE="http://iiif.io/api/auth/1/probe",e.AUTH_1_TOKEN="http://iiif.io/api/auth/1/token",e.SEARCH_0="http://iiif.io/api/search/0/search",e.SEARCH_0_AUTO_COMPLETE="http://iiif.io/api/search/0/autocomplete",e.SEARCH_1="http://iiif.io/api/search/1/search",e.SEARCH_1_AUTO_COMPLETE="http://iiif.io/api/search/1/autocomplete",e.TRACKING_EXTENSIONS="http://universalviewer.io/tracking-extensions-profile",e.UI_EXTENSIONS="http://universalviewer.io/ui-extensions-profile",e.PRINT_EXTENSIONS="http://universalviewer.io/print-extensions-profile",e.SHARE_EXTENSIONS="http://universalviewer.io/share-extensions-profile",e.OTHER_MANIFESTATIONS="http://iiif.io/api/otherManifestations.json",e.IXIF="http://wellcomelibrary.org/ld/ixif/0/alpha.json"}(t.ServiceProfile||(t.ServiceProfile={})),function(e){e.BOTTOM_TO_TOP="bottom-to-top",e.LEFT_TO_RIGHT="left-to-right",e.RIGHT_TO_LEFT="right-to-left",e.TOP_TO_BOTTOM="top-to-bottom"}(t.ViewingDirection||(t.ViewingDirection={})),function(e){e.CONTINUOUS="continuous",e.INDIVIDUALS="individuals",e.NON_PAGED="non-paged",e.PAGED="paged",e.TOP="top"}(t.ViewingHint||(t.ViewingHint={}))},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{s(r.next(e))}catch(e){a(e)}}function l(e){try{s(r.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,l)}s((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),o=n(1),l=n(33);n(34);var s=function(){function e(){}return e.getMediaType=function(e){return(e=(e=e.toLowerCase()).split(";")[0]).trim()},e.getImageQuality=function(e){return e===o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1||e===o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2||e===o.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1||e===o.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2||e===o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1||e===o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2||e===o.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1||e===o.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2||e===o.ServiceProfile.IMAGE_1_LEVEL_1||e===o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1||e===o.ServiceProfile.IMAGE_1_LEVEL_2||e===o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2?"native":"default"},e.getInexactLocale=function(e){return-1!==e.indexOf("-")?e.substr(0,e.indexOf("-")):e},e.getLocalisedValue=function(e,t){if(!Array.isArray(e))return e;for(var n=0;n<e.length;n++){var r=e[n];if(t===r["@language"])return r["@value"]}var i=t.substr(0,t.indexOf("-"));for(n=0;n<e.length;n++){var a=e[n];if(a["@language"]===i)return a["@value"]}return null},e.generateTreeNodeIds=function(t,n){var r;void 0===n&&(n=0),r=t.parentNode?t.parentNode.id+"-"+n:"0",t.id=r;for(var i=0;i<t.nodes.length;i++){var a=t.nodes[i];e.generateTreeNodeIds(a,i)}},e.normaliseType=function(e){return-1!==(e=e.toLowerCase()).indexOf(":")?e.split(":")[1]:e},e.normaliseUrl=function(e){return-1!==(e=e.substr(e.indexOf("://"))).indexOf("#")&&(e=e.split("#")[0]),e},e.normalisedUrlsMatch=function(t,n){return e.normaliseUrl(t)===e.normaliseUrl(n)},e.isImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_1_LEVEL_0)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_1_LEVEL_1)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_1_LEVEL_2)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_2_LEVEL_0)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_2_LEVEL_1)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_2_LEVEL_2)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2))},e.isLevel0ImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_0)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_1_LEVEL_0)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_2_LEVEL_0)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0))},e.isLevel1ImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_1_LEVEL_1)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_2_LEVEL_1)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1))},e.isLevel2ImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_1_LEVEL_2)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_2_LEVEL_2)||e.normalisedUrlsMatch(t,o.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2))},e.parseManifest=function(e,t){return a.Deserialiser.parse(e,t)},e.checkStatus=function(e){if(e.ok)return e;var t=new Error(e.statusText);return t.response=e,Promise.reject(t)},e.loadManifest=function(t){return new Promise((function(n){fetch(t).then(e.checkStatus).then((function(e){return e.json()})).then((function(e){n(e)}))}))},e.loadExternalResourcesAuth1=function(t,n,r,i,a,o,l,s){return new Promise((function(u,c){var f=t.map((function(t){return e.loadExternalResourceAuth1(t,n,r,i,a,o,l,s)}));Promise.all(f).then((function(){u(t)})).catch((function(e){c(e)}))}))},e.loadExternalResourceAuth1=function(t,n,a,o,s,u,c,f){return r(this,void 0,void 0,(function(){var r;return i(this,(function(i){switch(i.label){case 0:return[4,o(t)];case 1:return(r=i.sent())?[4,t.getData(r)]:[3,6];case 2:return i.sent(),t.status!==l.OK?[3,3]:[2,t];case 3:return[4,e.doAuthChain(t,n,a,s,u,c,f)];case 4:i.sent(),i.label=5;case 5:if(t.status===l.OK||t.status===l.MOVED_TEMPORARILY)return[2,t];throw e.createAuthorizationFailedError();case 6:return[4,t.getData()];case 7:return i.sent(),t.status!==l.MOVED_TEMPORARILY&&t.status!==l.UNAUTHORIZED?[3,9]:[4,e.doAuthChain(t,n,a,s,u,c,f)];case 8:i.sent(),i.label=9;case 9:if(t.status===l.OK||t.status===l.MOVED_TEMPORARILY)return[2,t];throw e.createAuthorizationFailedError()}}))}))},e.doAuthChain=function(t,n,a,o,s,u,c){return r(this,void 0,void 0,(function(){var r,f,d,p,h,g,v,_;return i(this,(function(i){switch(i.label){case 0:return t.isAccessControlled()?((r=t.externalService)&&(r.options=t.options),(f=t.kioskService)&&(f.options=t.options),(d=t.clickThroughService)&&(d.options=t.options),(p=t.loginService)&&(p.options=t.options),t.isResponseHandled||t.status!==l.MOVED_TEMPORARILY?[3,2]:[4,u(t)]):[2,t];case 1:case 3:case 6:case 10:case 14:return i.sent(),[2,t];case 2:return h=null,g=null,(h=r)?(g=h,[4,e.attemptResourceWithToken(t,a,h)]):[3,4];case 4:return(h=f)?(g=h,(v=n(h))?[4,o(v)]:[3,7]):[3,7];case 5:case 9:case 13:return i.sent(),[4,e.attemptResourceWithToken(t,a,h)];case 7:return(h=d)?(g=h,[4,s(t,h)]):[3,11];case 8:return(_=i.sent())?[4,o(_)]:[3,11];case 11:return(h=p)?(g=h,[4,s(t,h)]):[3,15];case 12:return(_=i.sent())?[4,o(_)]:[3,15];case 15:return g&&c(t,g),[2]}}))}))},e.attemptResourceWithToken=function(e,t,n){return r(this,void 0,void 0,(function(){var r,a;return i(this,(function(i){switch(i.label){case 0:return(r=n.getService(o.ServiceProfile.AUTH_1_TOKEN))?[4,t(e,r)]:[3,3];case 1:return(a=i.sent())&&a.accessToken?[4,e.getData(a)]:[3,3];case 2:return i.sent(),[2,e];case 3:return[2]}}))}))},e.loadExternalResourcesAuth09=function(t,n,r,i,a,o,l,s,u,c){return new Promise((function(f,d){var p=t.map((function(t){return e.loadExternalResourceAuth09(t,n,r,i,a,o,l,s,u,c)}));Promise.all(p).then((function(){f(t)})).catch((function(e){d(e)}))}))},e.loadExternalResourceAuth09=function(t,n,r,i,a,o,s,u,c,f){return new Promise((function(d,p){f&&f.pessimisticAccessControl?t.getData().then((function(){t.isAccessControlled()?t.clickThroughService?(d(r(t)),d(i(t))):a(t).then((function(){o(t,!0).then((function(n){t.getData(n).then((function(){d(c(t))})).catch((function(t){p(e.createInternalServerError(t))}))})).catch((function(t){p(e.createInternalServerError(t))}))})).catch((function(t){p(e.createInternalServerError(t))})):d(t)})).catch((function(t){p(e.createInternalServerError(t))})):u(t,n).then((function(f){f?t.getData(f).then((function(){t.status===l.OK?d(c(t)):e.authorize(t,n,r,i,a,o,s,u).then((function(){d(c(t))})).catch((function(t){p(e.createAuthorizationFailedError())}))})).catch((function(t){p(e.createAuthorizationFailedError())})):e.authorize(t,n,r,i,a,o,s,u).then((function(){d(c(t))})).catch((function(t){p(e.createAuthorizationFailedError())}))})).catch((function(t){p(e.createAuthorizationFailedError())}))}))},e.createError=function(e,t){var n=new Error;return n.message=t,n.name=String(e),n},e.createAuthorizationFailedError=function(){return e.createError(a.StatusCode.AUTHORIZATION_FAILED,"Authorization failed")},e.createRestrictedError=function(){return e.createError(a.StatusCode.RESTRICTED,"Restricted")},e.createInternalServerError=function(t){return e.createError(a.StatusCode.INTERNAL_SERVER_ERROR,t)},e.authorize=function(t,n,r,i,a,o,s,u){return new Promise((function(c,f){t.getData().then((function(){t.isAccessControlled()?u(t,n).then((function(u){u?t.getData(u).then((function(){t.status===l.OK?c(t):e.showAuthInteraction(t,n,r,i,a,o,s,c,f)})).catch((function(t){f(e.createInternalServerError(t))})):o(t,!1).then((function(u){u?s(t,u,n).then((function(){t.getData(u).then((function(){t.status===l.OK?c(t):e.showAuthInteraction(t,n,r,i,a,o,s,c,f)})).catch((function(t){f(e.createInternalServerError(t))}))})).catch((function(t){f(e.createInternalServerError(t))})):e.showAuthInteraction(t,n,r,i,a,o,s,c,f)}))})).catch((function(t){f(e.createInternalServerError(t))})):c(t)}))}))},e.showAuthInteraction=function(t,n,r,i,a,o,s,u,c){t.status!==l.MOVED_TEMPORARILY||t.isResponseHandled?t.clickThroughService&&!t.isResponseHandled?r(t).then((function(){o(t,!0).then((function(r){s(t,r,n).then((function(){t.getData(r).then((function(){u(t)})).catch((function(t){c(e.createInternalServerError(t))}))})).catch((function(t){c(e.createInternalServerError(t))}))})).catch((function(t){c(e.createInternalServerError(t))}))})):a(t).then((function(){o(t,!0).then((function(r){s(t,r,n).then((function(){t.getData(r).then((function(){u(t)})).catch((function(t){c(e.createInternalServerError(t))}))})).catch((function(t){c(e.createInternalServerError(t))}))})).catch((function(t){c(e.createInternalServerError(t))}))})):u(t)},e.getService=function(e,t){for(var n=this.getServices(e),r=0;r<n.length;r++){var i=n[r];if(i.getProfile()===t)return i}return null},e.getResourceById=function(t,n){return e.traverseAndFind(t.__jsonld,"@id",n)},e.traverseAndFind=function(t,n,r){if(t.hasOwnProperty(n)&&t[n]===r)return t;for(var i=0;i<Object.keys(t).length;i++)if("object"==typeof t[Object.keys(t)[i]]){var a=e.traverseAndFind(t[Object.keys(t)[i]],n,r);if(null!=a)return a}},e.getServices=function(e){var t,n=[];if(!(t=e.__jsonld?e.__jsonld.service:e.service))return n;Array.isArray(t)||(t=[t]);for(var r=0;r<t.length;r++){var i=t[r];if("string"==typeof i){var o=this.getResourceById(e.options.resource,i);o&&n.push(new a.Service(o.__jsonld||o,e.options))}else n.push(new a.Service(i,e.options))}return n},e.getTemporalComponent=function(e){var t=/t=([^&]+)/g.exec(e),n=null;return t&&t[1]&&(n=t[1].split(",")),n},e}();t.Utils=s},function(e,t,n){"use strict";n.r(t),t.default=function(e,t){return t=t||{},new Promise((function(n,r){var i=new XMLHttpRequest,a=[],o=[],l={},s=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(JSON.parse(i.responseText))},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:s,headers:{keys:function(){return a},entries:function(){return o},get:function(e){return l[e.toLowerCase()]},has:function(e){return e.toLowerCase()in l}}}};for(var u in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,n){a.push(t=t.toLowerCase()),o.push([t,n]),l[t]=l[t]?l[t]+","+n:n})),n(s())},i.onerror=r,i.withCredentials="include"==t.credentials,t.headers)i.setRequestHeader(u,t.headers[u]);i.send(t.body||null)}))}},function(e,t,n){e.exports=n(5)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(0));var r=n(2);t.loadManifest=function(e){return r.Utils.loadManifest(e)},t.parseManifest=function(e,t){return r.Utils.parseManifest(e,t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this.__jsonld=e,this.context=this.getProperty("context"),this.id=this.getProperty("id")}return e.prototype.getProperty=function(e){var t=null;return this.__jsonld&&((t=this.__jsonld[e])||(t=this.__jsonld["@"+e])),t},e}();t.JSONLDResource=r},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),o=n(1),l=function(e){function t(t,n){var r=e.call(this,t)||this;return r.options=n,r}return i(t,e),t.prototype.getIIIFResourceType=function(){return a.Utils.normaliseType(this.getProperty("type"))},t.prototype.getLabel=function(){var e=this.getProperty("label");return e?a.LanguageMap.parse(e,this.options.locale):[]},t.prototype.getDefaultLabel=function(){return a.LanguageMap.getValue(this.getLabel())},t.prototype.getMetadata=function(){var e=this.getProperty("metadata"),t=[];if(!e)return t;for(var n=0;n<e.length;n++){var r=e[n],i=new a.LabelValuePair(this.options.locale);i.parse(r),t.push(i)}return t},t.prototype.getRendering=function(e){for(var t=this.getRenderings(),n=0;n<t.length;n++){var r=t[n];if(r.getFormat()===e)return r}return null},t.prototype.getRenderings=function(){var e,t=[];if(!(e=this.__jsonld?this.__jsonld.rendering:this.rendering))return t;Array.isArray(e)||(e=[e]);for(var n=0;n<e.length;n++){var r=e[n];t.push(new a.Rendering(r,this.options))}return t},t.prototype.getService=function(e){return a.Utils.getService(this,e)},t.prototype.getServices=function(){return a.Utils.getServices(this)},t.prototype.getThumbnail=function(){var e=this.getProperty("thumbnail");return Array.isArray(e)&&(e=e[0]),e?new a.Thumbnail(e,this.options):null},t.prototype.isAnnotation=function(){return this.getIIIFResourceType()===o.IIIFResourceType.ANNOTATION},t.prototype.isCanvas=function(){return this.getIIIFResourceType()===o.IIIFResourceType.CANVAS},t.prototype.isCollection=function(){return this.getIIIFResourceType()===o.IIIFResourceType.COLLECTION},t.prototype.isManifest=function(){return this.getIIIFResourceType()===o.IIIFResourceType.MANIFEST},t.prototype.isRange=function(){return this.getIIIFResourceType()===o.IIIFResourceType.RANGE},t.prototype.isSequence=function(){return this.getIIIFResourceType()===o.IIIFResourceType.SEQUENCE},t}(a.JSONLDResource);t.ManifestResource=l},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),o=function(e){function t(t,n){return e.call(this,t,n)||this}return i(t,e),t.prototype.getFormat=function(){var e=this.getProperty("format");return e?e.toLowerCase():null},t.prototype.getResources=function(){var e=[];if(!this.__jsonld.resources)return e;for(var t=0;t<this.__jsonld.resources.length;t++){var n=this.__jsonld.resources[t],r=new a.Annotation(n,this.options);e.push(r)}return e},t.prototype.getType=function(){var e=this.getProperty("type");return e?a.Utils.normaliseType(e):null},t.prototype.getWidth=function(){return this.getProperty("width")},t.prototype.getHeight=function(){return this.getProperty("height")},t.prototype.getMaxWidth=function(){return this.getProperty("maxWidth")},t.prototype.getMaxHeight=function(){return this.getProperty("maxHeight")?null:this.getMaxWidth()},t}(a.ManifestResource);t.Resource=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),o=n(1),l=function(e){function t(t,n){var r=e.call(this,t,n)||this;r.index=-1,r.isLoaded=!1;var i={defaultLabel:"-",locale:"en-GB",resource:r,pessimisticAccessControl:!1};return r.options=Object.assign(i,n),r}return i(t,e),t.prototype.getAttribution=function(){var e=this.getProperty("attribution");return e?a.LanguageMap.parse(e,this.options.locale):[]},t.prototype.getDescription=function(){var e=this.getProperty("description");return e?a.LanguageMap.parse(e,this.options.locale):[]},t.prototype.getIIIFResourceType=function(){return a.Utils.normaliseType(this.getProperty("type"))},t.prototype.getLogo=function(){var e=this.getProperty("logo");return e?"string"==typeof e?e:(Array.isArray(e)&&e.length&&(e=e[0]),e["@id"]||e.id):null},t.prototype.getLicense=function(){return a.Utils.getLocalisedValue(this.getProperty("license"),this.options.locale)},t.prototype.getNavDate=function(){return new Date(this.getProperty("navDate"))},t.prototype.getRelated=function(){return this.getProperty("related")},t.prototype.getSeeAlso=function(){return this.getProperty("seeAlso")},t.prototype.getTrackingLabel=function(){var e=this.getService(o.ServiceProfile.TRACKING_EXTENSIONS);return e?e.getProperty("trackingLabel"):""},t.prototype.getDefaultTree=function(){return this.defaultTree=new a.TreeNode("root"),this.defaultTree.data=this,this.defaultTree},t.prototype.getRequiredStatement=function(){var e=null,t=this.getProperty("requiredStatement");if(t)(e=new a.LabelValuePair(this.options.locale)).parse(t);else{var n=this.getAttribution();n&&((e=new a.LabelValuePair(this.options.locale)).value=n)}return e},t.prototype.isCollection=function(){return this.getIIIFResourceType()===o.IIIFResourceType.COLLECTION},t.prototype.isManifest=function(){return this.getIIIFResourceType()===o.IIIFResourceType.MANIFEST},t.prototype.load=function(){var e=this;return new Promise((function(t){if(e.isLoaded)t(e);else{var n=e.options;n.navDate=e.getNavDate();var r=e.__jsonld.id;r||(r=e.__jsonld["@id"]),a.Utils.loadManifest(r).then((function(r){e.parentLabel=a.LanguageMap.getValue(e.getLabel(),n.locale);var i=a.Deserialiser.parse(r,n);(e=Object.assign(e,i)).index=n.index,t(e)}))}}))},t}(a.ManifestResource);t.IIIFResource=l},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),o=function(e){function t(t,n){return e.call(this,t,n)||this}return i(t,e),t.prototype.getBody=function(){var e=[],t=this.getProperty("body");if(t)if(Array.isArray(t))for(var n=0;n<t.length;n++)if((o=t[n]).items)for(var r=0;r<o.items.length;r++){var i=o.items[r];e.push(new a.AnnotationBody(i,this.options))}else e.push(new a.AnnotationBody(o,this.options));else if(t.items)for(n=0;n<t.items.length;n++){var o=t.items[n];e.push(new a.AnnotationBody(o,this.options))}else e.push(new a.AnnotationBody(t,this.options));return e},t.prototype.getMotivation=function(){return this.getProperty("motivation")||null},t.prototype.getOn=function(){return this.getProperty("on")},t.prototype.getTarget=function(){return this.getProperty("target")},t.prototype.getResource=function(){return new a.Resource(this.getProperty("resource"),this.options)},t}(a.ManifestResource);t.Annotation=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),o=function(e){function t(t,n){return e.call(this,t,n)||this}return i(t,e),t.prototype.getFormat=function(){var e=this.getProperty("format");return e?a.Utils.getMediaType(e):null},t.prototype.getType=function(){return this.getProperty("type")?a.Utils.normaliseType(this.getProperty("type")):null},t.prototype.getWidth=function(){return this.getProperty("width")},t.prototype.getHeight=function(){return this.getProperty("height")},t}(a.ManifestResource);t.AnnotationBody=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),o=function(e){function t(t,n,r){var i=e.call(this,n)||this;return i.label=t,i.options=r,i}return i(t,e),t.prototype.getIIIFResourceType=function(){return a.Utils.normaliseType(this.getProperty("type"))},t.prototype.getLabel=function(){return this.label},t.prototype.getResources=function(){var e=this;return this.getProperty("resources").map((function(t){return new a.Annotation(t,e.options)}))},t.prototype.load=function(){var e=this;return new Promise((function(t,n){if(e.isLoaded)t(e);else{var r=e.__jsonld.id;r||(r=e.__jsonld["@id"]),a.Utils.loadManifest(r).then((function(n){e.__jsonld=n,e.context=e.getProperty("context"),e.id=e.getProperty("id"),e.isLoaded=!0,t(e)})).catch(n)}}))},t}(a.JSONLDResource);t.AnnotationList=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(t,n){return e.call(this,t,n)||this}return i(t,e),t.prototype.getItems=function(){return this.getProperty("items")},t}(n(0).ManifestResource);t.AnnotationPage=a},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,ne