New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

manifesto.js

Package Overview
Dependencies
Maintainers
1
Versions
131
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

manifesto.js - npm Package Compare versions

Comparing version

to
4.2.2

test/tests/bad-manifest-url.js

5

dist-commonjs/Utils.js

@@ -211,3 +211,3 @@ "use strict";

Utils.loadManifest = function (url) {
return new Promise(function (resolve) {
return new Promise(function (resolve, reject) {
fetch(url)

@@ -218,2 +218,5 @@ .then(Utils.checkStatus)

resolve(data);
})
.catch(function (err) {
reject();
});

@@ -220,0 +223,0 @@ });

@@ -209,3 +209,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

Utils.loadManifest = function (url) {
return new Promise(function (resolve) {
return new Promise(function (resolve, reject) {
fetch(url)

@@ -216,2 +216,5 @@ .then(Utils.checkStatus)

resolve(data);
})
.catch(function (err) {
reject();
});

@@ -218,0 +221,0 @@ });

2

dist-var/manifesto.js

@@ -1,1 +0,1 @@

var manifesto=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}([function(e,t,r){"use strict";function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),n(r(6)),n(r(7)),n(r(8)),n(r(9)),n(r(10)),n(r(11)),n(r(12)),n(r(13)),n(r(14)),n(r(15)),n(r(16)),n(r(17)),n(r(18)),n(r(19)),n(r(22)),n(r(23)),n(r(24)),n(r(25)),n(r(26)),n(r(27)),n(r(28)),n(r(29)),n(r(30)),n(r(31)),n(r(32)),n(r(33)),n(r(34)),n(r(2))},function(e,t,r){"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,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),a=r(1),s=r(20);r(21);var u=function(){function e(){}return e.getMediaType=function(e){return(e=(e=e.toLowerCase()).split(";")[0]).trim()},e.getImageQuality=function(e){return e===a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_1_LEVEL_1||e===a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1||e===a.ServiceProfile.IMAGE_1_LEVEL_2||e===a.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 r=0;r<e.length;r++){var n=e[r];if(t===n["@language"])return n["@value"]}var i=t.substr(0,t.indexOf("-"));for(r=0;r<e.length;r++){var o=e[r];if(o["@language"]===i)return o["@value"]}return null},e.generateTreeNodeIds=function(t,r){var n;void 0===r&&(r=0),n=t.parentNode?t.parentNode.id+"-"+r:"0",t.id=n;for(var i=0;i<t.nodes.length;i++){var o=t.nodes[i];e.generateTreeNodeIds(o,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,r){return e.normaliseUrl(t)===e.normaliseUrl(r)},e.isImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2))},e.isLevel0ImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0))},e.isLevel1ImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1))},e.isLevel2ImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2))},e.parseManifest=function(e,t){return o.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(r){fetch(t).then(e.checkStatus).then((function(e){return e.json()})).then((function(e){r(e)}))}))},e.loadExternalResourcesAuth1=function(t,r,n,i,o,a,s,u){return new Promise((function(l,c){var p=t.map((function(t){return e.loadExternalResourceAuth1(t,r,n,i,o,a,s,u)}));Promise.all(p).then((function(){l(t)})).catch((function(e){c(e)}))}))},e.loadExternalResourceAuth1=function(t,r,o,a,u,l,c,p){return n(this,void 0,void 0,(function(){var n;return i(this,(function(i){switch(i.label){case 0:return[4,a(t)];case 1:return(n=i.sent())?[4,t.getData(n)]:[3,6];case 2:return i.sent(),t.status!==s.OK?[3,3]:[2,t];case 3:return[4,e.doAuthChain(t,r,o,u,l,c,p)];case 4:i.sent(),i.label=5;case 5:if(t.status===s.OK||t.status===s.MOVED_TEMPORARILY)return[2,t];throw e.createAuthorizationFailedError();case 6:return[4,t.getData()];case 7:return i.sent(),t.status!==s.MOVED_TEMPORARILY&&t.status!==s.UNAUTHORIZED?[3,9]:[4,e.doAuthChain(t,r,o,u,l,c,p)];case 8:i.sent(),i.label=9;case 9:if(t.status===s.OK||t.status===s.MOVED_TEMPORARILY)return[2,t];throw e.createAuthorizationFailedError()}}))}))},e.doAuthChain=function(t,r,o,a,u,l,c){return n(this,void 0,void 0,(function(){var n,p,f,h,_,g,d,v;return i(this,(function(i){switch(i.label){case 0:return t.isAccessControlled()?((n=t.externalService)&&(n.options=t.options),(p=t.kioskService)&&(p.options=t.options),(f=t.clickThroughService)&&(f.options=t.options),(h=t.loginService)&&(h.options=t.options),t.isResponseHandled||t.status!==s.MOVED_TEMPORARILY?[3,2]:[4,l(t)]):[2,t];case 1:return i.sent(),[2,t];case 2:return _=null,g=null,(_=n)?(g=_,[4,e.attemptResourceWithToken(t,o,_)]):[3,4];case 3:return i.sent(),[2,t];case 4:return(_=p)?(g=_,(d=r(_))?[4,a(d)]:[3,7]):[3,7];case 5:return i.sent(),[4,e.attemptResourceWithToken(t,o,_)];case 6:return i.sent(),[2,t];case 7:return(_=f)?(g=_,[4,u(t,_)]):[3,11];case 8:return(v=i.sent())?[4,a(v)]:[3,11];case 9:return i.sent(),[4,e.attemptResourceWithToken(t,o,_)];case 10:return i.sent(),[2,t];case 11:return(_=h)?(g=_,[4,u(t,_)]):[3,15];case 12:return(v=i.sent())?[4,a(v)]:[3,15];case 13:return i.sent(),[4,e.attemptResourceWithToken(t,o,_)];case 14:return i.sent(),[2,t];case 15:return g&&c(t,g),[2]}}))}))},e.attemptResourceWithToken=function(e,t,r){return n(this,void 0,void 0,(function(){var n,o;return i(this,(function(i){switch(i.label){case 0:return(n=r.getService(a.ServiceProfile.AUTH_1_TOKEN))?[4,t(e,n)]:[3,3];case 1:return(o=i.sent())&&o.accessToken?[4,e.getData(o)]:[3,3];case 2:return i.sent(),[2,e];case 3:return[2]}}))}))},e.loadExternalResourcesAuth09=function(t,r,n,i,o,a,s,u,l,c){return new Promise((function(p,f){var h=t.map((function(t){return e.loadExternalResourceAuth09(t,r,n,i,o,a,s,u,l,c)}));Promise.all(h).then((function(){p(t)})).catch((function(e){f(e)}))}))},e.loadExternalResourceAuth09=function(t,r,n,i,o,a,u,l,c,p){return new Promise((function(f,h){p&&p.pessimisticAccessControl?t.getData().then((function(){t.isAccessControlled()?t.clickThroughService?(f(n(t)),f(i(t))):o(t).then((function(){a(t,!0).then((function(r){t.getData(r).then((function(){f(c(t))})).catch((function(t){h(e.createInternalServerError(t))}))})).catch((function(t){h(e.createInternalServerError(t))}))})).catch((function(t){h(e.createInternalServerError(t))})):f(t)})).catch((function(t){h(e.createInternalServerError(t))})):l(t,r).then((function(p){p?t.getData(p).then((function(){t.status===s.OK?f(c(t)):e.authorize(t,r,n,i,o,a,u,l).then((function(){f(c(t))})).catch((function(t){h(e.createAuthorizationFailedError())}))})).catch((function(t){h(e.createAuthorizationFailedError())})):e.authorize(t,r,n,i,o,a,u,l).then((function(){f(c(t))})).catch((function(t){h(e.createAuthorizationFailedError())}))})).catch((function(t){h(e.createAuthorizationFailedError())}))}))},e.createError=function(e,t){var r=new Error;return r.message=t,r.name=String(e),r},e.createAuthorizationFailedError=function(){return e.createError(o.StatusCode.AUTHORIZATION_FAILED,"Authorization failed")},e.createRestrictedError=function(){return e.createError(o.StatusCode.RESTRICTED,"Restricted")},e.createInternalServerError=function(t){return e.createError(o.StatusCode.INTERNAL_SERVER_ERROR,t)},e.authorize=function(t,r,n,i,o,a,u,l){return new Promise((function(c,p){t.getData().then((function(){t.isAccessControlled()?l(t,r).then((function(l){l?t.getData(l).then((function(){t.status===s.OK?c(t):e.showAuthInteraction(t,r,n,i,o,a,u,c,p)})).catch((function(t){p(e.createInternalServerError(t))})):a(t,!1).then((function(l){l?u(t,l,r).then((function(){t.getData(l).then((function(){t.status===s.OK?c(t):e.showAuthInteraction(t,r,n,i,o,a,u,c,p)})).catch((function(t){p(e.createInternalServerError(t))}))})).catch((function(t){p(e.createInternalServerError(t))})):e.showAuthInteraction(t,r,n,i,o,a,u,c,p)}))})).catch((function(t){p(e.createInternalServerError(t))})):c(t)}))}))},e.showAuthInteraction=function(t,r,n,i,o,a,u,l,c){t.status!==s.MOVED_TEMPORARILY||t.isResponseHandled?t.clickThroughService&&!t.isResponseHandled?n(t).then((function(){a(t,!0).then((function(n){u(t,n,r).then((function(){t.getData(n).then((function(){l(t)})).catch((function(t){c(e.createInternalServerError(t))}))})).catch((function(t){c(e.createInternalServerError(t))}))})).catch((function(t){c(e.createInternalServerError(t))}))})):o(t).then((function(){a(t,!0).then((function(n){u(t,n,r).then((function(){t.getData(n).then((function(){l(t)})).catch((function(t){c(e.createInternalServerError(t))}))})).catch((function(t){c(e.createInternalServerError(t))}))})).catch((function(t){c(e.createInternalServerError(t))}))})):l(t)},e.getService=function(e,t){for(var r=this.getServices(e),n=0;n<r.length;n++){var i=r[n];if(i.getProfile()===t)return i}return null},e.getResourceById=function(t,r){return e.traverseAndFind(t.__jsonld,"@id",r)},e.traverseAndFind=function(t,r,n){if(t.hasOwnProperty(r)&&t[r]===n)return t;for(var i=0;i<Object.keys(t).length;i++)if("object"==typeof t[Object.keys(t)[i]]){var o=e.traverseAndFind(t[Object.keys(t)[i]],r,n);if(null!=o)return o}},e.getServices=function(e){var t,r=[];if(!(t=e.__jsonld?e.__jsonld.service:e.service))return r;Array.isArray(t)||(t=[t]);for(var n=0;n<t.length;n++){var i=t[n];if("string"==typeof i){var a=this.getResourceById(e.options.resource,i);a&&r.push(new o.Service(a.__jsonld||a,e.options))}else r.push(new o.Service(i,e.options))}return r},e.getTemporalComponent=function(e){var t=/t=([^&]+)/g.exec(e),r=null;return t&&t[1]&&(r=t[1].split(",")),r},e}();t.Utils=u},function(e,t,r){"use strict";r.r(t),t.default=function(e,t){return t=t||{},new Promise((function(r,n){var i=new XMLHttpRequest,o=[],a=[],s={},u=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:u,headers:{keys:function(){return o},entries:function(){return a},get:function(e){return s[e.toLowerCase()]},has:function(e){return e.toLowerCase()in s}}}};for(var l in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,r){o.push(t=t.toLowerCase()),a.push([t,r]),s[t]=s[t]?s[t]+","+r:r})),r(u())},i.onerror=n,i.withCredentials="include"==t.credentials,t.headers)i.setRequestHeader(l,t.headers[l]);i.send(t.body||null)}))}},function(e,t,r){e.exports=r(5)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(0));var n=r(2);t.loadManifest=function(e){return n.Utils.loadManifest(e)},t.parseManifest=function(e,t){return n.Utils.parseManifest(e,t)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=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=n},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),a=r(1),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.options=r,n}return i(t,e),t.prototype.getIIIFResourceType=function(){return o.Utils.normaliseType(this.getProperty("type"))},t.prototype.getLabel=function(){var e=this.getProperty("label");return e?o.PropertyValue.parse(e,this.options.locale):new o.PropertyValue([],this.options.locale)},t.prototype.getDefaultLabel=function(){return this.getLabel().getValue(this.options.locale)},t.prototype.getMetadata=function(){var e=this.getProperty("metadata"),t=[];if(!e)return t;for(var r=0;r<e.length;r++){var n=e[r],i=new o.LabelValuePair(this.options.locale);i.parse(n),t.push(i)}return t},t.prototype.getRendering=function(e){for(var t=this.getRenderings(),r=0;r<t.length;r++){var n=t[r];if(n.getFormat()===e)return n}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 r=0;r<e.length;r++){var n=e[r];t.push(new o.Rendering(n,this.options))}return t},t.prototype.getService=function(e){return o.Utils.getService(this,e)},t.prototype.getServices=function(){return o.Utils.getServices(this)},t.prototype.getThumbnail=function(){var e=this.getProperty("thumbnail");return Array.isArray(e)&&(e=e[0]),e?new o.Thumbnail(e,this.options):null},t.prototype.isAnnotation=function(){return this.getIIIFResourceType()===a.IIIFResourceType.ANNOTATION},t.prototype.isCanvas=function(){return this.getIIIFResourceType()===a.IIIFResourceType.CANVAS},t.prototype.isCollection=function(){return this.getIIIFResourceType()===a.IIIFResourceType.COLLECTION},t.prototype.isManifest=function(){return this.getIIIFResourceType()===a.IIIFResourceType.MANIFEST},t.prototype.isRange=function(){return this.getIIIFResourceType()===a.IIIFResourceType.RANGE},t.prototype.isSequence=function(){return this.getIIIFResourceType()===a.IIIFResourceType.SEQUENCE},t}(o.JSONLDResource);t.ManifestResource=s},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),a=function(e){function t(t,r){return e.call(this,t,r)||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 r=this.__jsonld.resources[t],n=new o.Annotation(r,this.options);e.push(n)}return e},t.prototype.getType=function(){var e=this.getProperty("type");return e?o.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}(o.ManifestResource);t.Resource=a},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),a=r(1),s=function(e){function t(t,r){var n=e.call(this,t,r)||this;n.index=-1,n.isLoaded=!1;var i={defaultLabel:"-",locale:"en-GB",resource:n,pessimisticAccessControl:!1};return n.options=Object.assign(i,r),n}return i(t,e),t.prototype.getAttribution=function(){var e=this.getProperty("attribution");return e?o.PropertyValue.parse(e,this.options.locale):new o.PropertyValue([],this.options.locale)},t.prototype.getDescription=function(){var e=this.getProperty("description");return e?o.PropertyValue.parse(e,this.options.locale):new o.PropertyValue([],this.options.locale)},t.prototype.getHomepage=function(){var e=this.getProperty("homepage");return e?"string"==typeof e?e:(Array.isArray(e)&&e.length&&(e=e[0]),e["@id"]||e.id):null},t.prototype.getIIIFResourceType=function(){return o.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 o.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(a.ServiceProfile.TRACKING_EXTENSIONS);return e?e.getProperty("trackingLabel"):""},t.prototype.getDefaultTree=function(){return this.defaultTree=new o.TreeNode("root"),this.defaultTree.data=this,this.defaultTree},t.prototype.getRequiredStatement=function(){var e=null,t=this.getProperty("requiredStatement");if(t)(e=new o.LabelValuePair(this.options.locale)).parse(t);else{var r=this.getAttribution();r&&((e=new o.LabelValuePair(this.options.locale)).value=r)}return e},t.prototype.isCollection=function(){return this.getIIIFResourceType()===a.IIIFResourceType.COLLECTION},t.prototype.isManifest=function(){return this.getIIIFResourceType()===a.IIIFResourceType.MANIFEST},t.prototype.load=function(){var e=this;return new Promise((function(t){if(e.isLoaded)t(e);else{var r=e.options;r.navDate=e.getNavDate();var n=e.__jsonld.id;n||(n=e.__jsonld["@id"]),o.Utils.loadManifest(n).then((function(n){e.parentLabel=e.getLabel().getValue(r.locale);var i=o.Deserialiser.parse(n,r);(e=Object.assign(e,i)).index=r.index,t(e)}))}}))},t}(o.ManifestResource);t.IIIFResource=s},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),a=function(e){function t(t,r){return e.call(this,t,r)||this}return i(t,e),t.prototype.getBody=function(){var e=[],t=this.getProperty("body");if(t)if(Array.isArray(t))for(var r=0;r<t.length;r++){if((a=t[r]).items)for(var n=0;n<a.items.length;n++){var i=a.items[n];e.push(new o.AnnotationBody(i,this.options))}else e.push(new o.AnnotationBody(a,this.options))}else if(t.items)for(r=0;r<t.items.length;r++){var a=t.items[r];e.push(new o.AnnotationBody(a,this.options))}else e.push(new o.AnnotationBody(t,this.options));return e},t.prototype.getMotivation=function(){var e=this.getProperty("motivation");return e||null},t.prototype.getOn=function(){return this.getProperty("on")},t.prototype.getTarget=function(){return this.getProperty("target")},t.prototype.getResource=function(){return new o.Resource(this.getProperty("resource"),this.options)},t}(o.ManifestResource);t.Annotation=a},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),a=function(e){function t(t,r){return e.call(this,t,r)||this}return i(t,e),t.prototype.getFormat=function(){var e=this.getProperty("format");return e?o.Utils.getMediaType(e):null},t.prototype.getType=function(){return this.getProperty("type")?o.Utils.normaliseType(this.getProperty("type")):null},t.prototype.getWidth=function(){return this.getProperty("width")},t.prototype.getHeight=function(){return this.getProperty("height")},t}(o.ManifestResource);t.AnnotationBody=a},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),a=function(e){function t(t,r,n){var i=e.call(this,r)||this;return i.label=t,i.options=n,i}return i(t,e),t.prototype.getIIIFResourceType=function(){return o.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 o.Annotation(t,e.options)}))},t.prototype.load=function(){var e=this;return new Promise((function(t,r){if(e.isLoaded)t(e);else{var n=e.__jsonld.id;n||(n=e.__jsonld["@id"]),o.Utils.loadManifest(n).then((function(r){e.__jsonld=r,e.context=e.getProperty("context"),e.id=e.getProperty("id"),e.isLoaded=!0,t(e)})).catch(r)}}))},t}(o.JSONLDResource);t.AnnotationList=a},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t,r){return e.call(this,t,r)||this}return i(t,e),t.prototype.getItems=function(){return this.getProperty("items")},t}(r(0).ManifestResource);t.AnnotationPage=o},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),a=function(e){function t(t,r){return e.call(this,t,r)||this}return i(t,e),t.prototype.getCanonicalImageUri=function(e){var t,r=null,n="default",i=e;if(this.externalResource&&this.externalResource.data&&this.externalResource.data["@id"])r=this.externalResource.data["@id"],i||(i=this.externalResource.data.width),this.externalResource.data["@context"]&&(this.externalResource.data["@context"].indexOf("/1.0/context.json")>-1||this.externalResource.data["@context"].indexOf("/1.1/context.json")>-1||this.externalResource.data["@context"].indexOf("/1/context.json")>-1)&&(n="native");else{var a=this.getImages();if(a&&a.length){var s=a[0].getResource(),u=s.getServices();if(i||(i=s.getWidth()),u.length){var l=u[0];r=l.id,n=o.Utils.getImageQuality(l.getProfile())}else if(i===s.getWidth())return s.id}if(!r){var c=this.getProperty("thumbnail");if(c){if("string"==typeof c)return c;if(c["@id"])return c["@id"];if(c.length)return c[0].id}}}return t=i+",",r&&r.endsWith("/")&&(r=r.substr(0,r.length-1)),[r,"full",t,0,n+".jpg"].join("/")},t.prototype.getMaxDimensions=function(){var e,t=null;return this.externalResource&&this.externalResource.data&&this.externalResource.data.profile&&(e=this.externalResource.data.profile,Array.isArray(e)&&(e=e.filter((function(e){return e.maxWidth}))[0])&&(t=new o.Size(e.maxWidth,e.maxHeight?e.maxHeight:e.maxWidth))),t},t.prototype.getContent=function(){var e=[],t=this.__jsonld.items||this.__jsonld.content;if(!t)return e;var r=null;if(t.length&&(r=new o.AnnotationPage(t[0],this.options)),!r)return e;for(var n=r.getItems(),i=0;i<n.length;i++){var a=n[i],s=new o.Annotation(a,this.options);e.push(s)}return e},t.prototype.getDuration=function(){return this.getProperty("duration")},t.prototype.getImages=function(){var e=[];if(!this.__jsonld.images)return e;for(var t=0;t<this.__jsonld.images.length;t++){var r=this.__jsonld.images[t],n=new o.Annotation(r,this.options);e.push(n)}return e},t.prototype.getIndex=function(){return this.getProperty("index")},t.prototype.getOtherContent=function(){var e=this,t=Array.isArray(this.getProperty("otherContent"))?this.getProperty("otherContent"):[this.getProperty("otherContent")],r=t.filter((function(e){return e&&(t=e["@type"],r="sc:AnnotationList","string"==typeof t&&"string"==typeof r&&t.toLowerCase()==t.toLowerCase());var t,r})).map((function(t,r){return new o.AnnotationList(t.label||"Annotation list "+r,t,e.options)})).map((function(e){return e.load()}));return Promise.all(r)},t.prototype.getWidth=function(){return this.getProperty("width")},t.prototype.getHeight=function(){return this.getProperty("height")},t.prototype.getViewingHint=function(){return this.getProperty("viewingHint")},t}(o.Resource);t.Canvas=a},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1),a=r(0),s=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.items=[],n._collections=null,n._manifests=null,t.__collection=n,n}return i(t,e),t.prototype.getCollections=function(){return this._collections?this._collections:this._collections=this.items.filter((function(e){return e.isCollection()}))},t.prototype.getManifests=function(){return this._manifests?this._manifests:this._manifests=this.items.filter((function(e){return e.isManifest()}))},t.prototype.getCollectionByIndex=function(e){for(var t,r=this.getCollections(),n=0;n<r.length;n++){var i=r[n];i.index===e&&(t=i)}if(t)return t.options.index=e,t.load();throw new Error("Collection index not found")},t.prototype.getManifestByIndex=function(e){for(var t,r=this.getManifests(),n=0;n<r.length;n++){var i=r[n];i.index===e&&(t=i)}if(t)return t.options.index=e,t.load();throw new Error("Manifest index not found")},t.prototype.getTotalCollections=function(){return this.getCollections().length},t.prototype.getTotalManifests=function(){return this.getManifests().length},t.prototype.getTotalItems=function(){return this.items.length},t.prototype.getViewingDirection=function(){return this.getProperty("viewingDirection")?this.getProperty("viewingDirection"):o.ViewingDirection.LEFT_TO_RIGHT},t.prototype.getBehavior=function(){var e=this.getProperty("behavior");return Array.isArray(e)&&(e=e[0]),e||null},t.prototype.getViewingHint=function(){return this.getProperty("viewingHint")},t.prototype.getDefaultTree=function(){return e.prototype.getDefaultTree.call(this),this.defaultTree.data.type=a.Utils.normaliseType(a.TreeNodeType.COLLECTION),this._parseManifests(this),this._parseCollections(this),a.Utils.generateTreeNodeIds(this.defaultTree),this.defaultTree},t.prototype._parseManifests=function(e){if(e.getManifests()&&e.getManifests().length)for(var t=0;t<e.getManifests().length;t++){var r=e.getManifests()[t],n=r.getDefaultTree();n.label=r.parentLabel||r.getLabel().getValue(this.options.locale)||"manifest "+(t+1),n.navDate=r.getNavDate(),n.data.id=r.id,n.data.type=a.Utils.normaliseType(a.TreeNodeType.MANIFEST),e.defaultTree.addNode(n)}},t.prototype._parseCollections=function(e){if(e.getCollections()&&e.getCollections().length)for(var t=0;t<e.getCollections().length;t++){var r=e.getCollections()[t],n=r.getDefaultTree();n.label=r.parentLabel||r.getLabel().getValue(this.options.locale)||"collection "+(t+1),n.navDate=r.getNavDate(),n.data.id=r.id,n.data.type=a.Utils.normaliseType(a.TreeNodeType.COLLECTION),e.defaultTree.addNode(n)}},t}(a.IIIFResource);t.Collection=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){this.start=e,this.end=t}return e.prototype.getLength=function(){return this.end-this.start},e}();t.Duration=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),i=function(){function e(e){this.defaultLocale=e}return e.prototype.parse=function(e){this.resource=e,this.label=n.PropertyValue.parse(this.resource.label,this.defaultLocale),this.value=n.PropertyValue.parse(this.resource.value,this.defaultLocale)},e.prototype.getLabel=function(e){return null===this.label?null:(Array.isArray(e)&&!e.length&&(e=void 0),this.label.getValue(e||this.defaultLocale))},e.prototype.setLabel=function(e){null===this.label&&(this.label=new n.PropertyValue([])),this.label.setValue(e,this.defaultLocale)},e.prototype.getValue=function(e,t){return void 0===t&&(t="<br/>"),null===this.value?null:(Array.isArray(e)&&!e.length&&(e=void 0),this.value.getValue(e||this.defaultLocale,t))},e.prototype.getValues=function(e){return null===this.value?[]:(Array.isArray(e)&&!e.length&&(e=void 0),this.value.getValues(e||this.defaultLocale))},e.prototype.setValue=function(e){null===this.value&&(this.value=new n.PropertyValue([])),this.value.setValue(e,this.defaultLocale)},e}();t.LabelValuePair=i},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.getValue=function(e,t){return e.getValue(t,"<br/>")},t.getValues=function(e,t){return e.getValues(t)},t}(Array);t.LanguageMap=o},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)n[i]=o[a];return n};Object.defineProperty(t,"__esModule",{value:!0});var a=r(2),s=function(){function e(e,t,r){void 0===r&&(r="none"),Array.isArray(e)&&1===e.length?this._value=e[0]:this._value=e,"none"!==t&&"@none"!==t||(t=void 0),this._locale=t,this._defaultLocale=r}return e.parseV2Value=function(t,r){return"string"==typeof t?new e(t,void 0,r):t["@value"]?new e(t["@value"],t["@language"],r):null},Object.defineProperty(e.prototype,"value",{get:function(){return Array.isArray(this._value)?this._value.join("<br/>"):this._value},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"locale",{get:function(){return void 0===this._locale?this._defaultLocale:this._locale},enumerable:!0,configurable:!0}),e.prototype.addValue=function(e){Array.isArray(this._value)||(this._value=[this._value]),Array.isArray(e)?this._value=this._value.concat(e):this._value.push(e)},e}();t.LocalizedValue=s;var u=function(e){function t(r,n){void 0===r&&(r=[]);var i=e.apply(this,r)||this;return i.__proto__=t.prototype,i._defaultLocale=n,i}return i(t,e),t.parse=function(e,r){if(!e)return new t([],r);if(Array.isArray(e)){var n=(i=e.map((function(e){return s.parseV2Value(e,r)})).filter((function(e){return null!==e}))).reduce((function(e,t){var r=t._locale;return r||(r="none"),e[r]?e[r].addValue(t._value):e[r]=t,e}),{});return new t(Object.values(n),r)}return"string"==typeof e?new t([new s(e,void 0,r)],r):e["@language"]?new t(null!==(i=s.parseV2Value(e))?[i]:[],r):new t(Object.keys(e).map((function(t){var n=e[t];if(!Array.isArray(n))throw new Error("A IIIF v3 localized property value must have an array as the value for a given language.");return new s(n,t,r)})),r);var i},t.prototype.getSuitableLocale=function(e){for(var t=o(this).map((function(e){return e._locale})).filter((function(e){return void 0!==e})),r=function(e){var r=t.find((function(t){return t===e}));if(r)return{value:r}},n=0,i=e;n<i.length;n++){var s=r(i[n]);if("object"==typeof s)return s.value}for(var u=function(e){var r=t.find((function(t){return a.Utils.getInexactLocale(t)===a.Utils.getInexactLocale(e)}));if(r)return{value:r}},l=0,c=e;l<c.length;l++){var p=u(c[l]);if("object"==typeof p)return p.value}},t.prototype.setValue=function(e,t){var r=void 0;if(t){var n=this.getSuitableLocale([t]);n&&(r=this.find((function(e){return e._locale===n})))}else r=this.find((function(e){return void 0===e._locale}));r?r._value=e:this.push(new s(e,t,this._defaultLocale))},t.prototype.getValue=function(e,t){var r=this.getValues(e);return 0===r.length?null:t?r.join(t):r[0]},t.prototype.getValues=function(e){if(!this.length)return[];var t;if(t=e?Array.isArray(e)?e:[e]:[],1===this.length&&void 0===this[0]._locale){var r=this[0]._value;return Array.isArray(r)?r:[r]}var n=this.getSuitableLocale(t);if(n){r=this.find((function(e){return e._locale===n}))._value;return Array.isArray(r)?r:[r]}if(!this.find((function(e){return void 0===e._locale}))){r=this[0]._value;return Array.isArray(r)?r:[r]}var i=this.find((function(e){return void 0===e._locale}));return i?Array.isArray(i._value)?i._value:[i._value]:[]},t}(Array);t.PropertyValue=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CONTINUE=100,t.SWITCHING_PROTOCOLS=101,t.PROCESSING=102,t.OK=200,t.CREATED=201,t.ACCEPTED=202,t.NON_AUTHORITATIVE_INFORMATION=203,t.NO_CONTENT=204,t.RESET_CONTENT=205,t.PARTIAL_CONTENT=206,t.MULTI_STATUS=207,t.MULTIPLE_CHOICES=300,t.MOVED_PERMANENTLY=301,t.MOVED_TEMPORARILY=302,t.SEE_OTHER=303,t.NOT_MODIFIED=304,t.USE_PROXY=305,t.TEMPORARY_REDIRECT=307,t.BAD_REQUEST=400,t.UNAUTHORIZED=401,t.PAYMENT_REQUIRED=402,t.FORBIDDEN=403,t.NOT_FOUND=404,t.METHOD_NOT_ALLOWED=405,t.NOT_ACCEPTABLE=406,t.PROXY_AUTHENTICATION_REQUIRED=407,t.REQUEST_TIME_OUT=408,t.CONFLICT=409,t.GONE=410,t.LENGTH_REQUIRED=411,t.PRECONDITION_FAILED=412,t.REQUEST_ENTITY_TOO_LARGE=413,t.REQUEST_URI_TOO_LARGE=414,t.UNSUPPORTED_MEDIA_TYPE=415,t.REQUESTED_RANGE_NOT_SATISFIABLE=416,t.EXPECTATION_FAILED=417,t.IM_A_TEAPOT=418,t.UNPROCESSABLE_ENTITY=422,t.LOCKED=423,t.FAILED_DEPENDENCY=424,t.UNORDERED_COLLECTION=425,t.UPGRADE_REQUIRED=426,t.PRECONDITION_REQUIRED=428,t.TOO_MANY_REQUESTS=429,t.REQUEST_HEADER_FIELDS_TOO_LARGE=431,t.INTERNAL_SERVER_ERROR=500,t.NOT_IMPLEMENTED=501,t.BAD_GATEWAY=502,t.SERVICE_UNAVAILABLE=503,t.GATEWAY_TIME_OUT=504,t.HTTP_VERSION_NOT_SUPPORTED=505,t.VARIANT_ALSO_NEGOTIATES=506,t.INSUFFICIENT_STORAGE=507,t.BANDWIDTH_LIMIT_EXCEEDED=509,t.NOT_EXTENDED=510,t.NETWORK_AUTHENTICATION_REQUIRED=511},function(e,t,r){e.exports=window.fetch||(window.fetch=r(3).default||r(3))},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1),a=r(0),s=function(e){function t(t,r){var n=e.call(this,t,r)||this;if(n.index=0,n._allRanges=null,n.items=[],n._topRanges=[],n.__jsonld.structures&&n.__jsonld.structures.length)for(var i=n._getTopRanges(),o=0;o<i.length;o++){var a=i[o];n._parseRanges(a,String(o))}return n}return i(t,e),t.prototype.getPosterCanvas=function(){var e=this.getProperty("posterCanvas");return e&&(e=new a.Canvas(e,this.options)),e},t.prototype.getBehavior=function(){var e=this.getProperty("behavior");return Array.isArray(e)&&(e=e[0]),e||null},t.prototype.getDefaultTree=function(){if(e.prototype.getDefaultTree.call(this),this.defaultTree.data.type=a.Utils.normaliseType(a.TreeNodeType.MANIFEST),!this.isLoaded)return this.defaultTree;var t=this.getTopRanges();return t.length&&t[0].getTree(this.defaultTree),a.Utils.generateTreeNodeIds(this.defaultTree),this.defaultTree},t.prototype._getTopRanges=function(){var e=[];if(this.__jsonld.structures&&this.__jsonld.structures.length){for(var t=0;t<this.__jsonld.structures.length;t++){var r=this.__jsonld.structures[t];r.viewingHint===o.ViewingHint.TOP&&e.push(r)}if(!e.length){var n={};n.ranges=this.__jsonld.structures,e.push(n)}}return e},t.prototype.getTopRanges=function(){return this._topRanges},t.prototype._getRangeById=function(e){if(this.__jsonld.structures&&this.__jsonld.structures.length)for(var t=0;t<this.__jsonld.structures.length;t++){var r=this.__jsonld.structures[t];if(r["@id"]===e||r.id===e)return r}return null},t.prototype._parseRanges=function(e,t,r){var n,i=null;if("string"==typeof e&&(i=e,e=this._getRangeById(i)),e){(n=new a.Range(e,this.options)).parentRange=r,n.path=t,r?r.items.push(n):this._topRanges.push(n);var o=e.items||e.members;if(o)for(var s=0;s<o.length;s++){var u=o[s];if(u["@type"]&&"sc:range"===u["@type"].toLowerCase()||u.type&&"range"===u.type.toLowerCase())this._parseRanges(u,t+"/"+s,n);else if(u["@type"]&&"sc:canvas"===u["@type"].toLowerCase()||u.type&&"canvas"===u.type.toLowerCase()){n.canvases||(n.canvases=[]);var l=u.id||u["@id"];n.canvases.push(l)}}else if(e.ranges)for(s=0;s<e.ranges.length;s++)this._parseRanges(e.ranges[s],t+"/"+s,n)}else console.warn("Range:",i,"does not exist")},t.prototype.getAllRanges=function(){if(null!=this._allRanges)return this._allRanges;this._allRanges=[];for(var e=this.getTopRanges(),t=function(t){var n=e[t];n.id&&r._allRanges.push(n);var i=function(e,t){e.add(t);var r=t.getRanges();return r.length?r.reduce(i,e):e},o=Array.from(n.getRanges().reduce(i,new Set));r._allRanges=r._allRanges.concat(o)},r=this,n=0;n<e.length;n++)t(n);return this._allRanges},t.prototype.getRangeById=function(e){for(var t=this.getAllRanges(),r=0;r<t.length;r++){var n=t[r];if(n.id===e)return n}return null},t.prototype.getRangeByPath=function(e){for(var t=this.getAllRanges(),r=0;r<t.length;r++){var n=t[r];if(n.path===e)return n}return null},t.prototype.getSequences=function(){if(this.items.length)return this.items;var e=this.__jsonld.mediaSequences||this.__jsonld.sequences;if(e)for(var t=0;t<e.length;t++){var r=e[t],n=new a.Sequence(r,this.options);this.items.push(n)}else if(this.__jsonld.items){n=new a.Sequence(this.__jsonld.items,this.options);this.items.push(n)}return this.items},t.prototype.getSequenceByIndex=function(e){return this.getSequences()[e]},t.prototype.getTotalSequences=function(){return this.getSequences().length},t.prototype.getManifestType=function(){var e=this.getService(o.ServiceProfile.UI_EXTENSIONS);return e?e.getProperty("manifestType"):a.ManifestType.EMPTY},t.prototype.isMultiSequence=function(){return this.getTotalSequences()>1},t.prototype.isPagingEnabled=function(){var e=this.getViewingHint();if(e)return e===o.ViewingHint.PAGED;var t=this.getBehavior();return!!t&&t===o.Behavior.PAGED},t.prototype.getViewingDirection=function(){return this.getProperty("viewingDirection")},t.prototype.getViewingHint=function(){return this.getProperty("viewingHint")},t}(a.IIIFResource);t.Manifest=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.EMPTY="",e.MANUSCRIPT="manuscript",e.MONOGRAPH="monograph"}(t.ManifestType||(t.ManifestType={}))},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),a=r(1),s=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n._ranges=null,n.canvases=null,n.items=[],n}return i(t,e),t.prototype.getCanvasIds=function(){return this.__jsonld.canvases?this.__jsonld.canvases:this.canvases?this.canvases:[]},t.prototype.getDuration=function(){if(this.canvases&&this.canvases.length){for(var e=[],t=[],r=0,n=this.canvases;r<n.length;r++){if(_=n[r]){var i=_.match(/(.*)#t=([0-9.]+),?([0-9.]+)?/)||[void 0,_],a=i[1],s=i[2],u=i[3];a&&(e.push(parseFloat(s)),t.push(parseFloat(u)))}}if(e.length&&t.length)return new o.Duration(Math.min.apply(Math,e),Math.max.apply(Math,t))}else{e=[],t=[];for(var l=0,c=d=this.getRanges();l<c.length;l++){(v=c[l].getDuration())&&(e.push(v.start),t.push(v.end))}if(e.length&&t.length)return new o.Duration(Math.min.apply(Math,e),Math.max.apply(Math,t))}var p,f;if(this.canvases&&this.canvases.length)for(var h=0;h<this.canvases.length;h++){var _=this.canvases[h],g=o.Utils.getTemporalComponent(_);g&&g.length>1&&(0===h&&(p=Number(g[0])),h===this.canvases.length-1&&(f=Number(g[1])))}else{var d=this.getRanges();for(h=0;h<d.length;h++){var v;(v=d[h].getDuration())&&(0===h&&(p=v.start),h===d.length-1&&(f=v.end))}}if(void 0!==p&&void 0!==f)return new o.Duration(p,f)},t.prototype.getRanges=function(){return this._ranges?this._ranges:this._ranges=this.items.filter((function(e){return e.isRange()}))},t.prototype.getBehavior=function(){var e=this.getProperty("behavior");return Array.isArray(e)&&(e=e[0]),e||null},t.prototype.getViewingDirection=function(){return this.getProperty("viewingDirection")},t.prototype.getViewingHint=function(){return this.getProperty("viewingHint")},t.prototype.getTree=function(e){e.data=this,this.treeNode=e;var t=this.getRanges();if(t&&t.length)for(var r=0;r<t.length;r++){var n=t[r],i=new o.TreeNode;e.addNode(i),this._parseTreeNode(i,n)}return o.Utils.generateTreeNodeIds(e),e},t.prototype.spansTime=function(e){var t=this.getDuration();return!!(t&&e>=t.start&&e<=t.end)},t.prototype._parseTreeNode=function(e,t){e.label=t.getLabel().getValue(this.options.locale),e.data=t,e.data.type=o.Utils.normaliseType(o.TreeNodeType.RANGE),t.treeNode=e;var r=t.getRanges();if(r&&r.length)for(var n=0;n<r.length;n++){var i=r[n];if(i.getBehavior()!==a.Behavior.NO_NAV){var s=new o.TreeNode;e.addNode(s),this._parseTreeNode(s,i)}}},t}(o.ManifestResource);t.Range=s},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t,r){return e.call(this,t,r)||this}return i(t,e),t.prototype.getFormat=function(){return this.getProperty("format")},t}(r(0).ManifestResource);t.Rendering=o},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1),a=r(0),s=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.items=[],n._thumbnails=null,n}return i(t,e),t.prototype.getCanvases=function(){if(this.items.length)return this.items;var e=this.__jsonld.canvases||this.__jsonld.elements;if(e)for(var t=0;t<e.length;t++){var r=e[t];(n=new a.Canvas(r,this.options)).index=t,this.items.push(n)}else if(this.__jsonld)for(t=0;t<this.__jsonld.length;t++){var n;r=this.__jsonld[t];(n=new a.Canvas(r,this.options)).index=t,this.items.push(n)}return this.items},t.prototype.getCanvasById=function(e){for(var t=0;t<this.getTotalCanvases();t++){var r=this.getCanvasByIndex(t),n=a.Utils.normaliseUrl(r.id);if(a.Utils.normaliseUrl(e)===n)return r}return null},t.prototype.getCanvasByIndex=function(e){return this.getCanvases()[e]},t.prototype.getCanvasIndexById=function(e){for(var t=0;t<this.getTotalCanvases();t++){if(this.getCanvasByIndex(t).id===e)return t}return null},t.prototype.getCanvasIndexByLabel=function(e,t){e=e.trim(),isNaN(e)||(e=parseInt(e,10).toString(),t&&(e+="r"));for(var r,n,i,o=/(\d*)\D+(\d*)/,a=0;a<this.getTotalCanvases();a++){var s=this.getCanvasByIndex(a);if(s.getLabel().getValue(this.options.locale)===e)return a;if((r=o.exec(e))&&(n=r[1],(i=r[2])&&new RegExp("^"+n+"\\D+"+i+"$").test(s.getLabel().toString())))return a}return-1},t.prototype.getLastCanvasLabel=function(e){for(var t=this.getTotalCanvases()-1;t>=0;t--){var r=this.getCanvasByIndex(t).getLabel().getValue(this.options.locale);if(e){if(/^[a-zA-Z0-9]*$/.test(r))return r}else if(r)return r}return this.options.defaultLabel},t.prototype.getLastPageIndex=function(){return this.getTotalCanvases()-1},t.prototype.getNextPageIndex=function(e,t){var r;if(t){var n=this.getPagedIndices(e),i=this.getViewingDirection();r=i&&i===o.ViewingDirection.RIGHT_TO_LEFT?n[0]+1:n[n.length-1]+1}else r=e+1;return r>this.getLastPageIndex()?-1:r},t.prototype.getPagedIndices=function(e,t){var r=[];if(t){r=this.isFirstCanvas(e)||this.isLastCanvas(e)?[e]:e%2?[e,e+1]:[e-1,e];var n=this.getViewingDirection();n&&n===o.ViewingDirection.RIGHT_TO_LEFT&&(r=r.reverse())}else r.push(e);return r},t.prototype.getPrevPageIndex=function(e,t){var r;if(t){var n=this.getPagedIndices(e),i=this.getViewingDirection();r=i&&i===o.ViewingDirection.RIGHT_TO_LEFT?n[n.length-1]-1:n[0]-1}else r=e-1;return r},t.prototype.getStartCanvasIndex=function(){var e=this.getStartCanvas();if(e)for(var t=0;t<this.getTotalCanvases();t++){if(this.getCanvasByIndex(t).id===e)return t}return 0},t.prototype.getThumbs=function(e,t){for(var r=[],n=this.getTotalCanvases(),i=0;i<n;i++){var o=this.getCanvasByIndex(i),s=new a.Thumb(e,o);r.push(s)}return r},t.prototype.getThumbnails=function(){if(null!=this._thumbnails)return this._thumbnails;this._thumbnails=[];for(var e=this.getCanvases(),t=0;t<e.length;t++){var r=e[t].getThumbnail();r&&this._thumbnails.push(r)}return this._thumbnails},t.prototype.getStartCanvas=function(){return this.getProperty("startCanvas")},t.prototype.getTotalCanvases=function(){return this.getCanvases().length},t.prototype.getViewingDirection=function(){return this.getProperty("viewingDirection")?this.getProperty("viewingDirection"):this.options.resource.getViewingDirection?this.options.resource.getViewingDirection():null},t.prototype.getViewingHint=function(){return this.getProperty("viewingHint")},t.prototype.isCanvasIndexOutOfRange=function(e){return e>this.getTotalCanvases()-1},t.prototype.isFirstCanvas=function(e){return 0===e},t.prototype.isLastCanvas=function(e){return e===this.getTotalCanvases()-1},t.prototype.isMultiCanvas=function(){return this.getTotalCanvases()>1},t.prototype.isPagingEnabled=function(){var e=this.getViewingHint();return!!e&&e===o.ViewingHint.PAGED},t.prototype.isTotalCanvasesEven=function(){return this.getTotalCanvases()%2==0},t}(a.ManifestResource);t.Sequence=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),i=function(){function e(){}return e.parse=function(e,t){return"string"==typeof e&&(e=JSON.parse(e)),this.parseJson(e,t)},e.parseJson=function(e,t){var r;if(t&&t.navDate&&!isNaN(t.navDate.getTime())&&(e.navDate=t.navDate.toString()),e["@type"])switch(e["@type"]){case"sc:Collection":r=this.parseCollection(e,t);break;case"sc:Manifest":r=this.parseManifest(e,t);break;default:return null}else switch(e.type){case"Collection":r=this.parseCollection(e,t);break;case"Manifest":r=this.parseManifest(e,t);break;default:return null}return r.isLoaded=!0,r},e.parseCollection=function(e,t){var r=new n.Collection(e,t);return t?(r.index=t.index||0,t.resource&&(r.parentCollection=t.resource.parentCollection)):r.index=0,this.parseCollections(r,t),this.parseManifests(r,t),this.parseItems(r,t),r},e.parseCollections=function(e,t){var r;if(e.__jsonld.collections?r=e.__jsonld.collections:e.__jsonld.items&&(r=e.__jsonld.items.filter((function(e){return"collection"===e.type.toLowerCase()}))),r)for(var n=0;n<r.length;n++){t&&(t.index=n);var i=this.parseCollection(r[n],t);i.index=n,i.parentCollection=e,e.items.push(i)}},e.parseManifest=function(e,t){return new n.Manifest(e,t)},e.parseManifests=function(e,t){var r;if(e.__jsonld.manifests?r=e.__jsonld.manifests:e.__jsonld.items&&(r=e.__jsonld.items.filter((function(e){return"manifest"===e.type.toLowerCase()}))),r)for(var n=0;n<r.length;n++){var i=this.parseManifest(r[n],t);i.index=n,i.parentCollection=e,e.items.push(i)}},e.parseItem=function(e,t){if(e["@type"]){if("sc:manifest"===e["@type"].toLowerCase())return this.parseManifest(e,t);if("sc:collection"===e["@type"].toLowerCase())return this.parseCollection(e,t)}else if(e.type){if("manifest"===e.type.toLowerCase())return this.parseManifest(e,t);if("collection"===e.type.toLowerCase())return this.parseCollection(e,t)}return null},e.parseItems=function(e,t){var r=e.__jsonld.members||e.__jsonld.items;if(r)for(var n=function(n){t&&(t.index=n);var o=i.parseItem(r[n],t);return o?e.items.filter((function(e){return e.id===o.id}))[0]?"continue":(o.index=n,o.parentCollection=e,void e.items.push(o)):{value:void 0}},i=this,o=0;o<r.length;o++){var a=n(o);if("object"==typeof a)return a.value}},e}();t.Deserialiser=i},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),a=function(e){function t(t,r){return e.call(this,t,r)||this}return i(t,e),t.prototype.getProfile=function(){var e=this.getProperty("profile");return e||(e=this.getProperty("dcterms:conformsTo")),Array.isArray(e)?e[0]:e},t.prototype.getConfirmLabel=function(){return o.Utils.getLocalisedValue(this.getProperty("confirmLabel"),this.options.locale)},t.prototype.getDescription=function(){return o.Utils.getLocalisedValue(this.getProperty("description"),this.options.locale)},t.prototype.getFailureDescription=function(){return o.Utils.getLocalisedValue(this.getProperty("failureDescription"),this.options.locale)},t.prototype.getFailureHeader=function(){return o.Utils.getLocalisedValue(this.getProperty("failureHeader"),this.options.locale)},t.prototype.getHeader=function(){return o.Utils.getLocalisedValue(this.getProperty("header"),this.options.locale)},t.prototype.getServiceLabel=function(){return o.Utils.getLocalisedValue(this.getProperty("label"),this.options.locale)},t.prototype.getInfoUri=function(){var e=this.id;return e.endsWith("/")||(e+="/"),e+="info.json"},t}(o.ManifestResource);t.Service=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){this.width=e,this.height=t};t.Size=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.AUTHORIZATION_FAILED=1]="AUTHORIZATION_FAILED",e[e.FORBIDDEN=2]="FORBIDDEN",e[e.INTERNAL_SERVER_ERROR=3]="INTERNAL_SERVER_ERROR",e[e.RESTRICTED=4]="RESTRICTED"}(t.StatusCode||(t.StatusCode={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){this.data=t,this.index=t.index,this.width=e;var r=t.getHeight()/t.getWidth();this.height=r?Math.floor(this.width*r):e,this.uri=t.getCanonicalImageUri(e),this.label=t.getLabel().getValue()};t.Thumb=n},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t,r){return e.call(this,t,r)||this}return i(t,e),t}(r(0).Resource);t.Thumbnail=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),i=function(){function e(e,t){this.label=e,this.data=t||{},this.nodes=[]}return e.prototype.addNode=function(e){this.nodes.push(e),e.parentNode=this},e.prototype.isCollection=function(){return this.data.type===n.Utils.normaliseType(n.TreeNodeType.COLLECTION)},e.prototype.isManifest=function(){return this.data.type===n.Utils.normaliseType(n.TreeNodeType.MANIFEST)},e.prototype.isRange=function(){return this.data.type===n.Utils.normaliseType(n.TreeNodeType.RANGE)},e}();t.TreeNode=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.COLLECTION="collection",e.MANIFEST="manifest",e.RANGE="range"}(t.TreeNodeType||(t.TreeNodeType={}))}]);
var manifesto=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}([function(e,t,r){"use strict";function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),n(r(6)),n(r(7)),n(r(8)),n(r(9)),n(r(10)),n(r(11)),n(r(12)),n(r(13)),n(r(14)),n(r(15)),n(r(16)),n(r(17)),n(r(18)),n(r(19)),n(r(22)),n(r(23)),n(r(24)),n(r(25)),n(r(26)),n(r(27)),n(r(28)),n(r(29)),n(r(30)),n(r(31)),n(r(32)),n(r(33)),n(r(34)),n(r(2))},function(e,t,r){"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.OA_CHOICE="oa:choice",e.CONTENT_AS_TEXT="contentastext",e.DATASET="dataset",e.DOCUMENT="document",e.IMAGE="image",e.MODEL="model",e.MOVING_IMAGE="movingimage",e.PDF="pdf",e.PHYSICAL_OBJECT="physicalobject",e.SOUND="sound",e.TEXT="text",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.DICOM="application/dicom",e.DRACO="application/draco",e.EPUB="application/epub+zip",e.GLB="model/gltf-binary",e.GLTF="model/gltf+json",e.IIIF_PRESENTATION_2='application/ld+json;profile="http://iiif.io/api/presentation/2/context.json"',e.IIIF_PRESENTATION_3='application/ld+json;profile="http://iiif.io/api/presentation/3/context.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.OPF="application/oebps-package+xml",e.PDF="application/pdf",e.PLY="application/ply",e.THREEJS="application/vnd.threejs+json",e.USDZ="model/vnd.usd+zip",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,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),a=r(1),s=r(20);r(21);var u=function(){function e(){}return e.getMediaType=function(e){return(e=(e=e.toLowerCase()).split(";")[0]).trim()},e.getImageQuality=function(e){return e===a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_1_LEVEL_1||e===a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1||e===a.ServiceProfile.IMAGE_1_LEVEL_2||e===a.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 r=0;r<e.length;r++){var n=e[r];if(t===n["@language"])return n["@value"]}var i=t.substr(0,t.indexOf("-"));for(r=0;r<e.length;r++){var o=e[r];if(o["@language"]===i)return o["@value"]}return null},e.generateTreeNodeIds=function(t,r){var n;void 0===r&&(r=0),n=t.parentNode?t.parentNode.id+"-"+r:"0",t.id=n;for(var i=0;i<t.nodes.length;i++){var o=t.nodes[i];e.generateTreeNodeIds(o,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,r){return e.normaliseUrl(t)===e.normaliseUrl(r)},e.isImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2))},e.isLevel0ImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0))},e.isLevel1ImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1))},e.isLevel2ImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2))},e.parseManifest=function(e,t){return o.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(r,n){fetch(t).then(e.checkStatus).then((function(e){return e.json()})).then((function(e){r(e)})).catch((function(e){n()}))}))},e.loadExternalResourcesAuth1=function(t,r,n,i,o,a,s,u){return new Promise((function(l,c){var p=t.map((function(t){return e.loadExternalResourceAuth1(t,r,n,i,o,a,s,u)}));Promise.all(p).then((function(){l(t)})).catch((function(e){c(e)}))}))},e.loadExternalResourceAuth1=function(t,r,o,a,u,l,c,p){return n(this,void 0,void 0,(function(){var n;return i(this,(function(i){switch(i.label){case 0:return[4,a(t)];case 1:return(n=i.sent())?[4,t.getData(n)]:[3,6];case 2:return i.sent(),t.status!==s.OK?[3,3]:[2,t];case 3:return[4,e.doAuthChain(t,r,o,u,l,c,p)];case 4:i.sent(),i.label=5;case 5:if(t.status===s.OK||t.status===s.MOVED_TEMPORARILY)return[2,t];throw e.createAuthorizationFailedError();case 6:return[4,t.getData()];case 7:return i.sent(),t.status!==s.MOVED_TEMPORARILY&&t.status!==s.UNAUTHORIZED?[3,9]:[4,e.doAuthChain(t,r,o,u,l,c,p)];case 8:i.sent(),i.label=9;case 9:if(t.status===s.OK||t.status===s.MOVED_TEMPORARILY)return[2,t];throw e.createAuthorizationFailedError()}}))}))},e.doAuthChain=function(t,r,o,a,u,l,c){return n(this,void 0,void 0,(function(){var n,p,f,h,_,g,d,v;return i(this,(function(i){switch(i.label){case 0:return t.isAccessControlled()?((n=t.externalService)&&(n.options=t.options),(p=t.kioskService)&&(p.options=t.options),(f=t.clickThroughService)&&(f.options=t.options),(h=t.loginService)&&(h.options=t.options),t.isResponseHandled||t.status!==s.MOVED_TEMPORARILY?[3,2]:[4,l(t)]):[2,t];case 1:return i.sent(),[2,t];case 2:return _=null,g=null,(_=n)?(g=_,[4,e.attemptResourceWithToken(t,o,_)]):[3,4];case 3:return i.sent(),[2,t];case 4:return(_=p)?(g=_,(d=r(_))?[4,a(d)]:[3,7]):[3,7];case 5:return i.sent(),[4,e.attemptResourceWithToken(t,o,_)];case 6:return i.sent(),[2,t];case 7:return(_=f)?(g=_,[4,u(t,_)]):[3,11];case 8:return(v=i.sent())?[4,a(v)]:[3,11];case 9:return i.sent(),[4,e.attemptResourceWithToken(t,o,_)];case 10:return i.sent(),[2,t];case 11:return(_=h)?(g=_,[4,u(t,_)]):[3,15];case 12:return(v=i.sent())?[4,a(v)]:[3,15];case 13:return i.sent(),[4,e.attemptResourceWithToken(t,o,_)];case 14:return i.sent(),[2,t];case 15:return g&&c(t,g),[2]}}))}))},e.attemptResourceWithToken=function(e,t,r){return n(this,void 0,void 0,(function(){var n,o;return i(this,(function(i){switch(i.label){case 0:return(n=r.getService(a.ServiceProfile.AUTH_1_TOKEN))?[4,t(e,n)]:[3,3];case 1:return(o=i.sent())&&o.accessToken?[4,e.getData(o)]:[3,3];case 2:return i.sent(),[2,e];case 3:return[2]}}))}))},e.loadExternalResourcesAuth09=function(t,r,n,i,o,a,s,u,l,c){return new Promise((function(p,f){var h=t.map((function(t){return e.loadExternalResourceAuth09(t,r,n,i,o,a,s,u,l,c)}));Promise.all(h).then((function(){p(t)})).catch((function(e){f(e)}))}))},e.loadExternalResourceAuth09=function(t,r,n,i,o,a,u,l,c,p){return new Promise((function(f,h){p&&p.pessimisticAccessControl?t.getData().then((function(){t.isAccessControlled()?t.clickThroughService?(f(n(t)),f(i(t))):o(t).then((function(){a(t,!0).then((function(r){t.getData(r).then((function(){f(c(t))})).catch((function(t){h(e.createInternalServerError(t))}))})).catch((function(t){h(e.createInternalServerError(t))}))})).catch((function(t){h(e.createInternalServerError(t))})):f(t)})).catch((function(t){h(e.createInternalServerError(t))})):l(t,r).then((function(p){p?t.getData(p).then((function(){t.status===s.OK?f(c(t)):e.authorize(t,r,n,i,o,a,u,l).then((function(){f(c(t))})).catch((function(t){h(e.createAuthorizationFailedError())}))})).catch((function(t){h(e.createAuthorizationFailedError())})):e.authorize(t,r,n,i,o,a,u,l).then((function(){f(c(t))})).catch((function(t){h(e.createAuthorizationFailedError())}))})).catch((function(t){h(e.createAuthorizationFailedError())}))}))},e.createError=function(e,t){var r=new Error;return r.message=t,r.name=String(e),r},e.createAuthorizationFailedError=function(){return e.createError(o.StatusCode.AUTHORIZATION_FAILED,"Authorization failed")},e.createRestrictedError=function(){return e.createError(o.StatusCode.RESTRICTED,"Restricted")},e.createInternalServerError=function(t){return e.createError(o.StatusCode.INTERNAL_SERVER_ERROR,t)},e.authorize=function(t,r,n,i,o,a,u,l){return new Promise((function(c,p){t.getData().then((function(){t.isAccessControlled()?l(t,r).then((function(l){l?t.getData(l).then((function(){t.status===s.OK?c(t):e.showAuthInteraction(t,r,n,i,o,a,u,c,p)})).catch((function(t){p(e.createInternalServerError(t))})):a(t,!1).then((function(l){l?u(t,l,r).then((function(){t.getData(l).then((function(){t.status===s.OK?c(t):e.showAuthInteraction(t,r,n,i,o,a,u,c,p)})).catch((function(t){p(e.createInternalServerError(t))}))})).catch((function(t){p(e.createInternalServerError(t))})):e.showAuthInteraction(t,r,n,i,o,a,u,c,p)}))})).catch((function(t){p(e.createInternalServerError(t))})):c(t)}))}))},e.showAuthInteraction=function(t,r,n,i,o,a,u,l,c){t.status!==s.MOVED_TEMPORARILY||t.isResponseHandled?t.clickThroughService&&!t.isResponseHandled?n(t).then((function(){a(t,!0).then((function(n){u(t,n,r).then((function(){t.getData(n).then((function(){l(t)})).catch((function(t){c(e.createInternalServerError(t))}))})).catch((function(t){c(e.createInternalServerError(t))}))})).catch((function(t){c(e.createInternalServerError(t))}))})):o(t).then((function(){a(t,!0).then((function(n){u(t,n,r).then((function(){t.getData(n).then((function(){l(t)})).catch((function(t){c(e.createInternalServerError(t))}))})).catch((function(t){c(e.createInternalServerError(t))}))})).catch((function(t){c(e.createInternalServerError(t))}))})):l(t)},e.getService=function(e,t){for(var r=this.getServices(e),n=0;n<r.length;n++){var i=r[n];if(i.getProfile()===t)return i}return null},e.getResourceById=function(t,r){return e.traverseAndFind(t.__jsonld,"@id",r)},e.traverseAndFind=function(t,r,n){if(t.hasOwnProperty(r)&&t[r]===n)return t;for(var i=0;i<Object.keys(t).length;i++)if("object"==typeof t[Object.keys(t)[i]]){var o=e.traverseAndFind(t[Object.keys(t)[i]],r,n);if(null!=o)return o}},e.getServices=function(e){var t,r=[];if(!(t=e.__jsonld?e.__jsonld.service:e.service))return r;Array.isArray(t)||(t=[t]);for(var n=0;n<t.length;n++){var i=t[n];if("string"==typeof i){var a=this.getResourceById(e.options.resource,i);a&&r.push(new o.Service(a.__jsonld||a,e.options))}else r.push(new o.Service(i,e.options))}return r},e.getTemporalComponent=function(e){var t=/t=([^&]+)/g.exec(e),r=null;return t&&t[1]&&(r=t[1].split(",")),r},e}();t.Utils=u},function(e,t,r){"use strict";r.r(t),t.default=function(e,t){return t=t||{},new Promise((function(r,n){var i=new XMLHttpRequest,o=[],a=[],s={},u=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:u,headers:{keys:function(){return o},entries:function(){return a},get:function(e){return s[e.toLowerCase()]},has:function(e){return e.toLowerCase()in s}}}};for(var l in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,r){o.push(t=t.toLowerCase()),a.push([t,r]),s[t]=s[t]?s[t]+","+r:r})),r(u())},i.onerror=n,i.withCredentials="include"==t.credentials,t.headers)i.setRequestHeader(l,t.headers[l]);i.send(t.body||null)}))}},function(e,t,r){e.exports=r(5)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(0));var n=r(2);t.loadManifest=function(e){return n.Utils.loadManifest(e)},t.parseManifest=function(e,t){return n.Utils.parseManifest(e,t)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=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=n},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),a=r(1),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.options=r,n}return i(t,e),t.prototype.getIIIFResourceType=function(){return o.Utils.normaliseType(this.getProperty("type"))},t.prototype.getLabel=function(){var e=this.getProperty("label");return e?o.PropertyValue.parse(e,this.options.locale):new o.PropertyValue([],this.options.locale)},t.prototype.getDefaultLabel=function(){return this.getLabel().getValue(this.options.locale)},t.prototype.getMetadata=function(){var e=this.getProperty("metadata"),t=[];if(!e)return t;for(var r=0;r<e.length;r++){var n=e[r],i=new o.LabelValuePair(this.options.locale);i.parse(n),t.push(i)}return t},t.prototype.getRendering=function(e){for(var t=this.getRenderings(),r=0;r<t.length;r++){var n=t[r];if(n.getFormat()===e)return n}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 r=0;r<e.length;r++){var n=e[r];t.push(new o.Rendering(n,this.options))}return t},t.prototype.getService=function(e){return o.Utils.getService(this,e)},t.prototype.getServices=function(){return o.Utils.getServices(this)},t.prototype.getThumbnail=function(){var e=this.getProperty("thumbnail");return Array.isArray(e)&&(e=e[0]),e?new o.Thumbnail(e,this.options):null},t.prototype.isAnnotation=function(){return this.getIIIFResourceType()===a.IIIFResourceType.ANNOTATION},t.prototype.isCanvas=function(){return this.getIIIFResourceType()===a.IIIFResourceType.CANVAS},t.prototype.isCollection=function(){return this.getIIIFResourceType()===a.IIIFResourceType.COLLECTION},t.prototype.isManifest=function(){return this.getIIIFResourceType()===a.IIIFResourceType.MANIFEST},t.prototype.isRange=function(){return this.getIIIFResourceType()===a.IIIFResourceType.RANGE},t.prototype.isSequence=function(){return this.getIIIFResourceType()===a.IIIFResourceType.SEQUENCE},t}(o.JSONLDResource);t.ManifestResource=s},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),a=function(e){function t(t,r){return e.call(this,t,r)||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 r=this.__jsonld.resources[t],n=new o.Annotation(r,this.options);e.push(n)}return e},t.prototype.getType=function(){var e=this.getProperty("type");return e?o.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}(o.ManifestResource);t.Resource=a},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),a=r(1),s=function(e){function t(t,r){var n=e.call(this,t,r)||this;n.index=-1,n.isLoaded=!1;var i={defaultLabel:"-",locale:"en-GB",resource:n,pessimisticAccessControl:!1};return n.options=Object.assign(i,r),n}return i(t,e),t.prototype.getAttribution=function(){var e=this.getProperty("attribution");return e?o.PropertyValue.parse(e,this.options.locale):new o.PropertyValue([],this.options.locale)},t.prototype.getDescription=function(){var e=this.getProperty("description");return e?o.PropertyValue.parse(e,this.options.locale):new o.PropertyValue([],this.options.locale)},t.prototype.getHomepage=function(){var e=this.getProperty("homepage");return e?"string"==typeof e?e:(Array.isArray(e)&&e.length&&(e=e[0]),e["@id"]||e.id):null},t.prototype.getIIIFResourceType=function(){return o.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 o.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(a.ServiceProfile.TRACKING_EXTENSIONS);return e?e.getProperty("trackingLabel"):""},t.prototype.getDefaultTree=function(){return this.defaultTree=new o.TreeNode("root"),this.defaultTree.data=this,this.defaultTree},t.prototype.getRequiredStatement=function(){var e=null,t=this.getProperty("requiredStatement");if(t)(e=new o.LabelValuePair(this.options.locale)).parse(t);else{var r=this.getAttribution();r&&((e=new o.LabelValuePair(this.options.locale)).value=r)}return e},t.prototype.isCollection=function(){return this.getIIIFResourceType()===a.IIIFResourceType.COLLECTION},t.prototype.isManifest=function(){return this.getIIIFResourceType()===a.IIIFResourceType.MANIFEST},t.prototype.load=function(){var e=this;return new Promise((function(t){if(e.isLoaded)t(e);else{var r=e.options;r.navDate=e.getNavDate();var n=e.__jsonld.id;n||(n=e.__jsonld["@id"]),o.Utils.loadManifest(n).then((function(n){e.parentLabel=e.getLabel().getValue(r.locale);var i=o.Deserialiser.parse(n,r);(e=Object.assign(e,i)).index=r.index,t(e)}))}}))},t}(o.ManifestResource);t.IIIFResource=s},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),a=function(e){function t(t,r){return e.call(this,t,r)||this}return i(t,e),t.prototype.getBody=function(){var e=[],t=this.getProperty("body");if(t)if(Array.isArray(t))for(var r=0;r<t.length;r++){if((a=t[r]).items)for(var n=0;n<a.items.length;n++){var i=a.items[n];e.push(new o.AnnotationBody(i,this.options))}else e.push(new o.AnnotationBody(a,this.options))}else if(t.items)for(r=0;r<t.items.length;r++){var a=t.items[r];e.push(new o.AnnotationBody(a,this.options))}else e.push(new o.AnnotationBody(t,this.options));return e},t.prototype.getMotivation=function(){var e=this.getProperty("motivation");return e||null},t.prototype.getOn=function(){return this.getProperty("on")},t.prototype.getTarget=function(){return this.getProperty("target")},t.prototype.getResource=function(){return new o.Resource(this.getProperty("resource"),this.options)},t}(o.ManifestResource);t.Annotation=a},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),a=function(e){function t(t,r){return e.call(this,t,r)||this}return i(t,e),t.prototype.getFormat=function(){var e=this.getProperty("format");return e?o.Utils.getMediaType(e):null},t.prototype.getType=function(){return this.getProperty("type")?o.Utils.normaliseType(this.getProperty("type")):null},t.prototype.getWidth=function(){return this.getProperty("width")},t.prototype.getHeight=function(){return this.getProperty("height")},t}(o.ManifestResource);t.AnnotationBody=a},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),a=function(e){function t(t,r,n){var i=e.call(this,r)||this;return i.label=t,i.options=n,i}return i(t,e),t.prototype.getIIIFResourceType=function(){return o.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 o.Annotation(t,e.options)}))},t.prototype.load=function(){var e=this;return new Promise((function(t,r){if(e.isLoaded)t(e);else{var n=e.__jsonld.id;n||(n=e.__jsonld["@id"]),o.Utils.loadManifest(n).then((function(r){e.__jsonld=r,e.context=e.getProperty("context"),e.id=e.getProperty("id"),e.isLoaded=!0,t(e)})).catch(r)}}))},t}(o.JSONLDResource);t.AnnotationList=a},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t,r){return e.call(this,t,r)||this}return i(t,e),t.prototype.getItems=function(){return this.getProperty("items")},t}(r(0).ManifestResource);t.AnnotationPage=o},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),a=function(e){function t(t,r){return e.call(this,t,r)||this}return i(t,e),t.prototype.getCanonicalImageUri=function(e){var t,r=null,n="default",i=e;if(this.externalResource&&this.externalResource.data&&this.externalResource.data["@id"])r=this.externalResource.data["@id"],i||(i=this.externalResource.data.width),this.externalResource.data["@context"]&&(this.externalResource.data["@context"].indexOf("/1.0/context.json")>-1||this.externalResource.data["@context"].indexOf("/1.1/context.json")>-1||this.externalResource.data["@context"].indexOf("/1/context.json")>-1)&&(n="native");else{var a=this.getImages();if(a&&a.length){var s=a[0].getResource(),u=s.getServices();if(i||(i=s.getWidth()),u.length){var l=u[0];r=l.id,n=o.Utils.getImageQuality(l.getProfile())}else if(i===s.getWidth())return s.id}if(!r){var c=this.getProperty("thumbnail");if(c){if("string"==typeof c)return c;if(c["@id"])return c["@id"];if(c.length)return c[0].id}}}return t=i+",",r&&r.endsWith("/")&&(r=r.substr(0,r.length-1)),[r,"full",t,0,n+".jpg"].join("/")},t.prototype.getMaxDimensions=function(){var e,t=null;return this.externalResource&&this.externalResource.data&&this.externalResource.data.profile&&(e=this.externalResource.data.profile,Array.isArray(e)&&(e=e.filter((function(e){return e.maxWidth}))[0])&&(t=new o.Size(e.maxWidth,e.maxHeight?e.maxHeight:e.maxWidth))),t},t.prototype.getContent=function(){var e=[],t=this.__jsonld.items||this.__jsonld.content;if(!t)return e;var r=null;if(t.length&&(r=new o.AnnotationPage(t[0],this.options)),!r)return e;for(var n=r.getItems(),i=0;i<n.length;i++){var a=n[i],s=new o.Annotation(a,this.options);e.push(s)}return e},t.prototype.getDuration=function(){return this.getProperty("duration")},t.prototype.getImages=function(){var e=[];if(!this.__jsonld.images)return e;for(var t=0;t<this.__jsonld.images.length;t++){var r=this.__jsonld.images[t],n=new o.Annotation(r,this.options);e.push(n)}return e},t.prototype.getIndex=function(){return this.getProperty("index")},t.prototype.getOtherContent=function(){var e=this,t=Array.isArray(this.getProperty("otherContent"))?this.getProperty("otherContent"):[this.getProperty("otherContent")],r=t.filter((function(e){return e&&(t=e["@type"],r="sc:AnnotationList","string"==typeof t&&"string"==typeof r&&t.toLowerCase()==t.toLowerCase());var t,r})).map((function(t,r){return new o.AnnotationList(t.label||"Annotation list "+r,t,e.options)})).map((function(e){return e.load()}));return Promise.all(r)},t.prototype.getWidth=function(){return this.getProperty("width")},t.prototype.getHeight=function(){return this.getProperty("height")},t.prototype.getViewingHint=function(){return this.getProperty("viewingHint")},t}(o.Resource);t.Canvas=a},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1),a=r(0),s=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.items=[],n._collections=null,n._manifests=null,t.__collection=n,n}return i(t,e),t.prototype.getCollections=function(){return this._collections?this._collections:this._collections=this.items.filter((function(e){return e.isCollection()}))},t.prototype.getManifests=function(){return this._manifests?this._manifests:this._manifests=this.items.filter((function(e){return e.isManifest()}))},t.prototype.getCollectionByIndex=function(e){for(var t,r=this.getCollections(),n=0;n<r.length;n++){var i=r[n];i.index===e&&(t=i)}if(t)return t.options.index=e,t.load();throw new Error("Collection index not found")},t.prototype.getManifestByIndex=function(e){for(var t,r=this.getManifests(),n=0;n<r.length;n++){var i=r[n];i.index===e&&(t=i)}if(t)return t.options.index=e,t.load();throw new Error("Manifest index not found")},t.prototype.getTotalCollections=function(){return this.getCollections().length},t.prototype.getTotalManifests=function(){return this.getManifests().length},t.prototype.getTotalItems=function(){return this.items.length},t.prototype.getViewingDirection=function(){return this.getProperty("viewingDirection")?this.getProperty("viewingDirection"):o.ViewingDirection.LEFT_TO_RIGHT},t.prototype.getBehavior=function(){var e=this.getProperty("behavior");return Array.isArray(e)&&(e=e[0]),e||null},t.prototype.getViewingHint=function(){return this.getProperty("viewingHint")},t.prototype.getDefaultTree=function(){return e.prototype.getDefaultTree.call(this),this.defaultTree.data.type=a.Utils.normaliseType(a.TreeNodeType.COLLECTION),this._parseManifests(this),this._parseCollections(this),a.Utils.generateTreeNodeIds(this.defaultTree),this.defaultTree},t.prototype._parseManifests=function(e){if(e.getManifests()&&e.getManifests().length)for(var t=0;t<e.getManifests().length;t++){var r=e.getManifests()[t],n=r.getDefaultTree();n.label=r.parentLabel||r.getLabel().getValue(this.options.locale)||"manifest "+(t+1),n.navDate=r.getNavDate(),n.data.id=r.id,n.data.type=a.Utils.normaliseType(a.TreeNodeType.MANIFEST),e.defaultTree.addNode(n)}},t.prototype._parseCollections=function(e){if(e.getCollections()&&e.getCollections().length)for(var t=0;t<e.getCollections().length;t++){var r=e.getCollections()[t],n=r.getDefaultTree();n.label=r.parentLabel||r.getLabel().getValue(this.options.locale)||"collection "+(t+1),n.navDate=r.getNavDate(),n.data.id=r.id,n.data.type=a.Utils.normaliseType(a.TreeNodeType.COLLECTION),e.defaultTree.addNode(n)}},t}(a.IIIFResource);t.Collection=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){this.start=e,this.end=t}return e.prototype.getLength=function(){return this.end-this.start},e}();t.Duration=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),i=function(){function e(e){this.defaultLocale=e}return e.prototype.parse=function(e){this.resource=e,this.label=n.PropertyValue.parse(this.resource.label,this.defaultLocale),this.value=n.PropertyValue.parse(this.resource.value,this.defaultLocale)},e.prototype.getLabel=function(e){return null===this.label?null:(Array.isArray(e)&&!e.length&&(e=void 0),this.label.getValue(e||this.defaultLocale))},e.prototype.setLabel=function(e){null===this.label&&(this.label=new n.PropertyValue([])),this.label.setValue(e,this.defaultLocale)},e.prototype.getValue=function(e,t){return void 0===t&&(t="<br/>"),null===this.value?null:(Array.isArray(e)&&!e.length&&(e=void 0),this.value.getValue(e||this.defaultLocale,t))},e.prototype.getValues=function(e){return null===this.value?[]:(Array.isArray(e)&&!e.length&&(e=void 0),this.value.getValues(e||this.defaultLocale))},e.prototype.setValue=function(e){null===this.value&&(this.value=new n.PropertyValue([])),this.value.setValue(e,this.defaultLocale)},e}();t.LabelValuePair=i},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.getValue=function(e,t){return e.getValue(t,"<br/>")},t.getValues=function(e,t){return e.getValues(t)},t}(Array);t.LanguageMap=o},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)n[i]=o[a];return n};Object.defineProperty(t,"__esModule",{value:!0});var a=r(2),s=function(){function e(e,t,r){void 0===r&&(r="none"),Array.isArray(e)&&1===e.length?this._value=e[0]:this._value=e,"none"!==t&&"@none"!==t||(t=void 0),this._locale=t,this._defaultLocale=r}return e.parseV2Value=function(t,r){return"string"==typeof t?new e(t,void 0,r):t["@value"]?new e(t["@value"],t["@language"],r):null},Object.defineProperty(e.prototype,"value",{get:function(){return Array.isArray(this._value)?this._value.join("<br/>"):this._value},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"locale",{get:function(){return void 0===this._locale?this._defaultLocale:this._locale},enumerable:!0,configurable:!0}),e.prototype.addValue=function(e){Array.isArray(this._value)||(this._value=[this._value]),Array.isArray(e)?this._value=this._value.concat(e):this._value.push(e)},e}();t.LocalizedValue=s;var u=function(e){function t(r,n){void 0===r&&(r=[]);var i=e.apply(this,r)||this;return i.__proto__=t.prototype,i._defaultLocale=n,i}return i(t,e),t.parse=function(e,r){if(!e)return new t([],r);if(Array.isArray(e)){var n=(i=e.map((function(e){return s.parseV2Value(e,r)})).filter((function(e){return null!==e}))).reduce((function(e,t){var r=t._locale;return r||(r="none"),e[r]?e[r].addValue(t._value):e[r]=t,e}),{});return new t(Object.values(n),r)}return"string"==typeof e?new t([new s(e,void 0,r)],r):e["@language"]?new t(null!==(i=s.parseV2Value(e))?[i]:[],r):new t(Object.keys(e).map((function(t){var n=e[t];if(!Array.isArray(n))throw new Error("A IIIF v3 localized property value must have an array as the value for a given language.");return new s(n,t,r)})),r);var i},t.prototype.getSuitableLocale=function(e){for(var t=o(this).map((function(e){return e._locale})).filter((function(e){return void 0!==e})),r=function(e){var r=t.find((function(t){return t===e}));if(r)return{value:r}},n=0,i=e;n<i.length;n++){var s=r(i[n]);if("object"==typeof s)return s.value}for(var u=function(e){var r=t.find((function(t){return a.Utils.getInexactLocale(t)===a.Utils.getInexactLocale(e)}));if(r)return{value:r}},l=0,c=e;l<c.length;l++){var p=u(c[l]);if("object"==typeof p)return p.value}},t.prototype.setValue=function(e,t){var r=void 0;if(t){var n=this.getSuitableLocale([t]);n&&(r=this.find((function(e){return e._locale===n})))}else r=this.find((function(e){return void 0===e._locale}));r?r._value=e:this.push(new s(e,t,this._defaultLocale))},t.prototype.getValue=function(e,t){var r=this.getValues(e);return 0===r.length?null:t?r.join(t):r[0]},t.prototype.getValues=function(e){if(!this.length)return[];var t;if(t=e?Array.isArray(e)?e:[e]:[],1===this.length&&void 0===this[0]._locale){var r=this[0]._value;return Array.isArray(r)?r:[r]}var n=this.getSuitableLocale(t);if(n){r=this.find((function(e){return e._locale===n}))._value;return Array.isArray(r)?r:[r]}if(!this.find((function(e){return void 0===e._locale}))){r=this[0]._value;return Array.isArray(r)?r:[r]}var i=this.find((function(e){return void 0===e._locale}));return i?Array.isArray(i._value)?i._value:[i._value]:[]},t}(Array);t.PropertyValue=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CONTINUE=100,t.SWITCHING_PROTOCOLS=101,t.PROCESSING=102,t.OK=200,t.CREATED=201,t.ACCEPTED=202,t.NON_AUTHORITATIVE_INFORMATION=203,t.NO_CONTENT=204,t.RESET_CONTENT=205,t.PARTIAL_CONTENT=206,t.MULTI_STATUS=207,t.MULTIPLE_CHOICES=300,t.MOVED_PERMANENTLY=301,t.MOVED_TEMPORARILY=302,t.SEE_OTHER=303,t.NOT_MODIFIED=304,t.USE_PROXY=305,t.TEMPORARY_REDIRECT=307,t.BAD_REQUEST=400,t.UNAUTHORIZED=401,t.PAYMENT_REQUIRED=402,t.FORBIDDEN=403,t.NOT_FOUND=404,t.METHOD_NOT_ALLOWED=405,t.NOT_ACCEPTABLE=406,t.PROXY_AUTHENTICATION_REQUIRED=407,t.REQUEST_TIME_OUT=408,t.CONFLICT=409,t.GONE=410,t.LENGTH_REQUIRED=411,t.PRECONDITION_FAILED=412,t.REQUEST_ENTITY_TOO_LARGE=413,t.REQUEST_URI_TOO_LARGE=414,t.UNSUPPORTED_MEDIA_TYPE=415,t.REQUESTED_RANGE_NOT_SATISFIABLE=416,t.EXPECTATION_FAILED=417,t.IM_A_TEAPOT=418,t.UNPROCESSABLE_ENTITY=422,t.LOCKED=423,t.FAILED_DEPENDENCY=424,t.UNORDERED_COLLECTION=425,t.UPGRADE_REQUIRED=426,t.PRECONDITION_REQUIRED=428,t.TOO_MANY_REQUESTS=429,t.REQUEST_HEADER_FIELDS_TOO_LARGE=431,t.INTERNAL_SERVER_ERROR=500,t.NOT_IMPLEMENTED=501,t.BAD_GATEWAY=502,t.SERVICE_UNAVAILABLE=503,t.GATEWAY_TIME_OUT=504,t.HTTP_VERSION_NOT_SUPPORTED=505,t.VARIANT_ALSO_NEGOTIATES=506,t.INSUFFICIENT_STORAGE=507,t.BANDWIDTH_LIMIT_EXCEEDED=509,t.NOT_EXTENDED=510,t.NETWORK_AUTHENTICATION_REQUIRED=511},function(e,t,r){e.exports=window.fetch||(window.fetch=r(3).default||r(3))},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1),a=r(0),s=function(e){function t(t,r){var n=e.call(this,t,r)||this;if(n.index=0,n._allRanges=null,n.items=[],n._topRanges=[],n.__jsonld.structures&&n.__jsonld.structures.length)for(var i=n._getTopRanges(),o=0;o<i.length;o++){var a=i[o];n._parseRanges(a,String(o))}return n}return i(t,e),t.prototype.getPosterCanvas=function(){var e=this.getProperty("posterCanvas");return e&&(e=new a.Canvas(e,this.options)),e},t.prototype.getBehavior=function(){var e=this.getProperty("behavior");return Array.isArray(e)&&(e=e[0]),e||null},t.prototype.getDefaultTree=function(){if(e.prototype.getDefaultTree.call(this),this.defaultTree.data.type=a.Utils.normaliseType(a.TreeNodeType.MANIFEST),!this.isLoaded)return this.defaultTree;var t=this.getTopRanges();return t.length&&t[0].getTree(this.defaultTree),a.Utils.generateTreeNodeIds(this.defaultTree),this.defaultTree},t.prototype._getTopRanges=function(){var e=[];if(this.__jsonld.structures&&this.__jsonld.structures.length){for(var t=0;t<this.__jsonld.structures.length;t++){var r=this.__jsonld.structures[t];r.viewingHint===o.ViewingHint.TOP&&e.push(r)}if(!e.length){var n={};n.ranges=this.__jsonld.structures,e.push(n)}}return e},t.prototype.getTopRanges=function(){return this._topRanges},t.prototype._getRangeById=function(e){if(this.__jsonld.structures&&this.__jsonld.structures.length)for(var t=0;t<this.__jsonld.structures.length;t++){var r=this.__jsonld.structures[t];if(r["@id"]===e||r.id===e)return r}return null},t.prototype._parseRanges=function(e,t,r){var n,i=null;if("string"==typeof e&&(i=e,e=this._getRangeById(i)),e){(n=new a.Range(e,this.options)).parentRange=r,n.path=t,r?r.items.push(n):this._topRanges.push(n);var o=e.items||e.members;if(o)for(var s=0;s<o.length;s++){var u=o[s];if(u["@type"]&&"sc:range"===u["@type"].toLowerCase()||u.type&&"range"===u.type.toLowerCase())this._parseRanges(u,t+"/"+s,n);else if(u["@type"]&&"sc:canvas"===u["@type"].toLowerCase()||u.type&&"canvas"===u.type.toLowerCase()){n.canvases||(n.canvases=[]);var l=u.id||u["@id"];n.canvases.push(l)}}else if(e.ranges)for(s=0;s<e.ranges.length;s++)this._parseRanges(e.ranges[s],t+"/"+s,n)}else console.warn("Range:",i,"does not exist")},t.prototype.getAllRanges=function(){if(null!=this._allRanges)return this._allRanges;this._allRanges=[];for(var e=this.getTopRanges(),t=function(t){var n=e[t];n.id&&r._allRanges.push(n);var i=function(e,t){e.add(t);var r=t.getRanges();return r.length?r.reduce(i,e):e},o=Array.from(n.getRanges().reduce(i,new Set));r._allRanges=r._allRanges.concat(o)},r=this,n=0;n<e.length;n++)t(n);return this._allRanges},t.prototype.getRangeById=function(e){for(var t=this.getAllRanges(),r=0;r<t.length;r++){var n=t[r];if(n.id===e)return n}return null},t.prototype.getRangeByPath=function(e){for(var t=this.getAllRanges(),r=0;r<t.length;r++){var n=t[r];if(n.path===e)return n}return null},t.prototype.getSequences=function(){if(this.items.length)return this.items;var e=this.__jsonld.mediaSequences||this.__jsonld.sequences;if(e)for(var t=0;t<e.length;t++){var r=e[t],n=new a.Sequence(r,this.options);this.items.push(n)}else if(this.__jsonld.items){n=new a.Sequence(this.__jsonld.items,this.options);this.items.push(n)}return this.items},t.prototype.getSequenceByIndex=function(e){return this.getSequences()[e]},t.prototype.getTotalSequences=function(){return this.getSequences().length},t.prototype.getManifestType=function(){var e=this.getService(o.ServiceProfile.UI_EXTENSIONS);return e?e.getProperty("manifestType"):a.ManifestType.EMPTY},t.prototype.isMultiSequence=function(){return this.getTotalSequences()>1},t.prototype.isPagingEnabled=function(){var e=this.getViewingHint();if(e)return e===o.ViewingHint.PAGED;var t=this.getBehavior();return!!t&&t===o.Behavior.PAGED},t.prototype.getViewingDirection=function(){return this.getProperty("viewingDirection")},t.prototype.getViewingHint=function(){return this.getProperty("viewingHint")},t}(a.IIIFResource);t.Manifest=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.EMPTY="",e.MANUSCRIPT="manuscript",e.MONOGRAPH="monograph"}(t.ManifestType||(t.ManifestType={}))},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),a=r(1),s=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n._ranges=null,n.canvases=null,n.items=[],n}return i(t,e),t.prototype.getCanvasIds=function(){return this.__jsonld.canvases?this.__jsonld.canvases:this.canvases?this.canvases:[]},t.prototype.getDuration=function(){if(this.canvases&&this.canvases.length){for(var e=[],t=[],r=0,n=this.canvases;r<n.length;r++){if(_=n[r]){var i=_.match(/(.*)#t=([0-9.]+),?([0-9.]+)?/)||[void 0,_],a=i[1],s=i[2],u=i[3];a&&(e.push(parseFloat(s)),t.push(parseFloat(u)))}}if(e.length&&t.length)return new o.Duration(Math.min.apply(Math,e),Math.max.apply(Math,t))}else{e=[],t=[];for(var l=0,c=d=this.getRanges();l<c.length;l++){(v=c[l].getDuration())&&(e.push(v.start),t.push(v.end))}if(e.length&&t.length)return new o.Duration(Math.min.apply(Math,e),Math.max.apply(Math,t))}var p,f;if(this.canvases&&this.canvases.length)for(var h=0;h<this.canvases.length;h++){var _=this.canvases[h],g=o.Utils.getTemporalComponent(_);g&&g.length>1&&(0===h&&(p=Number(g[0])),h===this.canvases.length-1&&(f=Number(g[1])))}else{var d=this.getRanges();for(h=0;h<d.length;h++){var v;(v=d[h].getDuration())&&(0===h&&(p=v.start),h===d.length-1&&(f=v.end))}}if(void 0!==p&&void 0!==f)return new o.Duration(p,f)},t.prototype.getRanges=function(){return this._ranges?this._ranges:this._ranges=this.items.filter((function(e){return e.isRange()}))},t.prototype.getBehavior=function(){var e=this.getProperty("behavior");return Array.isArray(e)&&(e=e[0]),e||null},t.prototype.getViewingDirection=function(){return this.getProperty("viewingDirection")},t.prototype.getViewingHint=function(){return this.getProperty("viewingHint")},t.prototype.getTree=function(e){e.data=this,this.treeNode=e;var t=this.getRanges();if(t&&t.length)for(var r=0;r<t.length;r++){var n=t[r],i=new o.TreeNode;e.addNode(i),this._parseTreeNode(i,n)}return o.Utils.generateTreeNodeIds(e),e},t.prototype.spansTime=function(e){var t=this.getDuration();return!!(t&&e>=t.start&&e<=t.end)},t.prototype._parseTreeNode=function(e,t){e.label=t.getLabel().getValue(this.options.locale),e.data=t,e.data.type=o.Utils.normaliseType(o.TreeNodeType.RANGE),t.treeNode=e;var r=t.getRanges();if(r&&r.length)for(var n=0;n<r.length;n++){var i=r[n];if(i.getBehavior()!==a.Behavior.NO_NAV){var s=new o.TreeNode;e.addNode(s),this._parseTreeNode(s,i)}}},t}(o.ManifestResource);t.Range=s},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t,r){return e.call(this,t,r)||this}return i(t,e),t.prototype.getFormat=function(){return this.getProperty("format")},t}(r(0).ManifestResource);t.Rendering=o},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1),a=r(0),s=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.items=[],n._thumbnails=null,n}return i(t,e),t.prototype.getCanvases=function(){if(this.items.length)return this.items;var e=this.__jsonld.canvases||this.__jsonld.elements;if(e)for(var t=0;t<e.length;t++){var r=e[t];(n=new a.Canvas(r,this.options)).index=t,this.items.push(n)}else if(this.__jsonld)for(t=0;t<this.__jsonld.length;t++){var n;r=this.__jsonld[t];(n=new a.Canvas(r,this.options)).index=t,this.items.push(n)}return this.items},t.prototype.getCanvasById=function(e){for(var t=0;t<this.getTotalCanvases();t++){var r=this.getCanvasByIndex(t),n=a.Utils.normaliseUrl(r.id);if(a.Utils.normaliseUrl(e)===n)return r}return null},t.prototype.getCanvasByIndex=function(e){return this.getCanvases()[e]},t.prototype.getCanvasIndexById=function(e){for(var t=0;t<this.getTotalCanvases();t++){if(this.getCanvasByIndex(t).id===e)return t}return null},t.prototype.getCanvasIndexByLabel=function(e,t){e=e.trim(),isNaN(e)||(e=parseInt(e,10).toString(),t&&(e+="r"));for(var r,n,i,o=/(\d*)\D+(\d*)/,a=0;a<this.getTotalCanvases();a++){var s=this.getCanvasByIndex(a);if(s.getLabel().getValue(this.options.locale)===e)return a;if((r=o.exec(e))&&(n=r[1],(i=r[2])&&new RegExp("^"+n+"\\D+"+i+"$").test(s.getLabel().toString())))return a}return-1},t.prototype.getLastCanvasLabel=function(e){for(var t=this.getTotalCanvases()-1;t>=0;t--){var r=this.getCanvasByIndex(t).getLabel().getValue(this.options.locale);if(e){if(/^[a-zA-Z0-9]*$/.test(r))return r}else if(r)return r}return this.options.defaultLabel},t.prototype.getLastPageIndex=function(){return this.getTotalCanvases()-1},t.prototype.getNextPageIndex=function(e,t){var r;if(t){var n=this.getPagedIndices(e),i=this.getViewingDirection();r=i&&i===o.ViewingDirection.RIGHT_TO_LEFT?n[0]+1:n[n.length-1]+1}else r=e+1;return r>this.getLastPageIndex()?-1:r},t.prototype.getPagedIndices=function(e,t){var r=[];if(t){r=this.isFirstCanvas(e)||this.isLastCanvas(e)?[e]:e%2?[e,e+1]:[e-1,e];var n=this.getViewingDirection();n&&n===o.ViewingDirection.RIGHT_TO_LEFT&&(r=r.reverse())}else r.push(e);return r},t.prototype.getPrevPageIndex=function(e,t){var r;if(t){var n=this.getPagedIndices(e),i=this.getViewingDirection();r=i&&i===o.ViewingDirection.RIGHT_TO_LEFT?n[n.length-1]-1:n[0]-1}else r=e-1;return r},t.prototype.getStartCanvasIndex=function(){var e=this.getStartCanvas();if(e)for(var t=0;t<this.getTotalCanvases();t++){if(this.getCanvasByIndex(t).id===e)return t}return 0},t.prototype.getThumbs=function(e,t){for(var r=[],n=this.getTotalCanvases(),i=0;i<n;i++){var o=this.getCanvasByIndex(i),s=new a.Thumb(e,o);r.push(s)}return r},t.prototype.getThumbnails=function(){if(null!=this._thumbnails)return this._thumbnails;this._thumbnails=[];for(var e=this.getCanvases(),t=0;t<e.length;t++){var r=e[t].getThumbnail();r&&this._thumbnails.push(r)}return this._thumbnails},t.prototype.getStartCanvas=function(){return this.getProperty("startCanvas")},t.prototype.getTotalCanvases=function(){return this.getCanvases().length},t.prototype.getViewingDirection=function(){return this.getProperty("viewingDirection")?this.getProperty("viewingDirection"):this.options.resource.getViewingDirection?this.options.resource.getViewingDirection():null},t.prototype.getViewingHint=function(){return this.getProperty("viewingHint")},t.prototype.isCanvasIndexOutOfRange=function(e){return e>this.getTotalCanvases()-1},t.prototype.isFirstCanvas=function(e){return 0===e},t.prototype.isLastCanvas=function(e){return e===this.getTotalCanvases()-1},t.prototype.isMultiCanvas=function(){return this.getTotalCanvases()>1},t.prototype.isPagingEnabled=function(){var e=this.getViewingHint();return!!e&&e===o.ViewingHint.PAGED},t.prototype.isTotalCanvasesEven=function(){return this.getTotalCanvases()%2==0},t}(a.ManifestResource);t.Sequence=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),i=function(){function e(){}return e.parse=function(e,t){return"string"==typeof e&&(e=JSON.parse(e)),this.parseJson(e,t)},e.parseJson=function(e,t){var r;if(t&&t.navDate&&!isNaN(t.navDate.getTime())&&(e.navDate=t.navDate.toString()),e["@type"])switch(e["@type"]){case"sc:Collection":r=this.parseCollection(e,t);break;case"sc:Manifest":r=this.parseManifest(e,t);break;default:return null}else switch(e.type){case"Collection":r=this.parseCollection(e,t);break;case"Manifest":r=this.parseManifest(e,t);break;default:return null}return r.isLoaded=!0,r},e.parseCollection=function(e,t){var r=new n.Collection(e,t);return t?(r.index=t.index||0,t.resource&&(r.parentCollection=t.resource.parentCollection)):r.index=0,this.parseCollections(r,t),this.parseManifests(r,t),this.parseItems(r,t),r},e.parseCollections=function(e,t){var r;if(e.__jsonld.collections?r=e.__jsonld.collections:e.__jsonld.items&&(r=e.__jsonld.items.filter((function(e){return"collection"===e.type.toLowerCase()}))),r)for(var n=0;n<r.length;n++){t&&(t.index=n);var i=this.parseCollection(r[n],t);i.index=n,i.parentCollection=e,e.items.push(i)}},e.parseManifest=function(e,t){return new n.Manifest(e,t)},e.parseManifests=function(e,t){var r;if(e.__jsonld.manifests?r=e.__jsonld.manifests:e.__jsonld.items&&(r=e.__jsonld.items.filter((function(e){return"manifest"===e.type.toLowerCase()}))),r)for(var n=0;n<r.length;n++){var i=this.parseManifest(r[n],t);i.index=n,i.parentCollection=e,e.items.push(i)}},e.parseItem=function(e,t){if(e["@type"]){if("sc:manifest"===e["@type"].toLowerCase())return this.parseManifest(e,t);if("sc:collection"===e["@type"].toLowerCase())return this.parseCollection(e,t)}else if(e.type){if("manifest"===e.type.toLowerCase())return this.parseManifest(e,t);if("collection"===e.type.toLowerCase())return this.parseCollection(e,t)}return null},e.parseItems=function(e,t){var r=e.__jsonld.members||e.__jsonld.items;if(r)for(var n=function(n){t&&(t.index=n);var o=i.parseItem(r[n],t);return o?e.items.filter((function(e){return e.id===o.id}))[0]?"continue":(o.index=n,o.parentCollection=e,void e.items.push(o)):{value:void 0}},i=this,o=0;o<r.length;o++){var a=n(o);if("object"==typeof a)return a.value}},e}();t.Deserialiser=i},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),a=function(e){function t(t,r){return e.call(this,t,r)||this}return i(t,e),t.prototype.getProfile=function(){var e=this.getProperty("profile");return e||(e=this.getProperty("dcterms:conformsTo")),Array.isArray(e)?e[0]:e},t.prototype.getConfirmLabel=function(){return o.Utils.getLocalisedValue(this.getProperty("confirmLabel"),this.options.locale)},t.prototype.getDescription=function(){return o.Utils.getLocalisedValue(this.getProperty("description"),this.options.locale)},t.prototype.getFailureDescription=function(){return o.Utils.getLocalisedValue(this.getProperty("failureDescription"),this.options.locale)},t.prototype.getFailureHeader=function(){return o.Utils.getLocalisedValue(this.getProperty("failureHeader"),this.options.locale)},t.prototype.getHeader=function(){return o.Utils.getLocalisedValue(this.getProperty("header"),this.options.locale)},t.prototype.getServiceLabel=function(){return o.Utils.getLocalisedValue(this.getProperty("label"),this.options.locale)},t.prototype.getInfoUri=function(){var e=this.id;return e.endsWith("/")||(e+="/"),e+="info.json"},t}(o.ManifestResource);t.Service=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){this.width=e,this.height=t};t.Size=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.AUTHORIZATION_FAILED=1]="AUTHORIZATION_FAILED",e[e.FORBIDDEN=2]="FORBIDDEN",e[e.INTERNAL_SERVER_ERROR=3]="INTERNAL_SERVER_ERROR",e[e.RESTRICTED=4]="RESTRICTED"}(t.StatusCode||(t.StatusCode={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){this.data=t,this.index=t.index,this.width=e;var r=t.getHeight()/t.getWidth();this.height=r?Math.floor(this.width*r):e,this.uri=t.getCanonicalImageUri(e),this.label=t.getLabel().getValue()};t.Thumb=n},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t,r){return e.call(this,t,r)||this}return i(t,e),t}(r(0).Resource);t.Thumbnail=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),i=function(){function e(e,t){this.label=e,this.data=t||{},this.nodes=[]}return e.prototype.addNode=function(e){this.nodes.push(e),e.parentNode=this},e.prototype.isCollection=function(){return this.data.type===n.Utils.normaliseType(n.TreeNodeType.COLLECTION)},e.prototype.isManifest=function(){return this.data.type===n.Utils.normaliseType(n.TreeNodeType.MANIFEST)},e.prototype.isRange=function(){return this.data.type===n.Utils.normaliseType(n.TreeNodeType.RANGE)},e}();t.TreeNode=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.COLLECTION="collection",e.MANIFEST="manifest",e.RANGE="range"}(t.TreeNodeType||(t.TreeNodeType={}))}]);
{
"name": "manifesto.js",
"version": "4.2.1",
"version": "4.2.2",
"description": "IIIF Presentation API utility library for client and server",

@@ -5,0 +5,0 @@ "main": "./dist-commonjs/index.js",

@@ -36,2 +36,3 @@ const finalhandler = require('finalhandler');

importTest('audio', './tests/audio');
importTest('bad-manifest-url', './tests/bad-manifest-url');
importTest('biocrats', './tests/biocrats');

@@ -38,0 +39,0 @@ importTest('book-of-remembrance', './tests/book-of-remembrance');

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 too big to display