@acdh-oeaw/universalviewer
Version:
The Universal Viewer is a community-developed open source project on a mission to help you share your 📚📜📰📽️📻🗿 with the 🌎
3 lines • 176 kB
JavaScript
import{a as ae,c as Ht,e as kt,f as Ft,g as Ut}from"./chunk-FEXGFX4C.js";import{a as y}from"./chunk-Z6KGRKDP.js";import{a as B,b as wt,c as R,e as Y,h as Mt,k as Ot,l as Pt,m as D,n as pt,o as Nt,p as V}from"./chunk-LLTGMZMR.js";import{b as G,e as U,f as Bt,g as P}from"./chunk-5XPHF4E5.js";import{c as re,d as et}from"./chunk-L67DAW3A.js";var Kt=re((ht,At)=>{(function(a,o){typeof ht=="object"&&typeof At=="object"?At.exports=o():typeof define=="function"&&define.amd?define("IIIFMetadataComponent",[],o):typeof ht=="object"?ht.IIIFMetadataComponent=o():a.IIIFMetadataComponent=o()})(typeof self<"u"?self:ht,function(){return function(a){var o={};function l(u){if(o[u])return o[u].exports;var n=o[u]={i:u,l:!1,exports:{}};return a[u].call(n.exports,n,n.exports,l),n.l=!0,n.exports}return l.m=a,l.c=o,l.d=function(u,n,d){l.o(u,n)||Object.defineProperty(u,n,{enumerable:!0,get:d})},l.r=function(u){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(u,"__esModule",{value:!0})},l.t=function(u,n){if(1&n&&(u=l(u)),8&n||4&n&&typeof u=="object"&&u&&u.__esModule)return u;var d=Object.create(null);if(l.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:u}),2&n&&typeof u!="string")for(var s in u)l.d(d,s,function(v){return u[v]}.bind(null,s));return d},l.n=function(u){var n=u&&u.__esModule?function(){return u.default}:function(){return u};return l.d(n,"a",n),n},l.o=function(u,n){return Object.prototype.hasOwnProperty.call(u,n)},l.p="",l(l.s=1)}([function(a,o,l){"use strict";l.r(o),l.d(o,"Async",function(){return n}),l.d(o,"Bools",function(){return d}),l.d(o,"Clipboard",function(){return s}),l.d(o,"Colors",function(){return v}),l.d(o,"Dates",function(){return b}),l.d(o,"Device",function(){return c}),l.d(o,"Documents",function(){return f}),l.d(o,"Events",function(){return p}),l.d(o,"Files",function(){return e}),l.d(o,"Keyboard",function(){return t}),l.d(o,"Maths",function(){return i}),l.d(o,"Size",function(){return r}),l.d(o,"Dimensions",function(){return h}),l.d(o,"Numbers",function(){return m}),l.d(o,"Objects",function(){return I}),l.d(o,"Storage",function(){return x}),l.d(o,"StorageItem",function(){return S}),l.d(o,"StorageType",function(){return u}),l.d(o,"Strings",function(){return O}),l.d(o,"Urls",function(){return C});var u,n=function(){function _(){}return _.waitFor=function(g,E,T,A,L,w){A||(A=200),L||(L=100),w||(w=0),(w+=1)>L?T&&T():g()?E():setTimeout(function(){_.waitFor(g,E,T,A,L,w)},A)},_}(),d=function(){function _(){}return _.getBool=function(g,E){return g??E},_}(),s=function(){function _(){}return _.supportsCopy=function(){return document.queryCommandSupported&&document.queryCommandSupported("copy")},_.copy=function(g){g=_.convertBrToNewLine(g);var E=document.createElement("textarea");E.value=g,_.hideButKeepEnabled(E),document.body.appendChild(E),E.focus(),E.select(),document.execCommand("copy"),document.body.removeChild(E)},_.hideButKeepEnabled=function(g){g.style.position="fixed",g.style.top="0",g.style.left="0",g.style.width="2em",g.style.height="2em",g.style.padding="0",g.style.border="none",g.style.outline="none",g.style.boxShadow="none",g.style.background="transparent"},_.convertBrToNewLine=function(g){return g=g.replace(/<br\s*[\/]?>/gi,`
`)},_}(),v=function(){function _(){}return _.float32ColorToARGB=function(g){return[(4278190080&g)>>>24,(16711680&g)>>>16,(65280&g)>>>8,255&g]},_._componentToHex=function(g){var E=g.toString(16);return E.length==1?"0"+E:E},_.rgbToHexString=function(g){return _.coalesce(g),"#"+_._componentToHex(g[0])+_._componentToHex(g[1])+_._componentToHex(g[2])},_.argbToHexString=function(g){return"#"+_._componentToHex(g[0])+_._componentToHex(g[1])+_._componentToHex(g[2])+_._componentToHex(g[3])},_.coalesce=function(g){for(var E=1;E<g.length;E++)g[E]===void 0&&(g[E]=g[E-1])},_}(),b=function(){function _(){}return _.getTimeStamp=function(){return new Date().getTime()},_}(),c=function(){function _(){}return _.getPixelRatio=function(g){return(window.devicePixelRatio||1)/(g.webkitBackingStorePixelRatio||g.mozBackingStorePixelRatio||g.msBackingStorePixelRatio||g.oBackingStorePixelRatio||g.backingStorePixelRatio||1)},_.isTouch=function(){return"ontouchstart"in window||window.navigator.msMaxTouchPoints>0},_}(),f=function(){function _(){}return _.isInIFrame=function(){try{return window.self!==window.top}catch{return!0}},_.supportsFullscreen=function(){var g=document.documentElement;return(g.requestFullscreen||g.mozRequestFullScreen||g.webkitRequestFullScreen||g.msRequestFullscreen)!==void 0},_.isHidden=function(){return!!_.getHiddenProp()},_.getHiddenProp=function(){var g=["webkit","moz","ms","o"];if("hidden"in document)return"hidden";for(var E=0;E<g.length;E++)if(g[E]+"Hidden"in document)return g[E]+"Hidden";return null},_}(),p=function(){function _(){}return _.debounce=function(g,E){return E=E||100,function(){if(!g.debouncing){var T=Array.prototype.slice.apply(arguments);g.lastReturnVal=g.apply(window,T),g.debouncing=!0}return clearTimeout(g.debounceTimeout),g.debounceTimeout=setTimeout(function(){g.debouncing=!1},E),g.lastReturnVal}},_}(),e=function(){function _(){}return _.simplifyMimeType=function(g){switch(g){case"text/plain":return"txt";case"image/jpeg":return"jpg";case"application/msword":return"doc";case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return"docx";default:var E=g.split("/");return E[E.length-1]}},_}(),t=function(){function _(){}return _.getCharCode=function(g){return typeof g.which=="number"?g.which:g.keyCode},_}(),i=function(){function _(){}return _.normalise=function(g,E,T){return(g-E)/(T-E)},_.median=function(g){g.sort(function(T,A){return T-A});var E=Math.floor(g.length/2);return g.length%2?g[E]:(g[E-1]+g[E])/2},_.clamp=function(g,E,T){return Math.min(Math.max(g,E),T)},_}(),r=function(_,g){this.width=_,this.height=g},h=function(){function _(){}return _.fitRect=function(g,E,T,A){var L,w=0,q=0;return E/g<A/T?(w=g*(L=T/g),q=E*L):(w=g*(L=A/E),q=E*L),new r(Math.floor(w),Math.floor(q))},_.hitRect=function(g,E,T,A,L,w){return L>g&&L<g+T&&w>E&&w<E+A},_}(),m=function(){function _(){}return _.numericalInput=function(g){return g.keyCode==46||g.keyCode==8||g.keyCode==9||g.keyCode==27||g.keyCode==65&&g.ctrlKey===!0||g.keyCode>=35&&g.keyCode<=39||!(g.shiftKey||(g.keyCode<48||g.keyCode>57)&&(g.keyCode<96||g.keyCode>105))||(g.preventDefault(),!1)},_}(),I=function(){function _(){}return _.toPlainObject=function(g){g=Object(g);var E={};for(var T in g)E[T]=g[T];return E},_}(),x=function(){function _(){}return _.clear=function(g){switch(g===void 0&&(g=u.MEMORY),g){case u.MEMORY:this._memoryStorage={};break;case u.SESSION:sessionStorage.clear();break;case u.LOCAL:localStorage.clear()}},_.clearExpired=function(g){g===void 0&&(g=u.MEMORY);for(var E=this.getItems(g),T=0;T<E.length;T++){var A=E[T];this._isExpired(A)&&this.remove(A.key)}},_.get=function(g,E){E===void 0&&(E=u.MEMORY);var T=null;switch(E){case u.MEMORY:T=this._memoryStorage[g];break;case u.SESSION:T=sessionStorage.getItem(g);break;case u.LOCAL:T=localStorage.getItem(g)}if(!T)return null;var A=null;try{A=JSON.parse(T)}catch{return null}return A?this._isExpired(A)?null:(A.key=g,A):null},_._isExpired=function(g){return!(new Date().getTime()<g.expiresAt)},_.getItems=function(g){g===void 0&&(g=u.MEMORY);var E=[];switch(g){case u.MEMORY:for(var T=Object.keys(this._memoryStorage),A=0;A<T.length;A++)(w=this.get(T[A],u.MEMORY))&&E.push(w);break;case u.SESSION:for(A=0;A<sessionStorage.length;A++)(L=sessionStorage.key(A))&&(w=this.get(L,u.SESSION))&&E.push(w);break;case u.LOCAL:for(A=0;A<localStorage.length;A++){var L,w;(L=localStorage.key(A))&&(w=this.get(L,u.LOCAL))&&E.push(w)}}return E},_.remove=function(g,E){switch(E===void 0&&(E=u.MEMORY),E){case u.MEMORY:delete this._memoryStorage[g];break;case u.SESSION:sessionStorage.removeItem(g);break;case u.LOCAL:localStorage.removeItem(g)}},_.set=function(g,E,T,A){A===void 0&&(A=u.MEMORY);var L=1e3*T,w=new S;switch(w.value=E,w.expiresAt=new Date().getTime()+L,A){case u.MEMORY:this._memoryStorage[g]=JSON.stringify(w);break;case u.SESSION:sessionStorage.setItem(g,JSON.stringify(w));break;case u.LOCAL:localStorage.setItem(g,JSON.stringify(w))}return w},_._memoryStorage={},_}(),S=function(){};(function(_){_.MEMORY="memory",_.SESSION="session",_.LOCAL="local"})(u||(u={}));var O=function(){function _(){}return _.ellipsis=function(g,E){if(g.length<=E)return g;var T=g.substr(0,E),A=T.lastIndexOf(" ");return A!=-1&&(T=T.substr(0,Math.min(T.length,A))),T+"…"},_.htmlDecode=function(g){var E=document.createElement("div");return E.innerHTML=g,E.firstChild.nodeValue},_.format=function(g){for(var E=[],T=1;T<arguments.length;T++)E[T-1]=arguments[T];for(var A=0;A<E.length;A++){var L=new RegExp("\\{"+A+"\\}","gm");g=g.replace(L,E[A])}return g},_.isAlphanumeric=function(g){return/^[a-zA-Z0-9]*$/.test(g)},_.toCssClass=function(g){return g.replace(/[^a-z0-9]/g,function(E){var T=E.charCodeAt(0);return T==32?"-":T>=65&&T<=90?"_"+E.toLowerCase():"__"+("000"+T.toString(16)).slice(-4)})},_.toFileName=function(g){return g.replace(/[^a-z0-9]/gi,"_").toLowerCase()},_.utf8_to_b64=function(g){return window.btoa(unescape(encodeURIComponent(g)))},_}(),C=function(){function _(){}return _.getHashParameter=function(g,E){return E||(E=window.document),E&&E.location?this.getHashParameterFromString(g,E.location.hash):null},_.getHashParameterFromString=function(g,E){var T=new RegExp("#.*[?&]"+g+"=([^&]+)(&|$)").exec(E);return T?decodeURIComponent(T[1].replace(/\+/g," ")):null},_.setHashParameter=function(g,E,T){if(T||(T=window.document),T&&T.location){var A="#?"+this.updateURIKeyValuePair(T.location.hash.replace("#?",""),g,E),L=T.URL;L.indexOf("#")!=-1&&(L=L.substr(0,L.indexOf("#"))),T.location.replace(L+A)}},_.getQuerystringParameter=function(g,E){return E||(E=window),this.getQuerystringParameterFromString(g,E.location.search)},_.getQuerystringParameterFromString=function(g,E){g=g.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var T=new RegExp("[\\?&]"+g+"=([^&#]*)").exec(E);return T?decodeURIComponent(T[1].replace(/\+/g," ")):null},_.setQuerystringParameter=function(g,E,T){if(T||(T=window.document),T&&T.location){var A=this.updateURIKeyValuePair(T.location.hash.replace("#?",""),g,E);window.location.search=A}},_.updateURIKeyValuePair=function(g,E,T){E=encodeURIComponent(E),T=encodeURIComponent(T);var A=g.split("&");A[0]==""&&A.shift();for(var L,w=A.length;w--;)if((L=A[w].split("="))[0]==E){L[1]=T,A[w]=L.join("=");break}return w<0&&(A[A.length]=[E,T].join("=")),A.join("&")},_.getUrlParts=function(g){var E=document.createElement("a");return E.href=g,E},_.convertToRelativeUrl=function(g){var E=this.getUrlParts(g),T=E.pathname+E.searchWithin;return T.startsWith("/")||(T="/"+T),T},_}()},function(a,o,l){a.exports=l(2)},function(a,o,l){"use strict";var u,n=this&&this.__extends||(u=function(e,t){return(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var h in r)Object.prototype.hasOwnProperty.call(r,h)&&(i[h]=r[h])})(e,t)},function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}u(e,t),e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(o,"__esModule",{value:!0}),o.Events=o.MetadataComponent=o.LimitType=void 0;var d,s=l(3),v=l(4),b=l(0),c=l(5);(function(e){e.LINES="lines",e.CHARS="chars"})(d||(o.LimitType=d={}));var f=function(e){function t(i){var r=e.call(this,i)||this;return r._data=r.data(),r._data=r.options.data,r._init(),r._resize(),r}return n(t,e),t.prototype._init=function(){return e.prototype._init.call(this),this._$element=$(this.el),this._$metadataGroupTemplate=$('<div class="group"> <div class="header"></div> <div class="items"></div> </div>'),this._$metadataItemTemplate=$('<div class="item"> <div class="label"></div> <div class="values"></div> </div>'),this._$metadataItemValueTemplate=$('<div class="value"></div>'),this._$metadataItemURIValueTemplate=$('<a class="value" href="" target="_blank"></a>'),this._$copyTextTemplate=$('<div class="copyText" alt="'+this.options.data.content.copyToClipboard+'" title="'+this.options.data.content.copyToClipboard+'"> <div class="copiedText">'+this.options.data.content.copiedToClipboard+" </div> </div>"),this._$metadataGroups=$('<div class="groups"></div>'),this._$element.append(this._$metadataGroups),this._$noData=$('<div class="noData">'+this.options.data.content.noData+"</div>"),this._$element.append(this._$noData),!0},t.prototype.data=function(){return{aggregateValues:"",canvases:null,canvasDisplayOrder:"",metadataGroupOrder:"",canvasExclude:"",canvasLabels:"",content:{attribution:"Attribution",canvasHeader:"About the canvas",copiedToClipboard:"Copied to clipboard",copyToClipboard:"Copy to clipboard",description:"Description",imageHeader:"About the image",less:"less",lessAriaLabelTemplate:"Less information: Hide {0}",license:"License",rights:"Rights",logo:"Logo",manifestHeader:"About the item",more:"more",moreAriaLabelTemplate:"More information: Reveal {0}",noData:"No data to display",rangeHeader:"About the range",sequenceHeader:"About the sequence"},copiedMessageDuration:2e3,copyToClipboardEnabled:!1,helper:null,licenseFormatter:null,limit:4,limitType:d.LINES,limitToRange:!1,manifestDisplayOrder:"",manifestExclude:"",range:null,rtlLanguageCodes:"ar, ara, dv, div, he, heb, ur, urd",sanitizer:function(i){return i},showAllLanguages:!1}},t.prototype._getManifestGroup=function(){return this._metadataGroups.filter(function(i){return i.resource.isManifest()})[0]},t.prototype._getCanvasGroups=function(){return this._metadataGroups.filter(function(i){return i.resource.isCanvas()})},t.prototype.set=function(i){var r=this;if(this._data=Object.assign(this._data,i),this._data&&this._data.helper){var h,m={canvases:this._data.canvases,licenseFormatter:this._data.licenseFormatter,range:this._data.range};if(this._metadataGroups=this._data.helper.getMetadata(m),this._data.manifestDisplayOrder&&((h=this._getManifestGroup()).items=this._sortItems(h.items,this._readCSV(this._data.manifestDisplayOrder))),this._data.canvasDisplayOrder&&this._getCanvasGroups().forEach(function(x,S){x.items=r._sortItems(x.items,r._readCSV(r._data.canvasDisplayOrder))}),this._data.metadataGroupOrder&&(this._metadataGroups=this._sortGroups(this._metadataGroups,this._readCSV(this._data.metadataGroupOrder))),this._data.canvasLabels&&this._label(this._getCanvasGroups(),this._readCSV(this._data.canvasLabels,!1)),this._data.manifestExclude&&((h=this._getManifestGroup()).items=this._exclude(h.items,this._readCSV(this._data.manifestExclude))),this._data.canvasExclude&&this._getCanvasGroups().forEach(function(x,S){x.items=r._exclude(x.items,r._readCSV(r._data.canvasExclude))}),this._data.limitToRange){var I=[];this._metadataGroups.forEach(function(x,S){x.resource.isRange()&&I.push(x)}),I.length&&(this._metadataGroups=I)}this._render()}},t.prototype._sortItems=function(i,r){var h=this,m=[],I=i.slice(0);return r.forEach(function(x,S){var O=I.filter(function(_){return h._normalise(_.getLabel())===x})[0];if(O){m.push(O);var C=I.indexOf(O);C>-1&&I.splice(C,1)}}),I.forEach(function(x,S){m.push(x)}),m},t.prototype._sortGroups=function(i,r){var h=[],m=i.slice(0);return r.forEach(function(I,x){var S=m.filter(function(C){return C.resource.getIIIFResourceType().toLowerCase()==I.toLowerCase()})[0];if(S){h.push(S);var O=m.indexOf(S);O>-1&&m.splice(O,1)}}),h},t.prototype._label=function(i,r){i.forEach(function(h,m){h.label=r[m]})},t.prototype._exclude=function(i,r){var h=this;return r.forEach(function(m,I){var x=i.filter(function(O){return h._normalise(O.getLabel())===m})[0];if(x){var S=i.indexOf(x);S>-1&&i.splice(S,1)}}),i},t.prototype._normalise=function(i){return i?i.toLowerCase().replace(/ /g,""):null},t.prototype._render=function(){var i=this;this._metadataGroups.length?(this._$noData.hide(),this._$metadataGroups.empty(),this._metadataGroups.forEach(function(r,h){var m=i._buildMetadataGroup(r);i._$metadataGroups.append(m);var I=m.find(".value"),x=m.find(".item");i._data.limit&&i._data.content&&(i._data.limitType===d.LINES?(0,c.default)(x,i._data.limit,i._data.content.less,i._data.content.more,function(){},i._data.content.lessAriaLabelTemplate,i._data.content.moreAriaLabelTemplate):i._data.limitType===d.CHARS&&I.ellipsisHtmlFixed(i._data.limit,function(){}))})):this._$noData.show()},t.prototype._buildMetadataGroup=function(i){var r=this._$metadataGroupTemplate.clone(),h=r.find(">.header");if(this._data.content){if(i.resource.isManifest()&&this._data.content.manifestHeader)(I=this._sanitize(this._data.content.manifestHeader))&&h.html(I);else if(i.resource.isSequence()&&this._data.content.sequenceHeader)(I=this._sanitize(this._data.content.sequenceHeader))&&h.html(I);else if(i.resource.isRange()&&this._data.content.rangeHeader)(I=this._sanitize(this._data.content.rangeHeader))&&h.html(I);else if(i.resource.isCanvas()&&(i.label||this._data.content.canvasHeader)){var m=i.label||this._data.content.canvasHeader;h.html(this._sanitize(m))}else if(i.resource.isAnnotation()&&this._data.content.imageHeader){var I;(I=this._sanitize(this._data.content.imageHeader))&&h.html(I)}}h.text()||h.hide();for(var x=r.find(".items"),S=0;S<i.items.length;S++){var O=i.items[S],C=this._buildMetadataItem(O);x.append(C)}return r},t.prototype._buildMetadataItem=function(i){var r,h,m=this._$metadataItemTemplate.clone(),I=m.find(".label"),x=m.find(".values"),S=i.getLabel(),O=S,C=new RegExp("/w+:(/?/?)[^s]+/gm","i");if(this._data.content&&O&&i.isRootLevel)switch(O.toLowerCase()){case"attribution":O=this._data.content.attribution;break;case"description":O=this._data.content.description;break;case"license":O=this._data.content.license;break;case"logo":O=this._data.content.logo;break;case"rights":O=this._data.content.rights}O=this._sanitize(O),I.html(O),this._addReadingDirection(I,this._getLabelLocale(i)),m.addClass(b.Strings.toCssClass(O));var _=this._getValueLocale(i),g=(r=i.value)===null||r===void 0?void 0:r.getValue(_);if(!S||S.toLowerCase()!=="license"&&S.toLowerCase()!=="rights"||C.exec(g)===null)if(this._data.showAllLanguages&&i.value&&i.value.length>1)for(var E=[],T=0;T<i.value.length;T++){var A=i.value[T]._locale;if(A&&!E.includes(A)){var L=i.getValue(A,"<br/>");L&&(h=this._buildMetadataItemValue(L,A),E.push(A),x.append(h))}}else{for(var w=this._getValueLocale(i),q=!1,Tt=0,Lt=i.getValues(w);Tt<Lt.length;Tt++){var dt;(dt=Lt[Tt])&&(q=!0,h=this._buildMetadataItemValue(dt,w),x.append(h))}q||(dt=i.getValue())&&(h=this._buildMetadataItemValue(dt,w),x.append(h))}else h=this._buildMetadataItemURIValue(g),x.append(h);this._data.copyToClipboardEnabled&&b.Clipboard.supportsCopy()&&I.text()&&this._addCopyButton(m,I,x);var Rt=this;return m.find("a.iiif-viewer-link").length>0&&m.on("click","a.iiif-viewer-link",function(rt){rt.preventDefault();var at=$(rt.target),se=at.attr("data-uv-navigate")||at.prop("href");Rt.fire(p.IIIF_VIEWER_LINK_CLICKED,se)}),m.find("[data-uv-navigate]").length>0&&m.on("click","[data-uv-navigate]",function(rt){rt.preventDefault();var at=$(rt.target).attr("data-uv-navigate")||null;at&&Rt.fire(p.IIIF_VIEWER_LINK_CLICKED,at)}),m},t.prototype._getLabelLocale=function(i){var r;if(!this._data||!this._data.helper)return"";var h=this._data.helper.options.locale;if(!((r=i.label)===null||r===void 0)&&r.length){var m=i.label[0].locale;if(m.toLowerCase()!==h.toLowerCase())return m}return h},t.prototype._getValueLocale=function(i){return this._data&&this._data.helper?this._data.helper.options.locale:""},t.prototype._buildMetadataItemValue=function(i,r){i=(i=this._sanitize(i)).replace(`
`,"<br>");var h=this._$metadataItemValueTemplate.clone();return h.html(i),h.find("a").each(function(){var m=$(this);m.hasClass("iiif-viewer-link")||m.prop("target","_blank")}),r&&(h.prop("lang",r),this._addReadingDirection(h,r)),h},t.prototype._buildMetadataItemURIValue=function(i){i=this._sanitize(i);var r=this._$metadataItemURIValueTemplate.clone();return r.prop("href",i),r.text(i),r},t.prototype._addReadingDirection=function(i,r){r=s.Utils.getInexactLocale(r),this._readCSV(this._data.rtlLanguageCodes).filter(function(h){return h===r}).length>0&&(i.prop("dir","rtl"),i.addClass("rtl"))},t.prototype._addCopyButton=function(i,r,h){var m=this._$copyTextTemplate.clone(),I=m.children();r.append(m),b.Device.isTouch()?m.show():(i.on("mouseenter",function(){m.show()}),i.on("mouseleave",function(){m.hide()}),m.on("mouseleave",function(){I.hide()}));var x=this,S=h.text();m.on("click",function(O){x._copyItemValues(m,S)})},t.prototype._copyItemValues=function(i,r){b.Clipboard.copy(r);var h=i.find(".copiedText");h.show(),setTimeout(function(){h.hide()},this._data.copiedMessageDuration)},t.prototype._readCSV=function(i,r){r===void 0&&(r=!0);var h=[];if(i&&(h=i.split(","),r))for(var m=0;m<h.length;m++)h[m]=this._normalise(h[m]);return h},t.prototype._sanitize=function(i){return this._data.sanitizer?this._data.sanitizer(i):null},t.prototype._resize=function(){},t}(v.BaseComponent);o.MetadataComponent=f;var p=function(){function e(){}return e.IIIF_VIEWER_LINK_CLICKED="iiifViewerLinkClicked",e}();o.Events=p},function(a,o,l){typeof self<"u",a.exports=function(u){var n={};function d(s){if(n[s])return n[s].exports;var v=n[s]={i:s,l:!1,exports:{}};return u[s].call(v.exports,v,v.exports,d),v.l=!0,v.exports}return d.m=u,d.c=n,d.d=function(s,v,b){d.o(s,v)||Object.defineProperty(s,v,{enumerable:!0,get:b})},d.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},d.t=function(s,v){if(1&v&&(s=d(s)),8&v||4&v&&typeof s=="object"&&s&&s.__esModule)return s;var b=Object.create(null);if(d.r(b),Object.defineProperty(b,"default",{enumerable:!0,value:s}),2&v&&typeof s!="string")for(var c in s)d.d(b,c,function(f){return s[f]}.bind(null,c));return b},d.n=function(s){var v=s&&s.__esModule?function(){return s.default}:function(){return s};return d.d(v,"a",v),v},d.o=function(s,v){return Object.prototype.hasOwnProperty.call(s,v)},d.p="",d(d.s=7)}([function(u,n,d){"use strict";var s=this&&this.__createBinding||(Object.create?function(b,c,f,p){p===void 0&&(p=f);var e=Object.getOwnPropertyDescriptor(c,f);e&&!("get"in e?!c.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return c[f]}}),Object.defineProperty(b,p,e)}:function(b,c,f,p){p===void 0&&(p=f),b[p]=c[f]}),v=this&&this.__exportStar||function(b,c){for(var f in b)f==="default"||Object.prototype.hasOwnProperty.call(c,f)||s(c,b,f)};Object.defineProperty(n,"__esModule",{value:!0}),v(d(9),n),v(d(10),n),v(d(11),n),v(d(12),n),v(d(13),n),v(d(14),n),v(d(15),n),v(d(16),n),v(d(17),n),v(d(31),n),v(d(32),n),v(d(33),n),v(d(34),n),v(d(35),n),v(d(36),n),v(d(37),n),v(d(38),n),v(d(39),n),v(d(40),n),v(d(41),n),v(d(42),n),v(d(45),n),v(d(46),n),v(d(47),n),v(d(48),n),v(d(49),n),v(d(50),n),v(d(51),n),v(d(52),n),v(d(53),n),v(d(54),n),v(d(55),n),v(d(56),n),v(d(57),n),v(d(3),n)},function(u,n,d){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),function(s){s.BOOKMARKING="oa:bookmarking",s.CLASSIFYING="oa:classifying",s.COMMENTING="oa:commenting",s.DESCRIBING="oa:describing",s.EDITING="oa:editing",s.HIGHLIGHTING="oa:highlighting",s.IDENTIFYING="oa:identifying",s.LINKING="oa:linking",s.MODERATING="oa:moderating",s.PAINTING="sc:painting",s.QUESTIONING="oa:questioning",s.REPLYING="oa:replying",s.TAGGING="oa:tagging",s.TRANSCRIBING="oad:transcribing"}(n.AnnotationMotivation||(n.AnnotationMotivation={})),function(s){s.AUTO_ADVANCE="auto-advance",s.CONTINUOUS="continuous",s.FACING_PAGES="facing-pages",s.HIDDEN="hidden",s.INDIVIDUALS="individuals",s.MULTI_PART="multi-part",s.NO_NAV="no-nav",s.NON_PAGED="non-paged",s.PAGED="paged",s.REPEAT="repeat",s.SEQUENCE="sequence",s.THUMBNAIL_NAV="thumbnail-nav",s.TOGETHER="together",s.UNORDERED="unordered"}(n.Behavior||(n.Behavior={})),function(s){s.CANVAS="canvas",s.CHOICE="choice",s.OA_CHOICE="oa:choice",s.CONTENT_AS_TEXT="contentastext",s.DATASET="dataset",s.DOCUMENT="document",s.IMAGE="image",s.MODEL="model",s.MOVING_IMAGE="movingimage",s.PDF="pdf",s.PHYSICAL_OBJECT="physicalobject",s.SOUND="sound",s.TEXT="text",s.TEXTUALBODY="textualbody",s.VIDEO="video"}(n.ExternalResourceType||(n.ExternalResourceType={})),function(s){s.ANNOTATION="annotation",s.CANVAS="canvas",s.COLLECTION="collection",s.MANIFEST="manifest",s.RANGE="range",s.SEQUENCE="sequence"}(n.IIIFResourceType||(n.IIIFResourceType={})),function(s){s.AUDIO_MP4="audio/mp4",s.CORTO="application/corto",s.DICOM="application/dicom",s.DRACO="application/draco",s.EPUB="application/epub+zip",s.GIRDER="image/vnd.kitware.girder",s.GLB="model/gltf-binary",s.GLTF="model/gltf+json",s.IIIF_PRESENTATION_2='application/ld+json;profile="http://iiif.io/api/presentation/2/context.json"',s.IIIF_PRESENTATION_3='application/ld+json;profile="http://iiif.io/api/presentation/3/context.json"',s.JPG="image/jpeg",s.M3U8="application/vnd.apple.mpegurl",s.MP3="audio/mp3",s.MPEG_DASH="application/dash+xml",s.OBJ="text/plain",s.OPF="application/oebps-package+xml",s.PDF="application/pdf",s.PLY="application/ply",s.THREEJS="application/vnd.threejs+json",s.USDZ="model/vnd.usd+zip",s.VIDEO_MP4="video/mp4",s.WAV="audio/wav",s.WEBM="video/webm"}(n.MediaType||(n.MediaType={})),function(s){s.DOC="application/msword",s.DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",s.PDF="application/pdf"}(n.RenderingFormat||(n.RenderingFormat={})),function(s){s.IMAGE_0_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/compliance.html#level0",s.IMAGE_0_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/compliance.html#level1",s.IMAGE_0_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/compliance.html#level2",s.IMAGE_0_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/conformance.html#level0",s.IMAGE_0_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/conformance.html#level1",s.IMAGE_0_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/conformance.html#level2",s.IMAGE_1_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",s.IMAGE_1_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",s.IMAGE_1_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",s.IMAGE_1_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",s.IMAGE_1_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",s.IMAGE_1_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",s.IMAGE_1_LEVEL_0="http://iiif.io/api/image/1/level0.json",s.IMAGE_1_PROFILE_LEVEL_0="http://iiif.io/api/image/1/profiles/level0.json",s.IMAGE_1_LEVEL_1="http://iiif.io/api/image/1/level1.json",s.IMAGE_1_PROFILE_LEVEL_1="http://iiif.io/api/image/1/profiles/level1.json",s.IMAGE_1_LEVEL_2="http://iiif.io/api/image/1/level2.json",s.IMAGE_1_PROFILE_LEVEL_2="http://iiif.io/api/image/1/profiles/level2.json",s.IMAGE_2_LEVEL_0="http://iiif.io/api/image/2/level0.json",s.IMAGE_2_PROFILE_LEVEL_0="http://iiif.io/api/image/2/profiles/level0.json",s.IMAGE_2_LEVEL_1="http://iiif.io/api/image/2/level1.json",s.IMAGE_2_PROFILE_LEVEL_1="http://iiif.io/api/image/2/profiles/level1.json",s.IMAGE_2_LEVEL_2="http://iiif.io/api/image/2/level2.json",s.IMAGE_2_PROFILE_LEVEL_2="http://iiif.io/api/image/2/profiles/level2.json",s.AUTH_0_CLICK_THROUGH="http://iiif.io/api/auth/0/login/clickthrough",s.AUTH_0_LOGIN="http://iiif.io/api/auth/0/login",s.AUTH_0_LOGOUT="http://iiif.io/api/auth/0/logout",s.AUTH_0_RESTRICTED="http://iiif.io/api/auth/0/login/restricted",s.AUTH_0_TOKEN="http://iiif.io/api/auth/0/token",s.AUTH_1_CLICK_THROUGH="http://iiif.io/api/auth/1/clickthrough",s.AUTH_1_EXTERNAL="http://iiif.io/api/auth/1/external",s.AUTH_1_KIOSK="http://iiif.io/api/auth/1/kiosk",s.AUTH_1_LOGIN="http://iiif.io/api/auth/1/login",s.AUTH_1_LOGOUT="http://iiif.io/api/auth/1/logout",s.AUTH_1_PROBE="http://iiif.io/api/auth/1/probe",s.AUTH_1_TOKEN="http://iiif.io/api/auth/1/token",s.SEARCH_0="http://iiif.io/api/search/0/search",s.SEARCH_0_AUTO_COMPLETE="http://iiif.io/api/search/0/autocomplete",s.SEARCH_1="http://iiif.io/api/search/1/search",s.SEARCH_1_AUTO_COMPLETE="http://iiif.io/api/search/1/autocomplete",s.TRACKING_EXTENSIONS="http://universalviewer.io/tracking-extensions-profile",s.UI_EXTENSIONS="http://universalviewer.io/ui-extensions-profile",s.PRINT_EXTENSIONS="http://universalviewer.io/print-extensions-profile",s.SHARE_EXTENSIONS="http://universalviewer.io/share-extensions-profile",s.DOWNLOAD_EXTENSIONS="http://universalviewer.io/download-extensions-profile",s.OTHER_MANIFESTATIONS="http://iiif.io/api/otherManifestations.json",s.IXIF="http://wellcomelibrary.org/ld/ixif/0/alpha.json"}(n.ServiceProfile||(n.ServiceProfile={})),function(s){s.IMAGE_SERVICE_2="ImageService2",s.IMAGE_SERVICE_3="ImageService3"}(n.ServiceType||(n.ServiceType={})),function(s){s.BOTTOM_TO_TOP="bottom-to-top",s.LEFT_TO_RIGHT="left-to-right",s.RIGHT_TO_LEFT="right-to-left",s.TOP_TO_BOTTOM="top-to-bottom"}(n.ViewingDirection||(n.ViewingDirection={})),function(s){s.CONTINUOUS="continuous",s.INDIVIDUALS="individuals",s.NON_PAGED="non-paged",s.PAGED="paged",s.TOP="top"}(n.ViewingHint||(n.ViewingHint={}))},function(u,n,d){var s=d(21).Symbol;u.exports=s},function(u,n,d){"use strict";var s=this&&this.__awaiter||function(e,t,i,r){return new(i||(i=Promise))(function(h,m){function I(O){try{S(r.next(O))}catch(C){m(C)}}function x(O){try{S(r.throw(O))}catch(C){m(C)}}function S(O){var C;O.done?h(O.value):(C=O.value,C instanceof i?C:new i(function(_){_(C)})).then(I,x)}S((r=r.apply(e,t||[])).next())})},v=this&&this.__generator||function(e,t){var i,r,h,m={label:0,sent:function(){if(1&h[0])throw h[1];return h[1]},trys:[],ops:[]},I=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return I.next=x(0),I.throw=x(1),I.return=x(2),typeof Symbol=="function"&&(I[Symbol.iterator]=function(){return this}),I;function x(S){return function(O){return function(C){if(i)throw new TypeError("Generator is already executing.");for(;I&&(I=0,C[0]&&(m=0)),m;)try{if(i=1,r&&(h=2&C[0]?r.return:C[0]?r.throw||((h=r.return)&&h.call(r),0):r.next)&&!(h=h.call(r,C[1])).done)return h;switch(r=0,h&&(C=[2&C[0],h.value]),C[0]){case 0:case 1:h=C;break;case 4:return m.label++,{value:C[1],done:!1};case 5:m.label++,r=C[1],C=[0];continue;case 7:C=m.ops.pop(),m.trys.pop();continue;default:if(!((h=(h=m.trys).length>0&&h[h.length-1])||C[0]!==6&&C[0]!==2)){m=0;continue}if(C[0]===3&&(!h||C[1]>h[0]&&C[1]<h[3])){m.label=C[1];break}if(C[0]===6&&m.label<h[1]){m.label=h[1],h=C;break}if(h&&m.label<h[2]){m.label=h[2],m.ops.push(C);break}h[2]&&m.ops.pop(),m.trys.pop();continue}C=t.call(e,m)}catch(_){C=[6,_],r=0}finally{i=h=0}if(5&C[0])throw C[1];return{value:C[0]?C[1]:void 0,done:!0}}([S,O])}}};Object.defineProperty(n,"__esModule",{value:!0}),n.Utils=void 0;var b=d(0),c=d(1),f=d(43);d(44);var p=function(){function e(){}return e.getMediaType=function(t){return(t=(t=t.toLowerCase()).split(";")[0]).trim()},e.getImageQuality=function(t){return t===c.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1||t===c.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2||t===c.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1||t===c.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2||t===c.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1||t===c.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2||t===c.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1||t===c.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2||t===c.ServiceProfile.IMAGE_1_LEVEL_1||t===c.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1||t===c.ServiceProfile.IMAGE_1_LEVEL_2||t===c.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2?"native":"default"},e.getInexactLocale=function(t){return t.indexOf("-")!==-1?t.substr(0,t.indexOf("-")):t},e.getLocalisedValue=function(t,i){if(!Array.isArray(t))return t;for(var r=0;r<t.length;r++){var h=t[r];if(i===h["@language"])return h["@value"]}var m=i.substr(0,i.indexOf("-"));for(r=0;r<t.length;r++){var I=t[r];if(I["@language"]===m)return I["@value"]}return null},e.generateTreeNodeIds=function(t,i){var r;i===void 0&&(i=0),r=t.parentNode?t.parentNode.id+"-"+i:"0",t.id=r;for(var h=0;h<t.nodes.length;h++){var m=t.nodes[h];e.generateTreeNodeIds(m,h)}},e.normaliseType=function(t){return(t=(t||"").toLowerCase()).indexOf(":")!==-1?t.split(":")[1]:t},e.normaliseUrl=function(t){return(t=t.substr(t.indexOf("://"))).indexOf("#")!==-1&&(t=t.split("#")[0]),t},e.normalisedUrlsMatch=function(t,i){return e.normaliseUrl(t)===e.normaliseUrl(i)},e.isImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_1_LEVEL_0)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_1_LEVEL_1)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_1_LEVEL_2)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_2_LEVEL_0)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_2_LEVEL_1)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_2_LEVEL_2)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2))},e.isImageServiceType=function(t){return t!==null&&t.toLowerCase()===c.ServiceType.IMAGE_SERVICE_2.toLowerCase()||t===c.ServiceType.IMAGE_SERVICE_3.toLowerCase()},e.isLevel0ImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_0)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_1_LEVEL_0)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_2_LEVEL_0)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0))},e.isLevel1ImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_1_LEVEL_1)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_2_LEVEL_1)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1))},e.isLevel2ImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_1_LEVEL_2)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_2_LEVEL_2)||e.normalisedUrlsMatch(t,c.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2))},e.parseManifest=function(t,i){return b.Deserialiser.parse(t,i)},e.checkStatus=function(t){if(t.ok)return t;var i=new Error(t.statusText);return i.response=t,Promise.reject(i)},e.loadManifest=function(t){return new Promise(function(i,r){fetch(t).then(e.checkStatus).then(function(h){return h.json()}).then(function(h){i(h)}).catch(function(h){r()})})},e.loadExternalResourcesAuth1=function(t,i,r,h,m,I,x,S){return new Promise(function(O,C){var _=t.map(function(g){return e.loadExternalResourceAuth1(g,i,r,h,m,I,x,S)});Promise.all(_).then(function(){O(t)}).catch(function(g){C(g)})})},e.loadExternalResourceAuth1=function(t,i,r,h,m,I,x,S){return s(this,void 0,void 0,function(){var O;return v(this,function(C){switch(C.label){case 0:return[4,h(t)];case 1:return(O=C.sent())?[4,t.getData(O)]:[3,6];case 2:return C.sent(),t.status!==f.OK?[3,3]:[2,t];case 3:return[4,e.doAuthChain(t,i,r,m,I,x,S)];case 4:C.sent(),C.label=5;case 5:if(t.status===f.OK||t.status===f.MOVED_TEMPORARILY)return[2,t];throw e.createAuthorizationFailedError();case 6:return[4,t.getData()];case 7:return C.sent(),t.status!==f.MOVED_TEMPORARILY&&t.status!==f.UNAUTHORIZED?[3,9]:[4,e.doAuthChain(t,i,r,m,I,x,S)];case 8:C.sent(),C.label=9;case 9:if(t.status===f.OK||t.status===f.MOVED_TEMPORARILY)return[2,t];throw e.createAuthorizationFailedError()}})})},e.doAuthChain=function(t,i,r,h,m,I,x){return s(this,void 0,void 0,function(){var S,O,C,_,g,E,T,A;return v(this,function(L){switch(L.label){case 0:return t.isAccessControlled()?((S=t.externalService)&&(S.options=t.options),(O=t.kioskService)&&(O.options=t.options),(C=t.clickThroughService)&&(C.options=t.options),(_=t.loginService)&&(_.options=t.options),t.isResponseHandled||t.status!==f.MOVED_TEMPORARILY?[3,2]:[4,I(t)]):[2,t];case 1:return L.sent(),[2,t];case 2:return g=null,E=null,(g=S)?(E=g,[4,e.attemptResourceWithToken(t,r,g)]):[3,4];case 3:return L.sent(),[2,t];case 4:return(g=O)?(E=g,(T=i(g))?[4,h(T)]:[3,7]):[3,7];case 5:return L.sent(),[4,e.attemptResourceWithToken(t,r,g)];case 6:return L.sent(),[2,t];case 7:return(g=C)?(E=g,[4,m(t,g)]):[3,11];case 8:return(A=L.sent())?[4,h(A)]:[3,11];case 9:return L.sent(),[4,e.attemptResourceWithToken(t,r,g)];case 10:return L.sent(),[2,t];case 11:return(g=_)?(E=g,[4,m(t,g)]):[3,15];case 12:return(A=L.sent())?[4,h(A)]:[3,15];case 13:return L.sent(),[4,e.attemptResourceWithToken(t,r,g)];case 14:return L.sent(),[2,t];case 15:return E&&x(t,E),[2]}})})},e.attemptResourceWithToken=function(t,i,r){return s(this,void 0,void 0,function(){var h,m;return v(this,function(I){switch(I.label){case 0:return(h=r.getService(c.ServiceProfile.AUTH_1_TOKEN))?[4,i(t,h)]:[3,3];case 1:return(m=I.sent())&&m.accessToken?[4,t.getData(m)]:[3,3];case 2:return I.sent(),[2,t];case 3:return[2]}})})},e.loadExternalResourcesAuth09=function(t,i,r,h,m,I,x,S,O,C){return new Promise(function(_,g){var E=t.map(function(T){return e.loadExternalResourceAuth09(T,i,r,h,m,I,x,S,O,C)});Promise.all(E).then(function(){_(t)}).catch(function(T){g(T)})})},e.loadExternalResourceAuth09=function(t,i,r,h,m,I,x,S,O,C){return new Promise(function(_,g){C&&C.pessimisticAccessControl?t.getData().then(function(){t.isAccessControlled()?t.clickThroughService?(_(r(t)),_(h(t))):m(t).then(function(){I(t,!0).then(function(E){t.getData(E).then(function(){_(O(t))}).catch(function(T){g(e.createInternalServerError(T))})}).catch(function(E){g(e.createInternalServerError(E))})}).catch(function(E){g(e.createInternalServerError(E))}):_(t)}).catch(function(E){g(e.createInternalServerError(E))}):S(t,i).then(function(E){E?t.getData(E).then(function(){t.status===f.OK?_(O(t)):e.authorize(t,i,r,h,m,I,x,S).then(function(){_(O(t))}).catch(function(T){g(e.createAuthorizationFailedError())})}).catch(function(T){g(e.createAuthorizationFailedError())}):e.authorize(t,i,r,h,m,I,x,S).then(function(){_(O(t))}).catch(function(T){g(e.createAuthorizationFailedError())})}).catch(function(E){g(e.createAuthorizationFailedError())})})},e.createError=function(t,i){var r=new Error;return r.message=i,r.name=String(t),r},e.createAuthorizationFailedError=function(){return e.createError(b.StatusCode.AUTHORIZATION_FAILED,"Authorization failed")},e.createRestrictedError=function(){return e.createError(b.StatusCode.RESTRICTED,"Restricted")},e.createInternalServerError=function(t){return e.createError(b.StatusCode.INTERNAL_SERVER_ERROR,t)},e.authorize=function(t,i,r,h,m,I,x,S){return new Promise(function(O,C){t.getData().then(function(){t.isAccessControlled()?S(t,i).then(function(_){_?t.getData(_).then(function(){t.status===f.OK?O(t):e.showAuthInteraction(t,i,r,h,m,I,x,O,C)}).catch(function(g){C(e.createInternalServerError(g))}):I(t,!1).then(function(g){g?x(t,g,i).then(function(){t.getData(g).then(function(){t.status===f.OK?O(t):e.showAuthInteraction(t,i,r,h,m,I,x,O,C)}).catch(function(E){C(e.createInternalServerError(E))})}).catch(function(E){C(e.createInternalServerError(E))}):e.showAuthInteraction(t,i,r,h,m,I,x,O,C)})}).catch(function(_){C(e.createInternalServerError(_))}):O(t)})})},e.showAuthInteraction=function(t,i,r,h,m,I,x,S,O){t.status!==f.MOVED_TEMPORARILY||t.isResponseHandled?t.clickThroughService&&!t.isResponseHandled?r(t).then(function(){I(t,!0).then(function(C){x(t,C,i).then(function(){t.getData(C).then(function(){S(t)}).catch(function(_){O(e.createInternalServerError(_))})}).catch(function(_){O(e.createInternalServerError(_))})}).catch(function(C){O(e.createInternalServerError(C))})}):m(t).then(function(){I(t,!0).then(function(C){x(t,C,i).then(function(){t.getData(C).then(function(){S(t)}).catch(function(_){O(e.createInternalServerError(_))})}).catch(function(_){O(e.createInternalServerError(_))})}).catch(function(C){O(e.createInternalServerError(C))})}):S(t)},e.getService=function(t,i){for(var r=this.getServices(t),h=0;h<r.length;h++){var m=r[h];if(m.getProfile()===i)return m}return null},e.getResourceById=function(t,i){return e.traverseAndFind(t.__jsonld,"@id",i)},e.traverseAndFind=function(t,i,r){if(t.hasOwnProperty(i)&&t[i]===r)return t;for(var h=0;h<Object.keys(t).length;h++)if(typeof t[Object.keys(t)[h]]=="object"){var m=e.traverseAndFind(t[Object.keys(t)[h]],i,r);if(m!=null)return m}},e.getServices=function(t,i){var r=i===void 0?{}:i,h=r.onlyService,m=h!==void 0&&h,I=r.onlyServices,x=I!==void 0&&I,S=r.skipParentResources,O=[];(S===void 0||!S)&&t&&t.options&&t.options.resource&&t.options.resource!==t&&O.push.apply(O,e.getServices(t.options.resource,{onlyServices:!0}));var C=x?[]:(t.__jsonld||t).service||[];if(Array.isArray(C)||(C=[C]),m||C.push.apply(C,(t.__jsonld||t).services||[]),C.length===0)return O;for(var _=0;_<C.length;_++){var g=C[_];if(typeof g=="string"){var E=this.getResourceById(t.options.resource,g);E&&O.push(new b.Service(E.__jsonld||E,t.options))}else O.push(new b.Service(g,t.options))}return O},e.getTemporalComponent=function(t){var i=/t=([^&]+)/g.exec(t),r=null;return i&&i[1]&&(r=i[1].split(",")),r},e}();n.Utils=p},function(u,n,d){var s=d(19),v=d(20);u.exports=function b(c,f,p,e,t){var i=-1,r=c.length;for(p||(p=v),t||(t=[]);++i<r;){var h=c[i];f>0&&p(h)?f>1?b(h,f-1,p,e,t):s(t,h):e||(t[t.length]=h)}return t}},function(u,n){u.exports=function(d){return d!=null&&typeof d=="object"}},function(u,n,d){"use strict";d.r(n),n.default=function(s,v){return v=v||{},new Promise(function(b,c){var f=new XMLHttpRequest,p=[],e=[],t={},i=function(){return{ok:(f.status/100|0)==2,statusText:f.statusText,status:f.status,url:f.responseURL,text:function(){return Promise.resolve(f.responseText)},json:function(){return Promise.resolve(JSON.parse(f.responseText))},blob:function(){return Promise.resolve(new Blob([f.response]))},clone:i,headers:{keys:function(){return p},entries:function(){return e},get:function(h){return t[h.toLowerCase()]},has:function(h){return h.toLowerCase()in t}}}};for(var r in f.open(v.method||"get",s,!0),f.onload=function(){f.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(h,m,I){p.push(m=m.toLowerCase()),e.push([m,I]),t[m]=t[m]?t[m]+","+I:I}),b(i())},f.onerror=c,f.withCredentials=v.credentials=="include",v.headers)f.setRequestHeader(r,v.headers[r]);f.send(v.body||null)})}},function(u,n,d){u.exports=d(8)},function(u,n,d){"use strict";var s=this&&this.__createBinding||(Object.create?function(c,f,p,e){e===void 0&&(e=p);var t=Object.getOwnPropertyDescriptor(f,p);t&&!("get"in t?!f.__esModule:t.writable||t.configurable)||(t={enumerable:!0,get:function(){return f[p]}}),Object.defineProperty(c,e,t)}:function(c,f,p,e){e===void 0&&(e=p),c[e]=f[p]}),v=this&&this.__exportStar||function(c,f){for(var p in c)p==="default"||Object.prototype.hasOwnProperty.call(f,p)||s(f,c,p)};Object.defineProperty(n,"__esModule",{value:!0}),n.parseManifest=n.loadManifest=void 0,v(d(0),n);var b=d(3);n.loadManifest=function(c){return b.Utils.loadManifest(c)},n.parseManifest=function(c,f){return b.Utils.parseManifest(c,f)}},function(u,n,d){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.JSONLDResource=void 0;var s=function(){function v(b){this.__jsonld=b,this.context=this.getProperty("context"),this.id=this.getProperty("id")}return v.prototype.getProperty=function(b){var c=null;return this.__jsonld&&((c=this.__jsonld[b])||(c=this.__jsonld["@"+b])),c},v}();n.JSONLDResource=s},function(u,n,d){"use strict";var s,v=this&&this.__extends||(s=function(p,e){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])})(p,e)},function(p,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=p}s(p,e),p.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)});Object.defineProperty(n,"__esModule",{value:!0}),n.ManifestResource=void 0;var b=d(0),c=d(1),f=function(p){function e(t,i){var r=p.call(this,t)||this;return r.options=i,r}return v(e,p),e.prototype.getIIIFResourceType=function(){return b.Utils.normaliseType(this.getProperty("type"))},e.prototype.getLabel=function(){var t=this.getProperty("label");return t?b.PropertyValue.parse(t,this.options.locale):new b.PropertyValue([],this.options.locale)},e.prototype.getDefaultLabel=function(){return this.getLabel().getValue(this.options.locale)},e.prototype.getMetadata=function(){var t=this.getProperty("metadata"),i=[];if(!t)return i;for(var r=0;r<t.length;r++){var h=t[r],m=new b.LabelValuePair(this.options.locale);m.parse(h),i.push(m)}return i},e.prototype.getRendering=function(t){for(var i=this.getRenderings(),r=0;r<i.length;r++){var h=i[r];if(h.getFormat()===t)return h}return null},e.prototype.getRenderings=function(){var t,i=[];if(!(t=this.__jsonld?this.__jsonld.rendering:this.rendering))return i;Array.isArray(t)||(t=[t]);for(var r=0;r<t.length;r++){var h=t[r];i.push(new b.Rendering(h,this.options))}return i},e.prototype.getRequiredStatement=function(){var t=null,i=this.getProperty("requiredStatement");return i&&(t=new b.LabelValuePair(this.options.locale)).parse(i),t},e.prototype.getService=function(t){return b.Utils.getService(this,t)},e.prototype.getServices=function(){return b.Utils.getServices(this)},e.prototype.getThumbnail=function(){var t=this.getProperty("thumbnail");return Array.isArray(t)&&(t=t[0]),t?new b.Thumbnail(t,this.options):null},e.prototype.isAnnotation=function(){return this.getIIIFResourceType()===c.IIIFResourceType.ANNOTATION},e.prototype.isCanvas=function(){return this.getIIIFResourceType()===c.IIIFResourceType.CANVAS},e.prototype.isCollection=function(){return this.getIIIFResourceType()===c.IIIFResourceType.COLLECTION},e.prototype.isManifest=function(){return this.getIIIFResourceType()===c.IIIFResourceType.MANIFEST},e.prototype.isRange=function(){return this.getIIIFResourceType()===c.IIIFResourceType.RANGE},e.prototype.isSequence=function(){return this.getIIIFResourceType()===c.IIIFResourceType.SEQUENCE},e}(b.JSONLDResource);n.ManifestResource=f},function(u,n,d){"use strict";var s,v=this&&this.__extends||(s=function(f,p){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(f,p)},function(f,p){if(typeof p!="function"&&p!==null)throw new TypeError("Class extends value "+String(p)+" is not a constructor or null");function e(){this.constructor=f}s(f,p),f.prototype=p===null?Object.create(p):(e.prototype=p.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.Resource=void 0;var b=d(0),c=function(f){function p(e,t){return f.call(this,e,t)||this}return v(p,f),p.prototype.getFormat=function(){var e=this.getProperty("format");return e?e.toLowerCase():null},p.prototype.getResources=function(){var e=[];if(!this.__jsonld.resources)return e;for(var t=0;t<this.__jsonld.resources.length;t++){var i=this.__jsonld.resources[t],r=new b.Annotation(i,this.options);e.push(r)}return e},p.prototype.getType=function(){var e=this.getProperty("type");return e?b.Utils.normaliseType(e):null},p.prototype.getWidth=function(){return this.getProperty("width")},p.prototype.getHeight=function(){return this.getProperty("height")},p.prototype.getMaxWidth=function(){return this.getProperty("maxWidth")},p.prototype.getMaxHeight=function(){return this.getProperty("maxHeight")?null:this.getMaxWidth()},p}(b.ManifestResource);n.Resource=c},function(u,n,d){"use strict";var s,v=this&&this.__extends||(s=function(p,e){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])})(p,e)},function(p,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=p}s(p,e),p.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)});Object.def