diff --git a/dist/index.es.js b/dist/index.es.js index 9e7f8fdd..a061109f 100644 --- a/dist/index.es.js +++ b/dist/index.es.js @@ -1,2 +1,2 @@ -import e,{useState as t,useRef as n,useEffect as r,useCallback as o,Fragment as i}from"react";function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};var m,g,h={exports:{}},b={};var x=(g||(g=1,h.exports=function(){if(m)return b;m=1;var t=e,n=Symbol.for("react.element"),r=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in void 0!==r&&(l=""+r),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(u=t.ref),t)o.call(t,s)&&!a.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps)void 0===c[s]&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:i.current}}return b.Fragment=r,b.jsx=s,b.jsxs=s,b}()),h.exports);function y(e){var t=e.progressBarColor,n=void 0===t?"#9de1f6":t,r=e.progress,o=e.height,i=void 0===o?"25px":o,a=e.quizLength,s=e.isEndQuiz,c=r-1,l=100/a,u={width:"100%",backgroundColor:"#D0D4CA",height:i,borderRadius:40,position:"relative",overflow:"hidden"},d={width:s?"100%":"".concat(l*c,"%"),height:"100%",backgroundColor:n,transition:"width 0.3s ease"};return x.jsxs("div",{style:u,children:[x.jsx("div",{style:d}),x.jsx("span",{style:{position:"absolute",left:"50%",top:"50%",transform:"translateX(-50%) translateY(-50%)",lineHeigth:"20px",fontSize:"16px",color:"#000",fontWeight:"bold",backgroundColor:"transparent"},children:s?"100%":"".concat(Math.round(l*c),"%")})]})}function w(e){var o=e.filteredValue,i=e.handleChange,a=e.appLocale,s=l(t(!1),2),c=s[0],u=s[1],d=n(null),p=function(){u(!c)},f=function(e){i({target:{value:e}}),u(!1)},m=c?"selected-open":"",g={all:a.resultFilterAll,correct:a.resultFilterCorrect,incorrect:a.resultFilterIncorrect,unanswered:a.resultFilterUnanswered};return r((function(){var e=function(e){c&&d.current&&!d.current.contains(e.target)&&u(!1)};return document.addEventListener("click",e),function(){document.removeEventListener("click",e)}}),[c]),x.jsxs("div",{className:"quiz-result-filter",children:[x.jsxs("div",{ref:d,className:"filter-dropdown-select ".concat(c?"open":""),onClick:p,onKeyDown:function(e){"Enter"===e.key&&p()},role:"button",tabIndex:0,children:[x.jsx("div",{className:"selected-option ".concat(m),children:g[o]}),x.jsx("span",{className:"arrow ".concat(c?"up":"down")})]}),c&&x.jsxs("div",{className:"dropdown-options",role:"menu","aria-labelledby":"quiz-filter",children:[x.jsx("div",{className:"dropdown-options-item ".concat("all"===o?"selected":""),onClick:function(){return f("all")},onKeyDown:function(e){"Enter"===e.key&&f("all")},role:"menuitem",tabIndex:0,children:a.resultFilterAll}),x.jsx("div",{className:"dropdown-options-item ".concat("correct"===o?"selected":""),onClick:function(){return f("correct")},onKeyDown:function(e){"Enter"===e.key&&f("correct")},role:"menuitem",tabIndex:0,children:a.resultFilterCorrect}),x.jsx("div",{className:"dropdown-options-item ".concat("incorrect"===o?"selected":""),onClick:function(){return f("incorrect")},onKeyDown:function(e){"Enter"===e.key&&f("incorrect")},role:"menuitem",tabIndex:0,children:a.resultFilterIncorrect}),x.jsx("div",{className:"dropdown-options-item ".concat("unanswered"===o?"selected":""),onClick:function(){return f("unanswered")},onKeyDown:function(e){"Enter"===e.key&&f("unanswered")},role:"menuitem",tabIndex:0,children:a.resultFilterUnanswered})]})]})}var v={"":["",""],_:["",""],"*":["",""],"~":["",""],"\n":["
"]," ":["
"],"-":["
"]};function T(e){return e.replace(RegExp("^"+(e.match(/^(\t| )+/)||"")[0],"gm"),"")}function S(e){return(e+"").replace(/"/g,""").replace(//g,">")}function A(e,t){var n,r,o,i,a,s=/((?:^|\n+)(?:\n---+|\* \*(?: \*)+)\n)|(?:^``` *(\w*)\n([\s\S]*?)\n```$)|((?:(?:^|\n+)(?:\t| {2,}).+)+\n*)|((?:(?:^|\n)([>*+-]|\d+\.)\s+.*)+)|(?:!\[([^\]]*?)\]\(([^)]+?)\))|(\[)|(\](?:\(([^)]+?)\))?)|(?:(?:^|\n+)([^\s].*)\n(-{3,}|={3,})(?:\n+|$))|(?:(?:^|\n+)(#{1,6})\s*(.+)(?:\n+|$))|(?:`([^`].*?)`)|( \n\n*|\n{2,}|__|\*\*|[_*]|~~)/gm,c=[],l="",u=t||{},d=0;function p(e){var t=v[e[1]||""],n=c[c.length-1]==e;return t?t[1]?(n?c.pop():c.push(e),t[0|n]):t[0]:e}function f(){for(var e="";c.length;)e+=p(c[c.length-1]);return e}for(e=e.replace(/^\[(.+?)\]:\s*(.+)$/gm,(function(e,t,n){return u[t.toLowerCase()]=n,""})).replace(/^\n+|\n+$/g,"");o=s.exec(e);)r=e.substring(d,o.index),d=s.lastIndex,n=o[0],r.match(/[^\\](\\\\)*\\$/)||((a=o[3]||o[4])?n='
"+T(S(a).replace(/^\n+|\n+$/g,""))+"
":(a=o[6])?(a.match(/\./)&&(o[5]=o[5].replace(/^\d+/gm,"")),i=A(T(o[5].replace(/^\s*[>*+.-]/gm,""))),">"==a?a="blockquote":(a=a.match(/\./)?"ol":"ul",i=i.replace(/^(.*)(\n|$)/gm,"
  • $1
  • ")),n="<"+a+">"+i+""):o[8]?n=''+S(o[7])+'':o[10]?(l=l.replace("",''),n=f()+""):o[9]?n="":o[12]||o[14]?n="<"+(a="h"+(o[14]?o[14].length:o[13]>"="?1:2))+">"+A(o[12]||o[15],u)+"":o[16]?n=""+S(o[16])+"":(o[17]||o[1])&&(n=p(o[17]||"--"))),l+=r,l+=n;return(l+e.substring(d)+f()).replace(/^\n+|\n+$/g,"")} -/*! @license DOMPurify 3.2.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.3/LICENSE */const{entries:N,setPrototypeOf:E,isFrozen:O,getPrototypeOf:_,getOwnPropertyDescriptor:k}=Object;let{freeze:C,seal:I,create:R}=Object,{apply:L,construct:z}="undefined"!=typeof Reflect&&Reflect;C||(C=function(e){return e}),I||(I=function(e){return e}),L||(L=function(e,t,n){return e.apply(t,n)}),z||(z=function(e,t){return new e(...t)});const j=$(Array.prototype.forEach),D=$(Array.prototype.pop),P=$(Array.prototype.push),q=$(String.prototype.toLowerCase),M=$(String.prototype.toString),B=$(String.prototype.match),F=$(String.prototype.replace),U=$(String.prototype.indexOf),H=$(String.prototype.trim),Q=$(Object.prototype.hasOwnProperty),W=$(RegExp.prototype.test),Y=(G=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n1?n-1:0),o=1;o2&&void 0!==arguments[2]?arguments[2]:q;E&&E(e,null);let r=t.length;for(;r--;){let o=t[r];if("string"==typeof o){const e=n(o);e!==o&&(O(t)||(t[r]=e),o=e)}e[o]=!0}return e}function K(e){for(let t=0;t/gm),pe=I(/\$\{[\w\W]*}/gm),fe=I(/^data-[\-\w.\u00B7-\uFFFF]+$/),me=I(/^aria-[\-\w]+$/),ge=I(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),he=I(/^(?:\w+script|data):/i),be=I(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),xe=I(/^html$/i),ye=I(/^[a-z][.\w]*(-[.\w]+)+$/i);var we=Object.freeze({__proto__:null,ARIA_ATTR:me,ATTR_WHITESPACE:be,CUSTOM_ELEMENT:ye,DATA_ATTR:fe,DOCTYPE_NAME:xe,ERB_EXPR:de,IS_ALLOWED_URI:ge,IS_SCRIPT_OR_DATA:he,MUSTACHE_EXPR:ue,TMPLIT_EXPR:pe});const ve=1,Te=3,Se=7,Ae=8,Ne=9,Ee=function(){return"undefined"==typeof window?null:window};var Oe=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ee();const n=t=>e(t);if(n.version="3.2.3",n.removed=[],!t||!t.document||t.document.nodeType!==Ne)return n.isSupported=!1,n;let{document:r}=t;const o=r,i=o.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:c,Element:l,NodeFilter:u,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:p,DOMParser:f,trustedTypes:m}=t,g=l.prototype,h=Z(g,"cloneNode"),b=Z(g,"remove"),x=Z(g,"nextSibling"),y=Z(g,"childNodes"),w=Z(g,"parentNode");if("function"==typeof s){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let v,T="";const{implementation:S,createNodeIterator:A,createDocumentFragment:E,getElementsByTagName:O}=r,{importNode:_}=o;let k={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof N&&"function"==typeof w&&S&&void 0!==S.createHTMLDocument;const{MUSTACHE_EXPR:I,ERB_EXPR:L,TMPLIT_EXPR:z,DATA_ATTR:G,ARIA_ATTR:$,IS_SCRIPT_OR_DATA:K,ATTR_WHITESPACE:ue,CUSTOM_ELEMENT:de}=we;let{IS_ALLOWED_URI:pe}=we,fe=null;const me=X({},[...J,...ee,...te,...re,...ie]);let he=null;const be=X({},[...ae,...se,...ce,...le]);let ye=Object.seal(R(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Oe=null,_e=null,ke=!0,Ce=!0,Ie=!1,Re=!0,Le=!1,ze=!0,je=!1,De=!1,Pe=!1,qe=!1,Me=!1,Be=!1,Fe=!0,Ue=!1,He=!0,Qe=!1,We={},Ye=null;const Ge=X({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let $e=null;const Xe=X({},["audio","video","img","source","image","track"]);let Ke=null;const Ve=X({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ze="http://www.w3.org/1998/Math/MathML",Je="http://www.w3.org/2000/svg",et="http://www.w3.org/1999/xhtml";let tt=et,nt=!1,rt=null;const ot=X({},[Ze,Je,et],M);let it=X({},["mi","mo","mn","ms","mtext"]),at=X({},["annotation-xml"]);const st=X({},["title","style","font","a","script"]);let ct=null;const lt=["application/xhtml+xml","text/html"];let ut=null,dt=null;const pt=r.createElement("form"),ft=function(e){return e instanceof RegExp||e instanceof Function},mt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!dt||dt!==e){if(e&&"object"==typeof e||(e={}),e=V(e),ct=-1===lt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,ut="application/xhtml+xml"===ct?M:q,fe=Q(e,"ALLOWED_TAGS")?X({},e.ALLOWED_TAGS,ut):me,he=Q(e,"ALLOWED_ATTR")?X({},e.ALLOWED_ATTR,ut):be,rt=Q(e,"ALLOWED_NAMESPACES")?X({},e.ALLOWED_NAMESPACES,M):ot,Ke=Q(e,"ADD_URI_SAFE_ATTR")?X(V(Ve),e.ADD_URI_SAFE_ATTR,ut):Ve,$e=Q(e,"ADD_DATA_URI_TAGS")?X(V(Xe),e.ADD_DATA_URI_TAGS,ut):Xe,Ye=Q(e,"FORBID_CONTENTS")?X({},e.FORBID_CONTENTS,ut):Ge,Oe=Q(e,"FORBID_TAGS")?X({},e.FORBID_TAGS,ut):{},_e=Q(e,"FORBID_ATTR")?X({},e.FORBID_ATTR,ut):{},We=!!Q(e,"USE_PROFILES")&&e.USE_PROFILES,ke=!1!==e.ALLOW_ARIA_ATTR,Ce=!1!==e.ALLOW_DATA_ATTR,Ie=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Re=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Le=e.SAFE_FOR_TEMPLATES||!1,ze=!1!==e.SAFE_FOR_XML,je=e.WHOLE_DOCUMENT||!1,qe=e.RETURN_DOM||!1,Me=e.RETURN_DOM_FRAGMENT||!1,Be=e.RETURN_TRUSTED_TYPE||!1,Pe=e.FORCE_BODY||!1,Fe=!1!==e.SANITIZE_DOM,Ue=e.SANITIZE_NAMED_PROPS||!1,He=!1!==e.KEEP_CONTENT,Qe=e.IN_PLACE||!1,pe=e.ALLOWED_URI_REGEXP||ge,tt=e.NAMESPACE||et,it=e.MATHML_TEXT_INTEGRATION_POINTS||it,at=e.HTML_INTEGRATION_POINTS||at,ye=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ft(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ye.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ft(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ye.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(ye.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Le&&(Ce=!1),Me&&(qe=!0),We&&(fe=X({},ie),he=[],!0===We.html&&(X(fe,J),X(he,ae)),!0===We.svg&&(X(fe,ee),X(he,se),X(he,le)),!0===We.svgFilters&&(X(fe,te),X(he,se),X(he,le)),!0===We.mathMl&&(X(fe,re),X(he,ce),X(he,le))),e.ADD_TAGS&&(fe===me&&(fe=V(fe)),X(fe,e.ADD_TAGS,ut)),e.ADD_ATTR&&(he===be&&(he=V(he)),X(he,e.ADD_ATTR,ut)),e.ADD_URI_SAFE_ATTR&&X(Ke,e.ADD_URI_SAFE_ATTR,ut),e.FORBID_CONTENTS&&(Ye===Ge&&(Ye=V(Ye)),X(Ye,e.FORBID_CONTENTS,ut)),He&&(fe["#text"]=!0),je&&X(fe,["html","head","body"]),fe.table&&(X(fe,["tbody"]),delete Oe.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw Y('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw Y('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');v=e.TRUSTED_TYPES_POLICY,T=v.createHTML("")}else void 0===v&&(v=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(m,i)),null!==v&&"string"==typeof T&&(T=v.createHTML(""));C&&C(e),dt=e}},gt=X({},[...ee,...te,...ne]),ht=X({},[...re,...oe]),bt=function(e){P(n.removed,{element:e});try{w(e).removeChild(e)}catch(t){b(e)}},xt=function(e,t){try{P(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){P(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(qe||Me)try{bt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},yt=function(e){let t=null,n=null;if(Pe)e=""+e;else{const t=B(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ct&&tt===et&&(e=''+e+"");const o=v?v.createHTML(e):e;if(tt===et)try{t=(new f).parseFromString(o,ct)}catch(e){}if(!t||!t.documentElement){t=S.createDocument(tt,"template",null);try{t.documentElement.innerHTML=nt?T:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),tt===et?O.call(t,je?"html":"body")[0]:je?t.documentElement:i},wt=function(e){return A.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},vt=function(e){return e instanceof p&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof d)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Tt=function(e){return"function"==typeof c&&e instanceof c};function St(e,t,r){j(e,(e=>{e.call(n,t,r,dt)}))}const At=function(e){let t=null;if(St(k.beforeSanitizeElements,e,null),vt(e))return bt(e),!0;const r=ut(e.nodeName);if(St(k.uponSanitizeElement,e,{tagName:r,allowedTags:fe}),e.hasChildNodes()&&!Tt(e.firstElementChild)&&W(/<[/\w]/g,e.innerHTML)&&W(/<[/\w]/g,e.textContent))return bt(e),!0;if(e.nodeType===Se)return bt(e),!0;if(ze&&e.nodeType===Ae&&W(/<[/\w]/g,e.data))return bt(e),!0;if(!fe[r]||Oe[r]){if(!Oe[r]&&Et(r)){if(ye.tagNameCheck instanceof RegExp&&W(ye.tagNameCheck,r))return!1;if(ye.tagNameCheck instanceof Function&&ye.tagNameCheck(r))return!1}if(He&&!Ye[r]){const t=w(e)||e.parentNode,n=y(e)||e.childNodes;if(n&&t){for(let r=n.length-1;r>=0;--r){const o=h(n[r],!0);o.__removalCount=(e.__removalCount||0)+1,t.insertBefore(o,x(e))}}}return bt(e),!0}return e instanceof l&&!function(e){let t=w(e);t&&t.tagName||(t={namespaceURI:tt,tagName:"template"});const n=q(e.tagName),r=q(t.tagName);return!!rt[e.namespaceURI]&&(e.namespaceURI===Je?t.namespaceURI===et?"svg"===n:t.namespaceURI===Ze?"svg"===n&&("annotation-xml"===r||it[r]):Boolean(gt[n]):e.namespaceURI===Ze?t.namespaceURI===et?"math"===n:t.namespaceURI===Je?"math"===n&&at[r]:Boolean(ht[n]):e.namespaceURI===et?!(t.namespaceURI===Je&&!at[r])&&!(t.namespaceURI===Ze&&!it[r])&&!ht[n]&&(st[n]||!gt[n]):!("application/xhtml+xml"!==ct||!rt[e.namespaceURI]))}(e)?(bt(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!W(/<\/no(script|embed|frames)/i,e.innerHTML)?(Le&&e.nodeType===Te&&(t=e.textContent,j([I,L,z],(e=>{t=F(t,e," ")})),e.textContent!==t&&(P(n.removed,{element:e.cloneNode()}),e.textContent=t)),St(k.afterSanitizeElements,e,null),!1):(bt(e),!0)},Nt=function(e,t,n){if(Fe&&("id"===t||"name"===t)&&(n in r||n in pt))return!1;if(Ce&&!_e[t]&&W(G,t));else if(ke&&W($,t));else if(!he[t]||_e[t]){if(!(Et(e)&&(ye.tagNameCheck instanceof RegExp&&W(ye.tagNameCheck,e)||ye.tagNameCheck instanceof Function&&ye.tagNameCheck(e))&&(ye.attributeNameCheck instanceof RegExp&&W(ye.attributeNameCheck,t)||ye.attributeNameCheck instanceof Function&&ye.attributeNameCheck(t))||"is"===t&&ye.allowCustomizedBuiltInElements&&(ye.tagNameCheck instanceof RegExp&&W(ye.tagNameCheck,n)||ye.tagNameCheck instanceof Function&&ye.tagNameCheck(n))))return!1}else if(Ke[t]);else if(W(pe,F(n,ue,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==U(n,"data:")||!$e[e]){if(Ie&&!W(K,F(n,ue,"")));else if(n)return!1}else;return!0},Et=function(e){return"annotation-xml"!==e&&B(e,de)},Ot=function(e){St(k.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||vt(e))return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:he,forceKeepAttr:void 0};let o=t.length;for(;o--;){const i=t[o],{name:a,namespaceURI:s,value:c}=i,l=ut(a);let u="value"===a?c:H(c);if(r.attrName=l,r.attrValue=u,r.keepAttr=!0,r.forceKeepAttr=void 0,St(k.uponSanitizeAttribute,e,r),u=r.attrValue,!Ue||"id"!==l&&"name"!==l||(xt(a,e),u="user-content-"+u),ze&&W(/((--!?|])>)|<\/(style|title)/i,u)){xt(a,e);continue}if(r.forceKeepAttr)continue;if(xt(a,e),!r.keepAttr)continue;if(!Re&&W(/\/>/i,u)){xt(a,e);continue}Le&&j([I,L,z],(e=>{u=F(u,e," ")}));const d=ut(e.nodeName);if(Nt(d,l,u)){if(v&&"object"==typeof m&&"function"==typeof m.getAttributeType)if(s);else switch(m.getAttributeType(d,l)){case"TrustedHTML":u=v.createHTML(u);break;case"TrustedScriptURL":u=v.createScriptURL(u)}try{s?e.setAttributeNS(s,a,u):e.setAttribute(a,u),vt(e)?bt(e):D(n.removed)}catch(e){}}}St(k.afterSanitizeAttributes,e,null)},_t=function e(t){let n=null;const r=wt(t);for(St(k.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)St(k.uponSanitizeShadowNode,n,null),At(n),Ot(n),n.content instanceof a&&e(n.content);St(k.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,s=null,l=null;if(nt=!e,nt&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Tt(e)){if("function"!=typeof e.toString)throw Y("toString is not a function");if("string"!=typeof(e=e.toString()))throw Y("dirty is not a string, aborting")}if(!n.isSupported)return e;if(De||mt(t),n.removed=[],"string"==typeof e&&(Qe=!1),Qe){if(e.nodeName){const t=ut(e.nodeName);if(!fe[t]||Oe[t])throw Y("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof c)r=yt("\x3c!----\x3e"),i=r.ownerDocument.importNode(e,!0),i.nodeType===ve&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i);else{if(!qe&&!Le&&!je&&-1===e.indexOf("<"))return v&&Be?v.createHTML(e):e;if(r=yt(e),!r)return qe?null:Be?T:""}r&&Pe&&bt(r.firstChild);const u=wt(Qe?e:r);for(;s=u.nextNode();)At(s),Ot(s),s.content instanceof a&&_t(s.content);if(Qe)return e;if(qe){if(Me)for(l=E.call(r.ownerDocument);r.firstChild;)l.appendChild(r.firstChild);else l=r;return(he.shadowroot||he.shadowrootmode)&&(l=_.call(o,l,!0)),l}let d=je?r.outerHTML:r.innerHTML;return je&&fe["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&W(xe,r.ownerDocument.doctype.name)&&(d="\n"+d),Le&&j([I,L,z],(e=>{d=F(d,e," ")})),v&&Be?v.createHTML(d):d},n.setConfig=function(){mt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),De=!0},n.clearConfig=function(){dt=null,De=!1},n.isValidAttribute=function(e,t,n){dt||mt({});const r=ut(e),o=ut(t);return Nt(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&P(k[e],t)},n.removeHook=function(e){return D(k[e])},n.removeHooks=function(e){k[e]=[]},n.removeAllHooks=function(){k={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}(),_e=function(e){return{__html:A((0,Oe.sanitize)(e))}},ke=function(e,t,n,r,o){var i=o.userInput,a=o.userAttempt,l=o.currentQuestionIndex,d=o.continueTillCorrect,p=o.showNextQuestionButton,f=o.incorrect,m=o.correct,g=o.setButtons,h=o.setIsCorrect,b=o.setIncorrectAnswer,x=o.setCorrect,y=o.setIncorrect,w=o.setShowNextQuestionButton,v=o.setUserInput,T=o.setUserAttempt,S="".concat(e),A=Object.keys(r).map((function(){return{disabled:!0}})),N=u(i);if("single"===n)void 0===N[l]&&(N[l]=e),S===t?(f.indexOf(l)<0&&m.indexOf(l)<0&&m.push(l),g((function(n){return s(s(s({},n),A),{},c({},e-1,{className:S===t?"correct":"incorrect"}))})),h(!0),b(!1),x(m),w(!0)):(m.indexOf(l)<0&&f.indexOf(l)<0&&f.push(l),d?g((function(t){return s(s({},t),{},c({},e-1,{disabled:!t[e-1]}))})):(g((function(n){return s(s(s({},n),A),{},c({},e-1,{className:S===t?"correct":"incorrect"}))})),w(!0)),b(!0),h(!1),y(f));else{var E=t.length;if(void 0===N[l]&&(N[l]=[]),N[l].length=0&&f.splice(f.indexOf(a),1)):(f.indexOf(a)<0&&f.push(a),m.indexOf(a)>=0&&m.splice(m.indexOf(a),1)),g(m),h(f),l((function(t){return s(s(s({},t),x),{},c({},e-1,{className:"selected"}))})),p(!0);else{if(void 0===y[a]&&(y[a]=[]),y[a].includes(e)?y[a].splice(y[a].indexOf(e),1):y[a].push(e),y[a].length===t.length){var w,v=!0,T=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=d(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(i[a]);try{for(T.s();!(w=T.n()).done;){var S=w.value;if(!t.includes(S)){v=!1,f.indexOf(a)<0&&f.push(a),m.indexOf(a)>=0&&m.splice(m.indexOf(a),1);break}}}catch(e){T.e(e)}finally{T.f()}v&&(m.indexOf(a)<0&&m.push(a),f.indexOf(a)>=0&&f.splice(f.indexOf(a),1))}else f.indexOf(a)<0&&f.push(a),m.indexOf(a)>=0&&m.splice(m.indexOf(a),1);g(m),h(f),l((function(t){return s(s({},t),{},c({},e-1,{className:y[a].includes(e)?"selected":void 0}))})),y[a].length>0&&p(!0)}b(y)};function Ie(e){var t=e.question,n=e.isResultPage,r=t.explanation;return r?n?x.jsx("div",{className:"explanation",children:r}):x.jsxs("div",{children:[x.jsx("br",{}),r]}):null}var Re=function(e){return e.messageForCorrectAnswer||"You are correct. Please click Next to continue."},Le=function(e){return e.messageForIncorrectAnswer||"Incorrect answer. Please try again."};function ze(e){var t=e.showInstantFeedback,n=e.incorrectAnswer,o=e.correctAnswer,i=e.question,a=e.onQuestionSubmit,s=e.userAnswer;return r((function(){a&&(o||n)&&a({question:i,userAnswer:s,isCorrect:o})}),[o,n]),x.jsxs(x.Fragment,{children:[n&&t&&x.jsx("div",{className:"alert incorrect",children:Le(i)}),o&&t&&x.jsxs("div",{className:"alert correct",children:[Re(i),x.jsx(Ie,{question:i,isResultPage:!1})]})]})}function je(e){var n=e.questions,a=e.appLocale,s=e.showDefaultResult,c=e.onComplete,d=e.customResultPage,p=e.showInstantFeedback,m=e.continueTillCorrect,g=e.revealAnswerOnSubmit,h=e.allowNavigation,b=e.onQuestionSubmit,v=e.timer,T=e.allowPauseTimer,S=e.enableProgressBar,A=e.progressBarColor,N=l(t(!1),2),E=N[0],O=N[1],_=l(t(!1),2),k=_[0],C=_[1],I=l(t(!1),2),R=I[0],L=I[1],z=l(t(!1),2),j=z[0],D=z[1],P=l(t(0),2),q=P[0],M=P[1],B=l(t({}),2),F=B[0],U=B[1],H=l(t([]),2),Q=H[0],W=H[1],Y=l(t([]),2),G=Y[0],$=Y[1],X=l(t([]),2),K=X[0],V=X[1],Z=l(t([]),2),J=Z[0],ee=Z[1],te=l(t("all"),2),ne=te[0],re=te[1],oe=l(t(1),2),ie=oe[0],ae=oe[1],se=l(t(!0),2),ce=se[0],le=se[1],ue=l(t(void 0),2),de=ue[0],pe=ue[1],fe=l(t(0),2),me=fe[0],ge=fe[1],he=l(t(0),2),be=he[0],xe=he[1],ye=l(t(n[q]),2),we=ye[0],ve=ye[1],Te=l(t(void 0),2),Se=Te[0],Ae=Te[1],Ne=l(t(v),2),Ee=Ne[0],Oe=Ne[1],Re=l(t(!0),2),Le=Re[0],je=Re[1];r((function(){le(void 0===s||s)}),[s]),r((function(){ve(n[q])}),[q,n]),r((function(){var e=we.answerSelectionType;pe(e||"single")}),[we,q]),r((function(){if(j){je(!1);for(var e=0,t=0,r=0;r",t)}),n&&x.jsx("span",{className:"selection-tag segment",children:n})]})},Be=o((function(){var e,t;if("all"!==ne){var r=K;"correct"===ne?r=Q:"incorrect"===ne&&(r=G),e=n.filter((function(e,t){return-1!==r.indexOf(t)})),t=J.filter((function(e,t){return-1!==r.indexOf(t)}))}return(e||n).map((function(e,n){var r=t?t[n]:J[n],o=e.answerSelectionType||"single";return x.jsxs("div",{className:"result-answer-wrapper",children:[x.jsx("h3",{dangerouslySetInnerHTML:_e("Q".concat(e.questionIndex,": ").concat(e.question," ").concat(a.marksOfQuestion.replace("",e.point)))}),e.questionPic&&x.jsx("img",{src:e.questionPic,alt:"question"}),Me(o,e.correctAnswer.length,e.segment),x.jsx("div",{className:"result-answer",children:qe(e,r)}),x.jsx(Ie,{question:e,isResultPage:!0})]},f())}))}),[j,ne]);r((function(){var e;return v&&Le&&Ee>0&&(e=setInterval((function(){Oe((function(e){return e-1}))}),1e3)),function(){return v&&clearInterval(e)}}),[Le,Ee,v]);var Fe,Ue,He,Qe,We,Ye,Ge,$e,Xe,Ke,Ve=function(e){return e<10?"0":""},Ze=function(e){var t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=e%60;return"".concat(Ve(t)).concat(t,":").concat(Ve(n)).concat(n,":").concat(Ve(r)).concat(r)};return x.jsxs("div",{className:"questionWrapper",children:[S&&x.jsxs(x.Fragment,{children:[x.jsx("div",{style:{display:"flex",width:"100%"},children:x.jsx(y,{progress:q+1,quizLength:n.length,isEndQuiz:j,progressBarColor:A})}),x.jsx("br",{})]}),v&&!Le&&x.jsxs("div",{children:[a.timerTimeTaken,":"," ",x.jsx("b",{children:Ze(v-Ee)})]}),v&&Le&&x.jsxs("div",{children:[a.timerTimeRemaining,":"," ",x.jsx("b",{children:Ze(Ee)})]}),v&&0===Ee&&Le&&(je(!1),D(!0),void n.forEach((function(e,t){void 0===J[t]&&V((function(e){return[].concat(u(e),[t])}))}))),!j&&x.jsxs("div",{className:"questionWrapperBody",children:[x.jsxs("div",{children:["".concat(a.question," ").concat(q+1," / ").concat(n.length,":"),x.jsx("br",{}),v&&T&&x.jsx("button",{type:"button",className:"timerBtn",onClick:function(){je(!Le)},children:Le?a.pauseScreenPause:a.pauseScreenResume})]}),Le?x.jsxs(x.Fragment,{children:[x.jsx("h3",{dangerouslySetInnerHTML:_e("".concat(we&&we.question," ").concat(a.marksOfQuestion.replace("",we.point)))}),we&&we.questionPic&&x.jsx("img",{src:we.questionPic,alt:"question"}),we&&Me(de,we.correctAnswer.length,we.segment),x.jsx("div",{className:"questionModal",children:x.jsx(ze,{question:we,showInstantFeedback:p,correctAnswer:k,incorrectAnswer:E,onQuestionSubmit:b,userAnswer:u(J).pop()})}),we&&(Fe=we,Ue=F,He=Fe.answers,Qe=Fe.correctAnswer,We=Fe.questionType,Ye=Fe.questionIndex,Ge=Fe.answerSelectionType,$e=function(e){return ke(e+1,Qe,Ge,He,{userInput:J,userAttempt:ie,currentQuestionIndex:q,continueTillCorrect:m,showNextQuestionButton:R,incorrect:G,correct:Q,setButtons:U,setIsCorrect:C,setIncorrectAnswer:O,setCorrect:W,setIncorrect:$,setShowNextQuestionButton:L,setUserInput:ee,setUserAttempt:ae})},Xe=function(e){return Ce(e+1,Qe,Ge,He,{userInput:J,currentQuestionIndex:q,setButtons:U,setShowNextQuestionButton:L,incorrect:G,correct:Q,setCorrect:W,setIncorrect:$,setUserInput:ee})},Ke=function(e){return void 0!==J[Ye-1]&&("single"===Ge?J[Ye-1]===e:Array.isArray(J[Ye-1])&&J[Ye-1].includes(e))},Ge=Ge||"single",He.map((function(e,t){return x.jsx(i,{children:void 0!==Ue[t]?x.jsxs("button",{type:"button",disabled:Ue[t].disabled||!1,className:"".concat(Ue[t].className||""," answerBtn btn"),onClick:function(){return g?Xe(t):$e(t)},children:["text"===We&&x.jsx("span",{children:e}),"photo"===We&&x.jsx("img",{src:e,alt:"answer"})]}):x.jsxs("button",{type:"button",onClick:function(){return g?Xe(t):$e(t)},className:"answerBtn btn ".concat(h&&Ke(t+1)?"selected":""),children:["text"===We&&e,"photo"===We&&x.jsx("img",{src:e,alt:"answer"})]})},f())}))),(R||h)&&x.jsxs("div",{className:"questionBtnContainer",children:[h&&q>0&&x.jsx("button",{onClick:function(){return De(q-2)},className:"prevQuestionBtn btn",type:"button",children:a.prevQuestionBtn}),x.jsx("button",{onClick:function(){return De(q)},className:"nextQuestionBtn btn",type:"button",children:a.nextQuestionBtn})]})]}):x.jsxs("span",{className:"timerPauseScreen dark:text-white text-black",children:[x.jsx("br",{}),x.jsx("br",{}),a.pauseScreenDisplay]})]}),j&&ce&&void 0===d&&x.jsxs("div",{className:"card-body",children:[x.jsx("h2",{children:a.resultPageHeaderText.replace("",Q.length).replace("",n.length)}),x.jsx("h2",{children:a.resultPagePoint.replace("",be).replace("",me)}),x.jsx("br",{}),x.jsx(w,{filteredValue:ne,handleChange:Pe,appLocale:a}),Be()]}),j&&!ce&&void 0!==d&&d(Se)]})}var De={landingHeaderText:" Questions",question:"Question",startQuizBtn:"Start Quiz",resultFilterAll:"All",resultFilterCorrect:"Correct",resultFilterIncorrect:"Incorrect",resultFilterUnanswered:"Unanswered",nextQuestionBtn:"Next",prevQuestionBtn:"Prev",resultPageHeaderText:"You have completed the quiz. You got out of questions.",resultPagePoint:"You scored out of .",pauseScreenDisplay:"Test is paused. Clicked the Resume button to continue",timerTimeRemaining:"Time Remaining",timerTimeTaken:"Time Taken",pauseScreenPause:"Pause",pauseScreenResume:"Resume",singleSelectionTagText:"Single Selection",multipleSelectionTagText:"Multiple Selection",pickNumberOfSelection:"Pick ",marksOfQuestion:"( marks)"};function Pe(e){var n=e.quiz,i=e.shuffle,a=e.shuffleAnswer,c=e.showDefaultResult,u=e.onComplete,d=e.customResultPage,p=e.showInstantFeedback,f=e.continueTillCorrect,m=e.revealAnswerOnSubmit,g=e.allowNavigation,h=e.onQuestionSubmit,b=e.disableSynopsis,y=e.timer,w=e.allowPauseTimer,v=e.enableProgressBar,T=l(t(!1),2),S=T[0],A=T[1],N=l(t(n.questions),2),E=N[0],O=N[1],_=n.nrOfQuestions&&n.nrOfQuestions0;t-=1){var n=Math.floor(Math.random()*(t+1)),r=[e[n],e[t]];e[t]=r[0],e[n]=r[1]}return e}),[]);r((function(){b&&A(!0)}),[]),r((function(){var e=n.questions;i&&(e=k(e)),a&&(e=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((function(e){var t,n=(null===(t=e.answers)||void 0===t?void 0:t.map((function(e,t){return[e,t]}))).sort((function(){return Math.random()-.5})),r=n.map((function(e){return e[0]}));if("single"===e.answerSelectionType){var o=e.correctAnswer,i=n.findIndex((function(e){return"".concat(e[1]+1)==="".concat(o)}))+1;return s(s({},e),{},{correctAnswer:"".concat(i),answers:r})}if("multiple"===e.answerSelectionType){var a=e.correctAnswer.map((function(e){return n.findIndex((function(t){return"".concat(t[1]+1)==="".concat(e)}))+1}));return s(s({},e),{},{correctAnswer:a,answers:r})}return e}))}(e)),e.length=_,e=e.map((function(e,t){return s(s({},e),{},{questionIndex:t+1})})),O(e)}),[S]);if(!function(e){if(!e)return console.error("Quiz object is required."),!1;if(y&&"number"!=typeof y||y<1)return console.error(y&&"number"!=typeof y?"timer must be a number":"timer must be a number greater than 0"),!1;if(w&&"boolean"!=typeof w)return console.error("allowPauseTimer must be a Boolean"),!1;if(v&&"boolean"!=typeof v)return console.error("enableProgressBar must be a Boolean"),!1;if("progressBarColor"in n){if("string"!=typeof n.progressBarColor)return console.error("progressBarColor must be a String"),!1;if(t=n.progressBarColor,!/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/.test(t))return console.error("progressBarColor must be a valid hex colour"),!1}for(var t,r=0;r",_)}),n.quizSynopsis&&x.jsx("div",{className:"quiz-synopsis",children:n.quizSynopsis}),x.jsx("div",{className:"startQuizWrapper",children:x.jsx("button",{type:"button",onClick:function(){return A(!0)},className:"startQuizBtn btn",children:C.startQuizBtn})})]}),S&&x.jsx(je,{questions:E,showDefaultResult:c,onComplete:u,customResultPage:d,showInstantFeedback:p,continueTillCorrect:f,revealAnswerOnSubmit:m,allowNavigation:g,appLocale:C,onQuestionSubmit:h,timer:y,allowPauseTimer:w,enableProgressBar:v,progressBarColor:n.progressBarColor})]})}!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}('.react-quiz-container{margin:20px;max-width:500px}.react-quiz-container .startQuizWrapper{margin-top:10px}.react-quiz-container .btn{background-image:none;border:1px solid transparent;cursor:pointer;font-weight:600;margin-bottom:0;padding:11px 12px;text-align:center;touch-action:manipulation;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;white-space:nowrap}.react-quiz-container .questionWrapper .btn{border:1px solid #e8e8e8;border-radius:4px;display:block;font-size:15px;margin-bottom:10px;margin-top:10px;text-align:unset;white-space:normal}.react-quiz-container .questionWrapper .btn.correct,.timerBtn{background:green;color:#fff}.timerBtn{border:0!important;border-radius:10px;cursor:pointer;float:right;padding:5px;position:relative;top:-35px;width:80px}.timerPauseScreen{font-size:30px}.react-quiz-container .questionModal .alert{border:1px solid transparent;border-radius:2px;color:#fff;margin-bottom:21px;padding:20px}.react-quiz-container .correct{background:green}.react-quiz-container .incorrect{background:red;color:#fff}.react-quiz-container .unanswered{background:grey;color:#fff}.react-quiz-container .answerBtn,.react-quiz-container .questionWrapper img{width:100%}.react-quiz-container .selected{background:#007bff;color:#fff}.react-quiz-container .startQuizWrapper .startQuizBtn{background-color:#fff;border:1px solid #d9d9d9;border-radius:2px;color:rgba(0,0,0,.65);font-size:15px;line-height:1.35135}.react-quiz-container .result-answer-wrapper{border:1px solid #e8e8e8;border-bottom-left-radius:5px;border-bottom-right-radius:5px;margin-bottom:20px}.react-quiz-container .result-answer-wrapper h3{background-color:#fafafa;border-top-left-radius:5px;border-top-right-radius:5px;color:rgba(0,0,0,.9);margin:0;opacity:.8;padding:10px}.react-quiz-container .result-answer-wrapper .explanation{border:1px solid #e8e8e8;margin:0 20px 20px;padding:20px}.react-quiz-container .result-answer-wrapper .tag-container{margin:20px}.react-quiz-container .result-answer{padding:0 20px}.react-quiz-container .quiz-synopsis{margin:15px 0}.react-quiz-container .tag-container{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:20px;margin-top:20px}.react-quiz-container .number-of-selection,.react-quiz-container .selection-tag{border-radius:5px;color:#fff;padding:7px}.react-quiz-container .number-of-selection{background:#673ab7;margin-left:5px}.react-quiz-container .selection-tag.single{background:#3f51b5}.react-quiz-container .selection-tag.multiple{background:#ff9800}.react-quiz-container .selection-tag.segment{background:#3db4b9;margin-left:5px}.react-quiz-container .questionBtnContainer{display:flex;justify-content:space-between}.react-quiz-container .quiz-result-filter{bottom:15px;position:relative;width:120px;.filter-dropdown-select{background-color:#fcfcfc;border:2px solid #c2c5c7;border-radius:7px;bottom:10px;color:#333;cursor:pointer;font-size:16px;height:12px;margin-top:2px;padding:8px;position:relative;text-transform:capitalize}.filter-dropdown-select:after{color:#a5a5a5;content:"▼";font-size:11px;position:absolute;right:10px;top:57%;transform:translateY(-50%);transition:all .3s ease}.filter-dropdown-select:hover{border:2px solid #51aae6;box-shadow:0 0 6px rgba(109,179,250,.5)}.dropdown-options{background-color:#fcfcfc;border-radius:10px;box-shadow:0 0 10px hsla(210,2%,56%,.5);left:0;list-style:none;margin:0;padding:0;position:absolute;top:85%;width:100%;z-index:1}.filter-dropdown-select.open{border:2px solid #51aae6;box-shadow:0 0 6px rgba(109,179,250,.5)}.dropdown-options .dropdown-options-item{cursor:pointer;font-size:16px;padding:10px}.dropdown-options .dropdown-options-item:hover{background-color:hsla(0,0%,89%,.852);border-radius:5px}.dropdown-options .dropdown-options-item:focus{background-color:#d7f1f9;font-weight:700}.filter-dropdown-select .selected-option.selected-open{color:#c6c2c2;font-weight:lighter}.filter-dropdown-select .selected-option{bottom:2px;font-size:16px;position:relative}.filter-dropdown-select:focus+.dropdown-options{max-height:200px}.dropdown-options .dropdown-options-item.selected{background-color:#d7f1f9;color:#333;font-weight:700}.dropdown-options.open{max-height:200px}}');export{Pe as default}; +import e,{useState as t,useRef as n,useEffect as r,useCallback as o,Fragment as i}from"react";function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};var m,g,h={exports:{}},b={};var x=(g||(g=1,h.exports=function(){if(m)return b;m=1;var t=e,n=Symbol.for("react.element"),r=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in void 0!==r&&(l=""+r),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(u=t.ref),t)o.call(t,s)&&!a.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps)void 0===c[s]&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:i.current}}return b.Fragment=r,b.jsx=s,b.jsxs=s,b}()),h.exports);function y(e){var t=e.progressBarColor,n=void 0===t?"#9de1f6":t,r=e.progress,o=e.height,i=void 0===o?"25px":o,a=e.quizLength,s=e.isEndQuiz,c=r-1,l=100/a,u={width:"100%",backgroundColor:"#D0D4CA",height:i,borderRadius:40,position:"relative",overflow:"hidden"},d={width:s?"100%":"".concat(l*c,"%"),height:"100%",backgroundColor:n,transition:"width 0.3s ease"};return x.jsxs("div",{style:u,children:[x.jsx("div",{style:d}),x.jsx("span",{style:{position:"absolute",left:"50%",top:"50%",transform:"translateX(-50%) translateY(-50%)",lineHeigth:"20px",fontSize:"16px",color:"#000",fontWeight:"bold",backgroundColor:"transparent"},children:s?"100%":"".concat(Math.round(l*c),"%")})]})}function w(e){var o=e.filteredValue,i=e.handleChange,a=e.appLocale,s=l(t(!1),2),c=s[0],u=s[1],d=n(null),p=function(){u(!c)},f=function(e){i({target:{value:e}}),u(!1)},m=c?"selected-open":"",g={all:a.resultFilterAll,correct:a.resultFilterCorrect,incorrect:a.resultFilterIncorrect,unanswered:a.resultFilterUnanswered};return r((function(){var e=function(e){c&&d.current&&!d.current.contains(e.target)&&u(!1)};return document.addEventListener("click",e),function(){document.removeEventListener("click",e)}}),[c]),x.jsxs("div",{className:"quiz-result-filter",children:[x.jsxs("div",{ref:d,className:"filter-dropdown-select ".concat(c?"open":""),onClick:p,onKeyDown:function(e){"Enter"===e.key&&p()},role:"button",tabIndex:0,children:[x.jsx("div",{className:"selected-option ".concat(m),children:g[o]}),x.jsx("span",{className:"arrow ".concat(c?"up":"down")})]}),c&&x.jsxs("div",{className:"dropdown-options",role:"menu","aria-labelledby":"quiz-filter",children:[x.jsx("div",{className:"dropdown-options-item ".concat("all"===o?"selected":""),onClick:function(){return f("all")},onKeyDown:function(e){"Enter"===e.key&&f("all")},role:"menuitem",tabIndex:0,children:a.resultFilterAll}),x.jsx("div",{className:"dropdown-options-item ".concat("correct"===o?"selected":""),onClick:function(){return f("correct")},onKeyDown:function(e){"Enter"===e.key&&f("correct")},role:"menuitem",tabIndex:0,children:a.resultFilterCorrect}),x.jsx("div",{className:"dropdown-options-item ".concat("incorrect"===o?"selected":""),onClick:function(){return f("incorrect")},onKeyDown:function(e){"Enter"===e.key&&f("incorrect")},role:"menuitem",tabIndex:0,children:a.resultFilterIncorrect}),x.jsx("div",{className:"dropdown-options-item ".concat("unanswered"===o?"selected":""),onClick:function(){return f("unanswered")},onKeyDown:function(e){"Enter"===e.key&&f("unanswered")},role:"menuitem",tabIndex:0,children:a.resultFilterUnanswered})]})]})}var v={"":["",""],_:["",""],"*":["",""],"~":["",""],"\n":["
    "]," ":["
    "],"-":["
    "]};function T(e){return e.replace(RegExp("^"+(e.match(/^(\t| )+/)||"")[0],"gm"),"")}function S(e){return(e+"").replace(/"/g,""").replace(//g,">")}function A(e,t){var n,r,o,i,a,s=/((?:^|\n+)(?:\n---+|\* \*(?: \*)+)\n)|(?:^``` *(\w*)\n([\s\S]*?)\n```$)|((?:(?:^|\n+)(?:\t| {2,}).+)+\n*)|((?:(?:^|\n)([>*+-]|\d+\.)\s+.*)+)|(?:!\[([^\]]*?)\]\(([^)]+?)\))|(\[)|(\](?:\(([^)]+?)\))?)|(?:(?:^|\n+)([^\s].*)\n(-{3,}|={3,})(?:\n+|$))|(?:(?:^|\n+)(#{1,6})\s*(.+)(?:\n+|$))|(?:`([^`].*?)`)|( \n\n*|\n{2,}|__|\*\*|[_*]|~~)/gm,c=[],l="",u=t||{},d=0;function p(e){var t=v[e[1]||""],n=c[c.length-1]==e;return t?t[1]?(n?c.pop():c.push(e),t[0|n]):t[0]:e}function f(){for(var e="";c.length;)e+=p(c[c.length-1]);return e}for(e=e.replace(/^\[(.+?)\]:\s*(.+)$/gm,(function(e,t,n){return u[t.toLowerCase()]=n,""})).replace(/^\n+|\n+$/g,"");o=s.exec(e);)r=e.substring(d,o.index),d=s.lastIndex,n=o[0],r.match(/[^\\](\\\\)*\\$/)||((a=o[3]||o[4])?n='
    "+T(S(a).replace(/^\n+|\n+$/g,""))+"
    ":(a=o[6])?(a.match(/\./)&&(o[5]=o[5].replace(/^\d+/gm,"")),i=A(T(o[5].replace(/^\s*[>*+.-]/gm,""))),">"==a?a="blockquote":(a=a.match(/\./)?"ol":"ul",i=i.replace(/^(.*)(\n|$)/gm,"
  • $1
  • ")),n="<"+a+">"+i+""):o[8]?n=''+S(o[7])+'':o[10]?(l=l.replace("
    ",''),n=f()+""):o[9]?n="":o[12]||o[14]?n="<"+(a="h"+(o[14]?o[14].length:o[13]>"="?1:2))+">"+A(o[12]||o[15],u)+"":o[16]?n=""+S(o[16])+"":(o[17]||o[1])&&(n=p(o[17]||"--"))),l+=r,l+=n;return(l+e.substring(d)+f()).replace(/^\n+|\n+$/g,"")} +/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:N,setPrototypeOf:E,isFrozen:O,getPrototypeOf:k,getOwnPropertyDescriptor:_}=Object;let{freeze:C,seal:I,create:R}=Object,{apply:z,construct:j}="undefined"!=typeof Reflect&&Reflect;C||(C=function(e){return e}),I||(I=function(e){return e}),z||(z=function(e,t,n){return e.apply(t,n)}),j||(j=function(e,t){return new e(...t)});const L=K(Array.prototype.forEach),q=K(Array.prototype.lastIndexOf),D=K(Array.prototype.pop),P=K(Array.prototype.push),M=K(Array.prototype.splice),B=K(String.prototype.toLowerCase),F=K(String.prototype.toString),U=K(String.prototype.match),Q=K(String.prototype.replace),H=K(String.prototype.indexOf),W=K(String.prototype.trim),Y=K(Object.prototype.hasOwnProperty),G=K(RegExp.prototype.test),$=(X=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n1?n-1:0),o=1;o2&&void 0!==arguments[2]?arguments[2]:B;E&&E(e,null);let r=t.length;for(;r--;){let o=t[r];if("string"==typeof o){const e=n(o);e!==o&&(O(t)||(t[r]=e),o=e)}e[o]=!0}return e}function Z(e){for(let t=0;t/gm),me=I(/\$\{[\w\W]*/gm),ge=I(/^data-[\-\w.\u00B7-\uFFFF]+$/),he=I(/^aria-[\-\w]+$/),be=I(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),xe=I(/^(?:\w+script|data):/i),ye=I(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),we=I(/^html$/i),ve=I(/^[a-z][.\w]*(-[.\w]+)+$/i);var Te=Object.freeze({__proto__:null,ARIA_ATTR:he,ATTR_WHITESPACE:ye,CUSTOM_ELEMENT:ve,DATA_ATTR:ge,DOCTYPE_NAME:we,ERB_EXPR:fe,IS_ALLOWED_URI:be,IS_SCRIPT_OR_DATA:xe,MUSTACHE_EXPR:pe,TMPLIT_EXPR:me});const Se=1,Ae=3,Ne=7,Ee=8,Oe=9,ke=function(){return"undefined"==typeof window?null:window};var _e=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ke();const n=t=>e(t);if(n.version="3.2.6",n.removed=[],!t||!t.document||t.document.nodeType!==Oe||!t.Element)return n.isSupported=!1,n;let{document:r}=t;const o=r,i=o.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:c,Element:l,NodeFilter:u,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:p,DOMParser:f,trustedTypes:m}=t,g=l.prototype,h=ee(g,"cloneNode"),b=ee(g,"remove"),x=ee(g,"nextSibling"),y=ee(g,"childNodes"),w=ee(g,"parentNode");if("function"==typeof s){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let v,T="";const{implementation:S,createNodeIterator:A,createDocumentFragment:E,getElementsByTagName:O}=r,{importNode:k}=o;let _={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof N&&"function"==typeof w&&S&&void 0!==S.createHTMLDocument;const{MUSTACHE_EXPR:I,ERB_EXPR:z,TMPLIT_EXPR:j,DATA_ATTR:X,ARIA_ATTR:K,IS_SCRIPT_OR_DATA:Z,ATTR_WHITESPACE:pe,CUSTOM_ELEMENT:fe}=Te;let{IS_ALLOWED_URI:me}=Te,ge=null;const he=V({},[...te,...ne,...re,...ie,...se]);let xe=null;const ye=V({},[...ce,...le,...ue,...de]);let ve=Object.seal(R(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),_e=null,Ce=null,Ie=!0,Re=!0,ze=!1,je=!0,Le=!1,qe=!0,De=!1,Pe=!1,Me=!1,Be=!1,Fe=!1,Ue=!1,Qe=!0,He=!1,We=!0,Ye=!1,Ge={},$e=null;const Xe=V({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ke=null;const Ve=V({},["audio","video","img","source","image","track"]);let Ze=null;const Je=V({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),et="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml";let rt=nt,ot=!1,it=null;const at=V({},[et,tt,nt],F);let st=V({},["mi","mo","mn","ms","mtext"]),ct=V({},["annotation-xml"]);const lt=V({},["title","style","font","a","script"]);let ut=null;const dt=["application/xhtml+xml","text/html"];let pt=null,ft=null;const mt=r.createElement("form"),gt=function(e){return e instanceof RegExp||e instanceof Function},ht=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ft||ft!==e){if(e&&"object"==typeof e||(e={}),e=J(e),ut=-1===dt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,pt="application/xhtml+xml"===ut?F:B,ge=Y(e,"ALLOWED_TAGS")?V({},e.ALLOWED_TAGS,pt):he,xe=Y(e,"ALLOWED_ATTR")?V({},e.ALLOWED_ATTR,pt):ye,it=Y(e,"ALLOWED_NAMESPACES")?V({},e.ALLOWED_NAMESPACES,F):at,Ze=Y(e,"ADD_URI_SAFE_ATTR")?V(J(Je),e.ADD_URI_SAFE_ATTR,pt):Je,Ke=Y(e,"ADD_DATA_URI_TAGS")?V(J(Ve),e.ADD_DATA_URI_TAGS,pt):Ve,$e=Y(e,"FORBID_CONTENTS")?V({},e.FORBID_CONTENTS,pt):Xe,_e=Y(e,"FORBID_TAGS")?V({},e.FORBID_TAGS,pt):J({}),Ce=Y(e,"FORBID_ATTR")?V({},e.FORBID_ATTR,pt):J({}),Ge=!!Y(e,"USE_PROFILES")&&e.USE_PROFILES,Ie=!1!==e.ALLOW_ARIA_ATTR,Re=!1!==e.ALLOW_DATA_ATTR,ze=e.ALLOW_UNKNOWN_PROTOCOLS||!1,je=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Le=e.SAFE_FOR_TEMPLATES||!1,qe=!1!==e.SAFE_FOR_XML,De=e.WHOLE_DOCUMENT||!1,Be=e.RETURN_DOM||!1,Fe=e.RETURN_DOM_FRAGMENT||!1,Ue=e.RETURN_TRUSTED_TYPE||!1,Me=e.FORCE_BODY||!1,Qe=!1!==e.SANITIZE_DOM,He=e.SANITIZE_NAMED_PROPS||!1,We=!1!==e.KEEP_CONTENT,Ye=e.IN_PLACE||!1,me=e.ALLOWED_URI_REGEXP||be,rt=e.NAMESPACE||nt,st=e.MATHML_TEXT_INTEGRATION_POINTS||st,ct=e.HTML_INTEGRATION_POINTS||ct,ve=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&>(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ve.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&>(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ve.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(ve.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Le&&(Re=!1),Fe&&(Be=!0),Ge&&(ge=V({},se),xe=[],!0===Ge.html&&(V(ge,te),V(xe,ce)),!0===Ge.svg&&(V(ge,ne),V(xe,le),V(xe,de)),!0===Ge.svgFilters&&(V(ge,re),V(xe,le),V(xe,de)),!0===Ge.mathMl&&(V(ge,ie),V(xe,ue),V(xe,de))),e.ADD_TAGS&&(ge===he&&(ge=J(ge)),V(ge,e.ADD_TAGS,pt)),e.ADD_ATTR&&(xe===ye&&(xe=J(xe)),V(xe,e.ADD_ATTR,pt)),e.ADD_URI_SAFE_ATTR&&V(Ze,e.ADD_URI_SAFE_ATTR,pt),e.FORBID_CONTENTS&&($e===Xe&&($e=J($e)),V($e,e.FORBID_CONTENTS,pt)),We&&(ge["#text"]=!0),De&&V(ge,["html","head","body"]),ge.table&&(V(ge,["tbody"]),delete _e.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw $('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw $('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');v=e.TRUSTED_TYPES_POLICY,T=v.createHTML("")}else void 0===v&&(v=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(m,i)),null!==v&&"string"==typeof T&&(T=v.createHTML(""));C&&C(e),ft=e}},bt=V({},[...ne,...re,...oe]),xt=V({},[...ie,...ae]),yt=function(e){P(n.removed,{element:e});try{w(e).removeChild(e)}catch(t){b(e)}},wt=function(e,t){try{P(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){P(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Be||Fe)try{yt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},vt=function(e){let t=null,n=null;if(Me)e=""+e;else{const t=U(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ut&&rt===nt&&(e=''+e+"");const o=v?v.createHTML(e):e;if(rt===nt)try{t=(new f).parseFromString(o,ut)}catch(e){}if(!t||!t.documentElement){t=S.createDocument(rt,"template",null);try{t.documentElement.innerHTML=ot?T:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),rt===nt?O.call(t,De?"html":"body")[0]:De?t.documentElement:i},Tt=function(e){return A.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},St=function(e){return e instanceof p&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof d)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},At=function(e){return"function"==typeof c&&e instanceof c};function Nt(e,t,r){L(e,(e=>{e.call(n,t,r,ft)}))}const Et=function(e){let t=null;if(Nt(_.beforeSanitizeElements,e,null),St(e))return yt(e),!0;const r=pt(e.nodeName);if(Nt(_.uponSanitizeElement,e,{tagName:r,allowedTags:ge}),qe&&e.hasChildNodes()&&!At(e.firstElementChild)&&G(/<[/\w!]/g,e.innerHTML)&&G(/<[/\w!]/g,e.textContent))return yt(e),!0;if(e.nodeType===Ne)return yt(e),!0;if(qe&&e.nodeType===Ee&&G(/<[/\w]/g,e.data))return yt(e),!0;if(!ge[r]||_e[r]){if(!_e[r]&&kt(r)){if(ve.tagNameCheck instanceof RegExp&&G(ve.tagNameCheck,r))return!1;if(ve.tagNameCheck instanceof Function&&ve.tagNameCheck(r))return!1}if(We&&!$e[r]){const t=w(e)||e.parentNode,n=y(e)||e.childNodes;if(n&&t){for(let r=n.length-1;r>=0;--r){const o=h(n[r],!0);o.__removalCount=(e.__removalCount||0)+1,t.insertBefore(o,x(e))}}}return yt(e),!0}return e instanceof l&&!function(e){let t=w(e);t&&t.tagName||(t={namespaceURI:rt,tagName:"template"});const n=B(e.tagName),r=B(t.tagName);return!!it[e.namespaceURI]&&(e.namespaceURI===tt?t.namespaceURI===nt?"svg"===n:t.namespaceURI===et?"svg"===n&&("annotation-xml"===r||st[r]):Boolean(bt[n]):e.namespaceURI===et?t.namespaceURI===nt?"math"===n:t.namespaceURI===tt?"math"===n&&ct[r]:Boolean(xt[n]):e.namespaceURI===nt?!(t.namespaceURI===tt&&!ct[r])&&!(t.namespaceURI===et&&!st[r])&&!xt[n]&&(lt[n]||!bt[n]):!("application/xhtml+xml"!==ut||!it[e.namespaceURI]))}(e)?(yt(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!G(/<\/no(script|embed|frames)/i,e.innerHTML)?(Le&&e.nodeType===Ae&&(t=e.textContent,L([I,z,j],(e=>{t=Q(t,e," ")})),e.textContent!==t&&(P(n.removed,{element:e.cloneNode()}),e.textContent=t)),Nt(_.afterSanitizeElements,e,null),!1):(yt(e),!0)},Ot=function(e,t,n){if(Qe&&("id"===t||"name"===t)&&(n in r||n in mt))return!1;if(Re&&!Ce[t]&&G(X,t));else if(Ie&&G(K,t));else if(!xe[t]||Ce[t]){if(!(kt(e)&&(ve.tagNameCheck instanceof RegExp&&G(ve.tagNameCheck,e)||ve.tagNameCheck instanceof Function&&ve.tagNameCheck(e))&&(ve.attributeNameCheck instanceof RegExp&&G(ve.attributeNameCheck,t)||ve.attributeNameCheck instanceof Function&&ve.attributeNameCheck(t))||"is"===t&&ve.allowCustomizedBuiltInElements&&(ve.tagNameCheck instanceof RegExp&&G(ve.tagNameCheck,n)||ve.tagNameCheck instanceof Function&&ve.tagNameCheck(n))))return!1}else if(Ze[t]);else if(G(me,Q(n,pe,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==H(n,"data:")||!Ke[e]){if(ze&&!G(Z,Q(n,pe,"")));else if(n)return!1}else;return!0},kt=function(e){return"annotation-xml"!==e&&U(e,fe)},_t=function(e){Nt(_.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||St(e))return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:xe,forceKeepAttr:void 0};let o=t.length;for(;o--;){const i=t[o],{name:a,namespaceURI:s,value:c}=i,l=pt(a),u=c;let d="value"===a?u:W(u);if(r.attrName=l,r.attrValue=d,r.keepAttr=!0,r.forceKeepAttr=void 0,Nt(_.uponSanitizeAttribute,e,r),d=r.attrValue,!He||"id"!==l&&"name"!==l||(wt(a,e),d="user-content-"+d),qe&&G(/((--!?|])>)|<\/(style|title)/i,d)){wt(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){wt(a,e);continue}if(!je&&G(/\/>/i,d)){wt(a,e);continue}Le&&L([I,z,j],(e=>{d=Q(d,e," ")}));const p=pt(e.nodeName);if(Ot(p,l,d)){if(v&&"object"==typeof m&&"function"==typeof m.getAttributeType)if(s);else switch(m.getAttributeType(p,l)){case"TrustedHTML":d=v.createHTML(d);break;case"TrustedScriptURL":d=v.createScriptURL(d)}if(d!==u)try{s?e.setAttributeNS(s,a,d):e.setAttribute(a,d),St(e)?yt(e):D(n.removed)}catch(t){wt(a,e)}}else wt(a,e)}Nt(_.afterSanitizeAttributes,e,null)},Ct=function e(t){let n=null;const r=Tt(t);for(Nt(_.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)Nt(_.uponSanitizeShadowNode,n,null),Et(n),_t(n),n.content instanceof a&&e(n.content);Nt(_.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,s=null,l=null;if(ot=!e,ot&&(e="\x3c!--\x3e"),"string"!=typeof e&&!At(e)){if("function"!=typeof e.toString)throw $("toString is not a function");if("string"!=typeof(e=e.toString()))throw $("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Pe||ht(t),n.removed=[],"string"==typeof e&&(Ye=!1),Ye){if(e.nodeName){const t=pt(e.nodeName);if(!ge[t]||_e[t])throw $("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof c)r=vt("\x3c!----\x3e"),i=r.ownerDocument.importNode(e,!0),i.nodeType===Se&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i);else{if(!Be&&!Le&&!De&&-1===e.indexOf("<"))return v&&Ue?v.createHTML(e):e;if(r=vt(e),!r)return Be?null:Ue?T:""}r&&Me&&yt(r.firstChild);const u=Tt(Ye?e:r);for(;s=u.nextNode();)Et(s),_t(s),s.content instanceof a&&Ct(s.content);if(Ye)return e;if(Be){if(Fe)for(l=E.call(r.ownerDocument);r.firstChild;)l.appendChild(r.firstChild);else l=r;return(xe.shadowroot||xe.shadowrootmode)&&(l=k.call(o,l,!0)),l}let d=De?r.outerHTML:r.innerHTML;return De&&ge["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&G(we,r.ownerDocument.doctype.name)&&(d="\n"+d),Le&&L([I,z,j],(e=>{d=Q(d,e," ")})),v&&Ue?v.createHTML(d):d},n.setConfig=function(){ht(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Pe=!0},n.clearConfig=function(){ft=null,Pe=!1},n.isValidAttribute=function(e,t,n){ft||ht({});const r=pt(e),o=pt(t);return Ot(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&P(_[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=q(_[e],t);return-1===n?void 0:M(_[e],n,1)[0]}return D(_[e])},n.removeHooks=function(e){_[e]=[]},n.removeAllHooks=function(){_={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}(),Ce=function(e){return{__html:A((0,_e.sanitize)(e))}},Ie=function(e,t,n,r,o){var i=o.userInput,a=o.currentQuestionIndex,l=o.setButtons,p=o.setShowNextQuestionButton,f=o.incorrect,m=o.correct,g=o.setCorrect,h=o.setIncorrect,b=o.setUserInput,x=Object.keys(r).map((function(){return{selected:!1}})),y=u(i);if("single"===n)t=Number(t),y[a]=e,e===t?(m.indexOf(a)<0&&m.push(a),f.indexOf(a)>=0&&f.splice(f.indexOf(a),1)):(f.indexOf(a)<0&&f.push(a),m.indexOf(a)>=0&&m.splice(m.indexOf(a),1)),g(m),h(f),l((function(t){return s(s(s({},t),x),{},c({},e-1,{className:"selected"}))})),p(!0);else{if(void 0===y[a]&&(y[a]=[]),y[a].includes(e)?y[a].splice(y[a].indexOf(e),1):y[a].push(e),y[a].length===t.length){var w,v=!0,T=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=d(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(i[a]);try{for(T.s();!(w=T.n()).done;){var S=w.value;if(!t.includes(S)){v=!1,f.indexOf(a)<0&&f.push(a),m.indexOf(a)>=0&&m.splice(m.indexOf(a),1);break}}}catch(e){T.e(e)}finally{T.f()}v&&(m.indexOf(a)<0&&m.push(a),f.indexOf(a)>=0&&f.splice(f.indexOf(a),1))}else f.indexOf(a)<0&&f.push(a),m.indexOf(a)>=0&&m.splice(m.indexOf(a),1);g(m),h(f),l((function(t){return s(s({},t),{},c({},e-1,{className:y[a].includes(e)?"selected":void 0}))})),y[a].length>0&&p(!0)}b(y)};function Re(e){var t=e.question,n=e.isResultPage,r=t.explanation;return r?n?x.jsx("div",{className:"explanation",children:r}):x.jsxs("div",{children:[x.jsx("br",{}),r]}):null}var ze=function(e){return e.messageForCorrectAnswer||"You are correct. Please click Next to continue."},je=function(e){return e.messageForIncorrectAnswer||"Incorrect answer. Please try again."};function Le(e){var t=e.showInstantFeedback,n=e.incorrectAnswer,o=e.correctAnswer,i=e.question,a=e.onQuestionSubmit,s=e.userAnswer;return r((function(){a&&(o||n)&&a({question:i,userAnswer:s,isCorrect:o})}),[o,n]),x.jsxs(x.Fragment,{children:[n&&t&&x.jsx("div",{className:"alert incorrect",children:je(i)}),o&&t&&x.jsxs("div",{className:"alert correct",children:[ze(i),x.jsx(Re,{question:i,isResultPage:!1})]})]})}function qe(e){var n=e.questions,a=e.appLocale,d=e.showDefaultResult,p=e.onComplete,m=e.customResultPage,g=e.showInstantFeedback,h=e.continueTillCorrect,b=e.revealAnswerOnSubmit,v=e.allowNavigation,T=e.onQuestionSubmit,S=e.timer,A=e.allowPauseTimer,N=e.enableProgressBar,E=e.progressBarColor,O=l(t(!1),2),k=O[0],_=O[1],C=l(t(!1),2),I=C[0],R=C[1],z=l(t(!1),2),j=z[0],L=z[1],q=l(t(!1),2),D=q[0],P=q[1],M=l(t(0),2),B=M[0],F=M[1],U=l(t({}),2),Q=U[0],H=U[1],W=l(t([]),2),Y=W[0],G=W[1],$=l(t([]),2),X=$[0],K=$[1],V=l(t([]),2),Z=V[0],J=V[1],ee=l(t([]),2),te=ee[0],ne=ee[1],re=l(t("all"),2),oe=re[0],ie=re[1],ae=l(t(1),2),se=ae[0],ce=ae[1],le=l(t(!0),2),ue=le[0],de=le[1],pe=l(t(void 0),2),fe=pe[0],me=pe[1],ge=l(t(0),2),he=ge[0],be=ge[1],xe=l(t(0),2),ye=xe[0],we=xe[1],ve=l(t(n[B]),2),Te=ve[0],Se=ve[1],Ae=l(t(void 0),2),Ne=Ae[0],Ee=Ae[1],Oe=l(t(S),2),ke=Oe[0],_e=Oe[1],ze=l(t(!0),2),je=ze[0],qe=ze[1],De=l(t(!1),2),Pe=De[0],Me=De[1];r((function(){de(void 0===d||d)}),[d]),r((function(){Se(n[B])}),[B,n]),r((function(){var e=Te.answerSelectionType;me(e||"single")}),[Te,B]),r((function(){if(D){qe(!1);for(var e=0,t=0,r=0;r",t)}),n&&x.jsx("span",{className:"selection-tag segment",children:n})]})},He=o((function(){var e,t;if("all"!==oe){var r=Z;"correct"===oe?r=Y:"incorrect"===oe&&(r=X),e=n.filter((function(e,t){return-1!==r.indexOf(t)})),t=te.filter((function(e,t){return-1!==r.indexOf(t)}))}return(e||n).map((function(e,n){var r=t?t[n]:te[n],o=e.answerSelectionType||"single";return x.jsxs("div",{className:"result-answer-wrapper",children:[x.jsx("h3",{dangerouslySetInnerHTML:Ce("Q".concat(e.questionIndex,": ").concat(e.question," ").concat(a.marksOfQuestion.replace("",e.point)))}),e.questionPic&&x.jsx("img",{src:e.questionPic,alt:"question"}),Qe(o,e.correctAnswer.length,e.segment),x.jsx("div",{className:"result-answer",children:Ue(e,r)}),x.jsx(Re,{question:e,isResultPage:!0})]},f())}))}),[D,oe]);r((function(){var e;return S&&je&&ke>0&&(e=setInterval((function(){_e((function(e){return e-1}))}),1e3)),function(){return S&&clearInterval(e)}}),[je,ke,S]);var We,Ye,Ge,$e,Xe,Ke,Ve,Ze,Je,et,tt=function(e){return e<10?"0":""},nt=function(e){var t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=e%60;return"".concat(tt(t)).concat(t,":").concat(tt(n)).concat(n,":").concat(tt(r)).concat(r)},rt=function(){qe(!1),P(!0),n.forEach((function(e,t){void 0===te[t]&&J((function(e){return[].concat(u(e),[t])}))}))};return x.jsxs("div",{className:"questionWrapper",children:[N&&x.jsxs(x.Fragment,{children:[x.jsx("div",{style:{display:"flex",width:"100%"},children:x.jsx(y,{progress:B+1,quizLength:n.length,isEndQuiz:D,progressBarColor:E})}),x.jsx("br",{})]}),S&&!je&&x.jsxs("div",{children:[a.timerTimeTaken,":"," ",x.jsx("b",{children:nt(S-ke)})]}),S&&je&&x.jsxs("div",{children:[a.timerTimeRemaining,": ",x.jsx("b",{children:nt(ke)})]}),S&&0===ke&&je&&rt(),!D&&x.jsxs("div",{className:"questionWrapperBody",children:[x.jsxs("div",{children:["".concat(a.question," ").concat(B+1," / ").concat(n.length,":"),x.jsx("br",{}),S&&A&&x.jsx("button",{type:"button",className:"timerBtn",onClick:function(){qe(!je)},children:je?a.pauseScreenPause:a.pauseScreenResume})]}),je?x.jsxs(x.Fragment,{children:[x.jsx("h3",{dangerouslySetInnerHTML:Ce("".concat(Te&&Te.question," ").concat(a.marksOfQuestion.replace("",Te.point)))}),Te&&Te.questionPic&&x.jsx("img",{src:Te.questionPic,alt:"question"}),Te&&Qe(fe,Te.correctAnswer.length,Te.segment),x.jsx("div",{className:"questionModal",children:x.jsx(Le,{question:Te,showInstantFeedback:g,correctAnswer:I,incorrectAnswer:k,onQuestionSubmit:T,userAnswer:u(te).pop()})}),Te&&(We=Te,Ye=Q,Ge=We.answers,$e=We.correctAnswer,Xe=We.questionType,Ke=We.questionIndex,Ve=We.answerSelectionType,Ze=function(e){return function(e,t,n,r,o){var i=o.userInput,a=o.userAttempt,l=o.currentQuestionIndex,d=o.continueTillCorrect,p=o.showNextQuestionButton,f=o.incorrect,m=o.correct,g=o.setButtons,h=o.setIsCorrect,b=o.setIncorrectAnswer,x=o.setCorrect,y=o.setIncorrect,w=o.setShowNextQuestionButton,v=o.setUserInput,T=o.setUserAttempt,S="".concat(e),A=Object.keys(r).map((function(){return{disabled:!0}})),N=u(i);if("single"===n)void 0===N[l]&&(N[l]=e),S===t?(f.indexOf(l)<0&&m.indexOf(l)<0&&m.push(l),g((function(n){return s(s(s({},n),A),{},c({},e-1,{className:S===t?"correct":"incorrect"}))})),h(!0),b(!1),x(m),w(!0)):(m.indexOf(l)<0&&f.indexOf(l)<0&&f.push(l),d?g((function(t){return s(s({},t),{},c({},e-1,{disabled:!t[e-1]}))})):(g((function(n){return s(s(s({},n),A),{},c({},e-1,{className:S===t?"correct":"incorrect"}))})),w(!0)),b(!0),h(!1),y(f));else{var E=t.length;if(void 0===N[l]&&(N[l]=[]),N[l].length0&&x.jsx("button",{onClick:function(){return Be(B-2)},className:"prevQuestionBtn btn",type:"button",children:a.prevQuestionBtn}),x.jsx("button",{onClick:function(){return Be(B)},className:"nextQuestionBtn btn",type:"button",children:a.nextQuestionBtn})]}),!D&&je&&x.jsx("div",{className:"quitQuizBtnContainer",children:x.jsx("button",{onClick:function(){return Me(!0)},className:"quitQuizBtn",type:"button",children:a.quitQuizBtn||"Submit and Quit"})})]}):x.jsxs("span",{className:"timerPauseScreen dark:text-white text-black",children:[x.jsx("br",{}),x.jsx("br",{}),a.pauseScreenDisplay]})]}),D&&ue&&void 0===m&&x.jsxs("div",{className:"card-body",children:[x.jsx("h2",{children:a.resultPageHeaderText.replace("",Y.length).replace("",n.length)}),x.jsx("h2",{children:a.resultPagePoint.replace("",ye).replace("",he)}),x.jsx("br",{}),x.jsx(w,{filteredValue:oe,handleChange:Fe,appLocale:a}),He()]}),D&&!ue&&void 0!==m&&m(Ne),Pe&&x.jsx("div",{className:"quit-confirm-modal",children:x.jsxs("div",{className:"modal-content",children:[x.jsx("p",{children:a.quitConfirmationText||"Are you sure you want to quit the quiz? Your progress will be saved."}),x.jsxs("div",{className:"modal-buttons",children:[x.jsx("button",{className:"confirm-quit-btn btn",onClick:function(){Me(!1),rt()},children:a.confirmQuitText||"Yes, Quit"}),x.jsx("button",{className:"cancel-quit-btn btn",onClick:function(){return Me(!1)},children:a.cancelQuitText||"Cancel"})]})]})})]})}var De={landingHeaderText:" Questions",question:"Question",startQuizBtn:"Start Quiz",resultFilterAll:"All",resultFilterCorrect:"Correct",resultFilterIncorrect:"Incorrect",resultFilterUnanswered:"Unanswered",nextQuestionBtn:"Next",prevQuestionBtn:"Prev",resultPageHeaderText:"You have completed the quiz. You got out of questions.",resultPagePoint:"You scored out of .",pauseScreenDisplay:"Test is paused. Clicked the Resume button to continue",timerTimeRemaining:"Time Remaining",timerTimeTaken:"Time Taken",pauseScreenPause:"Pause",pauseScreenResume:"Resume",singleSelectionTagText:"Single Selection",multipleSelectionTagText:"Multiple Selection",pickNumberOfSelection:"Pick ",marksOfQuestion:"( marks)"};function Pe(e){var n=e.quiz,i=e.shuffle,a=e.shuffleAnswer,c=e.showDefaultResult,u=e.onComplete,d=e.customResultPage,p=e.showInstantFeedback,f=e.continueTillCorrect,m=e.revealAnswerOnSubmit,g=e.allowNavigation,h=e.onQuestionSubmit,b=e.disableSynopsis,y=e.timer,w=e.allowPauseTimer,v=e.enableProgressBar,T=l(t(!1),2),S=T[0],A=T[1],N=l(t(n.questions),2),E=N[0],O=N[1],k=n.nrOfQuestions&&n.nrOfQuestions0;t-=1){var n=Math.floor(Math.random()*(t+1)),r=[e[n],e[t]];e[t]=r[0],e[n]=r[1]}return e}),[]);r((function(){b&&A(!0)}),[]),r((function(){var e=n.questions;i&&(e=_(e)),a&&(e=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((function(e){var t,n=(null===(t=e.answers)||void 0===t?void 0:t.map((function(e,t){return[e,t]}))).sort((function(){return Math.random()-.5})),r=n.map((function(e){return e[0]}));if("single"===e.answerSelectionType){var o=e.correctAnswer,i=n.findIndex((function(e){return"".concat(e[1]+1)==="".concat(o)}))+1;return s(s({},e),{},{correctAnswer:"".concat(i),answers:r})}if("multiple"===e.answerSelectionType){var a=e.correctAnswer.map((function(e){return n.findIndex((function(t){return"".concat(t[1]+1)==="".concat(e)}))+1}));return s(s({},e),{},{correctAnswer:a,answers:r})}return e}))}(e)),e.length=k,e=e.map((function(e,t){return s(s({},e),{},{questionIndex:t+1})})),O(e)}),[S]);if(!function(e){if(!e)return console.error("Quiz object is required."),!1;if(y&&"number"!=typeof y||y<1)return console.error(y&&"number"!=typeof y?"timer must be a number":"timer must be a number greater than 0"),!1;if(w&&"boolean"!=typeof w)return console.error("allowPauseTimer must be a Boolean"),!1;if(v&&"boolean"!=typeof v)return console.error("enableProgressBar must be a Boolean"),!1;if("progressBarColor"in n){if("string"!=typeof n.progressBarColor)return console.error("progressBarColor must be a String"),!1;if(t=n.progressBarColor,!/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/.test(t))return console.error("progressBarColor must be a valid hex colour"),!1}for(var t,r=0;r",k)}),n.quizSynopsis&&x.jsx("div",{className:"quiz-synopsis",children:n.quizSynopsis}),x.jsx("div",{className:"startQuizWrapper",children:x.jsx("button",{type:"button",onClick:function(){return A(!0)},className:"startQuizBtn btn",children:C.startQuizBtn})})]}),S&&x.jsx(qe,{questions:E,showDefaultResult:c,onComplete:u,customResultPage:d,showInstantFeedback:p,continueTillCorrect:f,revealAnswerOnSubmit:m,allowNavigation:g,appLocale:C,onQuestionSubmit:h,timer:y,allowPauseTimer:w,enableProgressBar:v,progressBarColor:n.progressBarColor})]})}!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}('.react-quiz-container{margin:20px;max-width:500px}.react-quiz-container .startQuizWrapper{margin-top:10px}.react-quiz-container .btn{background-image:none;border:1px solid transparent;cursor:pointer;font-weight:600;margin-bottom:0;padding:11px 12px;text-align:center;touch-action:manipulation;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;white-space:nowrap}.react-quiz-container .questionWrapper .btn{border:1px solid #e8e8e8;border-radius:4px;display:block;font-size:15px;margin-bottom:10px;margin-top:10px;text-align:unset;white-space:normal}.react-quiz-container .questionWrapper .btn.correct,.timerBtn{background:green;color:#fff}.timerBtn{border:0!important;border-radius:10px;cursor:pointer;float:right;padding:5px;position:relative;top:-35px;width:80px}.timerPauseScreen{font-size:30px}.react-quiz-container .questionModal .alert{border:1px solid transparent;border-radius:2px;color:#fff;margin-bottom:21px;padding:20px}.react-quiz-container .correct{background:green}.react-quiz-container .incorrect{background:red;color:#fff}.react-quiz-container .submitQuizBtn{border:"none";border-radius:"4px";cursor:"pointer";margin-top:"10px";padding:"10px 20px"}.react-quiz-container .unanswered{background:grey;color:#fff}.react-quiz-container .answerBtn,.react-quiz-container .questionWrapper img{width:100%}.react-quiz-container .selected{background:#007bff;color:#fff}.react-quiz-container .startQuizWrapper .startQuizBtn{background-color:#fff;border:1px solid #d9d9d9;border-radius:2px;color:rgba(0,0,0,.65);font-size:15px;line-height:1.35135}.react-quiz-container .result-answer-wrapper{border:1px solid #e8e8e8;border-bottom-left-radius:5px;border-bottom-right-radius:5px;margin-bottom:20px}.react-quiz-container .result-answer-wrapper h3{background-color:#fafafa;border-top-left-radius:5px;border-top-right-radius:5px;color:rgba(0,0,0,.9);margin:0;opacity:.8;padding:10px}.react-quiz-container .result-answer-wrapper .explanation{border:1px solid #e8e8e8;margin:0 20px 20px;padding:20px}.react-quiz-container .result-answer-wrapper .tag-container{margin:20px}.react-quiz-container .result-answer{padding:0 20px}.react-quiz-container .quiz-synopsis{margin:15px 0}.react-quiz-container .tag-container{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:20px;margin-top:20px}.react-quiz-container .number-of-selection,.react-quiz-container .selection-tag{border-radius:5px;color:#fff;padding:7px}.react-quiz-container .number-of-selection{background:#673ab7;margin-left:5px}.react-quiz-container .selection-tag.single{background:#3f51b5}.react-quiz-container .selection-tag.multiple{background:#ff9800}.react-quiz-container .selection-tag.segment{background:#3db4b9;margin-left:5px}.react-quiz-container .questionBtnContainer{display:flex;justify-content:space-between}.react-quiz-container .quiz-result-filter{bottom:15px;position:relative;width:120px;.filter-dropdown-select{background-color:#fcfcfc;border:2px solid #c2c5c7;border-radius:7px;bottom:10px;color:#333;cursor:pointer;font-size:16px;margin-top:2px;padding:8px;position:relative;text-transform:capitalize}.filter-dropdown-select:after{color:#a5a5a5;content:"▼";font-size:11px;position:absolute;right:10px;top:57%;transform:translateY(-50%);transition:all .3s ease}.filter-dropdown-select:hover{border:2px solid #51aae6;box-shadow:0 0 6px rgba(109,179,250,.5)}.dropdown-options{background-color:#fcfcfc;border-radius:10px;box-shadow:0 0 10px hsla(210,2%,56%,.5);left:0;list-style:none;margin:0;padding:0;position:absolute;top:85%;width:100%;z-index:1}.filter-dropdown-select.open{border:2px solid #51aae6;box-shadow:0 0 6px rgba(109,179,250,.5)}.dropdown-options .dropdown-options-item{cursor:pointer;font-size:16px;padding:10px}.dropdown-options .dropdown-options-item:hover{background-color:hsla(0,0%,89%,.852);border-radius:5px}.dropdown-options .dropdown-options-item:focus{background-color:#d7f1f9;font-weight:700}.filter-dropdown-select .selected-option.selected-open{color:#c6c2c2;font-weight:lighter}.filter-dropdown-select .selected-option{bottom:2px;font-size:16px;position:relative}.filter-dropdown-select:focus+.dropdown-options{max-height:200px}.dropdown-options .dropdown-options-item.selected{background-color:#d7f1f9;color:#333;font-weight:700}.dropdown-options.open{max-height:200px}}.quit-confirm-modal{align-items:center;background:rgba(0,0,0,.5);bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0;z-index:1000}.modal-content{background:#fff;border-radius:8px;max-width:400px;padding:2rem;width:90%}.modal-buttons{display:flex;justify-content:space-between;margin-top:1rem}.questionBtnContainer .nextQuestionBtn{background-color:#3f51b5;color:#fff}.quitQuizBtnContainer{display:flex;justify-content:center}.quitQuizBtn{background-color:#fff;border:1px solid #d9d9d9;border-radius:4px;color:#7b7a7a;cursor:pointer;font-size:10px;font-weight:600;margin-top:24px;padding:8px 12px}.quitQuizBtn:hover{color:#d9d9d9}.confirm-quit-btn{background-color:#f44336;color:#fff}.cancel-quit-btn{background-color:#e0e0e0}');export{Pe as default}; diff --git a/dist/index.js b/dist/index.js index 01ab5425..1dea3322 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,2 +1,2 @@ -"use strict";var e=require("react");function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function n(e){for(var n=1;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};var l,u,d={exports:{}},p={};var f=(u||(u=1,d.exports=function(){if(l)return p;l=1;var t=e,n=Symbol.for("react.element"),r=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in void 0!==r&&(l=""+r),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(u=t.ref),t)o.call(t,s)&&!a.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps)void 0===c[s]&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:i.current}}return p.Fragment=r,p.jsx=s,p.jsxs=s,p}()),d.exports);function m(e){var t=e.progressBarColor,n=void 0===t?"#9de1f6":t,r=e.progress,o=e.height,i=void 0===o?"25px":o,a=e.quizLength,s=e.isEndQuiz,c=r-1,l=100/a,u={width:"100%",backgroundColor:"#D0D4CA",height:i,borderRadius:40,position:"relative",overflow:"hidden"},d={width:s?"100%":"".concat(l*c,"%"),height:"100%",backgroundColor:n,transition:"width 0.3s ease"};return f.jsxs("div",{style:u,children:[f.jsx("div",{style:d}),f.jsx("span",{style:{position:"absolute",left:"50%",top:"50%",transform:"translateX(-50%) translateY(-50%)",lineHeigth:"20px",fontSize:"16px",color:"#000",fontWeight:"bold",backgroundColor:"transparent"},children:s?"100%":"".concat(Math.round(l*c),"%")})]})}function g(t){var n=t.filteredValue,r=t.handleChange,i=t.appLocale,a=o(e.useState(!1),2),s=a[0],c=a[1],l=e.useRef(null),u=function(){c(!s)},d=function(e){r({target:{value:e}}),c(!1)},p=s?"selected-open":"",m={all:i.resultFilterAll,correct:i.resultFilterCorrect,incorrect:i.resultFilterIncorrect,unanswered:i.resultFilterUnanswered};return e.useEffect((function(){var e=function(e){s&&l.current&&!l.current.contains(e.target)&&c(!1)};return document.addEventListener("click",e),function(){document.removeEventListener("click",e)}}),[s]),f.jsxs("div",{className:"quiz-result-filter",children:[f.jsxs("div",{ref:l,className:"filter-dropdown-select ".concat(s?"open":""),onClick:u,onKeyDown:function(e){"Enter"===e.key&&u()},role:"button",tabIndex:0,children:[f.jsx("div",{className:"selected-option ".concat(p),children:m[n]}),f.jsx("span",{className:"arrow ".concat(s?"up":"down")})]}),s&&f.jsxs("div",{className:"dropdown-options",role:"menu","aria-labelledby":"quiz-filter",children:[f.jsx("div",{className:"dropdown-options-item ".concat("all"===n?"selected":""),onClick:function(){return d("all")},onKeyDown:function(e){"Enter"===e.key&&d("all")},role:"menuitem",tabIndex:0,children:i.resultFilterAll}),f.jsx("div",{className:"dropdown-options-item ".concat("correct"===n?"selected":""),onClick:function(){return d("correct")},onKeyDown:function(e){"Enter"===e.key&&d("correct")},role:"menuitem",tabIndex:0,children:i.resultFilterCorrect}),f.jsx("div",{className:"dropdown-options-item ".concat("incorrect"===n?"selected":""),onClick:function(){return d("incorrect")},onKeyDown:function(e){"Enter"===e.key&&d("incorrect")},role:"menuitem",tabIndex:0,children:i.resultFilterIncorrect}),f.jsx("div",{className:"dropdown-options-item ".concat("unanswered"===n?"selected":""),onClick:function(){return d("unanswered")},onKeyDown:function(e){"Enter"===e.key&&d("unanswered")},role:"menuitem",tabIndex:0,children:i.resultFilterUnanswered})]})]})}var h={"":["",""],_:["",""],"*":["",""],"~":["",""],"\n":["
    "]," ":["
    "],"-":["
    "]};function b(e){return e.replace(RegExp("^"+(e.match(/^(\t| )+/)||"")[0],"gm"),"")}function x(e){return(e+"").replace(/"/g,""").replace(//g,">")}function y(e,t){var n,r,o,i,a,s=/((?:^|\n+)(?:\n---+|\* \*(?: \*)+)\n)|(?:^``` *(\w*)\n([\s\S]*?)\n```$)|((?:(?:^|\n+)(?:\t| {2,}).+)+\n*)|((?:(?:^|\n)([>*+-]|\d+\.)\s+.*)+)|(?:!\[([^\]]*?)\]\(([^)]+?)\))|(\[)|(\](?:\(([^)]+?)\))?)|(?:(?:^|\n+)([^\s].*)\n(-{3,}|={3,})(?:\n+|$))|(?:(?:^|\n+)(#{1,6})\s*(.+)(?:\n+|$))|(?:`([^`].*?)`)|( \n\n*|\n{2,}|__|\*\*|[_*]|~~)/gm,c=[],l="",u=t||{},d=0;function p(e){var t=h[e[1]||""],n=c[c.length-1]==e;return t?t[1]?(n?c.pop():c.push(e),t[0|n]):t[0]:e}function f(){for(var e="";c.length;)e+=p(c[c.length-1]);return e}for(e=e.replace(/^\[(.+?)\]:\s*(.+)$/gm,(function(e,t,n){return u[t.toLowerCase()]=n,""})).replace(/^\n+|\n+$/g,"");o=s.exec(e);)r=e.substring(d,o.index),d=s.lastIndex,n=o[0],r.match(/[^\\](\\\\)*\\$/)||((a=o[3]||o[4])?n='
    "+b(x(a).replace(/^\n+|\n+$/g,""))+"
    ":(a=o[6])?(a.match(/\./)&&(o[5]=o[5].replace(/^\d+/gm,"")),i=y(b(o[5].replace(/^\s*[>*+.-]/gm,""))),">"==a?a="blockquote":(a=a.match(/\./)?"ol":"ul",i=i.replace(/^(.*)(\n|$)/gm,"
  • $1
  • ")),n="<"+a+">"+i+""):o[8]?n=''+x(o[7])+'':o[10]?(l=l.replace("
    ",''),n=f()+""):o[9]?n="":o[12]||o[14]?n="<"+(a="h"+(o[14]?o[14].length:o[13]>"="?1:2))+">"+y(o[12]||o[15],u)+"":o[16]?n=""+x(o[16])+"":(o[17]||o[1])&&(n=p(o[17]||"--"))),l+=r,l+=n;return(l+e.substring(d)+f()).replace(/^\n+|\n+$/g,"")} -/*! @license DOMPurify 3.2.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.3/LICENSE */const{entries:w,setPrototypeOf:v,isFrozen:T,getPrototypeOf:S,getOwnPropertyDescriptor:A}=Object;let{freeze:E,seal:N,create:O}=Object,{apply:_,construct:k}="undefined"!=typeof Reflect&&Reflect;E||(E=function(e){return e}),N||(N=function(e){return e}),_||(_=function(e,t,n){return e.apply(t,n)}),k||(k=function(e,t){return new e(...t)});const C=H(Array.prototype.forEach),I=H(Array.prototype.pop),R=H(Array.prototype.push),L=H(String.prototype.toLowerCase),z=H(String.prototype.toString),j=H(String.prototype.match),D=H(String.prototype.replace),P=H(String.prototype.indexOf),q=H(String.prototype.trim),M=H(Object.prototype.hasOwnProperty),B=H(RegExp.prototype.test),F=(U=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n1?n-1:0),o=1;o2&&void 0!==arguments[2]?arguments[2]:L;v&&v(e,null);let r=t.length;for(;r--;){let o=t[r];if("string"==typeof o){const e=n(o);e!==o&&(T(t)||(t[r]=e),o=e)}e[o]=!0}return e}function W(e){for(let t=0;t/gm),se=N(/\$\{[\w\W]*}/gm),ce=N(/^data-[\-\w.\u00B7-\uFFFF]+$/),le=N(/^aria-[\-\w]+$/),ue=N(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),de=N(/^(?:\w+script|data):/i),pe=N(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),fe=N(/^html$/i),me=N(/^[a-z][.\w]*(-[.\w]+)+$/i);var ge=Object.freeze({__proto__:null,ARIA_ATTR:le,ATTR_WHITESPACE:pe,CUSTOM_ELEMENT:me,DATA_ATTR:ce,DOCTYPE_NAME:fe,ERB_EXPR:ae,IS_ALLOWED_URI:ue,IS_SCRIPT_OR_DATA:de,MUSTACHE_EXPR:ie,TMPLIT_EXPR:se});const he=1,be=3,xe=7,ye=8,we=9,ve=function(){return"undefined"==typeof window?null:window};var Te=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ve();const n=t=>e(t);if(n.version="3.2.3",n.removed=[],!t||!t.document||t.document.nodeType!==we)return n.isSupported=!1,n;let{document:r}=t;const o=r,i=o.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:c,Element:l,NodeFilter:u,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:p,DOMParser:f,trustedTypes:m}=t,g=l.prototype,h=G(g,"cloneNode"),b=G(g,"remove"),x=G(g,"nextSibling"),y=G(g,"childNodes"),v=G(g,"parentNode");if("function"==typeof s){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let T,S="";const{implementation:A,createNodeIterator:N,createDocumentFragment:_,getElementsByTagName:k}=r,{importNode:U}=o;let H={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof w&&"function"==typeof v&&A&&void 0!==A.createHTMLDocument;const{MUSTACHE_EXPR:W,ERB_EXPR:ie,TMPLIT_EXPR:ae,DATA_ATTR:se,ARIA_ATTR:ce,IS_SCRIPT_OR_DATA:le,ATTR_WHITESPACE:de,CUSTOM_ELEMENT:pe}=ge;let{IS_ALLOWED_URI:me}=ge,Te=null;const Se=Q({},[...$,...X,...K,...Z,...ee]);let Ae=null;const Ee=Q({},[...te,...ne,...re,...oe]);let Ne=Object.seal(O(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Oe=null,_e=null,ke=!0,Ce=!0,Ie=!1,Re=!0,Le=!1,ze=!0,je=!1,De=!1,Pe=!1,qe=!1,Me=!1,Be=!1,Fe=!0,Ue=!1,He=!0,Qe=!1,We={},Ye=null;const Ge=Q({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let $e=null;const Xe=Q({},["audio","video","img","source","image","track"]);let Ke=null;const Ve=Q({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ze="http://www.w3.org/1998/Math/MathML",Je="http://www.w3.org/2000/svg",et="http://www.w3.org/1999/xhtml";let tt=et,nt=!1,rt=null;const ot=Q({},[Ze,Je,et],z);let it=Q({},["mi","mo","mn","ms","mtext"]),at=Q({},["annotation-xml"]);const st=Q({},["title","style","font","a","script"]);let ct=null;const lt=["application/xhtml+xml","text/html"];let ut=null,dt=null;const pt=r.createElement("form"),ft=function(e){return e instanceof RegExp||e instanceof Function},mt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!dt||dt!==e){if(e&&"object"==typeof e||(e={}),e=Y(e),ct=-1===lt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,ut="application/xhtml+xml"===ct?z:L,Te=M(e,"ALLOWED_TAGS")?Q({},e.ALLOWED_TAGS,ut):Se,Ae=M(e,"ALLOWED_ATTR")?Q({},e.ALLOWED_ATTR,ut):Ee,rt=M(e,"ALLOWED_NAMESPACES")?Q({},e.ALLOWED_NAMESPACES,z):ot,Ke=M(e,"ADD_URI_SAFE_ATTR")?Q(Y(Ve),e.ADD_URI_SAFE_ATTR,ut):Ve,$e=M(e,"ADD_DATA_URI_TAGS")?Q(Y(Xe),e.ADD_DATA_URI_TAGS,ut):Xe,Ye=M(e,"FORBID_CONTENTS")?Q({},e.FORBID_CONTENTS,ut):Ge,Oe=M(e,"FORBID_TAGS")?Q({},e.FORBID_TAGS,ut):{},_e=M(e,"FORBID_ATTR")?Q({},e.FORBID_ATTR,ut):{},We=!!M(e,"USE_PROFILES")&&e.USE_PROFILES,ke=!1!==e.ALLOW_ARIA_ATTR,Ce=!1!==e.ALLOW_DATA_ATTR,Ie=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Re=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Le=e.SAFE_FOR_TEMPLATES||!1,ze=!1!==e.SAFE_FOR_XML,je=e.WHOLE_DOCUMENT||!1,qe=e.RETURN_DOM||!1,Me=e.RETURN_DOM_FRAGMENT||!1,Be=e.RETURN_TRUSTED_TYPE||!1,Pe=e.FORCE_BODY||!1,Fe=!1!==e.SANITIZE_DOM,Ue=e.SANITIZE_NAMED_PROPS||!1,He=!1!==e.KEEP_CONTENT,Qe=e.IN_PLACE||!1,me=e.ALLOWED_URI_REGEXP||ue,tt=e.NAMESPACE||et,it=e.MATHML_TEXT_INTEGRATION_POINTS||it,at=e.HTML_INTEGRATION_POINTS||at,Ne=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ft(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ne.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ft(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ne.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Ne.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Le&&(Ce=!1),Me&&(qe=!0),We&&(Te=Q({},ee),Ae=[],!0===We.html&&(Q(Te,$),Q(Ae,te)),!0===We.svg&&(Q(Te,X),Q(Ae,ne),Q(Ae,oe)),!0===We.svgFilters&&(Q(Te,K),Q(Ae,ne),Q(Ae,oe)),!0===We.mathMl&&(Q(Te,Z),Q(Ae,re),Q(Ae,oe))),e.ADD_TAGS&&(Te===Se&&(Te=Y(Te)),Q(Te,e.ADD_TAGS,ut)),e.ADD_ATTR&&(Ae===Ee&&(Ae=Y(Ae)),Q(Ae,e.ADD_ATTR,ut)),e.ADD_URI_SAFE_ATTR&&Q(Ke,e.ADD_URI_SAFE_ATTR,ut),e.FORBID_CONTENTS&&(Ye===Ge&&(Ye=Y(Ye)),Q(Ye,e.FORBID_CONTENTS,ut)),He&&(Te["#text"]=!0),je&&Q(Te,["html","head","body"]),Te.table&&(Q(Te,["tbody"]),delete Oe.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw F('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw F('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=e.TRUSTED_TYPES_POLICY,S=T.createHTML("")}else void 0===T&&(T=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(m,i)),null!==T&&"string"==typeof S&&(S=T.createHTML(""));E&&E(e),dt=e}},gt=Q({},[...X,...K,...V]),ht=Q({},[...Z,...J]),bt=function(e){R(n.removed,{element:e});try{v(e).removeChild(e)}catch(t){b(e)}},xt=function(e,t){try{R(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){R(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(qe||Me)try{bt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},yt=function(e){let t=null,n=null;if(Pe)e=""+e;else{const t=j(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ct&&tt===et&&(e=''+e+"");const o=T?T.createHTML(e):e;if(tt===et)try{t=(new f).parseFromString(o,ct)}catch(e){}if(!t||!t.documentElement){t=A.createDocument(tt,"template",null);try{t.documentElement.innerHTML=nt?S:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),tt===et?k.call(t,je?"html":"body")[0]:je?t.documentElement:i},wt=function(e){return N.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},vt=function(e){return e instanceof p&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof d)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Tt=function(e){return"function"==typeof c&&e instanceof c};function St(e,t,r){C(e,(e=>{e.call(n,t,r,dt)}))}const At=function(e){let t=null;if(St(H.beforeSanitizeElements,e,null),vt(e))return bt(e),!0;const r=ut(e.nodeName);if(St(H.uponSanitizeElement,e,{tagName:r,allowedTags:Te}),e.hasChildNodes()&&!Tt(e.firstElementChild)&&B(/<[/\w]/g,e.innerHTML)&&B(/<[/\w]/g,e.textContent))return bt(e),!0;if(e.nodeType===xe)return bt(e),!0;if(ze&&e.nodeType===ye&&B(/<[/\w]/g,e.data))return bt(e),!0;if(!Te[r]||Oe[r]){if(!Oe[r]&&Nt(r)){if(Ne.tagNameCheck instanceof RegExp&&B(Ne.tagNameCheck,r))return!1;if(Ne.tagNameCheck instanceof Function&&Ne.tagNameCheck(r))return!1}if(He&&!Ye[r]){const t=v(e)||e.parentNode,n=y(e)||e.childNodes;if(n&&t){for(let r=n.length-1;r>=0;--r){const o=h(n[r],!0);o.__removalCount=(e.__removalCount||0)+1,t.insertBefore(o,x(e))}}}return bt(e),!0}return e instanceof l&&!function(e){let t=v(e);t&&t.tagName||(t={namespaceURI:tt,tagName:"template"});const n=L(e.tagName),r=L(t.tagName);return!!rt[e.namespaceURI]&&(e.namespaceURI===Je?t.namespaceURI===et?"svg"===n:t.namespaceURI===Ze?"svg"===n&&("annotation-xml"===r||it[r]):Boolean(gt[n]):e.namespaceURI===Ze?t.namespaceURI===et?"math"===n:t.namespaceURI===Je?"math"===n&&at[r]:Boolean(ht[n]):e.namespaceURI===et?!(t.namespaceURI===Je&&!at[r])&&!(t.namespaceURI===Ze&&!it[r])&&!ht[n]&&(st[n]||!gt[n]):!("application/xhtml+xml"!==ct||!rt[e.namespaceURI]))}(e)?(bt(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!B(/<\/no(script|embed|frames)/i,e.innerHTML)?(Le&&e.nodeType===be&&(t=e.textContent,C([W,ie,ae],(e=>{t=D(t,e," ")})),e.textContent!==t&&(R(n.removed,{element:e.cloneNode()}),e.textContent=t)),St(H.afterSanitizeElements,e,null),!1):(bt(e),!0)},Et=function(e,t,n){if(Fe&&("id"===t||"name"===t)&&(n in r||n in pt))return!1;if(Ce&&!_e[t]&&B(se,t));else if(ke&&B(ce,t));else if(!Ae[t]||_e[t]){if(!(Nt(e)&&(Ne.tagNameCheck instanceof RegExp&&B(Ne.tagNameCheck,e)||Ne.tagNameCheck instanceof Function&&Ne.tagNameCheck(e))&&(Ne.attributeNameCheck instanceof RegExp&&B(Ne.attributeNameCheck,t)||Ne.attributeNameCheck instanceof Function&&Ne.attributeNameCheck(t))||"is"===t&&Ne.allowCustomizedBuiltInElements&&(Ne.tagNameCheck instanceof RegExp&&B(Ne.tagNameCheck,n)||Ne.tagNameCheck instanceof Function&&Ne.tagNameCheck(n))))return!1}else if(Ke[t]);else if(B(me,D(n,de,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==P(n,"data:")||!$e[e]){if(Ie&&!B(le,D(n,de,"")));else if(n)return!1}else;return!0},Nt=function(e){return"annotation-xml"!==e&&j(e,pe)},Ot=function(e){St(H.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||vt(e))return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ae,forceKeepAttr:void 0};let o=t.length;for(;o--;){const i=t[o],{name:a,namespaceURI:s,value:c}=i,l=ut(a);let u="value"===a?c:q(c);if(r.attrName=l,r.attrValue=u,r.keepAttr=!0,r.forceKeepAttr=void 0,St(H.uponSanitizeAttribute,e,r),u=r.attrValue,!Ue||"id"!==l&&"name"!==l||(xt(a,e),u="user-content-"+u),ze&&B(/((--!?|])>)|<\/(style|title)/i,u)){xt(a,e);continue}if(r.forceKeepAttr)continue;if(xt(a,e),!r.keepAttr)continue;if(!Re&&B(/\/>/i,u)){xt(a,e);continue}Le&&C([W,ie,ae],(e=>{u=D(u,e," ")}));const d=ut(e.nodeName);if(Et(d,l,u)){if(T&&"object"==typeof m&&"function"==typeof m.getAttributeType)if(s);else switch(m.getAttributeType(d,l)){case"TrustedHTML":u=T.createHTML(u);break;case"TrustedScriptURL":u=T.createScriptURL(u)}try{s?e.setAttributeNS(s,a,u):e.setAttribute(a,u),vt(e)?bt(e):I(n.removed)}catch(e){}}}St(H.afterSanitizeAttributes,e,null)},_t=function e(t){let n=null;const r=wt(t);for(St(H.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)St(H.uponSanitizeShadowNode,n,null),At(n),Ot(n),n.content instanceof a&&e(n.content);St(H.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,s=null,l=null;if(nt=!e,nt&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Tt(e)){if("function"!=typeof e.toString)throw F("toString is not a function");if("string"!=typeof(e=e.toString()))throw F("dirty is not a string, aborting")}if(!n.isSupported)return e;if(De||mt(t),n.removed=[],"string"==typeof e&&(Qe=!1),Qe){if(e.nodeName){const t=ut(e.nodeName);if(!Te[t]||Oe[t])throw F("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof c)r=yt("\x3c!----\x3e"),i=r.ownerDocument.importNode(e,!0),i.nodeType===he&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i);else{if(!qe&&!Le&&!je&&-1===e.indexOf("<"))return T&&Be?T.createHTML(e):e;if(r=yt(e),!r)return qe?null:Be?S:""}r&&Pe&&bt(r.firstChild);const u=wt(Qe?e:r);for(;s=u.nextNode();)At(s),Ot(s),s.content instanceof a&&_t(s.content);if(Qe)return e;if(qe){if(Me)for(l=_.call(r.ownerDocument);r.firstChild;)l.appendChild(r.firstChild);else l=r;return(Ae.shadowroot||Ae.shadowrootmode)&&(l=U.call(o,l,!0)),l}let d=je?r.outerHTML:r.innerHTML;return je&&Te["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&B(fe,r.ownerDocument.doctype.name)&&(d="\n"+d),Le&&C([W,ie,ae],(e=>{d=D(d,e," ")})),T&&Be?T.createHTML(d):d},n.setConfig=function(){mt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),De=!0},n.clearConfig=function(){dt=null,De=!1},n.isValidAttribute=function(e,t,n){dt||mt({});const r=ut(e),o=ut(t);return Et(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&R(H[e],t)},n.removeHook=function(e){return I(H[e])},n.removeHooks=function(e){H[e]=[]},n.removeAllHooks=function(){H={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}(),Se=function(e){return{__html:y((0,Te.sanitize)(e))}},Ae=function(e,t,o,a,s){var c=s.userInput,l=s.userAttempt,u=s.currentQuestionIndex,d=s.continueTillCorrect,p=s.showNextQuestionButton,f=s.incorrect,m=s.correct,g=s.setButtons,h=s.setIsCorrect,b=s.setIncorrectAnswer,x=s.setCorrect,y=s.setIncorrect,w=s.setShowNextQuestionButton,v=s.setUserInput,T=s.setUserAttempt,S="".concat(e),A=Object.keys(a).map((function(){return{disabled:!0}})),E=i(c);if("single"===o)void 0===E[u]&&(E[u]=e),S===t?(f.indexOf(u)<0&&m.indexOf(u)<0&&m.push(u),g((function(o){return n(n(n({},o),A),{},r({},e-1,{className:S===t?"correct":"incorrect"}))})),h(!0),b(!1),x(m),w(!0)):(m.indexOf(u)<0&&f.indexOf(u)<0&&f.push(u),d?g((function(t){return n(n({},t),{},r({},e-1,{disabled:!t[e-1]}))})):(g((function(o){return n(n(n({},o),A),{},r({},e-1,{className:S===t?"correct":"incorrect"}))})),w(!0)),b(!0),h(!1),y(f));else{var N=t.length;if(void 0===E[u]&&(E[u]=[]),E[u].length=0&&f.splice(f.indexOf(u),1)):(f.indexOf(u)<0&&f.push(u),m.indexOf(u)>=0&&m.splice(m.indexOf(u),1)),g(m),h(f),d((function(t){return n(n(n({},t),x),{},r({},e-1,{className:"selected"}))})),p(!0);else{if(void 0===y[u]&&(y[u]=[]),y[u].includes(e)?y[u].splice(y[u].indexOf(e),1):y[u].push(e),y[u].length===t.length){var w,v=!0,T=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=a(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){c=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw i}}}}(l[u]);try{for(T.s();!(w=T.n()).done;){var S=w.value;if(!t.includes(S)){v=!1,f.indexOf(u)<0&&f.push(u),m.indexOf(u)>=0&&m.splice(m.indexOf(u),1);break}}}catch(e){T.e(e)}finally{T.f()}v&&(m.indexOf(u)<0&&m.push(u),f.indexOf(u)>=0&&f.splice(f.indexOf(u),1))}else f.indexOf(u)<0&&f.push(u),m.indexOf(u)>=0&&m.splice(m.indexOf(u),1);g(m),h(f),d((function(t){return n(n({},t),{},r({},e-1,{className:y[u].includes(e)?"selected":void 0}))})),y[u].length>0&&p(!0)}b(y)};function Ne(e){var t=e.question,n=e.isResultPage,r=t.explanation;return r?n?f.jsx("div",{className:"explanation",children:r}):f.jsxs("div",{children:[f.jsx("br",{}),r]}):null}var Oe=function(e){return e.messageForCorrectAnswer||"You are correct. Please click Next to continue."},_e=function(e){return e.messageForIncorrectAnswer||"Incorrect answer. Please try again."};function ke(t){var n=t.showInstantFeedback,r=t.incorrectAnswer,o=t.correctAnswer,i=t.question,a=t.onQuestionSubmit,s=t.userAnswer;return e.useEffect((function(){a&&(o||r)&&a({question:i,userAnswer:s,isCorrect:o})}),[o,r]),f.jsxs(f.Fragment,{children:[r&&n&&f.jsx("div",{className:"alert incorrect",children:_e(i)}),o&&n&&f.jsxs("div",{className:"alert correct",children:[Oe(i),f.jsx(Ne,{question:i,isResultPage:!1})]})]})}function Ce(t){var n=t.questions,r=t.appLocale,a=t.showDefaultResult,s=t.onComplete,l=t.customResultPage,u=t.showInstantFeedback,d=t.continueTillCorrect,p=t.revealAnswerOnSubmit,h=t.allowNavigation,b=t.onQuestionSubmit,x=t.timer,y=t.allowPauseTimer,w=t.enableProgressBar,v=t.progressBarColor,T=o(e.useState(!1),2),S=T[0],A=T[1],E=o(e.useState(!1),2),N=E[0],O=E[1],_=o(e.useState(!1),2),k=_[0],C=_[1],I=o(e.useState(!1),2),R=I[0],L=I[1],z=o(e.useState(0),2),j=z[0],D=z[1],P=o(e.useState({}),2),q=P[0],M=P[1],B=o(e.useState([]),2),F=B[0],U=B[1],H=o(e.useState([]),2),Q=H[0],W=H[1],Y=o(e.useState([]),2),G=Y[0],$=Y[1],X=o(e.useState([]),2),K=X[0],V=X[1],Z=o(e.useState("all"),2),J=Z[0],ee=Z[1],te=o(e.useState(1),2),ne=te[0],re=te[1],oe=o(e.useState(!0),2),ie=oe[0],ae=oe[1],se=o(e.useState(void 0),2),ce=se[0],le=se[1],ue=o(e.useState(0),2),de=ue[0],pe=ue[1],fe=o(e.useState(0),2),me=fe[0],ge=fe[1],he=o(e.useState(n[j]),2),be=he[0],xe=he[1],ye=o(e.useState(void 0),2),we=ye[0],ve=ye[1],Te=o(e.useState(x),2),Oe=Te[0],_e=Te[1],Ce=o(e.useState(!0),2),Ie=Ce[0],Re=Ce[1];e.useEffect((function(){ae(void 0===a||a)}),[a]),e.useEffect((function(){xe(n[j])}),[j,n]),e.useEffect((function(){var e=be.answerSelectionType;le(e||"single")}),[be,j]),e.useEffect((function(){if(R){Re(!1);for(var e=0,t=0,r=0;r",t)}),n&&f.jsx("span",{className:"selection-tag segment",children:n})]})},Pe=e.useCallback((function(){var e,t;if("all"!==J){var o=G;"correct"===J?o=F:"incorrect"===J&&(o=Q),e=n.filter((function(e,t){return-1!==o.indexOf(t)})),t=K.filter((function(e,t){return-1!==o.indexOf(t)}))}return(e||n).map((function(e,n){var o=t?t[n]:K[n],i=e.answerSelectionType||"single";return f.jsxs("div",{className:"result-answer-wrapper",children:[f.jsx("h3",{dangerouslySetInnerHTML:Se("Q".concat(e.questionIndex,": ").concat(e.question," ").concat(r.marksOfQuestion.replace("",e.point)))}),e.questionPic&&f.jsx("img",{src:e.questionPic,alt:"question"}),De(i,e.correctAnswer.length,e.segment),f.jsx("div",{className:"result-answer",children:je(e,o)}),f.jsx(Ne,{question:e,isResultPage:!0})]},c())}))}),[R,J]);e.useEffect((function(){var e;return x&&Ie&&Oe>0&&(e=setInterval((function(){_e((function(e){return e-1}))}),1e3)),function(){return x&&clearInterval(e)}}),[Ie,Oe,x]);var qe,Me,Be,Fe,Ue,He,Qe,We,Ye,Ge,$e=function(e){return e<10?"0":""},Xe=function(e){var t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=e%60;return"".concat($e(t)).concat(t,":").concat($e(n)).concat(n,":").concat($e(r)).concat(r)};return f.jsxs("div",{className:"questionWrapper",children:[w&&f.jsxs(f.Fragment,{children:[f.jsx("div",{style:{display:"flex",width:"100%"},children:f.jsx(m,{progress:j+1,quizLength:n.length,isEndQuiz:R,progressBarColor:v})}),f.jsx("br",{})]}),x&&!Ie&&f.jsxs("div",{children:[r.timerTimeTaken,":"," ",f.jsx("b",{children:Xe(x-Oe)})]}),x&&Ie&&f.jsxs("div",{children:[r.timerTimeRemaining,":"," ",f.jsx("b",{children:Xe(Oe)})]}),x&&0===Oe&&Ie&&(Re(!1),L(!0),void n.forEach((function(e,t){void 0===K[t]&&$((function(e){return[].concat(i(e),[t])}))}))),!R&&f.jsxs("div",{className:"questionWrapperBody",children:[f.jsxs("div",{children:["".concat(r.question," ").concat(j+1," / ").concat(n.length,":"),f.jsx("br",{}),x&&y&&f.jsx("button",{type:"button",className:"timerBtn",onClick:function(){Re(!Ie)},children:Ie?r.pauseScreenPause:r.pauseScreenResume})]}),Ie?f.jsxs(f.Fragment,{children:[f.jsx("h3",{dangerouslySetInnerHTML:Se("".concat(be&&be.question," ").concat(r.marksOfQuestion.replace("",be.point)))}),be&&be.questionPic&&f.jsx("img",{src:be.questionPic,alt:"question"}),be&&De(ce,be.correctAnswer.length,be.segment),f.jsx("div",{className:"questionModal",children:f.jsx(ke,{question:be,showInstantFeedback:u,correctAnswer:N,incorrectAnswer:S,onQuestionSubmit:b,userAnswer:i(K).pop()})}),be&&(qe=be,Me=q,Be=qe.answers,Fe=qe.correctAnswer,Ue=qe.questionType,He=qe.questionIndex,Qe=qe.answerSelectionType,We=function(e){return Ae(e+1,Fe,Qe,Be,{userInput:K,userAttempt:ne,currentQuestionIndex:j,continueTillCorrect:d,showNextQuestionButton:k,incorrect:Q,correct:F,setButtons:M,setIsCorrect:O,setIncorrectAnswer:A,setCorrect:U,setIncorrect:W,setShowNextQuestionButton:C,setUserInput:V,setUserAttempt:re})},Ye=function(e){return Ee(e+1,Fe,Qe,Be,{userInput:K,currentQuestionIndex:j,setButtons:M,setShowNextQuestionButton:C,incorrect:Q,correct:F,setCorrect:U,setIncorrect:W,setUserInput:V})},Ge=function(e){return void 0!==K[He-1]&&("single"===Qe?K[He-1]===e:Array.isArray(K[He-1])&&K[He-1].includes(e))},Qe=Qe||"single",Be.map((function(t,n){return f.jsx(e.Fragment,{children:void 0!==Me[n]?f.jsxs("button",{type:"button",disabled:Me[n].disabled||!1,className:"".concat(Me[n].className||""," answerBtn btn"),onClick:function(){return p?Ye(n):We(n)},children:["text"===Ue&&f.jsx("span",{children:t}),"photo"===Ue&&f.jsx("img",{src:t,alt:"answer"})]}):f.jsxs("button",{type:"button",onClick:function(){return p?Ye(n):We(n)},className:"answerBtn btn ".concat(h&&Ge(n+1)?"selected":""),children:["text"===Ue&&t,"photo"===Ue&&f.jsx("img",{src:t,alt:"answer"})]})},c())}))),(k||h)&&f.jsxs("div",{className:"questionBtnContainer",children:[h&&j>0&&f.jsx("button",{onClick:function(){return Le(j-2)},className:"prevQuestionBtn btn",type:"button",children:r.prevQuestionBtn}),f.jsx("button",{onClick:function(){return Le(j)},className:"nextQuestionBtn btn",type:"button",children:r.nextQuestionBtn})]})]}):f.jsxs("span",{className:"timerPauseScreen dark:text-white text-black",children:[f.jsx("br",{}),f.jsx("br",{}),r.pauseScreenDisplay]})]}),R&&ie&&void 0===l&&f.jsxs("div",{className:"card-body",children:[f.jsx("h2",{children:r.resultPageHeaderText.replace("",F.length).replace("",n.length)}),f.jsx("h2",{children:r.resultPagePoint.replace("",me).replace("",de)}),f.jsx("br",{}),f.jsx(g,{filteredValue:J,handleChange:ze,appLocale:r}),Pe()]}),R&&!ie&&void 0!==l&&l(we)]})}var Ie={landingHeaderText:" Questions",question:"Question",startQuizBtn:"Start Quiz",resultFilterAll:"All",resultFilterCorrect:"Correct",resultFilterIncorrect:"Incorrect",resultFilterUnanswered:"Unanswered",nextQuestionBtn:"Next",prevQuestionBtn:"Prev",resultPageHeaderText:"You have completed the quiz. You got out of questions.",resultPagePoint:"You scored out of .",pauseScreenDisplay:"Test is paused. Clicked the Resume button to continue",timerTimeRemaining:"Time Remaining",timerTimeTaken:"Time Taken",pauseScreenPause:"Pause",pauseScreenResume:"Resume",singleSelectionTagText:"Single Selection",multipleSelectionTagText:"Multiple Selection",pickNumberOfSelection:"Pick ",marksOfQuestion:"( marks)"};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}('.react-quiz-container{margin:20px;max-width:500px}.react-quiz-container .startQuizWrapper{margin-top:10px}.react-quiz-container .btn{background-image:none;border:1px solid transparent;cursor:pointer;font-weight:600;margin-bottom:0;padding:11px 12px;text-align:center;touch-action:manipulation;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;white-space:nowrap}.react-quiz-container .questionWrapper .btn{border:1px solid #e8e8e8;border-radius:4px;display:block;font-size:15px;margin-bottom:10px;margin-top:10px;text-align:unset;white-space:normal}.react-quiz-container .questionWrapper .btn.correct,.timerBtn{background:green;color:#fff}.timerBtn{border:0!important;border-radius:10px;cursor:pointer;float:right;padding:5px;position:relative;top:-35px;width:80px}.timerPauseScreen{font-size:30px}.react-quiz-container .questionModal .alert{border:1px solid transparent;border-radius:2px;color:#fff;margin-bottom:21px;padding:20px}.react-quiz-container .correct{background:green}.react-quiz-container .incorrect{background:red;color:#fff}.react-quiz-container .unanswered{background:grey;color:#fff}.react-quiz-container .answerBtn,.react-quiz-container .questionWrapper img{width:100%}.react-quiz-container .selected{background:#007bff;color:#fff}.react-quiz-container .startQuizWrapper .startQuizBtn{background-color:#fff;border:1px solid #d9d9d9;border-radius:2px;color:rgba(0,0,0,.65);font-size:15px;line-height:1.35135}.react-quiz-container .result-answer-wrapper{border:1px solid #e8e8e8;border-bottom-left-radius:5px;border-bottom-right-radius:5px;margin-bottom:20px}.react-quiz-container .result-answer-wrapper h3{background-color:#fafafa;border-top-left-radius:5px;border-top-right-radius:5px;color:rgba(0,0,0,.9);margin:0;opacity:.8;padding:10px}.react-quiz-container .result-answer-wrapper .explanation{border:1px solid #e8e8e8;margin:0 20px 20px;padding:20px}.react-quiz-container .result-answer-wrapper .tag-container{margin:20px}.react-quiz-container .result-answer{padding:0 20px}.react-quiz-container .quiz-synopsis{margin:15px 0}.react-quiz-container .tag-container{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:20px;margin-top:20px}.react-quiz-container .number-of-selection,.react-quiz-container .selection-tag{border-radius:5px;color:#fff;padding:7px}.react-quiz-container .number-of-selection{background:#673ab7;margin-left:5px}.react-quiz-container .selection-tag.single{background:#3f51b5}.react-quiz-container .selection-tag.multiple{background:#ff9800}.react-quiz-container .selection-tag.segment{background:#3db4b9;margin-left:5px}.react-quiz-container .questionBtnContainer{display:flex;justify-content:space-between}.react-quiz-container .quiz-result-filter{bottom:15px;position:relative;width:120px;.filter-dropdown-select{background-color:#fcfcfc;border:2px solid #c2c5c7;border-radius:7px;bottom:10px;color:#333;cursor:pointer;font-size:16px;height:12px;margin-top:2px;padding:8px;position:relative;text-transform:capitalize}.filter-dropdown-select:after{color:#a5a5a5;content:"▼";font-size:11px;position:absolute;right:10px;top:57%;transform:translateY(-50%);transition:all .3s ease}.filter-dropdown-select:hover{border:2px solid #51aae6;box-shadow:0 0 6px rgba(109,179,250,.5)}.dropdown-options{background-color:#fcfcfc;border-radius:10px;box-shadow:0 0 10px hsla(210,2%,56%,.5);left:0;list-style:none;margin:0;padding:0;position:absolute;top:85%;width:100%;z-index:1}.filter-dropdown-select.open{border:2px solid #51aae6;box-shadow:0 0 6px rgba(109,179,250,.5)}.dropdown-options .dropdown-options-item{cursor:pointer;font-size:16px;padding:10px}.dropdown-options .dropdown-options-item:hover{background-color:hsla(0,0%,89%,.852);border-radius:5px}.dropdown-options .dropdown-options-item:focus{background-color:#d7f1f9;font-weight:700}.filter-dropdown-select .selected-option.selected-open{color:#c6c2c2;font-weight:lighter}.filter-dropdown-select .selected-option{bottom:2px;font-size:16px;position:relative}.filter-dropdown-select:focus+.dropdown-options{max-height:200px}.dropdown-options .dropdown-options-item.selected{background-color:#d7f1f9;color:#333;font-weight:700}.dropdown-options.open{max-height:200px}}'),module.exports=function(t){var r=t.quiz,i=t.shuffle,a=t.shuffleAnswer,s=t.showDefaultResult,c=t.onComplete,l=t.customResultPage,u=t.showInstantFeedback,d=t.continueTillCorrect,p=t.revealAnswerOnSubmit,m=t.allowNavigation,g=t.onQuestionSubmit,h=t.disableSynopsis,b=t.timer,x=t.allowPauseTimer,y=t.enableProgressBar,w=o(e.useState(!1),2),v=w[0],T=w[1],S=o(e.useState(r.questions),2),A=S[0],E=S[1],N=r.nrOfQuestions&&r.nrOfQuestions0;t-=1){var n=Math.floor(Math.random()*(t+1)),r=[e[n],e[t]];e[t]=r[0],e[n]=r[1]}return e}),[]);if(e.useEffect((function(){h&&T(!0)}),[]),e.useEffect((function(){var e=r.questions;i&&(e=O(e)),a&&(e=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((function(e){var t,r=(null===(t=e.answers)||void 0===t?void 0:t.map((function(e,t){return[e,t]}))).sort((function(){return Math.random()-.5})),o=r.map((function(e){return e[0]}));if("single"===e.answerSelectionType){var i=e.correctAnswer,a=r.findIndex((function(e){return"".concat(e[1]+1)==="".concat(i)}))+1;return n(n({},e),{},{correctAnswer:"".concat(a),answers:o})}if("multiple"===e.answerSelectionType){var s=e.correctAnswer.map((function(e){return r.findIndex((function(t){return"".concat(t[1]+1)==="".concat(e)}))+1}));return n(n({},e),{},{correctAnswer:s,answers:o})}return e}))}(e)),e.length=N,e=e.map((function(e,t){return n(n({},e),{},{questionIndex:t+1})})),E(e)}),[v]),!function(e){if(!e)return console.error("Quiz object is required."),!1;if(b&&"number"!=typeof b||b<1)return console.error(b&&"number"!=typeof b?"timer must be a number":"timer must be a number greater than 0"),!1;if(x&&"boolean"!=typeof x)return console.error("allowPauseTimer must be a Boolean"),!1;if(y&&"boolean"!=typeof y)return console.error("enableProgressBar must be a Boolean"),!1;if("progressBarColor"in r){if("string"!=typeof r.progressBarColor)return console.error("progressBarColor must be a String"),!1;if(t=r.progressBarColor,!/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/.test(t))return console.error("progressBarColor must be a valid hex colour"),!1}for(var t,n=0;n",N)}),r.quizSynopsis&&f.jsx("div",{className:"quiz-synopsis",children:r.quizSynopsis}),f.jsx("div",{className:"startQuizWrapper",children:f.jsx("button",{type:"button",onClick:function(){return T(!0)},className:"startQuizBtn btn",children:_.startQuizBtn})})]}),v&&f.jsx(Ce,{questions:A,showDefaultResult:s,onComplete:c,customResultPage:l,showInstantFeedback:u,continueTillCorrect:d,revealAnswerOnSubmit:p,allowNavigation:m,appLocale:_,onQuestionSubmit:g,timer:b,allowPauseTimer:x,enableProgressBar:y,progressBarColor:r.progressBarColor})]})}; +"use strict";var e=require("react");function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function n(e){for(var n=1;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};var l,u,d={exports:{}},p={};var f=(u||(u=1,d.exports=function(){if(l)return p;l=1;var t=e,n=Symbol.for("react.element"),r=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in void 0!==r&&(l=""+r),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(u=t.ref),t)o.call(t,s)&&!a.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps)void 0===c[s]&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:i.current}}return p.Fragment=r,p.jsx=s,p.jsxs=s,p}()),d.exports);function m(e){var t=e.progressBarColor,n=void 0===t?"#9de1f6":t,r=e.progress,o=e.height,i=void 0===o?"25px":o,a=e.quizLength,s=e.isEndQuiz,c=r-1,l=100/a,u={width:"100%",backgroundColor:"#D0D4CA",height:i,borderRadius:40,position:"relative",overflow:"hidden"},d={width:s?"100%":"".concat(l*c,"%"),height:"100%",backgroundColor:n,transition:"width 0.3s ease"};return f.jsxs("div",{style:u,children:[f.jsx("div",{style:d}),f.jsx("span",{style:{position:"absolute",left:"50%",top:"50%",transform:"translateX(-50%) translateY(-50%)",lineHeigth:"20px",fontSize:"16px",color:"#000",fontWeight:"bold",backgroundColor:"transparent"},children:s?"100%":"".concat(Math.round(l*c),"%")})]})}function g(t){var n=t.filteredValue,r=t.handleChange,i=t.appLocale,a=o(e.useState(!1),2),s=a[0],c=a[1],l=e.useRef(null),u=function(){c(!s)},d=function(e){r({target:{value:e}}),c(!1)},p=s?"selected-open":"",m={all:i.resultFilterAll,correct:i.resultFilterCorrect,incorrect:i.resultFilterIncorrect,unanswered:i.resultFilterUnanswered};return e.useEffect((function(){var e=function(e){s&&l.current&&!l.current.contains(e.target)&&c(!1)};return document.addEventListener("click",e),function(){document.removeEventListener("click",e)}}),[s]),f.jsxs("div",{className:"quiz-result-filter",children:[f.jsxs("div",{ref:l,className:"filter-dropdown-select ".concat(s?"open":""),onClick:u,onKeyDown:function(e){"Enter"===e.key&&u()},role:"button",tabIndex:0,children:[f.jsx("div",{className:"selected-option ".concat(p),children:m[n]}),f.jsx("span",{className:"arrow ".concat(s?"up":"down")})]}),s&&f.jsxs("div",{className:"dropdown-options",role:"menu","aria-labelledby":"quiz-filter",children:[f.jsx("div",{className:"dropdown-options-item ".concat("all"===n?"selected":""),onClick:function(){return d("all")},onKeyDown:function(e){"Enter"===e.key&&d("all")},role:"menuitem",tabIndex:0,children:i.resultFilterAll}),f.jsx("div",{className:"dropdown-options-item ".concat("correct"===n?"selected":""),onClick:function(){return d("correct")},onKeyDown:function(e){"Enter"===e.key&&d("correct")},role:"menuitem",tabIndex:0,children:i.resultFilterCorrect}),f.jsx("div",{className:"dropdown-options-item ".concat("incorrect"===n?"selected":""),onClick:function(){return d("incorrect")},onKeyDown:function(e){"Enter"===e.key&&d("incorrect")},role:"menuitem",tabIndex:0,children:i.resultFilterIncorrect}),f.jsx("div",{className:"dropdown-options-item ".concat("unanswered"===n?"selected":""),onClick:function(){return d("unanswered")},onKeyDown:function(e){"Enter"===e.key&&d("unanswered")},role:"menuitem",tabIndex:0,children:i.resultFilterUnanswered})]})]})}var h={"":["",""],_:["",""],"*":["",""],"~":["",""],"\n":["
    "]," ":["
    "],"-":["
    "]};function b(e){return e.replace(RegExp("^"+(e.match(/^(\t| )+/)||"")[0],"gm"),"")}function x(e){return(e+"").replace(/"/g,""").replace(//g,">")}function y(e,t){var n,r,o,i,a,s=/((?:^|\n+)(?:\n---+|\* \*(?: \*)+)\n)|(?:^``` *(\w*)\n([\s\S]*?)\n```$)|((?:(?:^|\n+)(?:\t| {2,}).+)+\n*)|((?:(?:^|\n)([>*+-]|\d+\.)\s+.*)+)|(?:!\[([^\]]*?)\]\(([^)]+?)\))|(\[)|(\](?:\(([^)]+?)\))?)|(?:(?:^|\n+)([^\s].*)\n(-{3,}|={3,})(?:\n+|$))|(?:(?:^|\n+)(#{1,6})\s*(.+)(?:\n+|$))|(?:`([^`].*?)`)|( \n\n*|\n{2,}|__|\*\*|[_*]|~~)/gm,c=[],l="",u=t||{},d=0;function p(e){var t=h[e[1]||""],n=c[c.length-1]==e;return t?t[1]?(n?c.pop():c.push(e),t[0|n]):t[0]:e}function f(){for(var e="";c.length;)e+=p(c[c.length-1]);return e}for(e=e.replace(/^\[(.+?)\]:\s*(.+)$/gm,(function(e,t,n){return u[t.toLowerCase()]=n,""})).replace(/^\n+|\n+$/g,"");o=s.exec(e);)r=e.substring(d,o.index),d=s.lastIndex,n=o[0],r.match(/[^\\](\\\\)*\\$/)||((a=o[3]||o[4])?n='
    "+b(x(a).replace(/^\n+|\n+$/g,""))+"
    ":(a=o[6])?(a.match(/\./)&&(o[5]=o[5].replace(/^\d+/gm,"")),i=y(b(o[5].replace(/^\s*[>*+.-]/gm,""))),">"==a?a="blockquote":(a=a.match(/\./)?"ol":"ul",i=i.replace(/^(.*)(\n|$)/gm,"
  • $1
  • ")),n="<"+a+">"+i+""):o[8]?n=''+x(o[7])+'':o[10]?(l=l.replace("
    ",''),n=f()+""):o[9]?n="":o[12]||o[14]?n="<"+(a="h"+(o[14]?o[14].length:o[13]>"="?1:2))+">"+y(o[12]||o[15],u)+"":o[16]?n=""+x(o[16])+"":(o[17]||o[1])&&(n=p(o[17]||"--"))),l+=r,l+=n;return(l+e.substring(d)+f()).replace(/^\n+|\n+$/g,"")} +/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:w,setPrototypeOf:v,isFrozen:T,getPrototypeOf:S,getOwnPropertyDescriptor:A}=Object;let{freeze:N,seal:E,create:k}=Object,{apply:O,construct:C}="undefined"!=typeof Reflect&&Reflect;N||(N=function(e){return e}),E||(E=function(e){return e}),O||(O=function(e,t,n){return e.apply(t,n)}),C||(C=function(e,t){return new e(...t)});const _=W(Array.prototype.forEach),I=W(Array.prototype.lastIndexOf),R=W(Array.prototype.pop),z=W(Array.prototype.push),j=W(Array.prototype.splice),L=W(String.prototype.toLowerCase),q=W(String.prototype.toString),D=W(String.prototype.match),P=W(String.prototype.replace),M=W(String.prototype.indexOf),B=W(String.prototype.trim),F=W(Object.prototype.hasOwnProperty),U=W(RegExp.prototype.test),Q=(H=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n1?n-1:0),o=1;o2&&void 0!==arguments[2]?arguments[2]:L;v&&v(e,null);let r=t.length;for(;r--;){let o=t[r];if("string"==typeof o){const e=n(o);e!==o&&(T(t)||(t[r]=e),o=e)}e[o]=!0}return e}function G(e){for(let t=0;t/gm),le=E(/\$\{[\w\W]*/gm),ue=E(/^data-[\-\w.\u00B7-\uFFFF]+$/),de=E(/^aria-[\-\w]+$/),pe=E(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),fe=E(/^(?:\w+script|data):/i),me=E(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ge=E(/^html$/i),he=E(/^[a-z][.\w]*(-[.\w]+)+$/i);var be=Object.freeze({__proto__:null,ARIA_ATTR:de,ATTR_WHITESPACE:me,CUSTOM_ELEMENT:he,DATA_ATTR:ue,DOCTYPE_NAME:ge,ERB_EXPR:ce,IS_ALLOWED_URI:pe,IS_SCRIPT_OR_DATA:fe,MUSTACHE_EXPR:se,TMPLIT_EXPR:le});const xe=1,ye=3,we=7,ve=8,Te=9,Se=function(){return"undefined"==typeof window?null:window};var Ae=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Se();const n=t=>e(t);if(n.version="3.2.6",n.removed=[],!t||!t.document||t.document.nodeType!==Te||!t.Element)return n.isSupported=!1,n;let{document:r}=t;const o=r,i=o.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:c,Element:l,NodeFilter:u,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:p,DOMParser:f,trustedTypes:m}=t,g=l.prototype,h=X(g,"cloneNode"),b=X(g,"remove"),x=X(g,"nextSibling"),y=X(g,"childNodes"),v=X(g,"parentNode");if("function"==typeof s){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let T,S="";const{implementation:A,createNodeIterator:E,createDocumentFragment:O,getElementsByTagName:C}=r,{importNode:H}=o;let W={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof w&&"function"==typeof v&&A&&void 0!==A.createHTMLDocument;const{MUSTACHE_EXPR:G,ERB_EXPR:se,TMPLIT_EXPR:ce,DATA_ATTR:le,ARIA_ATTR:ue,IS_SCRIPT_OR_DATA:de,ATTR_WHITESPACE:fe,CUSTOM_ELEMENT:me}=be;let{IS_ALLOWED_URI:he}=be,Ae=null;const Ne=Y({},[...K,...V,...Z,...ee,...ne]);let Ee=null;const ke=Y({},[...re,...oe,...ie,...ae]);let Oe=Object.seal(k(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ce=null,_e=null,Ie=!0,Re=!0,ze=!1,je=!0,Le=!1,qe=!0,De=!1,Pe=!1,Me=!1,Be=!1,Fe=!1,Ue=!1,Qe=!0,He=!1,We=!0,Ye=!1,Ge={},$e=null;const Xe=Y({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ke=null;const Ve=Y({},["audio","video","img","source","image","track"]);let Ze=null;const Je=Y({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),et="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml";let rt=nt,ot=!1,it=null;const at=Y({},[et,tt,nt],q);let st=Y({},["mi","mo","mn","ms","mtext"]),ct=Y({},["annotation-xml"]);const lt=Y({},["title","style","font","a","script"]);let ut=null;const dt=["application/xhtml+xml","text/html"];let pt=null,ft=null;const mt=r.createElement("form"),gt=function(e){return e instanceof RegExp||e instanceof Function},ht=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ft||ft!==e){if(e&&"object"==typeof e||(e={}),e=$(e),ut=-1===dt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,pt="application/xhtml+xml"===ut?q:L,Ae=F(e,"ALLOWED_TAGS")?Y({},e.ALLOWED_TAGS,pt):Ne,Ee=F(e,"ALLOWED_ATTR")?Y({},e.ALLOWED_ATTR,pt):ke,it=F(e,"ALLOWED_NAMESPACES")?Y({},e.ALLOWED_NAMESPACES,q):at,Ze=F(e,"ADD_URI_SAFE_ATTR")?Y($(Je),e.ADD_URI_SAFE_ATTR,pt):Je,Ke=F(e,"ADD_DATA_URI_TAGS")?Y($(Ve),e.ADD_DATA_URI_TAGS,pt):Ve,$e=F(e,"FORBID_CONTENTS")?Y({},e.FORBID_CONTENTS,pt):Xe,Ce=F(e,"FORBID_TAGS")?Y({},e.FORBID_TAGS,pt):$({}),_e=F(e,"FORBID_ATTR")?Y({},e.FORBID_ATTR,pt):$({}),Ge=!!F(e,"USE_PROFILES")&&e.USE_PROFILES,Ie=!1!==e.ALLOW_ARIA_ATTR,Re=!1!==e.ALLOW_DATA_ATTR,ze=e.ALLOW_UNKNOWN_PROTOCOLS||!1,je=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Le=e.SAFE_FOR_TEMPLATES||!1,qe=!1!==e.SAFE_FOR_XML,De=e.WHOLE_DOCUMENT||!1,Be=e.RETURN_DOM||!1,Fe=e.RETURN_DOM_FRAGMENT||!1,Ue=e.RETURN_TRUSTED_TYPE||!1,Me=e.FORCE_BODY||!1,Qe=!1!==e.SANITIZE_DOM,He=e.SANITIZE_NAMED_PROPS||!1,We=!1!==e.KEEP_CONTENT,Ye=e.IN_PLACE||!1,he=e.ALLOWED_URI_REGEXP||pe,rt=e.NAMESPACE||nt,st=e.MATHML_TEXT_INTEGRATION_POINTS||st,ct=e.HTML_INTEGRATION_POINTS||ct,Oe=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&>(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Oe.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&>(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Oe.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Oe.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Le&&(Re=!1),Fe&&(Be=!0),Ge&&(Ae=Y({},ne),Ee=[],!0===Ge.html&&(Y(Ae,K),Y(Ee,re)),!0===Ge.svg&&(Y(Ae,V),Y(Ee,oe),Y(Ee,ae)),!0===Ge.svgFilters&&(Y(Ae,Z),Y(Ee,oe),Y(Ee,ae)),!0===Ge.mathMl&&(Y(Ae,ee),Y(Ee,ie),Y(Ee,ae))),e.ADD_TAGS&&(Ae===Ne&&(Ae=$(Ae)),Y(Ae,e.ADD_TAGS,pt)),e.ADD_ATTR&&(Ee===ke&&(Ee=$(Ee)),Y(Ee,e.ADD_ATTR,pt)),e.ADD_URI_SAFE_ATTR&&Y(Ze,e.ADD_URI_SAFE_ATTR,pt),e.FORBID_CONTENTS&&($e===Xe&&($e=$($e)),Y($e,e.FORBID_CONTENTS,pt)),We&&(Ae["#text"]=!0),De&&Y(Ae,["html","head","body"]),Ae.table&&(Y(Ae,["tbody"]),delete Ce.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=e.TRUSTED_TYPES_POLICY,S=T.createHTML("")}else void 0===T&&(T=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(m,i)),null!==T&&"string"==typeof S&&(S=T.createHTML(""));N&&N(e),ft=e}},bt=Y({},[...V,...Z,...J]),xt=Y({},[...ee,...te]),yt=function(e){z(n.removed,{element:e});try{v(e).removeChild(e)}catch(t){b(e)}},wt=function(e,t){try{z(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){z(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Be||Fe)try{yt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},vt=function(e){let t=null,n=null;if(Me)e=""+e;else{const t=D(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ut&&rt===nt&&(e=''+e+"");const o=T?T.createHTML(e):e;if(rt===nt)try{t=(new f).parseFromString(o,ut)}catch(e){}if(!t||!t.documentElement){t=A.createDocument(rt,"template",null);try{t.documentElement.innerHTML=ot?S:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),rt===nt?C.call(t,De?"html":"body")[0]:De?t.documentElement:i},Tt=function(e){return E.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},St=function(e){return e instanceof p&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof d)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},At=function(e){return"function"==typeof c&&e instanceof c};function Nt(e,t,r){_(e,(e=>{e.call(n,t,r,ft)}))}const Et=function(e){let t=null;if(Nt(W.beforeSanitizeElements,e,null),St(e))return yt(e),!0;const r=pt(e.nodeName);if(Nt(W.uponSanitizeElement,e,{tagName:r,allowedTags:Ae}),qe&&e.hasChildNodes()&&!At(e.firstElementChild)&&U(/<[/\w!]/g,e.innerHTML)&&U(/<[/\w!]/g,e.textContent))return yt(e),!0;if(e.nodeType===we)return yt(e),!0;if(qe&&e.nodeType===ve&&U(/<[/\w]/g,e.data))return yt(e),!0;if(!Ae[r]||Ce[r]){if(!Ce[r]&&Ot(r)){if(Oe.tagNameCheck instanceof RegExp&&U(Oe.tagNameCheck,r))return!1;if(Oe.tagNameCheck instanceof Function&&Oe.tagNameCheck(r))return!1}if(We&&!$e[r]){const t=v(e)||e.parentNode,n=y(e)||e.childNodes;if(n&&t){for(let r=n.length-1;r>=0;--r){const o=h(n[r],!0);o.__removalCount=(e.__removalCount||0)+1,t.insertBefore(o,x(e))}}}return yt(e),!0}return e instanceof l&&!function(e){let t=v(e);t&&t.tagName||(t={namespaceURI:rt,tagName:"template"});const n=L(e.tagName),r=L(t.tagName);return!!it[e.namespaceURI]&&(e.namespaceURI===tt?t.namespaceURI===nt?"svg"===n:t.namespaceURI===et?"svg"===n&&("annotation-xml"===r||st[r]):Boolean(bt[n]):e.namespaceURI===et?t.namespaceURI===nt?"math"===n:t.namespaceURI===tt?"math"===n&&ct[r]:Boolean(xt[n]):e.namespaceURI===nt?!(t.namespaceURI===tt&&!ct[r])&&!(t.namespaceURI===et&&!st[r])&&!xt[n]&&(lt[n]||!bt[n]):!("application/xhtml+xml"!==ut||!it[e.namespaceURI]))}(e)?(yt(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!U(/<\/no(script|embed|frames)/i,e.innerHTML)?(Le&&e.nodeType===ye&&(t=e.textContent,_([G,se,ce],(e=>{t=P(t,e," ")})),e.textContent!==t&&(z(n.removed,{element:e.cloneNode()}),e.textContent=t)),Nt(W.afterSanitizeElements,e,null),!1):(yt(e),!0)},kt=function(e,t,n){if(Qe&&("id"===t||"name"===t)&&(n in r||n in mt))return!1;if(Re&&!_e[t]&&U(le,t));else if(Ie&&U(ue,t));else if(!Ee[t]||_e[t]){if(!(Ot(e)&&(Oe.tagNameCheck instanceof RegExp&&U(Oe.tagNameCheck,e)||Oe.tagNameCheck instanceof Function&&Oe.tagNameCheck(e))&&(Oe.attributeNameCheck instanceof RegExp&&U(Oe.attributeNameCheck,t)||Oe.attributeNameCheck instanceof Function&&Oe.attributeNameCheck(t))||"is"===t&&Oe.allowCustomizedBuiltInElements&&(Oe.tagNameCheck instanceof RegExp&&U(Oe.tagNameCheck,n)||Oe.tagNameCheck instanceof Function&&Oe.tagNameCheck(n))))return!1}else if(Ze[t]);else if(U(he,P(n,fe,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==M(n,"data:")||!Ke[e]){if(ze&&!U(de,P(n,fe,"")));else if(n)return!1}else;return!0},Ot=function(e){return"annotation-xml"!==e&&D(e,me)},Ct=function(e){Nt(W.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||St(e))return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ee,forceKeepAttr:void 0};let o=t.length;for(;o--;){const i=t[o],{name:a,namespaceURI:s,value:c}=i,l=pt(a),u=c;let d="value"===a?u:B(u);if(r.attrName=l,r.attrValue=d,r.keepAttr=!0,r.forceKeepAttr=void 0,Nt(W.uponSanitizeAttribute,e,r),d=r.attrValue,!He||"id"!==l&&"name"!==l||(wt(a,e),d="user-content-"+d),qe&&U(/((--!?|])>)|<\/(style|title)/i,d)){wt(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){wt(a,e);continue}if(!je&&U(/\/>/i,d)){wt(a,e);continue}Le&&_([G,se,ce],(e=>{d=P(d,e," ")}));const p=pt(e.nodeName);if(kt(p,l,d)){if(T&&"object"==typeof m&&"function"==typeof m.getAttributeType)if(s);else switch(m.getAttributeType(p,l)){case"TrustedHTML":d=T.createHTML(d);break;case"TrustedScriptURL":d=T.createScriptURL(d)}if(d!==u)try{s?e.setAttributeNS(s,a,d):e.setAttribute(a,d),St(e)?yt(e):R(n.removed)}catch(t){wt(a,e)}}else wt(a,e)}Nt(W.afterSanitizeAttributes,e,null)},_t=function e(t){let n=null;const r=Tt(t);for(Nt(W.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)Nt(W.uponSanitizeShadowNode,n,null),Et(n),Ct(n),n.content instanceof a&&e(n.content);Nt(W.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,s=null,l=null;if(ot=!e,ot&&(e="\x3c!--\x3e"),"string"!=typeof e&&!At(e)){if("function"!=typeof e.toString)throw Q("toString is not a function");if("string"!=typeof(e=e.toString()))throw Q("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Pe||ht(t),n.removed=[],"string"==typeof e&&(Ye=!1),Ye){if(e.nodeName){const t=pt(e.nodeName);if(!Ae[t]||Ce[t])throw Q("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof c)r=vt("\x3c!----\x3e"),i=r.ownerDocument.importNode(e,!0),i.nodeType===xe&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i);else{if(!Be&&!Le&&!De&&-1===e.indexOf("<"))return T&&Ue?T.createHTML(e):e;if(r=vt(e),!r)return Be?null:Ue?S:""}r&&Me&&yt(r.firstChild);const u=Tt(Ye?e:r);for(;s=u.nextNode();)Et(s),Ct(s),s.content instanceof a&&_t(s.content);if(Ye)return e;if(Be){if(Fe)for(l=O.call(r.ownerDocument);r.firstChild;)l.appendChild(r.firstChild);else l=r;return(Ee.shadowroot||Ee.shadowrootmode)&&(l=H.call(o,l,!0)),l}let d=De?r.outerHTML:r.innerHTML;return De&&Ae["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&U(ge,r.ownerDocument.doctype.name)&&(d="\n"+d),Le&&_([G,se,ce],(e=>{d=P(d,e," ")})),T&&Ue?T.createHTML(d):d},n.setConfig=function(){ht(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Pe=!0},n.clearConfig=function(){ft=null,Pe=!1},n.isValidAttribute=function(e,t,n){ft||ht({});const r=pt(e),o=pt(t);return kt(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&z(W[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=I(W[e],t);return-1===n?void 0:j(W[e],n,1)[0]}return R(W[e])},n.removeHooks=function(e){W[e]=[]},n.removeAllHooks=function(){W={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}(),Ne=function(e){return{__html:y((0,Ae.sanitize)(e))}},Ee=function(e,t,o,s,c){var l=c.userInput,u=c.currentQuestionIndex,d=c.setButtons,p=c.setShowNextQuestionButton,f=c.incorrect,m=c.correct,g=c.setCorrect,h=c.setIncorrect,b=c.setUserInput,x=Object.keys(s).map((function(){return{selected:!1}})),y=i(l);if("single"===o)t=Number(t),y[u]=e,e===t?(m.indexOf(u)<0&&m.push(u),f.indexOf(u)>=0&&f.splice(f.indexOf(u),1)):(f.indexOf(u)<0&&f.push(u),m.indexOf(u)>=0&&m.splice(m.indexOf(u),1)),g(m),h(f),d((function(t){return n(n(n({},t),x),{},r({},e-1,{className:"selected"}))})),p(!0);else{if(void 0===y[u]&&(y[u]=[]),y[u].includes(e)?y[u].splice(y[u].indexOf(e),1):y[u].push(e),y[u].length===t.length){var w,v=!0,T=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=a(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){c=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw i}}}}(l[u]);try{for(T.s();!(w=T.n()).done;){var S=w.value;if(!t.includes(S)){v=!1,f.indexOf(u)<0&&f.push(u),m.indexOf(u)>=0&&m.splice(m.indexOf(u),1);break}}}catch(e){T.e(e)}finally{T.f()}v&&(m.indexOf(u)<0&&m.push(u),f.indexOf(u)>=0&&f.splice(f.indexOf(u),1))}else f.indexOf(u)<0&&f.push(u),m.indexOf(u)>=0&&m.splice(m.indexOf(u),1);g(m),h(f),d((function(t){return n(n({},t),{},r({},e-1,{className:y[u].includes(e)?"selected":void 0}))})),y[u].length>0&&p(!0)}b(y)};function ke(e){var t=e.question,n=e.isResultPage,r=t.explanation;return r?n?f.jsx("div",{className:"explanation",children:r}):f.jsxs("div",{children:[f.jsx("br",{}),r]}):null}var Oe=function(e){return e.messageForCorrectAnswer||"You are correct. Please click Next to continue."},Ce=function(e){return e.messageForIncorrectAnswer||"Incorrect answer. Please try again."};function _e(t){var n=t.showInstantFeedback,r=t.incorrectAnswer,o=t.correctAnswer,i=t.question,a=t.onQuestionSubmit,s=t.userAnswer;return e.useEffect((function(){a&&(o||r)&&a({question:i,userAnswer:s,isCorrect:o})}),[o,r]),f.jsxs(f.Fragment,{children:[r&&n&&f.jsx("div",{className:"alert incorrect",children:Ce(i)}),o&&n&&f.jsxs("div",{className:"alert correct",children:[Oe(i),f.jsx(ke,{question:i,isResultPage:!1})]})]})}function Ie(t){var a=t.questions,s=t.appLocale,l=t.showDefaultResult,u=t.onComplete,d=t.customResultPage,p=t.showInstantFeedback,h=t.continueTillCorrect,b=t.revealAnswerOnSubmit,x=t.allowNavigation,y=t.onQuestionSubmit,w=t.timer,v=t.allowPauseTimer,T=t.enableProgressBar,S=t.progressBarColor,A=o(e.useState(!1),2),N=A[0],E=A[1],k=o(e.useState(!1),2),O=k[0],C=k[1],_=o(e.useState(!1),2),I=_[0],R=_[1],z=o(e.useState(!1),2),j=z[0],L=z[1],q=o(e.useState(0),2),D=q[0],P=q[1],M=o(e.useState({}),2),B=M[0],F=M[1],U=o(e.useState([]),2),Q=U[0],H=U[1],W=o(e.useState([]),2),Y=W[0],G=W[1],$=o(e.useState([]),2),X=$[0],K=$[1],V=o(e.useState([]),2),Z=V[0],J=V[1],ee=o(e.useState("all"),2),te=ee[0],ne=ee[1],re=o(e.useState(1),2),oe=re[0],ie=re[1],ae=o(e.useState(!0),2),se=ae[0],ce=ae[1],le=o(e.useState(void 0),2),ue=le[0],de=le[1],pe=o(e.useState(0),2),fe=pe[0],me=pe[1],ge=o(e.useState(0),2),he=ge[0],be=ge[1],xe=o(e.useState(a[D]),2),ye=xe[0],we=xe[1],ve=o(e.useState(void 0),2),Te=ve[0],Se=ve[1],Ae=o(e.useState(w),2),Oe=Ae[0],Ce=Ae[1],Ie=o(e.useState(!0),2),Re=Ie[0],ze=Ie[1],je=o(e.useState(!1),2),Le=je[0],qe=je[1];e.useEffect((function(){ce(void 0===l||l)}),[l]),e.useEffect((function(){we(a[D])}),[D,a]),e.useEffect((function(){var e=ye.answerSelectionType;de(e||"single")}),[ye,D]),e.useEffect((function(){if(j){ze(!1);for(var e=0,t=0,n=0;n",t)}),n&&f.jsx("span",{className:"selection-tag segment",children:n})]})},Fe=e.useCallback((function(){var e,t;if("all"!==te){var n=X;"correct"===te?n=Q:"incorrect"===te&&(n=Y),e=a.filter((function(e,t){return-1!==n.indexOf(t)})),t=Z.filter((function(e,t){return-1!==n.indexOf(t)}))}return(e||a).map((function(e,n){var r=t?t[n]:Z[n],o=e.answerSelectionType||"single";return f.jsxs("div",{className:"result-answer-wrapper",children:[f.jsx("h3",{dangerouslySetInnerHTML:Ne("Q".concat(e.questionIndex,": ").concat(e.question," ").concat(s.marksOfQuestion.replace("",e.point)))}),e.questionPic&&f.jsx("img",{src:e.questionPic,alt:"question"}),Be(o,e.correctAnswer.length,e.segment),f.jsx("div",{className:"result-answer",children:Me(e,r)}),f.jsx(ke,{question:e,isResultPage:!0})]},c())}))}),[j,te]);e.useEffect((function(){var e;return w&&Re&&Oe>0&&(e=setInterval((function(){Ce((function(e){return e-1}))}),1e3)),function(){return w&&clearInterval(e)}}),[Re,Oe,w]);var Ue,Qe,He,We,Ye,Ge,$e,Xe,Ke,Ve,Ze=function(e){return e<10?"0":""},Je=function(e){var t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=e%60;return"".concat(Ze(t)).concat(t,":").concat(Ze(n)).concat(n,":").concat(Ze(r)).concat(r)},et=function(){ze(!1),L(!0),a.forEach((function(e,t){void 0===Z[t]&&K((function(e){return[].concat(i(e),[t])}))}))};return f.jsxs("div",{className:"questionWrapper",children:[T&&f.jsxs(f.Fragment,{children:[f.jsx("div",{style:{display:"flex",width:"100%"},children:f.jsx(m,{progress:D+1,quizLength:a.length,isEndQuiz:j,progressBarColor:S})}),f.jsx("br",{})]}),w&&!Re&&f.jsxs("div",{children:[s.timerTimeTaken,":"," ",f.jsx("b",{children:Je(w-Oe)})]}),w&&Re&&f.jsxs("div",{children:[s.timerTimeRemaining,": ",f.jsx("b",{children:Je(Oe)})]}),w&&0===Oe&&Re&&et(),!j&&f.jsxs("div",{className:"questionWrapperBody",children:[f.jsxs("div",{children:["".concat(s.question," ").concat(D+1," / ").concat(a.length,":"),f.jsx("br",{}),w&&v&&f.jsx("button",{type:"button",className:"timerBtn",onClick:function(){ze(!Re)},children:Re?s.pauseScreenPause:s.pauseScreenResume})]}),Re?f.jsxs(f.Fragment,{children:[f.jsx("h3",{dangerouslySetInnerHTML:Ne("".concat(ye&&ye.question," ").concat(s.marksOfQuestion.replace("",ye.point)))}),ye&&ye.questionPic&&f.jsx("img",{src:ye.questionPic,alt:"question"}),ye&&Be(ue,ye.correctAnswer.length,ye.segment),f.jsx("div",{className:"questionModal",children:f.jsx(_e,{question:ye,showInstantFeedback:p,correctAnswer:O,incorrectAnswer:N,onQuestionSubmit:y,userAnswer:i(Z).pop()})}),ye&&(Ue=ye,Qe=B,He=Ue.answers,We=Ue.correctAnswer,Ye=Ue.questionType,Ge=Ue.questionIndex,$e=Ue.answerSelectionType,Xe=function(e){return function(e,t,o,a,s){var c=s.userInput,l=s.userAttempt,u=s.currentQuestionIndex,d=s.continueTillCorrect,p=s.showNextQuestionButton,f=s.incorrect,m=s.correct,g=s.setButtons,h=s.setIsCorrect,b=s.setIncorrectAnswer,x=s.setCorrect,y=s.setIncorrect,w=s.setShowNextQuestionButton,v=s.setUserInput,T=s.setUserAttempt,S="".concat(e),A=Object.keys(a).map((function(){return{disabled:!0}})),N=i(c);if("single"===o)void 0===N[u]&&(N[u]=e),S===t?(f.indexOf(u)<0&&m.indexOf(u)<0&&m.push(u),g((function(o){return n(n(n({},o),A),{},r({},e-1,{className:S===t?"correct":"incorrect"}))})),h(!0),b(!1),x(m),w(!0)):(m.indexOf(u)<0&&f.indexOf(u)<0&&f.push(u),d?g((function(t){return n(n({},t),{},r({},e-1,{disabled:!t[e-1]}))})):(g((function(o){return n(n(n({},o),A),{},r({},e-1,{className:S===t?"correct":"incorrect"}))})),w(!0)),b(!0),h(!1),y(f));else{var E=t.length;if(void 0===N[u]&&(N[u]=[]),N[u].length0&&f.jsx("button",{onClick:function(){return De(D-2)},className:"prevQuestionBtn btn",type:"button",children:s.prevQuestionBtn}),f.jsx("button",{onClick:function(){return De(D)},className:"nextQuestionBtn btn",type:"button",children:s.nextQuestionBtn})]}),!j&&Re&&f.jsx("div",{className:"quitQuizBtnContainer",children:f.jsx("button",{onClick:function(){return qe(!0)},className:"quitQuizBtn",type:"button",children:s.quitQuizBtn||"Submit and Quit"})})]}):f.jsxs("span",{className:"timerPauseScreen dark:text-white text-black",children:[f.jsx("br",{}),f.jsx("br",{}),s.pauseScreenDisplay]})]}),j&&se&&void 0===d&&f.jsxs("div",{className:"card-body",children:[f.jsx("h2",{children:s.resultPageHeaderText.replace("",Q.length).replace("",a.length)}),f.jsx("h2",{children:s.resultPagePoint.replace("",he).replace("",fe)}),f.jsx("br",{}),f.jsx(g,{filteredValue:te,handleChange:Pe,appLocale:s}),Fe()]}),j&&!se&&void 0!==d&&d(Te),Le&&f.jsx("div",{className:"quit-confirm-modal",children:f.jsxs("div",{className:"modal-content",children:[f.jsx("p",{children:s.quitConfirmationText||"Are you sure you want to quit the quiz? Your progress will be saved."}),f.jsxs("div",{className:"modal-buttons",children:[f.jsx("button",{className:"confirm-quit-btn btn",onClick:function(){qe(!1),et()},children:s.confirmQuitText||"Yes, Quit"}),f.jsx("button",{className:"cancel-quit-btn btn",onClick:function(){return qe(!1)},children:s.cancelQuitText||"Cancel"})]})]})})]})}var Re={landingHeaderText:" Questions",question:"Question",startQuizBtn:"Start Quiz",resultFilterAll:"All",resultFilterCorrect:"Correct",resultFilterIncorrect:"Incorrect",resultFilterUnanswered:"Unanswered",nextQuestionBtn:"Next",prevQuestionBtn:"Prev",resultPageHeaderText:"You have completed the quiz. You got out of questions.",resultPagePoint:"You scored out of .",pauseScreenDisplay:"Test is paused. Clicked the Resume button to continue",timerTimeRemaining:"Time Remaining",timerTimeTaken:"Time Taken",pauseScreenPause:"Pause",pauseScreenResume:"Resume",singleSelectionTagText:"Single Selection",multipleSelectionTagText:"Multiple Selection",pickNumberOfSelection:"Pick ",marksOfQuestion:"( marks)"};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}('.react-quiz-container{margin:20px;max-width:500px}.react-quiz-container .startQuizWrapper{margin-top:10px}.react-quiz-container .btn{background-image:none;border:1px solid transparent;cursor:pointer;font-weight:600;margin-bottom:0;padding:11px 12px;text-align:center;touch-action:manipulation;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;white-space:nowrap}.react-quiz-container .questionWrapper .btn{border:1px solid #e8e8e8;border-radius:4px;display:block;font-size:15px;margin-bottom:10px;margin-top:10px;text-align:unset;white-space:normal}.react-quiz-container .questionWrapper .btn.correct,.timerBtn{background:green;color:#fff}.timerBtn{border:0!important;border-radius:10px;cursor:pointer;float:right;padding:5px;position:relative;top:-35px;width:80px}.timerPauseScreen{font-size:30px}.react-quiz-container .questionModal .alert{border:1px solid transparent;border-radius:2px;color:#fff;margin-bottom:21px;padding:20px}.react-quiz-container .correct{background:green}.react-quiz-container .incorrect{background:red;color:#fff}.react-quiz-container .submitQuizBtn{border:"none";border-radius:"4px";cursor:"pointer";margin-top:"10px";padding:"10px 20px"}.react-quiz-container .unanswered{background:grey;color:#fff}.react-quiz-container .answerBtn,.react-quiz-container .questionWrapper img{width:100%}.react-quiz-container .selected{background:#007bff;color:#fff}.react-quiz-container .startQuizWrapper .startQuizBtn{background-color:#fff;border:1px solid #d9d9d9;border-radius:2px;color:rgba(0,0,0,.65);font-size:15px;line-height:1.35135}.react-quiz-container .result-answer-wrapper{border:1px solid #e8e8e8;border-bottom-left-radius:5px;border-bottom-right-radius:5px;margin-bottom:20px}.react-quiz-container .result-answer-wrapper h3{background-color:#fafafa;border-top-left-radius:5px;border-top-right-radius:5px;color:rgba(0,0,0,.9);margin:0;opacity:.8;padding:10px}.react-quiz-container .result-answer-wrapper .explanation{border:1px solid #e8e8e8;margin:0 20px 20px;padding:20px}.react-quiz-container .result-answer-wrapper .tag-container{margin:20px}.react-quiz-container .result-answer{padding:0 20px}.react-quiz-container .quiz-synopsis{margin:15px 0}.react-quiz-container .tag-container{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:20px;margin-top:20px}.react-quiz-container .number-of-selection,.react-quiz-container .selection-tag{border-radius:5px;color:#fff;padding:7px}.react-quiz-container .number-of-selection{background:#673ab7;margin-left:5px}.react-quiz-container .selection-tag.single{background:#3f51b5}.react-quiz-container .selection-tag.multiple{background:#ff9800}.react-quiz-container .selection-tag.segment{background:#3db4b9;margin-left:5px}.react-quiz-container .questionBtnContainer{display:flex;justify-content:space-between}.react-quiz-container .quiz-result-filter{bottom:15px;position:relative;width:120px;.filter-dropdown-select{background-color:#fcfcfc;border:2px solid #c2c5c7;border-radius:7px;bottom:10px;color:#333;cursor:pointer;font-size:16px;margin-top:2px;padding:8px;position:relative;text-transform:capitalize}.filter-dropdown-select:after{color:#a5a5a5;content:"▼";font-size:11px;position:absolute;right:10px;top:57%;transform:translateY(-50%);transition:all .3s ease}.filter-dropdown-select:hover{border:2px solid #51aae6;box-shadow:0 0 6px rgba(109,179,250,.5)}.dropdown-options{background-color:#fcfcfc;border-radius:10px;box-shadow:0 0 10px hsla(210,2%,56%,.5);left:0;list-style:none;margin:0;padding:0;position:absolute;top:85%;width:100%;z-index:1}.filter-dropdown-select.open{border:2px solid #51aae6;box-shadow:0 0 6px rgba(109,179,250,.5)}.dropdown-options .dropdown-options-item{cursor:pointer;font-size:16px;padding:10px}.dropdown-options .dropdown-options-item:hover{background-color:hsla(0,0%,89%,.852);border-radius:5px}.dropdown-options .dropdown-options-item:focus{background-color:#d7f1f9;font-weight:700}.filter-dropdown-select .selected-option.selected-open{color:#c6c2c2;font-weight:lighter}.filter-dropdown-select .selected-option{bottom:2px;font-size:16px;position:relative}.filter-dropdown-select:focus+.dropdown-options{max-height:200px}.dropdown-options .dropdown-options-item.selected{background-color:#d7f1f9;color:#333;font-weight:700}.dropdown-options.open{max-height:200px}}.quit-confirm-modal{align-items:center;background:rgba(0,0,0,.5);bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0;z-index:1000}.modal-content{background:#fff;border-radius:8px;max-width:400px;padding:2rem;width:90%}.modal-buttons{display:flex;justify-content:space-between;margin-top:1rem}.questionBtnContainer .nextQuestionBtn{background-color:#3f51b5;color:#fff}.quitQuizBtnContainer{display:flex;justify-content:center}.quitQuizBtn{background-color:#fff;border:1px solid #d9d9d9;border-radius:4px;color:#7b7a7a;cursor:pointer;font-size:10px;font-weight:600;margin-top:24px;padding:8px 12px}.quitQuizBtn:hover{color:#d9d9d9}.confirm-quit-btn{background-color:#f44336;color:#fff}.cancel-quit-btn{background-color:#e0e0e0}'),module.exports=function(t){var r=t.quiz,i=t.shuffle,a=t.shuffleAnswer,s=t.showDefaultResult,c=t.onComplete,l=t.customResultPage,u=t.showInstantFeedback,d=t.continueTillCorrect,p=t.revealAnswerOnSubmit,m=t.allowNavigation,g=t.onQuestionSubmit,h=t.disableSynopsis,b=t.timer,x=t.allowPauseTimer,y=t.enableProgressBar,w=o(e.useState(!1),2),v=w[0],T=w[1],S=o(e.useState(r.questions),2),A=S[0],N=S[1],E=r.nrOfQuestions&&r.nrOfQuestions0;t-=1){var n=Math.floor(Math.random()*(t+1)),r=[e[n],e[t]];e[t]=r[0],e[n]=r[1]}return e}),[]);if(e.useEffect((function(){h&&T(!0)}),[]),e.useEffect((function(){var e=r.questions;i&&(e=k(e)),a&&(e=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((function(e){var t,r=(null===(t=e.answers)||void 0===t?void 0:t.map((function(e,t){return[e,t]}))).sort((function(){return Math.random()-.5})),o=r.map((function(e){return e[0]}));if("single"===e.answerSelectionType){var i=e.correctAnswer,a=r.findIndex((function(e){return"".concat(e[1]+1)==="".concat(i)}))+1;return n(n({},e),{},{correctAnswer:"".concat(a),answers:o})}if("multiple"===e.answerSelectionType){var s=e.correctAnswer.map((function(e){return r.findIndex((function(t){return"".concat(t[1]+1)==="".concat(e)}))+1}));return n(n({},e),{},{correctAnswer:s,answers:o})}return e}))}(e)),e.length=E,e=e.map((function(e,t){return n(n({},e),{},{questionIndex:t+1})})),N(e)}),[v]),!function(e){if(!e)return console.error("Quiz object is required."),!1;if(b&&"number"!=typeof b||b<1)return console.error(b&&"number"!=typeof b?"timer must be a number":"timer must be a number greater than 0"),!1;if(x&&"boolean"!=typeof x)return console.error("allowPauseTimer must be a Boolean"),!1;if(y&&"boolean"!=typeof y)return console.error("enableProgressBar must be a Boolean"),!1;if("progressBarColor"in r){if("string"!=typeof r.progressBarColor)return console.error("progressBarColor must be a String"),!1;if(t=r.progressBarColor,!/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/.test(t))return console.error("progressBarColor must be a valid hex colour"),!1}for(var t,n=0;n",E)}),r.quizSynopsis&&f.jsx("div",{className:"quiz-synopsis",children:r.quizSynopsis}),f.jsx("div",{className:"startQuizWrapper",children:f.jsx("button",{type:"button",onClick:function(){return T(!0)},className:"startQuizBtn btn",children:O.startQuizBtn})})]}),v&&f.jsx(Ie,{questions:A,showDefaultResult:s,onComplete:c,customResultPage:l,showInstantFeedback:u,continueTillCorrect:d,revealAnswerOnSubmit:p,allowNavigation:m,appLocale:O,onQuestionSubmit:g,timer:b,allowPauseTimer:x,enableProgressBar:y,progressBarColor:r.progressBarColor})]})}; diff --git a/src/lib/Core.jsx b/src/lib/Core.jsx index ddd145c4..b23d611b 100644 --- a/src/lib/Core.jsx +++ b/src/lib/Core.jsx @@ -1,17 +1,30 @@ -import React, { - useState, useEffect, useCallback, Fragment, -} from 'react'; -import { nanoid } from 'nanoid'; -import ProgressBar from './core-components/ProgressBar'; -import QuizResultFilter from './core-components/QuizResultFilter'; -import { checkAnswer, selectAnswer, rawMarkup } from './core-components/helpers'; -import InstantFeedback from './core-components/InstantFeedback'; -import Explanation from './core-components/Explanation'; +import React, { useState, useEffect, useCallback, Fragment } from "react"; +import { nanoid } from "nanoid"; +import ProgressBar from "./core-components/ProgressBar"; +import QuizResultFilter from "./core-components/QuizResultFilter"; +import { + checkAnswer, + selectAnswer, + rawMarkup, +} from "./core-components/helpers"; +import InstantFeedback from "./core-components/InstantFeedback"; +import Explanation from "./core-components/Explanation"; function Core({ - questions, appLocale, showDefaultResult, onComplete, customResultPage, - showInstantFeedback, continueTillCorrect, revealAnswerOnSubmit, allowNavigation, - onQuestionSubmit, timer, allowPauseTimer, enableProgressBar, progressBarColor, + questions, + appLocale, + showDefaultResult, + onComplete, + customResultPage, + showInstantFeedback, + continueTillCorrect, + revealAnswerOnSubmit, + allowNavigation, + onQuestionSubmit, + timer, + allowPauseTimer, + enableProgressBar, + progressBarColor, }) { const [incorrectAnswer, setIncorrectAnswer] = useState(false); const [isCorrect, setIsCorrect] = useState(false); @@ -23,20 +36,26 @@ function Core({ const [incorrect, setIncorrect] = useState([]); const [unanswered, setUnanswered] = useState([]); const [userInput, setUserInput] = useState([]); - const [filteredValue, setFilteredValue] = useState('all'); + const [filteredValue, setFilteredValue] = useState("all"); const [userAttempt, setUserAttempt] = useState(1); const [showDefaultResultState, setShowDefaultResult] = useState(true); - const [answerSelectionTypeState, setAnswerSelectionType] = useState(undefined); + const [answerSelectionTypeState, setAnswerSelectionType] = + useState(undefined); const [totalPoints, setTotalPoints] = useState(0); const [correctPoints, setCorrectPoints] = useState(0); - const [activeQuestion, setActiveQuestion] = useState(questions[currentQuestionIndex]); + const [activeQuestion, setActiveQuestion] = useState( + questions[currentQuestionIndex] + ); const [questionSummary, setQuestionSummary] = useState(undefined); const [timeRemaining, setTimeRemaining] = useState(timer); const [isRunning, setIsRunning] = useState(true); + const [showQuitConfirm, setShowQuitConfirm] = useState(false); useEffect(() => { - setShowDefaultResult(showDefaultResult !== undefined ? showDefaultResult : true); + setShowDefaultResult( + showDefaultResult !== undefined ? showDefaultResult : true + ); }, [showDefaultResult]); useEffect(() => { @@ -46,7 +65,7 @@ function Core({ useEffect(() => { const { answerSelectionType } = activeQuestion; // Default single to avoid code breaking due to automatic version upgrade - setAnswerSelectionType(answerSelectionType || 'single'); + setAnswerSelectionType(answerSelectionType || "single"); }, [activeQuestion, currentQuestionIndex]); useEffect(() => { @@ -56,7 +75,7 @@ function Core({ let correctPointsTemp = 0; for (let i = 0; i < questions.length; i += 1) { let point = questions[i].point || 0; - if (typeof point === 'string' || point instanceof String) { + if (typeof point === "string" || point instanceof String) { point = parseInt(point, 10); } @@ -98,9 +117,11 @@ function Core({ if (currentQuestionIdx + 1 === questions.length) { if (userInput.length !== questions.length) { - alert('Quiz is incomplete'); + alert("Quiz is incomplete"); } else if (allowNavigation) { - const submitQuiz = confirm('You have finished all the questions. Submit Quiz now?'); + const submitQuiz = confirm( + "You have finished all the questions. Submit Quiz now?" + ); if (submitQuiz) { setEndQuiz(true); } @@ -123,28 +144,38 @@ function Core({ let answerBtnIncorrectClassName; // Default single to avoid code breaking due to automatic version upgrade - answerSelectionType = answerSelectionType || 'single'; + answerSelectionType = answerSelectionType || "single"; return answers.map((answer, index) => { - if (answerSelectionType === 'single') { + if (answerSelectionType === "single") { // correctAnswer - is string - answerBtnCorrectClassName = `${index + 1}` === correctAnswer ? 'correct' : ''; - answerBtnIncorrectClassName = `${userInputIndex}` !== correctAnswer - && `${index + 1}` === `${userInputIndex}` ? 'incorrect' : ''; + answerBtnCorrectClassName = + `${index + 1}` === correctAnswer ? "correct" : ""; + answerBtnIncorrectClassName = + `${userInputIndex}` !== correctAnswer && + `${index + 1}` === `${userInputIndex}` + ? "incorrect" + : ""; if (userInputIndex === undefined && `${index + 1}` !== correctAnswer) { - answerBtnIncorrectClassName = 'unanswered'; + answerBtnIncorrectClassName = "unanswered"; } } else { // correctAnswer - is array of numbers answerBtnCorrectClassName = correctAnswer.includes(index + 1) - ? 'correct' - : ''; - answerBtnIncorrectClassName = !correctAnswer.includes(index + 1) - && userInputIndex?.includes(index + 1) ? 'incorrect' : ''; - - if (userInputIndex === undefined && !correctAnswer.includes(index + 1)) { - answerBtnIncorrectClassName = 'unanswered'; + ? "correct" + : ""; + answerBtnIncorrectClassName = + !correctAnswer.includes(index + 1) && + userInputIndex?.includes(index + 1) + ? "incorrect" + : ""; + + if ( + userInputIndex === undefined && + !correctAnswer.includes(index + 1) + ) { + answerBtnIncorrectClassName = "unanswered"; } } @@ -155,8 +186,8 @@ function Core({ disabled className={`answerBtn btn ${answerBtnCorrectClassName}${answerBtnIncorrectClassName}`} > - {questionType === 'text' && {answer}} - {questionType === 'photo' && answer} + {questionType === "text" && {answer}} + {questionType === "photo" && answer} ); @@ -172,12 +203,19 @@ function Core({ return (
    - {answerSelectionType === 'single' - && {singleSelectionTagText}} - {answerSelectionType === 'multiple' - && {multipleSelectionTagText}} + {answerSelectionType === "single" && ( + {singleSelectionTagText} + )} + {answerSelectionType === "multiple" && ( + + {multipleSelectionTagText} + + )} - {pickNumberOfSelection.replace('', numberOfSelection)} + {pickNumberOfSelection.replace( + "", + numberOfSelection + )} {segment && {segment}}
    @@ -188,18 +226,18 @@ function Core({ let filteredQuestions; let filteredUserInput; - if (filteredValue !== 'all') { + if (filteredValue !== "all") { let targetQuestions = unanswered; - if (filteredValue === 'correct') { + if (filteredValue === "correct") { targetQuestions = correct; - } else if (filteredValue === 'incorrect') { + } else if (filteredValue === "incorrect") { targetQuestions = incorrect; } filteredQuestions = questions.filter( - (_, index) => targetQuestions.indexOf(index) !== -1, + (_, index) => targetQuestions.indexOf(index) !== -1 ); filteredUserInput = userInput.filter( - (_, index) => targetQuestions.indexOf(index) !== -1, + (_, index) => targetQuestions.indexOf(index) !== -1 ); } @@ -209,7 +247,7 @@ function Core({ : userInput[index]; // Default single to avoid code breaking due to automatic version upgrade - const answerSelectionType = question.answerSelectionType || 'single'; + const answerSelectionType = question.answerSelectionType || "single"; return (
    @@ -217,7 +255,7 @@ function Core({ dangerouslySetInnerHTML={rawMarkup( `Q${question.questionIndex}: ${ question.question - } ${appLocale.marksOfQuestion.replace('', question.point)}`, + } ${appLocale.marksOfQuestion.replace("", question.point)}` )} /> {question.questionPic && ( @@ -226,7 +264,7 @@ function Core({ {renderTags( answerSelectionType, question.correctAnswer.length, - question.segment, + question.segment )}
    {renderAnswerInResult(question, userInputIndex)} @@ -238,77 +276,90 @@ function Core({ }, [endQuiz, filteredValue]); const renderAnswers = (question, answerButtons) => { - const { - answers, correctAnswer, questionType, questionIndex, - } = question; + const { answers, correctAnswer, questionType, questionIndex } = question; let { answerSelectionType } = question; - const onClickAnswer = (index) => checkAnswer(index + 1, correctAnswer, answerSelectionType, answers, { - userInput, - userAttempt, - currentQuestionIndex, - continueTillCorrect, - showNextQuestionButton, - incorrect, - correct, - setButtons, - setIsCorrect, - setIncorrectAnswer, - setCorrect, - setIncorrect, - setShowNextQuestionButton, - setUserInput, - setUserAttempt, - }); - - const onSelectAnswer = (index) => selectAnswer(index + 1, correctAnswer, answerSelectionType, answers, { - userInput, - currentQuestionIndex, - setButtons, - setShowNextQuestionButton, - incorrect, - correct, - setCorrect, - setIncorrect, - setUserInput, - }); + const onClickAnswer = (index) => + checkAnswer(index + 1, correctAnswer, answerSelectionType, answers, { + userInput, + userAttempt, + currentQuestionIndex, + continueTillCorrect, + showNextQuestionButton, + incorrect, + correct, + setButtons, + setIsCorrect, + setIncorrectAnswer, + setCorrect, + setIncorrect, + setShowNextQuestionButton, + setUserInput, + setUserAttempt, + }); + + const onSelectAnswer = (index) => + selectAnswer(index + 1, correctAnswer, answerSelectionType, answers, { + userInput, + currentQuestionIndex, + setButtons, + setShowNextQuestionButton, + incorrect, + correct, + setCorrect, + setIncorrect, + setUserInput, + }); const checkSelectedAnswer = (index) => { if (userInput[questionIndex - 1] === undefined) { return false; } - if (answerSelectionType === 'single') { + if (answerSelectionType === "single") { return userInput[questionIndex - 1] === index; } - return Array.isArray(userInput[questionIndex - 1]) && userInput[questionIndex - 1].includes(index); + return ( + Array.isArray(userInput[questionIndex - 1]) && + userInput[questionIndex - 1].includes(index) + ); }; // Default single to avoid code breaking due to automatic version upgrade - answerSelectionType = answerSelectionType || 'single'; + answerSelectionType = answerSelectionType || "single"; return answers.map((answer, index) => ( - {(answerButtons[index] !== undefined) - ? ( - - ) - : ( - - )} + {answerButtons[index] !== undefined ? ( + + ) : ( + + )} )); }; @@ -325,13 +376,13 @@ function Core({

    {appLocale.resultPageHeaderText - .replace('', correct.length) - .replace('', questions.length)} + .replace("", correct.length) + .replace("", questions.length)}

    {appLocale.resultPagePoint - .replace('', correctPoints) - .replace('', totalPoints)} + .replace("", correctPoints) + .replace("", totalPoints)}


    (time < 10 ? '0' : ''); + const formatTime = (time) => (time < 10 ? "0" : ""); const displayTime = (time) => { const hours = Math.floor(time / 3600); const minutes = Math.floor((time % 3600) / 60); const seconds = time % 60; - return `${formatTime(hours)}${hours}:${formatTime(minutes)}${minutes}:${ - formatTime(seconds) - }${seconds}`; + return `${formatTime(hours)}${hours}:${formatTime( + minutes + )}${minutes}:${formatTime(seconds)}${seconds}`; }; const handleTimeUp = () => { @@ -375,11 +426,16 @@ function Core({ getUnansweredQuestions(); }; + const handleQuitQuiz = () => { + setShowQuitConfirm(false); + handleTimeUp(); + }; + return (
    {enableProgressBar && ( <> -
    +
    - {appLocale.timerTimeTaken} - : - {' '} + {appLocale.timerTimeTaken}:{" "} {displayTime(timer - timeRemaining)}
    )} {timer && isRunning && (
    - {appLocale.timerTimeRemaining} - : - {' '} - - {displayTime(timeRemaining)} - + {appLocale.timerTimeRemaining}: {displayTime(timeRemaining)}
    )} {timer && timeRemaining === 0 && isRunning && handleTimeUp()} @@ -420,7 +469,9 @@ function Core({
    {timer && allowPauseTimer && ( )}
    @@ -431,19 +482,19 @@ function Core({ `${ activeQuestion && activeQuestion.question } ${appLocale.marksOfQuestion.replace( - '', - activeQuestion.point, - )}`, + "", + activeQuestion.point + )}` )} /> {activeQuestion && activeQuestion.questionPic && ( question )} - {activeQuestion - && renderTags( + {activeQuestion && + renderTags( answerSelectionTypeState, activeQuestion.correctAnswer.length, - activeQuestion.segment, + activeQuestion.segment )}
    )} + {!endQuiz && isRunning && ( +
    + +
    + )} ) : ( @@ -487,10 +549,36 @@ function Core({ )}
    )} - {endQuiz && showDefaultResultState && customResultPage === undefined - && renderResult()} - {endQuiz && !showDefaultResultState && customResultPage !== undefined - && customResultPage(questionSummary)} + {endQuiz && + showDefaultResultState && + customResultPage === undefined && + renderResult()} + {endQuiz && + !showDefaultResultState && + customResultPage !== undefined && + customResultPage(questionSummary)} + + {showQuitConfirm && ( +
    +
    +

    + {appLocale.quitConfirmationText || + "Are you sure you want to quit the quiz? Your progress will be saved."} +

    +
    + + +
    +
    +
    + )}
    ); } diff --git a/src/lib/styles.css b/src/lib/styles.css index 442ccb35..93704fb8 100644 --- a/src/lib/styles.css +++ b/src/lib/styles.css @@ -58,7 +58,6 @@ font-size: 30px; } - .react-quiz-container .questionModal .alert { padding: 20px; margin-bottom: 21px; @@ -76,6 +75,14 @@ color: white; } +.react-quiz-container .submitQuizBtn { + margin-top: "10px"; + padding: "10px 20px"; + border: "none"; + border-radius: "4px"; + cursor: "pointer"; +} + .react-quiz-container .unanswered { background: grey; color: white; @@ -192,8 +199,8 @@ font-size: 16px; cursor: pointer; bottom: 10px; - position: relative; - height: 12px; + position: relative; + /* height: 12px; */ } .filter-dropdown-select:after { @@ -224,7 +231,7 @@ background-color: #fcfcfc; box-shadow: 0 0 10px rgba(141, 143, 145, 0.5); border-radius: 10px; - } + } .filter-dropdown-select.open { border: 2px solid #51aae6; @@ -248,27 +255,89 @@ } .filter-dropdown-select .selected-option.selected-open { - color: #c6c2c2; - font-weight: lighter; + color: #c6c2c2; + font-weight: lighter; } - + .filter-dropdown-select .selected-option { font-size: 16px; position: relative; - bottom: 2px; + bottom: 2px; } .filter-dropdown-select:focus + .dropdown-options { - max-height: 200px; + max-height: 200px; } .dropdown-options .dropdown-options-item.selected { - background-color: #d7f1f9; - color: #333; - font-weight: bold; + background-color: #d7f1f9; + color: #333; + font-weight: bold; } .dropdown-options.open { - max-height: 200px; + max-height: 200px; } } + +.quit-confirm-modal { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: rgba(0, 0, 0, 0.5); + display: flex; + justify-content: center; + align-items: center; + z-index: 1000; +} + +.modal-content { + background: white; + padding: 2rem; + border-radius: 8px; + max-width: 400px; + width: 90%; +} + +.modal-buttons { + display: flex; + justify-content: space-between; + margin-top: 1rem; +} + +.questionBtnContainer .nextQuestionBtn { + background-color: #3f51b5; + color: white; +} + +.quitQuizBtnContainer { + display: flex; + justify-content: center; +} + +.quitQuizBtn { + background-color: white; + color: #7b7a7a; + border: 1px solid #d9d9d9; + border-radius: 4px; + padding: 8px 12px; + margin-top: 24px; + cursor: pointer; + font-weight: 600; + font-size: 10px; +} + +.quitQuizBtn:hover { + color: #d9d9d9; +} + +.confirm-quit-btn { + background-color: #f44336; + color: white; +} + +.cancel-quit-btn { + background-color: #e0e0e0; +} \ No newline at end of file