universalviewer
Version:
The Universal Viewer is a community-developed open source project on a mission to help you share your 📚📜📰📽️📻🗿 with the 🌎
1 lines • 101 kB
JavaScript
(self.webpackChunkUV=self.webpackChunkUV||[]).push([[9501],{8847:(e,t,n)=>{"use strict";var r,o;n.d(t,{G:()=>r}),function(e){e[e.Backspace=8]="Backspace",e[e.Tab=9]="Tab",e[e.Enter=13]="Enter",e[e.Shift=16]="Shift",e[e.Ctrl=17]="Ctrl",e[e.Alt=18]="Alt",e[e.PauseBreak=19]="PauseBreak",e[e.CapsLock=20]="CapsLock",e[e.Escape=27]="Escape",e[e.Spacebar=32]="Spacebar",e[e.PageUp=33]="PageUp",e[e.PageDown=34]="PageDown",e[e.End=35]="End",e[e.Home=36]="Home",e[e.LeftArrow=37]="LeftArrow",e[e.UpArrow=38]="UpArrow",e[e.RightArrow=39]="RightArrow",e[e.DownArrow=40]="DownArrow",e[e.PrintScrn=44]="PrintScrn",e[e.Insert=45]="Insert",e[e.Delete=46]="Delete",e[e.Zero=48]="Zero",e[e.One=49]="One",e[e.Two=50]="Two",e[e.Three=51]="Three",e[e.Four=52]="Four",e[e.Five=53]="Five",e[e.Six=54]="Six",e[e.Seven=55]="Seven",e[e.Eight=56]="Eight",e[e.Nine=57]="Nine",e[e.a=65]="a",e[e.b=66]="b",e[e.c=67]="c",e[e.d=68]="d",e[e.e=69]="e",e[e.f=70]="f",e[e.g=71]="g",e[e.h=72]="h",e[e.i=73]="i",e[e.j=74]="j",e[e.k=75]="k",e[e.l=76]="l",e[e.m=77]="m",e[e.n=78]="n",e[e.o=79]="o",e[e.p=80]="p",e[e.q=81]="q",e[e.r=82]="r",e[e.s=83]="s",e[e.t=84]="t",e[e.u=85]="u",e[e.v=86]="v",e[e.w=87]="w",e[e.x=88]="x",e[e.y=89]="y",e[e.z=90]="z",e[e.LeftWindowKey=91]="LeftWindowKey",e[e.RightWindowKey=92]="RightWindowKey",e[e.SelectKey=93]="SelectKey",e[e.Numpad0=96]="Numpad0",e[e.Numpad1=97]="Numpad1",e[e.Numpad2=98]="Numpad2",e[e.Numpad3=99]="Numpad3",e[e.Numpad4=100]="Numpad4",e[e.Numpad5=101]="Numpad5",e[e.Numpad6=102]="Numpad6",e[e.Numpad7=103]="Numpad7",e[e.Numpad8=104]="Numpad8",e[e.Numpad9=105]="Numpad9",e[e.Multiply=106]="Multiply",e[e.NumpadPlus=107]="NumpadPlus",e[e.NumpadMinus=109]="NumpadMinus",e[e.DecimalPoint=110]="DecimalPoint",e[e.Divide=111]="Divide",e[e.F1=112]="F1",e[e.F2=113]="F2",e[e.F3=114]="F3",e[e.F4=115]="F4",e[e.F5=116]="F5",e[e.F6=117]="F6",e[e.F7=118]="F7",e[e.F8=119]="F8",e[e.F9=120]="F9",e[e.F10=121]="F10",e[e.F11=122]="F11",e[e.F12=123]="F12",e[e.NumLock=144]="NumLock",e[e.ScrollLock=145]="ScrollLock",e[e.Semicolon=186]="Semicolon",e[e.Equals=187]="Equals",e[e.Comma=188]="Comma",e[e.LessThan=188]="LessThan",e[e.Dash=189]="Dash",e[e.Period=190]="Period",e[e.GreaterThan=190]="GreaterThan",e[e.ForwardSlash=191]="ForwardSlash",e[e.QuestionMark=191]="QuestionMark",e[e.GraveAccent=192]="GraveAccent",e[e.Tilde=192]="Tilde",e[e.OpenCurlyBracket=219]="OpenCurlyBracket",e[e.OpenSquareBracket=219]="OpenSquareBracket",e[e.BackSlash=220]="BackSlash",e[e.VerticalPipe=220]="VerticalPipe",e[e.CloseCurlyBracket=221]="CloseCurlyBracket",e[e.CloseSquareBracket=221]="CloseSquareBracket",e[e.Quote=222]="Quote",e[e.CommandFF=224]="CommandFF"}(r||(r={})),function(e){e[e.Backspace=8]="Backspace",e[e.Enter=13]="Enter",e[e.Spacebar=32]="Spacebar",e[e.Hash=35]="Hash",e[e.GraveAccent=39]="GraveAccent",e[e.DoubleQuote=34]="DoubleQuote",e[e.Asterisk=42]="Asterisk",e[e.Plus=43]="Plus",e[e.Comma=44]="Comma",e[e.Minus=45]="Minus",e[e.Period=46]="Period",e[e.ForwardSlash=47]="ForwardSlash",e[e.Zero=48]="Zero",e[e.One=49]="One",e[e.Two=50]="Two",e[e.Three=51]="Three",e[e.Four=52]="Four",e[e.Five=53]="Five",e[e.Six=54]="Six",e[e.Seven=55]="Seven",e[e.Eight=56]="Eight",e[e.Nine=57]="Nine",e[e.Colon=58]="Colon",e[e.Semicolon=59]="Semicolon",e[e.LessThan=60]="LessThan",e[e.Equals=61]="Equals",e[e.GreaterThan=62]="GreaterThan",e[e.QuestionMark=63]="QuestionMark",e[e.At=64]="At",e[e.OpenSquareBracket=91]="OpenSquareBracket",e[e.BackSlash=92]="BackSlash",e[e.CloseSquareBracket=93]="CloseSquareBracket",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.OpenCurlyBracket=123]="OpenCurlyBracket",e[e.VerticalPipe=124]="VerticalPipe",e[e.CloseCurlyBracket=125]="CloseCurlyBracket",e[e.Tilde=126]="Tilde"}(o||(o={}))},4995:function(e,t,n){var r=n(4692);"undefined"!=typeof self&&self,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t,n){"use strict";n.r(t),n.d(t,"Async",(function(){return o})),n.d(t,"Bools",(function(){return i})),n.d(t,"Clipboard",(function(){return a})),n.d(t,"Colors",(function(){return s})),n.d(t,"Dates",(function(){return u})),n.d(t,"Device",(function(){return l})),n.d(t,"Documents",(function(){return c})),n.d(t,"Events",(function(){return p})),n.d(t,"Files",(function(){return f})),n.d(t,"Keyboard",(function(){return h})),n.d(t,"Maths",(function(){return d})),n.d(t,"Size",(function(){return _})),n.d(t,"Dimensions",(function(){return g})),n.d(t,"Numbers",(function(){return v})),n.d(t,"Objects",(function(){return y})),n.d(t,"Storage",(function(){return E})),n.d(t,"StorageItem",(function(){return m})),n.d(t,"StorageType",(function(){return r})),n.d(t,"Strings",(function(){return I})),n.d(t,"Urls",(function(){return O}));var r,o=function(){function e(){}return e.waitFor=function(t,n,r,o,i,a){o||(o=200),i||(i=100),a||(a=0),(a+=1)>i?r&&r():t()?n():setTimeout((function(){e.waitFor(t,n,r,o,i,a)}),o)},e}(),i=function(){function e(){}return e.getBool=function(e,t){return null==e?t:e},e}(),a=function(){function e(){}return e.supportsCopy=function(){return document.queryCommandSupported&&document.queryCommandSupported("copy")},e.copy=function(t){t=e.convertBrToNewLine(t);var n=document.createElement("textarea");n.value=t,e.hideButKeepEnabled(n),document.body.appendChild(n),n.focus(),n.select(),document.execCommand("copy"),document.body.removeChild(n)},e.hideButKeepEnabled=function(e){e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.width="2em",e.style.height="2em",e.style.padding="0",e.style.border="none",e.style.outline="none",e.style.boxShadow="none",e.style.background="transparent"},e.convertBrToNewLine=function(e){return e.replace(/<br\s*[\/]?>/gi,"\n")},e}(),s=function(){function e(){}return e.float32ColorToARGB=function(e){return[(4278190080&e)>>>24,(16711680&e)>>>16,(65280&e)>>>8,255&e]},e._componentToHex=function(e){var t=e.toString(16);return 1==t.length?"0"+t:t},e.rgbToHexString=function(t){return e.coalesce(t),"#"+e._componentToHex(t[0])+e._componentToHex(t[1])+e._componentToHex(t[2])},e.argbToHexString=function(t){return"#"+e._componentToHex(t[0])+e._componentToHex(t[1])+e._componentToHex(t[2])+e._componentToHex(t[3])},e.coalesce=function(e){for(var t=1;t<e.length;t++)void 0===e[t]&&(e[t]=e[t-1])},e}(),u=function(){function e(){}return e.getTimeStamp=function(){return(new Date).getTime()},e}(),l=function(){function e(){}return e.getPixelRatio=function(e){return(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)},e.isTouch=function(){return!!("ontouchstart"in window)||window.navigator.msMaxTouchPoints>0},e}(),c=function(){function e(){}return e.isInIFrame=function(){try{return window.self!==window.top}catch(e){return!0}},e.supportsFullscreen=function(){var e=document.documentElement;return void 0!==(e.requestFullscreen||e.mozRequestFullScreen||e.webkitRequestFullScreen||e.msRequestFullscreen)},e.isHidden=function(){return!!e.getHiddenProp()},e.getHiddenProp=function(){var e=["webkit","moz","ms","o"];if("hidden"in document)return"hidden";for(var t=0;t<e.length;t++)if(e[t]+"Hidden"in document)return e[t]+"Hidden";return null},e}(),p=function(){function e(){}return e.debounce=function(e,t){return t=t||100,function(){if(!e.debouncing){var n=Array.prototype.slice.apply(arguments);e.lastReturnVal=e.apply(window,n),e.debouncing=!0}return clearTimeout(e.debounceTimeout),e.debounceTimeout=setTimeout((function(){e.debouncing=!1}),t),e.lastReturnVal}},e}(),f=function(){function e(){}return e.simplifyMimeType=function(e){switch(e){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 t=e.split("/");return t[t.length-1]}},e}(),h=function(){function e(){}return e.getCharCode=function(e){return"number"==typeof e.which?e.which:e.keyCode},e}(),d=function(){function e(){}return e.normalise=function(e,t,n){return(e-t)/(n-t)},e.median=function(e){e.sort((function(e,t){return e-t}));var t=Math.floor(e.length/2);return e.length%2?e[t]:(e[t-1]+e[t])/2},e.clamp=function(e,t,n){return Math.min(Math.max(e,t),n)},e}(),_=function(e,t){this.width=e,this.height=t},g=function(){function e(){}return e.fitRect=function(e,t,n,r){var o,i=0,a=0;return t/e<r/n?(i=e*(o=n/e),a=t*o):(i=e*(o=r/t),a=t*o),new _(Math.floor(i),Math.floor(a))},e.hitRect=function(e,t,n,r,o,i){return o>e&&o<e+n&&i>t&&i<t+r},e}(),v=function(){function e(){}return e.numericalInput=function(e){return 46==e.keyCode||8==e.keyCode||9==e.keyCode||27==e.keyCode||65==e.keyCode&&!0===e.ctrlKey||e.keyCode>=35&&e.keyCode<=39||!(e.shiftKey||(e.keyCode<48||e.keyCode>57)&&(e.keyCode<96||e.keyCode>105))||(e.preventDefault(),!1)},e}(),y=function(){function e(){}return e.toPlainObject=function(e){e=Object(e);var t={};for(var n in e)t[n]=e[n];return t},e}(),E=function(){function e(){}return e.clear=function(e){switch(void 0===e&&(e=r.MEMORY),e){case r.MEMORY:this._memoryStorage={};break;case r.SESSION:sessionStorage.clear();break;case r.LOCAL:localStorage.clear()}},e.clearExpired=function(e){void 0===e&&(e=r.MEMORY);for(var t=this.getItems(e),n=0;n<t.length;n++){var o=t[n];this._isExpired(o)&&this.remove(o.key)}},e.get=function(e,t){void 0===t&&(t=r.MEMORY);var n=null;switch(t){case r.MEMORY:n=this._memoryStorage[e];break;case r.SESSION:n=sessionStorage.getItem(e);break;case r.LOCAL:n=localStorage.getItem(e)}if(!n)return null;var o=null;try{o=JSON.parse(n)}catch(e){return null}return o?this._isExpired(o)?null:(o.key=e,o):null},e._isExpired=function(e){return!((new Date).getTime()<e.expiresAt)},e.getItems=function(e){void 0===e&&(e=r.MEMORY);var t=[];switch(e){case r.MEMORY:for(var n=Object.keys(this._memoryStorage),o=0;o<n.length;o++)(a=this.get(n[o],r.MEMORY))&&t.push(a);break;case r.SESSION:for(o=0;o<sessionStorage.length;o++)(i=sessionStorage.key(o))&&(a=this.get(i,r.SESSION))&&t.push(a);break;case r.LOCAL:for(o=0;o<localStorage.length;o++){var i,a;(i=localStorage.key(o))&&(a=this.get(i,r.LOCAL))&&t.push(a)}}return t},e.remove=function(e,t){switch(void 0===t&&(t=r.MEMORY),t){case r.MEMORY:delete this._memoryStorage[e];break;case r.SESSION:sessionStorage.removeItem(e);break;case r.LOCAL:localStorage.removeItem(e)}},e.set=function(e,t,n,o){void 0===o&&(o=r.MEMORY);var i=1e3*n,a=new m;switch(a.value=t,a.expiresAt=(new Date).getTime()+i,o){case r.MEMORY:this._memoryStorage[e]=JSON.stringify(a);break;case r.SESSION:sessionStorage.setItem(e,JSON.stringify(a));break;case r.LOCAL:localStorage.setItem(e,JSON.stringify(a))}return a},e._memoryStorage={},e}(),m=function(){};!function(e){e.MEMORY="memory",e.SESSION="session",e.LOCAL="local"}(r||(r={}));var I=function(){function e(){}return e.ellipsis=function(e,t){if(e.length<=t)return e;var n=e.substr(0,t),r=n.lastIndexOf(" ");return-1!=r&&(n=n.substr(0,Math.min(n.length,r))),n+"…"},e.htmlDecode=function(e){var t=document.createElement("div");return t.innerHTML=e,t.firstChild.nodeValue},e.format=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0;r<t.length;r++){var o=new RegExp("\\{"+r+"\\}","gm");e=e.replace(o,t[r])}return e},e.isAlphanumeric=function(e){return/^[a-zA-Z0-9]*$/.test(e)},e.toCssClass=function(e){return e.replace(/[^a-z0-9]/g,(function(e){var t=e.charCodeAt(0);return 32==t?"-":t>=65&&t<=90?"_"+e.toLowerCase():"__"+("000"+t.toString(16)).slice(-4)}))},e.toFileName=function(e){return e.replace(/[^a-z0-9]/gi,"_").toLowerCase()},e.utf8_to_b64=function(e){return window.btoa(unescape(encodeURIComponent(e)))},e}(),O=function(){function e(){}return e.getHashParameter=function(e,t){return t||(t=window.document),t&&t.location?this.getHashParameterFromString(e,t.location.hash):null},e.getHashParameterFromString=function(e,t){var n=new RegExp("#.*[?&]"+e+"=([^&]+)(&|$)").exec(t);return n?decodeURIComponent(n[1].replace(/\+/g," ")):null},e.setHashParameter=function(e,t,n){if(n||(n=window.document),n&&n.location){var r="#?"+this.updateURIKeyValuePair(n.location.hash.replace("#?",""),e,t),o=n.URL;-1!=o.indexOf("#")&&(o=o.substr(0,o.indexOf("#"))),n.location.replace(o+r)}},e.getQuerystringParameter=function(e,t){return t||(t=window),this.getQuerystringParameterFromString(e,t.location.search)},e.getQuerystringParameterFromString=function(e,t){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var n=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(t);return n?decodeURIComponent(n[1].replace(/\+/g," ")):null},e.setQuerystringParameter=function(e,t,n){if(n||(n=window.document),n&&n.location){var r=this.updateURIKeyValuePair(n.location.hash.replace("#?",""),e,t);window.location.search=r}},e.updateURIKeyValuePair=function(e,t,n){t=encodeURIComponent(t),n=encodeURIComponent(n);var r=e.split("&");""==r[0]&&r.shift();for(var o,i=r.length;i--;)if((o=r[i].split("="))[0]==t){o[1]=n,r[i]=o.join("=");break}return i<0&&(r[r.length]=[t,n].join("=")),r.join("&")},e.getUrlParts=function(e){var t=document.createElement("a");return t.href=e,t},e.convertToRelativeUrl=function(e){var t=this.getUrlParts(e),n=t.pathname+t.searchWithin;return n.startsWith("/")||(n="/"+n),n},e}()},function(e,t,n){e.exports=n(2)},function(e,t,n){"use strict";var o,i=this&&this.__extends||(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Events=t.MetadataComponent=t.LimitType=void 0;var a,s=n(3),u=n(4),l=n(0),c=n(5);!function(e){e.LINES="lines",e.CHARS="chars"}(a||(t.LimitType=a={}));var p=function(e){function t(t){var n=e.call(this,t)||this;return n._data=n.data(),n._data=n.options.data,n._init(),n._resize(),n}return i(t,e),t.prototype._init=function(){return e.prototype._init.call(this),this._$element=r(this.el),this._$metadataGroupTemplate=r('<div class="group"> <div class="header"></div> <div class="items"></div> </div>'),this._$metadataItemTemplate=r('<div class="item"> <div class="label"></div> <div class="values"></div> </div>'),this._$metadataItemValueTemplate=r('<div class="value"></div>'),this._$metadataItemURIValueTemplate=r('<a class="value" href="" target="_blank"></a>'),this._$copyTextTemplate=r('<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=r('<div class="groups"></div>'),this._$element.append(this._$metadataGroups),this._$noData=r('<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:a.LINES,limitToRange:!1,manifestDisplayOrder:"",manifestExclude:"",range:null,rtlLanguageCodes:"ar, ara, dv, div, he, heb, ur, urd",sanitizer:function(e){return e},showAllLanguages:!1}},t.prototype._getManifestGroup=function(){return this._metadataGroups.filter((function(e){return e.resource.isManifest()}))[0]},t.prototype._getCanvasGroups=function(){return this._metadataGroups.filter((function(e){return e.resource.isCanvas()}))},t.prototype.set=function(e){var t=this;if(this._data=Object.assign(this._data,e),this._data&&this._data.helper){var n,r={canvases:this._data.canvases,licenseFormatter:this._data.licenseFormatter,range:this._data.range};if(this._metadataGroups=this._data.helper.getMetadata(r),this._data.manifestDisplayOrder&&((n=this._getManifestGroup()).items=this._sortItems(n.items,this._readCSV(this._data.manifestDisplayOrder))),this._data.canvasDisplayOrder&&this._getCanvasGroups().forEach((function(e,n){e.items=t._sortItems(e.items,t._readCSV(t._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&&((n=this._getManifestGroup()).items=this._exclude(n.items,this._readCSV(this._data.manifestExclude))),this._data.canvasExclude&&this._getCanvasGroups().forEach((function(e,n){e.items=t._exclude(e.items,t._readCSV(t._data.canvasExclude))})),this._data.limitToRange){var o=[];this._metadataGroups.forEach((function(e,t){e.resource.isRange()&&o.push(e)})),o.length&&(this._metadataGroups=o)}this._render()}},t.prototype._sortItems=function(e,t){var n=this,r=[],o=e.slice(0);return t.forEach((function(e,t){var i=o.filter((function(t){return n._normalise(t.getLabel())===e}))[0];if(i){r.push(i);var a=o.indexOf(i);a>-1&&o.splice(a,1)}})),o.forEach((function(e,t){r.push(e)})),r},t.prototype._sortGroups=function(e,t){var n=[],r=e.slice(0);return t.forEach((function(e,t){var o=r.filter((function(t){return t.resource.getIIIFResourceType().toLowerCase()==e.toLowerCase()}))[0];if(o){n.push(o);var i=r.indexOf(o);i>-1&&r.splice(i,1)}})),n},t.prototype._label=function(e,t){e.forEach((function(e,n){e.label=t[n]}))},t.prototype._exclude=function(e,t){var n=this;return t.forEach((function(t,r){var o=e.filter((function(e){return n._normalise(e.getLabel())===t}))[0];if(o){var i=e.indexOf(o);i>-1&&e.splice(i,1)}})),e},t.prototype._normalise=function(e){return e?e.toLowerCase().replace(/ /g,""):null},t.prototype._render=function(){var e=this;this._metadataGroups.length?(this._$noData.hide(),this._$metadataGroups.empty(),this._metadataGroups.forEach((function(t,n){var r=e._buildMetadataGroup(t);e._$metadataGroups.append(r);var o=r.find(".value"),i=r.find(".item");e._data.limit&&e._data.content&&(e._data.limitType===a.LINES?(0,c.default)(i,e._data.limit,e._data.content.less,e._data.content.more,(function(){}),e._data.content.lessAriaLabelTemplate,e._data.content.moreAriaLabelTemplate):e._data.limitType===a.CHARS&&o.ellipsisHtmlFixed(e._data.limit,(function(){})))}))):this._$noData.show()},t.prototype._buildMetadataGroup=function(e){var t=this._$metadataGroupTemplate.clone(),n=t.find(">.header");if(this._data.content)if(e.resource.isManifest()&&this._data.content.manifestHeader)(o=this._sanitize(this._data.content.manifestHeader))&&n.html(o);else if(e.resource.isSequence()&&this._data.content.sequenceHeader)(o=this._sanitize(this._data.content.sequenceHeader))&&n.html(o);else if(e.resource.isRange()&&this._data.content.rangeHeader)(o=this._sanitize(this._data.content.rangeHeader))&&n.html(o);else if(e.resource.isCanvas()&&(e.label||this._data.content.canvasHeader)){var r=e.label||this._data.content.canvasHeader;n.html(this._sanitize(r))}else if(e.resource.isAnnotation()&&this._data.content.imageHeader){var o;(o=this._sanitize(this._data.content.imageHeader))&&n.html(o)}n.text()||n.hide();for(var i=t.find(".items"),a=0;a<e.items.length;a++){var s=e.items[a],u=this._buildMetadataItem(s);i.append(u)}return t},t.prototype._buildMetadataItem=function(e){var t,n,o=this._$metadataItemTemplate.clone(),i=o.find(".label"),a=o.find(".values"),s=e.getLabel(),u=s,c=new RegExp("/w+:(/?/?)[^s]+/gm","i");if(this._data.content&&u&&e.isRootLevel)switch(u.toLowerCase()){case"attribution":u=this._data.content.attribution;break;case"description":u=this._data.content.description;break;case"license":u=this._data.content.license;break;case"logo":u=this._data.content.logo;break;case"rights":u=this._data.content.rights}u=this._sanitize(u),i.html(u),this._addReadingDirection(i,this._getLabelLocale(e)),o.addClass(l.Strings.toCssClass(u));var p=this._getValueLocale(e),h=null===(t=e.value)||void 0===t?void 0:t.getValue(p);if(!s||"license"!==s.toLowerCase()&&"rights"!==s.toLowerCase()||null===c.exec(h))if(this._data.showAllLanguages&&e.value&&e.value.length>1)for(var d=[],_=0;_<e.value.length;_++){var g=e.value[_]._locale;if(g&&!d.includes(g)){var v=e.getValue(g,"<br/>");v&&(n=this._buildMetadataItemValue(v,g),d.push(g),a.append(n))}}else{for(var y=this._getValueLocale(e),E=!1,m=0,I=e.getValues(y);m<I.length;m++){var O;(O=I[m])&&(E=!0,n=this._buildMetadataItemValue(O,y),a.append(n))}E||(O=e.getValue())&&(n=this._buildMetadataItemValue(O,y),a.append(n))}else n=this._buildMetadataItemURIValue(h),a.append(n);this._data.copyToClipboardEnabled&&l.Clipboard.supportsCopy()&&i.text()&&this._addCopyButton(o,i,a);var T=this;return o.find("a.iiif-viewer-link").length>0&&o.on("click","a.iiif-viewer-link",(function(e){e.preventDefault();var t=r(e.target),n=t.attr("data-uv-navigate")||t.prop("href");T.fire(f.IIIF_VIEWER_LINK_CLICKED,n)})),o.find("[data-uv-navigate]").length>0&&o.on("click","[data-uv-navigate]",(function(e){e.preventDefault();var t=r(e.target).attr("data-uv-navigate")||null;t&&T.fire(f.IIIF_VIEWER_LINK_CLICKED,t)})),o},t.prototype._getLabelLocale=function(e){var t;if(!this._data||!this._data.helper)return"";var n=this._data.helper.options.locale;if(null===(t=e.label)||void 0===t?void 0:t.length){var r=e.label[0].locale;if(r.toLowerCase()!==n.toLowerCase())return r}return n},t.prototype._getValueLocale=function(e){return this._data&&this._data.helper?this._data.helper.options.locale:""},t.prototype._buildMetadataItemValue=function(e,t){e=(e=this._sanitize(e)).replace("\n","<br>");var n=this._$metadataItemValueTemplate.clone();return n.html(e),n.find("a").each((function(){var e=r(this);e.hasClass("iiif-viewer-link")||e.prop("target","_blank")})),t&&(n.prop("lang",t),this._addReadingDirection(n,t)),n},t.prototype._buildMetadataItemURIValue=function(e){e=this._sanitize(e);var t=this._$metadataItemURIValueTemplate.clone();return t.prop("href",e),t.text(e),t},t.prototype._addReadingDirection=function(e,t){t=s.Utils.getInexactLocale(t),this._readCSV(this._data.rtlLanguageCodes).filter((function(e){return e===t})).length>0&&(e.prop("dir","rtl"),e.addClass("rtl"))},t.prototype._addCopyButton=function(e,t,n){var r=this._$copyTextTemplate.clone(),o=r.children();t.append(r),l.Device.isTouch()?r.show():(e.on("mouseenter",(function(){r.show()})),e.on("mouseleave",(function(){r.hide()})),r.on("mouseleave",(function(){o.hide()})));var i=this,a=n.text();r.on("click",(function(e){i._copyItemValues(r,a)}))},t.prototype._copyItemValues=function(e,t){l.Clipboard.copy(t);var n=e.find(".copiedText");n.show(),setTimeout((function(){n.hide()}),this._data.copiedMessageDuration)},t.prototype._readCSV=function(e,t){void 0===t&&(t=!0);var n=[];if(e&&(n=e.split(","),t))for(var r=0;r<n.length;r++)n[r]=this._normalise(n[r]);return n},t.prototype._sanitize=function(e){return this._data.sanitizer?this._data.sanitizer(e):null},t.prototype._resize=function(){},t}(u.BaseComponent);t.MetadataComponent=p;var f=function(){function e(){}return e.IIIF_VIEWER_LINK_CLICKED="iiifViewerLinkClicked",e}();t.Events=f},function(e,t,n){"undefined"!=typeof self&&self,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(9),t),o(n(10),t),o(n(11),t),o(n(12),t),o(n(13),t),o(n(14),t),o(n(15),t),o(n(16),t),o(n(17),t),o(n(31),t),o(n(32),t),o(n(33),t),o(n(34),t),o(n(35),t),o(n(36),t),o(n(37),t),o(n(38),t),o(n(39),t),o(n(40),t),o(n(41),t),o(n(42),t),o(n(45),t),o(n(46),t),o(n(47),t),o(n(48),t),o(n(49),t),o(n(50),t),o(n(51),t),o(n(52),t),o(n(53),t),o(n(54),t),o(n(55),t),o(n(56),t),o(n(57),t),o(n(3),t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BOOKMARKING="oa:bookmarking",e.CLASSIFYING="oa:classifying",e.COMMENTING="oa:commenting",e.DESCRIBING="oa:describing",e.EDITING="oa:editing",e.HIGHLIGHTING="oa:highlighting",e.IDENTIFYING="oa:identifying",e.LINKING="oa:linking",e.MODERATING="oa:moderating",e.PAINTING="sc:painting",e.QUESTIONING="oa:questioning",e.REPLYING="oa:replying",e.TAGGING="oa:tagging",e.TRANSCRIBING="oad:transcribing"}(t.AnnotationMotivation||(t.AnnotationMotivation={})),function(e){e.AUTO_ADVANCE="auto-advance",e.CONTINUOUS="continuous",e.FACING_PAGES="facing-pages",e.HIDDEN="hidden",e.INDIVIDUALS="individuals",e.MULTI_PART="multi-part",e.NO_NAV="no-nav",e.NON_PAGED="non-paged",e.PAGED="paged",e.REPEAT="repeat",e.SEQUENCE="sequence",e.THUMBNAIL_NAV="thumbnail-nav",e.TOGETHER="together",e.UNORDERED="unordered"}(t.Behavior||(t.Behavior={})),function(e){e.CANVAS="canvas",e.CHOICE="choice",e.OA_CHOICE="oa:choice",e.CONTENT_AS_TEXT="contentastext",e.DATASET="dataset",e.DOCUMENT="document",e.IMAGE="image",e.MODEL="model",e.MOVING_IMAGE="movingimage",e.PDF="pdf",e.PHYSICAL_OBJECT="physicalobject",e.SOUND="sound",e.TEXT="text",e.TEXTUALBODY="textualbody",e.VIDEO="video"}(t.ExternalResourceType||(t.ExternalResourceType={})),function(e){e.ANNOTATION="annotation",e.CANVAS="canvas",e.COLLECTION="collection",e.MANIFEST="manifest",e.RANGE="range",e.SEQUENCE="sequence"}(t.IIIFResourceType||(t.IIIFResourceType={})),function(e){e.AUDIO_MP4="audio/mp4",e.CORTO="application/corto",e.DICOM="application/dicom",e.DRACO="application/draco",e.EPUB="application/epub+zip",e.GIRDER="image/vnd.kitware.girder",e.GLB="model/gltf-binary",e.GLTF="model/gltf+json",e.IIIF_PRESENTATION_2='application/ld+json;profile="http://iiif.io/api/presentation/2/context.json"',e.IIIF_PRESENTATION_3='application/ld+json;profile="http://iiif.io/api/presentation/3/context.json"',e.JPG="image/jpeg",e.M3U8="application/vnd.apple.mpegurl",e.MP3="audio/mp3",e.MPEG_DASH="application/dash+xml",e.OBJ="text/plain",e.OPF="application/oebps-package+xml",e.PDF="application/pdf",e.PLY="application/ply",e.THREEJS="application/vnd.threejs+json",e.USDZ="model/vnd.usd+zip",e.VIDEO_MP4="video/mp4",e.WAV="audio/wav",e.WEBM="video/webm"}(t.MediaType||(t.MediaType={})),function(e){e.DOC="application/msword",e.DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",e.PDF="application/pdf"}(t.RenderingFormat||(t.RenderingFormat={})),function(e){e.IMAGE_0_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/compliance.html#level0",e.IMAGE_0_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/compliance.html#level1",e.IMAGE_0_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/compliance.html#level2",e.IMAGE_0_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/conformance.html#level0",e.IMAGE_0_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/conformance.html#level1",e.IMAGE_0_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/conformance.html#level2",e.IMAGE_1_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",e.IMAGE_1_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",e.IMAGE_1_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",e.IMAGE_1_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",e.IMAGE_1_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",e.IMAGE_1_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",e.IMAGE_1_LEVEL_0="http://iiif.io/api/image/1/level0.json",e.IMAGE_1_PROFILE_LEVEL_0="http://iiif.io/api/image/1/profiles/level0.json",e.IMAGE_1_LEVEL_1="http://iiif.io/api/image/1/level1.json",e.IMAGE_1_PROFILE_LEVEL_1="http://iiif.io/api/image/1/profiles/level1.json",e.IMAGE_1_LEVEL_2="http://iiif.io/api/image/1/level2.json",e.IMAGE_1_PROFILE_LEVEL_2="http://iiif.io/api/image/1/profiles/level2.json",e.IMAGE_2_LEVEL_0="http://iiif.io/api/image/2/level0.json",e.IMAGE_2_PROFILE_LEVEL_0="http://iiif.io/api/image/2/profiles/level0.json",e.IMAGE_2_LEVEL_1="http://iiif.io/api/image/2/level1.json",e.IMAGE_2_PROFILE_LEVEL_1="http://iiif.io/api/image/2/profiles/level1.json",e.IMAGE_2_LEVEL_2="http://iiif.io/api/image/2/level2.json",e.IMAGE_2_PROFILE_LEVEL_2="http://iiif.io/api/image/2/profiles/level2.json",e.AUTH_0_CLICK_THROUGH="http://iiif.io/api/auth/0/login/clickthrough",e.AUTH_0_LOGIN="http://iiif.io/api/auth/0/login",e.AUTH_0_LOGOUT="http://iiif.io/api/auth/0/logout",e.AUTH_0_RESTRICTED="http://iiif.io/api/auth/0/login/restricted",e.AUTH_0_TOKEN="http://iiif.io/api/auth/0/token",e.AUTH_1_CLICK_THROUGH="http://iiif.io/api/auth/1/clickthrough",e.AUTH_1_EXTERNAL="http://iiif.io/api/auth/1/external",e.AUTH_1_KIOSK="http://iiif.io/api/auth/1/kiosk",e.AUTH_1_LOGIN="http://iiif.io/api/auth/1/login",e.AUTH_1_LOGOUT="http://iiif.io/api/auth/1/logout",e.AUTH_1_PROBE="http://iiif.io/api/auth/1/probe",e.AUTH_1_TOKEN="http://iiif.io/api/auth/1/token",e.SEARCH_0="http://iiif.io/api/search/0/search",e.SEARCH_0_AUTO_COMPLETE="http://iiif.io/api/search/0/autocomplete",e.SEARCH_1="http://iiif.io/api/search/1/search",e.SEARCH_1_AUTO_COMPLETE="http://iiif.io/api/search/1/autocomplete",e.TRACKING_EXTENSIONS="http://universalviewer.io/tracking-extensions-profile",e.UI_EXTENSIONS="http://universalviewer.io/ui-extensions-profile",e.PRINT_EXTENSIONS="http://universalviewer.io/print-extensions-profile",e.SHARE_EXTENSIONS="http://universalviewer.io/share-extensions-profile",e.DOWNLOAD_EXTENSIONS="http://universalviewer.io/download-extensions-profile",e.OTHER_MANIFESTATIONS="http://iiif.io/api/otherManifestations.json",e.IXIF="http://wellcomelibrary.org/ld/ixif/0/alpha.json"}(t.ServiceProfile||(t.ServiceProfile={})),function(e){e.IMAGE_SERVICE_2="ImageService2",e.IMAGE_SERVICE_3="ImageService3"}(t.ServiceType||(t.ServiceType={})),function(e){e.BOTTOM_TO_TOP="bottom-to-top",e.LEFT_TO_RIGHT="left-to-right",e.RIGHT_TO_LEFT="right-to-left",e.TOP_TO_BOTTOM="top-to-bottom"}(t.ViewingDirection||(t.ViewingDirection={})),function(e){e.CONTINUOUS="continuous",e.INDIVIDUALS="individuals",e.NON_PAGED="non-paged",e.PAGED="paged",e.TOP="top"}(t.ViewingHint||(t.ViewingHint={}))},function(e,t,n){var r=n(21).Symbol;e.exports=r},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Utils=void 0;var i=n(0),a=n(1),s=n(43);n(44);var u=function(){function e(){}return e.getMediaType=function(e){return(e=(e=e.toLowerCase()).split(";")[0]).trim()},e.getImageQuality=function(e){return e===a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_1_LEVEL_1||e===a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1||e===a.ServiceProfile.IMAGE_1_LEVEL_2||e===a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2?"native":"default"},e.getInexactLocale=function(e){return-1!==e.indexOf("-")?e.substr(0,e.indexOf("-")):e},e.getLocalisedValue=function(e,t){if(!Array.isArray(e))return e;for(var n=0;n<e.length;n++){var r=e[n];if(t===r["@language"])return r["@value"]}var o=t.substr(0,t.indexOf("-"));for(n=0;n<e.length;n++){var i=e[n];if(i["@language"]===o)return i["@value"]}return null},e.generateTreeNodeIds=function(t,n){var r;void 0===n&&(n=0),r=t.parentNode?t.parentNode.id+"-"+n:"0",t.id=r;for(var o=0;o<t.nodes.length;o++){var i=t.nodes[o];e.generateTreeNodeIds(i,o)}},e.normaliseType=function(e){return-1!==(e=(e||"").toLowerCase()).indexOf(":")?e.split(":")[1]:e},e.normaliseUrl=function(e){return-1!==(e=e.substr(e.indexOf("://"))).indexOf("#")&&(e=e.split("#")[0]),e},e.normalisedUrlsMatch=function(t,n){return e.normaliseUrl(t)===e.normaliseUrl(n)},e.isImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2))},e.isImageServiceType=function(e){return null!==e&&e.toLowerCase()===a.ServiceType.IMAGE_SERVICE_2.toLowerCase()||e===a.ServiceType.IMAGE_SERVICE_3.toLowerCase()},e.isLevel0ImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0))},e.isLevel1ImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1))},e.isLevel2ImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2))},e.parseManifest=function(e,t){return i.Deserialiser.parse(e,t)},e.checkStatus=function(e){if(e.ok)return e;var t=new Error(e.statusText);return t.response=e,Promise.reject(t)},e.loadManifest=function(t){return new Promise((function(n,r){fetch(t).then(e.checkStatus).then((function(e){return e.json()})).then((function(e){n(e)})).catch((function(e){r()}))}))},e.loadExternalResourcesAuth1=function(t,n,r,o,i,a,s,u){return new Promise((function(l,c){var p=t.map((function(t){return e.loadExternalResourceAuth1(t,n,r,o,i,a,s,u)}));Promise.all(p).then((function(){l(t)})).catch((function(e){c(e)}))}))},e.loadExternalResourceAuth1=function(t,n,i,a,u,l,c,p){return r(this,void 0,void 0,(function(){var r;return o(this,(function(o){switch(o.label){case 0:return[4,a(t)];case 1:return(r=o.sent())?[4,t.getData(r)]:[3,6];case 2:return o.sent(),t.status!==s.OK?[3,3]:[2,t];case 3:return[4,e.doAuthChain(t,n,i,u,l,c,p)];case 4:o.sent(),o.label=5;case 5:if(t.status===s.OK||t.status===s.MOVED_TEMPORARILY)return[2,t];throw e.createAuthorizationFailedError();case 6:return[4,t.getData()];case 7:return o.sent(),t.status!==s.MOVED_TEMPORARILY&&t.status!==s.UNAUTHORIZED?[3,9]:[4,e.doAuthChain(t,n,i,u,l,c,p)];case 8:o.sent(),o.label=9;case 9:if(t.status===s.OK||t.status===s.MOVED_TEMPORARILY)return[2,t];throw e.createAuthorizationFailedError()}}))}))},e.doAuthChain=function(t,n,i,a,u,l,c){return r(this,void 0,void 0,(function(){var r,p,f,h,d,_,g,v;return o(this,(function(o){switch(o.label){case 0:return t.isAccessControlled()?((r=t.externalService)&&(r.options=t.options),(p=t.kioskService)&&(p.options=t.options),(f=t.clickThroughService)&&(f.options=t.options),(h=t.loginService)&&(h.options=t.options),t.isResponseHandled||t.status!==s.MOVED_TEMPORARILY?[3,2]:[4,l(t)]):[2,t];case 1:case 3:case 6:case 10:case 14:return o.sent(),[2,t];case 2:return d=null,_=null,(d=r)?(_=d,[4,e.attemptResourceWithToken(t,i,d)]):[3,4];case 4:return(d=p)?(_=d,(g=n(d))?[4,a(g)]:[3,7]):[3,7];case 5:case 9:case 13:return o.sent(),[4,e.attemptResourceWithToken(t,i,d)];case 7:return(d=f)?(_=d,[4,u(t,d)]):[3,11];case 8:return(v=o.sent())?[4,a(v)]:[3,11];case 11:return(d=h)?(_=d,[4,u(t,d)]):[3,15];case 12:return(v=o.sent())?[4,a(v)]:[3,15];case 15:return _&&c(t,_),[2]}}))}))},e.attemptResourceWithToken=function(e,t,n){return r(this,void 0,void 0,(function(){var r,i;return o(this,(function(o){switch(o.label){case 0:return(r=n.getService(a.ServiceProfile.AUTH_1_TOKEN))?[4,t(e,r)]:[3,3];case 1:return(i=o.sent())&&i.accessToken?[4,e.getData(i)]:[3,3];case 2:return o.sent(),[2,e];case 3:return[2]}}))}))},e.loadExternalResourcesAuth09=function(t,n,r,o,i,a,s,u,l,c){return new Promise((function(p,f){var h=t.map((function(t){return e.loadExternalResourceAuth09(t,n,r,o,i,a,s,u,l,c)}));Promise.all(h).then((function(){p(t)})).catch((function(e){f(e)}))}))},e.loadExternalResourceAuth09=function(t,n,r,o,i,a,u,l,c,p){return new Promise((function(f,h){p&&p.pessimisticAccessControl?t.getData().then((function(){t.isAccessControlled()?t.clickThroughService?(f(r(t)),f(o(t))):i(t).then((function(){a(t,!0).then((function(n){t.getData(n).then((function(){f(c(t))})).catch((function(t){h(e.createInternalServerError(t))}))})).catch((function(t){h(e.createInternalServerError(t))}))})).catch((function(t){h(e.createInternalServerError(t))})):f(t)})).catch((function(t){h(e.createInternalServerError(t))})):l(t,n).then((function(p){p?t.getData(p).then((function(){t.status===s.OK?f(c(t)):e.authorize(t,n,r,o,i,a,u,l).then((function(){f(c(t))})).catch((function(t){h(e.createAuthorizationFailedError())}))})).catch((function(t){h(e.createAuthorizationFailedError())})):e.authorize(t,n,r,o,i,a,u,l).then((function(){f(c(t))})).catch((function(t){h(e.createAuthorizationFailedError())}))})).catch((function(t){h(e.createAuthorizationFailedError())}))}))},e.createError=function(e,t){var n=new Error;return n.message=t,n.name=String(e),n},e.createAuthorizationFailedError=function(){return e.createError(i.StatusCode.AUTHORIZATION_FAILED,"Authorization failed")},e.createRestrictedError=function(){return e.createError(i.StatusCode.RESTRICTED,"Restricted")},e.createInternalServerError=function(t){return e.createError(i.StatusCode.INTERNAL_SERVER_ERROR,t)},e.authorize=function(t,n,r,o,i,a,u,l){return new Promise((function(c,p){t.getData().then((function(){t.isAccessControlled()?l(t,n).then((function(l){l?t.getData(l).then((function(){t.status===s.OK?c(t):e.showAuthInteraction(t,n,r,o,i,a,u,c,p)})).catch((function(t){p(e.createInternalServerError(t))})):a(t,!1).then((function(l){l?u(t,l,n).then((function(){t.getData(l).then((function(){t.status===s.OK?c(t):e.showAuthInteraction(t,n,r,o,i,a,u,c,p)})).catch((function(t){p(e.createInternalServerError(t))}))})).catch((function(t){p(e.createInternalServerError(t))})):e.showAuthInteraction(t,n,r,o,i,a,u,c,p)}))})).catch((function(t){p(e.createInternalServerError(t))})):c(t)}))}))},e.showAuthInteraction=function(t,n,r,o,i,a,u,l,c){t.status!==s.MOVED_TEMPORARILY||t.isResponseHandled?t.clickThroughService&&!t.isResponseHandled?r(t).then((function(){a(t,!0).then((function(r){u(t,r,n).then((function(){t.getData(r).then((function(){l(t)})).catch((function(t){c(e.createInternalServerError(t))}))})).catch((function(t){c(e.createInternalServerError(t))}))})).catch((function(t){c(e.createInternalServerError(t))}))})):i(t).then((function(){a(t,!0).then((function(r){u(t,r,n).then((function(){t.getData(r).then((function(){l(t)})).catch((function(t){c(e.createInternalServerError(t))}))})).catch((function(t){c(e.createInternalServerError(t))}))})).catch((function(t){c(e.createInternalServerError(t))}))})):l(t)},e.getService=function(e,t){for(var n=this.getServices(e),r=0;r<n.length;r++){var o=n[r];if(o.getProfile()===t)return o}return null},e.getResourceById=function(t,n){return e.traverseAndFind(t.__jsonld,"@id",n)},e.traverseAndFind=function(t,n,r){if(t.hasOwnProperty(n)&&t[n]===r)return t;for(var o=0;o<Object.keys(t).length;o++)if("object"==typeof t[Object.keys(t)[o]]){var i=e.traverseAndFind(t[Object.keys(t)[o]],n,r);if(null!=i)return i}},e.getServices=function(t,n){var r=void 0===n?{}:n,o=r.onlyService,a=void 0!==o&&o,s=r.onlyServices,u=void 0!==s&&s,l=r.skipParentResources,c=[];(void 0===l||!l)&&t&&t.options&&t.options.resource&&t.options.resource!==t&&c.push.apply(c,e.getServices(t.options.resource,{onlyServices:!0}));var p=u?[]:(t.__jsonld||t).service||[];if(Array.isArray(p)||(p=[p]),a||p.push.apply(p,(t.__jsonld||t).services||[]),0===p.length)return c;for(var f=0;f<p.length;f++){var h=p[f];if("string"==typeof h){var d=this.getResourceById(t.options.resource,h);d&&c.push(new i.Service(d.__jsonld||d,t.options))}else c.push(new i.Service(h,t.options))}return c},e.getTemporalComponent=function(e){var t=/t=([^&]+)/g.exec(e),n=null;return t&&t[1]&&(n=t[1].split(",")),n},e}();t.Utils=u},function(e,t,n){var r=n(19),o=n(20);e.exports=function e(t,n,i,a,s){var u=-1,l=t.length;for(i||(i=o),s||(s=[]);++u<l;){var c=t[u];n>0&&i(c)?n>1?e(c,n-1,i,a,s):r(s,c):a||(s[s.length]=c)}return s}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){"use strict";n.r(t),t.default=function(e,t){return t=t||{},new Promise((function(n,r){var o=new XMLHttpRequest,i=[],a=[],s={},u=function(){return{ok:2==(o.status/100|0),statusText:o.statusText,status:o.status,url:o.responseURL,text:function(){return Promise.resolve(o.responseText)},json:function(){return Promise.resolve(JSON.parse(o.responseText))},blob:function(){return Promise.resolve(new Blob([o.response]))},clone:u,headers:{keys:function(){return i},entries:function(){return a},get:function(e){return s[e.toLowerCase()]},has:function(e){return e.toLowerCase()in s}}}};for(var l in o.open(t.method||"get",e,!0),o.onload=function(){o.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,n){i.push(t=t.toLowerCase()),a.push([t,n]),s[t]=s[t]?s[t]+","+n:n})),n(u())},o.onerror=r,o.withCredentials="include"==t.credentials,t.headers)o.setRequestHeader(l,t.headers[l]);o.send(t.body||null)}))}},function(e,t,n){e.exports=n(8)},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.parseManifest=t.loadManifest=void 0,o(n(0),t);var i=n(3);t.loadManifest=function(e){return i.Utils.loadManifest(e)},t.parseManifest=function(e,t){return i.Utils.parseManifest(e,t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JSONLDResource=void 0;var r=function(){function e(e){this.__jsonld=e,this.context=this.getProperty("context"),this.id=this.getProperty("id")}return e.prototype.getProperty=function(e){var t=null;return this.__jsonld&&((t=this.__jsonld[e])||(t=this.__jsonld["@"+e])),t},e}();t.JSONLDResource=r},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.ManifestResource=void 0;var i=n(0),a=n(1),s=function(e){function t(t,n){var r=e.call(this,t)||this;return r.options=n,r}return o(t,e),t.prototype.getIIIFResourceType=function(){return i.Utils.normaliseType(this.getProperty("type"))},t.prototype.getLabel=function(){var e=this.getProperty("label");return e?i.PropertyValue.parse(e,this.options.locale):new i.PropertyValue([],this.options.locale)},t.prototype.getDefaultLabel=function(){return this.getLabel().getValue(this.options.locale)},t.prototype.getMetadata=function(){var e=this.getProperty("metadata"),t=[];if(!e)return t;for(var n=0;n<e.length;n++){var r=e[n],o=new i.LabelValuePair(this.options.locale);o.parse(r),t.push(o)}return t},t.prototype.getRendering=function(e){for(var t=this.getRenderings(),n=0;n<t.length;n++){var r=t[n];if(r.getFormat()===e)return r}return null},t.prototype.getRenderings=function(){var e,t=[];if(!(e=this.__jsonld?this.__jsonld.rendering:this.rendering))return t;Array.isArray(e)||(e=[e]);for(var n=0;n<e.length;n++){var r=e[n];t.push(new i.Rendering(r,this.options))}return t},t.prototype.getRequiredStatement=function(){var e=null,t=this.getProperty("requiredStatement");return t&&(e=new i.LabelValuePair(this.options.locale)).parse(t),e},t.prototype.getService=function(e){return i.Utils.getService(this,e)},t.prototype.getServices=function(){return i.Utils.getServices(this)},t.prototype.getThumbnail=function(){var e=this.getProperty("thumbnail");return Array.isArray(e)&&(e=e[0]),e?new i.Thumbnail(e,this.options):null},t.prototype.isAnnotation=function(){return this.getIIIFResourceType()===a.IIIFResourceType.ANNOTATION},t.prototype.isCanvas=function(){return this.getIIIFResourceType()===a.IIIFResourceType.CANVAS},t.prototype.isCollection=function(){return this.getIIIFResourceType()===a.IIIFResourceType.COLLECTION},t.prototype.isManifest=function(){return this.getIIIFResourceType()===a.IIIFResourceType.MANIFEST},t.prototype.isRange=function(){return this.getIIIFResourceType()===a.IIIFResourceType.RANGE},t.prototype.isSequence=function(){return this.getIIIFResourceType()===a.IIIFResourceType.SEQUENCE},t}(i.JSONLDResource);t.ManifestResource=s},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Resource=void 0;var i=n(0),a=function(e){function t(t,n){return e.call(this,t,n)||this}return o(t,e),t.prototype.getFormat=function(){var e=this.getProperty("format");return e?e.toLowerCase():null},t.prototype.getResources=function(){var e=[];if(!this.__jsonld.resources)return e;for(var t=0;t<this.__jsonld.resources.length;t++){var n=this.__jsonld.resources[t],r=new i.Annotation(n,this.options);e.push(r)}return e},t.prototype.getType=function(){var e=this.getProperty("type");return e?i.Utils.normaliseType(e):null},t.prototype.getWidth=function(){return this.getProperty("width")},t.prototype.getHeight=function(){return this.getProperty("height")},t.prototype.getMaxWidth=function(){return this.getProperty("maxWidth")},t.prototype.getMaxHeight=function(){return this.getProperty("maxHeight")?null:this.getMaxWidth()},t}(i.ManifestResource);t.Resource=a},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.IIIFResource=void 0;var i=n(0),a=n(1),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;r.index=-1,r.isLoaded=!1;var o={defaultLabel:"-",locale:"en-GB",resource:r,pessimisticAccessControl:!1};return r.options=Object.assign(o,n),r}return o(t,e),t.prototype.getAttribution=function(){var e=this.getProperty("attribution");return e?i.PropertyValue.parse(e,this.options.locale):new i.PropertyValue([],this.options.locale)},t.prototype.getDescription=function(){var e=this.getProperty("description");return e?i.PropertyValue.parse(e,this.options.locale):new i.PropertyValue([],this.options.locale)},t.prototype.getHomepage=function(){var e=this.getProperty("homepage");return e?"string"==typeof e?e:(Array.isArray(e)&&e.length&&(e=e[0]),e["@id"]||e.id):null},t.prototype.getIIIFResourceType=function(){return i.Utils.normaliseType(this.getProperty("type"))},t.prototype.getLogo=function(){var e=this.getProperty("logo");if(!e){var t=this.getProperty("provider");if(!t)return null;var n=t.find((function(e){return void 0!==e.logo}));e=n&&void 0!==n.logo?n.logo:null}return e?"string"==typeof e?e:(Array.isArray(e)&&e.length&&(e=e[0]),e["@id"]||(null==e?void 0:e.id)):null},t.prototype.getLicense=function(){return i.Utils.getLocalisedValue(this.getProperty("license"),this.options.locale)},t.prototype.getRights=function(){var e=this.getProperty("rights");return e?"string"==typeof e?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(a.ServiceProfile.TRACKING_EXTENSIONS);return e?e.getProperty("trackingLabel"):""},t.prototype.getDefaultTree=function(){return this.defaultTree=new i.TreeNode("root"),this.defaultTree.data=this,this.defaultTree},t.prototype.getRequiredStatement=function(){var e=null,t=this.getProperty("requiredStatement");if(t)(e=new i.LabelValuePair(this.options.locale)).parse(t);else{var n=this.getAttribution();n&&n.length&&((e=new i.LabelValuePair(this.options.locale)).value=n)}return e},t.prototype.isCollection=function(){return this.getIIIFResourceType()===a.IIIFResourceType.COLLECTION},t.prototype.isManifest=function(){return this.getIIIFResourceType()===a.IIIFResourceType.MANIFEST},t.prototype.load=function(){var e=this;return new Promise((function(t){if(e.isLoaded)t(e);else{var n=e.options;n.navDate=e.getNavDate();var r=e.__jsonld.id;r||(r=e.__jsonld["@id"]),i.Utils.loadManifest(r).then((function(r){e.parentLabel=e.getLabel().getValue(n.locale);var o=i.Deserialiser.parse(r,n);(e=Object.assign(e,o)).index=n.index,t(e)}))}}))},t}(i.ManifestResource);t.IIIFResource=s},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Annotation=void 0;var i=n(0),a=function(e){function t(t,n){return e.call(this,t,n)||this}return o(t,e),t.prototype.getBody=function(){var e=[],t=this.getProperty("body");if(t)if(Array.isArray(t))for(var n=0;n<t.length;n++)if((a=t[n]).items)for(var r=0;r<a.items.length;r++){var o=a.items[r];e.push(new i.AnnotationBody(o,this.options))}else e.push(new i.AnnotationBody(a,this.options));else if(t.items)for(n=0;n<t.items.length;n++){var a=t.items[n];e.push(new i.AnnotationBody(a,this.options))}else e.push(new i.AnnotationBody(t,this.options));return e},t.prototype.getMotivation=function(){return this.getProperty("motivation")||null},t.prototype.getOn=function(){return this.getProperty("on")},t.prototype.getTarget=function(){return this.getProperty("target")},t.prototype.getResource=function(){return new i.Resource(this.getProperty("resource"),this.options)},t}(i.ManifestResource);t.Annotation=a},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationBody=void 0;var i=n(0),a=function(e){function t(t,n){return e.call(this,t,n)||this}return o(t,e),t.prototype.getFormat=function(){var e=this.getProperty("format");return e?i.Utils.getMediaType(e):null},t.prototype.getType=function(){return this.getProperty("type")?i.Utils.normaliseType(this.getProperty("type")):null},t.prototype.getWidth=function(){return this.getProperty("width")},t.prototype.getHeight=function(){return this.getProperty("height")},t}(i.ManifestResource);t.AnnotationBody=a},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationList=void 0;var i=n(0),a=function(e){function t(t,n,r){var o=e.call(this,n)||this;return o.label=t,o.options=r,o}return o(t,e),t.prototype.getIIIFResourceType=function(){return i.Utils.normaliseType(this.getProperty("type"))},t.prototype.getLabel=function(){return this.label},t.prototype.getResources=function(){var e=this;return this.getProperty("resources").map((function(t){return new i.Annotation(t,e.options)}))},t.prototype.load=function(){var e=this;return new Promise((function(t,n){if(e.isLoaded)t(e);else{var r=e.__jsonld.id;r||(r=e.__jsonld["@id"]),i.Utils.loadManifest(r).then((function(n){e.__jsonld=n,e.context=e.getProperty("context"),e.id=e.getProperty("id"),e.isLoaded=!0,t(e)})).catch(n)}}))},t}(i.JSONLDResource);t.AnnotationList=a},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationPage=void 0;var i=function(e){function t(t,n){return e.call(this,t,n)||this}return o(t,e),t.prototype.getItems=function(){return this.getProperty("items")},t}(n(0).ManifestResource);t.AnnotationPage=i},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Canvas=void 0;var a=n(1),s=n(0),u=i(n(18)),l=i(n(30)),c=function(e){function t(t,n){return e.call(this,t,n)||this}return o(t,e),t.prototype.getCanonicalImageUri=function(e){var t,n=null,r="default",o=e;if(this.externalResource&&this.externalResource.data&&this.externalResource.data["@id"])n=this.externalResource.data["@id"],o||(o=this.externalResource.data.width),this.externalResource.data["@context"]&&(this.externalResource.data["@context"].indexOf("/1.0/context.json")>-1||this.externalResource.data["@context"].indexOf("/1.1/context.json")>-1||this.externalResource.data["@context"].indexOf("/1/context.json")>-1)&&(r="native");else{var i=void 0;if((i=this.getImages())&&i.length){var a=i[0].getResource(),u=a.getServices();if(o||(o=a.getWidth()),l=u?u.find((function(e){return s.Utils.isImageProfile(e.getProfile())||s.Utils.isImageServiceType(e.getIIIFResourceType())})):null)n=l.id,r=s.Utils.getImageQuality(l.getProfile());else if(o===a.getWidth())return a.id}if((i=this.getContent())&&i.length){var l,c=i[0].getBody()[0];if(u=c.getServices(),o||(o=c.getWidth()),l=u?u.find((function(e){return s.Utils.isImageServiceType(e.getIIIFResourceType())})):null)n=l.id,r=s.Utils.getImageQuality(l.getProfile());else if(o===c.getWidth())return c.id}if(!n){var p=this.getProperty("thumbnail");if(p){if("string"==typeof p)return p;if(p["@id"])return p["@id"];if(p.length)return p[0].id}}}return t=o+",",n&&n.endsWith("/")&&(n=n.substr(0,n.length-1)),[n,"full",t,0,r+".jpg"].join("/")},t.prototype.getMaxDimensions=function(){var e,t=null;return this.externalResource&&this.externalResource.data&&this.externalResource.data.profile&&(e=this.externalResource.data.profile,Array.isArray(e)&&(e=e.filter((function(e){var t;return null!==(t=e.maxWidth)&&void 0!==t?t:e.maxwidth}))[0])&&(t=new s.Size(e.maxWidth,e.maxHeight?e.maxHeight:e.maxWidth))),t},t.prototype.getContent=function(){var e=[],t=this.__jsonld.items||this.__jsonld.content;if(!t)return e;var n=null;if(t.length&&(n=new s.AnnotationPage(t[0],this.options)),!n)return e;for(var r=n.getItems(),o=0;o<r.length;o++){var i=r[o],a=new s.Annotation(i,this.options);e.push(a)}return e},t.prototype.getDuration=function(){return this.getProperty("duration")},t.prototype.getImages=function(){var e=[];if(!this.__jsonld.images)return e;for(var t=0;t<this.__jsonld.images.length;t++){var n=this.__jsonld.images[t],r=new s.Annotation(n,this.options);e.push(r)}return e},t.prototype.getIndex=function(){return this.getProperty("index")},t.prototype.getOtherContent=function(){var e=this,t=(Array.isArray(this.getProperty("otherContent"))?this.getProperty("otherContent"):[this.getProperty("otherContent")]).filter((function(e){return e&&"string"==typeof(t=e["@type"])&&t.toLowerCase()==t.toLowerCase();var t})).map((function(t,n){return new s.AnnotationList(t.label||"Annotation list ".concat(n),t,e.options)})).map((function(e){return e.load()}));return Promise.all(t)},t.prototype.getWidth=function(){return this.getProperty("width")},t.prototype.getHeight=function(){return this.getProperty("height")},t.prototype.getViewingHint=function(){return this.getProperty("viewingHint")},Object.defineProperty(t.prototype,"imageResources",{get:function(){var e=this,n=(0,l.default)([this.getImages().map((function(e){return e.getResource()})),this.getContent().map((function(e){return e.getBody()}))]);return(0,u.default)(n.map((function(n){switch(n.getProperty("type").toLowerCase()){case a.ExternalResourceType.CHOICE:case a.ExternalResourceType.OA_CHOICE:return new t({images:(0,u.default)([n.getProperty("default"),n.getProperty("item")]).map((function(e){return{resource:e}}))},e.options).getImages().map((function(e){return e.getResource()}));default:return n}})))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resourceAnnotations",{get:function(){return(0,l.default)([this.getImages(),this.getContent()])},enumerable:!1,configurable:!0}),t.prototype.resourceAnnotation=function(e){return this.resourceAnnotations.find((function(t){return t.getResource().id===e||(0,u.default)(new Array(t.getBody())).some((function(t){return t.id===e}))}))},t.prototype.onFragment=function(e){var t=this.resourceAnnotation(e);if(t){var n=t.getProperty("on"),r=t.getProperty("target");if(n&&r){var o=(n||r).match(/xywh=(.*)$/);if(o)return o[1].split(",").map((function(e){return parseInt(e,10)}))}}},Object.defineProperty(t.prototype,"iiifImageResources",{get:function(){return this.imageResources.filter((function(e){return e&&e.getServices()[0]&&e.getServices()[0].id}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"imageServiceIds",{get:function(){return this.iiifImageResources.map((function(e){return e.getServices()[0].id}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"aspectRatio",{get:function(){return this.getWidth()/this.getHeight()},enumerable:!1,configurable:!0}),t}(s.Resource);t.Canvas=c},function(e,t,n){var r=n(4);e.exports=function(e){return null!=e&&e.length?r(e,1):[]}},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},function(e,t,n){var r=n(2),o=n(24),i=n(29),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return i(e)||o(e)||!!(a&&e&&e[a])}},function(e,t,n){var r=n(22),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(23))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(25),o=n(5),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(e){return o(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},function(e,t,n){var r=n(26),o=n(5);e.exports=function(e){return o(e)&&"[object Arguments]"==r(e)}},function(e,t,n){var r=n(2),o=n(27),i=n(28),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},function(e,t,n){var r=n(2),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[s]=n:delete e[s]),o}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){var r=n(4);e.exports=function(e){return null!=e&&e.length?r(e,1/0):[]}},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Collection=void 0;var i=n(1),a=n(0),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.items=[],r._collections=null,r._manifests=null,t.__collection=r,r}return o(t,e),t.prototype.getCollections=function(){return this._collections?this._collections:this._collections=this.items.filter((function(e){return e.isCollection()}))},t.prototype.getManifests=function(){return this._manifests?this._manifests:this._manifests=this.items.filter((function(e){return e.isManifest()}))},t.prototype.getCollectionByIndex=function(e){for(var t,n=this.getCollections(),r=0;r<n.length;r++){var o=n[r];o.index===e&&(t=o)}if(t)return t.options.index=e,t.load();throw new Error("Collection index not found")},t.prototype.getManifestByIndex=function(e){for(var t,n=this.getManifests(),r=0;r<n.length;r++){var o=n[r];o.index===e&&(t=o)}if(t)return t.options.index=e,t.load();throw new Error("Manifest index not found")},t.prototype.getTotalCollections=function(){return this.getCollections().length},t.prototype.getTotalManifests=function(){return this.getManifests().length},t.prototype.getTotalItems=function(){return this.items.length},t.prototype.getViewingDirection=function(){return this.getProperty("viewingDirection")?this.getProperty("viewingDirection"):i.ViewingDirection.LEFT_TO_RIGHT},t.prototype.getBehavior=function(){var e=this.getProperty("behavior");return Array.isArray(e)&&(e=e[0]),e||null},t.prototype.getViewingHint=function(){return this.getProperty("viewingHint")},t.prototype.getDefaultTree=function(){return e.prototype.getDefaultTree.call(this),this.defaultTree.data.type=a.Utils.normaliseType(a.TreeNodeType.COLLECTION),this._parseManifests(this),this._parseCollections(this),a.Utils.generateTreeNodeIds(this.defaultTree),this.defaultTree},t.prototype._parseManifests=function(e){if(e.getManifests()&&e.getManifests().length)for(var t=0;t<e.getManifests().length;t++){var n=e.getManifests()[t],r=n.getDefaultTree();r.label=n.parentLabel||n.getLabel().getValue(this.options.locale)||"manifest "+(t+1),r.navDate=n.getNavDate(),r.data.id=n.id,r.data.type=a.Utils.normaliseType(a.TreeNodeType.MANIFEST),e.defaultTree.addNode(r)}},t.prototype._parseCollections=function(e){if(e.getCollections()&&e.getCollections().length)for(var t=0;t<e.getCollections().length;t++){var n=e.getCollections()[t],r=n.getDefaultTree();r.label=n.parentLabel||n.getLabel().getValue(this.options.locale)||"collection "+(t+1),r.navDate=n.getNavDate(),r.data.id=n.id,r.data.type=a.Utils.normaliseType(a.TreeNodeType.COLLECTION),e.defaultTree.addNode(r)}},t}(a.IIIFResource);t.Collection=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Duration=void 0;var r=function(){function e(e,t){this.start=e,this.end=t}return e.prototype.getLength=function(){return this.end-this.start},e}();t.Duration=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LabelValuePair=void 0;var r=n(0),o=function(){function e(e){this.defaultLocale=e}return e.prototype.parse=function(e){this.resource=e,this.label=r.PropertyValue.parse(this.resource.label,this.defaultLocale),this.value=r.PropertyValue.parse(this.resource.value,this.defaultLocale)},e.prototype.getLabel=function(e){return null===this.label?null:(Array.isArray(e)&&!e.length&&(e=void 0),this.label.getValue(e||this.defaultLocale))},e.prototype.setLabel=function(e){null===this.label&&(this.label=new r.PropertyValue([])),this.label.setValue(e,this.defaultLocale)},e.prototype.getValue=function(e,t){return void 0===t&&(t="<br/>"),null===this.value?null:(Array.isArray(e)&&!e.length&&(e=void 0),this.value.getValue(e||this.defaultLocale,t))},e.prototype.getValues=function(e){return null===this.value?[]:(Array.isArray(e)&&!e.length&&(e=void 0),this.value.getValues(e||this.defaultLocale))},e.prototype.setValue=function(e){null===this.value&&(this.value=new r.PropertyValue([])),this.value.setValue(e,this.defaultLocale)},e}();t.LabelValuePair=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageMap=void 0;var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.getValue=function(e,t){return e.getValue(t,"<br/>")},t.getValues=function(e,t){return e.getValues(t)},t}(Array);t.LanguageMap=i},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyValue=t.LocalizedValue=void 0;var i=n(3),a=function(){function e(e,t,n){void 0===n&&(n="none"),Array.isArray(e)&&1===e.length?this._value=e[0]:this._value=e,"none"!==t&&"@none"!==t||(t=void 0),this._locale=t,this._defaultLocale=n}return e.parseV2Value=function(t,n){return"string"==typeof t?new e(t,void 0,n):t["@value"]?new e(t["@value"],t["@language"],n):null},Object.defineProperty(e.prototype,"value",{get:function(){return Array.isArray(this._value)?this._value.join("<br/>"):this._value},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"locale",{get:function(){return void 0===this._locale?this._defaultLocale:this._locale},enumerable:!1,configurable:!0}),e.prototype.addValue=function(e){Array.isArray(this._value)||(this._value=[this._value]),Array.isArray(e)?this._value=this._value.concat(e):this._value.push(e)},e}();t.LocalizedValue=a;var s=function(e){function t(n,r){void 0===n&&(n=[]);var o=e.apply(this,n)||this;return o.__proto__=t.prototype,o._defaultLocale=r,o}return o(t,e),t.parse=function(e,n){if(!e)return new t([],n);if(Array.isArray(e)){var r=(o=e.map((function(e){return a.parseV2Value(e,n)})).filter((function(e){return null!==e}))).reduce((function(e,t){var n=t._locale;return n||(n="none"),e[n]?e[n].addValue(t._value):e[n]=t,e}),{});return new t(Object.values(r),n)}return"string"==typeof e?new t([new a(e,void 0,n)],n):e["@language"]||e["@value"]?new t(null!==(o=a.parseV2Value(e))?[o]:[],n):new t(Object.keys(e).map((function(t){var r=e[t];if(!Array.isArray(r))throw new Error("A IIIF v3 localized property value must have an array as the value for a given language.");return new a(r,t,n)})),n);var o},t.prototype.getSuitableLocale=function(e){for(var t=Array.from(this.values()).map((function(e){return e._locale})).filter((function(e){return void 0!==e})),n=function(e){var n=t.find((function(t){return t===e}));if(n)return{value:n}},r=0,o=e;r<o.length;r++){var a=n(o[r]);if("object"==typeof a)return a.value}for(var s=function(e){var n=t.find((function(t){return i.Utils.getInexactLocale(t)===i.Utils.getInexactLocale(e)}));if(n)return{value:n}},u=0,l=e;u<l.length;u++){var c=s(l[u]);if("object"==typeof c)return c.value}},t.prototype.setValue=function(e,t){var n=void 0;if(t){var r=this.getSuitableLocale([t]);r&&(n=this.find((function(e){return e._locale===r})))}else n=this.find((function(e){return void 0===e._locale}));n?n._value=e:this.push(new a(e,t,this._defaultLocale))},t.prototype.getValue=function(e,t){var n=this.getValues(e);return 0===n.length?null:t?n.join(t):n[0]},t.prototype.getValues=function(e){if(!this.length)return[];var t;if(t=e?Array.isArray(e)?e:[e]:[],1===this.length&&void 0===this[0]._locale){var n=this[0]._value;return Array.isArray(n)?n:[n]}var r=this.getSuitableLocale(t);if(r)return n=this.find((function(e){return e._locale===r}))._value,Array.isArray(n)?n:[n];if(!this.find((function(e){return void 0===e._locale})))return n=this[0]._value,Array.isArray(n)?n:[n];var o=this.find((function(e){return void 0===e._locale}));return o?Array.isArray(o._value)?o._value:[o._value]:[]},t}(Array);t.PropertyValue=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CONTINUE=100,t.SWITCHING_PROTOCOLS=101,t.PROCESSING=102,t.OK=200,t.CREATED=201,t.ACCEPTED=202,t.NON_AUTHORITATIVE_INFORMATION=203,t.NO_CONTENT=204,t.RESET_CONTENT=205,t.PARTIAL_CONTENT=206,t.MULTI_STATUS=207,t.MULTIPLE_CHOICES=300,t.MOVED_PERMANENTLY=301,t.MOVED_TEMPORARILY=302,t.SEE_OTHER=303,t.NOT_MODIFIED=304,t.USE_PROXY=305,t.TEMPORARY_REDIRECT=307,t.BAD_REQUEST=400,t.UNAUTHORIZED=401,t.PAYMENT_REQUIRED=402,t.FORBIDDEN=403,t.NOT_FOUND=404,t.METHOD_NOT_ALLOWED=405,t.NOT_ACCEPTABLE=406,t.PROXY_AUTHENTICATION_REQUIRED=407,t.REQUEST_TIME_OUT=408,t.CONFLICT=409,t.GONE=410,t.LENGTH_REQUIRED=411,t.PRECONDITION_FAILED=412,t.REQUEST_ENTITY_TOO_LARGE=413,t.REQUEST_URI_TOO_LARGE=414,t.UNSUPPORTED_MEDIA_TYPE=415,t.REQUESTED_RANGE_NOT_SATISFIABLE=416,t.EXPECTATION_FAILED=417,t.IM_A_TEAPOT=418,t.UNPROCESSABLE_ENTITY=422,t.LOCKED=423,t.FAILED_DEPENDENCY=424,t.UNORDERED_COLLECTION=425,t.UPGRADE_REQUIRED=426,t.PRECONDITION_REQUIRED=428,t.TOO_MANY_REQUESTS=429,t.REQUEST_HEADER_FIELDS_TOO_LARGE=431,t.INTERNAL_SERVER_ERROR=500,t.NOT_IMPLEMENTED=501,t.BAD_GATEWAY=502,t.SERVICE_UNAVAILABLE=503,t.GATEWAY_TIME_OUT=504,t.HTTP_VERSION_NOT_SUPPORTED=505,t.VARIANT_ALSO_NEGOTIATES=506,t.INSUFFICIENT_STORAGE=507,t.BANDWIDTH_LIMIT_EXCEEDED=509,t.NOT_EXTENDED=510,t.NETWORK_AUTHENTICATION_REQUIRED=511},function(e,t,n){e.exports=window.fetch||(window.fetch=n(6).default||n(6))},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Manifest=void 0;var i=n(1),a=n(0),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;if(r.index=0,r._allRanges=null,r.items=[],r._topRanges=[],r.__jsonld.structures&&r.__jsonld.structures.length)for(var o=r._getTopRanges(),i=0;i<o.length;i++){var a=o[i];r._parseRanges(a,String(i))}return r}return o(t,e),t.prototype.getPosterCanvas=function(){var e=this.getProperty("posterCanvas");return e&&(e=new a.Canvas(e,this.options)),e},t.prototype.getAccompanyingCanvas=function(){var e=this.getProperty("accompanyingCanvas");return e&&(e=new a.Canvas(e,this.options)),e},t.prototype.getBehavior=function(){var e=this.getProperty("behavior");return Array.isArray(e)&&(e=e[0]),e||null},t.prototype.getDefaultTree=function(){if(e.prototype.getDefaultTree.call(this),this.defaultTree.data.type=a.Utils.normaliseType(a.TreeNodeType.MANIFEST),!this.isLoaded)return this.defaultTree;var t=this.getTopRanges();return t.length&&t[0].getTree(this.defaultTree),a.Utils.generateTreeNodeIds(this.defaultTree),this.defaultTree},t.prototype._getTopRanges=function(){var e=[];if(this.__jsonld.structures&&this.__jsonld.structures.length){for(var t=0;t<this.__jsonld.structures.length;t++){var n=this.__jsonld.structures[t];n.viewingHint===i.ViewingHint.TOP&&e.push(n)}if(!e.length){var r={};r.ranges=this.__jsonld.structures,e.push(r)}}return e},t.prototype.getTopRanges=function(){return this._topRanges},t.prototype._getRangeById=function(e){if(this.__jsonld.structures&&this.__jsonld.structures.length)for(var t=0;t<this.__jsonld.structures.length;t++){var n=this.__jsonld.structures[t];if(n["@id"]===e||n.id===e)return n}return null},t.prototype._parseRanges=function(e,t,n){var r,o=null;if("string"==typeof e&&(o=e,e=this._getRangeById(o)),e){(r=new a.Range(e,this.options)).parentRange=n,r.path=t,n?n.items.push(r):this._topRanges.push(r);var i=e.items||e.members;if(i)for(var s=0;s<i.length;s++){var u=i[s];if(u["@type"]&&"sc:range"===u["@type"].toLowerCase()||u.type&&"range"===u.type.toLowerCase())this._parseRanges(u,t+"/"+s,r);else if(u["@type"]&&"sc:canvas"===u["@type"].toLowerCase()||u.type&&"canvas"===u.type.toLowerCase()){r.canvases||(r.canvases=[]);var l=u.id||u["@id"];r.canvases.push(l)}}else if(e.ranges)for(s=0;s<e.ranges.length;s++)this._parseRanges(e.ranges[s],t+"/"+s,r)}else console.warn("Range:",o,"does not exist")},t.prototype.getAllRanges=function(){if(null!=this._allRanges)return this._allRanges;this._allRanges=[];for(var e=this.getTopRanges(),t=function(t){var r=e[t];r.id&&n._allRanges.push(r);var o=function(e,t){e.add(t);var n=t.getRanges();return n.length?n.reduce(o,e):e},i=Array.from(r.getRanges().reduce(o,new Set));n._allRanges=n._allRanges.concat(i)},n=this,r=0;r<e.length;r++)t(r);return this._allRanges},t.prototype.getRangeById=function(e){for(var t=this.getAllRanges(),n=0;n<t.length;n++){var r=t[n];if(r.id===e)return r}return null},t.prototype.getRangeByPath=function(e){for(var t=this.getAllRanges(),n=0;n<t.length;n++){var r=t[n];if(r.path===e)return r}return null},t.prototype.getSequences=function(){if(this.items.length)return this.items;var e=this.__jsonld.mediaSequences||this.__jsonld.sequences;if(e)for(var t=0;t<e.length;t++){var n=e[t],r=new a.Sequence(n,this.options);this.items.push(r)}else this.__jsonld.items&&(r=new a.Sequence(this.__jsonld.items,this.options),this.items.push(r));return this.items},t.prototype.getSequenceByIndex=function(e){return this.getSequences()[e]},t.prototype.getTotalSequences=function(){return this.getSequences().length},t.prototype.getManifestType=function(){var e=this.getService(i.ServiceProfile.UI_EXTENSIONS);return e?e.getProperty("manifestType"):a.ManifestType.EMPTY},t.prototype.isMultiSequence=function(){return this.getTotalSequences()>1},t.prototype.isPagingEnabled=function(){var e=this.getViewingHint();if(e)return e===i.ViewingHint.PAGED;var t=this.getBehavior();return!!t&&t===i.Behavior.PAGED},t.prototype.getViewingDirection=function(){return this.getProperty("viewingDirection")},t.prototype.getViewingHint=function(){return this.getProperty("viewingHint")},t}(a.IIIFResource);t.Manifest=s},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ManifestType=void 0,function(e){e.EMPTY="",e.MANUSCRIPT="manuscript",e.MONOGRAPH="monograph"}(r||(t.ManifestType=r={}))},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Range=void 0;var i=n(0),a=n(1),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._ranges=null,r.canvases=null,r.items=[],r}return o(t,e),t.prototype.getCanvasIds=function(){return this.__jsonld.canvases?this.__jsonld.canvases:this.canvases?this.canvases:[]},t.prototype.getDuration=function(){if(this.canvases&&this.canvases.length){for(var e=[],t=[],n=0,r=this.canvases;n<r.length;n++)if(d=r[n]){var o=d.match(/(.*)#t=([0-9.]+),?([0-9.]+)?/)||[void 0,d],a=o[1],s=o[2],u=o[3];a&&(e.push(parseFloat(s)),t.push(parseFloat(u)))}if(e.length&&t.length)return new i.Duration(Math.min.apply(Math,e),Math.max.apply(Math,t))}else{e=[],t=[];for(var l=0,c=g=this.getRanges();l<c.length;l++)(v=c[l].getDuration())&&(e.push(v.start),t.push(v.end));if(e.length&&t.length)return new i.Duration(Math.min.apply(Math,e),Math.max.apply(Math,t))}var p,f;if(this.canvases&&this.canvases.length)for(var h=0;h<this.canvases.length;h++){var d=this.canvases[h],_=i.Utils.getTemporalComponent(d);_&&_.length>1&&(0===h&&(p=Number(_[0])),h===this.canvases.length-1&&(f=Number(_[1])))}else{var g=this.getRanges();for(h=0;h<g.length;h++){var v;(v=g[h].getDuration())&&(0===h&&(p=v.start),h===g.length-1&&(f=v.end))}}if(void 0!==p&&void 0!==f)return new i.Duration(p,f)},t.prototype.getRanges=function(){return this._ranges?this._ranges:this._ranges=this.items.filter((function(e){return e.isRange()}))},t.prototype.getBehavior=function(){var e=this.getProperty("behavior");return Array.isArray(e)&&(e=e[0]),e||null},t.prototype.getViewingDirection=function(){return this.getProperty("viewingDirection")},t.prototype.getViewingHint=function(){return this.getProperty("viewingHint")},t.prototype.getTree=function(e){e.data=this,this.treeNode=e;var t=this.getRanges();if(t&&t.length)for(var n=0;n<t.length;n++){var r=t[n],o=new i.TreeNode;e.addNode(o),this._parseTreeNode(o,r)}return i.Utils.generateTreeNodeIds(e),e},t.prototype.spansTime=function(e){var t=this.getDuration();return!!(t&&e>=t.start&&e<=t.end)},t.prototype._parseTreeNode=function(e,t){e.label=t.getLabel().getValue(this.options.locale),e.data=t,e.data.type=i.Utils.normaliseType(i.TreeNodeType.RANGE),t.treeNode=e;var n=t.getRanges();if(n&&n.length)for(var r=0;r<n.length;r++){var o=n[r];if(o.getBehavior()!==a.Behavior.NO_NAV){var s=new i.TreeNode;e.addNode(s),this._parseTreeNode(s,o)}}},t}(i.ManifestResource);t.Range=s},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Rendering=void 0;var i=function(e){function t(t,n){return e.call(this,t,n)||this}return o(t,e),t.prototype.getFormat=function(){return this.getProperty("format")},t}(n(0).ManifestResource);t.Rendering=i},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Sequence=void 0;var i=n(1),a=n(0),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.items=[],r._thumbnails=null,r}return o(t,e),t.prototype.getCanvases=function(){if(this.items.length)return this.items;var e=this.__jsonld.canvases||this.__jsonld.elements;if(e)for(var t=0;t<e.length;t++){var n=e[t];(r=new a.Canvas(n,this.options)).index=t,this.items.push(r)}else if(this.__jsonld)for(t=0;t<this.__jsonld.length;t++){var r;n=this.__jsonld[t],(r=new a.Canvas(n,this.options)).index=t,this.items.push(r)}return this.items},t.prototype.getCanvasById=function(e){for(var t=0;t<this.getTotalCanvases();t++){var n=this.getCanvasByIndex(t),r=a.Utils.normaliseUrl(n.id);if(a.Utils.normaliseUrl(e)===r)return n}return null},t.prototype.getCanvasByIndex=function(e){return this.getCanvases()[e]},t.prototype.getCanvasIndexById=function(e){for(var t=0;t<this.getTotalCanvases();t++)if(this.getCanvasByIndex(t).id===e)return t;return null},t.prototype.getCanvasIndexByLabel=function(e,t){e=e.trim(),isNaN(e)||(e=parseInt(e,10).toString(),t&&(e+="r"));for(var n,r,o,i=/(\d*)\D+(\d*)/,a=0;a<this.getTotalCanvases();a++){var s=this.getCanvasByIndex(a);if(s.getLabel().getValue(this.options.locale)===e)return a;if((n=i.exec(e))&&(r=n[1],(o=n[2])&&new RegExp("^"+r+"\\D+"+o+"$").test(s.getLabel().toString())))return a}return-1},t.prototype.getLastCanvasLabel=function(e){for(var t=this.getTotalCanvases()-1;t>=0;t--){var n=this.getCanvasByIndex(t).getLabel().getValue(this.options.locale);if(e){if(/^[a-zA-Z0-9]*$/.test(n))return n}else if(n)return n}return this.options.defaultLabel},t.prototype.getLastPageIndex=function(){return this.getTotalCanvases()-1},t.prototype.getNextPageIndex=function(e,t){var n;if(t){var r=this.getPagedIndices(e),o=this.getViewingDirection();n=o&&o===i.ViewingDirection.RIGHT_TO_LEFT?r[0]+1:r[r.length-1]+1}else n=e+1;return n>this.getLastPageIndex()?-1:n},t.prototype.getPagedIndices=function(e,t){var n=[];if(t){n=this.isFirstCanvas(e)||this.isLastCanvas(e)?[e]:e%2?[e,e+1]:[e-1,e];var r=this.getViewingDirection();r&&r===i.ViewingDirection.RIGHT_TO_LEFT&&(n=n.reverse())}else n.push(e);return n},t.prototype.getPrevPageIndex=function(e,t){var n;if(t){var r=this.getPagedIndices(e),o=this.getViewingDirection();n=o&&o===i.ViewingDirection.RIGHT_TO_LEFT?r[r.length-1]-1:r[0]-1}else n=e-1;return n},t.prototype.getStartCanvasIndex=function(){var e=this.getStartCanvas();if(e)for(var t=0;t<this.getTotalCanvases();t++)if(this.getCanvasByIndex(t).id===e)return t;return 0},t.prototype.getThumbs=function(e,t){for(var n=[],r=this.getTotalCanvases(),o=0;o<r;o++){var i=this.getCanvasByIndex(o),s=new a.Thumb(e,i);n.push(s)}return n},t.prototype.getThumbnails=function(){if(null!=this._thumbnails)return this._thumbnails;this._thumbnails=[];for(var e=this.getCanvases(),t=0;t<e.length;t++){var n=e[t].getThumbnail();n&&this._thumbnails.push(n)}return this._thumbnails},t.prototype.getStartCanvas=function(){return this.getProperty("startCanvas")},t.prototype.getTotalCanvases=function(){return this.getCanvases().length},t.prototype.getViewingDirection=function(){return this.getProperty("viewingDirection")?this.getProperty("viewingDirection"):this.options.resource.getViewingDirection?this.options.resource.getViewingDirection():null},t.prototype.getViewingHint=function(){return this.getProperty("viewingHint")},t.prototype.isCanvasIndexOutOfRange=function(e){return e>this.getTotalCanvases()-1},t.prototype.isFirstCanvas=function(e){return 0===e},t.prototype.isLastCanvas=function(e){return e===this.getTotalCanvases()-1},t.prototype.isMultiCanvas=function(){return this.getTotalCanvases()>1},t.prototype.isPagingEnabled=function(){var e=this.getViewingHint();return!!e&&e===i.ViewingHint.PAGED},t.prototype.isTotalCanvasesEven=function(){return this.getTotalCanvases()%2==0},t}(a.ManifestResource);t.Sequence=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Deserialiser=void 0;var r=n(0),o=function(){function e(){}return e.parse=function(e,t){return"string"==typeof e&&(e=JSON.parse(e)),this.parseJson(e,t)},e.parseJson=function(e,t){var n;if(t&&t.navDate&&!isNaN(t.navDate.getTime())&&(e.navDate=t.navDate.toString()),e["@type"])switch(e["@type"]){case"sc:Collection":n=this.parseCollection(e,t);break;case"sc:Manifest":n=this.parseManifest(e,t);break;default:return null}else switch(e.type){case"Collection":n=this.parseCollection(e,t);break;case"Manifest":n=this.parseManifest(e,t);break;default:return null}return n.isLoaded=!0,n},e.parseCollection=function(e,t){var n=new r.Collection(e,t);return t?(n.index=t.index||0,t.resource&&(n.parentCollection=t.resource.parentCollection)):n.index=0,this.parseCollections(n,t),this.parseManifests(n,t),this.parseItems(n,t),n},e.parseCollections=function(e,t){var n;if(e.__jsonld.collections?n=e.__jsonld.collections:e.__jsonld.items&&(n=e.__jsonld.items.filter((function(e){return"collection"===e.type.toLowerCase()}))),n)for(var r=0;r<n.length;r++){t&&(t.index=r);var o=this.parseCollection(n[r],t);o.index=r,o.parentCollection=e,e.items.push(o)}},e.parseManifest=function(e,t){return new r.Manifest(e,t)},e.parseManifests=function(e,t){var n;if(e.__jsonld.manifests?n=e.__jsonld.manifests:e.__jsonld.items&&(n=e.__jsonld.items.filter((function(e){return"manifest"===e.type.toLowerCase()}))),n)for(var r=0;r<n.length;r++){var o=this.parseManifest(n[r],t);o.index=r,o.parentCollection=e,e.items.push(o)}},e.parseItem=function(e,t){if(e["@type"]){if("sc:manifest"===e["@type"].toLowerCase())return this.parseManifest(e,t);if("sc:collection"===e["@type"].toLowerCase())return this.parseCollection(e,t)}else if(e.type){if("manifest"===e.type.toLowerCase())return this.parseManifest(e,t);if("collection"===e.type.toLowerCase())return this.parseCollection(e,t)}return null},e.parseItems=function(e,t){var n=e.__jsonld.members||e.__jsonld.items;if(n)for(var r=function(r){t&&(t.index=r);var i=o.parseItem(n[r],t);return i?e.items.filter((function(e){return e.id===i.id}))[0]?"continue":(i.index=r,i.parentCollection=e,void e.items.push(i)):{value:void 0}},o=this,i=0;i<n.length;i++){var a=r(i);if("object"==typeof a)return a.value}},e}();t.Deserialiser=o},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Service=void 0;var i=n(0),a=function(e){function t(t,n){return e.call(this,t,n)||this}return o(t,e),t.prototype.getProfile=function(){var e=this.getProperty("profile");return e||(e=this.getProperty("dcterms:conformsTo")),Array.isArray(e)?e[0]:e},t.prototype.getConfirmLabel=function(){return i.Utils.getLocalisedValue(this.getProperty("confirmLabel"),this.options.locale)},t.prototype.getDescription=function(){return i.Utils.getLocalisedValue(this.getProperty("description"),this.options.locale)},t.prototype.getFailureDescription=function(){return i.Utils.getLocalisedValue(this.getProperty("failureDescription"),this.options.locale)},t.prototype.getFailureHeader=function(){return i.Utils.getLocalisedValue(this.getProperty("failureHeader"),this.options.locale)},t.prototype.getHeader=function(){return i.Utils.getLocalisedValue(this.getProperty("header"),this.options.locale)},t.prototype.getServiceLabel=function(){return i.Utils.getLocalisedValue(this.getProperty("label"),this.options.locale)},t.prototype.getInfoUri=function(){var e=this.id;return e.endsWith("/")||(e+="/"),e+"info.json"},t}(i.ManifestResource);t.Service=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Size=void 0,t.Size=function(e,t){this.width=e,this.height=t}},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.StatusCode=void 0,function(e){e[e.AUTHORIZATION_FAILED=1]="AUTHORIZATION_FAILED",e[e.FORBIDDEN=2]="FORBIDDEN",e[e.INTERNAL_SERVER_ERROR=3]="INTERNAL_SERVER_ERROR",e[e.RESTRICTED=4]="RESTRICTED"}(r||(t.StatusCode=r={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Thumb=void 0,t.Thumb=function(e,t){this.data=t,this.index=t.index,this.width=e;var n=t.getHeight()/t.getWidth();this.height=n?Math.floor(this.width*n):e,this.uri=t.getCanonicalImageUri(e),this.label=t.getLabel().getValue(),this.viewingHint=t.getViewingHint()}},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Thumbnail=void 0;var i=function(e){function t(t,n){return e.call(this,t,n)||this}return o(t,e),t}(n(0).Resource);t.Thumbnail=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TreeNode=void 0;var r=n(0),o=function(){function e(e,t){this.label=e,this.data=t||{},this.nodes=[]}return e.prototype.addNode=function(e){this.nodes.push(e),e.parentNode=this},e.prototype.isCollection=function(){return this.data.type===r.Utils.normaliseType(r.TreeNodeType.COLLECTION)},e.prototype.isManifest=function(){return this.data.type===r.Utils.normaliseType(r.TreeNodeType.MANIFEST)},e.prototype.isRange=function(){return this.data.type===r.Utils.normaliseType(r.TreeNodeType.RANGE)},e}();t.TreeNode=o},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TreeNodeType=void 0,function(e){e.COLLECTION="collection",e.MANIFEST="manifest",e.RANGE="range"}(r||(t.TreeNodeType=r={}))}])},function(e,t,n){"use strict";n.r(t),n.d(t,"BaseComponent",(function(){return r}));var r=function(){function e(e){this.options=e,this.options.data=Object.assign({},this.data(),e.data)}return e.prototype._init=function(){return this.el=this.options.target,this.el?(this.el.innerHTML="",!0):(console.warn("element not found"),!1)},e.prototype.data=function(){return{}},e.prototype.on=function(e,t,n){var r=this._e||(this._e={});(r[e]||(r[e]=[])).push({fn:t,ctx:n})},e.prototype.fire=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=[].slice.call(arguments,1),o=((this._e||(this._e={}))[e]||[]).slice(),i=0,a=o.length;i<a;i++)o[i].fn.apply(o[i].ctx,r)},e.prototype._resize=function(){},e.prototype.set=function(e){},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,s,u,l,c){return void 0===l&&(l="Less information: Hide {0}"),void 0===c&&(c="More information: Reveal {0}"),e.each((function(){var e=r(this),p=e.find(".label");e.find(".value").each((function(f,h){for(var d=r(h),_=d.html(),g=p.contents().filter((function(){return this.nodeType===Node.TEXT_NODE})).text().trim(),v=r('<span>… <a href="#" class="toggle more">morepad</a></span>'),y=[_],E=e.height();d.text().length>0;){a(d);var m=d.html();d.append(v);var I=d.height();void 0!==I&&void 0!==E&&E>I&&(y.unshift(m),E=d.height()),v.remove()}if(y.length<=t)d.html(_);else{var O=y[t-1],T=!1;d.toggle=function(){d.empty();var e=r('<a href="#" class="toggle"></a>');if(T){var t=o.Strings.format(l,g);d.html(_+" "),e.text(n),i(e,"less","more"),e.attr("aria-label",t)}else{var a=o.Strings.format(c,g);d.html(O+"… "),e.text(s),i(e,"more","less"),e.attr("aria-label",a)}e.one("click",(function(e){e.preventDefault(),d.toggle()})),T=!T,d.append(e),u&&u()},d.toggle()}}))}))};var o=n(0);function i(e,t,n){return e.each((function(){r(this).removeClass(t).addClass(n)}))}function a(e,t,n){return void 0===t&&(t=8),void 0===n&&(n=0),e.each((function(){var e=r(this);if(e.contents().length>0){var o=e.contents().last();if(3===o[0].nodeType){var i=o.text().trim().split(" ");if(i.length>1)return i.splice(i.length-1,1),void(o[0].data=i.join(" "));if(void 0!==t&&1===i.length&&i[0].length>t)return void(o[0].data=i.join(" ").substring(0,t))}a(o,t,n+1)}else n>0&&e.remove()}))}}])}}]);