UNPKG

@tindtechnologies/universalviewer

Version:

The Universal Viewer is a community-developed open source project on a mission to help you share your 📚📜📰📽️📻🗿 with the 🌎

1 lines 114 kB
import{c as K,d as U}from"./chunk-L67DAW3A.js";var k=K(P=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});P.ViewingHint=P.ViewingDirection=P.ServiceType=P.ServiceProfile=P.RenderingFormat=P.MediaType=P.IIIFResourceType=P.ExternalResourceType=P.Behavior=P.AnnotationMotivation=void 0;var J;(function(a){a.BOOKMARKING="oa:bookmarking",a.CLASSIFYING="oa:classifying",a.COMMENTING="oa:commenting",a.DESCRIBING="oa:describing",a.EDITING="oa:editing",a.HIGHLIGHTING="oa:highlighting",a.IDENTIFYING="oa:identifying",a.LINKING="oa:linking",a.MODERATING="oa:moderating",a.PAINTING="sc:painting",a.QUESTIONING="oa:questioning",a.REPLYING="oa:replying",a.TAGGING="oa:tagging",a.TRANSCRIBING="oad:transcribing"})(J||(P.AnnotationMotivation=J={}));var Z;(function(a){a.AUTO_ADVANCE="auto-advance",a.CONTINUOUS="continuous",a.FACING_PAGES="facing-pages",a.HIDDEN="hidden",a.INDIVIDUALS="individuals",a.MULTI_PART="multi-part",a.NO_NAV="no-nav",a.NON_PAGED="non-paged",a.PAGED="paged",a.REPEAT="repeat",a.SEQUENCE="sequence",a.THUMBNAIL_NAV="thumbnail-nav",a.TOGETHER="together",a.UNORDERED="unordered"})(Z||(P.Behavior=Z={}));var $;(function(a){a.CANVAS="canvas",a.CHOICE="choice",a.OA_CHOICE="oa:choice",a.CONTENT_AS_TEXT="contentastext",a.DATASET="dataset",a.DOCUMENT="document",a.IMAGE="image",a.MODEL="model",a.MOVING_IMAGE="movingimage",a.PDF="pdf",a.PHYSICAL_OBJECT="physicalobject",a.SOUND="sound",a.TEXT="text",a.TEXTUALBODY="textualbody",a.VIDEO="video"})($||(P.ExternalResourceType=$={}));var ee;(function(a){a.ANNOTATION="annotation",a.ANNOTATION_COLLECTION="annotationcollection",a.ANNOTATION_PAGE="annotationpage",a.CANVAS="canvas",a.COLLECTION="collection",a.MANIFEST="manifest",a.RANGE="range",a.SEQUENCE="sequence"})(ee||(P.IIIFResourceType=ee={}));var te;(function(a){a.APNG="image/apng",a.AUDIO_MP4="audio/mp4",a.AUDIO_OGG="audio/ogg",a.AVIF="audio/avif",a.CORTO="application/corto",a.DICOM="application/dicom",a.DRACO="application/draco",a.EPUB="application/epub+zip",a.GIF="image/gif",a.GIRDER="image/vnd.kitware.girder",a.GLB="model/gltf-binary",a.GLTF="model/gltf+json",a.IIIF_PRESENTATION_2='application/ld+json;profile="http://iiif.io/api/presentation/2/context.json"',a.IIIF_PRESENTATION_3='application/ld+json;profile="http://iiif.io/api/presentation/3/context.json"',a.JPG="image/jpeg",a.M3U8="application/vnd.apple.mpegurl",a.MP3="audio/mp3",a.MPEG="audio/mpeg",a.MPEG_DASH="application/dash+xml",a.OBJ="model/obj",a.OPF="application/oebps-package+xml",a.PDF="application/pdf",a.PLY="application/ply",a.PNG="image/png",a.SVG="image/svg+xml",a.THREEJS="application/vnd.threejs+json",a.USDZ="model/vnd.usd+zip",a.VIDEO_MP4="video/mp4",a.VIDEO_OGG="video/ogg",a.WAV="audio/wav",a.WEBM="video/webm",a.WEBP="image/webp"})(te||(P.MediaType=te={}));var ne;(function(a){a.DOC="application/msword",a.DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",a.ODT="application/vnd.oasis.opendocument.text",a.PDF="application/pdf"})(ne||(P.RenderingFormat=ne={}));var re;(function(a){a.IMAGE_0_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/compliance.html#level0",a.IMAGE_0_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/compliance.html#level1",a.IMAGE_0_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/compliance.html#level2",a.IMAGE_0_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/conformance.html#level0",a.IMAGE_0_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/conformance.html#level1",a.IMAGE_0_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/conformance.html#level2",a.IMAGE_1_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",a.IMAGE_1_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",a.IMAGE_1_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",a.IMAGE_1_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",a.IMAGE_1_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",a.IMAGE_1_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",a.IMAGE_1_LEVEL_0="http://iiif.io/api/image/1/level0.json",a.IMAGE_1_PROFILE_LEVEL_0="http://iiif.io/api/image/1/profiles/level0.json",a.IMAGE_1_LEVEL_1="http://iiif.io/api/image/1/level1.json",a.IMAGE_1_PROFILE_LEVEL_1="http://iiif.io/api/image/1/profiles/level1.json",a.IMAGE_1_LEVEL_2="http://iiif.io/api/image/1/level2.json",a.IMAGE_1_PROFILE_LEVEL_2="http://iiif.io/api/image/1/profiles/level2.json",a.IMAGE_2_LEVEL_0="http://iiif.io/api/image/2/level0.json",a.IMAGE_2_PROFILE_LEVEL_0="http://iiif.io/api/image/2/profiles/level0.json",a.IMAGE_2_LEVEL_1="http://iiif.io/api/image/2/level1.json",a.IMAGE_2_PROFILE_LEVEL_1="http://iiif.io/api/image/2/profiles/level1.json",a.IMAGE_2_LEVEL_2="http://iiif.io/api/image/2/level2.json",a.IMAGE_2_PROFILE_LEVEL_2="http://iiif.io/api/image/2/profiles/level2.json",a.AUTH_0_CLICK_THROUGH="http://iiif.io/api/auth/0/login/clickthrough",a.AUTH_0_LOGIN="http://iiif.io/api/auth/0/login",a.AUTH_0_LOGOUT="http://iiif.io/api/auth/0/logout",a.AUTH_0_RESTRICTED="http://iiif.io/api/auth/0/login/restricted",a.AUTH_0_TOKEN="http://iiif.io/api/auth/0/token",a.AUTH_1_CLICK_THROUGH="http://iiif.io/api/auth/1/clickthrough",a.AUTH_1_EXTERNAL="http://iiif.io/api/auth/1/external",a.AUTH_1_KIOSK="http://iiif.io/api/auth/1/kiosk",a.AUTH_1_LOGIN="http://iiif.io/api/auth/1/login",a.AUTH_1_LOGOUT="http://iiif.io/api/auth/1/logout",a.AUTH_1_PROBE="http://iiif.io/api/auth/1/probe",a.AUTH_1_TOKEN="http://iiif.io/api/auth/1/token",a.SEARCH_0="http://iiif.io/api/search/0/search",a.SEARCH_0_AUTO_COMPLETE="http://iiif.io/api/search/0/autocomplete",a.SEARCH_1="http://iiif.io/api/search/1/search",a.SEARCH_1_AUTO_COMPLETE="http://iiif.io/api/search/1/autocomplete",a.SEARCH_2="http://iiif.io/api/search/2/search",a.SEARCH_2_AUTO_COMPLETE="http://iiif.io/api/search/2/autocomplete",a.TRACKING_EXTENSIONS="http://universalviewer.io/tracking-extensions-profile",a.UI_EXTENSIONS="http://universalviewer.io/ui-extensions-profile",a.PRINT_EXTENSIONS="http://universalviewer.io/print-extensions-profile",a.SHARE_EXTENSIONS="http://universalviewer.io/share-extensions-profile",a.DOWNLOAD_EXTENSIONS="http://universalviewer.io/download-extensions-profile",a.OTHER_MANIFESTATIONS="http://iiif.io/api/otherManifestations.json",a.IXIF="http://wellcomelibrary.org/ld/ixif/0/alpha.json"})(re||(P.ServiceProfile=re={}));var ie;(function(a){a.IMAGE_SERVICE_2="ImageService2",a.IMAGE_SERVICE_3="ImageService3",a.SEARCH_SERVICE_2="SearchService2",a.AUTO_COMPLETE_SERVICE_2="AutoCompleteService2"})(ie||(P.ServiceType=ie={}));var oe;(function(a){a.BOTTOM_TO_TOP="bottom-to-top",a.LEFT_TO_RIGHT="left-to-right",a.RIGHT_TO_LEFT="right-to-left",a.TOP_TO_BOTTOM="top-to-bottom"})(oe||(P.ViewingDirection=oe={}));var ae;(function(a){a.CONTINUOUS="continuous",a.INDIVIDUALS="individuals",a.NON_PAGED="non-paged",a.PAGED="paged",a.TOP="top"})(ae||(P.ViewingHint=ae={}))});var F=K((H,W)=>{(function(a,i){typeof H=="object"&&typeof W=="object"?W.exports=i():typeof define=="function"&&define.amd?define("manifesto",[],i):typeof H=="object"?H.manifesto=i():a.manifesto=i()})(typeof self<"u"?self:H,()=>(()=>{var a={41:function(l,r,c){"use strict";var g=this&&this.__awaiter||function(t,e,o,n){return new(o||(o=Promise))(function(p,d){function E(m){try{O(n.next(m))}catch(I){d(I)}}function y(m){try{O(n.throw(m))}catch(I){d(I)}}function O(m){var I;m.done?p(m.value):(I=m.value,I instanceof o?I:new o(function(T){T(I)})).then(E,y)}O((n=n.apply(t,e||[])).next())})},_=this&&this.__generator||function(t,e){var o,n,p,d={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]},E=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return E.next=y(0),E.throw=y(1),E.return=y(2),typeof Symbol=="function"&&(E[Symbol.iterator]=function(){return this}),E;function y(O){return function(m){return function(I){if(o)throw new TypeError("Generator is already executing.");for(;E&&(E=0,I[0]&&(d=0)),d;)try{if(o=1,n&&(p=2&I[0]?n.return:I[0]?n.throw||((p=n.return)&&p.call(n),0):n.next)&&!(p=p.call(n,I[1])).done)return p;switch(n=0,p&&(I=[2&I[0],p.value]),I[0]){case 0:case 1:p=I;break;case 4:return d.label++,{value:I[1],done:!1};case 5:d.label++,n=I[1],I=[0];continue;case 7:I=d.ops.pop(),d.trys.pop();continue;default:if(!((p=(p=d.trys).length>0&&p[p.length-1])||I[0]!==6&&I[0]!==2)){d=0;continue}if(I[0]===3&&(!p||I[1]>p[0]&&I[1]<p[3])){d.label=I[1];break}if(I[0]===6&&d.label<p[1]){d.label=p[1],p=I;break}if(p&&d.label<p[2]){d.label=p[2],d.ops.push(I);break}p[2]&&d.ops.pop(),d.trys.pop();continue}I=e.call(t,d)}catch(T){I=[6,T],n=0}finally{o=p=0}if(5&I[0])throw I[1];return{value:I[0]?I[1]:void 0,done:!0}}([O,m])}}};Object.defineProperty(r,"__esModule",{value:!0}),r.Utils=void 0;var v=c(4799),u=c(3957),h=c(7019);c(916);var s=function(){function t(){}return t.getMediaType=function(e){return(e=(e=e.toLowerCase()).split(";")[0]).trim()},t.getImageQuality=function(e){return e===u.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1||e===u.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2||e===u.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1||e===u.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2||e===u.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1||e===u.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2||e===u.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1||e===u.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2||e===u.ServiceProfile.IMAGE_1_LEVEL_1||e===u.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1||e===u.ServiceProfile.IMAGE_1_LEVEL_2||e===u.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2?"native":"default"},t.getInexactLocale=function(e){return e.indexOf("-")!==-1?e.substr(0,e.indexOf("-")):e},t.getLocalisedValue=function(e,o){if(!Array.isArray(e))return e;for(var n=0;n<e.length;n++){var p=e[n];if(o===p["@language"])return p["@value"]}var d=o.substr(0,o.indexOf("-"));for(n=0;n<e.length;n++){var E=e[n];if(E["@language"]===d)return E["@value"]}return null},t.generateTreeNodeIds=function(e,o){var n;o===void 0&&(o=0),n=e.parentNode?e.parentNode.id+"-"+o:"0",e.id=n;for(var p=0;p<e.nodes.length;p++){var d=e.nodes[p];t.generateTreeNodeIds(d,p)}},t.normaliseType=function(e){return(e=(e||"").toLowerCase()).indexOf(":")!==-1?e.split(":")[1]:e},t.normaliseUrl=function(e){return(e=e.substr(e.indexOf("://"))).indexOf("#")!==-1&&(e=e.split("#")[0]),e},t.normalisedUrlsMatch=function(e,o){return t.normaliseUrl(e)===t.normaliseUrl(o)},t.isImageProfile=function(e){return!!(t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_1_LEVEL_0)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_1_LEVEL_1)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_1_LEVEL_2)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_2_LEVEL_0)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_2_LEVEL_1)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_2_LEVEL_2)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2))},t.isImageServiceType=function(e){return e!==null&&e.toLowerCase()===u.ServiceType.IMAGE_SERVICE_2.toLowerCase()||e===u.ServiceType.IMAGE_SERVICE_3.toLowerCase()},t.isLevel0ImageProfile=function(e){return!!(t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_0)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_1_LEVEL_0)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_2_LEVEL_0)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0))},t.isLevel1ImageProfile=function(e){return!!(t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_1_LEVEL_1)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_2_LEVEL_1)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1))},t.isLevel2ImageProfile=function(e){return!!(t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_1_LEVEL_2)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_2_LEVEL_2)||t.normalisedUrlsMatch(e,u.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2))},t.parseManifest=function(e,o){return v.Deserialiser.parse(e,o)},t.checkStatus=function(e){if(e.ok)return e;var o=new Error(e.statusText);return o.response=e,Promise.reject(o)},t.loadManifest=function(e){return new Promise(function(o,n){fetch(e).then(t.checkStatus).then(function(p){return p.json()}).then(function(p){o(p)}).catch(function(p){n()})})},t.loadExternalResourcesAuth1=function(e,o,n,p,d,E,y,O){return new Promise(function(m,I){var T=e.map(function(A){return t.loadExternalResourceAuth1(A,o,n,p,d,E,y,O)});Promise.all(T).then(function(){m(e)}).catch(function(A){I(A)})})},t.loadExternalResourceAuth1=function(e,o,n,p,d,E,y,O){return g(this,void 0,void 0,function(){var m;return _(this,function(I){switch(I.label){case 0:return[4,p(e)];case 1:return(m=I.sent())?[4,e.getData(m)]:[3,6];case 2:return I.sent(),e.status!==h.OK?[3,3]:[2,e];case 3:return[4,t.doAuthChain(e,o,n,d,E,y,O)];case 4:I.sent(),I.label=5;case 5:if(e.status===h.OK||e.status===h.MOVED_TEMPORARILY)return[2,e];throw t.createAuthorizationFailedError();case 6:return[4,e.getData()];case 7:return I.sent(),e.status!==h.MOVED_TEMPORARILY&&e.status!==h.UNAUTHORIZED?[3,9]:[4,t.doAuthChain(e,o,n,d,E,y,O)];case 8:I.sent(),I.label=9;case 9:if(e.status===h.OK||e.status===h.MOVED_TEMPORARILY)return[2,e];throw t.createAuthorizationFailedError()}})})},t.doAuthChain=function(e,o,n,p,d,E,y){return g(this,void 0,void 0,function(){var O,m,I,T,A,L,N,b;return _(this,function(D){switch(D.label){case 0:return e.isAccessControlled()?((O=e.externalService)&&(O.options=e.options),(m=e.kioskService)&&(m.options=e.options),(I=e.clickThroughService)&&(I.options=e.options),(T=e.loginService)&&(T.options=e.options),e.isResponseHandled||e.status!==h.MOVED_TEMPORARILY?[3,2]:[4,E(e)]):[2,e];case 1:case 3:case 6:case 10:case 14:return D.sent(),[2,e];case 2:return A=null,L=null,(A=O)?(L=A,[4,t.attemptResourceWithToken(e,n,A)]):[3,4];case 4:return(A=m)?(L=A,(N=o(A))?[4,p(N)]:[3,7]):[3,7];case 5:case 9:case 13:return D.sent(),[4,t.attemptResourceWithToken(e,n,A)];case 7:return(A=I)?(L=A,[4,d(e,A)]):[3,11];case 8:return(b=D.sent())?[4,p(b)]:[3,11];case 11:return(A=T)?(L=A,[4,d(e,A)]):[3,15];case 12:return(b=D.sent())?[4,p(b)]:[3,15];case 15:return L&&y(e,L),[2]}})})},t.attemptResourceWithToken=function(e,o,n){return g(this,void 0,void 0,function(){var p,d;return _(this,function(E){switch(E.label){case 0:return(p=n.getService(u.ServiceProfile.AUTH_1_TOKEN))?[4,o(e,p)]:[3,3];case 1:return(d=E.sent())&&d.accessToken?[4,e.getData(d)]:[3,3];case 2:return E.sent(),[2,e];case 3:return[2]}})})},t.loadExternalResourcesAuth09=function(e,o,n,p,d,E,y,O,m,I){return new Promise(function(T,A){var L=e.map(function(N){return t.loadExternalResourceAuth09(N,o,n,p,d,E,y,O,m,I)});Promise.all(L).then(function(){T(e)}).catch(function(N){A(N)})})},t.loadExternalResourceAuth09=function(e,o,n,p,d,E,y,O,m,I){return new Promise(function(T,A){I&&I.pessimisticAccessControl?e.getData().then(function(){e.isAccessControlled()?e.clickThroughService?(T(n(e)),T(p(e))):d(e).then(function(){E(e,!0).then(function(L){e.getData(L).then(function(){T(m(e))}).catch(function(N){A(t.createInternalServerError(N))})}).catch(function(L){A(t.createInternalServerError(L))})}).catch(function(L){A(t.createInternalServerError(L))}):T(e)}).catch(function(L){A(t.createInternalServerError(L))}):O(e,o).then(function(L){L?e.getData(L).then(function(){e.status===h.OK?T(m(e)):t.authorize(e,o,n,p,d,E,y,O).then(function(){T(m(e))}).catch(function(N){A(t.createAuthorizationFailedError())})}).catch(function(N){A(t.createAuthorizationFailedError())}):t.authorize(e,o,n,p,d,E,y,O).then(function(){T(m(e))}).catch(function(N){A(t.createAuthorizationFailedError())})}).catch(function(L){A(t.createAuthorizationFailedError())})})},t.createError=function(e,o){var n=new Error;return n.message=o,n.name=String(e),n},t.createAuthorizationFailedError=function(){return t.createError(v.StatusCode.AUTHORIZATION_FAILED,"Authorization failed")},t.createRestrictedError=function(){return t.createError(v.StatusCode.RESTRICTED,"Restricted")},t.createInternalServerError=function(e){return t.createError(v.StatusCode.INTERNAL_SERVER_ERROR,e)},t.authorize=function(e,o,n,p,d,E,y,O){return new Promise(function(m,I){e.getData().then(function(){e.isAccessControlled()?O(e,o).then(function(T){T?e.getData(T).then(function(){e.status===h.OK?m(e):t.showAuthInteraction(e,o,n,p,d,E,y,m,I)}).catch(function(A){I(t.createInternalServerError(A))}):E(e,!1).then(function(A){A?y(e,A,o).then(function(){e.getData(A).then(function(){e.status===h.OK?m(e):t.showAuthInteraction(e,o,n,p,d,E,y,m,I)}).catch(function(L){I(t.createInternalServerError(L))})}).catch(function(L){I(t.createInternalServerError(L))}):t.showAuthInteraction(e,o,n,p,d,E,y,m,I)})}).catch(function(T){I(t.createInternalServerError(T))}):m(e)})})},t.showAuthInteraction=function(e,o,n,p,d,E,y,O,m){e.status!==h.MOVED_TEMPORARILY||e.isResponseHandled?e.clickThroughService&&!e.isResponseHandled?n(e).then(function(){E(e,!0).then(function(I){y(e,I,o).then(function(){e.getData(I).then(function(){O(e)}).catch(function(T){m(t.createInternalServerError(T))})}).catch(function(T){m(t.createInternalServerError(T))})}).catch(function(I){m(t.createInternalServerError(I))})}):d(e).then(function(){E(e,!0).then(function(I){y(e,I,o).then(function(){e.getData(I).then(function(){O(e)}).catch(function(T){m(t.createInternalServerError(T))})}).catch(function(T){m(t.createInternalServerError(T))})}).catch(function(I){m(t.createInternalServerError(I))})}):O(e)},t.getService=function(e,o){for(var n=this.getServices(e),p=0;p<n.length;p++){var d=n[p];if(d.getProfile()===o)return d}return null},t.getResourceById=function(e,o){return t.traverseAndFind(e.__jsonld,"@id",o)},t.traverseAndFind=function(e,o,n){if(e.hasOwnProperty(o)&&e[o]===n)return e;for(var p=0;p<Object.keys(e).length;p++)if(typeof e[Object.keys(e)[p]]=="object"){var d=t.traverseAndFind(e[Object.keys(e)[p]],o,n);if(d!=null)return d}},t.getServices=function(e,o){var n=o===void 0?{}:o,p=n.onlyService,d=p!==void 0&&p,E=n.onlyServices,y=E!==void 0&&E,O=n.skipParentResources,m=[];(O===void 0||!O)&&e&&e.options&&e.options.resource&&e.options.resource!==e&&m.push.apply(m,t.getServices(e.options.resource,{onlyServices:!0}));var I=y?[]:(e.__jsonld||e).service||[];if(Array.isArray(I)||(I=[I]),d||I.push.apply(I,(e.__jsonld||e).services||[]),I.length===0)return m;for(var T=0;T<I.length;T++){var A=I[T];if(typeof A=="string"){var L=this.getResourceById(e.options.resource,A);L&&m.push(new v.Service(L.__jsonld||L,e.options))}else m.push(new v.Service(A,e.options))}return m},t.getTemporalComponent=function(e){var o=/t=([^&]+)/g.exec(e),n=null;return o&&o[1]&&(n=o[1].split(",")),n},t}();r.Utils=s},72:(l,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0})},107:function(l,r,c){"use strict";var g,_=this&&this.__extends||(g=function(s,t){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,o){e.__proto__=o}||function(e,o){for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])},g(s,t)},function(s,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=s}g(s,t),s.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)});Object.defineProperty(r,"__esModule",{value:!0}),r.IIIFResource=void 0;var v=c(4799),u=c(3957),h=function(s){function t(e,o){var n=s.call(this,e,o)||this;n.index=-1,n.isLoaded=!1;var p={defaultLabel:"-",locale:"en-GB",resource:n,pessimisticAccessControl:!1};return n.options=Object.assign(p,o),n}return _(t,s),t.prototype.getAttribution=function(){var e=this.getProperty("attribution");return e?v.PropertyValue.parse(e,this.options.locale):new v.PropertyValue([],this.options.locale)},t.prototype.getDescription=function(){var e=this.getProperty("description");return e===void 0&&(e=this.getProperty("summary")),e?v.PropertyValue.parse(e,this.options.locale):new v.PropertyValue([],this.options.locale)},t.prototype.getSummary=function(){var e=this.getProperty("summary");return e===void 0&&(e=this.getProperty("description")),e?v.PropertyValue.parse(e,this.options.locale):new v.PropertyValue([],this.options.locale)},t.prototype.getHomepage=function(){var e=this.getProperty("homepage");return e?typeof e=="string"?e:(Array.isArray(e)&&e.length&&(e=e[0]),e["@id"]||e.id):null},t.prototype.getIIIFResourceType=function(){return v.Utils.normaliseType(this.getProperty("type"))},t.prototype.getLogo=function(){var e=this.getProperty("logo");if(!e){var o=this.getProperty("provider");if(!o)return null;var n=o.find(function(p){return p.logo!==void 0});e=n&&n.logo!==void 0?n.logo:null}return e?typeof e=="string"?e:(Array.isArray(e)&&e.length&&(e=e[0]),e["@id"]||e?.id):null},t.prototype.getLicense=function(){return v.Utils.getLocalisedValue(this.getProperty("license"),this.options.locale)},t.prototype.getRights=function(){var e=this.getProperty("rights");return e?typeof e=="string"?e:(Array.isArray(e)&&e.length&&(e=e[0]),e["@id"]||e.id):null},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(u.ServiceProfile.TRACKING_EXTENSIONS);return e?e.getProperty("trackingLabel"):""},t.prototype.getDefaultTree=function(){return this.defaultTree=new v.TreeNode("root"),this.defaultTree.data=this,this.defaultTree},t.prototype.getRequiredStatement=function(){var e=null,o=this.getProperty("requiredStatement");if(o)(e=new v.LabelValuePair(this.options.locale)).parse(o);else{var n=this.getAttribution();n&&n.length&&((e=new v.LabelValuePair(this.options.locale)).value=n)}return e},t.prototype.isCollection=function(){return this.getIIIFResourceType()===u.IIIFResourceType.COLLECTION},t.prototype.isManifest=function(){return this.getIIIFResourceType()===u.IIIFResourceType.MANIFEST},t.prototype.load=function(){var e=this;return new Promise(function(o){if(e.isLoaded)o(e);else{var n=e.options;n.navDate=e.getNavDate();var p=e.__jsonld.id;p||(p=e.__jsonld["@id"]),v.Utils.loadManifest(p).then(function(d){e.parentLabel=e.getLabel().getValue(n.locale);var E=v.Deserialiser.parse(d,n);(e=Object.assign(e,E)).index=n.index,o(e)})}})},t}(v.ManifestResource);r.IIIFResource=h},212:function(l,r){"use strict";var c,g=this&&this.__extends||(c=function(v,u){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,s){h.__proto__=s}||function(h,s){for(var t in s)Object.prototype.hasOwnProperty.call(s,t)&&(h[t]=s[t])},c(v,u)},function(v,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");function h(){this.constructor=v}c(v,u),v.prototype=u===null?Object.create(u):(h.prototype=u.prototype,new h)});Object.defineProperty(r,"__esModule",{value:!0}),r.LanguageMap=void 0;var _=function(v){function u(){return v!==null&&v.apply(this,arguments)||this}return g(u,v),u.getValue=function(h,s){return h.getValue(s,"<br/>")},u.getValues=function(h,s){return h.getValues(s)},u}(Array);r.LanguageMap=_},258:function(l,r,c){"use strict";var g,_=this&&this.__extends||(g=function(h,s){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])},g(h,s)},function(h,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function t(){this.constructor=h}g(h,s),h.prototype=s===null?Object.create(s):(t.prototype=s.prototype,new t)});Object.defineProperty(r,"__esModule",{value:!0}),r.Resource=void 0;var v=c(4799),u=function(h){function s(t,e){return h.call(this,t,e)||this}return _(s,h),s.prototype.getFormat=function(){var t=this.getProperty("format");return t?t.toLowerCase():null},s.prototype.getResources=function(){var t=[];if(!this.__jsonld.resources)return t;for(var e=0;e<this.__jsonld.resources.length;e++){var o=this.__jsonld.resources[e],n=new v.Annotation(o,this.options);t.push(n)}return t},s.prototype.getType=function(){var t=this.getProperty("type");return t?v.Utils.normaliseType(t):null},s.prototype.getWidth=function(){return this.getProperty("width")},s.prototype.getHeight=function(){return this.getProperty("height")},s.prototype.getMaxWidth=function(){return this.getProperty("maxWidth")},s.prototype.getMaxHeight=function(){return this.getProperty("maxHeight")?null:this.getMaxWidth()},s}(v.ManifestResource);r.Resource=u},346:l=>{l.exports=function(r){return r!=null&&typeof r=="object"}},659:(l,r,c)=>{var g=c(1873),_=Object.prototype,v=_.hasOwnProperty,u=_.toString,h=g?g.toStringTag:void 0;l.exports=function(s){var t=v.call(s,h),e=s[h];try{s[h]=void 0;var o=!0}catch{}var n=u.call(s);return o&&(t?s[h]=e:delete s[h]),n}},672:(l,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0})},916:(l,r,c)=>{l.exports=self.fetch||(self.fetch=c(6782).default||c(6782))},1858:(l,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Duration=void 0;var c=function(){function g(_,v){this.start=_,this.end=v}return g.prototype.getLength=function(){return this.end-this.start},g}();r.Duration=c},1873:(l,r,c)=>{var g=c(9325).Symbol;l.exports=g},2006:function(l,r,c){"use strict";var g,_=this&&this.__extends||(g=function(s,t){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,o){e.__proto__=o}||function(e,o){for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])},g(s,t)},function(s,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=s}g(s,t),s.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)});Object.defineProperty(r,"__esModule",{value:!0}),r.PropertyValue=r.LocalizedValue=void 0;var v=c(41),u=function(){function s(t,e,o){o===void 0&&(o="none"),Array.isArray(t)&&t.length===1?this._value=t[0]:this._value=t,e!=="none"&&e!=="@none"||(e=void 0),this._locale=e,this._defaultLocale=o}return s.parseV2Value=function(t,e){return typeof t=="string"?new s(t,void 0,e):t["@value"]?new s(t["@value"],t["@language"],e):null},Object.defineProperty(s.prototype,"value",{get:function(){return Array.isArray(this._value)?this._value.join("<br/>"):this._value},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"locale",{get:function(){return this._locale===void 0?this._defaultLocale:this._locale},enumerable:!1,configurable:!0}),s.prototype.addValue=function(t){Array.isArray(this._value)||(this._value=[this._value]),Array.isArray(t)?this._value=this._value.concat(t):this._value.push(t)},s}();r.LocalizedValue=u;var h=function(s){function t(e,o){e===void 0&&(e=[]);var n=s.apply(this,e)||this;return n.__proto__=t.prototype,n._defaultLocale=o,n}return _(t,s),t.parse=function(e,o){if(!e)return new t([],o);if(Array.isArray(e)){var n=(p=e.map(function(d){return u.parseV2Value(d,o)}).filter(function(d){return d!==null})).reduce(function(d,E){var y=E._locale;return y||(y="none"),d[y]?d[y].addValue(E._value):d[y]=E,d},{});return new t(Object.values(n),o)}return typeof e=="string"?new t([new u(e,void 0,o)],o):e["@language"]||e["@value"]?new t((p=u.parseV2Value(e))!==null?[p]:[],o):new t(Object.keys(e).map(function(d){var E=e[d];if(!Array.isArray(E))throw new Error("A IIIF v3 localized property value must have an array as the value for a given language.");return new u(E,d,o)}),o);var p},t.prototype.getSuitableLocale=function(e){for(var o=Array.from(this.values()).map(function(T){return T._locale}).filter(function(T){return T!==void 0}),n=function(T){var A=o.find(function(L){return L===T});if(A)return{value:A}},p=0,d=e;p<d.length;p++){var E=n(d[p]);if(typeof E=="object")return E.value}for(var y=function(T){var A=o.find(function(L){return v.Utils.getInexactLocale(L)===v.Utils.getInexactLocale(T)});if(A)return{value:A}},O=0,m=e;O<m.length;O++){var I=y(m[O]);if(typeof I=="object")return I.value}},t.prototype.setValue=function(e,o){var n=void 0;if(o){var p=this.getSuitableLocale([o]);p&&(n=this.find(function(d){return d._locale===p}))}else n=this.find(function(d){return d._locale===void 0});n?n._value=e:this.push(new u(e,o,this._defaultLocale))},t.prototype.getValue=function(e,o){var n=this.getValues(e);return n.length===0?null:o?n.join(o):n[0]},t.prototype.getValues=function(e){if(!this.length)return[];var o;if(o=e?Array.isArray(e)?e:[e]:[],this.length===1&&this[0]._locale===void 0){var n=this[0]._value;return Array.isArray(n)?n:[n]}var p=this.getSuitableLocale(o);if(p)return n=this.find(function(y){return y._locale===p})._value,Array.isArray(n)?n:[n];var d=!this.find(function(y){return y._locale===void 0});if(d)return n=this[0]._value,Array.isArray(n)?n:[n];var E=this.find(function(y){return y._locale===void 0});return E?Array.isArray(E._value)?E._value:[E._value]:[]},t}(Array);r.PropertyValue=h},2184:(l,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0})},2315:function(l,r,c){"use strict";var g,_=this&&this.__extends||(g=function(s,t){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,o){e.__proto__=o}||function(e,o){for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])},g(s,t)},function(s,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=s}g(s,t),s.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)});Object.defineProperty(r,"__esModule",{value:!0}),r.ManifestResource=void 0;var v=c(4799),u=c(3957),h=function(s){function t(e,o){var n=s.call(this,e)||this;return n.options=o,n}return _(t,s),t.prototype.getIIIFResourceType=function(){return v.Utils.normaliseType(this.getProperty("type"))},t.prototype.getLabel=function(){var e=this.getProperty("label");return e?v.PropertyValue.parse(e,this.options.locale):new v.PropertyValue([],this.options.locale)},t.prototype.getDefaultLabel=function(){return this.getLabel().getValue(this.options.locale)},t.prototype.getMetadata=function(){var e=this.getProperty("metadata"),o=[];if(!e)return o;for(var n=0;n<e.length;n++){var p=e[n],d=new v.LabelValuePair(this.options.locale);d.parse(p),o.push(d)}return o},t.prototype.getRendering=function(e){for(var o=this.getRenderings(),n=0;n<o.length;n++){var p=o[n];if(p.getFormat()===e)return p}return null},t.prototype.getRenderings=function(){var e,o=[];if(!(e=this.__jsonld?this.__jsonld.rendering:this.rendering))return o;Array.isArray(e)||(e=[e]);for(var n=0;n<e.length;n++){var p=e[n];o.push(new v.Rendering(p,this.options))}return o},t.prototype.getRequiredStatement=function(){var e=null,o=this.getProperty("requiredStatement");return o&&(e=new v.LabelValuePair(this.options.locale)).parse(o),e},t.prototype.getService=function(e){return v.Utils.getService(this,e)},t.prototype.getServices=function(){return v.Utils.getServices(this)},t.prototype.getThumbnail=function(){var e=this.getProperty("thumbnail");return Array.isArray(e)&&(e=e[0]),e?new v.Thumbnail(e,this.options):null},t.prototype.isAnnotation=function(){return this.getIIIFResourceType()===u.IIIFResourceType.ANNOTATION},t.prototype.isCanvas=function(){return this.getIIIFResourceType()===u.IIIFResourceType.CANVAS},t.prototype.isCollection=function(){return this.getIIIFResourceType()===u.IIIFResourceType.COLLECTION},t.prototype.isManifest=function(){return this.getIIIFResourceType()===u.IIIFResourceType.MANIFEST},t.prototype.isRange=function(){return this.getIIIFResourceType()===u.IIIFResourceType.RANGE},t.prototype.isSequence=function(){return this.getIIIFResourceType()===u.IIIFResourceType.SEQUENCE},t}(v.JSONLDResource);r.ManifestResource=h},2339:function(l,r,c){"use strict";var g,_=this&&this.__extends||(g=function(h,s){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])},g(h,s)},function(h,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function t(){this.constructor=h}g(h,s),h.prototype=s===null?Object.create(s):(t.prototype=s.prototype,new t)});Object.defineProperty(r,"__esModule",{value:!0}),r.AnnotationBody=void 0;var v=c(4799),u=function(h){function s(t,e){return h.call(this,t,e)||this}return _(s,h),s.prototype.getFormat=function(){var t=this.getProperty("format");return t?v.Utils.getMediaType(t):null},s.prototype.getType=function(){return this.getProperty("type")?v.Utils.normaliseType(this.getProperty("type")):null},s.prototype.getValue=function(){return this.getProperty("value")},s.prototype.getLanguage=function(){return this.getProperty("language")},s.prototype.getWidth=function(){return this.getProperty("width")},s.prototype.getHeight=function(){return this.getProperty("height")},s}(v.ManifestResource);r.AnnotationBody=u},2428:(l,r,c)=>{var g=c(7534),_=c(346),v=Object.prototype,u=v.hasOwnProperty,h=v.propertyIsEnumerable,s=g(function(){return arguments}())?g:function(t){return _(t)&&u.call(t,"callee")&&!h.call(t,"callee")};l.exports=s},2552:(l,r,c)=>{var g=c(1873),_=c(659),v=c(9350),u=g?g.toStringTag:void 0;l.exports=function(h){return h==null?h===void 0?"[object Undefined]":"[object Null]":u&&u in Object(h)?_(h):v(h)}},2639:(l,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Size=void 0,r.Size=function(c,g){this.width=c,this.height=g}},2712:(l,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0})},2817:(l,r,c)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.LabelValuePair=void 0;var g=c(4799),_=function(){function v(u){this.defaultLocale=u}return v.prototype.parse=function(u){this.resource=u,this.label=g.PropertyValue.parse(this.resource.label,this.defaultLocale),this.value=g.PropertyValue.parse(this.resource.value,this.defaultLocale)},v.prototype.getLabel=function(u){return this.label===null?null:(Array.isArray(u)&&!u.length&&(u=void 0),this.label.getValue(u||this.defaultLocale))},v.prototype.setLabel=function(u){this.label===null&&(this.label=new g.PropertyValue([])),this.label.setValue(u,this.defaultLocale)},v.prototype.getValue=function(u,h){return h===void 0&&(h="<br/>"),this.value===null?null:(Array.isArray(u)&&!u.length&&(u=void 0),this.value.getValue(u||this.defaultLocale,h))},v.prototype.getValues=function(u){return this.value===null?[]:(Array.isArray(u)&&!u.length&&(u=void 0),this.value.getValues(u||this.defaultLocale))},v.prototype.setValue=function(u){this.value===null&&(this.value=new g.PropertyValue([])),this.value.setValue(u,this.defaultLocale)},v}();r.LabelValuePair=_},3039:function(l,r,c){"use strict";var g,_=this&&this.__extends||(g=function(h,s){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])},g(h,s)},function(h,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function t(){this.constructor=h}g(h,s),h.prototype=s===null?Object.create(s):(t.prototype=s.prototype,new t)});Object.defineProperty(r,"__esModule",{value:!0}),r.Annotation=void 0;var v=c(4799),u=function(h){function s(t,e){return h.call(this,t,e)||this}return _(s,h),s.prototype.getBody=function(){var t=[],e=this.getProperty("body");if(e)if(Array.isArray(e))for(var o=0;o<e.length;o++)if((d=e[o]).items)for(var n=0;n<d.items.length;n++){var p=d.items[n];t.push(new v.AnnotationBody(p,this.options))}else t.push(new v.AnnotationBody(d,this.options));else if(e.items)for(o=0;o<e.items.length;o++){var d=e.items[o];t.push(new v.AnnotationBody(d,this.options))}else t.push(new v.AnnotationBody(e,this.options));return t},s.prototype.getMotivation=function(){return this.getProperty("motivation")||null},s.prototype.getOn=function(){return this.getProperty("on")},s.prototype.getTarget=function(){return this.getProperty("target")},s.prototype.getResource=function(){return new v.Resource(this.getProperty("resource"),this.options)},s}(v.ManifestResource);r.Annotation=u},3043:(l,r)=>{"use strict";var c;Object.defineProperty(r,"__esModule",{value:!0}),r.ManifestType=void 0,function(g){g.EMPTY="",g.MANUSCRIPT="manuscript",g.MONOGRAPH="monograph"}(c||(r.ManifestType=c={}))},3120:(l,r,c)=>{var g=c(4528),_=c(5891);l.exports=function v(u,h,s,t,e){var o=-1,n=u.length;for(s||(s=_),e||(e=[]);++o<n;){var p=u[o];h>0&&s(p)?h>1?v(p,h-1,s,t,e):g(e,p):t||(e[e.length]=p)}return e}},3167:(l,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0})},3176:(l,r,c)=>{var g=c(3120),_=1/0;l.exports=function(v){return v!=null&&v.length?g(v,_):[]}},3435:function(l,r,c){"use strict";var g,_=this&&this.__extends||(g=function(h,s){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])},g(h,s)},function(h,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function t(){this.constructor=h}g(h,s),h.prototype=s===null?Object.create(s):(t.prototype=s.prototype,new t)});Object.defineProperty(r,"__esModule",{value:!0}),r.AnnotationList=void 0;var v=c(4799),u=function(h){function s(t,e,o){var n=h.call(this,e)||this;return n.label=t,n.options=o,n}return _(s,h),s.prototype.getIIIFResourceType=function(){return v.Utils.normaliseType(this.getProperty("type"))},s.prototype.getLabel=function(){return this.label},s.prototype.getResources=function(){var t=this;return this.getProperty("resources").map(function(e){return new v.Annotation(e,t.options)})},s.prototype.load=function(){var t=this;return new Promise(function(e,o){if(t.isLoaded)e(t);else{var n=t.__jsonld.id;n||(n=t.__jsonld["@id"]),v.Utils.loadManifest(n).then(function(p){t.__jsonld=p,t.context=t.getProperty("context"),t.id=t.getProperty("id"),t.isLoaded=!0,e(t)}).catch(o)}})},s}(v.JSONLDResource);r.AnnotationList=u},3556:function(l,r,c){"use strict";var g,_=this&&this.__extends||(g=function(h,s){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])},g(h,s)},function(h,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function t(){this.constructor=h}g(h,s),h.prototype=s===null?Object.create(s):(t.prototype=s.prototype,new t)});Object.defineProperty(r,"__esModule",{value:!0}),r.AnnotationPage=void 0;var v=c(4799),u=function(h){function s(t,e){return h.call(this,t,e)||this}return _(s,h),s.prototype.getItems=function(){return this.getProperty("items")},s.prototype.getAnnotations=function(){var t=[],e=this.getProperty("items");if(!e||!Array.isArray(e))return t;for(var o=0;o<e.length;o++){var n=new v.Annotation(e[o],this.options);t.push(n)}return t},s}(v.ManifestResource);r.AnnotationPage=u},3845:function(l,r,c){"use strict";var g,_=this&&this.__extends||(g=function(s,t){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,o){e.__proto__=o}||function(e,o){for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])},g(s,t)},function(s,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=s}g(s,t),s.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)});Object.defineProperty(r,"__esModule",{value:!0}),r.Range=void 0;var v=c(4799),u=c(3957),h=function(s){function t(e,o){var n=s.call(this,e,o)||this;return n._ranges=null,n.canvases=null,n.items=[],n}return _(t,s),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=[],o=[],n=0,p=this.canvases;n<p.length;n++)if(N=p[n]){var d=N.match(/(.*)#t=([0-9.]+),?([0-9.]+)?/)||[void 0,N],E=d[1],y=d[2],O=d[3];E&&(e.push(parseFloat(y)),o.push(parseFloat(O)))}if(e.length&&o.length)return new v.Duration(Math.min.apply(Math,e),Math.max.apply(Math,o))}else{e=[],o=[];for(var m=0,I=D=this.getRanges();m<I.length;m++)(G=I[m].getDuration())&&(e.push(G.start),o.push(G.end));if(e.length&&o.length)return new v.Duration(Math.min.apply(Math,e),Math.max.apply(Math,o))}var T,A;if(this.canvases&&this.canvases.length)for(var L=0;L<this.canvases.length;L++){var N=this.canvases[L],b=v.Utils.getTemporalComponent(N);b&&b.length>1&&(L===0&&(T=Number(b[0])),L===this.canvases.length-1&&(A=Number(b[1])))}else{var D=this.getRanges();for(L=0;L<D.length;L++){var G;(G=D[L].getDuration())&&(L===0&&(T=G.start),L===D.length-1&&(A=G.end))}}if(T!==void 0&&A!==void 0)return new v.Duration(T,A)},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(){var e=this.getProperty("viewingHint");return Array.isArray(e)&&(e=e[0]),e||null},t.prototype.getTree=function(e){e.data=this,this.treeNode=e;var o=this.getRanges();if(o&&o.length)for(var n=0;n<o.length;n++){var p=o[n],d=new v.TreeNode;e.addNode(d),this._parseTreeNode(d,p)}return v.Utils.generateTreeNodeIds(e),e},t.prototype.spansTime=function(e){var o=this.getDuration();return!!(o&&e>=o.start&&e<=o.end)},t.prototype._parseTreeNode=function(e,o){e.label=o.getLabel().getValue(this.options.locale),e.data=o,e.data.type=v.Utils.normaliseType(v.TreeNodeType.RANGE),o.treeNode=e;var n=o.getRanges();if(n&&n.length)for(var p=0;p<n.length;p++){var d=n[p];if(d.getBehavior()!==u.Behavior.NO_NAV){var E=new v.TreeNode;e.addNode(E),this._parseTreeNode(E,d)}}},t}(v.ManifestResource);r.Range=h},3957:(l,r)=>{"use strict";var c,g,_,v,u,h,s,t,e,o;Object.defineProperty(r,"__esModule",{value:!0}),r.ViewingHint=r.ViewingDirection=r.ServiceType=r.ServiceProfile=r.RenderingFormat=r.MediaType=r.IIIFResourceType=r.ExternalResourceType=r.Behavior=r.AnnotationMotivation=void 0,function(n){n.BOOKMARKING="oa:bookmarking",n.CLASSIFYING="oa:classifying",n.COMMENTING="oa:commenting",n.DESCRIBING="oa:describing",n.EDITING="oa:editing",n.HIGHLIGHTING="oa:highlighting",n.IDENTIFYING="oa:identifying",n.LINKING="oa:linking",n.MODERATING="oa:moderating",n.PAINTING="sc:painting",n.QUESTIONING="oa:questioning",n.REPLYING="oa:replying",n.TAGGING="oa:tagging",n.TRANSCRIBING="oad:transcribing"}(c||(r.AnnotationMotivation=c={})),function(n){n.AUTO_ADVANCE="auto-advance",n.CONTINUOUS="continuous",n.FACING_PAGES="facing-pages",n.HIDDEN="hidden",n.INDIVIDUALS="individuals",n.MULTI_PART="multi-part",n.NO_NAV="no-nav",n.NON_PAGED="non-paged",n.PAGED="paged",n.REPEAT="repeat",n.SEQUENCE="sequence",n.THUMBNAIL_NAV="thumbnail-nav",n.TOGETHER="together",n.UNORDERED="unordered"}(g||(r.Behavior=g={})),function(n){n.CANVAS="canvas",n.CHOICE="choice",n.OA_CHOICE="oa:choice",n.CONTENT_AS_TEXT="contentastext",n.DATASET="dataset",n.DOCUMENT="document",n.IMAGE="image",n.MODEL="model",n.MOVING_IMAGE="movingimage",n.PDF="pdf",n.PHYSICAL_OBJECT="physicalobject",n.SOUND="sound",n.TEXT="text",n.TEXTUALBODY="textualbody",n.VIDEO="video"}(_||(r.ExternalResourceType=_={})),function(n){n.ANNOTATION="annotation",n.CANVAS="canvas",n.COLLECTION="collection",n.MANIFEST="manifest",n.RANGE="range",n.SEQUENCE="sequence"}(v||(r.IIIFResourceType=v={})),function(n){n.AUDIO_MP4="audio/mp4",n.CORTO="application/corto",n.DICOM="application/dicom",n.DRACO="application/draco",n.EPUB="application/epub+zip",n.GIRDER="image/vnd.kitware.girder",n.GLB="model/gltf-binary",n.GLTF="model/gltf+json",n.IIIF_PRESENTATION_2='application/ld+json;profile="http://iiif.io/api/presentation/2/context.json"',n.IIIF_PRESENTATION_3='application/ld+json;profile="http://iiif.io/api/presentation/3/context.json"',n.JPG="image/jpeg",n.M3U8="application/vnd.apple.mpegurl",n.MP3="audio/mp3",n.MPEG="audio/mpeg",n.MPEG_DASH="application/dash+xml",n.OBJ="model/obj",n.OPF="application/oebps-package+xml",n.PDF="application/pdf",n.PLY="application/ply",n.THREEJS="application/vnd.threejs+json",n.USDZ="model/vnd.usd+zip",n.VIDEO_MP4="video/mp4",n.WAV="audio/wav",n.WEBM="video/webm"}(u||(r.MediaType=u={})),function(n){n.DOC="application/msword",n.DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",n.ODT="application/vnd.oasis.opendocument.text",n.PDF="application/pdf"}(h||(r.RenderingFormat=h={})),function(n){n.IMAGE_0_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/compliance.html#level0",n.IMAGE_0_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/compliance.html#level1",n.IMAGE_0_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/compliance.html#level2",n.IMAGE_0_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/conformance.html#level0",n.IMAGE_0_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/conformance.html#level1",n.IMAGE_0_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/conformance.html#level2",n.IMAGE_1_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",n.IMAGE_1_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",n.IMAGE_1_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",n.IMAGE_1_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",n.IMAGE_1_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",n.IMAGE_1_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",n.IMAGE_1_LEVEL_0="http://iiif.io/api/image/1/level0.json",n.IMAGE_1_PROFILE_LEVEL_0="http://iiif.io/api/image/1/profiles/level0.json",n.IMAGE_1_LEVEL_1="http://iiif.io/api/image/1/level1.json",n.IMAGE_1_PROFILE_LEVEL_1="http://iiif.io/api/image/1/profiles/level1.json",n.IMAGE_1_LEVEL_2="http://iiif.io/api/image/1/level2.json",n.IMAGE_1_PROFILE_LEVEL_2="http://iiif.io/api/image/1/profiles/level2.json",n.IMAGE_2_LEVEL_0="http://iiif.io/api/image/2/level0.json",n.IMAGE_2_PROFILE_LEVEL_0="http://iiif.io/api/image/2/profiles/level0.json",n.IMAGE_2_LEVEL_1="http://iiif.io/api/image/2/level1.json",n.IMAGE_2_PROFILE_LEVEL_1="http://iiif.io/api/image/2/profiles/level1.json",n.IMAGE_2_LEVEL_2="http://iiif.io/api/image/2/level2.json",n.IMAGE_2_PROFILE_LEVEL_2="http://iiif.io/api/image/2/profiles/level2.json",n.AUTH_0_CLICK_THROUGH="http://iiif.io/api/auth/0/login/clickthrough",n.AUTH_0_LOGIN="http://iiif.io/api/auth/0/login",n.AUTH_0_LOGOUT="http://iiif.io/api/auth/0/logout",n.AUTH_0_RESTRICTED="http://iiif.io/api/auth/0/login/restricted",n.AUTH_0_TOKEN="http://iiif.io/api/auth/0/token",n.AUTH_1_CLICK_THROUGH="http://iiif.io/api/auth/1/clickthrough",n.AUTH_1_EXTERNAL="http://iiif.io/api/auth/1/external",n.AUTH_1_KIOSK="http://iiif.io/api/auth/1/kiosk",n.AUTH_1_LOGIN="http://iiif.io/api/auth/1/login",n.AUTH_1_LOGOUT="http://iiif.io/api/auth/1/logout",n.AUTH_1_PROBE="http://iiif.io/api/auth/1/probe",n.AUTH_1_TOKEN="http://iiif.io/api/auth/1/token",n.SEARCH_0="http://iiif.io/api/search/0/search",n.SEARCH_0_AUTO_COMPLETE="http://iiif.io/api/search/0/autocomplete",n.SEARCH_1="http://iiif.io/api/search/1/search",n.SEARCH_1_AUTO_COMPLETE="http://iiif.io/api/search/1/autocomplete",n.TRACKING_EXTENSIONS="http://universalviewer.io/tracking-extensions-profile",n.UI_EXTENSIONS="http://universalviewer.io/ui-extensions-profile",n.PRINT_EXTENSIONS="http://universalviewer.io/print-extensions-profile",n.SHARE_EXTENSIONS="http://universalviewer.io/share-extensions-profile",n.DOWNLOAD_EXTENSIONS="http://universalviewer.io/download-extensions-profile",n.OT