UNPKG

@tindtechnologies/universalviewer

Version:

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

1 lines 113 kB
"use strict";(self.webpackChunkUV=self.webpackChunkUV||[]).push([[8444],{2789(t,e,n){var i,o;n.d(e,{G:()=>i}),function(t){t[t.Backspace=8]="Backspace",t[t.Tab=9]="Tab",t[t.Enter=13]="Enter",t[t.Shift=16]="Shift",t[t.Ctrl=17]="Ctrl",t[t.Alt=18]="Alt",t[t.PauseBreak=19]="PauseBreak",t[t.CapsLock=20]="CapsLock",t[t.Escape=27]="Escape",t[t.Spacebar=32]="Spacebar",t[t.PageUp=33]="PageUp",t[t.PageDown=34]="PageDown",t[t.End=35]="End",t[t.Home=36]="Home",t[t.LeftArrow=37]="LeftArrow",t[t.UpArrow=38]="UpArrow",t[t.RightArrow=39]="RightArrow",t[t.DownArrow=40]="DownArrow",t[t.PrintScrn=44]="PrintScrn",t[t.Insert=45]="Insert",t[t.Delete=46]="Delete",t[t.Zero=48]="Zero",t[t.One=49]="One",t[t.Two=50]="Two",t[t.Three=51]="Three",t[t.Four=52]="Four",t[t.Five=53]="Five",t[t.Six=54]="Six",t[t.Seven=55]="Seven",t[t.Eight=56]="Eight",t[t.Nine=57]="Nine",t[t.a=65]="a",t[t.b=66]="b",t[t.c=67]="c",t[t.d=68]="d",t[t.e=69]="e",t[t.f=70]="f",t[t.g=71]="g",t[t.h=72]="h",t[t.i=73]="i",t[t.j=74]="j",t[t.k=75]="k",t[t.l=76]="l",t[t.m=77]="m",t[t.n=78]="n",t[t.o=79]="o",t[t.p=80]="p",t[t.q=81]="q",t[t.r=82]="r",t[t.s=83]="s",t[t.t=84]="t",t[t.u=85]="u",t[t.v=86]="v",t[t.w=87]="w",t[t.x=88]="x",t[t.y=89]="y",t[t.z=90]="z",t[t.LeftWindowKey=91]="LeftWindowKey",t[t.RightWindowKey=92]="RightWindowKey",t[t.SelectKey=93]="SelectKey",t[t.Numpad0=96]="Numpad0",t[t.Numpad1=97]="Numpad1",t[t.Numpad2=98]="Numpad2",t[t.Numpad3=99]="Numpad3",t[t.Numpad4=100]="Numpad4",t[t.Numpad5=101]="Numpad5",t[t.Numpad6=102]="Numpad6",t[t.Numpad7=103]="Numpad7",t[t.Numpad8=104]="Numpad8",t[t.Numpad9=105]="Numpad9",t[t.Multiply=106]="Multiply",t[t.NumpadPlus=107]="NumpadPlus",t[t.NumpadMinus=109]="NumpadMinus",t[t.DecimalPoint=110]="DecimalPoint",t[t.Divide=111]="Divide",t[t.F1=112]="F1",t[t.F2=113]="F2",t[t.F3=114]="F3",t[t.F4=115]="F4",t[t.F5=116]="F5",t[t.F6=117]="F6",t[t.F7=118]="F7",t[t.F8=119]="F8",t[t.F9=120]="F9",t[t.F10=121]="F10",t[t.F11=122]="F11",t[t.F12=123]="F12",t[t.NumLock=144]="NumLock",t[t.ScrollLock=145]="ScrollLock",t[t.Semicolon=186]="Semicolon",t[t.Equals=187]="Equals",t[t.Comma=188]="Comma",t[t.LessThan=188]="LessThan",t[t.Dash=189]="Dash",t[t.Period=190]="Period",t[t.GreaterThan=190]="GreaterThan",t[t.ForwardSlash=191]="ForwardSlash",t[t.QuestionMark=191]="QuestionMark",t[t.GraveAccent=192]="GraveAccent",t[t.Tilde=192]="Tilde",t[t.OpenCurlyBracket=219]="OpenCurlyBracket",t[t.OpenSquareBracket=219]="OpenSquareBracket",t[t.BackSlash=220]="BackSlash",t[t.VerticalPipe=220]="VerticalPipe",t[t.CloseCurlyBracket=221]="CloseCurlyBracket",t[t.CloseSquareBracket=221]="CloseSquareBracket",t[t.Quote=222]="Quote",t[t.CommandFF=224]="CommandFF"}(i||(i={})),function(t){t[t.Backspace=8]="Backspace",t[t.Enter=13]="Enter",t[t.Spacebar=32]="Spacebar",t[t.Hash=35]="Hash",t[t.GraveAccent=39]="GraveAccent",t[t.DoubleQuote=34]="DoubleQuote",t[t.Asterisk=42]="Asterisk",t[t.Plus=43]="Plus",t[t.Comma=44]="Comma",t[t.Minus=45]="Minus",t[t.Period=46]="Period",t[t.ForwardSlash=47]="ForwardSlash",t[t.Zero=48]="Zero",t[t.One=49]="One",t[t.Two=50]="Two",t[t.Three=51]="Three",t[t.Four=52]="Four",t[t.Five=53]="Five",t[t.Six=54]="Six",t[t.Seven=55]="Seven",t[t.Eight=56]="Eight",t[t.Nine=57]="Nine",t[t.Colon=58]="Colon",t[t.Semicolon=59]="Semicolon",t[t.LessThan=60]="LessThan",t[t.Equals=61]="Equals",t[t.GreaterThan=62]="GreaterThan",t[t.QuestionMark=63]="QuestionMark",t[t.At=64]="At",t[t.OpenSquareBracket=91]="OpenSquareBracket",t[t.BackSlash=92]="BackSlash",t[t.CloseSquareBracket=93]="CloseSquareBracket",t[t.a=97]="a",t[t.b=98]="b",t[t.c=99]="c",t[t.d=100]="d",t[t.e=101]="e",t[t.f=102]="f",t[t.g=103]="g",t[t.h=104]="h",t[t.i=105]="i",t[t.j=106]="j",t[t.k=107]="k",t[t.l=108]="l",t[t.m=109]="m",t[t.n=110]="n",t[t.o=111]="o",t[t.p=112]="p",t[t.q=113]="q",t[t.r=114]="r",t[t.s=115]="s",t[t.t=116]="t",t[t.u=117]="u",t[t.v=118]="v",t[t.w=119]="w",t[t.x=120]="x",t[t.y=121]="y",t[t.z=122]="z",t[t.OpenCurlyBracket=123]="OpenCurlyBracket",t[t.VerticalPipe=124]="VerticalPipe",t[t.CloseCurlyBracket=125]="CloseCurlyBracket",t[t.Tilde=126]="Tilde"}(o||(o={}))},9594(t,e,n){n.d(e,{M:()=>l});var i,o=n(4194),s=n(9323),a=(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=window.$,l=function(t){function e(e){return t.call(this,e)||this}return a(e,t),e.prototype.create=function(){var e,n=this;this.setConfig("settingsDialogue"),t.prototype.create.call(this),this.openCommand=o.b.SHOW_SETTINGS_DIALOGUE,this.closeCommand=o.b.HIDE_SETTINGS_DIALOGUE,this.extensionHost.subscribe(this.openCommand,(function(t){e=t,n.open()})),this.extensionHost.subscribe(this.closeCommand,(function(){e&&e.focus(),n.close()})),this.$title=r('<div role="heading" class="heading"></div>'),this.$content.append(this.$title),this.$scroll=r('<div class="scroll"></div>'),this.$content.append(this.$scroll),this.$version=r('<div class="version"></div>'),this.$content.append(this.$version),this.$website=r('<div class="website"></div>'),this.$content.append(this.$website),this.$locale=r('<div class="setting locale"></div>'),this.$scroll.append(this.$locale),this.$localeLabel=r('<label for="locale">'+this.content.locale+"</label>"),this.$locale.append(this.$localeLabel),this.$localeDropDown=r('<select id="locale"></select>'),this.$locale.append(this.$localeDropDown),this.$title.text(this.content.title),this.$website.html(this.content.website),this.$website.targetBlank(),this._createLocalesMenu(),this._createAccessibilityMenu(),this.$element.hide()},e.prototype.getSettings=function(){return this.extension.getSettings()},e.prototype.updateSettings=function(t){this.extension.updateSettings(t),this.extensionHost.publish(o.b.UPDATE_SETTINGS,t)},e.prototype.open=function(){t.prototype.open.call(this),this.$version.text("v4.2.2-alpha.0")},e.prototype._createLocalesMenu=function(){var t=this,e=this.extension.data.locales;if(e&&e.length>1){for(var n=0;n<e.length;n++){var i=e[n];this.$localeDropDown.append('<option value="'+i.name+'">'+i.label+"</option>")}this.$localeDropDown.val(e[0].name)}else this.$locale.hide();this.$localeDropDown.change((function(){t.extension.changeLocale(t.$localeDropDown.val())}))},e.prototype.resize=function(){t.prototype.resize.call(this)},e.prototype._createAccessibilityMenu=function(){var t=this;this.$reducedAnimation=r('<div class="setting reducedAnimation"></div>'),this.$scroll.append(this.$reducedAnimation),this.$reducedAnimationCheckbox=r('<input id="reducedAnimation" type="checkbox" tabindex="0" />'),this.$reducedAnimation.append(this.$reducedAnimationCheckbox),this.$reducedAnimationLabel=r('<label for="reducedAnimation">'+this.content.reducedMotion+"</label>"),this.$reducedAnimation.append(this.$reducedAnimationLabel);var e=this.getSettings();e.animationDuration&&document.documentElement.style.setProperty("--uv-animation-duration","".concat(e.animationDuration,"ms")),e.reducedAnimation?(document.documentElement.style.setProperty("--uv-animation","0"),this.$reducedAnimationCheckbox.prop("checked",!0)):(document.documentElement.style.setProperty("--uv-animation","1"),this.$reducedAnimationCheckbox.removeAttr("checked")),this.$reducedAnimationCheckbox.change((function(){var e={};t.$reducedAnimationCheckbox.is(":checked")?(e.reducedAnimation=!0,document.documentElement.style.setProperty("--uv-animation","0")):(e.reducedAnimation=!1,document.documentElement.style.setProperty("--uv-animation","1")),t.updateSettings(e)}))},e}(s.X)},4792(t,e,n){n.d(e,{C:()=>c});var i,o=n(2949),s=n(4194),a=n(9323),r=(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=window.$,c=function(t){function e(e){var n=t.call(this,e)||this;return n.copyToClipboardEnabled=!0,n.isShareViewVisible=!1,n.shareManifestsEnabled=!1,n.isEmbedViewVisible=!1,n.aspectRatio=.75,n.maxWidth=8e3,n.maxHeight=n.maxWidth*n.aspectRatio,n.minWidth=200,n.minHeight=n.minWidth*n.aspectRatio,n}return r(e,t),e.prototype.create=function(){var e,n,i=this;this.setConfig("shareDialogue"),t.prototype.create.call(this),this.$element.attr("role","region"),this.$element.attr("aria-label",this.content.share),this.openCommand=s.b.SHOW_SHARE_DIALOGUE,this.closeCommand=s.b.HIDE_SHARE_DIALOGUE,this.shareManifestsEnabled=this.options.shareManifestsEnabled||!1,this.extensionHost.subscribe(this.openCommand,(function(t){n=t,i.open(t)})),this.extensionHost.subscribe(this.closeCommand,(function(){n&&n.focus(),i.close()})),this.extensionHost.subscribe(s.b.SHOW_EMBED_DIALOGUE,(function(t){i.open(t),t&&l(t).is(".embed.btn")&&setTimeout((function(){i.$embedCode.focus()}),2)}));var a=l('<div role="heading" class="heading">'.concat(this.content.share,"</div>"));this.$content.append(a),this.$urlSection=l('<div class="share__section"><label class="share__label" for="embedCode">'.concat(this.content.shareLink,"</label></div>"));var r=this.getShareUrl();this.$urlInput=l('<input class="copy-input" id="urlInput" type="text" value="'.concat(r,'" readonly/>')),this.$urlInput.focus((function(){l(this).select()})),this.$urlSection.append(this.$urlInput),this.$content.append(this.$urlSection),this.$manifestSection=l('<div class="share__section"><label class="share__label" for="manifestCode">'.concat(this.content.iiif,"</label></div>"));var c=this.extension.getIIIFShareUrl(this.shareManifestsEnabled);this.$manifestInput=l('<input class="copy-input" id="manifestInput" type="text" value="'.concat(c,'" readonly/>')),this.$manifestInput.focus((function(){l(this).select()})),this.$manifestSection.append(this.$manifestInput),this.$content.append(this.$manifestSection),this.$embedSection=l('<div class="share__section"><label class="share__label" for="embedCode">'.concat(this.content.embed,"</label></div>")),this.$embedCode=l('<input class="copy-input" id="embedCode" type="text" readonly/>'),this.$embedCode.focus((function(){l(this).select()})),this.$embedSection.append(this.$embedCode),this.$content.append(this.$embedSection),this.$customSize=l('<div class="customSize"></div>'),this.$size=l('<label for="size" class="size">'.concat(this.content.size,"</label>")),this.$customSize.append(this.$size),this.$customSizeDropDown=l('<select class="embed-size-select" id="size" aria-label="'.concat(this.content.size,'"></select>')),this.$customSizeDropDown.append('<option value="small" data-width="560" data-height="420">560 x 420</option>'),this.$customSizeDropDown.append('<option value="medium" data-width="640" data-height="480">640 x 480</option>'),this.$customSizeDropDown.append('<option value="large" data-width="800" data-height="600">800 x 600</option>'),this.$customSizeDropDown.append('<option value="custom">'.concat(this.content.customSize,"</option>")),this.$customSizeDropDown.change((function(){i.update()})),this.$customSize.append(this.$customSizeDropDown),this.$widthInput=l('<input class="width" type="text" maxlength="10" aria-label="'.concat(this.content.width,'"/>')),this.$widthInput.on("keydown",(function(t){return o.FQ.numericalInput(t)})),this.$widthInput.change((function(){i.updateHeightRatio(),i.update()})),this.$customSize.append(this.$widthInput),this.$embedSection.append(this.$customSize),this.$x=l('<span class="x">x</span>'),this.$customSize.append(this.$x),this.$heightInput=l('<input class="height" type="text" maxlength="10" aria-label="'.concat(this.content.height,'"/>')),this.$heightInput.on("keydown",(function(t){return o.FQ.numericalInput(t)})),this.$heightInput.change((function(){i.updateWidthRatio(),i.update()})),this.$customSize.append(this.$heightInput);var h=l('<div class="iiif-section"></div>');this.$iiifButton=l('<a class="imageBtn iiif" href="'.concat(c,'" title="').concat(this.content.iiif,'" target="_blank"></a>')),h.append(this.$iiifButton),this.$content.append(h),this.$termsOfUseButton=l('<a href="#">'.concat(null===(e=this.extension.data.config)||void 0===e?void 0:e.content.termsOfUse,"</a>")),h.append(this.$termsOfUseButton),this.shareManifestsEnabled?this.$manifestSection.show():this.$manifestSection.hide(),o.YA.getBool(this.config.options.embedEnabled,!1)?this.$embedSection.show():this.$embedSection.hide(),this.onAccessibleClick(this.$termsOfUseButton,(function(){i.extensionHost.publish(s.b.SHOW_TERMS_OF_USE)})),o.YA.getBool(this.config.options.copyToClipboardEnabled,!0)&&(this.addCopyButton(this.$urlInput),this.addCopyButton(this.$embedCode),this.addCopyButton(this.$manifestInput)),this.$element.hide(),this.update()},e.prototype.open=function(e){t.prototype.open.call(this,e),this.update()},e.prototype.getShareUrl=function(){return this.extension.getShareUrl()},e.prototype.isShareAvailable=function(){return!!this.getShareUrl()},e.prototype.addCopyButton=function(t){var e=l('<button class="copyBtn" aria-label="'.concat(this.content.copyToClipboard,'">').concat(this.content.copyBtn,"</button>"));this.onAccessibleClick(e,(function(){o.B0.copy(t.val()),t.focus()}),!0,!0);var n=l('<div class="copy-group"></div>');n.append(e),n.insertBefore(t),t.insertBefore(e)},e.prototype.update=function(){this.isShareAvailable()?this.$urlSection.show():this.$urlSection.hide();var t=this.getSelectedSize();"custom"===t.val()?(this.$widthInput.show(),this.$x.show(),this.$heightInput.show()):(this.$widthInput.hide(),this.$x.hide(),this.$heightInput.hide(),this.currentWidth=Number(t.data("width")),this.currentHeight=Number(t.data("height")),this.$widthInput.val(String(this.currentWidth)),this.$heightInput.val(String(this.currentHeight))),this.updateShareOptions(),this.updateTermsOfUseButton()},e.prototype.updateShareOptions=function(){var t=this.getShareUrl();t&&this.$urlInput.val(t)},e.prototype.getSelectedSize=function(){return this.$customSizeDropDown.find(":selected")},e.prototype.updateWidthRatio=function(){this.currentHeight=Number(this.$heightInput.val()),this.currentHeight<this.minHeight?(this.currentHeight=this.minHeight,this.$heightInput.val(String(this.currentHeight))):this.currentHeight>this.maxHeight&&(this.currentHeight=this.maxHeight,this.$heightInput.val(String(this.currentHeight))),this.currentWidth=Math.floor(this.currentHeight/this.aspectRatio),this.$widthInput.val(String(this.currentWidth))},e.prototype.updateHeightRatio=function(){this.currentWidth=Number(this.$widthInput.val()),this.currentWidth<this.minWidth?(this.currentWidth=this.minWidth,this.$widthInput.val(String(this.currentWidth))):this.currentWidth>this.maxWidth&&(this.currentWidth=this.maxWidth,this.$widthInput.val(String(this.currentWidth))),this.currentHeight=Math.floor(this.currentWidth*this.aspectRatio),this.$heightInput.val(String(this.currentHeight))},e.prototype.updateTermsOfUseButton=function(){var t,e=this.extension.helper.getRequiredStatement();o.YA.getBool(null===(t=this.extension.data.config)||void 0===t?void 0:t.options.termsOfUseEnabled,!0)&&e&&e.value?this.$termsOfUseButton.show():this.$termsOfUseButton.hide()},e.prototype.close=function(){t.prototype.close.call(this)},e.prototype.resize=function(){this.setDockedPosition()},e}(a.X)},6807(t,e,n){n.d(e,{Q:()=>w});var i,o=n(4194),s=n(2949),a=n(8719),r=(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(e){return t.call(this,e,!1,!1)||this}return r(e,t),e.prototype.create=function(){t.prototype.create.call(this)},e.prototype.init=function(){var e=this;t.prototype.init.call(this),s.YA.getBool(this.extension.getSettings().rightPanelOpen,this.options.panelOpen)&&this.toggle(!0),this.extensionHost.subscribe(o.b.TOGGLE_EXPAND_RIGHT_PANEL,(function(){e.isFullyExpanded?e.collapseFull():e.expandFull()})),this.extensionHost.subscribe(o.b.TOGGLE_RIGHT_PANEL,(function(){e.toggle()})),this.extensionHost.subscribe(o.b.TOGGLE_LEFT_PANEL,(function(){e.extension.isMetric("sm")&&e.isExpanded&&e.toggle(!0)}))},e.prototype.getTargetWidth=function(){return this.isExpanded?this.options.panelCollapsedWidth:this.options.panelExpandedWidth},e.prototype.getTargetLeft=function(){return this.isExpanded?this.$element.parent().width()-this.options.panelCollapsedWidth:this.$element.parent().width()-this.options.panelExpandedWidth},e.prototype.toggleFinish=function(){var e=this;t.prototype.toggleFinish.call(this),this.isExpanded?this.extensionHost.publish(o.b.OPEN_RIGHT_PANEL):this.extensionHost.publish(o.b.CLOSE_RIGHT_PANEL),this.extension.updateSettings({rightPanelOpen:this.isExpanded}),setTimeout((function(){e.$element.toggleClass("open-finished")}),100)},e.prototype.resize=function(){t.prototype.resize.call(this)},e.prototype.toggle=function(e){this.isExpanded?this.$element.parent().removeClass("rightPanelOpen"):this.$element.parent().addClass("rightPanelOpen"),t.prototype.toggle.call(this,e)},e.prototype.expandFull=function(){t.prototype.expandFull.call(this)},e}(a.k),c=n(41),h=n(1539),u=n(6346),p=n(3664),d=n(4692);function f(t,e,n){return t.each((function(){d(this).removeClass(e).addClass(n)}))}function g(t,e,n){return void 0===e&&(e=8),void 0===n&&(n=0),t.each((function(){var t=d(this);if(t.contents().length>0){var i=t.contents().last();if(3===i[0].nodeType){var o=i.text().trim().split(" ");if(o.length>1)return o.splice(o.length-1,1),void(i[0].data=o.join(" "));if(void 0!==e&&1===o.length&&o[0].length>e)return void(i[0].data=o.join(" ").substring(0,e))}g(i,e,n+1)}else n>0&&t.remove()}))}function m(t,e,n,i,o,a,r){return void 0===a&&(a="Less information: Hide {0}"),void 0===r&&(r="More information: Reveal {0}"),t.each((function(){var t=d(this),l=t.find(".label");t.find(".value").each((function(c,h){for(var u=d(h),p=u.html(),m=l.contents().filter((function(){return this.nodeType===Node.TEXT_NODE})).text().trim(),b=d('<span>&hellip; <a href="#" class="toggle more">morepad</a></span>'),v=[p],y=t.height();u.text().length>0;){g(u);var $=u.html();u.append(b);var E=u.height();void 0!==E&&void 0!==y&&y>E&&(v.unshift($),y=u.height()),b.remove()}if(v.length<=e)u.html(p);else{var _=v[e-1],x=!1;u.toggle=function(){u.empty();var t=d('<a href="#" class="toggle"></a>');if(x){var e=s.DH.format(a,m);u.html(p+" "),t.text(n),f(t,"less","more"),t.attr("aria-label",e)}else{var l=s.DH.format(r,m);u.html(_+"&hellip; "),t.text(i),f(t,"more","less"),t.attr("aria-label",l)}t.one("click",(function(t){t.preventDefault(),u.toggle()})),x=!x,u.append(t),o&&o()},u.toggle()}}))}))}var b,v=n(4692),y=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();!function(t){t.LINES="lines",t.CHARS="chars"}(b||(b={}));var $=function(t){function e(e){var n=t.call(this,e)||this;return n._data=n.data(),n._data=n.options.data,n._init(),n._resize(),n}return y(e,t),e.prototype._init=function(){return t.prototype._init.call(this),this._$element=v(this.el),this._$metadataGroupTemplate=v('<div class="group"> <div class="header"></div> <div class="items"></div> </div>'),this._$metadataItemTemplate=v('<div class="item"> <div class="label"></div> <div class="values"></div> </div>'),this._$metadataItemValueTemplate=v('<div class="value"></div>'),this._$metadataItemURIValueTemplate=v('<a class="value" href="" target="_blank"></a>'),this._$copyTextTemplate=v('<div class="copyText" alt="'+this.options.data.content.copyToClipboard+'" title="'+this.options.data.content.copyToClipboard+'"> <div class="copiedText">'+this.options.data.content.copiedToClipboard+" </div> </div>"),this._$metadataGroups=v('<div class="groups"></div>'),this._$element.append(this._$metadataGroups),this._$noData=v('<div class="noData">'+this.options.data.content.noData+"</div>"),this._$element.append(this._$noData),!0},e.prototype.data=function(){return{aggregateValues:"",canvases:null,canvasDisplayOrder:"",metadataGroupOrder:"",canvasExclude:"",canvasLabels:"",content:{attribution:"Attribution",canvasHeader:"About the canvas",copiedToClipboard:"Copied to clipboard",copyToClipboard:"Copy to clipboard",description:"Description",imageHeader:"About the image",less:"less",lessAriaLabelTemplate:"Less information: Hide {0}",license:"License",rights:"Rights",logo:"Logo",manifestHeader:"About the item",more:"more",moreAriaLabelTemplate:"More information: Reveal {0}",noData:"No data to display",rangeHeader:"About the range",sequenceHeader:"About the sequence"},copiedMessageDuration:2e3,copyToClipboardEnabled:!1,helper:null,licenseFormatter:null,limit:4,limitType:b.LINES,limitToRange:!1,manifestDisplayOrder:"",manifestExclude:"",range:null,rtlLanguageCodes:"ar, ara, dv, div, he, heb, ur, urd",sanitizer:function(t){return t},showAllLanguages:!1}},e.prototype._getManifestGroup=function(){return this._metadataGroups.filter((function(t){return t.resource.isManifest()}))[0]},e.prototype._getCanvasGroups=function(){return this._metadataGroups.filter((function(t){return t.resource.isCanvas()}))},e.prototype.set=function(t){var e=this;if(this._data=Object.assign(this._data,t),this._data&&this._data.helper){var n,i={canvases:this._data.canvases,licenseFormatter:this._data.licenseFormatter,range:this._data.range};if(this._metadataGroups=this._data.helper.getMetadata(i),this._data.manifestDisplayOrder&&((n=this._getManifestGroup()).items=this._sortItems(n.items,this._readCSV(this._data.manifestDisplayOrder))),this._data.canvasDisplayOrder&&this._getCanvasGroups().forEach((function(t,n){t.items=e._sortItems(t.items,e._readCSV(e._data.canvasDisplayOrder))})),this._data.metadataGroupOrder&&(this._metadataGroups=this._sortGroups(this._metadataGroups,this._readCSV(this._data.metadataGroupOrder))),this._data.canvasLabels&&this._label(this._getCanvasGroups(),this._readCSV(this._data.canvasLabels,!1)),this._data.manifestExclude&&((n=this._getManifestGroup()).items=this._exclude(n.items,this._readCSV(this._data.manifestExclude))),this._data.canvasExclude&&this._getCanvasGroups().forEach((function(t,n){t.items=e._exclude(t.items,e._readCSV(e._data.canvasExclude))})),this._data.limitToRange){var o=[];this._metadataGroups.forEach((function(t,e){t.resource.isRange()&&o.push(t)})),o.length&&(this._metadataGroups=o)}this._render()}},e.prototype._sortItems=function(t,e){var n=this,i=[],o=t.slice(0);return e.forEach((function(t,e){var s=o.filter((function(e){return n._normalise(e.getLabel())===t}))[0];if(s){i.push(s);var a=o.indexOf(s);a>-1&&o.splice(a,1)}})),o.forEach((function(t,e){i.push(t)})),i},e.prototype._sortGroups=function(t,e){var n=[],i=t.slice(0);return e.forEach((function(t,e){var o=i.filter((function(e){return e.resource.getIIIFResourceType().toLowerCase()==t.toLowerCase()}))[0];if(o){n.push(o);var s=i.indexOf(o);s>-1&&i.splice(s,1)}})),n},e.prototype._label=function(t,e){t.forEach((function(t,n){t.label=e[n]}))},e.prototype._exclude=function(t,e){var n=this;return e.forEach((function(e,i){var o=t.filter((function(t){return n._normalise(t.getLabel())===e}))[0];if(o){var s=t.indexOf(o);s>-1&&t.splice(s,1)}})),t},e.prototype._normalise=function(t){return t?t.toLowerCase().replace(/ /g,""):null},e.prototype._render=function(){var t=this;this._metadataGroups.length?(this._$noData.hide(),this._$metadataGroups.empty(),this._metadataGroups.forEach((function(e,n){var i=t._buildMetadataGroup(e);t._$metadataGroups.append(i);var o=i.find(".value"),s=i.find(".item");if(t._data.limit&&t._data.content)if(t._data.limitType===b.LINES){var a=[s,t._data.limit,t._data.content.less,t._data.content.more,function(){},t._data.content.lessAriaLabelTemplate,t._data.content.moreAriaLabelTemplate];setTimeout((function(){m.apply(t,a)}),100)}else t._data.limitType===b.CHARS&&o.ellipsisHtmlFixed(t._data.limit,(function(){}))}))):this._$noData.show()},e.prototype._buildMetadataGroup=function(t){var e=this._$metadataGroupTemplate.clone(),n=e.find(">.header");if(this._data.content)if(t.resource.isManifest()&&this._data.content.manifestHeader)(o=this._sanitize(this._data.content.manifestHeader))&&n.html(o);else if(t.resource.isSequence()&&this._data.content.sequenceHeader)(o=this._sanitize(this._data.content.sequenceHeader))&&n.html(o);else if(t.resource.isRange()&&this._data.content.rangeHeader)(o=this._sanitize(this._data.content.rangeHeader))&&n.html(o);else if(t.resource.isCanvas()&&(t.label||this._data.content.canvasHeader)){var i=t.label||this._data.content.canvasHeader;n.html(this._sanitize(i))}else if(t.resource.isAnnotation()&&this._data.content.imageHeader){var o;(o=this._sanitize(this._data.content.imageHeader))&&n.html(o)}n.text()||n.hide();for(var s=e.find(".items"),a=0;a<t.items.length;a++){var r=t.items[a],l=this._buildMetadataItem(r);s.append(l)}return e},e.prototype._buildMetadataItem=function(t){var e,n,i=this._$metadataItemTemplate.clone(),o=i.find(".label"),a=i.find(".values"),r=t.getLabel(),l=r,c=new RegExp("/w+:(/?/?)[^s]+/gm","i");if(this._data.content&&l&&t.isRootLevel)switch(l.toLowerCase()){case"attribution":l=this._data.content.attribution;break;case"description":l=this._data.content.description;break;case"license":l=this._data.content.license;break;case"logo":l=this._data.content.logo;break;case"rights":l=this._data.content.rights}l=this._sanitize(l),o.html(l),this._addReadingDirection(o,this._getLabelLocale(t)),i.addClass(s.DH.toCssClass(l));var h=this._getValueLocale(t),u=null===(e=t.value)||void 0===e?void 0:e.getValue(h);if(!r||"license"!==r.toLowerCase()&&"rights"!==r.toLowerCase()||null===c.exec(u))if(this._data.showAllLanguages&&t.value&&t.value.length>1)for(var p=[],d=0;d<t.value.length;d++){var f=t.value[d]._locale;if(f&&!p.includes(f)){var g=t.getValue(f,"<br/>");g&&(n=this._buildMetadataItemValue(g,f),p.push(f),a.append(n))}}else{for(var m=this._getValueLocale(t),b=!1,y=0,$=t.getValues(m);y<$.length;y++){var _;(_=$[y])&&(b=!0,n=this._buildMetadataItemValue(_,m),a.append(n))}b||(_=t.getValue())&&(n=this._buildMetadataItemValue(_,m),a.append(n))}else n=this._buildMetadataItemURIValue(u),a.append(n);this._data.copyToClipboardEnabled&&s.B0.supportsCopy()&&o.text()&&this._addCopyButton(i,o,a);var x=this;return i.find("a.iiif-viewer-link").length>0&&i.on("click","a.iiif-viewer-link",(function(t){t.preventDefault();var e=v(t.target),n=e.attr("data-uv-navigate")||e.prop("href");x.fire(E.IIIF_VIEWER_LINK_CLICKED,n)})),i.find("[data-uv-navigate]").length>0&&i.on("click","[data-uv-navigate]",(function(t){t.preventDefault();var e=v(t.target).attr("data-uv-navigate")||null;e&&x.fire(E.IIIF_VIEWER_LINK_CLICKED,e)})),i},e.prototype._getLabelLocale=function(t){var e;if(!this._data||!this._data.helper)return"";var n=this._data.helper.options.locale;if(null===(e=t.label)||void 0===e?void 0:e.length){var i=t.label[0].locale;if(i.toLowerCase()!==n.toLowerCase())return i}return n},e.prototype._getValueLocale=function(t){return this._data&&this._data.helper?this._data.helper.options.locale:""},e.prototype._buildMetadataItemValue=function(t,e){t=(t=this._sanitize(t)).replace("\n","<br>");var n=this._$metadataItemValueTemplate.clone();return n.html(t),n.find("a").each((function(){var t=v(this);t.hasClass("iiif-viewer-link")||t.prop("target","_blank")})),e&&(n.prop("lang",e),this._addReadingDirection(n,e)),n},e.prototype._buildMetadataItemURIValue=function(t){t=this._sanitize(t);var e=this._$metadataItemURIValueTemplate.clone();return e.prop("href",t),e.text(t),e},e.prototype._addReadingDirection=function(t,e){e=u.Utils.getInexactLocale(e),this._readCSV(this._data.rtlLanguageCodes).filter((function(t){return t===e})).length>0&&(t.prop("dir","rtl"),t.addClass("rtl"))},e.prototype._addCopyButton=function(t,e,n){var i=this._$copyTextTemplate.clone(),o=i.children();e.append(i),s.pF.isTouch()?i.show():(t.on("mouseenter",(function(){i.show()})),t.on("mouseleave",(function(){i.hide()})),i.on("mouseleave",(function(){o.hide()})));var a=this,r=n.text();i.on("click",(function(t){a._copyItemValues(i,r)}))},e.prototype._copyItemValues=function(t,e){s.B0.copy(e);var n=t.find(".copiedText");n.show(),setTimeout((function(){n.hide()}),this._data.copiedMessageDuration)},e.prototype._readCSV=function(t,e){void 0===e&&(e=!0);var n=[];if(t&&(n=t.split(","),e))for(var i=0;i<n.length;i++)n[i]=this._normalise(n[i]);return n},e.prototype._sanitize=function(t){return this._data.sanitizer?this._data.sanitizer(t):null},e.prototype._resize=function(){},e}(p.$),E=function(){function t(){}return t.IIIF_VIEWER_LINK_CLICKED="iiifViewerLinkClicked",t}(),_=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),x=window.$,w=function(t){function e(e){return t.call(this,e)||this}return _(e,t),e.prototype.create=function(){var e=this;this.setConfig("moreInfoRightPanel"),t.prototype.create.call(this),this.extensionHost.subscribe(o.b.CANVAS_INDEX_CHANGE,(function(){e.databind()})),this.extensionHost.subscribe(o.b.RANGE_CHANGE,(function(){e.databind()})),this.setTitle(this.config.content.title),this.$metadata=x('<article class="iiif-metadata-component"></article>'),this.$main.append(this.$metadata),this.metadataComponent=new $({target:this.$metadata[0],data:this._getData()}),this.metadataComponent.on("iiifViewerLinkClicked",(function(t){var n=s.f.getHashParameterFromString("rid",t),i=s.f.getHashParameterFromString("t",t);if(n&&null===i&&(a=e.extension.helper.getRangeById(n))&&e.extensionHost.publish(o.b.RANGE_CHANGE,a),null!==i){var a,r=Number(i);Number.isNaN(r)||(n?(a=e.extension.helper.getRangeById(n))&&e.extensionHost.publish(o.b.RANGE_TIME_CHANGE,{rangeId:a.id,time:r}):e.extensionHost.publish(o.b.CURRENT_TIME_CHANGE,r))}}),!1)},e.prototype.toggleFinish=function(){t.prototype.toggleFinish.call(this),this.databind()},e.prototype.databind=function(){this.metadataComponent.set(this._getData())},e.prototype._getCurrentRange=function(){return this.extension.helper.getCurrentRange()},e.prototype._getData=function(){var t=this.extension.getCurrentCanvases();return{canvasDisplayOrder:this.config.options.canvasDisplayOrder,canvases:t,canvasExclude:this.config.options.canvasExclude,canvasLabels:this.extension.getCanvasLabels(this.content.page),content:this.config.content,copiedMessageDuration:2e3,copyToClipboardEnabled:s.YA.getBool(this.config.options.copyToClipboardEnabled,!1),helper:this.extension.helper,licenseFormatter:new h.k9(this.content.license?this.content.license:{}),limit:this.config.options.textLimit||4,limitType:b.LINES,limitToRange:s.YA.getBool(this.config.options.limitToRange,!1),manifestDisplayOrder:this.config.options.manifestDisplayOrder,manifestExclude:this.config.options.manifestExclude,range:this._getCurrentRange(),rtlLanguageCodes:this.config.options.rtlLanguageCodes,sanitizer:function(t){return(0,c.aj)(t)},showAllLanguages:this.config.options.showAllLanguages}},e.prototype.resize=function(){t.prototype.resize.call(this),this.$main.height(this.$element.height()-this.$top.height()-this.$main.verticalMargins()),this.$main.attr("tabindex",0),this.$main.attr("aria-label",this.config.content.title),this.$metadata.height()<=this.$main.height()&&(this.$main.removeAttr("tabindex"),this.$main.removeAttr("aria-label"))},e}(l)},8719(t,e,n){n.d(e,{k:()=>l});var i,o=n(2949),s=n(4598),a=(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=window.$,l=function(t){function e(e,n,i){void 0===n&&(n=!1),void 0===i&&(i=!0);var o=t.call(this,e,n,i)||this;return o.isExpanded=!1,o.isFullyExpanded=!1,o.isUnopened=!0,o.autoToggled=!1,o.expandFullEnabled=!0,o}return a(e,t),e.prototype.create=function(){var e=this;t.prototype.create.call(this),this.$top=r('<div class="top"></div>'),this.$element.append(this.$top),this.$title=r('<h2 class="title"></h2>'),this.$top.append(this.$title),this.$expandFullButton=r('<a class="expandFullButton" tabindex="0"></a>'),this.$top.append(this.$expandFullButton),o.YA.getBool(this.config.options.expandFullEnabled,!0)||this.$expandFullButton.hide(),this.$collapseButton=r('<button role="button" class="collapseButton" tabindex="0" aria-expanded="true"></button>'),this.$collapseButton.prop("title",this.content.collapse),this.$collapseButton.attr("aria-label",this.content.collapse),this.$top.append(this.$collapseButton),this.$closed=r('<div class="closed"></div>'),this.$element.append(this.$closed),this.$expandButton=r('<button role="button" class="expandButton" tabindex="0" aria-expanded="false"></button>'),this.$expandButton.prop("title",this.content.expand),this.$expandButton.attr("aria-label",this.content.expand),this.$closed.append(this.$expandButton),this.$closedTitle=r('<a class="title"></a>'),this.$closed.append(this.$closedTitle),this.$main=r('<div class="main"></div>'),this.$element.append(this.$main),this.onAccessibleClick(this.$expandButton,(function(){e.toggle()})),this.$expandFullButton.on("click",(function(){e.expandFull()})),this.$closedTitle.on("click",(function(){e.toggle()})),this.$title.on("click",(function(){e.isFullyExpanded?e.collapseFull():e.toggle()})),this.onAccessibleClick(this.$collapseButton,(function(){e.isFullyExpanded?e.collapseFull():e.toggle()}))},e.prototype.init=function(){t.prototype.init.call(this)},e.prototype.setTitle=function(t){this.$title.text(t),this.$closedTitle.text(t)},e.prototype.toggle=function(t){var e,n,i=this,o=this.extension.getSettings(),s=o.reducedAnimation,a=document.documentElement.style.getPropertyValue("--uv-animation-duration");this.options.panelAnimationDuration&&document.documentElement.style.setProperty("--uv-animation-duration","".concat(this.options.panelAnimationDuration,"ms")),this.autoToggled=!!t,this.$element.toggleClass("open"),this.isExpanded&&(this.$top.attr("aria-hidden","true"),this.$main.attr("aria-hidden","true"),this.$closed.attr("aria-hidden","false"),this.$collapseButton.attr("aria-expanded","false"),this.$expandButton.attr("aria-expanded","false"));var r=0;s||(r=(null!==(n=null!==(e=this.options.panelAnimationDuration)&&void 0!==e?e:o.animationDuration)&&void 0!==n?n:250)+50),setTimeout((function(){i.toggled(),a&&document.documentElement.style.setProperty("--uv-animation-duration","".concat(a))}),r)},e.prototype.toggled=function(){this.toggleStart(),this.isExpanded=!this.isExpanded,this.isExpanded&&(this.$top.attr("aria-hidden","false"),this.$main.attr("aria-hidden","false"),this.$closed.attr("aria-hidden","true"),this.$collapseButton.attr("aria-expanded","true"),this.$expandButton.attr("aria-expanded","true")),this.toggleFinish(),this.isUnopened=!1},e.prototype.expandFull=function(){var t,e,n=this,i=this.extension.getSettings(),o=i.reducedAnimation,s=document.documentElement.style.getPropertyValue("--uv-animation-duration");this.options.panelAnimationDuration&&document.documentElement.style.setProperty("--uv-animation-duration","".concat(2*this.options.panelAnimationDuration,"ms")),this.expandFullStart();var a=0;o||(a=(null!==(e=null!==(t=this.options.panelAnimationDuration)&&void 0!==t?t:i.animationDuration)&&void 0!==e?e:250)+50,a*=2),setTimeout((function(){n.isExpanded||n.toggled(),n.expandFullFinish(),s&&document.documentElement.style.setProperty("--uv-animation-duration","".concat(s))}),a)},e.prototype.collapseFull=function(){var t,e,n=this,i=this.extension.getSettings(),o=i.reducedAnimation,s=document.documentElement.style.getPropertyValue("--uv-animation-duration");this.options.panelAnimationDuration&&document.documentElement.style.setProperty("--uv-animation-duration","".concat(2*this.options.panelAnimationDuration,"ms")),this.collapseFullStart();var a=0;o||(a=(null!==(e=null!==(t=this.options.panelAnimationDuration)&&void 0!==t?t:i.animationDuration)&&void 0!==e?e:250)+50,a*=2),setTimeout((function(){n.collapseFullFinish(),s&&document.documentElement.style.setProperty("--uv-animation-duration","".concat(s))}),a)},e.prototype.getTargetWidth=function(){return 0},e.prototype.getTargetLeft=function(){return 0},e.prototype.getFullTargetWidth=function(){return 0},e.prototype.getFullTargetLeft=function(){return 0},e.prototype.toggleStart=function(){},e.prototype.toggleFinish=function(){this.isExpanded&&!this.autoToggled?this.focusCollapseButton():this.focusExpandButton()},e.prototype.expandFullStart=function(){},e.prototype.expandFullFinish=function(){this.isFullyExpanded=!0,this.$expandFullButton.hide()},e.prototype.collapseFullStart=function(){},e.prototype.collapseFullFinish=function(){this.isFullyExpanded=!1,this.expandFullEnabled&&this.$expandFullButton.show(),this.focusExpandFullButton()},e.prototype.focusExpandButton=function(){var t=this;setTimeout((function(){t.$expandButton.focus()}),1)},e.prototype.focusExpandFullButton=function(){var t=this;setTimeout((function(){t.$expandFullButton.focus()}),1)},e.prototype.focusCollapseButton=function(){var t=this;setTimeout((function(){t.$collapseButton.focus()}),1)},e.prototype.resize=function(){t.prototype.resize.call(this),this.$main.height(this.$element.height()-this.$top.outerHeight(!0))},e}(s.P)},6496(t,e,n){n.d(e,{H:()=>M});var i,o=n(4194),s=function(t,e){this.informationType=t,this.param=e},a=n(3115),r=function(){function t(){}return t.FORBIDDEN="forbiddenResourceMessage",t}(),l=n(6346),c=n(2949),h=n(1123),u=window.$,p=function(){function t(){}return t.loadExternalResources=function(e,n){return new Promise((function(i){l.Utils.loadExternalResourcesAuth09(e,n,t.clickThrough,t.restricted,t.login,t.getAccessToken,t.storeAccessToken,t.getStoredAccessToken,t.handleExternalResourceResponse).then((function(t){i(t)})).catch((function(e){switch(e.name){case l.StatusCode.AUTHORIZATION_FAILED.toString():t.publish(o.b.LOGIN_FAILED);break;case l.StatusCode.FORBIDDEN.toString():t.publish(o.b.FORBIDDEN);break;case l.StatusCode.RESTRICTED.toString():break;default:t.publish(o.b.SHOW_MESSAGE,[e.message||e])}}))}))},t.clickThrough=function(e){return new Promise((function(n){t.publish(o.b.SHOW_CLICKTHROUGH_DIALOGUE,[{resource:e,acceptCallback:function(){if(e.clickThroughService)var i=window.open(e.clickThroughService.id),s=window.setInterval((function(){i&&i.closed&&(window.clearInterval(s),t.publish(o.b.CLICKTHROUGH),n())}),500)}}])}))},t.restricted=function(e){return new Promise((function(n,i){t.publish(o.b.SHOW_RESTRICTED_DIALOGUE,[{resource:e,acceptCallback:function(){t.publish(h.s.LOAD_FAILED),i(e)}}])}))},t.login=function(e){return new Promise((function(n){var i={};403===e.status&&(i.warningMessage=r.FORBIDDEN,i.showCancelButton=!0),console.log("login"),t.publish(o.b.SHOW_LOGIN_DIALOGUE,[{resource:e,loginCallback:function(){if(e.loginService)var i=window.open(e.loginService.id+"?t="+(new Date).getTime()),s=window.setInterval((function(){i&&i.closed&&(window.clearInterval(s),t.publish(o.b.LOGIN),n())}),500)},logoutCallback:function(){if(e.logoutService)var i=window.open(e.logoutService.id+"?t="+(new Date).getTime()),s=window.setInterval((function(){i&&i.closed&&(window.clearInterval(s),t.publish(o.b.LOGOUT),n())}),500)},options:i}])}))},t.getAccessToken=function(t,e){return new Promise((function(n,i){if(t.tokenService){var o=t.tokenService.id,s=o+"|"+(new Date).getTime(),a=function(t){window.removeEventListener("message",a);var o=t.data;o.error?i(e?o.errorDescription:void 0):n(o)};window.addEventListener("message",a,!1);var r=o+"?messageId="+s;u("#commsFrame").prop("src",r)}else i("Token service not found")}))},t.storeAccessToken=function(t,e,n){return new Promise((function(i,o){t.tokenService?(c.wc.set(t.tokenService.id,e,e.expiresIn,n),i()):o("Token service not found")}))},t.getStoredAccessToken=function(t,e){return new Promise((function(n,i){var o=[],s=null;if(t.tokenService&&(s=c.wc.get(t.tokenService.id,e)),s)o.push(s);else for(var a=c.f.getUrlParts(t.dataUri).hostname,r=c.wc.getItems(e),l=0;l<r.length;l++)(s=r[l]).key.includes(a)&&o.push(s);(o=o.sort((function(t,e){return t.expiresAt-e.expiresAt}))).length&&n(o[o.length-1].value)}))},t.handleExternalResourceResponse=function(e){return new Promise((function(n,i){if(e.isResponseHandled=!0,200===e.status)n(e);else if(302===e.status)n(e),t.publish(o.b.RESOURCE_DEGRADED,[e]);else if(401===e.error.status||500===e.error.status)i(e.error.statusText);else if(403===e.error.status){var s=new Error;s.message="Forbidden",s.name=l.StatusCode.FORBIDDEN.toString(),i(s)}else i(e.error.statusText)}))},t.handleDegraded=function(e){var n=new s(a.J.DEGRADED_RESOURCE,e);t.publish(o.b.SHOW_INFORMATION,[n])},t}(),d=n(41),f=window.$,g=function(){function t(){}return t.loadExternalResources=function(e,n,i){return new Promise((function(s){t.storageStrategy=n,e=e.map((function(t){return t.authAPIVersion=1,t.options=i,t})),l.Utils.loadExternalResourcesAuth1(e,t.openContentProviderInteraction,t.openTokenService,t.getStoredAccessToken,t.userInteractedWithContentProvider,t.getContentProviderInteraction,t.handleMovedTemporarily,t.showOutOfOptionsMessages).then((function(t){s(t)})).catch((function(e){switch(e.name){case l.StatusCode.AUTHORIZATION_FAILED.toString():t.publish(o.b.LOGIN_FAILED);break;case l.StatusCode.FORBIDDEN.toString():t.publish(o.b.FORBIDDEN);break;case l.StatusCode.RESTRICTED.toString():break;default:t.publish(o.b.SHOW_MESSAGE,[e.message||e])}}))}))},t.getCookieServiceUrl=function(e){return e.id+"?origin="+t.getOrigin()},t.openContentProviderInteraction=function(e){var n=t.getCookieServiceUrl(e);return window.open(n)},t.getOrigin=function(t){var e=window.location;return t&&((e=document.createElement("a")).href=t),e.protocol+"//"+e.hostname+(e.port?":"+e.port:"")},t.userInteractedWithContentProvider=function(t){return new Promise((function(e){var n=window.setInterval((function(){t.closed&&(window.clearInterval(n),e(!0))}),500)}))},t.handleMovedTemporarily=function(e){return new Promise((function(n){t.showDegradedMessage(e),e.isResponseHandled=!0,n()}))},t.showDegradedMessage=function(e){if(e.kioskService)t.publish(o.b.OPEN_EXTERNAL_RESOURCE,[[e]]);else{var n=new s(a.J.DEGRADED_RESOURCE,e);t.publish(o.b.SHOW_INFORMATION,[n])}},t.storeAccessToken=function(e,n){return new Promise((function(i,o){e.tokenService?(c.wc.set(e.tokenService.id,n,n.expiresIn||3600,t.storageStrategy),i()):o("Token service not found")}))},t.getStoredAccessToken=function(e){return new Promise((function(n,i){var o=[],s=null;if(e.tokenService&&(s=c.wc.get(e.tokenService.id,t.storageStrategy)),s)o.push(s);else for(var a=c.f.getUrlParts(e.dataUri).hostname,r=c.wc.getItems(t.storageStrategy),l=0;l<r.length;l++)(s=r[l]).key.includes(a)&&o.push(s);var h=null;(o=o.sort((function(t,e){return t.expiresAt-e.expiresAt}))).length&&(h=o[o.length-1].value),n(h)}))},t.getContentProviderInteraction=function(e,n){return new Promise((function(i){e.isResponseHandled&&!e.authHoldingPage?(t.showDegradedMessage(e),i(null)):e.authHoldingPage?(e.authHoldingPage.location.href=t.getCookieServiceUrl(n),i(e.authHoldingPage)):t.publish(o.b.SHOW_AUTH_DIALOGUE,[{service:n,closeCallback:function(){i(null)},confirmCallback:function(){var e=t.openContentProviderInteraction(n);i(e)},cancelCallback:function(){i(null)}}])}))},t.openTokenService=function(e,n){return new Promise((function(i,o){var s=t.getOrigin(n.id),a=(new Date).getTime();t.messages[a]={resolve:i,reject:o,serviceOrigin:s,resource:e},window.addEventListener("message",t.receiveToken,!1);var r=n.id+"?messageId="+a+"&origin="+t.getOrigin();f("#commsFrame").prop("src",r),setTimeout((function(){t.messages[a]&&(t.messages[a].reject("Message unhandled after 5000ms, rejecting"),delete t.messages[a])}),5e3)}))},t.receiveToken=function(e){if(e.data.hasOwnProperty("messageId")){var n=t.messages[e.data.messageId];n&&e.origin==n.serviceOrigin&&t.storeAccessToken(n.resource,e.data).then((function(){n.resolve(e.data),delete t.messages[e.data.messageId]}))}},t.showOutOfOptionsMessages=function(e,n){if(302!=e.status){var i="";n.getFailureHeader()&&(i+="<p>"+n.getFailureHeader()+"</p>"),n.getFailureDescription()&&(i+=n.getFailureDescription()),t.publish(o.b.SHOW_MESSAGE,[(0,d.aj)(i)])}},t.messages={},t}(),m=n(9323),b=(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),v=window.$,y=function(t){function e(e){return t.call(this,e)||this}return b(e,t),e.prototype.create=function(){var e=this;this.setConfig("authDialogue"),t.prototype.create.call(this),this.openCommand=o.b.SHOW_AUTH_DIALOGUE,this.closeCommand=o.b.HIDE_AUTH_DIALOGUE,this.extensionHost.subscribe(this.openCommand,(function(t){var n=Array.isArray(t)?t[0]:t;e.closeCallback=n.closeCallback,e.confirmCallback=n.confirmCallback,e.cancelCallback=n.cancelCallback,e.service=n.service,e.open()})),this.extensionHost.subscribe(this.closeCommand,(function(){e.close()})),this.$title=v('<div role="heading" class="heading"></div>'),this.$content.append(this.$title),this.$content.append(' <div> <p class="message scroll"></p> </div>'),this.$buttons.prepend(this._buttonsToAdd()),this.$message=this.$content.find(".message"),this.$confirmButton=this.$buttons.find(".confirm"),this.$confirmButton.text(this.content.confirm),this.$cancelButton=this.$buttons.find(".close"),this.$cancelButton.text(this.content.cancel),this.$element.hide(),this.$confirmButton.on("click",(function(t){t.preventDefault(),e.confirmCallback&&e.confirmCallback(),e.close()})),this.$cancelButton.on("click",(function(t){t.preventDefault(),e.cancelCallback&&e.cancelCallback(),e.close()}))},e.prototype.open=function(){if(this.service){t.prototype.open.call(this);var e=this.service.getHeader(),n=this.service.getDescription(),i=this.service.getConfirmLabel();e&&this.$title.text((0,d.aj)(e)),n&&(this.$message.html((0,d.aj)(n)),this.$message.targetBlank(),this.$message.find("a").on("click",(function(){var t=v(this).attr("href");this.extensionHost.publish(o.b.EXTERNAL_LINK_CLICKED,t)}))),i&&this.$confirmButton.text((0,d.aj)(i)),this.resize()}else console.error("NO SERVICE")},e.prototype.resize=function(){t.prototype.resize.call(this)},e.prototype._buttonsToAdd=function(){var t='<a class="confirm btn btn-primary" href="#" target="_parent"></a>';return this.options.topCloseButtonEnabled&&(t+='<button class="close btn btn-default"></button>'),t},e}(m.X),$=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),E=window.$,_=function(t){function e(e){return t.call(this,e)||this}return $(e,t),e.prototype.create=function(){var e=this;this.setConfig("clickThroughDialogue"),t.prototype.create.call(this),this.openCommand=o.b.SHOW_CLICKTHROUGH_DIALOGUE,this.closeCommand=o.b.HIDE_CLICKTHROUGH_DIALOGUE,this.extensionHost.subscribe(this.openCommand,(function(t){e.acceptCallback=t.acceptCallback,e.resource=t.resource,e.open()})),this.extensionHost.subscribe(this.closeCommand,(function(){e.close()})),this.$title=E('<div role="heading" class="heading"></div>'),this.$content.append(this.$title),this.$content.append(' <div> <p class="message scroll"></p> <div class="buttons"> <a class="acceptTerms btn btn-primary" href="#" target="_parent"></a> </div> </div>'),this.$message=this.$content.find(".message"),this.$acceptTermsButton=this.$content.find(".acceptTerms"),this.$acceptTermsButton.text("Accept Terms and Open"),this.$element.hide(),this.$acceptTermsButton.on("click",(function(t){t.preventDefault(),e.close(),e.extensionHost.publish(o.b.ACCEPT_TERMS),e.acceptCallback&&e.acceptCallback()}))},e.prototype.open=function(){t.prototype.open.call(this),this.resource.clickThroughService&&(this.$title.text(this.resource.clickThroughService.getProperty("label")),t