',s.appendTo=function(t){s.$scoreBar.appendTo(t)},s.setScore=function(t){t!==s.score&&(s.score=t>s.maxScore?s.maxScore:t,s.updateVisuals())},s.incrementScore=function(t){s.setScore(s.score+(t||1))},s.setMaxScore=function(t){s.maxScore=t},s.updateVisuals=function(){s.$progress.html(o(s.score)),s.$scoreCounter.text(s.score),s.$maxScore.text(s.maxScore),setTimeout(function(){s.$progress.css({width:s.score/s.maxScore*100+"%"}),H5P.Transition.onTransitionEnd(s.$progress,function(){s.$scoreBar.toggleClass("h5p-joubelui-score-bar-full-score",s.score===s.maxScore),s.$scoreBar.toggleClass("h5p-joubelui-score-bar-animation-active",s.score===s.maxScore),s.$scoreBar.one("animationend",function(){s.$scoreBar.removeClass("h5p-joubelui-score-bar-animation-active")})},600)},300)},s.reset=function(){s.$scoreBar.removeClass("h5p-joubelui-score-bar-full-score")},s.$scoreBar=r("
",{class:"h5p-joubelui-score-bar"}),t=r("
",{class:"h5p-joubelui-score-bar-visuals",appendTo:s.$scoreBar}),s.$progressWrapper=r("
",{class:"h5p-joubelui-score-bar-progress-wrapper",appendTo:t}),s.$progress=r("
",{class:"h5p-joubelui-score-bar-progress",html:o(s.score),appendTo:s.$progressWrapper}),r("
",{class:"h5p-joubelui-score-bar-star",html:s.STAR_MARKUP}).appendTo(t),t=r("
",{class:"h5p-joubelui-score-numeric",appendTo:s.$scoreBar,"aria-hidden":!0}),s.$scoreCounter=r("",{class:"h5p-joubelui-score-number h5p-joubelui-score-number-counter",text:0,appendTo:t}),r("",{class:"h5p-joubelui-score-number-separator",text:"/",appendTo:t}),s.$maxScore=r("",{class:"h5p-joubelui-score-number h5p-joubelui-score-max",text:s.maxScore,appendTo:t}),i&&(H5P.JoubelUI.createTip(i,{tipLabel:n||i,helpIcon:!0}).appendTo(s.$scoreBar),s.$scoreBar.addClass("h5p-score-bar-has-help"))}}(H5P.jQuery),H5P||{}),H5P=(H5P.JoubelProgressbar=function(i){function t(t,e){H5P.EventDispatcher.call(this);this.options=i.extend({progressText:"Slide :num of :total"},e),this.currentStep=0,this.steps=t,this.$progressbar=i("
",{class:"h5p-joubelui-progressbar"}),this.$background=i("
",{class:"h5p-joubelui-progressbar-background"}).appendTo(this.$progressbar)}return((t.prototype=Object.create(H5P.EventDispatcher.prototype)).constructor=t).prototype.updateAria=function(){var t;this.options.disableAria||(this.$currentStatus||(this.$currentStatus=i("
",{class:"h5p-joubelui-progressbar-slide-status-text","aria-live":"assertive"}).appendTo(this.$progressbar)),t=this.options.progressText.replace(":num",this.currentStep).replace(":total",this.steps),this.$currentStatus.html(t))},t.prototype.appendTo=function(t){this.$progressbar.appendTo(t)},t.prototype.setProgress=function(t){t>this.steps||t<0||(this.currentStep=t,this.$background.css({width:this.currentStep/this.steps*100+"%"}),this.updateAria())},t.prototype.next=function(){this.setProgress(this.currentStep+1)},t.prototype.reset=function(){this.setProgress(0)},t.prototype.isLastStep=function(){return this.steps===this.currentStep},t}(H5P.jQuery),H5P||{}),H5P=(H5P.JoubelUI=function(i){function t(){}var e;return t.createTip=function(t,e){return new H5P.JoubelTip(t,e)},t.createMessageDialog=function(t,e){return new H5P.JoubelMessageDialog(t,e)},t.createHelpTextDialog=function(t,e,i){return new H5P.JoubelHelpTextDialog(t,e,i)},t.createProgressCircle=function(t,e,i,n){return new H5P.JoubelProgressCircle(t,e,i,n)},t.createThrobber=function(){return new H5P.JoubelThrobber},t.createSimpleRoundedButton=function(t){return new H5P.SimpleRoundedButton(t)},t.createSlider=function(t){return new H5P.JoubelSlider(t)},t.createScoreBar=function(t,e,i,n){return new H5P.JoubelScoreBar(t,e,i,n)},t.createProgressbar=function(t,e){return new H5P.JoubelProgressbar(t,e)},t.createButton=function(t){var e="button";return t.href?e="a":t.type="button",t.class?t.class+=" h5p-joubelui-button":t.class="h5p-joubelui-button",i("<"+e+"/>",t)},H5P.isFramed&&!H5P.hasiOSiframeScrollFix&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&(H5P.hasiOSiframeScrollFix=!0,e=HTMLElement.prototype.focus,HTMLElement.prototype.focus=function(){(this instanceof HTMLAnchorElement||this instanceof HTMLInputElement||this instanceof HTMLSelectElement||this instanceof HTMLTextAreaElement||this instanceof HTMLButtonElement||this instanceof HTMLIFrameElement||this instanceof HTMLAreaElement)&&!this.getAttribute("role")&&e.call(this)}),t}(H5P.jQuery),/*!@license H5P.Question-1.5/scripts/question.js by Joubel licensed under MIT*/H5P.Tooltip=H5P.Tooltip||function(){},H5P.Question=function(j,t,W){function e(O){function d(t,e){x[t]={},t=x[t].$element=j("
",{class:"h5p-question-"+t}),e&&t[e instanceof j?"append":"html"](e)}function p(t,e){e instanceof j?x[t].$element.html("").append(e):x[t].$element.html(e)}function f(){if(void 0!==x.buttons){clearTimeout(l);for(var t=0;t<_.length;t++)S(h,_[t].id,u,x.buttons.$element),u[_[t].id].isVisible=!0;for(var e=0,i=!(_=[]),n=0;nr.height()-15,o=e[0].offsetLeft<15,s=e[0].offsetLeft+e.width()>r.width()-15,d=e[0].offsetLeft-l/2+e.width()/2,h=e[0].offsetTop-c-15,p=d+l/2-a.width()/2,f=h+c-a.height()/2,m=225,c+15>e[0].offsetTop&&(f=(h=e[0].offsetTop+e.height()+15)-a.height()/2,m=45),(d=d<0?0:d)+l>r.width()&&(d=r.width()-l),i&&(o||s)?(d=e[0].offsetLeft+(o?e.width():-l),h=e[0].offsetTop+e.height(),u=!0):n&&(o||s)?(d=e[0].offsetLeft+(o?e.width():-l),h=e[0].offsetTop-c,u=!0):i||n||(o||s)&&(h=e[0].offsetTop-c/2+e.width()/2,(d=e[0].offsetLeft+(o?e.width()+15:-l-15))<0?u=!(d=0):(p=d+(o?-a.width()/2:l-a.width()/2),f=h+c/2-a.height()/2,m=o?315:135)),h+c>r.height()&&(h=r.height()-c,c>r.height()-(e[0].offsetTop+e.height()+15))))&&(u=!0),t.css({top:h=h<0?0:h,left:d}),a.css({top:f,left:p}),u?a.hide():a.css({left:p,top:f,transform:"rotate("+m+"deg)"}).show()},E=function(t){var e,i,n;if(t.is(":visible"))return e=t.hasClass("h5p-question-popup"),e=t.clone().css({position:"absolute","max-height":"none",width:e?"":"100%"}).appendTo(t.parent()),n=parseFloat(t.css("margin-left"))+parseFloat(t.css("margin-right")),i=e.css("width")?e.css("width"):"100%",e.css("width","calc("+i+" - "+n+"px)"),i=Math.round(e.get(0).getBoundingClientRect().height),n=parseFloat(t.css("fontSize")),t.css("max-height",i/n+"em"),e.remove(),0",{class:"h5p-question-video"})},H&&t.params.playback&&(t.params.playback.autoplay=!1),t.params.visuals||(t.params.visuals={}),t.params.visuals.fit=!1,x.video.instance=H5P.newRunnable(t,w.contentId,x.video.$element,!0);var e=!1;return x.video.instance.on("resize",function(){e=!0,w.trigger("resize"),e=!1}),w.on("resize",function(){e||x.video.instance.trigger("resize")}),w},w.setAudio=function(t){return t.params=t.params||{},x.audio={$element:j("
",{class:"h5p-question-audio"})},H?t.params.autoplay=!1:"transparent"===t.params.playerMode&&(t.params.autoplay=!0),x.audio.instance=H5P.newRunnable(t,w.contentId,x.audio.$element,!0),x.audio.instance.audio&&(x.audio.instance.audio.style.height=""),w},w.pause=function(){x.video&&x.video.isVisible&&x.video.instance.pause(),x.audio&&x.audio.isVisible&&x.audio.instance.pause()},w.play=function(){x.video&&x.video.isVisible&&x.video.instance.play(),x.audio&&x.audio.isVisible&&x.audio.instance.play()},w.disableAutoPlay=function(){H=!0},w.massageAttributeOutput=function(t){var t=(new DOMParser).parseFromString(t,"text/html"),e=document.createElement("div");return e.innerHTML=t.documentElement.textContent,e.textContent||e.innerText||""},w.setImage=function(t,e){e=e||{},x.image={},x.image.$element=j("
",{class:"h5p-question-image h5p-question-image-fill-width"});var i=j("
",{class:"h5p-question-image-wrap",appendTo:x.image.$element}),n=j("",{src:H5P.getPath(t,w.contentId),alt:void 0===e.alt?"":w.massageAttributeOutput(e.alt),title:void 0===e.title?"":w.massageAttributeOutput(e.title),on:{load:function(){w.trigger("imageLoaded",this),w.trigger("resize")}},appendTo:i});if(!e.disableImageZooming){const s=()=>{var t="true"===i.attr("aria-expanded")?e.minimizeImage:e.expandImage;i.attr("aria-label",t+" "+e.alt)};var o=!1;return w.on("resize",function(){!o&&n.is(":visible")&&(i.addClass("h5p-question-image-scalable").attr("aria-expanded",!1).attr("role","button").attr("tabIndex","0").on("click",function(t){1===t.which&&(r.apply(this),s())}).on("keypress",function(t){32===t.which&&(t.preventDefault(),r.apply(this),s())}),s(),x.image.$element.removeClass("h5p-question-image-fill-width"),o=!0)}),w}n.css("maxHeight","none"),t=function(){var t=x.image.$element.get(0).getBoundingClientRect().width,e=(i.css({"-webkit-transition":"none",transition:"none"}),2*(i.get(0).getBoundingClientRect().left-x.image.$element.get(0).getBoundingClientRect().left));n.get(0).naturalWidth>=t-e?x.image.$element.addClass("h5p-question-image-fill-width"):x.image.$element.removeClass("h5p-question-image-fill-width"),i.css({"-webkit-transition":"",transition:""})},n.is(":visible")?t():n.on("load",t)},w.setIntroduction=function(t){return d("introduction",t),w},w.setContent=function(t,e){return d("content",t),e&&e.class&&x.content.$element.addClass(e.class),w},w.read=function(t){o&&(s?s+=("."===s.substr(-1,1)?" ":". ")+t:s=t,o.html(s),setTimeout(function(){s=null,o.html("")},100))},w.readFeedback=function(){var t;!k.disableReadSpeaker&&b&&x.feedback&&x.feedback.$element&&(t=j(".h5p-question-feedback-content-text",x.feedback.$element))&&t.html()&&t.html().length&&w.read(t.html())},w.removeFeedback=function(){return clearTimeout(y),x.feedback&&b&&(b=!1,L(x.scorebar),L(x.feedback),T=!0,y=setTimeout(function(){b||(x.feedback.$element.children().detach(),x.scorebar.$element.children().detach(),w.trigger("resize")),T=!1,v.setScore(0)},150),m)&&m.find(".h5p-question-feedback-tail").remove(),w},w.setFeedback=function(t,e,i,n,o,s,r){var a,l,c,u,h;return k.disableFeedback||(f(),g=null!=s&&null!=s.click?s.click:null,clearTimeout(y),a=j("
",{class:"h5p-question-feedback-container"}),u=j("
",{class:"h5p-question-feedback-content"}).appendTo(a),j("
",{class:"h5p-question-feedback-content-text",html:t}).appendTo(u),l=j("
",{class:"h5p-question-scorebar-container"}),(v=void 0===v?W.createScoreBar(i,n,o,r):v).appendTo(l),u.toggleClass("has-content",void 0!==t&&0",{class:"h5p-question-feedback-tail"}).hide().appendTo(r),r=j("
",{class:"h5p-question-feedback-close",tabindex:0,title:o,on:{click:function(t){c.remove(),h.remove(),t.preventDefault()},keydown:function(t){switch(t.which){case 13:case 32:c.remove(),h.remove(),t.preventDefault()}}}}).hide().appendTo(c),null!=u&&(u.hasClass("correct")?(c.addClass("h5p-question-feedback-correct"),r.show(),x.buttons.$element.hide()):x.buttons.$element.appendTo(x.feedback.$element)),D(c,u),v.setScore(e)):y=setTimeout(function(){var t;E(x.feedback.$element),E(x.scorebar.$element),T=!0,!m||m.hasClass("h5p-standalone")&&!H5P.isFullscreen||(t=$(m))&&t.animate({scrollTop:m.css("height")},"slow"),y=setTimeout(function(){T=!1,w.trigger("resize"),v.setScore(e)},150)},0)),w},w.updateFeedbackContent=function(t,e){return x.feedback&&x.feedback.$element&&(e&&(t=j(".h5p-question-feedback-content",x.feedback.$element).html()+" "+t),j(".h5p-question-feedback-content",x.feedback.$element).html(t).addClass("has-content"),E(x.feedback.$element),setTimeout(w.trigger.bind(w,"resize"),150)),w},w.setExplanation=function(t,e){return t?(e=new H5P.Question.Explainer(e,t),x.explanation?p("explanation",e.getElement()):(d("explanation",e.getElement()),C&&m&&S(w.order,"explanation",x,m))):x.explanation&&x.explanation.$element.children().detach(),w},w.hasButton=function(t){return void 0!==u[t]},w.addButton=function(t,e,i,n,o,s){var r,a,l,c;return!u[t]&&(void 0===x.buttons&&(d("buttons"),C)&&S(w.order,"buttons",x,m),(s=s||{}).confirmationDialog=s.confirmationDialog||{},o=o||{},r=w.addConfirmationDialogToButton(s.confirmationDialog,i),s.contentData&&s.contentData.standalone&&(s.contentData.isScoringEnabled||s.contentData.isReportingEnabled)&&s.textIfSubmitting&&(e=s.textIfSubmitting),u[t]={isTruncated:!(a=function(){s.confirmationDialog.enable&&r?(s.confirmationDialog.$parentElement||x.popups.$element.removeClass("hidden"),r.show(c.position().top)):i()}),text:e,isVisible:!1,ariaLabel:o["aria-label"]},l=void 0!==o.href,c=u[t].$element=W.createButton(j.extend({class:"h5p-question-"+t,html:e,on:{click:function(t){a(),l&&t.preventDefault()}}},o)),h.push(t),H5P.Tooltip(c.get(0),{tooltipSource:"data-tooltip"}),l&&c.on("keypress",function(t){32===t.which&&(a(),t.preventDefault())}),void 0===n||n)&&(c.appendTo(x.buttons.$element),u[t].isVisible=!0,B(x.buttons)),w},function(t){var e=t.$element,e=e.clone().css({position:"absolute","white-space":"nowrap","max-width":"none"}).removeClass("truncated").html(t.text).appendTo(e.parent());t.width={max:Math.ceil(e.outerWidth()+parseFloat(e.css("margin-left"))+parseFloat(e.css("margin-right")))},e.html("").addClass("truncated"),t.width.min=Math.ceil(e.outerWidth()+parseFloat(e.css("margin-left"))+parseFloat(e.css("margin-right"))),e.remove()});w.addConfirmationDialogToButton=function(e,t){if((e=e||{}).enable){var i=new H5P.ConfirmationDialog({instance:e.instance,headerText:e.l10n.header,dialogText:e.l10n.body,cancelText:e.l10n.cancelLabel,confirmText:e.l10n.confirmLabel});if(e.$parentElement){var n=e.$parentElement.get(0);let t;n.classList.contains("h5p-content")&&(t=n.querySelector(".h5p-container")),i.appendTo(t??n)}else void 0===x.popups&&(d("popups"),C&&S(w.order,"popups",x,m),x.popups.$element.addClass("hidden"),w.order.push("popups")),i.appendTo(x.popups.$element.get(0));return i.on("confirmed",function(){e.$parentElement||x.popups.$element.addClass("hidden"),t(),w.trigger("confirmed")}),i.on("canceled",function(){e.$parentElement||x.popups.$element.addClass("hidden"),w.trigger("canceled")}),i}},w.showButton=function(t,e){var i=-1!==n(t,"id",c);return void 0===u[t]||!0===u[t].isVisible&&!i||(e=e||0,-1!==(i=n(t,"id",_))?_[i].priority",{"aria-live":"polite",class:"h5p-hidden-read"}),d("read",o),w.trigger("registerDomElements")),(m=t).html("").addClass("h5p-question h5p-"+O);for(var e=[],i=0;i=e&&o)return n.feedback}return""},e}(H5P.jQuery,H5P.EventDispatcher,H5P.JoubelUI),/*!@license H5P.Question-1.5/scripts/explainer.js by Joubel licensed under MIT*/H5P.Question.Explainer=function(l){return function(s,r){var a=this;!function(){a.$explanation=l("
",{class:"h5p-question-explanation-container"}),l("
",{class:"h5p-question-explanation-title",role:"heading",html:s,appendTo:a.$explanation});for(var t=l("