",{role:"button",class:c+"-close-button",tabindex:"0","aria-label":this.parent.l10n.close}),(0,a.onClick)(this.$closeButton,function(){return t.parent.toggleEndscreen(!1)});var e=l("
",{class:c+"-introduction-title"}).append([this.$endscreenIntroductionTitleText,this.$closeButton]);this.$endscreenIntroductionText=l("
",{class:c+"-introduction-text",id:c+"-introduction-text"}),this.$submitButtonContainer=l("
",{class:c+"-submit-button-container "+u}),this.$submitButton=H5P.JoubelUI.createButton({class:c+"-submit-button",html:this.l10n.submitButton,appendTo:this.$submitButtonContainer,click:function(){return t.handleSubmit()}}),this.$endscreenOverviewTitle=l("
",{class:c+"-overview-title"}).append(l("
",{class:c+"-overview-title-answered-questions",html:this.l10n.tableRowAnswered})).append(l("
",{class:c+"-overview-title-score",html:this.l10n.tableRowScore})),this.$endscreenBottomTable=l("
",{class:c+"-overview-table"}),this.$endscreen=l("
",{class:c,role:"dialog","aria-labelledby":c+"-introduction-title-text","aria-describedby":c+"-introduction-text"}).append(l("
",{class:c+"-introduction"}).append(l("
",{class:c+"-star-symbol"})).append(l("
",{class:c+"-introduction-container"}).append([e,this.$endscreenIntroductionText,this.$submitButtonContainer]))).append(l("
",{class:c+"-overview"}).append(this.$endscreenOverviewTitle).append(this.$endscreenBottomTable))}},{key:"handleSubmit",value:function(){var t=this;this.$submitButtonContainer.hasClass(u)||(this.$submitButtonContainer.addClass(u),this.$endscreenIntroductionText.html('
'+this.l10n.submitMessage+"
"),this.answered.forEach(function(e){if("completed"!==e.getLastXAPIVerb()&&"answered"!==e.getLastXAPIVerb()){var n=new H5P.XAPIEvent;n.data.statement=e.getXAPIData().statement,e.setLastXAPIVerb(n.getVerb()),t.trigger(n)}}),this.parent.triggerXAPIScored(this.parent.getUsersScore(),this.parent.getUsersMaxScore(),"completed"))}},{key:"getDOM",value:function(){return this.$endscreen}},{key:"buildTableRow",value:function(t,e,n,o){var i=this,r=d(n)&&d(o),s=r?this.l10n.tableRowSummaryWithScore:this.l10n.tableRowSummaryWithoutScore,u=this.parent.skippingPrevented()?" "+c+"-no-link":"",h=l("
",{class:c+"-overview-table-row"+u,role:"row",tabIndex:0,"aria-label":s.replace("@score",n).replace("@total",o).replace("@question",e).replace("@minutes",Math.floor(t/60)).replace("@seconds",t%60)});return(0,a.onClick)(h,function(){return i.jump(t)}),l("
",{class:c+"-overview-table-row-time",html:H5P.InteractiveVideo.humanizeTime(t),appendTo:h,"aria-hidden":!0}),l("
",{class:c+"-overview-table-row-title",html:e,appendTo:h,"aria-hidden":!0}),l("
",{class:c+"-overview-table-row-score",html:r?n+" / "+o:this.l10n.answeredScore,appendTo:h,"aria-hidden":!0}),h}},{key:"jump",value:function(t){this.parent.skippingPrevented()||(this.parent.seek(t),this.parent.toggleEndscreen(!1))}},{key:"update",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.answered=e.filter(function(t){return void 0!==t.getProgress()}).sort(function(t,e){return t.getDuration().from-e.getDuration().from}),this.$endscreenBottomTable.empty(),this.answered.forEach(function(e){var n=e.getDuration().from,o=t.getDescription(e),i=e.getInstance(),r=i.getScore?i.getScore():void 0,s=i.getMaxScore?i.getMaxScore():void 0;t.$endscreenBottomTable.append(t.buildTableRow(n,o,r,s))});var n=this.answered.length;this.$endscreenIntroductionTitleText.html(this.l10n.title.replace("@answered",n)),0===n?this.$endscreenIntroductionText.html('
'+this.l10n.informationNoAnswers+"
"+this.l10n.informationMustHaveAnswer+"
"):this.$endscreenIntroductionText.html(this.l10n.information.replace("@answered",n)),n>0&&this.$submitButtonContainer.removeClass(u)}},{key:"getDescription",value:function(t){return"function"==typeof t.getInstance&&"function"==typeof t.getInstance().getTitle?t.getInstance().getTitle():t.getTitle()}},{key:"focus",value:function(){this.$submitButtonContainer.hasClass(u)?this.$closeButton.focus():this.$submitButton.focus()}}]),e}(H5P.EventDispatcher);e.default=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.onClick=void 0;var o=n(3);e.onClick=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.ignoreKeyboard,r=void 0!==i&&i,s=n.preventDefaultForKeys,a=void 0===s||s,l=function(t){"click"!==t.type&&a&&t.preventDefault(),e(t)};t.click(l),!0!==r&&(0,o.onKey)(t,[{key:o.Keys.SPACE},{key:o.Keys.ENTER}],l)}}]);;