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

@iiif/manifold

Package Overview
Dependencies
Maintainers
2
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iiif/manifold - npm Package Compare versions

Comparing version

to
2.0.0-pre.6

2

dist-commonjs/MultiSelectState.js

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

MultiSelectState.prototype.getCanvasById = function (id) {
return this.canvases.filter(function (c) { return c.id === id; })[0];
return this.canvases.filter(function (c) { return manifesto.Utils.normaliseUrl(c.id) === manifesto.Utils.normaliseUrl(id); })[0];
};

@@ -31,0 +31,0 @@ MultiSelectState.prototype.getCanvasesByIds = function (ids) {

@@ -26,3 +26,3 @@ var MultiSelectState = /** @class */ (function () {

MultiSelectState.prototype.getCanvasById = function (id) {
return this.canvases.filter(function (c) { return c.id === id; })[0];
return this.canvases.filter(function (c) { return manifesto.Utils.normaliseUrl(c.id) === manifesto.Utils.normaliseUrl(id); })[0];
};

@@ -29,0 +29,0 @@ MultiSelectState.prototype.getCanvasesByIds = function (ids) {

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

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("manifold",[],t):"object"==typeof exports?exports.manifold=t():e.manifold=t()}(window,function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var s=t[i]={i:i,l:!1,exports:{}};return e[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},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 i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)n.d(i,s,function(t){return e[t]}.bind(null,s));return i},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";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){return function(e){this.isVisible=!0;var t=e.on.match(/.*xywh=(\d*),(\d*),(\d*),(\d*)/);this.x=Number(t[1]),this.y=Number(t[2]),this.width=Number(t[3]),this.height=Number(t[4]),this.chars=e.resource.chars}}();t.AnnotationRect=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),s=function(){function e(e){this._options=e,this._options.locale=this._options.locale||"en-GB"}return e.prototype.bootstrap=function(e,t){var n=this;return new Promise(function(i,s){e&&t&&(i=e,s=t);var o=n._detectIE();if(!1===o)manifesto.Utils.loadManifest(n._options.manifestUri).then(function(e){n._loaded(n,e,i,s)});else if(o>0)if(9===o){var r={url:n._options.manifestUri,type:"GET",dataType:"jsonp",jsonp:"callback",jsonpCallback:"manifestCallback"};$.ajax(r),window.manifestCallback=function(e){n._loaded(n,JSON.stringify(e),i,s)}}else $.getJSON(n._options.manifestUri,function(e){n._loaded(n,JSON.stringify(e),i,s)})})},e.prototype._loaded=function(e,t,n,s){var o=manifesto.Utils.parseManifest(t,{locale:e._options.locale});if(o)if(e._options.iiifResource||(e._options.iiifResource=o),o.getIIIFResourceType()===manifesto.IIIFResourceType.COLLECTION){var r=o.getCollections();r&&r.length?o.getCollectionByIndex(e._options.collectionIndex).then(function(t){t||s("Collection index not found"),0===t.getTotalManifests()&&0===e._options.manifestIndex&&t.getTotalCollections()>0?(e._options.collectionIndex=0,e._options.manifestUri=t.id,e.bootstrap(n,s)):t.getManifestByIndex(e._options.manifestIndex).then(function(t){e._options.manifest=t;var s=new i.Helper(e._options);n(s)})}):o.getManifestByIndex(e._options.manifestIndex).then(function(t){e._options.manifest=t;var s=new i.Helper(e._options);n(s)})}else{e._options.manifest=o;var a=new i.Helper(e._options);n(a)}else console.error("Unable to load IIIF resource")},e.prototype._detectIE=function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(e.indexOf("Trident/")>0){var n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}var i=e.indexOf("Edge/");return i>0&&parseInt(e.substring(i+5,e.indexOf(".",i)),10)},e}();t.Bootstrapper=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),s=n(4),o=n(5),r=n(6),a=function(){function e(e){this.options=e,this.iiifResource=this.options.iiifResource,this.iiifResourceUri=this.options.manifestUri,this.manifest=this.options.manifest,this.collectionIndex=this.options.collectionIndex||0,this.manifestIndex=this.options.manifestIndex||0,this.sequenceIndex=this.options.sequenceIndex||0,this.canvasIndex=this.options.canvasIndex||0}return e.prototype.getAutoCompleteService=function(){var e=this.getSearchService();return e?e.getService(r.ServiceProfile.SEARCH_0_AUTO_COMPLETE):null},e.prototype.getAttribution=function(){console.warn("getAttribution will be deprecated, use getRequiredStatement instead.");var e=this.manifest.getAttribution();return e?manifesto.LanguageMap.getValue(e,this.options.locale):null},e.prototype.getCanvases=function(){return this.getCurrentSequence().getCanvases()},e.prototype.getCanvasById=function(e){return this.getCurrentSequence().getCanvasById(e)},e.prototype.getCanvasesById=function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n],s=this.getCanvasById(i);s&&t.push(s)}return t},e.prototype.getCanvasByIndex=function(e){return this.getCurrentSequence().getCanvasByIndex(e)},e.prototype.getCanvasIndexById=function(e){return this.getCurrentSequence().getCanvasIndexById(e)},e.prototype.getCanvasIndexByLabel=function(e){var t=this.getManifestType()===manifesto.ManifestType.MANUSCRIPT;return this.getCurrentSequence().getCanvasIndexByLabel(e,t)},e.prototype.getCanvasRange=function(e,t){var n=this.getCanvasRanges(e);if(t){for(var i=0;i<n.length;i++){var s=n[i];if(s.path===t)return s}return null}return n[0]},e.prototype.getCanvasRanges=function(e){return e.ranges?e.ranges:(e.ranges=this.manifest.getAllRanges().filter(function(t){return t.getCanvasIds().some(function(t){return manifesto.Utils.normaliseUrl(t)===manifesto.Utils.normaliseUrl(e.id)})}),e.ranges)},e.prototype.getCollectionIndex=function(e){var t=null;return e.parentCollection&&(t=e.parentCollection.index),t},e.prototype.getCurrentCanvas=function(){return this.getCurrentSequence().getCanvasByIndex(this.canvasIndex)},e.prototype.getCurrentSequence=function(){return this.getSequenceByIndex(this.sequenceIndex)},e.prototype.getDescription=function(){var e=this.manifest.getDescription();return e?manifesto.LanguageMap.getValue(e,this.options.locale):null},e.prototype.getLabel=function(){var e=this.manifest.getLabel();return e?manifesto.LanguageMap.getValue(e,this.options.locale):null},e.prototype.getLastCanvasLabel=function(e){return this.getCurrentSequence().getLastCanvasLabel(e)},e.prototype.getFirstPageIndex=function(){return 0},e.prototype.getLastPageIndex=function(){return this.getTotalCanvases()-1},e.prototype.getLicense=function(){return this.manifest.getLicense()},e.prototype.getLogo=function(){return this.manifest.getLogo()},e.prototype.getManifestType=function(){var e=this.manifest.getManifestType();return e===manifesto.ManifestType.EMPTY&&(e=manifesto.ManifestType.MONOGRAPH),e},e.prototype.getMetadata=function(e){var t=[],n=this.manifest.getMetadata(),i=new s.MetadataGroup(this.manifest);(n&&n.length&&i.addMetadata(n,!0),this.manifest.getDescription().length)&&((a=new manifesto.LabelValuePair(this.options.locale)).label=[new manifesto.Language("description",this.options.locale)],a.value=this.manifest.getDescription(),a.isRootLevel=!0,i.addItem(a));this.manifest.getAttribution().length&&((a=new manifesto.LabelValuePair(this.options.locale)).label=[new manifesto.Language("attribution",this.options.locale)],a.value=this.manifest.getAttribution(),a.isRootLevel=!0,i.addItem(a));var o=this.manifest.getLicense();if(o){var r={label:"license",value:e&&e.licenseFormatter?e.licenseFormatter.format(o):o};(a=new manifesto.LabelValuePair(this.options.locale)).parse(r),a.isRootLevel=!0,i.addItem(a)}if(this.manifest.getLogo()){var a;r={label:"logo",value:'<img src="'+this.manifest.getLogo()+'"/>'};(a=new manifesto.LabelValuePair(this.options.locale)).parse(r),a.isRootLevel=!0,i.addItem(a)}return t.push(i),e?this._parseMetadataOptions(e,t):t},e.prototype.getRequiredStatement=function(){var e=this.manifest.getRequiredStatement();return e?{label:e.getLabel(),value:e.getValue()}:null},e.prototype._parseMetadataOptions=function(e,t){var n=this.getCurrentSequence(),i=n.getMetadata();if(i&&i.length){var o=new s.MetadataGroup(n);o.addMetadata(i),t.push(o)}if(e.range){var r=this._getRangeMetadata([],e.range);r=r.reverse(),t=t.concat(r)}if(e.canvases&&e.canvases.length)for(var a=0;a<e.canvases.length;a++){var u=e.canvases[a],g=u.getMetadata();if(g&&g.length){var f=new s.MetadataGroup(u);f.addMetadata(u.getMetadata()),t.push(f)}for(var c=u.getImages(),l=0;l<c.length;l++){var d=c[l],v=d.getMetadata();if(v&&v.length){var h=new s.MetadataGroup(d);h.addMetadata(v),t.push(h)}}}return t},e.prototype._getRangeMetadata=function(e,t){var n=t.getMetadata();if(n&&n.length){var i=new s.MetadataGroup(t);i.addMetadata(n),e.push(i)}else if(t.parentRange)return this._getRangeMetadata(e,t.parentRange);return e},e.prototype.getMultiSelectState=function(){return this._multiSelectState||(this._multiSelectState=new i.MultiSelectState,this._multiSelectState.ranges=this.getRanges().slice(0),this._multiSelectState.canvases=this.getCurrentSequence().getCanvases().slice(0)),this._multiSelectState},e.prototype.getCurrentRange=function(){return this.rangeId?this.getRangeById(this.rangeId):null},e.prototype.getPosterCanvas=function(){return this.manifest.getPosterCanvas()},e.prototype.getPosterImage=function(){var e=this.getPosterCanvas();if(e){var t=e.getContent();if(t&&t.length)return t[0].getBody()[0].id}return null},e.prototype.getPreviousRange=function(e){var t=null;if(t=e||this.getCurrentRange()){var n=this.getFlattenedTree();if(n)for(var i=0;i<n.length;i++){var s=n[i];if(s&&s.data.id===t.id){for(;i>0;){return n[--i].data}break}}}return null},e.prototype.getNextRange=function(e){var t=null;if(t=e||this.getCurrentRange()){var n=this.getFlattenedTree();if(n)for(var i=0;i<n.length;i++){var s=n[i];if(s&&s.data.id===t.id){for(;i<n.length-1;){var o=n[++i];if(o.data.canvases&&o.data.canvases.length)return o.data}break}}}return null},e.prototype.getFlattenedTree=function(e){var t=null;return(t=e||this.getTree())?this._flattenTree(t,"nodes"):null},e.prototype._flattenTree=function(e,t){var n=this,i=[Object.assign({},e)];return delete i[0][t],e[t]&&e[t].length>0?i.concat(e[t].map(function(e){return n._flattenTree(e,t)}).reduce(function(e,t){return e.concat(t)},[])):i},e.prototype.getRanges=function(){return this.manifest.getAllRanges()},e.prototype.getRangeByPath=function(e){return this.manifest.getRangeByPath(e)},e.prototype.getRangeById=function(e){return this.manifest.getRangeById(e)},e.prototype.getRangeCanvases=function(e){var t=e.getCanvasIds();return this.getCanvasesById(t)},e.prototype.getRelated=function(){return this.manifest.getRelated()},e.prototype.getSearchService=function(){return this.manifest.getService(r.ServiceProfile.SEARCH_0)},e.prototype.getSeeAlso=function(){return this.manifest.getSeeAlso()},e.prototype.getSequenceByIndex=function(e){return this.manifest.getSequenceByIndex(e)},e.prototype.getShareServiceUrl=function(){var e=null,t=this.manifest.getService(r.ServiceProfile.SHARE_EXTENSIONS);return t&&(t.length&&(t=t[0]),e=t.__jsonld.shareUrl),e},e.prototype._getSortedTreeNodesByDate=function(e,t){var n=this.getFlattenedTree(t);if(n){var i=n.filter(function(e){return e.data.type===manifesto.TreeNodeType.MANIFEST});this.createDecadeNodes(e,n),this.sortDecadeNodes(e),this.createYearNodes(e,n),this.sortYearNodes(e),this.createMonthNodes(e,i),this.sortMonthNodes(e),this.createDateNodes(e,i),this.pruneDecadeNodes(e)}},e.prototype.getStartCanvasIndex=function(){return this.getCurrentSequence().getStartCanvasIndex()},e.prototype.getThumbs=function(e,t){return this.getCurrentSequence().getThumbs(e,t)},e.prototype.getTopRanges=function(){return this.manifest.getTopRanges()},e.prototype.getTotalCanvases=function(){return this.getCurrentSequence().getTotalCanvases()},e.prototype.getTrackingLabel=function(){return this.manifest.getTrackingLabel()},e.prototype._getTopRanges=function(){return this.iiifResource.getTopRanges()},e.prototype.getTree=function(e,t){if(void 0===e&&(e=0),void 0===t&&(t=o.TreeSortType.NONE),!this.iiifResource)return null;var n;if(this.iiifResource.isCollection())n=this.iiifResource.getDefaultTree();else{var i=this._getTopRanges(),s=new manifesto.TreeNode;if(s.label="root",s.data=this.iiifResource,!i.length)return s;n=i[e].getTree(s)}var r=new manifesto.TreeNode;switch(t){case o.TreeSortType.DATE:if(this.treeHasNavDates(n)){this._getSortedTreeNodesByDate(r,n);break}default:r=n}return r},e.prototype.treeHasNavDates=function(e){var t=this.getFlattenedTree(e);return!!t&&t.some(function(e){return!isNaN(e.navDate)})},e.prototype.getViewingDirection=function(){var e=this.getCurrentSequence().getViewingDirection();return e||(e=this.manifest.getViewingDirection()),e},e.prototype.getViewingHint=function(){var e=this.getCurrentSequence().getViewingHint();return e||(e=this.manifest.getViewingHint()),e},e.prototype.hasParentCollection=function(){return!!this.manifest.parentCollection},e.prototype.hasRelatedPage=function(){var e=this.getRelated();return!!e&&(e.length&&(e=e[0]),"text/html"===e.format)},e.prototype.hasResources=function(){return this.getCurrentCanvas().getResources().length>0},e.prototype.isBottomToTop=function(){var e=this.getViewingDirection();return!!e&&e===r.ViewingDirection.BOTTOM_TO_TOP},e.prototype.isCanvasIndexOutOfRange=function(e){return this.getCurrentSequence().isCanvasIndexOutOfRange(e)},e.prototype.isContinuous=function(){var e=this.getViewingHint();return!!e&&e===r.ViewingHint.CONTINUOUS},e.prototype.isFirstCanvas=function(e){return void 0!==e?this.getCurrentSequence().isFirstCanvas(e):this.getCurrentSequence().isFirstCanvas(this.canvasIndex)},e.prototype.isHorizontallyAligned=function(){return this.isLeftToRight()||this.isRightToLeft()},e.prototype.isLastCanvas=function(e){return void 0!==e?this.getCurrentSequence().isLastCanvas(e):this.getCurrentSequence().isLastCanvas(this.canvasIndex)},e.prototype.isLeftToRight=function(){var e=this.getViewingDirection();return!!e&&e===r.ViewingDirection.LEFT_TO_RIGHT},e.prototype.isMultiCanvas=function(){return this.getCurrentSequence().isMultiCanvas()},e.prototype.isMultiSequence=function(){return this.manifest.isMultiSequence()},e.prototype.isPaged=function(){var e=this.getViewingHint();return e?e===r.ViewingHint.PAGED:this.manifest.isPagingEnabled()},e.prototype.isPagingAvailable=function(){return this.isPagingEnabled()&&this.getTotalCanvases()>2},e.prototype.isPagingEnabled=function(){return this.manifest.isPagingEnabled()||this.getCurrentSequence().isPagingEnabled()},e.prototype.isRightToLeft=function(){var e=this.getViewingDirection();return!!e&&e===r.ViewingDirection.RIGHT_TO_LEFT},e.prototype.isTopToBottom=function(){var e=this.getViewingDirection();return!!e&&e===r.ViewingDirection.TOP_TO_BOTTOM},e.prototype.isTotalCanvasesEven=function(){return this.getCurrentSequence().isTotalCanvasesEven()},e.prototype.isUIEnabled=function(e){var t=this.manifest.getService(r.ServiceProfile.UI_EXTENSIONS);if(t){var n=t.getProperty("disableUI");if(n&&(-1!==n.indexOf(e)||-1!==n.indexOf(e.toLowerCase())))return!1}return!0},e.prototype.isVerticallyAligned=function(){return this.isTopToBottom()||this.isBottomToTop()},e.prototype.createDateNodes=function(e,t){for(var n=0;n<t.length;n++){var i=t[n],s=this.getNodeYear(i),o=this.getNodeMonth(i),r=new manifesto.TreeNode;r.id=i.id,r.label=this.getNodeDisplayDate(i),r.data=i.data,r.data.type=manifesto.TreeNodeType.MANIFEST,r.data.year=s,r.data.month=o;var a=this.getDecadeNode(e,s);if(a){var u=this.getYearNode(a,s);if(u){var g=this.getMonthNode(u,o);g&&g.addNode(r)}}}},e.prototype.createDecadeNodes=function(e,t){for(var n=0;n<t.length;n++){var i=t[n],s=this.getNodeYear(i),o=Number(s.toString().substr(0,3)+"9");if(!this.getDecadeNode(e,s)){var r=new manifesto.TreeNode;r.label=s+" - "+o,r.navDate=i.navDate,r.data.startYear=s,r.data.endYear=o,e.addNode(r)}}},e.prototype.createMonthNodes=function(e,t){for(var n=0;n<t.length;n++){var i=t[n],s=this.getNodeYear(i),o=this.getNodeMonth(i),r=this.getDecadeNode(e,s),a=null;if(r&&(a=this.getYearNode(r,s)),r&&a&&!this.getMonthNode(a,o)){var u=new manifesto.TreeNode;u.label=this.getNodeDisplayMonth(i),u.navDate=i.navDate,u.data.year=s,u.data.month=o,a.addNode(u)}}},e.prototype.createYearNodes=function(e,t){for(var n=0;n<t.length;n++){var i=t[n],s=this.getNodeYear(i),o=this.getDecadeNode(e,s);if(o&&!this.getYearNode(o,s)){var r=new manifesto.TreeNode;r.label=s.toString(),r.navDate=i.navDate,r.data.year=s,o.addNode(r)}}},e.prototype.getDecadeNode=function(e,t){for(var n=0;n<e.nodes.length;n++){var i=e.nodes[n];if(t>=i.data.startYear&&t<=i.data.endYear)return i}return null},e.prototype.getMonthNode=function(e,t){for(var n=0;n<e.nodes.length;n++){var i=e.nodes[n];if(t===this.getNodeMonth(i))return i}return null},e.prototype.getNodeDisplayDate=function(e){return e.navDate.toDateString()},e.prototype.getNodeDisplayMonth=function(e){return["January","February","March","April","May","June","July","August","September","October","November","December"][e.navDate.getMonth()]},e.prototype.getNodeMonth=function(e){return e.navDate.getMonth()},e.prototype.getNodeYear=function(e){return e.navDate.getFullYear()},e.prototype.getYearNode=function(e,t){for(var n=0;n<e.nodes.length;n++){var i=e.nodes[n];if(t===this.getNodeYear(i))return i}return null},e.prototype.pruneDecadeNodes=function(e){for(var t=[],n=0;n<e.nodes.length;n++){var i=e.nodes[n];i.nodes.length||t.push(i)}for(var s=0;s<t.length;s++){var o=t[s],r=e.nodes.indexOf(o);r>-1&&e.nodes.splice(r,1)}},e.prototype.sortDecadeNodes=function(e){e.nodes=e.nodes.sort(function(e,t){return e.data.startYear-t.data.startYear})},e.prototype.sortMonthNodes=function(e){for(var t=this,n=0;n<e.nodes.length;n++)for(var i=e.nodes[n],s=0;s<i.nodes.length;s++){var o=i.nodes[s];o.nodes=o.nodes.sort(function(e,n){return t.getNodeMonth(e)-t.getNodeMonth(n)})}},e.prototype.sortYearNodes=function(e){for(var t=this,n=0;n<e.nodes.length;n++){var i=e.nodes[n];i.nodes=i.nodes.sort(function(e,n){return t.getNodeYear(e)-t.getNodeYear(n)})}},e}();t.Helper=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){this.isEnabled=!1,this.ranges=[],this.canvases=[]}return e.prototype.allCanvasesSelected=function(){return this.canvases.length>0&&this.getAllSelectedCanvases().length===this.canvases.length},e.prototype.allRangesSelected=function(){return this.ranges.length>0&&this.getAllSelectedRanges().length===this.ranges.length},e.prototype.allSelected=function(){return this.allRangesSelected()&&this.allCanvasesSelected()},e.prototype.getAll=function(){return this.canvases.concat(this.ranges)},e.prototype.getAllSelectedCanvases=function(){return this.canvases.filter(function(e){return e.multiSelected})},e.prototype.getAllSelectedRanges=function(){return this.ranges.filter(function(e){return e.multiSelected})},e.prototype.getCanvasById=function(e){return this.canvases.filter(function(t){return t.id===e})[0]},e.prototype.getCanvasesByIds=function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n];t.push(this.getCanvasById(i))}return t},e.prototype.getRangeCanvases=function(e){var t=e.getCanvasIds();return this.getCanvasesByIds(t)},e.prototype.selectAll=function(e){this.selectRanges(this.ranges,e),this.selectCanvases(this.canvases,e)},e.prototype.selectCanvas=function(e,t){this.canvases.filter(function(t){return t.id===e.id})[0].multiSelected=t},e.prototype.selectAllCanvases=function(e){this.selectCanvases(this.canvases,e)},e.prototype.selectCanvases=function(e,t){for(var n=0;n<e.length;n++){e[n].multiSelected=t}},e.prototype.selectRange=function(e,t){var n=this.ranges.filter(function(t){return t.id===e.id})[0];n.multiSelected=t;var i=this.getRangeCanvases(n);this.selectCanvases(i,t)},e.prototype.selectAllRanges=function(e){this.selectRanges(this.ranges,e)},e.prototype.selectRanges=function(e,t){for(var n=0;n<e.length;n++){var i=e[n];i.multiSelected=t;var s=this.getCanvasesByIds(i.getCanvasIds());this.selectCanvases(s,t)}},e.prototype.setEnabled=function(e){this.isEnabled=e;for(var t=this.getAll(),n=0;n<t.length;n++){var i=t[n];i.multiSelectEnabled=this.isEnabled,e||(i.multiSelected=!1)}},e}();t.MultiSelectState=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){this.items=[],this.resource=e,this.label=t}return e.prototype.addItem=function(e){this.items.push(e)},e.prototype.addMetadata=function(e,t){void 0===t&&(t=!1);for(var n=0;n<e.length;n++){var i=e[n];i.isRootLevel=t,this.addItem(i)}},e}();t.MetadataGroup=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.DATE="date",e.NONE="none"}(t.TreeSortType||(t.TreeSortType={}))},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.DOCUMENT="document",e.IMAGE="image",e.MOVING_IMAGE="movingimage",e.PHYSICAL_OBJECT="physicalobject",e.SOUND="sound",e.TEXT="textualbody"}(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.JPG="image/jpeg",e.MP4="video/mp4",e.PDF="application/pdf",e.THREEJS="application/vnd.threejs+json",e.WEBM="video/webm"}(t.MediaType||(t.MediaType={})),function(e){e.DOC="application/msword",e.DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",e.PDF="application/pdf"}(t.RenderingFormat||(t.RenderingFormat={})),function(e){e.IMAGE_0_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/compliance.html#level0",e.IMAGE_0_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/compliance.html#level1",e.IMAGE_0_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/compliance.html#level2",e.IMAGE_0_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/conformance.html#level0",e.IMAGE_0_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/conformance.html#level1",e.IMAGE_0_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/conformance.html#level2",e.IMAGE_1_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",e.IMAGE_1_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",e.IMAGE_1_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",e.IMAGE_1_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",e.IMAGE_1_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",e.IMAGE_1_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",e.IMAGE_1_LEVEL_0="http://iiif.io/api/image/1/level0.json",e.IMAGE_1_PROFILE_LEVEL_0="http://iiif.io/api/image/1/profiles/level0.json",e.IMAGE_1_LEVEL_1="http://iiif.io/api/image/1/level1.json",e.IMAGE_1_PROFILE_LEVEL_1="http://iiif.io/api/image/1/profiles/level1.json",e.IMAGE_1_LEVEL_2="http://iiif.io/api/image/1/level2.json",e.IMAGE_1_PROFILE_LEVEL_2="http://iiif.io/api/image/1/profiles/level2.json",e.IMAGE_2_LEVEL_0="http://iiif.io/api/image/2/level0.json",e.IMAGE_2_PROFILE_LEVEL_0="http://iiif.io/api/image/2/profiles/level0.json",e.IMAGE_2_LEVEL_1="http://iiif.io/api/image/2/level1.json",e.IMAGE_2_PROFILE_LEVEL_1="http://iiif.io/api/image/2/profiles/level1.json",e.IMAGE_2_LEVEL_2="http://iiif.io/api/image/2/level2.json",e.IMAGE_2_PROFILE_LEVEL_2="http://iiif.io/api/image/2/profiles/level2.json",e.AUTH_0_CLICK_THROUGH="http://iiif.io/api/auth/0/login/clickthrough",e.AUTH_0_LOGIN="http://iiif.io/api/auth/0/login",e.AUTH_0_LOGOUT="http://iiif.io/api/auth/0/logout",e.AUTH_0_RESTRICTED="http://iiif.io/api/auth/0/login/restricted",e.AUTH_0_TOKEN="http://iiif.io/api/auth/0/token",e.AUTH_1_CLICK_THROUGH="http://iiif.io/api/auth/1/clickthrough",e.AUTH_1_EXTERNAL="http://iiif.io/api/auth/1/external",e.AUTH_1_KIOSK="http://iiif.io/api/auth/1/kiosk",e.AUTH_1_LOGIN="http://iiif.io/api/auth/1/login",e.AUTH_1_LOGOUT="http://iiif.io/api/auth/1/logout",e.AUTH_1_PROBE="http://iiif.io/api/auth/1/probe",e.AUTH_1_TOKEN="http://iiif.io/api/auth/1/token",e.SEARCH_0="http://iiif.io/api/search/0/search",e.SEARCH_0_AUTO_COMPLETE="http://iiif.io/api/search/0/autocomplete",e.SEARCH_1="http://iiif.io/api/search/1/search",e.SEARCH_1_AUTO_COMPLETE="http://iiif.io/api/search/1/autocomplete",e.TRACKING_EXTENSIONS="http://universalviewer.io/tracking-extensions-profile",e.UI_EXTENSIONS="http://universalviewer.io/ui-extensions-profile",e.PRINT_EXTENSIONS="http://universalviewer.io/print-extensions-profile",e.SHARE_EXTENSIONS="http://universalviewer.io/share-extensions-profile",e.OTHER_MANIFESTATIONS="http://iiif.io/api/otherManifestations.json",e.IXIF="http://wellcomelibrary.org/ld/ixif/0/alpha.json"}(t.ServiceProfile||(t.ServiceProfile={})),function(e){e.BOTTOM_TO_TOP="bottom-to-top",e.LEFT_TO_RIGHT="left-to-right",e.RIGHT_TO_LEFT="right-to-left",e.TOP_TO_BOTTOM="top-to-bottom"}(t.ViewingDirection||(t.ViewingDirection={})),function(e){e.CONTINUOUS="continuous",e.INDIVIDUALS="individuals",e.NON_PAGED="non-paged",e.PAGED="paged",e.TOP="top"}(t.ViewingHint||(t.ViewingHint={}))},function(e,t,n){e.exports=n(8)},function(e,t,n){"use strict";function i(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),i(n(9)),i(n(0)),i(n(1)),i(n(10)),i(n(2)),i(n(11)),i(n(4)),i(n(12)),i(n(3)),i(n(13)),i(n(5)),i(n(14));var s=n(1);t.loadManifest=function(e){return new s.Bootstrapper(e).bootstrap()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),s=function(){function e(e,t){this.rects=[],this.canvasIndex=t,this.addRect(e)}return e.prototype.addRect=function(e){var t=new i.AnnotationRect(e);t.canvasIndex=this.canvasIndex,t.index=this.rects.length,this.rects.push(t),this.rects.sort(function(e,t){return e.index-t.index})},e}();t.AnnotationGroup=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(6),s=function(){function e(e,t){this.authHoldingPage=null,this.clickThroughService=null,this.externalService=null,this.isProbed=!1,this.isResponseHandled=!1,this.kioskService=null,this.loginService=null,this.logoutService=null,this.probeService=null,this.restrictedService=null,this.tokenService=null,e.externalResource=this,this.dataUri=this._getDataUri(e),this.index=e.index,this.authAPIVersion=t.authApiVersion,this._parseAuthServices(e),this._parseDimensions(e)}return e.prototype._getImageServiceDescriptor=function(e){for(var t=null,n=0;n<e.length;n++){var i=e[n],s=i.id;s.endsWith("/")||(s+="/"),manifesto.Utils.isImageProfile(i.getProfile())&&(t=s+"info.json")}return t},e.prototype._getDataUri=function(e){var t=e.getContent(),n=e.getImages(),s=null;if(t&&t.length){var o=t[0].getBody();return o.length?(r=o[0].getServices()).length&&(s=this._getImageServiceDescriptor(r))?s:o[0].id:null}if(n&&n.length){var r,a=n[0].getResource();return(r=a.getServices()).length&&(s=this._getImageServiceDescriptor(r))?s:a.id}var u=e.getService(i.ServiceProfile.IXIF);return u?u.getInfoUri():e.id},e.prototype._parseAuthServices=function(e){if(.9===this.authAPIVersion)this.clickThroughService=manifesto.Utils.getService(e,i.ServiceProfile.AUTH_0_CLICK_THROUGH),this.loginService=manifesto.Utils.getService(e,i.ServiceProfile.AUTH_0_LOGIN),this.restrictedService=manifesto.Utils.getService(e,i.ServiceProfile.AUTH_0_RESTRICTED),this.clickThroughService?(this.logoutService=this.clickThroughService.getService(i.ServiceProfile.AUTH_0_LOGOUT),this.tokenService=this.clickThroughService.getService(i.ServiceProfile.AUTH_0_TOKEN)):this.loginService?(this.logoutService=this.loginService.getService(i.ServiceProfile.AUTH_0_LOGOUT),this.tokenService=this.loginService.getService(i.ServiceProfile.AUTH_0_TOKEN)):this.restrictedService&&(this.logoutService=this.restrictedService.getService(i.ServiceProfile.AUTH_0_LOGOUT),this.tokenService=this.restrictedService.getService(i.ServiceProfile.AUTH_0_TOKEN));else{if(void 0!==e.isCanvas&&e.isCanvas()){var t=e.getContent();if(t&&t.length){var n=t[0].getBody();if(n&&n.length)e=n[0]}}this.clickThroughService=manifesto.Utils.getService(e,i.ServiceProfile.AUTH_1_CLICK_THROUGH),this.loginService=manifesto.Utils.getService(e,i.ServiceProfile.AUTH_1_LOGIN),this.externalService=manifesto.Utils.getService(e,i.ServiceProfile.AUTH_1_EXTERNAL),this.kioskService=manifesto.Utils.getService(e,i.ServiceProfile.AUTH_1_KIOSK),this.clickThroughService?(this.logoutService=this.clickThroughService.getService(i.ServiceProfile.AUTH_1_LOGOUT),this.tokenService=this.clickThroughService.getService(i.ServiceProfile.AUTH_1_TOKEN),this.probeService=this.clickThroughService.getService(i.ServiceProfile.AUTH_1_PROBE)):this.loginService?(this.logoutService=this.loginService.getService(i.ServiceProfile.AUTH_1_LOGOUT),this.tokenService=this.loginService.getService(i.ServiceProfile.AUTH_1_TOKEN),this.probeService=this.loginService.getService(i.ServiceProfile.AUTH_1_PROBE)):this.externalService?(this.logoutService=this.externalService.getService(i.ServiceProfile.AUTH_1_LOGOUT),this.tokenService=this.externalService.getService(i.ServiceProfile.AUTH_1_TOKEN),this.probeService=this.externalService.getService(i.ServiceProfile.AUTH_1_PROBE)):this.kioskService&&(this.logoutService=this.kioskService.getService(i.ServiceProfile.AUTH_1_LOGOUT),this.tokenService=this.kioskService.getService(i.ServiceProfile.AUTH_1_TOKEN),this.probeService=this.kioskService.getService(i.ServiceProfile.AUTH_1_PROBE))}},e.prototype._parseDimensions=function(e){var t=e.getImages();if(t&&t.length){var n=t[0].getResource();this.width=n.getWidth(),this.height=n.getHeight()}else if((t=e.getContent()).length){var i=t[0].getBody();i.length&&(this.width=i[0].getWidth(),this.height=i[0].getHeight())}},e.prototype.isAccessControlled=function(){return!!(this.clickThroughService||this.loginService||this.externalService||this.kioskService||this.probeService)},e.prototype.hasServiceDescriptor=function(){return!!this.dataUri&&this.dataUri.endsWith("info.json")},e.prototype.getData=function(e){var t=this;return t.data={},new Promise(function(n,i){if(t.dataUri)if(t.probeService&&!t.isProbed)t.isProbed=!0,$.ajax({url:t.probeService.id,type:"GET",dataType:"json"}).done(function(e){unescape(e.contentLocation)!==t.dataUri?t.status=HTTPStatusCode.MOVED_TEMPORARILY:t.status=HTTPStatusCode.OK,n(t)}).fail(function(e){t.status=e.status,t.error=e,n(t)});else{var s="GET";if(!t.hasServiceDescriptor()){if(!t.isAccessControlled())return t.status=HTTPStatusCode.OK,void n(t);s="HEAD"}$.ajax({url:t.dataUri,type:s,dataType:"json",beforeSend:function(t){e&&t.setRequestHeader("Authorization","Bearer "+e.accessToken)}}).done(function(e){if(e){var i=unescape(e["@id"]);t.data=e,t._parseAuthServices(t.data),i.endsWith("/info.json")&&(i=i.substr(0,i.lastIndexOf("/")));var s=t.dataUri;s&&s.endsWith("/info.json")&&(s=s.substr(0,s.lastIndexOf("/"))),i!==s&&t.loginService?t.status=HTTPStatusCode.MOVED_TEMPORARILY:t.status=HTTPStatusCode.OK,n(t)}else t.status=HTTPStatusCode.OK,n(t)}).fail(function(e){t.status=e.status,t.error=e,e.responseJSON&&t._parseAuthServices(e.responseJSON),n(t)})}else i("There is no dataUri to fetch")})},e}();t.ExternalResource=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){return function(){}}();t.ILabelValuePair=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){return function(){}}();t.MetadataOptions=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){return function(e,t){this.value=e,this.locale=t}}();t.Translation=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e){this.labels=e}return e.prototype.format=function(e){return-1!=e.indexOf("<a")?e:'<a href="'+e+'">'+(this.labels[e]?this.labels[e]:e)+"</a>"},e}();t.UriLabeller=i}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("manifold",[],t):"object"==typeof exports?exports.manifold=t():e.manifold=t()}(window,function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var s=t[i]={i:i,l:!1,exports:{}};return e[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},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 i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)n.d(i,s,function(t){return e[t]}.bind(null,s));return i},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";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){return function(e){this.isVisible=!0;var t=e.on.match(/.*xywh=(\d*),(\d*),(\d*),(\d*)/);this.x=Number(t[1]),this.y=Number(t[2]),this.width=Number(t[3]),this.height=Number(t[4]),this.chars=e.resource.chars}}();t.AnnotationRect=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),s=function(){function e(e){this._options=e,this._options.locale=this._options.locale||"en-GB"}return e.prototype.bootstrap=function(e,t){var n=this;return new Promise(function(i,s){e&&t&&(i=e,s=t);var o=n._detectIE();if(!1===o)manifesto.Utils.loadManifest(n._options.manifestUri).then(function(e){n._loaded(n,e,i,s)});else if(o>0)if(9===o){var r={url:n._options.manifestUri,type:"GET",dataType:"jsonp",jsonp:"callback",jsonpCallback:"manifestCallback"};$.ajax(r),window.manifestCallback=function(e){n._loaded(n,JSON.stringify(e),i,s)}}else $.getJSON(n._options.manifestUri,function(e){n._loaded(n,JSON.stringify(e),i,s)})})},e.prototype._loaded=function(e,t,n,s){var o=manifesto.Utils.parseManifest(t,{locale:e._options.locale});if(o)if(e._options.iiifResource||(e._options.iiifResource=o),o.getIIIFResourceType()===manifesto.IIIFResourceType.COLLECTION){var r=o.getCollections();r&&r.length?o.getCollectionByIndex(e._options.collectionIndex).then(function(t){t||s("Collection index not found"),0===t.getTotalManifests()&&0===e._options.manifestIndex&&t.getTotalCollections()>0?(e._options.collectionIndex=0,e._options.manifestUri=t.id,e.bootstrap(n,s)):t.getManifestByIndex(e._options.manifestIndex).then(function(t){e._options.manifest=t;var s=new i.Helper(e._options);n(s)})}):o.getManifestByIndex(e._options.manifestIndex).then(function(t){e._options.manifest=t;var s=new i.Helper(e._options);n(s)})}else{e._options.manifest=o;var a=new i.Helper(e._options);n(a)}else console.error("Unable to load IIIF resource")},e.prototype._detectIE=function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(e.indexOf("Trident/")>0){var n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}var i=e.indexOf("Edge/");return i>0&&parseInt(e.substring(i+5,e.indexOf(".",i)),10)},e}();t.Bootstrapper=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),s=n(4),o=n(5),r=n(6),a=function(){function e(e){this.options=e,this.iiifResource=this.options.iiifResource,this.iiifResourceUri=this.options.manifestUri,this.manifest=this.options.manifest,this.collectionIndex=this.options.collectionIndex||0,this.manifestIndex=this.options.manifestIndex||0,this.sequenceIndex=this.options.sequenceIndex||0,this.canvasIndex=this.options.canvasIndex||0}return e.prototype.getAutoCompleteService=function(){var e=this.getSearchService();return e?e.getService(r.ServiceProfile.SEARCH_0_AUTO_COMPLETE):null},e.prototype.getAttribution=function(){console.warn("getAttribution will be deprecated, use getRequiredStatement instead.");var e=this.manifest.getAttribution();return e?manifesto.LanguageMap.getValue(e,this.options.locale):null},e.prototype.getCanvases=function(){return this.getCurrentSequence().getCanvases()},e.prototype.getCanvasById=function(e){return this.getCurrentSequence().getCanvasById(e)},e.prototype.getCanvasesById=function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n],s=this.getCanvasById(i);s&&t.push(s)}return t},e.prototype.getCanvasByIndex=function(e){return this.getCurrentSequence().getCanvasByIndex(e)},e.prototype.getCanvasIndexById=function(e){return this.getCurrentSequence().getCanvasIndexById(e)},e.prototype.getCanvasIndexByLabel=function(e){var t=this.getManifestType()===manifesto.ManifestType.MANUSCRIPT;return this.getCurrentSequence().getCanvasIndexByLabel(e,t)},e.prototype.getCanvasRange=function(e,t){var n=this.getCanvasRanges(e);if(t){for(var i=0;i<n.length;i++){var s=n[i];if(s.path===t)return s}return null}return n[0]},e.prototype.getCanvasRanges=function(e){return e.ranges?e.ranges:(e.ranges=this.manifest.getAllRanges().filter(function(t){return t.getCanvasIds().some(function(t){return manifesto.Utils.normaliseUrl(t)===manifesto.Utils.normaliseUrl(e.id)})}),e.ranges)},e.prototype.getCollectionIndex=function(e){var t=null;return e.parentCollection&&(t=e.parentCollection.index),t},e.prototype.getCurrentCanvas=function(){return this.getCurrentSequence().getCanvasByIndex(this.canvasIndex)},e.prototype.getCurrentSequence=function(){return this.getSequenceByIndex(this.sequenceIndex)},e.prototype.getDescription=function(){var e=this.manifest.getDescription();return e?manifesto.LanguageMap.getValue(e,this.options.locale):null},e.prototype.getLabel=function(){var e=this.manifest.getLabel();return e?manifesto.LanguageMap.getValue(e,this.options.locale):null},e.prototype.getLastCanvasLabel=function(e){return this.getCurrentSequence().getLastCanvasLabel(e)},e.prototype.getFirstPageIndex=function(){return 0},e.prototype.getLastPageIndex=function(){return this.getTotalCanvases()-1},e.prototype.getLicense=function(){return this.manifest.getLicense()},e.prototype.getLogo=function(){return this.manifest.getLogo()},e.prototype.getManifestType=function(){var e=this.manifest.getManifestType();return e===manifesto.ManifestType.EMPTY&&(e=manifesto.ManifestType.MONOGRAPH),e},e.prototype.getMetadata=function(e){var t=[],n=this.manifest.getMetadata(),i=new s.MetadataGroup(this.manifest);(n&&n.length&&i.addMetadata(n,!0),this.manifest.getDescription().length)&&((a=new manifesto.LabelValuePair(this.options.locale)).label=[new manifesto.Language("description",this.options.locale)],a.value=this.manifest.getDescription(),a.isRootLevel=!0,i.addItem(a));this.manifest.getAttribution().length&&((a=new manifesto.LabelValuePair(this.options.locale)).label=[new manifesto.Language("attribution",this.options.locale)],a.value=this.manifest.getAttribution(),a.isRootLevel=!0,i.addItem(a));var o=this.manifest.getLicense();if(o){var r={label:"license",value:e&&e.licenseFormatter?e.licenseFormatter.format(o):o};(a=new manifesto.LabelValuePair(this.options.locale)).parse(r),a.isRootLevel=!0,i.addItem(a)}if(this.manifest.getLogo()){var a;r={label:"logo",value:'<img src="'+this.manifest.getLogo()+'"/>'};(a=new manifesto.LabelValuePair(this.options.locale)).parse(r),a.isRootLevel=!0,i.addItem(a)}return t.push(i),e?this._parseMetadataOptions(e,t):t},e.prototype.getRequiredStatement=function(){var e=this.manifest.getRequiredStatement();return e?{label:e.getLabel(),value:e.getValue()}:null},e.prototype._parseMetadataOptions=function(e,t){var n=this.getCurrentSequence(),i=n.getMetadata();if(i&&i.length){var o=new s.MetadataGroup(n);o.addMetadata(i),t.push(o)}if(e.range){var r=this._getRangeMetadata([],e.range);r=r.reverse(),t=t.concat(r)}if(e.canvases&&e.canvases.length)for(var a=0;a<e.canvases.length;a++){var u=e.canvases[a],g=u.getMetadata();if(g&&g.length){var f=new s.MetadataGroup(u);f.addMetadata(u.getMetadata()),t.push(f)}for(var c=u.getImages(),l=0;l<c.length;l++){var d=c[l],v=d.getMetadata();if(v&&v.length){var h=new s.MetadataGroup(d);h.addMetadata(v),t.push(h)}}}return t},e.prototype._getRangeMetadata=function(e,t){var n=t.getMetadata();if(n&&n.length){var i=new s.MetadataGroup(t);i.addMetadata(n),e.push(i)}else if(t.parentRange)return this._getRangeMetadata(e,t.parentRange);return e},e.prototype.getMultiSelectState=function(){return this._multiSelectState||(this._multiSelectState=new i.MultiSelectState,this._multiSelectState.ranges=this.getRanges().slice(0),this._multiSelectState.canvases=this.getCurrentSequence().getCanvases().slice(0)),this._multiSelectState},e.prototype.getCurrentRange=function(){return this.rangeId?this.getRangeById(this.rangeId):null},e.prototype.getPosterCanvas=function(){return this.manifest.getPosterCanvas()},e.prototype.getPosterImage=function(){var e=this.getPosterCanvas();if(e){var t=e.getContent();if(t&&t.length)return t[0].getBody()[0].id}return null},e.prototype.getPreviousRange=function(e){var t=null;if(t=e||this.getCurrentRange()){var n=this.getFlattenedTree();if(n)for(var i=0;i<n.length;i++){var s=n[i];if(s&&s.data.id===t.id){for(;i>0;){return n[--i].data}break}}}return null},e.prototype.getNextRange=function(e){var t=null;if(t=e||this.getCurrentRange()){var n=this.getFlattenedTree();if(n)for(var i=0;i<n.length;i++){var s=n[i];if(s&&s.data.id===t.id){for(;i<n.length-1;){var o=n[++i];if(o.data.canvases&&o.data.canvases.length)return o.data}break}}}return null},e.prototype.getFlattenedTree=function(e){var t=null;return(t=e||this.getTree())?this._flattenTree(t,"nodes"):null},e.prototype._flattenTree=function(e,t){var n=this,i=[Object.assign({},e)];return delete i[0][t],e[t]&&e[t].length>0?i.concat(e[t].map(function(e){return n._flattenTree(e,t)}).reduce(function(e,t){return e.concat(t)},[])):i},e.prototype.getRanges=function(){return this.manifest.getAllRanges()},e.prototype.getRangeByPath=function(e){return this.manifest.getRangeByPath(e)},e.prototype.getRangeById=function(e){return this.manifest.getRangeById(e)},e.prototype.getRangeCanvases=function(e){var t=e.getCanvasIds();return this.getCanvasesById(t)},e.prototype.getRelated=function(){return this.manifest.getRelated()},e.prototype.getSearchService=function(){return this.manifest.getService(r.ServiceProfile.SEARCH_0)},e.prototype.getSeeAlso=function(){return this.manifest.getSeeAlso()},e.prototype.getSequenceByIndex=function(e){return this.manifest.getSequenceByIndex(e)},e.prototype.getShareServiceUrl=function(){var e=null,t=this.manifest.getService(r.ServiceProfile.SHARE_EXTENSIONS);return t&&(t.length&&(t=t[0]),e=t.__jsonld.shareUrl),e},e.prototype._getSortedTreeNodesByDate=function(e,t){var n=this.getFlattenedTree(t);if(n){var i=n.filter(function(e){return e.data.type===manifesto.TreeNodeType.MANIFEST});this.createDecadeNodes(e,n),this.sortDecadeNodes(e),this.createYearNodes(e,n),this.sortYearNodes(e),this.createMonthNodes(e,i),this.sortMonthNodes(e),this.createDateNodes(e,i),this.pruneDecadeNodes(e)}},e.prototype.getStartCanvasIndex=function(){return this.getCurrentSequence().getStartCanvasIndex()},e.prototype.getThumbs=function(e,t){return this.getCurrentSequence().getThumbs(e,t)},e.prototype.getTopRanges=function(){return this.manifest.getTopRanges()},e.prototype.getTotalCanvases=function(){return this.getCurrentSequence().getTotalCanvases()},e.prototype.getTrackingLabel=function(){return this.manifest.getTrackingLabel()},e.prototype._getTopRanges=function(){return this.iiifResource.getTopRanges()},e.prototype.getTree=function(e,t){if(void 0===e&&(e=0),void 0===t&&(t=o.TreeSortType.NONE),!this.iiifResource)return null;var n;if(this.iiifResource.isCollection())n=this.iiifResource.getDefaultTree();else{var i=this._getTopRanges(),s=new manifesto.TreeNode;if(s.label="root",s.data=this.iiifResource,!i.length)return s;n=i[e].getTree(s)}var r=new manifesto.TreeNode;switch(t){case o.TreeSortType.DATE:if(this.treeHasNavDates(n)){this._getSortedTreeNodesByDate(r,n);break}default:r=n}return r},e.prototype.treeHasNavDates=function(e){var t=this.getFlattenedTree(e);return!!t&&t.some(function(e){return!isNaN(e.navDate)})},e.prototype.getViewingDirection=function(){var e=this.getCurrentSequence().getViewingDirection();return e||(e=this.manifest.getViewingDirection()),e},e.prototype.getViewingHint=function(){var e=this.getCurrentSequence().getViewingHint();return e||(e=this.manifest.getViewingHint()),e},e.prototype.hasParentCollection=function(){return!!this.manifest.parentCollection},e.prototype.hasRelatedPage=function(){var e=this.getRelated();return!!e&&(e.length&&(e=e[0]),"text/html"===e.format)},e.prototype.hasResources=function(){return this.getCurrentCanvas().getResources().length>0},e.prototype.isBottomToTop=function(){var e=this.getViewingDirection();return!!e&&e===r.ViewingDirection.BOTTOM_TO_TOP},e.prototype.isCanvasIndexOutOfRange=function(e){return this.getCurrentSequence().isCanvasIndexOutOfRange(e)},e.prototype.isContinuous=function(){var e=this.getViewingHint();return!!e&&e===r.ViewingHint.CONTINUOUS},e.prototype.isFirstCanvas=function(e){return void 0!==e?this.getCurrentSequence().isFirstCanvas(e):this.getCurrentSequence().isFirstCanvas(this.canvasIndex)},e.prototype.isHorizontallyAligned=function(){return this.isLeftToRight()||this.isRightToLeft()},e.prototype.isLastCanvas=function(e){return void 0!==e?this.getCurrentSequence().isLastCanvas(e):this.getCurrentSequence().isLastCanvas(this.canvasIndex)},e.prototype.isLeftToRight=function(){var e=this.getViewingDirection();return!!e&&e===r.ViewingDirection.LEFT_TO_RIGHT},e.prototype.isMultiCanvas=function(){return this.getCurrentSequence().isMultiCanvas()},e.prototype.isMultiSequence=function(){return this.manifest.isMultiSequence()},e.prototype.isPaged=function(){var e=this.getViewingHint();return e?e===r.ViewingHint.PAGED:this.manifest.isPagingEnabled()},e.prototype.isPagingAvailable=function(){return this.isPagingEnabled()&&this.getTotalCanvases()>2},e.prototype.isPagingEnabled=function(){return this.manifest.isPagingEnabled()||this.getCurrentSequence().isPagingEnabled()},e.prototype.isRightToLeft=function(){var e=this.getViewingDirection();return!!e&&e===r.ViewingDirection.RIGHT_TO_LEFT},e.prototype.isTopToBottom=function(){var e=this.getViewingDirection();return!!e&&e===r.ViewingDirection.TOP_TO_BOTTOM},e.prototype.isTotalCanvasesEven=function(){return this.getCurrentSequence().isTotalCanvasesEven()},e.prototype.isUIEnabled=function(e){var t=this.manifest.getService(r.ServiceProfile.UI_EXTENSIONS);if(t){var n=t.getProperty("disableUI");if(n&&(-1!==n.indexOf(e)||-1!==n.indexOf(e.toLowerCase())))return!1}return!0},e.prototype.isVerticallyAligned=function(){return this.isTopToBottom()||this.isBottomToTop()},e.prototype.createDateNodes=function(e,t){for(var n=0;n<t.length;n++){var i=t[n],s=this.getNodeYear(i),o=this.getNodeMonth(i),r=new manifesto.TreeNode;r.id=i.id,r.label=this.getNodeDisplayDate(i),r.data=i.data,r.data.type=manifesto.TreeNodeType.MANIFEST,r.data.year=s,r.data.month=o;var a=this.getDecadeNode(e,s);if(a){var u=this.getYearNode(a,s);if(u){var g=this.getMonthNode(u,o);g&&g.addNode(r)}}}},e.prototype.createDecadeNodes=function(e,t){for(var n=0;n<t.length;n++){var i=t[n],s=this.getNodeYear(i),o=Number(s.toString().substr(0,3)+"9");if(!this.getDecadeNode(e,s)){var r=new manifesto.TreeNode;r.label=s+" - "+o,r.navDate=i.navDate,r.data.startYear=s,r.data.endYear=o,e.addNode(r)}}},e.prototype.createMonthNodes=function(e,t){for(var n=0;n<t.length;n++){var i=t[n],s=this.getNodeYear(i),o=this.getNodeMonth(i),r=this.getDecadeNode(e,s),a=null;if(r&&(a=this.getYearNode(r,s)),r&&a&&!this.getMonthNode(a,o)){var u=new manifesto.TreeNode;u.label=this.getNodeDisplayMonth(i),u.navDate=i.navDate,u.data.year=s,u.data.month=o,a.addNode(u)}}},e.prototype.createYearNodes=function(e,t){for(var n=0;n<t.length;n++){var i=t[n],s=this.getNodeYear(i),o=this.getDecadeNode(e,s);if(o&&!this.getYearNode(o,s)){var r=new manifesto.TreeNode;r.label=s.toString(),r.navDate=i.navDate,r.data.year=s,o.addNode(r)}}},e.prototype.getDecadeNode=function(e,t){for(var n=0;n<e.nodes.length;n++){var i=e.nodes[n];if(t>=i.data.startYear&&t<=i.data.endYear)return i}return null},e.prototype.getMonthNode=function(e,t){for(var n=0;n<e.nodes.length;n++){var i=e.nodes[n];if(t===this.getNodeMonth(i))return i}return null},e.prototype.getNodeDisplayDate=function(e){return e.navDate.toDateString()},e.prototype.getNodeDisplayMonth=function(e){return["January","February","March","April","May","June","July","August","September","October","November","December"][e.navDate.getMonth()]},e.prototype.getNodeMonth=function(e){return e.navDate.getMonth()},e.prototype.getNodeYear=function(e){return e.navDate.getFullYear()},e.prototype.getYearNode=function(e,t){for(var n=0;n<e.nodes.length;n++){var i=e.nodes[n];if(t===this.getNodeYear(i))return i}return null},e.prototype.pruneDecadeNodes=function(e){for(var t=[],n=0;n<e.nodes.length;n++){var i=e.nodes[n];i.nodes.length||t.push(i)}for(var s=0;s<t.length;s++){var o=t[s],r=e.nodes.indexOf(o);r>-1&&e.nodes.splice(r,1)}},e.prototype.sortDecadeNodes=function(e){e.nodes=e.nodes.sort(function(e,t){return e.data.startYear-t.data.startYear})},e.prototype.sortMonthNodes=function(e){for(var t=this,n=0;n<e.nodes.length;n++)for(var i=e.nodes[n],s=0;s<i.nodes.length;s++){var o=i.nodes[s];o.nodes=o.nodes.sort(function(e,n){return t.getNodeMonth(e)-t.getNodeMonth(n)})}},e.prototype.sortYearNodes=function(e){for(var t=this,n=0;n<e.nodes.length;n++){var i=e.nodes[n];i.nodes=i.nodes.sort(function(e,n){return t.getNodeYear(e)-t.getNodeYear(n)})}},e}();t.Helper=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){this.isEnabled=!1,this.ranges=[],this.canvases=[]}return e.prototype.allCanvasesSelected=function(){return this.canvases.length>0&&this.getAllSelectedCanvases().length===this.canvases.length},e.prototype.allRangesSelected=function(){return this.ranges.length>0&&this.getAllSelectedRanges().length===this.ranges.length},e.prototype.allSelected=function(){return this.allRangesSelected()&&this.allCanvasesSelected()},e.prototype.getAll=function(){return this.canvases.concat(this.ranges)},e.prototype.getAllSelectedCanvases=function(){return this.canvases.filter(function(e){return e.multiSelected})},e.prototype.getAllSelectedRanges=function(){return this.ranges.filter(function(e){return e.multiSelected})},e.prototype.getCanvasById=function(e){return this.canvases.filter(function(t){return manifesto.Utils.normaliseUrl(t.id)===manifesto.Utils.normaliseUrl(e)})[0]},e.prototype.getCanvasesByIds=function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n];t.push(this.getCanvasById(i))}return t},e.prototype.getRangeCanvases=function(e){var t=e.getCanvasIds();return this.getCanvasesByIds(t)},e.prototype.selectAll=function(e){this.selectRanges(this.ranges,e),this.selectCanvases(this.canvases,e)},e.prototype.selectCanvas=function(e,t){this.canvases.filter(function(t){return t.id===e.id})[0].multiSelected=t},e.prototype.selectAllCanvases=function(e){this.selectCanvases(this.canvases,e)},e.prototype.selectCanvases=function(e,t){for(var n=0;n<e.length;n++){e[n].multiSelected=t}},e.prototype.selectRange=function(e,t){var n=this.ranges.filter(function(t){return t.id===e.id})[0];n.multiSelected=t;var i=this.getRangeCanvases(n);this.selectCanvases(i,t)},e.prototype.selectAllRanges=function(e){this.selectRanges(this.ranges,e)},e.prototype.selectRanges=function(e,t){for(var n=0;n<e.length;n++){var i=e[n];i.multiSelected=t;var s=this.getCanvasesByIds(i.getCanvasIds());this.selectCanvases(s,t)}},e.prototype.setEnabled=function(e){this.isEnabled=e;for(var t=this.getAll(),n=0;n<t.length;n++){var i=t[n];i.multiSelectEnabled=this.isEnabled,e||(i.multiSelected=!1)}},e}();t.MultiSelectState=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){this.items=[],this.resource=e,this.label=t}return e.prototype.addItem=function(e){this.items.push(e)},e.prototype.addMetadata=function(e,t){void 0===t&&(t=!1);for(var n=0;n<e.length;n++){var i=e[n];i.isRootLevel=t,this.addItem(i)}},e}();t.MetadataGroup=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.DATE="date",e.NONE="none"}(t.TreeSortType||(t.TreeSortType={}))},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.DOCUMENT="document",e.IMAGE="image",e.MOVING_IMAGE="movingimage",e.PHYSICAL_OBJECT="physicalobject",e.SOUND="sound",e.TEXT="textualbody"}(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.JPG="image/jpeg",e.MP4="video/mp4",e.PDF="application/pdf",e.THREEJS="application/vnd.threejs+json",e.WEBM="video/webm"}(t.MediaType||(t.MediaType={})),function(e){e.DOC="application/msword",e.DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",e.PDF="application/pdf"}(t.RenderingFormat||(t.RenderingFormat={})),function(e){e.IMAGE_0_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/compliance.html#level0",e.IMAGE_0_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/compliance.html#level1",e.IMAGE_0_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/compliance.html#level2",e.IMAGE_0_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/conformance.html#level0",e.IMAGE_0_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/conformance.html#level1",e.IMAGE_0_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/conformance.html#level2",e.IMAGE_1_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",e.IMAGE_1_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",e.IMAGE_1_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",e.IMAGE_1_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",e.IMAGE_1_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",e.IMAGE_1_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",e.IMAGE_1_LEVEL_0="http://iiif.io/api/image/1/level0.json",e.IMAGE_1_PROFILE_LEVEL_0="http://iiif.io/api/image/1/profiles/level0.json",e.IMAGE_1_LEVEL_1="http://iiif.io/api/image/1/level1.json",e.IMAGE_1_PROFILE_LEVEL_1="http://iiif.io/api/image/1/profiles/level1.json",e.IMAGE_1_LEVEL_2="http://iiif.io/api/image/1/level2.json",e.IMAGE_1_PROFILE_LEVEL_2="http://iiif.io/api/image/1/profiles/level2.json",e.IMAGE_2_LEVEL_0="http://iiif.io/api/image/2/level0.json",e.IMAGE_2_PROFILE_LEVEL_0="http://iiif.io/api/image/2/profiles/level0.json",e.IMAGE_2_LEVEL_1="http://iiif.io/api/image/2/level1.json",e.IMAGE_2_PROFILE_LEVEL_1="http://iiif.io/api/image/2/profiles/level1.json",e.IMAGE_2_LEVEL_2="http://iiif.io/api/image/2/level2.json",e.IMAGE_2_PROFILE_LEVEL_2="http://iiif.io/api/image/2/profiles/level2.json",e.AUTH_0_CLICK_THROUGH="http://iiif.io/api/auth/0/login/clickthrough",e.AUTH_0_LOGIN="http://iiif.io/api/auth/0/login",e.AUTH_0_LOGOUT="http://iiif.io/api/auth/0/logout",e.AUTH_0_RESTRICTED="http://iiif.io/api/auth/0/login/restricted",e.AUTH_0_TOKEN="http://iiif.io/api/auth/0/token",e.AUTH_1_CLICK_THROUGH="http://iiif.io/api/auth/1/clickthrough",e.AUTH_1_EXTERNAL="http://iiif.io/api/auth/1/external",e.AUTH_1_KIOSK="http://iiif.io/api/auth/1/kiosk",e.AUTH_1_LOGIN="http://iiif.io/api/auth/1/login",e.AUTH_1_LOGOUT="http://iiif.io/api/auth/1/logout",e.AUTH_1_PROBE="http://iiif.io/api/auth/1/probe",e.AUTH_1_TOKEN="http://iiif.io/api/auth/1/token",e.SEARCH_0="http://iiif.io/api/search/0/search",e.SEARCH_0_AUTO_COMPLETE="http://iiif.io/api/search/0/autocomplete",e.SEARCH_1="http://iiif.io/api/search/1/search",e.SEARCH_1_AUTO_COMPLETE="http://iiif.io/api/search/1/autocomplete",e.TRACKING_EXTENSIONS="http://universalviewer.io/tracking-extensions-profile",e.UI_EXTENSIONS="http://universalviewer.io/ui-extensions-profile",e.PRINT_EXTENSIONS="http://universalviewer.io/print-extensions-profile",e.SHARE_EXTENSIONS="http://universalviewer.io/share-extensions-profile",e.OTHER_MANIFESTATIONS="http://iiif.io/api/otherManifestations.json",e.IXIF="http://wellcomelibrary.org/ld/ixif/0/alpha.json"}(t.ServiceProfile||(t.ServiceProfile={})),function(e){e.BOTTOM_TO_TOP="bottom-to-top",e.LEFT_TO_RIGHT="left-to-right",e.RIGHT_TO_LEFT="right-to-left",e.TOP_TO_BOTTOM="top-to-bottom"}(t.ViewingDirection||(t.ViewingDirection={})),function(e){e.CONTINUOUS="continuous",e.INDIVIDUALS="individuals",e.NON_PAGED="non-paged",e.PAGED="paged",e.TOP="top"}(t.ViewingHint||(t.ViewingHint={}))},function(e,t,n){e.exports=n(8)},function(e,t,n){"use strict";function i(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),i(n(9)),i(n(0)),i(n(1)),i(n(10)),i(n(2)),i(n(11)),i(n(4)),i(n(12)),i(n(3)),i(n(13)),i(n(5)),i(n(14));var s=n(1);t.loadManifest=function(e){return new s.Bootstrapper(e).bootstrap()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),s=function(){function e(e,t){this.rects=[],this.canvasIndex=t,this.addRect(e)}return e.prototype.addRect=function(e){var t=new i.AnnotationRect(e);t.canvasIndex=this.canvasIndex,t.index=this.rects.length,this.rects.push(t),this.rects.sort(function(e,t){return e.index-t.index})},e}();t.AnnotationGroup=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(6),s=function(){function e(e,t){this.authHoldingPage=null,this.clickThroughService=null,this.externalService=null,this.isProbed=!1,this.isResponseHandled=!1,this.kioskService=null,this.loginService=null,this.logoutService=null,this.probeService=null,this.restrictedService=null,this.tokenService=null,e.externalResource=this,this.dataUri=this._getDataUri(e),this.index=e.index,this.authAPIVersion=t.authApiVersion,this._parseAuthServices(e),this._parseDimensions(e)}return e.prototype._getImageServiceDescriptor=function(e){for(var t=null,n=0;n<e.length;n++){var i=e[n],s=i.id;s.endsWith("/")||(s+="/"),manifesto.Utils.isImageProfile(i.getProfile())&&(t=s+"info.json")}return t},e.prototype._getDataUri=function(e){var t=e.getContent(),n=e.getImages(),s=null;if(t&&t.length){var o=t[0].getBody();return o.length?(r=o[0].getServices()).length&&(s=this._getImageServiceDescriptor(r))?s:o[0].id:null}if(n&&n.length){var r,a=n[0].getResource();return(r=a.getServices()).length&&(s=this._getImageServiceDescriptor(r))?s:a.id}var u=e.getService(i.ServiceProfile.IXIF);return u?u.getInfoUri():e.id},e.prototype._parseAuthServices=function(e){if(.9===this.authAPIVersion)this.clickThroughService=manifesto.Utils.getService(e,i.ServiceProfile.AUTH_0_CLICK_THROUGH),this.loginService=manifesto.Utils.getService(e,i.ServiceProfile.AUTH_0_LOGIN),this.restrictedService=manifesto.Utils.getService(e,i.ServiceProfile.AUTH_0_RESTRICTED),this.clickThroughService?(this.logoutService=this.clickThroughService.getService(i.ServiceProfile.AUTH_0_LOGOUT),this.tokenService=this.clickThroughService.getService(i.ServiceProfile.AUTH_0_TOKEN)):this.loginService?(this.logoutService=this.loginService.getService(i.ServiceProfile.AUTH_0_LOGOUT),this.tokenService=this.loginService.getService(i.ServiceProfile.AUTH_0_TOKEN)):this.restrictedService&&(this.logoutService=this.restrictedService.getService(i.ServiceProfile.AUTH_0_LOGOUT),this.tokenService=this.restrictedService.getService(i.ServiceProfile.AUTH_0_TOKEN));else{if(void 0!==e.isCanvas&&e.isCanvas()){var t=e.getContent();if(t&&t.length){var n=t[0].getBody();if(n&&n.length)e=n[0]}}this.clickThroughService=manifesto.Utils.getService(e,i.ServiceProfile.AUTH_1_CLICK_THROUGH),this.loginService=manifesto.Utils.getService(e,i.ServiceProfile.AUTH_1_LOGIN),this.externalService=manifesto.Utils.getService(e,i.ServiceProfile.AUTH_1_EXTERNAL),this.kioskService=manifesto.Utils.getService(e,i.ServiceProfile.AUTH_1_KIOSK),this.clickThroughService?(this.logoutService=this.clickThroughService.getService(i.ServiceProfile.AUTH_1_LOGOUT),this.tokenService=this.clickThroughService.getService(i.ServiceProfile.AUTH_1_TOKEN),this.probeService=this.clickThroughService.getService(i.ServiceProfile.AUTH_1_PROBE)):this.loginService?(this.logoutService=this.loginService.getService(i.ServiceProfile.AUTH_1_LOGOUT),this.tokenService=this.loginService.getService(i.ServiceProfile.AUTH_1_TOKEN),this.probeService=this.loginService.getService(i.ServiceProfile.AUTH_1_PROBE)):this.externalService?(this.logoutService=this.externalService.getService(i.ServiceProfile.AUTH_1_LOGOUT),this.tokenService=this.externalService.getService(i.ServiceProfile.AUTH_1_TOKEN),this.probeService=this.externalService.getService(i.ServiceProfile.AUTH_1_PROBE)):this.kioskService&&(this.logoutService=this.kioskService.getService(i.ServiceProfile.AUTH_1_LOGOUT),this.tokenService=this.kioskService.getService(i.ServiceProfile.AUTH_1_TOKEN),this.probeService=this.kioskService.getService(i.ServiceProfile.AUTH_1_PROBE))}},e.prototype._parseDimensions=function(e){var t=e.getImages();if(t&&t.length){var n=t[0].getResource();this.width=n.getWidth(),this.height=n.getHeight()}else if((t=e.getContent()).length){var i=t[0].getBody();i.length&&(this.width=i[0].getWidth(),this.height=i[0].getHeight())}},e.prototype.isAccessControlled=function(){return!!(this.clickThroughService||this.loginService||this.externalService||this.kioskService||this.probeService)},e.prototype.hasServiceDescriptor=function(){return!!this.dataUri&&this.dataUri.endsWith("info.json")},e.prototype.getData=function(e){var t=this;return t.data={},new Promise(function(n,i){if(t.dataUri)if(t.probeService&&!t.isProbed)t.isProbed=!0,$.ajax({url:t.probeService.id,type:"GET",dataType:"json"}).done(function(e){unescape(e.contentLocation)!==t.dataUri?t.status=HTTPStatusCode.MOVED_TEMPORARILY:t.status=HTTPStatusCode.OK,n(t)}).fail(function(e){t.status=e.status,t.error=e,n(t)});else{var s="GET";if(!t.hasServiceDescriptor()){if(!t.isAccessControlled())return t.status=HTTPStatusCode.OK,void n(t);s="HEAD"}$.ajax({url:t.dataUri,type:s,dataType:"json",beforeSend:function(t){e&&t.setRequestHeader("Authorization","Bearer "+e.accessToken)}}).done(function(e){if(e){var i=unescape(e["@id"]);t.data=e,t._parseAuthServices(t.data),i.endsWith("/info.json")&&(i=i.substr(0,i.lastIndexOf("/")));var s=t.dataUri;s&&s.endsWith("/info.json")&&(s=s.substr(0,s.lastIndexOf("/"))),i!==s&&t.loginService?t.status=HTTPStatusCode.MOVED_TEMPORARILY:t.status=HTTPStatusCode.OK,n(t)}else t.status=HTTPStatusCode.OK,n(t)}).fail(function(e){t.status=e.status,t.error=e,e.responseJSON&&t._parseAuthServices(e.responseJSON),n(t)})}else i("There is no dataUri to fetch")})},e}();t.ExternalResource=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){return function(){}}();t.ILabelValuePair=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){return function(){}}();t.MetadataOptions=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){return function(e,t){this.value=e,this.locale=t}}();t.Translation=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e){this.labels=e}return e.prototype.format=function(e){return-1!=e.indexOf("<a")?e:'<a href="'+e+'">'+(this.labels[e]?this.labels[e]:e)+"</a>"},e}();t.UriLabeller=i}])});

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

var manifold=function(e){var t={};function n(i){if(t[i])return t[i].exports;var s=t[i]={i:i,l:!1,exports:{}};return e[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},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 i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)n.d(i,s,function(t){return e[t]}.bind(null,s));return i},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";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){return function(e){this.isVisible=!0;var t=e.on.match(/.*xywh=(\d*),(\d*),(\d*),(\d*)/);this.x=Number(t[1]),this.y=Number(t[2]),this.width=Number(t[3]),this.height=Number(t[4]),this.chars=e.resource.chars}}();t.AnnotationRect=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),s=function(){function e(e){this._options=e,this._options.locale=this._options.locale||"en-GB"}return e.prototype.bootstrap=function(e,t){var n=this;return new Promise(function(i,s){e&&t&&(i=e,s=t);var o=n._detectIE();if(!1===o)manifesto.Utils.loadManifest(n._options.manifestUri).then(function(e){n._loaded(n,e,i,s)});else if(o>0)if(9===o){var r={url:n._options.manifestUri,type:"GET",dataType:"jsonp",jsonp:"callback",jsonpCallback:"manifestCallback"};$.ajax(r),window.manifestCallback=function(e){n._loaded(n,JSON.stringify(e),i,s)}}else $.getJSON(n._options.manifestUri,function(e){n._loaded(n,JSON.stringify(e),i,s)})})},e.prototype._loaded=function(e,t,n,s){var o=manifesto.Utils.parseManifest(t,{locale:e._options.locale});if(o)if(e._options.iiifResource||(e._options.iiifResource=o),o.getIIIFResourceType()===manifesto.IIIFResourceType.COLLECTION){var r=o.getCollections();r&&r.length?o.getCollectionByIndex(e._options.collectionIndex).then(function(t){t||s("Collection index not found"),0===t.getTotalManifests()&&0===e._options.manifestIndex&&t.getTotalCollections()>0?(e._options.collectionIndex=0,e._options.manifestUri=t.id,e.bootstrap(n,s)):t.getManifestByIndex(e._options.manifestIndex).then(function(t){e._options.manifest=t;var s=new i.Helper(e._options);n(s)})}):o.getManifestByIndex(e._options.manifestIndex).then(function(t){e._options.manifest=t;var s=new i.Helper(e._options);n(s)})}else{e._options.manifest=o;var a=new i.Helper(e._options);n(a)}else console.error("Unable to load IIIF resource")},e.prototype._detectIE=function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(e.indexOf("Trident/")>0){var n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}var i=e.indexOf("Edge/");return i>0&&parseInt(e.substring(i+5,e.indexOf(".",i)),10)},e}();t.Bootstrapper=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),s=n(4),o=n(5),r=n(6),a=function(){function e(e){this.options=e,this.iiifResource=this.options.iiifResource,this.iiifResourceUri=this.options.manifestUri,this.manifest=this.options.manifest,this.collectionIndex=this.options.collectionIndex||0,this.manifestIndex=this.options.manifestIndex||0,this.sequenceIndex=this.options.sequenceIndex||0,this.canvasIndex=this.options.canvasIndex||0}return e.prototype.getAutoCompleteService=function(){var e=this.getSearchService();return e?e.getService(r.ServiceProfile.SEARCH_0_AUTO_COMPLETE):null},e.prototype.getAttribution=function(){console.warn("getAttribution will be deprecated, use getRequiredStatement instead.");var e=this.manifest.getAttribution();return e?manifesto.LanguageMap.getValue(e,this.options.locale):null},e.prototype.getCanvases=function(){return this.getCurrentSequence().getCanvases()},e.prototype.getCanvasById=function(e){return this.getCurrentSequence().getCanvasById(e)},e.prototype.getCanvasesById=function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n],s=this.getCanvasById(i);s&&t.push(s)}return t},e.prototype.getCanvasByIndex=function(e){return this.getCurrentSequence().getCanvasByIndex(e)},e.prototype.getCanvasIndexById=function(e){return this.getCurrentSequence().getCanvasIndexById(e)},e.prototype.getCanvasIndexByLabel=function(e){var t=this.getManifestType()===manifesto.ManifestType.MANUSCRIPT;return this.getCurrentSequence().getCanvasIndexByLabel(e,t)},e.prototype.getCanvasRange=function(e,t){var n=this.getCanvasRanges(e);if(t){for(var i=0;i<n.length;i++){var s=n[i];if(s.path===t)return s}return null}return n[0]},e.prototype.getCanvasRanges=function(e){return e.ranges?e.ranges:(e.ranges=this.manifest.getAllRanges().filter(function(t){return t.getCanvasIds().some(function(t){return manifesto.Utils.normaliseUrl(t)===manifesto.Utils.normaliseUrl(e.id)})}),e.ranges)},e.prototype.getCollectionIndex=function(e){var t=null;return e.parentCollection&&(t=e.parentCollection.index),t},e.prototype.getCurrentCanvas=function(){return this.getCurrentSequence().getCanvasByIndex(this.canvasIndex)},e.prototype.getCurrentSequence=function(){return this.getSequenceByIndex(this.sequenceIndex)},e.prototype.getDescription=function(){var e=this.manifest.getDescription();return e?manifesto.LanguageMap.getValue(e,this.options.locale):null},e.prototype.getLabel=function(){var e=this.manifest.getLabel();return e?manifesto.LanguageMap.getValue(e,this.options.locale):null},e.prototype.getLastCanvasLabel=function(e){return this.getCurrentSequence().getLastCanvasLabel(e)},e.prototype.getFirstPageIndex=function(){return 0},e.prototype.getLastPageIndex=function(){return this.getTotalCanvases()-1},e.prototype.getLicense=function(){return this.manifest.getLicense()},e.prototype.getLogo=function(){return this.manifest.getLogo()},e.prototype.getManifestType=function(){var e=this.manifest.getManifestType();return e===manifesto.ManifestType.EMPTY&&(e=manifesto.ManifestType.MONOGRAPH),e},e.prototype.getMetadata=function(e){var t=[],n=this.manifest.getMetadata(),i=new s.MetadataGroup(this.manifest);(n&&n.length&&i.addMetadata(n,!0),this.manifest.getDescription().length)&&((a=new manifesto.LabelValuePair(this.options.locale)).label=[new manifesto.Language("description",this.options.locale)],a.value=this.manifest.getDescription(),a.isRootLevel=!0,i.addItem(a));this.manifest.getAttribution().length&&((a=new manifesto.LabelValuePair(this.options.locale)).label=[new manifesto.Language("attribution",this.options.locale)],a.value=this.manifest.getAttribution(),a.isRootLevel=!0,i.addItem(a));var o=this.manifest.getLicense();if(o){var r={label:"license",value:e&&e.licenseFormatter?e.licenseFormatter.format(o):o};(a=new manifesto.LabelValuePair(this.options.locale)).parse(r),a.isRootLevel=!0,i.addItem(a)}if(this.manifest.getLogo()){var a;r={label:"logo",value:'<img src="'+this.manifest.getLogo()+'"/>'};(a=new manifesto.LabelValuePair(this.options.locale)).parse(r),a.isRootLevel=!0,i.addItem(a)}return t.push(i),e?this._parseMetadataOptions(e,t):t},e.prototype.getRequiredStatement=function(){var e=this.manifest.getRequiredStatement();return e?{label:e.getLabel(),value:e.getValue()}:null},e.prototype._parseMetadataOptions=function(e,t){var n=this.getCurrentSequence(),i=n.getMetadata();if(i&&i.length){var o=new s.MetadataGroup(n);o.addMetadata(i),t.push(o)}if(e.range){var r=this._getRangeMetadata([],e.range);r=r.reverse(),t=t.concat(r)}if(e.canvases&&e.canvases.length)for(var a=0;a<e.canvases.length;a++){var u=e.canvases[a],g=u.getMetadata();if(g&&g.length){var f=new s.MetadataGroup(u);f.addMetadata(u.getMetadata()),t.push(f)}for(var c=u.getImages(),l=0;l<c.length;l++){var d=c[l],v=d.getMetadata();if(v&&v.length){var h=new s.MetadataGroup(d);h.addMetadata(v),t.push(h)}}}return t},e.prototype._getRangeMetadata=function(e,t){var n=t.getMetadata();if(n&&n.length){var i=new s.MetadataGroup(t);i.addMetadata(n),e.push(i)}else if(t.parentRange)return this._getRangeMetadata(e,t.parentRange);return e},e.prototype.getMultiSelectState=function(){return this._multiSelectState||(this._multiSelectState=new i.MultiSelectState,this._multiSelectState.ranges=this.getRanges().slice(0),this._multiSelectState.canvases=this.getCurrentSequence().getCanvases().slice(0)),this._multiSelectState},e.prototype.getCurrentRange=function(){return this.rangeId?this.getRangeById(this.rangeId):null},e.prototype.getPosterCanvas=function(){return this.manifest.getPosterCanvas()},e.prototype.getPosterImage=function(){var e=this.getPosterCanvas();if(e){var t=e.getContent();if(t&&t.length)return t[0].getBody()[0].id}return null},e.prototype.getPreviousRange=function(e){var t=null;if(t=e||this.getCurrentRange()){var n=this.getFlattenedTree();if(n)for(var i=0;i<n.length;i++){var s=n[i];if(s&&s.data.id===t.id){for(;i>0;){return n[--i].data}break}}}return null},e.prototype.getNextRange=function(e){var t=null;if(t=e||this.getCurrentRange()){var n=this.getFlattenedTree();if(n)for(var i=0;i<n.length;i++){var s=n[i];if(s&&s.data.id===t.id){for(;i<n.length-1;){var o=n[++i];if(o.data.canvases&&o.data.canvases.length)return o.data}break}}}return null},e.prototype.getFlattenedTree=function(e){var t=null;return(t=e||this.getTree())?this._flattenTree(t,"nodes"):null},e.prototype._flattenTree=function(e,t){var n=this,i=[Object.assign({},e)];return delete i[0][t],e[t]&&e[t].length>0?i.concat(e[t].map(function(e){return n._flattenTree(e,t)}).reduce(function(e,t){return e.concat(t)},[])):i},e.prototype.getRanges=function(){return this.manifest.getAllRanges()},e.prototype.getRangeByPath=function(e){return this.manifest.getRangeByPath(e)},e.prototype.getRangeById=function(e){return this.manifest.getRangeById(e)},e.prototype.getRangeCanvases=function(e){var t=e.getCanvasIds();return this.getCanvasesById(t)},e.prototype.getRelated=function(){return this.manifest.getRelated()},e.prototype.getSearchService=function(){return this.manifest.getService(r.ServiceProfile.SEARCH_0)},e.prototype.getSeeAlso=function(){return this.manifest.getSeeAlso()},e.prototype.getSequenceByIndex=function(e){return this.manifest.getSequenceByIndex(e)},e.prototype.getShareServiceUrl=function(){var e=null,t=this.manifest.getService(r.ServiceProfile.SHARE_EXTENSIONS);return t&&(t.length&&(t=t[0]),e=t.__jsonld.shareUrl),e},e.prototype._getSortedTreeNodesByDate=function(e,t){var n=this.getFlattenedTree(t);if(n){var i=n.filter(function(e){return e.data.type===manifesto.TreeNodeType.MANIFEST});this.createDecadeNodes(e,n),this.sortDecadeNodes(e),this.createYearNodes(e,n),this.sortYearNodes(e),this.createMonthNodes(e,i),this.sortMonthNodes(e),this.createDateNodes(e,i),this.pruneDecadeNodes(e)}},e.prototype.getStartCanvasIndex=function(){return this.getCurrentSequence().getStartCanvasIndex()},e.prototype.getThumbs=function(e,t){return this.getCurrentSequence().getThumbs(e,t)},e.prototype.getTopRanges=function(){return this.manifest.getTopRanges()},e.prototype.getTotalCanvases=function(){return this.getCurrentSequence().getTotalCanvases()},e.prototype.getTrackingLabel=function(){return this.manifest.getTrackingLabel()},e.prototype._getTopRanges=function(){return this.iiifResource.getTopRanges()},e.prototype.getTree=function(e,t){if(void 0===e&&(e=0),void 0===t&&(t=o.TreeSortType.NONE),!this.iiifResource)return null;var n;if(this.iiifResource.isCollection())n=this.iiifResource.getDefaultTree();else{var i=this._getTopRanges(),s=new manifesto.TreeNode;if(s.label="root",s.data=this.iiifResource,!i.length)return s;n=i[e].getTree(s)}var r=new manifesto.TreeNode;switch(t){case o.TreeSortType.DATE:if(this.treeHasNavDates(n)){this._getSortedTreeNodesByDate(r,n);break}default:r=n}return r},e.prototype.treeHasNavDates=function(e){var t=this.getFlattenedTree(e);return!!t&&t.some(function(e){return!isNaN(e.navDate)})},e.prototype.getViewingDirection=function(){var e=this.getCurrentSequence().getViewingDirection();return e||(e=this.manifest.getViewingDirection()),e},e.prototype.getViewingHint=function(){var e=this.getCurrentSequence().getViewingHint();return e||(e=this.manifest.getViewingHint()),e},e.prototype.hasParentCollection=function(){return!!this.manifest.parentCollection},e.prototype.hasRelatedPage=function(){var e=this.getRelated();return!!e&&(e.length&&(e=e[0]),"text/html"===e.format)},e.prototype.hasResources=function(){return this.getCurrentCanvas().getResources().length>0},e.prototype.isBottomToTop=function(){var e=this.getViewingDirection();return!!e&&e===r.ViewingDirection.BOTTOM_TO_TOP},e.prototype.isCanvasIndexOutOfRange=function(e){return this.getCurrentSequence().isCanvasIndexOutOfRange(e)},e.prototype.isContinuous=function(){var e=this.getViewingHint();return!!e&&e===r.ViewingHint.CONTINUOUS},e.prototype.isFirstCanvas=function(e){return void 0!==e?this.getCurrentSequence().isFirstCanvas(e):this.getCurrentSequence().isFirstCanvas(this.canvasIndex)},e.prototype.isHorizontallyAligned=function(){return this.isLeftToRight()||this.isRightToLeft()},e.prototype.isLastCanvas=function(e){return void 0!==e?this.getCurrentSequence().isLastCanvas(e):this.getCurrentSequence().isLastCanvas(this.canvasIndex)},e.prototype.isLeftToRight=function(){var e=this.getViewingDirection();return!!e&&e===r.ViewingDirection.LEFT_TO_RIGHT},e.prototype.isMultiCanvas=function(){return this.getCurrentSequence().isMultiCanvas()},e.prototype.isMultiSequence=function(){return this.manifest.isMultiSequence()},e.prototype.isPaged=function(){var e=this.getViewingHint();return e?e===r.ViewingHint.PAGED:this.manifest.isPagingEnabled()},e.prototype.isPagingAvailable=function(){return this.isPagingEnabled()&&this.getTotalCanvases()>2},e.prototype.isPagingEnabled=function(){return this.manifest.isPagingEnabled()||this.getCurrentSequence().isPagingEnabled()},e.prototype.isRightToLeft=function(){var e=this.getViewingDirection();return!!e&&e===r.ViewingDirection.RIGHT_TO_LEFT},e.prototype.isTopToBottom=function(){var e=this.getViewingDirection();return!!e&&e===r.ViewingDirection.TOP_TO_BOTTOM},e.prototype.isTotalCanvasesEven=function(){return this.getCurrentSequence().isTotalCanvasesEven()},e.prototype.isUIEnabled=function(e){var t=this.manifest.getService(r.ServiceProfile.UI_EXTENSIONS);if(t){var n=t.getProperty("disableUI");if(n&&(-1!==n.indexOf(e)||-1!==n.indexOf(e.toLowerCase())))return!1}return!0},e.prototype.isVerticallyAligned=function(){return this.isTopToBottom()||this.isBottomToTop()},e.prototype.createDateNodes=function(e,t){for(var n=0;n<t.length;n++){var i=t[n],s=this.getNodeYear(i),o=this.getNodeMonth(i),r=new manifesto.TreeNode;r.id=i.id,r.label=this.getNodeDisplayDate(i),r.data=i.data,r.data.type=manifesto.TreeNodeType.MANIFEST,r.data.year=s,r.data.month=o;var a=this.getDecadeNode(e,s);if(a){var u=this.getYearNode(a,s);if(u){var g=this.getMonthNode(u,o);g&&g.addNode(r)}}}},e.prototype.createDecadeNodes=function(e,t){for(var n=0;n<t.length;n++){var i=t[n],s=this.getNodeYear(i),o=Number(s.toString().substr(0,3)+"9");if(!this.getDecadeNode(e,s)){var r=new manifesto.TreeNode;r.label=s+" - "+o,r.navDate=i.navDate,r.data.startYear=s,r.data.endYear=o,e.addNode(r)}}},e.prototype.createMonthNodes=function(e,t){for(var n=0;n<t.length;n++){var i=t[n],s=this.getNodeYear(i),o=this.getNodeMonth(i),r=this.getDecadeNode(e,s),a=null;if(r&&(a=this.getYearNode(r,s)),r&&a&&!this.getMonthNode(a,o)){var u=new manifesto.TreeNode;u.label=this.getNodeDisplayMonth(i),u.navDate=i.navDate,u.data.year=s,u.data.month=o,a.addNode(u)}}},e.prototype.createYearNodes=function(e,t){for(var n=0;n<t.length;n++){var i=t[n],s=this.getNodeYear(i),o=this.getDecadeNode(e,s);if(o&&!this.getYearNode(o,s)){var r=new manifesto.TreeNode;r.label=s.toString(),r.navDate=i.navDate,r.data.year=s,o.addNode(r)}}},e.prototype.getDecadeNode=function(e,t){for(var n=0;n<e.nodes.length;n++){var i=e.nodes[n];if(t>=i.data.startYear&&t<=i.data.endYear)return i}return null},e.prototype.getMonthNode=function(e,t){for(var n=0;n<e.nodes.length;n++){var i=e.nodes[n];if(t===this.getNodeMonth(i))return i}return null},e.prototype.getNodeDisplayDate=function(e){return e.navDate.toDateString()},e.prototype.getNodeDisplayMonth=function(e){return["January","February","March","April","May","June","July","August","September","October","November","December"][e.navDate.getMonth()]},e.prototype.getNodeMonth=function(e){return e.navDate.getMonth()},e.prototype.getNodeYear=function(e){return e.navDate.getFullYear()},e.prototype.getYearNode=function(e,t){for(var n=0;n<e.nodes.length;n++){var i=e.nodes[n];if(t===this.getNodeYear(i))return i}return null},e.prototype.pruneDecadeNodes=function(e){for(var t=[],n=0;n<e.nodes.length;n++){var i=e.nodes[n];i.nodes.length||t.push(i)}for(var s=0;s<t.length;s++){var o=t[s],r=e.nodes.indexOf(o);r>-1&&e.nodes.splice(r,1)}},e.prototype.sortDecadeNodes=function(e){e.nodes=e.nodes.sort(function(e,t){return e.data.startYear-t.data.startYear})},e.prototype.sortMonthNodes=function(e){for(var t=this,n=0;n<e.nodes.length;n++)for(var i=e.nodes[n],s=0;s<i.nodes.length;s++){var o=i.nodes[s];o.nodes=o.nodes.sort(function(e,n){return t.getNodeMonth(e)-t.getNodeMonth(n)})}},e.prototype.sortYearNodes=function(e){for(var t=this,n=0;n<e.nodes.length;n++){var i=e.nodes[n];i.nodes=i.nodes.sort(function(e,n){return t.getNodeYear(e)-t.getNodeYear(n)})}},e}();t.Helper=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){this.isEnabled=!1,this.ranges=[],this.canvases=[]}return e.prototype.allCanvasesSelected=function(){return this.canvases.length>0&&this.getAllSelectedCanvases().length===this.canvases.length},e.prototype.allRangesSelected=function(){return this.ranges.length>0&&this.getAllSelectedRanges().length===this.ranges.length},e.prototype.allSelected=function(){return this.allRangesSelected()&&this.allCanvasesSelected()},e.prototype.getAll=function(){return this.canvases.concat(this.ranges)},e.prototype.getAllSelectedCanvases=function(){return this.canvases.filter(function(e){return e.multiSelected})},e.prototype.getAllSelectedRanges=function(){return this.ranges.filter(function(e){return e.multiSelected})},e.prototype.getCanvasById=function(e){return this.canvases.filter(function(t){return t.id===e})[0]},e.prototype.getCanvasesByIds=function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n];t.push(this.getCanvasById(i))}return t},e.prototype.getRangeCanvases=function(e){var t=e.getCanvasIds();return this.getCanvasesByIds(t)},e.prototype.selectAll=function(e){this.selectRanges(this.ranges,e),this.selectCanvases(this.canvases,e)},e.prototype.selectCanvas=function(e,t){this.canvases.filter(function(t){return t.id===e.id})[0].multiSelected=t},e.prototype.selectAllCanvases=function(e){this.selectCanvases(this.canvases,e)},e.prototype.selectCanvases=function(e,t){for(var n=0;n<e.length;n++){e[n].multiSelected=t}},e.prototype.selectRange=function(e,t){var n=this.ranges.filter(function(t){return t.id===e.id})[0];n.multiSelected=t;var i=this.getRangeCanvases(n);this.selectCanvases(i,t)},e.prototype.selectAllRanges=function(e){this.selectRanges(this.ranges,e)},e.prototype.selectRanges=function(e,t){for(var n=0;n<e.length;n++){var i=e[n];i.multiSelected=t;var s=this.getCanvasesByIds(i.getCanvasIds());this.selectCanvases(s,t)}},e.prototype.setEnabled=function(e){this.isEnabled=e;for(var t=this.getAll(),n=0;n<t.length;n++){var i=t[n];i.multiSelectEnabled=this.isEnabled,e||(i.multiSelected=!1)}},e}();t.MultiSelectState=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){this.items=[],this.resource=e,this.label=t}return e.prototype.addItem=function(e){this.items.push(e)},e.prototype.addMetadata=function(e,t){void 0===t&&(t=!1);for(var n=0;n<e.length;n++){var i=e[n];i.isRootLevel=t,this.addItem(i)}},e}();t.MetadataGroup=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.DATE="date",e.NONE="none"}(t.TreeSortType||(t.TreeSortType={}))},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.DOCUMENT="document",e.IMAGE="image",e.MOVING_IMAGE="movingimage",e.PHYSICAL_OBJECT="physicalobject",e.SOUND="sound",e.TEXT="textualbody"}(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.JPG="image/jpeg",e.MP4="video/mp4",e.PDF="application/pdf",e.THREEJS="application/vnd.threejs+json",e.WEBM="video/webm"}(t.MediaType||(t.MediaType={})),function(e){e.DOC="application/msword",e.DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",e.PDF="application/pdf"}(t.RenderingFormat||(t.RenderingFormat={})),function(e){e.IMAGE_0_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/compliance.html#level0",e.IMAGE_0_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/compliance.html#level1",e.IMAGE_0_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/compliance.html#level2",e.IMAGE_0_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/conformance.html#level0",e.IMAGE_0_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/conformance.html#level1",e.IMAGE_0_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/conformance.html#level2",e.IMAGE_1_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",e.IMAGE_1_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",e.IMAGE_1_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",e.IMAGE_1_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",e.IMAGE_1_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",e.IMAGE_1_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",e.IMAGE_1_LEVEL_0="http://iiif.io/api/image/1/level0.json",e.IMAGE_1_PROFILE_LEVEL_0="http://iiif.io/api/image/1/profiles/level0.json",e.IMAGE_1_LEVEL_1="http://iiif.io/api/image/1/level1.json",e.IMAGE_1_PROFILE_LEVEL_1="http://iiif.io/api/image/1/profiles/level1.json",e.IMAGE_1_LEVEL_2="http://iiif.io/api/image/1/level2.json",e.IMAGE_1_PROFILE_LEVEL_2="http://iiif.io/api/image/1/profiles/level2.json",e.IMAGE_2_LEVEL_0="http://iiif.io/api/image/2/level0.json",e.IMAGE_2_PROFILE_LEVEL_0="http://iiif.io/api/image/2/profiles/level0.json",e.IMAGE_2_LEVEL_1="http://iiif.io/api/image/2/level1.json",e.IMAGE_2_PROFILE_LEVEL_1="http://iiif.io/api/image/2/profiles/level1.json",e.IMAGE_2_LEVEL_2="http://iiif.io/api/image/2/level2.json",e.IMAGE_2_PROFILE_LEVEL_2="http://iiif.io/api/image/2/profiles/level2.json",e.AUTH_0_CLICK_THROUGH="http://iiif.io/api/auth/0/login/clickthrough",e.AUTH_0_LOGIN="http://iiif.io/api/auth/0/login",e.AUTH_0_LOGOUT="http://iiif.io/api/auth/0/logout",e.AUTH_0_RESTRICTED="http://iiif.io/api/auth/0/login/restricted",e.AUTH_0_TOKEN="http://iiif.io/api/auth/0/token",e.AUTH_1_CLICK_THROUGH="http://iiif.io/api/auth/1/clickthrough",e.AUTH_1_EXTERNAL="http://iiif.io/api/auth/1/external",e.AUTH_1_KIOSK="http://iiif.io/api/auth/1/kiosk",e.AUTH_1_LOGIN="http://iiif.io/api/auth/1/login",e.AUTH_1_LOGOUT="http://iiif.io/api/auth/1/logout",e.AUTH_1_PROBE="http://iiif.io/api/auth/1/probe",e.AUTH_1_TOKEN="http://iiif.io/api/auth/1/token",e.SEARCH_0="http://iiif.io/api/search/0/search",e.SEARCH_0_AUTO_COMPLETE="http://iiif.io/api/search/0/autocomplete",e.SEARCH_1="http://iiif.io/api/search/1/search",e.SEARCH_1_AUTO_COMPLETE="http://iiif.io/api/search/1/autocomplete",e.TRACKING_EXTENSIONS="http://universalviewer.io/tracking-extensions-profile",e.UI_EXTENSIONS="http://universalviewer.io/ui-extensions-profile",e.PRINT_EXTENSIONS="http://universalviewer.io/print-extensions-profile",e.SHARE_EXTENSIONS="http://universalviewer.io/share-extensions-profile",e.OTHER_MANIFESTATIONS="http://iiif.io/api/otherManifestations.json",e.IXIF="http://wellcomelibrary.org/ld/ixif/0/alpha.json"}(t.ServiceProfile||(t.ServiceProfile={})),function(e){e.BOTTOM_TO_TOP="bottom-to-top",e.LEFT_TO_RIGHT="left-to-right",e.RIGHT_TO_LEFT="right-to-left",e.TOP_TO_BOTTOM="top-to-bottom"}(t.ViewingDirection||(t.ViewingDirection={})),function(e){e.CONTINUOUS="continuous",e.INDIVIDUALS="individuals",e.NON_PAGED="non-paged",e.PAGED="paged",e.TOP="top"}(t.ViewingHint||(t.ViewingHint={}))},function(e,t,n){e.exports=n(8)},function(e,t,n){"use strict";function i(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),i(n(9)),i(n(0)),i(n(1)),i(n(10)),i(n(2)),i(n(11)),i(n(4)),i(n(12)),i(n(3)),i(n(13)),i(n(5)),i(n(14));var s=n(1);t.loadManifest=function(e){return new s.Bootstrapper(e).bootstrap()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),s=function(){function e(e,t){this.rects=[],this.canvasIndex=t,this.addRect(e)}return e.prototype.addRect=function(e){var t=new i.AnnotationRect(e);t.canvasIndex=this.canvasIndex,t.index=this.rects.length,this.rects.push(t),this.rects.sort(function(e,t){return e.index-t.index})},e}();t.AnnotationGroup=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(6),s=function(){function e(e,t){this.authHoldingPage=null,this.clickThroughService=null,this.externalService=null,this.isProbed=!1,this.isResponseHandled=!1,this.kioskService=null,this.loginService=null,this.logoutService=null,this.probeService=null,this.restrictedService=null,this.tokenService=null,e.externalResource=this,this.dataUri=this._getDataUri(e),this.index=e.index,this.authAPIVersion=t.authApiVersion,this._parseAuthServices(e),this._parseDimensions(e)}return e.prototype._getImageServiceDescriptor=function(e){for(var t=null,n=0;n<e.length;n++){var i=e[n],s=i.id;s.endsWith("/")||(s+="/"),manifesto.Utils.isImageProfile(i.getProfile())&&(t=s+"info.json")}return t},e.prototype._getDataUri=function(e){var t=e.getContent(),n=e.getImages(),s=null;if(t&&t.length){var o=t[0].getBody();return o.length?(r=o[0].getServices()).length&&(s=this._getImageServiceDescriptor(r))?s:o[0].id:null}if(n&&n.length){var r,a=n[0].getResource();return(r=a.getServices()).length&&(s=this._getImageServiceDescriptor(r))?s:a.id}var u=e.getService(i.ServiceProfile.IXIF);return u?u.getInfoUri():e.id},e.prototype._parseAuthServices=function(e){if(.9===this.authAPIVersion)this.clickThroughService=manifesto.Utils.getService(e,i.ServiceProfile.AUTH_0_CLICK_THROUGH),this.loginService=manifesto.Utils.getService(e,i.ServiceProfile.AUTH_0_LOGIN),this.restrictedService=manifesto.Utils.getService(e,i.ServiceProfile.AUTH_0_RESTRICTED),this.clickThroughService?(this.logoutService=this.clickThroughService.getService(i.ServiceProfile.AUTH_0_LOGOUT),this.tokenService=this.clickThroughService.getService(i.ServiceProfile.AUTH_0_TOKEN)):this.loginService?(this.logoutService=this.loginService.getService(i.ServiceProfile.AUTH_0_LOGOUT),this.tokenService=this.loginService.getService(i.ServiceProfile.AUTH_0_TOKEN)):this.restrictedService&&(this.logoutService=this.restrictedService.getService(i.ServiceProfile.AUTH_0_LOGOUT),this.tokenService=this.restrictedService.getService(i.ServiceProfile.AUTH_0_TOKEN));else{if(void 0!==e.isCanvas&&e.isCanvas()){var t=e.getContent();if(t&&t.length){var n=t[0].getBody();if(n&&n.length)e=n[0]}}this.clickThroughService=manifesto.Utils.getService(e,i.ServiceProfile.AUTH_1_CLICK_THROUGH),this.loginService=manifesto.Utils.getService(e,i.ServiceProfile.AUTH_1_LOGIN),this.externalService=manifesto.Utils.getService(e,i.ServiceProfile.AUTH_1_EXTERNAL),this.kioskService=manifesto.Utils.getService(e,i.ServiceProfile.AUTH_1_KIOSK),this.clickThroughService?(this.logoutService=this.clickThroughService.getService(i.ServiceProfile.AUTH_1_LOGOUT),this.tokenService=this.clickThroughService.getService(i.ServiceProfile.AUTH_1_TOKEN),this.probeService=this.clickThroughService.getService(i.ServiceProfile.AUTH_1_PROBE)):this.loginService?(this.logoutService=this.loginService.getService(i.ServiceProfile.AUTH_1_LOGOUT),this.tokenService=this.loginService.getService(i.ServiceProfile.AUTH_1_TOKEN),this.probeService=this.loginService.getService(i.ServiceProfile.AUTH_1_PROBE)):this.externalService?(this.logoutService=this.externalService.getService(i.ServiceProfile.AUTH_1_LOGOUT),this.tokenService=this.externalService.getService(i.ServiceProfile.AUTH_1_TOKEN),this.probeService=this.externalService.getService(i.ServiceProfile.AUTH_1_PROBE)):this.kioskService&&(this.logoutService=this.kioskService.getService(i.ServiceProfile.AUTH_1_LOGOUT),this.tokenService=this.kioskService.getService(i.ServiceProfile.AUTH_1_TOKEN),this.probeService=this.kioskService.getService(i.ServiceProfile.AUTH_1_PROBE))}},e.prototype._parseDimensions=function(e){var t=e.getImages();if(t&&t.length){var n=t[0].getResource();this.width=n.getWidth(),this.height=n.getHeight()}else if((t=e.getContent()).length){var i=t[0].getBody();i.length&&(this.width=i[0].getWidth(),this.height=i[0].getHeight())}},e.prototype.isAccessControlled=function(){return!!(this.clickThroughService||this.loginService||this.externalService||this.kioskService||this.probeService)},e.prototype.hasServiceDescriptor=function(){return!!this.dataUri&&this.dataUri.endsWith("info.json")},e.prototype.getData=function(e){var t=this;return t.data={},new Promise(function(n,i){if(t.dataUri)if(t.probeService&&!t.isProbed)t.isProbed=!0,$.ajax({url:t.probeService.id,type:"GET",dataType:"json"}).done(function(e){unescape(e.contentLocation)!==t.dataUri?t.status=HTTPStatusCode.MOVED_TEMPORARILY:t.status=HTTPStatusCode.OK,n(t)}).fail(function(e){t.status=e.status,t.error=e,n(t)});else{var s="GET";if(!t.hasServiceDescriptor()){if(!t.isAccessControlled())return t.status=HTTPStatusCode.OK,void n(t);s="HEAD"}$.ajax({url:t.dataUri,type:s,dataType:"json",beforeSend:function(t){e&&t.setRequestHeader("Authorization","Bearer "+e.accessToken)}}).done(function(e){if(e){var i=unescape(e["@id"]);t.data=e,t._parseAuthServices(t.data),i.endsWith("/info.json")&&(i=i.substr(0,i.lastIndexOf("/")));var s=t.dataUri;s&&s.endsWith("/info.json")&&(s=s.substr(0,s.lastIndexOf("/"))),i!==s&&t.loginService?t.status=HTTPStatusCode.MOVED_TEMPORARILY:t.status=HTTPStatusCode.OK,n(t)}else t.status=HTTPStatusCode.OK,n(t)}).fail(function(e){t.status=e.status,t.error=e,e.responseJSON&&t._parseAuthServices(e.responseJSON),n(t)})}else i("There is no dataUri to fetch")})},e}();t.ExternalResource=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){return function(){}}();t.ILabelValuePair=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){return function(){}}();t.MetadataOptions=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){return function(e,t){this.value=e,this.locale=t}}();t.Translation=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e){this.labels=e}return e.prototype.format=function(e){return-1!=e.indexOf("<a")?e:'<a href="'+e+'">'+(this.labels[e]?this.labels[e]:e)+"</a>"},e}();t.UriLabeller=i}]);
var manifold=function(e){var t={};function n(i){if(t[i])return t[i].exports;var s=t[i]={i:i,l:!1,exports:{}};return e[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},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 i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)n.d(i,s,function(t){return e[t]}.bind(null,s));return i},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";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){return function(e){this.isVisible=!0;var t=e.on.match(/.*xywh=(\d*),(\d*),(\d*),(\d*)/);this.x=Number(t[1]),this.y=Number(t[2]),this.width=Number(t[3]),this.height=Number(t[4]),this.chars=e.resource.chars}}();t.AnnotationRect=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),s=function(){function e(e){this._options=e,this._options.locale=this._options.locale||"en-GB"}return e.prototype.bootstrap=function(e,t){var n=this;return new Promise(function(i,s){e&&t&&(i=e,s=t);var o=n._detectIE();if(!1===o)manifesto.Utils.loadManifest(n._options.manifestUri).then(function(e){n._loaded(n,e,i,s)});else if(o>0)if(9===o){var r={url:n._options.manifestUri,type:"GET",dataType:"jsonp",jsonp:"callback",jsonpCallback:"manifestCallback"};$.ajax(r),window.manifestCallback=function(e){n._loaded(n,JSON.stringify(e),i,s)}}else $.getJSON(n._options.manifestUri,function(e){n._loaded(n,JSON.stringify(e),i,s)})})},e.prototype._loaded=function(e,t,n,s){var o=manifesto.Utils.parseManifest(t,{locale:e._options.locale});if(o)if(e._options.iiifResource||(e._options.iiifResource=o),o.getIIIFResourceType()===manifesto.IIIFResourceType.COLLECTION){var r=o.getCollections();r&&r.length?o.getCollectionByIndex(e._options.collectionIndex).then(function(t){t||s("Collection index not found"),0===t.getTotalManifests()&&0===e._options.manifestIndex&&t.getTotalCollections()>0?(e._options.collectionIndex=0,e._options.manifestUri=t.id,e.bootstrap(n,s)):t.getManifestByIndex(e._options.manifestIndex).then(function(t){e._options.manifest=t;var s=new i.Helper(e._options);n(s)})}):o.getManifestByIndex(e._options.manifestIndex).then(function(t){e._options.manifest=t;var s=new i.Helper(e._options);n(s)})}else{e._options.manifest=o;var a=new i.Helper(e._options);n(a)}else console.error("Unable to load IIIF resource")},e.prototype._detectIE=function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(e.indexOf("Trident/")>0){var n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}var i=e.indexOf("Edge/");return i>0&&parseInt(e.substring(i+5,e.indexOf(".",i)),10)},e}();t.Bootstrapper=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),s=n(4),o=n(5),r=n(6),a=function(){function e(e){this.options=e,this.iiifResource=this.options.iiifResource,this.iiifResourceUri=this.options.manifestUri,this.manifest=this.options.manifest,this.collectionIndex=this.options.collectionIndex||0,this.manifestIndex=this.options.manifestIndex||0,this.sequenceIndex=this.options.sequenceIndex||0,this.canvasIndex=this.options.canvasIndex||0}return e.prototype.getAutoCompleteService=function(){var e=this.getSearchService();return e?e.getService(r.ServiceProfile.SEARCH_0_AUTO_COMPLETE):null},e.prototype.getAttribution=function(){console.warn("getAttribution will be deprecated, use getRequiredStatement instead.");var e=this.manifest.getAttribution();return e?manifesto.LanguageMap.getValue(e,this.options.locale):null},e.prototype.getCanvases=function(){return this.getCurrentSequence().getCanvases()},e.prototype.getCanvasById=function(e){return this.getCurrentSequence().getCanvasById(e)},e.prototype.getCanvasesById=function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n],s=this.getCanvasById(i);s&&t.push(s)}return t},e.prototype.getCanvasByIndex=function(e){return this.getCurrentSequence().getCanvasByIndex(e)},e.prototype.getCanvasIndexById=function(e){return this.getCurrentSequence().getCanvasIndexById(e)},e.prototype.getCanvasIndexByLabel=function(e){var t=this.getManifestType()===manifesto.ManifestType.MANUSCRIPT;return this.getCurrentSequence().getCanvasIndexByLabel(e,t)},e.prototype.getCanvasRange=function(e,t){var n=this.getCanvasRanges(e);if(t){for(var i=0;i<n.length;i++){var s=n[i];if(s.path===t)return s}return null}return n[0]},e.prototype.getCanvasRanges=function(e){return e.ranges?e.ranges:(e.ranges=this.manifest.getAllRanges().filter(function(t){return t.getCanvasIds().some(function(t){return manifesto.Utils.normaliseUrl(t)===manifesto.Utils.normaliseUrl(e.id)})}),e.ranges)},e.prototype.getCollectionIndex=function(e){var t=null;return e.parentCollection&&(t=e.parentCollection.index),t},e.prototype.getCurrentCanvas=function(){return this.getCurrentSequence().getCanvasByIndex(this.canvasIndex)},e.prototype.getCurrentSequence=function(){return this.getSequenceByIndex(this.sequenceIndex)},e.prototype.getDescription=function(){var e=this.manifest.getDescription();return e?manifesto.LanguageMap.getValue(e,this.options.locale):null},e.prototype.getLabel=function(){var e=this.manifest.getLabel();return e?manifesto.LanguageMap.getValue(e,this.options.locale):null},e.prototype.getLastCanvasLabel=function(e){return this.getCurrentSequence().getLastCanvasLabel(e)},e.prototype.getFirstPageIndex=function(){return 0},e.prototype.getLastPageIndex=function(){return this.getTotalCanvases()-1},e.prototype.getLicense=function(){return this.manifest.getLicense()},e.prototype.getLogo=function(){return this.manifest.getLogo()},e.prototype.getManifestType=function(){var e=this.manifest.getManifestType();return e===manifesto.ManifestType.EMPTY&&(e=manifesto.ManifestType.MONOGRAPH),e},e.prototype.getMetadata=function(e){var t=[],n=this.manifest.getMetadata(),i=new s.MetadataGroup(this.manifest);(n&&n.length&&i.addMetadata(n,!0),this.manifest.getDescription().length)&&((a=new manifesto.LabelValuePair(this.options.locale)).label=[new manifesto.Language("description",this.options.locale)],a.value=this.manifest.getDescription(),a.isRootLevel=!0,i.addItem(a));this.manifest.getAttribution().length&&((a=new manifesto.LabelValuePair(this.options.locale)).label=[new manifesto.Language("attribution",this.options.locale)],a.value=this.manifest.getAttribution(),a.isRootLevel=!0,i.addItem(a));var o=this.manifest.getLicense();if(o){var r={label:"license",value:e&&e.licenseFormatter?e.licenseFormatter.format(o):o};(a=new manifesto.LabelValuePair(this.options.locale)).parse(r),a.isRootLevel=!0,i.addItem(a)}if(this.manifest.getLogo()){var a;r={label:"logo",value:'<img src="'+this.manifest.getLogo()+'"/>'};(a=new manifesto.LabelValuePair(this.options.locale)).parse(r),a.isRootLevel=!0,i.addItem(a)}return t.push(i),e?this._parseMetadataOptions(e,t):t},e.prototype.getRequiredStatement=function(){var e=this.manifest.getRequiredStatement();return e?{label:e.getLabel(),value:e.getValue()}:null},e.prototype._parseMetadataOptions=function(e,t){var n=this.getCurrentSequence(),i=n.getMetadata();if(i&&i.length){var o=new s.MetadataGroup(n);o.addMetadata(i),t.push(o)}if(e.range){var r=this._getRangeMetadata([],e.range);r=r.reverse(),t=t.concat(r)}if(e.canvases&&e.canvases.length)for(var a=0;a<e.canvases.length;a++){var u=e.canvases[a],g=u.getMetadata();if(g&&g.length){var f=new s.MetadataGroup(u);f.addMetadata(u.getMetadata()),t.push(f)}for(var c=u.getImages(),l=0;l<c.length;l++){var d=c[l],v=d.getMetadata();if(v&&v.length){var h=new s.MetadataGroup(d);h.addMetadata(v),t.push(h)}}}return t},e.prototype._getRangeMetadata=function(e,t){var n=t.getMetadata();if(n&&n.length){var i=new s.MetadataGroup(t);i.addMetadata(n),e.push(i)}else if(t.parentRange)return this._getRangeMetadata(e,t.parentRange);return e},e.prototype.getMultiSelectState=function(){return this._multiSelectState||(this._multiSelectState=new i.MultiSelectState,this._multiSelectState.ranges=this.getRanges().slice(0),this._multiSelectState.canvases=this.getCurrentSequence().getCanvases().slice(0)),this._multiSelectState},e.prototype.getCurrentRange=function(){return this.rangeId?this.getRangeById(this.rangeId):null},e.prototype.getPosterCanvas=function(){return this.manifest.getPosterCanvas()},e.prototype.getPosterImage=function(){var e=this.getPosterCanvas();if(e){var t=e.getContent();if(t&&t.length)return t[0].getBody()[0].id}return null},e.prototype.getPreviousRange=function(e){var t=null;if(t=e||this.getCurrentRange()){var n=this.getFlattenedTree();if(n)for(var i=0;i<n.length;i++){var s=n[i];if(s&&s.data.id===t.id){for(;i>0;){return n[--i].data}break}}}return null},e.prototype.getNextRange=function(e){var t=null;if(t=e||this.getCurrentRange()){var n=this.getFlattenedTree();if(n)for(var i=0;i<n.length;i++){var s=n[i];if(s&&s.data.id===t.id){for(;i<n.length-1;){var o=n[++i];if(o.data.canvases&&o.data.canvases.length)return o.data}break}}}return null},e.prototype.getFlattenedTree=function(e){var t=null;return(t=e||this.getTree())?this._flattenTree(t,"nodes"):null},e.prototype._flattenTree=function(e,t){var n=this,i=[Object.assign({},e)];return delete i[0][t],e[t]&&e[t].length>0?i.concat(e[t].map(function(e){return n._flattenTree(e,t)}).reduce(function(e,t){return e.concat(t)},[])):i},e.prototype.getRanges=function(){return this.manifest.getAllRanges()},e.prototype.getRangeByPath=function(e){return this.manifest.getRangeByPath(e)},e.prototype.getRangeById=function(e){return this.manifest.getRangeById(e)},e.prototype.getRangeCanvases=function(e){var t=e.getCanvasIds();return this.getCanvasesById(t)},e.prototype.getRelated=function(){return this.manifest.getRelated()},e.prototype.getSearchService=function(){return this.manifest.getService(r.ServiceProfile.SEARCH_0)},e.prototype.getSeeAlso=function(){return this.manifest.getSeeAlso()},e.prototype.getSequenceByIndex=function(e){return this.manifest.getSequenceByIndex(e)},e.prototype.getShareServiceUrl=function(){var e=null,t=this.manifest.getService(r.ServiceProfile.SHARE_EXTENSIONS);return t&&(t.length&&(t=t[0]),e=t.__jsonld.shareUrl),e},e.prototype._getSortedTreeNodesByDate=function(e,t){var n=this.getFlattenedTree(t);if(n){var i=n.filter(function(e){return e.data.type===manifesto.TreeNodeType.MANIFEST});this.createDecadeNodes(e,n),this.sortDecadeNodes(e),this.createYearNodes(e,n),this.sortYearNodes(e),this.createMonthNodes(e,i),this.sortMonthNodes(e),this.createDateNodes(e,i),this.pruneDecadeNodes(e)}},e.prototype.getStartCanvasIndex=function(){return this.getCurrentSequence().getStartCanvasIndex()},e.prototype.getThumbs=function(e,t){return this.getCurrentSequence().getThumbs(e,t)},e.prototype.getTopRanges=function(){return this.manifest.getTopRanges()},e.prototype.getTotalCanvases=function(){return this.getCurrentSequence().getTotalCanvases()},e.prototype.getTrackingLabel=function(){return this.manifest.getTrackingLabel()},e.prototype._getTopRanges=function(){return this.iiifResource.getTopRanges()},e.prototype.getTree=function(e,t){if(void 0===e&&(e=0),void 0===t&&(t=o.TreeSortType.NONE),!this.iiifResource)return null;var n;if(this.iiifResource.isCollection())n=this.iiifResource.getDefaultTree();else{var i=this._getTopRanges(),s=new manifesto.TreeNode;if(s.label="root",s.data=this.iiifResource,!i.length)return s;n=i[e].getTree(s)}var r=new manifesto.TreeNode;switch(t){case o.TreeSortType.DATE:if(this.treeHasNavDates(n)){this._getSortedTreeNodesByDate(r,n);break}default:r=n}return r},e.prototype.treeHasNavDates=function(e){var t=this.getFlattenedTree(e);return!!t&&t.some(function(e){return!isNaN(e.navDate)})},e.prototype.getViewingDirection=function(){var e=this.getCurrentSequence().getViewingDirection();return e||(e=this.manifest.getViewingDirection()),e},e.prototype.getViewingHint=function(){var e=this.getCurrentSequence().getViewingHint();return e||(e=this.manifest.getViewingHint()),e},e.prototype.hasParentCollection=function(){return!!this.manifest.parentCollection},e.prototype.hasRelatedPage=function(){var e=this.getRelated();return!!e&&(e.length&&(e=e[0]),"text/html"===e.format)},e.prototype.hasResources=function(){return this.getCurrentCanvas().getResources().length>0},e.prototype.isBottomToTop=function(){var e=this.getViewingDirection();return!!e&&e===r.ViewingDirection.BOTTOM_TO_TOP},e.prototype.isCanvasIndexOutOfRange=function(e){return this.getCurrentSequence().isCanvasIndexOutOfRange(e)},e.prototype.isContinuous=function(){var e=this.getViewingHint();return!!e&&e===r.ViewingHint.CONTINUOUS},e.prototype.isFirstCanvas=function(e){return void 0!==e?this.getCurrentSequence().isFirstCanvas(e):this.getCurrentSequence().isFirstCanvas(this.canvasIndex)},e.prototype.isHorizontallyAligned=function(){return this.isLeftToRight()||this.isRightToLeft()},e.prototype.isLastCanvas=function(e){return void 0!==e?this.getCurrentSequence().isLastCanvas(e):this.getCurrentSequence().isLastCanvas(this.canvasIndex)},e.prototype.isLeftToRight=function(){var e=this.getViewingDirection();return!!e&&e===r.ViewingDirection.LEFT_TO_RIGHT},e.prototype.isMultiCanvas=function(){return this.getCurrentSequence().isMultiCanvas()},e.prototype.isMultiSequence=function(){return this.manifest.isMultiSequence()},e.prototype.isPaged=function(){var e=this.getViewingHint();return e?e===r.ViewingHint.PAGED:this.manifest.isPagingEnabled()},e.prototype.isPagingAvailable=function(){return this.isPagingEnabled()&&this.getTotalCanvases()>2},e.prototype.isPagingEnabled=function(){return this.manifest.isPagingEnabled()||this.getCurrentSequence().isPagingEnabled()},e.prototype.isRightToLeft=function(){var e=this.getViewingDirection();return!!e&&e===r.ViewingDirection.RIGHT_TO_LEFT},e.prototype.isTopToBottom=function(){var e=this.getViewingDirection();return!!e&&e===r.ViewingDirection.TOP_TO_BOTTOM},e.prototype.isTotalCanvasesEven=function(){return this.getCurrentSequence().isTotalCanvasesEven()},e.prototype.isUIEnabled=function(e){var t=this.manifest.getService(r.ServiceProfile.UI_EXTENSIONS);if(t){var n=t.getProperty("disableUI");if(n&&(-1!==n.indexOf(e)||-1!==n.indexOf(e.toLowerCase())))return!1}return!0},e.prototype.isVerticallyAligned=function(){return this.isTopToBottom()||this.isBottomToTop()},e.prototype.createDateNodes=function(e,t){for(var n=0;n<t.length;n++){var i=t[n],s=this.getNodeYear(i),o=this.getNodeMonth(i),r=new manifesto.TreeNode;r.id=i.id,r.label=this.getNodeDisplayDate(i),r.data=i.data,r.data.type=manifesto.TreeNodeType.MANIFEST,r.data.year=s,r.data.month=o;var a=this.getDecadeNode(e,s);if(a){var u=this.getYearNode(a,s);if(u){var g=this.getMonthNode(u,o);g&&g.addNode(r)}}}},e.prototype.createDecadeNodes=function(e,t){for(var n=0;n<t.length;n++){var i=t[n],s=this.getNodeYear(i),o=Number(s.toString().substr(0,3)+"9");if(!this.getDecadeNode(e,s)){var r=new manifesto.TreeNode;r.label=s+" - "+o,r.navDate=i.navDate,r.data.startYear=s,r.data.endYear=o,e.addNode(r)}}},e.prototype.createMonthNodes=function(e,t){for(var n=0;n<t.length;n++){var i=t[n],s=this.getNodeYear(i),o=this.getNodeMonth(i),r=this.getDecadeNode(e,s),a=null;if(r&&(a=this.getYearNode(r,s)),r&&a&&!this.getMonthNode(a,o)){var u=new manifesto.TreeNode;u.label=this.getNodeDisplayMonth(i),u.navDate=i.navDate,u.data.year=s,u.data.month=o,a.addNode(u)}}},e.prototype.createYearNodes=function(e,t){for(var n=0;n<t.length;n++){var i=t[n],s=this.getNodeYear(i),o=this.getDecadeNode(e,s);if(o&&!this.getYearNode(o,s)){var r=new manifesto.TreeNode;r.label=s.toString(),r.navDate=i.navDate,r.data.year=s,o.addNode(r)}}},e.prototype.getDecadeNode=function(e,t){for(var n=0;n<e.nodes.length;n++){var i=e.nodes[n];if(t>=i.data.startYear&&t<=i.data.endYear)return i}return null},e.prototype.getMonthNode=function(e,t){for(var n=0;n<e.nodes.length;n++){var i=e.nodes[n];if(t===this.getNodeMonth(i))return i}return null},e.prototype.getNodeDisplayDate=function(e){return e.navDate.toDateString()},e.prototype.getNodeDisplayMonth=function(e){return["January","February","March","April","May","June","July","August","September","October","November","December"][e.navDate.getMonth()]},e.prototype.getNodeMonth=function(e){return e.navDate.getMonth()},e.prototype.getNodeYear=function(e){return e.navDate.getFullYear()},e.prototype.getYearNode=function(e,t){for(var n=0;n<e.nodes.length;n++){var i=e.nodes[n];if(t===this.getNodeYear(i))return i}return null},e.prototype.pruneDecadeNodes=function(e){for(var t=[],n=0;n<e.nodes.length;n++){var i=e.nodes[n];i.nodes.length||t.push(i)}for(var s=0;s<t.length;s++){var o=t[s],r=e.nodes.indexOf(o);r>-1&&e.nodes.splice(r,1)}},e.prototype.sortDecadeNodes=function(e){e.nodes=e.nodes.sort(function(e,t){return e.data.startYear-t.data.startYear})},e.prototype.sortMonthNodes=function(e){for(var t=this,n=0;n<e.nodes.length;n++)for(var i=e.nodes[n],s=0;s<i.nodes.length;s++){var o=i.nodes[s];o.nodes=o.nodes.sort(function(e,n){return t.getNodeMonth(e)-t.getNodeMonth(n)})}},e.prototype.sortYearNodes=function(e){for(var t=this,n=0;n<e.nodes.length;n++){var i=e.nodes[n];i.nodes=i.nodes.sort(function(e,n){return t.getNodeYear(e)-t.getNodeYear(n)})}},e}();t.Helper=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){this.isEnabled=!1,this.ranges=[],this.canvases=[]}return e.prototype.allCanvasesSelected=function(){return this.canvases.length>0&&this.getAllSelectedCanvases().length===this.canvases.length},e.prototype.allRangesSelected=function(){return this.ranges.length>0&&this.getAllSelectedRanges().length===this.ranges.length},e.prototype.allSelected=function(){return this.allRangesSelected()&&this.allCanvasesSelected()},e.prototype.getAll=function(){return this.canvases.concat(this.ranges)},e.prototype.getAllSelectedCanvases=function(){return this.canvases.filter(function(e){return e.multiSelected})},e.prototype.getAllSelectedRanges=function(){return this.ranges.filter(function(e){return e.multiSelected})},e.prototype.getCanvasById=function(e){return this.canvases.filter(function(t){return manifesto.Utils.normaliseUrl(t.id)===manifesto.Utils.normaliseUrl(e)})[0]},e.prototype.getCanvasesByIds=function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n];t.push(this.getCanvasById(i))}return t},e.prototype.getRangeCanvases=function(e){var t=e.getCanvasIds();return this.getCanvasesByIds(t)},e.prototype.selectAll=function(e){this.selectRanges(this.ranges,e),this.selectCanvases(this.canvases,e)},e.prototype.selectCanvas=function(e,t){this.canvases.filter(function(t){return t.id===e.id})[0].multiSelected=t},e.prototype.selectAllCanvases=function(e){this.selectCanvases(this.canvases,e)},e.prototype.selectCanvases=function(e,t){for(var n=0;n<e.length;n++){e[n].multiSelected=t}},e.prototype.selectRange=function(e,t){var n=this.ranges.filter(function(t){return t.id===e.id})[0];n.multiSelected=t;var i=this.getRangeCanvases(n);this.selectCanvases(i,t)},e.prototype.selectAllRanges=function(e){this.selectRanges(this.ranges,e)},e.prototype.selectRanges=function(e,t){for(var n=0;n<e.length;n++){var i=e[n];i.multiSelected=t;var s=this.getCanvasesByIds(i.getCanvasIds());this.selectCanvases(s,t)}},e.prototype.setEnabled=function(e){this.isEnabled=e;for(var t=this.getAll(),n=0;n<t.length;n++){var i=t[n];i.multiSelectEnabled=this.isEnabled,e||(i.multiSelected=!1)}},e}();t.MultiSelectState=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){this.items=[],this.resource=e,this.label=t}return e.prototype.addItem=function(e){this.items.push(e)},e.prototype.addMetadata=function(e,t){void 0===t&&(t=!1);for(var n=0;n<e.length;n++){var i=e[n];i.isRootLevel=t,this.addItem(i)}},e}();t.MetadataGroup=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.DATE="date",e.NONE="none"}(t.TreeSortType||(t.TreeSortType={}))},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.DOCUMENT="document",e.IMAGE="image",e.MOVING_IMAGE="movingimage",e.PHYSICAL_OBJECT="physicalobject",e.SOUND="sound",e.TEXT="textualbody"}(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.JPG="image/jpeg",e.MP4="video/mp4",e.PDF="application/pdf",e.THREEJS="application/vnd.threejs+json",e.WEBM="video/webm"}(t.MediaType||(t.MediaType={})),function(e){e.DOC="application/msword",e.DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",e.PDF="application/pdf"}(t.RenderingFormat||(t.RenderingFormat={})),function(e){e.IMAGE_0_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/compliance.html#level0",e.IMAGE_0_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/compliance.html#level1",e.IMAGE_0_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/compliance.html#level2",e.IMAGE_0_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/conformance.html#level0",e.IMAGE_0_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/conformance.html#level1",e.IMAGE_0_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/conformance.html#level2",e.IMAGE_1_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",e.IMAGE_1_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",e.IMAGE_1_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",e.IMAGE_1_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",e.IMAGE_1_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",e.IMAGE_1_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",e.IMAGE_1_LEVEL_0="http://iiif.io/api/image/1/level0.json",e.IMAGE_1_PROFILE_LEVEL_0="http://iiif.io/api/image/1/profiles/level0.json",e.IMAGE_1_LEVEL_1="http://iiif.io/api/image/1/level1.json",e.IMAGE_1_PROFILE_LEVEL_1="http://iiif.io/api/image/1/profiles/level1.json",e.IMAGE_1_LEVEL_2="http://iiif.io/api/image/1/level2.json",e.IMAGE_1_PROFILE_LEVEL_2="http://iiif.io/api/image/1/profiles/level2.json",e.IMAGE_2_LEVEL_0="http://iiif.io/api/image/2/level0.json",e.IMAGE_2_PROFILE_LEVEL_0="http://iiif.io/api/image/2/profiles/level0.json",e.IMAGE_2_LEVEL_1="http://iiif.io/api/image/2/level1.json",e.IMAGE_2_PROFILE_LEVEL_1="http://iiif.io/api/image/2/profiles/level1.json",e.IMAGE_2_LEVEL_2="http://iiif.io/api/image/2/level2.json",e.IMAGE_2_PROFILE_LEVEL_2="http://iiif.io/api/image/2/profiles/level2.json",e.AUTH_0_CLICK_THROUGH="http://iiif.io/api/auth/0/login/clickthrough",e.AUTH_0_LOGIN="http://iiif.io/api/auth/0/login",e.AUTH_0_LOGOUT="http://iiif.io/api/auth/0/logout",e.AUTH_0_RESTRICTED="http://iiif.io/api/auth/0/login/restricted",e.AUTH_0_TOKEN="http://iiif.io/api/auth/0/token",e.AUTH_1_CLICK_THROUGH="http://iiif.io/api/auth/1/clickthrough",e.AUTH_1_EXTERNAL="http://iiif.io/api/auth/1/external",e.AUTH_1_KIOSK="http://iiif.io/api/auth/1/kiosk",e.AUTH_1_LOGIN="http://iiif.io/api/auth/1/login",e.AUTH_1_LOGOUT="http://iiif.io/api/auth/1/logout",e.AUTH_1_PROBE="http://iiif.io/api/auth/1/probe",e.AUTH_1_TOKEN="http://iiif.io/api/auth/1/token",e.SEARCH_0="http://iiif.io/api/search/0/search",e.SEARCH_0_AUTO_COMPLETE="http://iiif.io/api/search/0/autocomplete",e.SEARCH_1="http://iiif.io/api/search/1/search",e.SEARCH_1_AUTO_COMPLETE="http://iiif.io/api/search/1/autocomplete",e.TRACKING_EXTENSIONS="http://universalviewer.io/tracking-extensions-profile",e.UI_EXTENSIONS="http://universalviewer.io/ui-extensions-profile",e.PRINT_EXTENSIONS="http://universalviewer.io/print-extensions-profile",e.SHARE_EXTENSIONS="http://universalviewer.io/share-extensions-profile",e.OTHER_MANIFESTATIONS="http://iiif.io/api/otherManifestations.json",e.IXIF="http://wellcomelibrary.org/ld/ixif/0/alpha.json"}(t.ServiceProfile||(t.ServiceProfile={})),function(e){e.BOTTOM_TO_TOP="bottom-to-top",e.LEFT_TO_RIGHT="left-to-right",e.RIGHT_TO_LEFT="right-to-left",e.TOP_TO_BOTTOM="top-to-bottom"}(t.ViewingDirection||(t.ViewingDirection={})),function(e){e.CONTINUOUS="continuous",e.INDIVIDUALS="individuals",e.NON_PAGED="non-paged",e.PAGED="paged",e.TOP="top"}(t.ViewingHint||(t.ViewingHint={}))},function(e,t,n){e.exports=n(8)},function(e,t,n){"use strict";function i(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),i(n(9)),i(n(0)),i(n(1)),i(n(10)),i(n(2)),i(n(11)),i(n(4)),i(n(12)),i(n(3)),i(n(13)),i(n(5)),i(n(14));var s=n(1);t.loadManifest=function(e){return new s.Bootstrapper(e).bootstrap()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),s=function(){function e(e,t){this.rects=[],this.canvasIndex=t,this.addRect(e)}return e.prototype.addRect=function(e){var t=new i.AnnotationRect(e);t.canvasIndex=this.canvasIndex,t.index=this.rects.length,this.rects.push(t),this.rects.sort(function(e,t){return e.index-t.index})},e}();t.AnnotationGroup=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(6),s=function(){function e(e,t){this.authHoldingPage=null,this.clickThroughService=null,this.externalService=null,this.isProbed=!1,this.isResponseHandled=!1,this.kioskService=null,this.loginService=null,this.logoutService=null,this.probeService=null,this.restrictedService=null,this.tokenService=null,e.externalResource=this,this.dataUri=this._getDataUri(e),this.index=e.index,this.authAPIVersion=t.authApiVersion,this._parseAuthServices(e),this._parseDimensions(e)}return e.prototype._getImageServiceDescriptor=function(e){for(var t=null,n=0;n<e.length;n++){var i=e[n],s=i.id;s.endsWith("/")||(s+="/"),manifesto.Utils.isImageProfile(i.getProfile())&&(t=s+"info.json")}return t},e.prototype._getDataUri=function(e){var t=e.getContent(),n=e.getImages(),s=null;if(t&&t.length){var o=t[0].getBody();return o.length?(r=o[0].getServices()).length&&(s=this._getImageServiceDescriptor(r))?s:o[0].id:null}if(n&&n.length){var r,a=n[0].getResource();return(r=a.getServices()).length&&(s=this._getImageServiceDescriptor(r))?s:a.id}var u=e.getService(i.ServiceProfile.IXIF);return u?u.getInfoUri():e.id},e.prototype._parseAuthServices=function(e){if(.9===this.authAPIVersion)this.clickThroughService=manifesto.Utils.getService(e,i.ServiceProfile.AUTH_0_CLICK_THROUGH),this.loginService=manifesto.Utils.getService(e,i.ServiceProfile.AUTH_0_LOGIN),this.restrictedService=manifesto.Utils.getService(e,i.ServiceProfile.AUTH_0_RESTRICTED),this.clickThroughService?(this.logoutService=this.clickThroughService.getService(i.ServiceProfile.AUTH_0_LOGOUT),this.tokenService=this.clickThroughService.getService(i.ServiceProfile.AUTH_0_TOKEN)):this.loginService?(this.logoutService=this.loginService.getService(i.ServiceProfile.AUTH_0_LOGOUT),this.tokenService=this.loginService.getService(i.ServiceProfile.AUTH_0_TOKEN)):this.restrictedService&&(this.logoutService=this.restrictedService.getService(i.ServiceProfile.AUTH_0_LOGOUT),this.tokenService=this.restrictedService.getService(i.ServiceProfile.AUTH_0_TOKEN));else{if(void 0!==e.isCanvas&&e.isCanvas()){var t=e.getContent();if(t&&t.length){var n=t[0].getBody();if(n&&n.length)e=n[0]}}this.clickThroughService=manifesto.Utils.getService(e,i.ServiceProfile.AUTH_1_CLICK_THROUGH),this.loginService=manifesto.Utils.getService(e,i.ServiceProfile.AUTH_1_LOGIN),this.externalService=manifesto.Utils.getService(e,i.ServiceProfile.AUTH_1_EXTERNAL),this.kioskService=manifesto.Utils.getService(e,i.ServiceProfile.AUTH_1_KIOSK),this.clickThroughService?(this.logoutService=this.clickThroughService.getService(i.ServiceProfile.AUTH_1_LOGOUT),this.tokenService=this.clickThroughService.getService(i.ServiceProfile.AUTH_1_TOKEN),this.probeService=this.clickThroughService.getService(i.ServiceProfile.AUTH_1_PROBE)):this.loginService?(this.logoutService=this.loginService.getService(i.ServiceProfile.AUTH_1_LOGOUT),this.tokenService=this.loginService.getService(i.ServiceProfile.AUTH_1_TOKEN),this.probeService=this.loginService.getService(i.ServiceProfile.AUTH_1_PROBE)):this.externalService?(this.logoutService=this.externalService.getService(i.ServiceProfile.AUTH_1_LOGOUT),this.tokenService=this.externalService.getService(i.ServiceProfile.AUTH_1_TOKEN),this.probeService=this.externalService.getService(i.ServiceProfile.AUTH_1_PROBE)):this.kioskService&&(this.logoutService=this.kioskService.getService(i.ServiceProfile.AUTH_1_LOGOUT),this.tokenService=this.kioskService.getService(i.ServiceProfile.AUTH_1_TOKEN),this.probeService=this.kioskService.getService(i.ServiceProfile.AUTH_1_PROBE))}},e.prototype._parseDimensions=function(e){var t=e.getImages();if(t&&t.length){var n=t[0].getResource();this.width=n.getWidth(),this.height=n.getHeight()}else if((t=e.getContent()).length){var i=t[0].getBody();i.length&&(this.width=i[0].getWidth(),this.height=i[0].getHeight())}},e.prototype.isAccessControlled=function(){return!!(this.clickThroughService||this.loginService||this.externalService||this.kioskService||this.probeService)},e.prototype.hasServiceDescriptor=function(){return!!this.dataUri&&this.dataUri.endsWith("info.json")},e.prototype.getData=function(e){var t=this;return t.data={},new Promise(function(n,i){if(t.dataUri)if(t.probeService&&!t.isProbed)t.isProbed=!0,$.ajax({url:t.probeService.id,type:"GET",dataType:"json"}).done(function(e){unescape(e.contentLocation)!==t.dataUri?t.status=HTTPStatusCode.MOVED_TEMPORARILY:t.status=HTTPStatusCode.OK,n(t)}).fail(function(e){t.status=e.status,t.error=e,n(t)});else{var s="GET";if(!t.hasServiceDescriptor()){if(!t.isAccessControlled())return t.status=HTTPStatusCode.OK,void n(t);s="HEAD"}$.ajax({url:t.dataUri,type:s,dataType:"json",beforeSend:function(t){e&&t.setRequestHeader("Authorization","Bearer "+e.accessToken)}}).done(function(e){if(e){var i=unescape(e["@id"]);t.data=e,t._parseAuthServices(t.data),i.endsWith("/info.json")&&(i=i.substr(0,i.lastIndexOf("/")));var s=t.dataUri;s&&s.endsWith("/info.json")&&(s=s.substr(0,s.lastIndexOf("/"))),i!==s&&t.loginService?t.status=HTTPStatusCode.MOVED_TEMPORARILY:t.status=HTTPStatusCode.OK,n(t)}else t.status=HTTPStatusCode.OK,n(t)}).fail(function(e){t.status=e.status,t.error=e,e.responseJSON&&t._parseAuthServices(e.responseJSON),n(t)})}else i("There is no dataUri to fetch")})},e}();t.ExternalResource=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){return function(){}}();t.ILabelValuePair=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){return function(){}}();t.MetadataOptions=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){return function(e,t){this.value=e,this.locale=t}}();t.Translation=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e){this.labels=e}return e.prototype.format=function(e){return-1!=e.indexOf("<a")?e:'<a href="'+e+'">'+(this.labels[e]?this.labels[e]:e)+"</a>"},e}();t.UriLabeller=i}]);
//# sourceMappingURL=manifold.js.map
{
"name": "@iiif/manifold",
"version": "2.0.0-pre.5",
"version": "2.0.0-pre.6",
"description": "",

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet