UNPKG

universalviewer

Version:

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

2 lines 166 kB
/*! For license information please see 4864.b0b319b4f29542847e0e.js.LICENSE.txt */ (self.webpackChunkUV=self.webpackChunkUV||[]).push([[4864],{2084:e=>{window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CONTINUE=100,t.SWITCHING_PROTOCOLS=101,t.PROCESSING=102,t.OK=200,t.CREATED=201,t.ACCEPTED=202,t.NON_AUTHORITATIVE_INFORMATION=203,t.NO_CONTENT=204,t.RESET_CONTENT=205,t.PARTIAL_CONTENT=206,t.MULTI_STATUS=207,t.MULTIPLE_CHOICES=300,t.MOVED_PERMANENTLY=301,t.MOVED_TEMPORARILY=302,t.SEE_OTHER=303,t.NOT_MODIFIED=304,t.USE_PROXY=305,t.TEMPORARY_REDIRECT=307,t.BAD_REQUEST=400,t.UNAUTHORIZED=401,t.PAYMENT_REQUIRED=402,t.FORBIDDEN=403,t.NOT_FOUND=404,t.METHOD_NOT_ALLOWED=405,t.NOT_ACCEPTABLE=406,t.PROXY_AUTHENTICATION_REQUIRED=407,t.REQUEST_TIME_OUT=408,t.CONFLICT=409,t.GONE=410,t.LENGTH_REQUIRED=411,t.PRECONDITION_FAILED=412,t.REQUEST_ENTITY_TOO_LARGE=413,t.REQUEST_URI_TOO_LARGE=414,t.UNSUPPORTED_MEDIA_TYPE=415,t.REQUESTED_RANGE_NOT_SATISFIABLE=416,t.EXPECTATION_FAILED=417,t.IM_A_TEAPOT=418,t.UNPROCESSABLE_ENTITY=422,t.LOCKED=423,t.FAILED_DEPENDENCY=424,t.UNORDERED_COLLECTION=425,t.UPGRADE_REQUIRED=426,t.PRECONDITION_REQUIRED=428,t.TOO_MANY_REQUESTS=429,t.REQUEST_HEADER_FIELDS_TOO_LARGE=431,t.INTERNAL_SERVER_ERROR=500,t.NOT_IMPLEMENTED=501,t.BAD_GATEWAY=502,t.SERVICE_UNAVAILABLE=503,t.GATEWAY_TIME_OUT=504,t.HTTP_VERSION_NOT_SUPPORTED=505,t.VARIANT_ALSO_NEGOTIATES=506,t.INSUFFICIENT_STORAGE=507,t.BANDWIDTH_LIMIT_EXCEEDED=509,t.NOT_EXTENDED=510,t.NETWORK_AUTHENTICATION_REQUIRED=511}])},8939:(e,t,n)=>{"use strict";n.d(t,{ll:()=>a,LH:()=>v,pF:()=>r,x0:()=>_,UG:()=>y});var r,i=function(e){this.isVisible=!0;var t=e.target.match(/.*[^n]xyz=(-?\d+(?:\.\d+)?),(-?\d+(?:\.\d+)?),(-?\d+(?:\.\d+)?)/),n=e.target.match(/.*nxyz=(-?\d+(?:\.\d+)?),(-?\d+(?:\.\d+)?),(-?\d+(?:\.\d+)?)/);this.bodyValue=e.bodyValue,this.x=Number(t[1]),this.y=Number(t[2]),this.z=Number(t[3]),this.nx=Number(n[1]),this.ny=Number(n[2]),this.nz=Number(n[3])},o=function(e){var t;this.isVisible=!0,e.on?(t=e.on.match(/.*xywh=(\d*),(\d*),(\d*),(\d*)/),this.chars=e.resource.chars):(t=e.target.match(/.*xywh=(\d*),(\d*),(\d*),(\d*)/),this.chars=e.bodyValue),this.x=Number(t[1]),this.y=Number(t[2]),this.width=Number(t[3]),this.height=Number(t[4])},a=function(){function e(e){this.rects=[],this.points3D=[],this.canvasId=e}return e.prototype.addRect=function(e){var t=new o(e);t.canvasId=this.canvasId,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.prototype.addPoint3D=function(e){var t=new i(e);t.canvasId=this.canvasId,t.canvasIndex=this.canvasIndex,t.index=this.points3D.length,this.points3D.push(t),this.points3D.sort((function(e,t){return e.index-t.index}))},e}(),s=n(6947),l=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 s.Utils.normaliseUrl(t.id)===s.Utils.normaliseUrl(e)}))[0]},e.prototype.getCanvasesByIds=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(this.getCanvasById(r))}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 r=this.getRangeCanvases(n);this.selectCanvases(r,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 r=e[n];r.multiSelected=t;var i=this.getCanvasesByIds(r.getCanvasIds());this.selectCanvases(i,t)}},e.prototype.setEnabled=function(e){this.isEnabled=e;for(var t=this.getAll(),n=0;n<t.length;n++){var r=t[n];r.multiSelectEnabled=this.isEnabled,e||(r.multiSelected=!1)}},e}(),u=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 r=e[n];r.isRootLevel=t,this.addItem(r)}},e}();!function(e){e.DATE="date",e.NONE="none"}(r||(r={}));var c=n(3911),p=function(){function e(){}return e.manifestNotLoaded="Manifest has not loaded yet",e}(),f=function(){return f=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},f.apply(this,arguments)},h=function(){function e(e){if(this.options=e,this.iiifResource=this.options.iiifResource,this.manifestUri=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,this.options.canvasId){var t=this.getCanvasIndexById(this.options.canvasId);null!==t&&(this.canvasIndex=t)}}return e.prototype.getAutoCompleteService=function(){var e=this.getSearchService(),t=null;return e&&((t=e.getService(c.vl.SEARCH_0_AUTO_COMPLETE))||(t=e.getService(c.vl.SEARCH_1_AUTO_COMPLETE))),t},e.prototype.getAttribution=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);var e=this.manifest.getAttribution();return e?e.getValue(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 r=e[n],i=this.getCanvasById(r);i&&t.push(i)}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()===s.ManifestType.MANUSCRIPT;return this.getCurrentSequence().getCanvasIndexByLabel(e,t)},e.prototype.getCanvasRange=function(e,t){var n=this.getCanvasRanges(e);if(t){for(var r=0;r<n.length;r++){var i=n[r];if(i.path===t)return i}return null}return n[0]},e.prototype.getCanvasRanges=function(e){if(!this.manifest)throw new Error(p.manifestNotLoaded);return e.ranges||(e.ranges=this.manifest.getAllRanges().filter((function(t){return t.getCanvasIds().some((function(t){return s.Utils.normaliseUrl(t)===s.Utils.normaliseUrl(e.id)}))}))),e.ranges},e.prototype.getCollectionIndex=function(e){if(!e.parentCollection||e.parentCollection.parentCollection)return e.parentCollection?e.parentCollection.index:void 0},e.prototype.getCurrentCanvas=function(){return this.getCurrentSequence().getCanvasByIndex(this.canvasIndex)},e.prototype.getCurrentSequence=function(){return this.getSequenceByIndex(this.sequenceIndex)},e.prototype.getDescription=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);var e=this.manifest.getDescription();return e?e.getValue(this.options.locale):null},e.prototype.getLabel=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);var e=this.manifest.getLabel();return e?e.getValue(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(){if(!this.manifest)throw new Error(p.manifestNotLoaded);return this.manifest.getLicense()},e.prototype.getLogo=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);return this.manifest.getLogo()},e.prototype.getManifestType=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);var e=this.manifest.getManifestType();return e===s.ManifestType.EMPTY&&(e=s.ManifestType.MONOGRAPH),e},e.prototype.getMetadata=function(e){if(!this.manifest)throw new Error(p.manifestNotLoaded);var t=[],n=this.manifest.getMetadata(),r=new u(this.manifest),i=this.options.locale;n&&n.length&&r.addMetadata(n,!0),this.manifest.getDescription().length&&((o=new s.LabelValuePair(i)).label=new s.PropertyValue([new s.LocalizedValue("description",i)]),o.value=this.manifest.getDescription(),o.isRootLevel=!0,r.addItem(o)),this.manifest.getAttribution().length&&((o=new s.LabelValuePair(i)).label=new s.PropertyValue([new s.LocalizedValue("attribution",i)]),o.value=this.manifest.getAttribution(),o.isRootLevel=!0,r.addItem(o));var o,a=this.manifest.getLicense();if(a){var l={label:"license",value:e&&e.licenseFormatter?e.licenseFormatter.format(a):a};(o=new s.LabelValuePair(i)).parse(l),o.isRootLevel=!0,r.addItem(o)}this.manifest.getLogo()&&(l={label:"logo",value:'<img alt="logo" src="'+this.manifest.getLogo()+'"/>'},(o=new s.LabelValuePair(i)).parse(l),o.isRootLevel=!0,r.addItem(o));return t.push(r),e?this._parseMetadataOptions(e,t):t},e.prototype.getAllRequiredStatements=function(){var e=[],t=this.getCurrentRange();if(t){var n=t.getRequiredStatement?t.getRequiredStatement():null;n&&e.push(f(f({},this.parseStatement(n)),{source:"Range"}))}var r=this.getCurrentCanvas();if(r){var i=r.getRequiredStatement?r.getRequiredStatement():null;i&&e.push(f(f({},this.parseStatement(i)),{source:"Canvas"}))}if(this.manifest){var o=this.manifest.getRequiredStatement();o&&o&&e.push(f(f({},this.parseStatement(o)),{source:"Manifest"}))}return e},e.prototype.getMostSpecificRequiredStatement=function(){var e=this.getAllRequiredStatements(),t=e.find((function(e){return"Range"===e.source}));if(t)return t;var n=e.find((function(e){return"Canvas"===e.source}));return n||(e.find((function(e){return"Manifest"===e.source}))||null)},e.prototype.getRequiredStatement=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);var e=this.manifest.getRequiredStatement();return e?this.parseStatement(e):null},e.prototype.parseStatement=function(e){return{label:e.label?e.getLabel():"",value:e.value&&e.value.length?e.getValue():""}},e.prototype._parseMetadataOptions=function(e,t){var n=this.getCurrentSequence(),r=n.getMetadata();if(r&&r.length){var i=new u(n);i.addMetadata(r),t.push(i)}if(e.range){var o=this._getRangeMetadata([],e.range);o=o.reverse(),t=t.concat(o)}if(e.canvases&&e.canvases.length)for(var a=0;a<e.canvases.length;a++){var s=e.canvases[a],l=s.getMetadata();if(l&&l.length){var c=new u(s);c.addMetadata(s.getMetadata()),t.push(c)}for(var p=s.getImages(),f=0;f<p.length;f++){var h=p[f],d=h.getMetadata();if(d&&d.length){var g=new u(h);g.addMetadata(d),t.push(g)}}}return t},e.prototype._getRangeMetadata=function(e,t){var n=t.getMetadata();if(n&&n.length){var r=new u(t);r.addMetadata(n),e.push(r)}else if(t.parentRange)return this._getRangeMetadata(e,t.parentRange);return e},e.prototype.getMultiSelectState=function(){return this._multiSelectState||(this._multiSelectState=new l,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(){if(!this.manifest)throw new Error(p.manifestNotLoaded);return this.manifest.getPosterCanvas()},e.prototype.getAccompanyingCanvas=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);return this.manifest.getAccompanyingCanvas()},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.getAccompanyingCanvasImage=function(){var e=this.getAccompanyingCanvas();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;if(t=e||this.getCurrentRange()){var n=this.getFlattenedTree();if(n)for(var r=0;r<n.length;r++){var i=n[r];if(i&&i.data.id===t.id){for(;r>0;)return n[--r].data;break}}}return null},e.prototype.getNextRange=function(e){var t;if(t=e||this.getCurrentRange()){var n=this.getFlattenedTree();if(n)for(var r=0;r<n.length;r++){var i=n[r];if(i&&i.data.id===t.id){for(;r<n.length-1;){var o=n[++r];if(o.data.canvases&&o.data.canvases.length)return o.data}break}}}return null},e.prototype.getFlattenedTree=function(e){var t;return(t=e||this.getTree())?this._flattenTree(t,"nodes"):null},e.prototype._flattenTree=function(e,t){var n=this,r=[e];return e[t]&&e[t].length>0?r.concat(e[t].map((function(e){return n._flattenTree(e,t)})).reduce((function(e,t){return e.concat(t)}),[])):r},e.prototype.getRanges=function(){return this.manifest.getAllRanges()},e.prototype.getRangeByPath=function(e){if(!this.manifest)throw new Error(p.manifestNotLoaded);return this.manifest.getRangeByPath(e)},e.prototype.getRangeById=function(e){if(!this.manifest)throw new Error(p.manifestNotLoaded);return this.manifest.getRangeById(e)},e.prototype.getRangeCanvases=function(e){var t=e.getCanvasIds();return this.getCanvasesById(t)},e.prototype.getRelated=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);return this.manifest.getRelated()},e.prototype.getSearchService=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);var e=this.manifest.getService(c.vl.SEARCH_0);return e||(e=this.manifest.getService(c.vl.SEARCH_1)),e},e.prototype.getSeeAlso=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);return this.manifest.getSeeAlso()},e.prototype.getSequenceByIndex=function(e){if(!this.manifest)throw new Error(p.manifestNotLoaded);return this.manifest.getSequenceByIndex(e)},e.prototype.getShareServiceUrl=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);var e=null,t=this.manifest.getService(c.vl.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 r=n.filter((function(e){return e.data.type===s.TreeNodeType.MANIFEST}));this.createDecadeNodes(e,n),this.sortDecadeNodes(e),this.createYearNodes(e,n),this.sortYearNodes(e),this.createMonthNodes(e,r),this.sortMonthNodes(e),this.createDateNodes(e,r),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(){if(!this.manifest)throw new Error(p.manifestNotLoaded);return this.manifest.getTopRanges()},e.prototype.getTotalCanvases=function(){return this.getCurrentSequence().getTotalCanvases()},e.prototype.getTrackingLabel=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);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=r.NONE),!this.iiifResource)return null;var n;if(this.iiifResource.isCollection())n=this.iiifResource.getDefaultTree();else{var i=this._getTopRanges(),o=new s.TreeNode;if(o.label="root",o.data=this.iiifResource,!i.length)return o;n=i[e].getTree(o)}var a=new s.TreeNode;return t.toString()===r.DATE.toString()&&this.treeHasNavDates(n)?(this._getSortedTreeNodesByDate(a,n),a):n},e.prototype.treeHasNavDates=function(e){var t=this.getFlattenedTree(e);return!!t&&t.some((function(e){return!isNaN(e.navDate)}))},e.prototype.getViewingDirection=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);var e=this.getCurrentSequence().getViewingDirection();return e||(e=this.manifest.getViewingDirection()),e},e.prototype.getViewingHint=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);var e=this.getCurrentSequence().getViewingHint();return e||(e=this.manifest.getViewingHint()),e},e.prototype.hasParentCollection=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);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===c.Pr.BOTTOM_TO_TOP},e.prototype.isCanvasIndexOutOfRange=function(e){return this.getCurrentSequence().isCanvasIndexOutOfRange(e)},e.prototype.isContinuous=function(){var e=this.getViewingHint();return!!e&&e===c.qQ.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===c.Pr.LEFT_TO_RIGHT},e.prototype.isMultiCanvas=function(){return this.getCurrentSequence().isMultiCanvas()},e.prototype.isMultiSequence=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);return this.manifest.isMultiSequence()},e.prototype.isPaged=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);var e=this.getViewingHint();return e?e===c.qQ.PAGED:this.manifest.isPagingEnabled()},e.prototype.isPagingAvailable=function(){return this.isPagingEnabled()&&this.getTotalCanvases()>2},e.prototype.isPagingEnabled=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);return this.manifest.isPagingEnabled()||this.getCurrentSequence().isPagingEnabled()},e.prototype.isRightToLeft=function(){var e=this.getViewingDirection();return!!e&&e===c.Pr.RIGHT_TO_LEFT},e.prototype.isTopToBottom=function(){var e=this.getViewingDirection();return!!e&&e===c.Pr.TOP_TO_BOTTOM},e.prototype.isTotalCanvasesEven=function(){return this.getCurrentSequence().isTotalCanvasesEven()},e.prototype.isUIEnabled=function(e){if(!this.manifest)throw new Error(p.manifestNotLoaded);var t=this.manifest.getService(c.vl.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 r=t[n],i=this.getNodeYear(r),o=this.getNodeMonth(r),a=new s.TreeNode;a.id=r.id,a.label=this.getNodeDisplayDate(r),a.data=r.data,a.data.type=s.TreeNodeType.MANIFEST,a.data.year=i,a.data.month=o;var l=this.getDecadeNode(e,i);if(l){var u=this.getYearNode(l,i);if(u){var c=this.getMonthNode(u,o);c&&c.addNode(a)}}}},e.prototype.createDecadeNodes=function(e,t){for(var n=0;n<t.length;n++){var r=t[n];if(r.navDate){var i=this.getNodeYear(r),o=Number(i.toString().substr(0,3)+"9");if(!this.getDecadeNode(e,i)){var a=new s.TreeNode;a.label=i+" - "+o,a.navDate=r.navDate,a.data.startYear=i,a.data.endYear=o,e.addNode(a)}}}},e.prototype.createMonthNodes=function(e,t){for(var n=0;n<t.length;n++){var r=t[n];if(r.navDate){var i=this.getNodeYear(r),o=this.getNodeMonth(r),a=this.getDecadeNode(e,i),l=null;if(a&&(l=this.getYearNode(a,i)),a&&l&&!this.getMonthNode(l,o)){var u=new s.TreeNode;u.label=this.getNodeDisplayMonth(r),u.navDate=r.navDate,u.data.year=i,u.data.month=o,l.addNode(u)}}}},e.prototype.createYearNodes=function(e,t){for(var n=0;n<t.length;n++){var r=t[n];if(r.navDate){var i=this.getNodeYear(r),o=this.getDecadeNode(e,i);if(o&&!this.getYearNode(o,i)){var a=new s.TreeNode;a.label=i.toString(),a.navDate=r.navDate,a.data.year=i,o.addNode(a)}}}},e.prototype.getDecadeNode=function(e,t){for(var n=0;n<e.nodes.length;n++){var r=e.nodes[n];if(t>=r.data.startYear&&t<=r.data.endYear)return r}return null},e.prototype.getMonthNode=function(e,t){for(var n=0;n<e.nodes.length;n++){var r=e.nodes[n];if(t===this.getNodeMonth(r))return r}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 r=e.nodes[n];if(t===this.getNodeYear(r))return r}return null},e.prototype.pruneDecadeNodes=function(e){for(var t=[],n=0;n<e.nodes.length;n++){var r=e.nodes[n];r.nodes.length||t.push(r)}for(var i=0;i<t.length;i++){var o=t[i],a=e.nodes.indexOf(o);a>-1&&e.nodes.splice(a,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 r=e.nodes[n],i=0;i<r.nodes.length;i++){var o=r.nodes[i];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 r=e.nodes[n];r.nodes=r.nodes.sort((function(e,n){return t.getNodeYear(e)-t.getNodeYear(n)}))}},e}(),d=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(r,i){e&&t&&(r=e,i=t),s.Utils.loadManifest(n._options.manifestUri).then((function(e){n._loaded(n,e,r,i)})).catch((function(e){i(e)}))}))},e.prototype._loaded=function(e,t,n,r){var i=s.Utils.parseManifest(t,{locale:e._options.locale});if(i){e._options.iiifResource||(e._options.iiifResource=i);var o=e._options.collectionIndex,a=e._options.manifestIndex;if(i.getIIIFResourceType()===c.mU.COLLECTION){var l=i.getManifests(),u=i.getCollections();l.length||void 0!==o||(o=0),void 0!==o&&u&&u.length?i.getCollectionByIndex(o).then((function(t){t||r("Collection index not found"),0===t.getTotalManifests()&&0===a&&t.getTotalCollections()>0?(e._options.collectionIndex=0,e._options.manifestUri=t.id,e.bootstrap(n,r)):void 0!==a&&t.getManifestByIndex(a).then((function(t){e._options.manifest=t;var r=new h(e._options);n(r)}))})):i.getManifestByIndex(e._options.manifestIndex).then((function(t){e._options.manifest=t;var r=new h(e._options);n(r)}))}else{e._options.manifest=i;var p=new h(e._options);n(p)}}else console.error("Unable to load IIIF resource")},e}(),g=n(2084),v=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._parseCanvasDimensions(e)}return e.prototype._getImageServiceDescriptor=function(e){for(var t=null,n=0;n<e.length;n++){var r=e[n],i=r.id;i.endsWith("/")||(i+="/"),r.getProfile()&&(s.Utils.isImageProfile(r.getProfile())||s.Utils.isImageServiceType(r.getIIIFResourceType()))&&(t=i+"info.json")}return t},e.prototype._getDataUri=function(e){var t=e.getContent(),n=e.getImages(),r=null;if(t&&t.length){var i=t[0].getBody();return i.length?(o=i[0].getServices()).length&&(r=this._getImageServiceDescriptor(o))?r:i[0].id:null}if(n&&n.length){var o,a=n[0].getResource();return(o=a.getServices()).length&&(r=this._getImageServiceDescriptor(o))?r:a.id}var s=e.getService(c.vl.IXIF);return s?s.getInfoUri():e.id},e.prototype._parseAuthServices=function(e){if(.9===this.authAPIVersion)this.clickThroughService=s.Utils.getService(e,c.vl.AUTH_0_CLICK_THROUGH),this.loginService=s.Utils.getService(e,c.vl.AUTH_0_LOGIN),this.restrictedService=s.Utils.getService(e,c.vl.AUTH_0_RESTRICTED),this.clickThroughService?(this.logoutService=this.clickThroughService.getService(c.vl.AUTH_0_LOGOUT),this.tokenService=this.clickThroughService.getService(c.vl.AUTH_0_TOKEN)):this.loginService?(this.logoutService=this.loginService.getService(c.vl.AUTH_0_LOGOUT),this.tokenService=this.loginService.getService(c.vl.AUTH_0_TOKEN)):this.restrictedService&&(this.logoutService=this.restrictedService.getService(c.vl.AUTH_0_LOGOUT),this.tokenService=this.restrictedService.getService(c.vl.AUTH_0_TOKEN));else{if(void 0!==e.isCanvas&&e.isCanvas()){var t=e.getContent();if(t&&t.length){var n=t[0].getBody();n&&n.length&&(e=n[0])}}this.clickThroughService=s.Utils.getService(e,c.vl.AUTH_1_CLICK_THROUGH),this.loginService=s.Utils.getService(e,c.vl.AUTH_1_LOGIN),this.externalService=s.Utils.getService(e,c.vl.AUTH_1_EXTERNAL),this.kioskService=s.Utils.getService(e,c.vl.AUTH_1_KIOSK),this.clickThroughService?(this.logoutService=this.clickThroughService.getService(c.vl.AUTH_1_LOGOUT),this.tokenService=this.clickThroughService.getService(c.vl.AUTH_1_TOKEN),this.probeService=this.clickThroughService.getService(c.vl.AUTH_1_PROBE)):this.loginService?(this.logoutService=this.loginService.getService(c.vl.AUTH_1_LOGOUT),this.tokenService=this.loginService.getService(c.vl.AUTH_1_TOKEN),this.probeService=s.Utils.getService(e,c.vl.AUTH_1_PROBE),this.probeService||(this.probeService=this.loginService.getService(c.vl.AUTH_1_PROBE))):this.externalService?(this.logoutService=this.externalService.getService(c.vl.AUTH_1_LOGOUT),this.tokenService=this.externalService.getService(c.vl.AUTH_1_TOKEN),this.probeService=s.Utils.getService(e,c.vl.AUTH_1_PROBE),this.probeService||(this.probeService=this.externalService.getService(c.vl.AUTH_1_PROBE))):this.kioskService&&(this.logoutService=this.kioskService.getService(c.vl.AUTH_1_LOGOUT),this.tokenService=this.kioskService.getService(c.vl.AUTH_1_TOKEN),this.probeService=s.Utils.getService(e,c.vl.AUTH_1_PROBE),this.probeService||(this.probeService=this.kioskService.getService(c.vl.AUTH_1_PROBE)))}},e.prototype._parseCanvasDimensions=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 r=t[0].getBody();r.length&&(this.width=r[0].getWidth(),this.height=r[0].getHeight())}},e.prototype._parseDescriptorDimensions=function(e){void 0!==e.width&&(this.width=e.width),void 0!==e.height&&(this.height=e.height)},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,r){if(t.dataUri)if(t.probeService){t.isProbed=!0;var i=new XMLHttpRequest;i.open("GET",t.probeService.id,!0),i.withCredentials=!1,e&&i.setRequestHeader("Authorization","Bearer "+e.accessToken),i.onload=function(){var e=JSON.parse(i.responseText),r=unescape(e.contentLocation);t.status=i.status,r!==t.dataUri&&(t.status=g.MOVED_TEMPORARILY),t.data=e,n(t)},i.onerror=function(){t.status=i.status,n(t)},i.send()}else{var o="GET";if(!t.hasServiceDescriptor()){if(!t.isAccessControlled())return t.status=g.OK,void n(t);o="HEAD"}var a=new XMLHttpRequest;a.open(o,t.dataUri,!0),a.withCredentials=!1,e&&a.setRequestHeader("Authorization","Bearer "+e.accessToken),a.onload=function(){if(a.responseText){var e=JSON.parse(a.responseText),r=a.status,i=unescape(e["@id"]||e.id);t.data=e,t._parseAuthServices(t.data),t._parseDescriptorDimensions(t.data),i.endsWith("/info.json")&&(i=i.substr(0,i.lastIndexOf("/")));var o=t.dataUri;o&&o.endsWith("/info.json")&&(o=o.substr(0,o.lastIndexOf("/"))),r===g.OK&&i!==o&&(t.loginService||t.kioskService)?t.status=g.MOVED_TEMPORARILY:t.status=r,n(t)}else t.status=a.status||g.OK,n(t)},a.onerror=function(){t.status=a.status,a.responseText&&t._parseAuthServices(JSON.parse(a.responseText)),n(t)},a.send()}else r("There is no dataUri to fetch")}))},e}(),_=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}(),y=function(e){return new d(e).bootstrap()}},3911:(e,t)=>{"use strict";var n,r,i,o,a,s,l,u,c,p;(p=t.rj||(t.rj={})).BOOKMARKING="oa:bookmarking",p.CLASSIFYING="oa:classifying",p.COMMENTING="oa:commenting",p.DESCRIBING="oa:describing",p.EDITING="oa:editing",p.HIGHLIGHTING="oa:highlighting",p.IDENTIFYING="oa:identifying",p.LINKING="oa:linking",p.MODERATING="oa:moderating",p.PAINTING="sc:painting",p.QUESTIONING="oa:questioning",p.REPLYING="oa:replying",p.TAGGING="oa:tagging",p.TRANSCRIBING="oad:transcribing",(c=t.cg||(t.cg={})).AUTO_ADVANCE="auto-advance",c.CONTINUOUS="continuous",c.FACING_PAGES="facing-pages",c.HIDDEN="hidden",c.INDIVIDUALS="individuals",c.MULTI_PART="multi-part",c.NO_NAV="no-nav",c.NON_PAGED="non-paged",c.PAGED="paged",c.REPEAT="repeat",c.SEQUENCE="sequence",c.THUMBNAIL_NAV="thumbnail-nav",c.TOGETHER="together",c.UNORDERED="unordered",(u=t.Hd||(t.Hd={})).CANVAS="canvas",u.CHOICE="choice",u.OA_CHOICE="oa:choice",u.CONTENT_AS_TEXT="contentastext",u.DATASET="dataset",u.DOCUMENT="document",u.IMAGE="image",u.MODEL="model",u.MOVING_IMAGE="movingimage",u.PDF="pdf",u.PHYSICAL_OBJECT="physicalobject",u.SOUND="sound",u.TEXT="text",u.TEXTUALBODY="textualbody",u.VIDEO="video",(l=t.mU||(t.mU={})).ANNOTATION="annotation",l.CANVAS="canvas",l.COLLECTION="collection",l.MANIFEST="manifest",l.RANGE="range",l.SEQUENCE="sequence",(s=t.DD||(t.DD={})).AUDIO_MP4="audio/mp4",s.CORTO="application/corto",s.DICOM="application/dicom",s.DRACO="application/draco",s.EPUB="application/epub+zip",s.GIRDER="image/vnd.kitware.girder",s.GLB="model/gltf-binary",s.GLTF="model/gltf+json",s.IIIF_PRESENTATION_2='application/ld+json;profile="http://iiif.io/api/presentation/2/context.json"',s.IIIF_PRESENTATION_3='application/ld+json;profile="http://iiif.io/api/presentation/3/context.json"',s.JPG="image/jpeg",s.M3U8="application/vnd.apple.mpegurl",s.MP3="audio/mp3",s.MPEG_DASH="application/dash+xml",s.OBJ="text/plain",s.OPF="application/oebps-package+xml",s.PDF="application/pdf",s.PLY="application/ply",s.THREEJS="application/vnd.threejs+json",s.USDZ="model/vnd.usd+zip",s.VIDEO_MP4="video/mp4",s.WAV="audio/wav",s.WEBM="video/webm",(a=t.F4||(t.F4={})).DOC="application/msword",a.DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",a.PDF="application/pdf",(o=t.vl||(t.vl={})).IMAGE_0_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/compliance.html#level0",o.IMAGE_0_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/compliance.html#level1",o.IMAGE_0_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/compliance.html#level2",o.IMAGE_0_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/conformance.html#level0",o.IMAGE_0_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/conformance.html#level1",o.IMAGE_0_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/conformance.html#level2",o.IMAGE_1_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",o.IMAGE_1_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",o.IMAGE_1_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",o.IMAGE_1_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",o.IMAGE_1_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",o.IMAGE_1_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",o.IMAGE_1_LEVEL_0="http://iiif.io/api/image/1/level0.json",o.IMAGE_1_PROFILE_LEVEL_0="http://iiif.io/api/image/1/profiles/level0.json",o.IMAGE_1_LEVEL_1="http://iiif.io/api/image/1/level1.json",o.IMAGE_1_PROFILE_LEVEL_1="http://iiif.io/api/image/1/profiles/level1.json",o.IMAGE_1_LEVEL_2="http://iiif.io/api/image/1/level2.json",o.IMAGE_1_PROFILE_LEVEL_2="http://iiif.io/api/image/1/profiles/level2.json",o.IMAGE_2_LEVEL_0="http://iiif.io/api/image/2/level0.json",o.IMAGE_2_PROFILE_LEVEL_0="http://iiif.io/api/image/2/profiles/level0.json",o.IMAGE_2_LEVEL_1="http://iiif.io/api/image/2/level1.json",o.IMAGE_2_PROFILE_LEVEL_1="http://iiif.io/api/image/2/profiles/level1.json",o.IMAGE_2_LEVEL_2="http://iiif.io/api/image/2/level2.json",o.IMAGE_2_PROFILE_LEVEL_2="http://iiif.io/api/image/2/profiles/level2.json",o.AUTH_0_CLICK_THROUGH="http://iiif.io/api/auth/0/login/clickthrough",o.AUTH_0_LOGIN="http://iiif.io/api/auth/0/login",o.AUTH_0_LOGOUT="http://iiif.io/api/auth/0/logout",o.AUTH_0_RESTRICTED="http://iiif.io/api/auth/0/login/restricted",o.AUTH_0_TOKEN="http://iiif.io/api/auth/0/token",o.AUTH_1_CLICK_THROUGH="http://iiif.io/api/auth/1/clickthrough",o.AUTH_1_EXTERNAL="http://iiif.io/api/auth/1/external",o.AUTH_1_KIOSK="http://iiif.io/api/auth/1/kiosk",o.AUTH_1_LOGIN="http://iiif.io/api/auth/1/login",o.AUTH_1_LOGOUT="http://iiif.io/api/auth/1/logout",o.AUTH_1_PROBE="http://iiif.io/api/auth/1/probe",o.AUTH_1_TOKEN="http://iiif.io/api/auth/1/token",o.SEARCH_0="http://iiif.io/api/search/0/search",o.SEARCH_0_AUTO_COMPLETE="http://iiif.io/api/search/0/autocomplete",o.SEARCH_1="http://iiif.io/api/search/1/search",o.SEARCH_1_AUTO_COMPLETE="http://iiif.io/api/search/1/autocomplete",o.TRACKING_EXTENSIONS="http://universalviewer.io/tracking-extensions-profile",o.UI_EXTENSIONS="http://universalviewer.io/ui-extensions-profile",o.PRINT_EXTENSIONS="http://universalviewer.io/print-extensions-profile",o.SHARE_EXTENSIONS="http://universalviewer.io/share-extensions-profile",o.DOWNLOAD_EXTENSIONS="http://universalviewer.io/download-extensions-profile",o.OTHER_MANIFESTATIONS="http://iiif.io/api/otherManifestations.json",o.IXIF="http://wellcomelibrary.org/ld/ixif/0/alpha.json",(i=t.UW||(t.UW={})).IMAGE_SERVICE_2="ImageService2",i.IMAGE_SERVICE_3="ImageService3",(r=t.Pr||(t.Pr={})).BOTTOM_TO_TOP="bottom-to-top",r.LEFT_TO_RIGHT="left-to-right",r.RIGHT_TO_LEFT="right-to-left",r.TOP_TO_BOTTOM="top-to-bottom",(n=t.qQ||(t.qQ={})).CONTINUOUS="continuous",n.INDIVIDUALS="individuals",n.NON_PAGED="non-paged",n.PAGED="paged",n.TOP="top"},3645:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(r)for(var o=0;o<this.length;o++){var a=this[o][0];null!=a&&(i[a]=!0)}for(var s=0;s<e.length;s++){var l=[].concat(e[s]);r&&i[l[0]]||(n&&(l[2]?l[2]="".concat(n," and ").concat(l[2]):l[2]=n),t.push(l))}},t}},4015:e=>{"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}e.exports=function(e){var n,r,i=(r=4,function(e){if(Array.isArray(e))return e}(n=e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}}(n,r)||function(e,n){if(e){if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}(n,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=i[1],a=i[3];if(!a)return o;if("function"==typeof btoa){var s=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),l="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),u="/*# ".concat(l," */"),c=a.sources.map((function(e){return"/*# sourceURL=".concat(a.sourceRoot||"").concat(e," */")}));return[o].concat(c).concat([u]).join("\n")}return[o].join("\n")}},3386:(e,t,n)=>{var r,i,o,a=n(9755);r=function(e,t){"use strict";var n=!1===t;if(!(t=t||e.jQuery)||!t.fn)throw"JsViews requires jQuery";var r,i,o,a,s,l,u,c,p,f,h,d,g,v,_,y,E,m,I,T,A,b,C,O,S="v0.9.83",N=/^(!*?)(?:null|true|false|\d[\d.]*|([\w$]+|\.|~([\w$]+)|#(view|([\w$]+))?)([\w$.^]*?)(?:[.[^]([\w$]+)\]?)?)$/g,L=/(\()(?=\s*\()|(?:([([])\s*)?(?:(\^?)(!*?[#~]?[\w$.^]+)?\s*((\+\+|--)|\+|-|&&|\|\||===|!==|==|!=|<=|>=|[<>%*:?\/]|(=))\s*|(!*?[#~]?[\w$.^]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*(([)\]])(?=\s*[.^]|\s*$|[^([])|[)\]])([([]?))|(\s+)/g,R=/[ \t]*(\r\n|\n|\r)/g,w=/\\(['"])/g,P=/['"\\]/g,M=/(?:\x08|^)(onerror:)?(?:(~?)(([\w$_\.]+):)?([^\x08]+))\x08(,)?([^\x08]+)/gi,x=/^if\s/,U=/<(\w+)[>\s]/,D=/[\x00`><\"'&=]/,j=/^on[A-Z]|^convert(Back)?$/,V=/^\#\d+_`[\s\S]*\/\d+_`$/,k=/[\x00`><"'&=]/g,G=0,F={"&":"&amp;","<":"&lt;",">":"&gt;","\0":"&#0;","'":"&#39;",'"':"&#34;","`":"&#96;","=":"&#61;"},H="html",B="object",q="data-jsv-tmpl",Y="jsvTmpl",K="For #index in nested block use #getIndex().",W={},Q=e.jsrender,X=Q&&t&&!t.render,z={template:{compile:function e(n,r,i,o){function s(r){var a,s;if(""+r===r||r.nodeType>0&&(l=r)){if(!l)if(/^\.\/[^\\:*?"<>]*$/.test(r))(s=f[n=n||r])?r=s:l=document.getElementById(r);else if(t.fn&&!v.rTmpl.test(r))try{l=t(document).find(r)[0]}catch(e){}l&&(o?r=l.innerHTML:((a=l.getAttribute(q))?a!==Y?(r=f[a],delete f[a]):t.fn&&(r=t.data(l)[Y]):(n=n||(t.fn?Y:r),r=e(n,l.innerHTML,i,o)),r.tmplName=n=n||a,n!==Y&&(f[n]=r),l.setAttribute(q,n),t.fn&&t.data(l,Y,r))),l=void 0}else r.fn||(r=void 0);return r}var l,u,c=r=r||"";if(0===o&&(o=void 0,c=s(c)),(o=o||(r.markup?r:{})).tmplName=n,i&&(o._parentTmpl=i),!c&&r.markup&&(c=s(r.markup))&&c.fn&&(c=c.markup),void 0!==c)return c.fn||r.fn?c.fn&&(u=c):(r=ce(c,o),Ee(c.replace(P,"\\$&"),r)),u||(u=re((function(){return u.render.apply(u,arguments)}),r),function(e){var t,n,r;for(t in z)e[n=t+"s"]&&(r=e[n],e[n]={},a[n](r,e))}(u)),n&&!i&&n!==Y&&(W[n]=u),u}},tag:{compile:function(e,t,n){var r,i,o,a=new v._tg;function s(){this._={inline:!0,unlinked:!0},this.tagName=e}if(c(t)?t={depends:t.depends,render:t}:""+t===t&&(t={template:t}),i=t.baseTag)for(o in t.flow=!!t.flow,t.baseTag=i=""+i===i?n&&n.tags[i]||g[i]:i,a=re(a,i),t)a[o]=J(i[o],t[o]);else a=re(a,t);return void 0!==(r=a.template)&&(a.template=""+r===r?f[r]||f(r):r),!1!==a.init&&((s.prototype=a).constructor=a._ctr=s),n&&(a._parentTmpl=n),a}},viewModel:{compile:function(e,n){var r,i,o=this,a=n.getters,s=n.extend,l=n.id,c=t.extend({_is:e||"unnamed",unmap:I,merge:m},s),f="",h="",d=a?a.length:0,g=t.observable,v={};function _(e){i.apply(this,e)}function y(){return new _(arguments)}function E(e,t){var n,r,i,s,l,u=a.length;for(n=0;n<u;n++)r=void 0,(s=a[n])+""!==s&&(s=(r=s).getter),void 0===(l=e[s])&&r&&void 0!==(i=r.defaultVal)&&(l=le(i,e)),t(l,r&&o[r.type],s)}function m(e){e=e+""===e?JSON.parse(e):e;var t,n,r,i,o,a,s,c,f,h,d=this;if(p(d)){for(c={},h=[],r=e.length,i=d.length,t=0;t<r;t++){for(f=e[t],s=!1,n=0;n<i&&!s;n++)c[n]||(a=d[n],l&&(c[n]=s=l+""===l?f[l]&&(v[l]?a[l]():a[l])===f[l]:l(a,f)));s?(a.merge(f),h.push(a)):h.push(y.map(f))}g?g(d).refresh(h,!0):d.splice.apply(d,[0,d.length].concat(h))}else for(o in E(e,(function(e,t,n){t?d[n]().merge(e):d[n](e)})),e)o===u||v[o]||(d[o]=e[o])}function I(){var e,n,r,i,s,l,c=this;if(p(c))return ue(c);for(e={},i=a.length,r=0;r<i;r++)s=void 0,(n=a[r])+""!==n&&(n=(s=n).getter),l=c[n](),e[n]=s&&l&&o[s.type]?p(l)?ue(l):l.unmap():l;for(n in c)"_is"===n||v[n]||n===u||"_"===n.charAt(0)&&v[n.slice(1)]||t.isFunction(c[n])||(e[n]=c[n]);return e}for(_.prototype=c,r=0;r<d;r++)!function(e){e=e.getter||e,v[e]=r+1;var t="_"+e;f+=(f?",":"")+e,h+="this."+t+" = "+e+";\n",c[e]=c[e]||function(n){if(!arguments.length)return this[t];g?g(this).setProperty(e,n):this[t]=n},g&&(c[e].set=c[e].set||function(e){this[t]=e})}(a[r]);return(i=new Function(f,h.slice(0,-1))).prototype=c,c.constructor=i,y.map=function(t){var n,r,i,o=t=t+""===t?JSON.parse(t):t,a=[];if(p(t)){for(r=(t=t||[]).length,n=0;n<r;n++)a.push(this.map(t[n]));return a._is=e,a.unmap=I,a.merge=m,a}if(t)for(i in E(t,(function(e,t){t&&(e=t.map(e)),a.push(e)})),o=this.apply(this,a),t)i===u||v[i]||(o[i]=t[i]);return o},y.getters=a,y.extend=s,y.id=l,y}},helper:{},converter:{}};function $(e,t){return function(){var n,r=this,i=r.base;return r.base=e,n=t.apply(r,arguments),r.base=i,n}}function J(e,t){return c(t)&&((t=$(e?e._d?e:$(te,e):te,t))._d=1),t}function Z(e,t){for(var n in t.props)j.test(n)&&(e[n]=J(e[n],t.props[n]))}function ee(e){return e}function te(){return""}function ne(e){this.name=(t.link?"JsViews":"JsRender")+" Error",this.message=e||this.name}function re(e,t){for(var n in t)e[n]=t[n];return e}function ie(e,t,n){return e?p(e)?ie.apply(a,e):(_.delimiters=[e,t,b=n?n.charAt(0):b],m=e.charAt(0),I=e.charAt(1),T=t.charAt(0),A=t.charAt(1),e="\\"+m+"(\\"+b+")?\\"+I,t="\\"+T+"\\"+A,i="(?:(\\w+(?=[\\/\\s\\"+T+"]))|(\\w+)?(:)|(>)|(\\*))\\s*((?:[^\\"+T+"]|\\"+T+"(?!\\"+A+"))*?)",v.rTag="(?:"+i+")",i=new RegExp("(?:"+e+i+"(\\/)?|\\"+m+"(\\"+b+")?\\"+I+"(?:(?:\\/(\\w+))\\s*|!--[\\s\\S]*?--))"+t,"g"),v.rTmpl=new RegExp("<.*>|([^\\\\]|^)[{}]|"+e+".*"+t),E):_.delimiters}function oe(){var e=this.get("item");return e?e.index:void 0}function ae(){return this.index}function se(e,t,n,r,i,o,a,s){var l,u,c,p=this,f="array"===t;p.content=s,p.views=f?[]:{},p.parent=n,p.type=t||"top",p.data=r,p.tmpl=i,c=p._={key:0,useKey:f?0:1,id:""+G++,onRender:a,bnds:{}},p.linked=!!a,n?(l=n.views,(u=n._).useKey?(l[c.key="_"+u.useKey++]=p,p.index=K,p.getIndex=oe):l.length===(c.key=p.index=o)?l.push(p):l.splice(o,0,p),p.ctx=e||n.ctx):p.ctx=e}function le(e,n){return t.isFunction(e)?e.call(n):e}function ue(e){var t,n=[],r=e.length;for(t=0;t<r;t++)n.push(e[t].unmap());return n}function ce(e,n){var r,i=y._wm||{},o=re({tmpls:[],links:{},bnds:[],_is:"template",render:de},n);return o.markup=e,n.htmlTag||(r=U.exec(e),o.htmlTag=r?r[1].toLowerCase():""),(r=i[o.htmlTag])&&r!==i.div&&(o.markup=t.trim(o.markup)),o}function pe(e,t){var n=e+"s";a[n]=function r(i,o,s){var l,u,c,p;if(i&&typeof i===B&&!i.nodeType&&!i.markup&&!i.getTgt&&!("viewModel"===e&&i.getters||i.extend)){for(c in i)r(c,i[c],o);return o||a}return void 0===o&&(o=i,i=void 0),i&&""+i!==i&&(s=o,o=i,i=void 0),p=s?"viewModel"===e?s:s[n]=s[n]||{}:r,u=t.compile,null===o?i&&delete p[i]:(o=u?u.call(p,i,o,s,0):o,i&&(p[i]=o)),u&&o&&(o._is=e),o&&(l=v.onStore[e])&&l(i,o,u),o}}function fe(e){E[e]=function(t){return arguments.length?(_[e]=t,E):_[e]}}function he(e){function t(t,n){this.tgt=e.getTgt(t,n)}return c(e)&&(e={getTgt:e}),e.baseMap&&(e=re(re({},e.baseMap),e)),e.map=function(e,n){return new t(e,n)},e}function de(e,t,n,r,i,a){var s,l,u,c,f,h,d,g,_=r,E="";if(!0===t?(n=t,t=void 0):typeof t!==B&&(t=void 0),(u=this.tag)?(f=this,c=(_=_||f.view).getTmpl(u.template||f.tmpl),arguments.length||(e=_)):c=this,c){if(!r&&e&&"view"===e._is&&(_=e),_&&e===_&&(e=_.data),h=!_,O=O||h,_||((t=t||{}).root=e),!O||y.useViews||c.useViews||_&&_!==o)E=ge(c,e,t,n,_,i,a,u);else{if(_?(d=_.data,g=_.index,_.index=K):((_=o).data=e,_.ctx=t),p(e)&&!n)for(s=0,l=e.length;s<l;s++)_.index=s,_.data=e[s],E+=c.fn(e[s],_,v);else _.data=e,E+=c.fn(e,_,v);_.data=d,_.index=g}h&&(O=void 0)}return E}function ge(e,t,n,r,i,o,a,s){function l(e){(I=re({},n))[m]=e}var u,c,f,h,d,g,_,y,E,m,I,T,A="";if(s&&(E=s.tagName,T=s.tagCtx,n=n?Ce(n,s.ctx):s.ctx,e===i.content?_=e!==i.ctx._wrp?i.ctx._wrp:void 0:e!==T.content?e===s.template?(_=T.tmpl,n._wrp=T.content):_=T.content||i.content:_=i.content,!1===T.props.link&&((n=n||{}).link=!1),(m=T.props.itemVar)&&("~"!==m.charAt(0)&&ye("Use itemVar='~myItem'"),m=m.slice(1))),i&&(a=a||i._.onRender,n=Ce(n,i.ctx)),!0===o&&(g=!0,o=0),a&&(n&&!1===n.link||s&&s._.noVws)&&(a=void 0),y=a,!0===a&&(y=void 0,a=i._.onRender),n=e.helpers?Ce(e.helpers,n):n,I=n,p(t)&&!r)for(f=g?i:void 0!==o&&i||new se(n,"array",i,t,e,o,a,_),i&&i._.useKey&&(f._.bnd=!s||s._.bnd&&s),m&&(f.it=m),m=f.it,u=0,c=t.length;u<c;u++)m&&l(t[u]),h=new se(I,"item",f,t[u],e,(o||0)+u,a,f.content),d=e.fn(t[u],h,v),A+=f._.onRender?f._.onRender(d,h):d;else m&&l(t),f=g?i:new se(I,E||"data",i,t,e,o,a,_),s&&!s.flow&&(f.tag=s,s.view=f),A+=e.fn(t,f,v);return y?y(A,f):A}function ve(e,t,n){var r=void 0!==n?c(n)?n.call(t.data,e,t):n||"":"{Error: "+e.message+"}";return _.onError&&void 0!==(n=_.onError.call(t.data,e,n&&r,t))&&(r=n),t&&!t.linkCtx?h.html(r):r}function _e(e){throw new v.Err(e)}function ye(e){_e("Syntax error\n"+e)}function Ee(e,t,n,r,o){function a(t){(t-=g)&&y.push(e.substr(g,t).replace(R,"\\n"))}function s(t,n){t&&(t+="}}",ye((n?"{{"+n+"}} block has {{/"+t+" without {{"+t:"Unmatched or missing {{/"+t)+", in template:\n"+e))}var l,u,c,p,f,h=_.allowCode||t&&t.allowCode||!0===E.allowCode,d=[],g=0,v=[],y=d,I=[,,d];if(h&&t._is&&(t.allowCode=h),n&&(void 0!==r&&(e=e.slice(0,-r.length-2)+T),e=m+e+A),s(v[0]&&v[0][2].pop()[0]),e.replace(i,(function(i,l,u,f,d,_,E,m,T,A,b,C){(E&&l||T&&!u||m&&":"===m.slice(-1)||A)&&ye(i),_&&(d=":",f=H);var O=(l||n)&&[[]],S="",N="",L="",P="",U="",D="",V="",k="",G=!(T=T||n&&!o)&&!d;u=u||(m=m||"#data",d),a(C),g=C+i.length,E?h&&y.push(["*","\n"+m.replace(/^:/,"ret+= ").replace(w,"$1")+";\n"]):u?("else"===u&&(x.test(m)&&ye('for "{{else if expr}}" use "{{else expr}}"'),O=I[7]&&[[]],I[8]=e.substring(I[8],C),I=v.pop(),y=I[2],G=!0),m&&Ae(m.replace(R," "),O,t).replace(M,(function(e,t,n,r,i,o,a,s){return r="'"+i+"':",a?(N+=o+",",P+="'"+s+"',"):n?(L+=r+"j._cp("+o+',"'+s+'",view),',D+=r+"'"+s+"',"):t?V+=o:("trigger"===i&&(k+=o),S+=r+o+",",U+=r+"'"+s+"',",p=p||j.test(i)),""})).slice(0,-1),O&&O[0]&&O.pop(),c=[u,f||!!r||p||"",G&&[],Ie(P||(":"===u?"'#data',":""),U,D),Ie(N||(":"===u?"data,":""),S,L),V,k,O||0],y.push(c),G&&(v.push(I),(I=c)[8]=g)):b&&(s(b!==I[0]&&"else"!==I[0]&&b,I[0]),I[8]=e.substring(I[8],C),I=v.pop()),s(!I&&b),y=I[2]})),a(e.length),(g=d[d.length-1])&&s(""+g!==g&&+g[8]===g[8]&&g[0]),n){for(u=be(d,e,n),f=[],l=d.length;l--;)f.unshift(d[l][7]);me(u,f)}else u=be(d,t);return u}function me(e,t){var n,r,i=0,o=t.length;for(e.deps=[],e.paths=[];i<o;i++)for(n in e.paths.push(r=t[i]),r)"_jsvto"!==n&&r.hasOwnProperty(n)&&r[n].length&&!r[n].skp&&(e.deps=e.deps.concat(r[n]))}function Ie(e,t,n){return[e.slice(0,-1),t.slice(0,-1),n.slice(0,-1)]}function Te(e,t){return"\n\t"+(t?t+":{":"")+"args:["+e[0]+"]"+(e[1]||!t?",\n\tprops:{"+e[1]+"}":"")+(e[2]?",\n\tctx:{"+e[2]+"}":"")}function Ae(e,t,n){var r,i,a,s,l,u=t&&t[0],c={bd:u},p={0:c},f=0,h=(n?n.links:u&&(u.links=u.links||{}))||o.tmpl.links,d=0,g={},v={},_=(e+(n?" ":"")).replace(L,(function(o,_,y,E,m,A,b,C,O,S,L,R,w,P,M,x,U,D,j,V){E&&!C&&(m=E+m),A=A||"",y=y||_||R,m=m||O;var k,G,F,H,B,q=")";if("["===(S=S||U||"")&&(S="[j._sq(",q=")]"),!b||l||s){if(u&&x&&!l&&!s&&(!r||a||i)&&(k=v[d-1],V.length-1>j-(k||0))){if(k=V.slice(k,j+o.length),!0!==G)if(F=i||p[d-1].bd,(H=F[F.length-1])&&H.prm){for(;H.sb&&H.sb.prm;)H=H.sb;B=H.sb={path:H.sb,bnd:H.bnd}}else F.push(B={path:F.pop()});(G=h[x=I+":"+k+" onerror=''"+T])||(h[x]=!0,h[x]=G=Ee(x,n,!0)),!0!==G&&B&&(B._jsv=G,B.prm=c.bd,B.bnd=B.bnd||B.path&&B.path.indexOf("^")>=0)}return l?(l=!w)?o:R+'"':s?(s=!P)?o:R+'"':(y?(v[d]=j++,c=p[++d]={bd:[]},y):"")+(D?d?"":(f=V.slice(f,j),(r?(r=a=i=!1,"\b"):"\b,")+f+(f=j+o.length,u&&t.push(c.bd=[]),"\b")):C?(d&&ye(e),u&&t.pop(),r=m,a=E,f=j+o.length,u&&((u=c.bd=t[r]=[]).skp=!E),m+":"):m?m.split("^").join(".").replace(N,(function(e,n,o,a,s,l,p,f){var h="."===o;if(o&&(m=m.slice(n.length),/^\.?constructor$/.test(f||m)&&ye(e),h||(e=(a?'view.hlp("'+a+'")':s?"view":"data")+(f?(l?"."+l:a||s?"":"."+o)+(p||""):(f=a?"":s?l||"":o,"")),e=n+("view.data"===(e+=f?"."+f:"").slice(0,9)?e.slice(5):e)),u)){if(F="linkTo"===r?i=t._jsvto=t._jsvto||[]:c.bd,H=h&&F[F.length-1]){if(H._jsv){for(;H.sb;)H=H.sb;H.bnd&&(m="^"+m.slice(1)),H.sb=m,H.bnd=H.bnd||"^"===m.charAt(0)}}else F.push(m);v[d]=j+(h?1:0)}return e}))+(S?(c=p[++d]={bd:[]},g[d]=q,S):A):A||(M?(M=g[d]||M,g[d]=!1,c=p[--d],M+(S?(c=p[++d],g[d]=q,S):"")):L?(g[d]||ye(e),","):_?"":(l=w,s=P,'"')))}ye(e)}));return!d&&_||ye(e)}function be(e,t,n){var r,i,o,a,s,l,u,c,p,f,h,d,v,E,m,I,T,A,b,C,O,S,N,L,P,M,x,U,D,j=0,V=y.useViews||t.useViews||t.tags||t.templates||t.helpers||t.converters,k="",G={},F=e.length;for(""+t===t?(T=n?'data-link="'+t.replace(R," ").slice(1,-1)+'"':t,t=0):(T=t.tmplName||"unnamed",t.allowCode&&(G.