",{class:"h5p-question-scorebar-container"}),(v=void 0===v?R.createScoreBar(i,n,s,r):v).appendTo(l),h.toggleClass("has-content",void 0!==e&&0
",{class:"h5p-question-feedback-tail"}).hide().appendTo(r),r=W("
",{class:"h5p-question-feedback-close",tabindex:0,title:s,on:{click:function(e){c.remove(),u.remove(),e.preventDefault()},keydown:function(e){switch(e.which){case 13:case 32:c.remove(),u.remove(),e.preventDefault()}}}}).hide().appendTo(c),null!=h&&(h.hasClass("correct")?(c.addClass("h5p-question-feedback-correct"),r.show(),w.buttons.$element.hide()):w.buttons.$element.appendTo(w.feedback.$element)),H(c,h),v.setScore(t)):y=setTimeout(function(){var e;E(w.feedback.$element),E(w.scorebar.$element),S=!0,!g||g.hasClass("h5p-standalone")&&!H5P.isFullscreen||(e=M(g))&&e.animate({scrollTop:g.css("height")},"slow"),y=setTimeout(function(){S=!1,_.trigger("resize"),v.setScore(t)},150)},0)),_},_.updateFeedbackContent=function(e,t){return w.feedback&&w.feedback.$element&&(t&&(e=W(".h5p-question-feedback-content",w.feedback.$element).html()+" "+e),W(".h5p-question-feedback-content",w.feedback.$element).html(e).addClass("has-content"),E(w.feedback.$element),setTimeout(_.trigger.bind(_,"resize"),150)),_},_.setExplanation=function(e,t){return e?(t=new H5P.Question.Explainer(t,e),w.explanation?p("explanation",t.getElement()):(d("explanation",t.getElement()),C&&g&&D(_.order,"explanation",w,g))):w.explanation&&w.explanation.$element.children().detach(),_},_.hasButton=function(e){return void 0!==h[e]},_.addButton=function(e,t,i,n,s,o){var r,a,l,c;return!h[e]&&(void 0===w.buttons&&(d("buttons"),C)&&D(_.order,"buttons",w,g),(o=o||{}).confirmationDialog=o.confirmationDialog||{},s=s||{},r=_.addConfirmationDialogToButton(o.confirmationDialog,i),o.contentData&&o.contentData.standalone&&(o.contentData.isScoringEnabled||o.contentData.isReportingEnabled)&&o.textIfSubmitting&&(t=o.textIfSubmitting),h[e]={isTruncated:!(a=function(){o.confirmationDialog.enable&&r?(o.confirmationDialog.$parentElement||w.popups.$element.removeClass("hidden"),r.show(c.position().top)):i()}),text:t,isVisible:!1,ariaLabel:s["aria-label"]},l=void 0!==s.href,c=h[e].$element=R.createButton(W.extend({class:"h5p-question-"+e,html:t,on:{click:function(e){a(),l&&e.preventDefault()}}},s)),u.push(e),H5P.Tooltip(c.get(0),{tooltipSource:"data-tooltip"}),l&&c.on("keypress",function(e){32===e.which&&(a(),e.preventDefault())}),void 0===n||n)&&(c.appendTo(w.buttons.$element),h[e].isVisible=!0,O(w.buttons)),_},function(e){var t=e.$element,t=t.clone().css({position:"absolute","white-space":"nowrap","max-width":"none"}).removeClass("truncated").html(e.text).appendTo(t.parent());e.width={max:Math.ceil(t.outerWidth()+parseFloat(t.css("margin-left"))+parseFloat(t.css("margin-right")))},t.html("").addClass("truncated"),e.width.min=Math.ceil(t.outerWidth()+parseFloat(t.css("margin-left"))+parseFloat(t.css("margin-right"))),t.remove()});_.addConfirmationDialogToButton=function(t,e){if((t=t||{}).enable){var i=new H5P.ConfirmationDialog({instance:t.instance,headerText:t.l10n.header,dialogText:t.l10n.body,cancelText:t.l10n.cancelLabel,confirmText:t.l10n.confirmLabel});if(t.$parentElement){var n=t.$parentElement.get(0);let e;n.classList.contains("h5p-content")&&(e=n.querySelector(".h5p-container")),i.appendTo(e??n)}else void 0===w.popups&&(d("popups"),C&&D(_.order,"popups",w,g),w.popups.$element.addClass("hidden"),_.order.push("popups")),i.appendTo(w.popups.$element.get(0));return i.on("confirmed",function(){t.$parentElement||w.popups.$element.addClass("hidden"),e(),_.trigger("confirmed")}),i.on("canceled",function(){t.$parentElement||w.popups.$element.addClass("hidden"),_.trigger("canceled")}),i}},_.showButton=function(e,t){var i=-1!==n(e,"id",c);return void 0===h[e]||!0===h[e].isVisible&&!i||(t=t||0,-1!==(i=n(e,"id",x))?x[i].priority
",{"aria-live":"polite",class:"h5p-hidden-read"}),d("read",s),_.trigger("registerDomElements")),(g=e).html("").addClass("h5p-question h5p-"+$);for(var t=[],i=0;i<_.order.length;i++){var n=_.order[i];w[n]&&(w[n].parent?w[n].$element.appendTo(w[n].parent):t.push(w[n].$element),w[n].isVisible=!0)}return e.append(t),_.trigger("domChanged",{$target:e,library:_.libraryInfo.machineName,contentId:_.contentId,key:"newLibrary"},{bubbles:!0,external:!0}),C=!0,_},_.detachSections=function(){for(var e in C=!1,w)w[e].$element.detach();return _},_.on("resize",function(){!S&&w.feedback&&b&&E(w.feedback.$element);var e=w.feedback,t=m;null!=e&&null!=e.$element&&null!=t&&null!=t.$element&&setTimeout(function(){H(e.$element,t.$element)},10),L()})}return((t.prototype=Object.create(e.prototype)).constructor=t).determineOverallFeedback=function(e,t){t=Math.floor(100*t);for(var i=0;i
=t&&s)return n.feedback}return""},t}(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(o,r){var a=this;!function(){a.$explanation=l("",{class:"h5p-question-explanation-container"}),l("
",{class:"h5p-question-explanation-title",role:"heading",html:o,appendTo:a.$explanation});for(var e=l("
",{class:"h5p-question-explanation-list",appendTo:a.$explanation}),t=0;t",{class:"h5p-question-explanation-item",appendTo:e}),s=l("",{class:"h5p-question-explanation-status"});i.correct&&l("
",{class:"h5p-question-explanation-correct",html:i.correct,appendTo:s}),i.wrong&&l("",{class:"h5p-question-explanation-wrong",html:i.wrong,appendTo:s}),s.appendTo(n),i.text&&l("",{class:"h5p-question-explanation-text",html:i.text,appendTo:n})}}(),a.getElement=function(){return a.$explanation}}}(H5P.jQuery),H5P.Question.ScorePoints=function(){var i,n=[],s=(this.getElement=function(e){var t=document.createElement("div");return t.classList.add(e?"h5p-question-plus-one":"h5p-question-minus-one"),t.classList.add("h5p-question-hidden-one"),n.push(t),i&&clearTimeout(i),i=setTimeout(s,0),t},function(){var e=0,t=150;n.length&&n.length>Math.ceil(1e3/t)&&(t=1e3/n.length);for(var i=0;i
{var i={97:(N,$,e)=>{"use strict";e.d($,{A:()=>de});function t(e){var n=e.length;return function t(){var i=Array.prototype.slice.call(arguments,0);return i.length>=n?e.apply(null,i):function(){var e=Array.prototype.slice.call(arguments,0);return t.apply(null,i.concat(e))}}}function i(e,t){return t.substr(0,1)===e}function n(e,t){return t.substr(-1)===e}const s={curry:t,cleanCharacter:t(function(e,t){return i(e,t)&&(t=t.slice(1)),t=n(e,t)?t.slice(0,-1):t}),startsWith:i,endsWith:n,shuffle:function(e){for(var t=e.length;0",{html:l.params.incorrectText+" "+l.params.correctAnswer,class:"correct-answer"}),l.$correctText=u("",{html:l.params.correctText,class:"correct-answer"}),l.$showSolution=u("",{class:"h5p-drag-show-solution-container"}).appendTo(l.$dropzoneContainer).hide()}H5P.TextDroppable=(u=H5P.jQuery,d="h5p-drag-correct-feedback",p="h5p-drag-wrong-feedback",f="h5p-drag-draggable-correct",g="h5p-drag-draggable-wrong",x.prototype.removeTipTabIndexIfNoFocus=function(){var e=this;setTimeout(function(){e.$dropzone.is(":focus")||e.$tip.is(":focus")||e.$tip.attr("tabindex","-1")},0)},x.prototype.showSolution=function(){var e=null!==this.containedDraggable&&this.containedDraggable.getAnswerText()===this.text;e||this.$showSolution.html(this.text),this.$showSolution.prepend(e?this.$correctText:this.$incorrectText),this.$showSolution.toggleClass("incorrect",!e),this.$showSolution.show()},x.prototype.hideSolution=function(){this.$showSolution.html(""),this.$showSolution.hide()},x.prototype.getElement=function(){return this.$dropzone.get(0)},x.prototype.appendDroppableTo=function(e){this.$dropzoneContainer.appendTo(e)},x.prototype.appendInsideDroppableTo=function(e){if(null!==this.containedDraggable)return this.containedDraggable.revertDraggableTo(e),this.containedDraggable},x.prototype.setDraggable=function(e){this.containedDraggable!==e&&(null!==this.containedDraggable&&this.containedDraggable.removeFromZone(),(this.containedDraggable=e).addToZone(this))},x.prototype.hasDraggable=function(){return!!this.containedDraggable},x.prototype.removeDraggable=function(){null!==this.containedDraggable&&(this.containedDraggable=null)},x.prototype.isCorrect=function(){return null!==this.containedDraggable&&this.containedDraggable.getAnswerText()===this.text},x.prototype.addFeedback=function(){this.isCorrect()?(this.$dropzone.removeClass(p).addClass(d),this.containedDraggable.getDraggableElement().removeClass(g).addClass(f)):null===this.containedDraggable?this.$dropzone.removeClass(p).removeClass(d):(this.$dropzone.removeClass(d).addClass(p),null!==this.containedDraggable&&this.containedDraggable.getDraggableElement().addClass(g).removeClass(f))},x.prototype.removeFeedback=function(){this.$dropzone.removeClass(p).removeClass(d),null!==this.containedDraggable&&this.containedDraggable.getDraggableElement().removeClass(g).removeClass(f)},x.prototype.hasFeedback=function(){return this.$dropzone.hasClass(p)||this.$dropzone.hasClass(d)},x.prototype.setShortFormat=function(){null!==this.containedDraggable&&this.containedDraggable.setShortFormat()},x.prototype.disableDropzoneAndContainedDraggable=function(){null!==this.containedDraggable&&this.containedDraggable.disableDraggable(),this.$dropzone.droppable({disabled:!0})},x.prototype.enableDropzone=function(){this.$dropzone.droppable({disabled:!1})},x.prototype.removeShortFormat=function(){null!==this.containedDraggable&&this.containedDraggable.removeShortFormat()},x.prototype.getDropzone=function(){return this.$dropzone},x.prototype.getIndex=function(){return this.index},x);function C(e){const n=e.length;return function t(){const i=Array.prototype.slice.call(arguments,0);return i.length>=n?e.apply(null,i):function(){var e=Array.prototype.slice.call(arguments,0);return t.apply(null,i.concat(e))}}}const F=H5P.TextDroppable,P=(...e)=>e.reduce((t,i)=>(...e)=>t(i(...e))),k=C(function(e,t){t.forEach(e)}),S=(C(function(e,t){return t.map(e)}),C(function(e,t){return t.filter(e)})),B=C(function(e,t){return t.some(e)}),W=C(function(e,t){return-1!=t.indexOf(e)}),R=C(function(t,e){return S(e=>!W(e,t),e)}),q=C((e,t)=>t.getAttribute(e)),T=C((e,t,i)=>i.setAttribute(e,t)),U=C((e,t)=>t.removeAttribute(e)),D=C((e,t)=>t.hasAttribute(e)),V=C((e,t,i)=>i.getAttribute(e)===t),K=(C((e,t)=>{var i=q(e,t);T(e,("true"!==i).toString(),t)}),C((e,t)=>e.appendChild(t)),C((e,t)=>t.querySelector(e)),C((e,t)=>(t=t.querySelectorAll(e),Array.prototype.slice.call(t))),C((e,t)=>e.removeChild(t)),C((e,t)=>t.classList.contains(e)),C((e,t)=>t.classList.add(e))),Y=C((e,t)=>t.classList.remove(e)),Q=K("hidden"),X=Y("hidden"),H=(C((e,t)=>(e?X:Q)(t)),C((e,t,i)=>{i.classList[t?"add":"remove"](e)}),U("tabindex")),G=(k(H),T("tabindex","0")),E=T("tabindex","-1"),J=D("tabindex");class I{constructor(e){Object.assign(this,{listeners:{},on:function(e,t,i){t={listener:t,scope:i};return this.listeners[e]=this.listeners[e]||[],this.listeners[e].push(t),this},fire:function(e,t){return(this.listeners[e]||[]).every(function(e){return!1!==e.listener.call(e.scope||this,t)})},propagate:function(e,i){let n=this;e.forEach(t=>i.on(t,e=>n.fire(t,e)))}}),this.plugins=e||[],this.elements=[],this.negativeTabIndexAllowed=!1,this.on("nextElement",this.nextElement,this),this.on("previousElement",this.previousElement,this),this.on("firstElement",this.firstElement,this),this.on("lastElement",this.lastElement,this),this.initPlugins()}addElement(e){this.elements.push(e),this.firesEvent("addElement",e),1===this.elements.length&&this.setTabbable(e)}insertElementAt(e,t){this.elements.splice(t,0,e),this.firesEvent("addElement",e),1===this.elements.length&&this.setTabbable(e)}removeElement(e){this.elements=R([e],this.elements),J(e)&&(this.setUntabbable(e),this.elements[0])&&this.setTabbable(this.elements[0]),this.firesEvent("removeElement",e)}count(){return this.elements.length}firesEvent(e,t){var i=this.elements.indexOf(t);return this.fire(e,{element:t,index:i,elements:this.elements,oldElement:this.tabbableElement})}nextElement({index:e}){var t=e===this.elements.length-1,t=this.elements[t?0:e+1];this.setTabbable(t),t.focus()}firstElement(){var e=this.elements[0];this.setTabbable(e),e.focus()}lastElement(){var e=this.elements[this.elements.length-1];this.setTabbable(e),e.focus()}setTabbableByIndex(e){e=this.elements[e];e&&this.setTabbable(e)}setTabbable(e){k(this.setUntabbable.bind(this),this.elements),G(e),this.tabbableElement=e}setUntabbable(e){e!==document.activeElement&&(this.negativeTabIndexAllowed?E:H)(e)}previousElement({index:e}){e=this.elements[0===e?this.elements.length-1:e-1];this.setTabbable(e),e.focus()}useNegativeTabIndex(){this.negativeTabIndexAllowed=!0,this.elements.forEach(e=>{e.hasAttribute("tabindex")||E(e)})}initPlugins(){this.plugins.forEach(function(e){void 0!==e.init&&e.init(this)},this)}}const A="aria-grabbed",M=T(A),Z=V(A,"true"),ee=S(D(A)),te=P(k(T(A,"false")),ee),ie=P(B(Z),ee);class ne{init(e){this.controls=e,this.controls.on("select",this.select,this)}addElement(e){M("false",e),this.controls.addElement(e)}setAllGrabbedToFalse(){te(this.controls.elements)}hasAnyGrabbed(){return ie(this.controls.elements)}select({element:e}){var t=Z(e);this.setAllGrabbedToFalse(),t||M("true",e)}}const L="aria-dropeffect",se=T(L,"none"),oe=T(L,"move"),re=S(D(L)),ae=P(k(oe),re),le=P(k(se),re);class ce{init(e){this.controls=e}setAllToMove(){ae(this.controls.elements)}setAllToNone(){le(this.controls.elements)}}ce.DropEffect={COPY:"copy",MOVE:"move",EXECUTE:"execute",POPUP:"popup",NONE:"none"};class he{constructor(){this.selectability=!0}init(e){this.boundHandleKeyDown=this.handleKeyDown.bind(this),this.controls=e,this.controls.on("addElement",this.listenForKeyDown,this),this.controls.on("removeElement",this.removeKeyDownListener,this)}listenForKeyDown({element:e}){e.addEventListener("keydown",this.boundHandleKeyDown)}removeKeyDownListener({element:e}){e.removeEventListener("keydown",this.boundHandleKeyDown)}handleKeyDown(e){switch(e.which){case 27:this.close(e.target),e.preventDefault(),e.stopPropagation();break;case 35:this.lastElement(e.target),e.preventDefault(),e.stopPropagation();break;case 36:this.firstElement(e.target),e.preventDefault(),e.stopPropagation();break;case 13:case 32:this.select(e.target),e.preventDefault(),e.stopPropagation();break;case 37:case 38:this.hasChromevoxModifiers(e)||(this.previousElement(e.target),e.preventDefault(),e.stopPropagation());break;case 39:case 40:this.hasChromevoxModifiers(e)||(this.nextElement(e.target),e.preventDefault(),e.stopPropagation())}}hasChromevoxModifiers(e){return e.shiftKey||e.ctrlKey}previousElement(e){!1!==this.controls.firesEvent("beforePreviousElement",e)&&(this.controls.firesEvent("previousElement",e),this.controls.firesEvent("afterPreviousElement",e))}nextElement(e){!1!==this.controls.firesEvent("beforeNextElement",e)&&(this.controls.firesEvent("nextElement",e),this.controls.firesEvent("afterNextElement",e))}select(e){this.selectability&&!1!==this.controls.firesEvent("before-select",e)&&(this.controls.firesEvent("select",e),this.controls.firesEvent("after-select",e))}firstElement(e){!1!==this.controls.firesEvent("beforeFirstElement",e)&&(this.controls.firesEvent("firstElement",e),this.controls.firesEvent("afterFirstElement",e))}lastElement(e){!1!==this.controls.firesEvent("beforeLastElement",e)&&(this.controls.firesEvent("lastElement",e),this.controls.firesEvent("afterLastElement",e))}disableSelectability(){this.selectability=!1}enableSelectability(){this.selectability=!0}close(e){!1!==this.controls.firesEvent("before-close",e)&&(this.controls.firesEvent("close",e),this.controls.firesEvent("after-close",e))}}class ue{constructor(){this.selectability=!0,this.handleClickBound=this.handleClick.bind(this),this.handleDragBound=this.handleDrag.bind(this)}init(e){this.controls=e,this.controls.on("addElement",this.listenForKeyDown,this),this.controls.on("removeElement",this.unlistenForKeyDown,this)}listenForKeyDown({element:e}){e.addEventListener("click",this.handleClickBound),e.addEventListener("drag",this.handleClickBound)}unlistenForKeyDown({element:e}){e.removeEventListener("click",this.handleClickBound),e.removeEventListener("drag",this.handleDragBound)}handleClick(e){this.controls.firesEvent("select",e.currentTarget)}handleDrag(e){this.controls.firesEvent("drag",e.currentTarget)}disableSelectability(){this.selectability=!1}enableSelectability(){this.selectability=!0}}function O(e,t,i){var n=this;this.$=m(this),this.contentId=t,this.contentData=i,v.call(this,"drag-text"),this.params=m.extend(!0,{media:{},taskDescription:"Set in adjectives in the following sentence",textField:"This is a *nice*, *flexible* content type, which allows you to highlight all the *wonderful* words in this *exciting* sentence.\nThis is another line of *fantastic* text.",distractors:"",overallFeedback:[],checkAnswer:"Check",submitAnswer:"Submit",tryAgain:"Retry",behaviour:{enableRetry:!0,enableSolutionsButton:!0,enableCheckButton:!0,instantFeedback:!1},showSolution:"Show solution",dropZoneIndex:"Drop Zone @index.",empty:"Empty.",contains:"Drop Zone @index contains draggable @draggable.",ariaDraggableIndex:"@index of @count.",tipLabel:"Show tip",correctText:"Correct!",incorrectText:"Incorrect!",resetDropTitle:"Reset drop",resetDropDescription:"Are you sure you want to reset this drop zone?",grabbed:"Draggable is grabbed.",cancelledDragging:"Cancelled dragging.",correctAnswer:"Correct answer:",scoreBarLabel:"You got :num out of :total points",a11yCheck:"Check the answers. The responses will be marked as correct, incorrect, or unanswered.",a11yShowSolution:"Show the solution. The task will be marked with its correct solution.",a11yRetry:"Retry the task. Reset all responses and start the task over again."},e),this.contentData=i,void 0!==this.contentData&&void 0!==this.contentData.previousState&&void 0!==this.contentData.previousState.length&&(this.previousState=this.contentData.previousState),this.answered=!1,this.textFieldHtml=this.params.textField.replace(/(\r\n|\n|\r)/gm,"
"),this.distractorsHtml=this.params.distractors.replace(/(\r\n|\n|\r)/gm,"
"),this.introductionId="h5p-drag-text-"+t+"-introduction",this.selectedElement=void 0,this.ariaDragControls=new ne,this.ariaDropControls=new ce,this.dragControls=new I([new he,new ue,this.ariaDragControls]),this.dragControls.useNegativeTabIndex(),this.dropControls=new I([new he,new ue,this.ariaDropControls]),this.dropControls.useNegativeTabIndex(),this.dragControls.on("before-select",function(e){return!n.isElementDisabled(e.element)}),this.dragControls.on("select",this.keyboardDraggableSelected,this),this.dropControls.on("select",this.keyboardDroppableSelected,this),this.on("start",this.addAllDroppablesToControls,this),this.on("revert",this.removeControlsFromEmptyDropZones,this),this.on("stop",function(e){e.data.target||n.removeControlsFromDropZonesIfAllEmpty()},this),this.on("drop",this.removeControlsFromEmptyDropZones,this),this.on("start",function(e){var e=e.data.element,t=n.getDraggableByElement(e);n.toggleDropEffect(),e.setAttribute("aria-grabbed","true"),n.setDraggableAriaLabel(t)}),this.on("stop",function(e){var e=e.data.element,t=n.getDraggableByElement(e);n.toggleDropEffect(),e.setAttribute("aria-grabbed","false"),n.setDraggableAriaLabel(t)}),this.on("drop",this.ariaDropControls.setAllToNone,this.ariaDropControls),this.on("drop",function(e){this.dragControls.removeElement(e.data.element)},this),this.on("revert",function(e){this.dragControls.insertElementAt(e.data.element,0)},this),this.on("drop",this.updateDroppableElement,this),this.on("revert",this.updateDroppableElement,this),this.initDragText(),this.stopWatch=new j,this.stopWatch.start(),this.on("resize",this.resize,this),this.on("revert",this.toggleDraggablesContainer,this),this.on("drop",this.toggleDraggablesContainer,this),this.on("stop",function(e){e.data.target||n.read(n.params.cancelledDragging)}),this.params.behaviour.instantFeedback&&this.on("revert",function(){return n.instantFeedbackEvaluation()})}H5P.DragText=(m=H5P.jQuery,v=H5P.Question,b=H5P.ConfirmationDialog,y="h5p-drag-wide-screen",_="h5p-drag-draggable-wide-screen",((O.prototype=Object.create(v.prototype)).constructor=O).prototype.updateDroppableElement=function(e){var t=e.data.target,e=e.data.element,i=this.getDroppableByElement(t);t&&this.setDroppableLabel(t,e.textContent,i.getIndex())},O.prototype.removeControlsFromDropZonesIfAllEmpty=function(){this.anyDropZoneHasDraggable()||this.removeAllDroppablesFromControls()},O.prototype.removeControlsFromEmptyDropZones=function(){var t=this;this.droppables.filter(function(e){return!e.hasDraggable()}).map(function(e){return e.getElement()}).forEach(function(e){t.dropControls.removeElement(e)})},O.prototype.addAllDroppablesToControls=function(){var t=this;0'+this.params.taskDescription+""),this.setIntroduction(this.$introduction),this.$introduction.parent().attr("tabindex","-1"),this.setContent(this.$inner),this.addButtons()},O.prototype.initDragText=function(){return this.$inner=m("",{"aria-describedby":this.introductionId,class:"h5p-drag-inner"}),this.addTaskTo(this.$inner),this.setH5PUserState(),this.$inner},O.prototype.resize=function(){this.changeLayoutToFitWidth()},O.prototype.changeLayoutToFitWidth=function(){var e,t=this;t.addDropzoneWidth(),43",{class:"h5p-drag-task"}),i.$draggables=m("",{class:"h5p-drag-draggables-container"}),i.$wordContainer=m("",{class:"h5p-drag-droppable-words"}),o(i.textFieldHtml).forEach(function(e){var t;i.isAnswerPart(e)?(t=r(e),i.createDraggable(t.text),i.createDroppable(t.text,t.tip,t.correctFeedback,t.incorrectFeedback)):(t=s.createElementWithTextPart(e),i.$wordContainer.append(t))}),o(i.distractorsHtml).forEach(function(e){""!==e.trim()&&"*"===e.substring(0,1)&&"*"===e.substring(e.length-1,e.length)&&(e=r(e),i.createDraggable(e.text))}),i.shuffleAndAddDraggables(i.$draggables),i.$draggables.appendTo(i.$taskContainer),i.$wordContainer.appendTo(i.$taskContainer),i.$taskContainer.appendTo(e),i.addDropzoneWidth()},O.prototype.isAnswerPart=function(e){return s.startsWith("*",e)&&s.endsWith("*",e)},O.prototype.addDropzoneWidth=function(){var t=this,n=0,s=0,e=parseInt(this.$inner.css("font-size"),10),i=3*e,o=e;this.draggables.forEach(function(e){var t=e.getDraggableElement(),t=t.clone().css({position:"absolute","white-space":"nowrap",width:"auto",padding:0,margin:0}).html(e.getAnswerText()).appendTo(t.parent()),i=t.outerWidth();s=s",{html:"".concat(e,""),role:"button","aria-grabbed":"false",tabindex:"-1"}).draggable({revert:function(e){return e||t.revert(n),!1},drag:t.propagateDragEvent("drag",t),start:t.propagateDragEvent("start",t),stop:function(e){t.trigger("stop",{element:n.getElement(),target:e.target})},containment:t.$taskContainer}).append(m("",{class:"h5p-hidden-read"})),n=new z(e,i,t.draggables.length);return n.on("addedToZone",function(){t.triggerXAPI("interacted")}),t.draggables.push(n),n},O.prototype.createDroppable=function(e,t,i,n){var s=this,o=this.draggables.length,r=m("",{class:"h5p-drag-dropzone-container"}),a=m("",{"aria-dropeffect":"none","aria-label":this.params.dropZoneIndex.replace("@index",o.toString())+" "+this.params.empty.replace("@index",o.toString()),tabindex:"-1"}).appendTo(r).droppable({tolerance:"pointer",drop:function(e,t){t=s.getDraggableByElement(t.draggable[0]),e=s.getDroppableByElement(e.target);t&&e&&s.drop(t,e)}}),e=new F(e,t,i,n,a,r,o,s.params);return e.appendDroppableTo(s.$wordContainer),s.droppables.push(e),e},O.prototype.propagateDragEvent=s.curry(function(e,t,i){t.trigger(e,{element:i.target})}),O.prototype.revert=function(e){var t=e.removeFromZone(),t=t?t.getElement():void 0;e.revertDraggableTo(this.$draggables),this.setDraggableAriaLabel(e),this.trigger("revert",{element:e.getElement(),target:t}),this.trigger("resize")},O.prototype.drop=function(e,t){this.answered=!0,e.removeFromZone();var i=t.appendInsideDroppableTo(this.$draggables);i&&this.trigger("revert",{element:i.getElement(),target:t.getElement()}),t.setDraggable(e),e.appendDraggableTo(t.getDropzone()),this.params.behaviour.instantFeedback&&(t.addFeedback(),this.instantFeedbackEvaluation(),this.params.behaviour.enableRetry&&!t.isCorrect()||t.disableDropzoneAndContainedDraggable()),this.trigger("drop",{element:e.getElement(),target:t.getElement()}),this.trigger("resize")},O.prototype.shuffleAndAddDraggables=function(t){var i=this;return s.shuffle(this.draggables).map(function(e,t){return e.setIndex(t)}).map(function(e){return i.addDraggableToContainer(t,e)}).map(function(e){return i.setDraggableAriaLabel(e)}).map(function(e){return i.addDraggableToControls(i.dragControls,e)})},O.prototype.setDraggableAriaLabel=function(e){return e.updateAriaLabel(this.params.ariaDraggableIndex.replace("@index",(e.getIndex()+1).toString()).replace("@count",this.draggables.length.toString())),e},O.prototype.isGrabbed=function(e){return"true"===e.getAttribute("aria-grabbed")},O.prototype.addDraggableToContainer=function(e,t){return t.appendDraggableTo(e),t},O.prototype.addDraggableToControls=function(e,t){return e.addElement(t.getElement()),t},O.prototype.instantFeedbackEvaluation=function(){this.isAllAnswersFilled()?(this.params.behaviour.enableSolutionsButton&&this.showButton("show-solution"),this.params.behaviour.enableRetry&&this.showButton("try-again"),this.showEvaluation()):(this.hideButton("try-again"),this.hideButton("show-solution"),this.hideEvaluation())},O.prototype.isAllAnswersFilled=function(){return this.droppables.every(function(e){return e.hasDraggable()})},O.prototype.enableAllDropzonesAndDraggables=function(){this.enableDraggables(),this.droppables.forEach(function(e){e.enableDropzone()})},O.prototype.disableDraggables=function(){this.draggables.forEach(function(e){e.disableDraggable()})},O.prototype.enableDraggables=function(){this.draggables.forEach(function(e){e.enableDraggable()})},O.prototype.getAnswerGiven=function(){return this.answered},O.prototype.getScore=function(){return this.calculateScore()},O.prototype.getMaxScore=function(){return this.droppables.length},O.prototype.getTitle=function(){return H5P.createTitle(this.contentData&&this.contentData.metadata&&this.contentData.metadata.title?this.contentData.metadata.title:"Drag the Words")},O.prototype.toggleDropEffect=function(){var e=void 0!==this.selectedElement;this.ariaDropControls[e?"setAllToMove":"setAllToNone"]()},O.prototype.getDraggableByElement=function(t){return this.draggables.filter(function(e){return e.$draggable.get(0)===t},this)[0]},O.prototype.getDroppableByElement=function(t){return this.droppables.filter(function(e){return e.$dropzone.get(0)===t},this)[0]},O.prototype.showSolutions=function(){this.showEvaluation(!0),this.droppables.forEach(function(e){e.addFeedback(),e.showSolution()}),this.removeAllDroppablesFromControls(),this.disableDraggables(),this.hideButton("try-again"),this.hideButton("show-solution"),this.hideButton("check-answer"),this.trigger("resize")},O.prototype.resetTask=function(){var e=this;e.answered=!1,e.resetDraggables(),e.hideEvaluation(),e.hideExplanation(),e.enableAllDropzonesAndDraggables(),e.hideButton("try-again"),e.hideButton("show-solution"),e.params.behaviour.instantFeedback||e.showButton("check-answer"),e.hideAllSolutions(),e.stopWatch.reset(),this.trigger("resize")},O.prototype.resetDraggables=function(){s.shuffle(this.draggables).forEach(this.revert,this)},O.prototype.getCurrentState=function(){var t=this;if(void 0!==this.draggables)return this.draggables.filter(function(e){return null!==e.getInsideDropzone()}).map(function(e){return{draggable:e.getInitialIndex(),droppable:t.droppables.indexOf(e.getInsideDropzone())}})},O.prototype.setH5PUserState=function(){var i=this,n=this;void 0!==this.previousState&&(this.previousState.forEach(function(e){if(!n.isValidIndex(e.draggable)||!n.isValidIndex(e.droppable))throw new Error("Stored user state is invalid");var t=i.getDraggableByInitialIndex(e.draggable),e=n.droppables[e.droppable];n.drop(t,e),n.params.behaviour.instantFeedback&&(null!==e&&e.addFeedback(),e.isCorrect())&&e.disableDropzoneAndContainedDraggable()}),n.params.behaviour.instantFeedback)&&n.isAllAnswersFilled()&&!n.showEvaluation()&&(n.params.behaviour.enableSolutionsButton&&(n.initShowShowSolutionButton=!0),n.params.behaviour.enableRetry)&&(n.initShowTryAgainButton=!0)},O.prototype.isValidIndex=function(e){return!isNaN(e)&&e";return e.description={"en-US":i+this.replaceSolutionsWithBlanks(t)},e.correctResponsesPattern=[this.getSolutionsFromQuestion(t)],e},O.prototype.addResponseToXAPI=function(e){var t,i=this.getScore(),n=this.droppables.length,i=(e.setScoredResult(i,n,this),{min:0,raw:i,max:n,scaled:Math.round(i/n*1e4)/1e4});this.stopWatch&&(t="PT"+this.stopWatch.stop()+"S"),e.data.statement.result={response:this.getXAPIResponse(),score:i,duration:t,completion:!0}},O.prototype.getXAPIResponse=function(){return this.droppables.map(function(e){return e.hasDraggable()?e.containedDraggable.text:""}).join("[,]")},O.prototype.replaceSolutionsWithBlanks=function(e){var t=this;return o(e).map(function(e){return t.isAnswerPart(e)?"__________":e}).join("")},O.prototype.getSolutionsFromQuestion=function(e){return o(e).filter(this.isAnswerPart).map(r).map(function(e){return e.text}).join("[,]")},O.prototype.parseText=o,O),H5P.DragText.parseText=function(e){return o(e).map(function(e){return t=e,s.startsWith("*",t)&&s.endsWith("*",t)?{type:"answer",correct:r(e).text}:{type:"text",content:e};var t})};const de=H5P.DragText},477:(e,t,i)=>{"use strict";i.r(t)}},n={};function s(e){var t=n[e];return void 0!==t||(t=n[e]={exports:{}},i[e](t,t.exports,s)),t.exports}s.d=(e,t)=>{for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s(477),(H5P=H5P||{}).DragText=s(97).A})(),/*!@license H5P.CoursePresentation-1.26/dist/h5p-course-presentation.js by Joubel licensed under MIT*/(()=>{var i={454:e=>{e.exports=function(e,t){this.index=e,this.parent=t}},270:(e,t,i)=>{const r=i(454),a=H5P.EventDispatcher;function n(n,t){const s=this;a.call(s),s.children=[];function o(t){for(let e=t;e{var t=e&&e.__esModule?()=>e.default:()=>e;return le.d(t,{a:t}),t},le.d=(e,t)=>{for(var i in t)le.o(t,i)&&!le.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},le.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";function n(e){return e.concat.apply([],e)}function l(e){return"function"==typeof e}function o(e,t){return-1!==e.indexOf(t)}function s(e,t){return void 0!==e?e:t}function v(e,t,i){e.click(function(e){t.call(i||this,e)}),e.keydown(function(e){o([13,32],e.which)&&(e.preventDefault(),t.call(i||this,e))})}var h,a,e=le(270),r=le.n(e),b=H5P.jQuery,u=H5P.EventDispatcher,c=H5P.JoubelUI,N=null!==navigator.userAgent.match(/iPad/i),$=null!==navigator.userAgent.match(/iPad|iPod|iPhone/i),j=b("");t.prototype.updateSummarySlide=function(e,t){var i,n,s=this,e=void 0===this.cp.editor&&void 0!==this.$summarySlide&&e>=this.cp.slides.length-1,o=!this.cp.showSummarySlide&&this.cp.hasAnswerElements;e&&(s.cp.presentation.keywordListEnabled&&s.cp.presentation.keywordListAlwaysShow&&s.cp.hideKeywords(),this.$summarySlide.children().remove(),e=s.cp.getSlideScores(t),t=s.outputScoreStats(e),b(t).appendTo(s.$summarySlide),o||(i=s.totalScores(e),isNaN(i.totalPercentage)||((t=c.createScoreBar(i.totalMaxScore,"","","")).setScore(i.totalScore),n=b(".h5p-summary-total-score",s.$summarySlide),t.appendTo(n),setTimeout(function(){n.append(b("
",{"aria-live":"polite",class:"hidden-but-read",html:s.cp.l10n.summary+". "+s.cp.l10n.accessibilityTotalScore.replace("@score",i.totalScore).replace("@maxScore",i.totalMaxScore)}))},100)),!0===s.cp.enableTwitterShare&&(o=b(".h5p-summary-twitter-message",s.$summarySlide),this.addTwitterScoreLinkTo(o,i)),!0===s.cp.enableFacebookShare&&(e=b(".h5p-summary-facebook-message",s.$summarySlide),this.addFacebookScoreLinkTo(e,i)),!0===s.cp.enableGoogleShare&&(t=b(".h5p-summary-google-message",s.$summarySlide),this.addGoogleScoreLinkTo(t)),s.$summarySlide.find(".h5p-td > .h5p-slide-link").each(function(){var t=b(this);t.click(function(e){s.cp.jumpToSlide(parseInt(t.data("slide"),10)-1),e.preventDefault()})})),o=b(".h5p-summary-footer",s.$summarySlide),this.cp.showSummarySlideSolutionButton&&c.createButton({class:"h5p-show-solutions",html:s.cp.l10n.showSolutions,on:{click:function(){s.toggleSolutionMode(!0)}},appendTo:o}),this.cp.showSummarySlideRetryButton&&c.createButton({class:"h5p-cp-retry-button",html:s.cp.l10n.retry,on:{click:function(){s.cp.resetTask()}},appendTo:o}),s.cp.hasAnswerElements)&&c.createButton({class:"h5p-eta-export",html:s.cp.l10n.exportAnswers,on:{click:function(){H5P.ExportableTextArea.Exporter.run(s.cp.slides,s.cp.elementInstances)}},appendTo:o})},t.prototype.outputScoreStats=function(e){if(void 0===e)return this.$summarySlide.addClass("h5p-summary-only-export"),'';for(var t=this,i=0,n=0,s="",o=0,r="",a=0;a
]+)>)/gi,"")+" "+o+'%" data-slide="'+e[a].slide+'">'+t.cp.l10n.slide+" "+e[a].slide+": "+r.replace(/(<([^>]+)>)/gi,"")+' | '+o+"% "+e[a].score+"/"+e[a].maxScore+" | ",i+=e[a].score,n+=e[a].maxScore;this.cp.isSolutionMode||this.cp.ignoreResize||t.cp.triggerXAPICompleted(i,n);var l=t.cp.enableTwitterShare||t.cp.enableFacebookShare||t.cp.enableGoogleShare?''+t.cp.l10n.shareResult+"":"",c=!0===t.cp.enableTwitterShare?'':"",h=!0===t.cp.enableFacebookShare?'':"",u=!0===t.cp.enableGoogleShare?'':"";return''},t.prototype.getSlideDescription=function(e){var t,i,n,s=this.cp.slides[e.slide-1].elements;return 1 '),i=(e.attr("role","application").addClass("h5p-course-presentation").html(i),this.$container=e,this.$slideAnnouncer=e.find(".h5p-current-slide-announcer"),this.$fullscreenAnnouncer=e.find(".h5p-fullscreen-announcer"),this.$slideTop=this.$slideAnnouncer.next(),this.$wrapper=e.children(".h5p-wrapper"),this.activeSurface&&this.$wrapper.addClass("h5p-course-presentation-active-surface"),this.$wrapper.focus(function(){o.initKeyEvents()}).blur(function(){void 0!==o.keydown&&(H5P.jQuery("body").unbind("keydown",o.keydown),delete o.keydown)}).click(function(e){var t=H5P.jQuery(e.target),i=o.belongsToTagName(e.target,["input","textarea","a","button"],e.currentTarget),e=o.hasTabIndex(e.target,e.currentTarget),n=t.closest(".h5p-popup-container"),s=0!==n.length;i||e||o.editor||(s?1===(i=t.closest("[tabindex]")).closest(".h5p-popup-container").length?i:n.find(".h5p-close-popup"):o.$wrapper).focus(),o.presentation.keywordListEnabled&&!o.presentation.keywordListAlwaysShow&&o.presentation.keywordListAutoHide&&!t.is("textarea, .h5p-icon-pencil, span")&&o.hideKeywords()}),this.on("exitFullScreen",function(){t.$footer.removeClass("footer-full-screen"),t.$fullScreenButton.attr("aria-label",t.l10n.fullscreen),t.$fullscreenAnnouncer.html(t.l10n.accessibilityExitedFullscreen)}),this.on("enterFullScreen",function(){t.$fullscreenAnnouncer.html(t.l10n.accessibilityEnteredFullscreen)}),parseInt(this.$wrapper.css("width"))),e=(this.width=0!==i?i:640,parseInt(this.$wrapper.css("height")));this.height=0!==e?e:400,this.ratio=16/9,this.fontSize=16,this.$boxWrapper=this.$wrapper.children(".h5p-box-wrapper");var n,i=this.$boxWrapper.children(".h5p-presentation-wrapper"),i=(this.$slidesWrapper=i.children(".h5p-slides-wrapper"),this.$keywordsWrapper=i.children(".h5p-keywords-wrapper"),this.$progressbar=this.$wrapper.find(".h5p-progressbar"),this.$footer=this.$wrapper.children(".h5p-footer"),this.initKeywords=void 0===this.presentation.keywordListEnabled||!0===this.presentation.keywordListEnabled||void 0!==this.editor,this.activeSurface&&void 0===this.editor&&(this.initKeywords=!1,this.$boxWrapper.css("height","100%")),this.isSolutionMode=!1,this.createSlides(),this.elementsAttached[this.currentSlideIndex]=!0,this.showSummarySlide=!1,this.hideSummarySlide?this.showSummarySlide=!this.hideSummarySlide:this.slidesWithSolutions.forEach(function(e){o.showSummarySlide=e.length}),void 0===this.editor&&(this.showSummarySlide||this.hasAnswerElements)&&(this.slides.push(e={elements:[],keywords:[]}),(n=H5P.jQuery(oe.createHTML(e)).appendTo(this.$slidesWrapper)).addClass("h5p-summary-slide"),this.isCurrentSlide(this.slides.length-1))&&(this.$current=n),this.getKeywordMenuConfig());0",{class:"h5p-toggle-full-screen","aria-label":this.l10n.fullscreen,role:"button",tabindex:0,appendTo:this.$wrapper}),H5P.Tooltip(this.$fullScreenButton.get(0),{position:"left"}),v(this.$fullScreenButton,function(){return o.toggleFullScreen()}))):(this.initTouchEvents(),this.navigationLine=new J(this),this.previousState&&this.previousState.progress||this.setSlideNumberAnnouncer(0,!1),this.summarySlideObject=new z(this,n)),Z(this),this.previousState&&this.previousState.progress&&this.jumpToSlide(this.previousState.progress,!1,null,!1,!0)},O.prototype.belongsToTagName=function(e,t,i){if(!e)return!1;i=i||document.body,t=(t="string"==typeof t?[t]:t).map(function(e){return e.toLowerCase()});var n=e.tagName.toLowerCase();return-1!==t.indexOf(n)||i!==e&&this.belongsToTagName(e.parentNode,t,i)},O.prototype.hasTabIndex=function(e,t){if(-1!==e.tabIndex)return!0;var i,n=b(e).parents();for(i in n){if(-1!==n[i].tabIndex)return!0;if(t&&n[i]===t)return!1}return!1},O.prototype.updateKeywordMenuFromSlides=function(){this.keywordMenu.removeAllMenuItemElements();var e=this.getKeywordMenuConfig();return b(this.keywordMenu.init(e))},O.prototype.getKeywordMenuConfig=function(){var i=this;return this.slides.map(function(e,t){return{title:i.createSlideTitle(e),subtitle:"".concat(i.l10n.slide," ").concat(t+1),index:t}}).filter(function(e){return null!==e.title})},O.prototype.createSlideTitle=function(e){var t=this.isEditor()?this.l10n.noTitle:null;return this.hasKeywords(e)?e.keywords[0].main:t},O.prototype.isEditor=function(){return void 0!==this.editor},O.prototype.hasKeywords=function(e){return void 0!==e.keywords&&0=e.maxScore,i.addClass(t?"h5p-is-correct":"h5p-is-wrong"),n.navigationLine.updateSlideTitle(e.slide-1))}):this.progressbarParts.forEach(function(e){e.find(".h5p-progressbar-part-has-task").removeClass("h5p-is-correct").removeClass("h5p-is-wrong")})},O.prototype.toggleKeywords=function(){this[this.$keywordsWrapper.hasClass("h5p-open")?"hideKeywords":"showKeywords"]()},O.prototype.hideKeywords=function(){this.$keywordsWrapper.hasClass("h5p-open")&&(void 0!==this.$keywordsButton&&(this.$keywordsButton.attr("aria-label",this.l10n.showKeywords),this.$keywordsButton.attr("aria-expanded","false"),this.$keywordsButton.focus()),this.$keywordsWrapper.removeClass("h5p-open"))},O.prototype.showKeywords=function(){this.$keywordsWrapper.hasClass("h5p-open")||(void 0!==this.$keywordsButton&&(this.$keywordsButton.attr("aria-label",this.l10n.hideKeywords),this.$keywordsButton.attr("aria-expanded","true")),this.$keywordsWrapper.addClass("h5p-open"),this.presentation.keywordListAlwaysShow)||this.$keywordsWrapper.find('li[tabindex="0"]').focus()},O.prototype.setKeywordsOpacity=function(e){var t,i,n;""!==this.$keywordsWrapper.css("background-color")&&(i=this.$keywordsWrapper.css("background-color").match(/\d+/g),n=3,n=(i=function(e){if(Array.isArray(e))return e}(i)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,s,o,r,a=[],l=!0,c=!1;try{if(o=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=o.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){c=!0,s=e}finally{try{if(!l&&null!=i.return&&(r=i.return(),Object(r)!==r))return}finally{if(c)throw s}}return a}}(i,n)||function(e,t){var i;if(e)return"string"==typeof e?re(e,t):"Map"===(i="Object"===(i=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:i)||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?re(e,t):void 0}(i,n)||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.")}())[0],t=i[1],i=i[2],this.$keywordsWrapper.css("background-color","rgba(".concat(n,", ").concat(t,", ").concat(i,", ").concat(e/100,")")))},O.prototype.fitCT=function(){void 0===this.editor&&this.$current.find(".h5p-ct").each(function(){for(var e=100,t=H5P.jQuery(this),i=t.parent().height();t.outerHeight()>i&&(t.css({fontSize:--e+"%",lineHeight:e+65+"%"}),!(e<0)););})},O.prototype.resize=function(){var e=this.$container.hasClass("h5p-fullscreen")||this.$container.hasClass("h5p-semi-fullscreen");if(!this.ignoreResize){this.$wrapper.css("width","auto");var t=this.$container.width(),i={},e=(e&&t/(e=this.$container.height())>this.ratio&&(t=e*this.ratio,i.width=t+"px"),t/this.width),n=(i.height=t/this.ratio+"px",i.fontSize=this.fontSize*e+"px",void 0!==this.editor&&this.editor.setContainerEm(this.fontSize*e*.75),this.$wrapper.css(i),this.swipeThreshold=100*e,this.elementInstances[this.$current.index()]);if(void 0!==n)for(var s=this.slides[this.$current.index()].elements,o=0;o",{class:"h5p-element"+(s?" h5p-element-button-wrapper":"")+(o.length?" "+o:"")}).css({left:e.x+"%",top:e.y+"%",width:e.width+"%",height:e.height+"%"}).appendTo(i.children('[role="document"]').first()),o=void 0===e.backgroundOpacity||0===e.backgroundOpacity;return r.toggleClass("h5p-transparent",o),s?this.createInteractionButton(e,t).appendTo(r):(i=e.action&&e.action.library?this.getLibraryTypePmz(e.action.library):"other",o=H5P.jQuery("",{class:"h5p-element-outer ".concat(i,"-outer-element")}).css({background:"rgba(255,255,255,"+(void 0===e.backgroundOpacity?0:e.backgroundOpacity/100)+")"}).appendTo(r),s=H5P.jQuery("
",{class:"h5p-element-inner"}).appendTo(o),t.on("set-size",function(e){for(var t in e.data)r.get(0).style[t]=e.data[t]}),t.attach(s),void 0!==e.action&&"H5P.InteractiveVideo"===e.action.library.substr(0,20)&&(i=function(){t.$container.addClass("h5p-fullscreen"),t.controls.$fullscreen&&t.controls.$fullscreen.remove(),t.hasFullScreen=!0,t.controls.$play.hasClass("h5p-pause")?t.$controls.addClass("h5p-autohide"):t.enableAutoHide()},void 0!==t.controls?i():t.on("controls",i)),this.setOverflowTabIndex()),void 0!==this.editor?this.editor.processElement(e,r,n,t):(e.solution&&this.addElementSolutionButton(e,t,r),this.hasAnswerElements=this.hasAnswerElements||void 0!==t.exportAnswers),r},O.prototype.disableTabIndexes=function(){var i=this.$container.find(".h5p-popup-container");this.$tabbables=this.$container.find("a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]").filter(function(){var e=b(this),t=b.contains(i.get(0),e.get(0));return!!e.data("tabindex")||!t&&(t=e.attr("tabindex"),e.data("tabindex",t),e.attr("tabindex","-1"),!0)})},O.prototype.restoreTabIndexes=function(){this.$tabbables&&this.$tabbables.each(function(){var e=b(this),t=e.data("tabindex");e.hasClass("ui-slider-handle")?(e.attr("tabindex",0),e.removeData("tabindex")):void 0!==t?(e.attr("tabindex",t),e.removeData("tabindex")):e.removeAttr("tabindex")})},O.prototype.createInteractionButton=function(e,t){var i,n=this,s=e.action.metadata?e.action.metadata.title:"",o=(""!==s&&void 0!==s||(s=(null==(i=e.action)||null==(i=i.params)?void 0:i.contentName)||(null==(i=e.action)||null==(i=i.params)?void 0:i.title)||e.action.library.split(" ")[0].split(".")[1]),this.getLibraryTypePmz(e.action.library)),r=b("
",{role:"button",tabindex:0,"aria-label":s,"aria-haspopup":"dialog","aria-expanded":!1,class:"h5p-element-button h5p-element-button-".concat(e.buttonSize," ").concat(o,"-button")}),a=b('
'),l=(t.attach(a),"h5p-advancedtext"===o?{x:e.x,y:e.y}:null);return v(r,function(){var e;r.attr("aria-expanded","true"),n.showInteractionPopup(t,r,a,o,(e=r,function(){return e.attr("aria-expanded","false")}),l)}),void 0!==e.action&&"H5P.InteractiveVideo"===e.action.library.substr(0,20)&&t.on("controls",function(){t.controls.$fullscreen&&t.controls.$fullscreen.remove()}),r},O.prototype.showInteractionPopup=function(e,t,i,n,s){function o(){e.trigger("resize")}var r=this,a=5
",{role:"button",tabindex:0,title:o.l10n.solutionsButtonTitle,"aria-haspopup":"dialog","aria-expanded":!1,class:"h5p-element-solution"}).append('').appendTo(s),i={x:n.x,y:n.y},n.displayAsButton||(i.x+=n.width-4,i.y+=n.height-12),v(t,function(e){o.showPopup({popupContent:n.solution,$focusOnClose:t,parentPosition:i,updateAriaExpanded:!0}),t.attr("aria-expanded",!0),e.stopPropagation()}))},void 0!==n.alwaysDisplayComments&&n.alwaysDisplayComments&&e.showCPComments()},O.prototype.showPopup=function(e){var i,n,s,t,o,r=this,a=e.popupContent,l=e.$focusOnClose,c=e.parentPosition,c=void 0===c?null:c,h=e.remove,u=e.classes,u=void 0===u?"h5p-popup-comment-field":u,d=e.instance,p=e.keepInDOM,f=void 0!==p&&p,g=e.updateAriaExpanded,m=this,e=(this.popupId=void 0===this.popupId?0:this.popupId+1,this.closePopup=function(e){var t=!(1
')).find(".h5p-popup-wrapper"),a instanceof H5P.jQuery?p.append(a):p.html(a),s="",p.children().each(function(e,t){t.setAttribute("id","popup-content-"+r.popupId+"-"+e),s+="popup-content-"+r.popupId+"-"+e+" "}),n.find(".h5p-popup-container").attr("aria-describedby",s),d)&&d.subContentId&&(m.popups[d.subContentId]=n),n.find(".h5p-popup-container"));return u=n,a=e,(p=c)&&(a.css({visibility:"hidden"}),u.prependTo(r.$wrapper),d=a.height(),c=a.width(),t=d*(100/(d=u.height())),50<(c=c*(100/u.width()))&&50
=h.slides.length?0:e,u=!(c=null)}).bind("touchmove",function(e){var t=e.originalEvent.touches,i=(u&&(h.$current.prev().addClass("h5p-touch-move"),h.$current.next().addClass("h5p-touch-move"),u=!1),r=t[0].pageX,s-r);null===c&&(c=Math.abs(o-e.originalEvent.touches[0].pageY)>Math.abs(i)),1!==t.length||c||(e.preventDefault(),d)||(i<0?h.$current.prev().css(n("translateX("+(a-i)+"px")):h.$current.next().css(n("translateX("+(l-i)+"px)")),h.$current.css(n("translateX("+-i+"px)")))}).bind("touchend",function(){if(!c){var e=s-r;if(e>h.swipeThreshold&&h.nextSlide(void 0,!1)||e<-h.swipeThreshold&&h.previousSlide(void 0,!1))return}h.$slidesWrapper.children().css(t).removeClass("h5p-touch-move")})},O.prototype.updateTouchPopup=function(e,t,i,n){var s;arguments.length<=0?void 0!==this.touchPopup&&this.touchPopup.remove():(s="",void 0!==this.$keywords&&void 0!==this.$keywords.children(":eq("+t+")").find("span").html()?s+=this.$keywords.children(":eq("+t+")").find("span").html():s+=this.l10n.slide+" "+(t+1),void 0===this.editor&&t>=this.slides.length-1&&(s=this.l10n.showSolutions),void 0===this.touchPopup?this.touchPopup=H5P.jQuery("",{class:"h5p-touch-popup"}).insertAfter(e):this.touchPopup.insertAfter(e),n-.15*e.parent().height()<0?n=0:n-=.15*e.parent().height(),this.touchPopup.css({"max-width":e.width()-i,left:i,top:n}),this.touchPopup.html(s))},O.prototype.previousSlide=function(e){var t=!(1{H5P.ContentType=function(t){function e(){}return(e.prototype=new H5P.EventDispatcher).isRoot=function(){return t},e.prototype.getLibraryFilePath=function(t){return furtherH5PInlineResources[this.libraryInfo.versionedNameNoSpaces+"/"+t]||this.libraryInfo.versionedNameNoSpaces+"/"+t},e};var i=HTMLScriptElement.prototype.setAttribute,n=(HTMLScriptElement.prototype.setAttribute=function(t,e){if("src"===t){if(!(e instanceof String)){if(!e.toString)return void i.call(this,t,e);e=e.toString()}var r=window.location.href.substr(0,window.location.href.lastIndexOf("/")),r=(e=e.startsWith(r)?e.substr(r.length+1):e).match(/^.\/libraries\/([^?]+)\??.*$/);r&&(r=r[1],furtherH5PInlineResources[r])&&(e=furtherH5PInlineResources[r])}i.call(this,t,e)},Object.defineProperty(HTMLScriptElement.prototype,"src",{set(t){this.setAttribute("src",t)}}),HTMLLinkElement.prototype.setAttribute);HTMLLinkElement.prototype.setAttribute=function(t,e){if("href"===t){if(!(e instanceof String)){if(!e.toString)return void i.call(this,t,e);e=e.toString()}var r=window.location.href.substr(0,window.location.href.lastIndexOf("/")),r=(e=e.startsWith(r)?e.substr(r.length+1):e).match(/^.\/libraries\/([^?]+)\??.*$/);r&&(r=r[1],furtherH5PInlineResources[r])&&(e=furtherH5PInlineResources[r])}n.call(this,t,e)},Object.defineProperty(HTMLLinkElement.prototype,"src",{set(t){this.setAttribute("src",t)}});let e=fetch;fetch=(...t)=>1==t.length&&"string"==typeof t[0]&&furtherH5PInlineResources[t[0]]?fetch(furtherH5PInlineResources[t[0]]):e(...t)})();