!function(){var r={"./node_modules/lodash.debounce/index.js": /*!***********************************************!*\ !*** ./node_modules/lodash.debounce/index.js ***! \***********************************************/function(e,s,t){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function v(){return f.Date.now()}var n=NaN,i="[object Symbol]",o=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt,t="object"==(void 0===t.g?"undefined":r(t.g))&&t.g&&t.g.Object===Object&&t.g,h="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,f=t||h||Function("return this")(),d=Object.prototype.toString,b=Math.max,M=Math.min;function E(e){var t=r(e);return e&&("object"==t||"function"==t)}function m(e){return"symbol"==r(e)||!!(t=e)&&"object"==r(t)&&d.call(e)==i;var t}function _(e){if("number"==typeof e)return e;if(m(e))return n;if("string"!=typeof(e=E(e)?E(t="function"==typeof e.valueOf?e.valueOf():e)?t+"":t:e))return 0===e?e:+e;e=e.replace(o,"");var t=l.test(e);return t||c.test(e)?u(e.slice(2),t?2:8):a.test(e)?n:+e}e.exports=function(h,r,e){var n,i,o,a,s,l,c=0,f=!1,u=!1,t=!0;if("function"!=typeof h)throw new TypeError("Expected a function");function d(e){var t=n,r=i;return n=i=void 0,c=e,a=h.apply(r,t)}function m(e){var t=e-l;return void 0===l||r<=t||t<0||u&&o<=e-c}function p(){var e,t=v();if(m(t))return g(t);s=setTimeout(p,(e=r-((t=t)-l),u?M(e,o-(t-c)):e))}function g(e){return s=void 0,t&&n?d(e):(n=i=void 0,a)}function y(){var e=v(),t=m(e);if(n=arguments,i=this,l=e,t){if(void 0===s)return c=e=l,s=setTimeout(p,r),f?d(e):a;if(u)return s=setTimeout(p,r),d(l)}return void 0===s&&(s=setTimeout(p,r)),a}return r=_(r)||0,E(e)&&(f=!!e.leading,u="maxWait"in e,o=u?b(_(e.maxWait)||0,r):o,t="trailing"in e?!!e.trailing:t),y.cancel=function(){void 0!==s&&clearTimeout(s),n=l=i=s=void(c=0)},y.flush=function(){return void 0===s?a:g(v())},y}},"./src/BaseAPI.js": /*!************************!*\ !*** ./src/BaseAPI.js ***! \************************/function(r,e,t){"use strict";t.r(e),t.d(e,{default:function(){return T}});var p=t(/*! ./cmi/common */"./src/cmi/common.js"),l=t(/*! ./exceptions */"./src/exceptions.js"),e=t(/*! ./constants/error_codes */"./src/constants/error_codes.js"),c=t(/*! ./constants/api_constants */"./src/constants/api_constants.js"),u=t(/*! ./utilities */"./src/utilities.js"),h=t(/*! lodash.debounce */"./node_modules/lodash.debounce/index.js"),g=t.n(h);function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return v(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(r="Object"===r&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?v(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=this.apiLogLevel&&this.settings.onLogMessage(n,r)}},{key:"formatMessage",value:function(e,t,r){for(var n="",i=20-(n+=e).length,o=0;oe.max&&this.throwSCORMError(u.GENERAL_SET_FAILURE,"Data Model Element Pattern Too Long")}},{key:"checkDuplicateChoiceResponse",value:function(e,t){var r=e.correct_responses._count;if("choice"===e.type)for(var n=0;nNumber(t[1])&&this.throwSCORMError(u.TYPE_MISMATCH);else if(""!==t[o]&&n.unique)for(var s=0;s=this.cmi.completion_threshold?(console.debug("Setting Completion Status: Completed"),this.cmi.completion_status="completed"):(console.debug("Setting Completion Status: Incomplete"),this.cmi.completion_status="incomplete")),this.cmi.scaled_passing_score&&this.cmi.score.scaled&&(this.cmi.score.scaled>=this.cmi.scaled_passing_score?(console.debug("Setting Success Status: Passed"),this.cmi.success_status="passed"):(console.debug("Setting Success Status: Failed"),this.cmi.success_status="failed")));var t,r,n=!1,i=(this.adl.nav.request!==(null===(i=this.startingData)||void 0===i||null===(r=i.adl)||void 0===r||null===(t=r.nav)||void 0===t?void 0:t.request)&&"_none_"!==this.adl.nav.request&&(this.adl.nav.request=encodeURIComponent(this.adl.nav.request),n=!0),this.renderCommitCMI(e||this.settings.alwaysSendTotalTime));return this.apiLogLevel===c.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(i)),this.settings.lmsCommitUrl?(r=this.processHttpRequest(this.settings.lmsCommitUrl,i,e),n&&void 0!==r.navRequest&&""!==r.navRequest&&Function('"use strict";(() => { '.concat(r.navRequest," })()"))(),r):c.SCORM_TRUE}}])&&v(t.prototype,e),r&&v(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(e.default)},"./src/cmi/common.js": /*!***************************!*\ !*** ./src/cmi/common.js ***! \***************************/function(r,n,e){"use strict";e.r(n),e.d(n,{BaseCMI:function(){return k},CMIArray:function(){return z},CMIScore:function(){return D},checkValidFormat:function(){return I},checkValidRange:function(){return O}});var n=e(/*! ../constants/api_constants */"./src/constants/api_constants.js"),i=e(/*! ../constants/error_codes */"./src/constants/error_codes.js"),e=e(/*! ../constants/regex */"./src/constants/regex.js");function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(r){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=c(r),t=(e=n?(e=c(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),this);if(e&&("object"===o(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return h(t)}}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function E(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var r=0;r=t[0]){if("*"===t[1]||e<=t[1])return!0;throw new n.prototype.constructor(r)}throw new n.prototype.constructor(r)}var C=new WeakMap,T=new WeakMap,k=function(){function n(){var e,t,r;if(E(this,n),r=!(t="jsonString"),t in(e=this)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,f(this,C,{writable:!0,value:!1}),f(this,T,{writable:!0,value:void 0}),(this instanceof n?this.constructor:void 0)===n)throw new TypeError("Cannot construct BaseCMI instances directly")}return _(n,[{key:"initialized",get:function(){return t(this,C)}},{key:"start_time",get:function(){return t(this,T)}},{key:"initialize",value:function(){d(this,C,!0)}},{key:"setStartTime",value:function(){d(this,T,(new Date).getTime())}}]),n}(),R=new WeakMap,m=new WeakMap,L=new WeakMap,p=new WeakMap,g=new WeakMap,y=new WeakMap,v=new WeakMap,j=new WeakMap,A=new WeakMap,N=new WeakMap,D=function(){a(u,k);var c=l(u);function u(e){var t,r=e.score_children,n=e.score_range,i=e.max,o=e.invalidErrorCode,a=e.invalidTypeCode,s=e.invalidRangeCode,l=e.decimalRegex,e=e.errorClass;return E(this,u),f(h(t=c.call(this)),R,{writable:!0,value:void 0}),f(h(t),m,{writable:!0,value:void 0}),f(h(t),L,{writable:!0,value:void 0}),f(h(t),p,{writable:!0,value:void 0}),f(h(t),g,{writable:!0,value:void 0}),f(h(t),y,{writable:!0,value:void 0}),f(h(t),v,{writable:!0,value:void 0}),f(h(t),j,{writable:!0,value:""}),f(h(t),A,{writable:!0,value:""}),f(h(t),N,{writable:!0,value:void 0}),d(h(t),R,r||M.score_children),d(h(t),m,!!n&&w.score_range),d(h(t),N,i||""===i?i:"100"),d(h(t),L,o||S.INVALID_SET_VALUE),d(h(t),p,a||S.TYPE_MISMATCH),d(h(t),g,s||S.VALUE_OUT_OF_RANGE),d(h(t),y,l||w.CMIDecimal),d(h(t),v,e),t}return _(u,[{key:"_children",get:function(){return t(this,R)},set:function(e){throw new(t(this,v).prototype.constructor)(t(this,L))}},{key:"raw",get:function(){return t(this,j)},set:function(e){!I(e,t(this,y),t(this,p),t(this,v))||t(this,m)&&!O(e,t(this,m),t(this,g),t(this,v))||d(this,j,e)}},{key:"min",get:function(){return t(this,A)},set:function(e){!I(e,t(this,y),t(this,p),t(this,v))||t(this,m)&&!O(e,t(this,m),t(this,g),t(this,v))||d(this,A,e)}},{key:"max",get:function(){return t(this,N)},set:function(e){!I(e,t(this,y),t(this,p),t(this,v))||t(this,m)&&!O(e,t(this,m),t(this,g),t(this,v))||d(this,N,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={raw:this.raw,min:this.min,max:this.max};return delete this.jsonString,e}}]),u}(),P=new WeakMap,x=new WeakMap,V=new WeakMap,z=function(){a(o,k);var i=l(o);function o(e){var t,r=e.children,n=e.errorCode,e=e.errorClass;return E(this,o),f(h(t=i.call(this)),P,{writable:!0,value:void 0}),f(h(t),x,{writable:!0,value:void 0}),f(h(t),V,{writable:!0,value:void 0}),d(h(t),V,r),d(h(t),P,n),d(h(t),x,e),t.childArray=[],t}return _(o,[{key:"_children",get:function(){return t(this,V)},set:function(e){throw new(t(this,x).prototype.constructor)(t(this,P))}},{key:"_count",get:function(){return this.childArray.length},set:function(e){throw new(t(this,x).prototype.constructor)(t(this,P))}},{key:"toJSON",value:function(){this.jsonString=!0;for(var e={},t=0;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r