From bf2a22150a236c203a64449c538a17171fb6e42d Mon Sep 17 00:00:00 2001 From: Jonathan Putney Date: Thu, 24 Oct 2024 10:26:38 -0400 Subject: [PATCH] Bringing modules back, using global target for CommonJS --- dist/aicc.js | 4 +- dist/aicc.min.js | 2 +- dist/esm/aicc.js | 4587 ++++++++++++++++++++ dist/esm/aicc.js.map | 1 + dist/esm/aicc.min.js | 2 + dist/esm/aicc.min.js.map | 1 + dist/esm/scorm-again.js | 6975 +++++++++++++++++++++++++++++++ dist/esm/scorm-again.js.map | 1 + dist/esm/scorm-again.min.js | 2 + dist/esm/scorm-again.min.js.map | 1 + dist/esm/scorm12.js | 3655 ++++++++++++++++ dist/esm/scorm12.js.map | 1 + dist/esm/scorm12.min.js | 2 + dist/esm/scorm12.min.js.map | 1 + dist/esm/scorm2004.js | 4649 ++++++++++++++++++++ dist/esm/scorm2004.js.map | 1 + dist/esm/scorm2004.min.js | 2 + dist/esm/scorm2004.min.js.map | 1 + dist/scorm-again.js | 4 +- dist/scorm-again.min.js | 2 +- dist/scorm12.js | 4 +- dist/scorm12.min.js | 2 +- dist/scorm2004.js | 4 +- dist/scorm2004.min.js | 2 +- webpack.config.js | 32 +- 25 files changed, 19914 insertions(+), 24 deletions(-) create mode 100644 dist/esm/aicc.js create mode 100644 dist/esm/aicc.js.map create mode 100644 dist/esm/aicc.min.js create mode 100644 dist/esm/aicc.min.js.map create mode 100644 dist/esm/scorm-again.js create mode 100644 dist/esm/scorm-again.js.map create mode 100644 dist/esm/scorm-again.min.js create mode 100644 dist/esm/scorm-again.min.js.map create mode 100644 dist/esm/scorm12.js create mode 100644 dist/esm/scorm12.js.map create mode 100644 dist/esm/scorm12.min.js create mode 100644 dist/esm/scorm12.min.js.map create mode 100644 dist/esm/scorm2004.js create mode 100644 dist/esm/scorm2004.js.map create mode 100644 dist/esm/scorm2004.min.js create mode 100644 dist/esm/scorm2004.min.js.map diff --git a/dist/aicc.js b/dist/aicc.js index 8c0dd13..ad1847f 100644 --- a/dist/aicc.js +++ b/dist/aicc.js @@ -4596,7 +4596,9 @@ var AICCImpl = (function (_super) { }(Scorm12API.Scorm12Impl)); -module.exports = __webpack_exports__; +var __webpack_export_target__ = this; +for(var i in __webpack_exports__) __webpack_export_target__[i] = __webpack_exports__[i]; +if(__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, "__esModule", { value: true }); /******/ })() ; //# sourceMappingURL=aicc.js.map \ No newline at end of file diff --git a/dist/aicc.min.js b/dist/aicc.min.js index afd116c..30be7ec 100644 --- a/dist/aicc.min.js +++ b/dist/aicc.min.js @@ -1,2 +1,2 @@ -!function(){"use strict";var e={900:function(e,t,i){i.d(t,{A:function(){return d}});var r=i(635),n=i(589),o=i(784),s=i(797),a=i(340),c=i(864);var l={autocommit:!1,autocommitSeconds:10,asyncCommit:!1,sendFullCommit:!0,lmsCommitUrl:!1,dataCommitFormat:"json",commitRequestDataType:"application/json;charset=UTF-8",autoProgress:!1,logLevel:a.A.global.LOG_LEVEL_ERROR,selfReportSessionTime:!1,alwaysSendTotalTime:!1,renderCommonCommitFields:!1,strict_errors:!0,xhrHeaders:{},xhrWithCredentials:!1,responseHandler:function(e){return(0,r.sH)(this,void 0,void 0,(function(){var t,i,n;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return void 0===e?[3,2]:(n=(i=JSON).parse,[4,e.text()]);case 1:return null!==(t=n.apply(i,[r.sent()]))&&{}.hasOwnProperty.call(t,"result")?[2,{result:t.result,errorCode:t.errorCode?t.errorCode:t.result===a.A.global.SCORM_TRUE?0:101}]:200===e.status?[2,{result:a.A.global.SCORM_TRUE,errorCode:0}]:[2,{result:a.A.global.SCORM_FALSE,errorCode:101}];case 2:return[2,{result:a.A.global.SCORM_FALSE,errorCode:101}]}}))}))},requestHandler:function(e){return e},onLogMessage:function(e,t){switch(e){case a.A.global.LOG_LEVEL_ERROR:console.error(t);break;case a.A.global.LOG_LEVEL_WARNING:console.warn(t);break;case a.A.global.LOG_LEVEL_INFO:console.info(t);break;case a.A.global.LOG_LEVEL_DEBUG:console.debug?console.debug(t):console.log(t)}},scoItemIds:[],scoItemIdValidator:!1},u=function(){function e(e,t,i){this._cancelled=!1,this._API=e,this._timeout=setTimeout(this.wrapper.bind(this),t),this._callback=i}return e.prototype.cancel=function(){this._cancelled=!0,this._timeout&&clearTimeout(this._timeout)},e.prototype.wrapper=function(){var e=this;this._cancelled||(0,r.sH)(e,void 0,void 0,(function(){return(0,r.YH)(this,(function(e){switch(e.label){case 0:return[4,this._API.commit(this._callback)];case 1:return[2,e.sent()]}}))}))},e}(),_=function(){function e(t,i){var r=this.constructor;if(this._settings=l,r===e)throw new TypeError("Cannot construct BaseAPI instances directly");this.currentState=a.A.global.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[],this._error_codes=t,i&&(this.settings=i),this.apiLogLevel=this.settings.logLevel,this.selfReportSessionTime=this.settings.selfReportSessionTime}return e.prototype.commonReset=function(e){this.settings=(0,r.Cl)((0,r.Cl)({},this.settings),e),this.currentState=a.A.global.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[]},e.prototype.initialize=function(e,t,i){var r=a.A.global.SCORM_FALSE;return this.isInitialized()?this.throwSCORMError(this._error_codes.INITIALIZED,t):this.isTerminated()?this.throwSCORMError(this._error_codes.TERMINATED,i):(this.selfReportSessionTime&&this.cmi.setStartTime(),this.currentState=a.A.global.STATE_INITIALIZED,this.lastErrorCode="0",r=a.A.global.SCORM_TRUE,this.processListeners(e)),this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(r),r},e.prototype.apiLog=function(e,t,i,r){t=(0,c.hw)(e,t,r),i>=this.apiLogLevel&&this.settings.onLogMessage(i,t)},Object.defineProperty(e.prototype,"error_codes",{get:function(){return this._error_codes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"settings",{get:function(){return this._settings},set:function(e){this._settings=(0,r.Cl)((0,r.Cl)({},this._settings),e)},enumerable:!1,configurable:!0}),e.prototype.terminate=function(e,t){return(0,r.sH)(this,void 0,void 0,(function(){var i,n;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return i=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.TERMINATION_BEFORE_INIT,this._error_codes.MULTIPLE_TERMINATION)?(this.currentState=a.A.global.STATE_TERMINATED,[4,this.storeData(!0)]):[3,2];case 1:void 0!==(n=r.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),i=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,t&&(this.lastErrorCode="0"),i=a.A.global.SCORM_TRUE,this.processListeners(e),r.label=2;case 2:return this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(i),[2,i]}}))}))},e.prototype.getValue=function(e,t,i){var r="";if(this.checkState(t,this._error_codes.RETRIEVE_BEFORE_INIT,this._error_codes.RETRIEVE_AFTER_TERM)){t&&(this.lastErrorCode="0");try{r=this.getCMIValue(i)}catch(e){r=this.handleValueAccessException(e,r)}this.processListeners(e,i)}return this.apiLog(e,": returned: "+r,a.A.global.LOG_LEVEL_INFO,i),void 0===r?"":(this.clearSCORMError(r),r)},e.prototype.setValue=function(e,t,i,r,n){void 0!==n&&(n=String(n));var o=a.A.global.SCORM_FALSE;if(this.checkState(i,this._error_codes.STORE_BEFORE_INIT,this._error_codes.STORE_AFTER_TERM)){i&&(this.lastErrorCode="0");try{o=this.setCMIValue(r,n)}catch(e){this.handleValueAccessException(e,o)}this.processListeners(e,r,n)}return void 0===o&&(o=a.A.global.SCORM_FALSE),"0"===String(this.lastErrorCode)&&this.settings.autocommit&&!this._timeout&&this.scheduleCommit(1e3*this.settings.autocommitSeconds,t),this.apiLog(e,": "+n+": result: "+o,a.A.global.LOG_LEVEL_INFO,r),this.clearSCORMError(o),o},e.prototype.commit=function(e){return(0,r.sH)(this,arguments,void 0,(function(e,t){var i,n;return void 0===t&&(t=!1),(0,r.YH)(this,(function(r){switch(r.label){case 0:return this.clearScheduledCommit(),i=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.COMMIT_BEFORE_INIT,this._error_codes.COMMIT_AFTER_TERM)?[4,this.storeData(!1)]:[3,2];case 1:(n=r.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),i=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,this.apiLog(e," Result: "+i,a.A.global.LOG_LEVEL_DEBUG,"HttpRequest"),t&&(this.lastErrorCode="0"),this.processListeners(e),r.label=2;case 2:return this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(i),[2,i]}}))}))},e.prototype.getLastError=function(e){var t=String(this.lastErrorCode);return this.processListeners(e),this.apiLog(e,"returned: "+t,a.A.global.LOG_LEVEL_INFO),t},e.prototype.getErrorString=function(e,t){var i="";return null!==t&&""!==t&&(i=this.getLmsErrorMessageDetails(t),this.processListeners(e)),this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),i},e.prototype.getDiagnostic=function(e,t){var i="";return null!==t&&""!==t&&(i=this.getLmsErrorMessageDetails(t,!0),this.processListeners(e)),this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),i},e.prototype.checkState=function(e,t,i){return this.isNotInitialized()?(this.throwSCORMError(t),!1):!e||!this.isTerminated()||(this.throwSCORMError(i),!1)},e.prototype.getLmsErrorMessageDetails=function(e,t){throw void 0===t&&(t=!1),new Error("The getLmsErrorMessageDetails method has not been implemented")},e.prototype.getCMIValue=function(e){throw new Error("The getCMIValue method has not been implemented")},e.prototype.setCMIValue=function(e,t){throw new Error("The setCMIValue method has not been implemented")},e.prototype._commonSetCMIValue=function(e,t,i,o){if(!i||""===i)return a.A.global.SCORM_FALSE;for(var s=i.split("."),l=this,u=a.A.global.SCORM_FALSE,_=!1,d="The data model element passed to ".concat(e," (").concat(i,") is not a valid SCORM data model element."),h=t?this._error_codes.UNDEFINED_DATA_MODEL:this._error_codes.GENERAL,m=0;m1&&(s=e.replace(o+".","")),this.listenerArray.push({functionName:o,CMIElement:s,callback:t}),this.apiLog("on","Added event listener: ".concat(this.listenerArray.length),a.A.global.LOG_LEVEL_INFO,o)}},e.prototype.off=function(e,t){if(t)for(var i=e.split(" "),r=function(r){var o=i[r].split(".");if(0===o.length)return{value:void 0};var s=o[0],c=null;o.length>1&&(c=e.replace(s+".",""));var l=n.listenerArray.findIndex((function(e){return e.functionName===s&&e.CMIElement===c&&e.callback===t}));-1!==l&&(n.listenerArray.splice(l,1),n.apiLog("off","Removed event listener: ".concat(n.listenerArray.length),a.A.global.LOG_LEVEL_INFO,s))},n=this,o=0;o1&&(s=e.replace(o+".","")),r.listenerArray=r.listenerArray.filter((function(e){return e.functionName!==o&&e.CMIElement!==s}))},r=this,n=0;ns?1:0})),s.forEach((function(e){(r={})[e[0]]=e[1],i.loadFromJSON((0,c.sB)(r),t)}))}else console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize.");function a(e,t,i){var r,n=e.match(i);if(null!==n&&null!==(r=t.match(i))){var o=Number(n[2]),s=Number(r[2]);return o===s?"id"===n[3]?-1:"type"===n[3]?"id"===r[3]?1:-1:1:o-s}return null}},e.prototype.loadFromJSON=function(e,t){if(this.isNotInitialized()){for(var i in t=void 0!==t?t:"cmi",this.startingData=e,e)if({}.hasOwnProperty.call(e,i)&&e[i]){var r=(t?t+".":"")+i,n=e[i];if(n.childArray)for(var o=0;o=200&&e.status<=299&&(!0===t.result||t.result===a.A.global.SCORM_TRUE)?this.processListeners("CommitSuccess"):this.processListeners("CommitError"),[2,t]}}))}))},e}(),d=_},941:function(e,t,i){i.d(t,{Scorm12Impl:function(){return h}});var r=i(635),n=i(989),o=i(864),s=i(340),a=i(797),c=i(176),l=i(833),u=i(331),_=i(417),d=i(56),h=function(e){function t(t){var i=this;return t&&void 0===t.mastery_override&&(t.mastery_override=!1),(i=e.call(this,a.A.scorm12,t)||this).statusSetByModule=!1,i.cmi=new n.Y,i.nav=new u.A,i.LMSInitialize=i.lmsInitialize,i.LMSFinish=i.lmsFinish,i.LMSGetValue=i.lmsGetValue,i.LMSSetValue=i.lmsSetValue,i.LMSCommit=i.lmsCommit,i.LMSGetLastError=i.lmsGetLastError,i.LMSGetErrorString=i.lmsGetErrorString,i.LMSGetDiagnostic=i.lmsGetDiagnostic,i}return(0,r.C6)(t,e),t.prototype.reset=function(e){this.commonReset(e),this.cmi=new n.Y,this.nav=new u.A},t.prototype.lmsInitialize=function(){return this.cmi.initialize(),this.cmi.core.lesson_status?this.statusSetByModule=!0:this.cmi.core.lesson_status="not attempted",this.initialize("LMSInitialize","LMS was already initialized!","LMS is already finished!")},t.prototype.lmsFinish=function(){var e=this;return(0,r.sH)(e,void 0,void 0,(function(){return(0,r.YH)(this,(function(e){switch(e.label){case 0:return[4,this.internalFinish()];case 1:return e.sent(),[2]}}))})),s.A.global.SCORM_TRUE},t.prototype.internalFinish=function(){return(0,r.sH)(this,void 0,void 0,(function(){var e;return(0,r.YH)(this,(function(t){switch(t.label){case 0:return[4,this.terminate("LMSFinish",!0)];case 1:return(e=t.sent())===s.A.global.SCORM_TRUE&&(""!==this.nav.event?"continue"===this.nav.event?this.processListeners("SequenceNext"):this.processListeners("SequencePrevious"):this.settings.autoProgress&&this.processListeners("SequenceNext")),[2,e]}}))}))},t.prototype.lmsGetValue=function(e){return this.getValue("LMSGetValue",!1,e)},t.prototype.lmsSetValue=function(e,t){return"cmi.core.lesson_status"===e&&(this.statusSetByModule=!0),this.setValue("LMSSetValue","LMSCommit",!1,e,t)},t.prototype.lmsCommit=function(){var e=this;return(0,r.sH)(e,void 0,void 0,(function(){return(0,r.YH)(this,(function(e){switch(e.label){case 0:return[4,this.commit("LMSCommit",!1)];case 1:return e.sent(),[2]}}))})),s.A.global.SCORM_TRUE},t.prototype.lmsGetLastError=function(){return this.getLastError("LMSGetLastError")},t.prototype.lmsGetErrorString=function(e){return this.getErrorString("LMSGetErrorString",e)},t.prototype.lmsGetDiagnostic=function(e){return this.getDiagnostic("LMSGetDiagnostic",e)},t.prototype.setCMIValue=function(e,t){return this._commonSetCMIValue("LMSSetValue",!1,e,t)},t.prototype.getCMIValue=function(e){return this._commonGetCMIValue("getCMIValue",!1,e)},t.prototype.getChildElement=function(e,t,i){return(0,o.J6)(e,"cmi\\.objectives\\.\\d+")?new c.N:i&&(0,o.J6)(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")?new l.cb:i&&(0,o.J6)(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")?new l.Oh:!i&&(0,o.J6)(e,"cmi\\.interactions\\.\\d+")?new l.WP:null},t.prototype.validateCorrectResponse=function(e,t){},t.prototype.getLmsErrorMessageDetails=function(e,t){var i="No Error",r="No Error";return e=String(e),s.A.scorm12.error_descriptions[e]&&(i=s.A.scorm12.error_descriptions[e].basicMessage,r=s.A.scorm12.error_descriptions[e].detailMessage),t?r:i},t.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi},t.prototype.renderCommitCMI=function(e){var t=this.renderCMIToJSONObject();e&&(t.cmi.core.total_time=this.cmi.getCurrentTotalTime());var i=[],r=o.Bq(t);switch(this.settings.dataCommitFormat){case"flattened":return o.Bq(t);case"params":for(var n in r)({}).hasOwnProperty.call(r,n)&&i.push("".concat(n,"=").concat(r[n]));return i;default:return t}},t.prototype.renderCommitObject=function(e){var t=this.renderCommitCMI(e),i=this.cmi.getCurrentTotalTime(),r=o.f4(i,_.A.scorm12.CMITimespan),n=this.cmi.core.lesson_status,s=d.lC.unknown,a=d.YE.unknown;n&&(s="completed"===n||"passed"===n?d.lC.completed:d.lC.incomplete,"passed"===n?a=d.YE.passed:"failed"===n&&(a=d.YE.failed));var c=this.cmi.core.score,l=null;c&&(l={},Number.isNaN(Number.parseFloat(c.raw))||(l.raw=Number.parseFloat(c.raw)),Number.isNaN(Number.parseFloat(c.min))||(l.min=Number.parseFloat(c.min)),Number.isNaN(Number.parseFloat(c.max))||(l.max=Number.parseFloat(c.max)));var u={successStatus:a,completionStatus:s,runtimeData:t,totalTimeSeconds:r};return l&&(u.score=l),u},t.prototype.storeData=function(e){return(0,r.sH)(this,void 0,void 0,(function(){var t,i,n,o,a,c;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return e&&(t=this.cmi.core.lesson_status,this.cmi.core.lesson_status&&(this.statusSetByModule||"not attempted"!==this.cmi.core.lesson_status)||(this.cmi.core.lesson_status="completed"),"normal"===this.cmi.core.lesson_mode?"credit"===this.cmi.core.credit&&this.settings.mastery_override&&""!==this.cmi.student_data.mastery_score&&""!==this.cmi.core.score.raw&&(this.cmi.core.lesson_status=parseFloat(this.cmi.core.score.raw)>=parseFloat(this.cmi.student_data.mastery_score)?"passed":"failed"):"browse"===this.cmi.core.lesson_mode&&""===((null===(c=null===(a=null===(o=this.startingData)||void 0===o?void 0:o.cmi)||void 0===a?void 0:a.core)||void 0===c?void 0:c.lesson_status)||"")&&"not attempted"===t&&(this.cmi.core.lesson_status="browsed")),i=e||this.settings.alwaysSendTotalTime,n=this.settings.renderCommonCommitFields?this.renderCommitObject(i):this.renderCommitCMI(i),this.apiLogLevel===s.A.global.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(n)),"string"!=typeof this.settings.lmsCommitUrl?[3,2]:[4,this.processHttpRequest(this.settings.lmsCommitUrl,n,e)];case 1:return[2,r.sent()];case 2:return[2,{result:s.A.global.SCORM_TRUE,errorCode:0}]}}))}))},t}(i(900).A)},589:function(e,t,i){i.d(t,{B:function(){return c}});var r=i(635),n=i(319),o=i(797),s=i(784),a=o.A.scorm12,c=function(e){function t(t){var i=e.call(this)||this;return i.__children=t.children,i._errorCode=t.errorCode||a.GENERAL,i._errorClass=t.errorClass||s.$h,i.childArray=[],i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_count",{get:function(){return this.childArray.length},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;for(var e={},t=0;t=n[0]){if("*"===n[1]||e<=n[1])return!0;throw new r(i)}throw new r(i)}i.d(t,{W:function(){return n},q:function(){return r}})},989:function(e,t,i){i.d(t,{Y:function(){return g}});var r=i(635),n=i(340),o=i(797),s=i(417),a=i(784),c=i(319),l=i(915),u=i(434),_=i(864),d=function(e){function t(){var t=e.call(this)||this;return t.__children=n.A.scorm12.core_children,t._student_id="",t._student_name="",t._lesson_location="",t._credit="",t._lesson_status="not attempted",t._entry="",t._total_time="",t._lesson_mode="normal",t._exit="",t._session_time="00:00:00",t._suspend_data="",t.score=new u._({score_children:n.A.scorm12.score_children,score_range:s.A.scorm12.score_range,invalidErrorCode:o.A.scorm12.INVALID_SET_VALUE,invalidTypeCode:o.A.scorm12.TYPE_MISMATCH,invalidRangeCode:o.A.scorm12.VALUE_OUT_OF_RANGE,errorClass:a.tQ}),t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_id",{get:function(){return this._student_id},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._student_id=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_name",{get:function(){return this._student_name},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._student_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_location",{get:function(){return this._lesson_location},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString256,!0)&&(this._lesson_location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"credit",{get:function(){return this._credit},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._credit=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_status",{get:function(){return this._lesson_status},set:function(e){this.initialized?(0,l.p)(e,s.A.scorm12.CMIStatus)&&(this._lesson_status=e):(0,l.p)(e,s.A.scorm12.CMIStatus2)&&(this._lesson_status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"entry",{get:function(){return this._entry},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._entry=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"total_time",{get:function(){return this._total_time},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._total_time=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_mode",{get:function(){return this._lesson_mode},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._lesson_mode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"exit",{get:function(){if(!this.jsonString)throw new a.tQ(o.A.scorm12.WRITE_ONLY_ELEMENT);return this._exit},set:function(e){(0,l.p)(e,s.A.scorm12.CMIExit,!0)&&(this._exit=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"session_time",{get:function(){if(!this.jsonString)throw new a.tQ(o.A.scorm12.WRITE_ONLY_ELEMENT);return this._session_time},set:function(e){(0,l.p)(e,s.A.scorm12.CMITimespan)&&(this._session_time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"suspend_data",{get:function(){return this._suspend_data},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString4096,!0)&&(this._suspend_data=e)},enumerable:!1,configurable:!0}),t.prototype.getCurrentTotalTime=function(e){var t=this._session_time,i=e;if(null!=i){var r=(new Date).getTime()-i;t=_.UZ(r/1e3)}return _.HT(this._total_time,t,new RegExp(s.A.scorm12.CMITimespan))},t.prototype.toJSON=function(){this.jsonString=!0;var e={student_id:this.student_id,student_name:this.student_name,lesson_location:this.lesson_location,credit:this.credit,lesson_status:this.lesson_status,entry:this.entry,lesson_mode:this.lesson_mode,exit:this.exit,session_time:this.session_time,score:this.score};return delete this.jsonString,e},t}(c.J),h=i(176),m=i(532),f=i(181),p=i(833),g=function(e){function t(t,i,r){var o=e.call(this)||this;return o.__children="",o.__version="3.4",o._launch_data="",o._comments="",o._comments_from_lms="",r&&o.initialize(),o.__children=t||n.A.scorm12.cmi_children,o.core=new d,o.objectives=new h.C,o.student_data=i||new m.X,o.student_preference=new f.G,o.interactions=new p.Xb,o}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t,i,r,n,o;e.prototype.initialize.call(this),null===(t=this.core)||void 0===t||t.initialize(),null===(i=this.objectives)||void 0===i||i.initialize(),null===(r=this.student_data)||void 0===r||r.initialize(),null===(n=this.student_preference)||void 0===n||n.initialize(),null===(o=this.interactions)||void 0===o||o.initialize()},t.prototype.toJSON=function(){this.jsonString=!0;var e={suspend_data:this.suspend_data,launch_data:this.launch_data,comments:this.comments,comments_from_lms:this.comments_from_lms,core:this.core,objectives:this.objectives,student_data:this.student_data,student_preference:this.student_preference,interactions:this.interactions};return delete this.jsonString,e},Object.defineProperty(t.prototype,"_version",{get:function(){return this.__version},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"suspend_data",{get:function(){var e;return null===(e=this.core)||void 0===e?void 0:e.suspend_data},set:function(e){this.core&&(this.core.suspend_data=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"launch_data",{get:function(){return this._launch_data},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._launch_data=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"comments",{get:function(){return this._comments},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString4096,!0)&&(this._comments=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"comments_from_lms",{get:function(){return this._comments_from_lms},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._comments_from_lms=e},enumerable:!1,configurable:!0}),t.prototype.getCurrentTotalTime=function(){return this.core.getCurrentTotalTime(this.start_time)},t}(c.r)},833:function(e,t,i){i.d(t,{Oh:function(){return h},WP:function(){return d},Xb:function(){return _},cb:function(){return m}});var r=i(635),n=i(589),o=i(340),s=i(797),a=i(784),c=i(319),l=i(915),u=i(417),_=function(e){function t(){return e.call(this,{children:o.A.scorm12.interactions_children,errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ})||this}return(0,r.C6)(t,e),t}(n.B),d=function(e){function t(){var t=e.call(this)||this;return t._id="",t._time="",t._type="",t._weighting="",t._student_response="",t._result="",t._latency="",t.objectives=new n.B({errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ,children:o.A.scorm12.objectives_children}),t.correct_responses=new n.B({errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ,children:o.A.scorm12.correct_responses_children}),t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t,i;e.prototype.initialize.call(this),null===(t=this.objectives)||void 0===t||t.initialize(),null===(i=this.correct_responses)||void 0===i||i.initialize()},Object.defineProperty(t.prototype,"id",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._id},set:function(e){(0,l.p)(e,u.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._time},set:function(e){(0,l.p)(e,u.A.scorm12.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._type},set:function(e){(0,l.p)(e,u.A.scorm12.CMIType)&&(this._type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weighting",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._weighting},set:function(e){(0,l.p)(e,u.A.scorm12.CMIDecimal)&&(0,l.h)(e,u.A.scorm12.weighting_range)&&(this._weighting=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_response",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._student_response},set:function(e){(0,l.p)(e,u.A.scorm12.CMIFeedback,!0)&&(this._student_response=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"result",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._result},set:function(e){(0,l.p)(e,u.A.scorm12.CMIResult)&&(this._result=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"latency",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._latency},set:function(e){(0,l.p)(e,u.A.scorm12.CMITimespan)&&(this._latency=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,time:this.time,type:this.type,weighting:this.weighting,student_response:this.student_response,result:this.result,latency:this.latency,objectives:this.objectives,correct_responses:this.correct_responses};return delete this.jsonString,e},t}(c.J),h=function(e){function t(){var t=e.call(this)||this;return t._id="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(e){(0,l.p)(e,u.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id};return delete this.jsonString,e},t}(c.J),m=function(e){function t(){var t=e.call(this)||this;return t._pattern="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"pattern",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._pattern},set:function(e){(0,l.p)(e,u.A.scorm12.CMIFeedback,!0)&&(this._pattern=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={pattern:this._pattern};return delete this.jsonString,e},t}(c.J)},331:function(e,t,i){i.d(t,{A:function(){return a}});var r=i(635),n=i(319),o=i(915),s=i(417),a=function(e){function t(){var t=e.call(this)||this;return t._event="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"event",{get:function(){return this._event},set:function(e){(0,o.p)(e,s.A.scorm12.NAVEvent)&&(this._event=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={event:this.event};return delete this.jsonString,e},t}(n.J)},176:function(e,t,i){i.d(t,{C:function(){return _},N:function(){return d}});var r=i(635),n=i(319),o=i(434),s=i(340),a=i(417),c=i(797),l=i(784),u=i(915),_=function(e){function t(){return e.call(this,{children:s.A.scorm12.objectives_children,errorCode:c.A.scorm12.INVALID_SET_VALUE,errorClass:l.tQ})||this}return(0,r.C6)(t,e),t}(i(589).B),d=function(e){function t(){var t=e.call(this)||this;return t._id="",t._status="",t.score=new o._({score_children:s.A.scorm12.score_children,score_range:a.A.scorm12.score_range,invalidErrorCode:c.A.scorm12.INVALID_SET_VALUE,invalidTypeCode:c.A.scorm12.TYPE_MISMATCH,invalidRangeCode:c.A.scorm12.VALUE_OUT_OF_RANGE,errorClass:l.tQ}),t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(e){(0,u.p)(e,a.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},set:function(e){(0,u.p)(e,a.A.scorm12.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,status:this.status,score:this.score};return delete this.jsonString,e},t}(n.J)},532:function(e,t,i){i.d(t,{X:function(){return c}});var r=i(635),n=i(319),o=i(340),s=i(784),a=i(797),c=function(e){function t(t){var i=e.call(this)||this;return i._mastery_score="",i._max_time_allowed="",i._time_limit_action="",i.__children=t||o.A.scorm12.student_data_children,i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new s.tQ(a.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mastery_score",{get:function(){return this._mastery_score},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._mastery_score=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"max_time_allowed",{get:function(){return this._max_time_allowed},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._max_time_allowed=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time_limit_action",{get:function(){return this._time_limit_action},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._time_limit_action=e},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={mastery_score:this.mastery_score,max_time_allowed:this.max_time_allowed,time_limit_action:this.time_limit_action};return delete this.jsonString,e},t}(n.J)},181:function(e,t,i){i.d(t,{G:function(){return u}});var r=i(635),n=i(319),o=i(340),s=i(784),a=i(797),c=i(915),l=i(417),u=function(e){function t(t){var i=e.call(this)||this;return i._audio="",i._language="",i._speed="",i._text="",i.__children=t||o.A.scorm12.student_preference_children,i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new s.tQ(a.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audio",{get:function(){return this._audio},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.audio_range)&&(this._audio=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"language",{get:function(){return this._language},set:function(e){(0,c.p)(e,l.A.scorm12.CMIString256)&&(this._language=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speed",{get:function(){return this._speed},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.speed_range)&&(this._speed=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this._text},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.text_range)&&(this._text=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,speed:this.speed,text:this.text};return delete this.jsonString,e},t}(n.J)},915:function(e,t,i){i.d(t,{h:function(){return a},p:function(){return s}});var r=i(449),n=i(797),o=i(784);function s(e,t,i){return(0,r.q)(e,t,n.A.scorm12.TYPE_MISMATCH,o.tQ,i)}function a(e,t,i){if(!i&&""===e)throw new o.tQ(n.A.scorm12.VALUE_OUT_OF_RANGE);return(0,r.W)(e,t,n.A.scorm12.VALUE_OUT_OF_RANGE,o.tQ)}},340:function(e,t,i){var r=i(635),n={cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",core_children:"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time",score_children:"raw,min,max",comments_children:"content,location,time",objectives_children:"id,score,status",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio,language,speed,text",interactions_children:"id,objectives,time,type,correct_responses,weighting,student_response,result,latency",error_descriptions:{101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information"},201:{basicMessage:"Invalid argument error",detailMessage:"Indicates that an argument represents an invalid data model element or is otherwise incorrect."},202:{basicMessage:"Element cannot have children",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.'},203:{basicMessage:"Element not an array - cannot have count",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.'},301:{basicMessage:"Not initialized",detailMessage:"Indicates that an API call was made before the call to lmsInitialize."},401:{basicMessage:"Not implemented error",detailMessage:"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement."},402:{basicMessage:"Invalid set value, element is a keyword",detailMessage:'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").'},403:{basicMessage:"Element is read only",detailMessage:"LMSSetValue was called with a data model element that can only be read."},404:{basicMessage:"Element is write only",detailMessage:"LMSGetValue was called on a data model element that can only be written to."},405:{basicMessage:"Incorrect Data Type",detailMessage:"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Element Value Out Of Range",detailMessage:"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}},o={global:{SCORM_TRUE:"true",SCORM_FALSE:"false",STATE_NOT_INITIALIZED:0,STATE_INITIALIZED:1,STATE_TERMINATED:2,LOG_LEVEL_DEBUG:1,LOG_LEVEL_INFO:2,LOG_LEVEL_WARNING:3,LOG_LEVEL_ERROR:4,LOG_LEVEL_NONE:5},scorm12:n,aicc:(0,r.Cl)((0,r.Cl)({},n),{cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation",student_preference_children:"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows",student_data_children:"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action",student_demographics_children:"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience",tries_children:"time,status,score",attempt_records_children:"score,lesson_status",paths_children:"location_id,date,time,status,why_left,time_in_element"}),scorm2004:{cmi_children:"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time",comments_children:"comment,timestamp,location",score_children:"max,raw,scaled,min",objectives_children:"progress_measure,completion_status,success_status,description,score,id",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio_level,audio_captioning,delivery_speed,language",interactions_children:"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description",error_descriptions:{0:{basicMessage:"No Error",detailMessage:"No error occurred, the previous API call was successful."},101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use GetDiagnostic for more information."},102:{basicMessage:"General Initialization Failure",detailMessage:"Call to Initialize failed for an unknown reason."},103:{basicMessage:"Already Initialized",detailMessage:"Call to Initialize failed because Initialize was already called."},104:{basicMessage:"Content Instance Terminated",detailMessage:"Call to Initialize failed because Terminate was already called."},111:{basicMessage:"General Termination Failure",detailMessage:"Call to Terminate failed for an unknown reason."},112:{basicMessage:"Termination Before Initialization",detailMessage:"Call to Terminate failed because it was made before the call to Initialize."},113:{basicMessage:"Termination After Termination",detailMessage:"Call to Terminate failed because Terminate was already called."},122:{basicMessage:"Retrieve Data Before Initialization",detailMessage:"Call to GetValue failed because it was made before the call to Initialize."},123:{basicMessage:"Retrieve Data After Termination",detailMessage:"Call to GetValue failed because it was made after the call to Terminate."},132:{basicMessage:"Store Data Before Initialization",detailMessage:"Call to SetValue failed because it was made before the call to Initialize."},133:{basicMessage:"Store Data After Termination",detailMessage:"Call to SetValue failed because it was made after the call to Terminate."},142:{basicMessage:"Commit Before Initialization",detailMessage:"Call to Commit failed because it was made before the call to Initialize."},143:{basicMessage:"Commit After Termination",detailMessage:"Call to Commit failed because it was made after the call to Terminate."},201:{basicMessage:"General Argument Error",detailMessage:"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument."},301:{basicMessage:"General Get Failure",detailMessage:"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},351:{basicMessage:"General Set Failure",detailMessage:"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},391:{basicMessage:"General Commit Failure",detailMessage:"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information."},401:{basicMessage:"Undefined Data Model Element",detailMessage:"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element."},402:{basicMessage:"Unimplemented Data Model Element",detailMessage:"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant."},403:{basicMessage:"Data Model Element Value Not Initialized",detailMessage:"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO."},404:{basicMessage:"Data Model Element Is Read Only",detailMessage:"SetValue was called with a data model element that can only be read."},405:{basicMessage:"Data Model Element Is Write Only",detailMessage:"GetValue was called on a data model element that can only be written to."},406:{basicMessage:"Data Model Element Type Mismatch",detailMessage:"SetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Data Model Element Value Out Of Range",detailMessage:"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}}};t.A=o},56:function(e,t,i){var r,n,o;i.d(t,{YE:function(){return n},lC:function(){return o}}),function(e){e.unknown="unknown",e.true="true",e.false="false"}(r||(r={})),function(e){e.passed="passed",e.failed="failed",e.unknown="unknown"}(n||(n={})),function(e){e.completed="completed",e.incomplete="incomplete",e.unknown="unknown"}(o||(o={}))},797:function(e,t,i){var r=i(635),n={GENERAL:101,INITIALIZATION_FAILED:101,INITIALIZED:101,TERMINATED:101,TERMINATION_FAILURE:101,TERMINATION_BEFORE_INIT:101,MULTIPLE_TERMINATION:101,RETRIEVE_BEFORE_INIT:101,RETRIEVE_AFTER_TERM:101,STORE_BEFORE_INIT:101,STORE_AFTER_TERM:101,COMMIT_BEFORE_INIT:101,COMMIT_AFTER_TERM:101,ARGUMENT_ERROR:101,CHILDREN_ERROR:101,COUNT_ERROR:101,GENERAL_GET_FAILURE:101,GENERAL_SET_FAILURE:101,GENERAL_COMMIT_FAILURE:101,UNDEFINED_DATA_MODEL:101,UNIMPLEMENTED_ELEMENT:101,VALUE_NOT_INITIALIZED:101,INVALID_SET_VALUE:101,READ_ONLY_ELEMENT:101,WRITE_ONLY_ELEMENT:101,TYPE_MISMATCH:101,VALUE_OUT_OF_RANGE:101,DEPENDENCY_NOT_ESTABLISHED:101},o={scorm12:(0,r.Cl)((0,r.Cl)({},n),{RETRIEVE_BEFORE_INIT:301,STORE_BEFORE_INIT:301,COMMIT_BEFORE_INIT:301,ARGUMENT_ERROR:201,CHILDREN_ERROR:202,COUNT_ERROR:203,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:401,VALUE_NOT_INITIALIZED:301,INVALID_SET_VALUE:402,READ_ONLY_ELEMENT:403,WRITE_ONLY_ELEMENT:404,TYPE_MISMATCH:405,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408}),scorm2004:(0,r.Cl)((0,r.Cl)({},n),{INITIALIZATION_FAILED:102,INITIALIZED:103,TERMINATED:104,TERMINATION_FAILURE:111,TERMINATION_BEFORE_INIT:112,MULTIPLE_TERMINATIONS:113,RETRIEVE_BEFORE_INIT:122,RETRIEVE_AFTER_TERM:123,STORE_BEFORE_INIT:132,STORE_AFTER_TERM:133,COMMIT_BEFORE_INIT:142,COMMIT_AFTER_TERM:143,ARGUMENT_ERROR:201,GENERAL_GET_FAILURE:301,GENERAL_SET_FAILURE:351,GENERAL_COMMIT_FAILURE:391,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:402,VALUE_NOT_INITIALIZED:403,READ_ONLY_ELEMENT:404,WRITE_ONLY_ELEMENT:405,TYPE_MISMATCH:406,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408})};t.A=o},417:function(e,t,i){var r=i(635),n={CMIString256:"^.{0,255}$",CMIString4096:"^.{0,4096}$",CMITime:"^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",CMITimespan:"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{0,3})(.[0-9]*)?$",CMIIdentifier:"^[\\u0021-\\u007E\\s]{0,255}$",CMIFeedback:"^.{0,255}$",CMIIndex:"[._](\\d+).",CMIStatus:"^(passed|completed|failed|incomplete|browsed)$",CMIStatus2:"^(passed|completed|failed|incomplete|browsed|not attempted)$",CMIExit:"^(time-out|suspend|logout|)$",CMIType:"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$",CMIResult:"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$",NAVEvent:"^(previous|continue)$",score_range:"0#100",audio_range:"-1#100",speed_range:"-100#100",weighting_range:"-100#100",text_range:"-1#1"},o={aicc:(0,r.Cl)((0,r.Cl)({},n),{CMIIdentifier:"^\\w{1,255}$"}),scorm12:n,scorm2004:{CMIString200:"^[\\u0000-\\uFFFF]{0,200}$",CMIString250:"^[\\u0000-\\uFFFF]{0,250}$",CMIString1000:"^[\\u0000-\\uFFFF]{0,1000}$",CMIString4000:"^[\\u0000-\\uFFFF]{0,4000}$",CMIString64000:"^[\\u0000-\\uFFFF]{0,64000}$",CMILang:"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$",CMILangString250:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$",CMILangcr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$",CMILangString250cr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$",CMILangString4000:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$",CMITime:"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$",CMITimespan:"^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{1,5})(\\.[0-9]{1,18})?$",CMIIdentifier:"^\\S{1,250}[a-zA-Z0-9]$",CMIShortIdentifier:"^[\\w\\.\\-\\_]{1,250}$",CMILongIdentifier:"^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$",CMIFeedback:"^.*$",CMIIndex:"[._](\\d+).",CMIIndexStore:".N(\\d+).",CMICStatus:"^(completed|incomplete|not attempted|unknown)$",CMISStatus:"^(passed|failed|unknown)$",CMIExit:"^(time-out|suspend|logout|normal)$",CMIType:"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",CMIResult:"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",NAVEvent:"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$",NAVBoolean:"^(unknown|true|false$)",NAVTarget:"^{target=\\S{0,}[a-zA-Z0-9-_]+}$",scaled_range:"-1#1",audio_range:"0#*",speed_range:"0#*",text_range:"-1#1",progress_range:"0#1"}};t.A=o},784:function(e,t,i){i.d(t,{$h:function(){return c},gv:function(){return _},tQ:function(){return u},yI:function(){return l}});var r=i(635),n=i(340),o=n.A.scorm12.error_descriptions,s=n.A.aicc.error_descriptions,a=n.A.scorm2004.error_descriptions,c=function(e){function t(t){var i=e.call(this,t.toString())||this;return i._errorCode=t,i.name="ScormValidationError",i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"errorCode",{get:function(){return this._errorCode},enumerable:!1,configurable:!0}),t.prototype.setMessage=function(e){this.message=e},t}(Error),l=function(e){function t(t,i,r){var n=e.call(this,t)||this;return n._detailedMessage="",n.setMessage(i),n._errorMessage=i,r&&(n._detailedMessage=r),n}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"errorMessage",{get:function(){return this._errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"detailedMessage",{get:function(){return this._detailedMessage},enumerable:!1,configurable:!0}),t}(c),u=function(e){function t(t){return{}.hasOwnProperty.call(o,String(t))?e.call(this,t,o[String(t)].basicMessage,o[String(t)].detailMessage)||this:e.call(this,101,o[101].basicMessage,o[101].detailMessage)||this}return(0,r.C6)(t,e),t}(l),_=function(e){function t(t){return{}.hasOwnProperty.call(s,String(t))?e.call(this,t,s[String(t)].basicMessage,s[String(t)].detailMessage)||this:e.call(this,101,s[101].basicMessage,s[101].detailMessage)||this}return(0,r.C6)(t,e),t}(l);!function(e){function t(t){return{}.hasOwnProperty.call(a,String(t))?e.call(this,t,a[String(t)].basicMessage,a[String(t)].detailMessage)||this:e.call(this,101,a[101].basicMessage,a[101].detailMessage)||this}(0,r.C6)(t,e)}(l)},864:function(e,t,i){i.d(t,{Bq:function(){return a},HT:function(){return s},J6:function(){return _},UZ:function(){return n},f4:function(){return o},hw:function(){return u},sB:function(){return c}});var r=3600;function n(e){if(!e||e<=0)return"00:00:00";var t=Math.floor(e/r),i=new Date(1e3*e),n=i.getUTCMinutes(),o=i.getSeconds(),s=e%1,a="";return l(s)>0&&(a="."+(a=l(s)>2?s.toFixed(2):String(s)).split(".")[1]),(t+":"+n+":"+o).replace(/\b\d\b/g,"0$&")+a}function o(e,t){if("number"!=typeof e&&"boolean"!=typeof e||(e=String(e)),"string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var i=e.split(":");return 3600*Number(i[0])+60*Number(i[1])+Number(i[2])}function s(e,t,i){return"string"==typeof i&&(i=new RegExp(i)),n(o(e,i)+o(t,i))}function a(e){var t={};return function e(i,r){if(Object(i)!==i)t[r]=i;else if(Array.isArray(i))for(var n=0,o=i.length;n0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]=this.apiLogLevel&&this.settings.onLogMessage(i,t)},Object.defineProperty(e.prototype,"error_codes",{get:function(){return this._error_codes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"settings",{get:function(){return this._settings},set:function(e){this._settings=(0,r.Cl)((0,r.Cl)({},this._settings),e)},enumerable:!1,configurable:!0}),e.prototype.terminate=function(e,t){return(0,r.sH)(this,void 0,void 0,(function(){var i,n;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return i=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.TERMINATION_BEFORE_INIT,this._error_codes.MULTIPLE_TERMINATION)?(this.currentState=a.A.global.STATE_TERMINATED,[4,this.storeData(!0)]):[3,2];case 1:void 0!==(n=r.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),i=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,t&&(this.lastErrorCode="0"),i=a.A.global.SCORM_TRUE,this.processListeners(e),r.label=2;case 2:return this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(i),[2,i]}}))}))},e.prototype.getValue=function(e,t,i){var r="";if(this.checkState(t,this._error_codes.RETRIEVE_BEFORE_INIT,this._error_codes.RETRIEVE_AFTER_TERM)){t&&(this.lastErrorCode="0");try{r=this.getCMIValue(i)}catch(e){r=this.handleValueAccessException(e,r)}this.processListeners(e,i)}return this.apiLog(e,": returned: "+r,a.A.global.LOG_LEVEL_INFO,i),void 0===r?"":(this.clearSCORMError(r),r)},e.prototype.setValue=function(e,t,i,r,n){void 0!==n&&(n=String(n));var o=a.A.global.SCORM_FALSE;if(this.checkState(i,this._error_codes.STORE_BEFORE_INIT,this._error_codes.STORE_AFTER_TERM)){i&&(this.lastErrorCode="0");try{o=this.setCMIValue(r,n)}catch(e){this.handleValueAccessException(e,o)}this.processListeners(e,r,n)}return void 0===o&&(o=a.A.global.SCORM_FALSE),"0"===String(this.lastErrorCode)&&this.settings.autocommit&&!this._timeout&&this.scheduleCommit(1e3*this.settings.autocommitSeconds,t),this.apiLog(e,": "+n+": result: "+o,a.A.global.LOG_LEVEL_INFO,r),this.clearSCORMError(o),o},e.prototype.commit=function(e){return(0,r.sH)(this,arguments,void 0,(function(e,t){var i,n;return void 0===t&&(t=!1),(0,r.YH)(this,(function(r){switch(r.label){case 0:return this.clearScheduledCommit(),i=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.COMMIT_BEFORE_INIT,this._error_codes.COMMIT_AFTER_TERM)?[4,this.storeData(!1)]:[3,2];case 1:(n=r.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),i=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,this.apiLog(e," Result: "+i,a.A.global.LOG_LEVEL_DEBUG,"HttpRequest"),t&&(this.lastErrorCode="0"),this.processListeners(e),r.label=2;case 2:return this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(i),[2,i]}}))}))},e.prototype.getLastError=function(e){var t=String(this.lastErrorCode);return this.processListeners(e),this.apiLog(e,"returned: "+t,a.A.global.LOG_LEVEL_INFO),t},e.prototype.getErrorString=function(e,t){var i="";return null!==t&&""!==t&&(i=this.getLmsErrorMessageDetails(t),this.processListeners(e)),this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),i},e.prototype.getDiagnostic=function(e,t){var i="";return null!==t&&""!==t&&(i=this.getLmsErrorMessageDetails(t,!0),this.processListeners(e)),this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),i},e.prototype.checkState=function(e,t,i){return this.isNotInitialized()?(this.throwSCORMError(t),!1):!e||!this.isTerminated()||(this.throwSCORMError(i),!1)},e.prototype.getLmsErrorMessageDetails=function(e,t){throw void 0===t&&(t=!1),new Error("The getLmsErrorMessageDetails method has not been implemented")},e.prototype.getCMIValue=function(e){throw new Error("The getCMIValue method has not been implemented")},e.prototype.setCMIValue=function(e,t){throw new Error("The setCMIValue method has not been implemented")},e.prototype._commonSetCMIValue=function(e,t,i,o){if(!i||""===i)return a.A.global.SCORM_FALSE;for(var s=i.split("."),l=this,u=a.A.global.SCORM_FALSE,_=!1,d="The data model element passed to ".concat(e," (").concat(i,") is not a valid SCORM data model element."),h=t?this._error_codes.UNDEFINED_DATA_MODEL:this._error_codes.GENERAL,m=0;m1&&(s=e.replace(o+".","")),this.listenerArray.push({functionName:o,CMIElement:s,callback:t}),this.apiLog("on","Added event listener: ".concat(this.listenerArray.length),a.A.global.LOG_LEVEL_INFO,o)}},e.prototype.off=function(e,t){if(t)for(var i=e.split(" "),r=function(r){var o=i[r].split(".");if(0===o.length)return{value:void 0};var s=o[0],c=null;o.length>1&&(c=e.replace(s+".",""));var l=n.listenerArray.findIndex((function(e){return e.functionName===s&&e.CMIElement===c&&e.callback===t}));-1!==l&&(n.listenerArray.splice(l,1),n.apiLog("off","Removed event listener: ".concat(n.listenerArray.length),a.A.global.LOG_LEVEL_INFO,s))},n=this,o=0;o1&&(s=e.replace(o+".","")),r.listenerArray=r.listenerArray.filter((function(e){return e.functionName!==o&&e.CMIElement!==s}))},r=this,n=0;ns?1:0})),s.forEach((function(e){(r={})[e[0]]=e[1],i.loadFromJSON((0,c.sB)(r),t)}))}else console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize.");function a(e,t,i){var r,n=e.match(i);if(null!==n&&null!==(r=t.match(i))){var o=Number(n[2]),s=Number(r[2]);return o===s?"id"===n[3]?-1:"type"===n[3]?"id"===r[3]?1:-1:1:o-s}return null}},e.prototype.loadFromJSON=function(e,t){if(this.isNotInitialized()){for(var i in t=void 0!==t?t:"cmi",this.startingData=e,e)if({}.hasOwnProperty.call(e,i)&&e[i]){var r=(t?t+".":"")+i,n=e[i];if(n.childArray)for(var o=0;o=200&&e.status<=299&&(!0===t.result||t.result===a.A.global.SCORM_TRUE)?this.processListeners("CommitSuccess"):this.processListeners("CommitError"),[2,t]}}))}))},e}(),d=_},941:function(e,t,i){i.d(t,{Scorm12Impl:function(){return h}});var r=i(635),n=i(989),o=i(864),s=i(340),a=i(797),c=i(176),l=i(833),u=i(331),_=i(417),d=i(56),h=function(e){function t(t){var i=this;return t&&void 0===t.mastery_override&&(t.mastery_override=!1),(i=e.call(this,a.A.scorm12,t)||this).statusSetByModule=!1,i.cmi=new n.Y,i.nav=new u.A,i.LMSInitialize=i.lmsInitialize,i.LMSFinish=i.lmsFinish,i.LMSGetValue=i.lmsGetValue,i.LMSSetValue=i.lmsSetValue,i.LMSCommit=i.lmsCommit,i.LMSGetLastError=i.lmsGetLastError,i.LMSGetErrorString=i.lmsGetErrorString,i.LMSGetDiagnostic=i.lmsGetDiagnostic,i}return(0,r.C6)(t,e),t.prototype.reset=function(e){this.commonReset(e),this.cmi=new n.Y,this.nav=new u.A},t.prototype.lmsInitialize=function(){return this.cmi.initialize(),this.cmi.core.lesson_status?this.statusSetByModule=!0:this.cmi.core.lesson_status="not attempted",this.initialize("LMSInitialize","LMS was already initialized!","LMS is already finished!")},t.prototype.lmsFinish=function(){var e=this;return(0,r.sH)(e,void 0,void 0,(function(){return(0,r.YH)(this,(function(e){switch(e.label){case 0:return[4,this.internalFinish()];case 1:return e.sent(),[2]}}))})),s.A.global.SCORM_TRUE},t.prototype.internalFinish=function(){return(0,r.sH)(this,void 0,void 0,(function(){var e;return(0,r.YH)(this,(function(t){switch(t.label){case 0:return[4,this.terminate("LMSFinish",!0)];case 1:return(e=t.sent())===s.A.global.SCORM_TRUE&&(""!==this.nav.event?"continue"===this.nav.event?this.processListeners("SequenceNext"):this.processListeners("SequencePrevious"):this.settings.autoProgress&&this.processListeners("SequenceNext")),[2,e]}}))}))},t.prototype.lmsGetValue=function(e){return this.getValue("LMSGetValue",!1,e)},t.prototype.lmsSetValue=function(e,t){return"cmi.core.lesson_status"===e&&(this.statusSetByModule=!0),this.setValue("LMSSetValue","LMSCommit",!1,e,t)},t.prototype.lmsCommit=function(){var e=this;return(0,r.sH)(e,void 0,void 0,(function(){return(0,r.YH)(this,(function(e){switch(e.label){case 0:return[4,this.commit("LMSCommit",!1)];case 1:return e.sent(),[2]}}))})),s.A.global.SCORM_TRUE},t.prototype.lmsGetLastError=function(){return this.getLastError("LMSGetLastError")},t.prototype.lmsGetErrorString=function(e){return this.getErrorString("LMSGetErrorString",e)},t.prototype.lmsGetDiagnostic=function(e){return this.getDiagnostic("LMSGetDiagnostic",e)},t.prototype.setCMIValue=function(e,t){return this._commonSetCMIValue("LMSSetValue",!1,e,t)},t.prototype.getCMIValue=function(e){return this._commonGetCMIValue("getCMIValue",!1,e)},t.prototype.getChildElement=function(e,t,i){return(0,o.J6)(e,"cmi\\.objectives\\.\\d+")?new c.N:i&&(0,o.J6)(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")?new l.cb:i&&(0,o.J6)(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")?new l.Oh:!i&&(0,o.J6)(e,"cmi\\.interactions\\.\\d+")?new l.WP:null},t.prototype.validateCorrectResponse=function(e,t){},t.prototype.getLmsErrorMessageDetails=function(e,t){var i="No Error",r="No Error";return e=String(e),s.A.scorm12.error_descriptions[e]&&(i=s.A.scorm12.error_descriptions[e].basicMessage,r=s.A.scorm12.error_descriptions[e].detailMessage),t?r:i},t.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi},t.prototype.renderCommitCMI=function(e){var t=this.renderCMIToJSONObject();e&&(t.cmi.core.total_time=this.cmi.getCurrentTotalTime());var i=[],r=o.Bq(t);switch(this.settings.dataCommitFormat){case"flattened":return o.Bq(t);case"params":for(var n in r)({}).hasOwnProperty.call(r,n)&&i.push("".concat(n,"=").concat(r[n]));return i;default:return t}},t.prototype.renderCommitObject=function(e){var t=this.renderCommitCMI(e),i=this.cmi.getCurrentTotalTime(),r=o.f4(i,_.A.scorm12.CMITimespan),n=this.cmi.core.lesson_status,s=d.lC.unknown,a=d.YE.unknown;n&&(s="completed"===n||"passed"===n?d.lC.completed:d.lC.incomplete,"passed"===n?a=d.YE.passed:"failed"===n&&(a=d.YE.failed));var c=this.cmi.core.score,l=null;c&&(l={},Number.isNaN(Number.parseFloat(c.raw))||(l.raw=Number.parseFloat(c.raw)),Number.isNaN(Number.parseFloat(c.min))||(l.min=Number.parseFloat(c.min)),Number.isNaN(Number.parseFloat(c.max))||(l.max=Number.parseFloat(c.max)));var u={successStatus:a,completionStatus:s,runtimeData:t,totalTimeSeconds:r};return l&&(u.score=l),u},t.prototype.storeData=function(e){return(0,r.sH)(this,void 0,void 0,(function(){var t,i,n,o,a,c;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return e&&(t=this.cmi.core.lesson_status,this.cmi.core.lesson_status&&(this.statusSetByModule||"not attempted"!==this.cmi.core.lesson_status)||(this.cmi.core.lesson_status="completed"),"normal"===this.cmi.core.lesson_mode?"credit"===this.cmi.core.credit&&this.settings.mastery_override&&""!==this.cmi.student_data.mastery_score&&""!==this.cmi.core.score.raw&&(this.cmi.core.lesson_status=parseFloat(this.cmi.core.score.raw)>=parseFloat(this.cmi.student_data.mastery_score)?"passed":"failed"):"browse"===this.cmi.core.lesson_mode&&""===((null===(c=null===(a=null===(o=this.startingData)||void 0===o?void 0:o.cmi)||void 0===a?void 0:a.core)||void 0===c?void 0:c.lesson_status)||"")&&"not attempted"===t&&(this.cmi.core.lesson_status="browsed")),i=e||this.settings.alwaysSendTotalTime,n=this.settings.renderCommonCommitFields?this.renderCommitObject(i):this.renderCommitCMI(i),this.apiLogLevel===s.A.global.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(n)),"string"!=typeof this.settings.lmsCommitUrl?[3,2]:[4,this.processHttpRequest(this.settings.lmsCommitUrl,n,e)];case 1:return[2,r.sent()];case 2:return[2,{result:s.A.global.SCORM_TRUE,errorCode:0}]}}))}))},t}(i(900).A)},589:function(e,t,i){i.d(t,{B:function(){return c}});var r=i(635),n=i(319),o=i(797),s=i(784),a=o.A.scorm12,c=function(e){function t(t){var i=e.call(this)||this;return i.__children=t.children,i._errorCode=t.errorCode||a.GENERAL,i._errorClass=t.errorClass||s.$h,i.childArray=[],i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_count",{get:function(){return this.childArray.length},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;for(var e={},t=0;t=n[0]){if("*"===n[1]||e<=n[1])return!0;throw new r(i)}throw new r(i)}i.d(t,{W:function(){return n},q:function(){return r}})},989:function(e,t,i){i.d(t,{Y:function(){return g}});var r=i(635),n=i(340),o=i(797),s=i(417),a=i(784),c=i(319),l=i(915),u=i(434),_=i(864),d=function(e){function t(){var t=e.call(this)||this;return t.__children=n.A.scorm12.core_children,t._student_id="",t._student_name="",t._lesson_location="",t._credit="",t._lesson_status="not attempted",t._entry="",t._total_time="",t._lesson_mode="normal",t._exit="",t._session_time="00:00:00",t._suspend_data="",t.score=new u._({score_children:n.A.scorm12.score_children,score_range:s.A.scorm12.score_range,invalidErrorCode:o.A.scorm12.INVALID_SET_VALUE,invalidTypeCode:o.A.scorm12.TYPE_MISMATCH,invalidRangeCode:o.A.scorm12.VALUE_OUT_OF_RANGE,errorClass:a.tQ}),t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_id",{get:function(){return this._student_id},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._student_id=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_name",{get:function(){return this._student_name},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._student_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_location",{get:function(){return this._lesson_location},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString256,!0)&&(this._lesson_location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"credit",{get:function(){return this._credit},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._credit=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_status",{get:function(){return this._lesson_status},set:function(e){this.initialized?(0,l.p)(e,s.A.scorm12.CMIStatus)&&(this._lesson_status=e):(0,l.p)(e,s.A.scorm12.CMIStatus2)&&(this._lesson_status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"entry",{get:function(){return this._entry},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._entry=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"total_time",{get:function(){return this._total_time},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._total_time=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_mode",{get:function(){return this._lesson_mode},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._lesson_mode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"exit",{get:function(){if(!this.jsonString)throw new a.tQ(o.A.scorm12.WRITE_ONLY_ELEMENT);return this._exit},set:function(e){(0,l.p)(e,s.A.scorm12.CMIExit,!0)&&(this._exit=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"session_time",{get:function(){if(!this.jsonString)throw new a.tQ(o.A.scorm12.WRITE_ONLY_ELEMENT);return this._session_time},set:function(e){(0,l.p)(e,s.A.scorm12.CMITimespan)&&(this._session_time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"suspend_data",{get:function(){return this._suspend_data},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString4096,!0)&&(this._suspend_data=e)},enumerable:!1,configurable:!0}),t.prototype.getCurrentTotalTime=function(e){var t=this._session_time,i=e;if(null!=i){var r=(new Date).getTime()-i;t=_.UZ(r/1e3)}return _.HT(this._total_time,t,new RegExp(s.A.scorm12.CMITimespan))},t.prototype.toJSON=function(){this.jsonString=!0;var e={student_id:this.student_id,student_name:this.student_name,lesson_location:this.lesson_location,credit:this.credit,lesson_status:this.lesson_status,entry:this.entry,lesson_mode:this.lesson_mode,exit:this.exit,session_time:this.session_time,score:this.score};return delete this.jsonString,e},t}(c.J),h=i(176),m=i(532),f=i(181),p=i(833),g=function(e){function t(t,i,r){var o=e.call(this)||this;return o.__children="",o.__version="3.4",o._launch_data="",o._comments="",o._comments_from_lms="",r&&o.initialize(),o.__children=t||n.A.scorm12.cmi_children,o.core=new d,o.objectives=new h.C,o.student_data=i||new m.X,o.student_preference=new f.G,o.interactions=new p.Xb,o}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t,i,r,n,o;e.prototype.initialize.call(this),null===(t=this.core)||void 0===t||t.initialize(),null===(i=this.objectives)||void 0===i||i.initialize(),null===(r=this.student_data)||void 0===r||r.initialize(),null===(n=this.student_preference)||void 0===n||n.initialize(),null===(o=this.interactions)||void 0===o||o.initialize()},t.prototype.toJSON=function(){this.jsonString=!0;var e={suspend_data:this.suspend_data,launch_data:this.launch_data,comments:this.comments,comments_from_lms:this.comments_from_lms,core:this.core,objectives:this.objectives,student_data:this.student_data,student_preference:this.student_preference,interactions:this.interactions};return delete this.jsonString,e},Object.defineProperty(t.prototype,"_version",{get:function(){return this.__version},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"suspend_data",{get:function(){var e;return null===(e=this.core)||void 0===e?void 0:e.suspend_data},set:function(e){this.core&&(this.core.suspend_data=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"launch_data",{get:function(){return this._launch_data},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._launch_data=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"comments",{get:function(){return this._comments},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString4096,!0)&&(this._comments=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"comments_from_lms",{get:function(){return this._comments_from_lms},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._comments_from_lms=e},enumerable:!1,configurable:!0}),t.prototype.getCurrentTotalTime=function(){return this.core.getCurrentTotalTime(this.start_time)},t}(c.r)},833:function(e,t,i){i.d(t,{Oh:function(){return h},WP:function(){return d},Xb:function(){return _},cb:function(){return m}});var r=i(635),n=i(589),o=i(340),s=i(797),a=i(784),c=i(319),l=i(915),u=i(417),_=function(e){function t(){return e.call(this,{children:o.A.scorm12.interactions_children,errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ})||this}return(0,r.C6)(t,e),t}(n.B),d=function(e){function t(){var t=e.call(this)||this;return t._id="",t._time="",t._type="",t._weighting="",t._student_response="",t._result="",t._latency="",t.objectives=new n.B({errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ,children:o.A.scorm12.objectives_children}),t.correct_responses=new n.B({errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ,children:o.A.scorm12.correct_responses_children}),t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t,i;e.prototype.initialize.call(this),null===(t=this.objectives)||void 0===t||t.initialize(),null===(i=this.correct_responses)||void 0===i||i.initialize()},Object.defineProperty(t.prototype,"id",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._id},set:function(e){(0,l.p)(e,u.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._time},set:function(e){(0,l.p)(e,u.A.scorm12.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._type},set:function(e){(0,l.p)(e,u.A.scorm12.CMIType)&&(this._type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weighting",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._weighting},set:function(e){(0,l.p)(e,u.A.scorm12.CMIDecimal)&&(0,l.h)(e,u.A.scorm12.weighting_range)&&(this._weighting=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_response",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._student_response},set:function(e){(0,l.p)(e,u.A.scorm12.CMIFeedback,!0)&&(this._student_response=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"result",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._result},set:function(e){(0,l.p)(e,u.A.scorm12.CMIResult)&&(this._result=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"latency",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._latency},set:function(e){(0,l.p)(e,u.A.scorm12.CMITimespan)&&(this._latency=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,time:this.time,type:this.type,weighting:this.weighting,student_response:this.student_response,result:this.result,latency:this.latency,objectives:this.objectives,correct_responses:this.correct_responses};return delete this.jsonString,e},t}(c.J),h=function(e){function t(){var t=e.call(this)||this;return t._id="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(e){(0,l.p)(e,u.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id};return delete this.jsonString,e},t}(c.J),m=function(e){function t(){var t=e.call(this)||this;return t._pattern="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"pattern",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._pattern},set:function(e){(0,l.p)(e,u.A.scorm12.CMIFeedback,!0)&&(this._pattern=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={pattern:this._pattern};return delete this.jsonString,e},t}(c.J)},331:function(e,t,i){i.d(t,{A:function(){return a}});var r=i(635),n=i(319),o=i(915),s=i(417),a=function(e){function t(){var t=e.call(this)||this;return t._event="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"event",{get:function(){return this._event},set:function(e){(0,o.p)(e,s.A.scorm12.NAVEvent)&&(this._event=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={event:this.event};return delete this.jsonString,e},t}(n.J)},176:function(e,t,i){i.d(t,{C:function(){return _},N:function(){return d}});var r=i(635),n=i(319),o=i(434),s=i(340),a=i(417),c=i(797),l=i(784),u=i(915),_=function(e){function t(){return e.call(this,{children:s.A.scorm12.objectives_children,errorCode:c.A.scorm12.INVALID_SET_VALUE,errorClass:l.tQ})||this}return(0,r.C6)(t,e),t}(i(589).B),d=function(e){function t(){var t=e.call(this)||this;return t._id="",t._status="",t.score=new o._({score_children:s.A.scorm12.score_children,score_range:a.A.scorm12.score_range,invalidErrorCode:c.A.scorm12.INVALID_SET_VALUE,invalidTypeCode:c.A.scorm12.TYPE_MISMATCH,invalidRangeCode:c.A.scorm12.VALUE_OUT_OF_RANGE,errorClass:l.tQ}),t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(e){(0,u.p)(e,a.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},set:function(e){(0,u.p)(e,a.A.scorm12.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,status:this.status,score:this.score};return delete this.jsonString,e},t}(n.J)},532:function(e,t,i){i.d(t,{X:function(){return c}});var r=i(635),n=i(319),o=i(340),s=i(784),a=i(797),c=function(e){function t(t){var i=e.call(this)||this;return i._mastery_score="",i._max_time_allowed="",i._time_limit_action="",i.__children=t||o.A.scorm12.student_data_children,i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new s.tQ(a.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mastery_score",{get:function(){return this._mastery_score},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._mastery_score=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"max_time_allowed",{get:function(){return this._max_time_allowed},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._max_time_allowed=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time_limit_action",{get:function(){return this._time_limit_action},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._time_limit_action=e},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={mastery_score:this.mastery_score,max_time_allowed:this.max_time_allowed,time_limit_action:this.time_limit_action};return delete this.jsonString,e},t}(n.J)},181:function(e,t,i){i.d(t,{G:function(){return u}});var r=i(635),n=i(319),o=i(340),s=i(784),a=i(797),c=i(915),l=i(417),u=function(e){function t(t){var i=e.call(this)||this;return i._audio="",i._language="",i._speed="",i._text="",i.__children=t||o.A.scorm12.student_preference_children,i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new s.tQ(a.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audio",{get:function(){return this._audio},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.audio_range)&&(this._audio=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"language",{get:function(){return this._language},set:function(e){(0,c.p)(e,l.A.scorm12.CMIString256)&&(this._language=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speed",{get:function(){return this._speed},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.speed_range)&&(this._speed=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this._text},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.text_range)&&(this._text=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,speed:this.speed,text:this.text};return delete this.jsonString,e},t}(n.J)},915:function(e,t,i){i.d(t,{h:function(){return a},p:function(){return s}});var r=i(449),n=i(797),o=i(784);function s(e,t,i){return(0,r.q)(e,t,n.A.scorm12.TYPE_MISMATCH,o.tQ,i)}function a(e,t,i){if(!i&&""===e)throw new o.tQ(n.A.scorm12.VALUE_OUT_OF_RANGE);return(0,r.W)(e,t,n.A.scorm12.VALUE_OUT_OF_RANGE,o.tQ)}},340:function(e,t,i){var r=i(635),n={cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",core_children:"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time",score_children:"raw,min,max",comments_children:"content,location,time",objectives_children:"id,score,status",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio,language,speed,text",interactions_children:"id,objectives,time,type,correct_responses,weighting,student_response,result,latency",error_descriptions:{101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information"},201:{basicMessage:"Invalid argument error",detailMessage:"Indicates that an argument represents an invalid data model element or is otherwise incorrect."},202:{basicMessage:"Element cannot have children",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.'},203:{basicMessage:"Element not an array - cannot have count",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.'},301:{basicMessage:"Not initialized",detailMessage:"Indicates that an API call was made before the call to lmsInitialize."},401:{basicMessage:"Not implemented error",detailMessage:"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement."},402:{basicMessage:"Invalid set value, element is a keyword",detailMessage:'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").'},403:{basicMessage:"Element is read only",detailMessage:"LMSSetValue was called with a data model element that can only be read."},404:{basicMessage:"Element is write only",detailMessage:"LMSGetValue was called on a data model element that can only be written to."},405:{basicMessage:"Incorrect Data Type",detailMessage:"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Element Value Out Of Range",detailMessage:"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}},o={global:{SCORM_TRUE:"true",SCORM_FALSE:"false",STATE_NOT_INITIALIZED:0,STATE_INITIALIZED:1,STATE_TERMINATED:2,LOG_LEVEL_DEBUG:1,LOG_LEVEL_INFO:2,LOG_LEVEL_WARNING:3,LOG_LEVEL_ERROR:4,LOG_LEVEL_NONE:5},scorm12:n,aicc:(0,r.Cl)((0,r.Cl)({},n),{cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation",student_preference_children:"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows",student_data_children:"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action",student_demographics_children:"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience",tries_children:"time,status,score",attempt_records_children:"score,lesson_status",paths_children:"location_id,date,time,status,why_left,time_in_element"}),scorm2004:{cmi_children:"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time",comments_children:"comment,timestamp,location",score_children:"max,raw,scaled,min",objectives_children:"progress_measure,completion_status,success_status,description,score,id",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio_level,audio_captioning,delivery_speed,language",interactions_children:"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description",error_descriptions:{0:{basicMessage:"No Error",detailMessage:"No error occurred, the previous API call was successful."},101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use GetDiagnostic for more information."},102:{basicMessage:"General Initialization Failure",detailMessage:"Call to Initialize failed for an unknown reason."},103:{basicMessage:"Already Initialized",detailMessage:"Call to Initialize failed because Initialize was already called."},104:{basicMessage:"Content Instance Terminated",detailMessage:"Call to Initialize failed because Terminate was already called."},111:{basicMessage:"General Termination Failure",detailMessage:"Call to Terminate failed for an unknown reason."},112:{basicMessage:"Termination Before Initialization",detailMessage:"Call to Terminate failed because it was made before the call to Initialize."},113:{basicMessage:"Termination After Termination",detailMessage:"Call to Terminate failed because Terminate was already called."},122:{basicMessage:"Retrieve Data Before Initialization",detailMessage:"Call to GetValue failed because it was made before the call to Initialize."},123:{basicMessage:"Retrieve Data After Termination",detailMessage:"Call to GetValue failed because it was made after the call to Terminate."},132:{basicMessage:"Store Data Before Initialization",detailMessage:"Call to SetValue failed because it was made before the call to Initialize."},133:{basicMessage:"Store Data After Termination",detailMessage:"Call to SetValue failed because it was made after the call to Terminate."},142:{basicMessage:"Commit Before Initialization",detailMessage:"Call to Commit failed because it was made before the call to Initialize."},143:{basicMessage:"Commit After Termination",detailMessage:"Call to Commit failed because it was made after the call to Terminate."},201:{basicMessage:"General Argument Error",detailMessage:"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument."},301:{basicMessage:"General Get Failure",detailMessage:"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},351:{basicMessage:"General Set Failure",detailMessage:"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},391:{basicMessage:"General Commit Failure",detailMessage:"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information."},401:{basicMessage:"Undefined Data Model Element",detailMessage:"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element."},402:{basicMessage:"Unimplemented Data Model Element",detailMessage:"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant."},403:{basicMessage:"Data Model Element Value Not Initialized",detailMessage:"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO."},404:{basicMessage:"Data Model Element Is Read Only",detailMessage:"SetValue was called with a data model element that can only be read."},405:{basicMessage:"Data Model Element Is Write Only",detailMessage:"GetValue was called on a data model element that can only be written to."},406:{basicMessage:"Data Model Element Type Mismatch",detailMessage:"SetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Data Model Element Value Out Of Range",detailMessage:"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}}};t.A=o},56:function(e,t,i){var r,n,o;i.d(t,{YE:function(){return n},lC:function(){return o}}),function(e){e.unknown="unknown",e.true="true",e.false="false"}(r||(r={})),function(e){e.passed="passed",e.failed="failed",e.unknown="unknown"}(n||(n={})),function(e){e.completed="completed",e.incomplete="incomplete",e.unknown="unknown"}(o||(o={}))},797:function(e,t,i){var r=i(635),n={GENERAL:101,INITIALIZATION_FAILED:101,INITIALIZED:101,TERMINATED:101,TERMINATION_FAILURE:101,TERMINATION_BEFORE_INIT:101,MULTIPLE_TERMINATION:101,RETRIEVE_BEFORE_INIT:101,RETRIEVE_AFTER_TERM:101,STORE_BEFORE_INIT:101,STORE_AFTER_TERM:101,COMMIT_BEFORE_INIT:101,COMMIT_AFTER_TERM:101,ARGUMENT_ERROR:101,CHILDREN_ERROR:101,COUNT_ERROR:101,GENERAL_GET_FAILURE:101,GENERAL_SET_FAILURE:101,GENERAL_COMMIT_FAILURE:101,UNDEFINED_DATA_MODEL:101,UNIMPLEMENTED_ELEMENT:101,VALUE_NOT_INITIALIZED:101,INVALID_SET_VALUE:101,READ_ONLY_ELEMENT:101,WRITE_ONLY_ELEMENT:101,TYPE_MISMATCH:101,VALUE_OUT_OF_RANGE:101,DEPENDENCY_NOT_ESTABLISHED:101},o={scorm12:(0,r.Cl)((0,r.Cl)({},n),{RETRIEVE_BEFORE_INIT:301,STORE_BEFORE_INIT:301,COMMIT_BEFORE_INIT:301,ARGUMENT_ERROR:201,CHILDREN_ERROR:202,COUNT_ERROR:203,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:401,VALUE_NOT_INITIALIZED:301,INVALID_SET_VALUE:402,READ_ONLY_ELEMENT:403,WRITE_ONLY_ELEMENT:404,TYPE_MISMATCH:405,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408}),scorm2004:(0,r.Cl)((0,r.Cl)({},n),{INITIALIZATION_FAILED:102,INITIALIZED:103,TERMINATED:104,TERMINATION_FAILURE:111,TERMINATION_BEFORE_INIT:112,MULTIPLE_TERMINATIONS:113,RETRIEVE_BEFORE_INIT:122,RETRIEVE_AFTER_TERM:123,STORE_BEFORE_INIT:132,STORE_AFTER_TERM:133,COMMIT_BEFORE_INIT:142,COMMIT_AFTER_TERM:143,ARGUMENT_ERROR:201,GENERAL_GET_FAILURE:301,GENERAL_SET_FAILURE:351,GENERAL_COMMIT_FAILURE:391,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:402,VALUE_NOT_INITIALIZED:403,READ_ONLY_ELEMENT:404,WRITE_ONLY_ELEMENT:405,TYPE_MISMATCH:406,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408})};t.A=o},417:function(e,t,i){var r=i(635),n={CMIString256:"^.{0,255}$",CMIString4096:"^.{0,4096}$",CMITime:"^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",CMITimespan:"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{0,3})(.[0-9]*)?$",CMIIdentifier:"^[\\u0021-\\u007E\\s]{0,255}$",CMIFeedback:"^.{0,255}$",CMIIndex:"[._](\\d+).",CMIStatus:"^(passed|completed|failed|incomplete|browsed)$",CMIStatus2:"^(passed|completed|failed|incomplete|browsed|not attempted)$",CMIExit:"^(time-out|suspend|logout|)$",CMIType:"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$",CMIResult:"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$",NAVEvent:"^(previous|continue)$",score_range:"0#100",audio_range:"-1#100",speed_range:"-100#100",weighting_range:"-100#100",text_range:"-1#1"},o={aicc:(0,r.Cl)((0,r.Cl)({},n),{CMIIdentifier:"^\\w{1,255}$"}),scorm12:n,scorm2004:{CMIString200:"^[\\u0000-\\uFFFF]{0,200}$",CMIString250:"^[\\u0000-\\uFFFF]{0,250}$",CMIString1000:"^[\\u0000-\\uFFFF]{0,1000}$",CMIString4000:"^[\\u0000-\\uFFFF]{0,4000}$",CMIString64000:"^[\\u0000-\\uFFFF]{0,64000}$",CMILang:"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$",CMILangString250:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$",CMILangcr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$",CMILangString250cr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$",CMILangString4000:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$",CMITime:"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$",CMITimespan:"^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{1,5})(\\.[0-9]{1,18})?$",CMIIdentifier:"^\\S{1,250}[a-zA-Z0-9]$",CMIShortIdentifier:"^[\\w\\.\\-\\_]{1,250}$",CMILongIdentifier:"^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$",CMIFeedback:"^.*$",CMIIndex:"[._](\\d+).",CMIIndexStore:".N(\\d+).",CMICStatus:"^(completed|incomplete|not attempted|unknown)$",CMISStatus:"^(passed|failed|unknown)$",CMIExit:"^(time-out|suspend|logout|normal)$",CMIType:"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",CMIResult:"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",NAVEvent:"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$",NAVBoolean:"^(unknown|true|false$)",NAVTarget:"^{target=\\S{0,}[a-zA-Z0-9-_]+}$",scaled_range:"-1#1",audio_range:"0#*",speed_range:"0#*",text_range:"-1#1",progress_range:"0#1"}};t.A=o},784:function(e,t,i){i.d(t,{$h:function(){return c},gv:function(){return _},tQ:function(){return u},yI:function(){return l}});var r=i(635),n=i(340),o=n.A.scorm12.error_descriptions,s=n.A.aicc.error_descriptions,a=n.A.scorm2004.error_descriptions,c=function(e){function t(t){var i=e.call(this,t.toString())||this;return i._errorCode=t,i.name="ScormValidationError",i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"errorCode",{get:function(){return this._errorCode},enumerable:!1,configurable:!0}),t.prototype.setMessage=function(e){this.message=e},t}(Error),l=function(e){function t(t,i,r){var n=e.call(this,t)||this;return n._detailedMessage="",n.setMessage(i),n._errorMessage=i,r&&(n._detailedMessage=r),n}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"errorMessage",{get:function(){return this._errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"detailedMessage",{get:function(){return this._detailedMessage},enumerable:!1,configurable:!0}),t}(c),u=function(e){function t(t){return{}.hasOwnProperty.call(o,String(t))?e.call(this,t,o[String(t)].basicMessage,o[String(t)].detailMessage)||this:e.call(this,101,o[101].basicMessage,o[101].detailMessage)||this}return(0,r.C6)(t,e),t}(l),_=function(e){function t(t){return{}.hasOwnProperty.call(s,String(t))?e.call(this,t,s[String(t)].basicMessage,s[String(t)].detailMessage)||this:e.call(this,101,s[101].basicMessage,s[101].detailMessage)||this}return(0,r.C6)(t,e),t}(l);!function(e){function t(t){return{}.hasOwnProperty.call(a,String(t))?e.call(this,t,a[String(t)].basicMessage,a[String(t)].detailMessage)||this:e.call(this,101,a[101].basicMessage,a[101].detailMessage)||this}(0,r.C6)(t,e)}(l)},864:function(e,t,i){i.d(t,{Bq:function(){return a},HT:function(){return s},J6:function(){return _},UZ:function(){return n},f4:function(){return o},hw:function(){return u},sB:function(){return c}});var r=3600;function n(e){if(!e||e<=0)return"00:00:00";var t=Math.floor(e/r),i=new Date(1e3*e),n=i.getUTCMinutes(),o=i.getSeconds(),s=e%1,a="";return l(s)>0&&(a="."+(a=l(s)>2?s.toFixed(2):String(s)).split(".")[1]),(t+":"+n+":"+o).replace(/\b\d\b/g,"0$&")+a}function o(e,t){if("number"!=typeof e&&"boolean"!=typeof e||(e=String(e)),"string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var i=e.split(":");return 3600*Number(i[0])+60*Number(i[1])+Number(i[2])}function s(e,t,i){return"string"==typeof i&&(i=new RegExp(i)),n(o(e,i)+o(t,i))}function a(e){var t={};return function e(i,r){if(Object(i)!==i)t[r]=i;else if(Array.isArray(i))for(var n=0,o=i.length;n0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]= this.apiLogLevel) { + this.settings.onLogMessage(messageLevel, logMessage); + } + }; + Object.defineProperty(BaseAPI.prototype, "error_codes", { + get: function () { + return this._error_codes; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BaseAPI.prototype, "settings", { + get: function () { + return this._settings; + }, + set: function (settings) { + this._settings = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, this._settings), settings); + }, + enumerable: false, + configurable: true + }); + BaseAPI.prototype.terminate = function (callbackName, checkTerminated) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + var returnValue, result; + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: + returnValue = api_constants/* default */.A.global.SCORM_FALSE; + if (!this.checkState(checkTerminated, this._error_codes.TERMINATION_BEFORE_INIT, this._error_codes.MULTIPLE_TERMINATION)) return [3, 2]; + this.currentState = api_constants/* default */.A.global.STATE_TERMINATED; + return [4, this.storeData(true)]; + case 1: + result = _a.sent(); + if (typeof result.errorCode !== "undefined" && result.errorCode > 0) { + this.throwSCORMError(result.errorCode); + } + returnValue = + typeof result !== "undefined" && result.result + ? result.result + : api_constants/* default */.A.global.SCORM_FALSE; + if (checkTerminated) + this.lastErrorCode = "0"; + returnValue = api_constants/* default */.A.global.SCORM_TRUE; + this.processListeners(callbackName); + _a.label = 2; + case 2: + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + this.clearSCORMError(returnValue); + return [2, returnValue]; + } + }); + }); + }; + BaseAPI.prototype.getValue = function (callbackName, checkTerminated, CMIElement) { + var returnValue = ""; + if (this.checkState(checkTerminated, this._error_codes.RETRIEVE_BEFORE_INIT, this._error_codes.RETRIEVE_AFTER_TERM)) { + if (checkTerminated) + this.lastErrorCode = "0"; + try { + returnValue = this.getCMIValue(CMIElement); + } + catch (e) { + returnValue = this.handleValueAccessException(e, returnValue); + } + this.processListeners(callbackName, CMIElement); + } + this.apiLog(callbackName, ": returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); + if (returnValue === undefined) { + return ""; + } + this.clearSCORMError(returnValue); + return returnValue; + }; + BaseAPI.prototype.setValue = function (callbackName, commitCallback, checkTerminated, CMIElement, value) { + if (value !== undefined) { + value = String(value); + } + var returnValue = api_constants/* default */.A.global.SCORM_FALSE; + if (this.checkState(checkTerminated, this._error_codes.STORE_BEFORE_INIT, this._error_codes.STORE_AFTER_TERM)) { + if (checkTerminated) + this.lastErrorCode = "0"; + try { + returnValue = this.setCMIValue(CMIElement, value); + } + catch (e) { + this.handleValueAccessException(e, returnValue); + } + this.processListeners(callbackName, CMIElement, value); + } + if (returnValue === undefined) { + returnValue = api_constants/* default */.A.global.SCORM_FALSE; + } + if (String(this.lastErrorCode) === "0") { + if (this.settings.autocommit && !this._timeout) { + this.scheduleCommit(this.settings.autocommitSeconds * 1000, commitCallback); + } + } + this.apiLog(callbackName, ": " + value + ": result: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); + this.clearSCORMError(returnValue); + return returnValue; + }; + BaseAPI.prototype.commit = function (callbackName_1) { + return (0,tslib_es6/* __awaiter */.sH)(this, arguments, void 0, function (callbackName, checkTerminated) { + var returnValue, result; + if (checkTerminated === void 0) { checkTerminated = false; } + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: + this.clearScheduledCommit(); + returnValue = api_constants/* default */.A.global.SCORM_FALSE; + if (!this.checkState(checkTerminated, this._error_codes.COMMIT_BEFORE_INIT, this._error_codes.COMMIT_AFTER_TERM)) return [3, 2]; + return [4, this.storeData(false)]; + case 1: + result = _a.sent(); + if (result.errorCode && result.errorCode > 0) { + this.throwSCORMError(result.errorCode); + } + returnValue = + typeof result !== "undefined" && result.result + ? result.result + : api_constants/* default */.A.global.SCORM_FALSE; + this.apiLog(callbackName, " Result: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_DEBUG, "HttpRequest"); + if (checkTerminated) + this.lastErrorCode = "0"; + this.processListeners(callbackName); + _a.label = 2; + case 2: + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + this.clearSCORMError(returnValue); + return [2, returnValue]; + } + }); + }); + }; + BaseAPI.prototype.getLastError = function (callbackName) { + var returnValue = String(this.lastErrorCode); + this.processListeners(callbackName); + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + return returnValue; + }; + BaseAPI.prototype.getErrorString = function (callbackName, CMIErrorCode) { + var returnValue = ""; + if (CMIErrorCode !== null && CMIErrorCode !== "") { + returnValue = this.getLmsErrorMessageDetails(CMIErrorCode); + this.processListeners(callbackName); + } + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + return returnValue; + }; + BaseAPI.prototype.getDiagnostic = function (callbackName, CMIErrorCode) { + var returnValue = ""; + if (CMIErrorCode !== null && CMIErrorCode !== "") { + returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true); + this.processListeners(callbackName); + } + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + return returnValue; + }; + BaseAPI.prototype.checkState = function (checkTerminated, beforeInitError, afterTermError) { + if (this.isNotInitialized()) { + this.throwSCORMError(beforeInitError); + return false; + } + else if (checkTerminated && this.isTerminated()) { + this.throwSCORMError(afterTermError); + return false; + } + return true; + }; + BaseAPI.prototype.getLmsErrorMessageDetails = function (_errorNumber, _detail) { + if (_detail === void 0) { _detail = false; } + throw new Error("The getLmsErrorMessageDetails method has not been implemented"); + }; + BaseAPI.prototype.getCMIValue = function (_CMIElement) { + throw new Error("The getCMIValue method has not been implemented"); + }; + BaseAPI.prototype.setCMIValue = function (_CMIElement, _value) { + throw new Error("The setCMIValue method has not been implemented"); + }; + BaseAPI.prototype._commonSetCMIValue = function (methodName, scorm2004, CMIElement, value) { + if (!CMIElement || CMIElement === "") { + return api_constants/* default */.A.global.SCORM_FALSE; + } + var structure = CMIElement.split("."); + var refObject = this; + var returnValue = api_constants/* default */.A.global.SCORM_FALSE; + var foundFirstIndex = false; + var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element."); + var invalidErrorCode = scorm2004 + ? this._error_codes.UNDEFINED_DATA_MODEL + : this._error_codes.GENERAL; + for (var idx = 0; idx < structure.length; idx++) { + var attribute = structure[idx]; + if (idx === structure.length - 1) { + if (scorm2004 && attribute.substring(0, 8) === "{target=") { + if (this.isInitialized()) { + this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT); + } + else { + refObject = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, refObject), { attribute: value }); + } + } + else if (!this._checkObjectHasProperty(refObject, attribute)) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + } + else { + if ((0,utilities/* stringMatches */.J6)(CMIElement, "\\.correct_responses\\.\\d+") && + this.isInitialized()) { + this.validateCorrectResponse(CMIElement, value); + } + if (!scorm2004 || this.lastErrorCode === "0") { + refObject[attribute] = value; + returnValue = api_constants/* default */.A.global.SCORM_TRUE; + } + } + } + else { + refObject = refObject[attribute]; + if (!refObject) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + break; + } + if (refObject instanceof array/* CMIArray */.B) { + var index = parseInt(structure[idx + 1], 10); + if (!isNaN(index)) { + var item = refObject.childArray[index]; + if (item) { + refObject = item; + foundFirstIndex = true; + } + else { + var newChild = this.getChildElement(CMIElement, value, foundFirstIndex); + foundFirstIndex = true; + if (!newChild) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + } + else { + if (refObject.initialized) + newChild.initialize(); + refObject.childArray.push(newChild); + refObject = newChild; + } + } + idx++; + } + } + } + } + if (returnValue === api_constants/* default */.A.global.SCORM_FALSE) { + this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value), api_constants/* default */.A.global.LOG_LEVEL_WARNING); + } + return returnValue; + }; + BaseAPI.prototype._commonGetCMIValue = function (methodName, scorm2004, CMIElement) { + if (!CMIElement || CMIElement === "") { + return ""; + } + var structure = CMIElement.split("."); + var refObject = this; + var attribute = null; + var uninitializedErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") has not been initialized."); + var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element."); + var invalidErrorCode = scorm2004 + ? this._error_codes.UNDEFINED_DATA_MODEL + : this._error_codes.GENERAL; + for (var idx = 0; idx < structure.length; idx++) { + attribute = structure[idx]; + if (!scorm2004) { + if (idx === structure.length - 1) { + if (!this._checkObjectHasProperty(refObject, attribute)) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + return; + } + } + } + else { + if (String(attribute).substring(0, 8) === "{target=" && + typeof refObject._isTargetValid == "function") { + var target = String(attribute).substring(8, String(attribute).length - 9); + return refObject._isTargetValid(target); + } + else if (!this._checkObjectHasProperty(refObject, attribute)) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + return; + } + } + refObject = refObject[attribute]; + if (refObject === undefined) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + break; + } + if (refObject instanceof array/* CMIArray */.B) { + var index = parseInt(structure[idx + 1], 10); + if (!isNaN(index)) { + var item = refObject.childArray[index]; + if (item) { + refObject = item; + } + else { + this.throwSCORMError(this._error_codes.VALUE_NOT_INITIALIZED, uninitializedErrorMessage); + break; + } + idx++; + } + } + } + if (refObject === null || refObject === undefined) { + if (!scorm2004) { + if (attribute === "_children") { + this.throwSCORMError(error_codes/* default */.A.scorm12.CHILDREN_ERROR); + } + else if (attribute === "_count") { + this.throwSCORMError(error_codes/* default */.A.scorm12.COUNT_ERROR); + } + } + } + else { + return refObject; + } + }; + BaseAPI.prototype.isInitialized = function () { + return this.currentState === api_constants/* default */.A.global.STATE_INITIALIZED; + }; + BaseAPI.prototype.isNotInitialized = function () { + return this.currentState === api_constants/* default */.A.global.STATE_NOT_INITIALIZED; + }; + BaseAPI.prototype.isTerminated = function () { + return this.currentState === api_constants/* default */.A.global.STATE_TERMINATED; + }; + BaseAPI.prototype.on = function (listenerName, callback) { + if (!callback) + return; + var listenerFunctions = listenerName.split(" "); + for (var i = 0; i < listenerFunctions.length; i++) { + var listenerSplit = listenerFunctions[i].split("."); + if (listenerSplit.length === 0) + return; + var functionName = listenerSplit[0]; + var CMIElement = null; + if (listenerSplit.length > 1) { + CMIElement = listenerName.replace(functionName + ".", ""); + } + this.listenerArray.push({ + functionName: functionName, + CMIElement: CMIElement, + callback: callback, + }); + this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length), api_constants/* default */.A.global.LOG_LEVEL_INFO, functionName); + } + }; + BaseAPI.prototype.off = function (listenerName, callback) { + if (!callback) + return; + var listenerFunctions = listenerName.split(" "); + var _loop_1 = function (i) { + var listenerSplit = listenerFunctions[i].split("."); + if (listenerSplit.length === 0) + return { value: void 0 }; + var functionName = listenerSplit[0]; + var CMIElement = null; + if (listenerSplit.length > 1) { + CMIElement = listenerName.replace(functionName + ".", ""); + } + var removeIndex = this_1.listenerArray.findIndex(function (obj) { + return obj.functionName === functionName && + obj.CMIElement === CMIElement && + obj.callback === callback; + }); + if (removeIndex !== -1) { + this_1.listenerArray.splice(removeIndex, 1); + this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length), api_constants/* default */.A.global.LOG_LEVEL_INFO, functionName); + } + }; + var this_1 = this; + for (var i = 0; i < listenerFunctions.length; i++) { + var state_1 = _loop_1(i); + if (typeof state_1 === "object") + return state_1.value; + } + }; + BaseAPI.prototype.clear = function (listenerName) { + var listenerFunctions = listenerName.split(" "); + var _loop_2 = function (i) { + var listenerSplit = listenerFunctions[i].split("."); + if (listenerSplit.length === 0) + return { value: void 0 }; + var functionName = listenerSplit[0]; + var CMIElement = null; + if (listenerSplit.length > 1) { + CMIElement = listenerName.replace(functionName + ".", ""); + } + this_2.listenerArray = this_2.listenerArray.filter(function (obj) { + return obj.functionName !== functionName && obj.CMIElement !== CMIElement; + }); + }; + var this_2 = this; + for (var i = 0; i < listenerFunctions.length; i++) { + var state_2 = _loop_2(i); + if (typeof state_2 === "object") + return state_2.value; + } + }; + BaseAPI.prototype.processListeners = function (functionName, CMIElement, value) { + this.apiLog(functionName, value, api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); + for (var i = 0; i < this.listenerArray.length; i++) { + var listener = this.listenerArray[i]; + var functionsMatch = listener.functionName === functionName; + var listenerHasCMIElement = !!listener.CMIElement; + var CMIElementsMatch = false; + if (CMIElement && + listener.CMIElement && + listener.CMIElement.substring(listener.CMIElement.length - 1) === "*") { + CMIElementsMatch = + CMIElement.indexOf(listener.CMIElement.substring(0, listener.CMIElement.length - 1)) === 0; + } + else { + CMIElementsMatch = listener.CMIElement === CMIElement; + } + if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) { + this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName), api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); + listener.callback(CMIElement, value); + } + } + }; + BaseAPI.prototype.throwSCORMError = function (errorNumber, message) { + if (!message) { + message = this.getLmsErrorMessageDetails(errorNumber); + } + this.apiLog("throwSCORMError", errorNumber + ": " + message, api_constants/* default */.A.global.LOG_LEVEL_ERROR); + this.lastErrorCode = String(errorNumber); + }; + BaseAPI.prototype.clearSCORMError = function (success) { + if (success !== undefined && success !== api_constants/* default */.A.global.SCORM_FALSE) { + this.lastErrorCode = "0"; + } + }; + BaseAPI.prototype.loadFromFlattenedJSON = function (json, CMIElement) { + var _this = this; + if (!CMIElement) { + CMIElement = ""; + } + if (!this.isNotInitialized()) { + console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize."); + return; + } + function testPattern(a, c, a_pattern) { + var a_match = a.match(a_pattern); + var c_match; + if (a_match !== null && (c_match = c.match(a_pattern)) !== null) { + var a_num = Number(a_match[2]); + var c_num = Number(c_match[2]); + if (a_num === c_num) { + if (a_match[3] === "id") { + return -1; + } + else if (a_match[3] === "type") { + if (c_match[3] === "id") { + return 1; + } + else { + return -1; + } + } + else { + return 1; + } + } + return a_num - c_num; + } + return null; + } + var int_pattern = /^(cmi\.interactions\.)(\d+)\.(.*)$/; + var obj_pattern = /^(cmi\.objectives\.)(\d+)\.(.*)$/; + var result = Object.keys(json).map(function (key) { + return [String(key), json[key]]; + }); + result.sort(function (_a, _c) { + var a = _a[0], _b = _a[1]; + var c = _c[0], _d = _c[1]; + var test; + if ((test = testPattern(a, c, int_pattern)) !== null) { + return test; + } + if ((test = testPattern(a, c, obj_pattern)) !== null) { + return test; + } + if (a < c) { + return -1; + } + if (a > c) { + return 1; + } + return 0; + }); + var obj; + result.forEach(function (element) { + obj = {}; + obj[element[0]] = element[1]; + _this.loadFromJSON((0,utilities/* unflatten */.sB)(obj), CMIElement); + }); + }; + BaseAPI.prototype.loadFromJSON = function (json, CMIElement) { + if (!this.isNotInitialized()) { + console.error("loadFromJSON can only be called before the call to lmsInitialize."); + return; + } + CMIElement = CMIElement !== undefined ? CMIElement : "cmi"; + this.startingData = json; + for (var key in json) { + if ({}.hasOwnProperty.call(json, key) && json[key]) { + var currentCMIElement = (CMIElement ? CMIElement + "." : "") + key; + var value = json[key]; + if (value["childArray"]) { + for (var i = 0; i < value["childArray"].length; i++) { + this.loadFromJSON(value["childArray"][i], currentCMIElement + "." + i); + } + } + else if (value.constructor === Object) { + this.loadFromJSON(value, currentCMIElement); + } + else { + this.setCMIValue(currentCMIElement, value); + } + } + } + }; + BaseAPI.prototype.renderCMIToJSONString = function () { + var cmi = this.cmi; + if (this.settings.sendFullCommit) { + return JSON.stringify({ cmi: cmi }); + } + return JSON.stringify({ cmi: cmi }, function (k, v) { return (v === undefined ? null : v); }, 2); + }; + BaseAPI.prototype.renderCMIToJSONObject = function () { + return JSON.parse(this.renderCMIToJSONString()); + }; + BaseAPI.prototype.processHttpRequest = function (url_1, params_1) { + return (0,tslib_es6/* __awaiter */.sH)(this, arguments, void 0, function (url, params, immediate) { + var api, genericError, process, debouncedProcess; + var _this = this; + if (immediate === void 0) { immediate = false; } + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: + api = this; + genericError = { + result: api_constants/* default */.A.global.SCORM_FALSE, + errorCode: this.error_codes.GENERAL, + }; + if (immediate) { + this.performFetch(url, params).then(function (response) { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this.transformResponse(response)]; + case 1: + _a.sent(); + return [2]; + } + }); + }); }); + return [2, { + result: api_constants/* default */.A.global.SCORM_TRUE, + errorCode: 0, + }]; + } + process = function (url, params, settings) { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { + var response, e_1; + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + params = settings.requestHandler(params); + return [4, this.performFetch(url, params)]; + case 1: + response = _a.sent(); + return [2, this.transformResponse(response)]; + case 2: + e_1 = _a.sent(); + this.apiLog("processHttpRequest", e_1, api_constants/* default */.A.global.LOG_LEVEL_ERROR); + api.processListeners("CommitError"); + return [2, genericError]; + case 3: return [2]; + } + }); + }); }; + if (!this.settings.asyncCommit) return [3, 1]; + debouncedProcess = debounce(process, 500, immediate); + debouncedProcess(url, params, this.settings); + return [2, { + result: api_constants/* default */.A.global.SCORM_TRUE, + errorCode: 0, + }]; + case 1: return [4, process(url, params, this.settings)]; + case 2: return [2, _a.sent()]; + } + }); + }); + }; + BaseAPI.prototype.scheduleCommit = function (when, callback) { + this._timeout = new ScheduledCommit(this, when, callback); + this.apiLog("scheduleCommit", "scheduled", api_constants/* default */.A.global.LOG_LEVEL_DEBUG, ""); + }; + BaseAPI.prototype.clearScheduledCommit = function () { + if (this._timeout) { + this._timeout.cancel(); + this._timeout = undefined; + this.apiLog("clearScheduledCommit", "cleared", api_constants/* default */.A.global.LOG_LEVEL_DEBUG, ""); + } + }; + BaseAPI.prototype._checkObjectHasProperty = function (refObject, attribute) { + return (Object.hasOwnProperty.call(refObject, attribute) || + Object.getOwnPropertyDescriptor(Object.getPrototypeOf(refObject), attribute) != null || + attribute in refObject); + }; + BaseAPI.prototype.handleValueAccessException = function (e, returnValue) { + if (e instanceof exceptions/* ValidationError */.yI) { + this.lastErrorCode = String(e.errorCode); + returnValue = api_constants/* default */.A.global.SCORM_FALSE; + } + else { + if (e instanceof Error && e.message) { + console.error(e.message); + } + else { + console.error(e); + } + this.throwSCORMError(this._error_codes.GENERAL); + } + return returnValue; + }; + BaseAPI.prototype.performFetch = function (url, params) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + return [2, fetch(url, { + method: "POST", + body: params instanceof Array ? params.join("&") : JSON.stringify(params), + headers: (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, this.settings.xhrHeaders), { "Content-Type": this.settings.commitRequestDataType }), + credentials: this.settings.xhrWithCredentials ? "include" : undefined, + keepalive: true, + })]; + }); + }); + }; + BaseAPI.prototype.transformResponse = function (response) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + var result, _a; + return (0,tslib_es6/* __generator */.YH)(this, function (_c) { + switch (_c.label) { + case 0: + if (!(typeof this.settings.responseHandler === "function")) return [3, 2]; + return [4, this.settings.responseHandler(response)]; + case 1: + _a = _c.sent(); + return [3, 4]; + case 2: return [4, response.json()]; + case 3: + _a = _c.sent(); + _c.label = 4; + case 4: + result = _a; + if (response.status >= 200 && + response.status <= 299 && + (result.result === true || + result.result === api_constants/* default */.A.global.SCORM_TRUE)) { + this.processListeners("CommitSuccess"); + } + else { + this.processListeners("CommitError"); + } + return [2, result]; + } + }); + }); + }; + return BaseAPI; +}()); +/* harmony default export */ var src_BaseAPI = (BaseAPI); + + +/***/ }), + +/***/ 941: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ C: function() { return /* binding */ Scorm12Impl; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(635); +/* harmony import */ var _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(989); +/* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(864); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(340); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797); +/* harmony import */ var _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(176); +/* harmony import */ var _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(833); +/* harmony import */ var _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(331); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(417); +/* harmony import */ var _constants_enums__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(56); +/* harmony import */ var _BaseAPI__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(900); + + + + + + + + + + + + +var Scorm12Impl = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__extends */ .C6)(Scorm12Impl, _super); + function Scorm12Impl(settings) { + var _this = this; + if (settings) { + if (settings.mastery_override === undefined) { + settings.mastery_override = false; + } + } + _this = _super.call(this, _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12, settings) || this; + _this.statusSetByModule = false; + _this.cmi = new _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__/* .CMI */ .Y(); + _this.nav = new _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__/* .NAV */ .A(); + _this.LMSInitialize = _this.lmsInitialize; + _this.LMSFinish = _this.lmsFinish; + _this.LMSGetValue = _this.lmsGetValue; + _this.LMSSetValue = _this.lmsSetValue; + _this.LMSCommit = _this.lmsCommit; + _this.LMSGetLastError = _this.lmsGetLastError; + _this.LMSGetErrorString = _this.lmsGetErrorString; + _this.LMSGetDiagnostic = _this.lmsGetDiagnostic; + return _this; + } + Scorm12Impl.prototype.reset = function (settings) { + this.commonReset(settings); + this.cmi = new _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__/* .CMI */ .Y(); + this.nav = new _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__/* .NAV */ .A(); + }; + Scorm12Impl.prototype.lmsInitialize = function () { + this.cmi.initialize(); + if (this.cmi.core.lesson_status) { + this.statusSetByModule = true; + } + else { + this.cmi.core.lesson_status = "not attempted"; + } + return this.initialize("LMSInitialize", "LMS was already initialized!", "LMS is already finished!"); + }; + Scorm12Impl.prototype.lmsFinish = function () { + var _this = this; + (function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__awaiter */ .sH)(_this, void 0, void 0, function () { + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__generator */ .YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this.internalFinish()]; + case 1: + _a.sent(); + return [2]; + } + }); + }); })(); + return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.global.SCORM_TRUE; + }; + Scorm12Impl.prototype.internalFinish = function () { + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__awaiter */ .sH)(this, void 0, void 0, function () { + var result; + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__generator */ .YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this.terminate("LMSFinish", true)]; + case 1: + result = _a.sent(); + if (result === _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.global.SCORM_TRUE) { + if (this.nav.event !== "") { + if (this.nav.event === "continue") { + this.processListeners("SequenceNext"); + } + else { + this.processListeners("SequencePrevious"); + } + } + else if (this.settings.autoProgress) { + this.processListeners("SequenceNext"); + } + } + return [2, result]; + } + }); + }); + }; + Scorm12Impl.prototype.lmsGetValue = function (CMIElement) { + return this.getValue("LMSGetValue", false, CMIElement); + }; + Scorm12Impl.prototype.lmsSetValue = function (CMIElement, value) { + if (CMIElement === "cmi.core.lesson_status") { + this.statusSetByModule = true; + } + return this.setValue("LMSSetValue", "LMSCommit", false, CMIElement, value); + }; + Scorm12Impl.prototype.lmsCommit = function () { + var _this = this; + (function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__awaiter */ .sH)(_this, void 0, void 0, function () { + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__generator */ .YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this.commit("LMSCommit", false)]; + case 1: + _a.sent(); + return [2]; + } + }); + }); })(); + return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.global.SCORM_TRUE; + }; + Scorm12Impl.prototype.lmsGetLastError = function () { + return this.getLastError("LMSGetLastError"); + }; + Scorm12Impl.prototype.lmsGetErrorString = function (CMIErrorCode) { + return this.getErrorString("LMSGetErrorString", CMIErrorCode); + }; + Scorm12Impl.prototype.lmsGetDiagnostic = function (CMIErrorCode) { + return this.getDiagnostic("LMSGetDiagnostic", CMIErrorCode); + }; + Scorm12Impl.prototype.setCMIValue = function (CMIElement, value) { + return this._commonSetCMIValue("LMSSetValue", false, CMIElement, value); + }; + Scorm12Impl.prototype.getCMIValue = function (CMIElement) { + return this._commonGetCMIValue("getCMIValue", false, CMIElement); + }; + Scorm12Impl.prototype.getChildElement = function (CMIElement, _value, foundFirstIndex) { + if ((0,_utilities__WEBPACK_IMPORTED_MODULE_1__/* .stringMatches */ .J6)(CMIElement, "cmi\\.objectives\\.\\d+")) { + return new _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__/* .CMIObjectivesObject */ .N(); + } + else if (foundFirstIndex && + (0,_utilities__WEBPACK_IMPORTED_MODULE_1__/* .stringMatches */ .J6)(CMIElement, "cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")) { + return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__/* .CMIInteractionsCorrectResponsesObject */ .cb(); + } + else if (foundFirstIndex && + (0,_utilities__WEBPACK_IMPORTED_MODULE_1__/* .stringMatches */ .J6)(CMIElement, "cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")) { + return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__/* .CMIInteractionsObjectivesObject */ .Oh(); + } + else if (!foundFirstIndex && + (0,_utilities__WEBPACK_IMPORTED_MODULE_1__/* .stringMatches */ .J6)(CMIElement, "cmi\\.interactions\\.\\d+")) { + return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__/* .CMIInteractionsObject */ .WP(); + } + return null; + }; + Scorm12Impl.prototype.validateCorrectResponse = function (_CMIElement, _value) { + }; + Scorm12Impl.prototype.getLmsErrorMessageDetails = function (errorNumber, detail) { + var basicMessage = "No Error"; + var detailMessage = "No Error"; + errorNumber = String(errorNumber); + if (_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.error_descriptions[errorNumber]) { + basicMessage = + _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.error_descriptions[errorNumber].basicMessage; + detailMessage = + _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.error_descriptions[errorNumber].detailMessage; + } + return detail ? detailMessage : basicMessage; + }; + Scorm12Impl.prototype.replaceWithAnotherScormAPI = function (newAPI) { + this.cmi = newAPI.cmi; + }; + Scorm12Impl.prototype.renderCommitCMI = function (terminateCommit) { + var cmiExport = this.renderCMIToJSONObject(); + if (terminateCommit) { + cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime(); + } + var result = []; + var flattened = _utilities__WEBPACK_IMPORTED_MODULE_1__/* .flatten */ .Bq(cmiExport); + switch (this.settings.dataCommitFormat) { + case "flattened": + return _utilities__WEBPACK_IMPORTED_MODULE_1__/* .flatten */ .Bq(cmiExport); + case "params": + for (var item in flattened) { + if ({}.hasOwnProperty.call(flattened, item)) { + result.push("".concat(item, "=").concat(flattened[item])); + } + } + return result; + case "json": + default: + return cmiExport; + } + }; + Scorm12Impl.prototype.renderCommitObject = function (terminateCommit) { + var cmiExport = this.renderCommitCMI(terminateCommit); + var totalTimeHHMMSS = this.cmi.getCurrentTotalTime(); + var totalTimeSeconds = _utilities__WEBPACK_IMPORTED_MODULE_1__/* .getTimeAsSeconds */ .f4(totalTimeHHMMSS, _constants_regex__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A.scorm12.CMITimespan); + var lessonStatus = this.cmi.core.lesson_status; + var completionStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_8__/* .CompletionStatus */ .lC.unknown; + var successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_8__/* .SuccessStatus */ .YE.unknown; + if (lessonStatus) { + completionStatus = + lessonStatus === "completed" || lessonStatus === "passed" + ? _constants_enums__WEBPACK_IMPORTED_MODULE_8__/* .CompletionStatus */ .lC.completed + : _constants_enums__WEBPACK_IMPORTED_MODULE_8__/* .CompletionStatus */ .lC.incomplete; + if (lessonStatus === "passed") { + successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_8__/* .SuccessStatus */ .YE.passed; + } + else if (lessonStatus === "failed") { + successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_8__/* .SuccessStatus */ .YE.failed; + } + } + var score = this.cmi.core.score; + var scoreObject = null; + if (score) { + scoreObject = {}; + if (!Number.isNaN(Number.parseFloat(score.raw))) { + scoreObject.raw = Number.parseFloat(score.raw); + } + if (!Number.isNaN(Number.parseFloat(score.min))) { + scoreObject.min = Number.parseFloat(score.min); + } + if (!Number.isNaN(Number.parseFloat(score.max))) { + scoreObject.max = Number.parseFloat(score.max); + } + } + var commitObject = { + successStatus: successStatus, + completionStatus: completionStatus, + runtimeData: cmiExport, + totalTimeSeconds: totalTimeSeconds, + }; + if (scoreObject) { + commitObject.score = scoreObject; + } + return commitObject; + }; + Scorm12Impl.prototype.storeData = function (terminateCommit) { + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__awaiter */ .sH)(this, void 0, void 0, function () { + var originalStatus, shouldTerminateCommit, commitObject; + var _a, _b, _c; + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__generator */ .YH)(this, function (_d) { + switch (_d.label) { + case 0: + if (terminateCommit) { + originalStatus = this.cmi.core.lesson_status; + if (!this.cmi.core.lesson_status || + (!this.statusSetByModule && + this.cmi.core.lesson_status === "not attempted")) { + this.cmi.core.lesson_status = "completed"; + } + if (this.cmi.core.lesson_mode === "normal") { + if (this.cmi.core.credit === "credit") { + if (this.settings.mastery_override && + this.cmi.student_data.mastery_score !== "" && + this.cmi.core.score.raw !== "") { + this.cmi.core.lesson_status = + parseFloat(this.cmi.core.score.raw) >= + parseFloat(this.cmi.student_data.mastery_score) + ? "passed" + : "failed"; + } + } + } + else if (this.cmi.core.lesson_mode === "browse") { + if ((((_c = (_b = (_a = this.startingData) === null || _a === void 0 ? void 0 : _a.cmi) === null || _b === void 0 ? void 0 : _b.core) === null || _c === void 0 ? void 0 : _c.lesson_status) || "") === "" && + originalStatus === "not attempted") { + this.cmi.core.lesson_status = "browsed"; + } + } + } + shouldTerminateCommit = terminateCommit || this.settings.alwaysSendTotalTime; + commitObject = this.settings.renderCommonCommitFields + ? this.renderCommitObject(shouldTerminateCommit) + : this.renderCommitCMI(shouldTerminateCommit); + if (this.apiLogLevel === _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.global.LOG_LEVEL_DEBUG) { + console.debug("Commit (terminated: " + (terminateCommit ? "yes" : "no") + "): "); + console.debug(commitObject); + } + if (!(typeof this.settings.lmsCommitUrl === "string")) return [3, 2]; + return [4, this.processHttpRequest(this.settings.lmsCommitUrl, commitObject, terminateCommit)]; + case 1: return [2, _d.sent()]; + case 2: return [2, { + result: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.global.SCORM_TRUE, + errorCode: 0, + }]; + } + }); + }); + }; + return Scorm12Impl; +}(_BaseAPI__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A)); + + + +/***/ }), + +/***/ 589: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ B: function() { return /* binding */ CMIArray; } +/* harmony export */ }); +/* unused harmony export scorm12_error_codes */ +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635); +/* harmony import */ var _base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(797); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(784); + + + + +var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12; +var CMIArray = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__extends */ .C6)(CMIArray, _super); + function CMIArray(params) { + var _this = _super.call(this) || this; + _this.__children = params.children; + _this._errorCode = params.errorCode || scorm12_error_codes.GENERAL; + _this._errorClass = params.errorClass || _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .BaseScormValidationError */ .$h; + _this.childArray = []; + return _this; + } + Object.defineProperty(CMIArray.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new this._errorClass(this._errorCode); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIArray.prototype, "_count", { + get: function () { + return this.childArray.length; + }, + set: function (_count) { + throw new this._errorClass(this._errorCode); + }, + enumerable: false, + configurable: true + }); + CMIArray.prototype.toJSON = function () { + this.jsonString = true; + var result = {}; + for (var i = 0; i < this.childArray.length; i++) { + result[i + ""] = this.childArray[i]; + } + delete this.jsonString; + return result; + }; + return CMIArray; +}(_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 319: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ J: function() { return /* binding */ BaseCMI; }, +/* harmony export */ r: function() { return /* binding */ BaseRootCMI; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); + +var BaseCMI = (function () { + function BaseCMI() { + this.jsonString = false; + this._initialized = false; + } + Object.defineProperty(BaseCMI.prototype, "initialized", { + get: function () { + return this._initialized; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BaseCMI.prototype, "start_time", { + get: function () { + return this._start_time; + }, + enumerable: false, + configurable: true + }); + BaseCMI.prototype.initialize = function () { + this._initialized = true; + }; + BaseCMI.prototype.setStartTime = function () { + this._start_time = new Date().getTime(); + }; + return BaseCMI; +}()); + +var BaseRootCMI = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__extends */ .C6)(BaseRootCMI, _super); + function BaseRootCMI() { + return _super !== null && _super.apply(this, arguments) || this; + } + return BaseRootCMI; +}(BaseCMI)); + + + +/***/ }), + +/***/ 434: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ _: function() { return /* binding */ CMIScore; } +/* harmony export */ }); +/* unused harmony export scorm12_error_codes */ +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(417); +/* harmony import */ var _base_cmi__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(319); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(449); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797); + + + + + + +var scorm12_constants = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12; +var scorm12_regex = _constants_regex__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12; +var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12; +var CMIScore = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__extends */ .C6)(CMIScore, _super); + function CMIScore(params) { + var _this = _super.call(this) || this; + _this._raw = ""; + _this._min = ""; + _this.__children = params.score_children || scorm12_constants.score_children; + _this.__score_range = !params.score_range + ? false + : scorm12_regex.score_range; + _this._max = params.max || params.max === "" ? params.max : "100"; + _this.__invalid_error_code = + params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE; + _this.__invalid_type_code = + params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH; + _this.__invalid_range_code = + params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE; + _this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal; + _this.__error_class = params.errorClass; + return _this; + } + Object.defineProperty(CMIScore.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new this.__error_class(this.__invalid_error_code); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIScore.prototype, "raw", { + get: function () { + return this._raw; + }, + set: function (raw) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidFormat */ .q)(raw, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && + (!this.__score_range || + (0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidRange */ .W)(raw, this.__score_range, this.__invalid_range_code, this.__error_class))) { + this._raw = raw; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIScore.prototype, "min", { + get: function () { + return this._min; + }, + set: function (min) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidFormat */ .q)(min, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && + (!this.__score_range || + (0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidRange */ .W)(min, this.__score_range, this.__invalid_range_code, this.__error_class))) { + this._min = min; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIScore.prototype, "max", { + get: function () { + return this._max; + }, + set: function (max) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidFormat */ .q)(max, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && + (!this.__score_range || + (0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidRange */ .W)(max, this.__score_range, this.__invalid_range_code, this.__error_class))) { + this._max = max; + } + }, + enumerable: false, + configurable: true + }); + CMIScore.prototype.toJSON = function () { + this.jsonString = true; + var result = { + raw: this.raw, + min: this.min, + max: this.max, + }; + delete this.jsonString; + return result; + }; + return CMIScore; +}(_base_cmi__WEBPACK_IMPORTED_MODULE_2__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 449: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ W: function() { return /* binding */ checkValidRange; }, +/* harmony export */ q: function() { return /* binding */ checkValidFormat; } +/* harmony export */ }); +function checkValidFormat(value, regexPattern, errorCode, errorClass, allowEmptyString) { + if (typeof value !== "string") { + return false; + } + var formatRegex = new RegExp(regexPattern); + var matches = value.match(formatRegex); + if (allowEmptyString && value === "") { + return true; + } + if (value === undefined || !matches || matches[0] === "") { + throw new errorClass(errorCode); + } + return true; +} +function checkValidRange(value, rangePattern, errorCode, errorClass) { + var ranges = rangePattern.split("#"); + value = value * 1.0; + if (value >= ranges[0]) { + if (ranges[1] === "*" || value <= ranges[1]) { + return true; + } + else { + throw new errorClass(errorCode); + } + } + else { + throw new errorClass(errorCode); + } +} + + +/***/ }), + +/***/ 989: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + Y: function() { return /* binding */ CMI; } +}); + +// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs +var tslib_es6 = __webpack_require__(635); +// EXTERNAL MODULE: ./src/constants/api_constants.ts +var api_constants = __webpack_require__(340); +// EXTERNAL MODULE: ./src/constants/error_codes.ts +var error_codes = __webpack_require__(797); +// EXTERNAL MODULE: ./src/constants/regex.ts +var regex = __webpack_require__(417); +// EXTERNAL MODULE: ./src/exceptions.ts +var exceptions = __webpack_require__(784); +// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts +var base_cmi = __webpack_require__(319); +// EXTERNAL MODULE: ./src/cmi/scorm12/validation.ts +var validation = __webpack_require__(915); +// EXTERNAL MODULE: ./src/cmi/common/score.ts +var score = __webpack_require__(434); +// EXTERNAL MODULE: ./src/utilities.ts +var utilities = __webpack_require__(864); +;// ./src/cmi/aicc/core.ts + + + + + + + + + +var CMICore = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMICore, _super); + function CMICore() { + var _this = _super.call(this) || this; + _this.__children = api_constants/* default */.A.scorm12.core_children; + _this._student_id = ""; + _this._student_name = ""; + _this._lesson_location = ""; + _this._credit = ""; + _this._lesson_status = "not attempted"; + _this._entry = ""; + _this._total_time = ""; + _this._lesson_mode = "normal"; + _this._exit = ""; + _this._session_time = "00:00:00"; + _this._suspend_data = ""; + _this.score = new score/* CMIScore */._({ + score_children: api_constants/* default */.A.scorm12.score_children, + score_range: regex/* default */.A.scorm12.score_range, + invalidErrorCode: error_codes/* default */.A.scorm12.INVALID_SET_VALUE, + invalidTypeCode: error_codes/* default */.A.scorm12.TYPE_MISMATCH, + invalidRangeCode: error_codes/* default */.A.scorm12.VALUE_OUT_OF_RANGE, + errorClass: exceptions/* Scorm12ValidationError */.tQ, + }); + return _this; + } + CMICore.prototype.initialize = function () { + var _a; + _super.prototype.initialize.call(this); + (_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize(); + }; + Object.defineProperty(CMICore.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.INVALID_SET_VALUE); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "student_id", { + get: function () { + return this._student_id; + }, + set: function (student_id) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._student_id = student_id; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "student_name", { + get: function () { + return this._student_name; + }, + set: function (student_name) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._student_name = student_name; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "lesson_location", { + get: function () { + return this._lesson_location; + }, + set: function (lesson_location) { + if ((0,validation/* check12ValidFormat */.p)(lesson_location, regex/* default */.A.scorm12.CMIString256, true)) { + this._lesson_location = lesson_location; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "credit", { + get: function () { + return this._credit; + }, + set: function (credit) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._credit = credit; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "lesson_status", { + get: function () { + return this._lesson_status; + }, + set: function (lesson_status) { + if (this.initialized) { + if ((0,validation/* check12ValidFormat */.p)(lesson_status, regex/* default */.A.scorm12.CMIStatus)) { + this._lesson_status = lesson_status; + } + } + else { + if ((0,validation/* check12ValidFormat */.p)(lesson_status, regex/* default */.A.scorm12.CMIStatus2)) { + this._lesson_status = lesson_status; + } + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "entry", { + get: function () { + return this._entry; + }, + set: function (entry) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._entry = entry; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "total_time", { + get: function () { + return this._total_time; + }, + set: function (total_time) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._total_time = total_time; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "lesson_mode", { + get: function () { + return this._lesson_mode; + }, + set: function (lesson_mode) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._lesson_mode = lesson_mode; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "exit", { + get: function () { + if (!this.jsonString) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._exit; + }, + set: function (exit) { + if ((0,validation/* check12ValidFormat */.p)(exit, regex/* default */.A.scorm12.CMIExit, true)) { + this._exit = exit; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "session_time", { + get: function () { + if (!this.jsonString) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._session_time; + }, + set: function (session_time) { + if ((0,validation/* check12ValidFormat */.p)(session_time, regex/* default */.A.scorm12.CMITimespan)) { + this._session_time = session_time; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "suspend_data", { + get: function () { + return this._suspend_data; + }, + set: function (suspend_data) { + if ((0,validation/* check12ValidFormat */.p)(suspend_data, regex/* default */.A.scorm12.CMIString4096, true)) { + this._suspend_data = suspend_data; + } + }, + enumerable: false, + configurable: true + }); + CMICore.prototype.getCurrentTotalTime = function (start_time) { + var sessionTime = this._session_time; + var startTime = start_time; + if (typeof startTime !== "undefined" && startTime !== null) { + var seconds = new Date().getTime() - startTime; + sessionTime = utilities/* getSecondsAsHHMMSS */.UZ(seconds / 1000); + } + return utilities/* addHHMMSSTimeStrings */.HT(this._total_time, sessionTime, new RegExp(regex/* default */.A.scorm12.CMITimespan)); + }; + CMICore.prototype.toJSON = function () { + this.jsonString = true; + var result = { + student_id: this.student_id, + student_name: this.student_name, + lesson_location: this.lesson_location, + credit: this.credit, + lesson_status: this.lesson_status, + entry: this.entry, + lesson_mode: this.lesson_mode, + exit: this.exit, + session_time: this.session_time, + score: this.score, + }; + delete this.jsonString; + return result; + }; + return CMICore; +}(base_cmi/* BaseCMI */.J)); + + +// EXTERNAL MODULE: ./src/cmi/scorm12/objectives.ts +var objectives = __webpack_require__(176); +// EXTERNAL MODULE: ./src/cmi/scorm12/student_data.ts +var scorm12_student_data = __webpack_require__(532); +// EXTERNAL MODULE: ./src/cmi/scorm12/student_preference.ts +var student_preference = __webpack_require__(181); +// EXTERNAL MODULE: ./src/cmi/scorm12/interactions.ts +var interactions = __webpack_require__(833); +;// ./src/cmi/scorm12/cmi.ts + + + + + + + + + + + + +var CMI = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMI, _super); + function CMI(cmi_children, student_data, initialized) { + var _this = _super.call(this) || this; + _this.__children = ""; + _this.__version = "3.4"; + _this._launch_data = ""; + _this._comments = ""; + _this._comments_from_lms = ""; + if (initialized) + _this.initialize(); + _this.__children = cmi_children + ? cmi_children + : api_constants/* default */.A.scorm12.cmi_children; + _this.core = new CMICore(); + _this.objectives = new objectives/* CMIObjectives */.C(); + _this.student_data = student_data ? student_data : new scorm12_student_data/* CMIStudentData */.X(); + _this.student_preference = new student_preference/* CMIStudentPreference */.G(); + _this.interactions = new interactions/* CMIInteractions */.Xb(); + return _this; + } + CMI.prototype.initialize = function () { + var _a, _b, _c, _d, _e; + _super.prototype.initialize.call(this); + (_a = this.core) === null || _a === void 0 ? void 0 : _a.initialize(); + (_b = this.objectives) === null || _b === void 0 ? void 0 : _b.initialize(); + (_c = this.student_data) === null || _c === void 0 ? void 0 : _c.initialize(); + (_d = this.student_preference) === null || _d === void 0 ? void 0 : _d.initialize(); + (_e = this.interactions) === null || _e === void 0 ? void 0 : _e.initialize(); + }; + CMI.prototype.toJSON = function () { + this.jsonString = true; + var result = { + suspend_data: this.suspend_data, + launch_data: this.launch_data, + comments: this.comments, + comments_from_lms: this.comments_from_lms, + core: this.core, + objectives: this.objectives, + student_data: this.student_data, + student_preference: this.student_preference, + interactions: this.interactions, + }; + delete this.jsonString; + return result; + }; + Object.defineProperty(CMI.prototype, "_version", { + get: function () { + return this.__version; + }, + set: function (_version) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.INVALID_SET_VALUE); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.INVALID_SET_VALUE); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "suspend_data", { + get: function () { + var _a; + return (_a = this.core) === null || _a === void 0 ? void 0 : _a.suspend_data; + }, + set: function (suspend_data) { + if (this.core) { + this.core.suspend_data = suspend_data; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "launch_data", { + get: function () { + return this._launch_data; + }, + set: function (launch_data) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._launch_data = launch_data; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "comments", { + get: function () { + return this._comments; + }, + set: function (comments) { + if ((0,validation/* check12ValidFormat */.p)(comments, regex/* default */.A.scorm12.CMIString4096, true)) { + this._comments = comments; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "comments_from_lms", { + get: function () { + return this._comments_from_lms; + }, + set: function (comments_from_lms) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._comments_from_lms = comments_from_lms; + } + }, + enumerable: false, + configurable: true + }); + CMI.prototype.getCurrentTotalTime = function () { + return this.core.getCurrentTotalTime(this.start_time); + }; + return CMI; +}(base_cmi/* BaseRootCMI */.r)); + + + +/***/ }), + +/***/ 833: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Oh: function() { return /* binding */ CMIInteractionsObjectivesObject; }, +/* harmony export */ WP: function() { return /* binding */ CMIInteractionsObject; }, +/* harmony export */ Xb: function() { return /* binding */ CMIInteractions; }, +/* harmony export */ cb: function() { return /* binding */ CMIInteractionsCorrectResponsesObject; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(635); +/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(589); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(797); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(784); +/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(319); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(915); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(417); + + + + + + + + +var CMIInteractions = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(CMIInteractions, _super); + function CMIInteractions() { + return _super.call(this, { + children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.interactions_children, + errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE, + errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ, + }) || this; + } + return CMIInteractions; +}(_common_array__WEBPACK_IMPORTED_MODULE_0__/* .CMIArray */ .B)); + +var CMIInteractionsObject = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(CMIInteractionsObject, _super); + function CMIInteractionsObject() { + var _this = _super.call(this) || this; + _this._id = ""; + _this._time = ""; + _this._type = ""; + _this._weighting = ""; + _this._student_response = ""; + _this._result = ""; + _this._latency = ""; + _this.objectives = new _common_array__WEBPACK_IMPORTED_MODULE_0__/* .CMIArray */ .B({ + errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE, + errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ, + children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.objectives_children, + }); + _this.correct_responses = new _common_array__WEBPACK_IMPORTED_MODULE_0__/* .CMIArray */ .B({ + errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE, + errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ, + children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.correct_responses_children, + }); + return _this; + } + CMIInteractionsObject.prototype.initialize = function () { + var _a, _b; + _super.prototype.initialize.call(this); + (_a = this.objectives) === null || _a === void 0 ? void 0 : _a.initialize(); + (_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.initialize(); + }; + Object.defineProperty(CMIInteractionsObject.prototype, "id", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._id; + }, + set: function (id) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIIdentifier)) { + this._id = id; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "time", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._time; + }, + set: function (time) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(time, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMITime)) { + this._time = time; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "type", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._type; + }, + set: function (type) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(type, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIType)) { + this._type = type; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "weighting", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._weighting; + }, + set: function (weighting) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(weighting, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIDecimal) && + (0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidRange */ .h)(weighting, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.weighting_range)) { + this._weighting = weighting; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "student_response", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._student_response; + }, + set: function (student_response) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(student_response, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIFeedback, true)) { + this._student_response = student_response; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "result", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._result; + }, + set: function (result) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(result, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIResult)) { + this._result = result; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "latency", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._latency; + }, + set: function (latency) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(latency, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMITimespan)) { + this._latency = latency; + } + }, + enumerable: false, + configurable: true + }); + CMIInteractionsObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + id: this.id, + time: this.time, + type: this.type, + weighting: this.weighting, + student_response: this.student_response, + result: this.result, + latency: this.latency, + objectives: this.objectives, + correct_responses: this.correct_responses, + }; + delete this.jsonString; + return result; + }; + return CMIInteractionsObject; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__/* .BaseCMI */ .J)); + +var CMIInteractionsObjectivesObject = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(CMIInteractionsObjectivesObject, _super); + function CMIInteractionsObjectivesObject() { + var _this = _super.call(this) || this; + _this._id = ""; + return _this; + } + Object.defineProperty(CMIInteractionsObjectivesObject.prototype, "id", { + get: function () { + return this._id; + }, + set: function (id) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIIdentifier)) { + this._id = id; + } + }, + enumerable: false, + configurable: true + }); + CMIInteractionsObjectivesObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + id: this.id, + }; + delete this.jsonString; + return result; + }; + return CMIInteractionsObjectivesObject; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__/* .BaseCMI */ .J)); + +var CMIInteractionsCorrectResponsesObject = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(CMIInteractionsCorrectResponsesObject, _super); + function CMIInteractionsCorrectResponsesObject() { + var _this = _super.call(this) || this; + _this._pattern = ""; + return _this; + } + Object.defineProperty(CMIInteractionsCorrectResponsesObject.prototype, "pattern", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._pattern; + }, + set: function (pattern) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(pattern, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIFeedback, true)) { + this._pattern = pattern; + } + }, + enumerable: false, + configurable: true + }); + CMIInteractionsCorrectResponsesObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + pattern: this._pattern, + }; + delete this.jsonString; + return result; + }; + return CMIInteractionsCorrectResponsesObject; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 331: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ A: function() { return /* binding */ NAV; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635); +/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(915); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(417); + + + + +var NAV = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__extends */ .C6)(NAV, _super); + function NAV() { + var _this = _super.call(this) || this; + _this._event = ""; + return _this; + } + Object.defineProperty(NAV.prototype, "event", { + get: function () { + return this._event; + }, + set: function (event) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_1__/* .check12ValidFormat */ .p)(event, _constants_regex__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.NAVEvent)) { + this._event = event; + } + }, + enumerable: false, + configurable: true + }); + NAV.prototype.toJSON = function () { + this.jsonString = true; + var result = { + event: this.event, + }; + delete this.jsonString; + return result; + }; + return NAV; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 176: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ C: function() { return /* binding */ CMIObjectives; }, +/* harmony export */ N: function() { return /* binding */ CMIObjectivesObject; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(635); +/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _common_score__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(434); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(340); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(417); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(797); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(784); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(915); +/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(589); + + + + + + + + + +var CMIObjectives = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__extends */ .C6)(CMIObjectives, _super); + function CMIObjectives() { + return _super.call(this, { + children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.objectives_children, + errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE, + errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_5__/* .Scorm12ValidationError */ .tQ, + }) || this; + } + return CMIObjectives; +}(_common_array__WEBPACK_IMPORTED_MODULE_7__/* .CMIArray */ .B)); + +var CMIObjectivesObject = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__extends */ .C6)(CMIObjectivesObject, _super); + function CMIObjectivesObject() { + var _this = _super.call(this) || this; + _this._id = ""; + _this._status = ""; + _this.score = new _common_score__WEBPACK_IMPORTED_MODULE_1__/* .CMIScore */ ._({ + score_children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.score_children, + score_range: _constants_regex__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.score_range, + invalidErrorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE, + invalidTypeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.scorm12.TYPE_MISMATCH, + invalidRangeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.scorm12.VALUE_OUT_OF_RANGE, + errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_5__/* .Scorm12ValidationError */ .tQ, + }); + return _this; + } + Object.defineProperty(CMIObjectivesObject.prototype, "id", { + get: function () { + return this._id; + }, + set: function (id) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__/* .check12ValidFormat */ .p)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.CMIIdentifier)) { + this._id = id; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIObjectivesObject.prototype, "status", { + get: function () { + return this._status; + }, + set: function (status) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__/* .check12ValidFormat */ .p)(status, _constants_regex__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.CMIStatus2)) { + this._status = status; + } + }, + enumerable: false, + configurable: true + }); + CMIObjectivesObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + id: this.id, + status: this.status, + score: this.score, + }; + delete this.jsonString; + return result; + }; + return CMIObjectivesObject; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 532: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ X: function() { return /* binding */ CMIStudentData; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635); +/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(784); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797); + + + + + +var CMIStudentData = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__extends */ .C6)(CMIStudentData, _super); + function CMIStudentData(student_data_children) { + var _this = _super.call(this) || this; + _this._mastery_score = ""; + _this._max_time_allowed = ""; + _this._time_limit_action = ""; + _this.__children = student_data_children + ? student_data_children + : _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.student_data_children; + return _this; + } + Object.defineProperty(CMIStudentData.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentData.prototype, "mastery_score", { + get: function () { + return this._mastery_score; + }, + set: function (mastery_score) { + if (this.initialized) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._mastery_score = mastery_score; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentData.prototype, "max_time_allowed", { + get: function () { + return this._max_time_allowed; + }, + set: function (max_time_allowed) { + if (this.initialized) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._max_time_allowed = max_time_allowed; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentData.prototype, "time_limit_action", { + get: function () { + return this._time_limit_action; + }, + set: function (time_limit_action) { + if (this.initialized) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._time_limit_action = time_limit_action; + } + }, + enumerable: false, + configurable: true + }); + CMIStudentData.prototype.toJSON = function () { + this.jsonString = true; + var result = { + mastery_score: this.mastery_score, + max_time_allowed: this.max_time_allowed, + time_limit_action: this.time_limit_action, + }; + delete this.jsonString; + return result; + }; + return CMIStudentData; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 181: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ G: function() { return /* binding */ CMIStudentPreference; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(635); +/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(784); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(915); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(417); + + + + + + + +var CMIStudentPreference = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__extends */ .C6)(CMIStudentPreference, _super); + function CMIStudentPreference(student_preference_children) { + var _this = _super.call(this) || this; + _this._audio = ""; + _this._language = ""; + _this._speed = ""; + _this._text = ""; + _this.__children = student_preference_children + ? student_preference_children + : _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.student_preference_children; + return _this; + } + Object.defineProperty(CMIStudentPreference.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentPreference.prototype, "audio", { + get: function () { + return this._audio; + }, + set: function (audio) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidFormat */ .p)(audio, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.CMISInteger) && + (0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidRange */ .h)(audio, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.audio_range)) { + this._audio = audio; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentPreference.prototype, "language", { + get: function () { + return this._language; + }, + set: function (language) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidFormat */ .p)(language, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.CMIString256)) { + this._language = language; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentPreference.prototype, "speed", { + get: function () { + return this._speed; + }, + set: function (speed) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidFormat */ .p)(speed, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.CMISInteger) && + (0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidRange */ .h)(speed, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.speed_range)) { + this._speed = speed; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentPreference.prototype, "text", { + get: function () { + return this._text; + }, + set: function (text) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidFormat */ .p)(text, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.CMISInteger) && + (0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidRange */ .h)(text, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.text_range)) { + this._text = text; + } + }, + enumerable: false, + configurable: true + }); + CMIStudentPreference.prototype.toJSON = function () { + this.jsonString = true; + var result = { + audio: this.audio, + language: this.language, + speed: this.speed, + text: this.text, + }; + delete this.jsonString; + return result; + }; + return CMIStudentPreference; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 915: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ h: function() { return /* binding */ check12ValidRange; }, +/* harmony export */ p: function() { return /* binding */ check12ValidFormat; } +/* harmony export */ }); +/* harmony import */ var _common_validation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(449); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(797); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(784); + + + +function check12ValidFormat(value, regexPattern, allowEmptyString) { + return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__/* .checkValidFormat */ .q)(value, regexPattern, _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.TYPE_MISMATCH, _exceptions__WEBPACK_IMPORTED_MODULE_1__/* .Scorm12ValidationError */ .tQ, allowEmptyString); +} +function check12ValidRange(value, rangePattern, allowEmptyString) { + if (!allowEmptyString && value === "") { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_1__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.VALUE_OUT_OF_RANGE); + } + return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__/* .checkValidRange */ .W)(value, rangePattern, _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.VALUE_OUT_OF_RANGE, _exceptions__WEBPACK_IMPORTED_MODULE_1__/* .Scorm12ValidationError */ .tQ); +} + + +/***/ }), + +/***/ 340: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); + +var global = { + SCORM_TRUE: "true", + SCORM_FALSE: "false", + STATE_NOT_INITIALIZED: 0, + STATE_INITIALIZED: 1, + STATE_TERMINATED: 2, + LOG_LEVEL_DEBUG: 1, + LOG_LEVEL_INFO: 2, + LOG_LEVEL_WARNING: 3, + LOG_LEVEL_ERROR: 4, + LOG_LEVEL_NONE: 5, +}; +var scorm12 = { + cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions", + core_children: "student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time", + score_children: "raw,min,max", + comments_children: "content,location,time", + objectives_children: "id,score,status", + correct_responses_children: "pattern", + student_data_children: "mastery_score,max_time_allowed,time_limit_action", + student_preference_children: "audio,language,speed,text", + interactions_children: "id,objectives,time,type,correct_responses,weighting,student_response,result,latency", + error_descriptions: { + "101": { + basicMessage: "General Exception", + detailMessage: "No specific error code exists to describe the error. Use LMSGetDiagnostic for more information", + }, + "201": { + basicMessage: "Invalid argument error", + detailMessage: "Indicates that an argument represents an invalid data model element or is otherwise incorrect.", + }, + "202": { + basicMessage: "Element cannot have children", + detailMessage: 'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.', + }, + "203": { + basicMessage: "Element not an array - cannot have count", + detailMessage: 'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.', + }, + "301": { + basicMessage: "Not initialized", + detailMessage: "Indicates that an API call was made before the call to lmsInitialize.", + }, + "401": { + basicMessage: "Not implemented error", + detailMessage: "The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.", + }, + "402": { + basicMessage: "Invalid set value, element is a keyword", + detailMessage: 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").', + }, + "403": { + basicMessage: "Element is read only", + detailMessage: "LMSSetValue was called with a data model element that can only be read.", + }, + "404": { + basicMessage: "Element is write only", + detailMessage: "LMSGetValue was called on a data model element that can only be written to.", + }, + "405": { + basicMessage: "Incorrect Data Type", + detailMessage: "LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.", + }, + "407": { + basicMessage: "Element Value Out Of Range", + detailMessage: "The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.", + }, + "408": { + basicMessage: "Data Model Dependency Not Established", + detailMessage: "Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.", + }, + }, +}; +var aicc = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, scorm12), { + cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation", + student_preference_children: "audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows", + student_data_children: "attempt_number,tries,mastery_score,max_time_allowed,time_limit_action", + student_demographics_children: "city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience", + tries_children: "time,status,score", + attempt_records_children: "score,lesson_status", + paths_children: "location_id,date,time,status,why_left,time_in_element", +}); +var scorm2004 = { + cmi_children: "_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time", + comments_children: "comment,timestamp,location", + score_children: "max,raw,scaled,min", + objectives_children: "progress_measure,completion_status,success_status,description,score,id", + correct_responses_children: "pattern", + student_data_children: "mastery_score,max_time_allowed,time_limit_action", + student_preference_children: "audio_level,audio_captioning,delivery_speed,language", + interactions_children: "id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description", + error_descriptions: { + "0": { + basicMessage: "No Error", + detailMessage: "No error occurred, the previous API call was successful.", + }, + "101": { + basicMessage: "General Exception", + detailMessage: "No specific error code exists to describe the error. Use GetDiagnostic for more information.", + }, + "102": { + basicMessage: "General Initialization Failure", + detailMessage: "Call to Initialize failed for an unknown reason.", + }, + "103": { + basicMessage: "Already Initialized", + detailMessage: "Call to Initialize failed because Initialize was already called.", + }, + "104": { + basicMessage: "Content Instance Terminated", + detailMessage: "Call to Initialize failed because Terminate was already called.", + }, + "111": { + basicMessage: "General Termination Failure", + detailMessage: "Call to Terminate failed for an unknown reason.", + }, + "112": { + basicMessage: "Termination Before Initialization", + detailMessage: "Call to Terminate failed because it was made before the call to Initialize.", + }, + "113": { + basicMessage: "Termination After Termination", + detailMessage: "Call to Terminate failed because Terminate was already called.", + }, + "122": { + basicMessage: "Retrieve Data Before Initialization", + detailMessage: "Call to GetValue failed because it was made before the call to Initialize.", + }, + "123": { + basicMessage: "Retrieve Data After Termination", + detailMessage: "Call to GetValue failed because it was made after the call to Terminate.", + }, + "132": { + basicMessage: "Store Data Before Initialization", + detailMessage: "Call to SetValue failed because it was made before the call to Initialize.", + }, + "133": { + basicMessage: "Store Data After Termination", + detailMessage: "Call to SetValue failed because it was made after the call to Terminate.", + }, + "142": { + basicMessage: "Commit Before Initialization", + detailMessage: "Call to Commit failed because it was made before the call to Initialize.", + }, + "143": { + basicMessage: "Commit After Termination", + detailMessage: "Call to Commit failed because it was made after the call to Terminate.", + }, + "201": { + basicMessage: "General Argument Error", + detailMessage: "An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.", + }, + "301": { + basicMessage: "General Get Failure", + detailMessage: "Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.", + }, + "351": { + basicMessage: "General Set Failure", + detailMessage: "Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.", + }, + "391": { + basicMessage: "General Commit Failure", + detailMessage: "Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.", + }, + "401": { + basicMessage: "Undefined Data Model Element", + detailMessage: "The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.", + }, + "402": { + basicMessage: "Unimplemented Data Model Element", + detailMessage: "The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.", + }, + "403": { + basicMessage: "Data Model Element Value Not Initialized", + detailMessage: "Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.", + }, + "404": { + basicMessage: "Data Model Element Is Read Only", + detailMessage: "SetValue was called with a data model element that can only be read.", + }, + "405": { + basicMessage: "Data Model Element Is Write Only", + detailMessage: "GetValue was called on a data model element that can only be written to.", + }, + "406": { + basicMessage: "Data Model Element Type Mismatch", + detailMessage: "SetValue was called with a value that is not consistent with the data format of the supplied data model element.", + }, + "407": { + basicMessage: "Data Model Element Value Out Of Range", + detailMessage: "The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.", + }, + "408": { + basicMessage: "Data Model Dependency Not Established", + detailMessage: "Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.", + }, + }, +}; +var APIConstants = { + global: global, + scorm12: scorm12, + aicc: aicc, + scorm2004: scorm2004, +}; +/* harmony default export */ __webpack_exports__.A = (APIConstants); + + +/***/ }), + +/***/ 56: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ YE: function() { return /* binding */ SuccessStatus; }, +/* harmony export */ lC: function() { return /* binding */ CompletionStatus; } +/* harmony export */ }); +/* unused harmony export NAVBoolean */ +var NAVBoolean; +(function (NAVBoolean) { + NAVBoolean["unknown"] = "unknown"; + NAVBoolean["true"] = "true"; + NAVBoolean["false"] = "false"; +})(NAVBoolean || (NAVBoolean = {})); +var SuccessStatus; +(function (SuccessStatus) { + SuccessStatus["passed"] = "passed"; + SuccessStatus["failed"] = "failed"; + SuccessStatus["unknown"] = "unknown"; +})(SuccessStatus || (SuccessStatus = {})); +var CompletionStatus; +(function (CompletionStatus) { + CompletionStatus["completed"] = "completed"; + CompletionStatus["incomplete"] = "incomplete"; + CompletionStatus["unknown"] = "unknown"; +})(CompletionStatus || (CompletionStatus = {})); + + +/***/ }), + +/***/ 797: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); + +var global = { + GENERAL: 101, + INITIALIZATION_FAILED: 101, + INITIALIZED: 101, + TERMINATED: 101, + TERMINATION_FAILURE: 101, + TERMINATION_BEFORE_INIT: 101, + MULTIPLE_TERMINATION: 101, + RETRIEVE_BEFORE_INIT: 101, + RETRIEVE_AFTER_TERM: 101, + STORE_BEFORE_INIT: 101, + STORE_AFTER_TERM: 101, + COMMIT_BEFORE_INIT: 101, + COMMIT_AFTER_TERM: 101, + ARGUMENT_ERROR: 101, + CHILDREN_ERROR: 101, + COUNT_ERROR: 101, + GENERAL_GET_FAILURE: 101, + GENERAL_SET_FAILURE: 101, + GENERAL_COMMIT_FAILURE: 101, + UNDEFINED_DATA_MODEL: 101, + UNIMPLEMENTED_ELEMENT: 101, + VALUE_NOT_INITIALIZED: 101, + INVALID_SET_VALUE: 101, + READ_ONLY_ELEMENT: 101, + WRITE_ONLY_ELEMENT: 101, + TYPE_MISMATCH: 101, + VALUE_OUT_OF_RANGE: 101, + DEPENDENCY_NOT_ESTABLISHED: 101, +}; +var scorm12 = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, global), { RETRIEVE_BEFORE_INIT: 301, STORE_BEFORE_INIT: 301, COMMIT_BEFORE_INIT: 301, ARGUMENT_ERROR: 201, CHILDREN_ERROR: 202, COUNT_ERROR: 203, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 401, VALUE_NOT_INITIALIZED: 301, INVALID_SET_VALUE: 402, READ_ONLY_ELEMENT: 403, WRITE_ONLY_ELEMENT: 404, TYPE_MISMATCH: 405, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 }); +var scorm2004 = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, global), { INITIALIZATION_FAILED: 102, INITIALIZED: 103, TERMINATED: 104, TERMINATION_FAILURE: 111, TERMINATION_BEFORE_INIT: 112, MULTIPLE_TERMINATIONS: 113, RETRIEVE_BEFORE_INIT: 122, RETRIEVE_AFTER_TERM: 123, STORE_BEFORE_INIT: 132, STORE_AFTER_TERM: 133, COMMIT_BEFORE_INIT: 142, COMMIT_AFTER_TERM: 143, ARGUMENT_ERROR: 201, GENERAL_GET_FAILURE: 301, GENERAL_SET_FAILURE: 351, GENERAL_COMMIT_FAILURE: 391, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 402, VALUE_NOT_INITIALIZED: 403, READ_ONLY_ELEMENT: 404, WRITE_ONLY_ELEMENT: 405, TYPE_MISMATCH: 406, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 }); +var ErrorCodes = { + scorm12: scorm12, + scorm2004: scorm2004, +}; +/* harmony default export */ __webpack_exports__.A = (ErrorCodes); + + +/***/ }), + +/***/ 417: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); + +var scorm12 = { + CMIString256: "^.{0,255}$", + CMIString4096: "^.{0,4096}$", + CMITime: "^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$", + CMITimespan: "^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$", + CMIInteger: "^\\d+$", + CMISInteger: "^-?([0-9]+)$", + CMIDecimal: "^-?([0-9]{0,3})(.[0-9]*)?$", + CMIIdentifier: "^[\\u0021-\\u007E\\s]{0,255}$", + CMIFeedback: "^.{0,255}$", + CMIIndex: "[._](\\d+).", + CMIStatus: "^(passed|completed|failed|incomplete|browsed)$", + CMIStatus2: "^(passed|completed|failed|incomplete|browsed|not attempted)$", + CMIExit: "^(time-out|suspend|logout|)$", + CMIType: "^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$", + CMIResult: "^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$", + NAVEvent: "^(previous|continue)$", + score_range: "0#100", + audio_range: "-1#100", + speed_range: "-100#100", + weighting_range: "-100#100", + text_range: "-1#1", +}; +var aicc = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, scorm12), { + CMIIdentifier: "^\\w{1,255}$", +}); +var scorm2004 = { + CMIString200: "^[\\u0000-\\uFFFF]{0,200}$", + CMIString250: "^[\\u0000-\\uFFFF]{0,250}$", + CMIString1000: "^[\\u0000-\\uFFFF]{0,1000}$", + CMIString4000: "^[\\u0000-\\uFFFF]{0,4000}$", + CMIString64000: "^[\\u0000-\\uFFFF]{0,64000}$", + CMILang: "^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$", + CMILangString250: "^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$", + CMILangcr: "^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$", + CMILangString250cr: "^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$", + CMILangString4000: "^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$", + CMITime: "^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$", + CMITimespan: "^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$", + CMIInteger: "^\\d+$", + CMISInteger: "^-?([0-9]+)$", + CMIDecimal: "^-?([0-9]{1,5})(\\.[0-9]{1,18})?$", + CMIIdentifier: "^\\S{1,250}[a-zA-Z0-9]$", + CMIShortIdentifier: "^[\\w\\.\\-\\_]{1,250}$", + CMILongIdentifier: "^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$", + CMIFeedback: "^.*$", + CMIIndex: "[._](\\d+).", + CMIIndexStore: ".N(\\d+).", + CMICStatus: "^(completed|incomplete|not attempted|unknown)$", + CMISStatus: "^(passed|failed|unknown)$", + CMIExit: "^(time-out|suspend|logout|normal)$", + CMIType: "^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$", + CMIResult: "^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$", + NAVEvent: "^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$", + NAVBoolean: "^(unknown|true|false$)", + NAVTarget: "^{target=\\S{0,}[a-zA-Z0-9-_]+}$", + scaled_range: "-1#1", + audio_range: "0#*", + speed_range: "0#*", + text_range: "-1#1", + progress_range: "0#1", +}; +var Regex = { + aicc: aicc, + scorm12: scorm12, + scorm2004: scorm2004, +}; +/* harmony default export */ __webpack_exports__.A = (Regex); + + +/***/ }), + +/***/ 784: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ $h: function() { return /* binding */ BaseScormValidationError; }, +/* harmony export */ gv: function() { return /* binding */ AICCValidationError; }, +/* harmony export */ tQ: function() { return /* binding */ Scorm12ValidationError; }, +/* harmony export */ yI: function() { return /* binding */ ValidationError; } +/* harmony export */ }); +/* unused harmony export Scorm2004ValidationError */ +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(635); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340); + + +var scorm12_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.error_descriptions; +var aicc_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.aicc.error_descriptions; +var scorm2004_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm2004.error_descriptions; +var BaseScormValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(BaseScormValidationError, _super); + function BaseScormValidationError(errorCode) { + var _this = _super.call(this, errorCode.toString()) || this; + _this._errorCode = errorCode; + _this.name = "ScormValidationError"; + return _this; + } + Object.defineProperty(BaseScormValidationError.prototype, "errorCode", { + get: function () { + return this._errorCode; + }, + enumerable: false, + configurable: true + }); + BaseScormValidationError.prototype.setMessage = function (message) { + this.message = message; + }; + return BaseScormValidationError; +}(Error)); + +var ValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(ValidationError, _super); + function ValidationError(errorCode, errorMessage, detailedMessage) { + var _this = _super.call(this, errorCode) || this; + _this._detailedMessage = ""; + _this.setMessage(errorMessage); + _this._errorMessage = errorMessage; + if (detailedMessage) { + _this._detailedMessage = detailedMessage; + } + return _this; + } + Object.defineProperty(ValidationError.prototype, "errorMessage", { + get: function () { + return this._errorMessage; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(ValidationError.prototype, "detailedMessage", { + get: function () { + return this._detailedMessage; + }, + enumerable: false, + configurable: true + }); + return ValidationError; +}(BaseScormValidationError)); + +var Scorm12ValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(Scorm12ValidationError, _super); + function Scorm12ValidationError(errorCode) { + var _this = this; + if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) { + _this = _super.call(this, errorCode, scorm12_errors[String(errorCode)].basicMessage, scorm12_errors[String(errorCode)].detailMessage) || this; + } + else { + _this = _super.call(this, 101, scorm12_errors["101"].basicMessage, scorm12_errors["101"].detailMessage) || this; + } + return _this; + } + return Scorm12ValidationError; +}(ValidationError)); + +var AICCValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(AICCValidationError, _super); + function AICCValidationError(errorCode) { + var _this = this; + if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) { + _this = _super.call(this, errorCode, aicc_errors[String(errorCode)].basicMessage, aicc_errors[String(errorCode)].detailMessage) || this; + } + else { + _this = _super.call(this, 101, aicc_errors["101"].basicMessage, aicc_errors["101"].detailMessage) || this; + } + return _this; + } + return AICCValidationError; +}(ValidationError)); + +var Scorm2004ValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(Scorm2004ValidationError, _super); + function Scorm2004ValidationError(errorCode) { + var _this = this; + if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) { + _this = _super.call(this, errorCode, scorm2004_errors[String(errorCode)].basicMessage, scorm2004_errors[String(errorCode)].detailMessage) || this; + } + else { + _this = _super.call(this, 101, scorm2004_errors["101"].basicMessage, scorm2004_errors["101"].detailMessage) || this; + } + return _this; + } + return Scorm2004ValidationError; +}(ValidationError)); + + + +/***/ }), + +/***/ 864: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Bq: function() { return /* binding */ flatten; }, +/* harmony export */ HT: function() { return /* binding */ addHHMMSSTimeStrings; }, +/* harmony export */ J6: function() { return /* binding */ stringMatches; }, +/* harmony export */ UZ: function() { return /* binding */ getSecondsAsHHMMSS; }, +/* harmony export */ f4: function() { return /* binding */ getTimeAsSeconds; }, +/* harmony export */ hw: function() { return /* binding */ formatMessage; }, +/* harmony export */ sB: function() { return /* binding */ unflatten; } +/* harmony export */ }); +/* unused harmony exports SECONDS_PER_SECOND, SECONDS_PER_MINUTE, SECONDS_PER_HOUR, SECONDS_PER_DAY, getSecondsAsISODuration, getDurationAsSeconds, addTwoDurations, countDecimals */ +var SECONDS_PER_SECOND = 1.0; +var SECONDS_PER_MINUTE = 60; +var SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE; +var SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR; +var designations = { + D: SECONDS_PER_DAY, + H: SECONDS_PER_HOUR, + M: SECONDS_PER_MINUTE, + S: SECONDS_PER_SECOND, +}; +function getSecondsAsHHMMSS(totalSeconds) { + if (!totalSeconds || totalSeconds <= 0) { + return "00:00:00"; + } + var hours = Math.floor(totalSeconds / SECONDS_PER_HOUR); + var dateObj = new Date(totalSeconds * 1000); + var minutes = dateObj.getUTCMinutes(); + var seconds = dateObj.getSeconds(); + var ms = totalSeconds % 1.0; + var msStr = ""; + if (countDecimals(ms) > 0) { + if (countDecimals(ms) > 2) { + msStr = ms.toFixed(2); + } + else { + msStr = String(ms); + } + msStr = "." + msStr.split(".")[1]; + } + return ((hours + ":" + minutes + ":" + seconds).replace(/\b\d\b/g, "0$&") + msStr); +} +function getSecondsAsISODuration(seconds) { + if (!seconds || seconds <= 0) { + return "PT0S"; + } + var duration = "P"; + var remainder = seconds; + for (var designationsKey in designations) { + var current_seconds = designations[designationsKey]; + var value = Math.floor(remainder / current_seconds); + remainder = remainder % current_seconds; + if (countDecimals(remainder) > 2) { + remainder = Number(Number(remainder).toFixed(2)); + } + if (designationsKey === "S" && remainder > 0) { + value += remainder; + } + if (value) { + if ((duration.indexOf("D") > 0 || + designationsKey === "H" || + designationsKey === "M" || + designationsKey === "S") && + duration.indexOf("T") === -1) { + duration += "T"; + } + duration += "".concat(value).concat(designationsKey); + } + } + return duration; +} +function getTimeAsSeconds(timeString, timeRegex) { + if (typeof timeString === "number" || typeof timeString === "boolean") { + timeString = String(timeString); + } + if (typeof timeRegex === "string") { + timeRegex = new RegExp(timeRegex); + } + if (!timeString || !timeString.match(timeRegex)) { + return 0; + } + var parts = timeString.split(":"); + var hours = Number(parts[0]); + var minutes = Number(parts[1]); + var seconds = Number(parts[2]); + return hours * 3600 + minutes * 60 + seconds; +} +function getDurationAsSeconds(duration, durationRegex) { + if (typeof durationRegex === "string") { + durationRegex = new RegExp(durationRegex); + } + if (!duration || !duration.match(durationRegex)) { + return 0; + } + var _a = new RegExp(durationRegex).exec(duration) || [], years = _a[1], _ = _a[2], days = _a[4], hours = _a[5], minutes = _a[6], seconds = _a[7]; + var result = 0.0; + result += Number(seconds) || 0.0; + result += Number(minutes) * 60.0 || 0.0; + result += Number(hours) * 3600.0 || 0.0; + result += Number(days) * (60 * 60 * 24.0) || 0.0; + result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0; + return result; +} +function addTwoDurations(first, second, durationRegex) { + var regex = typeof durationRegex === "string" + ? new RegExp(durationRegex) + : durationRegex; + return getSecondsAsISODuration(getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex)); +} +function addHHMMSSTimeStrings(first, second, timeRegex) { + if (typeof timeRegex === "string") { + timeRegex = new RegExp(timeRegex); + } + return getSecondsAsHHMMSS(getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex)); +} +function flatten(data) { + var result = {}; + function recurse(cur, prop) { + if (Object(cur) !== cur) { + result[prop] = cur; + } + else if (Array.isArray(cur)) { + for (var i = 0, l = cur.length; i < l; i++) { + recurse(cur[i], prop + "[" + i + "]"); + if (l === 0) + result[prop] = []; + } + } + else { + var isEmpty = true; + for (var p in cur) { + if ({}.hasOwnProperty.call(cur, p)) { + isEmpty = false; + recurse(cur[p], prop ? prop + "." + p : p); + } + } + if (isEmpty && prop) + result[prop] = {}; + } + } + recurse(data, ""); + return result; +} +function unflatten(data) { + "use strict"; + if (Object(data) !== data || Array.isArray(data)) + return data; + var regex = /\.?([^.[\]]+)|\[(\d+)]/g; + var result = {}; + for (var p in data) { + if ({}.hasOwnProperty.call(data, p)) { + var cur = result; + var prop = ""; + var m = regex.exec(p); + while (m) { + cur = cur[prop] || (cur[prop] = m[2] ? [] : {}); + prop = m[2] || m[1]; + m = regex.exec(p); + } + cur[prop] = data[p]; + } + } + return result[""] || result; +} +function countDecimals(num) { + if (Math.floor(num) === num || String(num).indexOf(".") < 0) + return 0; + var parts = num.toString().split(".")[1]; + return parts.length || 0; +} +function formatMessage(functionName, message, CMIElement) { + var baseLength = 20; + var messageString = ""; + messageString += functionName; + var fillChars = baseLength - messageString.length; + for (var i = 0; i < fillChars; i++) { + messageString += " "; + } + messageString += ": "; + if (CMIElement) { + var CMIElementBaseLength = 70; + messageString += CMIElement; + fillChars = CMIElementBaseLength - messageString.length; + for (var j = 0; j < fillChars; j++) { + messageString += " "; + } + } + if (message) { + messageString += message; + } + return messageString; +} +function stringMatches(str, tester) { + return (str === null || str === void 0 ? void 0 : str.match(tester)) !== null; +} + + +/***/ }), + +/***/ 635: +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ C6: function() { return /* binding */ __extends; }, +/* harmony export */ Cl: function() { return /* binding */ __assign; }, +/* harmony export */ YH: function() { return /* binding */ __generator; }, +/* harmony export */ sH: function() { return /* binding */ __awaiter; } +/* harmony export */ }); +/* unused harmony exports __rest, __decorate, __param, __esDecorate, __runInitializers, __propKey, __setFunctionName, __metadata, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn, __addDisposableResource, __disposeResources */ +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise, SuppressedError, Symbol, Iterator */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + } + return __assign.apply(this, arguments); +} + +function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +} + +function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +} + +function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } + var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context = {}; + for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context.access[p] = contextIn.access[p]; + context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } + else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; + } + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; +}; + +function __runInitializers(thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) { + value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + } + return useValue ? value : void 0; +}; + +function __propKey(x) { + return typeof x === "symbol" ? x : "".concat(x); +}; + +function __setFunctionName(f, name, prefix) { + if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; + return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); +}; + +function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} + +function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +var __createBinding = Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); + +function __exportStar(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); +} + +function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} + +function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +/** @deprecated */ +function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} + +/** @deprecated */ +function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +} + +function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +} + +function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} + +function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; + function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } + function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} + +function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } +} + +function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} + +function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; + +var __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}; + +function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +} + +function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; +} + +function __classPrivateFieldGet(receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +} + +function __classPrivateFieldSet(receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; +} + +function __classPrivateFieldIn(state, receiver) { + if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); + return typeof state === "function" ? receiver === state : state.has(receiver); +} + +function __addDisposableResource(env, value, async) { + if (value !== null && value !== void 0) { + if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); + var dispose, inner; + if (async) { + if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value[Symbol.asyncDispose]; + } + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + if (async) inner = dispose; + } + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; + env.stack.push({ value: value, dispose: dispose, async: async }); + } + else if (async) { + env.stack.push({ async: true }); + } + return value; +} + +var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; +}; + +function __disposeResources(env) { + function fail(e) { + env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; + env.hasError = true; + } + var r, s = 0; + function next() { + while (r = env.stack.pop()) { + try { + if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); + if (r.dispose) { + var result = r.dispose.call(r.value); + if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); + } + else s |= 1; + } + catch (e) { + fail(e); + } + } + if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); + if (env.hasError) throw env.error; + } + return next(); +} + +/* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ({ + __extends, + __assign, + __rest, + __decorate, + __param, + __metadata, + __awaiter, + __generator, + __createBinding, + __exportStar, + __values, + __read, + __spread, + __spreadArrays, + __spreadArray, + __await, + __asyncGenerator, + __asyncDelegator, + __asyncValues, + __makeTemplateObject, + __importStar, + __importDefault, + __classPrivateFieldGet, + __classPrivateFieldSet, + __classPrivateFieldIn, + __addDisposableResource, + __disposeResources, +}); + + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ !function() { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = function(exports, definition) { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ !function() { +/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ }(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + X: function() { return /* binding */ AICCImpl; } +}); + +// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs +var tslib_es6 = __webpack_require__(635); +// EXTERNAL MODULE: ./src/Scorm12API.ts +var Scorm12API = __webpack_require__(941); +// EXTERNAL MODULE: ./src/cmi/scorm12/cmi.ts + 1 modules +var cmi = __webpack_require__(989); +// EXTERNAL MODULE: ./src/constants/api_constants.ts +var api_constants = __webpack_require__(340); +// EXTERNAL MODULE: ./src/cmi/common/array.ts +var array = __webpack_require__(589); +// EXTERNAL MODULE: ./src/exceptions.ts +var exceptions = __webpack_require__(784); +// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts +var base_cmi = __webpack_require__(319); +// EXTERNAL MODULE: ./src/constants/error_codes.ts +var error_codes = __webpack_require__(797); +// EXTERNAL MODULE: ./src/cmi/common/validation.ts +var validation = __webpack_require__(449); +;// ./src/cmi/aicc/validation.ts + + + +var aicc_error_codes = error_codes/* default */.A.scorm12; +function checkAICCValidFormat(value, regexPattern, allowEmptyString) { + return (0,validation/* checkValidFormat */.q)(value, regexPattern, aicc_error_codes.TYPE_MISMATCH, exceptions/* AICCValidationError */.gv, allowEmptyString); +} + +// EXTERNAL MODULE: ./src/constants/regex.ts +var regex = __webpack_require__(417); +;// ./src/cmi/aicc/evaluation.ts + + + + + + + + +var CMIEvaluation = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIEvaluation, _super); + function CMIEvaluation() { + var _this = _super.call(this) || this; + _this.comments = new CMIEvaluationComments(); + return _this; + } + CMIEvaluation.prototype.initialize = function () { + var _a; + _super.prototype.initialize.call(this); + (_a = this.comments) === null || _a === void 0 ? void 0 : _a.initialize(); + }; + CMIEvaluation.prototype.toJSON = function () { + this.jsonString = true; + var result = { + comments: this.comments, + }; + delete this.jsonString; + return result; + }; + return CMIEvaluation; +}(base_cmi/* BaseCMI */.J)); + +var CMIEvaluationComments = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIEvaluationComments, _super); + function CMIEvaluationComments() { + return _super.call(this, { + children: api_constants/* default */.A.aicc.comments_children, + errorCode: error_codes/* default */.A.scorm12.INVALID_SET_VALUE, + errorClass: exceptions/* AICCValidationError */.gv, + }) || this; + } + return CMIEvaluationComments; +}(array/* CMIArray */.B)); +var CMIEvaluationCommentsObject = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIEvaluationCommentsObject, _super); + function CMIEvaluationCommentsObject() { + var _this = _super.call(this) || this; + _this._content = ""; + _this._location = ""; + _this._time = ""; + return _this; + } + Object.defineProperty(CMIEvaluationCommentsObject.prototype, "content", { + get: function () { + return this._content; + }, + set: function (content) { + if (checkAICCValidFormat(content, regex/* default */.A.aicc.CMIString256)) { + this._content = content; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIEvaluationCommentsObject.prototype, "location", { + get: function () { + return this._location; + }, + set: function (location) { + if (checkAICCValidFormat(location, regex/* default */.A.aicc.CMIString256)) { + this._location = location; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIEvaluationCommentsObject.prototype, "time", { + get: function () { + return this._time; + }, + set: function (time) { + if (checkAICCValidFormat(time, regex/* default */.A.aicc.CMITime)) { + this._time = time; + } + }, + enumerable: false, + configurable: true + }); + CMIEvaluationCommentsObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + content: this.content, + location: this.location, + time: this.time, + }; + delete this.jsonString; + return result; + }; + return CMIEvaluationCommentsObject; +}(base_cmi/* BaseCMI */.J)); + + +// EXTERNAL MODULE: ./src/cmi/scorm12/student_preference.ts +var student_preference = __webpack_require__(181); +;// ./src/cmi/aicc/student_preferences.ts + + + + + + + + +var AICCStudentPreferences = (function (_super) { + (0,tslib_es6/* __extends */.C6)(AICCStudentPreferences, _super); + function AICCStudentPreferences() { + var _this = _super.call(this, api_constants/* default */.A.aicc.student_preference_children) || this; + _this._lesson_type = ""; + _this._text_color = ""; + _this._text_location = ""; + _this._text_size = ""; + _this._video = ""; + _this.windows = new array/* CMIArray */.B({ + errorCode: error_codes/* default */.A.scorm12.INVALID_SET_VALUE, + errorClass: exceptions/* AICCValidationError */.gv, + children: "", + }); + return _this; + } + AICCStudentPreferences.prototype.initialize = function () { + var _a; + _super.prototype.initialize.call(this); + (_a = this.windows) === null || _a === void 0 ? void 0 : _a.initialize(); + }; + Object.defineProperty(AICCStudentPreferences.prototype, "lesson_type", { + get: function () { + return this._lesson_type; + }, + set: function (lesson_type) { + if (checkAICCValidFormat(lesson_type, regex/* default */.A.aicc.CMIString256)) { + this._lesson_type = lesson_type; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(AICCStudentPreferences.prototype, "text_color", { + get: function () { + return this._text_color; + }, + set: function (text_color) { + if (checkAICCValidFormat(text_color, regex/* default */.A.aicc.CMIString256)) { + this._text_color = text_color; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(AICCStudentPreferences.prototype, "text_location", { + get: function () { + return this._text_location; + }, + set: function (text_location) { + if (checkAICCValidFormat(text_location, regex/* default */.A.aicc.CMIString256)) { + this._text_location = text_location; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(AICCStudentPreferences.prototype, "text_size", { + get: function () { + return this._text_size; + }, + set: function (text_size) { + if (checkAICCValidFormat(text_size, regex/* default */.A.aicc.CMIString256)) { + this._text_size = text_size; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(AICCStudentPreferences.prototype, "video", { + get: function () { + return this._video; + }, + set: function (video) { + if (checkAICCValidFormat(video, regex/* default */.A.aicc.CMIString256)) { + this._video = video; + } + }, + enumerable: false, + configurable: true + }); + AICCStudentPreferences.prototype.toJSON = function () { + this.jsonString = true; + var result = { + audio: this.audio, + language: this.language, + lesson_type: this.lesson_type, + speed: this.speed, + text: this.text, + text_color: this.text_color, + text_location: this.text_location, + text_size: this.text_size, + video: this.video, + windows: this.windows, + }; + delete this.jsonString; + return result; + }; + return AICCStudentPreferences; +}(student_preference/* CMIStudentPreference */.G)); + + +;// ./src/cmi/aicc/student_demographics.ts + + + + + +var CMIStudentDemographics = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIStudentDemographics, _super); + function CMIStudentDemographics() { + var _this = _super.call(this) || this; + _this.__children = api_constants/* default */.A.aicc.student_demographics_children; + _this._city = ""; + _this._class = ""; + _this._company = ""; + _this._country = ""; + _this._experience = ""; + _this._familiar_name = ""; + _this._instructor_name = ""; + _this._title = ""; + _this._native_language = ""; + _this._state = ""; + _this._street_address = ""; + _this._telephone = ""; + _this._years_experience = ""; + return _this; + } + Object.defineProperty(CMIStudentDemographics.prototype, "_children", { + get: function () { + return this.__children; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "city", { + get: function () { + return this._city; + }, + set: function (city) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._city = city; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "class", { + get: function () { + return this._class; + }, + set: function (clazz) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._class = clazz; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "company", { + get: function () { + return this._company; + }, + set: function (company) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._company = company; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "country", { + get: function () { + return this._country; + }, + set: function (country) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._country = country; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "experience", { + get: function () { + return this._experience; + }, + set: function (experience) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._experience = experience; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "familiar_name", { + get: function () { + return this._familiar_name; + }, + set: function (familiar_name) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._familiar_name = familiar_name; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "instructor_name", { + get: function () { + return this._instructor_name; + }, + set: function (instructor_name) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._instructor_name = instructor_name; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "title", { + get: function () { + return this._title; + }, + set: function (title) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._title = title; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "native_language", { + get: function () { + return this._native_language; + }, + set: function (native_language) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._native_language = native_language; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "state", { + get: function () { + return this._state; + }, + set: function (state) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._state = state; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "street_address", { + get: function () { + return this._street_address; + }, + set: function (street_address) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._street_address = street_address; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "telephone", { + get: function () { + return this._telephone; + }, + set: function (telephone) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._telephone = telephone; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "years_experience", { + get: function () { + return this._years_experience; + }, + set: function (years_experience) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._years_experience = years_experience; + } + }, + enumerable: false, + configurable: true + }); + CMIStudentDemographics.prototype.toJSON = function () { + this.jsonString = true; + var result = { + city: this.city, + class: this.class, + company: this.company, + country: this.country, + experience: this.experience, + familiar_name: this.familiar_name, + instructor_name: this.instructor_name, + title: this.title, + native_language: this.native_language, + state: this.state, + street_address: this.street_address, + telephone: this.telephone, + years_experience: this.years_experience, + }; + delete this.jsonString; + return result; + }; + return CMIStudentDemographics; +}(base_cmi/* BaseCMI */.J)); + + +// EXTERNAL MODULE: ./src/cmi/common/score.ts +var score = __webpack_require__(434); +;// ./src/cmi/aicc/tries.ts + + + + + + + + + +var CMITries = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMITries, _super); + function CMITries() { + return _super.call(this, { + children: api_constants/* default */.A.aicc.tries_children, + }) || this; + } + return CMITries; +}(array/* CMIArray */.B)); + +var CMITriesObject = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMITriesObject, _super); + function CMITriesObject() { + var _this = _super.call(this) || this; + _this._status = ""; + _this._time = ""; + _this.score = new score/* CMIScore */._({ + score_children: api_constants/* default */.A.aicc.score_children, + score_range: regex/* default */.A.aicc.score_range, + invalidErrorCode: error_codes/* default */.A.scorm12.INVALID_SET_VALUE, + invalidTypeCode: error_codes/* default */.A.scorm12.TYPE_MISMATCH, + invalidRangeCode: error_codes/* default */.A.scorm12.VALUE_OUT_OF_RANGE, + errorClass: exceptions/* AICCValidationError */.gv, + }); + return _this; + } + CMITriesObject.prototype.initialize = function () { + var _a; + _super.prototype.initialize.call(this); + (_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize(); + }; + Object.defineProperty(CMITriesObject.prototype, "status", { + get: function () { + return this._status; + }, + set: function (status) { + if (checkAICCValidFormat(status, regex/* default */.A.aicc.CMIStatus2)) { + this._status = status; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMITriesObject.prototype, "time", { + get: function () { + return this._time; + }, + set: function (time) { + if (checkAICCValidFormat(time, regex/* default */.A.aicc.CMITime)) { + this._time = time; + } + }, + enumerable: false, + configurable: true + }); + CMITriesObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + status: this.status, + time: this.time, + score: this.score, + }; + delete this.jsonString; + return result; + }; + return CMITriesObject; +}(base_cmi/* BaseCMI */.J)); + + +// EXTERNAL MODULE: ./src/cmi/scorm12/student_data.ts +var student_data = __webpack_require__(532); +;// ./src/cmi/aicc/attempts.ts + + + + + + + + + +var CMIAttemptRecords = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIAttemptRecords, _super); + function CMIAttemptRecords() { + return _super.call(this, { + children: api_constants/* default */.A.aicc.attempt_records_children, + }) || this; + } + return CMIAttemptRecords; +}(array/* CMIArray */.B)); + +var CMIAttemptRecordsObject = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIAttemptRecordsObject, _super); + function CMIAttemptRecordsObject() { + var _this = _super.call(this) || this; + _this._lesson_status = ""; + _this.score = new score/* CMIScore */._({ + score_children: api_constants/* default */.A.aicc.score_children, + score_range: regex/* default */.A.aicc.score_range, + invalidErrorCode: error_codes/* default */.A.scorm12.INVALID_SET_VALUE, + invalidTypeCode: error_codes/* default */.A.scorm12.TYPE_MISMATCH, + invalidRangeCode: error_codes/* default */.A.scorm12.VALUE_OUT_OF_RANGE, + errorClass: exceptions/* AICCValidationError */.gv, + }); + return _this; + } + CMIAttemptRecordsObject.prototype.initialize = function () { + var _a; + _super.prototype.initialize.call(this); + (_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize(); + }; + Object.defineProperty(CMIAttemptRecordsObject.prototype, "lesson_status", { + get: function () { + return this._lesson_status; + }, + set: function (lesson_status) { + if (checkAICCValidFormat(lesson_status, regex/* default */.A.aicc.CMIStatus2)) { + this._lesson_status = lesson_status; + } + }, + enumerable: false, + configurable: true + }); + CMIAttemptRecordsObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + lesson_status: this.lesson_status, + score: this.score, + }; + delete this.jsonString; + return result; + }; + return CMIAttemptRecordsObject; +}(base_cmi/* BaseCMI */.J)); + + +;// ./src/cmi/aicc/student_data.ts + + + + + + + +var AICCCMIStudentData = (function (_super) { + (0,tslib_es6/* __extends */.C6)(AICCCMIStudentData, _super); + function AICCCMIStudentData() { + var _this = _super.call(this, api_constants/* default */.A.aicc.student_data_children) || this; + _this._tries_during_lesson = ""; + _this.tries = new CMITries(); + _this.attempt_records = new CMIAttemptRecords(); + return _this; + } + AICCCMIStudentData.prototype.initialize = function () { + var _a, _b; + _super.prototype.initialize.call(this); + (_a = this.tries) === null || _a === void 0 ? void 0 : _a.initialize(); + (_b = this.attempt_records) === null || _b === void 0 ? void 0 : _b.initialize(); + }; + Object.defineProperty(AICCCMIStudentData.prototype, "tries_during_lesson", { + get: function () { + return this._tries_during_lesson; + }, + set: function (tries_during_lesson) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._tries_during_lesson = tries_during_lesson; + } + }, + enumerable: false, + configurable: true + }); + AICCCMIStudentData.prototype.toJSON = function () { + this.jsonString = true; + var result = { + mastery_score: this.mastery_score, + max_time_allowed: this.max_time_allowed, + time_limit_action: this.time_limit_action, + tries: this.tries, + attempt_records: this.attempt_records, + }; + delete this.jsonString; + return result; + }; + return AICCCMIStudentData; +}(student_data/* CMIStudentData */.X)); + + +;// ./src/cmi/aicc/paths.ts + + + + + + +var CMIPaths = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIPaths, _super); + function CMIPaths() { + return _super.call(this, { + children: api_constants/* default */.A.aicc.paths_children, + }) || this; + } + return CMIPaths; +}(array/* CMIArray */.B)); + +var CMIPathsObject = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIPathsObject, _super); + function CMIPathsObject() { + var _this = _super.call(this) || this; + _this._location_id = ""; + _this._date = ""; + _this._time = ""; + _this._status = ""; + _this._why_left = ""; + _this._time_in_element = ""; + return _this; + } + Object.defineProperty(CMIPathsObject.prototype, "location_id", { + get: function () { + return this._location_id; + }, + set: function (location_id) { + if (checkAICCValidFormat(location_id, regex/* default */.A.aicc.CMIString256)) { + this._location_id = location_id; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIPathsObject.prototype, "date", { + get: function () { + return this._date; + }, + set: function (date) { + if (checkAICCValidFormat(date, regex/* default */.A.aicc.CMIString256)) { + this._date = date; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIPathsObject.prototype, "time", { + get: function () { + return this._time; + }, + set: function (time) { + if (checkAICCValidFormat(time, regex/* default */.A.aicc.CMITime)) { + this._time = time; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIPathsObject.prototype, "status", { + get: function () { + return this._status; + }, + set: function (status) { + if (checkAICCValidFormat(status, regex/* default */.A.aicc.CMIStatus2)) { + this._status = status; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIPathsObject.prototype, "why_left", { + get: function () { + return this._why_left; + }, + set: function (why_left) { + if (checkAICCValidFormat(why_left, regex/* default */.A.aicc.CMIString256)) { + this._why_left = why_left; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIPathsObject.prototype, "time_in_element", { + get: function () { + return this._time_in_element; + }, + set: function (time_in_element) { + if (checkAICCValidFormat(time_in_element, regex/* default */.A.aicc.CMITime)) { + this._time_in_element = time_in_element; + } + }, + enumerable: false, + configurable: true + }); + CMIPathsObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + location_id: this.location_id, + date: this.date, + time: this.time, + status: this.status, + why_left: this.why_left, + time_in_element: this.time_in_element, + }; + delete this.jsonString; + return result; + }; + return CMIPathsObject; +}(base_cmi/* BaseCMI */.J)); + + +;// ./src/cmi/aicc/cmi.ts + + + + + + + + +var CMI = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMI, _super); + function CMI(initialized) { + if (initialized === void 0) { initialized = false; } + var _this = _super.call(this, api_constants/* default */.A.aicc.cmi_children) || this; + if (initialized) + _this.initialize(); + _this.student_preference = new AICCStudentPreferences(); + _this.student_data = new AICCCMIStudentData(); + _this.student_demographics = new CMIStudentDemographics(); + _this.evaluation = new CMIEvaluation(); + _this.paths = new CMIPaths(); + return _this; + } + CMI.prototype.initialize = function () { + var _a, _b, _c, _d, _e; + _super.prototype.initialize.call(this); + (_a = this.student_preference) === null || _a === void 0 ? void 0 : _a.initialize(); + (_b = this.student_data) === null || _b === void 0 ? void 0 : _b.initialize(); + (_c = this.student_demographics) === null || _c === void 0 ? void 0 : _c.initialize(); + (_d = this.evaluation) === null || _d === void 0 ? void 0 : _d.initialize(); + (_e = this.paths) === null || _e === void 0 ? void 0 : _e.initialize(); + }; + CMI.prototype.toJSON = function () { + this.jsonString = true; + var result = { + suspend_data: this.suspend_data, + launch_data: this.launch_data, + comments: this.comments, + comments_from_lms: this.comments_from_lms, + core: this.core, + objectives: this.objectives, + student_data: this.student_data, + student_preference: this.student_preference, + student_demographics: this.student_demographics, + interactions: this.interactions, + evaluation: this.evaluation, + paths: this.paths, + }; + delete this.jsonString; + return result; + }; + return CMI; +}(cmi/* CMI */.Y)); + + +// EXTERNAL MODULE: ./src/cmi/scorm12/nav.ts +var nav = __webpack_require__(331); +// EXTERNAL MODULE: ./src/utilities.ts +var utilities = __webpack_require__(864); +;// ./src/AICC.ts + + + + + + + + + +var AICCImpl = (function (_super) { + (0,tslib_es6/* __extends */.C6)(AICCImpl, _super); + function AICCImpl(settings) { + var _this = _super.call(this, settings) || this; + _this.cmi = new CMI(); + _this.nav = new nav/* NAV */.A(); + return _this; + } + AICCImpl.prototype.getChildElement = function (CMIElement, value, foundFirstIndex) { + var newChild = _super.prototype.getChildElement.call(this, CMIElement, value, foundFirstIndex); + if (!newChild) { + if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.evaluation\\.comments\\.\\d+")) { + newChild = new CMIEvaluationCommentsObject(); + } + else if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.student_data\\.tries\\.\\d+")) { + newChild = new CMITriesObject(); + } + else if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.student_data\\.attempt_records\\.\\d+")) { + newChild = new CMIAttemptRecordsObject(); + } + else if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.paths\\.\\d+")) { + newChild = new CMIPathsObject(); + } + } + return newChild; + }; + AICCImpl.prototype.replaceWithAnotherScormAPI = function (newAPI) { + this.cmi = newAPI.cmi; + this.nav = newAPI.nav; + }; + return AICCImpl; +}(Scorm12API/* Scorm12Impl */.C)); + + +var __webpack_exports__AICCImpl = __webpack_exports__.X; +export { __webpack_exports__AICCImpl as AICCImpl }; + +//# sourceMappingURL=aicc.js.map \ No newline at end of file diff --git a/dist/esm/aicc.js.map b/dist/esm/aicc.js.map new file mode 100644 index 0000000..81bece1 --- /dev/null +++ b/dist/esm/aicc.js.map @@ -0,0 +1 @@ +{"version":3,"file":"aicc.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAQO,SAAS,QAAQ,CACtB,IAAO,EACP,IAAY,EACZ,SAAiB;IAAjB,6CAAiB;IAEjB,IAAI,OAA6C,CAAC;IAElD,OAAO;QAAqB,cAAsB;aAAtB,UAAsB,EAAtB,qBAAsB,EAAtB,IAAsB;YAAtB,yBAAsB;;QAChD,IAAM,OAAO,GAAG,IAAI,CAAC;QAErB,IAAM,KAAK,GAAG;YACZ,OAAO,GAAG,IAAI,CAAC;YACf,IAAI,CAAC,SAAS;gBAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC5C,CAAC,CAAC;QAEF,IAAM,OAAO,GAAG,SAAS,IAAI,CAAC,OAAO,CAAC;QAEtC,IAAI,OAAO;YAAE,YAAY,CAAC,OAAO,CAAC,CAAC;QACnC,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,IA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wMAAwM,cAAc;AACtN,4BAA4B,sBAAsB;AAClD,wBAAwB,YAAY,sBAAsB,qCAAqC,2CAA2C,MAAM;AAChJ,0BAA0B,MAAM,iBAAiB,YAAY;AAC7D,qBAAqB;AACrB,4BAA4B;AAC5B,2BAA2B;AAC3B,0BAA0B;AAC1B;;AAEO;AACP;AACA,eAAe,6CAA6C,UAAU,sDAAsD,cAAc;AAC1I,wBAAwB,6BAA6B,oBAAoB,uCAAuC,kBAAkB;AAClI;;AAEO;AACP;AACA;AACA,yGAAyG,uFAAuF,cAAc;AAC9M,qBAAqB,8BAA8B,gDAAgD,wDAAwD;AAC3J,2CAA2C,sCAAsC,UAAU,mBAAmB,IAAI;AAClH;;AAEO;AACP,+BAA+B,uCAAuC,YAAY,KAAK,OAAO;AAC9F;AACA;;AAEA;AACA,wCAAwC,4BAA4B;AACpE,CAAC;AACD;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,2CAA2C;AAC3C;;AAEO;AACP;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,MAAM,oBAAoB,YAAY;AAC5E,qBAAqB,8CAA8C;AACnE;AACA;AACA,qBAAqB,aAAa;AAClC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uFAAuF,SAAS,gBAAgB;AAChH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sEAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAC;;;;;;;SCzXF;SACA;;SAEA;SACA;SACA;SACA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ACxB,CAAC;IACH,eAAC;AAAD,CAAC,CAxDsB,6BAAW,GAwDjC;AAEmB","sources":["webpack://scorm-again/./src/utilities/debounce.ts","webpack://scorm-again/./src/constants/default_settings.ts","webpack://scorm-again/./src/helpers/scheduled_commit.ts","webpack://scorm-again/./src/BaseAPI.ts","webpack://scorm-again/./src/Scorm12API.ts","webpack://scorm-again/./src/cmi/common/array.ts","webpack://scorm-again/./src/cmi/common/base_cmi.ts","webpack://scorm-again/./src/cmi/common/score.ts","webpack://scorm-again/./src/cmi/common/validation.ts","webpack://scorm-again/./src/cmi/aicc/core.ts","webpack://scorm-again/./src/cmi/scorm12/cmi.ts","webpack://scorm-again/./src/cmi/scorm12/interactions.ts","webpack://scorm-again/./src/cmi/scorm12/nav.ts","webpack://scorm-again/./src/cmi/scorm12/objectives.ts","webpack://scorm-again/./src/cmi/scorm12/student_data.ts","webpack://scorm-again/./src/cmi/scorm12/student_preference.ts","webpack://scorm-again/./src/cmi/scorm12/validation.ts","webpack://scorm-again/./src/constants/api_constants.ts","webpack://scorm-again/./src/constants/enums.ts","webpack://scorm-again/./src/constants/error_codes.ts","webpack://scorm-again/./src/constants/regex.ts","webpack://scorm-again/./src/exceptions.ts","webpack://scorm-again/./src/utilities.ts","webpack://scorm-again/./node_modules/tslib/tslib.es6.mjs","webpack://scorm-again/webpack/bootstrap","webpack://scorm-again/webpack/runtime/define property getters","webpack://scorm-again/webpack/runtime/hasOwnProperty shorthand","webpack://scorm-again/./src/cmi/aicc/validation.ts","webpack://scorm-again/./src/cmi/aicc/evaluation.ts","webpack://scorm-again/./src/cmi/aicc/student_preferences.ts","webpack://scorm-again/./src/cmi/aicc/student_demographics.ts","webpack://scorm-again/./src/cmi/aicc/tries.ts","webpack://scorm-again/./src/cmi/aicc/attempts.ts","webpack://scorm-again/./src/cmi/aicc/student_data.ts","webpack://scorm-again/./src/cmi/aicc/paths.ts","webpack://scorm-again/./src/cmi/aicc/cmi.ts","webpack://scorm-again/./src/AICC.ts"],"sourcesContent":["/**\n * Debounce function to delay the execution of a given function.\n *\n * @param func - The function to debounce.\n * @param wait - The number of milliseconds to delay.\n * @param immediate - If `true`, the function will be triggered on the leading edge instead of the trailing.\n * @returns A debounced version of the provided function.\n */\nexport function debounce void>(\n func: T,\n wait: number,\n immediate = false,\n): (...args: Parameters) => void {\n let timeout: ReturnType | null;\n\n return function (this: any, ...args: Parameters) {\n const context = this;\n\n const later = () => {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n const callNow = immediate && !timeout;\n\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) func.apply(context, args);\n };\n}\n","import { ResultObject, Settings } from \"../types/api_types\";\nimport APIConstants from \"./api_constants\";\n\n/**\n * Default settings for the SCORM API\n */\nexport const DefaultSettings: Settings = {\n autocommit: false,\n autocommitSeconds: 10,\n asyncCommit: false,\n sendFullCommit: true,\n lmsCommitUrl: false,\n dataCommitFormat: \"json\",\n commitRequestDataType: \"application/json;charset=UTF-8\",\n autoProgress: false,\n logLevel: APIConstants.global.LOG_LEVEL_ERROR,\n selfReportSessionTime: false,\n alwaysSendTotalTime: false,\n renderCommonCommitFields: false,\n strict_errors: true,\n xhrHeaders: {},\n xhrWithCredentials: false,\n responseHandler: async function (response: Response): Promise {\n if (typeof response !== \"undefined\") {\n const httpResult = JSON.parse(await response.text());\n if (\n httpResult === null ||\n !{}.hasOwnProperty.call(httpResult, \"result\")\n ) {\n if (response.status === 200) {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n }\n } else {\n return {\n result: httpResult.result,\n errorCode: httpResult.errorCode\n ? httpResult.errorCode\n : httpResult.result === APIConstants.global.SCORM_TRUE\n ? 0\n : 101,\n };\n }\n }\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n },\n requestHandler: function (commitObject) {\n return commitObject;\n },\n onLogMessage: function (messageLevel, logMessage) {\n switch (messageLevel) {\n case APIConstants.global.LOG_LEVEL_ERROR:\n console.error(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_WARNING:\n console.warn(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_INFO:\n console.info(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_DEBUG:\n if (console.debug) {\n console.debug(logMessage);\n } else {\n console.log(logMessage);\n }\n break;\n }\n },\n scoItemIds: [],\n scoItemIdValidator: false,\n};\n","import BaseAPI from \"../BaseAPI\";\n\n/**\n * Private class that wraps a timeout call to the commit() function\n */\nexport class ScheduledCommit {\n private _API;\n private _cancelled = false;\n private readonly _timeout;\n private readonly _callback;\n\n /**\n * Constructor for ScheduledCommit\n * @param {BaseAPI} API\n * @param {number} when\n * @param {string} callback\n */\n constructor(API: BaseAPI, when: number, callback: string) {\n this._API = API;\n this._timeout = setTimeout(this.wrapper.bind(this), when);\n this._callback = callback;\n }\n\n /**\n * Cancel any currently scheduled commit\n */\n cancel() {\n this._cancelled = true;\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n }\n\n /**\n * Wrap the API commit call to check if the call has already been cancelled\n */\n wrapper() {\n if (!this._cancelled) {\n (async () => await this._API.commit(this._callback))();\n }\n }\n}\n","import { CMIArray } from \"./cmi/common/array\";\nimport { ValidationError } from \"./exceptions\";\nimport ErrorCodes, { ErrorCode } from \"./constants/error_codes\";\nimport APIConstants from \"./constants/api_constants\";\nimport { formatMessage, stringMatches, unflatten } from \"./utilities\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { debounce } from \"./utilities/debounce\";\nimport {\n RefObject,\n CommitObject,\n ResultObject,\n Settings,\n} from \"./types/api_types\";\nimport { DefaultSettings } from \"./constants/default_settings\";\nimport { IBaseAPI } from \"./interfaces/IBaseAPI\";\nimport { ScheduledCommit } from \"./helpers/scheduled_commit\";\n\n/**\n * Base API class for AICC, SCORM 1.2, and SCORM 2004. Should be considered\n * abstract, and never initialized on its own.\n */\nexport default abstract class BaseAPI implements IBaseAPI {\n private _timeout?: ScheduledCommit;\n private readonly _error_codes: ErrorCode;\n private _settings: Settings = DefaultSettings;\n\n /**\n * Constructor for Base API class. Sets some shared API fields, as well as\n * sets up options for the API.\n * @param {ErrorCode} error_codes\n * @param {Settings} settings\n */\n protected constructor(error_codes: ErrorCode, settings?: Settings) {\n if (new.target === BaseAPI) {\n throw new TypeError(\"Cannot construct BaseAPI instances directly\");\n }\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n\n this._error_codes = error_codes;\n\n if (settings) {\n this.settings = settings;\n }\n this.apiLogLevel = this.settings.logLevel;\n this.selfReportSessionTime = this.settings.selfReportSessionTime;\n }\n\n public abstract cmi: BaseCMI;\n public startingData?: RefObject;\n\n public currentState: number;\n public lastErrorCode: string;\n public listenerArray: any[];\n public apiLogLevel: number;\n public selfReportSessionTime: boolean;\n\n abstract reset(settings?: Settings): void;\n\n /**\n * Common reset method for all APIs. New settings are merged with the existing settings.\n * @param {Settings} settings\n * @protected\n */\n commonReset(settings?: Settings): void {\n this.settings = { ...this.settings, ...settings };\n\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n }\n\n /**\n * Initialize the API\n * @param {string} callbackName\n * @param {string} initializeMessage\n * @param {string} terminationMessage\n * @return {string}\n */\n initialize(\n callbackName: string,\n initializeMessage?: string,\n terminationMessage?: string,\n ): string {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);\n } else if (this.isTerminated()) {\n this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage);\n } else {\n if (this.selfReportSessionTime) {\n this.cmi.setStartTime();\n }\n\n this.currentState = APIConstants.global.STATE_INITIALIZED;\n this.lastErrorCode = \"0\";\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n abstract lmsInitialize(): string;\n\n abstract lmsFinish(): string;\n\n abstract lmsGetValue(CMIElement: string): string;\n\n abstract lmsSetValue(CMIElement: string, value: any): string;\n\n abstract lmsCommit(): string;\n\n abstract lmsGetLastError(): string;\n\n abstract lmsGetErrorString(CMIErrorCode: string | number): string;\n\n abstract lmsGetDiagnostic(CMIErrorCode: string | number): string;\n\n /**\n * Abstract method for validating that a response is correct.\n *\n * @param {string} _CMIElement\n * @param {any} _value\n */\n abstract validateCorrectResponse(_CMIElement: string, _value: any): void;\n\n /**\n * Gets or builds a new child element to add to the array.\n * APIs that inherit BaseAPI should override this method.\n *\n * @param {string} _CMIElement - unused\n * @param {*} _value - unused\n * @param {boolean} _foundFirstIndex - unused\n * @return {BaseCMI|null}\n * @abstract\n */\n abstract getChildElement(\n _CMIElement: string,\n _value: any,\n _foundFirstIndex: boolean,\n ): BaseCMI | null;\n\n /**\n * Attempts to store the data to the LMS, logs data if no LMS configured\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _calculateTotalTime\n * @return {ResultObject}\n * @abstract\n */\n abstract storeData(_calculateTotalTime: boolean): Promise;\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _terminateCommit\n * @return {RefObject|Array}\n * @abstract\n */\n abstract renderCommitCMI(_terminateCommit: boolean): RefObject | Array;\n\n /**\n * Render the commit object to the shortened format for LMS commit\n * @param {boolean} _terminateCommit\n * @return {CommitObject}\n */\n abstract renderCommitObject(_terminateCommit: boolean): CommitObject;\n\n /**\n * Logging for all SCORM actions\n *\n * @param {string} functionName\n * @param {string} logMessage\n * @param {number} messageLevel\n * @param {string} CMIElement\n */\n apiLog(\n functionName: string,\n logMessage: string,\n messageLevel: number,\n CMIElement?: string,\n ) {\n logMessage = formatMessage(functionName, logMessage, CMIElement);\n\n if (messageLevel >= this.apiLogLevel) {\n this.settings.onLogMessage(messageLevel, logMessage);\n }\n }\n\n /**\n * Getter for _error_codes\n * @return {ErrorCode}\n */\n get error_codes(): ErrorCode {\n return this._error_codes;\n }\n\n /**\n * Getter for _settings\n * @return {Settings}\n */\n get settings(): Settings {\n return this._settings;\n }\n\n /**\n * Setter for _settings\n * @param {Settings} settings\n */\n set settings(settings: Settings) {\n this._settings = { ...this._settings, ...settings };\n }\n\n /**\n * Terminates the current run of the API\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async terminate(\n callbackName: string,\n checkTerminated: boolean,\n ): Promise {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.TERMINATION_BEFORE_INIT,\n this._error_codes.MULTIPLE_TERMINATION,\n )\n ) {\n this.currentState = APIConstants.global.STATE_TERMINATED;\n\n const result: ResultObject = await this.storeData(true);\n if (typeof result.errorCode !== \"undefined\" && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Get the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @return {string}\n */\n getValue(\n callbackName: string,\n checkTerminated: boolean,\n CMIElement: string,\n ): string {\n let returnValue: string = \"\";\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.RETRIEVE_BEFORE_INIT,\n this._error_codes.RETRIEVE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.getCMIValue(CMIElement);\n } catch (e) {\n returnValue = this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement);\n }\n\n this.apiLog(\n callbackName,\n \": returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n\n if (returnValue === undefined) {\n return \"\";\n }\n\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Sets the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {string} commitCallback\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setValue(\n callbackName: string,\n commitCallback: string,\n checkTerminated: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (value !== undefined) {\n value = String(value);\n }\n let returnValue: string = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.STORE_BEFORE_INIT,\n this._error_codes.STORE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.setCMIValue(CMIElement, value);\n } catch (e) {\n this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement, value);\n }\n\n if (returnValue === undefined) {\n returnValue = APIConstants.global.SCORM_FALSE;\n }\n\n // If we didn't have any errors while setting the data, go ahead and\n // schedule a commit, if autocommit is turned on\n if (String(this.lastErrorCode) === \"0\") {\n if (this.settings.autocommit && !this._timeout) {\n this.scheduleCommit(\n this.settings.autocommitSeconds * 1000,\n commitCallback,\n );\n }\n }\n\n this.apiLog(\n callbackName,\n \": \" + value + \": result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Orders LMS to store all content parameters\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async commit(\n callbackName: string,\n checkTerminated: boolean = false,\n ): Promise {\n this.clearScheduledCommit();\n\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.COMMIT_BEFORE_INIT,\n this._error_codes.COMMIT_AFTER_TERM,\n )\n ) {\n const result = await this.storeData(false);\n if (result.errorCode && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n this.apiLog(\n callbackName,\n \" Result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"HttpRequest\",\n );\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Returns last error code\n * @param {string} callbackName\n * @return {string}\n */\n getLastError(callbackName: string): string {\n const returnValue = String(this.lastErrorCode);\n\n this.processListeners(callbackName);\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getErrorString(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getDiagnostic(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Checks the LMS state and ensures it has been initialized.\n *\n * @param {boolean} checkTerminated\n * @param {number} beforeInitError\n * @param {number} afterTermError\n * @return {boolean}\n */\n checkState(\n checkTerminated: boolean,\n beforeInitError: number,\n afterTermError: number,\n ): boolean {\n if (this.isNotInitialized()) {\n this.throwSCORMError(beforeInitError);\n return false;\n } else if (checkTerminated && this.isTerminated()) {\n this.throwSCORMError(afterTermError);\n return false;\n }\n\n return true;\n }\n\n /**\n * Returns the message that corresponds to errorNumber\n * APIs that inherit BaseAPI should override this function\n *\n * @param {(string|number)} _errorNumber\n * @param {boolean} _detail\n * @return {string}\n * @abstract\n */\n getLmsErrorMessageDetails(\n _errorNumber: string | number,\n _detail: boolean = false,\n ): string {\n throw new Error(\n \"The getLmsErrorMessageDetails method has not been implemented\",\n );\n }\n\n /**\n * Gets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @return {string}\n * @abstract\n */\n getCMIValue(_CMIElement: string): string {\n throw new Error(\"The getCMIValue method has not been implemented\");\n }\n\n /**\n * Sets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @param {any} _value\n * @return {string}\n * @abstract\n */\n setCMIValue(_CMIElement: string, _value: any): string {\n throw new Error(\"The setCMIValue method has not been implemented\");\n }\n\n /**\n * Shared API method to set a valid for a given element.\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n _commonSetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (!CMIElement || CMIElement === \"\") {\n return APIConstants.global.SCORM_FALSE;\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let returnValue = APIConstants.global.SCORM_FALSE;\n let foundFirstIndex = false;\n\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n const attribute = structure[idx];\n\n if (idx === structure.length - 1) {\n if (scorm2004 && attribute.substring(0, 8) === \"{target=\") {\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);\n } else {\n refObject = {\n ...refObject,\n attribute: value,\n };\n }\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (\n stringMatches(CMIElement, \"\\\\.correct_responses\\\\.\\\\d+\") &&\n this.isInitialized()\n ) {\n this.validateCorrectResponse(CMIElement, value);\n }\n\n if (!scorm2004 || this.lastErrorCode === \"0\") {\n refObject[attribute] = value;\n returnValue = APIConstants.global.SCORM_TRUE;\n }\n }\n } else {\n refObject = refObject[attribute];\n if (!refObject) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n foundFirstIndex = true;\n } else {\n const newChild = this.getChildElement(\n CMIElement,\n value,\n foundFirstIndex,\n );\n foundFirstIndex = true;\n\n if (!newChild) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (refObject.initialized) newChild.initialize();\n\n refObject.childArray.push(newChild);\n refObject = newChild;\n }\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n }\n\n if (returnValue === APIConstants.global.SCORM_FALSE) {\n this.apiLog(\n methodName,\n `There was an error setting the value for: ${CMIElement}, value of: ${value}`,\n APIConstants.global.LOG_LEVEL_WARNING,\n );\n }\n\n return returnValue;\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @return {any}\n */\n _commonGetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n ): any {\n if (!CMIElement || CMIElement === \"\") {\n return \"\";\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let attribute = null;\n\n const uninitializedErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) has not been initialized.`;\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n attribute = structure[idx];\n\n if (!scorm2004) {\n if (idx === structure.length - 1) {\n if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n } else {\n if (\n String(attribute).substring(0, 8) === \"{target=\" &&\n typeof refObject._isTargetValid == \"function\"\n ) {\n const target = String(attribute).substring(\n 8,\n String(attribute).length - 9,\n );\n return refObject._isTargetValid(target);\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n\n refObject = refObject[attribute];\n if (refObject === undefined) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n } else {\n this.throwSCORMError(\n this._error_codes.VALUE_NOT_INITIALIZED,\n uninitializedErrorMessage,\n );\n break;\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n\n if (refObject === null || refObject === undefined) {\n if (!scorm2004) {\n if (attribute === \"_children\") {\n this.throwSCORMError(ErrorCodes.scorm12.CHILDREN_ERROR);\n } else if (attribute === \"_count\") {\n this.throwSCORMError(ErrorCodes.scorm12.COUNT_ERROR);\n }\n }\n } else {\n return refObject;\n }\n }\n\n /**\n * Returns true if the API's current state is STATE_INITIALIZED\n *\n * @return {boolean}\n */\n isInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_NOT_INITIALIZED\n *\n * @return {boolean}\n */\n isNotInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_NOT_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_TERMINATED\n *\n * @return {boolean}\n */\n isTerminated(): boolean {\n return this.currentState === APIConstants.global.STATE_TERMINATED;\n }\n\n /**\n * Provides a mechanism for attaching to a specific SCORM event\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n on(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray.push({\n functionName: functionName,\n CMIElement: CMIElement,\n callback: callback,\n });\n\n this.apiLog(\n \"on\",\n `Added event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n\n /**\n * Provides a mechanism for detaching a specific SCORM event listener\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n off(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n const removeIndex = this.listenerArray.findIndex(\n (obj) =>\n obj.functionName === functionName &&\n obj.CMIElement === CMIElement &&\n obj.callback === callback,\n );\n if (removeIndex !== -1) {\n this.listenerArray.splice(removeIndex, 1);\n this.apiLog(\n \"off\",\n `Removed event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n }\n\n /**\n * Provides a mechanism for clearing all listeners from a specific SCORM event\n *\n * @param {string} listenerName\n */\n clear(listenerName: string) {\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray = this.listenerArray.filter(\n (obj) =>\n obj.functionName !== functionName && obj.CMIElement !== CMIElement,\n );\n }\n }\n\n /**\n * Processes any 'on' listeners that have been created\n *\n * @param {string} functionName\n * @param {string} CMIElement\n * @param {any} value\n */\n processListeners(functionName: string, CMIElement?: string, value?: any) {\n this.apiLog(\n functionName,\n value,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n for (let i = 0; i < this.listenerArray.length; i++) {\n const listener = this.listenerArray[i];\n const functionsMatch = listener.functionName === functionName;\n const listenerHasCMIElement = !!listener.CMIElement;\n let CMIElementsMatch = false;\n if (\n CMIElement &&\n listener.CMIElement &&\n listener.CMIElement.substring(listener.CMIElement.length - 1) === \"*\"\n ) {\n CMIElementsMatch =\n CMIElement.indexOf(\n listener.CMIElement.substring(0, listener.CMIElement.length - 1),\n ) === 0;\n } else {\n CMIElementsMatch = listener.CMIElement === CMIElement;\n }\n\n if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {\n this.apiLog(\n \"processListeners\",\n `Processing listener: ${listener.functionName}`,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n listener.callback(CMIElement, value);\n }\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} errorNumber\n * @param {string} message\n */\n throwSCORMError(errorNumber: number, message?: string) {\n if (!message) {\n message = this.getLmsErrorMessageDetails(errorNumber);\n }\n\n this.apiLog(\n \"throwSCORMError\",\n errorNumber + \": \" + message,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n\n this.lastErrorCode = String(errorNumber);\n }\n\n /**\n * Clears the last SCORM error code on success.\n *\n * @param {string} success\n */\n clearSCORMError(success: string) {\n if (success !== undefined && success !== APIConstants.global.SCORM_FALSE) {\n this.lastErrorCode = \"0\";\n }\n }\n\n /**\n * Load the CMI from a flattened JSON object\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromFlattenedJSON(json: RefObject, CMIElement?: string) {\n if (!CMIElement) {\n // by default, we start from a blank string because we're expecting each element to start with `cmi`\n CMIElement = \"\";\n }\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromFlattenedJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n /**\n * Tests two strings against a given regular expression pattern and determines a numeric or null result based on the matching criterion.\n *\n * @param {string} a - The first string to be tested against the pattern.\n * @param {string} c - The second string to be tested against the pattern.\n * @param {RegExp} a_pattern - The regular expression pattern to test the strings against.\n * @return {number | null} A numeric result based on the matching criterion, or null if the strings do not match the pattern.\n */\n function testPattern(\n a: string,\n c: string,\n a_pattern: RegExp,\n ): number | null {\n const a_match = a.match(a_pattern);\n\n let c_match;\n if (a_match !== null && (c_match = c.match(a_pattern)) !== null) {\n const a_num = Number(a_match[2]);\n const c_num = Number(c_match[2]);\n if (a_num === c_num) {\n if (a_match[3] === \"id\") {\n return -1;\n } else if (a_match[3] === \"type\") {\n if (c_match[3] === \"id\") {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 1;\n }\n }\n return a_num - c_num;\n }\n\n return null;\n }\n\n const int_pattern = /^(cmi\\.interactions\\.)(\\d+)\\.(.*)$/;\n const obj_pattern = /^(cmi\\.objectives\\.)(\\d+)\\.(.*)$/;\n\n const result = Object.keys(json).map(function (key) {\n return [String(key), json[key]];\n });\n\n // CMI interactions need to have id and type loaded before any other fields\n result.sort(function ([a, _b], [c, _d]) {\n let test;\n if ((test = testPattern(a, c, int_pattern)) !== null) {\n return test;\n }\n if ((test = testPattern(a, c, obj_pattern)) !== null) {\n return test;\n }\n\n if (a < c) {\n return -1;\n }\n if (a > c) {\n return 1;\n }\n return 0;\n });\n\n let obj: RefObject;\n result.forEach((element) => {\n obj = {};\n obj[element[0]] = element[1];\n this.loadFromJSON(unflatten(obj), CMIElement);\n });\n }\n\n /**\n * Loads CMI data from a JSON object.\n *\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromJSON(json: RefObject, CMIElement: string) {\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n CMIElement = CMIElement !== undefined ? CMIElement : \"cmi\";\n\n this.startingData = json;\n\n // could this be refactored down to flatten(json) then setCMIValue on each?\n for (const key in json) {\n if ({}.hasOwnProperty.call(json, key) && json[key]) {\n const currentCMIElement = (CMIElement ? CMIElement + \".\" : \"\") + key;\n const value = json[key];\n\n if (value[\"childArray\"]) {\n for (let i = 0; i < value[\"childArray\"].length; i++) {\n this.loadFromJSON(\n value[\"childArray\"][i],\n currentCMIElement + \".\" + i,\n );\n }\n } else if (value.constructor === Object) {\n this.loadFromJSON(value, currentCMIElement);\n } else {\n this.setCMIValue(currentCMIElement, value);\n }\n }\n }\n }\n\n /**\n * Render the CMI object to JSON for sending to an LMS.\n *\n * @return {string}\n */\n renderCMIToJSONString(): string {\n const cmi = this.cmi;\n // Do we want/need to return fields that have no set value?\n if (this.settings.sendFullCommit) {\n return JSON.stringify({ cmi });\n }\n return JSON.stringify({ cmi }, (k, v) => (v === undefined ? null : v), 2);\n }\n\n /**\n * Returns a JS object representing the current cmi\n * @return {object}\n */\n renderCMIToJSONObject(): object {\n return JSON.parse(this.renderCMIToJSONString());\n }\n\n /**\n * Send the request to the LMS\n * @param {string} url\n * @param {CommitObject|RefObject|Array} params\n * @param {boolean} immediate\n * @return {ResultObject}\n */\n async processHttpRequest(\n url: string,\n params: CommitObject | RefObject | Array,\n immediate: boolean = false,\n ): Promise {\n const api = this;\n const genericError: ResultObject = {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: this.error_codes.GENERAL,\n };\n\n // if we are terminating the module or closing the browser window/tab, we need to make this fetch ASAP.\n // Some browsers, especially Chrome, do not like synchronous requests to be made when the window is closing.\n if (immediate) {\n this.performFetch(url, params).then(async (response) => {\n await this.transformResponse(response);\n });\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n\n const process = async (\n url: string,\n params: CommitObject | RefObject | Array,\n settings: Settings,\n ): Promise => {\n try {\n params = settings.requestHandler(params);\n const response = await this.performFetch(url, params);\n\n return this.transformResponse(response);\n } catch (e) {\n this.apiLog(\n \"processHttpRequest\",\n e,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n api.processListeners(\"CommitError\");\n return genericError;\n }\n };\n\n if (this.settings.asyncCommit) {\n const debouncedProcess = debounce(process, 500, immediate);\n debouncedProcess(url, params, this.settings);\n\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return await process(url, params, this.settings);\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} when - the number of milliseconds to wait before committing\n * @param {string} callback - the name of the commit event callback\n */\n scheduleCommit(when: number, callback: string) {\n this._timeout = new ScheduledCommit(this, when, callback);\n this.apiLog(\n \"scheduleCommit\",\n \"scheduled\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n\n /**\n * Clears and cancels any currently scheduled commits\n */\n clearScheduledCommit() {\n if (this._timeout) {\n this._timeout.cancel();\n this._timeout = undefined;\n this.apiLog(\n \"clearScheduledCommit\",\n \"cleared\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n }\n\n /**\n * Check to see if the specific object has the given property\n * @param {RefObject} refObject\n * @param {string} attribute\n * @return {boolean}\n * @private\n */\n private _checkObjectHasProperty(\n refObject: RefObject,\n attribute: string,\n ): boolean {\n return (\n Object.hasOwnProperty.call(refObject, attribute) ||\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(refObject),\n attribute,\n ) != null ||\n attribute in refObject\n );\n }\n\n /**\n * Handles the error that occurs when trying to access a value\n * @param {any} e\n * @param {string} returnValue\n * @return {string}\n * @private\n */\n private handleValueAccessException(e: any, returnValue: string): string {\n if (e instanceof ValidationError) {\n this.lastErrorCode = String(e.errorCode);\n returnValue = APIConstants.global.SCORM_FALSE;\n } else {\n if (e instanceof Error && e.message) {\n console.error(e.message);\n } else {\n console.error(e);\n }\n this.throwSCORMError(this._error_codes.GENERAL);\n }\n return returnValue;\n }\n\n /**\n * Perform the fetch request to the LMS\n * @param {string} url\n * @param {RefObject|Array} params\n * @return {Promise}\n * @private\n */\n private async performFetch(\n url: string,\n params: RefObject | Array,\n ): Promise {\n return fetch(url, {\n method: \"POST\",\n body: params instanceof Array ? params.join(\"&\") : JSON.stringify(params),\n headers: {\n ...this.settings.xhrHeaders,\n \"Content-Type\": this.settings.commitRequestDataType,\n },\n credentials: this.settings.xhrWithCredentials ? \"include\" : undefined,\n keepalive: true,\n });\n }\n\n /**\n * Transforms the response from the LMS to a ResultObject\n * @param {Response} response\n * @return {Promise}\n * @private\n */\n private async transformResponse(response: Response): Promise {\n const result =\n typeof this.settings.responseHandler === \"function\"\n ? await this.settings.responseHandler(response)\n : await response.json();\n\n if (\n response.status >= 200 &&\n response.status <= 299 &&\n (result.result === true ||\n result.result === APIConstants.global.SCORM_TRUE)\n ) {\n this.processListeners(\"CommitSuccess\");\n } else {\n this.processListeners(\"CommitError\");\n }\n return result;\n }\n}\n","import { CMI } from \"./cmi/scorm12/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMIObjectivesObject } from \"./cmi/scorm12/objectives\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm12/interactions\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport Regex from \"./constants/regex\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\nimport BaseAPI from \"./BaseAPI\";\n\n/**\n * API class for SCORM 1.2\n */\nclass Scorm12Impl extends BaseAPI {\n /**\n * Constructor for SCORM 1.2 API\n * @param {object} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm12, settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n\n // Rename functions to match 1.2 Spec and expose to modules\n this.LMSInitialize = this.lmsInitialize;\n this.LMSFinish = this.lmsFinish;\n this.LMSGetValue = this.lmsGetValue;\n this.LMSSetValue = this.lmsSetValue;\n this.LMSCommit = this.lmsCommit;\n this.LMSGetLastError = this.lmsGetLastError;\n this.LMSGetErrorString = this.lmsGetErrorString;\n this.LMSGetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public statusSetByModule = false;\n\n cmi: CMI;\n nav: NAV;\n\n LMSInitialize: () => string;\n LMSFinish: () => string;\n LMSGetValue: (CMIElement: string) => string;\n LMSSetValue: (CMIElement: string, value: any) => string;\n LMSCommit: () => string;\n LMSGetLastError: () => string;\n LMSGetErrorString: (CMIErrorCode: string) => string;\n LMSGetDiagnostic: (CMIErrorCode: string) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * lmsInitialize function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n if (this.cmi.core.lesson_status) {\n this.statusSetByModule = true;\n } else {\n this.cmi.core.lesson_status = \"not attempted\";\n }\n return this.initialize(\n \"LMSInitialize\",\n \"LMS was already initialized!\",\n \"LMS is already finished!\",\n );\n }\n\n /**\n * LMSFinish function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"LMSFinish\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.nav.event !== \"\") {\n if (this.nav.event === \"continue\") {\n this.processListeners(\"SequenceNext\");\n } else {\n this.processListeners(\"SequencePrevious\");\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * LMSGetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n return this.getValue(\"LMSGetValue\", false, CMIElement);\n }\n\n /**\n * LMSSetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n if (CMIElement === \"cmi.core.lesson_status\") {\n this.statusSetByModule = true;\n }\n return this.setValue(\"LMSSetValue\", \"LMSCommit\", false, CMIElement, value);\n }\n\n /**\n * LMSCommit function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"LMSCommit\", false);\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * LMSGetLastError function from SCORM 1.2 Spec\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"LMSGetLastError\");\n }\n\n /**\n * LMSGetErrorString function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string): string {\n return this.getErrorString(\"LMSGetErrorString\", CMIErrorCode);\n }\n\n /**\n * LMSGetDiagnostic function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string): string {\n return this.getDiagnostic(\"LMSGetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"LMSSetValue\", false, CMIElement, value);\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"getCMIValue\", false, CMIElement);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {*} _value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n _value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsCorrectResponsesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObjectivesObject();\n } else if (\n !foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObject();\n }\n\n return null;\n }\n\n /**\n * Validates Correct Response values\n *\n * @param {string} _CMIElement\n * @param {*} _value\n */\n validateCorrectResponse(_CMIElement: string, _value: any) {\n // do nothing\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {number|string} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: number | string,\n detail: boolean,\n ): string {\n let basicMessage = \"No Error\";\n let detailMessage = \"No Error\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm12.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {Scorm12Impl} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm12Impl) {\n // Data Model\n this.cmi = newAPI.cmi;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeHHMMSS = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getTimeAsSeconds(\n totalTimeHHMMSS,\n Regex.scorm12.CMITimespan,\n );\n const lessonStatus = this.cmi.core.lesson_status;\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (lessonStatus) {\n completionStatus =\n lessonStatus === \"completed\" || lessonStatus === \"passed\"\n ? CompletionStatus.completed\n : CompletionStatus.incomplete;\n if (lessonStatus === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (lessonStatus === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.core.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n }\n\n const commitObject: CommitObject = {\n successStatus: successStatus,\n completionStatus: completionStatus,\n runtimeData: cmiExport,\n totalTimeSeconds: totalTimeSeconds,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n const originalStatus = this.cmi.core.lesson_status;\n if (\n !this.cmi.core.lesson_status ||\n (!this.statusSetByModule &&\n this.cmi.core.lesson_status === \"not attempted\")\n ) {\n this.cmi.core.lesson_status = \"completed\";\n }\n\n if (this.cmi.core.lesson_mode === \"normal\") {\n if (this.cmi.core.credit === \"credit\") {\n if (\n this.settings.mastery_override &&\n this.cmi.student_data.mastery_score !== \"\" &&\n this.cmi.core.score.raw !== \"\"\n ) {\n this.cmi.core.lesson_status =\n parseFloat(this.cmi.core.score.raw) >=\n parseFloat(this.cmi.student_data.mastery_score)\n ? \"passed\"\n : \"failed\";\n }\n }\n } else if (this.cmi.core.lesson_mode === \"browse\") {\n if (\n (this.startingData?.cmi?.core?.lesson_status || \"\") === \"\" &&\n originalStatus === \"not attempted\"\n ) {\n this.cmi.core.lesson_status = \"browsed\";\n }\n }\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n return await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n\nexport { Scorm12Impl };\n","import { BaseCMI } from \"./base_cmi\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.n objects\n */\nexport class CMIArray extends BaseCMI {\n private readonly _errorCode: number;\n private readonly _errorClass: typeof BaseScormValidationError;\n private readonly __children: string;\n childArray: any[];\n\n /**\n * Constructor cmi *.n arrays\n * @param {object} params\n */\n constructor(params: {\n children: string;\n errorCode?: number;\n errorClass?: typeof BaseScormValidationError;\n }) {\n super();\n this.__children = params.children;\n this._errorCode = params.errorCode || scorm12_error_codes.GENERAL;\n this._errorClass = params.errorClass || BaseScormValidationError;\n this.childArray = [];\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * Getter for _count\n * @return {number}\n */\n get _count(): number {\n return this.childArray.length;\n }\n\n /**\n * Setter for _count. Just throws an error.\n * @param {number} _count\n */\n set _count(_count: number) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * toJSON for *.n arrays\n * @return {object}\n */\n toJSON(): object {\n this.jsonString = true;\n const result: { [key: string]: any } = {};\n for (let i = 0; i < this.childArray.length; i++) {\n result[i + \"\"] = this.childArray[i];\n }\n delete this.jsonString;\n return result;\n }\n}\n","/**\n * Base class for API cmi objects\n */\nexport abstract class BaseCMI {\n jsonString? = false;\n private _initialized = false;\n private _start_time: number | undefined;\n\n /**\n * Getter for _initialized\n * @return {boolean}\n */\n get initialized(): boolean {\n return this._initialized;\n }\n\n /**\n * Getter for _start_time\n * @return {number | undefined}\n */\n get start_time(): number | undefined {\n return this._start_time;\n }\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize(): void {\n this._initialized = true;\n }\n\n /**\n * Called when the player should override the 'session_time' provided by\n * the module\n */\n setStartTime(): void {\n this._start_time = new Date().getTime();\n }\n}\n\n/**\n * Base class for cmi root objects\n */\nexport abstract class BaseRootCMI extends BaseCMI {\n abstract getCurrentTotalTime(): string;\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport { BaseCMI } from \"./base_cmi\";\nimport { checkValidFormat, checkValidRange } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nconst scorm12_constants = APIConstants.scorm12;\nconst scorm12_regex = Regex.scorm12;\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.score objects\n */\nexport class CMIScore extends BaseCMI {\n private readonly __children: string;\n private readonly __score_range: string | false;\n private readonly __invalid_error_code: number;\n private readonly __invalid_type_code: number;\n private readonly __invalid_range_code: number;\n private readonly __decimal_regex: string;\n private readonly __error_class: typeof BaseScormValidationError;\n private _raw = \"\";\n private _min = \"\";\n private _max: string;\n\n /**\n * Constructor for *.score\n * @param {\n * score_children: string,\n * score_range: string,\n * max: string,\n * invalidErrorCode: number,\n * invalidTypeCode: number,\n * invalidRangeCode: number,\n * decimalRegex: string,\n * errorClass: typeof BaseScormValidationError\n * } params\n */\n constructor(params: {\n score_children?: string;\n score_range?: string;\n max?: string;\n invalidErrorCode?: number;\n invalidTypeCode?: number;\n invalidRangeCode?: number;\n decimalRegex?: string;\n errorClass: typeof BaseScormValidationError;\n }) {\n super();\n\n this.__children = params.score_children || scorm12_constants.score_children;\n this.__score_range = !params.score_range\n ? false\n : scorm12_regex.score_range;\n this._max = params.max || params.max === \"\" ? params.max : \"100\";\n this.__invalid_error_code =\n params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE;\n this.__invalid_type_code =\n params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH;\n this.__invalid_range_code =\n params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE;\n this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;\n this.__error_class = params.errorClass;\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this.__error_class(this.__invalid_error_code);\n }\n\n /**\n * Getter for _raw\n * @return {string}\n */\n get raw(): string {\n return this._raw;\n }\n\n /**\n * Setter for _raw\n * @param {string} raw\n */\n set raw(raw: string) {\n if (\n checkValidFormat(\n raw,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n raw,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._raw = raw;\n }\n }\n\n /**\n * Getter for _min\n * @return {string}\n */\n get min(): string {\n return this._min;\n }\n\n /**\n * Setter for _min\n * @param {string} min\n */\n set min(min: string) {\n if (\n checkValidFormat(\n min,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n min,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._min = min;\n }\n }\n\n /**\n * Getter for _max\n * @return {string}\n */\n get max(): string {\n return this._max;\n }\n\n /**\n * Setter for _max\n * @param {string} max\n */\n set max(max: string) {\n if (\n checkValidFormat(\n max,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n max,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._max = max;\n }\n }\n\n /**\n * toJSON for *.score\n * @return {\n * {\n * min: string,\n * max: string,\n * raw: string\n * }\n * }\n */\n toJSON(): {\n min: string;\n max: string;\n raw: string;\n } {\n this.jsonString = true;\n const result = {\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseScormValidationError } from \"../../exceptions\";\n\n/**\n * Check if the value matches the proper format. If not, throw proper error code.\n *\n * @param {string} value\n * @param {string} regexPattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @param {boolean} [allowEmptyString]\n * @return {boolean}\n */\nexport function checkValidFormat(\n value: string,\n regexPattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n allowEmptyString?: boolean,\n): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n const formatRegex = new RegExp(regexPattern);\n const matches = value.match(formatRegex);\n if (allowEmptyString && value === \"\") {\n return true;\n }\n if (value === undefined || !matches || matches[0] === \"\") {\n throw new errorClass(errorCode);\n }\n return true;\n}\n\n/**\n * Check if the value matches the proper range. If not, throw proper error code.\n *\n * @param {any} value\n * @param {string} rangePattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @return {boolean}\n */\nexport function checkValidRange(\n value: any,\n rangePattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n): boolean {\n const ranges = rangePattern.split(\"#\");\n value = value * 1.0;\n if (value >= ranges[0]) {\n if (ranges[1] === \"*\" || value <= ranges[1]) {\n return true;\n } else {\n throw new errorClass(errorCode);\n }\n } else {\n throw new errorClass(errorCode);\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { check12ValidFormat } from \"../scorm12/validation\";\nimport * as Util from \"../../utilities\";\n\n/**\n * Class representing the `cmi.core` object\n * @extends BaseCMI\n */\nexport class CMICore extends BaseCMI {\n /**\n * Constructor for `cmi.core`\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private __children = APIConstants.scorm12.core_children;\n private _student_id = \"\";\n private _student_name = \"\";\n private _lesson_location = \"\";\n private _credit = \"\";\n private _lesson_status = \"not attempted\";\n private _entry = \"\";\n private _total_time = \"\";\n private _lesson_mode = \"normal\";\n private _exit = \"\";\n private _session_time = \"00:00:00\";\n private _suspend_data = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _student_id\n * @return {string}\n */\n get student_id(): string {\n return this._student_id;\n }\n\n /**\n * Setter for _student_id. Can only be called before initialization.\n * @param {string} student_id\n */\n set student_id(student_id: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_id = student_id;\n }\n }\n\n /**\n * Getter for _student_name\n * @return {string}\n */\n get student_name(): string {\n return this._student_name;\n }\n\n /**\n * Setter for _student_name. Can only be called before initialization.\n * @param {string} student_name\n */\n set student_name(student_name: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_name = student_name;\n }\n }\n\n /**\n * Getter for _lesson_location\n * @return {string}\n */\n get lesson_location(): string {\n return this._lesson_location;\n }\n\n /**\n * Setter for _lesson_location\n * @param {string} lesson_location\n */\n set lesson_location(lesson_location: string) {\n if (check12ValidFormat(lesson_location, Regex.scorm12.CMIString256, true)) {\n this._lesson_location = lesson_location;\n }\n }\n\n /**\n * Getter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (this.initialized) {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus)) {\n this._lesson_status = lesson_status;\n }\n } else {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Getter for _lesson_mode\n * @return {string}\n */\n get lesson_mode(): string {\n return this._lesson_mode;\n }\n\n /**\n * Setter for _lesson_mode. Can only be called before initialization.\n * @param {string} lesson_mode\n */\n set lesson_mode(lesson_mode: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._lesson_mode = lesson_mode;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._exit;\n }\n\n /**\n * Setter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check12ValidFormat(exit, Regex.scorm12.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check12ValidFormat(session_time, Regex.scorm12.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (check12ValidFormat(suspend_data, Regex.scorm12.CMIString4096, true)) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n * @param {number} start_time\n * @return {string}\n */\n getCurrentTotalTime(start_time: number | undefined): string {\n let sessionTime = this._session_time;\n const startTime = start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsHHMMSS(seconds / 1000);\n }\n\n return Util.addHHMMSSTimeStrings(\n this._total_time,\n sessionTime,\n new RegExp(Regex.scorm12.CMITimespan),\n );\n }\n\n /**\n * toJSON for cmi.core\n *\n * @return {\n * {\n * student_name: string,\n * entry: string,\n * exit: string,\n * score: CMIScore,\n * student_id: string,\n * lesson_mode: string,\n * lesson_location: string,\n * lesson_status: string,\n * credit: string,\n * session_time: string\n * }\n * }\n */\n toJSON(): {\n student_name: string;\n entry: string;\n exit: string;\n score: CMIScore;\n student_id: string;\n lesson_mode: string;\n lesson_location: string;\n lesson_status: string;\n credit: string;\n session_time: string;\n } {\n this.jsonString = true;\n const result = {\n student_id: this.student_id,\n student_name: this.student_name,\n lesson_location: this.lesson_location,\n credit: this.credit,\n lesson_status: this.lesson_status,\n entry: this.entry,\n lesson_mode: this.lesson_mode,\n exit: this.exit,\n session_time: this.session_time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat } from \"./validation\";\nimport { CMICore } from \"../aicc/core\";\nimport { CMIObjectives } from \"./objectives\";\nimport { CMIStudentData } from \"./student_data\";\nimport { CMIStudentPreference } from \"./student_preference\";\nimport { CMIInteractions } from \"./interactions\";\n\n/**\n * Class representing the cmi object for SCORM 1.2\n */\nexport class CMI extends BaseRootCMI {\n private readonly __children: string = \"\";\n private __version: string = \"3.4\";\n private _launch_data: string = \"\";\n private _comments: string = \"\";\n private _comments_from_lms: string = \"\";\n\n /**\n * Constructor for the SCORM 1.2 cmi object\n * @param {string} cmi_children\n * @param {(CMIStudentData|AICCCMIStudentData)} student_data\n * @param {boolean} initialized\n */\n constructor(\n cmi_children?: string,\n student_data?: CMIStudentData,\n initialized?: boolean,\n ) {\n super();\n if (initialized) this.initialize();\n this.__children = cmi_children\n ? cmi_children\n : APIConstants.scorm12.cmi_children;\n this.core = new CMICore();\n this.objectives = new CMIObjectives();\n this.student_data = student_data ? student_data : new CMIStudentData();\n this.student_preference = new CMIStudentPreference();\n this.interactions = new CMIInteractions();\n }\n\n public core: CMICore;\n public objectives: CMIObjectives;\n public student_data: CMIStudentData;\n public student_preference: CMIStudentPreference;\n public interactions: CMIInteractions;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.core?.initialize();\n this.objectives?.initialize();\n this.student_data?.initialize();\n this.student_preference?.initialize();\n this.interactions?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n interactions: CMIInteractions;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n interactions: this.interactions,\n };\n delete this.jsonString;\n return result;\n }\n\n /**\n * Getter for __version\n * @return {string}\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n */\n set _version(_version: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for __children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this.core?.suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (this.core) {\n this.core.suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _comments\n * @return {string}\n */\n get comments(): string {\n return this._comments;\n }\n\n /**\n * Setter for _comments\n * @param {string} comments\n */\n set comments(comments: string) {\n if (check12ValidFormat(comments, Regex.scorm12.CMIString4096, true)) {\n this._comments = comments;\n }\n }\n\n /**\n * Getter for _comments_from_lms\n * @return {string}\n */\n get comments_from_lms(): string {\n return this._comments_from_lms;\n }\n\n /**\n * Setter for _comments_from_lms. Can only be called before initialization.\n * @param {string} comments_from_lms\n */\n set comments_from_lms(comments_from_lms: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._comments_from_lms = comments_from_lms;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string}\n */\n getCurrentTotalTime(): string {\n return this.core.getCurrentTotalTime(this.start_time);\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 `cmi.interactions`\n * @extends CMIArray\n */\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.interactions`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.interactions_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n object\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.correct_responses_children,\n });\n }\n\n public readonly objectives: CMIArray;\n public readonly correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n private _id = \"\";\n private _time = \"\";\n private _type = \"\";\n private _weighting = \"\";\n private _student_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n\n /**\n * Getter for _id. Should only be called during JSON export.\n * @return {string}\n */\n get id(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _time. Should only be called during JSON export.\n * @return {string}\n */\n get time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (check12ValidFormat(time, Regex.scorm12.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _type. Should only be called during JSON export.\n * @return {string}\n */\n get type(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (check12ValidFormat(type, Regex.scorm12.CMIType)) {\n this._type = type;\n }\n }\n\n /**\n * Getter for _weighting. Should only be called during JSON export.\n * @return {string}\n */\n get weighting(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (\n check12ValidFormat(weighting, Regex.scorm12.CMIDecimal) &&\n check12ValidRange(weighting, Regex.scorm12.weighting_range)\n ) {\n this._weighting = weighting;\n }\n }\n\n /**\n * Getter for _student_response. Should only be called during JSON export.\n * @return {string}\n */\n get student_response(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._student_response;\n }\n\n /**\n * Setter for _student_response\n * @param {string} student_response\n */\n set student_response(student_response: string) {\n if (check12ValidFormat(student_response, Regex.scorm12.CMIFeedback, true)) {\n this._student_response = student_response;\n }\n }\n\n /**\n * Getter for _result. Should only be called during JSON export.\n * @return {string}\n */\n get result(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check12ValidFormat(result, Regex.scorm12.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency. Should only be called during JSON export.\n * @return {string}\n */\n get latency(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (check12ValidFormat(latency, Regex.scorm12.CMITimespan)) {\n this._latency = latency;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * time: string,\n * type: string,\n * weighting: string,\n * student_response: string,\n * result: string,\n * latency: string,\n * objectives: CMIArray,\n * correct_responses: CMIArray\n * }\n * }\n */\n toJSON(): {\n id: string;\n time: string;\n type: string;\n weighting: string;\n student_response: string;\n result: string;\n latency: string;\n objectives: CMIArray;\n correct_responses: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n time: this.time,\n type: this.type,\n weighting: this.weighting,\n student_response: this.student_response,\n result: this.result,\n latency: this.latency,\n objectives: this.objectives,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n private _id = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.correct_responses.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.correct_responses.n\n */\n constructor() {\n super();\n }\n\n private _pattern = \"\";\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check12ValidFormat(pattern, Regex.scorm12.CMIFeedback, true)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON for cmi.interactions.correct_responses.n\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this._pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {BaseCMI} from \"../common/base_cmi\";\nimport {check12ValidFormat} from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class for AICC Navigation object\n */\nexport class NAV extends BaseCMI {\n /**\n * Constructor for NAV object\n */\n constructor() {\n super();\n }\n\n private _event = \"\";\n\n /**\n * Getter for _event\n * @return {string}\n */\n get event(): string {\n return this._event;\n }\n\n /**\n * Setter for _event\n * @param {string} event\n */\n set event(event: string) {\n if (check12ValidFormat(event, Regex.scorm12.NAVEvent)) {\n this._event = event;\n }\n }\n\n /**\n * toJSON for nav object\n * @return {\n * {\n * event: string\n * }\n * }\n */\n toJSON(): {\n event: string;\n } {\n this.jsonString = true;\n const result = {\n event: this.event,\n };\n delete this.jsonString;\n return result;\n }\n}","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\nimport {check12ValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class representing SCORM 1.2's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.objectives_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n private _id = \"\";\n private _status = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (check12ValidFormat(status, Regex.scorm12.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n * @return {\n * {\n * id: string,\n * status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n status: this.status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_data object\n * @extends BaseCMI\n */\nexport class CMIStudentData extends BaseCMI {\n private readonly __children;\n private _mastery_score = \"\";\n private _max_time_allowed = \"\";\n private _time_limit_action = \"\";\n\n /**\n * Constructor for cmi.student_data\n * @param {string} student_data_children\n */\n constructor(student_data_children?: string) {\n super();\n this.__children = student_data_children\n ? student_data_children\n : APIConstants.scorm12.student_data_children;\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _master_score\n * @return {string}\n */\n get mastery_score(): string {\n return this._mastery_score;\n }\n\n /**\n * Setter for _master_score. Can only be called before initialization.\n * @param {string} mastery_score\n */\n set mastery_score(mastery_score: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._mastery_score = mastery_score;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * toJSON for cmi.student_data\n *\n * @return {\n * {\n * max_time_allowed: string,\n * time_limit_action: string,\n * mastery_score: string\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_preference object\n * @extends BaseCMI\n */\nexport class CMIStudentPreference extends BaseCMI {\n private readonly __children;\n\n /**\n * Constructor for cmi.student_preference\n * @param {string} student_preference_children\n */\n constructor(student_preference_children?: string) {\n super();\n this.__children = student_preference_children\n ? student_preference_children\n : APIConstants.scorm12.student_preference_children;\n }\n\n private _audio = \"\";\n private _language = \"\";\n private _speed = \"\";\n private _text = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _audio\n * @return {string}\n */\n get audio(): string {\n return this._audio;\n }\n\n /**\n * Setter for _audio\n * @param {string} audio\n */\n set audio(audio: string) {\n if (\n check12ValidFormat(audio, Regex.scorm12.CMISInteger) &&\n check12ValidRange(audio, Regex.scorm12.audio_range)\n ) {\n this._audio = audio;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check12ValidFormat(language, Regex.scorm12.CMIString256)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _speed\n * @return {string}\n */\n get speed(): string {\n return this._speed;\n }\n\n /**\n * Setter for _speed\n * @param {string} speed\n */\n set speed(speed: string) {\n if (\n check12ValidFormat(speed, Regex.scorm12.CMISInteger) &&\n check12ValidRange(speed, Regex.scorm12.speed_range)\n ) {\n this._speed = speed;\n }\n }\n\n /**\n * Getter for _text\n * @return {string}\n */\n get text(): string {\n return this._text;\n }\n\n /**\n * Setter for _text\n * @param {string} text\n */\n set text(text: string) {\n if (\n check12ValidFormat(text, Regex.scorm12.CMISInteger) &&\n check12ValidRange(text, Regex.scorm12.text_range)\n ) {\n this._text = text;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n speed: string;\n text: string;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n speed: this.speed,\n text: this.text,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {checkValidFormat, checkValidRange} from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm12.TYPE_MISMATCH,\n Scorm12ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidRange(\n value: any,\n rangePattern: string,\n allowEmptyString?: boolean,\n): boolean {\n if (!allowEmptyString && value === \"\") {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.VALUE_OUT_OF_RANGE);\n }\n\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n Scorm12ValidationError,\n );\n}","interface ErrorDescription {\n basicMessage: string;\n detailMessage: string;\n}\n\ninterface ErrorDescriptions {\n [key: string]: ErrorDescription;\n}\n\ninterface ScormConstants {\n cmi_children: string;\n core_children: string;\n score_children: string;\n comments_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface AiccConstants extends ScormConstants {\n student_demographics_children: string;\n tries_children: string;\n attempt_records_children: string;\n paths_children: string;\n}\n\ninterface Scorm2004Constants {\n cmi_children: string;\n comments_children: string;\n score_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface GlobalConstants {\n SCORM_TRUE: string;\n SCORM_FALSE: string;\n STATE_NOT_INITIALIZED: number;\n STATE_INITIALIZED: number;\n STATE_TERMINATED: number;\n LOG_LEVEL_DEBUG: number;\n LOG_LEVEL_INFO: number;\n LOG_LEVEL_WARNING: number;\n LOG_LEVEL_ERROR: number;\n LOG_LEVEL_NONE: number;\n}\n\ninterface APIConstants {\n global: GlobalConstants;\n scorm12: ScormConstants;\n aicc: AiccConstants;\n scorm2004: Scorm2004Constants;\n}\n\nconst global: GlobalConstants = {\n SCORM_TRUE: \"true\",\n SCORM_FALSE: \"false\",\n STATE_NOT_INITIALIZED: 0,\n STATE_INITIALIZED: 1,\n STATE_TERMINATED: 2,\n LOG_LEVEL_DEBUG: 1,\n LOG_LEVEL_INFO: 2,\n LOG_LEVEL_WARNING: 3,\n LOG_LEVEL_ERROR: 4,\n LOG_LEVEL_NONE: 5,\n};\n\nconst scorm12: ScormConstants = {\n // Children lists\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions\",\n core_children:\n \"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time\",\n score_children: \"raw,min,max\",\n comments_children: \"content,location,time\",\n objectives_children: \"id,score,status\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children: \"audio,language,speed,text\",\n interactions_children:\n \"id,objectives,time,type,correct_responses,weighting,student_response,result,latency\",\n error_descriptions: {\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information\",\n },\n \"201\": {\n basicMessage: \"Invalid argument error\",\n detailMessage:\n \"Indicates that an argument represents an invalid data model element or is otherwise incorrect.\",\n },\n \"202\": {\n basicMessage: \"Element cannot have children\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_children\" for a data model element that does not support the \"_children\" suffix.',\n },\n \"203\": {\n basicMessage: \"Element not an array - cannot have count\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_count\" for a data model element that does not support the \"_count\" suffix.',\n },\n \"301\": {\n basicMessage: \"Not initialized\",\n detailMessage:\n \"Indicates that an API call was made before the call to lmsInitialize.\",\n },\n \"401\": {\n basicMessage: \"Not implemented error\",\n detailMessage:\n \"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.\",\n },\n \"402\": {\n basicMessage: \"Invalid set value, element is a keyword\",\n detailMessage:\n 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in \"_children\" and \"_count\").',\n },\n \"403\": {\n basicMessage: \"Element is read only\",\n detailMessage:\n \"LMSSetValue was called with a data model element that can only be read.\",\n },\n \"404\": {\n basicMessage: \"Element is write only\",\n detailMessage:\n \"LMSGetValue was called on a data model element that can only be written to.\",\n },\n \"405\": {\n basicMessage: \"Incorrect Data Type\",\n detailMessage:\n \"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst aicc: AiccConstants = {\n ...scorm12,\n ...{\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation\",\n student_preference_children:\n \"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows\",\n student_data_children:\n \"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action\",\n student_demographics_children:\n \"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience\",\n tries_children: \"time,status,score\",\n attempt_records_children: \"score,lesson_status\",\n paths_children: \"location_id,date,time,status,why_left,time_in_element\",\n },\n};\nconst scorm2004: Scorm2004Constants = {\n // Children lists\n cmi_children:\n \"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time\",\n comments_children: \"comment,timestamp,location\",\n score_children: \"max,raw,scaled,min\",\n objectives_children:\n \"progress_measure,completion_status,success_status,description,score,id\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children:\n \"audio_level,audio_captioning,delivery_speed,language\",\n interactions_children:\n \"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description\",\n error_descriptions: {\n \"0\": {\n basicMessage: \"No Error\",\n detailMessage: \"No error occurred, the previous API call was successful.\",\n },\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use GetDiagnostic for more information.\",\n },\n \"102\": {\n basicMessage: \"General Initialization Failure\",\n detailMessage: \"Call to Initialize failed for an unknown reason.\",\n },\n \"103\": {\n basicMessage: \"Already Initialized\",\n detailMessage:\n \"Call to Initialize failed because Initialize was already called.\",\n },\n \"104\": {\n basicMessage: \"Content Instance Terminated\",\n detailMessage:\n \"Call to Initialize failed because Terminate was already called.\",\n },\n \"111\": {\n basicMessage: \"General Termination Failure\",\n detailMessage: \"Call to Terminate failed for an unknown reason.\",\n },\n \"112\": {\n basicMessage: \"Termination Before Initialization\",\n detailMessage:\n \"Call to Terminate failed because it was made before the call to Initialize.\",\n },\n \"113\": {\n basicMessage: \"Termination After Termination\",\n detailMessage:\n \"Call to Terminate failed because Terminate was already called.\",\n },\n \"122\": {\n basicMessage: \"Retrieve Data Before Initialization\",\n detailMessage:\n \"Call to GetValue failed because it was made before the call to Initialize.\",\n },\n \"123\": {\n basicMessage: \"Retrieve Data After Termination\",\n detailMessage:\n \"Call to GetValue failed because it was made after the call to Terminate.\",\n },\n \"132\": {\n basicMessage: \"Store Data Before Initialization\",\n detailMessage:\n \"Call to SetValue failed because it was made before the call to Initialize.\",\n },\n \"133\": {\n basicMessage: \"Store Data After Termination\",\n detailMessage:\n \"Call to SetValue failed because it was made after the call to Terminate.\",\n },\n \"142\": {\n basicMessage: \"Commit Before Initialization\",\n detailMessage:\n \"Call to Commit failed because it was made before the call to Initialize.\",\n },\n \"143\": {\n basicMessage: \"Commit After Termination\",\n detailMessage:\n \"Call to Commit failed because it was made after the call to Terminate.\",\n },\n \"201\": {\n basicMessage: \"General Argument Error\",\n detailMessage:\n \"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.\",\n },\n \"301\": {\n basicMessage: \"General Get Failure\",\n detailMessage:\n \"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"351\": {\n basicMessage: \"General Set Failure\",\n detailMessage:\n \"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"391\": {\n basicMessage: \"General Commit Failure\",\n detailMessage:\n \"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"401\": {\n basicMessage: \"Undefined Data Model Element\",\n detailMessage:\n \"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.\",\n },\n \"402\": {\n basicMessage: \"Unimplemented Data Model Element\",\n detailMessage:\n \"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.\",\n },\n \"403\": {\n basicMessage: \"Data Model Element Value Not Initialized\",\n detailMessage:\n \"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.\",\n },\n \"404\": {\n basicMessage: \"Data Model Element Is Read Only\",\n detailMessage:\n \"SetValue was called with a data model element that can only be read.\",\n },\n \"405\": {\n basicMessage: \"Data Model Element Is Write Only\",\n detailMessage:\n \"GetValue was called on a data model element that can only be written to.\",\n },\n \"406\": {\n basicMessage: \"Data Model Element Type Mismatch\",\n detailMessage:\n \"SetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Data Model Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst APIConstants: APIConstants = {\n global: global,\n scorm12: scorm12,\n aicc: aicc,\n scorm2004: scorm2004,\n};\nexport default APIConstants;\n","export enum NAVBoolean {\n unknown = \"unknown\",\n true = \"true\",\n false = \"false\",\n}\n\nexport enum SuccessStatus {\n passed = \"passed\",\n failed = \"failed\",\n unknown = \"unknown\",\n}\n\nexport enum CompletionStatus {\n completed = \"completed\",\n incomplete = \"incomplete\",\n unknown = \"unknown\",\n}\n","export type ErrorCode = {\n [key: string]: number;\n};\n\nconst global: ErrorCode = {\n GENERAL: 101,\n INITIALIZATION_FAILED: 101,\n INITIALIZED: 101,\n TERMINATED: 101,\n TERMINATION_FAILURE: 101,\n TERMINATION_BEFORE_INIT: 101,\n MULTIPLE_TERMINATION: 101,\n RETRIEVE_BEFORE_INIT: 101,\n RETRIEVE_AFTER_TERM: 101,\n STORE_BEFORE_INIT: 101,\n STORE_AFTER_TERM: 101,\n COMMIT_BEFORE_INIT: 101,\n COMMIT_AFTER_TERM: 101,\n ARGUMENT_ERROR: 101,\n CHILDREN_ERROR: 101,\n COUNT_ERROR: 101,\n GENERAL_GET_FAILURE: 101,\n GENERAL_SET_FAILURE: 101,\n GENERAL_COMMIT_FAILURE: 101,\n UNDEFINED_DATA_MODEL: 101,\n UNIMPLEMENTED_ELEMENT: 101,\n VALUE_NOT_INITIALIZED: 101,\n INVALID_SET_VALUE: 101,\n READ_ONLY_ELEMENT: 101,\n WRITE_ONLY_ELEMENT: 101,\n TYPE_MISMATCH: 101,\n VALUE_OUT_OF_RANGE: 101,\n DEPENDENCY_NOT_ESTABLISHED: 101,\n};\n\nconst scorm12: ErrorCode = {\n ...global,\n RETRIEVE_BEFORE_INIT: 301,\n STORE_BEFORE_INIT: 301,\n COMMIT_BEFORE_INIT: 301,\n ARGUMENT_ERROR: 201,\n CHILDREN_ERROR: 202,\n COUNT_ERROR: 203,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 401,\n VALUE_NOT_INITIALIZED: 301,\n INVALID_SET_VALUE: 402,\n READ_ONLY_ELEMENT: 403,\n WRITE_ONLY_ELEMENT: 404,\n TYPE_MISMATCH: 405,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst scorm2004: ErrorCode = {\n ...global,\n INITIALIZATION_FAILED: 102,\n INITIALIZED: 103,\n TERMINATED: 104,\n TERMINATION_FAILURE: 111,\n TERMINATION_BEFORE_INIT: 112,\n MULTIPLE_TERMINATIONS: 113,\n RETRIEVE_BEFORE_INIT: 122,\n RETRIEVE_AFTER_TERM: 123,\n STORE_BEFORE_INIT: 132,\n STORE_AFTER_TERM: 133,\n COMMIT_BEFORE_INIT: 142,\n COMMIT_AFTER_TERM: 143,\n ARGUMENT_ERROR: 201,\n GENERAL_GET_FAILURE: 301,\n GENERAL_SET_FAILURE: 351,\n GENERAL_COMMIT_FAILURE: 391,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 402,\n VALUE_NOT_INITIALIZED: 403,\n READ_ONLY_ELEMENT: 404,\n WRITE_ONLY_ELEMENT: 405,\n TYPE_MISMATCH: 406,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst ErrorCodes = {\n scorm12,\n scorm2004,\n};\n\nexport default ErrorCodes;\n","const scorm12 = {\n CMIString256: \"^.{0,255}$\",\n CMIString4096: \"^.{0,4096}$\",\n CMITime: \"^(?:[01]\\\\d|2[0123]):(?:[012345]\\\\d):(?:[012345]\\\\d)$\",\n CMITimespan: \"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$\",\n\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{0,3})(.[0-9]*)?$\",\n\n CMIIdentifier: \"^[\\\\u0021-\\\\u007E\\\\s]{0,255}$\",\n CMIFeedback: \"^.{0,255}$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n // Vocabulary Data Type Definition\n CMIStatus: \"^(passed|completed|failed|incomplete|browsed)$\",\n CMIStatus2: \"^(passed|completed|failed|incomplete|browsed|not attempted)$\",\n CMIExit: \"^(time-out|suspend|logout|)$\",\n CMIType:\n \"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$\",\n CMIResult:\n \"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\\\.[0-9]*)?)$\",\n NAVEvent: \"^(previous|continue)$\",\n // Data ranges\n score_range: \"0#100\",\n audio_range: \"-1#100\",\n speed_range: \"-100#100\",\n weighting_range: \"-100#100\",\n text_range: \"-1#1\",\n};\nconst aicc = {\n ...scorm12,\n ...{\n CMIIdentifier: \"^\\\\w{1,255}$\",\n },\n};\nconst scorm2004 = {\n CMIString200: \"^[\\\\u0000-\\\\uFFFF]{0,200}$\",\n CMIString250: \"^[\\\\u0000-\\\\uFFFF]{0,250}$\",\n CMIString1000: \"^[\\\\u0000-\\\\uFFFF]{0,1000}$\",\n CMIString4000: \"^[\\\\u0000-\\\\uFFFF]{0,4000}$\",\n CMIString64000: \"^[\\\\u0000-\\\\uFFFF]{0,64000}$\",\n CMILang: \"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$\",\n\n CMILangString250:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$\",\n\n CMILangcr: \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$\",\n\n CMILangString250cr:\n \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$\",\n\n CMILangString4000:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$\",\n\n CMITime:\n \"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$\",\n CMITimespan:\n \"^P(?:([.,\\\\d]+)Y)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)W)?(?:([.,\\\\d]+)D)?(?:T?(?:([.,\\\\d]+)H)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)S)?)?$\",\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{1,5})(\\\\.[0-9]{1,18})?$\",\n CMIIdentifier: \"^\\\\S{1,250}[a-zA-Z0-9]$\",\n CMIShortIdentifier: \"^[\\\\w\\\\.\\\\-\\\\_]{1,250}$\",\n CMILongIdentifier:\n \"^(?:(?!urn:)\\\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\\\S{1,4000}|.{1,4000})$\",\n // need to re-examine this\n CMIFeedback: \"^.*$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n CMIIndexStore: \".N(\\\\d+).\",\n // Vocabulary Data Type Definition\n CMICStatus: \"^(completed|incomplete|not attempted|unknown)$\",\n CMISStatus: \"^(passed|failed|unknown)$\",\n CMIExit: \"^(time-out|suspend|logout|normal)$\",\n CMIType:\n \"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$\",\n CMIResult:\n \"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\\\.[0-9]{1,18})?)$\",\n NAVEvent:\n \"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?jump)$\",\n\n NAVBoolean: \"^(unknown|true|false$)\",\n NAVTarget: \"^{target=\\\\S{0,}[a-zA-Z0-9-_]+}$\",\n // Data ranges\n scaled_range: \"-1#1\",\n audio_range: \"0#*\",\n speed_range: \"0#*\",\n text_range: \"-1#1\",\n progress_range: \"0#1\",\n};\nconst Regex = {\n aicc: aicc,\n scorm12: scorm12,\n scorm2004: scorm2004,\n};\nexport default Regex;\n","import APIConstants from \"./constants/api_constants\";\n\nconst scorm12_errors = APIConstants.scorm12.error_descriptions;\nconst aicc_errors = APIConstants.aicc.error_descriptions;\nconst scorm2004_errors = APIConstants.scorm2004.error_descriptions;\n\ntype APIError = {\n errorCode: number;\n errorMessage: string;\n detailedMessage: string;\n};\n\nexport class BaseScormValidationError extends Error {\n constructor(errorCode: number) {\n super(errorCode.toString());\n this._errorCode = errorCode;\n this.name = \"ScormValidationError\";\n }\n\n private readonly _errorCode: number;\n\n /**\n * Getter for _errorCode\n * @return {number}\n */\n get errorCode(): number {\n return this._errorCode;\n }\n\n setMessage(message: string) {\n this.message = message;\n }\n}\n\n/**\n * Base Validation Exception\n */\nexport class ValidationError\n extends BaseScormValidationError\n implements APIError\n{\n /**\n * Constructor to take in an error message and code\n * @param {number} errorCode\n * @param {string} errorMessage\n * @param {string} detailedMessage\n */\n constructor(\n errorCode: number,\n errorMessage: string,\n detailedMessage?: string,\n ) {\n super(errorCode);\n this.setMessage(errorMessage);\n this._errorMessage = errorMessage;\n if (detailedMessage) {\n this._detailedMessage = detailedMessage;\n }\n }\n\n private readonly _errorMessage: string;\n private readonly _detailedMessage: string = \"\";\n\n /**\n * Getter for _errorMessage\n * @return {string}\n */\n get errorMessage(): string {\n return this._errorMessage;\n }\n\n /**\n * Getter for _detailedMessage\n * @return {string}\n */\n get detailedMessage(): string {\n return this._detailedMessage;\n }\n}\n\n/**\n * SCORM 1.2 Validation Error\n */\nexport class Scorm12ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {\n super(\n errorCode,\n scorm12_errors[String(errorCode)].basicMessage,\n scorm12_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm12_errors[\"101\"].basicMessage,\n scorm12_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * AICC Validation Error\n */\nexport class AICCValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {\n super(\n errorCode,\n aicc_errors[String(errorCode)].basicMessage,\n aicc_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n aicc_errors[\"101\"].basicMessage,\n aicc_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * SCORM 2004 Validation Error\n */\nexport class Scorm2004ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {\n super(\n errorCode,\n scorm2004_errors[String(errorCode)].basicMessage,\n scorm2004_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm2004_errors[\"101\"].basicMessage,\n scorm2004_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n","export const SECONDS_PER_SECOND = 1.0;\nexport const SECONDS_PER_MINUTE = 60;\nexport const SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;\nexport const SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR;\n\ntype Designation = {\n [key: string]: number;\n};\n\ntype StringKeyMap = {\n [key: string]: any;\n};\n\nconst designations: Designation = {\n D: SECONDS_PER_DAY,\n H: SECONDS_PER_HOUR,\n M: SECONDS_PER_MINUTE,\n S: SECONDS_PER_SECOND,\n};\n\n/**\n * Converts a Number to a String of HH:MM:SS\n *\n * @param {number} totalSeconds\n * @return {string}\n */\nexport function getSecondsAsHHMMSS(totalSeconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!totalSeconds || totalSeconds <= 0) {\n return \"00:00:00\";\n }\n\n const hours = Math.floor(totalSeconds / SECONDS_PER_HOUR);\n const dateObj = new Date(totalSeconds * 1000);\n const minutes = dateObj.getUTCMinutes();\n // make sure we add any possible decimal value\n const seconds = dateObj.getSeconds();\n const ms = totalSeconds % 1.0;\n let msStr = \"\";\n\n if (countDecimals(ms) > 0) {\n if (countDecimals(ms) > 2) {\n msStr = ms.toFixed(2);\n } else {\n msStr = String(ms);\n }\n\n msStr = \".\" + msStr.split(\".\")[1];\n }\n\n return (\n (hours + \":\" + minutes + \":\" + seconds).replace(/\\b\\d\\b/g, \"0$&\") + msStr\n );\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {number} seconds\n * @return {string}\n */\nexport function getSecondsAsISODuration(seconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!seconds || seconds <= 0) {\n return \"PT0S\";\n }\n\n let duration = \"P\";\n let remainder = seconds;\n for (const designationsKey in designations) {\n const current_seconds = designations[designationsKey];\n let value = Math.floor(remainder / current_seconds);\n remainder = remainder % current_seconds;\n\n if (countDecimals(remainder) > 2) {\n remainder = Number(Number(remainder).toFixed(2));\n }\n\n // If we have anything left in the remainder, and we're currently adding\n // seconds to the duration, go ahead and add the decimal to the seconds\n if (designationsKey === \"S\" && remainder > 0) {\n value += remainder;\n }\n\n if (value) {\n if (\n (duration.indexOf(\"D\") > 0 ||\n designationsKey === \"H\" ||\n designationsKey === \"M\" ||\n designationsKey === \"S\") &&\n duration.indexOf(\"T\") === -1\n ) {\n duration += \"T\";\n }\n\n duration += `${value}${designationsKey}`;\n }\n }\n return duration;\n}\n\n/**\n * Calculate the number of seconds from HH:MM:SS.DDDDDD\n *\n * @param {string} timeString\n * @param {RegExp} timeRegex\n * @return {number}\n */\nexport function getTimeAsSeconds(\n timeString: string | number | boolean | null,\n timeRegex: RegExp | string,\n): number {\n if (typeof timeString === \"number\" || typeof timeString === \"boolean\") {\n timeString = String(timeString);\n }\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n if (!timeString || !timeString.match(timeRegex)) {\n return 0;\n }\n\n const parts = timeString.split(\":\");\n const hours = Number(parts[0]);\n const minutes = Number(parts[1]);\n const seconds = Number(parts[2]);\n return hours * 3600 + minutes * 60 + seconds;\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {string} duration\n * @param {RegExp} durationRegex\n * @return {number}\n */\nexport function getDurationAsSeconds(\n duration: string | null,\n durationRegex: RegExp | string,\n): number {\n if (typeof durationRegex === \"string\") {\n durationRegex = new RegExp(durationRegex);\n }\n\n if (!duration || !duration.match(durationRegex)) {\n return 0;\n }\n\n const [, years, _, , days, hours, minutes, seconds] =\n new RegExp(durationRegex).exec(duration) || [];\n let result = 0.0;\n result += Number(seconds) || 0.0;\n result += Number(minutes) * 60.0 || 0.0;\n result += Number(hours) * 3600.0 || 0.0;\n result += Number(days) * (60 * 60 * 24.0) || 0.0;\n result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0;\n return result;\n}\n\n/**\n * Adds together two ISO8601 Duration strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp|string} durationRegex\n * @return {string}\n */\nexport function addTwoDurations(\n first: string,\n second: string,\n durationRegex: RegExp | string,\n): string {\n const regex: RegExp =\n typeof durationRegex === \"string\"\n ? new RegExp(durationRegex)\n : durationRegex;\n return getSecondsAsISODuration(\n getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex),\n );\n}\n\n/**\n * Add together two HH:MM:SS.DD strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp} timeRegex\n * @return {string}\n */\nexport function addHHMMSSTimeStrings(\n first: string,\n second: string,\n timeRegex: RegExp | string,\n): string {\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n return getSecondsAsHHMMSS(\n getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex),\n );\n}\n\n/**\n * Flatten a JSON object down to string paths for each values\n * @param {object} data\n * @return {object}\n */\nexport function flatten(data: StringKeyMap): object {\n const result: StringKeyMap = {};\n\n /**\n * Recurse through the object\n * @param {*} cur\n * @param {*} prop\n */\n function recurse(cur: any, prop: any) {\n if (Object(cur) !== cur) {\n result[prop] = cur;\n } else if (Array.isArray(cur)) {\n for (let i = 0, l = cur.length; i < l; i++) {\n recurse(cur[i], prop + \"[\" + i + \"]\");\n if (l === 0) result[prop] = [];\n }\n } else {\n let isEmpty = true;\n\n for (const p in cur) {\n if ({}.hasOwnProperty.call(cur, p)) {\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p);\n }\n }\n\n if (isEmpty && prop) result[prop] = {};\n }\n }\n\n recurse(data, \"\");\n return result;\n}\n\n/**\n * Un-flatten a flat JSON object\n * @param {object} data\n * @return {object}\n */\nexport function unflatten(data: StringKeyMap): object {\n \"use strict\";\n\n if (Object(data) !== data || Array.isArray(data)) return data;\n const regex = /\\.?([^.[\\]]+)|\\[(\\d+)]/g;\n const result: StringKeyMap = {};\n\n for (const p in data) {\n if ({}.hasOwnProperty.call(data, p)) {\n let cur = result;\n let prop = \"\";\n let m = regex.exec(p);\n\n while (m) {\n cur = cur[prop] || (cur[prop] = m[2] ? [] : {});\n prop = m[2] || m[1];\n m = regex.exec(p);\n }\n\n cur[prop] = data[p];\n }\n }\n\n return result[\"\"] || result;\n}\n\n/**\n * Counts the number of decimal places\n * @param {number} num\n * @return {number}\n */\nexport function countDecimals(num: number): number {\n if (Math.floor(num) === num || String(num).indexOf(\".\") < 0) return 0;\n const parts = num.toString().split(\".\")[1];\n return parts.length || 0;\n}\n\n/**\n * Formats the SCORM messages for easy reading\n *\n * @param {string} functionName\n * @param {string} message\n * @param {string} CMIElement\n * @return {string}\n */\nexport function formatMessage(\n functionName: string,\n message: string,\n CMIElement?: string,\n): string {\n const baseLength = 20;\n let messageString = \"\";\n\n messageString += functionName;\n\n let fillChars = baseLength - messageString.length;\n\n for (let i = 0; i < fillChars; i++) {\n messageString += \" \";\n }\n\n messageString += \": \";\n\n if (CMIElement) {\n const CMIElementBaseLength = 70;\n\n messageString += CMIElement;\n\n fillChars = CMIElementBaseLength - messageString.length;\n\n for (let j = 0; j < fillChars; j++) {\n messageString += \" \";\n }\n }\n\n if (message) {\n messageString += message;\n }\n\n return messageString;\n}\n\n/**\n * Checks to see if {str} contains {tester}\n *\n * @param {string} str String to check against\n * @param {string} tester String to check for\n * @return {boolean}\n */\nexport function stringMatches(str: string, tester: string): boolean {\n return str?.match(tester) !== null;\n}\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","import { checkValidFormat } from \"../common/validation\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nconst aicc_error_codes = ErrorCodes.scorm12;\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function checkAICCValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n aicc_error_codes.TYPE_MISMATCH,\n AICCValidationError,\n allowEmptyString,\n );\n}\n","import { CMIArray } from \"../common/array\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * AICC Evaluation object\n */\nexport class CMIEvaluation extends BaseCMI {\n /**\n * Constructor for AICC Evaluation object\n */\n constructor() {\n super();\n this.comments = new CMIEvaluationComments();\n }\n\n public comments: CMIEvaluationComments;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.comments?.initialize();\n }\n\n /**\n * toJSON for cmi.evaluation object\n * @return {{comments: CMIEvaluationComments}}\n */\n toJSON(): {\n comments: CMIEvaluationComments;\n } {\n this.jsonString = true;\n const result = {\n comments: this.comments,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing AICC's cmi.evaluation.comments object\n */\n\nclass CMIEvaluationComments extends CMIArray {\n /**\n * Constructor for AICC Evaluation Comments object\n */\n constructor() {\n super({\n children: APIConstants.aicc.comments_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: AICCValidationError,\n });\n }\n}\n\n/**\n * Class for AICC Evaluation Comments\n */\nexport class CMIEvaluationCommentsObject extends BaseCMI {\n /**\n * Constructor for Evaluation Comments\n */\n constructor() {\n super();\n }\n\n private _content = \"\";\n private _location = \"\";\n private _time = \"\";\n\n /**\n * Getter for _content\n * @return {string}\n */\n get content(): string {\n return this._content;\n }\n\n /**\n * Setter for _content\n * @param {string} content\n */\n set content(content: string) {\n if (checkAICCValidFormat(content, Regex.aicc.CMIString256)) {\n this._content = content;\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (checkAICCValidFormat(location, Regex.aicc.CMIString256)) {\n this._location = location;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setting for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * toJSON for cmi.evaluation.comments.n object\n * @return {\n * {\n * content: string,\n * location: string,\n * time: string\n * }\n * }\n */\n toJSON(): {\n content: string;\n location: string;\n time: string;\n } {\n this.jsonString = true;\n const result = {\n content: this.content,\n location: this.location,\n time: this.time,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMIStudentPreference } from \"../scorm12/student_preference\";\n\n/**\n * StudentPreferences class for AICC\n */\nexport class AICCStudentPreferences extends CMIStudentPreference {\n /**\n * Constructor for AICC Student Preferences object\n */\n constructor() {\n super(APIConstants.aicc.student_preference_children);\n this.windows = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: AICCValidationError,\n children: \"\",\n });\n }\n\n public windows: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.windows?.initialize();\n }\n\n private _lesson_type = \"\";\n private _text_color = \"\";\n private _text_location = \"\";\n private _text_size = \"\";\n private _video = \"\";\n\n /**\n * Getter for _lesson_type\n * @return {string}\n */\n get lesson_type(): string {\n return this._lesson_type;\n }\n\n /**\n * Setter for _lesson_type\n * @param {string} lesson_type\n */\n set lesson_type(lesson_type: string) {\n if (checkAICCValidFormat(lesson_type, Regex.aicc.CMIString256)) {\n this._lesson_type = lesson_type;\n }\n }\n\n /**\n * Getter for _text_color\n * @return {string}\n */\n get text_color(): string {\n return this._text_color;\n }\n\n /**\n * Setter for _text_color\n * @param {string} text_color\n */\n set text_color(text_color: string) {\n if (checkAICCValidFormat(text_color, Regex.aicc.CMIString256)) {\n this._text_color = text_color;\n }\n }\n\n /**\n * Getter for _text_location\n * @return {string}\n */\n get text_location(): string {\n return this._text_location;\n }\n\n /**\n * Setter for _text_location\n * @param {string} text_location\n */\n set text_location(text_location: string) {\n if (checkAICCValidFormat(text_location, Regex.aicc.CMIString256)) {\n this._text_location = text_location;\n }\n }\n\n /**\n * Getter for _text_size\n * @return {string}\n */\n get text_size(): string {\n return this._text_size;\n }\n\n /**\n * Setter for _text_size\n * @param {string} text_size\n */\n set text_size(text_size: string) {\n if (checkAICCValidFormat(text_size, Regex.aicc.CMIString256)) {\n this._text_size = text_size;\n }\n }\n\n /**\n * Getter for _video\n * @return {string}\n */\n get video(): string {\n return this._video;\n }\n\n /**\n * Setter for _video\n * @param {string} video\n */\n set video(video: string) {\n if (checkAICCValidFormat(video, Regex.aicc.CMIString256)) {\n this._video = video;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string,\n * text_color: string,\n * text_location: string,\n * text_size: string,\n * video: string,\n * windows: CMIArray\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n lesson_type: string;\n speed: string;\n text: string;\n text_color: string;\n text_location: string;\n text_size: string;\n video: string;\n windows: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n lesson_type: this.lesson_type,\n speed: this.speed,\n text: this.text,\n text_color: this.text_color,\n text_location: this.text_location,\n text_size: this.text_size,\n video: this.video,\n windows: this.windows,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the AICC cmi.student_demographics object\n */\nexport class CMIStudentDemographics extends BaseCMI {\n /**\n * Constructor for AICC StudentDemographics object\n */\n constructor() {\n super();\n }\n\n private __children = APIConstants.aicc.student_demographics_children;\n private _city = \"\";\n private _class = \"\";\n private _company = \"\";\n private _country = \"\";\n private _experience = \"\";\n private _familiar_name = \"\";\n private _instructor_name = \"\";\n private _title = \"\";\n private _native_language = \"\";\n private _state = \"\";\n private _street_address = \"\";\n private _telephone = \"\";\n private _years_experience = \"\";\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Getter for city\n * @return {string}\n */\n get city(): string {\n return this._city;\n }\n\n /**\n * Setter for _city. Sets an error if trying to set after\n * initialization.\n * @param {string} city\n */\n set city(city: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._city = city;\n }\n }\n\n /**\n * Getter for class\n * @return {string}\n */\n get class(): string {\n return this._class;\n }\n\n /**\n * Setter for _class. Sets an error if trying to set after\n * initialization.\n * @param {string} clazz\n */\n set class(clazz: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._class = clazz;\n }\n }\n\n /**\n * Getter for company\n * @return {string}\n */\n get company(): string {\n return this._company;\n }\n\n /**\n * Setter for _company. Sets an error if trying to set after\n * initialization.\n * @param {string} company\n */\n set company(company: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._company = company;\n }\n }\n\n /**\n * Getter for country\n * @return {string}\n */\n get country(): string {\n return this._country;\n }\n\n /**\n * Setter for _country. Sets an error if trying to set after\n * initialization.\n * @param {string} country\n */\n set country(country: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._country = country;\n }\n }\n\n /**\n * Getter for experience\n * @return {string}\n */\n get experience(): string {\n return this._experience;\n }\n\n /**\n * Setter for _experience. Sets an error if trying to set after\n * initialization.\n * @param {string} experience\n */\n set experience(experience: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._experience = experience;\n }\n }\n\n /**\n * Getter for familiar_name\n * @return {string}\n */\n get familiar_name(): string {\n return this._familiar_name;\n }\n\n /**\n * Setter for _familiar_name. Sets an error if trying to set after\n * initialization.\n * @param {string} familiar_name\n */\n set familiar_name(familiar_name: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._familiar_name = familiar_name;\n }\n }\n\n /**\n * Getter for instructor_name\n * @return {string}\n */\n get instructor_name(): string {\n return this._instructor_name;\n }\n\n /**\n * Setter for _instructor_name. Sets an error if trying to set after\n * initialization.\n * @param {string} instructor_name\n */\n set instructor_name(instructor_name: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._instructor_name = instructor_name;\n }\n }\n\n /**\n * Getter for title\n * @return {string}\n */\n get title(): string {\n return this._title;\n }\n\n /**\n * Setter for _title. Sets an error if trying to set after\n * initialization.\n * @param {string} title\n */\n set title(title: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._title = title;\n }\n }\n\n /**\n * Getter for native_language\n * @return {string}\n */\n get native_language(): string {\n return this._native_language;\n }\n\n /**\n * Setter for _native_language. Sets an error if trying to set after\n * initialization.\n * @param {string} native_language\n */\n set native_language(native_language: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._native_language = native_language;\n }\n }\n\n /**\n * Getter for state\n * @return {string}\n */\n get state(): string {\n return this._state;\n }\n\n /**\n * Setter for _state. Sets an error if trying to set after\n * initialization.\n * @param {string} state\n */\n set state(state: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._state = state;\n }\n }\n\n /**\n * Getter for street_address\n * @return {string}\n */\n get street_address(): string {\n return this._street_address;\n }\n\n /**\n * Setter for _street_address. Sets an error if trying to set after\n * initialization.\n * @param {string} street_address\n */\n set street_address(street_address: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._street_address = street_address;\n }\n }\n\n /**\n * Getter for telephone\n * @return {string}\n */\n get telephone(): string {\n return this._telephone;\n }\n\n /**\n * Setter for _telephone. Sets an error if trying to set after\n * initialization.\n * @param {string} telephone\n */\n set telephone(telephone: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._telephone = telephone;\n }\n }\n\n /**\n * Getter for years_experience\n * @return {string}\n */\n get years_experience(): string {\n return this._years_experience;\n }\n\n /**\n * Setter for _years_experience. Sets an error if trying to set after\n * initialization.\n * @param {string} years_experience\n */\n set years_experience(years_experience: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._years_experience = years_experience;\n }\n }\n\n /**\n * toJSON for cmi.student_demographics object\n * @return {\n * {\n * city: string,\n * class: string,\n * company: string,\n * country: string,\n * experience: string,\n * familiar_name: string,\n * instructor_name: string,\n * title: string,\n * native_language: string,\n * state: string,\n * street_address: string,\n * telephone: string,\n * years_experience: string\n * }\n * }\n */\n toJSON(): {\n city: string;\n class: string;\n company: string;\n country: string;\n experience: string;\n familiar_name: string;\n instructor_name: string;\n title: string;\n native_language: string;\n state: string;\n street_address: string;\n telephone: string;\n years_experience: string;\n } {\n this.jsonString = true;\n const result = {\n city: this.city,\n class: this.class,\n company: this.company,\n country: this.country,\n experience: this.experience,\n familiar_name: this.familiar_name,\n instructor_name: this.instructor_name,\n title: this.title,\n native_language: this.native_language,\n state: this.state,\n street_address: this.street_address,\n telephone: this.telephone,\n years_experience: this.years_experience,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {CMIArray} from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {AICCValidationError} from \"../../exceptions\";\nimport {checkAICCValidFormat} from \"./validation\";\n\n/**\n * Class representing the AICC cmi.student_data.tries object\n */\nexport class CMITries extends CMIArray {\n /**\n * Constructor for inline Tries Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.tries_children,\n });\n }\n}\n\n/**\n * Class for AICC Tries\n */\nexport class CMITriesObject extends BaseCMI {\n /**\n * Constructor for AICC Tries object\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.aicc.score_children,\n score_range: Regex.aicc.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: AICCValidationError,\n });\n }\n\n public score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private _status = \"\";\n private _time = \"\";\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (checkAICCValidFormat(status, Regex.aicc.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * toJSON for cmi.student_data.tries.n object\n * @return {\n * {\n * status: string,\n * time: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n status: string;\n time: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n status: this.status,\n time: this.time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {AICCValidationError} from \"../../exceptions\";\nimport {checkAICCValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class for cmi.student_data.attempt_records array\n */\nexport class CMIAttemptRecords extends CMIArray {\n /**\n * Constructor for inline Tries Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.attempt_records_children,\n });\n }\n}\n\n/**\n * Class for AICC Attempt Records\n */\nexport class CMIAttemptRecordsObject extends BaseCMI {\n /**\n * Constructor for AICC Attempt Records object\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.aicc.score_children,\n score_range: Regex.aicc.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: AICCValidationError,\n });\n }\n\n public score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private _lesson_status = \"\";\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (checkAICCValidFormat(lesson_status, Regex.aicc.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n\n /**\n * toJSON for cmi.student_data.attempt_records.n object\n * @return {\n * {\n * lesson_status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n lesson_status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n lesson_status: this.lesson_status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { AICCValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMITries } from \"./tries\";\nimport { CMIStudentData } from \"../scorm12/student_data\";\nimport { CMIAttemptRecords } from \"./attempts\";\n\n/**\n * StudentData class for AICC\n */\nexport class AICCCMIStudentData extends CMIStudentData {\n /**\n * Constructor for AICC StudentData object\n */\n constructor() {\n super(APIConstants.aicc.student_data_children);\n this.tries = new CMITries();\n this.attempt_records = new CMIAttemptRecords();\n }\n\n public tries: CMITries;\n public attempt_records: CMIAttemptRecords;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.tries?.initialize();\n this.attempt_records?.initialize();\n }\n\n private _tries_during_lesson = \"\";\n\n /**\n * Getter for tries_during_lesson\n * @return {string}\n */\n get tries_during_lesson(): string {\n return this._tries_during_lesson;\n }\n\n /**\n * Setter for _tries_during_lesson. Sets an error if trying to set after\n * initialization.\n * @param {string} tries_during_lesson\n */\n set tries_during_lesson(tries_during_lesson: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._tries_during_lesson = tries_during_lesson;\n }\n }\n\n /**\n * toJSON for cmi.student_data object\n * @return {\n * {\n * mastery_score: string,\n * max_time_allowed: string,\n * time_limit_action: string,\n * tries: CMITries,\n * attempt_records: CMIAttemptRecords\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n tries: CMITries;\n attempt_records: CMIAttemptRecords;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n tries: this.tries,\n attempt_records: this.attempt_records,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport { CMIArray } from \"../common/array\";\nimport Regex from \"../../constants/regex\";\nimport APIConstants from \"../../constants/api_constants\";\n\n/**\n * Class representing the AICC `cmi.paths` object\n */\nexport class CMIPaths extends CMIArray {\n /**\n * Constructor for inline Paths Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.paths_children,\n });\n }\n}\n\n/**\n * Class for AICC Paths\n */\nexport class CMIPathsObject extends BaseCMI {\n /**\n * Constructor for AICC Paths objects\n */\n constructor() {\n super();\n }\n\n private _location_id = \"\";\n private _date = \"\";\n private _time = \"\";\n private _status = \"\";\n private _why_left = \"\";\n private _time_in_element = \"\";\n\n /**\n * Getter for _location_id\n * @return {string}\n */\n get location_id(): string {\n return this._location_id;\n }\n\n /**\n * Setter for _location_id\n * @param {string} location_id\n */\n set location_id(location_id: string) {\n if (checkAICCValidFormat(location_id, Regex.aicc.CMIString256)) {\n this._location_id = location_id;\n }\n }\n\n /**\n * Getter for _date\n * @return {string}\n */\n get date(): string {\n return this._date;\n }\n\n /**\n * Setter for _date\n * @param {string} date\n */\n set date(date: string) {\n if (checkAICCValidFormat(date, Regex.aicc.CMIString256)) {\n this._date = date;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (checkAICCValidFormat(status, Regex.aicc.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * Getter for _why_left\n * @return {string}\n */\n get why_left(): string {\n return this._why_left;\n }\n\n /**\n * Setter for _why_left\n * @param {string} why_left\n */\n set why_left(why_left: string) {\n if (checkAICCValidFormat(why_left, Regex.aicc.CMIString256)) {\n this._why_left = why_left;\n }\n }\n\n /**\n * Getter for _time_in_element\n * @return {string}\n */\n get time_in_element(): string {\n return this._time_in_element;\n }\n\n /**\n * Setter for _time_in_element\n * @param {string} time_in_element\n */\n set time_in_element(time_in_element: string) {\n if (checkAICCValidFormat(time_in_element, Regex.aicc.CMITime)) {\n this._time_in_element = time_in_element;\n }\n }\n\n /**\n * toJSON for cmi.paths.n object\n * @return {\n * {\n * location_id: string,\n * date: string,\n * time: string,\n * status: string,\n * why_left: string,\n * time_in_element: string\n * }\n * }\n */\n toJSON(): {\n location_id: string;\n date: string;\n time: string;\n status: string;\n why_left: string;\n time_in_element: string;\n } {\n this.jsonString = true;\n const result = {\n location_id: this.location_id,\n date: this.date,\n time: this.time,\n status: this.status,\n why_left: this.why_left,\n time_in_element: this.time_in_element,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import * as Scorm12CMI from \"../scorm12/cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMIEvaluation } from \"./evaluation\";\nimport { AICCStudentPreferences } from \"./student_preferences\";\nimport { CMIStudentDemographics } from \"./student_demographics\";\nimport { AICCCMIStudentData } from \"./student_data\";\nimport { CMIPaths } from \"./paths\";\nimport { CMICore } from \"./core\";\nimport { CMIObjectives } from \"../scorm12/objectives\";\nimport { CMIStudentData } from \"../scorm12/student_data\";\nimport { CMIStudentPreference } from \"../scorm12/student_preference\";\nimport { CMIInteractions } from \"../scorm12/interactions\";\n\n/**\n * CMI Class for AICC\n */\nexport class CMI extends Scorm12CMI.CMI {\n /**\n * Constructor for AICC CMI object\n * @param {boolean} initialized\n */\n constructor(initialized: boolean = false) {\n super(APIConstants.aicc.cmi_children);\n if (initialized) this.initialize();\n this.student_preference = new AICCStudentPreferences();\n this.student_data = new AICCCMIStudentData();\n this.student_demographics = new CMIStudentDemographics();\n this.evaluation = new CMIEvaluation();\n this.paths = new CMIPaths();\n }\n\n public student_data: AICCCMIStudentData;\n public student_preference: AICCStudentPreferences;\n public student_demographics: CMIStudentDemographics;\n public evaluation: CMIEvaluation;\n public paths: CMIPaths;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.student_preference?.initialize();\n this.student_data?.initialize();\n this.student_demographics?.initialize();\n this.evaluation?.initialize();\n this.paths?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions,\n * paths: CMIPaths\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n student_demographics: CMIStudentDemographics;\n interactions: CMIInteractions;\n evaluation: CMIEvaluation;\n paths: CMIPaths;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n student_demographics: this.student_demographics,\n interactions: this.interactions,\n evaluation: this.evaluation,\n paths: this.paths,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { Scorm12Impl } from \"./Scorm12API\";\nimport { CMI } from \"./cmi/aicc/cmi\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMITriesObject } from \"./cmi/aicc/tries\";\nimport { CMIAttemptRecordsObject } from \"./cmi/aicc/attempts\";\nimport { CMIEvaluationCommentsObject } from \"./cmi/aicc/evaluation\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport { CMIPathsObject } from \"./cmi/aicc/paths\";\nimport { Settings } from \"./types/api_types\";\nimport { stringMatches } from \"./utilities\";\n\n/**\n * The AICC API class\n */\nclass AICCImpl extends Scorm12Impl {\n /**\n * Constructor to create AICC API object\n * @param {Settings} settings\n */\n constructor(settings?: Settings) {\n super(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {any} value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI | null}\n */\n getChildElement(\n CMIElement: string,\n value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n let newChild = super.getChildElement(CMIElement, value, foundFirstIndex);\n\n if (!newChild) {\n if (stringMatches(CMIElement, \"cmi\\\\.evaluation\\\\.comments\\\\.\\\\d+\")) {\n newChild = new CMIEvaluationCommentsObject();\n } else if (\n stringMatches(CMIElement, \"cmi\\\\.student_data\\\\.tries\\\\.\\\\d+\")\n ) {\n newChild = new CMITriesObject();\n } else if (\n stringMatches(CMIElement, \"cmi\\\\.student_data\\\\.attempt_records\\\\.\\\\d+\")\n ) {\n newChild = new CMIAttemptRecordsObject();\n } else if (stringMatches(CMIElement, \"cmi\\\\.paths\\\\.\\\\d+\")) {\n newChild = new CMIPathsObject();\n }\n }\n\n return newChild;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {AICCImpl} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: AICCImpl) {\n // Data Model\n this.cmi = newAPI.cmi;\n this.nav = newAPI.nav;\n }\n}\n\nexport { AICCImpl };\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/dist/esm/aicc.min.js b/dist/esm/aicc.min.js new file mode 100644 index 0000000..7f36f36 --- /dev/null +++ b/dist/esm/aicc.min.js @@ -0,0 +1,2 @@ +var e={900:function(e,t,i){i.d(t,{A:function(){return d}});var r=i(635),n=i(589),o=i(784),s=i(797),a=i(340),c=i(864);var l={autocommit:!1,autocommitSeconds:10,asyncCommit:!1,sendFullCommit:!0,lmsCommitUrl:!1,dataCommitFormat:"json",commitRequestDataType:"application/json;charset=UTF-8",autoProgress:!1,logLevel:a.A.global.LOG_LEVEL_ERROR,selfReportSessionTime:!1,alwaysSendTotalTime:!1,renderCommonCommitFields:!1,strict_errors:!0,xhrHeaders:{},xhrWithCredentials:!1,responseHandler:function(e){return(0,r.sH)(this,void 0,void 0,(function(){var t,i,n;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return void 0===e?[3,2]:(n=(i=JSON).parse,[4,e.text()]);case 1:return null!==(t=n.apply(i,[r.sent()]))&&{}.hasOwnProperty.call(t,"result")?[2,{result:t.result,errorCode:t.errorCode?t.errorCode:t.result===a.A.global.SCORM_TRUE?0:101}]:200===e.status?[2,{result:a.A.global.SCORM_TRUE,errorCode:0}]:[2,{result:a.A.global.SCORM_FALSE,errorCode:101}];case 2:return[2,{result:a.A.global.SCORM_FALSE,errorCode:101}]}}))}))},requestHandler:function(e){return e},onLogMessage:function(e,t){switch(e){case a.A.global.LOG_LEVEL_ERROR:console.error(t);break;case a.A.global.LOG_LEVEL_WARNING:console.warn(t);break;case a.A.global.LOG_LEVEL_INFO:console.info(t);break;case a.A.global.LOG_LEVEL_DEBUG:console.debug?console.debug(t):console.log(t)}},scoItemIds:[],scoItemIdValidator:!1},u=function(){function e(e,t,i){this._cancelled=!1,this._API=e,this._timeout=setTimeout(this.wrapper.bind(this),t),this._callback=i}return e.prototype.cancel=function(){this._cancelled=!0,this._timeout&&clearTimeout(this._timeout)},e.prototype.wrapper=function(){var e=this;this._cancelled||(0,r.sH)(e,void 0,void 0,(function(){return(0,r.YH)(this,(function(e){switch(e.label){case 0:return[4,this._API.commit(this._callback)];case 1:return[2,e.sent()]}}))}))},e}(),_=function(){function e(t,i){var r=this.constructor;if(this._settings=l,r===e)throw new TypeError("Cannot construct BaseAPI instances directly");this.currentState=a.A.global.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[],this._error_codes=t,i&&(this.settings=i),this.apiLogLevel=this.settings.logLevel,this.selfReportSessionTime=this.settings.selfReportSessionTime}return e.prototype.commonReset=function(e){this.settings=(0,r.Cl)((0,r.Cl)({},this.settings),e),this.currentState=a.A.global.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[]},e.prototype.initialize=function(e,t,i){var r=a.A.global.SCORM_FALSE;return this.isInitialized()?this.throwSCORMError(this._error_codes.INITIALIZED,t):this.isTerminated()?this.throwSCORMError(this._error_codes.TERMINATED,i):(this.selfReportSessionTime&&this.cmi.setStartTime(),this.currentState=a.A.global.STATE_INITIALIZED,this.lastErrorCode="0",r=a.A.global.SCORM_TRUE,this.processListeners(e)),this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(r),r},e.prototype.apiLog=function(e,t,i,r){t=(0,c.hw)(e,t,r),i>=this.apiLogLevel&&this.settings.onLogMessage(i,t)},Object.defineProperty(e.prototype,"error_codes",{get:function(){return this._error_codes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"settings",{get:function(){return this._settings},set:function(e){this._settings=(0,r.Cl)((0,r.Cl)({},this._settings),e)},enumerable:!1,configurable:!0}),e.prototype.terminate=function(e,t){return(0,r.sH)(this,void 0,void 0,(function(){var i,n;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return i=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.TERMINATION_BEFORE_INIT,this._error_codes.MULTIPLE_TERMINATION)?(this.currentState=a.A.global.STATE_TERMINATED,[4,this.storeData(!0)]):[3,2];case 1:void 0!==(n=r.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),i=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,t&&(this.lastErrorCode="0"),i=a.A.global.SCORM_TRUE,this.processListeners(e),r.label=2;case 2:return this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(i),[2,i]}}))}))},e.prototype.getValue=function(e,t,i){var r="";if(this.checkState(t,this._error_codes.RETRIEVE_BEFORE_INIT,this._error_codes.RETRIEVE_AFTER_TERM)){t&&(this.lastErrorCode="0");try{r=this.getCMIValue(i)}catch(e){r=this.handleValueAccessException(e,r)}this.processListeners(e,i)}return this.apiLog(e,": returned: "+r,a.A.global.LOG_LEVEL_INFO,i),void 0===r?"":(this.clearSCORMError(r),r)},e.prototype.setValue=function(e,t,i,r,n){void 0!==n&&(n=String(n));var o=a.A.global.SCORM_FALSE;if(this.checkState(i,this._error_codes.STORE_BEFORE_INIT,this._error_codes.STORE_AFTER_TERM)){i&&(this.lastErrorCode="0");try{o=this.setCMIValue(r,n)}catch(e){this.handleValueAccessException(e,o)}this.processListeners(e,r,n)}return void 0===o&&(o=a.A.global.SCORM_FALSE),"0"===String(this.lastErrorCode)&&this.settings.autocommit&&!this._timeout&&this.scheduleCommit(1e3*this.settings.autocommitSeconds,t),this.apiLog(e,": "+n+": result: "+o,a.A.global.LOG_LEVEL_INFO,r),this.clearSCORMError(o),o},e.prototype.commit=function(e){return(0,r.sH)(this,arguments,void 0,(function(e,t){var i,n;return void 0===t&&(t=!1),(0,r.YH)(this,(function(r){switch(r.label){case 0:return this.clearScheduledCommit(),i=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.COMMIT_BEFORE_INIT,this._error_codes.COMMIT_AFTER_TERM)?[4,this.storeData(!1)]:[3,2];case 1:(n=r.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),i=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,this.apiLog(e," Result: "+i,a.A.global.LOG_LEVEL_DEBUG,"HttpRequest"),t&&(this.lastErrorCode="0"),this.processListeners(e),r.label=2;case 2:return this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(i),[2,i]}}))}))},e.prototype.getLastError=function(e){var t=String(this.lastErrorCode);return this.processListeners(e),this.apiLog(e,"returned: "+t,a.A.global.LOG_LEVEL_INFO),t},e.prototype.getErrorString=function(e,t){var i="";return null!==t&&""!==t&&(i=this.getLmsErrorMessageDetails(t),this.processListeners(e)),this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),i},e.prototype.getDiagnostic=function(e,t){var i="";return null!==t&&""!==t&&(i=this.getLmsErrorMessageDetails(t,!0),this.processListeners(e)),this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),i},e.prototype.checkState=function(e,t,i){return this.isNotInitialized()?(this.throwSCORMError(t),!1):!e||!this.isTerminated()||(this.throwSCORMError(i),!1)},e.prototype.getLmsErrorMessageDetails=function(e,t){throw void 0===t&&(t=!1),new Error("The getLmsErrorMessageDetails method has not been implemented")},e.prototype.getCMIValue=function(e){throw new Error("The getCMIValue method has not been implemented")},e.prototype.setCMIValue=function(e,t){throw new Error("The setCMIValue method has not been implemented")},e.prototype._commonSetCMIValue=function(e,t,i,o){if(!i||""===i)return a.A.global.SCORM_FALSE;for(var s=i.split("."),l=this,u=a.A.global.SCORM_FALSE,_=!1,d="The data model element passed to ".concat(e," (").concat(i,") is not a valid SCORM data model element."),h=t?this._error_codes.UNDEFINED_DATA_MODEL:this._error_codes.GENERAL,m=0;m1&&(s=e.replace(o+".","")),this.listenerArray.push({functionName:o,CMIElement:s,callback:t}),this.apiLog("on","Added event listener: ".concat(this.listenerArray.length),a.A.global.LOG_LEVEL_INFO,o)}},e.prototype.off=function(e,t){if(t)for(var i=e.split(" "),r=function(r){var o=i[r].split(".");if(0===o.length)return{value:void 0};var s=o[0],c=null;o.length>1&&(c=e.replace(s+".",""));var l=n.listenerArray.findIndex((function(e){return e.functionName===s&&e.CMIElement===c&&e.callback===t}));-1!==l&&(n.listenerArray.splice(l,1),n.apiLog("off","Removed event listener: ".concat(n.listenerArray.length),a.A.global.LOG_LEVEL_INFO,s))},n=this,o=0;o1&&(s=e.replace(o+".","")),r.listenerArray=r.listenerArray.filter((function(e){return e.functionName!==o&&e.CMIElement!==s}))},r=this,n=0;ns?1:0})),s.forEach((function(e){(r={})[e[0]]=e[1],i.loadFromJSON((0,c.sB)(r),t)}))}else console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize.");function a(e,t,i){var r,n=e.match(i);if(null!==n&&null!==(r=t.match(i))){var o=Number(n[2]),s=Number(r[2]);return o===s?"id"===n[3]?-1:"type"===n[3]?"id"===r[3]?1:-1:1:o-s}return null}},e.prototype.loadFromJSON=function(e,t){if(this.isNotInitialized()){for(var i in t=void 0!==t?t:"cmi",this.startingData=e,e)if({}.hasOwnProperty.call(e,i)&&e[i]){var r=(t?t+".":"")+i,n=e[i];if(n.childArray)for(var o=0;o=200&&e.status<=299&&(!0===t.result||t.result===a.A.global.SCORM_TRUE)?this.processListeners("CommitSuccess"):this.processListeners("CommitError"),[2,t]}}))}))},e}(),d=_},941:function(e,t,i){i.d(t,{C:function(){return h}});var r=i(635),n=i(989),o=i(864),s=i(340),a=i(797),c=i(176),l=i(833),u=i(331),_=i(417),d=i(56),h=function(e){function t(t){var i=this;return t&&void 0===t.mastery_override&&(t.mastery_override=!1),(i=e.call(this,a.A.scorm12,t)||this).statusSetByModule=!1,i.cmi=new n.Y,i.nav=new u.A,i.LMSInitialize=i.lmsInitialize,i.LMSFinish=i.lmsFinish,i.LMSGetValue=i.lmsGetValue,i.LMSSetValue=i.lmsSetValue,i.LMSCommit=i.lmsCommit,i.LMSGetLastError=i.lmsGetLastError,i.LMSGetErrorString=i.lmsGetErrorString,i.LMSGetDiagnostic=i.lmsGetDiagnostic,i}return(0,r.C6)(t,e),t.prototype.reset=function(e){this.commonReset(e),this.cmi=new n.Y,this.nav=new u.A},t.prototype.lmsInitialize=function(){return this.cmi.initialize(),this.cmi.core.lesson_status?this.statusSetByModule=!0:this.cmi.core.lesson_status="not attempted",this.initialize("LMSInitialize","LMS was already initialized!","LMS is already finished!")},t.prototype.lmsFinish=function(){var e=this;return(0,r.sH)(e,void 0,void 0,(function(){return(0,r.YH)(this,(function(e){switch(e.label){case 0:return[4,this.internalFinish()];case 1:return e.sent(),[2]}}))})),s.A.global.SCORM_TRUE},t.prototype.internalFinish=function(){return(0,r.sH)(this,void 0,void 0,(function(){var e;return(0,r.YH)(this,(function(t){switch(t.label){case 0:return[4,this.terminate("LMSFinish",!0)];case 1:return(e=t.sent())===s.A.global.SCORM_TRUE&&(""!==this.nav.event?"continue"===this.nav.event?this.processListeners("SequenceNext"):this.processListeners("SequencePrevious"):this.settings.autoProgress&&this.processListeners("SequenceNext")),[2,e]}}))}))},t.prototype.lmsGetValue=function(e){return this.getValue("LMSGetValue",!1,e)},t.prototype.lmsSetValue=function(e,t){return"cmi.core.lesson_status"===e&&(this.statusSetByModule=!0),this.setValue("LMSSetValue","LMSCommit",!1,e,t)},t.prototype.lmsCommit=function(){var e=this;return(0,r.sH)(e,void 0,void 0,(function(){return(0,r.YH)(this,(function(e){switch(e.label){case 0:return[4,this.commit("LMSCommit",!1)];case 1:return e.sent(),[2]}}))})),s.A.global.SCORM_TRUE},t.prototype.lmsGetLastError=function(){return this.getLastError("LMSGetLastError")},t.prototype.lmsGetErrorString=function(e){return this.getErrorString("LMSGetErrorString",e)},t.prototype.lmsGetDiagnostic=function(e){return this.getDiagnostic("LMSGetDiagnostic",e)},t.prototype.setCMIValue=function(e,t){return this._commonSetCMIValue("LMSSetValue",!1,e,t)},t.prototype.getCMIValue=function(e){return this._commonGetCMIValue("getCMIValue",!1,e)},t.prototype.getChildElement=function(e,t,i){return(0,o.J6)(e,"cmi\\.objectives\\.\\d+")?new c.N:i&&(0,o.J6)(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")?new l.cb:i&&(0,o.J6)(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")?new l.Oh:!i&&(0,o.J6)(e,"cmi\\.interactions\\.\\d+")?new l.WP:null},t.prototype.validateCorrectResponse=function(e,t){},t.prototype.getLmsErrorMessageDetails=function(e,t){var i="No Error",r="No Error";return e=String(e),s.A.scorm12.error_descriptions[e]&&(i=s.A.scorm12.error_descriptions[e].basicMessage,r=s.A.scorm12.error_descriptions[e].detailMessage),t?r:i},t.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi},t.prototype.renderCommitCMI=function(e){var t=this.renderCMIToJSONObject();e&&(t.cmi.core.total_time=this.cmi.getCurrentTotalTime());var i=[],r=o.Bq(t);switch(this.settings.dataCommitFormat){case"flattened":return o.Bq(t);case"params":for(var n in r)({}).hasOwnProperty.call(r,n)&&i.push("".concat(n,"=").concat(r[n]));return i;default:return t}},t.prototype.renderCommitObject=function(e){var t=this.renderCommitCMI(e),i=this.cmi.getCurrentTotalTime(),r=o.f4(i,_.A.scorm12.CMITimespan),n=this.cmi.core.lesson_status,s=d.lC.unknown,a=d.YE.unknown;n&&(s="completed"===n||"passed"===n?d.lC.completed:d.lC.incomplete,"passed"===n?a=d.YE.passed:"failed"===n&&(a=d.YE.failed));var c=this.cmi.core.score,l=null;c&&(l={},Number.isNaN(Number.parseFloat(c.raw))||(l.raw=Number.parseFloat(c.raw)),Number.isNaN(Number.parseFloat(c.min))||(l.min=Number.parseFloat(c.min)),Number.isNaN(Number.parseFloat(c.max))||(l.max=Number.parseFloat(c.max)));var u={successStatus:a,completionStatus:s,runtimeData:t,totalTimeSeconds:r};return l&&(u.score=l),u},t.prototype.storeData=function(e){return(0,r.sH)(this,void 0,void 0,(function(){var t,i,n,o,a,c;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return e&&(t=this.cmi.core.lesson_status,this.cmi.core.lesson_status&&(this.statusSetByModule||"not attempted"!==this.cmi.core.lesson_status)||(this.cmi.core.lesson_status="completed"),"normal"===this.cmi.core.lesson_mode?"credit"===this.cmi.core.credit&&this.settings.mastery_override&&""!==this.cmi.student_data.mastery_score&&""!==this.cmi.core.score.raw&&(this.cmi.core.lesson_status=parseFloat(this.cmi.core.score.raw)>=parseFloat(this.cmi.student_data.mastery_score)?"passed":"failed"):"browse"===this.cmi.core.lesson_mode&&""===((null===(c=null===(a=null===(o=this.startingData)||void 0===o?void 0:o.cmi)||void 0===a?void 0:a.core)||void 0===c?void 0:c.lesson_status)||"")&&"not attempted"===t&&(this.cmi.core.lesson_status="browsed")),i=e||this.settings.alwaysSendTotalTime,n=this.settings.renderCommonCommitFields?this.renderCommitObject(i):this.renderCommitCMI(i),this.apiLogLevel===s.A.global.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(n)),"string"!=typeof this.settings.lmsCommitUrl?[3,2]:[4,this.processHttpRequest(this.settings.lmsCommitUrl,n,e)];case 1:return[2,r.sent()];case 2:return[2,{result:s.A.global.SCORM_TRUE,errorCode:0}]}}))}))},t}(i(900).A)},589:function(e,t,i){i.d(t,{B:function(){return c}});var r=i(635),n=i(319),o=i(797),s=i(784),a=o.A.scorm12,c=function(e){function t(t){var i=e.call(this)||this;return i.__children=t.children,i._errorCode=t.errorCode||a.GENERAL,i._errorClass=t.errorClass||s.$h,i.childArray=[],i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_count",{get:function(){return this.childArray.length},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;for(var e={},t=0;t=n[0]){if("*"===n[1]||e<=n[1])return!0;throw new r(i)}throw new r(i)}i.d(t,{W:function(){return n},q:function(){return r}})},989:function(e,t,i){i.d(t,{Y:function(){return g}});var r=i(635),n=i(340),o=i(797),s=i(417),a=i(784),c=i(319),l=i(915),u=i(434),_=i(864),d=function(e){function t(){var t=e.call(this)||this;return t.__children=n.A.scorm12.core_children,t._student_id="",t._student_name="",t._lesson_location="",t._credit="",t._lesson_status="not attempted",t._entry="",t._total_time="",t._lesson_mode="normal",t._exit="",t._session_time="00:00:00",t._suspend_data="",t.score=new u._({score_children:n.A.scorm12.score_children,score_range:s.A.scorm12.score_range,invalidErrorCode:o.A.scorm12.INVALID_SET_VALUE,invalidTypeCode:o.A.scorm12.TYPE_MISMATCH,invalidRangeCode:o.A.scorm12.VALUE_OUT_OF_RANGE,errorClass:a.tQ}),t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_id",{get:function(){return this._student_id},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._student_id=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_name",{get:function(){return this._student_name},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._student_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_location",{get:function(){return this._lesson_location},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString256,!0)&&(this._lesson_location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"credit",{get:function(){return this._credit},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._credit=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_status",{get:function(){return this._lesson_status},set:function(e){this.initialized?(0,l.p)(e,s.A.scorm12.CMIStatus)&&(this._lesson_status=e):(0,l.p)(e,s.A.scorm12.CMIStatus2)&&(this._lesson_status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"entry",{get:function(){return this._entry},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._entry=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"total_time",{get:function(){return this._total_time},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._total_time=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_mode",{get:function(){return this._lesson_mode},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._lesson_mode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"exit",{get:function(){if(!this.jsonString)throw new a.tQ(o.A.scorm12.WRITE_ONLY_ELEMENT);return this._exit},set:function(e){(0,l.p)(e,s.A.scorm12.CMIExit,!0)&&(this._exit=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"session_time",{get:function(){if(!this.jsonString)throw new a.tQ(o.A.scorm12.WRITE_ONLY_ELEMENT);return this._session_time},set:function(e){(0,l.p)(e,s.A.scorm12.CMITimespan)&&(this._session_time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"suspend_data",{get:function(){return this._suspend_data},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString4096,!0)&&(this._suspend_data=e)},enumerable:!1,configurable:!0}),t.prototype.getCurrentTotalTime=function(e){var t=this._session_time,i=e;if(null!=i){var r=(new Date).getTime()-i;t=_.UZ(r/1e3)}return _.HT(this._total_time,t,new RegExp(s.A.scorm12.CMITimespan))},t.prototype.toJSON=function(){this.jsonString=!0;var e={student_id:this.student_id,student_name:this.student_name,lesson_location:this.lesson_location,credit:this.credit,lesson_status:this.lesson_status,entry:this.entry,lesson_mode:this.lesson_mode,exit:this.exit,session_time:this.session_time,score:this.score};return delete this.jsonString,e},t}(c.J),h=i(176),m=i(532),f=i(181),p=i(833),g=function(e){function t(t,i,r){var o=e.call(this)||this;return o.__children="",o.__version="3.4",o._launch_data="",o._comments="",o._comments_from_lms="",r&&o.initialize(),o.__children=t||n.A.scorm12.cmi_children,o.core=new d,o.objectives=new h.C,o.student_data=i||new m.X,o.student_preference=new f.G,o.interactions=new p.Xb,o}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t,i,r,n,o;e.prototype.initialize.call(this),null===(t=this.core)||void 0===t||t.initialize(),null===(i=this.objectives)||void 0===i||i.initialize(),null===(r=this.student_data)||void 0===r||r.initialize(),null===(n=this.student_preference)||void 0===n||n.initialize(),null===(o=this.interactions)||void 0===o||o.initialize()},t.prototype.toJSON=function(){this.jsonString=!0;var e={suspend_data:this.suspend_data,launch_data:this.launch_data,comments:this.comments,comments_from_lms:this.comments_from_lms,core:this.core,objectives:this.objectives,student_data:this.student_data,student_preference:this.student_preference,interactions:this.interactions};return delete this.jsonString,e},Object.defineProperty(t.prototype,"_version",{get:function(){return this.__version},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"suspend_data",{get:function(){var e;return null===(e=this.core)||void 0===e?void 0:e.suspend_data},set:function(e){this.core&&(this.core.suspend_data=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"launch_data",{get:function(){return this._launch_data},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._launch_data=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"comments",{get:function(){return this._comments},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString4096,!0)&&(this._comments=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"comments_from_lms",{get:function(){return this._comments_from_lms},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._comments_from_lms=e},enumerable:!1,configurable:!0}),t.prototype.getCurrentTotalTime=function(){return this.core.getCurrentTotalTime(this.start_time)},t}(c.r)},833:function(e,t,i){i.d(t,{Oh:function(){return h},WP:function(){return d},Xb:function(){return _},cb:function(){return m}});var r=i(635),n=i(589),o=i(340),s=i(797),a=i(784),c=i(319),l=i(915),u=i(417),_=function(e){function t(){return e.call(this,{children:o.A.scorm12.interactions_children,errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ})||this}return(0,r.C6)(t,e),t}(n.B),d=function(e){function t(){var t=e.call(this)||this;return t._id="",t._time="",t._type="",t._weighting="",t._student_response="",t._result="",t._latency="",t.objectives=new n.B({errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ,children:o.A.scorm12.objectives_children}),t.correct_responses=new n.B({errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ,children:o.A.scorm12.correct_responses_children}),t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t,i;e.prototype.initialize.call(this),null===(t=this.objectives)||void 0===t||t.initialize(),null===(i=this.correct_responses)||void 0===i||i.initialize()},Object.defineProperty(t.prototype,"id",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._id},set:function(e){(0,l.p)(e,u.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._time},set:function(e){(0,l.p)(e,u.A.scorm12.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._type},set:function(e){(0,l.p)(e,u.A.scorm12.CMIType)&&(this._type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weighting",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._weighting},set:function(e){(0,l.p)(e,u.A.scorm12.CMIDecimal)&&(0,l.h)(e,u.A.scorm12.weighting_range)&&(this._weighting=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_response",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._student_response},set:function(e){(0,l.p)(e,u.A.scorm12.CMIFeedback,!0)&&(this._student_response=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"result",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._result},set:function(e){(0,l.p)(e,u.A.scorm12.CMIResult)&&(this._result=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"latency",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._latency},set:function(e){(0,l.p)(e,u.A.scorm12.CMITimespan)&&(this._latency=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,time:this.time,type:this.type,weighting:this.weighting,student_response:this.student_response,result:this.result,latency:this.latency,objectives:this.objectives,correct_responses:this.correct_responses};return delete this.jsonString,e},t}(c.J),h=function(e){function t(){var t=e.call(this)||this;return t._id="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(e){(0,l.p)(e,u.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id};return delete this.jsonString,e},t}(c.J),m=function(e){function t(){var t=e.call(this)||this;return t._pattern="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"pattern",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._pattern},set:function(e){(0,l.p)(e,u.A.scorm12.CMIFeedback,!0)&&(this._pattern=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={pattern:this._pattern};return delete this.jsonString,e},t}(c.J)},331:function(e,t,i){i.d(t,{A:function(){return a}});var r=i(635),n=i(319),o=i(915),s=i(417),a=function(e){function t(){var t=e.call(this)||this;return t._event="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"event",{get:function(){return this._event},set:function(e){(0,o.p)(e,s.A.scorm12.NAVEvent)&&(this._event=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={event:this.event};return delete this.jsonString,e},t}(n.J)},176:function(e,t,i){i.d(t,{C:function(){return _},N:function(){return d}});var r=i(635),n=i(319),o=i(434),s=i(340),a=i(417),c=i(797),l=i(784),u=i(915),_=function(e){function t(){return e.call(this,{children:s.A.scorm12.objectives_children,errorCode:c.A.scorm12.INVALID_SET_VALUE,errorClass:l.tQ})||this}return(0,r.C6)(t,e),t}(i(589).B),d=function(e){function t(){var t=e.call(this)||this;return t._id="",t._status="",t.score=new o._({score_children:s.A.scorm12.score_children,score_range:a.A.scorm12.score_range,invalidErrorCode:c.A.scorm12.INVALID_SET_VALUE,invalidTypeCode:c.A.scorm12.TYPE_MISMATCH,invalidRangeCode:c.A.scorm12.VALUE_OUT_OF_RANGE,errorClass:l.tQ}),t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(e){(0,u.p)(e,a.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},set:function(e){(0,u.p)(e,a.A.scorm12.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,status:this.status,score:this.score};return delete this.jsonString,e},t}(n.J)},532:function(e,t,i){i.d(t,{X:function(){return c}});var r=i(635),n=i(319),o=i(340),s=i(784),a=i(797),c=function(e){function t(t){var i=e.call(this)||this;return i._mastery_score="",i._max_time_allowed="",i._time_limit_action="",i.__children=t||o.A.scorm12.student_data_children,i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new s.tQ(a.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mastery_score",{get:function(){return this._mastery_score},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._mastery_score=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"max_time_allowed",{get:function(){return this._max_time_allowed},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._max_time_allowed=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time_limit_action",{get:function(){return this._time_limit_action},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._time_limit_action=e},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={mastery_score:this.mastery_score,max_time_allowed:this.max_time_allowed,time_limit_action:this.time_limit_action};return delete this.jsonString,e},t}(n.J)},181:function(e,t,i){i.d(t,{G:function(){return u}});var r=i(635),n=i(319),o=i(340),s=i(784),a=i(797),c=i(915),l=i(417),u=function(e){function t(t){var i=e.call(this)||this;return i._audio="",i._language="",i._speed="",i._text="",i.__children=t||o.A.scorm12.student_preference_children,i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new s.tQ(a.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audio",{get:function(){return this._audio},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.audio_range)&&(this._audio=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"language",{get:function(){return this._language},set:function(e){(0,c.p)(e,l.A.scorm12.CMIString256)&&(this._language=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speed",{get:function(){return this._speed},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.speed_range)&&(this._speed=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this._text},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.text_range)&&(this._text=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,speed:this.speed,text:this.text};return delete this.jsonString,e},t}(n.J)},915:function(e,t,i){i.d(t,{h:function(){return a},p:function(){return s}});var r=i(449),n=i(797),o=i(784);function s(e,t,i){return(0,r.q)(e,t,n.A.scorm12.TYPE_MISMATCH,o.tQ,i)}function a(e,t,i){if(!i&&""===e)throw new o.tQ(n.A.scorm12.VALUE_OUT_OF_RANGE);return(0,r.W)(e,t,n.A.scorm12.VALUE_OUT_OF_RANGE,o.tQ)}},340:function(e,t,i){var r=i(635),n={cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",core_children:"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time",score_children:"raw,min,max",comments_children:"content,location,time",objectives_children:"id,score,status",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio,language,speed,text",interactions_children:"id,objectives,time,type,correct_responses,weighting,student_response,result,latency",error_descriptions:{101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information"},201:{basicMessage:"Invalid argument error",detailMessage:"Indicates that an argument represents an invalid data model element or is otherwise incorrect."},202:{basicMessage:"Element cannot have children",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.'},203:{basicMessage:"Element not an array - cannot have count",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.'},301:{basicMessage:"Not initialized",detailMessage:"Indicates that an API call was made before the call to lmsInitialize."},401:{basicMessage:"Not implemented error",detailMessage:"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement."},402:{basicMessage:"Invalid set value, element is a keyword",detailMessage:'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").'},403:{basicMessage:"Element is read only",detailMessage:"LMSSetValue was called with a data model element that can only be read."},404:{basicMessage:"Element is write only",detailMessage:"LMSGetValue was called on a data model element that can only be written to."},405:{basicMessage:"Incorrect Data Type",detailMessage:"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Element Value Out Of Range",detailMessage:"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}},o={global:{SCORM_TRUE:"true",SCORM_FALSE:"false",STATE_NOT_INITIALIZED:0,STATE_INITIALIZED:1,STATE_TERMINATED:2,LOG_LEVEL_DEBUG:1,LOG_LEVEL_INFO:2,LOG_LEVEL_WARNING:3,LOG_LEVEL_ERROR:4,LOG_LEVEL_NONE:5},scorm12:n,aicc:(0,r.Cl)((0,r.Cl)({},n),{cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation",student_preference_children:"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows",student_data_children:"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action",student_demographics_children:"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience",tries_children:"time,status,score",attempt_records_children:"score,lesson_status",paths_children:"location_id,date,time,status,why_left,time_in_element"}),scorm2004:{cmi_children:"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time",comments_children:"comment,timestamp,location",score_children:"max,raw,scaled,min",objectives_children:"progress_measure,completion_status,success_status,description,score,id",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio_level,audio_captioning,delivery_speed,language",interactions_children:"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description",error_descriptions:{0:{basicMessage:"No Error",detailMessage:"No error occurred, the previous API call was successful."},101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use GetDiagnostic for more information."},102:{basicMessage:"General Initialization Failure",detailMessage:"Call to Initialize failed for an unknown reason."},103:{basicMessage:"Already Initialized",detailMessage:"Call to Initialize failed because Initialize was already called."},104:{basicMessage:"Content Instance Terminated",detailMessage:"Call to Initialize failed because Terminate was already called."},111:{basicMessage:"General Termination Failure",detailMessage:"Call to Terminate failed for an unknown reason."},112:{basicMessage:"Termination Before Initialization",detailMessage:"Call to Terminate failed because it was made before the call to Initialize."},113:{basicMessage:"Termination After Termination",detailMessage:"Call to Terminate failed because Terminate was already called."},122:{basicMessage:"Retrieve Data Before Initialization",detailMessage:"Call to GetValue failed because it was made before the call to Initialize."},123:{basicMessage:"Retrieve Data After Termination",detailMessage:"Call to GetValue failed because it was made after the call to Terminate."},132:{basicMessage:"Store Data Before Initialization",detailMessage:"Call to SetValue failed because it was made before the call to Initialize."},133:{basicMessage:"Store Data After Termination",detailMessage:"Call to SetValue failed because it was made after the call to Terminate."},142:{basicMessage:"Commit Before Initialization",detailMessage:"Call to Commit failed because it was made before the call to Initialize."},143:{basicMessage:"Commit After Termination",detailMessage:"Call to Commit failed because it was made after the call to Terminate."},201:{basicMessage:"General Argument Error",detailMessage:"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument."},301:{basicMessage:"General Get Failure",detailMessage:"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},351:{basicMessage:"General Set Failure",detailMessage:"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},391:{basicMessage:"General Commit Failure",detailMessage:"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information."},401:{basicMessage:"Undefined Data Model Element",detailMessage:"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element."},402:{basicMessage:"Unimplemented Data Model Element",detailMessage:"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant."},403:{basicMessage:"Data Model Element Value Not Initialized",detailMessage:"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO."},404:{basicMessage:"Data Model Element Is Read Only",detailMessage:"SetValue was called with a data model element that can only be read."},405:{basicMessage:"Data Model Element Is Write Only",detailMessage:"GetValue was called on a data model element that can only be written to."},406:{basicMessage:"Data Model Element Type Mismatch",detailMessage:"SetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Data Model Element Value Out Of Range",detailMessage:"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}}};t.A=o},56:function(e,t,i){var r,n,o;i.d(t,{YE:function(){return n},lC:function(){return o}}),function(e){e.unknown="unknown",e.true="true",e.false="false"}(r||(r={})),function(e){e.passed="passed",e.failed="failed",e.unknown="unknown"}(n||(n={})),function(e){e.completed="completed",e.incomplete="incomplete",e.unknown="unknown"}(o||(o={}))},797:function(e,t,i){var r=i(635),n={GENERAL:101,INITIALIZATION_FAILED:101,INITIALIZED:101,TERMINATED:101,TERMINATION_FAILURE:101,TERMINATION_BEFORE_INIT:101,MULTIPLE_TERMINATION:101,RETRIEVE_BEFORE_INIT:101,RETRIEVE_AFTER_TERM:101,STORE_BEFORE_INIT:101,STORE_AFTER_TERM:101,COMMIT_BEFORE_INIT:101,COMMIT_AFTER_TERM:101,ARGUMENT_ERROR:101,CHILDREN_ERROR:101,COUNT_ERROR:101,GENERAL_GET_FAILURE:101,GENERAL_SET_FAILURE:101,GENERAL_COMMIT_FAILURE:101,UNDEFINED_DATA_MODEL:101,UNIMPLEMENTED_ELEMENT:101,VALUE_NOT_INITIALIZED:101,INVALID_SET_VALUE:101,READ_ONLY_ELEMENT:101,WRITE_ONLY_ELEMENT:101,TYPE_MISMATCH:101,VALUE_OUT_OF_RANGE:101,DEPENDENCY_NOT_ESTABLISHED:101},o={scorm12:(0,r.Cl)((0,r.Cl)({},n),{RETRIEVE_BEFORE_INIT:301,STORE_BEFORE_INIT:301,COMMIT_BEFORE_INIT:301,ARGUMENT_ERROR:201,CHILDREN_ERROR:202,COUNT_ERROR:203,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:401,VALUE_NOT_INITIALIZED:301,INVALID_SET_VALUE:402,READ_ONLY_ELEMENT:403,WRITE_ONLY_ELEMENT:404,TYPE_MISMATCH:405,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408}),scorm2004:(0,r.Cl)((0,r.Cl)({},n),{INITIALIZATION_FAILED:102,INITIALIZED:103,TERMINATED:104,TERMINATION_FAILURE:111,TERMINATION_BEFORE_INIT:112,MULTIPLE_TERMINATIONS:113,RETRIEVE_BEFORE_INIT:122,RETRIEVE_AFTER_TERM:123,STORE_BEFORE_INIT:132,STORE_AFTER_TERM:133,COMMIT_BEFORE_INIT:142,COMMIT_AFTER_TERM:143,ARGUMENT_ERROR:201,GENERAL_GET_FAILURE:301,GENERAL_SET_FAILURE:351,GENERAL_COMMIT_FAILURE:391,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:402,VALUE_NOT_INITIALIZED:403,READ_ONLY_ELEMENT:404,WRITE_ONLY_ELEMENT:405,TYPE_MISMATCH:406,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408})};t.A=o},417:function(e,t,i){var r=i(635),n={CMIString256:"^.{0,255}$",CMIString4096:"^.{0,4096}$",CMITime:"^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",CMITimespan:"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{0,3})(.[0-9]*)?$",CMIIdentifier:"^[\\u0021-\\u007E\\s]{0,255}$",CMIFeedback:"^.{0,255}$",CMIIndex:"[._](\\d+).",CMIStatus:"^(passed|completed|failed|incomplete|browsed)$",CMIStatus2:"^(passed|completed|failed|incomplete|browsed|not attempted)$",CMIExit:"^(time-out|suspend|logout|)$",CMIType:"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$",CMIResult:"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$",NAVEvent:"^(previous|continue)$",score_range:"0#100",audio_range:"-1#100",speed_range:"-100#100",weighting_range:"-100#100",text_range:"-1#1"},o={aicc:(0,r.Cl)((0,r.Cl)({},n),{CMIIdentifier:"^\\w{1,255}$"}),scorm12:n,scorm2004:{CMIString200:"^[\\u0000-\\uFFFF]{0,200}$",CMIString250:"^[\\u0000-\\uFFFF]{0,250}$",CMIString1000:"^[\\u0000-\\uFFFF]{0,1000}$",CMIString4000:"^[\\u0000-\\uFFFF]{0,4000}$",CMIString64000:"^[\\u0000-\\uFFFF]{0,64000}$",CMILang:"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$",CMILangString250:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$",CMILangcr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$",CMILangString250cr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$",CMILangString4000:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$",CMITime:"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$",CMITimespan:"^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{1,5})(\\.[0-9]{1,18})?$",CMIIdentifier:"^\\S{1,250}[a-zA-Z0-9]$",CMIShortIdentifier:"^[\\w\\.\\-\\_]{1,250}$",CMILongIdentifier:"^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$",CMIFeedback:"^.*$",CMIIndex:"[._](\\d+).",CMIIndexStore:".N(\\d+).",CMICStatus:"^(completed|incomplete|not attempted|unknown)$",CMISStatus:"^(passed|failed|unknown)$",CMIExit:"^(time-out|suspend|logout|normal)$",CMIType:"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",CMIResult:"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",NAVEvent:"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$",NAVBoolean:"^(unknown|true|false$)",NAVTarget:"^{target=\\S{0,}[a-zA-Z0-9-_]+}$",scaled_range:"-1#1",audio_range:"0#*",speed_range:"0#*",text_range:"-1#1",progress_range:"0#1"}};t.A=o},784:function(e,t,i){i.d(t,{$h:function(){return c},gv:function(){return _},tQ:function(){return u},yI:function(){return l}});var r=i(635),n=i(340),o=n.A.scorm12.error_descriptions,s=n.A.aicc.error_descriptions,a=n.A.scorm2004.error_descriptions,c=function(e){function t(t){var i=e.call(this,t.toString())||this;return i._errorCode=t,i.name="ScormValidationError",i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"errorCode",{get:function(){return this._errorCode},enumerable:!1,configurable:!0}),t.prototype.setMessage=function(e){this.message=e},t}(Error),l=function(e){function t(t,i,r){var n=e.call(this,t)||this;return n._detailedMessage="",n.setMessage(i),n._errorMessage=i,r&&(n._detailedMessage=r),n}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"errorMessage",{get:function(){return this._errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"detailedMessage",{get:function(){return this._detailedMessage},enumerable:!1,configurable:!0}),t}(c),u=function(e){function t(t){return{}.hasOwnProperty.call(o,String(t))?e.call(this,t,o[String(t)].basicMessage,o[String(t)].detailMessage)||this:e.call(this,101,o[101].basicMessage,o[101].detailMessage)||this}return(0,r.C6)(t,e),t}(l),_=function(e){function t(t){return{}.hasOwnProperty.call(s,String(t))?e.call(this,t,s[String(t)].basicMessage,s[String(t)].detailMessage)||this:e.call(this,101,s[101].basicMessage,s[101].detailMessage)||this}return(0,r.C6)(t,e),t}(l);!function(e){function t(t){return{}.hasOwnProperty.call(a,String(t))?e.call(this,t,a[String(t)].basicMessage,a[String(t)].detailMessage)||this:e.call(this,101,a[101].basicMessage,a[101].detailMessage)||this}(0,r.C6)(t,e)}(l)},864:function(e,t,i){i.d(t,{Bq:function(){return a},HT:function(){return s},J6:function(){return _},UZ:function(){return n},f4:function(){return o},hw:function(){return u},sB:function(){return c}});var r=3600;function n(e){if(!e||e<=0)return"00:00:00";var t=Math.floor(e/r),i=new Date(1e3*e),n=i.getUTCMinutes(),o=i.getSeconds(),s=e%1,a="";return l(s)>0&&(a="."+(a=l(s)>2?s.toFixed(2):String(s)).split(".")[1]),(t+":"+n+":"+o).replace(/\b\d\b/g,"0$&")+a}function o(e,t){if("number"!=typeof e&&"boolean"!=typeof e||(e=String(e)),"string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var i=e.split(":");return 3600*Number(i[0])+60*Number(i[1])+Number(i[2])}function s(e,t,i){return"string"==typeof i&&(i=new RegExp(i)),n(o(e,i)+o(t,i))}function a(e){var t={};return function e(i,r){if(Object(i)!==i)t[r]=i;else if(Array.isArray(i))for(var n=0,o=i.length;n0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1] {\n if (typeof response !== \"undefined\") {\n const httpResult = JSON.parse(await response.text());\n if (\n httpResult === null ||\n !{}.hasOwnProperty.call(httpResult, \"result\")\n ) {\n if (response.status === 200) {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n }\n } else {\n return {\n result: httpResult.result,\n errorCode: httpResult.errorCode\n ? httpResult.errorCode\n : httpResult.result === APIConstants.global.SCORM_TRUE\n ? 0\n : 101,\n };\n }\n }\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n },\n requestHandler: function (commitObject) {\n return commitObject;\n },\n onLogMessage: function (messageLevel, logMessage) {\n switch (messageLevel) {\n case APIConstants.global.LOG_LEVEL_ERROR:\n console.error(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_WARNING:\n console.warn(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_INFO:\n console.info(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_DEBUG:\n if (console.debug) {\n console.debug(logMessage);\n } else {\n console.log(logMessage);\n }\n break;\n }\n },\n scoItemIds: [],\n scoItemIdValidator: false,\n};\n","import BaseAPI from \"../BaseAPI\";\n\n/**\n * Private class that wraps a timeout call to the commit() function\n */\nexport class ScheduledCommit {\n private _API;\n private _cancelled = false;\n private readonly _timeout;\n private readonly _callback;\n\n /**\n * Constructor for ScheduledCommit\n * @param {BaseAPI} API\n * @param {number} when\n * @param {string} callback\n */\n constructor(API: BaseAPI, when: number, callback: string) {\n this._API = API;\n this._timeout = setTimeout(this.wrapper.bind(this), when);\n this._callback = callback;\n }\n\n /**\n * Cancel any currently scheduled commit\n */\n cancel() {\n this._cancelled = true;\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n }\n\n /**\n * Wrap the API commit call to check if the call has already been cancelled\n */\n wrapper() {\n if (!this._cancelled) {\n (async () => await this._API.commit(this._callback))();\n }\n }\n}\n","import { CMIArray } from \"./cmi/common/array\";\nimport { ValidationError } from \"./exceptions\";\nimport ErrorCodes, { ErrorCode } from \"./constants/error_codes\";\nimport APIConstants from \"./constants/api_constants\";\nimport { formatMessage, stringMatches, unflatten } from \"./utilities\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { debounce } from \"./utilities/debounce\";\nimport {\n RefObject,\n CommitObject,\n ResultObject,\n Settings,\n} from \"./types/api_types\";\nimport { DefaultSettings } from \"./constants/default_settings\";\nimport { IBaseAPI } from \"./interfaces/IBaseAPI\";\nimport { ScheduledCommit } from \"./helpers/scheduled_commit\";\n\n/**\n * Base API class for AICC, SCORM 1.2, and SCORM 2004. Should be considered\n * abstract, and never initialized on its own.\n */\nexport default abstract class BaseAPI implements IBaseAPI {\n private _timeout?: ScheduledCommit;\n private readonly _error_codes: ErrorCode;\n private _settings: Settings = DefaultSettings;\n\n /**\n * Constructor for Base API class. Sets some shared API fields, as well as\n * sets up options for the API.\n * @param {ErrorCode} error_codes\n * @param {Settings} settings\n */\n protected constructor(error_codes: ErrorCode, settings?: Settings) {\n if (new.target === BaseAPI) {\n throw new TypeError(\"Cannot construct BaseAPI instances directly\");\n }\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n\n this._error_codes = error_codes;\n\n if (settings) {\n this.settings = settings;\n }\n this.apiLogLevel = this.settings.logLevel;\n this.selfReportSessionTime = this.settings.selfReportSessionTime;\n }\n\n public abstract cmi: BaseCMI;\n public startingData?: RefObject;\n\n public currentState: number;\n public lastErrorCode: string;\n public listenerArray: any[];\n public apiLogLevel: number;\n public selfReportSessionTime: boolean;\n\n abstract reset(settings?: Settings): void;\n\n /**\n * Common reset method for all APIs. New settings are merged with the existing settings.\n * @param {Settings} settings\n * @protected\n */\n commonReset(settings?: Settings): void {\n this.settings = { ...this.settings, ...settings };\n\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n }\n\n /**\n * Initialize the API\n * @param {string} callbackName\n * @param {string} initializeMessage\n * @param {string} terminationMessage\n * @return {string}\n */\n initialize(\n callbackName: string,\n initializeMessage?: string,\n terminationMessage?: string,\n ): string {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);\n } else if (this.isTerminated()) {\n this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage);\n } else {\n if (this.selfReportSessionTime) {\n this.cmi.setStartTime();\n }\n\n this.currentState = APIConstants.global.STATE_INITIALIZED;\n this.lastErrorCode = \"0\";\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n abstract lmsInitialize(): string;\n\n abstract lmsFinish(): string;\n\n abstract lmsGetValue(CMIElement: string): string;\n\n abstract lmsSetValue(CMIElement: string, value: any): string;\n\n abstract lmsCommit(): string;\n\n abstract lmsGetLastError(): string;\n\n abstract lmsGetErrorString(CMIErrorCode: string | number): string;\n\n abstract lmsGetDiagnostic(CMIErrorCode: string | number): string;\n\n /**\n * Abstract method for validating that a response is correct.\n *\n * @param {string} _CMIElement\n * @param {any} _value\n */\n abstract validateCorrectResponse(_CMIElement: string, _value: any): void;\n\n /**\n * Gets or builds a new child element to add to the array.\n * APIs that inherit BaseAPI should override this method.\n *\n * @param {string} _CMIElement - unused\n * @param {*} _value - unused\n * @param {boolean} _foundFirstIndex - unused\n * @return {BaseCMI|null}\n * @abstract\n */\n abstract getChildElement(\n _CMIElement: string,\n _value: any,\n _foundFirstIndex: boolean,\n ): BaseCMI | null;\n\n /**\n * Attempts to store the data to the LMS, logs data if no LMS configured\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _calculateTotalTime\n * @return {ResultObject}\n * @abstract\n */\n abstract storeData(_calculateTotalTime: boolean): Promise;\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _terminateCommit\n * @return {RefObject|Array}\n * @abstract\n */\n abstract renderCommitCMI(_terminateCommit: boolean): RefObject | Array;\n\n /**\n * Render the commit object to the shortened format for LMS commit\n * @param {boolean} _terminateCommit\n * @return {CommitObject}\n */\n abstract renderCommitObject(_terminateCommit: boolean): CommitObject;\n\n /**\n * Logging for all SCORM actions\n *\n * @param {string} functionName\n * @param {string} logMessage\n * @param {number} messageLevel\n * @param {string} CMIElement\n */\n apiLog(\n functionName: string,\n logMessage: string,\n messageLevel: number,\n CMIElement?: string,\n ) {\n logMessage = formatMessage(functionName, logMessage, CMIElement);\n\n if (messageLevel >= this.apiLogLevel) {\n this.settings.onLogMessage(messageLevel, logMessage);\n }\n }\n\n /**\n * Getter for _error_codes\n * @return {ErrorCode}\n */\n get error_codes(): ErrorCode {\n return this._error_codes;\n }\n\n /**\n * Getter for _settings\n * @return {Settings}\n */\n get settings(): Settings {\n return this._settings;\n }\n\n /**\n * Setter for _settings\n * @param {Settings} settings\n */\n set settings(settings: Settings) {\n this._settings = { ...this._settings, ...settings };\n }\n\n /**\n * Terminates the current run of the API\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async terminate(\n callbackName: string,\n checkTerminated: boolean,\n ): Promise {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.TERMINATION_BEFORE_INIT,\n this._error_codes.MULTIPLE_TERMINATION,\n )\n ) {\n this.currentState = APIConstants.global.STATE_TERMINATED;\n\n const result: ResultObject = await this.storeData(true);\n if (typeof result.errorCode !== \"undefined\" && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Get the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @return {string}\n */\n getValue(\n callbackName: string,\n checkTerminated: boolean,\n CMIElement: string,\n ): string {\n let returnValue: string = \"\";\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.RETRIEVE_BEFORE_INIT,\n this._error_codes.RETRIEVE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.getCMIValue(CMIElement);\n } catch (e) {\n returnValue = this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement);\n }\n\n this.apiLog(\n callbackName,\n \": returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n\n if (returnValue === undefined) {\n return \"\";\n }\n\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Sets the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {string} commitCallback\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setValue(\n callbackName: string,\n commitCallback: string,\n checkTerminated: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (value !== undefined) {\n value = String(value);\n }\n let returnValue: string = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.STORE_BEFORE_INIT,\n this._error_codes.STORE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.setCMIValue(CMIElement, value);\n } catch (e) {\n this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement, value);\n }\n\n if (returnValue === undefined) {\n returnValue = APIConstants.global.SCORM_FALSE;\n }\n\n // If we didn't have any errors while setting the data, go ahead and\n // schedule a commit, if autocommit is turned on\n if (String(this.lastErrorCode) === \"0\") {\n if (this.settings.autocommit && !this._timeout) {\n this.scheduleCommit(\n this.settings.autocommitSeconds * 1000,\n commitCallback,\n );\n }\n }\n\n this.apiLog(\n callbackName,\n \": \" + value + \": result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Orders LMS to store all content parameters\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async commit(\n callbackName: string,\n checkTerminated: boolean = false,\n ): Promise {\n this.clearScheduledCommit();\n\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.COMMIT_BEFORE_INIT,\n this._error_codes.COMMIT_AFTER_TERM,\n )\n ) {\n const result = await this.storeData(false);\n if (result.errorCode && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n this.apiLog(\n callbackName,\n \" Result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"HttpRequest\",\n );\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Returns last error code\n * @param {string} callbackName\n * @return {string}\n */\n getLastError(callbackName: string): string {\n const returnValue = String(this.lastErrorCode);\n\n this.processListeners(callbackName);\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getErrorString(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getDiagnostic(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Checks the LMS state and ensures it has been initialized.\n *\n * @param {boolean} checkTerminated\n * @param {number} beforeInitError\n * @param {number} afterTermError\n * @return {boolean}\n */\n checkState(\n checkTerminated: boolean,\n beforeInitError: number,\n afterTermError: number,\n ): boolean {\n if (this.isNotInitialized()) {\n this.throwSCORMError(beforeInitError);\n return false;\n } else if (checkTerminated && this.isTerminated()) {\n this.throwSCORMError(afterTermError);\n return false;\n }\n\n return true;\n }\n\n /**\n * Returns the message that corresponds to errorNumber\n * APIs that inherit BaseAPI should override this function\n *\n * @param {(string|number)} _errorNumber\n * @param {boolean} _detail\n * @return {string}\n * @abstract\n */\n getLmsErrorMessageDetails(\n _errorNumber: string | number,\n _detail: boolean = false,\n ): string {\n throw new Error(\n \"The getLmsErrorMessageDetails method has not been implemented\",\n );\n }\n\n /**\n * Gets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @return {string}\n * @abstract\n */\n getCMIValue(_CMIElement: string): string {\n throw new Error(\"The getCMIValue method has not been implemented\");\n }\n\n /**\n * Sets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @param {any} _value\n * @return {string}\n * @abstract\n */\n setCMIValue(_CMIElement: string, _value: any): string {\n throw new Error(\"The setCMIValue method has not been implemented\");\n }\n\n /**\n * Shared API method to set a valid for a given element.\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n _commonSetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (!CMIElement || CMIElement === \"\") {\n return APIConstants.global.SCORM_FALSE;\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let returnValue = APIConstants.global.SCORM_FALSE;\n let foundFirstIndex = false;\n\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n const attribute = structure[idx];\n\n if (idx === structure.length - 1) {\n if (scorm2004 && attribute.substring(0, 8) === \"{target=\") {\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);\n } else {\n refObject = {\n ...refObject,\n attribute: value,\n };\n }\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (\n stringMatches(CMIElement, \"\\\\.correct_responses\\\\.\\\\d+\") &&\n this.isInitialized()\n ) {\n this.validateCorrectResponse(CMIElement, value);\n }\n\n if (!scorm2004 || this.lastErrorCode === \"0\") {\n refObject[attribute] = value;\n returnValue = APIConstants.global.SCORM_TRUE;\n }\n }\n } else {\n refObject = refObject[attribute];\n if (!refObject) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n foundFirstIndex = true;\n } else {\n const newChild = this.getChildElement(\n CMIElement,\n value,\n foundFirstIndex,\n );\n foundFirstIndex = true;\n\n if (!newChild) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (refObject.initialized) newChild.initialize();\n\n refObject.childArray.push(newChild);\n refObject = newChild;\n }\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n }\n\n if (returnValue === APIConstants.global.SCORM_FALSE) {\n this.apiLog(\n methodName,\n `There was an error setting the value for: ${CMIElement}, value of: ${value}`,\n APIConstants.global.LOG_LEVEL_WARNING,\n );\n }\n\n return returnValue;\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @return {any}\n */\n _commonGetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n ): any {\n if (!CMIElement || CMIElement === \"\") {\n return \"\";\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let attribute = null;\n\n const uninitializedErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) has not been initialized.`;\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n attribute = structure[idx];\n\n if (!scorm2004) {\n if (idx === structure.length - 1) {\n if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n } else {\n if (\n String(attribute).substring(0, 8) === \"{target=\" &&\n typeof refObject._isTargetValid == \"function\"\n ) {\n const target = String(attribute).substring(\n 8,\n String(attribute).length - 9,\n );\n return refObject._isTargetValid(target);\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n\n refObject = refObject[attribute];\n if (refObject === undefined) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n } else {\n this.throwSCORMError(\n this._error_codes.VALUE_NOT_INITIALIZED,\n uninitializedErrorMessage,\n );\n break;\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n\n if (refObject === null || refObject === undefined) {\n if (!scorm2004) {\n if (attribute === \"_children\") {\n this.throwSCORMError(ErrorCodes.scorm12.CHILDREN_ERROR);\n } else if (attribute === \"_count\") {\n this.throwSCORMError(ErrorCodes.scorm12.COUNT_ERROR);\n }\n }\n } else {\n return refObject;\n }\n }\n\n /**\n * Returns true if the API's current state is STATE_INITIALIZED\n *\n * @return {boolean}\n */\n isInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_NOT_INITIALIZED\n *\n * @return {boolean}\n */\n isNotInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_NOT_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_TERMINATED\n *\n * @return {boolean}\n */\n isTerminated(): boolean {\n return this.currentState === APIConstants.global.STATE_TERMINATED;\n }\n\n /**\n * Provides a mechanism for attaching to a specific SCORM event\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n on(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray.push({\n functionName: functionName,\n CMIElement: CMIElement,\n callback: callback,\n });\n\n this.apiLog(\n \"on\",\n `Added event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n\n /**\n * Provides a mechanism for detaching a specific SCORM event listener\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n off(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n const removeIndex = this.listenerArray.findIndex(\n (obj) =>\n obj.functionName === functionName &&\n obj.CMIElement === CMIElement &&\n obj.callback === callback,\n );\n if (removeIndex !== -1) {\n this.listenerArray.splice(removeIndex, 1);\n this.apiLog(\n \"off\",\n `Removed event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n }\n\n /**\n * Provides a mechanism for clearing all listeners from a specific SCORM event\n *\n * @param {string} listenerName\n */\n clear(listenerName: string) {\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray = this.listenerArray.filter(\n (obj) =>\n obj.functionName !== functionName && obj.CMIElement !== CMIElement,\n );\n }\n }\n\n /**\n * Processes any 'on' listeners that have been created\n *\n * @param {string} functionName\n * @param {string} CMIElement\n * @param {any} value\n */\n processListeners(functionName: string, CMIElement?: string, value?: any) {\n this.apiLog(\n functionName,\n value,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n for (let i = 0; i < this.listenerArray.length; i++) {\n const listener = this.listenerArray[i];\n const functionsMatch = listener.functionName === functionName;\n const listenerHasCMIElement = !!listener.CMIElement;\n let CMIElementsMatch = false;\n if (\n CMIElement &&\n listener.CMIElement &&\n listener.CMIElement.substring(listener.CMIElement.length - 1) === \"*\"\n ) {\n CMIElementsMatch =\n CMIElement.indexOf(\n listener.CMIElement.substring(0, listener.CMIElement.length - 1),\n ) === 0;\n } else {\n CMIElementsMatch = listener.CMIElement === CMIElement;\n }\n\n if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {\n this.apiLog(\n \"processListeners\",\n `Processing listener: ${listener.functionName}`,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n listener.callback(CMIElement, value);\n }\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} errorNumber\n * @param {string} message\n */\n throwSCORMError(errorNumber: number, message?: string) {\n if (!message) {\n message = this.getLmsErrorMessageDetails(errorNumber);\n }\n\n this.apiLog(\n \"throwSCORMError\",\n errorNumber + \": \" + message,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n\n this.lastErrorCode = String(errorNumber);\n }\n\n /**\n * Clears the last SCORM error code on success.\n *\n * @param {string} success\n */\n clearSCORMError(success: string) {\n if (success !== undefined && success !== APIConstants.global.SCORM_FALSE) {\n this.lastErrorCode = \"0\";\n }\n }\n\n /**\n * Load the CMI from a flattened JSON object\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromFlattenedJSON(json: RefObject, CMIElement?: string) {\n if (!CMIElement) {\n // by default, we start from a blank string because we're expecting each element to start with `cmi`\n CMIElement = \"\";\n }\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromFlattenedJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n /**\n * Tests two strings against a given regular expression pattern and determines a numeric or null result based on the matching criterion.\n *\n * @param {string} a - The first string to be tested against the pattern.\n * @param {string} c - The second string to be tested against the pattern.\n * @param {RegExp} a_pattern - The regular expression pattern to test the strings against.\n * @return {number | null} A numeric result based on the matching criterion, or null if the strings do not match the pattern.\n */\n function testPattern(\n a: string,\n c: string,\n a_pattern: RegExp,\n ): number | null {\n const a_match = a.match(a_pattern);\n\n let c_match;\n if (a_match !== null && (c_match = c.match(a_pattern)) !== null) {\n const a_num = Number(a_match[2]);\n const c_num = Number(c_match[2]);\n if (a_num === c_num) {\n if (a_match[3] === \"id\") {\n return -1;\n } else if (a_match[3] === \"type\") {\n if (c_match[3] === \"id\") {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 1;\n }\n }\n return a_num - c_num;\n }\n\n return null;\n }\n\n const int_pattern = /^(cmi\\.interactions\\.)(\\d+)\\.(.*)$/;\n const obj_pattern = /^(cmi\\.objectives\\.)(\\d+)\\.(.*)$/;\n\n const result = Object.keys(json).map(function (key) {\n return [String(key), json[key]];\n });\n\n // CMI interactions need to have id and type loaded before any other fields\n result.sort(function ([a, _b], [c, _d]) {\n let test;\n if ((test = testPattern(a, c, int_pattern)) !== null) {\n return test;\n }\n if ((test = testPattern(a, c, obj_pattern)) !== null) {\n return test;\n }\n\n if (a < c) {\n return -1;\n }\n if (a > c) {\n return 1;\n }\n return 0;\n });\n\n let obj: RefObject;\n result.forEach((element) => {\n obj = {};\n obj[element[0]] = element[1];\n this.loadFromJSON(unflatten(obj), CMIElement);\n });\n }\n\n /**\n * Loads CMI data from a JSON object.\n *\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromJSON(json: RefObject, CMIElement: string) {\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n CMIElement = CMIElement !== undefined ? CMIElement : \"cmi\";\n\n this.startingData = json;\n\n // could this be refactored down to flatten(json) then setCMIValue on each?\n for (const key in json) {\n if ({}.hasOwnProperty.call(json, key) && json[key]) {\n const currentCMIElement = (CMIElement ? CMIElement + \".\" : \"\") + key;\n const value = json[key];\n\n if (value[\"childArray\"]) {\n for (let i = 0; i < value[\"childArray\"].length; i++) {\n this.loadFromJSON(\n value[\"childArray\"][i],\n currentCMIElement + \".\" + i,\n );\n }\n } else if (value.constructor === Object) {\n this.loadFromJSON(value, currentCMIElement);\n } else {\n this.setCMIValue(currentCMIElement, value);\n }\n }\n }\n }\n\n /**\n * Render the CMI object to JSON for sending to an LMS.\n *\n * @return {string}\n */\n renderCMIToJSONString(): string {\n const cmi = this.cmi;\n // Do we want/need to return fields that have no set value?\n if (this.settings.sendFullCommit) {\n return JSON.stringify({ cmi });\n }\n return JSON.stringify({ cmi }, (k, v) => (v === undefined ? null : v), 2);\n }\n\n /**\n * Returns a JS object representing the current cmi\n * @return {object}\n */\n renderCMIToJSONObject(): object {\n return JSON.parse(this.renderCMIToJSONString());\n }\n\n /**\n * Send the request to the LMS\n * @param {string} url\n * @param {CommitObject|RefObject|Array} params\n * @param {boolean} immediate\n * @return {ResultObject}\n */\n async processHttpRequest(\n url: string,\n params: CommitObject | RefObject | Array,\n immediate: boolean = false,\n ): Promise {\n const api = this;\n const genericError: ResultObject = {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: this.error_codes.GENERAL,\n };\n\n // if we are terminating the module or closing the browser window/tab, we need to make this fetch ASAP.\n // Some browsers, especially Chrome, do not like synchronous requests to be made when the window is closing.\n if (immediate) {\n this.performFetch(url, params).then(async (response) => {\n await this.transformResponse(response);\n });\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n\n const process = async (\n url: string,\n params: CommitObject | RefObject | Array,\n settings: Settings,\n ): Promise => {\n try {\n params = settings.requestHandler(params);\n const response = await this.performFetch(url, params);\n\n return this.transformResponse(response);\n } catch (e) {\n this.apiLog(\n \"processHttpRequest\",\n e,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n api.processListeners(\"CommitError\");\n return genericError;\n }\n };\n\n if (this.settings.asyncCommit) {\n const debouncedProcess = debounce(process, 500, immediate);\n debouncedProcess(url, params, this.settings);\n\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return await process(url, params, this.settings);\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} when - the number of milliseconds to wait before committing\n * @param {string} callback - the name of the commit event callback\n */\n scheduleCommit(when: number, callback: string) {\n this._timeout = new ScheduledCommit(this, when, callback);\n this.apiLog(\n \"scheduleCommit\",\n \"scheduled\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n\n /**\n * Clears and cancels any currently scheduled commits\n */\n clearScheduledCommit() {\n if (this._timeout) {\n this._timeout.cancel();\n this._timeout = undefined;\n this.apiLog(\n \"clearScheduledCommit\",\n \"cleared\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n }\n\n /**\n * Check to see if the specific object has the given property\n * @param {RefObject} refObject\n * @param {string} attribute\n * @return {boolean}\n * @private\n */\n private _checkObjectHasProperty(\n refObject: RefObject,\n attribute: string,\n ): boolean {\n return (\n Object.hasOwnProperty.call(refObject, attribute) ||\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(refObject),\n attribute,\n ) != null ||\n attribute in refObject\n );\n }\n\n /**\n * Handles the error that occurs when trying to access a value\n * @param {any} e\n * @param {string} returnValue\n * @return {string}\n * @private\n */\n private handleValueAccessException(e: any, returnValue: string): string {\n if (e instanceof ValidationError) {\n this.lastErrorCode = String(e.errorCode);\n returnValue = APIConstants.global.SCORM_FALSE;\n } else {\n if (e instanceof Error && e.message) {\n console.error(e.message);\n } else {\n console.error(e);\n }\n this.throwSCORMError(this._error_codes.GENERAL);\n }\n return returnValue;\n }\n\n /**\n * Perform the fetch request to the LMS\n * @param {string} url\n * @param {RefObject|Array} params\n * @return {Promise}\n * @private\n */\n private async performFetch(\n url: string,\n params: RefObject | Array,\n ): Promise {\n return fetch(url, {\n method: \"POST\",\n body: params instanceof Array ? params.join(\"&\") : JSON.stringify(params),\n headers: {\n ...this.settings.xhrHeaders,\n \"Content-Type\": this.settings.commitRequestDataType,\n },\n credentials: this.settings.xhrWithCredentials ? \"include\" : undefined,\n keepalive: true,\n });\n }\n\n /**\n * Transforms the response from the LMS to a ResultObject\n * @param {Response} response\n * @return {Promise}\n * @private\n */\n private async transformResponse(response: Response): Promise {\n const result =\n typeof this.settings.responseHandler === \"function\"\n ? await this.settings.responseHandler(response)\n : await response.json();\n\n if (\n response.status >= 200 &&\n response.status <= 299 &&\n (result.result === true ||\n result.result === APIConstants.global.SCORM_TRUE)\n ) {\n this.processListeners(\"CommitSuccess\");\n } else {\n this.processListeners(\"CommitError\");\n }\n return result;\n }\n}\n","/**\n * Debounce function to delay the execution of a given function.\n *\n * @param func - The function to debounce.\n * @param wait - The number of milliseconds to delay.\n * @param immediate - If `true`, the function will be triggered on the leading edge instead of the trailing.\n * @returns A debounced version of the provided function.\n */\nexport function debounce void>(\n func: T,\n wait: number,\n immediate = false,\n): (...args: Parameters) => void {\n let timeout: ReturnType | null;\n\n return function (this: any, ...args: Parameters) {\n const context = this;\n\n const later = () => {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n const callNow = immediate && !timeout;\n\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) func.apply(context, args);\n };\n}\n","import { CMI } from \"./cmi/scorm12/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMIObjectivesObject } from \"./cmi/scorm12/objectives\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm12/interactions\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport Regex from \"./constants/regex\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\nimport BaseAPI from \"./BaseAPI\";\n\n/**\n * API class for SCORM 1.2\n */\nclass Scorm12Impl extends BaseAPI {\n /**\n * Constructor for SCORM 1.2 API\n * @param {object} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm12, settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n\n // Rename functions to match 1.2 Spec and expose to modules\n this.LMSInitialize = this.lmsInitialize;\n this.LMSFinish = this.lmsFinish;\n this.LMSGetValue = this.lmsGetValue;\n this.LMSSetValue = this.lmsSetValue;\n this.LMSCommit = this.lmsCommit;\n this.LMSGetLastError = this.lmsGetLastError;\n this.LMSGetErrorString = this.lmsGetErrorString;\n this.LMSGetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public statusSetByModule = false;\n\n cmi: CMI;\n nav: NAV;\n\n LMSInitialize: () => string;\n LMSFinish: () => string;\n LMSGetValue: (CMIElement: string) => string;\n LMSSetValue: (CMIElement: string, value: any) => string;\n LMSCommit: () => string;\n LMSGetLastError: () => string;\n LMSGetErrorString: (CMIErrorCode: string) => string;\n LMSGetDiagnostic: (CMIErrorCode: string) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * lmsInitialize function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n if (this.cmi.core.lesson_status) {\n this.statusSetByModule = true;\n } else {\n this.cmi.core.lesson_status = \"not attempted\";\n }\n return this.initialize(\n \"LMSInitialize\",\n \"LMS was already initialized!\",\n \"LMS is already finished!\",\n );\n }\n\n /**\n * LMSFinish function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"LMSFinish\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.nav.event !== \"\") {\n if (this.nav.event === \"continue\") {\n this.processListeners(\"SequenceNext\");\n } else {\n this.processListeners(\"SequencePrevious\");\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * LMSGetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n return this.getValue(\"LMSGetValue\", false, CMIElement);\n }\n\n /**\n * LMSSetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n if (CMIElement === \"cmi.core.lesson_status\") {\n this.statusSetByModule = true;\n }\n return this.setValue(\"LMSSetValue\", \"LMSCommit\", false, CMIElement, value);\n }\n\n /**\n * LMSCommit function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"LMSCommit\", false);\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * LMSGetLastError function from SCORM 1.2 Spec\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"LMSGetLastError\");\n }\n\n /**\n * LMSGetErrorString function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string): string {\n return this.getErrorString(\"LMSGetErrorString\", CMIErrorCode);\n }\n\n /**\n * LMSGetDiagnostic function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string): string {\n return this.getDiagnostic(\"LMSGetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"LMSSetValue\", false, CMIElement, value);\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"getCMIValue\", false, CMIElement);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {*} _value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n _value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsCorrectResponsesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObjectivesObject();\n } else if (\n !foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObject();\n }\n\n return null;\n }\n\n /**\n * Validates Correct Response values\n *\n * @param {string} _CMIElement\n * @param {*} _value\n */\n validateCorrectResponse(_CMIElement: string, _value: any) {\n // do nothing\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {number|string} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: number | string,\n detail: boolean,\n ): string {\n let basicMessage = \"No Error\";\n let detailMessage = \"No Error\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm12.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {Scorm12Impl} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm12Impl) {\n // Data Model\n this.cmi = newAPI.cmi;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeHHMMSS = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getTimeAsSeconds(\n totalTimeHHMMSS,\n Regex.scorm12.CMITimespan,\n );\n const lessonStatus = this.cmi.core.lesson_status;\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (lessonStatus) {\n completionStatus =\n lessonStatus === \"completed\" || lessonStatus === \"passed\"\n ? CompletionStatus.completed\n : CompletionStatus.incomplete;\n if (lessonStatus === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (lessonStatus === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.core.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n }\n\n const commitObject: CommitObject = {\n successStatus: successStatus,\n completionStatus: completionStatus,\n runtimeData: cmiExport,\n totalTimeSeconds: totalTimeSeconds,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n const originalStatus = this.cmi.core.lesson_status;\n if (\n !this.cmi.core.lesson_status ||\n (!this.statusSetByModule &&\n this.cmi.core.lesson_status === \"not attempted\")\n ) {\n this.cmi.core.lesson_status = \"completed\";\n }\n\n if (this.cmi.core.lesson_mode === \"normal\") {\n if (this.cmi.core.credit === \"credit\") {\n if (\n this.settings.mastery_override &&\n this.cmi.student_data.mastery_score !== \"\" &&\n this.cmi.core.score.raw !== \"\"\n ) {\n this.cmi.core.lesson_status =\n parseFloat(this.cmi.core.score.raw) >=\n parseFloat(this.cmi.student_data.mastery_score)\n ? \"passed\"\n : \"failed\";\n }\n }\n } else if (this.cmi.core.lesson_mode === \"browse\") {\n if (\n (this.startingData?.cmi?.core?.lesson_status || \"\") === \"\" &&\n originalStatus === \"not attempted\"\n ) {\n this.cmi.core.lesson_status = \"browsed\";\n }\n }\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n return await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n\nexport { Scorm12Impl };\n","import { BaseCMI } from \"./base_cmi\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.n objects\n */\nexport class CMIArray extends BaseCMI {\n private readonly _errorCode: number;\n private readonly _errorClass: typeof BaseScormValidationError;\n private readonly __children: string;\n childArray: any[];\n\n /**\n * Constructor cmi *.n arrays\n * @param {object} params\n */\n constructor(params: {\n children: string;\n errorCode?: number;\n errorClass?: typeof BaseScormValidationError;\n }) {\n super();\n this.__children = params.children;\n this._errorCode = params.errorCode || scorm12_error_codes.GENERAL;\n this._errorClass = params.errorClass || BaseScormValidationError;\n this.childArray = [];\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * Getter for _count\n * @return {number}\n */\n get _count(): number {\n return this.childArray.length;\n }\n\n /**\n * Setter for _count. Just throws an error.\n * @param {number} _count\n */\n set _count(_count: number) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * toJSON for *.n arrays\n * @return {object}\n */\n toJSON(): object {\n this.jsonString = true;\n const result: { [key: string]: any } = {};\n for (let i = 0; i < this.childArray.length; i++) {\n result[i + \"\"] = this.childArray[i];\n }\n delete this.jsonString;\n return result;\n }\n}\n","/**\n * Base class for API cmi objects\n */\nexport abstract class BaseCMI {\n jsonString? = false;\n private _initialized = false;\n private _start_time: number | undefined;\n\n /**\n * Getter for _initialized\n * @return {boolean}\n */\n get initialized(): boolean {\n return this._initialized;\n }\n\n /**\n * Getter for _start_time\n * @return {number | undefined}\n */\n get start_time(): number | undefined {\n return this._start_time;\n }\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize(): void {\n this._initialized = true;\n }\n\n /**\n * Called when the player should override the 'session_time' provided by\n * the module\n */\n setStartTime(): void {\n this._start_time = new Date().getTime();\n }\n}\n\n/**\n * Base class for cmi root objects\n */\nexport abstract class BaseRootCMI extends BaseCMI {\n abstract getCurrentTotalTime(): string;\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport { BaseCMI } from \"./base_cmi\";\nimport { checkValidFormat, checkValidRange } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nconst scorm12_constants = APIConstants.scorm12;\nconst scorm12_regex = Regex.scorm12;\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.score objects\n */\nexport class CMIScore extends BaseCMI {\n private readonly __children: string;\n private readonly __score_range: string | false;\n private readonly __invalid_error_code: number;\n private readonly __invalid_type_code: number;\n private readonly __invalid_range_code: number;\n private readonly __decimal_regex: string;\n private readonly __error_class: typeof BaseScormValidationError;\n private _raw = \"\";\n private _min = \"\";\n private _max: string;\n\n /**\n * Constructor for *.score\n * @param {\n * score_children: string,\n * score_range: string,\n * max: string,\n * invalidErrorCode: number,\n * invalidTypeCode: number,\n * invalidRangeCode: number,\n * decimalRegex: string,\n * errorClass: typeof BaseScormValidationError\n * } params\n */\n constructor(params: {\n score_children?: string;\n score_range?: string;\n max?: string;\n invalidErrorCode?: number;\n invalidTypeCode?: number;\n invalidRangeCode?: number;\n decimalRegex?: string;\n errorClass: typeof BaseScormValidationError;\n }) {\n super();\n\n this.__children = params.score_children || scorm12_constants.score_children;\n this.__score_range = !params.score_range\n ? false\n : scorm12_regex.score_range;\n this._max = params.max || params.max === \"\" ? params.max : \"100\";\n this.__invalid_error_code =\n params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE;\n this.__invalid_type_code =\n params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH;\n this.__invalid_range_code =\n params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE;\n this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;\n this.__error_class = params.errorClass;\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this.__error_class(this.__invalid_error_code);\n }\n\n /**\n * Getter for _raw\n * @return {string}\n */\n get raw(): string {\n return this._raw;\n }\n\n /**\n * Setter for _raw\n * @param {string} raw\n */\n set raw(raw: string) {\n if (\n checkValidFormat(\n raw,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n raw,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._raw = raw;\n }\n }\n\n /**\n * Getter for _min\n * @return {string}\n */\n get min(): string {\n return this._min;\n }\n\n /**\n * Setter for _min\n * @param {string} min\n */\n set min(min: string) {\n if (\n checkValidFormat(\n min,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n min,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._min = min;\n }\n }\n\n /**\n * Getter for _max\n * @return {string}\n */\n get max(): string {\n return this._max;\n }\n\n /**\n * Setter for _max\n * @param {string} max\n */\n set max(max: string) {\n if (\n checkValidFormat(\n max,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n max,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._max = max;\n }\n }\n\n /**\n * toJSON for *.score\n * @return {\n * {\n * min: string,\n * max: string,\n * raw: string\n * }\n * }\n */\n toJSON(): {\n min: string;\n max: string;\n raw: string;\n } {\n this.jsonString = true;\n const result = {\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseScormValidationError } from \"../../exceptions\";\n\n/**\n * Check if the value matches the proper format. If not, throw proper error code.\n *\n * @param {string} value\n * @param {string} regexPattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @param {boolean} [allowEmptyString]\n * @return {boolean}\n */\nexport function checkValidFormat(\n value: string,\n regexPattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n allowEmptyString?: boolean,\n): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n const formatRegex = new RegExp(regexPattern);\n const matches = value.match(formatRegex);\n if (allowEmptyString && value === \"\") {\n return true;\n }\n if (value === undefined || !matches || matches[0] === \"\") {\n throw new errorClass(errorCode);\n }\n return true;\n}\n\n/**\n * Check if the value matches the proper range. If not, throw proper error code.\n *\n * @param {any} value\n * @param {string} rangePattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @return {boolean}\n */\nexport function checkValidRange(\n value: any,\n rangePattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n): boolean {\n const ranges = rangePattern.split(\"#\");\n value = value * 1.0;\n if (value >= ranges[0]) {\n if (ranges[1] === \"*\" || value <= ranges[1]) {\n return true;\n } else {\n throw new errorClass(errorCode);\n }\n } else {\n throw new errorClass(errorCode);\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { check12ValidFormat } from \"../scorm12/validation\";\nimport * as Util from \"../../utilities\";\n\n/**\n * Class representing the `cmi.core` object\n * @extends BaseCMI\n */\nexport class CMICore extends BaseCMI {\n /**\n * Constructor for `cmi.core`\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private __children = APIConstants.scorm12.core_children;\n private _student_id = \"\";\n private _student_name = \"\";\n private _lesson_location = \"\";\n private _credit = \"\";\n private _lesson_status = \"not attempted\";\n private _entry = \"\";\n private _total_time = \"\";\n private _lesson_mode = \"normal\";\n private _exit = \"\";\n private _session_time = \"00:00:00\";\n private _suspend_data = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _student_id\n * @return {string}\n */\n get student_id(): string {\n return this._student_id;\n }\n\n /**\n * Setter for _student_id. Can only be called before initialization.\n * @param {string} student_id\n */\n set student_id(student_id: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_id = student_id;\n }\n }\n\n /**\n * Getter for _student_name\n * @return {string}\n */\n get student_name(): string {\n return this._student_name;\n }\n\n /**\n * Setter for _student_name. Can only be called before initialization.\n * @param {string} student_name\n */\n set student_name(student_name: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_name = student_name;\n }\n }\n\n /**\n * Getter for _lesson_location\n * @return {string}\n */\n get lesson_location(): string {\n return this._lesson_location;\n }\n\n /**\n * Setter for _lesson_location\n * @param {string} lesson_location\n */\n set lesson_location(lesson_location: string) {\n if (check12ValidFormat(lesson_location, Regex.scorm12.CMIString256, true)) {\n this._lesson_location = lesson_location;\n }\n }\n\n /**\n * Getter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (this.initialized) {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus)) {\n this._lesson_status = lesson_status;\n }\n } else {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Getter for _lesson_mode\n * @return {string}\n */\n get lesson_mode(): string {\n return this._lesson_mode;\n }\n\n /**\n * Setter for _lesson_mode. Can only be called before initialization.\n * @param {string} lesson_mode\n */\n set lesson_mode(lesson_mode: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._lesson_mode = lesson_mode;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._exit;\n }\n\n /**\n * Setter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check12ValidFormat(exit, Regex.scorm12.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check12ValidFormat(session_time, Regex.scorm12.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (check12ValidFormat(suspend_data, Regex.scorm12.CMIString4096, true)) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n * @param {number} start_time\n * @return {string}\n */\n getCurrentTotalTime(start_time: number | undefined): string {\n let sessionTime = this._session_time;\n const startTime = start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsHHMMSS(seconds / 1000);\n }\n\n return Util.addHHMMSSTimeStrings(\n this._total_time,\n sessionTime,\n new RegExp(Regex.scorm12.CMITimespan),\n );\n }\n\n /**\n * toJSON for cmi.core\n *\n * @return {\n * {\n * student_name: string,\n * entry: string,\n * exit: string,\n * score: CMIScore,\n * student_id: string,\n * lesson_mode: string,\n * lesson_location: string,\n * lesson_status: string,\n * credit: string,\n * session_time: string\n * }\n * }\n */\n toJSON(): {\n student_name: string;\n entry: string;\n exit: string;\n score: CMIScore;\n student_id: string;\n lesson_mode: string;\n lesson_location: string;\n lesson_status: string;\n credit: string;\n session_time: string;\n } {\n this.jsonString = true;\n const result = {\n student_id: this.student_id,\n student_name: this.student_name,\n lesson_location: this.lesson_location,\n credit: this.credit,\n lesson_status: this.lesson_status,\n entry: this.entry,\n lesson_mode: this.lesson_mode,\n exit: this.exit,\n session_time: this.session_time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat } from \"./validation\";\nimport { CMICore } from \"../aicc/core\";\nimport { CMIObjectives } from \"./objectives\";\nimport { CMIStudentData } from \"./student_data\";\nimport { CMIStudentPreference } from \"./student_preference\";\nimport { CMIInteractions } from \"./interactions\";\n\n/**\n * Class representing the cmi object for SCORM 1.2\n */\nexport class CMI extends BaseRootCMI {\n private readonly __children: string = \"\";\n private __version: string = \"3.4\";\n private _launch_data: string = \"\";\n private _comments: string = \"\";\n private _comments_from_lms: string = \"\";\n\n /**\n * Constructor for the SCORM 1.2 cmi object\n * @param {string} cmi_children\n * @param {(CMIStudentData|AICCCMIStudentData)} student_data\n * @param {boolean} initialized\n */\n constructor(\n cmi_children?: string,\n student_data?: CMIStudentData,\n initialized?: boolean,\n ) {\n super();\n if (initialized) this.initialize();\n this.__children = cmi_children\n ? cmi_children\n : APIConstants.scorm12.cmi_children;\n this.core = new CMICore();\n this.objectives = new CMIObjectives();\n this.student_data = student_data ? student_data : new CMIStudentData();\n this.student_preference = new CMIStudentPreference();\n this.interactions = new CMIInteractions();\n }\n\n public core: CMICore;\n public objectives: CMIObjectives;\n public student_data: CMIStudentData;\n public student_preference: CMIStudentPreference;\n public interactions: CMIInteractions;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.core?.initialize();\n this.objectives?.initialize();\n this.student_data?.initialize();\n this.student_preference?.initialize();\n this.interactions?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n interactions: CMIInteractions;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n interactions: this.interactions,\n };\n delete this.jsonString;\n return result;\n }\n\n /**\n * Getter for __version\n * @return {string}\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n */\n set _version(_version: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for __children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this.core?.suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (this.core) {\n this.core.suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _comments\n * @return {string}\n */\n get comments(): string {\n return this._comments;\n }\n\n /**\n * Setter for _comments\n * @param {string} comments\n */\n set comments(comments: string) {\n if (check12ValidFormat(comments, Regex.scorm12.CMIString4096, true)) {\n this._comments = comments;\n }\n }\n\n /**\n * Getter for _comments_from_lms\n * @return {string}\n */\n get comments_from_lms(): string {\n return this._comments_from_lms;\n }\n\n /**\n * Setter for _comments_from_lms. Can only be called before initialization.\n * @param {string} comments_from_lms\n */\n set comments_from_lms(comments_from_lms: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._comments_from_lms = comments_from_lms;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string}\n */\n getCurrentTotalTime(): string {\n return this.core.getCurrentTotalTime(this.start_time);\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 `cmi.interactions`\n * @extends CMIArray\n */\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.interactions`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.interactions_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n object\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.correct_responses_children,\n });\n }\n\n public readonly objectives: CMIArray;\n public readonly correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n private _id = \"\";\n private _time = \"\";\n private _type = \"\";\n private _weighting = \"\";\n private _student_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n\n /**\n * Getter for _id. Should only be called during JSON export.\n * @return {string}\n */\n get id(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _time. Should only be called during JSON export.\n * @return {string}\n */\n get time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (check12ValidFormat(time, Regex.scorm12.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _type. Should only be called during JSON export.\n * @return {string}\n */\n get type(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (check12ValidFormat(type, Regex.scorm12.CMIType)) {\n this._type = type;\n }\n }\n\n /**\n * Getter for _weighting. Should only be called during JSON export.\n * @return {string}\n */\n get weighting(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (\n check12ValidFormat(weighting, Regex.scorm12.CMIDecimal) &&\n check12ValidRange(weighting, Regex.scorm12.weighting_range)\n ) {\n this._weighting = weighting;\n }\n }\n\n /**\n * Getter for _student_response. Should only be called during JSON export.\n * @return {string}\n */\n get student_response(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._student_response;\n }\n\n /**\n * Setter for _student_response\n * @param {string} student_response\n */\n set student_response(student_response: string) {\n if (check12ValidFormat(student_response, Regex.scorm12.CMIFeedback, true)) {\n this._student_response = student_response;\n }\n }\n\n /**\n * Getter for _result. Should only be called during JSON export.\n * @return {string}\n */\n get result(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check12ValidFormat(result, Regex.scorm12.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency. Should only be called during JSON export.\n * @return {string}\n */\n get latency(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (check12ValidFormat(latency, Regex.scorm12.CMITimespan)) {\n this._latency = latency;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * time: string,\n * type: string,\n * weighting: string,\n * student_response: string,\n * result: string,\n * latency: string,\n * objectives: CMIArray,\n * correct_responses: CMIArray\n * }\n * }\n */\n toJSON(): {\n id: string;\n time: string;\n type: string;\n weighting: string;\n student_response: string;\n result: string;\n latency: string;\n objectives: CMIArray;\n correct_responses: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n time: this.time,\n type: this.type,\n weighting: this.weighting,\n student_response: this.student_response,\n result: this.result,\n latency: this.latency,\n objectives: this.objectives,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n private _id = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.correct_responses.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.correct_responses.n\n */\n constructor() {\n super();\n }\n\n private _pattern = \"\";\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check12ValidFormat(pattern, Regex.scorm12.CMIFeedback, true)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON for cmi.interactions.correct_responses.n\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this._pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {BaseCMI} from \"../common/base_cmi\";\nimport {check12ValidFormat} from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class for AICC Navigation object\n */\nexport class NAV extends BaseCMI {\n /**\n * Constructor for NAV object\n */\n constructor() {\n super();\n }\n\n private _event = \"\";\n\n /**\n * Getter for _event\n * @return {string}\n */\n get event(): string {\n return this._event;\n }\n\n /**\n * Setter for _event\n * @param {string} event\n */\n set event(event: string) {\n if (check12ValidFormat(event, Regex.scorm12.NAVEvent)) {\n this._event = event;\n }\n }\n\n /**\n * toJSON for nav object\n * @return {\n * {\n * event: string\n * }\n * }\n */\n toJSON(): {\n event: string;\n } {\n this.jsonString = true;\n const result = {\n event: this.event,\n };\n delete this.jsonString;\n return result;\n }\n}","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\nimport {check12ValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class representing SCORM 1.2's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.objectives_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n private _id = \"\";\n private _status = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (check12ValidFormat(status, Regex.scorm12.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n * @return {\n * {\n * id: string,\n * status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n status: this.status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_data object\n * @extends BaseCMI\n */\nexport class CMIStudentData extends BaseCMI {\n private readonly __children;\n private _mastery_score = \"\";\n private _max_time_allowed = \"\";\n private _time_limit_action = \"\";\n\n /**\n * Constructor for cmi.student_data\n * @param {string} student_data_children\n */\n constructor(student_data_children?: string) {\n super();\n this.__children = student_data_children\n ? student_data_children\n : APIConstants.scorm12.student_data_children;\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _master_score\n * @return {string}\n */\n get mastery_score(): string {\n return this._mastery_score;\n }\n\n /**\n * Setter for _master_score. Can only be called before initialization.\n * @param {string} mastery_score\n */\n set mastery_score(mastery_score: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._mastery_score = mastery_score;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * toJSON for cmi.student_data\n *\n * @return {\n * {\n * max_time_allowed: string,\n * time_limit_action: string,\n * mastery_score: string\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_preference object\n * @extends BaseCMI\n */\nexport class CMIStudentPreference extends BaseCMI {\n private readonly __children;\n\n /**\n * Constructor for cmi.student_preference\n * @param {string} student_preference_children\n */\n constructor(student_preference_children?: string) {\n super();\n this.__children = student_preference_children\n ? student_preference_children\n : APIConstants.scorm12.student_preference_children;\n }\n\n private _audio = \"\";\n private _language = \"\";\n private _speed = \"\";\n private _text = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _audio\n * @return {string}\n */\n get audio(): string {\n return this._audio;\n }\n\n /**\n * Setter for _audio\n * @param {string} audio\n */\n set audio(audio: string) {\n if (\n check12ValidFormat(audio, Regex.scorm12.CMISInteger) &&\n check12ValidRange(audio, Regex.scorm12.audio_range)\n ) {\n this._audio = audio;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check12ValidFormat(language, Regex.scorm12.CMIString256)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _speed\n * @return {string}\n */\n get speed(): string {\n return this._speed;\n }\n\n /**\n * Setter for _speed\n * @param {string} speed\n */\n set speed(speed: string) {\n if (\n check12ValidFormat(speed, Regex.scorm12.CMISInteger) &&\n check12ValidRange(speed, Regex.scorm12.speed_range)\n ) {\n this._speed = speed;\n }\n }\n\n /**\n * Getter for _text\n * @return {string}\n */\n get text(): string {\n return this._text;\n }\n\n /**\n * Setter for _text\n * @param {string} text\n */\n set text(text: string) {\n if (\n check12ValidFormat(text, Regex.scorm12.CMISInteger) &&\n check12ValidRange(text, Regex.scorm12.text_range)\n ) {\n this._text = text;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n speed: string;\n text: string;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n speed: this.speed,\n text: this.text,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {checkValidFormat, checkValidRange} from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm12.TYPE_MISMATCH,\n Scorm12ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidRange(\n value: any,\n rangePattern: string,\n allowEmptyString?: boolean,\n): boolean {\n if (!allowEmptyString && value === \"\") {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.VALUE_OUT_OF_RANGE);\n }\n\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n Scorm12ValidationError,\n );\n}","interface ErrorDescription {\n basicMessage: string;\n detailMessage: string;\n}\n\ninterface ErrorDescriptions {\n [key: string]: ErrorDescription;\n}\n\ninterface ScormConstants {\n cmi_children: string;\n core_children: string;\n score_children: string;\n comments_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface AiccConstants extends ScormConstants {\n student_demographics_children: string;\n tries_children: string;\n attempt_records_children: string;\n paths_children: string;\n}\n\ninterface Scorm2004Constants {\n cmi_children: string;\n comments_children: string;\n score_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface GlobalConstants {\n SCORM_TRUE: string;\n SCORM_FALSE: string;\n STATE_NOT_INITIALIZED: number;\n STATE_INITIALIZED: number;\n STATE_TERMINATED: number;\n LOG_LEVEL_DEBUG: number;\n LOG_LEVEL_INFO: number;\n LOG_LEVEL_WARNING: number;\n LOG_LEVEL_ERROR: number;\n LOG_LEVEL_NONE: number;\n}\n\ninterface APIConstants {\n global: GlobalConstants;\n scorm12: ScormConstants;\n aicc: AiccConstants;\n scorm2004: Scorm2004Constants;\n}\n\nconst global: GlobalConstants = {\n SCORM_TRUE: \"true\",\n SCORM_FALSE: \"false\",\n STATE_NOT_INITIALIZED: 0,\n STATE_INITIALIZED: 1,\n STATE_TERMINATED: 2,\n LOG_LEVEL_DEBUG: 1,\n LOG_LEVEL_INFO: 2,\n LOG_LEVEL_WARNING: 3,\n LOG_LEVEL_ERROR: 4,\n LOG_LEVEL_NONE: 5,\n};\n\nconst scorm12: ScormConstants = {\n // Children lists\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions\",\n core_children:\n \"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time\",\n score_children: \"raw,min,max\",\n comments_children: \"content,location,time\",\n objectives_children: \"id,score,status\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children: \"audio,language,speed,text\",\n interactions_children:\n \"id,objectives,time,type,correct_responses,weighting,student_response,result,latency\",\n error_descriptions: {\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information\",\n },\n \"201\": {\n basicMessage: \"Invalid argument error\",\n detailMessage:\n \"Indicates that an argument represents an invalid data model element or is otherwise incorrect.\",\n },\n \"202\": {\n basicMessage: \"Element cannot have children\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_children\" for a data model element that does not support the \"_children\" suffix.',\n },\n \"203\": {\n basicMessage: \"Element not an array - cannot have count\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_count\" for a data model element that does not support the \"_count\" suffix.',\n },\n \"301\": {\n basicMessage: \"Not initialized\",\n detailMessage:\n \"Indicates that an API call was made before the call to lmsInitialize.\",\n },\n \"401\": {\n basicMessage: \"Not implemented error\",\n detailMessage:\n \"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.\",\n },\n \"402\": {\n basicMessage: \"Invalid set value, element is a keyword\",\n detailMessage:\n 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in \"_children\" and \"_count\").',\n },\n \"403\": {\n basicMessage: \"Element is read only\",\n detailMessage:\n \"LMSSetValue was called with a data model element that can only be read.\",\n },\n \"404\": {\n basicMessage: \"Element is write only\",\n detailMessage:\n \"LMSGetValue was called on a data model element that can only be written to.\",\n },\n \"405\": {\n basicMessage: \"Incorrect Data Type\",\n detailMessage:\n \"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst aicc: AiccConstants = {\n ...scorm12,\n ...{\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation\",\n student_preference_children:\n \"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows\",\n student_data_children:\n \"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action\",\n student_demographics_children:\n \"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience\",\n tries_children: \"time,status,score\",\n attempt_records_children: \"score,lesson_status\",\n paths_children: \"location_id,date,time,status,why_left,time_in_element\",\n },\n};\nconst scorm2004: Scorm2004Constants = {\n // Children lists\n cmi_children:\n \"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time\",\n comments_children: \"comment,timestamp,location\",\n score_children: \"max,raw,scaled,min\",\n objectives_children:\n \"progress_measure,completion_status,success_status,description,score,id\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children:\n \"audio_level,audio_captioning,delivery_speed,language\",\n interactions_children:\n \"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description\",\n error_descriptions: {\n \"0\": {\n basicMessage: \"No Error\",\n detailMessage: \"No error occurred, the previous API call was successful.\",\n },\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use GetDiagnostic for more information.\",\n },\n \"102\": {\n basicMessage: \"General Initialization Failure\",\n detailMessage: \"Call to Initialize failed for an unknown reason.\",\n },\n \"103\": {\n basicMessage: \"Already Initialized\",\n detailMessage:\n \"Call to Initialize failed because Initialize was already called.\",\n },\n \"104\": {\n basicMessage: \"Content Instance Terminated\",\n detailMessage:\n \"Call to Initialize failed because Terminate was already called.\",\n },\n \"111\": {\n basicMessage: \"General Termination Failure\",\n detailMessage: \"Call to Terminate failed for an unknown reason.\",\n },\n \"112\": {\n basicMessage: \"Termination Before Initialization\",\n detailMessage:\n \"Call to Terminate failed because it was made before the call to Initialize.\",\n },\n \"113\": {\n basicMessage: \"Termination After Termination\",\n detailMessage:\n \"Call to Terminate failed because Terminate was already called.\",\n },\n \"122\": {\n basicMessage: \"Retrieve Data Before Initialization\",\n detailMessage:\n \"Call to GetValue failed because it was made before the call to Initialize.\",\n },\n \"123\": {\n basicMessage: \"Retrieve Data After Termination\",\n detailMessage:\n \"Call to GetValue failed because it was made after the call to Terminate.\",\n },\n \"132\": {\n basicMessage: \"Store Data Before Initialization\",\n detailMessage:\n \"Call to SetValue failed because it was made before the call to Initialize.\",\n },\n \"133\": {\n basicMessage: \"Store Data After Termination\",\n detailMessage:\n \"Call to SetValue failed because it was made after the call to Terminate.\",\n },\n \"142\": {\n basicMessage: \"Commit Before Initialization\",\n detailMessage:\n \"Call to Commit failed because it was made before the call to Initialize.\",\n },\n \"143\": {\n basicMessage: \"Commit After Termination\",\n detailMessage:\n \"Call to Commit failed because it was made after the call to Terminate.\",\n },\n \"201\": {\n basicMessage: \"General Argument Error\",\n detailMessage:\n \"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.\",\n },\n \"301\": {\n basicMessage: \"General Get Failure\",\n detailMessage:\n \"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"351\": {\n basicMessage: \"General Set Failure\",\n detailMessage:\n \"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"391\": {\n basicMessage: \"General Commit Failure\",\n detailMessage:\n \"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"401\": {\n basicMessage: \"Undefined Data Model Element\",\n detailMessage:\n \"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.\",\n },\n \"402\": {\n basicMessage: \"Unimplemented Data Model Element\",\n detailMessage:\n \"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.\",\n },\n \"403\": {\n basicMessage: \"Data Model Element Value Not Initialized\",\n detailMessage:\n \"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.\",\n },\n \"404\": {\n basicMessage: \"Data Model Element Is Read Only\",\n detailMessage:\n \"SetValue was called with a data model element that can only be read.\",\n },\n \"405\": {\n basicMessage: \"Data Model Element Is Write Only\",\n detailMessage:\n \"GetValue was called on a data model element that can only be written to.\",\n },\n \"406\": {\n basicMessage: \"Data Model Element Type Mismatch\",\n detailMessage:\n \"SetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Data Model Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst APIConstants: APIConstants = {\n global: global,\n scorm12: scorm12,\n aicc: aicc,\n scorm2004: scorm2004,\n};\nexport default APIConstants;\n","export enum NAVBoolean {\n unknown = \"unknown\",\n true = \"true\",\n false = \"false\",\n}\n\nexport enum SuccessStatus {\n passed = \"passed\",\n failed = \"failed\",\n unknown = \"unknown\",\n}\n\nexport enum CompletionStatus {\n completed = \"completed\",\n incomplete = \"incomplete\",\n unknown = \"unknown\",\n}\n","export type ErrorCode = {\n [key: string]: number;\n};\n\nconst global: ErrorCode = {\n GENERAL: 101,\n INITIALIZATION_FAILED: 101,\n INITIALIZED: 101,\n TERMINATED: 101,\n TERMINATION_FAILURE: 101,\n TERMINATION_BEFORE_INIT: 101,\n MULTIPLE_TERMINATION: 101,\n RETRIEVE_BEFORE_INIT: 101,\n RETRIEVE_AFTER_TERM: 101,\n STORE_BEFORE_INIT: 101,\n STORE_AFTER_TERM: 101,\n COMMIT_BEFORE_INIT: 101,\n COMMIT_AFTER_TERM: 101,\n ARGUMENT_ERROR: 101,\n CHILDREN_ERROR: 101,\n COUNT_ERROR: 101,\n GENERAL_GET_FAILURE: 101,\n GENERAL_SET_FAILURE: 101,\n GENERAL_COMMIT_FAILURE: 101,\n UNDEFINED_DATA_MODEL: 101,\n UNIMPLEMENTED_ELEMENT: 101,\n VALUE_NOT_INITIALIZED: 101,\n INVALID_SET_VALUE: 101,\n READ_ONLY_ELEMENT: 101,\n WRITE_ONLY_ELEMENT: 101,\n TYPE_MISMATCH: 101,\n VALUE_OUT_OF_RANGE: 101,\n DEPENDENCY_NOT_ESTABLISHED: 101,\n};\n\nconst scorm12: ErrorCode = {\n ...global,\n RETRIEVE_BEFORE_INIT: 301,\n STORE_BEFORE_INIT: 301,\n COMMIT_BEFORE_INIT: 301,\n ARGUMENT_ERROR: 201,\n CHILDREN_ERROR: 202,\n COUNT_ERROR: 203,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 401,\n VALUE_NOT_INITIALIZED: 301,\n INVALID_SET_VALUE: 402,\n READ_ONLY_ELEMENT: 403,\n WRITE_ONLY_ELEMENT: 404,\n TYPE_MISMATCH: 405,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst scorm2004: ErrorCode = {\n ...global,\n INITIALIZATION_FAILED: 102,\n INITIALIZED: 103,\n TERMINATED: 104,\n TERMINATION_FAILURE: 111,\n TERMINATION_BEFORE_INIT: 112,\n MULTIPLE_TERMINATIONS: 113,\n RETRIEVE_BEFORE_INIT: 122,\n RETRIEVE_AFTER_TERM: 123,\n STORE_BEFORE_INIT: 132,\n STORE_AFTER_TERM: 133,\n COMMIT_BEFORE_INIT: 142,\n COMMIT_AFTER_TERM: 143,\n ARGUMENT_ERROR: 201,\n GENERAL_GET_FAILURE: 301,\n GENERAL_SET_FAILURE: 351,\n GENERAL_COMMIT_FAILURE: 391,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 402,\n VALUE_NOT_INITIALIZED: 403,\n READ_ONLY_ELEMENT: 404,\n WRITE_ONLY_ELEMENT: 405,\n TYPE_MISMATCH: 406,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst ErrorCodes = {\n scorm12,\n scorm2004,\n};\n\nexport default ErrorCodes;\n","const scorm12 = {\n CMIString256: \"^.{0,255}$\",\n CMIString4096: \"^.{0,4096}$\",\n CMITime: \"^(?:[01]\\\\d|2[0123]):(?:[012345]\\\\d):(?:[012345]\\\\d)$\",\n CMITimespan: \"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$\",\n\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{0,3})(.[0-9]*)?$\",\n\n CMIIdentifier: \"^[\\\\u0021-\\\\u007E\\\\s]{0,255}$\",\n CMIFeedback: \"^.{0,255}$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n // Vocabulary Data Type Definition\n CMIStatus: \"^(passed|completed|failed|incomplete|browsed)$\",\n CMIStatus2: \"^(passed|completed|failed|incomplete|browsed|not attempted)$\",\n CMIExit: \"^(time-out|suspend|logout|)$\",\n CMIType:\n \"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$\",\n CMIResult:\n \"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\\\.[0-9]*)?)$\",\n NAVEvent: \"^(previous|continue)$\",\n // Data ranges\n score_range: \"0#100\",\n audio_range: \"-1#100\",\n speed_range: \"-100#100\",\n weighting_range: \"-100#100\",\n text_range: \"-1#1\",\n};\nconst aicc = {\n ...scorm12,\n ...{\n CMIIdentifier: \"^\\\\w{1,255}$\",\n },\n};\nconst scorm2004 = {\n CMIString200: \"^[\\\\u0000-\\\\uFFFF]{0,200}$\",\n CMIString250: \"^[\\\\u0000-\\\\uFFFF]{0,250}$\",\n CMIString1000: \"^[\\\\u0000-\\\\uFFFF]{0,1000}$\",\n CMIString4000: \"^[\\\\u0000-\\\\uFFFF]{0,4000}$\",\n CMIString64000: \"^[\\\\u0000-\\\\uFFFF]{0,64000}$\",\n CMILang: \"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$\",\n\n CMILangString250:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$\",\n\n CMILangcr: \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$\",\n\n CMILangString250cr:\n \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$\",\n\n CMILangString4000:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$\",\n\n CMITime:\n \"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$\",\n CMITimespan:\n \"^P(?:([.,\\\\d]+)Y)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)W)?(?:([.,\\\\d]+)D)?(?:T?(?:([.,\\\\d]+)H)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)S)?)?$\",\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{1,5})(\\\\.[0-9]{1,18})?$\",\n CMIIdentifier: \"^\\\\S{1,250}[a-zA-Z0-9]$\",\n CMIShortIdentifier: \"^[\\\\w\\\\.\\\\-\\\\_]{1,250}$\",\n CMILongIdentifier:\n \"^(?:(?!urn:)\\\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\\\S{1,4000}|.{1,4000})$\",\n // need to re-examine this\n CMIFeedback: \"^.*$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n CMIIndexStore: \".N(\\\\d+).\",\n // Vocabulary Data Type Definition\n CMICStatus: \"^(completed|incomplete|not attempted|unknown)$\",\n CMISStatus: \"^(passed|failed|unknown)$\",\n CMIExit: \"^(time-out|suspend|logout|normal)$\",\n CMIType:\n \"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$\",\n CMIResult:\n \"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\\\.[0-9]{1,18})?)$\",\n NAVEvent:\n \"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?jump)$\",\n\n NAVBoolean: \"^(unknown|true|false$)\",\n NAVTarget: \"^{target=\\\\S{0,}[a-zA-Z0-9-_]+}$\",\n // Data ranges\n scaled_range: \"-1#1\",\n audio_range: \"0#*\",\n speed_range: \"0#*\",\n text_range: \"-1#1\",\n progress_range: \"0#1\",\n};\nconst Regex = {\n aicc: aicc,\n scorm12: scorm12,\n scorm2004: scorm2004,\n};\nexport default Regex;\n","import APIConstants from \"./constants/api_constants\";\n\nconst scorm12_errors = APIConstants.scorm12.error_descriptions;\nconst aicc_errors = APIConstants.aicc.error_descriptions;\nconst scorm2004_errors = APIConstants.scorm2004.error_descriptions;\n\ntype APIError = {\n errorCode: number;\n errorMessage: string;\n detailedMessage: string;\n};\n\nexport class BaseScormValidationError extends Error {\n constructor(errorCode: number) {\n super(errorCode.toString());\n this._errorCode = errorCode;\n this.name = \"ScormValidationError\";\n }\n\n private readonly _errorCode: number;\n\n /**\n * Getter for _errorCode\n * @return {number}\n */\n get errorCode(): number {\n return this._errorCode;\n }\n\n setMessage(message: string) {\n this.message = message;\n }\n}\n\n/**\n * Base Validation Exception\n */\nexport class ValidationError\n extends BaseScormValidationError\n implements APIError\n{\n /**\n * Constructor to take in an error message and code\n * @param {number} errorCode\n * @param {string} errorMessage\n * @param {string} detailedMessage\n */\n constructor(\n errorCode: number,\n errorMessage: string,\n detailedMessage?: string,\n ) {\n super(errorCode);\n this.setMessage(errorMessage);\n this._errorMessage = errorMessage;\n if (detailedMessage) {\n this._detailedMessage = detailedMessage;\n }\n }\n\n private readonly _errorMessage: string;\n private readonly _detailedMessage: string = \"\";\n\n /**\n * Getter for _errorMessage\n * @return {string}\n */\n get errorMessage(): string {\n return this._errorMessage;\n }\n\n /**\n * Getter for _detailedMessage\n * @return {string}\n */\n get detailedMessage(): string {\n return this._detailedMessage;\n }\n}\n\n/**\n * SCORM 1.2 Validation Error\n */\nexport class Scorm12ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {\n super(\n errorCode,\n scorm12_errors[String(errorCode)].basicMessage,\n scorm12_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm12_errors[\"101\"].basicMessage,\n scorm12_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * AICC Validation Error\n */\nexport class AICCValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {\n super(\n errorCode,\n aicc_errors[String(errorCode)].basicMessage,\n aicc_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n aicc_errors[\"101\"].basicMessage,\n aicc_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * SCORM 2004 Validation Error\n */\nexport class Scorm2004ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {\n super(\n errorCode,\n scorm2004_errors[String(errorCode)].basicMessage,\n scorm2004_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm2004_errors[\"101\"].basicMessage,\n scorm2004_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n","export const SECONDS_PER_SECOND = 1.0;\nexport const SECONDS_PER_MINUTE = 60;\nexport const SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;\nexport const SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR;\n\ntype Designation = {\n [key: string]: number;\n};\n\ntype StringKeyMap = {\n [key: string]: any;\n};\n\nconst designations: Designation = {\n D: SECONDS_PER_DAY,\n H: SECONDS_PER_HOUR,\n M: SECONDS_PER_MINUTE,\n S: SECONDS_PER_SECOND,\n};\n\n/**\n * Converts a Number to a String of HH:MM:SS\n *\n * @param {number} totalSeconds\n * @return {string}\n */\nexport function getSecondsAsHHMMSS(totalSeconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!totalSeconds || totalSeconds <= 0) {\n return \"00:00:00\";\n }\n\n const hours = Math.floor(totalSeconds / SECONDS_PER_HOUR);\n const dateObj = new Date(totalSeconds * 1000);\n const minutes = dateObj.getUTCMinutes();\n // make sure we add any possible decimal value\n const seconds = dateObj.getSeconds();\n const ms = totalSeconds % 1.0;\n let msStr = \"\";\n\n if (countDecimals(ms) > 0) {\n if (countDecimals(ms) > 2) {\n msStr = ms.toFixed(2);\n } else {\n msStr = String(ms);\n }\n\n msStr = \".\" + msStr.split(\".\")[1];\n }\n\n return (\n (hours + \":\" + minutes + \":\" + seconds).replace(/\\b\\d\\b/g, \"0$&\") + msStr\n );\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {number} seconds\n * @return {string}\n */\nexport function getSecondsAsISODuration(seconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!seconds || seconds <= 0) {\n return \"PT0S\";\n }\n\n let duration = \"P\";\n let remainder = seconds;\n for (const designationsKey in designations) {\n const current_seconds = designations[designationsKey];\n let value = Math.floor(remainder / current_seconds);\n remainder = remainder % current_seconds;\n\n if (countDecimals(remainder) > 2) {\n remainder = Number(Number(remainder).toFixed(2));\n }\n\n // If we have anything left in the remainder, and we're currently adding\n // seconds to the duration, go ahead and add the decimal to the seconds\n if (designationsKey === \"S\" && remainder > 0) {\n value += remainder;\n }\n\n if (value) {\n if (\n (duration.indexOf(\"D\") > 0 ||\n designationsKey === \"H\" ||\n designationsKey === \"M\" ||\n designationsKey === \"S\") &&\n duration.indexOf(\"T\") === -1\n ) {\n duration += \"T\";\n }\n\n duration += `${value}${designationsKey}`;\n }\n }\n return duration;\n}\n\n/**\n * Calculate the number of seconds from HH:MM:SS.DDDDDD\n *\n * @param {string} timeString\n * @param {RegExp} timeRegex\n * @return {number}\n */\nexport function getTimeAsSeconds(\n timeString: string | number | boolean | null,\n timeRegex: RegExp | string,\n): number {\n if (typeof timeString === \"number\" || typeof timeString === \"boolean\") {\n timeString = String(timeString);\n }\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n if (!timeString || !timeString.match(timeRegex)) {\n return 0;\n }\n\n const parts = timeString.split(\":\");\n const hours = Number(parts[0]);\n const minutes = Number(parts[1]);\n const seconds = Number(parts[2]);\n return hours * 3600 + minutes * 60 + seconds;\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {string} duration\n * @param {RegExp} durationRegex\n * @return {number}\n */\nexport function getDurationAsSeconds(\n duration: string | null,\n durationRegex: RegExp | string,\n): number {\n if (typeof durationRegex === \"string\") {\n durationRegex = new RegExp(durationRegex);\n }\n\n if (!duration || !duration.match(durationRegex)) {\n return 0;\n }\n\n const [, years, _, , days, hours, minutes, seconds] =\n new RegExp(durationRegex).exec(duration) || [];\n let result = 0.0;\n result += Number(seconds) || 0.0;\n result += Number(minutes) * 60.0 || 0.0;\n result += Number(hours) * 3600.0 || 0.0;\n result += Number(days) * (60 * 60 * 24.0) || 0.0;\n result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0;\n return result;\n}\n\n/**\n * Adds together two ISO8601 Duration strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp|string} durationRegex\n * @return {string}\n */\nexport function addTwoDurations(\n first: string,\n second: string,\n durationRegex: RegExp | string,\n): string {\n const regex: RegExp =\n typeof durationRegex === \"string\"\n ? new RegExp(durationRegex)\n : durationRegex;\n return getSecondsAsISODuration(\n getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex),\n );\n}\n\n/**\n * Add together two HH:MM:SS.DD strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp} timeRegex\n * @return {string}\n */\nexport function addHHMMSSTimeStrings(\n first: string,\n second: string,\n timeRegex: RegExp | string,\n): string {\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n return getSecondsAsHHMMSS(\n getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex),\n );\n}\n\n/**\n * Flatten a JSON object down to string paths for each values\n * @param {object} data\n * @return {object}\n */\nexport function flatten(data: StringKeyMap): object {\n const result: StringKeyMap = {};\n\n /**\n * Recurse through the object\n * @param {*} cur\n * @param {*} prop\n */\n function recurse(cur: any, prop: any) {\n if (Object(cur) !== cur) {\n result[prop] = cur;\n } else if (Array.isArray(cur)) {\n for (let i = 0, l = cur.length; i < l; i++) {\n recurse(cur[i], prop + \"[\" + i + \"]\");\n if (l === 0) result[prop] = [];\n }\n } else {\n let isEmpty = true;\n\n for (const p in cur) {\n if ({}.hasOwnProperty.call(cur, p)) {\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p);\n }\n }\n\n if (isEmpty && prop) result[prop] = {};\n }\n }\n\n recurse(data, \"\");\n return result;\n}\n\n/**\n * Un-flatten a flat JSON object\n * @param {object} data\n * @return {object}\n */\nexport function unflatten(data: StringKeyMap): object {\n \"use strict\";\n\n if (Object(data) !== data || Array.isArray(data)) return data;\n const regex = /\\.?([^.[\\]]+)|\\[(\\d+)]/g;\n const result: StringKeyMap = {};\n\n for (const p in data) {\n if ({}.hasOwnProperty.call(data, p)) {\n let cur = result;\n let prop = \"\";\n let m = regex.exec(p);\n\n while (m) {\n cur = cur[prop] || (cur[prop] = m[2] ? [] : {});\n prop = m[2] || m[1];\n m = regex.exec(p);\n }\n\n cur[prop] = data[p];\n }\n }\n\n return result[\"\"] || result;\n}\n\n/**\n * Counts the number of decimal places\n * @param {number} num\n * @return {number}\n */\nexport function countDecimals(num: number): number {\n if (Math.floor(num) === num || String(num).indexOf(\".\") < 0) return 0;\n const parts = num.toString().split(\".\")[1];\n return parts.length || 0;\n}\n\n/**\n * Formats the SCORM messages for easy reading\n *\n * @param {string} functionName\n * @param {string} message\n * @param {string} CMIElement\n * @return {string}\n */\nexport function formatMessage(\n functionName: string,\n message: string,\n CMIElement?: string,\n): string {\n const baseLength = 20;\n let messageString = \"\";\n\n messageString += functionName;\n\n let fillChars = baseLength - messageString.length;\n\n for (let i = 0; i < fillChars; i++) {\n messageString += \" \";\n }\n\n messageString += \": \";\n\n if (CMIElement) {\n const CMIElementBaseLength = 70;\n\n messageString += CMIElement;\n\n fillChars = CMIElementBaseLength - messageString.length;\n\n for (let j = 0; j < fillChars; j++) {\n messageString += \" \";\n }\n }\n\n if (message) {\n messageString += message;\n }\n\n return messageString;\n}\n\n/**\n * Checks to see if {str} contains {tester}\n *\n * @param {string} str String to check against\n * @param {string} tester String to check for\n * @return {boolean}\n */\nexport function stringMatches(str: string, tester: string): boolean {\n return str?.match(tester) !== null;\n}\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","import { checkValidFormat } from \"../common/validation\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nconst aicc_error_codes = ErrorCodes.scorm12;\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function checkAICCValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n aicc_error_codes.TYPE_MISMATCH,\n AICCValidationError,\n allowEmptyString,\n );\n}\n","import { CMIArray } from \"../common/array\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * AICC Evaluation object\n */\nexport class CMIEvaluation extends BaseCMI {\n /**\n * Constructor for AICC Evaluation object\n */\n constructor() {\n super();\n this.comments = new CMIEvaluationComments();\n }\n\n public comments: CMIEvaluationComments;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.comments?.initialize();\n }\n\n /**\n * toJSON for cmi.evaluation object\n * @return {{comments: CMIEvaluationComments}}\n */\n toJSON(): {\n comments: CMIEvaluationComments;\n } {\n this.jsonString = true;\n const result = {\n comments: this.comments,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing AICC's cmi.evaluation.comments object\n */\n\nclass CMIEvaluationComments extends CMIArray {\n /**\n * Constructor for AICC Evaluation Comments object\n */\n constructor() {\n super({\n children: APIConstants.aicc.comments_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: AICCValidationError,\n });\n }\n}\n\n/**\n * Class for AICC Evaluation Comments\n */\nexport class CMIEvaluationCommentsObject extends BaseCMI {\n /**\n * Constructor for Evaluation Comments\n */\n constructor() {\n super();\n }\n\n private _content = \"\";\n private _location = \"\";\n private _time = \"\";\n\n /**\n * Getter for _content\n * @return {string}\n */\n get content(): string {\n return this._content;\n }\n\n /**\n * Setter for _content\n * @param {string} content\n */\n set content(content: string) {\n if (checkAICCValidFormat(content, Regex.aicc.CMIString256)) {\n this._content = content;\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (checkAICCValidFormat(location, Regex.aicc.CMIString256)) {\n this._location = location;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setting for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * toJSON for cmi.evaluation.comments.n object\n * @return {\n * {\n * content: string,\n * location: string,\n * time: string\n * }\n * }\n */\n toJSON(): {\n content: string;\n location: string;\n time: string;\n } {\n this.jsonString = true;\n const result = {\n content: this.content,\n location: this.location,\n time: this.time,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMIStudentPreference } from \"../scorm12/student_preference\";\n\n/**\n * StudentPreferences class for AICC\n */\nexport class AICCStudentPreferences extends CMIStudentPreference {\n /**\n * Constructor for AICC Student Preferences object\n */\n constructor() {\n super(APIConstants.aicc.student_preference_children);\n this.windows = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: AICCValidationError,\n children: \"\",\n });\n }\n\n public windows: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.windows?.initialize();\n }\n\n private _lesson_type = \"\";\n private _text_color = \"\";\n private _text_location = \"\";\n private _text_size = \"\";\n private _video = \"\";\n\n /**\n * Getter for _lesson_type\n * @return {string}\n */\n get lesson_type(): string {\n return this._lesson_type;\n }\n\n /**\n * Setter for _lesson_type\n * @param {string} lesson_type\n */\n set lesson_type(lesson_type: string) {\n if (checkAICCValidFormat(lesson_type, Regex.aicc.CMIString256)) {\n this._lesson_type = lesson_type;\n }\n }\n\n /**\n * Getter for _text_color\n * @return {string}\n */\n get text_color(): string {\n return this._text_color;\n }\n\n /**\n * Setter for _text_color\n * @param {string} text_color\n */\n set text_color(text_color: string) {\n if (checkAICCValidFormat(text_color, Regex.aicc.CMIString256)) {\n this._text_color = text_color;\n }\n }\n\n /**\n * Getter for _text_location\n * @return {string}\n */\n get text_location(): string {\n return this._text_location;\n }\n\n /**\n * Setter for _text_location\n * @param {string} text_location\n */\n set text_location(text_location: string) {\n if (checkAICCValidFormat(text_location, Regex.aicc.CMIString256)) {\n this._text_location = text_location;\n }\n }\n\n /**\n * Getter for _text_size\n * @return {string}\n */\n get text_size(): string {\n return this._text_size;\n }\n\n /**\n * Setter for _text_size\n * @param {string} text_size\n */\n set text_size(text_size: string) {\n if (checkAICCValidFormat(text_size, Regex.aicc.CMIString256)) {\n this._text_size = text_size;\n }\n }\n\n /**\n * Getter for _video\n * @return {string}\n */\n get video(): string {\n return this._video;\n }\n\n /**\n * Setter for _video\n * @param {string} video\n */\n set video(video: string) {\n if (checkAICCValidFormat(video, Regex.aicc.CMIString256)) {\n this._video = video;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string,\n * text_color: string,\n * text_location: string,\n * text_size: string,\n * video: string,\n * windows: CMIArray\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n lesson_type: string;\n speed: string;\n text: string;\n text_color: string;\n text_location: string;\n text_size: string;\n video: string;\n windows: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n lesson_type: this.lesson_type,\n speed: this.speed,\n text: this.text,\n text_color: this.text_color,\n text_location: this.text_location,\n text_size: this.text_size,\n video: this.video,\n windows: this.windows,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the AICC cmi.student_demographics object\n */\nexport class CMIStudentDemographics extends BaseCMI {\n /**\n * Constructor for AICC StudentDemographics object\n */\n constructor() {\n super();\n }\n\n private __children = APIConstants.aicc.student_demographics_children;\n private _city = \"\";\n private _class = \"\";\n private _company = \"\";\n private _country = \"\";\n private _experience = \"\";\n private _familiar_name = \"\";\n private _instructor_name = \"\";\n private _title = \"\";\n private _native_language = \"\";\n private _state = \"\";\n private _street_address = \"\";\n private _telephone = \"\";\n private _years_experience = \"\";\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Getter for city\n * @return {string}\n */\n get city(): string {\n return this._city;\n }\n\n /**\n * Setter for _city. Sets an error if trying to set after\n * initialization.\n * @param {string} city\n */\n set city(city: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._city = city;\n }\n }\n\n /**\n * Getter for class\n * @return {string}\n */\n get class(): string {\n return this._class;\n }\n\n /**\n * Setter for _class. Sets an error if trying to set after\n * initialization.\n * @param {string} clazz\n */\n set class(clazz: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._class = clazz;\n }\n }\n\n /**\n * Getter for company\n * @return {string}\n */\n get company(): string {\n return this._company;\n }\n\n /**\n * Setter for _company. Sets an error if trying to set after\n * initialization.\n * @param {string} company\n */\n set company(company: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._company = company;\n }\n }\n\n /**\n * Getter for country\n * @return {string}\n */\n get country(): string {\n return this._country;\n }\n\n /**\n * Setter for _country. Sets an error if trying to set after\n * initialization.\n * @param {string} country\n */\n set country(country: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._country = country;\n }\n }\n\n /**\n * Getter for experience\n * @return {string}\n */\n get experience(): string {\n return this._experience;\n }\n\n /**\n * Setter for _experience. Sets an error if trying to set after\n * initialization.\n * @param {string} experience\n */\n set experience(experience: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._experience = experience;\n }\n }\n\n /**\n * Getter for familiar_name\n * @return {string}\n */\n get familiar_name(): string {\n return this._familiar_name;\n }\n\n /**\n * Setter for _familiar_name. Sets an error if trying to set after\n * initialization.\n * @param {string} familiar_name\n */\n set familiar_name(familiar_name: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._familiar_name = familiar_name;\n }\n }\n\n /**\n * Getter for instructor_name\n * @return {string}\n */\n get instructor_name(): string {\n return this._instructor_name;\n }\n\n /**\n * Setter for _instructor_name. Sets an error if trying to set after\n * initialization.\n * @param {string} instructor_name\n */\n set instructor_name(instructor_name: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._instructor_name = instructor_name;\n }\n }\n\n /**\n * Getter for title\n * @return {string}\n */\n get title(): string {\n return this._title;\n }\n\n /**\n * Setter for _title. Sets an error if trying to set after\n * initialization.\n * @param {string} title\n */\n set title(title: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._title = title;\n }\n }\n\n /**\n * Getter for native_language\n * @return {string}\n */\n get native_language(): string {\n return this._native_language;\n }\n\n /**\n * Setter for _native_language. Sets an error if trying to set after\n * initialization.\n * @param {string} native_language\n */\n set native_language(native_language: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._native_language = native_language;\n }\n }\n\n /**\n * Getter for state\n * @return {string}\n */\n get state(): string {\n return this._state;\n }\n\n /**\n * Setter for _state. Sets an error if trying to set after\n * initialization.\n * @param {string} state\n */\n set state(state: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._state = state;\n }\n }\n\n /**\n * Getter for street_address\n * @return {string}\n */\n get street_address(): string {\n return this._street_address;\n }\n\n /**\n * Setter for _street_address. Sets an error if trying to set after\n * initialization.\n * @param {string} street_address\n */\n set street_address(street_address: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._street_address = street_address;\n }\n }\n\n /**\n * Getter for telephone\n * @return {string}\n */\n get telephone(): string {\n return this._telephone;\n }\n\n /**\n * Setter for _telephone. Sets an error if trying to set after\n * initialization.\n * @param {string} telephone\n */\n set telephone(telephone: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._telephone = telephone;\n }\n }\n\n /**\n * Getter for years_experience\n * @return {string}\n */\n get years_experience(): string {\n return this._years_experience;\n }\n\n /**\n * Setter for _years_experience. Sets an error if trying to set after\n * initialization.\n * @param {string} years_experience\n */\n set years_experience(years_experience: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._years_experience = years_experience;\n }\n }\n\n /**\n * toJSON for cmi.student_demographics object\n * @return {\n * {\n * city: string,\n * class: string,\n * company: string,\n * country: string,\n * experience: string,\n * familiar_name: string,\n * instructor_name: string,\n * title: string,\n * native_language: string,\n * state: string,\n * street_address: string,\n * telephone: string,\n * years_experience: string\n * }\n * }\n */\n toJSON(): {\n city: string;\n class: string;\n company: string;\n country: string;\n experience: string;\n familiar_name: string;\n instructor_name: string;\n title: string;\n native_language: string;\n state: string;\n street_address: string;\n telephone: string;\n years_experience: string;\n } {\n this.jsonString = true;\n const result = {\n city: this.city,\n class: this.class,\n company: this.company,\n country: this.country,\n experience: this.experience,\n familiar_name: this.familiar_name,\n instructor_name: this.instructor_name,\n title: this.title,\n native_language: this.native_language,\n state: this.state,\n street_address: this.street_address,\n telephone: this.telephone,\n years_experience: this.years_experience,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {CMIArray} from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {AICCValidationError} from \"../../exceptions\";\nimport {checkAICCValidFormat} from \"./validation\";\n\n/**\n * Class representing the AICC cmi.student_data.tries object\n */\nexport class CMITries extends CMIArray {\n /**\n * Constructor for inline Tries Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.tries_children,\n });\n }\n}\n\n/**\n * Class for AICC Tries\n */\nexport class CMITriesObject extends BaseCMI {\n /**\n * Constructor for AICC Tries object\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.aicc.score_children,\n score_range: Regex.aicc.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: AICCValidationError,\n });\n }\n\n public score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private _status = \"\";\n private _time = \"\";\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (checkAICCValidFormat(status, Regex.aicc.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * toJSON for cmi.student_data.tries.n object\n * @return {\n * {\n * status: string,\n * time: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n status: string;\n time: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n status: this.status,\n time: this.time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {AICCValidationError} from \"../../exceptions\";\nimport {checkAICCValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class for cmi.student_data.attempt_records array\n */\nexport class CMIAttemptRecords extends CMIArray {\n /**\n * Constructor for inline Tries Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.attempt_records_children,\n });\n }\n}\n\n/**\n * Class for AICC Attempt Records\n */\nexport class CMIAttemptRecordsObject extends BaseCMI {\n /**\n * Constructor for AICC Attempt Records object\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.aicc.score_children,\n score_range: Regex.aicc.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: AICCValidationError,\n });\n }\n\n public score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private _lesson_status = \"\";\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (checkAICCValidFormat(lesson_status, Regex.aicc.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n\n /**\n * toJSON for cmi.student_data.attempt_records.n object\n * @return {\n * {\n * lesson_status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n lesson_status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n lesson_status: this.lesson_status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { AICCValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMITries } from \"./tries\";\nimport { CMIStudentData } from \"../scorm12/student_data\";\nimport { CMIAttemptRecords } from \"./attempts\";\n\n/**\n * StudentData class for AICC\n */\nexport class AICCCMIStudentData extends CMIStudentData {\n /**\n * Constructor for AICC StudentData object\n */\n constructor() {\n super(APIConstants.aicc.student_data_children);\n this.tries = new CMITries();\n this.attempt_records = new CMIAttemptRecords();\n }\n\n public tries: CMITries;\n public attempt_records: CMIAttemptRecords;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.tries?.initialize();\n this.attempt_records?.initialize();\n }\n\n private _tries_during_lesson = \"\";\n\n /**\n * Getter for tries_during_lesson\n * @return {string}\n */\n get tries_during_lesson(): string {\n return this._tries_during_lesson;\n }\n\n /**\n * Setter for _tries_during_lesson. Sets an error if trying to set after\n * initialization.\n * @param {string} tries_during_lesson\n */\n set tries_during_lesson(tries_during_lesson: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._tries_during_lesson = tries_during_lesson;\n }\n }\n\n /**\n * toJSON for cmi.student_data object\n * @return {\n * {\n * mastery_score: string,\n * max_time_allowed: string,\n * time_limit_action: string,\n * tries: CMITries,\n * attempt_records: CMIAttemptRecords\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n tries: CMITries;\n attempt_records: CMIAttemptRecords;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n tries: this.tries,\n attempt_records: this.attempt_records,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport { CMIArray } from \"../common/array\";\nimport Regex from \"../../constants/regex\";\nimport APIConstants from \"../../constants/api_constants\";\n\n/**\n * Class representing the AICC `cmi.paths` object\n */\nexport class CMIPaths extends CMIArray {\n /**\n * Constructor for inline Paths Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.paths_children,\n });\n }\n}\n\n/**\n * Class for AICC Paths\n */\nexport class CMIPathsObject extends BaseCMI {\n /**\n * Constructor for AICC Paths objects\n */\n constructor() {\n super();\n }\n\n private _location_id = \"\";\n private _date = \"\";\n private _time = \"\";\n private _status = \"\";\n private _why_left = \"\";\n private _time_in_element = \"\";\n\n /**\n * Getter for _location_id\n * @return {string}\n */\n get location_id(): string {\n return this._location_id;\n }\n\n /**\n * Setter for _location_id\n * @param {string} location_id\n */\n set location_id(location_id: string) {\n if (checkAICCValidFormat(location_id, Regex.aicc.CMIString256)) {\n this._location_id = location_id;\n }\n }\n\n /**\n * Getter for _date\n * @return {string}\n */\n get date(): string {\n return this._date;\n }\n\n /**\n * Setter for _date\n * @param {string} date\n */\n set date(date: string) {\n if (checkAICCValidFormat(date, Regex.aicc.CMIString256)) {\n this._date = date;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (checkAICCValidFormat(status, Regex.aicc.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * Getter for _why_left\n * @return {string}\n */\n get why_left(): string {\n return this._why_left;\n }\n\n /**\n * Setter for _why_left\n * @param {string} why_left\n */\n set why_left(why_left: string) {\n if (checkAICCValidFormat(why_left, Regex.aicc.CMIString256)) {\n this._why_left = why_left;\n }\n }\n\n /**\n * Getter for _time_in_element\n * @return {string}\n */\n get time_in_element(): string {\n return this._time_in_element;\n }\n\n /**\n * Setter for _time_in_element\n * @param {string} time_in_element\n */\n set time_in_element(time_in_element: string) {\n if (checkAICCValidFormat(time_in_element, Regex.aicc.CMITime)) {\n this._time_in_element = time_in_element;\n }\n }\n\n /**\n * toJSON for cmi.paths.n object\n * @return {\n * {\n * location_id: string,\n * date: string,\n * time: string,\n * status: string,\n * why_left: string,\n * time_in_element: string\n * }\n * }\n */\n toJSON(): {\n location_id: string;\n date: string;\n time: string;\n status: string;\n why_left: string;\n time_in_element: string;\n } {\n this.jsonString = true;\n const result = {\n location_id: this.location_id,\n date: this.date,\n time: this.time,\n status: this.status,\n why_left: this.why_left,\n time_in_element: this.time_in_element,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import * as Scorm12CMI from \"../scorm12/cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMIEvaluation } from \"./evaluation\";\nimport { AICCStudentPreferences } from \"./student_preferences\";\nimport { CMIStudentDemographics } from \"./student_demographics\";\nimport { AICCCMIStudentData } from \"./student_data\";\nimport { CMIPaths } from \"./paths\";\nimport { CMICore } from \"./core\";\nimport { CMIObjectives } from \"../scorm12/objectives\";\nimport { CMIStudentData } from \"../scorm12/student_data\";\nimport { CMIStudentPreference } from \"../scorm12/student_preference\";\nimport { CMIInteractions } from \"../scorm12/interactions\";\n\n/**\n * CMI Class for AICC\n */\nexport class CMI extends Scorm12CMI.CMI {\n /**\n * Constructor for AICC CMI object\n * @param {boolean} initialized\n */\n constructor(initialized: boolean = false) {\n super(APIConstants.aicc.cmi_children);\n if (initialized) this.initialize();\n this.student_preference = new AICCStudentPreferences();\n this.student_data = new AICCCMIStudentData();\n this.student_demographics = new CMIStudentDemographics();\n this.evaluation = new CMIEvaluation();\n this.paths = new CMIPaths();\n }\n\n public student_data: AICCCMIStudentData;\n public student_preference: AICCStudentPreferences;\n public student_demographics: CMIStudentDemographics;\n public evaluation: CMIEvaluation;\n public paths: CMIPaths;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.student_preference?.initialize();\n this.student_data?.initialize();\n this.student_demographics?.initialize();\n this.evaluation?.initialize();\n this.paths?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions,\n * paths: CMIPaths\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n student_demographics: CMIStudentDemographics;\n interactions: CMIInteractions;\n evaluation: CMIEvaluation;\n paths: CMIPaths;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n student_demographics: this.student_demographics,\n interactions: this.interactions,\n evaluation: this.evaluation,\n paths: this.paths,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { Scorm12Impl } from \"./Scorm12API\";\nimport { CMI } from \"./cmi/aicc/cmi\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMITriesObject } from \"./cmi/aicc/tries\";\nimport { CMIAttemptRecordsObject } from \"./cmi/aicc/attempts\";\nimport { CMIEvaluationCommentsObject } from \"./cmi/aicc/evaluation\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport { CMIPathsObject } from \"./cmi/aicc/paths\";\nimport { Settings } from \"./types/api_types\";\nimport { stringMatches } from \"./utilities\";\n\n/**\n * The AICC API class\n */\nclass AICCImpl extends Scorm12Impl {\n /**\n * Constructor to create AICC API object\n * @param {Settings} settings\n */\n constructor(settings?: Settings) {\n super(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {any} value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI | null}\n */\n getChildElement(\n CMIElement: string,\n value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n let newChild = super.getChildElement(CMIElement, value, foundFirstIndex);\n\n if (!newChild) {\n if (stringMatches(CMIElement, \"cmi\\\\.evaluation\\\\.comments\\\\.\\\\d+\")) {\n newChild = new CMIEvaluationCommentsObject();\n } else if (\n stringMatches(CMIElement, \"cmi\\\\.student_data\\\\.tries\\\\.\\\\d+\")\n ) {\n newChild = new CMITriesObject();\n } else if (\n stringMatches(CMIElement, \"cmi\\\\.student_data\\\\.attempt_records\\\\.\\\\d+\")\n ) {\n newChild = new CMIAttemptRecordsObject();\n } else if (stringMatches(CMIElement, \"cmi\\\\.paths\\\\.\\\\d+\")) {\n newChild = new CMIPathsObject();\n }\n }\n\n return newChild;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {AICCImpl} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: AICCImpl) {\n // Data Model\n this.cmi = newAPI.cmi;\n this.nav = newAPI.nav;\n }\n}\n\nexport { AICCImpl };\n"],"names":["DefaultSettings","autocommit","autocommitSeconds","asyncCommit","sendFullCommit","lmsCommitUrl","dataCommitFormat","commitRequestDataType","autoProgress","logLevel","A","global","LOG_LEVEL_ERROR","selfReportSessionTime","alwaysSendTotalTime","renderCommonCommitFields","strict_errors","xhrHeaders","xhrWithCredentials","responseHandler","response","JSON","parse","text","httpResult","hasOwnProperty","call","result","errorCode","SCORM_TRUE","status","SCORM_FALSE","requestHandler","commitObject","onLogMessage","messageLevel","logMessage","console","error","LOG_LEVEL_WARNING","warn","LOG_LEVEL_INFO","info","LOG_LEVEL_DEBUG","debug","log","scoItemIds","scoItemIdValidator","API","when","callback","_cancelled","this","_API","_timeout","setTimeout","wrapper","bind","_callback","cancel","clearTimeout","commit","error_codes","settings","_settings","BaseAPI","TypeError","currentState","STATE_NOT_INITIALIZED","lastErrorCode","listenerArray","_error_codes","apiLogLevel","commonReset","initialize","callbackName","initializeMessage","terminationMessage","returnValue","isInitialized","throwSCORMError","INITIALIZED","isTerminated","TERMINATED","cmi","setStartTime","STATE_INITIALIZED","processListeners","apiLog","clearSCORMError","functionName","CMIElement","terminate","checkTerminated","checkState","TERMINATION_BEFORE_INIT","MULTIPLE_TERMINATION","STATE_TERMINATED","storeData","getValue","RETRIEVE_BEFORE_INIT","RETRIEVE_AFTER_TERM","getCMIValue","e","handleValueAccessException","undefined","setValue","commitCallback","value","String","STORE_BEFORE_INIT","STORE_AFTER_TERM","setCMIValue","scheduleCommit","clearScheduledCommit","COMMIT_BEFORE_INIT","COMMIT_AFTER_TERM","getLastError","getErrorString","CMIErrorCode","getLmsErrorMessageDetails","getDiagnostic","beforeInitError","afterTermError","isNotInitialized","_errorNumber","_detail","Error","_CMIElement","_value","_commonSetCMIValue","methodName","scorm2004","structure","split","refObject","foundFirstIndex","invalidErrorMessage","invalidErrorCode","UNDEFINED_DATA_MODEL","GENERAL","idx","length","attribute","substring","READ_ONLY_ELEMENT","_checkObjectHasProperty","validateCorrectResponse","index","parseInt","isNaN","item","childArray","newChild","getChildElement","initialized","push","_commonGetCMIValue","uninitializedErrorMessage","_isTargetValid","target","VALUE_NOT_INITIALIZED","scorm12","CHILDREN_ERROR","COUNT_ERROR","on","listenerName","listenerFunctions","i","listenerSplit","replace","off","removeIndex","findIndex","obj","splice","clear","filter","listener","functionsMatch","listenerHasCMIElement","CMIElementsMatch","indexOf","errorNumber","message","success","loadFromFlattenedJSON","json","int_pattern","obj_pattern","Object","keys","map","key","sort","test","a","c","testPattern","forEach","element","loadFromJSON","a_pattern","c_match","a_match","match","a_num","Number","c_num","startingData","currentCMIElement","constructor","renderCMIToJSONString","stringify","k","v","renderCMIToJSONObject","processHttpRequest","url","params","immediate","api","genericError","performFetch","then","transformResponse","process","debouncedProcess","func","wait","timeout","context","callNow","apply","args","debounce","ScheduledCommit","getOwnPropertyDescriptor","getPrototypeOf","fetch","method","body","Array","join","headers","credentials","keepalive","mastery_override","statusSetByModule","nav","LMSInitialize","lmsInitialize","LMSFinish","lmsFinish","LMSGetValue","lmsGetValue","LMSSetValue","lmsSetValue","LMSCommit","lmsCommit","LMSGetLastError","lmsGetLastError","LMSGetErrorString","lmsGetErrorString","LMSGetDiagnostic","lmsGetDiagnostic","reset","core","lesson_status","internalFinish","event","detail","basicMessage","detailMessage","error_descriptions","replaceWithAnotherScormAPI","newAPI","renderCommitCMI","terminateCommit","cmiExport","total_time","getCurrentTotalTime","flattened","renderCommitObject","totalTimeHHMMSS","totalTimeSeconds","CMITimespan","lessonStatus","completionStatus","unknown","successStatus","completed","incomplete","passed","failed","score","scoreObject","parseFloat","raw","min","max","runtimeData","originalStatus","lesson_mode","credit","student_data","mastery_score","shouldTerminateCommit","scorm12_error_codes","__children","children","_errorCode","_errorClass","errorClass","_children","_count","toJSON","jsonString","_initialized","_start_time","Date","getTime","BaseCMI","scorm12_constants","scorm12_regex","_raw","_min","score_children","__score_range","score_range","_max","__invalid_error_code","INVALID_SET_VALUE","__invalid_type_code","invalidTypeCode","TYPE_MISMATCH","__invalid_range_code","invalidRangeCode","VALUE_OUT_OF_RANGE","__decimal_regex","decimalRegex","CMIDecimal","__error_class","checkValidFormat","regexPattern","allowEmptyString","formatRegex","RegExp","matches","checkValidRange","rangePattern","ranges","core_children","_student_id","_student_name","_lesson_location","_credit","_lesson_status","_entry","_total_time","_lesson_mode","_exit","_session_time","_suspend_data","student_id","student_name","lesson_location","CMIString256","CMIStatus","CMIStatus2","entry","WRITE_ONLY_ELEMENT","exit","CMIExit","session_time","suspend_data","CMIString4096","start_time","sessionTime","startTime","seconds","cmi_children","__version","_launch_data","_comments","_comments_from_lms","CMICore","objectives","C","student_preference","interactions","launch_data","comments","comments_from_lms","_version","interactions_children","_id","_time","_type","_weighting","_student_response","_result","_latency","objectives_children","correct_responses","correct_responses_children","id","CMIIdentifier","time","CMITime","type","CMIType","weighting","weighting_range","student_response","CMIFeedback","CMIResult","latency","_pattern","pattern","_event","NAVEvent","_status","student_data_children","_mastery_score","_max_time_allowed","_time_limit_action","max_time_allowed","time_limit_action","student_preference_children","_audio","_language","_speed","_text","audio","CMISInteger","audio_range","language","speed","speed_range","text_range","check12ValidFormat","check12ValidRange","comments_children","APIConstants","LOG_LEVEL_NONE","aicc","student_demographics_children","tries_children","attempt_records_children","paths_children","NAVBoolean","SuccessStatus","CompletionStatus","INITIALIZATION_FAILED","TERMINATION_FAILURE","ARGUMENT_ERROR","GENERAL_GET_FAILURE","GENERAL_SET_FAILURE","GENERAL_COMMIT_FAILURE","UNIMPLEMENTED_ELEMENT","DEPENDENCY_NOT_ESTABLISHED","ErrorCodes","MULTIPLE_TERMINATIONS","CMIInteger","CMIIndex","Regex","CMIString200","CMIString250","CMIString1000","CMIString4000","CMIString64000","CMILang","CMILangString250","CMILangcr","CMILangString250cr","CMILangString4000","CMIShortIdentifier","CMILongIdentifier","CMIIndexStore","CMICStatus","CMISStatus","NAVTarget","scaled_range","progress_range","scorm12_errors","aicc_errors","scorm2004_errors","toString","name","setMessage","errorMessage","detailedMessage","_detailedMessage","_errorMessage","BaseScormValidationError","ValidationError","SECONDS_PER_HOUR","getSecondsAsHHMMSS","totalSeconds","hours","Math","floor","dateObj","minutes","getUTCMinutes","getSeconds","ms","msStr","countDecimals","toFixed","getTimeAsSeconds","timeString","timeRegex","parts","addHHMMSSTimeStrings","first","second","flatten","data","recurse","cur","prop","isArray","l","isEmpty","p","unflatten","regex","m","exec","num","formatMessage","messageString","fillChars","j","stringMatches","str","tester","extendStatics","d","b","setPrototypeOf","__proto__","prototype","__extends","__","create","__assign","assign","t","s","n","arguments","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","step","next","rejected","done","__generator","f","y","_","label","sent","trys","ops","g","Iterator","verb","Symbol","iterator","op","pop","SuppressedError","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","__webpack_modules__","definition","o","defineProperty","enumerable","get","aicc_error_codes","checkAICCValidFormat","CMIEvaluationComments","_content","_location","content","location","_lesson_type","_text_color","_text_location","_text_size","_video","windows","lesson_type","text_color","text_location","text_size","video","_city","_class","_company","_country","_experience","_familiar_name","_instructor_name","_title","_native_language","_state","_street_address","_telephone","_years_experience","city","clazz","company","country","experience","familiar_name","instructor_name","title","native_language","state","street_address","telephone","years_experience","class","_tries_during_lesson","tries","CMITries","attempt_records","CMIAttemptRecords","tries_during_lesson","_location_id","_date","_why_left","_time_in_element","location_id","date","why_left","time_in_element","AICCStudentPreferences","AICCCMIStudentData","student_demographics","CMIStudentDemographics","evaluation","CMIEvaluation","paths","CMIPaths","CMI","CMIEvaluationCommentsObject","CMITriesObject","CMIAttemptRecordsObject","CMIPathsObject"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/esm/scorm-again.js b/dist/esm/scorm-again.js new file mode 100644 index 0000000..ba400fd --- /dev/null +++ b/dist/esm/scorm-again.js @@ -0,0 +1,6975 @@ +/******/ var __webpack_modules__ = ({ + +/***/ 531: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + X: function() { return /* binding */ AICCImpl; } +}); + +// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs +var tslib_es6 = __webpack_require__(635); +// EXTERNAL MODULE: ./src/Scorm12API.ts +var Scorm12API = __webpack_require__(941); +// EXTERNAL MODULE: ./src/cmi/scorm12/cmi.ts + 1 modules +var cmi = __webpack_require__(989); +// EXTERNAL MODULE: ./src/constants/api_constants.ts +var api_constants = __webpack_require__(340); +// EXTERNAL MODULE: ./src/cmi/common/array.ts +var array = __webpack_require__(589); +// EXTERNAL MODULE: ./src/exceptions.ts +var exceptions = __webpack_require__(784); +// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts +var base_cmi = __webpack_require__(319); +// EXTERNAL MODULE: ./src/constants/error_codes.ts +var error_codes = __webpack_require__(797); +// EXTERNAL MODULE: ./src/cmi/common/validation.ts +var validation = __webpack_require__(449); +;// ./src/cmi/aicc/validation.ts + + + +var aicc_error_codes = error_codes/* default */.A.scorm12; +function checkAICCValidFormat(value, regexPattern, allowEmptyString) { + return (0,validation/* checkValidFormat */.q)(value, regexPattern, aicc_error_codes.TYPE_MISMATCH, exceptions/* AICCValidationError */.gv, allowEmptyString); +} + +// EXTERNAL MODULE: ./src/constants/regex.ts +var regex = __webpack_require__(417); +;// ./src/cmi/aicc/evaluation.ts + + + + + + + + +var CMIEvaluation = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIEvaluation, _super); + function CMIEvaluation() { + var _this = _super.call(this) || this; + _this.comments = new CMIEvaluationComments(); + return _this; + } + CMIEvaluation.prototype.initialize = function () { + var _a; + _super.prototype.initialize.call(this); + (_a = this.comments) === null || _a === void 0 ? void 0 : _a.initialize(); + }; + CMIEvaluation.prototype.toJSON = function () { + this.jsonString = true; + var result = { + comments: this.comments, + }; + delete this.jsonString; + return result; + }; + return CMIEvaluation; +}(base_cmi/* BaseCMI */.J)); + +var CMIEvaluationComments = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIEvaluationComments, _super); + function CMIEvaluationComments() { + return _super.call(this, { + children: api_constants/* default */.A.aicc.comments_children, + errorCode: error_codes/* default */.A.scorm12.INVALID_SET_VALUE, + errorClass: exceptions/* AICCValidationError */.gv, + }) || this; + } + return CMIEvaluationComments; +}(array/* CMIArray */.B)); +var CMIEvaluationCommentsObject = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIEvaluationCommentsObject, _super); + function CMIEvaluationCommentsObject() { + var _this = _super.call(this) || this; + _this._content = ""; + _this._location = ""; + _this._time = ""; + return _this; + } + Object.defineProperty(CMIEvaluationCommentsObject.prototype, "content", { + get: function () { + return this._content; + }, + set: function (content) { + if (checkAICCValidFormat(content, regex/* default */.A.aicc.CMIString256)) { + this._content = content; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIEvaluationCommentsObject.prototype, "location", { + get: function () { + return this._location; + }, + set: function (location) { + if (checkAICCValidFormat(location, regex/* default */.A.aicc.CMIString256)) { + this._location = location; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIEvaluationCommentsObject.prototype, "time", { + get: function () { + return this._time; + }, + set: function (time) { + if (checkAICCValidFormat(time, regex/* default */.A.aicc.CMITime)) { + this._time = time; + } + }, + enumerable: false, + configurable: true + }); + CMIEvaluationCommentsObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + content: this.content, + location: this.location, + time: this.time, + }; + delete this.jsonString; + return result; + }; + return CMIEvaluationCommentsObject; +}(base_cmi/* BaseCMI */.J)); + + +// EXTERNAL MODULE: ./src/cmi/scorm12/student_preference.ts +var student_preference = __webpack_require__(181); +;// ./src/cmi/aicc/student_preferences.ts + + + + + + + + +var AICCStudentPreferences = (function (_super) { + (0,tslib_es6/* __extends */.C6)(AICCStudentPreferences, _super); + function AICCStudentPreferences() { + var _this = _super.call(this, api_constants/* default */.A.aicc.student_preference_children) || this; + _this._lesson_type = ""; + _this._text_color = ""; + _this._text_location = ""; + _this._text_size = ""; + _this._video = ""; + _this.windows = new array/* CMIArray */.B({ + errorCode: error_codes/* default */.A.scorm12.INVALID_SET_VALUE, + errorClass: exceptions/* AICCValidationError */.gv, + children: "", + }); + return _this; + } + AICCStudentPreferences.prototype.initialize = function () { + var _a; + _super.prototype.initialize.call(this); + (_a = this.windows) === null || _a === void 0 ? void 0 : _a.initialize(); + }; + Object.defineProperty(AICCStudentPreferences.prototype, "lesson_type", { + get: function () { + return this._lesson_type; + }, + set: function (lesson_type) { + if (checkAICCValidFormat(lesson_type, regex/* default */.A.aicc.CMIString256)) { + this._lesson_type = lesson_type; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(AICCStudentPreferences.prototype, "text_color", { + get: function () { + return this._text_color; + }, + set: function (text_color) { + if (checkAICCValidFormat(text_color, regex/* default */.A.aicc.CMIString256)) { + this._text_color = text_color; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(AICCStudentPreferences.prototype, "text_location", { + get: function () { + return this._text_location; + }, + set: function (text_location) { + if (checkAICCValidFormat(text_location, regex/* default */.A.aicc.CMIString256)) { + this._text_location = text_location; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(AICCStudentPreferences.prototype, "text_size", { + get: function () { + return this._text_size; + }, + set: function (text_size) { + if (checkAICCValidFormat(text_size, regex/* default */.A.aicc.CMIString256)) { + this._text_size = text_size; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(AICCStudentPreferences.prototype, "video", { + get: function () { + return this._video; + }, + set: function (video) { + if (checkAICCValidFormat(video, regex/* default */.A.aicc.CMIString256)) { + this._video = video; + } + }, + enumerable: false, + configurable: true + }); + AICCStudentPreferences.prototype.toJSON = function () { + this.jsonString = true; + var result = { + audio: this.audio, + language: this.language, + lesson_type: this.lesson_type, + speed: this.speed, + text: this.text, + text_color: this.text_color, + text_location: this.text_location, + text_size: this.text_size, + video: this.video, + windows: this.windows, + }; + delete this.jsonString; + return result; + }; + return AICCStudentPreferences; +}(student_preference/* CMIStudentPreference */.G)); + + +;// ./src/cmi/aicc/student_demographics.ts + + + + + +var CMIStudentDemographics = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIStudentDemographics, _super); + function CMIStudentDemographics() { + var _this = _super.call(this) || this; + _this.__children = api_constants/* default */.A.aicc.student_demographics_children; + _this._city = ""; + _this._class = ""; + _this._company = ""; + _this._country = ""; + _this._experience = ""; + _this._familiar_name = ""; + _this._instructor_name = ""; + _this._title = ""; + _this._native_language = ""; + _this._state = ""; + _this._street_address = ""; + _this._telephone = ""; + _this._years_experience = ""; + return _this; + } + Object.defineProperty(CMIStudentDemographics.prototype, "_children", { + get: function () { + return this.__children; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "city", { + get: function () { + return this._city; + }, + set: function (city) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._city = city; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "class", { + get: function () { + return this._class; + }, + set: function (clazz) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._class = clazz; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "company", { + get: function () { + return this._company; + }, + set: function (company) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._company = company; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "country", { + get: function () { + return this._country; + }, + set: function (country) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._country = country; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "experience", { + get: function () { + return this._experience; + }, + set: function (experience) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._experience = experience; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "familiar_name", { + get: function () { + return this._familiar_name; + }, + set: function (familiar_name) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._familiar_name = familiar_name; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "instructor_name", { + get: function () { + return this._instructor_name; + }, + set: function (instructor_name) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._instructor_name = instructor_name; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "title", { + get: function () { + return this._title; + }, + set: function (title) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._title = title; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "native_language", { + get: function () { + return this._native_language; + }, + set: function (native_language) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._native_language = native_language; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "state", { + get: function () { + return this._state; + }, + set: function (state) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._state = state; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "street_address", { + get: function () { + return this._street_address; + }, + set: function (street_address) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._street_address = street_address; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "telephone", { + get: function () { + return this._telephone; + }, + set: function (telephone) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._telephone = telephone; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "years_experience", { + get: function () { + return this._years_experience; + }, + set: function (years_experience) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._years_experience = years_experience; + } + }, + enumerable: false, + configurable: true + }); + CMIStudentDemographics.prototype.toJSON = function () { + this.jsonString = true; + var result = { + city: this.city, + class: this.class, + company: this.company, + country: this.country, + experience: this.experience, + familiar_name: this.familiar_name, + instructor_name: this.instructor_name, + title: this.title, + native_language: this.native_language, + state: this.state, + street_address: this.street_address, + telephone: this.telephone, + years_experience: this.years_experience, + }; + delete this.jsonString; + return result; + }; + return CMIStudentDemographics; +}(base_cmi/* BaseCMI */.J)); + + +// EXTERNAL MODULE: ./src/cmi/common/score.ts +var score = __webpack_require__(434); +;// ./src/cmi/aicc/tries.ts + + + + + + + + + +var CMITries = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMITries, _super); + function CMITries() { + return _super.call(this, { + children: api_constants/* default */.A.aicc.tries_children, + }) || this; + } + return CMITries; +}(array/* CMIArray */.B)); + +var CMITriesObject = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMITriesObject, _super); + function CMITriesObject() { + var _this = _super.call(this) || this; + _this._status = ""; + _this._time = ""; + _this.score = new score/* CMIScore */._({ + score_children: api_constants/* default */.A.aicc.score_children, + score_range: regex/* default */.A.aicc.score_range, + invalidErrorCode: error_codes/* default */.A.scorm12.INVALID_SET_VALUE, + invalidTypeCode: error_codes/* default */.A.scorm12.TYPE_MISMATCH, + invalidRangeCode: error_codes/* default */.A.scorm12.VALUE_OUT_OF_RANGE, + errorClass: exceptions/* AICCValidationError */.gv, + }); + return _this; + } + CMITriesObject.prototype.initialize = function () { + var _a; + _super.prototype.initialize.call(this); + (_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize(); + }; + Object.defineProperty(CMITriesObject.prototype, "status", { + get: function () { + return this._status; + }, + set: function (status) { + if (checkAICCValidFormat(status, regex/* default */.A.aicc.CMIStatus2)) { + this._status = status; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMITriesObject.prototype, "time", { + get: function () { + return this._time; + }, + set: function (time) { + if (checkAICCValidFormat(time, regex/* default */.A.aicc.CMITime)) { + this._time = time; + } + }, + enumerable: false, + configurable: true + }); + CMITriesObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + status: this.status, + time: this.time, + score: this.score, + }; + delete this.jsonString; + return result; + }; + return CMITriesObject; +}(base_cmi/* BaseCMI */.J)); + + +// EXTERNAL MODULE: ./src/cmi/scorm12/student_data.ts +var student_data = __webpack_require__(532); +;// ./src/cmi/aicc/attempts.ts + + + + + + + + + +var CMIAttemptRecords = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIAttemptRecords, _super); + function CMIAttemptRecords() { + return _super.call(this, { + children: api_constants/* default */.A.aicc.attempt_records_children, + }) || this; + } + return CMIAttemptRecords; +}(array/* CMIArray */.B)); + +var CMIAttemptRecordsObject = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIAttemptRecordsObject, _super); + function CMIAttemptRecordsObject() { + var _this = _super.call(this) || this; + _this._lesson_status = ""; + _this.score = new score/* CMIScore */._({ + score_children: api_constants/* default */.A.aicc.score_children, + score_range: regex/* default */.A.aicc.score_range, + invalidErrorCode: error_codes/* default */.A.scorm12.INVALID_SET_VALUE, + invalidTypeCode: error_codes/* default */.A.scorm12.TYPE_MISMATCH, + invalidRangeCode: error_codes/* default */.A.scorm12.VALUE_OUT_OF_RANGE, + errorClass: exceptions/* AICCValidationError */.gv, + }); + return _this; + } + CMIAttemptRecordsObject.prototype.initialize = function () { + var _a; + _super.prototype.initialize.call(this); + (_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize(); + }; + Object.defineProperty(CMIAttemptRecordsObject.prototype, "lesson_status", { + get: function () { + return this._lesson_status; + }, + set: function (lesson_status) { + if (checkAICCValidFormat(lesson_status, regex/* default */.A.aicc.CMIStatus2)) { + this._lesson_status = lesson_status; + } + }, + enumerable: false, + configurable: true + }); + CMIAttemptRecordsObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + lesson_status: this.lesson_status, + score: this.score, + }; + delete this.jsonString; + return result; + }; + return CMIAttemptRecordsObject; +}(base_cmi/* BaseCMI */.J)); + + +;// ./src/cmi/aicc/student_data.ts + + + + + + + +var AICCCMIStudentData = (function (_super) { + (0,tslib_es6/* __extends */.C6)(AICCCMIStudentData, _super); + function AICCCMIStudentData() { + var _this = _super.call(this, api_constants/* default */.A.aicc.student_data_children) || this; + _this._tries_during_lesson = ""; + _this.tries = new CMITries(); + _this.attempt_records = new CMIAttemptRecords(); + return _this; + } + AICCCMIStudentData.prototype.initialize = function () { + var _a, _b; + _super.prototype.initialize.call(this); + (_a = this.tries) === null || _a === void 0 ? void 0 : _a.initialize(); + (_b = this.attempt_records) === null || _b === void 0 ? void 0 : _b.initialize(); + }; + Object.defineProperty(AICCCMIStudentData.prototype, "tries_during_lesson", { + get: function () { + return this._tries_during_lesson; + }, + set: function (tries_during_lesson) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._tries_during_lesson = tries_during_lesson; + } + }, + enumerable: false, + configurable: true + }); + AICCCMIStudentData.prototype.toJSON = function () { + this.jsonString = true; + var result = { + mastery_score: this.mastery_score, + max_time_allowed: this.max_time_allowed, + time_limit_action: this.time_limit_action, + tries: this.tries, + attempt_records: this.attempt_records, + }; + delete this.jsonString; + return result; + }; + return AICCCMIStudentData; +}(student_data/* CMIStudentData */.X)); + + +;// ./src/cmi/aicc/paths.ts + + + + + + +var CMIPaths = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIPaths, _super); + function CMIPaths() { + return _super.call(this, { + children: api_constants/* default */.A.aicc.paths_children, + }) || this; + } + return CMIPaths; +}(array/* CMIArray */.B)); + +var CMIPathsObject = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIPathsObject, _super); + function CMIPathsObject() { + var _this = _super.call(this) || this; + _this._location_id = ""; + _this._date = ""; + _this._time = ""; + _this._status = ""; + _this._why_left = ""; + _this._time_in_element = ""; + return _this; + } + Object.defineProperty(CMIPathsObject.prototype, "location_id", { + get: function () { + return this._location_id; + }, + set: function (location_id) { + if (checkAICCValidFormat(location_id, regex/* default */.A.aicc.CMIString256)) { + this._location_id = location_id; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIPathsObject.prototype, "date", { + get: function () { + return this._date; + }, + set: function (date) { + if (checkAICCValidFormat(date, regex/* default */.A.aicc.CMIString256)) { + this._date = date; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIPathsObject.prototype, "time", { + get: function () { + return this._time; + }, + set: function (time) { + if (checkAICCValidFormat(time, regex/* default */.A.aicc.CMITime)) { + this._time = time; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIPathsObject.prototype, "status", { + get: function () { + return this._status; + }, + set: function (status) { + if (checkAICCValidFormat(status, regex/* default */.A.aicc.CMIStatus2)) { + this._status = status; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIPathsObject.prototype, "why_left", { + get: function () { + return this._why_left; + }, + set: function (why_left) { + if (checkAICCValidFormat(why_left, regex/* default */.A.aicc.CMIString256)) { + this._why_left = why_left; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIPathsObject.prototype, "time_in_element", { + get: function () { + return this._time_in_element; + }, + set: function (time_in_element) { + if (checkAICCValidFormat(time_in_element, regex/* default */.A.aicc.CMITime)) { + this._time_in_element = time_in_element; + } + }, + enumerable: false, + configurable: true + }); + CMIPathsObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + location_id: this.location_id, + date: this.date, + time: this.time, + status: this.status, + why_left: this.why_left, + time_in_element: this.time_in_element, + }; + delete this.jsonString; + return result; + }; + return CMIPathsObject; +}(base_cmi/* BaseCMI */.J)); + + +;// ./src/cmi/aicc/cmi.ts + + + + + + + + +var CMI = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMI, _super); + function CMI(initialized) { + if (initialized === void 0) { initialized = false; } + var _this = _super.call(this, api_constants/* default */.A.aicc.cmi_children) || this; + if (initialized) + _this.initialize(); + _this.student_preference = new AICCStudentPreferences(); + _this.student_data = new AICCCMIStudentData(); + _this.student_demographics = new CMIStudentDemographics(); + _this.evaluation = new CMIEvaluation(); + _this.paths = new CMIPaths(); + return _this; + } + CMI.prototype.initialize = function () { + var _a, _b, _c, _d, _e; + _super.prototype.initialize.call(this); + (_a = this.student_preference) === null || _a === void 0 ? void 0 : _a.initialize(); + (_b = this.student_data) === null || _b === void 0 ? void 0 : _b.initialize(); + (_c = this.student_demographics) === null || _c === void 0 ? void 0 : _c.initialize(); + (_d = this.evaluation) === null || _d === void 0 ? void 0 : _d.initialize(); + (_e = this.paths) === null || _e === void 0 ? void 0 : _e.initialize(); + }; + CMI.prototype.toJSON = function () { + this.jsonString = true; + var result = { + suspend_data: this.suspend_data, + launch_data: this.launch_data, + comments: this.comments, + comments_from_lms: this.comments_from_lms, + core: this.core, + objectives: this.objectives, + student_data: this.student_data, + student_preference: this.student_preference, + student_demographics: this.student_demographics, + interactions: this.interactions, + evaluation: this.evaluation, + paths: this.paths, + }; + delete this.jsonString; + return result; + }; + return CMI; +}(cmi/* CMI */.Y)); + + +// EXTERNAL MODULE: ./src/cmi/scorm12/nav.ts +var nav = __webpack_require__(331); +// EXTERNAL MODULE: ./src/utilities.ts +var utilities = __webpack_require__(864); +;// ./src/AICC.ts + + + + + + + + + +var AICCImpl = (function (_super) { + (0,tslib_es6/* __extends */.C6)(AICCImpl, _super); + function AICCImpl(settings) { + var _this = _super.call(this, settings) || this; + _this.cmi = new CMI(); + _this.nav = new nav/* NAV */.A(); + return _this; + } + AICCImpl.prototype.getChildElement = function (CMIElement, value, foundFirstIndex) { + var newChild = _super.prototype.getChildElement.call(this, CMIElement, value, foundFirstIndex); + if (!newChild) { + if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.evaluation\\.comments\\.\\d+")) { + newChild = new CMIEvaluationCommentsObject(); + } + else if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.student_data\\.tries\\.\\d+")) { + newChild = new CMITriesObject(); + } + else if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.student_data\\.attempt_records\\.\\d+")) { + newChild = new CMIAttemptRecordsObject(); + } + else if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.paths\\.\\d+")) { + newChild = new CMIPathsObject(); + } + } + return newChild; + }; + AICCImpl.prototype.replaceWithAnotherScormAPI = function (newAPI) { + this.cmi = newAPI.cmi; + this.nav = newAPI.nav; + }; + return AICCImpl; +}(Scorm12API/* Scorm12Impl */.C)); + + + +/***/ }), + +/***/ 900: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + A: function() { return /* binding */ src_BaseAPI; } +}); + +// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs +var tslib_es6 = __webpack_require__(635); +// EXTERNAL MODULE: ./src/cmi/common/array.ts +var array = __webpack_require__(589); +// EXTERNAL MODULE: ./src/exceptions.ts +var exceptions = __webpack_require__(784); +// EXTERNAL MODULE: ./src/constants/error_codes.ts +var error_codes = __webpack_require__(797); +// EXTERNAL MODULE: ./src/constants/api_constants.ts +var api_constants = __webpack_require__(340); +// EXTERNAL MODULE: ./src/utilities.ts +var utilities = __webpack_require__(864); +;// ./src/utilities/debounce.ts +function debounce(func, wait, immediate) { + if (immediate === void 0) { immediate = false; } + var timeout; + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var context = this; + var later = function () { + timeout = null; + if (!immediate) + func.apply(context, args); + }; + var callNow = immediate && !timeout; + if (timeout) + clearTimeout(timeout); + timeout = setTimeout(later, wait); + if (callNow) + func.apply(context, args); + }; +} + +;// ./src/constants/default_settings.ts + + +var DefaultSettings = { + autocommit: false, + autocommitSeconds: 10, + asyncCommit: false, + sendFullCommit: true, + lmsCommitUrl: false, + dataCommitFormat: "json", + commitRequestDataType: "application/json;charset=UTF-8", + autoProgress: false, + logLevel: api_constants/* default */.A.global.LOG_LEVEL_ERROR, + selfReportSessionTime: false, + alwaysSendTotalTime: false, + renderCommonCommitFields: false, + strict_errors: true, + xhrHeaders: {}, + xhrWithCredentials: false, + responseHandler: function (response) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + var httpResult, _a, _b; + return (0,tslib_es6/* __generator */.YH)(this, function (_c) { + switch (_c.label) { + case 0: + if (!(typeof response !== "undefined")) return [3, 2]; + _b = (_a = JSON).parse; + return [4, response.text()]; + case 1: + httpResult = _b.apply(_a, [_c.sent()]); + if (httpResult === null || + !{}.hasOwnProperty.call(httpResult, "result")) { + if (response.status === 200) { + return [2, { + result: api_constants/* default */.A.global.SCORM_TRUE, + errorCode: 0, + }]; + } + else { + return [2, { + result: api_constants/* default */.A.global.SCORM_FALSE, + errorCode: 101, + }]; + } + } + else { + return [2, { + result: httpResult.result, + errorCode: httpResult.errorCode + ? httpResult.errorCode + : httpResult.result === api_constants/* default */.A.global.SCORM_TRUE + ? 0 + : 101, + }]; + } + _c.label = 2; + case 2: return [2, { + result: api_constants/* default */.A.global.SCORM_FALSE, + errorCode: 101, + }]; + } + }); + }); + }, + requestHandler: function (commitObject) { + return commitObject; + }, + onLogMessage: function (messageLevel, logMessage) { + switch (messageLevel) { + case api_constants/* default */.A.global.LOG_LEVEL_ERROR: + console.error(logMessage); + break; + case api_constants/* default */.A.global.LOG_LEVEL_WARNING: + console.warn(logMessage); + break; + case api_constants/* default */.A.global.LOG_LEVEL_INFO: + console.info(logMessage); + break; + case api_constants/* default */.A.global.LOG_LEVEL_DEBUG: + if (console.debug) { + console.debug(logMessage); + } + else { + console.log(logMessage); + } + break; + } + }, + scoItemIds: [], + scoItemIdValidator: false, +}; + +;// ./src/helpers/scheduled_commit.ts + +var ScheduledCommit = (function () { + function ScheduledCommit(API, when, callback) { + this._cancelled = false; + this._API = API; + this._timeout = setTimeout(this.wrapper.bind(this), when); + this._callback = callback; + } + ScheduledCommit.prototype.cancel = function () { + this._cancelled = true; + if (this._timeout) { + clearTimeout(this._timeout); + } + }; + ScheduledCommit.prototype.wrapper = function () { + var _this = this; + if (!this._cancelled) { + (function () { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this._API.commit(this._callback)]; + case 1: return [2, _a.sent()]; + } + }); }); })(); + } + }; + return ScheduledCommit; +}()); + + +;// ./src/BaseAPI.ts + + + + + + + + + +var BaseAPI = (function () { + function BaseAPI(error_codes, settings) { + var _newTarget = this.constructor; + this._settings = DefaultSettings; + if (_newTarget === BaseAPI) { + throw new TypeError("Cannot construct BaseAPI instances directly"); + } + this.currentState = api_constants/* default */.A.global.STATE_NOT_INITIALIZED; + this.lastErrorCode = "0"; + this.listenerArray = []; + this._error_codes = error_codes; + if (settings) { + this.settings = settings; + } + this.apiLogLevel = this.settings.logLevel; + this.selfReportSessionTime = this.settings.selfReportSessionTime; + } + BaseAPI.prototype.commonReset = function (settings) { + this.settings = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, this.settings), settings); + this.currentState = api_constants/* default */.A.global.STATE_NOT_INITIALIZED; + this.lastErrorCode = "0"; + this.listenerArray = []; + }; + BaseAPI.prototype.initialize = function (callbackName, initializeMessage, terminationMessage) { + var returnValue = api_constants/* default */.A.global.SCORM_FALSE; + if (this.isInitialized()) { + this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage); + } + else if (this.isTerminated()) { + this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage); + } + else { + if (this.selfReportSessionTime) { + this.cmi.setStartTime(); + } + this.currentState = api_constants/* default */.A.global.STATE_INITIALIZED; + this.lastErrorCode = "0"; + returnValue = api_constants/* default */.A.global.SCORM_TRUE; + this.processListeners(callbackName); + } + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + this.clearSCORMError(returnValue); + return returnValue; + }; + BaseAPI.prototype.apiLog = function (functionName, logMessage, messageLevel, CMIElement) { + logMessage = (0,utilities/* formatMessage */.hw)(functionName, logMessage, CMIElement); + if (messageLevel >= this.apiLogLevel) { + this.settings.onLogMessage(messageLevel, logMessage); + } + }; + Object.defineProperty(BaseAPI.prototype, "error_codes", { + get: function () { + return this._error_codes; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BaseAPI.prototype, "settings", { + get: function () { + return this._settings; + }, + set: function (settings) { + this._settings = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, this._settings), settings); + }, + enumerable: false, + configurable: true + }); + BaseAPI.prototype.terminate = function (callbackName, checkTerminated) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + var returnValue, result; + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: + returnValue = api_constants/* default */.A.global.SCORM_FALSE; + if (!this.checkState(checkTerminated, this._error_codes.TERMINATION_BEFORE_INIT, this._error_codes.MULTIPLE_TERMINATION)) return [3, 2]; + this.currentState = api_constants/* default */.A.global.STATE_TERMINATED; + return [4, this.storeData(true)]; + case 1: + result = _a.sent(); + if (typeof result.errorCode !== "undefined" && result.errorCode > 0) { + this.throwSCORMError(result.errorCode); + } + returnValue = + typeof result !== "undefined" && result.result + ? result.result + : api_constants/* default */.A.global.SCORM_FALSE; + if (checkTerminated) + this.lastErrorCode = "0"; + returnValue = api_constants/* default */.A.global.SCORM_TRUE; + this.processListeners(callbackName); + _a.label = 2; + case 2: + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + this.clearSCORMError(returnValue); + return [2, returnValue]; + } + }); + }); + }; + BaseAPI.prototype.getValue = function (callbackName, checkTerminated, CMIElement) { + var returnValue = ""; + if (this.checkState(checkTerminated, this._error_codes.RETRIEVE_BEFORE_INIT, this._error_codes.RETRIEVE_AFTER_TERM)) { + if (checkTerminated) + this.lastErrorCode = "0"; + try { + returnValue = this.getCMIValue(CMIElement); + } + catch (e) { + returnValue = this.handleValueAccessException(e, returnValue); + } + this.processListeners(callbackName, CMIElement); + } + this.apiLog(callbackName, ": returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); + if (returnValue === undefined) { + return ""; + } + this.clearSCORMError(returnValue); + return returnValue; + }; + BaseAPI.prototype.setValue = function (callbackName, commitCallback, checkTerminated, CMIElement, value) { + if (value !== undefined) { + value = String(value); + } + var returnValue = api_constants/* default */.A.global.SCORM_FALSE; + if (this.checkState(checkTerminated, this._error_codes.STORE_BEFORE_INIT, this._error_codes.STORE_AFTER_TERM)) { + if (checkTerminated) + this.lastErrorCode = "0"; + try { + returnValue = this.setCMIValue(CMIElement, value); + } + catch (e) { + this.handleValueAccessException(e, returnValue); + } + this.processListeners(callbackName, CMIElement, value); + } + if (returnValue === undefined) { + returnValue = api_constants/* default */.A.global.SCORM_FALSE; + } + if (String(this.lastErrorCode) === "0") { + if (this.settings.autocommit && !this._timeout) { + this.scheduleCommit(this.settings.autocommitSeconds * 1000, commitCallback); + } + } + this.apiLog(callbackName, ": " + value + ": result: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); + this.clearSCORMError(returnValue); + return returnValue; + }; + BaseAPI.prototype.commit = function (callbackName_1) { + return (0,tslib_es6/* __awaiter */.sH)(this, arguments, void 0, function (callbackName, checkTerminated) { + var returnValue, result; + if (checkTerminated === void 0) { checkTerminated = false; } + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: + this.clearScheduledCommit(); + returnValue = api_constants/* default */.A.global.SCORM_FALSE; + if (!this.checkState(checkTerminated, this._error_codes.COMMIT_BEFORE_INIT, this._error_codes.COMMIT_AFTER_TERM)) return [3, 2]; + return [4, this.storeData(false)]; + case 1: + result = _a.sent(); + if (result.errorCode && result.errorCode > 0) { + this.throwSCORMError(result.errorCode); + } + returnValue = + typeof result !== "undefined" && result.result + ? result.result + : api_constants/* default */.A.global.SCORM_FALSE; + this.apiLog(callbackName, " Result: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_DEBUG, "HttpRequest"); + if (checkTerminated) + this.lastErrorCode = "0"; + this.processListeners(callbackName); + _a.label = 2; + case 2: + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + this.clearSCORMError(returnValue); + return [2, returnValue]; + } + }); + }); + }; + BaseAPI.prototype.getLastError = function (callbackName) { + var returnValue = String(this.lastErrorCode); + this.processListeners(callbackName); + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + return returnValue; + }; + BaseAPI.prototype.getErrorString = function (callbackName, CMIErrorCode) { + var returnValue = ""; + if (CMIErrorCode !== null && CMIErrorCode !== "") { + returnValue = this.getLmsErrorMessageDetails(CMIErrorCode); + this.processListeners(callbackName); + } + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + return returnValue; + }; + BaseAPI.prototype.getDiagnostic = function (callbackName, CMIErrorCode) { + var returnValue = ""; + if (CMIErrorCode !== null && CMIErrorCode !== "") { + returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true); + this.processListeners(callbackName); + } + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + return returnValue; + }; + BaseAPI.prototype.checkState = function (checkTerminated, beforeInitError, afterTermError) { + if (this.isNotInitialized()) { + this.throwSCORMError(beforeInitError); + return false; + } + else if (checkTerminated && this.isTerminated()) { + this.throwSCORMError(afterTermError); + return false; + } + return true; + }; + BaseAPI.prototype.getLmsErrorMessageDetails = function (_errorNumber, _detail) { + if (_detail === void 0) { _detail = false; } + throw new Error("The getLmsErrorMessageDetails method has not been implemented"); + }; + BaseAPI.prototype.getCMIValue = function (_CMIElement) { + throw new Error("The getCMIValue method has not been implemented"); + }; + BaseAPI.prototype.setCMIValue = function (_CMIElement, _value) { + throw new Error("The setCMIValue method has not been implemented"); + }; + BaseAPI.prototype._commonSetCMIValue = function (methodName, scorm2004, CMIElement, value) { + if (!CMIElement || CMIElement === "") { + return api_constants/* default */.A.global.SCORM_FALSE; + } + var structure = CMIElement.split("."); + var refObject = this; + var returnValue = api_constants/* default */.A.global.SCORM_FALSE; + var foundFirstIndex = false; + var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element."); + var invalidErrorCode = scorm2004 + ? this._error_codes.UNDEFINED_DATA_MODEL + : this._error_codes.GENERAL; + for (var idx = 0; idx < structure.length; idx++) { + var attribute = structure[idx]; + if (idx === structure.length - 1) { + if (scorm2004 && attribute.substring(0, 8) === "{target=") { + if (this.isInitialized()) { + this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT); + } + else { + refObject = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, refObject), { attribute: value }); + } + } + else if (!this._checkObjectHasProperty(refObject, attribute)) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + } + else { + if ((0,utilities/* stringMatches */.J6)(CMIElement, "\\.correct_responses\\.\\d+") && + this.isInitialized()) { + this.validateCorrectResponse(CMIElement, value); + } + if (!scorm2004 || this.lastErrorCode === "0") { + refObject[attribute] = value; + returnValue = api_constants/* default */.A.global.SCORM_TRUE; + } + } + } + else { + refObject = refObject[attribute]; + if (!refObject) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + break; + } + if (refObject instanceof array/* CMIArray */.B) { + var index = parseInt(structure[idx + 1], 10); + if (!isNaN(index)) { + var item = refObject.childArray[index]; + if (item) { + refObject = item; + foundFirstIndex = true; + } + else { + var newChild = this.getChildElement(CMIElement, value, foundFirstIndex); + foundFirstIndex = true; + if (!newChild) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + } + else { + if (refObject.initialized) + newChild.initialize(); + refObject.childArray.push(newChild); + refObject = newChild; + } + } + idx++; + } + } + } + } + if (returnValue === api_constants/* default */.A.global.SCORM_FALSE) { + this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value), api_constants/* default */.A.global.LOG_LEVEL_WARNING); + } + return returnValue; + }; + BaseAPI.prototype._commonGetCMIValue = function (methodName, scorm2004, CMIElement) { + if (!CMIElement || CMIElement === "") { + return ""; + } + var structure = CMIElement.split("."); + var refObject = this; + var attribute = null; + var uninitializedErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") has not been initialized."); + var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element."); + var invalidErrorCode = scorm2004 + ? this._error_codes.UNDEFINED_DATA_MODEL + : this._error_codes.GENERAL; + for (var idx = 0; idx < structure.length; idx++) { + attribute = structure[idx]; + if (!scorm2004) { + if (idx === structure.length - 1) { + if (!this._checkObjectHasProperty(refObject, attribute)) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + return; + } + } + } + else { + if (String(attribute).substring(0, 8) === "{target=" && + typeof refObject._isTargetValid == "function") { + var target = String(attribute).substring(8, String(attribute).length - 9); + return refObject._isTargetValid(target); + } + else if (!this._checkObjectHasProperty(refObject, attribute)) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + return; + } + } + refObject = refObject[attribute]; + if (refObject === undefined) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + break; + } + if (refObject instanceof array/* CMIArray */.B) { + var index = parseInt(structure[idx + 1], 10); + if (!isNaN(index)) { + var item = refObject.childArray[index]; + if (item) { + refObject = item; + } + else { + this.throwSCORMError(this._error_codes.VALUE_NOT_INITIALIZED, uninitializedErrorMessage); + break; + } + idx++; + } + } + } + if (refObject === null || refObject === undefined) { + if (!scorm2004) { + if (attribute === "_children") { + this.throwSCORMError(error_codes/* default */.A.scorm12.CHILDREN_ERROR); + } + else if (attribute === "_count") { + this.throwSCORMError(error_codes/* default */.A.scorm12.COUNT_ERROR); + } + } + } + else { + return refObject; + } + }; + BaseAPI.prototype.isInitialized = function () { + return this.currentState === api_constants/* default */.A.global.STATE_INITIALIZED; + }; + BaseAPI.prototype.isNotInitialized = function () { + return this.currentState === api_constants/* default */.A.global.STATE_NOT_INITIALIZED; + }; + BaseAPI.prototype.isTerminated = function () { + return this.currentState === api_constants/* default */.A.global.STATE_TERMINATED; + }; + BaseAPI.prototype.on = function (listenerName, callback) { + if (!callback) + return; + var listenerFunctions = listenerName.split(" "); + for (var i = 0; i < listenerFunctions.length; i++) { + var listenerSplit = listenerFunctions[i].split("."); + if (listenerSplit.length === 0) + return; + var functionName = listenerSplit[0]; + var CMIElement = null; + if (listenerSplit.length > 1) { + CMIElement = listenerName.replace(functionName + ".", ""); + } + this.listenerArray.push({ + functionName: functionName, + CMIElement: CMIElement, + callback: callback, + }); + this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length), api_constants/* default */.A.global.LOG_LEVEL_INFO, functionName); + } + }; + BaseAPI.prototype.off = function (listenerName, callback) { + if (!callback) + return; + var listenerFunctions = listenerName.split(" "); + var _loop_1 = function (i) { + var listenerSplit = listenerFunctions[i].split("."); + if (listenerSplit.length === 0) + return { value: void 0 }; + var functionName = listenerSplit[0]; + var CMIElement = null; + if (listenerSplit.length > 1) { + CMIElement = listenerName.replace(functionName + ".", ""); + } + var removeIndex = this_1.listenerArray.findIndex(function (obj) { + return obj.functionName === functionName && + obj.CMIElement === CMIElement && + obj.callback === callback; + }); + if (removeIndex !== -1) { + this_1.listenerArray.splice(removeIndex, 1); + this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length), api_constants/* default */.A.global.LOG_LEVEL_INFO, functionName); + } + }; + var this_1 = this; + for (var i = 0; i < listenerFunctions.length; i++) { + var state_1 = _loop_1(i); + if (typeof state_1 === "object") + return state_1.value; + } + }; + BaseAPI.prototype.clear = function (listenerName) { + var listenerFunctions = listenerName.split(" "); + var _loop_2 = function (i) { + var listenerSplit = listenerFunctions[i].split("."); + if (listenerSplit.length === 0) + return { value: void 0 }; + var functionName = listenerSplit[0]; + var CMIElement = null; + if (listenerSplit.length > 1) { + CMIElement = listenerName.replace(functionName + ".", ""); + } + this_2.listenerArray = this_2.listenerArray.filter(function (obj) { + return obj.functionName !== functionName && obj.CMIElement !== CMIElement; + }); + }; + var this_2 = this; + for (var i = 0; i < listenerFunctions.length; i++) { + var state_2 = _loop_2(i); + if (typeof state_2 === "object") + return state_2.value; + } + }; + BaseAPI.prototype.processListeners = function (functionName, CMIElement, value) { + this.apiLog(functionName, value, api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); + for (var i = 0; i < this.listenerArray.length; i++) { + var listener = this.listenerArray[i]; + var functionsMatch = listener.functionName === functionName; + var listenerHasCMIElement = !!listener.CMIElement; + var CMIElementsMatch = false; + if (CMIElement && + listener.CMIElement && + listener.CMIElement.substring(listener.CMIElement.length - 1) === "*") { + CMIElementsMatch = + CMIElement.indexOf(listener.CMIElement.substring(0, listener.CMIElement.length - 1)) === 0; + } + else { + CMIElementsMatch = listener.CMIElement === CMIElement; + } + if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) { + this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName), api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); + listener.callback(CMIElement, value); + } + } + }; + BaseAPI.prototype.throwSCORMError = function (errorNumber, message) { + if (!message) { + message = this.getLmsErrorMessageDetails(errorNumber); + } + this.apiLog("throwSCORMError", errorNumber + ": " + message, api_constants/* default */.A.global.LOG_LEVEL_ERROR); + this.lastErrorCode = String(errorNumber); + }; + BaseAPI.prototype.clearSCORMError = function (success) { + if (success !== undefined && success !== api_constants/* default */.A.global.SCORM_FALSE) { + this.lastErrorCode = "0"; + } + }; + BaseAPI.prototype.loadFromFlattenedJSON = function (json, CMIElement) { + var _this = this; + if (!CMIElement) { + CMIElement = ""; + } + if (!this.isNotInitialized()) { + console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize."); + return; + } + function testPattern(a, c, a_pattern) { + var a_match = a.match(a_pattern); + var c_match; + if (a_match !== null && (c_match = c.match(a_pattern)) !== null) { + var a_num = Number(a_match[2]); + var c_num = Number(c_match[2]); + if (a_num === c_num) { + if (a_match[3] === "id") { + return -1; + } + else if (a_match[3] === "type") { + if (c_match[3] === "id") { + return 1; + } + else { + return -1; + } + } + else { + return 1; + } + } + return a_num - c_num; + } + return null; + } + var int_pattern = /^(cmi\.interactions\.)(\d+)\.(.*)$/; + var obj_pattern = /^(cmi\.objectives\.)(\d+)\.(.*)$/; + var result = Object.keys(json).map(function (key) { + return [String(key), json[key]]; + }); + result.sort(function (_a, _c) { + var a = _a[0], _b = _a[1]; + var c = _c[0], _d = _c[1]; + var test; + if ((test = testPattern(a, c, int_pattern)) !== null) { + return test; + } + if ((test = testPattern(a, c, obj_pattern)) !== null) { + return test; + } + if (a < c) { + return -1; + } + if (a > c) { + return 1; + } + return 0; + }); + var obj; + result.forEach(function (element) { + obj = {}; + obj[element[0]] = element[1]; + _this.loadFromJSON((0,utilities/* unflatten */.sB)(obj), CMIElement); + }); + }; + BaseAPI.prototype.loadFromJSON = function (json, CMIElement) { + if (!this.isNotInitialized()) { + console.error("loadFromJSON can only be called before the call to lmsInitialize."); + return; + } + CMIElement = CMIElement !== undefined ? CMIElement : "cmi"; + this.startingData = json; + for (var key in json) { + if ({}.hasOwnProperty.call(json, key) && json[key]) { + var currentCMIElement = (CMIElement ? CMIElement + "." : "") + key; + var value = json[key]; + if (value["childArray"]) { + for (var i = 0; i < value["childArray"].length; i++) { + this.loadFromJSON(value["childArray"][i], currentCMIElement + "." + i); + } + } + else if (value.constructor === Object) { + this.loadFromJSON(value, currentCMIElement); + } + else { + this.setCMIValue(currentCMIElement, value); + } + } + } + }; + BaseAPI.prototype.renderCMIToJSONString = function () { + var cmi = this.cmi; + if (this.settings.sendFullCommit) { + return JSON.stringify({ cmi: cmi }); + } + return JSON.stringify({ cmi: cmi }, function (k, v) { return (v === undefined ? null : v); }, 2); + }; + BaseAPI.prototype.renderCMIToJSONObject = function () { + return JSON.parse(this.renderCMIToJSONString()); + }; + BaseAPI.prototype.processHttpRequest = function (url_1, params_1) { + return (0,tslib_es6/* __awaiter */.sH)(this, arguments, void 0, function (url, params, immediate) { + var api, genericError, process, debouncedProcess; + var _this = this; + if (immediate === void 0) { immediate = false; } + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: + api = this; + genericError = { + result: api_constants/* default */.A.global.SCORM_FALSE, + errorCode: this.error_codes.GENERAL, + }; + if (immediate) { + this.performFetch(url, params).then(function (response) { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this.transformResponse(response)]; + case 1: + _a.sent(); + return [2]; + } + }); + }); }); + return [2, { + result: api_constants/* default */.A.global.SCORM_TRUE, + errorCode: 0, + }]; + } + process = function (url, params, settings) { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { + var response, e_1; + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + params = settings.requestHandler(params); + return [4, this.performFetch(url, params)]; + case 1: + response = _a.sent(); + return [2, this.transformResponse(response)]; + case 2: + e_1 = _a.sent(); + this.apiLog("processHttpRequest", e_1, api_constants/* default */.A.global.LOG_LEVEL_ERROR); + api.processListeners("CommitError"); + return [2, genericError]; + case 3: return [2]; + } + }); + }); }; + if (!this.settings.asyncCommit) return [3, 1]; + debouncedProcess = debounce(process, 500, immediate); + debouncedProcess(url, params, this.settings); + return [2, { + result: api_constants/* default */.A.global.SCORM_TRUE, + errorCode: 0, + }]; + case 1: return [4, process(url, params, this.settings)]; + case 2: return [2, _a.sent()]; + } + }); + }); + }; + BaseAPI.prototype.scheduleCommit = function (when, callback) { + this._timeout = new ScheduledCommit(this, when, callback); + this.apiLog("scheduleCommit", "scheduled", api_constants/* default */.A.global.LOG_LEVEL_DEBUG, ""); + }; + BaseAPI.prototype.clearScheduledCommit = function () { + if (this._timeout) { + this._timeout.cancel(); + this._timeout = undefined; + this.apiLog("clearScheduledCommit", "cleared", api_constants/* default */.A.global.LOG_LEVEL_DEBUG, ""); + } + }; + BaseAPI.prototype._checkObjectHasProperty = function (refObject, attribute) { + return (Object.hasOwnProperty.call(refObject, attribute) || + Object.getOwnPropertyDescriptor(Object.getPrototypeOf(refObject), attribute) != null || + attribute in refObject); + }; + BaseAPI.prototype.handleValueAccessException = function (e, returnValue) { + if (e instanceof exceptions/* ValidationError */.yI) { + this.lastErrorCode = String(e.errorCode); + returnValue = api_constants/* default */.A.global.SCORM_FALSE; + } + else { + if (e instanceof Error && e.message) { + console.error(e.message); + } + else { + console.error(e); + } + this.throwSCORMError(this._error_codes.GENERAL); + } + return returnValue; + }; + BaseAPI.prototype.performFetch = function (url, params) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + return [2, fetch(url, { + method: "POST", + body: params instanceof Array ? params.join("&") : JSON.stringify(params), + headers: (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, this.settings.xhrHeaders), { "Content-Type": this.settings.commitRequestDataType }), + credentials: this.settings.xhrWithCredentials ? "include" : undefined, + keepalive: true, + })]; + }); + }); + }; + BaseAPI.prototype.transformResponse = function (response) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + var result, _a; + return (0,tslib_es6/* __generator */.YH)(this, function (_c) { + switch (_c.label) { + case 0: + if (!(typeof this.settings.responseHandler === "function")) return [3, 2]; + return [4, this.settings.responseHandler(response)]; + case 1: + _a = _c.sent(); + return [3, 4]; + case 2: return [4, response.json()]; + case 3: + _a = _c.sent(); + _c.label = 4; + case 4: + result = _a; + if (response.status >= 200 && + response.status <= 299 && + (result.result === true || + result.result === api_constants/* default */.A.global.SCORM_TRUE)) { + this.processListeners("CommitSuccess"); + } + else { + this.processListeners("CommitError"); + } + return [2, result]; + } + }); + }); + }; + return BaseAPI; +}()); +/* harmony default export */ var src_BaseAPI = (BaseAPI); + + +/***/ }), + +/***/ 941: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ C: function() { return /* binding */ Scorm12Impl; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(635); +/* harmony import */ var _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(989); +/* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(864); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(340); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797); +/* harmony import */ var _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(176); +/* harmony import */ var _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(833); +/* harmony import */ var _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(331); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(417); +/* harmony import */ var _constants_enums__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(56); +/* harmony import */ var _BaseAPI__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(900); + + + + + + + + + + + + +var Scorm12Impl = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__extends */ .C6)(Scorm12Impl, _super); + function Scorm12Impl(settings) { + var _this = this; + if (settings) { + if (settings.mastery_override === undefined) { + settings.mastery_override = false; + } + } + _this = _super.call(this, _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12, settings) || this; + _this.statusSetByModule = false; + _this.cmi = new _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__/* .CMI */ .Y(); + _this.nav = new _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__/* .NAV */ .A(); + _this.LMSInitialize = _this.lmsInitialize; + _this.LMSFinish = _this.lmsFinish; + _this.LMSGetValue = _this.lmsGetValue; + _this.LMSSetValue = _this.lmsSetValue; + _this.LMSCommit = _this.lmsCommit; + _this.LMSGetLastError = _this.lmsGetLastError; + _this.LMSGetErrorString = _this.lmsGetErrorString; + _this.LMSGetDiagnostic = _this.lmsGetDiagnostic; + return _this; + } + Scorm12Impl.prototype.reset = function (settings) { + this.commonReset(settings); + this.cmi = new _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__/* .CMI */ .Y(); + this.nav = new _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__/* .NAV */ .A(); + }; + Scorm12Impl.prototype.lmsInitialize = function () { + this.cmi.initialize(); + if (this.cmi.core.lesson_status) { + this.statusSetByModule = true; + } + else { + this.cmi.core.lesson_status = "not attempted"; + } + return this.initialize("LMSInitialize", "LMS was already initialized!", "LMS is already finished!"); + }; + Scorm12Impl.prototype.lmsFinish = function () { + var _this = this; + (function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__awaiter */ .sH)(_this, void 0, void 0, function () { + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__generator */ .YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this.internalFinish()]; + case 1: + _a.sent(); + return [2]; + } + }); + }); })(); + return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.global.SCORM_TRUE; + }; + Scorm12Impl.prototype.internalFinish = function () { + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__awaiter */ .sH)(this, void 0, void 0, function () { + var result; + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__generator */ .YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this.terminate("LMSFinish", true)]; + case 1: + result = _a.sent(); + if (result === _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.global.SCORM_TRUE) { + if (this.nav.event !== "") { + if (this.nav.event === "continue") { + this.processListeners("SequenceNext"); + } + else { + this.processListeners("SequencePrevious"); + } + } + else if (this.settings.autoProgress) { + this.processListeners("SequenceNext"); + } + } + return [2, result]; + } + }); + }); + }; + Scorm12Impl.prototype.lmsGetValue = function (CMIElement) { + return this.getValue("LMSGetValue", false, CMIElement); + }; + Scorm12Impl.prototype.lmsSetValue = function (CMIElement, value) { + if (CMIElement === "cmi.core.lesson_status") { + this.statusSetByModule = true; + } + return this.setValue("LMSSetValue", "LMSCommit", false, CMIElement, value); + }; + Scorm12Impl.prototype.lmsCommit = function () { + var _this = this; + (function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__awaiter */ .sH)(_this, void 0, void 0, function () { + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__generator */ .YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this.commit("LMSCommit", false)]; + case 1: + _a.sent(); + return [2]; + } + }); + }); })(); + return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.global.SCORM_TRUE; + }; + Scorm12Impl.prototype.lmsGetLastError = function () { + return this.getLastError("LMSGetLastError"); + }; + Scorm12Impl.prototype.lmsGetErrorString = function (CMIErrorCode) { + return this.getErrorString("LMSGetErrorString", CMIErrorCode); + }; + Scorm12Impl.prototype.lmsGetDiagnostic = function (CMIErrorCode) { + return this.getDiagnostic("LMSGetDiagnostic", CMIErrorCode); + }; + Scorm12Impl.prototype.setCMIValue = function (CMIElement, value) { + return this._commonSetCMIValue("LMSSetValue", false, CMIElement, value); + }; + Scorm12Impl.prototype.getCMIValue = function (CMIElement) { + return this._commonGetCMIValue("getCMIValue", false, CMIElement); + }; + Scorm12Impl.prototype.getChildElement = function (CMIElement, _value, foundFirstIndex) { + if ((0,_utilities__WEBPACK_IMPORTED_MODULE_1__/* .stringMatches */ .J6)(CMIElement, "cmi\\.objectives\\.\\d+")) { + return new _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__/* .CMIObjectivesObject */ .N(); + } + else if (foundFirstIndex && + (0,_utilities__WEBPACK_IMPORTED_MODULE_1__/* .stringMatches */ .J6)(CMIElement, "cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")) { + return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__/* .CMIInteractionsCorrectResponsesObject */ .cb(); + } + else if (foundFirstIndex && + (0,_utilities__WEBPACK_IMPORTED_MODULE_1__/* .stringMatches */ .J6)(CMIElement, "cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")) { + return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__/* .CMIInteractionsObjectivesObject */ .Oh(); + } + else if (!foundFirstIndex && + (0,_utilities__WEBPACK_IMPORTED_MODULE_1__/* .stringMatches */ .J6)(CMIElement, "cmi\\.interactions\\.\\d+")) { + return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__/* .CMIInteractionsObject */ .WP(); + } + return null; + }; + Scorm12Impl.prototype.validateCorrectResponse = function (_CMIElement, _value) { + }; + Scorm12Impl.prototype.getLmsErrorMessageDetails = function (errorNumber, detail) { + var basicMessage = "No Error"; + var detailMessage = "No Error"; + errorNumber = String(errorNumber); + if (_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.error_descriptions[errorNumber]) { + basicMessage = + _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.error_descriptions[errorNumber].basicMessage; + detailMessage = + _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.error_descriptions[errorNumber].detailMessage; + } + return detail ? detailMessage : basicMessage; + }; + Scorm12Impl.prototype.replaceWithAnotherScormAPI = function (newAPI) { + this.cmi = newAPI.cmi; + }; + Scorm12Impl.prototype.renderCommitCMI = function (terminateCommit) { + var cmiExport = this.renderCMIToJSONObject(); + if (terminateCommit) { + cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime(); + } + var result = []; + var flattened = _utilities__WEBPACK_IMPORTED_MODULE_1__/* .flatten */ .Bq(cmiExport); + switch (this.settings.dataCommitFormat) { + case "flattened": + return _utilities__WEBPACK_IMPORTED_MODULE_1__/* .flatten */ .Bq(cmiExport); + case "params": + for (var item in flattened) { + if ({}.hasOwnProperty.call(flattened, item)) { + result.push("".concat(item, "=").concat(flattened[item])); + } + } + return result; + case "json": + default: + return cmiExport; + } + }; + Scorm12Impl.prototype.renderCommitObject = function (terminateCommit) { + var cmiExport = this.renderCommitCMI(terminateCommit); + var totalTimeHHMMSS = this.cmi.getCurrentTotalTime(); + var totalTimeSeconds = _utilities__WEBPACK_IMPORTED_MODULE_1__/* .getTimeAsSeconds */ .f4(totalTimeHHMMSS, _constants_regex__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A.scorm12.CMITimespan); + var lessonStatus = this.cmi.core.lesson_status; + var completionStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_8__/* .CompletionStatus */ .lC.unknown; + var successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_8__/* .SuccessStatus */ .YE.unknown; + if (lessonStatus) { + completionStatus = + lessonStatus === "completed" || lessonStatus === "passed" + ? _constants_enums__WEBPACK_IMPORTED_MODULE_8__/* .CompletionStatus */ .lC.completed + : _constants_enums__WEBPACK_IMPORTED_MODULE_8__/* .CompletionStatus */ .lC.incomplete; + if (lessonStatus === "passed") { + successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_8__/* .SuccessStatus */ .YE.passed; + } + else if (lessonStatus === "failed") { + successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_8__/* .SuccessStatus */ .YE.failed; + } + } + var score = this.cmi.core.score; + var scoreObject = null; + if (score) { + scoreObject = {}; + if (!Number.isNaN(Number.parseFloat(score.raw))) { + scoreObject.raw = Number.parseFloat(score.raw); + } + if (!Number.isNaN(Number.parseFloat(score.min))) { + scoreObject.min = Number.parseFloat(score.min); + } + if (!Number.isNaN(Number.parseFloat(score.max))) { + scoreObject.max = Number.parseFloat(score.max); + } + } + var commitObject = { + successStatus: successStatus, + completionStatus: completionStatus, + runtimeData: cmiExport, + totalTimeSeconds: totalTimeSeconds, + }; + if (scoreObject) { + commitObject.score = scoreObject; + } + return commitObject; + }; + Scorm12Impl.prototype.storeData = function (terminateCommit) { + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__awaiter */ .sH)(this, void 0, void 0, function () { + var originalStatus, shouldTerminateCommit, commitObject; + var _a, _b, _c; + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__generator */ .YH)(this, function (_d) { + switch (_d.label) { + case 0: + if (terminateCommit) { + originalStatus = this.cmi.core.lesson_status; + if (!this.cmi.core.lesson_status || + (!this.statusSetByModule && + this.cmi.core.lesson_status === "not attempted")) { + this.cmi.core.lesson_status = "completed"; + } + if (this.cmi.core.lesson_mode === "normal") { + if (this.cmi.core.credit === "credit") { + if (this.settings.mastery_override && + this.cmi.student_data.mastery_score !== "" && + this.cmi.core.score.raw !== "") { + this.cmi.core.lesson_status = + parseFloat(this.cmi.core.score.raw) >= + parseFloat(this.cmi.student_data.mastery_score) + ? "passed" + : "failed"; + } + } + } + else if (this.cmi.core.lesson_mode === "browse") { + if ((((_c = (_b = (_a = this.startingData) === null || _a === void 0 ? void 0 : _a.cmi) === null || _b === void 0 ? void 0 : _b.core) === null || _c === void 0 ? void 0 : _c.lesson_status) || "") === "" && + originalStatus === "not attempted") { + this.cmi.core.lesson_status = "browsed"; + } + } + } + shouldTerminateCommit = terminateCommit || this.settings.alwaysSendTotalTime; + commitObject = this.settings.renderCommonCommitFields + ? this.renderCommitObject(shouldTerminateCommit) + : this.renderCommitCMI(shouldTerminateCommit); + if (this.apiLogLevel === _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.global.LOG_LEVEL_DEBUG) { + console.debug("Commit (terminated: " + (terminateCommit ? "yes" : "no") + "): "); + console.debug(commitObject); + } + if (!(typeof this.settings.lmsCommitUrl === "string")) return [3, 2]; + return [4, this.processHttpRequest(this.settings.lmsCommitUrl, commitObject, terminateCommit)]; + case 1: return [2, _d.sent()]; + case 2: return [2, { + result: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.global.SCORM_TRUE, + errorCode: 0, + }]; + } + }); + }); + }; + return Scorm12Impl; +}(_BaseAPI__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A)); + + + +/***/ }), + +/***/ 180: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + Z: function() { return /* binding */ Scorm2004Impl; } +}); + +// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs +var tslib_es6 = __webpack_require__(635); +// EXTERNAL MODULE: ./src/BaseAPI.ts + 3 modules +var BaseAPI = __webpack_require__(900); +// EXTERNAL MODULE: ./src/constants/api_constants.ts +var api_constants = __webpack_require__(340); +// EXTERNAL MODULE: ./src/constants/regex.ts +var regex = __webpack_require__(417); +// EXTERNAL MODULE: ./src/constants/error_codes.ts +var error_codes = __webpack_require__(797); +// EXTERNAL MODULE: ./src/exceptions.ts +var exceptions = __webpack_require__(784); +// EXTERNAL MODULE: ./src/utilities.ts +var utilities = __webpack_require__(864); +// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts +var base_cmi = __webpack_require__(319); +// EXTERNAL MODULE: ./src/cmi/common/validation.ts +var validation = __webpack_require__(449); +;// ./src/cmi/scorm2004/validation.ts + + + +function check2004ValidFormat(value, regexPattern, allowEmptyString) { + return (0,validation/* checkValidFormat */.q)(value, regexPattern, error_codes/* default */.A.scorm2004.TYPE_MISMATCH, exceptions/* Scorm2004ValidationError */.wq, allowEmptyString); +} +function check2004ValidRange(value, rangePattern) { + return (0,validation/* checkValidRange */.W)(value, rangePattern, error_codes/* default */.A.scorm2004.VALUE_OUT_OF_RANGE, exceptions/* Scorm2004ValidationError */.wq); +} + +;// ./src/cmi/scorm2004/learner_preference.ts + + + + + + + +var CMILearnerPreference = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMILearnerPreference, _super); + function CMILearnerPreference() { + var _this = _super.call(this) || this; + _this.__children = api_constants/* default */.A.scorm2004.student_preference_children; + _this._audio_level = "1"; + _this._language = ""; + _this._delivery_speed = "1"; + _this._audio_captioning = "0"; + return _this; + } + Object.defineProperty(CMILearnerPreference.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMILearnerPreference.prototype, "audio_level", { + get: function () { + return this._audio_level; + }, + set: function (audio_level) { + if (check2004ValidFormat(audio_level, regex/* default */.A.scorm2004.CMIDecimal) && + check2004ValidRange(audio_level, regex/* default */.A.scorm2004.audio_range)) { + this._audio_level = audio_level; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMILearnerPreference.prototype, "language", { + get: function () { + return this._language; + }, + set: function (language) { + if (check2004ValidFormat(language, regex/* default */.A.scorm2004.CMILang)) { + this._language = language; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMILearnerPreference.prototype, "delivery_speed", { + get: function () { + return this._delivery_speed; + }, + set: function (delivery_speed) { + if (check2004ValidFormat(delivery_speed, regex/* default */.A.scorm2004.CMIDecimal) && + check2004ValidRange(delivery_speed, regex/* default */.A.scorm2004.speed_range)) { + this._delivery_speed = delivery_speed; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMILearnerPreference.prototype, "audio_captioning", { + get: function () { + return this._audio_captioning; + }, + set: function (audio_captioning) { + if (check2004ValidFormat(audio_captioning, regex/* default */.A.scorm2004.CMISInteger) && + check2004ValidRange(audio_captioning, regex/* default */.A.scorm2004.text_range)) { + this._audio_captioning = audio_captioning; + } + }, + enumerable: false, + configurable: true + }); + CMILearnerPreference.prototype.toJSON = function () { + this.jsonString = true; + var result = { + audio_level: this.audio_level, + language: this.language, + delivery_speed: this.delivery_speed, + audio_captioning: this.audio_captioning, + }; + delete this.jsonString; + return result; + }; + return CMILearnerPreference; +}(base_cmi/* BaseCMI */.J)); + + +// EXTERNAL MODULE: ./src/cmi/common/array.ts +var array = __webpack_require__(589); +;// ./src/constants/response_constants.ts + +var scorm2004_regex = regex/* default */.A.scorm2004; +var LearnerResponses = { + "true-false": { + format: "^true$|^false$", + max: 1, + delimiter: "", + unique: false, + }, + choice: { + format: scorm2004_regex.CMILongIdentifier, + max: 36, + delimiter: "[,]", + unique: true, + }, + "fill-in": { + format: scorm2004_regex.CMILangString250, + max: 10, + delimiter: "[,]", + unique: false, + }, + "long-fill-in": { + format: scorm2004_regex.CMILangString4000, + max: 1, + delimiter: "", + unique: false, + }, + matching: { + format: scorm2004_regex.CMIShortIdentifier, + format2: scorm2004_regex.CMIShortIdentifier, + max: 36, + delimiter: "[,]", + delimiter2: "[.]", + unique: false, + }, + performance: { + format: "^$|" + scorm2004_regex.CMIShortIdentifier, + format2: scorm2004_regex.CMIDecimal + "|^$|" + scorm2004_regex.CMIShortIdentifier, + max: 250, + delimiter: "[,]", + delimiter2: "[.]", + unique: false, + }, + sequencing: { + format: scorm2004_regex.CMIShortIdentifier, + max: 36, + delimiter: "[,]", + unique: false, + }, + likert: { + format: scorm2004_regex.CMIShortIdentifier, + max: 1, + delimiter: "", + unique: false, + }, + numeric: { + format: scorm2004_regex.CMIDecimal, + max: 1, + delimiter: "", + unique: false, + }, + other: { + format: scorm2004_regex.CMIString4000, + max: 1, + delimiter: "", + unique: false, + }, +}; +var CorrectResponses = { + "true-false": { + max: 1, + delimiter: "", + unique: false, + duplicate: false, + format: "^true$|^false$", + limit: 1, + }, + choice: { + max: 36, + delimiter: "[,]", + unique: true, + duplicate: false, + format: scorm2004_regex.CMILongIdentifier, + }, + "fill-in": { + max: 10, + delimiter: "[,]", + unique: false, + duplicate: false, + format: scorm2004_regex.CMILangString250cr, + }, + "long-fill-in": { + max: 1, + delimiter: "", + unique: false, + duplicate: true, + format: scorm2004_regex.CMILangString4000, + }, + matching: { + max: 36, + delimiter: "[,]", + delimiter2: "[.]", + unique: false, + duplicate: false, + format: scorm2004_regex.CMIShortIdentifier, + format2: scorm2004_regex.CMIShortIdentifier, + }, + performance: { + max: 250, + delimiter: "[,]", + delimiter2: "[.]", + delimiter3: "[:]", + unique: false, + duplicate: false, + format: "^$|" + scorm2004_regex.CMIShortIdentifier, + format2: scorm2004_regex.CMIDecimal + "|^$|" + scorm2004_regex.CMIShortIdentifier, + }, + sequencing: { + max: 36, + delimiter: "[,]", + unique: false, + duplicate: false, + format: scorm2004_regex.CMIShortIdentifier, + }, + likert: { + max: 1, + delimiter: "", + unique: false, + duplicate: false, + format: scorm2004_regex.CMIShortIdentifier, + limit: 1, + }, + numeric: { + max: 2, + delimiter: "[:]", + unique: false, + duplicate: false, + format: scorm2004_regex.CMIDecimal, + limit: 1, + }, + other: { + max: 1, + delimiter: "", + unique: false, + duplicate: false, + format: scorm2004_regex.CMIString4000, + limit: 1, + }, +}; + +;// ./src/cmi/scorm2004/interactions.ts + + + + + + + + + +var CMIInteractions = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIInteractions, _super); + function CMIInteractions() { + return _super.call(this, { + children: api_constants/* default */.A.scorm2004.interactions_children, + errorCode: error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT, + errorClass: exceptions/* Scorm2004ValidationError */.wq, + }) || this; + } + return CMIInteractions; +}(array/* CMIArray */.B)); + +var CMIInteractionsObject = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIInteractionsObject, _super); + function CMIInteractionsObject() { + var _this = _super.call(this) || this; + _this._id = ""; + _this._type = ""; + _this._timestamp = ""; + _this._weighting = ""; + _this._learner_response = ""; + _this._result = ""; + _this._latency = ""; + _this._description = ""; + _this.objectives = new array/* CMIArray */.B({ + errorCode: error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT, + errorClass: exceptions/* Scorm2004ValidationError */.wq, + children: api_constants/* default */.A.scorm2004.objectives_children, + }); + _this.correct_responses = new array/* CMIArray */.B({ + errorCode: error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT, + errorClass: exceptions/* Scorm2004ValidationError */.wq, + children: api_constants/* default */.A.scorm2004.correct_responses_children, + }); + return _this; + } + CMIInteractionsObject.prototype.initialize = function () { + var _a, _b; + _super.prototype.initialize.call(this); + (_a = this.objectives) === null || _a === void 0 ? void 0 : _a.initialize(); + (_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.initialize(); + }; + Object.defineProperty(CMIInteractionsObject.prototype, "id", { + get: function () { + return this._id; + }, + set: function (id) { + if (check2004ValidFormat(id, regex/* default */.A.scorm2004.CMILongIdentifier)) { + this._id = id; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "type", { + get: function () { + return this._type; + }, + set: function (type) { + if (this.initialized && this._id === "") { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + } + else { + if (check2004ValidFormat(type, regex/* default */.A.scorm2004.CMIType)) { + this._type = type; + } + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "timestamp", { + get: function () { + return this._timestamp; + }, + set: function (timestamp) { + if (this.initialized && this._id === "") { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + } + else { + if (check2004ValidFormat(timestamp, regex/* default */.A.scorm2004.CMITime)) { + this._timestamp = timestamp; + } + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "weighting", { + get: function () { + return this._weighting; + }, + set: function (weighting) { + if (this.initialized && this._id === "") { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + } + else { + if (check2004ValidFormat(weighting, regex/* default */.A.scorm2004.CMIDecimal)) { + this._weighting = weighting; + } + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "learner_response", { + get: function () { + return this._learner_response; + }, + set: function (learner_response) { + if (this.initialized && (this._type === "" || this._id === "")) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + } + else { + var nodes = []; + var response_type = LearnerResponses[this.type]; + if (response_type) { + if (response_type === null || response_type === void 0 ? void 0 : response_type.delimiter) { + nodes = learner_response.split(response_type.delimiter); + } + else { + nodes[0] = learner_response; + } + if (nodes.length > 0 && nodes.length <= response_type.max) { + var formatRegex = new RegExp(response_type.format); + for (var i = 0; i < nodes.length; i++) { + if (response_type === null || response_type === void 0 ? void 0 : response_type.delimiter2) { + var values = nodes[i].split(response_type.delimiter2); + if (values.length === 2) { + if (!values[0].match(formatRegex)) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + else { + if (!response_type.format2 || + !values[1].match(new RegExp(response_type.format2))) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + } + } + else { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + } + else { + if (!nodes[i].match(formatRegex)) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + else { + if (nodes[i] !== "" && response_type.unique) { + for (var j = 0; j < i; j++) { + if (nodes[i] === nodes[j]) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + } + } + } + } + } + } + else { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.GENERAL_SET_FAILURE); + } + this._learner_response = learner_response; + } + else { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "result", { + get: function () { + return this._result; + }, + set: function (result) { + if (check2004ValidFormat(result, regex/* default */.A.scorm2004.CMIResult)) { + this._result = result; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "latency", { + get: function () { + return this._latency; + }, + set: function (latency) { + if (this.initialized && this._id === "") { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + } + else { + if (check2004ValidFormat(latency, regex/* default */.A.scorm2004.CMITimespan)) { + this._latency = latency; + } + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "description", { + get: function () { + return this._description; + }, + set: function (description) { + if (this.initialized && this._id === "") { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + } + else { + if (check2004ValidFormat(description, regex/* default */.A.scorm2004.CMILangString250, true)) { + this._description = description; + } + } + }, + enumerable: false, + configurable: true + }); + CMIInteractionsObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + id: this.id, + type: this.type, + objectives: this.objectives, + timestamp: this.timestamp, + weighting: this.weighting, + learner_response: this.learner_response, + result: this.result, + latency: this.latency, + description: this.description, + correct_responses: this.correct_responses, + }; + delete this.jsonString; + return result; + }; + return CMIInteractionsObject; +}(base_cmi/* BaseCMI */.J)); + +var CMIInteractionsObjectivesObject = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIInteractionsObjectivesObject, _super); + function CMIInteractionsObjectivesObject() { + var _this = _super.call(this) || this; + _this._id = ""; + return _this; + } + Object.defineProperty(CMIInteractionsObjectivesObject.prototype, "id", { + get: function () { + return this._id; + }, + set: function (id) { + if (check2004ValidFormat(id, regex/* default */.A.scorm2004.CMILongIdentifier)) { + this._id = id; + } + }, + enumerable: false, + configurable: true + }); + CMIInteractionsObjectivesObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + id: this.id, + }; + delete this.jsonString; + return result; + }; + return CMIInteractionsObjectivesObject; +}(base_cmi/* BaseCMI */.J)); + +var CMIInteractionsCorrectResponsesObject = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIInteractionsCorrectResponsesObject, _super); + function CMIInteractionsCorrectResponsesObject() { + var _this = _super.call(this) || this; + _this._pattern = ""; + return _this; + } + Object.defineProperty(CMIInteractionsCorrectResponsesObject.prototype, "pattern", { + get: function () { + return this._pattern; + }, + set: function (pattern) { + if (check2004ValidFormat(pattern, regex/* default */.A.scorm2004.CMIFeedback)) { + this._pattern = pattern; + } + }, + enumerable: false, + configurable: true + }); + CMIInteractionsCorrectResponsesObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + pattern: this.pattern, + }; + delete this.jsonString; + return result; + }; + return CMIInteractionsCorrectResponsesObject; +}(base_cmi/* BaseCMI */.J)); + + +// EXTERNAL MODULE: ./src/cmi/common/score.ts +var score = __webpack_require__(434); +;// ./src/cmi/scorm2004/score.ts + + + + + + + +var Scorm2004CMIScore = (function (_super) { + (0,tslib_es6/* __extends */.C6)(Scorm2004CMIScore, _super); + function Scorm2004CMIScore() { + var _this = _super.call(this, { + score_children: api_constants/* default */.A.scorm2004.score_children, + max: "", + invalidErrorCode: error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT, + invalidTypeCode: error_codes/* default */.A.scorm2004.TYPE_MISMATCH, + invalidRangeCode: error_codes/* default */.A.scorm2004.VALUE_OUT_OF_RANGE, + decimalRegex: regex/* default */.A.scorm2004.CMIDecimal, + errorClass: exceptions/* Scorm2004ValidationError */.wq, + }) || this; + _this._scaled = ""; + return _this; + } + Object.defineProperty(Scorm2004CMIScore.prototype, "scaled", { + get: function () { + return this._scaled; + }, + set: function (scaled) { + if (check2004ValidFormat(scaled, regex/* default */.A.scorm2004.CMIDecimal) && + check2004ValidRange(scaled, regex/* default */.A.scorm2004.scaled_range)) { + this._scaled = scaled; + } + }, + enumerable: false, + configurable: true + }); + Scorm2004CMIScore.prototype.toJSON = function () { + this.jsonString = true; + var result = { + scaled: this.scaled, + raw: this.raw, + min: this.min, + max: this.max, + }; + delete this.jsonString; + return result; + }; + return Scorm2004CMIScore; +}(score/* CMIScore */._)); + + +;// ./src/cmi/scorm2004/comments.ts + + + + + + + + +var CMICommentsFromLMS = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMICommentsFromLMS, _super); + function CMICommentsFromLMS() { + return _super.call(this, { + children: api_constants/* default */.A.scorm2004.comments_children, + errorCode: error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT, + errorClass: exceptions/* Scorm2004ValidationError */.wq, + }) || this; + } + return CMICommentsFromLMS; +}(array/* CMIArray */.B)); + +var CMICommentsFromLearner = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMICommentsFromLearner, _super); + function CMICommentsFromLearner() { + return _super.call(this, { + children: api_constants/* default */.A.scorm2004.comments_children, + errorCode: error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT, + errorClass: exceptions/* Scorm2004ValidationError */.wq, + }) || this; + } + return CMICommentsFromLearner; +}(array/* CMIArray */.B)); + +var CMICommentsObject = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMICommentsObject, _super); + function CMICommentsObject(readOnlyAfterInit) { + if (readOnlyAfterInit === void 0) { readOnlyAfterInit = false; } + var _this = _super.call(this) || this; + _this._comment = ""; + _this._location = ""; + _this._timestamp = ""; + _this._comment = ""; + _this._location = ""; + _this._timestamp = ""; + _this._readOnlyAfterInit = readOnlyAfterInit; + return _this; + } + Object.defineProperty(CMICommentsObject.prototype, "comment", { + get: function () { + return this._comment; + }, + set: function (comment) { + if (this.initialized && this._readOnlyAfterInit) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + else { + if (check2004ValidFormat(comment, regex/* default */.A.scorm2004.CMILangString4000, true)) { + this._comment = comment; + } + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICommentsObject.prototype, "location", { + get: function () { + return this._location; + }, + set: function (location) { + if (this.initialized && this._readOnlyAfterInit) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + else { + if (check2004ValidFormat(location, regex/* default */.A.scorm2004.CMIString250)) { + this._location = location; + } + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICommentsObject.prototype, "timestamp", { + get: function () { + return this._timestamp; + }, + set: function (timestamp) { + if (this.initialized && this._readOnlyAfterInit) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + else { + if (check2004ValidFormat(timestamp, regex/* default */.A.scorm2004.CMITime)) { + this._timestamp = timestamp; + } + } + }, + enumerable: false, + configurable: true + }); + CMICommentsObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + comment: this.comment, + location: this.location, + timestamp: this.timestamp, + }; + delete this.jsonString; + return result; + }; + return CMICommentsObject; +}(base_cmi/* BaseCMI */.J)); + + +;// ./src/cmi/scorm2004/objectives.ts + + + + + + + + + +var CMIObjectives = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIObjectives, _super); + function CMIObjectives() { + return _super.call(this, { + children: api_constants/* default */.A.scorm2004.objectives_children, + errorCode: error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT, + errorClass: exceptions/* Scorm2004ValidationError */.wq, + }) || this; + } + return CMIObjectives; +}(array/* CMIArray */.B)); + +var CMIObjectivesObject = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIObjectivesObject, _super); + function CMIObjectivesObject() { + var _this = _super.call(this) || this; + _this._id = ""; + _this._success_status = "unknown"; + _this._completion_status = "unknown"; + _this._progress_measure = ""; + _this._description = ""; + _this.score = new Scorm2004CMIScore(); + return _this; + } + CMIObjectivesObject.prototype.initialize = function () { + var _a; + _super.prototype.initialize.call(this); + (_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize(); + }; + Object.defineProperty(CMIObjectivesObject.prototype, "id", { + get: function () { + return this._id; + }, + set: function (id) { + if (check2004ValidFormat(id, regex/* default */.A.scorm2004.CMILongIdentifier)) { + this._id = id; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIObjectivesObject.prototype, "success_status", { + get: function () { + return this._success_status; + }, + set: function (success_status) { + if (this.initialized && this._id === "") { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + } + else { + if (check2004ValidFormat(success_status, regex/* default */.A.scorm2004.CMISStatus)) { + this._success_status = success_status; + } + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIObjectivesObject.prototype, "completion_status", { + get: function () { + return this._completion_status; + }, + set: function (completion_status) { + if (this.initialized && this._id === "") { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + } + else { + if (check2004ValidFormat(completion_status, regex/* default */.A.scorm2004.CMICStatus)) { + this._completion_status = completion_status; + } + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIObjectivesObject.prototype, "progress_measure", { + get: function () { + return this._progress_measure; + }, + set: function (progress_measure) { + if (this.initialized && this._id === "") { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + } + else { + if (check2004ValidFormat(progress_measure, regex/* default */.A.scorm2004.CMIDecimal) && + check2004ValidRange(progress_measure, regex/* default */.A.scorm2004.progress_range)) { + this._progress_measure = progress_measure; + } + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIObjectivesObject.prototype, "description", { + get: function () { + return this._description; + }, + set: function (description) { + if (this.initialized && this._id === "") { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + } + else { + if (check2004ValidFormat(description, regex/* default */.A.scorm2004.CMILangString250, true)) { + this._description = description; + } + } + }, + enumerable: false, + configurable: true + }); + CMIObjectivesObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + id: this.id, + success_status: this.success_status, + completion_status: this.completion_status, + progress_measure: this.progress_measure, + description: this.description, + score: this.score, + }; + delete this.jsonString; + return result; + }; + return CMIObjectivesObject; +}(base_cmi/* BaseCMI */.J)); + + +;// ./src/cmi/scorm2004/cmi.ts + + + + + + + + + + + + + +var CMI = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMI, _super); + function CMI(initialized) { + if (initialized === void 0) { initialized = false; } + var _this = _super.call(this) || this; + _this.__version = "1.0"; + _this.__children = api_constants/* default */.A.scorm2004.cmi_children; + _this._completion_status = "unknown"; + _this._completion_threshold = ""; + _this._credit = "credit"; + _this._entry = ""; + _this._exit = ""; + _this._launch_data = ""; + _this._learner_id = ""; + _this._learner_name = ""; + _this._location = ""; + _this._max_time_allowed = ""; + _this._mode = "normal"; + _this._progress_measure = ""; + _this._scaled_passing_score = ""; + _this._session_time = "PT0H0M0S"; + _this._success_status = "unknown"; + _this._suspend_data = ""; + _this._time_limit_action = "continue,no message"; + _this._total_time = ""; + _this.learner_preference = new CMILearnerPreference(); + _this.score = new Scorm2004CMIScore(); + _this.comments_from_learner = new CMICommentsFromLearner(); + _this.comments_from_lms = new CMICommentsFromLMS(); + _this.interactions = new CMIInteractions(); + _this.objectives = new CMIObjectives(); + if (initialized) + _this.initialize(); + return _this; + } + CMI.prototype.initialize = function () { + var _a, _b, _c, _d, _e, _f; + _super.prototype.initialize.call(this); + (_a = this.learner_preference) === null || _a === void 0 ? void 0 : _a.initialize(); + (_b = this.score) === null || _b === void 0 ? void 0 : _b.initialize(); + (_c = this.comments_from_learner) === null || _c === void 0 ? void 0 : _c.initialize(); + (_d = this.comments_from_lms) === null || _d === void 0 ? void 0 : _d.initialize(); + (_e = this.interactions) === null || _e === void 0 ? void 0 : _e.initialize(); + (_f = this.objectives) === null || _f === void 0 ? void 0 : _f.initialize(); + }; + Object.defineProperty(CMI.prototype, "_version", { + get: function () { + return this.__version; + }, + set: function (_version) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "completion_status", { + get: function () { + return this._completion_status; + }, + set: function (completion_status) { + if (check2004ValidFormat(completion_status, regex/* default */.A.scorm2004.CMICStatus)) { + this._completion_status = completion_status; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "completion_threshold", { + get: function () { + return this._completion_threshold; + }, + set: function (completion_threshold) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + else { + this._completion_threshold = completion_threshold; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "credit", { + get: function () { + return this._credit; + }, + set: function (credit) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + else { + this._credit = credit; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "entry", { + get: function () { + return this._entry; + }, + set: function (entry) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + else { + this._entry = entry; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "exit", { + get: function () { + if (!this.jsonString) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.WRITE_ONLY_ELEMENT); + } + return this._exit; + }, + set: function (exit) { + if (check2004ValidFormat(exit, regex/* default */.A.scorm2004.CMIExit, true)) { + this._exit = exit; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "launch_data", { + get: function () { + return this._launch_data; + }, + set: function (launch_data) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + else { + this._launch_data = launch_data; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "learner_id", { + get: function () { + return this._learner_id; + }, + set: function (learner_id) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + else { + this._learner_id = learner_id; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "learner_name", { + get: function () { + return this._learner_name; + }, + set: function (learner_name) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + else { + this._learner_name = learner_name; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "location", { + get: function () { + return this._location; + }, + set: function (location) { + if (check2004ValidFormat(location, regex/* default */.A.scorm2004.CMIString1000)) { + this._location = location; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "max_time_allowed", { + get: function () { + return this._max_time_allowed; + }, + set: function (max_time_allowed) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + else { + this._max_time_allowed = max_time_allowed; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "mode", { + get: function () { + return this._mode; + }, + set: function (mode) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + else { + this._mode = mode; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "progress_measure", { + get: function () { + return this._progress_measure; + }, + set: function (progress_measure) { + if (check2004ValidFormat(progress_measure, regex/* default */.A.scorm2004.CMIDecimal) && + check2004ValidRange(progress_measure, regex/* default */.A.scorm2004.progress_range)) { + this._progress_measure = progress_measure; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "scaled_passing_score", { + get: function () { + return this._scaled_passing_score; + }, + set: function (scaled_passing_score) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + else { + this._scaled_passing_score = scaled_passing_score; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "session_time", { + get: function () { + if (!this.jsonString) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.WRITE_ONLY_ELEMENT); + } + return this._session_time; + }, + set: function (session_time) { + if (check2004ValidFormat(session_time, regex/* default */.A.scorm2004.CMITimespan)) { + this._session_time = session_time; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "success_status", { + get: function () { + return this._success_status; + }, + set: function (success_status) { + if (check2004ValidFormat(success_status, regex/* default */.A.scorm2004.CMISStatus)) { + this._success_status = success_status; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "suspend_data", { + get: function () { + return this._suspend_data; + }, + set: function (suspend_data) { + if (check2004ValidFormat(suspend_data, regex/* default */.A.scorm2004.CMIString64000, true)) { + this._suspend_data = suspend_data; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "time_limit_action", { + get: function () { + return this._time_limit_action; + }, + set: function (time_limit_action) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + else { + this._time_limit_action = time_limit_action; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "total_time", { + get: function () { + return this._total_time; + }, + set: function (total_time) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + else { + this._total_time = total_time; + } + }, + enumerable: false, + configurable: true + }); + CMI.prototype.getCurrentTotalTime = function () { + var sessionTime = this._session_time; + var startTime = this.start_time; + if (typeof startTime !== "undefined" && startTime !== null) { + var seconds = new Date().getTime() - startTime; + sessionTime = utilities/* getSecondsAsISODuration */.xE(seconds / 1000); + } + return utilities/* addTwoDurations */.$o(this._total_time, sessionTime, regex/* default */.A.scorm2004.CMITimespan); + }; + CMI.prototype.toJSON = function () { + this.jsonString = true; + var result = { + comments_from_learner: this.comments_from_learner, + comments_from_lms: this.comments_from_lms, + completion_status: this.completion_status, + completion_threshold: this.completion_threshold, + credit: this.credit, + entry: this.entry, + exit: this.exit, + interactions: this.interactions, + launch_data: this.launch_data, + learner_id: this.learner_id, + learner_name: this.learner_name, + learner_preference: this.learner_preference, + location: this.location, + max_time_allowed: this.max_time_allowed, + mode: this.mode, + objectives: this.objectives, + progress_measure: this.progress_measure, + scaled_passing_score: this.scaled_passing_score, + score: this.score, + session_time: this.session_time, + success_status: this.success_status, + suspend_data: this.suspend_data, + time_limit_action: this.time_limit_action, + }; + delete this.jsonString; + return result; + }; + return CMI; +}(base_cmi/* BaseRootCMI */.r)); + + +;// ./src/constants/language_constants.ts +var ValidLanguages = [ + "aa", + "ab", + "ae", + "af", + "ak", + "am", + "an", + "ar", + "as", + "av", + "ay", + "az", + "ba", + "be", + "bg", + "bh", + "bi", + "bm", + "bn", + "bo", + "br", + "bs", + "ca", + "ce", + "ch", + "co", + "cr", + "cs", + "cu", + "cv", + "cy", + "da", + "de", + "dv", + "dz", + "ee", + "el", + "en", + "eo", + "es", + "et", + "eu", + "fa", + "ff", + "fi", + "fj", + "fo", + "fr", + "fy", + "ga", + "gd", + "gl", + "gn", + "gu", + "gv", + "ha", + "he", + "hi", + "ho", + "hr", + "ht", + "hu", + "hy", + "hz", + "ia", + "id", + "ie", + "ig", + "ii", + "ik", + "io", + "is", + "it", + "iu", + "ja", + "jv", + "ka", + "kg", + "ki", + "kj", + "kk", + "kl", + "km", + "kn", + "ko", + "kr", + "ks", + "ku", + "kv", + "kw", + "ky", + "la", + "lb", + "lg", + "li", + "ln", + "lo", + "lt", + "lu", + "lv", + "mg", + "mh", + "mi", + "mk", + "ml", + "mn", + "mo", + "mr", + "ms", + "mt", + "my", + "na", + "nb", + "nd", + "ne", + "ng", + "nl", + "nn", + "no", + "nr", + "nv", + "ny", + "oc", + "oj", + "om", + "or", + "os", + "pa", + "pi", + "pl", + "ps", + "pt", + "qu", + "rm", + "rn", + "ro", + "ru", + "rw", + "sa", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sk", + "sl", + "sm", + "sn", + "so", + "sq", + "sr", + "ss", + "st", + "su", + "sv", + "sw", + "ta", + "te", + "tg", + "th", + "ti", + "tk", + "tl", + "tn", + "to", + "tr", + "ts", + "tt", + "tw", + "ty", + "ug", + "uk", + "ur", + "uz", + "ve", + "vi", + "vo", + "wa", + "wo", + "xh", + "yi", + "yo", + "za", + "zh", + "zu", + "aar", + "abk", + "ave", + "afr", + "aka", + "amh", + "arg", + "ara", + "asm", + "ava", + "aym", + "aze", + "bak", + "bel", + "bul", + "bih", + "bis", + "bam", + "ben", + "tib", + "bod", + "bre", + "bos", + "cat", + "che", + "cha", + "cos", + "cre", + "cze", + "ces", + "chu", + "chv", + "wel", + "cym", + "dan", + "ger", + "deu", + "div", + "dzo", + "ewe", + "gre", + "ell", + "eng", + "epo", + "spa", + "est", + "baq", + "eus", + "per", + "fas", + "ful", + "fin", + "fij", + "fao", + "fre", + "fra", + "fry", + "gle", + "gla", + "glg", + "grn", + "guj", + "glv", + "hau", + "heb", + "hin", + "hmo", + "hrv", + "hat", + "hun", + "arm", + "hye", + "her", + "ina", + "ind", + "ile", + "ibo", + "iii", + "ipk", + "ido", + "ice", + "isl", + "ita", + "iku", + "jpn", + "jav", + "geo", + "kat", + "kon", + "kik", + "kua", + "kaz", + "kal", + "khm", + "kan", + "kor", + "kau", + "kas", + "kur", + "kom", + "cor", + "kir", + "lat", + "ltz", + "lug", + "lim", + "lin", + "lao", + "lit", + "lub", + "lav", + "mlg", + "mah", + "mao", + "mri", + "mac", + "mkd", + "mal", + "mon", + "mol", + "mar", + "may", + "msa", + "mlt", + "bur", + "mya", + "nau", + "nob", + "nde", + "nep", + "ndo", + "dut", + "nld", + "nno", + "nor", + "nbl", + "nav", + "nya", + "oci", + "oji", + "orm", + "ori", + "oss", + "pan", + "pli", + "pol", + "pus", + "por", + "que", + "roh", + "run", + "rum", + "ron", + "rus", + "kin", + "san", + "srd", + "snd", + "sme", + "sag", + "slo", + "sin", + "slk", + "slv", + "smo", + "sna", + "som", + "alb", + "sqi", + "srp", + "ssw", + "sot", + "sun", + "swe", + "swa", + "tam", + "tel", + "tgk", + "tha", + "tir", + "tuk", + "tgl", + "tsn", + "ton", + "tur", + "tso", + "tat", + "twi", + "tah", + "uig", + "ukr", + "urd", + "uzb", + "ven", + "vie", + "vol", + "wln", + "wol", + "xho", + "yid", + "yor", + "zha", + "chi", + "zho", + "zul", +]; +/* harmony default export */ var language_constants = (ValidLanguages); + +// EXTERNAL MODULE: ./src/constants/enums.ts +var enums = __webpack_require__(56); +;// ./src/cmi/scorm2004/adl.ts + + + + + + + +var ADL = (function (_super) { + (0,tslib_es6/* __extends */.C6)(ADL, _super); + function ADL() { + var _this = _super.call(this) || this; + _this.nav = new ADLNav(); + return _this; + } + ADL.prototype.initialize = function () { + var _a; + _super.prototype.initialize.call(this); + (_a = this.nav) === null || _a === void 0 ? void 0 : _a.initialize(); + }; + ADL.prototype.toJSON = function () { + this.jsonString = true; + var result = { + nav: this.nav, + }; + delete this.jsonString; + return result; + }; + return ADL; +}(base_cmi/* BaseCMI */.J)); + +var ADLNav = (function (_super) { + (0,tslib_es6/* __extends */.C6)(ADLNav, _super); + function ADLNav() { + var _this = _super.call(this) || this; + _this._request = "_none_"; + _this.request_valid = new ADLNavRequestValid(); + return _this; + } + ADLNav.prototype.initialize = function () { + var _a; + _super.prototype.initialize.call(this); + (_a = this.request_valid) === null || _a === void 0 ? void 0 : _a.initialize(); + }; + Object.defineProperty(ADLNav.prototype, "request", { + get: function () { + return this._request; + }, + set: function (request) { + if (check2004ValidFormat(request, regex/* default */.A.scorm2004.NAVEvent)) { + this._request = request; + } + }, + enumerable: false, + configurable: true + }); + ADLNav.prototype.toJSON = function () { + this.jsonString = true; + var result = { + request: this.request, + }; + delete this.jsonString; + return result; + }; + return ADLNav; +}(base_cmi/* BaseCMI */.J)); + +var ADLNavRequestValid = (function (_super) { + (0,tslib_es6/* __extends */.C6)(ADLNavRequestValid, _super); + function ADLNavRequestValid() { + var _this = _super.call(this) || this; + _this._continue = "unknown"; + _this._previous = "unknown"; + _this._choice = {}; + _this._jump = {}; + return _this; + } + Object.defineProperty(ADLNavRequestValid.prototype, "continue", { + get: function () { + return this._continue; + }, + set: function (_continue) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + if (check2004ValidFormat(_continue, regex/* default */.A.scorm2004.NAVBoolean)) { + this._continue = _continue; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(ADLNavRequestValid.prototype, "previous", { + get: function () { + return this._previous; + }, + set: function (_previous) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + if (check2004ValidFormat(_previous, regex/* default */.A.scorm2004.NAVBoolean)) { + this._previous = _previous; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(ADLNavRequestValid.prototype, "choice", { + get: function () { + return this._choice; + }, + set: function (choice) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + if (typeof choice !== "object") { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + for (var key in choice) { + if ({}.hasOwnProperty.call(choice, key)) { + if (check2004ValidFormat(choice[key], regex/* default */.A.scorm2004.NAVBoolean) && + check2004ValidFormat(key, regex/* default */.A.scorm2004.NAVTarget)) { + this._choice[key] = + enums/* NAVBoolean */.K$[choice[key]]; + } + } + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(ADLNavRequestValid.prototype, "jump", { + get: function () { + return this._jump; + }, + set: function (jump) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + if (typeof jump !== "object") { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + for (var key in jump) { + if ({}.hasOwnProperty.call(jump, key)) { + if (check2004ValidFormat(jump[key], regex/* default */.A.scorm2004.NAVBoolean) && + check2004ValidFormat(key, regex/* default */.A.scorm2004.NAVTarget)) { + this._jump[key] = enums/* NAVBoolean */.K$[jump[key]]; + } + } + } + }, + enumerable: false, + configurable: true + }); + ADLNavRequestValid.prototype.toJSON = function () { + this.jsonString = true; + var result = { + previous: this._previous, + continue: this._continue, + choice: this._choice, + jump: this._jump, + }; + delete this.jsonString; + return result; + }; + return ADLNavRequestValid; +}(base_cmi/* BaseCMI */.J)); + + +;// ./src/Scorm2004API.ts + + + + + + + + + + + + + + + + +var Scorm2004Impl = (function (_super) { + (0,tslib_es6/* __extends */.C6)(Scorm2004Impl, _super); + function Scorm2004Impl(settings) { + var _this = this; + if (settings) { + if (settings.mastery_override === undefined) { + settings.mastery_override = false; + } + } + _this = _super.call(this, error_codes/* default */.A.scorm2004, settings) || this; + _this._version = "1.0"; + _this.cmi = new CMI(); + _this.adl = new ADL(); + _this.Initialize = _this.lmsInitialize; + _this.Terminate = _this.lmsFinish; + _this.GetValue = _this.lmsGetValue; + _this.SetValue = _this.lmsSetValue; + _this.Commit = _this.lmsCommit; + _this.GetLastError = _this.lmsGetLastError; + _this.GetErrorString = _this.lmsGetErrorString; + _this.GetDiagnostic = _this.lmsGetDiagnostic; + return _this; + } + Scorm2004Impl.prototype.reset = function (settings) { + this.commonReset(settings); + this.cmi = new CMI(); + this.adl = new ADL(); + }; + Object.defineProperty(Scorm2004Impl.prototype, "version", { + get: function () { + return this._version; + }, + enumerable: false, + configurable: true + }); + Scorm2004Impl.prototype.lmsInitialize = function () { + this.cmi.initialize(); + return this.initialize("Initialize"); + }; + Scorm2004Impl.prototype.lmsFinish = function () { + var _this = this; + (function () { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this.internalFinish()]; + case 1: + _a.sent(); + return [2]; + } + }); + }); })(); + return api_constants/* default */.A.global.SCORM_TRUE; + }; + Scorm2004Impl.prototype.internalFinish = function () { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + var result, navActions, request, choiceJumpRegex, matches, target, action; + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this.terminate("Terminate", true)]; + case 1: + result = _a.sent(); + if (result === api_constants/* default */.A.global.SCORM_TRUE) { + if (this.adl.nav.request !== "_none_") { + navActions = { + continue: "SequenceNext", + previous: "SequencePrevious", + choice: "SequenceChoice", + jump: "SequenceJump", + exit: "SequenceExit", + exitAll: "SequenceExitAll", + abandon: "SequenceAbandon", + abandonAll: "SequenceAbandonAll", + }; + request = this.adl.nav.request; + choiceJumpRegex = new RegExp(regex/* default */.A.scorm2004.NAVEvent); + matches = request.match(choiceJumpRegex); + target = ""; + if (matches && matches.length > 2) { + target = matches[2]; + request = matches[1].replace(target, ""); + } + action = navActions[request]; + if (action) { + this.processListeners(action, "adl.nav.request", target); + } + } + else if (this.settings.autoProgress) { + this.processListeners("SequenceNext"); + } + } + return [2, result]; + } + }); + }); + }; + Scorm2004Impl.prototype.lmsGetValue = function (CMIElement) { + var adlNavRequestRegex = "^adl\\.nav\\.request_valid\\.(choice|jump)\\.{target=\\S{0,}([a-zA-Z0-9-_]+)}$"; + if ((0,utilities/* stringMatches */.J6)(CMIElement, adlNavRequestRegex)) { + var matches = CMIElement.match(adlNavRequestRegex); + var request = matches[1]; + var target = matches[2].replace("{target=", "").replace("}", ""); + if (request === "choice" || request === "jump") { + if (this.settings.scoItemIdValidator) { + return String(this.settings.scoItemIdValidator(target)); + } + return String(this.settings.scoItemIds.includes(target)); + } + } + return this.getValue("GetValue", true, CMIElement); + }; + Scorm2004Impl.prototype.lmsSetValue = function (CMIElement, value) { + return this.setValue("SetValue", "Commit", true, CMIElement, value); + }; + Scorm2004Impl.prototype.lmsCommit = function () { + var _this = this; + (function () { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this.commit("Commit")]; + case 1: + _a.sent(); + return [2]; + } + }); + }); })(); + return api_constants/* default */.A.global.SCORM_TRUE; + }; + Scorm2004Impl.prototype.lmsGetLastError = function () { + return this.getLastError("GetLastError"); + }; + Scorm2004Impl.prototype.lmsGetErrorString = function (CMIErrorCode) { + return this.getErrorString("GetErrorString", CMIErrorCode); + }; + Scorm2004Impl.prototype.lmsGetDiagnostic = function (CMIErrorCode) { + return this.getDiagnostic("GetDiagnostic", CMIErrorCode); + }; + Scorm2004Impl.prototype.setCMIValue = function (CMIElement, value) { + return this._commonSetCMIValue("SetValue", true, CMIElement, value); + }; + Scorm2004Impl.prototype.getChildElement = function (CMIElement, value, foundFirstIndex) { + if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.objectives\\.\\d+")) { + return new CMIObjectivesObject(); + } + if (foundFirstIndex) { + if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")) { + return this.createCorrectResponsesObject(CMIElement, value); + } + else if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")) { + return new CMIInteractionsObjectivesObject(); + } + } + else if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.interactions\\.\\d+")) { + return new CMIInteractionsObject(); + } + if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.comments_from_learner\\.\\d+")) { + return new CMICommentsObject(); + } + else if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.comments_from_lms\\.\\d+")) { + return new CMICommentsObject(true); + } + return null; + }; + Scorm2004Impl.prototype.createCorrectResponsesObject = function (CMIElement, value) { + var parts = CMIElement.split("."); + var index = Number(parts[2]); + var interaction = this.cmi.interactions.childArray[index]; + if (this.isInitialized()) { + if (!interaction.type) { + this.throwSCORMError(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + } + else { + this.checkDuplicateChoiceResponse(interaction, value); + var response_type = CorrectResponses[interaction.type]; + if (response_type) { + this.checkValidResponseType(response_type, value, interaction.type); + } + else { + this.throwSCORMError(error_codes/* default */.A.scorm2004.GENERAL_SET_FAILURE, "Incorrect Response Type: " + interaction.type); + } + } + } + if (this.lastErrorCode === "0") { + return new CMIInteractionsCorrectResponsesObject(); + } + return null; + }; + Scorm2004Impl.prototype.checkValidResponseType = function (response_type, value, interaction_type) { + var nodes = []; + if (response_type === null || response_type === void 0 ? void 0 : response_type.delimiter) { + nodes = String(value).split(response_type.delimiter); + } + else { + nodes[0] = value; + } + if (nodes.length > 0 && nodes.length <= response_type.max) { + this.checkCorrectResponseValue(interaction_type, nodes, value); + } + else if (nodes.length > response_type.max) { + this.throwSCORMError(error_codes/* default */.A.scorm2004.GENERAL_SET_FAILURE, "Data Model Element Pattern Too Long"); + } + }; + Scorm2004Impl.prototype.checkDuplicateChoiceResponse = function (interaction, value) { + var interaction_count = interaction.correct_responses._count; + if (interaction.type === "choice") { + for (var i = 0; i < interaction_count && this.lastErrorCode === "0"; i++) { + var response = interaction.correct_responses.childArray[i]; + if (response.pattern === value) { + this.throwSCORMError(error_codes/* default */.A.scorm2004.GENERAL_SET_FAILURE); + } + } + } + }; + Scorm2004Impl.prototype.validateCorrectResponse = function (CMIElement, value) { + var parts = CMIElement.split("."); + var index = Number(parts[2]); + var pattern_index = Number(parts[4]); + var interaction = this.cmi.interactions.childArray[index]; + var interaction_count = interaction.correct_responses._count; + this.checkDuplicateChoiceResponse(interaction, value); + var response_type = CorrectResponses[interaction.type]; + if (typeof response_type.limit === "undefined" || + interaction_count <= response_type.limit) { + this.checkValidResponseType(response_type, value, interaction.type); + if ((this.lastErrorCode === "0" && + (!response_type.duplicate || + !this.checkDuplicatedPattern(interaction.correct_responses, pattern_index, value))) || + (this.lastErrorCode === "0" && value === "")) { + } + else { + if (this.lastErrorCode === "0") { + this.throwSCORMError(error_codes/* default */.A.scorm2004.GENERAL_SET_FAILURE, "Data Model Element Pattern Already Exists"); + } + } + } + else { + this.throwSCORMError(error_codes/* default */.A.scorm2004.GENERAL_SET_FAILURE, "Data Model Element Collection Limit Reached"); + } + }; + Scorm2004Impl.prototype.getCMIValue = function (CMIElement) { + return this._commonGetCMIValue("GetValue", true, CMIElement); + }; + Scorm2004Impl.prototype.getLmsErrorMessageDetails = function (errorNumber, detail) { + var basicMessage = ""; + var detailMessage = ""; + errorNumber = String(errorNumber); + if (api_constants/* default */.A.scorm2004.error_descriptions[errorNumber]) { + basicMessage = + api_constants/* default */.A.scorm2004.error_descriptions[errorNumber].basicMessage; + detailMessage = + api_constants/* default */.A.scorm2004.error_descriptions[errorNumber].detailMessage; + } + return detail ? detailMessage : basicMessage; + }; + Scorm2004Impl.prototype.checkDuplicatedPattern = function (correct_response, current_index, value) { + var found = false; + var count = correct_response._count; + for (var i = 0; i < count && !found; i++) { + if (i !== current_index && correct_response.childArray[i] === value) { + found = true; + } + } + return found; + }; + Scorm2004Impl.prototype.checkCorrectResponseValue = function (interaction_type, nodes, value) { + var response = CorrectResponses[interaction_type]; + var formatRegex = new RegExp(response.format); + for (var i = 0; i < nodes.length && this.lastErrorCode === "0"; i++) { + if (interaction_type.match("^(fill-in|long-fill-in|matching|performance|sequencing)$")) { + nodes[i] = this.removeCorrectResponsePrefixes(nodes[i]); + } + if (response === null || response === void 0 ? void 0 : response.delimiter2) { + var values = nodes[i].split(response.delimiter2); + if (values.length === 2) { + var matches = values[0].match(formatRegex); + if (!matches) { + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + else { + if (!response.format2 || + !values[1].match(new RegExp(response.format2))) { + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + } + } + else { + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + } + else { + var matches = nodes[i].match(formatRegex); + if ((!matches && value !== "") || + (!matches && interaction_type === "true-false")) { + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + else { + if (interaction_type === "numeric" && nodes.length > 1) { + if (Number(nodes[0]) > Number(nodes[1])) { + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + } + else { + if (nodes[i] !== "" && response.unique) { + for (var j = 0; j < i && this.lastErrorCode === "0"; j++) { + if (nodes[i] === nodes[j]) { + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + } + } + } + } + } + } + }; + Scorm2004Impl.prototype.removeCorrectResponsePrefixes = function (node) { + var seenOrder = false; + var seenCase = false; + var seenLang = false; + var prefixRegex = new RegExp("^({(lang|case_matters|order_matters)=([^}]+)})"); + var matches = node.match(prefixRegex); + var langMatches = null; + while (matches) { + switch (matches[2]) { + case "lang": + langMatches = node.match(regex/* default */.A.scorm2004.CMILangcr); + if (langMatches) { + var lang = langMatches[3]; + if (lang !== undefined && lang.length > 0) { + if (!language_constants.includes(lang.toLowerCase())) { + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + } + } + seenLang = true; + break; + case "case_matters": + if (!seenLang && !seenOrder && !seenCase) { + if (matches[3] !== "true" && matches[3] !== "false") { + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + } + seenCase = true; + break; + case "order_matters": + if (!seenCase && !seenLang && !seenOrder) { + if (matches[3] !== "true" && matches[3] !== "false") { + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + } + seenOrder = true; + break; + } + node = node.substring(matches[1].length); + matches = node.match(prefixRegex); + } + return node; + }; + Scorm2004Impl.prototype.replaceWithAnotherScormAPI = function (newAPI) { + this.cmi = newAPI.cmi; + this.adl = newAPI.adl; + }; + Scorm2004Impl.prototype.renderCommitCMI = function (terminateCommit) { + var cmiExport = this.renderCMIToJSONObject(); + if (terminateCommit) { + cmiExport.cmi.total_time = this.cmi.getCurrentTotalTime(); + } + var result = []; + var flattened = utilities/* flatten */.Bq(cmiExport); + switch (this.settings.dataCommitFormat) { + case "flattened": + return utilities/* flatten */.Bq(cmiExport); + case "params": + for (var item in flattened) { + if ({}.hasOwnProperty.call(flattened, item)) { + result.push("".concat(item, "=").concat(flattened[item])); + } + } + return result; + case "json": + default: + return cmiExport; + } + }; + Scorm2004Impl.prototype.renderCommitObject = function (terminateCommit) { + var cmiExport = this.renderCommitCMI(terminateCommit); + var totalTimeDuration = this.cmi.getCurrentTotalTime(); + var totalTimeSeconds = utilities/* getDurationAsSeconds */.OI(totalTimeDuration, regex/* default */.A.scorm2004.CMITimespan); + var completionStatus = enums/* CompletionStatus */.lC.unknown; + var successStatus = enums/* SuccessStatus */.YE.unknown; + if (this.cmi.completion_status) { + if (this.cmi.completion_status === "completed") { + completionStatus = enums/* CompletionStatus */.lC.completed; + } + else if (this.cmi.completion_status === "incomplete") { + completionStatus = enums/* CompletionStatus */.lC.incomplete; + } + } + if (this.cmi.success_status) { + if (this.cmi.success_status === "passed") { + successStatus = enums/* SuccessStatus */.YE.passed; + } + else if (this.cmi.success_status === "failed") { + successStatus = enums/* SuccessStatus */.YE.failed; + } + } + var score = this.cmi.score; + var scoreObject = null; + if (score) { + scoreObject = {}; + if (!Number.isNaN(Number.parseFloat(score.raw))) { + scoreObject.raw = Number.parseFloat(score.raw); + } + if (!Number.isNaN(Number.parseFloat(score.min))) { + scoreObject.min = Number.parseFloat(score.min); + } + if (!Number.isNaN(Number.parseFloat(score.max))) { + scoreObject.max = Number.parseFloat(score.max); + } + if (!Number.isNaN(Number.parseFloat(score.scaled))) { + scoreObject.scaled = Number.parseFloat(score.scaled); + } + } + var commitObject = { + completionStatus: completionStatus, + successStatus: successStatus, + totalTimeSeconds: totalTimeSeconds, + runtimeData: cmiExport, + }; + if (scoreObject) { + commitObject.score = scoreObject; + } + return commitObject; + }; + Scorm2004Impl.prototype.storeData = function (terminateCommit) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + var navRequest, shouldTerminateCommit, commitObject, result; + var _a, _b, _c; + return (0,tslib_es6/* __generator */.YH)(this, function (_d) { + switch (_d.label) { + case 0: + if (terminateCommit) { + if (this.cmi.mode === "normal") { + if (this.cmi.credit === "credit") { + if (this.cmi.completion_threshold && this.cmi.progress_measure) { + if (this.cmi.progress_measure >= this.cmi.completion_threshold) { + this.cmi.completion_status = "completed"; + } + else { + this.cmi.completion_status = "incomplete"; + } + } + if (this.cmi.scaled_passing_score && this.cmi.score.scaled) { + if (this.cmi.score.scaled >= this.cmi.scaled_passing_score) { + this.cmi.success_status = "passed"; + } + else { + this.cmi.success_status = "failed"; + } + } + } + } + } + navRequest = false; + if (this.adl.nav.request !== ((_c = (_b = (_a = this.startingData) === null || _a === void 0 ? void 0 : _a.adl) === null || _b === void 0 ? void 0 : _b.nav) === null || _c === void 0 ? void 0 : _c.request) && + this.adl.nav.request !== "_none_") { + this.adl.nav.request = encodeURIComponent(this.adl.nav.request); + navRequest = true; + } + shouldTerminateCommit = terminateCommit || this.settings.alwaysSendTotalTime; + commitObject = this.settings.renderCommonCommitFields + ? this.renderCommitObject(shouldTerminateCommit) + : this.renderCommitCMI(shouldTerminateCommit); + if (this.apiLogLevel === api_constants/* default */.A.global.LOG_LEVEL_DEBUG) { + console.debug("Commit (terminated: " + (terminateCommit ? "yes" : "no") + "): "); + console.debug(commitObject); + } + if (!(typeof this.settings.lmsCommitUrl === "string")) return [3, 2]; + return [4, this.processHttpRequest(this.settings.lmsCommitUrl, commitObject, terminateCommit)]; + case 1: + result = _d.sent(); + { + if (navRequest && + result.navRequest !== undefined && + result.navRequest !== "") { + Function("\"use strict\";(() => { ".concat(result.navRequest, " })()"))(); + } + } + return [2, result]; + case 2: return [2, { + result: api_constants/* default */.A.global.SCORM_TRUE, + errorCode: 0, + }]; + } + }); + }); + }; + return Scorm2004Impl; +}(BaseAPI/* default */.A)); + + + +/***/ }), + +/***/ 589: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ B: function() { return /* binding */ CMIArray; } +/* harmony export */ }); +/* unused harmony export scorm12_error_codes */ +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635); +/* harmony import */ var _base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(797); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(784); + + + + +var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12; +var CMIArray = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__extends */ .C6)(CMIArray, _super); + function CMIArray(params) { + var _this = _super.call(this) || this; + _this.__children = params.children; + _this._errorCode = params.errorCode || scorm12_error_codes.GENERAL; + _this._errorClass = params.errorClass || _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .BaseScormValidationError */ .$h; + _this.childArray = []; + return _this; + } + Object.defineProperty(CMIArray.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new this._errorClass(this._errorCode); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIArray.prototype, "_count", { + get: function () { + return this.childArray.length; + }, + set: function (_count) { + throw new this._errorClass(this._errorCode); + }, + enumerable: false, + configurable: true + }); + CMIArray.prototype.toJSON = function () { + this.jsonString = true; + var result = {}; + for (var i = 0; i < this.childArray.length; i++) { + result[i + ""] = this.childArray[i]; + } + delete this.jsonString; + return result; + }; + return CMIArray; +}(_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 319: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ J: function() { return /* binding */ BaseCMI; }, +/* harmony export */ r: function() { return /* binding */ BaseRootCMI; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); + +var BaseCMI = (function () { + function BaseCMI() { + this.jsonString = false; + this._initialized = false; + } + Object.defineProperty(BaseCMI.prototype, "initialized", { + get: function () { + return this._initialized; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BaseCMI.prototype, "start_time", { + get: function () { + return this._start_time; + }, + enumerable: false, + configurable: true + }); + BaseCMI.prototype.initialize = function () { + this._initialized = true; + }; + BaseCMI.prototype.setStartTime = function () { + this._start_time = new Date().getTime(); + }; + return BaseCMI; +}()); + +var BaseRootCMI = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__extends */ .C6)(BaseRootCMI, _super); + function BaseRootCMI() { + return _super !== null && _super.apply(this, arguments) || this; + } + return BaseRootCMI; +}(BaseCMI)); + + + +/***/ }), + +/***/ 434: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ _: function() { return /* binding */ CMIScore; } +/* harmony export */ }); +/* unused harmony export scorm12_error_codes */ +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(417); +/* harmony import */ var _base_cmi__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(319); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(449); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797); + + + + + + +var scorm12_constants = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12; +var scorm12_regex = _constants_regex__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12; +var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12; +var CMIScore = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__extends */ .C6)(CMIScore, _super); + function CMIScore(params) { + var _this = _super.call(this) || this; + _this._raw = ""; + _this._min = ""; + _this.__children = params.score_children || scorm12_constants.score_children; + _this.__score_range = !params.score_range + ? false + : scorm12_regex.score_range; + _this._max = params.max || params.max === "" ? params.max : "100"; + _this.__invalid_error_code = + params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE; + _this.__invalid_type_code = + params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH; + _this.__invalid_range_code = + params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE; + _this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal; + _this.__error_class = params.errorClass; + return _this; + } + Object.defineProperty(CMIScore.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new this.__error_class(this.__invalid_error_code); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIScore.prototype, "raw", { + get: function () { + return this._raw; + }, + set: function (raw) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidFormat */ .q)(raw, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && + (!this.__score_range || + (0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidRange */ .W)(raw, this.__score_range, this.__invalid_range_code, this.__error_class))) { + this._raw = raw; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIScore.prototype, "min", { + get: function () { + return this._min; + }, + set: function (min) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidFormat */ .q)(min, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && + (!this.__score_range || + (0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidRange */ .W)(min, this.__score_range, this.__invalid_range_code, this.__error_class))) { + this._min = min; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIScore.prototype, "max", { + get: function () { + return this._max; + }, + set: function (max) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidFormat */ .q)(max, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && + (!this.__score_range || + (0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidRange */ .W)(max, this.__score_range, this.__invalid_range_code, this.__error_class))) { + this._max = max; + } + }, + enumerable: false, + configurable: true + }); + CMIScore.prototype.toJSON = function () { + this.jsonString = true; + var result = { + raw: this.raw, + min: this.min, + max: this.max, + }; + delete this.jsonString; + return result; + }; + return CMIScore; +}(_base_cmi__WEBPACK_IMPORTED_MODULE_2__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 449: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ W: function() { return /* binding */ checkValidRange; }, +/* harmony export */ q: function() { return /* binding */ checkValidFormat; } +/* harmony export */ }); +function checkValidFormat(value, regexPattern, errorCode, errorClass, allowEmptyString) { + if (typeof value !== "string") { + return false; + } + var formatRegex = new RegExp(regexPattern); + var matches = value.match(formatRegex); + if (allowEmptyString && value === "") { + return true; + } + if (value === undefined || !matches || matches[0] === "") { + throw new errorClass(errorCode); + } + return true; +} +function checkValidRange(value, rangePattern, errorCode, errorClass) { + var ranges = rangePattern.split("#"); + value = value * 1.0; + if (value >= ranges[0]) { + if (ranges[1] === "*" || value <= ranges[1]) { + return true; + } + else { + throw new errorClass(errorCode); + } + } + else { + throw new errorClass(errorCode); + } +} + + +/***/ }), + +/***/ 989: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + Y: function() { return /* binding */ CMI; } +}); + +// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs +var tslib_es6 = __webpack_require__(635); +// EXTERNAL MODULE: ./src/constants/api_constants.ts +var api_constants = __webpack_require__(340); +// EXTERNAL MODULE: ./src/constants/error_codes.ts +var error_codes = __webpack_require__(797); +// EXTERNAL MODULE: ./src/constants/regex.ts +var regex = __webpack_require__(417); +// EXTERNAL MODULE: ./src/exceptions.ts +var exceptions = __webpack_require__(784); +// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts +var base_cmi = __webpack_require__(319); +// EXTERNAL MODULE: ./src/cmi/scorm12/validation.ts +var validation = __webpack_require__(915); +// EXTERNAL MODULE: ./src/cmi/common/score.ts +var score = __webpack_require__(434); +// EXTERNAL MODULE: ./src/utilities.ts +var utilities = __webpack_require__(864); +;// ./src/cmi/aicc/core.ts + + + + + + + + + +var CMICore = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMICore, _super); + function CMICore() { + var _this = _super.call(this) || this; + _this.__children = api_constants/* default */.A.scorm12.core_children; + _this._student_id = ""; + _this._student_name = ""; + _this._lesson_location = ""; + _this._credit = ""; + _this._lesson_status = "not attempted"; + _this._entry = ""; + _this._total_time = ""; + _this._lesson_mode = "normal"; + _this._exit = ""; + _this._session_time = "00:00:00"; + _this._suspend_data = ""; + _this.score = new score/* CMIScore */._({ + score_children: api_constants/* default */.A.scorm12.score_children, + score_range: regex/* default */.A.scorm12.score_range, + invalidErrorCode: error_codes/* default */.A.scorm12.INVALID_SET_VALUE, + invalidTypeCode: error_codes/* default */.A.scorm12.TYPE_MISMATCH, + invalidRangeCode: error_codes/* default */.A.scorm12.VALUE_OUT_OF_RANGE, + errorClass: exceptions/* Scorm12ValidationError */.tQ, + }); + return _this; + } + CMICore.prototype.initialize = function () { + var _a; + _super.prototype.initialize.call(this); + (_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize(); + }; + Object.defineProperty(CMICore.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.INVALID_SET_VALUE); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "student_id", { + get: function () { + return this._student_id; + }, + set: function (student_id) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._student_id = student_id; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "student_name", { + get: function () { + return this._student_name; + }, + set: function (student_name) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._student_name = student_name; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "lesson_location", { + get: function () { + return this._lesson_location; + }, + set: function (lesson_location) { + if ((0,validation/* check12ValidFormat */.p)(lesson_location, regex/* default */.A.scorm12.CMIString256, true)) { + this._lesson_location = lesson_location; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "credit", { + get: function () { + return this._credit; + }, + set: function (credit) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._credit = credit; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "lesson_status", { + get: function () { + return this._lesson_status; + }, + set: function (lesson_status) { + if (this.initialized) { + if ((0,validation/* check12ValidFormat */.p)(lesson_status, regex/* default */.A.scorm12.CMIStatus)) { + this._lesson_status = lesson_status; + } + } + else { + if ((0,validation/* check12ValidFormat */.p)(lesson_status, regex/* default */.A.scorm12.CMIStatus2)) { + this._lesson_status = lesson_status; + } + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "entry", { + get: function () { + return this._entry; + }, + set: function (entry) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._entry = entry; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "total_time", { + get: function () { + return this._total_time; + }, + set: function (total_time) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._total_time = total_time; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "lesson_mode", { + get: function () { + return this._lesson_mode; + }, + set: function (lesson_mode) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._lesson_mode = lesson_mode; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "exit", { + get: function () { + if (!this.jsonString) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._exit; + }, + set: function (exit) { + if ((0,validation/* check12ValidFormat */.p)(exit, regex/* default */.A.scorm12.CMIExit, true)) { + this._exit = exit; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "session_time", { + get: function () { + if (!this.jsonString) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._session_time; + }, + set: function (session_time) { + if ((0,validation/* check12ValidFormat */.p)(session_time, regex/* default */.A.scorm12.CMITimespan)) { + this._session_time = session_time; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "suspend_data", { + get: function () { + return this._suspend_data; + }, + set: function (suspend_data) { + if ((0,validation/* check12ValidFormat */.p)(suspend_data, regex/* default */.A.scorm12.CMIString4096, true)) { + this._suspend_data = suspend_data; + } + }, + enumerable: false, + configurable: true + }); + CMICore.prototype.getCurrentTotalTime = function (start_time) { + var sessionTime = this._session_time; + var startTime = start_time; + if (typeof startTime !== "undefined" && startTime !== null) { + var seconds = new Date().getTime() - startTime; + sessionTime = utilities/* getSecondsAsHHMMSS */.UZ(seconds / 1000); + } + return utilities/* addHHMMSSTimeStrings */.HT(this._total_time, sessionTime, new RegExp(regex/* default */.A.scorm12.CMITimespan)); + }; + CMICore.prototype.toJSON = function () { + this.jsonString = true; + var result = { + student_id: this.student_id, + student_name: this.student_name, + lesson_location: this.lesson_location, + credit: this.credit, + lesson_status: this.lesson_status, + entry: this.entry, + lesson_mode: this.lesson_mode, + exit: this.exit, + session_time: this.session_time, + score: this.score, + }; + delete this.jsonString; + return result; + }; + return CMICore; +}(base_cmi/* BaseCMI */.J)); + + +// EXTERNAL MODULE: ./src/cmi/scorm12/objectives.ts +var objectives = __webpack_require__(176); +// EXTERNAL MODULE: ./src/cmi/scorm12/student_data.ts +var scorm12_student_data = __webpack_require__(532); +// EXTERNAL MODULE: ./src/cmi/scorm12/student_preference.ts +var student_preference = __webpack_require__(181); +// EXTERNAL MODULE: ./src/cmi/scorm12/interactions.ts +var interactions = __webpack_require__(833); +;// ./src/cmi/scorm12/cmi.ts + + + + + + + + + + + + +var CMI = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMI, _super); + function CMI(cmi_children, student_data, initialized) { + var _this = _super.call(this) || this; + _this.__children = ""; + _this.__version = "3.4"; + _this._launch_data = ""; + _this._comments = ""; + _this._comments_from_lms = ""; + if (initialized) + _this.initialize(); + _this.__children = cmi_children + ? cmi_children + : api_constants/* default */.A.scorm12.cmi_children; + _this.core = new CMICore(); + _this.objectives = new objectives/* CMIObjectives */.C(); + _this.student_data = student_data ? student_data : new scorm12_student_data/* CMIStudentData */.X(); + _this.student_preference = new student_preference/* CMIStudentPreference */.G(); + _this.interactions = new interactions/* CMIInteractions */.Xb(); + return _this; + } + CMI.prototype.initialize = function () { + var _a, _b, _c, _d, _e; + _super.prototype.initialize.call(this); + (_a = this.core) === null || _a === void 0 ? void 0 : _a.initialize(); + (_b = this.objectives) === null || _b === void 0 ? void 0 : _b.initialize(); + (_c = this.student_data) === null || _c === void 0 ? void 0 : _c.initialize(); + (_d = this.student_preference) === null || _d === void 0 ? void 0 : _d.initialize(); + (_e = this.interactions) === null || _e === void 0 ? void 0 : _e.initialize(); + }; + CMI.prototype.toJSON = function () { + this.jsonString = true; + var result = { + suspend_data: this.suspend_data, + launch_data: this.launch_data, + comments: this.comments, + comments_from_lms: this.comments_from_lms, + core: this.core, + objectives: this.objectives, + student_data: this.student_data, + student_preference: this.student_preference, + interactions: this.interactions, + }; + delete this.jsonString; + return result; + }; + Object.defineProperty(CMI.prototype, "_version", { + get: function () { + return this.__version; + }, + set: function (_version) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.INVALID_SET_VALUE); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.INVALID_SET_VALUE); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "suspend_data", { + get: function () { + var _a; + return (_a = this.core) === null || _a === void 0 ? void 0 : _a.suspend_data; + }, + set: function (suspend_data) { + if (this.core) { + this.core.suspend_data = suspend_data; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "launch_data", { + get: function () { + return this._launch_data; + }, + set: function (launch_data) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._launch_data = launch_data; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "comments", { + get: function () { + return this._comments; + }, + set: function (comments) { + if ((0,validation/* check12ValidFormat */.p)(comments, regex/* default */.A.scorm12.CMIString4096, true)) { + this._comments = comments; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "comments_from_lms", { + get: function () { + return this._comments_from_lms; + }, + set: function (comments_from_lms) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._comments_from_lms = comments_from_lms; + } + }, + enumerable: false, + configurable: true + }); + CMI.prototype.getCurrentTotalTime = function () { + return this.core.getCurrentTotalTime(this.start_time); + }; + return CMI; +}(base_cmi/* BaseRootCMI */.r)); + + + +/***/ }), + +/***/ 833: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Oh: function() { return /* binding */ CMIInteractionsObjectivesObject; }, +/* harmony export */ WP: function() { return /* binding */ CMIInteractionsObject; }, +/* harmony export */ Xb: function() { return /* binding */ CMIInteractions; }, +/* harmony export */ cb: function() { return /* binding */ CMIInteractionsCorrectResponsesObject; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(635); +/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(589); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(797); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(784); +/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(319); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(915); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(417); + + + + + + + + +var CMIInteractions = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(CMIInteractions, _super); + function CMIInteractions() { + return _super.call(this, { + children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.interactions_children, + errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE, + errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ, + }) || this; + } + return CMIInteractions; +}(_common_array__WEBPACK_IMPORTED_MODULE_0__/* .CMIArray */ .B)); + +var CMIInteractionsObject = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(CMIInteractionsObject, _super); + function CMIInteractionsObject() { + var _this = _super.call(this) || this; + _this._id = ""; + _this._time = ""; + _this._type = ""; + _this._weighting = ""; + _this._student_response = ""; + _this._result = ""; + _this._latency = ""; + _this.objectives = new _common_array__WEBPACK_IMPORTED_MODULE_0__/* .CMIArray */ .B({ + errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE, + errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ, + children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.objectives_children, + }); + _this.correct_responses = new _common_array__WEBPACK_IMPORTED_MODULE_0__/* .CMIArray */ .B({ + errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE, + errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ, + children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.correct_responses_children, + }); + return _this; + } + CMIInteractionsObject.prototype.initialize = function () { + var _a, _b; + _super.prototype.initialize.call(this); + (_a = this.objectives) === null || _a === void 0 ? void 0 : _a.initialize(); + (_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.initialize(); + }; + Object.defineProperty(CMIInteractionsObject.prototype, "id", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._id; + }, + set: function (id) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIIdentifier)) { + this._id = id; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "time", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._time; + }, + set: function (time) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(time, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMITime)) { + this._time = time; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "type", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._type; + }, + set: function (type) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(type, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIType)) { + this._type = type; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "weighting", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._weighting; + }, + set: function (weighting) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(weighting, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIDecimal) && + (0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidRange */ .h)(weighting, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.weighting_range)) { + this._weighting = weighting; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "student_response", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._student_response; + }, + set: function (student_response) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(student_response, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIFeedback, true)) { + this._student_response = student_response; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "result", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._result; + }, + set: function (result) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(result, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIResult)) { + this._result = result; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "latency", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._latency; + }, + set: function (latency) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(latency, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMITimespan)) { + this._latency = latency; + } + }, + enumerable: false, + configurable: true + }); + CMIInteractionsObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + id: this.id, + time: this.time, + type: this.type, + weighting: this.weighting, + student_response: this.student_response, + result: this.result, + latency: this.latency, + objectives: this.objectives, + correct_responses: this.correct_responses, + }; + delete this.jsonString; + return result; + }; + return CMIInteractionsObject; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__/* .BaseCMI */ .J)); + +var CMIInteractionsObjectivesObject = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(CMIInteractionsObjectivesObject, _super); + function CMIInteractionsObjectivesObject() { + var _this = _super.call(this) || this; + _this._id = ""; + return _this; + } + Object.defineProperty(CMIInteractionsObjectivesObject.prototype, "id", { + get: function () { + return this._id; + }, + set: function (id) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIIdentifier)) { + this._id = id; + } + }, + enumerable: false, + configurable: true + }); + CMIInteractionsObjectivesObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + id: this.id, + }; + delete this.jsonString; + return result; + }; + return CMIInteractionsObjectivesObject; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__/* .BaseCMI */ .J)); + +var CMIInteractionsCorrectResponsesObject = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(CMIInteractionsCorrectResponsesObject, _super); + function CMIInteractionsCorrectResponsesObject() { + var _this = _super.call(this) || this; + _this._pattern = ""; + return _this; + } + Object.defineProperty(CMIInteractionsCorrectResponsesObject.prototype, "pattern", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._pattern; + }, + set: function (pattern) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(pattern, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIFeedback, true)) { + this._pattern = pattern; + } + }, + enumerable: false, + configurable: true + }); + CMIInteractionsCorrectResponsesObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + pattern: this._pattern, + }; + delete this.jsonString; + return result; + }; + return CMIInteractionsCorrectResponsesObject; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 331: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ A: function() { return /* binding */ NAV; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635); +/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(915); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(417); + + + + +var NAV = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__extends */ .C6)(NAV, _super); + function NAV() { + var _this = _super.call(this) || this; + _this._event = ""; + return _this; + } + Object.defineProperty(NAV.prototype, "event", { + get: function () { + return this._event; + }, + set: function (event) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_1__/* .check12ValidFormat */ .p)(event, _constants_regex__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.NAVEvent)) { + this._event = event; + } + }, + enumerable: false, + configurable: true + }); + NAV.prototype.toJSON = function () { + this.jsonString = true; + var result = { + event: this.event, + }; + delete this.jsonString; + return result; + }; + return NAV; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 176: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ C: function() { return /* binding */ CMIObjectives; }, +/* harmony export */ N: function() { return /* binding */ CMIObjectivesObject; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(635); +/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _common_score__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(434); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(340); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(417); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(797); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(784); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(915); +/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(589); + + + + + + + + + +var CMIObjectives = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__extends */ .C6)(CMIObjectives, _super); + function CMIObjectives() { + return _super.call(this, { + children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.objectives_children, + errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE, + errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_5__/* .Scorm12ValidationError */ .tQ, + }) || this; + } + return CMIObjectives; +}(_common_array__WEBPACK_IMPORTED_MODULE_7__/* .CMIArray */ .B)); + +var CMIObjectivesObject = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__extends */ .C6)(CMIObjectivesObject, _super); + function CMIObjectivesObject() { + var _this = _super.call(this) || this; + _this._id = ""; + _this._status = ""; + _this.score = new _common_score__WEBPACK_IMPORTED_MODULE_1__/* .CMIScore */ ._({ + score_children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.score_children, + score_range: _constants_regex__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.score_range, + invalidErrorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE, + invalidTypeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.scorm12.TYPE_MISMATCH, + invalidRangeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.scorm12.VALUE_OUT_OF_RANGE, + errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_5__/* .Scorm12ValidationError */ .tQ, + }); + return _this; + } + Object.defineProperty(CMIObjectivesObject.prototype, "id", { + get: function () { + return this._id; + }, + set: function (id) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__/* .check12ValidFormat */ .p)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.CMIIdentifier)) { + this._id = id; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIObjectivesObject.prototype, "status", { + get: function () { + return this._status; + }, + set: function (status) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__/* .check12ValidFormat */ .p)(status, _constants_regex__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.CMIStatus2)) { + this._status = status; + } + }, + enumerable: false, + configurable: true + }); + CMIObjectivesObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + id: this.id, + status: this.status, + score: this.score, + }; + delete this.jsonString; + return result; + }; + return CMIObjectivesObject; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 532: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ X: function() { return /* binding */ CMIStudentData; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635); +/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(784); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797); + + + + + +var CMIStudentData = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__extends */ .C6)(CMIStudentData, _super); + function CMIStudentData(student_data_children) { + var _this = _super.call(this) || this; + _this._mastery_score = ""; + _this._max_time_allowed = ""; + _this._time_limit_action = ""; + _this.__children = student_data_children + ? student_data_children + : _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.student_data_children; + return _this; + } + Object.defineProperty(CMIStudentData.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentData.prototype, "mastery_score", { + get: function () { + return this._mastery_score; + }, + set: function (mastery_score) { + if (this.initialized) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._mastery_score = mastery_score; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentData.prototype, "max_time_allowed", { + get: function () { + return this._max_time_allowed; + }, + set: function (max_time_allowed) { + if (this.initialized) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._max_time_allowed = max_time_allowed; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentData.prototype, "time_limit_action", { + get: function () { + return this._time_limit_action; + }, + set: function (time_limit_action) { + if (this.initialized) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._time_limit_action = time_limit_action; + } + }, + enumerable: false, + configurable: true + }); + CMIStudentData.prototype.toJSON = function () { + this.jsonString = true; + var result = { + mastery_score: this.mastery_score, + max_time_allowed: this.max_time_allowed, + time_limit_action: this.time_limit_action, + }; + delete this.jsonString; + return result; + }; + return CMIStudentData; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 181: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ G: function() { return /* binding */ CMIStudentPreference; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(635); +/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(784); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(915); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(417); + + + + + + + +var CMIStudentPreference = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__extends */ .C6)(CMIStudentPreference, _super); + function CMIStudentPreference(student_preference_children) { + var _this = _super.call(this) || this; + _this._audio = ""; + _this._language = ""; + _this._speed = ""; + _this._text = ""; + _this.__children = student_preference_children + ? student_preference_children + : _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.student_preference_children; + return _this; + } + Object.defineProperty(CMIStudentPreference.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentPreference.prototype, "audio", { + get: function () { + return this._audio; + }, + set: function (audio) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidFormat */ .p)(audio, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.CMISInteger) && + (0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidRange */ .h)(audio, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.audio_range)) { + this._audio = audio; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentPreference.prototype, "language", { + get: function () { + return this._language; + }, + set: function (language) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidFormat */ .p)(language, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.CMIString256)) { + this._language = language; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentPreference.prototype, "speed", { + get: function () { + return this._speed; + }, + set: function (speed) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidFormat */ .p)(speed, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.CMISInteger) && + (0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidRange */ .h)(speed, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.speed_range)) { + this._speed = speed; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentPreference.prototype, "text", { + get: function () { + return this._text; + }, + set: function (text) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidFormat */ .p)(text, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.CMISInteger) && + (0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidRange */ .h)(text, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.text_range)) { + this._text = text; + } + }, + enumerable: false, + configurable: true + }); + CMIStudentPreference.prototype.toJSON = function () { + this.jsonString = true; + var result = { + audio: this.audio, + language: this.language, + speed: this.speed, + text: this.text, + }; + delete this.jsonString; + return result; + }; + return CMIStudentPreference; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 915: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ h: function() { return /* binding */ check12ValidRange; }, +/* harmony export */ p: function() { return /* binding */ check12ValidFormat; } +/* harmony export */ }); +/* harmony import */ var _common_validation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(449); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(797); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(784); + + + +function check12ValidFormat(value, regexPattern, allowEmptyString) { + return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__/* .checkValidFormat */ .q)(value, regexPattern, _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.TYPE_MISMATCH, _exceptions__WEBPACK_IMPORTED_MODULE_1__/* .Scorm12ValidationError */ .tQ, allowEmptyString); +} +function check12ValidRange(value, rangePattern, allowEmptyString) { + if (!allowEmptyString && value === "") { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_1__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.VALUE_OUT_OF_RANGE); + } + return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__/* .checkValidRange */ .W)(value, rangePattern, _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.VALUE_OUT_OF_RANGE, _exceptions__WEBPACK_IMPORTED_MODULE_1__/* .Scorm12ValidationError */ .tQ); +} + + +/***/ }), + +/***/ 340: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); + +var global = { + SCORM_TRUE: "true", + SCORM_FALSE: "false", + STATE_NOT_INITIALIZED: 0, + STATE_INITIALIZED: 1, + STATE_TERMINATED: 2, + LOG_LEVEL_DEBUG: 1, + LOG_LEVEL_INFO: 2, + LOG_LEVEL_WARNING: 3, + LOG_LEVEL_ERROR: 4, + LOG_LEVEL_NONE: 5, +}; +var scorm12 = { + cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions", + core_children: "student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time", + score_children: "raw,min,max", + comments_children: "content,location,time", + objectives_children: "id,score,status", + correct_responses_children: "pattern", + student_data_children: "mastery_score,max_time_allowed,time_limit_action", + student_preference_children: "audio,language,speed,text", + interactions_children: "id,objectives,time,type,correct_responses,weighting,student_response,result,latency", + error_descriptions: { + "101": { + basicMessage: "General Exception", + detailMessage: "No specific error code exists to describe the error. Use LMSGetDiagnostic for more information", + }, + "201": { + basicMessage: "Invalid argument error", + detailMessage: "Indicates that an argument represents an invalid data model element or is otherwise incorrect.", + }, + "202": { + basicMessage: "Element cannot have children", + detailMessage: 'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.', + }, + "203": { + basicMessage: "Element not an array - cannot have count", + detailMessage: 'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.', + }, + "301": { + basicMessage: "Not initialized", + detailMessage: "Indicates that an API call was made before the call to lmsInitialize.", + }, + "401": { + basicMessage: "Not implemented error", + detailMessage: "The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.", + }, + "402": { + basicMessage: "Invalid set value, element is a keyword", + detailMessage: 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").', + }, + "403": { + basicMessage: "Element is read only", + detailMessage: "LMSSetValue was called with a data model element that can only be read.", + }, + "404": { + basicMessage: "Element is write only", + detailMessage: "LMSGetValue was called on a data model element that can only be written to.", + }, + "405": { + basicMessage: "Incorrect Data Type", + detailMessage: "LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.", + }, + "407": { + basicMessage: "Element Value Out Of Range", + detailMessage: "The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.", + }, + "408": { + basicMessage: "Data Model Dependency Not Established", + detailMessage: "Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.", + }, + }, +}; +var aicc = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, scorm12), { + cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation", + student_preference_children: "audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows", + student_data_children: "attempt_number,tries,mastery_score,max_time_allowed,time_limit_action", + student_demographics_children: "city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience", + tries_children: "time,status,score", + attempt_records_children: "score,lesson_status", + paths_children: "location_id,date,time,status,why_left,time_in_element", +}); +var scorm2004 = { + cmi_children: "_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time", + comments_children: "comment,timestamp,location", + score_children: "max,raw,scaled,min", + objectives_children: "progress_measure,completion_status,success_status,description,score,id", + correct_responses_children: "pattern", + student_data_children: "mastery_score,max_time_allowed,time_limit_action", + student_preference_children: "audio_level,audio_captioning,delivery_speed,language", + interactions_children: "id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description", + error_descriptions: { + "0": { + basicMessage: "No Error", + detailMessage: "No error occurred, the previous API call was successful.", + }, + "101": { + basicMessage: "General Exception", + detailMessage: "No specific error code exists to describe the error. Use GetDiagnostic for more information.", + }, + "102": { + basicMessage: "General Initialization Failure", + detailMessage: "Call to Initialize failed for an unknown reason.", + }, + "103": { + basicMessage: "Already Initialized", + detailMessage: "Call to Initialize failed because Initialize was already called.", + }, + "104": { + basicMessage: "Content Instance Terminated", + detailMessage: "Call to Initialize failed because Terminate was already called.", + }, + "111": { + basicMessage: "General Termination Failure", + detailMessage: "Call to Terminate failed for an unknown reason.", + }, + "112": { + basicMessage: "Termination Before Initialization", + detailMessage: "Call to Terminate failed because it was made before the call to Initialize.", + }, + "113": { + basicMessage: "Termination After Termination", + detailMessage: "Call to Terminate failed because Terminate was already called.", + }, + "122": { + basicMessage: "Retrieve Data Before Initialization", + detailMessage: "Call to GetValue failed because it was made before the call to Initialize.", + }, + "123": { + basicMessage: "Retrieve Data After Termination", + detailMessage: "Call to GetValue failed because it was made after the call to Terminate.", + }, + "132": { + basicMessage: "Store Data Before Initialization", + detailMessage: "Call to SetValue failed because it was made before the call to Initialize.", + }, + "133": { + basicMessage: "Store Data After Termination", + detailMessage: "Call to SetValue failed because it was made after the call to Terminate.", + }, + "142": { + basicMessage: "Commit Before Initialization", + detailMessage: "Call to Commit failed because it was made before the call to Initialize.", + }, + "143": { + basicMessage: "Commit After Termination", + detailMessage: "Call to Commit failed because it was made after the call to Terminate.", + }, + "201": { + basicMessage: "General Argument Error", + detailMessage: "An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.", + }, + "301": { + basicMessage: "General Get Failure", + detailMessage: "Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.", + }, + "351": { + basicMessage: "General Set Failure", + detailMessage: "Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.", + }, + "391": { + basicMessage: "General Commit Failure", + detailMessage: "Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.", + }, + "401": { + basicMessage: "Undefined Data Model Element", + detailMessage: "The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.", + }, + "402": { + basicMessage: "Unimplemented Data Model Element", + detailMessage: "The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.", + }, + "403": { + basicMessage: "Data Model Element Value Not Initialized", + detailMessage: "Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.", + }, + "404": { + basicMessage: "Data Model Element Is Read Only", + detailMessage: "SetValue was called with a data model element that can only be read.", + }, + "405": { + basicMessage: "Data Model Element Is Write Only", + detailMessage: "GetValue was called on a data model element that can only be written to.", + }, + "406": { + basicMessage: "Data Model Element Type Mismatch", + detailMessage: "SetValue was called with a value that is not consistent with the data format of the supplied data model element.", + }, + "407": { + basicMessage: "Data Model Element Value Out Of Range", + detailMessage: "The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.", + }, + "408": { + basicMessage: "Data Model Dependency Not Established", + detailMessage: "Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.", + }, + }, +}; +var APIConstants = { + global: global, + scorm12: scorm12, + aicc: aicc, + scorm2004: scorm2004, +}; +/* harmony default export */ __webpack_exports__.A = (APIConstants); + + +/***/ }), + +/***/ 56: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ K$: function() { return /* binding */ NAVBoolean; }, +/* harmony export */ YE: function() { return /* binding */ SuccessStatus; }, +/* harmony export */ lC: function() { return /* binding */ CompletionStatus; } +/* harmony export */ }); +var NAVBoolean; +(function (NAVBoolean) { + NAVBoolean["unknown"] = "unknown"; + NAVBoolean["true"] = "true"; + NAVBoolean["false"] = "false"; +})(NAVBoolean || (NAVBoolean = {})); +var SuccessStatus; +(function (SuccessStatus) { + SuccessStatus["passed"] = "passed"; + SuccessStatus["failed"] = "failed"; + SuccessStatus["unknown"] = "unknown"; +})(SuccessStatus || (SuccessStatus = {})); +var CompletionStatus; +(function (CompletionStatus) { + CompletionStatus["completed"] = "completed"; + CompletionStatus["incomplete"] = "incomplete"; + CompletionStatus["unknown"] = "unknown"; +})(CompletionStatus || (CompletionStatus = {})); + + +/***/ }), + +/***/ 797: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); + +var global = { + GENERAL: 101, + INITIALIZATION_FAILED: 101, + INITIALIZED: 101, + TERMINATED: 101, + TERMINATION_FAILURE: 101, + TERMINATION_BEFORE_INIT: 101, + MULTIPLE_TERMINATION: 101, + RETRIEVE_BEFORE_INIT: 101, + RETRIEVE_AFTER_TERM: 101, + STORE_BEFORE_INIT: 101, + STORE_AFTER_TERM: 101, + COMMIT_BEFORE_INIT: 101, + COMMIT_AFTER_TERM: 101, + ARGUMENT_ERROR: 101, + CHILDREN_ERROR: 101, + COUNT_ERROR: 101, + GENERAL_GET_FAILURE: 101, + GENERAL_SET_FAILURE: 101, + GENERAL_COMMIT_FAILURE: 101, + UNDEFINED_DATA_MODEL: 101, + UNIMPLEMENTED_ELEMENT: 101, + VALUE_NOT_INITIALIZED: 101, + INVALID_SET_VALUE: 101, + READ_ONLY_ELEMENT: 101, + WRITE_ONLY_ELEMENT: 101, + TYPE_MISMATCH: 101, + VALUE_OUT_OF_RANGE: 101, + DEPENDENCY_NOT_ESTABLISHED: 101, +}; +var scorm12 = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, global), { RETRIEVE_BEFORE_INIT: 301, STORE_BEFORE_INIT: 301, COMMIT_BEFORE_INIT: 301, ARGUMENT_ERROR: 201, CHILDREN_ERROR: 202, COUNT_ERROR: 203, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 401, VALUE_NOT_INITIALIZED: 301, INVALID_SET_VALUE: 402, READ_ONLY_ELEMENT: 403, WRITE_ONLY_ELEMENT: 404, TYPE_MISMATCH: 405, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 }); +var scorm2004 = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, global), { INITIALIZATION_FAILED: 102, INITIALIZED: 103, TERMINATED: 104, TERMINATION_FAILURE: 111, TERMINATION_BEFORE_INIT: 112, MULTIPLE_TERMINATIONS: 113, RETRIEVE_BEFORE_INIT: 122, RETRIEVE_AFTER_TERM: 123, STORE_BEFORE_INIT: 132, STORE_AFTER_TERM: 133, COMMIT_BEFORE_INIT: 142, COMMIT_AFTER_TERM: 143, ARGUMENT_ERROR: 201, GENERAL_GET_FAILURE: 301, GENERAL_SET_FAILURE: 351, GENERAL_COMMIT_FAILURE: 391, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 402, VALUE_NOT_INITIALIZED: 403, READ_ONLY_ELEMENT: 404, WRITE_ONLY_ELEMENT: 405, TYPE_MISMATCH: 406, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 }); +var ErrorCodes = { + scorm12: scorm12, + scorm2004: scorm2004, +}; +/* harmony default export */ __webpack_exports__.A = (ErrorCodes); + + +/***/ }), + +/***/ 417: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); + +var scorm12 = { + CMIString256: "^.{0,255}$", + CMIString4096: "^.{0,4096}$", + CMITime: "^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$", + CMITimespan: "^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$", + CMIInteger: "^\\d+$", + CMISInteger: "^-?([0-9]+)$", + CMIDecimal: "^-?([0-9]{0,3})(.[0-9]*)?$", + CMIIdentifier: "^[\\u0021-\\u007E\\s]{0,255}$", + CMIFeedback: "^.{0,255}$", + CMIIndex: "[._](\\d+).", + CMIStatus: "^(passed|completed|failed|incomplete|browsed)$", + CMIStatus2: "^(passed|completed|failed|incomplete|browsed|not attempted)$", + CMIExit: "^(time-out|suspend|logout|)$", + CMIType: "^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$", + CMIResult: "^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$", + NAVEvent: "^(previous|continue)$", + score_range: "0#100", + audio_range: "-1#100", + speed_range: "-100#100", + weighting_range: "-100#100", + text_range: "-1#1", +}; +var aicc = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, scorm12), { + CMIIdentifier: "^\\w{1,255}$", +}); +var scorm2004 = { + CMIString200: "^[\\u0000-\\uFFFF]{0,200}$", + CMIString250: "^[\\u0000-\\uFFFF]{0,250}$", + CMIString1000: "^[\\u0000-\\uFFFF]{0,1000}$", + CMIString4000: "^[\\u0000-\\uFFFF]{0,4000}$", + CMIString64000: "^[\\u0000-\\uFFFF]{0,64000}$", + CMILang: "^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$", + CMILangString250: "^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$", + CMILangcr: "^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$", + CMILangString250cr: "^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$", + CMILangString4000: "^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$", + CMITime: "^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$", + CMITimespan: "^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$", + CMIInteger: "^\\d+$", + CMISInteger: "^-?([0-9]+)$", + CMIDecimal: "^-?([0-9]{1,5})(\\.[0-9]{1,18})?$", + CMIIdentifier: "^\\S{1,250}[a-zA-Z0-9]$", + CMIShortIdentifier: "^[\\w\\.\\-\\_]{1,250}$", + CMILongIdentifier: "^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$", + CMIFeedback: "^.*$", + CMIIndex: "[._](\\d+).", + CMIIndexStore: ".N(\\d+).", + CMICStatus: "^(completed|incomplete|not attempted|unknown)$", + CMISStatus: "^(passed|failed|unknown)$", + CMIExit: "^(time-out|suspend|logout|normal)$", + CMIType: "^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$", + CMIResult: "^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$", + NAVEvent: "^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$", + NAVBoolean: "^(unknown|true|false$)", + NAVTarget: "^{target=\\S{0,}[a-zA-Z0-9-_]+}$", + scaled_range: "-1#1", + audio_range: "0#*", + speed_range: "0#*", + text_range: "-1#1", + progress_range: "0#1", +}; +var Regex = { + aicc: aicc, + scorm12: scorm12, + scorm2004: scorm2004, +}; +/* harmony default export */ __webpack_exports__.A = (Regex); + + +/***/ }), + +/***/ 784: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ $h: function() { return /* binding */ BaseScormValidationError; }, +/* harmony export */ gv: function() { return /* binding */ AICCValidationError; }, +/* harmony export */ tQ: function() { return /* binding */ Scorm12ValidationError; }, +/* harmony export */ wq: function() { return /* binding */ Scorm2004ValidationError; }, +/* harmony export */ yI: function() { return /* binding */ ValidationError; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(635); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340); + + +var scorm12_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.error_descriptions; +var aicc_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.aicc.error_descriptions; +var scorm2004_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm2004.error_descriptions; +var BaseScormValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(BaseScormValidationError, _super); + function BaseScormValidationError(errorCode) { + var _this = _super.call(this, errorCode.toString()) || this; + _this._errorCode = errorCode; + _this.name = "ScormValidationError"; + return _this; + } + Object.defineProperty(BaseScormValidationError.prototype, "errorCode", { + get: function () { + return this._errorCode; + }, + enumerable: false, + configurable: true + }); + BaseScormValidationError.prototype.setMessage = function (message) { + this.message = message; + }; + return BaseScormValidationError; +}(Error)); + +var ValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(ValidationError, _super); + function ValidationError(errorCode, errorMessage, detailedMessage) { + var _this = _super.call(this, errorCode) || this; + _this._detailedMessage = ""; + _this.setMessage(errorMessage); + _this._errorMessage = errorMessage; + if (detailedMessage) { + _this._detailedMessage = detailedMessage; + } + return _this; + } + Object.defineProperty(ValidationError.prototype, "errorMessage", { + get: function () { + return this._errorMessage; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(ValidationError.prototype, "detailedMessage", { + get: function () { + return this._detailedMessage; + }, + enumerable: false, + configurable: true + }); + return ValidationError; +}(BaseScormValidationError)); + +var Scorm12ValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(Scorm12ValidationError, _super); + function Scorm12ValidationError(errorCode) { + var _this = this; + if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) { + _this = _super.call(this, errorCode, scorm12_errors[String(errorCode)].basicMessage, scorm12_errors[String(errorCode)].detailMessage) || this; + } + else { + _this = _super.call(this, 101, scorm12_errors["101"].basicMessage, scorm12_errors["101"].detailMessage) || this; + } + return _this; + } + return Scorm12ValidationError; +}(ValidationError)); + +var AICCValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(AICCValidationError, _super); + function AICCValidationError(errorCode) { + var _this = this; + if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) { + _this = _super.call(this, errorCode, aicc_errors[String(errorCode)].basicMessage, aicc_errors[String(errorCode)].detailMessage) || this; + } + else { + _this = _super.call(this, 101, aicc_errors["101"].basicMessage, aicc_errors["101"].detailMessage) || this; + } + return _this; + } + return AICCValidationError; +}(ValidationError)); + +var Scorm2004ValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(Scorm2004ValidationError, _super); + function Scorm2004ValidationError(errorCode) { + var _this = this; + if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) { + _this = _super.call(this, errorCode, scorm2004_errors[String(errorCode)].basicMessage, scorm2004_errors[String(errorCode)].detailMessage) || this; + } + else { + _this = _super.call(this, 101, scorm2004_errors["101"].basicMessage, scorm2004_errors["101"].detailMessage) || this; + } + return _this; + } + return Scorm2004ValidationError; +}(ValidationError)); + + + +/***/ }), + +/***/ 864: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ $o: function() { return /* binding */ addTwoDurations; }, +/* harmony export */ Bq: function() { return /* binding */ flatten; }, +/* harmony export */ HT: function() { return /* binding */ addHHMMSSTimeStrings; }, +/* harmony export */ J6: function() { return /* binding */ stringMatches; }, +/* harmony export */ OI: function() { return /* binding */ getDurationAsSeconds; }, +/* harmony export */ UZ: function() { return /* binding */ getSecondsAsHHMMSS; }, +/* harmony export */ f4: function() { return /* binding */ getTimeAsSeconds; }, +/* harmony export */ hw: function() { return /* binding */ formatMessage; }, +/* harmony export */ sB: function() { return /* binding */ unflatten; }, +/* harmony export */ xE: function() { return /* binding */ getSecondsAsISODuration; } +/* harmony export */ }); +/* unused harmony exports SECONDS_PER_SECOND, SECONDS_PER_MINUTE, SECONDS_PER_HOUR, SECONDS_PER_DAY, countDecimals */ +var SECONDS_PER_SECOND = 1.0; +var SECONDS_PER_MINUTE = 60; +var SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE; +var SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR; +var designations = { + D: SECONDS_PER_DAY, + H: SECONDS_PER_HOUR, + M: SECONDS_PER_MINUTE, + S: SECONDS_PER_SECOND, +}; +function getSecondsAsHHMMSS(totalSeconds) { + if (!totalSeconds || totalSeconds <= 0) { + return "00:00:00"; + } + var hours = Math.floor(totalSeconds / SECONDS_PER_HOUR); + var dateObj = new Date(totalSeconds * 1000); + var minutes = dateObj.getUTCMinutes(); + var seconds = dateObj.getSeconds(); + var ms = totalSeconds % 1.0; + var msStr = ""; + if (countDecimals(ms) > 0) { + if (countDecimals(ms) > 2) { + msStr = ms.toFixed(2); + } + else { + msStr = String(ms); + } + msStr = "." + msStr.split(".")[1]; + } + return ((hours + ":" + minutes + ":" + seconds).replace(/\b\d\b/g, "0$&") + msStr); +} +function getSecondsAsISODuration(seconds) { + if (!seconds || seconds <= 0) { + return "PT0S"; + } + var duration = "P"; + var remainder = seconds; + for (var designationsKey in designations) { + var current_seconds = designations[designationsKey]; + var value = Math.floor(remainder / current_seconds); + remainder = remainder % current_seconds; + if (countDecimals(remainder) > 2) { + remainder = Number(Number(remainder).toFixed(2)); + } + if (designationsKey === "S" && remainder > 0) { + value += remainder; + } + if (value) { + if ((duration.indexOf("D") > 0 || + designationsKey === "H" || + designationsKey === "M" || + designationsKey === "S") && + duration.indexOf("T") === -1) { + duration += "T"; + } + duration += "".concat(value).concat(designationsKey); + } + } + return duration; +} +function getTimeAsSeconds(timeString, timeRegex) { + if (typeof timeString === "number" || typeof timeString === "boolean") { + timeString = String(timeString); + } + if (typeof timeRegex === "string") { + timeRegex = new RegExp(timeRegex); + } + if (!timeString || !timeString.match(timeRegex)) { + return 0; + } + var parts = timeString.split(":"); + var hours = Number(parts[0]); + var minutes = Number(parts[1]); + var seconds = Number(parts[2]); + return hours * 3600 + minutes * 60 + seconds; +} +function getDurationAsSeconds(duration, durationRegex) { + if (typeof durationRegex === "string") { + durationRegex = new RegExp(durationRegex); + } + if (!duration || !duration.match(durationRegex)) { + return 0; + } + var _a = new RegExp(durationRegex).exec(duration) || [], years = _a[1], _ = _a[2], days = _a[4], hours = _a[5], minutes = _a[6], seconds = _a[7]; + var result = 0.0; + result += Number(seconds) || 0.0; + result += Number(minutes) * 60.0 || 0.0; + result += Number(hours) * 3600.0 || 0.0; + result += Number(days) * (60 * 60 * 24.0) || 0.0; + result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0; + return result; +} +function addTwoDurations(first, second, durationRegex) { + var regex = typeof durationRegex === "string" + ? new RegExp(durationRegex) + : durationRegex; + return getSecondsAsISODuration(getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex)); +} +function addHHMMSSTimeStrings(first, second, timeRegex) { + if (typeof timeRegex === "string") { + timeRegex = new RegExp(timeRegex); + } + return getSecondsAsHHMMSS(getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex)); +} +function flatten(data) { + var result = {}; + function recurse(cur, prop) { + if (Object(cur) !== cur) { + result[prop] = cur; + } + else if (Array.isArray(cur)) { + for (var i = 0, l = cur.length; i < l; i++) { + recurse(cur[i], prop + "[" + i + "]"); + if (l === 0) + result[prop] = []; + } + } + else { + var isEmpty = true; + for (var p in cur) { + if ({}.hasOwnProperty.call(cur, p)) { + isEmpty = false; + recurse(cur[p], prop ? prop + "." + p : p); + } + } + if (isEmpty && prop) + result[prop] = {}; + } + } + recurse(data, ""); + return result; +} +function unflatten(data) { + "use strict"; + if (Object(data) !== data || Array.isArray(data)) + return data; + var regex = /\.?([^.[\]]+)|\[(\d+)]/g; + var result = {}; + for (var p in data) { + if ({}.hasOwnProperty.call(data, p)) { + var cur = result; + var prop = ""; + var m = regex.exec(p); + while (m) { + cur = cur[prop] || (cur[prop] = m[2] ? [] : {}); + prop = m[2] || m[1]; + m = regex.exec(p); + } + cur[prop] = data[p]; + } + } + return result[""] || result; +} +function countDecimals(num) { + if (Math.floor(num) === num || String(num).indexOf(".") < 0) + return 0; + var parts = num.toString().split(".")[1]; + return parts.length || 0; +} +function formatMessage(functionName, message, CMIElement) { + var baseLength = 20; + var messageString = ""; + messageString += functionName; + var fillChars = baseLength - messageString.length; + for (var i = 0; i < fillChars; i++) { + messageString += " "; + } + messageString += ": "; + if (CMIElement) { + var CMIElementBaseLength = 70; + messageString += CMIElement; + fillChars = CMIElementBaseLength - messageString.length; + for (var j = 0; j < fillChars; j++) { + messageString += " "; + } + } + if (message) { + messageString += message; + } + return messageString; +} +function stringMatches(str, tester) { + return (str === null || str === void 0 ? void 0 : str.match(tester)) !== null; +} + + +/***/ }), + +/***/ 635: +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ C6: function() { return /* binding */ __extends; }, +/* harmony export */ Cl: function() { return /* binding */ __assign; }, +/* harmony export */ YH: function() { return /* binding */ __generator; }, +/* harmony export */ sH: function() { return /* binding */ __awaiter; } +/* harmony export */ }); +/* unused harmony exports __rest, __decorate, __param, __esDecorate, __runInitializers, __propKey, __setFunctionName, __metadata, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn, __addDisposableResource, __disposeResources */ +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise, SuppressedError, Symbol, Iterator */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + } + return __assign.apply(this, arguments); +} + +function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +} + +function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +} + +function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } + var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context = {}; + for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context.access[p] = contextIn.access[p]; + context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } + else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; + } + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; +}; + +function __runInitializers(thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) { + value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + } + return useValue ? value : void 0; +}; + +function __propKey(x) { + return typeof x === "symbol" ? x : "".concat(x); +}; + +function __setFunctionName(f, name, prefix) { + if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; + return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); +}; + +function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} + +function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +var __createBinding = Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); + +function __exportStar(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); +} + +function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} + +function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +/** @deprecated */ +function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} + +/** @deprecated */ +function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +} + +function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +} + +function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} + +function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; + function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } + function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} + +function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } +} + +function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} + +function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; + +var __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}; + +function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +} + +function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; +} + +function __classPrivateFieldGet(receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +} + +function __classPrivateFieldSet(receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; +} + +function __classPrivateFieldIn(state, receiver) { + if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); + return typeof state === "function" ? receiver === state : state.has(receiver); +} + +function __addDisposableResource(env, value, async) { + if (value !== null && value !== void 0) { + if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); + var dispose, inner; + if (async) { + if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value[Symbol.asyncDispose]; + } + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + if (async) inner = dispose; + } + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; + env.stack.push({ value: value, dispose: dispose, async: async }); + } + else if (async) { + env.stack.push({ async: true }); + } + return value; +} + +var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; +}; + +function __disposeResources(env) { + function fail(e) { + env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; + env.hasError = true; + } + var r, s = 0; + function next() { + while (r = env.stack.pop()) { + try { + if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); + if (r.dispose) { + var result = r.dispose.call(r.value); + if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); + } + else s |= 1; + } + catch (e) { + fail(e); + } + } + if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); + if (env.hasError) throw env.error; + } + return next(); +} + +/* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ({ + __extends, + __assign, + __rest, + __decorate, + __param, + __metadata, + __awaiter, + __generator, + __createBinding, + __exportStar, + __values, + __read, + __spread, + __spreadArrays, + __spreadArray, + __await, + __asyncGenerator, + __asyncDelegator, + __asyncValues, + __makeTemplateObject, + __importStar, + __importDefault, + __classPrivateFieldGet, + __classPrivateFieldSet, + __classPrivateFieldIn, + __addDisposableResource, + __disposeResources, +}); + + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ !function() { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = function(exports, definition) { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ !function() { +/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ }(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ VE: function() { return /* binding */ Scorm2004API; }, +/* harmony export */ Yq: function() { return /* binding */ Scorm12API; }, +/* harmony export */ jr: function() { return /* binding */ AICC; } +/* harmony export */ }); +/* harmony import */ var _AICC__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(531); +/* harmony import */ var _Scorm12API__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(941); +/* harmony import */ var _Scorm2004API__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(180); + + + +var Scorm12API = _Scorm12API__WEBPACK_IMPORTED_MODULE_1__/* .Scorm12Impl */ .C; +var Scorm2004API = _Scorm2004API__WEBPACK_IMPORTED_MODULE_2__/* .Scorm2004Impl */ .Z; +var AICC = _AICC__WEBPACK_IMPORTED_MODULE_0__/* .AICCImpl */ .X; + + +var __webpack_exports__AICC = __webpack_exports__.jr; +var __webpack_exports__Scorm12API = __webpack_exports__.Yq; +var __webpack_exports__Scorm2004API = __webpack_exports__.VE; +export { __webpack_exports__AICC as AICC, __webpack_exports__Scorm12API as Scorm12API, __webpack_exports__Scorm2004API as Scorm2004API }; + +//# sourceMappingURL=scorm-again.js.map \ No newline at end of file diff --git a/dist/esm/scorm-again.js.map b/dist/esm/scorm-again.js.map new file mode 100644 index 0000000..25c42b1 --- /dev/null +++ b/dist/esm/scorm-again.js.map @@ -0,0 +1 @@ +{"version":3,"file":"scorm-again.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAwD;AACD;AACF;AACrD,IAAM,gBAAgB,GAAG,0BAAU,CAAC,OAAO,CAAC;AASrC,SAAS,oBAAoB,CAClC,KAAa,EACb,YAAoB,EACpB,gBAA0B;IAE1B,OAAO,sCAAgB,CACrB,KAAK,EACL,YAAY,EACZ,gBAAgB,CAAC,aAAa,EAC9B,sCAAmB,EACnB,gBAAgB,CACjB,CAAC;AACJ,CAAC;;;;;;ACxB0C;AACY;AACV;AACY;AACJ;AACD;AACV;AAK1C;IAAmC,uDAAO;IAIxC;QACE,kBAAK,WAAE,SAAC;QACR,KAAI,CAAC,QAAQ,GAAG,IAAI,qBAAqB,EAAE,CAAC;;IAC9C,CAAC;IAOD,kCAAU,GAAV;;QACE,gBAAK,CAAC,UAAU,WAAE,CAAC;QACnB,UAAI,CAAC,QAAQ,0CAAE,UAAU,EAAE,CAAC;IAC9B,CAAC;IAMD,8BAAM,GAAN;QAGE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAM,MAAM,GAAG;YACb,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC;QACF,OAAO,IAAI,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KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IAC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qB,aAAa;AAClC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uFAAuF,SAAS,gBAAgB;AAChH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sEAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAC;;;;;;;SCzXF;SACA;;SAEA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;;SAEA;SACA;;SAEA;SACA;SACA;;;;;UCtBA;UACA;UACA;UACA;UACA,yCAAyC,wCAAwC;UACjF;UACA;UACA;;;;;UCPA,8CAA8C;;;;;;;;;;;;;ACAZ;AACS;AACI;AAE/C,IAAM,UAAU,GAAG,6DAAW,CAAC;AAC/B,IAAM,YAAY,GAAG,iEAAa,CAAC;AACnC,IAAM,IAAI,GAAG,oDAAQ,CAAC;AAEoB","sources":["webpack://scorm-again/./src/cmi/aicc/validation.ts","webpack://scorm-again/./src/cmi/aicc/evaluation.ts","webpack://scorm-again/./src/cmi/aicc/student_preferences.ts","webpack://scorm-again/./src/cmi/aicc/student_demographics.ts","webpack://scorm-again/./src/cmi/aicc/tries.ts","webpack://scorm-again/./src/cmi/aicc/attempts.ts","webpack://scorm-again/./src/cmi/aicc/student_data.ts","webpack://scorm-again/./src/cmi/aicc/paths.ts","webpack://scorm-again/./src/cmi/aicc/cmi.ts","webpack://scorm-again/./src/AICC.ts","webpack://scorm-again/./src/utilities/debounce.ts","webpack://scorm-again/./src/constants/default_settings.ts","webpack://scorm-again/./src/helpers/scheduled_commit.ts","webpack://scorm-again/./src/BaseAPI.ts","webpack://scorm-again/./src/Scorm12API.ts","webpack://scorm-again/./src/cmi/scorm2004/validation.ts","webpack://scorm-again/./src/cmi/scorm2004/learner_preference.ts","webpack://scorm-again/./src/constants/response_constants.ts","webpack://scorm-again/./src/cmi/scorm2004/interactions.ts","webpack://scorm-again/./src/cmi/scorm2004/score.ts","webpack://scorm-again/./src/cmi/scorm2004/comments.ts","webpack://scorm-again/./src/cmi/scorm2004/objectives.ts","webpack://scorm-again/./src/cmi/scorm2004/cmi.ts","webpack://scorm-again/./src/constants/language_constants.ts","webpack://scorm-again/./src/cmi/scorm2004/adl.ts","webpack://scorm-again/./src/Scorm2004API.ts","webpack://scorm-again/./src/cmi/common/array.ts","webpack://scorm-again/./src/cmi/common/base_cmi.ts","webpack://scorm-again/./src/cmi/common/score.ts","webpack://scorm-again/./src/cmi/common/validation.ts","webpack://scorm-again/./src/cmi/aicc/core.ts","webpack://scorm-again/./src/cmi/scorm12/cmi.ts","webpack://scorm-again/./src/cmi/scorm12/interactions.ts","webpack://scorm-again/./src/cmi/scorm12/nav.ts","webpack://scorm-again/./src/cmi/scorm12/objectives.ts","webpack://scorm-again/./src/cmi/scorm12/student_data.ts","webpack://scorm-again/./src/cmi/scorm12/student_preference.ts","webpack://scorm-again/./src/cmi/scorm12/validation.ts","webpack://scorm-again/./src/constants/api_constants.ts","webpack://scorm-again/./src/constants/enums.ts","webpack://scorm-again/./src/constants/error_codes.ts","webpack://scorm-again/./src/constants/regex.ts","webpack://scorm-again/./src/exceptions.ts","webpack://scorm-again/./src/utilities.ts","webpack://scorm-again/./node_modules/tslib/tslib.es6.mjs","webpack://scorm-again/webpack/bootstrap","webpack://scorm-again/webpack/runtime/define property getters","webpack://scorm-again/webpack/runtime/hasOwnProperty shorthand","webpack://scorm-again/./src/ScormAgain.ts"],"sourcesContent":["import { checkValidFormat } from \"../common/validation\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nconst aicc_error_codes = ErrorCodes.scorm12;\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function checkAICCValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n aicc_error_codes.TYPE_MISMATCH,\n AICCValidationError,\n allowEmptyString,\n );\n}\n","import { CMIArray } from \"../common/array\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * AICC Evaluation object\n */\nexport class CMIEvaluation extends BaseCMI {\n /**\n * Constructor for AICC Evaluation object\n */\n constructor() {\n super();\n this.comments = new CMIEvaluationComments();\n }\n\n public comments: CMIEvaluationComments;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.comments?.initialize();\n }\n\n /**\n * toJSON for cmi.evaluation object\n * @return {{comments: CMIEvaluationComments}}\n */\n toJSON(): {\n comments: CMIEvaluationComments;\n } {\n this.jsonString = true;\n const result = {\n comments: this.comments,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing AICC's cmi.evaluation.comments object\n */\n\nclass CMIEvaluationComments extends CMIArray {\n /**\n * Constructor for AICC Evaluation Comments object\n */\n constructor() {\n super({\n children: APIConstants.aicc.comments_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: AICCValidationError,\n });\n }\n}\n\n/**\n * Class for AICC Evaluation Comments\n */\nexport class CMIEvaluationCommentsObject extends BaseCMI {\n /**\n * Constructor for Evaluation Comments\n */\n constructor() {\n super();\n }\n\n private _content = \"\";\n private _location = \"\";\n private _time = \"\";\n\n /**\n * Getter for _content\n * @return {string}\n */\n get content(): string {\n return this._content;\n }\n\n /**\n * Setter for _content\n * @param {string} content\n */\n set content(content: string) {\n if (checkAICCValidFormat(content, Regex.aicc.CMIString256)) {\n this._content = content;\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (checkAICCValidFormat(location, Regex.aicc.CMIString256)) {\n this._location = location;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setting for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * toJSON for cmi.evaluation.comments.n object\n * @return {\n * {\n * content: string,\n * location: string,\n * time: string\n * }\n * }\n */\n toJSON(): {\n content: string;\n location: string;\n time: string;\n } {\n this.jsonString = true;\n const result = {\n content: this.content,\n location: this.location,\n time: this.time,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMIStudentPreference } from \"../scorm12/student_preference\";\n\n/**\n * StudentPreferences class for AICC\n */\nexport class AICCStudentPreferences extends CMIStudentPreference {\n /**\n * Constructor for AICC Student Preferences object\n */\n constructor() {\n super(APIConstants.aicc.student_preference_children);\n this.windows = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: AICCValidationError,\n children: \"\",\n });\n }\n\n public windows: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.windows?.initialize();\n }\n\n private _lesson_type = \"\";\n private _text_color = \"\";\n private _text_location = \"\";\n private _text_size = \"\";\n private _video = \"\";\n\n /**\n * Getter for _lesson_type\n * @return {string}\n */\n get lesson_type(): string {\n return this._lesson_type;\n }\n\n /**\n * Setter for _lesson_type\n * @param {string} lesson_type\n */\n set lesson_type(lesson_type: string) {\n if (checkAICCValidFormat(lesson_type, Regex.aicc.CMIString256)) {\n this._lesson_type = lesson_type;\n }\n }\n\n /**\n * Getter for _text_color\n * @return {string}\n */\n get text_color(): string {\n return this._text_color;\n }\n\n /**\n * Setter for _text_color\n * @param {string} text_color\n */\n set text_color(text_color: string) {\n if (checkAICCValidFormat(text_color, Regex.aicc.CMIString256)) {\n this._text_color = text_color;\n }\n }\n\n /**\n * Getter for _text_location\n * @return {string}\n */\n get text_location(): string {\n return this._text_location;\n }\n\n /**\n * Setter for _text_location\n * @param {string} text_location\n */\n set text_location(text_location: string) {\n if (checkAICCValidFormat(text_location, Regex.aicc.CMIString256)) {\n this._text_location = text_location;\n }\n }\n\n /**\n * Getter for _text_size\n * @return {string}\n */\n get text_size(): string {\n return this._text_size;\n }\n\n /**\n * Setter for _text_size\n * @param {string} text_size\n */\n set text_size(text_size: string) {\n if (checkAICCValidFormat(text_size, Regex.aicc.CMIString256)) {\n this._text_size = text_size;\n }\n }\n\n /**\n * Getter for _video\n * @return {string}\n */\n get video(): string {\n return this._video;\n }\n\n /**\n * Setter for _video\n * @param {string} video\n */\n set video(video: string) {\n if (checkAICCValidFormat(video, Regex.aicc.CMIString256)) {\n this._video = video;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string,\n * text_color: string,\n * text_location: string,\n * text_size: string,\n * video: string,\n * windows: CMIArray\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n lesson_type: string;\n speed: string;\n text: string;\n text_color: string;\n text_location: string;\n text_size: string;\n video: string;\n windows: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n lesson_type: this.lesson_type,\n speed: this.speed,\n text: this.text,\n text_color: this.text_color,\n text_location: this.text_location,\n text_size: this.text_size,\n video: this.video,\n windows: this.windows,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the AICC cmi.student_demographics object\n */\nexport class CMIStudentDemographics extends BaseCMI {\n /**\n * Constructor for AICC StudentDemographics object\n */\n constructor() {\n super();\n }\n\n private __children = APIConstants.aicc.student_demographics_children;\n private _city = \"\";\n private _class = \"\";\n private _company = \"\";\n private _country = \"\";\n private _experience = \"\";\n private _familiar_name = \"\";\n private _instructor_name = \"\";\n private _title = \"\";\n private _native_language = \"\";\n private _state = \"\";\n private _street_address = \"\";\n private _telephone = \"\";\n private _years_experience = \"\";\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Getter for city\n * @return {string}\n */\n get city(): string {\n return this._city;\n }\n\n /**\n * Setter for _city. Sets an error if trying to set after\n * initialization.\n * @param {string} city\n */\n set city(city: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._city = city;\n }\n }\n\n /**\n * Getter for class\n * @return {string}\n */\n get class(): string {\n return this._class;\n }\n\n /**\n * Setter for _class. Sets an error if trying to set after\n * initialization.\n * @param {string} clazz\n */\n set class(clazz: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._class = clazz;\n }\n }\n\n /**\n * Getter for company\n * @return {string}\n */\n get company(): string {\n return this._company;\n }\n\n /**\n * Setter for _company. Sets an error if trying to set after\n * initialization.\n * @param {string} company\n */\n set company(company: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._company = company;\n }\n }\n\n /**\n * Getter for country\n * @return {string}\n */\n get country(): string {\n return this._country;\n }\n\n /**\n * Setter for _country. Sets an error if trying to set after\n * initialization.\n * @param {string} country\n */\n set country(country: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._country = country;\n }\n }\n\n /**\n * Getter for experience\n * @return {string}\n */\n get experience(): string {\n return this._experience;\n }\n\n /**\n * Setter for _experience. Sets an error if trying to set after\n * initialization.\n * @param {string} experience\n */\n set experience(experience: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._experience = experience;\n }\n }\n\n /**\n * Getter for familiar_name\n * @return {string}\n */\n get familiar_name(): string {\n return this._familiar_name;\n }\n\n /**\n * Setter for _familiar_name. Sets an error if trying to set after\n * initialization.\n * @param {string} familiar_name\n */\n set familiar_name(familiar_name: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._familiar_name = familiar_name;\n }\n }\n\n /**\n * Getter for instructor_name\n * @return {string}\n */\n get instructor_name(): string {\n return this._instructor_name;\n }\n\n /**\n * Setter for _instructor_name. Sets an error if trying to set after\n * initialization.\n * @param {string} instructor_name\n */\n set instructor_name(instructor_name: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._instructor_name = instructor_name;\n }\n }\n\n /**\n * Getter for title\n * @return {string}\n */\n get title(): string {\n return this._title;\n }\n\n /**\n * Setter for _title. Sets an error if trying to set after\n * initialization.\n * @param {string} title\n */\n set title(title: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._title = title;\n }\n }\n\n /**\n * Getter for native_language\n * @return {string}\n */\n get native_language(): string {\n return this._native_language;\n }\n\n /**\n * Setter for _native_language. Sets an error if trying to set after\n * initialization.\n * @param {string} native_language\n */\n set native_language(native_language: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._native_language = native_language;\n }\n }\n\n /**\n * Getter for state\n * @return {string}\n */\n get state(): string {\n return this._state;\n }\n\n /**\n * Setter for _state. Sets an error if trying to set after\n * initialization.\n * @param {string} state\n */\n set state(state: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._state = state;\n }\n }\n\n /**\n * Getter for street_address\n * @return {string}\n */\n get street_address(): string {\n return this._street_address;\n }\n\n /**\n * Setter for _street_address. Sets an error if trying to set after\n * initialization.\n * @param {string} street_address\n */\n set street_address(street_address: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._street_address = street_address;\n }\n }\n\n /**\n * Getter for telephone\n * @return {string}\n */\n get telephone(): string {\n return this._telephone;\n }\n\n /**\n * Setter for _telephone. Sets an error if trying to set after\n * initialization.\n * @param {string} telephone\n */\n set telephone(telephone: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._telephone = telephone;\n }\n }\n\n /**\n * Getter for years_experience\n * @return {string}\n */\n get years_experience(): string {\n return this._years_experience;\n }\n\n /**\n * Setter for _years_experience. Sets an error if trying to set after\n * initialization.\n * @param {string} years_experience\n */\n set years_experience(years_experience: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._years_experience = years_experience;\n }\n }\n\n /**\n * toJSON for cmi.student_demographics object\n * @return {\n * {\n * city: string,\n * class: string,\n * company: string,\n * country: string,\n * experience: string,\n * familiar_name: string,\n * instructor_name: string,\n * title: string,\n * native_language: string,\n * state: string,\n * street_address: string,\n * telephone: string,\n * years_experience: string\n * }\n * }\n */\n toJSON(): {\n city: string;\n class: string;\n company: string;\n country: string;\n experience: string;\n familiar_name: string;\n instructor_name: string;\n title: string;\n native_language: string;\n state: string;\n street_address: string;\n telephone: string;\n years_experience: string;\n } {\n this.jsonString = true;\n const result = {\n city: this.city,\n class: this.class,\n company: this.company,\n country: this.country,\n experience: this.experience,\n familiar_name: this.familiar_name,\n instructor_name: this.instructor_name,\n title: this.title,\n native_language: this.native_language,\n state: this.state,\n street_address: this.street_address,\n telephone: this.telephone,\n years_experience: this.years_experience,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {CMIArray} from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {AICCValidationError} from \"../../exceptions\";\nimport {checkAICCValidFormat} from \"./validation\";\n\n/**\n * Class representing the AICC cmi.student_data.tries object\n */\nexport class CMITries extends CMIArray {\n /**\n * Constructor for inline Tries Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.tries_children,\n });\n }\n}\n\n/**\n * Class for AICC Tries\n */\nexport class CMITriesObject extends BaseCMI {\n /**\n * Constructor for AICC Tries object\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.aicc.score_children,\n score_range: Regex.aicc.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: AICCValidationError,\n });\n }\n\n public score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private _status = \"\";\n private _time = \"\";\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (checkAICCValidFormat(status, Regex.aicc.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * toJSON for cmi.student_data.tries.n object\n * @return {\n * {\n * status: string,\n * time: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n status: string;\n time: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n status: this.status,\n time: this.time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {AICCValidationError} from \"../../exceptions\";\nimport {checkAICCValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class for cmi.student_data.attempt_records array\n */\nexport class CMIAttemptRecords extends CMIArray {\n /**\n * Constructor for inline Tries Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.attempt_records_children,\n });\n }\n}\n\n/**\n * Class for AICC Attempt Records\n */\nexport class CMIAttemptRecordsObject extends BaseCMI {\n /**\n * Constructor for AICC Attempt Records object\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.aicc.score_children,\n score_range: Regex.aicc.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: AICCValidationError,\n });\n }\n\n public score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private _lesson_status = \"\";\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (checkAICCValidFormat(lesson_status, Regex.aicc.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n\n /**\n * toJSON for cmi.student_data.attempt_records.n object\n * @return {\n * {\n * lesson_status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n lesson_status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n lesson_status: this.lesson_status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { AICCValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMITries } from \"./tries\";\nimport { CMIStudentData } from \"../scorm12/student_data\";\nimport { CMIAttemptRecords } from \"./attempts\";\n\n/**\n * StudentData class for AICC\n */\nexport class AICCCMIStudentData extends CMIStudentData {\n /**\n * Constructor for AICC StudentData object\n */\n constructor() {\n super(APIConstants.aicc.student_data_children);\n this.tries = new CMITries();\n this.attempt_records = new CMIAttemptRecords();\n }\n\n public tries: CMITries;\n public attempt_records: CMIAttemptRecords;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.tries?.initialize();\n this.attempt_records?.initialize();\n }\n\n private _tries_during_lesson = \"\";\n\n /**\n * Getter for tries_during_lesson\n * @return {string}\n */\n get tries_during_lesson(): string {\n return this._tries_during_lesson;\n }\n\n /**\n * Setter for _tries_during_lesson. Sets an error if trying to set after\n * initialization.\n * @param {string} tries_during_lesson\n */\n set tries_during_lesson(tries_during_lesson: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._tries_during_lesson = tries_during_lesson;\n }\n }\n\n /**\n * toJSON for cmi.student_data object\n * @return {\n * {\n * mastery_score: string,\n * max_time_allowed: string,\n * time_limit_action: string,\n * tries: CMITries,\n * attempt_records: CMIAttemptRecords\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n tries: CMITries;\n attempt_records: CMIAttemptRecords;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n tries: this.tries,\n attempt_records: this.attempt_records,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport { CMIArray } from \"../common/array\";\nimport Regex from \"../../constants/regex\";\nimport APIConstants from \"../../constants/api_constants\";\n\n/**\n * Class representing the AICC `cmi.paths` object\n */\nexport class CMIPaths extends CMIArray {\n /**\n * Constructor for inline Paths Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.paths_children,\n });\n }\n}\n\n/**\n * Class for AICC Paths\n */\nexport class CMIPathsObject extends BaseCMI {\n /**\n * Constructor for AICC Paths objects\n */\n constructor() {\n super();\n }\n\n private _location_id = \"\";\n private _date = \"\";\n private _time = \"\";\n private _status = \"\";\n private _why_left = \"\";\n private _time_in_element = \"\";\n\n /**\n * Getter for _location_id\n * @return {string}\n */\n get location_id(): string {\n return this._location_id;\n }\n\n /**\n * Setter for _location_id\n * @param {string} location_id\n */\n set location_id(location_id: string) {\n if (checkAICCValidFormat(location_id, Regex.aicc.CMIString256)) {\n this._location_id = location_id;\n }\n }\n\n /**\n * Getter for _date\n * @return {string}\n */\n get date(): string {\n return this._date;\n }\n\n /**\n * Setter for _date\n * @param {string} date\n */\n set date(date: string) {\n if (checkAICCValidFormat(date, Regex.aicc.CMIString256)) {\n this._date = date;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (checkAICCValidFormat(status, Regex.aicc.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * Getter for _why_left\n * @return {string}\n */\n get why_left(): string {\n return this._why_left;\n }\n\n /**\n * Setter for _why_left\n * @param {string} why_left\n */\n set why_left(why_left: string) {\n if (checkAICCValidFormat(why_left, Regex.aicc.CMIString256)) {\n this._why_left = why_left;\n }\n }\n\n /**\n * Getter for _time_in_element\n * @return {string}\n */\n get time_in_element(): string {\n return this._time_in_element;\n }\n\n /**\n * Setter for _time_in_element\n * @param {string} time_in_element\n */\n set time_in_element(time_in_element: string) {\n if (checkAICCValidFormat(time_in_element, Regex.aicc.CMITime)) {\n this._time_in_element = time_in_element;\n }\n }\n\n /**\n * toJSON for cmi.paths.n object\n * @return {\n * {\n * location_id: string,\n * date: string,\n * time: string,\n * status: string,\n * why_left: string,\n * time_in_element: string\n * }\n * }\n */\n toJSON(): {\n location_id: string;\n date: string;\n time: string;\n status: string;\n why_left: string;\n time_in_element: string;\n } {\n this.jsonString = true;\n const result = {\n location_id: this.location_id,\n date: this.date,\n time: this.time,\n status: this.status,\n why_left: this.why_left,\n time_in_element: this.time_in_element,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import * as Scorm12CMI from \"../scorm12/cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMIEvaluation } from \"./evaluation\";\nimport { AICCStudentPreferences } from \"./student_preferences\";\nimport { CMIStudentDemographics } from \"./student_demographics\";\nimport { AICCCMIStudentData } from \"./student_data\";\nimport { CMIPaths } from \"./paths\";\nimport { CMICore } from \"./core\";\nimport { CMIObjectives } from \"../scorm12/objectives\";\nimport { CMIStudentData } from \"../scorm12/student_data\";\nimport { CMIStudentPreference } from \"../scorm12/student_preference\";\nimport { CMIInteractions } from \"../scorm12/interactions\";\n\n/**\n * CMI Class for AICC\n */\nexport class CMI extends Scorm12CMI.CMI {\n /**\n * Constructor for AICC CMI object\n * @param {boolean} initialized\n */\n constructor(initialized: boolean = false) {\n super(APIConstants.aicc.cmi_children);\n if (initialized) this.initialize();\n this.student_preference = new AICCStudentPreferences();\n this.student_data = new AICCCMIStudentData();\n this.student_demographics = new CMIStudentDemographics();\n this.evaluation = new CMIEvaluation();\n this.paths = new CMIPaths();\n }\n\n public student_data: AICCCMIStudentData;\n public student_preference: AICCStudentPreferences;\n public student_demographics: CMIStudentDemographics;\n public evaluation: CMIEvaluation;\n public paths: CMIPaths;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.student_preference?.initialize();\n this.student_data?.initialize();\n this.student_demographics?.initialize();\n this.evaluation?.initialize();\n this.paths?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions,\n * paths: CMIPaths\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n student_demographics: CMIStudentDemographics;\n interactions: CMIInteractions;\n evaluation: CMIEvaluation;\n paths: CMIPaths;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n student_demographics: this.student_demographics,\n interactions: this.interactions,\n evaluation: this.evaluation,\n paths: this.paths,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { Scorm12Impl } from \"./Scorm12API\";\nimport { CMI } from \"./cmi/aicc/cmi\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMITriesObject } from \"./cmi/aicc/tries\";\nimport { CMIAttemptRecordsObject } from \"./cmi/aicc/attempts\";\nimport { CMIEvaluationCommentsObject } from \"./cmi/aicc/evaluation\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport { CMIPathsObject } from \"./cmi/aicc/paths\";\nimport { Settings } from \"./types/api_types\";\nimport { stringMatches } from \"./utilities\";\n\n/**\n * The AICC API class\n */\nclass AICCImpl extends Scorm12Impl {\n /**\n * Constructor to create AICC API object\n * @param {Settings} settings\n */\n constructor(settings?: Settings) {\n super(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {any} value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI | null}\n */\n getChildElement(\n CMIElement: string,\n value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n let newChild = super.getChildElement(CMIElement, value, foundFirstIndex);\n\n if (!newChild) {\n if (stringMatches(CMIElement, \"cmi\\\\.evaluation\\\\.comments\\\\.\\\\d+\")) {\n newChild = new CMIEvaluationCommentsObject();\n } else if (\n stringMatches(CMIElement, \"cmi\\\\.student_data\\\\.tries\\\\.\\\\d+\")\n ) {\n newChild = new CMITriesObject();\n } else if (\n stringMatches(CMIElement, \"cmi\\\\.student_data\\\\.attempt_records\\\\.\\\\d+\")\n ) {\n newChild = new CMIAttemptRecordsObject();\n } else if (stringMatches(CMIElement, \"cmi\\\\.paths\\\\.\\\\d+\")) {\n newChild = new CMIPathsObject();\n }\n }\n\n return newChild;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {AICCImpl} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: AICCImpl) {\n // Data Model\n this.cmi = newAPI.cmi;\n this.nav = newAPI.nav;\n }\n}\n\nexport { AICCImpl };\n","/**\n * Debounce function to delay the execution of a given function.\n *\n * @param func - The function to debounce.\n * @param wait - The number of milliseconds to delay.\n * @param immediate - If `true`, the function will be triggered on the leading edge instead of the trailing.\n * @returns A debounced version of the provided function.\n */\nexport function debounce void>(\n func: T,\n wait: number,\n immediate = false,\n): (...args: Parameters) => void {\n let timeout: ReturnType | null;\n\n return function (this: any, ...args: Parameters) {\n const context = this;\n\n const later = () => {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n const callNow = immediate && !timeout;\n\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) func.apply(context, args);\n };\n}\n","import { ResultObject, Settings } from \"../types/api_types\";\nimport APIConstants from \"./api_constants\";\n\n/**\n * Default settings for the SCORM API\n */\nexport const DefaultSettings: Settings = {\n autocommit: false,\n autocommitSeconds: 10,\n asyncCommit: false,\n sendFullCommit: true,\n lmsCommitUrl: false,\n dataCommitFormat: \"json\",\n commitRequestDataType: \"application/json;charset=UTF-8\",\n autoProgress: false,\n logLevel: APIConstants.global.LOG_LEVEL_ERROR,\n selfReportSessionTime: false,\n alwaysSendTotalTime: false,\n renderCommonCommitFields: false,\n strict_errors: true,\n xhrHeaders: {},\n xhrWithCredentials: false,\n responseHandler: async function (response: Response): Promise {\n if (typeof response !== \"undefined\") {\n const httpResult = JSON.parse(await response.text());\n if (\n httpResult === null ||\n !{}.hasOwnProperty.call(httpResult, \"result\")\n ) {\n if (response.status === 200) {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n }\n } else {\n return {\n result: httpResult.result,\n errorCode: httpResult.errorCode\n ? httpResult.errorCode\n : httpResult.result === APIConstants.global.SCORM_TRUE\n ? 0\n : 101,\n };\n }\n }\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n },\n requestHandler: function (commitObject) {\n return commitObject;\n },\n onLogMessage: function (messageLevel, logMessage) {\n switch (messageLevel) {\n case APIConstants.global.LOG_LEVEL_ERROR:\n console.error(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_WARNING:\n console.warn(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_INFO:\n console.info(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_DEBUG:\n if (console.debug) {\n console.debug(logMessage);\n } else {\n console.log(logMessage);\n }\n break;\n }\n },\n scoItemIds: [],\n scoItemIdValidator: false,\n};\n","import BaseAPI from \"../BaseAPI\";\n\n/**\n * Private class that wraps a timeout call to the commit() function\n */\nexport class ScheduledCommit {\n private _API;\n private _cancelled = false;\n private readonly _timeout;\n private readonly _callback;\n\n /**\n * Constructor for ScheduledCommit\n * @param {BaseAPI} API\n * @param {number} when\n * @param {string} callback\n */\n constructor(API: BaseAPI, when: number, callback: string) {\n this._API = API;\n this._timeout = setTimeout(this.wrapper.bind(this), when);\n this._callback = callback;\n }\n\n /**\n * Cancel any currently scheduled commit\n */\n cancel() {\n this._cancelled = true;\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n }\n\n /**\n * Wrap the API commit call to check if the call has already been cancelled\n */\n wrapper() {\n if (!this._cancelled) {\n (async () => await this._API.commit(this._callback))();\n }\n }\n}\n","import { CMIArray } from \"./cmi/common/array\";\nimport { ValidationError } from \"./exceptions\";\nimport ErrorCodes, { ErrorCode } from \"./constants/error_codes\";\nimport APIConstants from \"./constants/api_constants\";\nimport { formatMessage, stringMatches, unflatten } from \"./utilities\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { debounce } from \"./utilities/debounce\";\nimport {\n RefObject,\n CommitObject,\n ResultObject,\n Settings,\n} from \"./types/api_types\";\nimport { DefaultSettings } from \"./constants/default_settings\";\nimport { IBaseAPI } from \"./interfaces/IBaseAPI\";\nimport { ScheduledCommit } from \"./helpers/scheduled_commit\";\n\n/**\n * Base API class for AICC, SCORM 1.2, and SCORM 2004. Should be considered\n * abstract, and never initialized on its own.\n */\nexport default abstract class BaseAPI implements IBaseAPI {\n private _timeout?: ScheduledCommit;\n private readonly _error_codes: ErrorCode;\n private _settings: Settings = DefaultSettings;\n\n /**\n * Constructor for Base API class. Sets some shared API fields, as well as\n * sets up options for the API.\n * @param {ErrorCode} error_codes\n * @param {Settings} settings\n */\n protected constructor(error_codes: ErrorCode, settings?: Settings) {\n if (new.target === BaseAPI) {\n throw new TypeError(\"Cannot construct BaseAPI instances directly\");\n }\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n\n this._error_codes = error_codes;\n\n if (settings) {\n this.settings = settings;\n }\n this.apiLogLevel = this.settings.logLevel;\n this.selfReportSessionTime = this.settings.selfReportSessionTime;\n }\n\n public abstract cmi: BaseCMI;\n public startingData?: RefObject;\n\n public currentState: number;\n public lastErrorCode: string;\n public listenerArray: any[];\n public apiLogLevel: number;\n public selfReportSessionTime: boolean;\n\n abstract reset(settings?: Settings): void;\n\n /**\n * Common reset method for all APIs. New settings are merged with the existing settings.\n * @param {Settings} settings\n * @protected\n */\n commonReset(settings?: Settings): void {\n this.settings = { ...this.settings, ...settings };\n\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n }\n\n /**\n * Initialize the API\n * @param {string} callbackName\n * @param {string} initializeMessage\n * @param {string} terminationMessage\n * @return {string}\n */\n initialize(\n callbackName: string,\n initializeMessage?: string,\n terminationMessage?: string,\n ): string {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);\n } else if (this.isTerminated()) {\n this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage);\n } else {\n if (this.selfReportSessionTime) {\n this.cmi.setStartTime();\n }\n\n this.currentState = APIConstants.global.STATE_INITIALIZED;\n this.lastErrorCode = \"0\";\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n abstract lmsInitialize(): string;\n\n abstract lmsFinish(): string;\n\n abstract lmsGetValue(CMIElement: string): string;\n\n abstract lmsSetValue(CMIElement: string, value: any): string;\n\n abstract lmsCommit(): string;\n\n abstract lmsGetLastError(): string;\n\n abstract lmsGetErrorString(CMIErrorCode: string | number): string;\n\n abstract lmsGetDiagnostic(CMIErrorCode: string | number): string;\n\n /**\n * Abstract method for validating that a response is correct.\n *\n * @param {string} _CMIElement\n * @param {any} _value\n */\n abstract validateCorrectResponse(_CMIElement: string, _value: any): void;\n\n /**\n * Gets or builds a new child element to add to the array.\n * APIs that inherit BaseAPI should override this method.\n *\n * @param {string} _CMIElement - unused\n * @param {*} _value - unused\n * @param {boolean} _foundFirstIndex - unused\n * @return {BaseCMI|null}\n * @abstract\n */\n abstract getChildElement(\n _CMIElement: string,\n _value: any,\n _foundFirstIndex: boolean,\n ): BaseCMI | null;\n\n /**\n * Attempts to store the data to the LMS, logs data if no LMS configured\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _calculateTotalTime\n * @return {ResultObject}\n * @abstract\n */\n abstract storeData(_calculateTotalTime: boolean): Promise;\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _terminateCommit\n * @return {RefObject|Array}\n * @abstract\n */\n abstract renderCommitCMI(_terminateCommit: boolean): RefObject | Array;\n\n /**\n * Render the commit object to the shortened format for LMS commit\n * @param {boolean} _terminateCommit\n * @return {CommitObject}\n */\n abstract renderCommitObject(_terminateCommit: boolean): CommitObject;\n\n /**\n * Logging for all SCORM actions\n *\n * @param {string} functionName\n * @param {string} logMessage\n * @param {number} messageLevel\n * @param {string} CMIElement\n */\n apiLog(\n functionName: string,\n logMessage: string,\n messageLevel: number,\n CMIElement?: string,\n ) {\n logMessage = formatMessage(functionName, logMessage, CMIElement);\n\n if (messageLevel >= this.apiLogLevel) {\n this.settings.onLogMessage(messageLevel, logMessage);\n }\n }\n\n /**\n * Getter for _error_codes\n * @return {ErrorCode}\n */\n get error_codes(): ErrorCode {\n return this._error_codes;\n }\n\n /**\n * Getter for _settings\n * @return {Settings}\n */\n get settings(): Settings {\n return this._settings;\n }\n\n /**\n * Setter for _settings\n * @param {Settings} settings\n */\n set settings(settings: Settings) {\n this._settings = { ...this._settings, ...settings };\n }\n\n /**\n * Terminates the current run of the API\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async terminate(\n callbackName: string,\n checkTerminated: boolean,\n ): Promise {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.TERMINATION_BEFORE_INIT,\n this._error_codes.MULTIPLE_TERMINATION,\n )\n ) {\n this.currentState = APIConstants.global.STATE_TERMINATED;\n\n const result: ResultObject = await this.storeData(true);\n if (typeof result.errorCode !== \"undefined\" && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Get the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @return {string}\n */\n getValue(\n callbackName: string,\n checkTerminated: boolean,\n CMIElement: string,\n ): string {\n let returnValue: string = \"\";\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.RETRIEVE_BEFORE_INIT,\n this._error_codes.RETRIEVE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.getCMIValue(CMIElement);\n } catch (e) {\n returnValue = this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement);\n }\n\n this.apiLog(\n callbackName,\n \": returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n\n if (returnValue === undefined) {\n return \"\";\n }\n\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Sets the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {string} commitCallback\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setValue(\n callbackName: string,\n commitCallback: string,\n checkTerminated: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (value !== undefined) {\n value = String(value);\n }\n let returnValue: string = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.STORE_BEFORE_INIT,\n this._error_codes.STORE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.setCMIValue(CMIElement, value);\n } catch (e) {\n this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement, value);\n }\n\n if (returnValue === undefined) {\n returnValue = APIConstants.global.SCORM_FALSE;\n }\n\n // If we didn't have any errors while setting the data, go ahead and\n // schedule a commit, if autocommit is turned on\n if (String(this.lastErrorCode) === \"0\") {\n if (this.settings.autocommit && !this._timeout) {\n this.scheduleCommit(\n this.settings.autocommitSeconds * 1000,\n commitCallback,\n );\n }\n }\n\n this.apiLog(\n callbackName,\n \": \" + value + \": result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Orders LMS to store all content parameters\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async commit(\n callbackName: string,\n checkTerminated: boolean = false,\n ): Promise {\n this.clearScheduledCommit();\n\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.COMMIT_BEFORE_INIT,\n this._error_codes.COMMIT_AFTER_TERM,\n )\n ) {\n const result = await this.storeData(false);\n if (result.errorCode && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n this.apiLog(\n callbackName,\n \" Result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"HttpRequest\",\n );\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Returns last error code\n * @param {string} callbackName\n * @return {string}\n */\n getLastError(callbackName: string): string {\n const returnValue = String(this.lastErrorCode);\n\n this.processListeners(callbackName);\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getErrorString(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getDiagnostic(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Checks the LMS state and ensures it has been initialized.\n *\n * @param {boolean} checkTerminated\n * @param {number} beforeInitError\n * @param {number} afterTermError\n * @return {boolean}\n */\n checkState(\n checkTerminated: boolean,\n beforeInitError: number,\n afterTermError: number,\n ): boolean {\n if (this.isNotInitialized()) {\n this.throwSCORMError(beforeInitError);\n return false;\n } else if (checkTerminated && this.isTerminated()) {\n this.throwSCORMError(afterTermError);\n return false;\n }\n\n return true;\n }\n\n /**\n * Returns the message that corresponds to errorNumber\n * APIs that inherit BaseAPI should override this function\n *\n * @param {(string|number)} _errorNumber\n * @param {boolean} _detail\n * @return {string}\n * @abstract\n */\n getLmsErrorMessageDetails(\n _errorNumber: string | number,\n _detail: boolean = false,\n ): string {\n throw new Error(\n \"The getLmsErrorMessageDetails method has not been implemented\",\n );\n }\n\n /**\n * Gets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @return {string}\n * @abstract\n */\n getCMIValue(_CMIElement: string): string {\n throw new Error(\"The getCMIValue method has not been implemented\");\n }\n\n /**\n * Sets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @param {any} _value\n * @return {string}\n * @abstract\n */\n setCMIValue(_CMIElement: string, _value: any): string {\n throw new Error(\"The setCMIValue method has not been implemented\");\n }\n\n /**\n * Shared API method to set a valid for a given element.\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n _commonSetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (!CMIElement || CMIElement === \"\") {\n return APIConstants.global.SCORM_FALSE;\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let returnValue = APIConstants.global.SCORM_FALSE;\n let foundFirstIndex = false;\n\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n const attribute = structure[idx];\n\n if (idx === structure.length - 1) {\n if (scorm2004 && attribute.substring(0, 8) === \"{target=\") {\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);\n } else {\n refObject = {\n ...refObject,\n attribute: value,\n };\n }\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (\n stringMatches(CMIElement, \"\\\\.correct_responses\\\\.\\\\d+\") &&\n this.isInitialized()\n ) {\n this.validateCorrectResponse(CMIElement, value);\n }\n\n if (!scorm2004 || this.lastErrorCode === \"0\") {\n refObject[attribute] = value;\n returnValue = APIConstants.global.SCORM_TRUE;\n }\n }\n } else {\n refObject = refObject[attribute];\n if (!refObject) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n foundFirstIndex = true;\n } else {\n const newChild = this.getChildElement(\n CMIElement,\n value,\n foundFirstIndex,\n );\n foundFirstIndex = true;\n\n if (!newChild) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (refObject.initialized) newChild.initialize();\n\n refObject.childArray.push(newChild);\n refObject = newChild;\n }\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n }\n\n if (returnValue === APIConstants.global.SCORM_FALSE) {\n this.apiLog(\n methodName,\n `There was an error setting the value for: ${CMIElement}, value of: ${value}`,\n APIConstants.global.LOG_LEVEL_WARNING,\n );\n }\n\n return returnValue;\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @return {any}\n */\n _commonGetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n ): any {\n if (!CMIElement || CMIElement === \"\") {\n return \"\";\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let attribute = null;\n\n const uninitializedErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) has not been initialized.`;\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n attribute = structure[idx];\n\n if (!scorm2004) {\n if (idx === structure.length - 1) {\n if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n } else {\n if (\n String(attribute).substring(0, 8) === \"{target=\" &&\n typeof refObject._isTargetValid == \"function\"\n ) {\n const target = String(attribute).substring(\n 8,\n String(attribute).length - 9,\n );\n return refObject._isTargetValid(target);\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n\n refObject = refObject[attribute];\n if (refObject === undefined) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n } else {\n this.throwSCORMError(\n this._error_codes.VALUE_NOT_INITIALIZED,\n uninitializedErrorMessage,\n );\n break;\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n\n if (refObject === null || refObject === undefined) {\n if (!scorm2004) {\n if (attribute === \"_children\") {\n this.throwSCORMError(ErrorCodes.scorm12.CHILDREN_ERROR);\n } else if (attribute === \"_count\") {\n this.throwSCORMError(ErrorCodes.scorm12.COUNT_ERROR);\n }\n }\n } else {\n return refObject;\n }\n }\n\n /**\n * Returns true if the API's current state is STATE_INITIALIZED\n *\n * @return {boolean}\n */\n isInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_NOT_INITIALIZED\n *\n * @return {boolean}\n */\n isNotInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_NOT_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_TERMINATED\n *\n * @return {boolean}\n */\n isTerminated(): boolean {\n return this.currentState === APIConstants.global.STATE_TERMINATED;\n }\n\n /**\n * Provides a mechanism for attaching to a specific SCORM event\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n on(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray.push({\n functionName: functionName,\n CMIElement: CMIElement,\n callback: callback,\n });\n\n this.apiLog(\n \"on\",\n `Added event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n\n /**\n * Provides a mechanism for detaching a specific SCORM event listener\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n off(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n const removeIndex = this.listenerArray.findIndex(\n (obj) =>\n obj.functionName === functionName &&\n obj.CMIElement === CMIElement &&\n obj.callback === callback,\n );\n if (removeIndex !== -1) {\n this.listenerArray.splice(removeIndex, 1);\n this.apiLog(\n \"off\",\n `Removed event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n }\n\n /**\n * Provides a mechanism for clearing all listeners from a specific SCORM event\n *\n * @param {string} listenerName\n */\n clear(listenerName: string) {\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray = this.listenerArray.filter(\n (obj) =>\n obj.functionName !== functionName && obj.CMIElement !== CMIElement,\n );\n }\n }\n\n /**\n * Processes any 'on' listeners that have been created\n *\n * @param {string} functionName\n * @param {string} CMIElement\n * @param {any} value\n */\n processListeners(functionName: string, CMIElement?: string, value?: any) {\n this.apiLog(\n functionName,\n value,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n for (let i = 0; i < this.listenerArray.length; i++) {\n const listener = this.listenerArray[i];\n const functionsMatch = listener.functionName === functionName;\n const listenerHasCMIElement = !!listener.CMIElement;\n let CMIElementsMatch = false;\n if (\n CMIElement &&\n listener.CMIElement &&\n listener.CMIElement.substring(listener.CMIElement.length - 1) === \"*\"\n ) {\n CMIElementsMatch =\n CMIElement.indexOf(\n listener.CMIElement.substring(0, listener.CMIElement.length - 1),\n ) === 0;\n } else {\n CMIElementsMatch = listener.CMIElement === CMIElement;\n }\n\n if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {\n this.apiLog(\n \"processListeners\",\n `Processing listener: ${listener.functionName}`,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n listener.callback(CMIElement, value);\n }\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} errorNumber\n * @param {string} message\n */\n throwSCORMError(errorNumber: number, message?: string) {\n if (!message) {\n message = this.getLmsErrorMessageDetails(errorNumber);\n }\n\n this.apiLog(\n \"throwSCORMError\",\n errorNumber + \": \" + message,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n\n this.lastErrorCode = String(errorNumber);\n }\n\n /**\n * Clears the last SCORM error code on success.\n *\n * @param {string} success\n */\n clearSCORMError(success: string) {\n if (success !== undefined && success !== APIConstants.global.SCORM_FALSE) {\n this.lastErrorCode = \"0\";\n }\n }\n\n /**\n * Load the CMI from a flattened JSON object\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromFlattenedJSON(json: RefObject, CMIElement?: string) {\n if (!CMIElement) {\n // by default, we start from a blank string because we're expecting each element to start with `cmi`\n CMIElement = \"\";\n }\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromFlattenedJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n /**\n * Tests two strings against a given regular expression pattern and determines a numeric or null result based on the matching criterion.\n *\n * @param {string} a - The first string to be tested against the pattern.\n * @param {string} c - The second string to be tested against the pattern.\n * @param {RegExp} a_pattern - The regular expression pattern to test the strings against.\n * @return {number | null} A numeric result based on the matching criterion, or null if the strings do not match the pattern.\n */\n function testPattern(\n a: string,\n c: string,\n a_pattern: RegExp,\n ): number | null {\n const a_match = a.match(a_pattern);\n\n let c_match;\n if (a_match !== null && (c_match = c.match(a_pattern)) !== null) {\n const a_num = Number(a_match[2]);\n const c_num = Number(c_match[2]);\n if (a_num === c_num) {\n if (a_match[3] === \"id\") {\n return -1;\n } else if (a_match[3] === \"type\") {\n if (c_match[3] === \"id\") {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 1;\n }\n }\n return a_num - c_num;\n }\n\n return null;\n }\n\n const int_pattern = /^(cmi\\.interactions\\.)(\\d+)\\.(.*)$/;\n const obj_pattern = /^(cmi\\.objectives\\.)(\\d+)\\.(.*)$/;\n\n const result = Object.keys(json).map(function (key) {\n return [String(key), json[key]];\n });\n\n // CMI interactions need to have id and type loaded before any other fields\n result.sort(function ([a, _b], [c, _d]) {\n let test;\n if ((test = testPattern(a, c, int_pattern)) !== null) {\n return test;\n }\n if ((test = testPattern(a, c, obj_pattern)) !== null) {\n return test;\n }\n\n if (a < c) {\n return -1;\n }\n if (a > c) {\n return 1;\n }\n return 0;\n });\n\n let obj: RefObject;\n result.forEach((element) => {\n obj = {};\n obj[element[0]] = element[1];\n this.loadFromJSON(unflatten(obj), CMIElement);\n });\n }\n\n /**\n * Loads CMI data from a JSON object.\n *\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromJSON(json: RefObject, CMIElement: string) {\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n CMIElement = CMIElement !== undefined ? CMIElement : \"cmi\";\n\n this.startingData = json;\n\n // could this be refactored down to flatten(json) then setCMIValue on each?\n for (const key in json) {\n if ({}.hasOwnProperty.call(json, key) && json[key]) {\n const currentCMIElement = (CMIElement ? CMIElement + \".\" : \"\") + key;\n const value = json[key];\n\n if (value[\"childArray\"]) {\n for (let i = 0; i < value[\"childArray\"].length; i++) {\n this.loadFromJSON(\n value[\"childArray\"][i],\n currentCMIElement + \".\" + i,\n );\n }\n } else if (value.constructor === Object) {\n this.loadFromJSON(value, currentCMIElement);\n } else {\n this.setCMIValue(currentCMIElement, value);\n }\n }\n }\n }\n\n /**\n * Render the CMI object to JSON for sending to an LMS.\n *\n * @return {string}\n */\n renderCMIToJSONString(): string {\n const cmi = this.cmi;\n // Do we want/need to return fields that have no set value?\n if (this.settings.sendFullCommit) {\n return JSON.stringify({ cmi });\n }\n return JSON.stringify({ cmi }, (k, v) => (v === undefined ? null : v), 2);\n }\n\n /**\n * Returns a JS object representing the current cmi\n * @return {object}\n */\n renderCMIToJSONObject(): object {\n return JSON.parse(this.renderCMIToJSONString());\n }\n\n /**\n * Send the request to the LMS\n * @param {string} url\n * @param {CommitObject|RefObject|Array} params\n * @param {boolean} immediate\n * @return {ResultObject}\n */\n async processHttpRequest(\n url: string,\n params: CommitObject | RefObject | Array,\n immediate: boolean = false,\n ): Promise {\n const api = this;\n const genericError: ResultObject = {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: this.error_codes.GENERAL,\n };\n\n // if we are terminating the module or closing the browser window/tab, we need to make this fetch ASAP.\n // Some browsers, especially Chrome, do not like synchronous requests to be made when the window is closing.\n if (immediate) {\n this.performFetch(url, params).then(async (response) => {\n await this.transformResponse(response);\n });\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n\n const process = async (\n url: string,\n params: CommitObject | RefObject | Array,\n settings: Settings,\n ): Promise => {\n try {\n params = settings.requestHandler(params);\n const response = await this.performFetch(url, params);\n\n return this.transformResponse(response);\n } catch (e) {\n this.apiLog(\n \"processHttpRequest\",\n e,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n api.processListeners(\"CommitError\");\n return genericError;\n }\n };\n\n if (this.settings.asyncCommit) {\n const debouncedProcess = debounce(process, 500, immediate);\n debouncedProcess(url, params, this.settings);\n\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return await process(url, params, this.settings);\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} when - the number of milliseconds to wait before committing\n * @param {string} callback - the name of the commit event callback\n */\n scheduleCommit(when: number, callback: string) {\n this._timeout = new ScheduledCommit(this, when, callback);\n this.apiLog(\n \"scheduleCommit\",\n \"scheduled\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n\n /**\n * Clears and cancels any currently scheduled commits\n */\n clearScheduledCommit() {\n if (this._timeout) {\n this._timeout.cancel();\n this._timeout = undefined;\n this.apiLog(\n \"clearScheduledCommit\",\n \"cleared\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n }\n\n /**\n * Check to see if the specific object has the given property\n * @param {RefObject} refObject\n * @param {string} attribute\n * @return {boolean}\n * @private\n */\n private _checkObjectHasProperty(\n refObject: RefObject,\n attribute: string,\n ): boolean {\n return (\n Object.hasOwnProperty.call(refObject, attribute) ||\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(refObject),\n attribute,\n ) != null ||\n attribute in refObject\n );\n }\n\n /**\n * Handles the error that occurs when trying to access a value\n * @param {any} e\n * @param {string} returnValue\n * @return {string}\n * @private\n */\n private handleValueAccessException(e: any, returnValue: string): string {\n if (e instanceof ValidationError) {\n this.lastErrorCode = String(e.errorCode);\n returnValue = APIConstants.global.SCORM_FALSE;\n } else {\n if (e instanceof Error && e.message) {\n console.error(e.message);\n } else {\n console.error(e);\n }\n this.throwSCORMError(this._error_codes.GENERAL);\n }\n return returnValue;\n }\n\n /**\n * Perform the fetch request to the LMS\n * @param {string} url\n * @param {RefObject|Array} params\n * @return {Promise}\n * @private\n */\n private async performFetch(\n url: string,\n params: RefObject | Array,\n ): Promise {\n return fetch(url, {\n method: \"POST\",\n body: params instanceof Array ? params.join(\"&\") : JSON.stringify(params),\n headers: {\n ...this.settings.xhrHeaders,\n \"Content-Type\": this.settings.commitRequestDataType,\n },\n credentials: this.settings.xhrWithCredentials ? \"include\" : undefined,\n keepalive: true,\n });\n }\n\n /**\n * Transforms the response from the LMS to a ResultObject\n * @param {Response} response\n * @return {Promise}\n * @private\n */\n private async transformResponse(response: Response): Promise {\n const result =\n typeof this.settings.responseHandler === \"function\"\n ? await this.settings.responseHandler(response)\n : await response.json();\n\n if (\n response.status >= 200 &&\n response.status <= 299 &&\n (result.result === true ||\n result.result === APIConstants.global.SCORM_TRUE)\n ) {\n this.processListeners(\"CommitSuccess\");\n } else {\n this.processListeners(\"CommitError\");\n }\n return result;\n }\n}\n","import { CMI } from \"./cmi/scorm12/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMIObjectivesObject } from \"./cmi/scorm12/objectives\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm12/interactions\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport Regex from \"./constants/regex\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\nimport BaseAPI from \"./BaseAPI\";\n\n/**\n * API class for SCORM 1.2\n */\nclass Scorm12Impl extends BaseAPI {\n /**\n * Constructor for SCORM 1.2 API\n * @param {object} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm12, settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n\n // Rename functions to match 1.2 Spec and expose to modules\n this.LMSInitialize = this.lmsInitialize;\n this.LMSFinish = this.lmsFinish;\n this.LMSGetValue = this.lmsGetValue;\n this.LMSSetValue = this.lmsSetValue;\n this.LMSCommit = this.lmsCommit;\n this.LMSGetLastError = this.lmsGetLastError;\n this.LMSGetErrorString = this.lmsGetErrorString;\n this.LMSGetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public statusSetByModule = false;\n\n cmi: CMI;\n nav: NAV;\n\n LMSInitialize: () => string;\n LMSFinish: () => string;\n LMSGetValue: (CMIElement: string) => string;\n LMSSetValue: (CMIElement: string, value: any) => string;\n LMSCommit: () => string;\n LMSGetLastError: () => string;\n LMSGetErrorString: (CMIErrorCode: string) => string;\n LMSGetDiagnostic: (CMIErrorCode: string) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * lmsInitialize function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n if (this.cmi.core.lesson_status) {\n this.statusSetByModule = true;\n } else {\n this.cmi.core.lesson_status = \"not attempted\";\n }\n return this.initialize(\n \"LMSInitialize\",\n \"LMS was already initialized!\",\n \"LMS is already finished!\",\n );\n }\n\n /**\n * LMSFinish function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"LMSFinish\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.nav.event !== \"\") {\n if (this.nav.event === \"continue\") {\n this.processListeners(\"SequenceNext\");\n } else {\n this.processListeners(\"SequencePrevious\");\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * LMSGetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n return this.getValue(\"LMSGetValue\", false, CMIElement);\n }\n\n /**\n * LMSSetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n if (CMIElement === \"cmi.core.lesson_status\") {\n this.statusSetByModule = true;\n }\n return this.setValue(\"LMSSetValue\", \"LMSCommit\", false, CMIElement, value);\n }\n\n /**\n * LMSCommit function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"LMSCommit\", false);\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * LMSGetLastError function from SCORM 1.2 Spec\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"LMSGetLastError\");\n }\n\n /**\n * LMSGetErrorString function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string): string {\n return this.getErrorString(\"LMSGetErrorString\", CMIErrorCode);\n }\n\n /**\n * LMSGetDiagnostic function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string): string {\n return this.getDiagnostic(\"LMSGetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"LMSSetValue\", false, CMIElement, value);\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"getCMIValue\", false, CMIElement);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {*} _value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n _value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsCorrectResponsesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObjectivesObject();\n } else if (\n !foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObject();\n }\n\n return null;\n }\n\n /**\n * Validates Correct Response values\n *\n * @param {string} _CMIElement\n * @param {*} _value\n */\n validateCorrectResponse(_CMIElement: string, _value: any) {\n // do nothing\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {number|string} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: number | string,\n detail: boolean,\n ): string {\n let basicMessage = \"No Error\";\n let detailMessage = \"No Error\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm12.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {Scorm12Impl} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm12Impl) {\n // Data Model\n this.cmi = newAPI.cmi;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeHHMMSS = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getTimeAsSeconds(\n totalTimeHHMMSS,\n Regex.scorm12.CMITimespan,\n );\n const lessonStatus = this.cmi.core.lesson_status;\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (lessonStatus) {\n completionStatus =\n lessonStatus === \"completed\" || lessonStatus === \"passed\"\n ? CompletionStatus.completed\n : CompletionStatus.incomplete;\n if (lessonStatus === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (lessonStatus === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.core.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n }\n\n const commitObject: CommitObject = {\n successStatus: successStatus,\n completionStatus: completionStatus,\n runtimeData: cmiExport,\n totalTimeSeconds: totalTimeSeconds,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n const originalStatus = this.cmi.core.lesson_status;\n if (\n !this.cmi.core.lesson_status ||\n (!this.statusSetByModule &&\n this.cmi.core.lesson_status === \"not attempted\")\n ) {\n this.cmi.core.lesson_status = \"completed\";\n }\n\n if (this.cmi.core.lesson_mode === \"normal\") {\n if (this.cmi.core.credit === \"credit\") {\n if (\n this.settings.mastery_override &&\n this.cmi.student_data.mastery_score !== \"\" &&\n this.cmi.core.score.raw !== \"\"\n ) {\n this.cmi.core.lesson_status =\n parseFloat(this.cmi.core.score.raw) >=\n parseFloat(this.cmi.student_data.mastery_score)\n ? \"passed\"\n : \"failed\";\n }\n }\n } else if (this.cmi.core.lesson_mode === \"browse\") {\n if (\n (this.startingData?.cmi?.core?.lesson_status || \"\") === \"\" &&\n originalStatus === \"not attempted\"\n ) {\n this.cmi.core.lesson_status = \"browsed\";\n }\n }\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n return await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n\nexport { Scorm12Impl };\n","import { checkValidFormat, checkValidRange } from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check2004ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n Scorm2004ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @return {boolean}\n */\nexport function check2004ValidRange(\n value: string,\n rangePattern: string,\n): boolean {\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm2004.VALUE_OUT_OF_RANGE,\n Scorm2004ValidationError,\n );\n}\n","/**\n * Class for SCORM 2004's cmi.learner_preference object\n */\nimport { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\nexport class CMILearnerPreference extends BaseCMI {\n private __children = APIConstants.scorm2004.student_preference_children;\n private _audio_level = \"1\";\n private _language = \"\";\n private _delivery_speed = \"1\";\n private _audio_captioning = \"0\";\n\n /**\n * Constructor for cmi.learner_preference\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for _audio_level\n * @return {string}\n */\n get audio_level(): string {\n return this._audio_level;\n }\n\n /**\n * Setter for _audio_level\n * @param {string} audio_level\n */\n set audio_level(audio_level: string) {\n if (\n check2004ValidFormat(audio_level, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(audio_level, Regex.scorm2004.audio_range)\n ) {\n this._audio_level = audio_level;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check2004ValidFormat(language, Regex.scorm2004.CMILang)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _delivery_speed\n * @return {string}\n */\n get delivery_speed(): string {\n return this._delivery_speed;\n }\n\n /**\n * Setter for _delivery_speed\n * @param {string} delivery_speed\n */\n set delivery_speed(delivery_speed: string) {\n if (\n check2004ValidFormat(delivery_speed, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(delivery_speed, Regex.scorm2004.speed_range)\n ) {\n this._delivery_speed = delivery_speed;\n }\n }\n\n /**\n * Getter for _audio_captioning\n * @return {string}\n */\n get audio_captioning(): string {\n return this._audio_captioning;\n }\n\n /**\n * Setter for _audio_captioning\n * @param {string} audio_captioning\n */\n set audio_captioning(audio_captioning: string) {\n if (\n check2004ValidFormat(audio_captioning, Regex.scorm2004.CMISInteger) &&\n check2004ValidRange(audio_captioning, Regex.scorm2004.text_range)\n ) {\n this._audio_captioning = audio_captioning;\n }\n }\n\n /**\n * toJSON for cmi.learner_preference\n *\n * @return {\n * {\n * audio_level: string,\n * language: string,\n * delivery_speed: string,\n * audio_captioning: string\n * }\n * }\n */\n toJSON(): {\n audio_level: string;\n language: string;\n delivery_speed: string;\n audio_captioning: string;\n } {\n this.jsonString = true;\n const result = {\n audio_level: this.audio_level,\n language: this.language,\n delivery_speed: this.delivery_speed,\n audio_captioning: this.audio_captioning,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import Regex from \"./regex\";\n\nconst scorm2004_regex = Regex.scorm2004;\nexport const LearnerResponses: Responses = {\n \"true-false\": {\n format: \"^true$|^false$\",\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n choice: {\n format: scorm2004_regex.CMILongIdentifier,\n max: 36,\n delimiter: \"[,]\",\n unique: true,\n },\n \"fill-in\": {\n format: scorm2004_regex.CMILangString250,\n max: 10,\n delimiter: \"[,]\",\n unique: false,\n },\n \"long-fill-in\": {\n format: scorm2004_regex.CMILangString4000,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n matching: {\n format: scorm2004_regex.CMIShortIdentifier,\n format2: scorm2004_regex.CMIShortIdentifier,\n max: 36,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n },\n performance: {\n format: \"^$|\" + scorm2004_regex.CMIShortIdentifier,\n format2:\n scorm2004_regex.CMIDecimal + \"|^$|\" + scorm2004_regex.CMIShortIdentifier,\n max: 250,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n },\n sequencing: {\n format: scorm2004_regex.CMIShortIdentifier,\n max: 36,\n delimiter: \"[,]\",\n unique: false,\n },\n likert: {\n format: scorm2004_regex.CMIShortIdentifier,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n numeric: {\n format: scorm2004_regex.CMIDecimal,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n other: {\n format: scorm2004_regex.CMIString4000,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n};\nexport const CorrectResponses: Responses = {\n \"true-false\": {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: \"^true$|^false$\",\n limit: 1,\n },\n choice: {\n max: 36,\n delimiter: \"[,]\",\n unique: true,\n duplicate: false,\n format: scorm2004_regex.CMILongIdentifier,\n },\n \"fill-in\": {\n max: 10,\n delimiter: \"[,]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMILangString250cr,\n },\n \"long-fill-in\": {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: true,\n format: scorm2004_regex.CMILangString4000,\n },\n matching: {\n max: 36,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n format2: scorm2004_regex.CMIShortIdentifier,\n },\n performance: {\n max: 250,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n delimiter3: \"[:]\",\n unique: false,\n duplicate: false,\n format: \"^$|\" + scorm2004_regex.CMIShortIdentifier,\n format2:\n scorm2004_regex.CMIDecimal + \"|^$|\" + scorm2004_regex.CMIShortIdentifier,\n },\n sequencing: {\n max: 36,\n delimiter: \"[,]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n },\n likert: {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n limit: 1,\n },\n numeric: {\n max: 2,\n delimiter: \"[:]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIDecimal,\n limit: 1,\n },\n other: {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIString4000,\n limit: 1,\n },\n};\n\nexport type ResponseType = {\n format: string;\n max: number;\n delimiter: string;\n unique: boolean;\n duplicate?: boolean;\n format2?: string;\n delimiter2?: string;\n limit?: number;\n delimiter3?: string;\n};\n\nexport type Responses = {\n [key: string]: ResponseType;\n};\n","/**\n * Class representing SCORM 2004's `cmi.interactions` object\n */\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { CMIArray } from \"../common/array\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\nimport { LearnerResponses } from \"../../constants/response_constants\";\n\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.objectives` Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.interactions_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class for SCORM 2004's cmi.interaction.n object\n */\n\nexport class CMIInteractionsObject extends BaseCMI {\n private _id = \"\";\n private _type = \"\";\n private _timestamp = \"\";\n private _weighting = \"\";\n private _learner_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n private _description = \"\";\n\n /**\n * Constructor for cmi.interaction.n\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n children: APIConstants.scorm2004.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n children: APIConstants.scorm2004.correct_responses_children,\n });\n }\n\n public objectives: CMIArray;\n public correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _type\n * @return {string}\n */\n get type(): string {\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(type, Regex.scorm2004.CMIType)) {\n this._type = type;\n }\n }\n }\n\n /**\n * Getter for _timestamp\n * @return {string}\n */\n get timestamp(): string {\n return this._timestamp;\n }\n\n /**\n * Setter for _timestamp\n * @param {string} timestamp\n */\n set timestamp(timestamp: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(timestamp, Regex.scorm2004.CMITime)) {\n this._timestamp = timestamp;\n }\n }\n }\n\n /**\n * Getter for _weighting\n * @return {string}\n */\n get weighting(): string {\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(weighting, Regex.scorm2004.CMIDecimal)) {\n this._weighting = weighting;\n }\n }\n }\n\n /**\n * Getter for _learner_response\n * @return {string}\n */\n get learner_response(): string {\n return this._learner_response;\n }\n\n /**\n * Setter for _learner_response. Does type validation to make sure response\n * matches SCORM 2004's spec\n * @param {string} learner_response\n */\n set learner_response(learner_response: string) {\n if (this.initialized && (this._type === \"\" || this._id === \"\")) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n let nodes = [];\n const response_type = LearnerResponses[this.type];\n\n if (response_type) {\n if (response_type?.delimiter) {\n nodes = learner_response.split(response_type.delimiter);\n } else {\n nodes[0] = learner_response;\n }\n\n if (nodes.length > 0 && nodes.length <= response_type.max) {\n const formatRegex = new RegExp(response_type.format);\n\n for (let i = 0; i < nodes.length; i++) {\n if (response_type?.delimiter2) {\n const values = nodes[i].split(response_type.delimiter2);\n\n if (values.length === 2) {\n if (!values[0].match(formatRegex)) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n } else {\n if (\n !response_type.format2 ||\n !values[1].match(new RegExp(response_type.format2))\n ) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n }\n } else {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n } else {\n if (!nodes[i].match(formatRegex)) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n } else {\n if (nodes[i] !== \"\" && response_type.unique) {\n for (let j = 0; j < i; j++) {\n if (nodes[i] === nodes[j]) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n }\n }\n }\n }\n }\n } else {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n );\n }\n\n this._learner_response = learner_response;\n } else {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n\n /**\n * Getter for _result\n * @return {string}\n */\n get result(): string {\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check2004ValidFormat(result, Regex.scorm2004.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency\n * @return {string}\n */\n get latency(): string {\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(latency, Regex.scorm2004.CMITimespan)) {\n this._latency = latency;\n }\n }\n }\n\n /**\n * Getter for _description\n * @return {string}\n */\n get description(): string {\n return this._description;\n }\n\n /**\n * Setter for _description\n * @param {string} description\n */\n set description(description: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(\n description,\n Regex.scorm2004.CMILangString250,\n true,\n )\n ) {\n this._description = description;\n }\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * type: string,\n * objectives: CMIArray,\n * timestamp: string,\n * correct_responses: CMIArray,\n * weighting: string,\n * learner_response: string,\n * result: string,\n * latency: string,\n * description: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n type: string;\n objectives: CMIArray;\n timestamp: string;\n correct_responses: CMIArray;\n weighting: string;\n learner_response: string;\n result: string;\n latency: string;\n description: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n type: this.type,\n objectives: this.objectives,\n timestamp: this.timestamp,\n weighting: this.weighting,\n learner_response: this.learner_response,\n result: this.result,\n latency: this.latency,\n description: this.description,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.interactions.n.objectives.n object\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n private _id = \"\";\n\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.interactions.n.correct_responses.n object\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n private _pattern = \"\";\n\n /**\n * Constructor for cmi.interactions.n.correct_responses.n\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check2004ValidFormat(pattern, Regex.scorm2004.CMIFeedback)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON cmi.interactions.n.correct_responses.n object\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this.pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","/**\n * Class for SCORM 2004's cmi *.score object\n */\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\n\nexport class Scorm2004CMIScore extends CMIScore {\n private _scaled = \"\";\n\n /**\n * Constructor for cmi *.score\n */\n constructor() {\n super({\n score_children: APIConstants.scorm2004.score_children,\n max: \"\",\n invalidErrorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n invalidTypeCode: ErrorCodes.scorm2004.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm2004.VALUE_OUT_OF_RANGE,\n decimalRegex: Regex.scorm2004.CMIDecimal,\n errorClass: Scorm2004ValidationError,\n });\n }\n\n /**\n * Getter for _scaled\n * @return {string}\n */\n get scaled(): string {\n return this._scaled;\n }\n\n /**\n * Setter for _scaled\n * @param {string} scaled\n */\n set scaled(scaled: string) {\n if (\n check2004ValidFormat(scaled, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(scaled, Regex.scorm2004.scaled_range)\n ) {\n this._scaled = scaled;\n }\n }\n\n /**\n * toJSON for cmi *.score\n *\n * @return {\n * {\n * scaled: string,\n * raw: string,\n * min: string,\n * max: string\n * }\n * }\n */\n toJSON(): {\n scaled: string;\n raw: string;\n min: string;\n max: string;\n } {\n this.jsonString = true;\n const result = {\n scaled: this.scaled,\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_lms object\n * @extends CMIArray\n */\nexport class CMICommentsFromLMS extends CMIArray {\n /**\n * Constructor for cmi.comments_from_lms Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.comments_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_learner object\n */\n\nexport class CMICommentsFromLearner extends CMIArray {\n /**\n * Constructor for cmi.comments_from_learner Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.comments_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_learner.n and cmi.comments_from_lms.n object\n */\n\nexport class CMICommentsObject extends BaseCMI {\n private _comment = \"\";\n private _location = \"\";\n private _timestamp = \"\";\n private readonly _readOnlyAfterInit: boolean;\n\n /**\n * Constructor for cmi.comments_from_learner.n and cmi.comments_from_lms.n\n * @param {boolean} readOnlyAfterInit\n */\n constructor(readOnlyAfterInit: boolean = false) {\n super();\n this._comment = \"\";\n this._location = \"\";\n this._timestamp = \"\";\n this._readOnlyAfterInit = readOnlyAfterInit;\n }\n\n /**\n * Getter for _comment\n * @return {string}\n */\n get comment(): string {\n return this._comment;\n }\n\n /**\n * Setter for _comment\n * @param {string} comment\n */\n set comment(comment: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (\n check2004ValidFormat(comment, Regex.scorm2004.CMILangString4000, true)\n ) {\n this._comment = comment;\n }\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (check2004ValidFormat(location, Regex.scorm2004.CMIString250)) {\n this._location = location;\n }\n }\n }\n\n /**\n * Getter for _timestamp\n * @return {string}\n */\n get timestamp(): string {\n return this._timestamp;\n }\n\n /**\n * Setter for _timestamp\n * @param {string} timestamp\n */\n set timestamp(timestamp: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (check2004ValidFormat(timestamp, Regex.scorm2004.CMITime)) {\n this._timestamp = timestamp;\n }\n }\n }\n\n /**\n * toJSON for cmi.comments_from_learner.n object\n * @return {\n * {\n * comment: string,\n * location: string,\n * timestamp: string\n * }\n * }\n */\n toJSON(): {\n comment: string;\n location: string;\n timestamp: string;\n } {\n this.jsonString = true;\n const result = {\n comment: this.comment,\n location: this.location,\n timestamp: this.timestamp,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { Scorm2004CMIScore } from \"./score\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing SCORM 2004's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives` Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.objectives_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class for SCORM 2004's cmi.objectives.n object\n */\nexport class CMIObjectivesObject extends BaseCMI {\n private _id = \"\";\n private _success_status = \"unknown\";\n private _completion_status = \"unknown\";\n private _progress_measure = \"\";\n private _description = \"\";\n\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new Scorm2004CMIScore();\n }\n\n public score: Scorm2004CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _success_status\n * @return {string}\n */\n get success_status(): string {\n return this._success_status;\n }\n\n /**\n * Setter for _success_status\n * @param {string} success_status\n */\n set success_status(success_status: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(success_status, Regex.scorm2004.CMISStatus)) {\n this._success_status = success_status;\n }\n }\n }\n\n /**\n * Getter for _completion_status\n * @return {string}\n */\n get completion_status(): string {\n return this._completion_status;\n }\n\n /**\n * Setter for _completion_status\n * @param {string} completion_status\n */\n set completion_status(completion_status: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(completion_status, Regex.scorm2004.CMICStatus)) {\n this._completion_status = completion_status;\n }\n }\n }\n\n /**\n * Getter for _progress_measure\n * @return {string}\n */\n get progress_measure(): string {\n return this._progress_measure;\n }\n\n /**\n * Setter for _progress_measure\n * @param {string} progress_measure\n */\n set progress_measure(progress_measure: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(progress_measure, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(progress_measure, Regex.scorm2004.progress_range)\n ) {\n this._progress_measure = progress_measure;\n }\n }\n }\n\n /**\n * Getter for _description\n * @return {string}\n */\n get description(): string {\n return this._description;\n }\n\n /**\n * Setter for _description\n * @param {string} description\n */\n set description(description: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(\n description,\n Regex.scorm2004.CMILangString250,\n true,\n )\n ) {\n this._description = description;\n }\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n *\n * @return {\n * {\n * id: string,\n * success_status: string,\n * completion_status: string,\n * progress_measure: string,\n * description: string,\n * score: Scorm2004CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n success_status: string;\n completion_status: string;\n progress_measure: string;\n description: string;\n score: Scorm2004CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n success_status: this.success_status,\n completion_status: this.completion_status,\n progress_measure: this.progress_measure,\n description: this.description,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport * as Util from \"../../utilities\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport { CMILearnerPreference } from \"./learner_preference\";\nimport { CMIInteractions } from \"./interactions\";\nimport { Scorm2004CMIScore } from \"./score\";\nimport { CMICommentsFromLearner, CMICommentsFromLMS } from \"./comments\";\nimport { CMIObjectives } from \"./objectives\";\n\n/**\n * Class representing cmi object for SCORM 2004\n */\nexport class CMI extends BaseRootCMI {\n /**\n * Constructor for the SCORM 2004 cmi object\n * @param {boolean} initialized\n */\n constructor(initialized: boolean = false) {\n super();\n this.learner_preference = new CMILearnerPreference();\n this.score = new Scorm2004CMIScore();\n this.comments_from_learner = new CMICommentsFromLearner();\n this.comments_from_lms = new CMICommentsFromLMS();\n this.interactions = new CMIInteractions();\n this.objectives = new CMIObjectives();\n if (initialized) this.initialize();\n }\n\n public learner_preference: CMILearnerPreference;\n public score: Scorm2004CMIScore;\n public comments_from_learner: CMICommentsFromLearner;\n public comments_from_lms: CMICommentsFromLMS;\n public interactions: CMIInteractions;\n public objectives: CMIObjectives;\n\n private __version = \"1.0\";\n private __children = APIConstants.scorm2004.cmi_children;\n private _completion_status = \"unknown\";\n private _completion_threshold = \"\";\n private _credit = \"credit\";\n private _entry = \"\";\n private _exit = \"\";\n private _launch_data = \"\";\n private _learner_id = \"\";\n private _learner_name = \"\";\n private _location = \"\";\n private _max_time_allowed = \"\";\n private _mode = \"normal\";\n private _progress_measure = \"\";\n private _scaled_passing_score = \"\";\n private _session_time = \"PT0H0M0S\";\n private _success_status = \"unknown\";\n private _suspend_data = \"\";\n private _time_limit_action = \"continue,no message\";\n private _total_time = \"\";\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.learner_preference?.initialize();\n this.score?.initialize();\n this.comments_from_learner?.initialize();\n this.comments_from_lms?.initialize();\n this.interactions?.initialize();\n this.objectives?.initialize();\n }\n\n /**\n * Getter for __version\n * @return {string}\n * @private\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n * @private\n */\n set _version(_version: string) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {number} _children\n * @private\n */\n set _children(_children: number) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for _completion_status\n * @return {string}\n */\n get completion_status(): string {\n return this._completion_status;\n }\n\n /**\n * Setter for _completion_status\n * @param {string} completion_status\n */\n set completion_status(completion_status: string) {\n if (check2004ValidFormat(completion_status, Regex.scorm2004.CMICStatus)) {\n this._completion_status = completion_status;\n }\n }\n\n /**\n * Getter for _completion_threshold\n * @return {string}\n */\n get completion_threshold(): string {\n return this._completion_threshold;\n }\n\n /**\n * Setter for _completion_threshold. Can only be called before initialization.\n * @param {string} completion_threshold\n */\n set completion_threshold(completion_threshold: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._completion_threshold = completion_threshold;\n }\n }\n\n /**\n * Setter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.WRITE_ONLY_ELEMENT,\n );\n }\n return this._exit;\n }\n\n /**\n * Getter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check2004ValidFormat(exit, Regex.scorm2004.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _learner_id\n * @return {string}\n */\n get learner_id(): string {\n return this._learner_id;\n }\n\n /**\n * Setter for _learner_id. Can only be called before initialization.\n * @param {string} learner_id\n */\n set learner_id(learner_id: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._learner_id = learner_id;\n }\n }\n\n /**\n * Getter for _learner_name\n * @return {string}\n */\n get learner_name(): string {\n return this._learner_name;\n }\n\n /**\n * Setter for _learner_name. Can only be called before initialization.\n * @param {string} learner_name\n */\n set learner_name(learner_name: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._learner_name = learner_name;\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (check2004ValidFormat(location, Regex.scorm2004.CMIString1000)) {\n this._location = location;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _mode\n * @return {string}\n */\n get mode(): string {\n return this._mode;\n }\n\n /**\n * Setter for _mode. Can only be called before initialization.\n * @param {string} mode\n */\n set mode(mode: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._mode = mode;\n }\n }\n\n /**\n * Getter for _progress_measure\n * @return {string}\n */\n get progress_measure(): string {\n return this._progress_measure;\n }\n\n /**\n * Setter for _progress_measure\n * @param {string} progress_measure\n */\n set progress_measure(progress_measure: string) {\n if (\n check2004ValidFormat(progress_measure, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(progress_measure, Regex.scorm2004.progress_range)\n ) {\n this._progress_measure = progress_measure;\n }\n }\n\n /**\n * Getter for _scaled_passing_score\n * @return {string}\n */\n get scaled_passing_score(): string {\n return this._scaled_passing_score;\n }\n\n /**\n * Setter for _scaled_passing_score. Can only be called before initialization.\n * @param {string} scaled_passing_score\n */\n set scaled_passing_score(scaled_passing_score: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._scaled_passing_score = scaled_passing_score;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.WRITE_ONLY_ELEMENT,\n );\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check2004ValidFormat(session_time, Regex.scorm2004.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _success_status\n * @return {string}\n */\n get success_status(): string {\n return this._success_status;\n }\n\n /**\n * Setter for _success_status\n * @param {string} success_status\n */\n set success_status(success_status: string) {\n if (check2004ValidFormat(success_status, Regex.scorm2004.CMISStatus)) {\n this._success_status = success_status;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (\n check2004ValidFormat(suspend_data, Regex.scorm2004.CMIString64000, true)\n ) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string} ISO8601 Duration\n */\n getCurrentTotalTime(): string {\n let sessionTime = this._session_time;\n const startTime = this.start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsISODuration(seconds / 1000);\n }\n\n return Util.addTwoDurations(\n this._total_time,\n sessionTime,\n Regex.scorm2004.CMITimespan,\n );\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * comments_from_learner: CMICommentsFromLearner,\n * comments_from_lms: CMICommentsFromLMS,\n * completion_status: string,\n * completion_threshold: string,\n * credit: string,\n * entry: string,\n * exit: string,\n * interactions: CMIInteractions,\n * launch_data: string,\n * learner_id: string,\n * learner_name: string,\n * learner_preference: CMILearnerPreference,\n * location: string,\n * max_time_allowed: string,\n * mode: string,\n * objectives: CMIObjectives,\n * progress_measure: string,\n * scaled_passing_score: string,\n * score: Scorm2004CMIScore,\n * session_time: string,\n * success_status: string,\n * suspend_data: string,\n * time_limit_action: string\n * }\n * }\n */\n toJSON(): {\n comments_from_learner: CMICommentsFromLearner;\n comments_from_lms: CMICommentsFromLMS;\n completion_status: string;\n completion_threshold: string;\n credit: string;\n entry: string;\n exit: string;\n interactions: CMIInteractions;\n launch_data: string;\n learner_id: string;\n learner_name: string;\n learner_preference: CMILearnerPreference;\n location: string;\n max_time_allowed: string;\n mode: string;\n objectives: CMIObjectives;\n progress_measure: string;\n scaled_passing_score: string;\n score: Scorm2004CMIScore;\n session_time: string;\n success_status: string;\n suspend_data: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n comments_from_learner: this.comments_from_learner,\n comments_from_lms: this.comments_from_lms,\n completion_status: this.completion_status,\n completion_threshold: this.completion_threshold,\n credit: this.credit,\n entry: this.entry,\n exit: this.exit,\n interactions: this.interactions,\n launch_data: this.launch_data,\n learner_id: this.learner_id,\n learner_name: this.learner_name,\n learner_preference: this.learner_preference,\n location: this.location,\n max_time_allowed: this.max_time_allowed,\n mode: this.mode,\n objectives: this.objectives,\n progress_measure: this.progress_measure,\n scaled_passing_score: this.scaled_passing_score,\n score: this.score,\n session_time: this.session_time,\n success_status: this.success_status,\n suspend_data: this.suspend_data,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","const ValidLanguages: string[] = [\n \"aa\",\n \"ab\",\n \"ae\",\n \"af\",\n \"ak\",\n \"am\",\n \"an\",\n \"ar\",\n \"as\",\n \"av\",\n \"ay\",\n \"az\",\n \"ba\",\n \"be\",\n \"bg\",\n \"bh\",\n \"bi\",\n \"bm\",\n \"bn\",\n \"bo\",\n \"br\",\n \"bs\",\n \"ca\",\n \"ce\",\n \"ch\",\n \"co\",\n \"cr\",\n \"cs\",\n \"cu\",\n \"cv\",\n \"cy\",\n \"da\",\n \"de\",\n \"dv\",\n \"dz\",\n \"ee\",\n \"el\",\n \"en\",\n \"eo\",\n \"es\",\n \"et\",\n \"eu\",\n \"fa\",\n \"ff\",\n \"fi\",\n \"fj\",\n \"fo\",\n \"fr\",\n \"fy\",\n \"ga\",\n \"gd\",\n \"gl\",\n \"gn\",\n \"gu\",\n \"gv\",\n \"ha\",\n \"he\",\n \"hi\",\n \"ho\",\n \"hr\",\n \"ht\",\n \"hu\",\n \"hy\",\n \"hz\",\n \"ia\",\n \"id\",\n \"ie\",\n \"ig\",\n \"ii\",\n \"ik\",\n \"io\",\n \"is\",\n \"it\",\n \"iu\",\n \"ja\",\n \"jv\",\n \"ka\",\n \"kg\",\n \"ki\",\n \"kj\",\n \"kk\",\n \"kl\",\n \"km\",\n \"kn\",\n \"ko\",\n \"kr\",\n \"ks\",\n \"ku\",\n \"kv\",\n \"kw\",\n \"ky\",\n \"la\",\n \"lb\",\n \"lg\",\n \"li\",\n \"ln\",\n \"lo\",\n \"lt\",\n \"lu\",\n \"lv\",\n \"mg\",\n \"mh\",\n \"mi\",\n \"mk\",\n \"ml\",\n \"mn\",\n \"mo\",\n \"mr\",\n \"ms\",\n \"mt\",\n \"my\",\n \"na\",\n \"nb\",\n \"nd\",\n \"ne\",\n \"ng\",\n \"nl\",\n \"nn\",\n \"no\",\n \"nr\",\n \"nv\",\n \"ny\",\n \"oc\",\n \"oj\",\n \"om\",\n \"or\",\n \"os\",\n \"pa\",\n \"pi\",\n \"pl\",\n \"ps\",\n \"pt\",\n \"qu\",\n \"rm\",\n \"rn\",\n \"ro\",\n \"ru\",\n \"rw\",\n \"sa\",\n \"sc\",\n \"sd\",\n \"se\",\n \"sg\",\n \"sh\",\n \"si\",\n \"sk\",\n \"sl\",\n \"sm\",\n \"sn\",\n \"so\",\n \"sq\",\n \"sr\",\n \"ss\",\n \"st\",\n \"su\",\n \"sv\",\n \"sw\",\n \"ta\",\n \"te\",\n \"tg\",\n \"th\",\n \"ti\",\n \"tk\",\n \"tl\",\n \"tn\",\n \"to\",\n \"tr\",\n \"ts\",\n \"tt\",\n \"tw\",\n \"ty\",\n \"ug\",\n \"uk\",\n \"ur\",\n \"uz\",\n \"ve\",\n \"vi\",\n \"vo\",\n \"wa\",\n \"wo\",\n \"xh\",\n \"yi\",\n \"yo\",\n \"za\",\n \"zh\",\n \"zu\",\n \"aar\",\n \"abk\",\n \"ave\",\n \"afr\",\n \"aka\",\n \"amh\",\n \"arg\",\n \"ara\",\n \"asm\",\n \"ava\",\n \"aym\",\n \"aze\",\n \"bak\",\n \"bel\",\n \"bul\",\n \"bih\",\n \"bis\",\n \"bam\",\n \"ben\",\n \"tib\",\n \"bod\",\n \"bre\",\n \"bos\",\n \"cat\",\n \"che\",\n \"cha\",\n \"cos\",\n \"cre\",\n \"cze\",\n \"ces\",\n \"chu\",\n \"chv\",\n \"wel\",\n \"cym\",\n \"dan\",\n \"ger\",\n \"deu\",\n \"div\",\n \"dzo\",\n \"ewe\",\n \"gre\",\n \"ell\",\n \"eng\",\n \"epo\",\n \"spa\",\n \"est\",\n \"baq\",\n \"eus\",\n \"per\",\n \"fas\",\n \"ful\",\n \"fin\",\n \"fij\",\n \"fao\",\n \"fre\",\n \"fra\",\n \"fry\",\n \"gle\",\n \"gla\",\n \"glg\",\n \"grn\",\n \"guj\",\n \"glv\",\n \"hau\",\n \"heb\",\n \"hin\",\n \"hmo\",\n \"hrv\",\n \"hat\",\n \"hun\",\n \"arm\",\n \"hye\",\n \"her\",\n \"ina\",\n \"ind\",\n \"ile\",\n \"ibo\",\n \"iii\",\n \"ipk\",\n \"ido\",\n \"ice\",\n \"isl\",\n \"ita\",\n \"iku\",\n \"jpn\",\n \"jav\",\n \"geo\",\n \"kat\",\n \"kon\",\n \"kik\",\n \"kua\",\n \"kaz\",\n \"kal\",\n \"khm\",\n \"kan\",\n \"kor\",\n \"kau\",\n \"kas\",\n \"kur\",\n \"kom\",\n \"cor\",\n \"kir\",\n \"lat\",\n \"ltz\",\n \"lug\",\n \"lim\",\n \"lin\",\n \"lao\",\n \"lit\",\n \"lub\",\n \"lav\",\n \"mlg\",\n \"mah\",\n \"mao\",\n \"mri\",\n \"mac\",\n \"mkd\",\n \"mal\",\n \"mon\",\n \"mol\",\n \"mar\",\n \"may\",\n \"msa\",\n \"mlt\",\n \"bur\",\n \"mya\",\n \"nau\",\n \"nob\",\n \"nde\",\n \"nep\",\n \"ndo\",\n \"dut\",\n \"nld\",\n \"nno\",\n \"nor\",\n \"nbl\",\n \"nav\",\n \"nya\",\n \"oci\",\n \"oji\",\n \"orm\",\n \"ori\",\n \"oss\",\n \"pan\",\n \"pli\",\n \"pol\",\n \"pus\",\n \"por\",\n \"que\",\n \"roh\",\n \"run\",\n \"rum\",\n \"ron\",\n \"rus\",\n \"kin\",\n \"san\",\n \"srd\",\n \"snd\",\n \"sme\",\n \"sag\",\n \"slo\",\n \"sin\",\n \"slk\",\n \"slv\",\n \"smo\",\n \"sna\",\n \"som\",\n \"alb\",\n \"sqi\",\n \"srp\",\n \"ssw\",\n \"sot\",\n \"sun\",\n \"swe\",\n \"swa\",\n \"tam\",\n \"tel\",\n \"tgk\",\n \"tha\",\n \"tir\",\n \"tuk\",\n \"tgl\",\n \"tsn\",\n \"ton\",\n \"tur\",\n \"tso\",\n \"tat\",\n \"twi\",\n \"tah\",\n \"uig\",\n \"ukr\",\n \"urd\",\n \"uzb\",\n \"ven\",\n \"vie\",\n \"vol\",\n \"wln\",\n \"wol\",\n \"xho\",\n \"yid\",\n \"yor\",\n \"zha\",\n \"chi\",\n \"zho\",\n \"zul\",\n];\nexport default ValidLanguages;\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\nimport { NAVBoolean } from \"../../constants/enums\";\n\n/**\n * Class representing SCORM 2004's adl object\n */\nexport class ADL extends BaseCMI {\n /**\n * Constructor for adl\n */\n constructor() {\n super();\n this.nav = new ADLNav();\n }\n\n public nav: ADLNav;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.nav?.initialize();\n }\n\n /**\n * toJSON for adl\n * @return {\n * {\n * nav: ADLNav\n * }\n * }\n */\n toJSON(): {\n nav: ADLNav;\n } {\n this.jsonString = true;\n const result = {\n nav: this.nav,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's `adl.nav` object\n */\n\nexport class ADLNav extends BaseCMI {\n private _request = \"_none_\";\n\n /**\n * Constructor for `adl.nav`\n */\n constructor() {\n super();\n this.request_valid = new ADLNavRequestValid();\n }\n\n public request_valid: ADLNavRequestValid;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.request_valid?.initialize();\n }\n\n /**\n * Getter for _request\n * @return {string}\n */\n get request(): string {\n return this._request;\n }\n\n /**\n * Setter for _request\n * @param {string} request\n */\n set request(request: string) {\n if (check2004ValidFormat(request, Regex.scorm2004.NAVEvent)) {\n this._request = request;\n }\n }\n\n /**\n * toJSON for adl.nav\n *\n * @return {\n * {\n * request: string\n * }\n * }\n */\n toJSON(): {\n request: string;\n } {\n this.jsonString = true;\n const result = {\n request: this.request,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's adl.nav.request_valid object\n */\n\nexport class ADLNavRequestValid extends BaseCMI {\n private _continue = \"unknown\";\n private _previous = \"unknown\";\n private _choice: {\n [key: string]: NAVBoolean;\n } = {};\n private _jump: {\n [key: string]: NAVBoolean;\n } = {};\n\n /**\n * Constructor for adl.nav.request_valid\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _continue\n * @return {string}\n */\n get continue(): string {\n return this._continue;\n }\n\n /**\n * Setter for _continue. Just throws an error.\n * @param {string} _continue\n */\n set continue(_continue: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (check2004ValidFormat(_continue, Regex.scorm2004.NAVBoolean)) {\n this._continue = _continue;\n }\n }\n\n /**\n * Getter for _previous\n * @return {string}\n */\n get previous(): string {\n return this._previous;\n }\n\n /**\n * Setter for _previous. Just throws an error.\n * @param {string} _previous\n */\n set previous(_previous: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (check2004ValidFormat(_previous, Regex.scorm2004.NAVBoolean)) {\n this._previous = _previous;\n }\n }\n\n /**\n * Getter for _choice\n * @return {{ [key: string]: NAVBoolean }}\n */\n get choice(): { [key: string]: NAVBoolean } {\n return this._choice;\n }\n\n /**\n * Setter for _choice\n * @param {{ [key: string]: string }} choice\n */\n set choice(choice: { [key: string]: string }) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (typeof choice !== \"object\") {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n for (const key in choice) {\n if ({}.hasOwnProperty.call(choice, key)) {\n if (\n check2004ValidFormat(choice[key], Regex.scorm2004.NAVBoolean) &&\n check2004ValidFormat(key, Regex.scorm2004.NAVTarget)\n ) {\n this._choice[key] =\n NAVBoolean[choice[key] as keyof typeof NAVBoolean];\n }\n }\n }\n }\n\n /**\n * Getter for _jump\n * @return {{ [key: string]: NAVBoolean }}\n */\n get jump(): { [key: string]: NAVBoolean } {\n return this._jump;\n }\n\n /**\n * Setter for _jump\n * @param {{ [key: string]: string }} jump\n */\n set jump(jump: { [key: string]: string }) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (typeof jump !== \"object\") {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n for (const key in jump) {\n if ({}.hasOwnProperty.call(jump, key)) {\n if (\n check2004ValidFormat(jump[key], Regex.scorm2004.NAVBoolean) &&\n check2004ValidFormat(key, Regex.scorm2004.NAVTarget)\n ) {\n this._jump[key] = NAVBoolean[jump[key] as keyof typeof NAVBoolean];\n }\n }\n }\n }\n\n /**\n * toJSON for adl.nav.request_valid\n *\n * @return {\n * {\n * previous: string,\n * continue: string\n * }\n * }\n */\n toJSON(): {\n previous: string;\n continue: string;\n } {\n this.jsonString = true;\n const result = {\n previous: this._previous,\n continue: this._continue,\n choice: this._choice,\n jump: this._jump,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import BaseAPI from \"./BaseAPI\";\nimport { CMI } from \"./cmi/scorm2004/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\nimport { CorrectResponses, ResponseType } from \"./constants/response_constants\";\nimport ValidLanguages from \"./constants/language_constants\";\nimport Regex from \"./constants/regex\";\nimport regex from \"./constants/regex\";\nimport { CMIArray } from \"./cmi/common/array\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm2004/interactions\";\nimport { CMICommentsObject } from \"./cmi/scorm2004/comments\";\nimport { CMIObjectivesObject } from \"./cmi/scorm2004/objectives\";\nimport { ADL } from \"./cmi/scorm2004/adl\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\n\n/**\n * API class for SCORM 2004\n */\nclass Scorm2004Impl extends BaseAPI {\n private _version: string = \"1.0\";\n\n /**\n * Constructor for SCORM 2004 API\n * @param {Settings} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm2004, settings);\n\n this.cmi = new CMI();\n this.adl = new ADL();\n\n // Rename functions to match 2004 Spec and expose to modules\n this.Initialize = this.lmsInitialize;\n this.Terminate = this.lmsFinish;\n this.GetValue = this.lmsGetValue;\n this.SetValue = this.lmsSetValue;\n this.Commit = this.lmsCommit;\n this.GetLastError = this.lmsGetLastError;\n this.GetErrorString = this.lmsGetErrorString;\n this.GetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public cmi: CMI;\n public adl: ADL;\n\n public Initialize: () => string;\n public Terminate: () => string;\n public GetValue: (CMIElement: string) => string;\n public SetValue: (CMIElement: string, value: any) => string;\n public Commit: () => string;\n public GetLastError: () => string;\n public GetErrorString: (CMIErrorCode: string | number) => string;\n public GetDiagnostic: (CMIErrorCode: string | number) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.adl = new ADL();\n }\n\n /**\n * Getter for _version\n * @return {string}\n */\n get version(): string {\n return this._version;\n }\n\n /**\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n return this.initialize(\"Initialize\");\n }\n\n /**\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"Terminate\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.adl.nav.request !== \"_none_\") {\n const navActions: { [key: string]: string } = {\n continue: \"SequenceNext\",\n previous: \"SequencePrevious\",\n choice: \"SequenceChoice\",\n jump: \"SequenceJump\",\n exit: \"SequenceExit\",\n exitAll: \"SequenceExitAll\",\n abandon: \"SequenceAbandon\",\n abandonAll: \"SequenceAbandonAll\",\n };\n\n let request = this.adl.nav.request;\n const choiceJumpRegex = new RegExp(regex.scorm2004.NAVEvent);\n const matches = request.match(choiceJumpRegex);\n let target = \"\";\n if (matches && matches.length > 2) {\n target = matches[2];\n request = matches[1].replace(target, \"\");\n }\n const action = navActions[request];\n if (action) {\n this.processListeners(action, \"adl.nav.request\", target);\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n const adlNavRequestRegex =\n \"^adl\\\\.nav\\\\.request_valid\\\\.(choice|jump)\\\\.{target=\\\\S{0,}([a-zA-Z0-9-_]+)}$\";\n if (stringMatches(CMIElement, adlNavRequestRegex)) {\n const matches = CMIElement.match(adlNavRequestRegex);\n const request = matches[1];\n const target = matches[2].replace(\"{target=\", \"\").replace(\"}\", \"\");\n if (request === \"choice\" || request === \"jump\") {\n if (this.settings.scoItemIdValidator) {\n return String(this.settings.scoItemIdValidator(target));\n }\n return String(this.settings.scoItemIds.includes(target));\n }\n }\n return this.getValue(\"GetValue\", true, CMIElement);\n }\n\n /**\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n return this.setValue(\"SetValue\", \"Commit\", true, CMIElement, value);\n }\n\n /**\n * Orders LMS to store all content parameters\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"Commit\");\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * Returns last error code\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"GetLastError\");\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string | number): string {\n return this.getErrorString(\"GetErrorString\", CMIErrorCode);\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string | number): string {\n return this.getDiagnostic(\"GetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"SetValue\", true, CMIElement, value);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {any} value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n }\n\n if (foundFirstIndex) {\n if (\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return this.createCorrectResponsesObject(CMIElement, value);\n } else if (\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsObjectivesObject();\n }\n } else if (stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")) {\n return new CMIInteractionsObject();\n }\n\n if (stringMatches(CMIElement, \"cmi\\\\.comments_from_learner\\\\.\\\\d+\")) {\n return new CMICommentsObject();\n } else if (stringMatches(CMIElement, \"cmi\\\\.comments_from_lms\\\\.\\\\d+\")) {\n return new CMICommentsObject(true);\n }\n\n return null;\n }\n\n private createCorrectResponsesObject(\n CMIElement: string,\n value: any,\n ): BaseCMI | null {\n const parts = CMIElement.split(\".\");\n const index = Number(parts[2]);\n const interaction = this.cmi.interactions.childArray[index];\n\n if (this.isInitialized()) {\n if (!interaction.type) {\n this.throwSCORMError(ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED);\n } else {\n this.checkDuplicateChoiceResponse(interaction, value);\n const response_type = CorrectResponses[interaction.type];\n if (response_type) {\n this.checkValidResponseType(response_type, value, interaction.type);\n } else {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Incorrect Response Type: \" + interaction.type,\n );\n }\n }\n }\n\n if (this.lastErrorCode === \"0\") {\n return new CMIInteractionsCorrectResponsesObject();\n }\n\n return null;\n }\n\n /**\n * Checks for valid response types\n * @param {object} response_type\n * @param {any} value\n * @param {string} interaction_type\n */\n checkValidResponseType(\n response_type: ResponseType,\n value: any,\n interaction_type: string,\n ) {\n let nodes = [];\n if (response_type?.delimiter) {\n nodes = String(value).split(response_type.delimiter);\n } else {\n nodes[0] = value;\n }\n\n if (nodes.length > 0 && nodes.length <= response_type.max) {\n this.checkCorrectResponseValue(interaction_type, nodes, value);\n } else if (nodes.length > response_type.max) {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Pattern Too Long\",\n );\n }\n }\n\n /**\n * Checks for duplicate 'choice' responses.\n * @param {CMIInteractionsObject} interaction\n * @param {any} value\n */\n checkDuplicateChoiceResponse(interaction: CMIInteractionsObject, value: any) {\n const interaction_count = interaction.correct_responses._count;\n if (interaction.type === \"choice\") {\n for (\n let i = 0;\n i < interaction_count && this.lastErrorCode === \"0\";\n i++\n ) {\n const response = interaction.correct_responses.childArray[i];\n if (response.pattern === value) {\n this.throwSCORMError(ErrorCodes.scorm2004.GENERAL_SET_FAILURE);\n }\n }\n }\n }\n\n /**\n * Validate correct response.\n * @param {string} CMIElement\n * @param {*} value\n */\n validateCorrectResponse(CMIElement: string, value: any) {\n const parts = CMIElement.split(\".\");\n const index = Number(parts[2]);\n const pattern_index = Number(parts[4]);\n const interaction = this.cmi.interactions.childArray[index];\n\n const interaction_count = interaction.correct_responses._count;\n this.checkDuplicateChoiceResponse(interaction, value);\n\n const response_type = CorrectResponses[interaction.type];\n if (\n typeof response_type.limit === \"undefined\" ||\n interaction_count <= response_type.limit\n ) {\n this.checkValidResponseType(response_type, value, interaction.type);\n\n if (\n (this.lastErrorCode === \"0\" &&\n (!response_type.duplicate ||\n !this.checkDuplicatedPattern(\n interaction.correct_responses,\n pattern_index,\n value,\n ))) ||\n (this.lastErrorCode === \"0\" && value === \"\")\n ) {\n // do nothing, we want the inverse\n } else {\n if (this.lastErrorCode === \"0\") {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Pattern Already Exists\",\n );\n }\n }\n } else {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Collection Limit Reached\",\n );\n }\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"GetValue\", true, CMIElement);\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {(string|number)} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: string | number,\n detail: boolean,\n ): string {\n let basicMessage = \"\";\n let detailMessage = \"\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm2004.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm2004.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm2004.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Check to see if a correct_response value has been duplicated\n * @param {CMIArray} correct_response\n * @param {number} current_index\n * @param {*} value\n * @return {boolean}\n */\n checkDuplicatedPattern(\n correct_response: CMIArray,\n current_index: number,\n value: any,\n ): boolean {\n let found = false;\n const count = correct_response._count;\n for (let i = 0; i < count && !found; i++) {\n if (i !== current_index && correct_response.childArray[i] === value) {\n found = true;\n }\n }\n return found;\n }\n\n /**\n * Checks for a valid correct_response value\n * @param {string} interaction_type\n * @param {Array} nodes\n * @param {*} value\n */\n checkCorrectResponseValue(\n interaction_type: string,\n nodes: Array,\n value: any,\n ) {\n const response = CorrectResponses[interaction_type];\n const formatRegex = new RegExp(response.format);\n for (let i = 0; i < nodes.length && this.lastErrorCode === \"0\"; i++) {\n if (\n interaction_type.match(\n \"^(fill-in|long-fill-in|matching|performance|sequencing)$\",\n )\n ) {\n nodes[i] = this.removeCorrectResponsePrefixes(nodes[i]);\n }\n\n if (response?.delimiter2) {\n const values = nodes[i].split(response.delimiter2);\n if (values.length === 2) {\n const matches = values[0].match(formatRegex);\n if (!matches) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n } else {\n if (\n !response.format2 ||\n !values[1].match(new RegExp(response.format2))\n ) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n } else {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n } else {\n const matches = nodes[i].match(formatRegex);\n if (\n (!matches && value !== \"\") ||\n (!matches && interaction_type === \"true-false\")\n ) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n } else {\n if (interaction_type === \"numeric\" && nodes.length > 1) {\n if (Number(nodes[0]) > Number(nodes[1])) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n } else {\n if (nodes[i] !== \"\" && response.unique) {\n for (let j = 0; j < i && this.lastErrorCode === \"0\"; j++) {\n if (nodes[i] === nodes[j]) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n }\n }\n }\n }\n }\n\n /**\n * Remove prefixes from correct_response\n * @param {string} node\n * @return {*}\n */\n removeCorrectResponsePrefixes(node: string): any {\n let seenOrder = false;\n let seenCase = false;\n let seenLang = false;\n\n const prefixRegex = new RegExp(\n \"^({(lang|case_matters|order_matters)=([^}]+)})\",\n );\n let matches = node.match(prefixRegex);\n let langMatches = null;\n while (matches) {\n switch (matches[2]) {\n case \"lang\":\n langMatches = node.match(Regex.scorm2004.CMILangcr);\n if (langMatches) {\n const lang = langMatches[3];\n if (lang !== undefined && lang.length > 0) {\n if (!ValidLanguages.includes(lang.toLowerCase())) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n seenLang = true;\n break;\n case \"case_matters\":\n if (!seenLang && !seenOrder && !seenCase) {\n if (matches[3] !== \"true\" && matches[3] !== \"false\") {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n\n seenCase = true;\n break;\n case \"order_matters\":\n if (!seenCase && !seenLang && !seenOrder) {\n if (matches[3] !== \"true\" && matches[3] !== \"false\") {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n\n seenOrder = true;\n break;\n }\n node = node.substring(matches[1].length);\n matches = node.match(prefixRegex);\n }\n\n return node;\n }\n\n /**\n * Replace the whole API with another\n * @param {Scorm2004Impl} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm2004Impl) {\n // Data Model\n this.cmi = newAPI.cmi;\n this.adl = newAPI.adl;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeDuration = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getDurationAsSeconds(\n totalTimeDuration,\n Regex.scorm2004.CMITimespan,\n );\n\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (this.cmi.completion_status) {\n if (this.cmi.completion_status === \"completed\") {\n completionStatus = CompletionStatus.completed;\n } else if (this.cmi.completion_status === \"incomplete\") {\n completionStatus = CompletionStatus.incomplete;\n }\n }\n if (this.cmi.success_status) {\n if (this.cmi.success_status === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (this.cmi.success_status === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n if (!Number.isNaN(Number.parseFloat(score.scaled))) {\n scoreObject.scaled = Number.parseFloat(score.scaled);\n }\n }\n\n const commitObject: CommitObject = {\n completionStatus: completionStatus,\n successStatus: successStatus,\n totalTimeSeconds: totalTimeSeconds,\n runtimeData: cmiExport,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n if (this.cmi.mode === \"normal\") {\n if (this.cmi.credit === \"credit\") {\n if (this.cmi.completion_threshold && this.cmi.progress_measure) {\n if (this.cmi.progress_measure >= this.cmi.completion_threshold) {\n this.cmi.completion_status = \"completed\";\n } else {\n this.cmi.completion_status = \"incomplete\";\n }\n }\n if (this.cmi.scaled_passing_score && this.cmi.score.scaled) {\n if (this.cmi.score.scaled >= this.cmi.scaled_passing_score) {\n this.cmi.success_status = \"passed\";\n } else {\n this.cmi.success_status = \"failed\";\n }\n }\n }\n }\n }\n\n let navRequest = false;\n if (\n this.adl.nav.request !== this.startingData?.adl?.nav?.request &&\n this.adl.nav.request !== \"_none_\"\n ) {\n this.adl.nav.request = encodeURIComponent(this.adl.nav.request);\n navRequest = true;\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n const result = await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n\n // check if this is a sequencing call, and then call the necessary JS\n {\n if (\n navRequest &&\n result.navRequest !== undefined &&\n result.navRequest !== \"\"\n ) {\n Function(`\"use strict\";(() => { ${result.navRequest} })()`)();\n }\n }\n return result;\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n\nexport { Scorm2004Impl };\n","import { BaseCMI } from \"./base_cmi\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.n objects\n */\nexport class CMIArray extends BaseCMI {\n private readonly _errorCode: number;\n private readonly _errorClass: typeof BaseScormValidationError;\n private readonly __children: string;\n childArray: any[];\n\n /**\n * Constructor cmi *.n arrays\n * @param {object} params\n */\n constructor(params: {\n children: string;\n errorCode?: number;\n errorClass?: typeof BaseScormValidationError;\n }) {\n super();\n this.__children = params.children;\n this._errorCode = params.errorCode || scorm12_error_codes.GENERAL;\n this._errorClass = params.errorClass || BaseScormValidationError;\n this.childArray = [];\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * Getter for _count\n * @return {number}\n */\n get _count(): number {\n return this.childArray.length;\n }\n\n /**\n * Setter for _count. Just throws an error.\n * @param {number} _count\n */\n set _count(_count: number) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * toJSON for *.n arrays\n * @return {object}\n */\n toJSON(): object {\n this.jsonString = true;\n const result: { [key: string]: any } = {};\n for (let i = 0; i < this.childArray.length; i++) {\n result[i + \"\"] = this.childArray[i];\n }\n delete this.jsonString;\n return result;\n }\n}\n","/**\n * Base class for API cmi objects\n */\nexport abstract class BaseCMI {\n jsonString? = false;\n private _initialized = false;\n private _start_time: number | undefined;\n\n /**\n * Getter for _initialized\n * @return {boolean}\n */\n get initialized(): boolean {\n return this._initialized;\n }\n\n /**\n * Getter for _start_time\n * @return {number | undefined}\n */\n get start_time(): number | undefined {\n return this._start_time;\n }\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize(): void {\n this._initialized = true;\n }\n\n /**\n * Called when the player should override the 'session_time' provided by\n * the module\n */\n setStartTime(): void {\n this._start_time = new Date().getTime();\n }\n}\n\n/**\n * Base class for cmi root objects\n */\nexport abstract class BaseRootCMI extends BaseCMI {\n abstract getCurrentTotalTime(): string;\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport { BaseCMI } from \"./base_cmi\";\nimport { checkValidFormat, checkValidRange } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nconst scorm12_constants = APIConstants.scorm12;\nconst scorm12_regex = Regex.scorm12;\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.score objects\n */\nexport class CMIScore extends BaseCMI {\n private readonly __children: string;\n private readonly __score_range: string | false;\n private readonly __invalid_error_code: number;\n private readonly __invalid_type_code: number;\n private readonly __invalid_range_code: number;\n private readonly __decimal_regex: string;\n private readonly __error_class: typeof BaseScormValidationError;\n private _raw = \"\";\n private _min = \"\";\n private _max: string;\n\n /**\n * Constructor for *.score\n * @param {\n * score_children: string,\n * score_range: string,\n * max: string,\n * invalidErrorCode: number,\n * invalidTypeCode: number,\n * invalidRangeCode: number,\n * decimalRegex: string,\n * errorClass: typeof BaseScormValidationError\n * } params\n */\n constructor(params: {\n score_children?: string;\n score_range?: string;\n max?: string;\n invalidErrorCode?: number;\n invalidTypeCode?: number;\n invalidRangeCode?: number;\n decimalRegex?: string;\n errorClass: typeof BaseScormValidationError;\n }) {\n super();\n\n this.__children = params.score_children || scorm12_constants.score_children;\n this.__score_range = !params.score_range\n ? false\n : scorm12_regex.score_range;\n this._max = params.max || params.max === \"\" ? params.max : \"100\";\n this.__invalid_error_code =\n params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE;\n this.__invalid_type_code =\n params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH;\n this.__invalid_range_code =\n params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE;\n this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;\n this.__error_class = params.errorClass;\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this.__error_class(this.__invalid_error_code);\n }\n\n /**\n * Getter for _raw\n * @return {string}\n */\n get raw(): string {\n return this._raw;\n }\n\n /**\n * Setter for _raw\n * @param {string} raw\n */\n set raw(raw: string) {\n if (\n checkValidFormat(\n raw,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n raw,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._raw = raw;\n }\n }\n\n /**\n * Getter for _min\n * @return {string}\n */\n get min(): string {\n return this._min;\n }\n\n /**\n * Setter for _min\n * @param {string} min\n */\n set min(min: string) {\n if (\n checkValidFormat(\n min,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n min,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._min = min;\n }\n }\n\n /**\n * Getter for _max\n * @return {string}\n */\n get max(): string {\n return this._max;\n }\n\n /**\n * Setter for _max\n * @param {string} max\n */\n set max(max: string) {\n if (\n checkValidFormat(\n max,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n max,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._max = max;\n }\n }\n\n /**\n * toJSON for *.score\n * @return {\n * {\n * min: string,\n * max: string,\n * raw: string\n * }\n * }\n */\n toJSON(): {\n min: string;\n max: string;\n raw: string;\n } {\n this.jsonString = true;\n const result = {\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseScormValidationError } from \"../../exceptions\";\n\n/**\n * Check if the value matches the proper format. If not, throw proper error code.\n *\n * @param {string} value\n * @param {string} regexPattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @param {boolean} [allowEmptyString]\n * @return {boolean}\n */\nexport function checkValidFormat(\n value: string,\n regexPattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n allowEmptyString?: boolean,\n): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n const formatRegex = new RegExp(regexPattern);\n const matches = value.match(formatRegex);\n if (allowEmptyString && value === \"\") {\n return true;\n }\n if (value === undefined || !matches || matches[0] === \"\") {\n throw new errorClass(errorCode);\n }\n return true;\n}\n\n/**\n * Check if the value matches the proper range. If not, throw proper error code.\n *\n * @param {any} value\n * @param {string} rangePattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @return {boolean}\n */\nexport function checkValidRange(\n value: any,\n rangePattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n): boolean {\n const ranges = rangePattern.split(\"#\");\n value = value * 1.0;\n if (value >= ranges[0]) {\n if (ranges[1] === \"*\" || value <= ranges[1]) {\n return true;\n } else {\n throw new errorClass(errorCode);\n }\n } else {\n throw new errorClass(errorCode);\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { check12ValidFormat } from \"../scorm12/validation\";\nimport * as Util from \"../../utilities\";\n\n/**\n * Class representing the `cmi.core` object\n * @extends BaseCMI\n */\nexport class CMICore extends BaseCMI {\n /**\n * Constructor for `cmi.core`\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private __children = APIConstants.scorm12.core_children;\n private _student_id = \"\";\n private _student_name = \"\";\n private _lesson_location = \"\";\n private _credit = \"\";\n private _lesson_status = \"not attempted\";\n private _entry = \"\";\n private _total_time = \"\";\n private _lesson_mode = \"normal\";\n private _exit = \"\";\n private _session_time = \"00:00:00\";\n private _suspend_data = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _student_id\n * @return {string}\n */\n get student_id(): string {\n return this._student_id;\n }\n\n /**\n * Setter for _student_id. Can only be called before initialization.\n * @param {string} student_id\n */\n set student_id(student_id: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_id = student_id;\n }\n }\n\n /**\n * Getter for _student_name\n * @return {string}\n */\n get student_name(): string {\n return this._student_name;\n }\n\n /**\n * Setter for _student_name. Can only be called before initialization.\n * @param {string} student_name\n */\n set student_name(student_name: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_name = student_name;\n }\n }\n\n /**\n * Getter for _lesson_location\n * @return {string}\n */\n get lesson_location(): string {\n return this._lesson_location;\n }\n\n /**\n * Setter for _lesson_location\n * @param {string} lesson_location\n */\n set lesson_location(lesson_location: string) {\n if (check12ValidFormat(lesson_location, Regex.scorm12.CMIString256, true)) {\n this._lesson_location = lesson_location;\n }\n }\n\n /**\n * Getter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (this.initialized) {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus)) {\n this._lesson_status = lesson_status;\n }\n } else {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Getter for _lesson_mode\n * @return {string}\n */\n get lesson_mode(): string {\n return this._lesson_mode;\n }\n\n /**\n * Setter for _lesson_mode. Can only be called before initialization.\n * @param {string} lesson_mode\n */\n set lesson_mode(lesson_mode: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._lesson_mode = lesson_mode;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._exit;\n }\n\n /**\n * Setter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check12ValidFormat(exit, Regex.scorm12.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check12ValidFormat(session_time, Regex.scorm12.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (check12ValidFormat(suspend_data, Regex.scorm12.CMIString4096, true)) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n * @param {number} start_time\n * @return {string}\n */\n getCurrentTotalTime(start_time: number | undefined): string {\n let sessionTime = this._session_time;\n const startTime = start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsHHMMSS(seconds / 1000);\n }\n\n return Util.addHHMMSSTimeStrings(\n this._total_time,\n sessionTime,\n new RegExp(Regex.scorm12.CMITimespan),\n );\n }\n\n /**\n * toJSON for cmi.core\n *\n * @return {\n * {\n * student_name: string,\n * entry: string,\n * exit: string,\n * score: CMIScore,\n * student_id: string,\n * lesson_mode: string,\n * lesson_location: string,\n * lesson_status: string,\n * credit: string,\n * session_time: string\n * }\n * }\n */\n toJSON(): {\n student_name: string;\n entry: string;\n exit: string;\n score: CMIScore;\n student_id: string;\n lesson_mode: string;\n lesson_location: string;\n lesson_status: string;\n credit: string;\n session_time: string;\n } {\n this.jsonString = true;\n const result = {\n student_id: this.student_id,\n student_name: this.student_name,\n lesson_location: this.lesson_location,\n credit: this.credit,\n lesson_status: this.lesson_status,\n entry: this.entry,\n lesson_mode: this.lesson_mode,\n exit: this.exit,\n session_time: this.session_time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat } from \"./validation\";\nimport { CMICore } from \"../aicc/core\";\nimport { CMIObjectives } from \"./objectives\";\nimport { CMIStudentData } from \"./student_data\";\nimport { CMIStudentPreference } from \"./student_preference\";\nimport { CMIInteractions } from \"./interactions\";\n\n/**\n * Class representing the cmi object for SCORM 1.2\n */\nexport class CMI extends BaseRootCMI {\n private readonly __children: string = \"\";\n private __version: string = \"3.4\";\n private _launch_data: string = \"\";\n private _comments: string = \"\";\n private _comments_from_lms: string = \"\";\n\n /**\n * Constructor for the SCORM 1.2 cmi object\n * @param {string} cmi_children\n * @param {(CMIStudentData|AICCCMIStudentData)} student_data\n * @param {boolean} initialized\n */\n constructor(\n cmi_children?: string,\n student_data?: CMIStudentData,\n initialized?: boolean,\n ) {\n super();\n if (initialized) this.initialize();\n this.__children = cmi_children\n ? cmi_children\n : APIConstants.scorm12.cmi_children;\n this.core = new CMICore();\n this.objectives = new CMIObjectives();\n this.student_data = student_data ? student_data : new CMIStudentData();\n this.student_preference = new CMIStudentPreference();\n this.interactions = new CMIInteractions();\n }\n\n public core: CMICore;\n public objectives: CMIObjectives;\n public student_data: CMIStudentData;\n public student_preference: CMIStudentPreference;\n public interactions: CMIInteractions;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.core?.initialize();\n this.objectives?.initialize();\n this.student_data?.initialize();\n this.student_preference?.initialize();\n this.interactions?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n interactions: CMIInteractions;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n interactions: this.interactions,\n };\n delete this.jsonString;\n return result;\n }\n\n /**\n * Getter for __version\n * @return {string}\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n */\n set _version(_version: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for __children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this.core?.suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (this.core) {\n this.core.suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _comments\n * @return {string}\n */\n get comments(): string {\n return this._comments;\n }\n\n /**\n * Setter for _comments\n * @param {string} comments\n */\n set comments(comments: string) {\n if (check12ValidFormat(comments, Regex.scorm12.CMIString4096, true)) {\n this._comments = comments;\n }\n }\n\n /**\n * Getter for _comments_from_lms\n * @return {string}\n */\n get comments_from_lms(): string {\n return this._comments_from_lms;\n }\n\n /**\n * Setter for _comments_from_lms. Can only be called before initialization.\n * @param {string} comments_from_lms\n */\n set comments_from_lms(comments_from_lms: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._comments_from_lms = comments_from_lms;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string}\n */\n getCurrentTotalTime(): string {\n return this.core.getCurrentTotalTime(this.start_time);\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 `cmi.interactions`\n * @extends CMIArray\n */\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.interactions`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.interactions_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n object\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.correct_responses_children,\n });\n }\n\n public readonly objectives: CMIArray;\n public readonly correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n private _id = \"\";\n private _time = \"\";\n private _type = \"\";\n private _weighting = \"\";\n private _student_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n\n /**\n * Getter for _id. Should only be called during JSON export.\n * @return {string}\n */\n get id(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _time. Should only be called during JSON export.\n * @return {string}\n */\n get time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (check12ValidFormat(time, Regex.scorm12.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _type. Should only be called during JSON export.\n * @return {string}\n */\n get type(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (check12ValidFormat(type, Regex.scorm12.CMIType)) {\n this._type = type;\n }\n }\n\n /**\n * Getter for _weighting. Should only be called during JSON export.\n * @return {string}\n */\n get weighting(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (\n check12ValidFormat(weighting, Regex.scorm12.CMIDecimal) &&\n check12ValidRange(weighting, Regex.scorm12.weighting_range)\n ) {\n this._weighting = weighting;\n }\n }\n\n /**\n * Getter for _student_response. Should only be called during JSON export.\n * @return {string}\n */\n get student_response(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._student_response;\n }\n\n /**\n * Setter for _student_response\n * @param {string} student_response\n */\n set student_response(student_response: string) {\n if (check12ValidFormat(student_response, Regex.scorm12.CMIFeedback, true)) {\n this._student_response = student_response;\n }\n }\n\n /**\n * Getter for _result. Should only be called during JSON export.\n * @return {string}\n */\n get result(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check12ValidFormat(result, Regex.scorm12.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency. Should only be called during JSON export.\n * @return {string}\n */\n get latency(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (check12ValidFormat(latency, Regex.scorm12.CMITimespan)) {\n this._latency = latency;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * time: string,\n * type: string,\n * weighting: string,\n * student_response: string,\n * result: string,\n * latency: string,\n * objectives: CMIArray,\n * correct_responses: CMIArray\n * }\n * }\n */\n toJSON(): {\n id: string;\n time: string;\n type: string;\n weighting: string;\n student_response: string;\n result: string;\n latency: string;\n objectives: CMIArray;\n correct_responses: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n time: this.time,\n type: this.type,\n weighting: this.weighting,\n student_response: this.student_response,\n result: this.result,\n latency: this.latency,\n objectives: this.objectives,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n private _id = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.correct_responses.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.correct_responses.n\n */\n constructor() {\n super();\n }\n\n private _pattern = \"\";\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check12ValidFormat(pattern, Regex.scorm12.CMIFeedback, true)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON for cmi.interactions.correct_responses.n\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this._pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {BaseCMI} from \"../common/base_cmi\";\nimport {check12ValidFormat} from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class for AICC Navigation object\n */\nexport class NAV extends BaseCMI {\n /**\n * Constructor for NAV object\n */\n constructor() {\n super();\n }\n\n private _event = \"\";\n\n /**\n * Getter for _event\n * @return {string}\n */\n get event(): string {\n return this._event;\n }\n\n /**\n * Setter for _event\n * @param {string} event\n */\n set event(event: string) {\n if (check12ValidFormat(event, Regex.scorm12.NAVEvent)) {\n this._event = event;\n }\n }\n\n /**\n * toJSON for nav object\n * @return {\n * {\n * event: string\n * }\n * }\n */\n toJSON(): {\n event: string;\n } {\n this.jsonString = true;\n const result = {\n event: this.event,\n };\n delete this.jsonString;\n return result;\n }\n}","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\nimport {check12ValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class representing SCORM 1.2's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.objectives_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n private _id = \"\";\n private _status = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (check12ValidFormat(status, Regex.scorm12.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n * @return {\n * {\n * id: string,\n * status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n status: this.status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_data object\n * @extends BaseCMI\n */\nexport class CMIStudentData extends BaseCMI {\n private readonly __children;\n private _mastery_score = \"\";\n private _max_time_allowed = \"\";\n private _time_limit_action = \"\";\n\n /**\n * Constructor for cmi.student_data\n * @param {string} student_data_children\n */\n constructor(student_data_children?: string) {\n super();\n this.__children = student_data_children\n ? student_data_children\n : APIConstants.scorm12.student_data_children;\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _master_score\n * @return {string}\n */\n get mastery_score(): string {\n return this._mastery_score;\n }\n\n /**\n * Setter for _master_score. Can only be called before initialization.\n * @param {string} mastery_score\n */\n set mastery_score(mastery_score: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._mastery_score = mastery_score;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * toJSON for cmi.student_data\n *\n * @return {\n * {\n * max_time_allowed: string,\n * time_limit_action: string,\n * mastery_score: string\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_preference object\n * @extends BaseCMI\n */\nexport class CMIStudentPreference extends BaseCMI {\n private readonly __children;\n\n /**\n * Constructor for cmi.student_preference\n * @param {string} student_preference_children\n */\n constructor(student_preference_children?: string) {\n super();\n this.__children = student_preference_children\n ? student_preference_children\n : APIConstants.scorm12.student_preference_children;\n }\n\n private _audio = \"\";\n private _language = \"\";\n private _speed = \"\";\n private _text = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _audio\n * @return {string}\n */\n get audio(): string {\n return this._audio;\n }\n\n /**\n * Setter for _audio\n * @param {string} audio\n */\n set audio(audio: string) {\n if (\n check12ValidFormat(audio, Regex.scorm12.CMISInteger) &&\n check12ValidRange(audio, Regex.scorm12.audio_range)\n ) {\n this._audio = audio;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check12ValidFormat(language, Regex.scorm12.CMIString256)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _speed\n * @return {string}\n */\n get speed(): string {\n return this._speed;\n }\n\n /**\n * Setter for _speed\n * @param {string} speed\n */\n set speed(speed: string) {\n if (\n check12ValidFormat(speed, Regex.scorm12.CMISInteger) &&\n check12ValidRange(speed, Regex.scorm12.speed_range)\n ) {\n this._speed = speed;\n }\n }\n\n /**\n * Getter for _text\n * @return {string}\n */\n get text(): string {\n return this._text;\n }\n\n /**\n * Setter for _text\n * @param {string} text\n */\n set text(text: string) {\n if (\n check12ValidFormat(text, Regex.scorm12.CMISInteger) &&\n check12ValidRange(text, Regex.scorm12.text_range)\n ) {\n this._text = text;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n speed: string;\n text: string;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n speed: this.speed,\n text: this.text,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {checkValidFormat, checkValidRange} from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm12.TYPE_MISMATCH,\n Scorm12ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidRange(\n value: any,\n rangePattern: string,\n allowEmptyString?: boolean,\n): boolean {\n if (!allowEmptyString && value === \"\") {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.VALUE_OUT_OF_RANGE);\n }\n\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n Scorm12ValidationError,\n );\n}","interface ErrorDescription {\n basicMessage: string;\n detailMessage: string;\n}\n\ninterface ErrorDescriptions {\n [key: string]: ErrorDescription;\n}\n\ninterface ScormConstants {\n cmi_children: string;\n core_children: string;\n score_children: string;\n comments_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface AiccConstants extends ScormConstants {\n student_demographics_children: string;\n tries_children: string;\n attempt_records_children: string;\n paths_children: string;\n}\n\ninterface Scorm2004Constants {\n cmi_children: string;\n comments_children: string;\n score_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface GlobalConstants {\n SCORM_TRUE: string;\n SCORM_FALSE: string;\n STATE_NOT_INITIALIZED: number;\n STATE_INITIALIZED: number;\n STATE_TERMINATED: number;\n LOG_LEVEL_DEBUG: number;\n LOG_LEVEL_INFO: number;\n LOG_LEVEL_WARNING: number;\n LOG_LEVEL_ERROR: number;\n LOG_LEVEL_NONE: number;\n}\n\ninterface APIConstants {\n global: GlobalConstants;\n scorm12: ScormConstants;\n aicc: AiccConstants;\n scorm2004: Scorm2004Constants;\n}\n\nconst global: GlobalConstants = {\n SCORM_TRUE: \"true\",\n SCORM_FALSE: \"false\",\n STATE_NOT_INITIALIZED: 0,\n STATE_INITIALIZED: 1,\n STATE_TERMINATED: 2,\n LOG_LEVEL_DEBUG: 1,\n LOG_LEVEL_INFO: 2,\n LOG_LEVEL_WARNING: 3,\n LOG_LEVEL_ERROR: 4,\n LOG_LEVEL_NONE: 5,\n};\n\nconst scorm12: ScormConstants = {\n // Children lists\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions\",\n core_children:\n \"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time\",\n score_children: \"raw,min,max\",\n comments_children: \"content,location,time\",\n objectives_children: \"id,score,status\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children: \"audio,language,speed,text\",\n interactions_children:\n \"id,objectives,time,type,correct_responses,weighting,student_response,result,latency\",\n error_descriptions: {\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information\",\n },\n \"201\": {\n basicMessage: \"Invalid argument error\",\n detailMessage:\n \"Indicates that an argument represents an invalid data model element or is otherwise incorrect.\",\n },\n \"202\": {\n basicMessage: \"Element cannot have children\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_children\" for a data model element that does not support the \"_children\" suffix.',\n },\n \"203\": {\n basicMessage: \"Element not an array - cannot have count\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_count\" for a data model element that does not support the \"_count\" suffix.',\n },\n \"301\": {\n basicMessage: \"Not initialized\",\n detailMessage:\n \"Indicates that an API call was made before the call to lmsInitialize.\",\n },\n \"401\": {\n basicMessage: \"Not implemented error\",\n detailMessage:\n \"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.\",\n },\n \"402\": {\n basicMessage: \"Invalid set value, element is a keyword\",\n detailMessage:\n 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in \"_children\" and \"_count\").',\n },\n \"403\": {\n basicMessage: \"Element is read only\",\n detailMessage:\n \"LMSSetValue was called with a data model element that can only be read.\",\n },\n \"404\": {\n basicMessage: \"Element is write only\",\n detailMessage:\n \"LMSGetValue was called on a data model element that can only be written to.\",\n },\n \"405\": {\n basicMessage: \"Incorrect Data Type\",\n detailMessage:\n \"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst aicc: AiccConstants = {\n ...scorm12,\n ...{\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation\",\n student_preference_children:\n \"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows\",\n student_data_children:\n \"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action\",\n student_demographics_children:\n \"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience\",\n tries_children: \"time,status,score\",\n attempt_records_children: \"score,lesson_status\",\n paths_children: \"location_id,date,time,status,why_left,time_in_element\",\n },\n};\nconst scorm2004: Scorm2004Constants = {\n // Children lists\n cmi_children:\n \"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time\",\n comments_children: \"comment,timestamp,location\",\n score_children: \"max,raw,scaled,min\",\n objectives_children:\n \"progress_measure,completion_status,success_status,description,score,id\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children:\n \"audio_level,audio_captioning,delivery_speed,language\",\n interactions_children:\n \"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description\",\n error_descriptions: {\n \"0\": {\n basicMessage: \"No Error\",\n detailMessage: \"No error occurred, the previous API call was successful.\",\n },\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use GetDiagnostic for more information.\",\n },\n \"102\": {\n basicMessage: \"General Initialization Failure\",\n detailMessage: \"Call to Initialize failed for an unknown reason.\",\n },\n \"103\": {\n basicMessage: \"Already Initialized\",\n detailMessage:\n \"Call to Initialize failed because Initialize was already called.\",\n },\n \"104\": {\n basicMessage: \"Content Instance Terminated\",\n detailMessage:\n \"Call to Initialize failed because Terminate was already called.\",\n },\n \"111\": {\n basicMessage: \"General Termination Failure\",\n detailMessage: \"Call to Terminate failed for an unknown reason.\",\n },\n \"112\": {\n basicMessage: \"Termination Before Initialization\",\n detailMessage:\n \"Call to Terminate failed because it was made before the call to Initialize.\",\n },\n \"113\": {\n basicMessage: \"Termination After Termination\",\n detailMessage:\n \"Call to Terminate failed because Terminate was already called.\",\n },\n \"122\": {\n basicMessage: \"Retrieve Data Before Initialization\",\n detailMessage:\n \"Call to GetValue failed because it was made before the call to Initialize.\",\n },\n \"123\": {\n basicMessage: \"Retrieve Data After Termination\",\n detailMessage:\n \"Call to GetValue failed because it was made after the call to Terminate.\",\n },\n \"132\": {\n basicMessage: \"Store Data Before Initialization\",\n detailMessage:\n \"Call to SetValue failed because it was made before the call to Initialize.\",\n },\n \"133\": {\n basicMessage: \"Store Data After Termination\",\n detailMessage:\n \"Call to SetValue failed because it was made after the call to Terminate.\",\n },\n \"142\": {\n basicMessage: \"Commit Before Initialization\",\n detailMessage:\n \"Call to Commit failed because it was made before the call to Initialize.\",\n },\n \"143\": {\n basicMessage: \"Commit After Termination\",\n detailMessage:\n \"Call to Commit failed because it was made after the call to Terminate.\",\n },\n \"201\": {\n basicMessage: \"General Argument Error\",\n detailMessage:\n \"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.\",\n },\n \"301\": {\n basicMessage: \"General Get Failure\",\n detailMessage:\n \"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"351\": {\n basicMessage: \"General Set Failure\",\n detailMessage:\n \"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"391\": {\n basicMessage: \"General Commit Failure\",\n detailMessage:\n \"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"401\": {\n basicMessage: \"Undefined Data Model Element\",\n detailMessage:\n \"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.\",\n },\n \"402\": {\n basicMessage: \"Unimplemented Data Model Element\",\n detailMessage:\n \"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.\",\n },\n \"403\": {\n basicMessage: \"Data Model Element Value Not Initialized\",\n detailMessage:\n \"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.\",\n },\n \"404\": {\n basicMessage: \"Data Model Element Is Read Only\",\n detailMessage:\n \"SetValue was called with a data model element that can only be read.\",\n },\n \"405\": {\n basicMessage: \"Data Model Element Is Write Only\",\n detailMessage:\n \"GetValue was called on a data model element that can only be written to.\",\n },\n \"406\": {\n basicMessage: \"Data Model Element Type Mismatch\",\n detailMessage:\n \"SetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Data Model Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst APIConstants: APIConstants = {\n global: global,\n scorm12: scorm12,\n aicc: aicc,\n scorm2004: scorm2004,\n};\nexport default APIConstants;\n","export enum NAVBoolean {\n unknown = \"unknown\",\n true = \"true\",\n false = \"false\",\n}\n\nexport enum SuccessStatus {\n passed = \"passed\",\n failed = \"failed\",\n unknown = \"unknown\",\n}\n\nexport enum CompletionStatus {\n completed = \"completed\",\n incomplete = \"incomplete\",\n unknown = \"unknown\",\n}\n","export type ErrorCode = {\n [key: string]: number;\n};\n\nconst global: ErrorCode = {\n GENERAL: 101,\n INITIALIZATION_FAILED: 101,\n INITIALIZED: 101,\n TERMINATED: 101,\n TERMINATION_FAILURE: 101,\n TERMINATION_BEFORE_INIT: 101,\n MULTIPLE_TERMINATION: 101,\n RETRIEVE_BEFORE_INIT: 101,\n RETRIEVE_AFTER_TERM: 101,\n STORE_BEFORE_INIT: 101,\n STORE_AFTER_TERM: 101,\n COMMIT_BEFORE_INIT: 101,\n COMMIT_AFTER_TERM: 101,\n ARGUMENT_ERROR: 101,\n CHILDREN_ERROR: 101,\n COUNT_ERROR: 101,\n GENERAL_GET_FAILURE: 101,\n GENERAL_SET_FAILURE: 101,\n GENERAL_COMMIT_FAILURE: 101,\n UNDEFINED_DATA_MODEL: 101,\n UNIMPLEMENTED_ELEMENT: 101,\n VALUE_NOT_INITIALIZED: 101,\n INVALID_SET_VALUE: 101,\n READ_ONLY_ELEMENT: 101,\n WRITE_ONLY_ELEMENT: 101,\n TYPE_MISMATCH: 101,\n VALUE_OUT_OF_RANGE: 101,\n DEPENDENCY_NOT_ESTABLISHED: 101,\n};\n\nconst scorm12: ErrorCode = {\n ...global,\n RETRIEVE_BEFORE_INIT: 301,\n STORE_BEFORE_INIT: 301,\n COMMIT_BEFORE_INIT: 301,\n ARGUMENT_ERROR: 201,\n CHILDREN_ERROR: 202,\n COUNT_ERROR: 203,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 401,\n VALUE_NOT_INITIALIZED: 301,\n INVALID_SET_VALUE: 402,\n READ_ONLY_ELEMENT: 403,\n WRITE_ONLY_ELEMENT: 404,\n TYPE_MISMATCH: 405,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst scorm2004: ErrorCode = {\n ...global,\n INITIALIZATION_FAILED: 102,\n INITIALIZED: 103,\n TERMINATED: 104,\n TERMINATION_FAILURE: 111,\n TERMINATION_BEFORE_INIT: 112,\n MULTIPLE_TERMINATIONS: 113,\n RETRIEVE_BEFORE_INIT: 122,\n RETRIEVE_AFTER_TERM: 123,\n STORE_BEFORE_INIT: 132,\n STORE_AFTER_TERM: 133,\n COMMIT_BEFORE_INIT: 142,\n COMMIT_AFTER_TERM: 143,\n ARGUMENT_ERROR: 201,\n GENERAL_GET_FAILURE: 301,\n GENERAL_SET_FAILURE: 351,\n GENERAL_COMMIT_FAILURE: 391,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 402,\n VALUE_NOT_INITIALIZED: 403,\n READ_ONLY_ELEMENT: 404,\n WRITE_ONLY_ELEMENT: 405,\n TYPE_MISMATCH: 406,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst ErrorCodes = {\n scorm12,\n scorm2004,\n};\n\nexport default ErrorCodes;\n","const scorm12 = {\n CMIString256: \"^.{0,255}$\",\n CMIString4096: \"^.{0,4096}$\",\n CMITime: \"^(?:[01]\\\\d|2[0123]):(?:[012345]\\\\d):(?:[012345]\\\\d)$\",\n CMITimespan: \"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$\",\n\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{0,3})(.[0-9]*)?$\",\n\n CMIIdentifier: \"^[\\\\u0021-\\\\u007E\\\\s]{0,255}$\",\n CMIFeedback: \"^.{0,255}$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n // Vocabulary Data Type Definition\n CMIStatus: \"^(passed|completed|failed|incomplete|browsed)$\",\n CMIStatus2: \"^(passed|completed|failed|incomplete|browsed|not attempted)$\",\n CMIExit: \"^(time-out|suspend|logout|)$\",\n CMIType:\n \"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$\",\n CMIResult:\n \"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\\\.[0-9]*)?)$\",\n NAVEvent: \"^(previous|continue)$\",\n // Data ranges\n score_range: \"0#100\",\n audio_range: \"-1#100\",\n speed_range: \"-100#100\",\n weighting_range: \"-100#100\",\n text_range: \"-1#1\",\n};\nconst aicc = {\n ...scorm12,\n ...{\n CMIIdentifier: \"^\\\\w{1,255}$\",\n },\n};\nconst scorm2004 = {\n CMIString200: \"^[\\\\u0000-\\\\uFFFF]{0,200}$\",\n CMIString250: \"^[\\\\u0000-\\\\uFFFF]{0,250}$\",\n CMIString1000: \"^[\\\\u0000-\\\\uFFFF]{0,1000}$\",\n CMIString4000: \"^[\\\\u0000-\\\\uFFFF]{0,4000}$\",\n CMIString64000: \"^[\\\\u0000-\\\\uFFFF]{0,64000}$\",\n CMILang: \"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$\",\n\n CMILangString250:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$\",\n\n CMILangcr: \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$\",\n\n CMILangString250cr:\n \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$\",\n\n CMILangString4000:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$\",\n\n CMITime:\n \"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$\",\n CMITimespan:\n \"^P(?:([.,\\\\d]+)Y)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)W)?(?:([.,\\\\d]+)D)?(?:T?(?:([.,\\\\d]+)H)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)S)?)?$\",\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{1,5})(\\\\.[0-9]{1,18})?$\",\n CMIIdentifier: \"^\\\\S{1,250}[a-zA-Z0-9]$\",\n CMIShortIdentifier: \"^[\\\\w\\\\.\\\\-\\\\_]{1,250}$\",\n CMILongIdentifier:\n \"^(?:(?!urn:)\\\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\\\S{1,4000}|.{1,4000})$\",\n // need to re-examine this\n CMIFeedback: \"^.*$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n CMIIndexStore: \".N(\\\\d+).\",\n // Vocabulary Data Type Definition\n CMICStatus: \"^(completed|incomplete|not attempted|unknown)$\",\n CMISStatus: \"^(passed|failed|unknown)$\",\n CMIExit: \"^(time-out|suspend|logout|normal)$\",\n CMIType:\n \"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$\",\n CMIResult:\n \"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\\\.[0-9]{1,18})?)$\",\n NAVEvent:\n \"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?jump)$\",\n\n NAVBoolean: \"^(unknown|true|false$)\",\n NAVTarget: \"^{target=\\\\S{0,}[a-zA-Z0-9-_]+}$\",\n // Data ranges\n scaled_range: \"-1#1\",\n audio_range: \"0#*\",\n speed_range: \"0#*\",\n text_range: \"-1#1\",\n progress_range: \"0#1\",\n};\nconst Regex = {\n aicc: aicc,\n scorm12: scorm12,\n scorm2004: scorm2004,\n};\nexport default Regex;\n","import APIConstants from \"./constants/api_constants\";\n\nconst scorm12_errors = APIConstants.scorm12.error_descriptions;\nconst aicc_errors = APIConstants.aicc.error_descriptions;\nconst scorm2004_errors = APIConstants.scorm2004.error_descriptions;\n\ntype APIError = {\n errorCode: number;\n errorMessage: string;\n detailedMessage: string;\n};\n\nexport class BaseScormValidationError extends Error {\n constructor(errorCode: number) {\n super(errorCode.toString());\n this._errorCode = errorCode;\n this.name = \"ScormValidationError\";\n }\n\n private readonly _errorCode: number;\n\n /**\n * Getter for _errorCode\n * @return {number}\n */\n get errorCode(): number {\n return this._errorCode;\n }\n\n setMessage(message: string) {\n this.message = message;\n }\n}\n\n/**\n * Base Validation Exception\n */\nexport class ValidationError\n extends BaseScormValidationError\n implements APIError\n{\n /**\n * Constructor to take in an error message and code\n * @param {number} errorCode\n * @param {string} errorMessage\n * @param {string} detailedMessage\n */\n constructor(\n errorCode: number,\n errorMessage: string,\n detailedMessage?: string,\n ) {\n super(errorCode);\n this.setMessage(errorMessage);\n this._errorMessage = errorMessage;\n if (detailedMessage) {\n this._detailedMessage = detailedMessage;\n }\n }\n\n private readonly _errorMessage: string;\n private readonly _detailedMessage: string = \"\";\n\n /**\n * Getter for _errorMessage\n * @return {string}\n */\n get errorMessage(): string {\n return this._errorMessage;\n }\n\n /**\n * Getter for _detailedMessage\n * @return {string}\n */\n get detailedMessage(): string {\n return this._detailedMessage;\n }\n}\n\n/**\n * SCORM 1.2 Validation Error\n */\nexport class Scorm12ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {\n super(\n errorCode,\n scorm12_errors[String(errorCode)].basicMessage,\n scorm12_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm12_errors[\"101\"].basicMessage,\n scorm12_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * AICC Validation Error\n */\nexport class AICCValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {\n super(\n errorCode,\n aicc_errors[String(errorCode)].basicMessage,\n aicc_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n aicc_errors[\"101\"].basicMessage,\n aicc_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * SCORM 2004 Validation Error\n */\nexport class Scorm2004ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {\n super(\n errorCode,\n scorm2004_errors[String(errorCode)].basicMessage,\n scorm2004_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm2004_errors[\"101\"].basicMessage,\n scorm2004_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n","export const SECONDS_PER_SECOND = 1.0;\nexport const SECONDS_PER_MINUTE = 60;\nexport const SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;\nexport const SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR;\n\ntype Designation = {\n [key: string]: number;\n};\n\ntype StringKeyMap = {\n [key: string]: any;\n};\n\nconst designations: Designation = {\n D: SECONDS_PER_DAY,\n H: SECONDS_PER_HOUR,\n M: SECONDS_PER_MINUTE,\n S: SECONDS_PER_SECOND,\n};\n\n/**\n * Converts a Number to a String of HH:MM:SS\n *\n * @param {number} totalSeconds\n * @return {string}\n */\nexport function getSecondsAsHHMMSS(totalSeconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!totalSeconds || totalSeconds <= 0) {\n return \"00:00:00\";\n }\n\n const hours = Math.floor(totalSeconds / SECONDS_PER_HOUR);\n const dateObj = new Date(totalSeconds * 1000);\n const minutes = dateObj.getUTCMinutes();\n // make sure we add any possible decimal value\n const seconds = dateObj.getSeconds();\n const ms = totalSeconds % 1.0;\n let msStr = \"\";\n\n if (countDecimals(ms) > 0) {\n if (countDecimals(ms) > 2) {\n msStr = ms.toFixed(2);\n } else {\n msStr = String(ms);\n }\n\n msStr = \".\" + msStr.split(\".\")[1];\n }\n\n return (\n (hours + \":\" + minutes + \":\" + seconds).replace(/\\b\\d\\b/g, \"0$&\") + msStr\n );\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {number} seconds\n * @return {string}\n */\nexport function getSecondsAsISODuration(seconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!seconds || seconds <= 0) {\n return \"PT0S\";\n }\n\n let duration = \"P\";\n let remainder = seconds;\n for (const designationsKey in designations) {\n const current_seconds = designations[designationsKey];\n let value = Math.floor(remainder / current_seconds);\n remainder = remainder % current_seconds;\n\n if (countDecimals(remainder) > 2) {\n remainder = Number(Number(remainder).toFixed(2));\n }\n\n // If we have anything left in the remainder, and we're currently adding\n // seconds to the duration, go ahead and add the decimal to the seconds\n if (designationsKey === \"S\" && remainder > 0) {\n value += remainder;\n }\n\n if (value) {\n if (\n (duration.indexOf(\"D\") > 0 ||\n designationsKey === \"H\" ||\n designationsKey === \"M\" ||\n designationsKey === \"S\") &&\n duration.indexOf(\"T\") === -1\n ) {\n duration += \"T\";\n }\n\n duration += `${value}${designationsKey}`;\n }\n }\n return duration;\n}\n\n/**\n * Calculate the number of seconds from HH:MM:SS.DDDDDD\n *\n * @param {string} timeString\n * @param {RegExp} timeRegex\n * @return {number}\n */\nexport function getTimeAsSeconds(\n timeString: string | number | boolean | null,\n timeRegex: RegExp | string,\n): number {\n if (typeof timeString === \"number\" || typeof timeString === \"boolean\") {\n timeString = String(timeString);\n }\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n if (!timeString || !timeString.match(timeRegex)) {\n return 0;\n }\n\n const parts = timeString.split(\":\");\n const hours = Number(parts[0]);\n const minutes = Number(parts[1]);\n const seconds = Number(parts[2]);\n return hours * 3600 + minutes * 60 + seconds;\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {string} duration\n * @param {RegExp} durationRegex\n * @return {number}\n */\nexport function getDurationAsSeconds(\n duration: string | null,\n durationRegex: RegExp | string,\n): number {\n if (typeof durationRegex === \"string\") {\n durationRegex = new RegExp(durationRegex);\n }\n\n if (!duration || !duration.match(durationRegex)) {\n return 0;\n }\n\n const [, years, _, , days, hours, minutes, seconds] =\n new RegExp(durationRegex).exec(duration) || [];\n let result = 0.0;\n result += Number(seconds) || 0.0;\n result += Number(minutes) * 60.0 || 0.0;\n result += Number(hours) * 3600.0 || 0.0;\n result += Number(days) * (60 * 60 * 24.0) || 0.0;\n result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0;\n return result;\n}\n\n/**\n * Adds together two ISO8601 Duration strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp|string} durationRegex\n * @return {string}\n */\nexport function addTwoDurations(\n first: string,\n second: string,\n durationRegex: RegExp | string,\n): string {\n const regex: RegExp =\n typeof durationRegex === \"string\"\n ? new RegExp(durationRegex)\n : durationRegex;\n return getSecondsAsISODuration(\n getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex),\n );\n}\n\n/**\n * Add together two HH:MM:SS.DD strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp} timeRegex\n * @return {string}\n */\nexport function addHHMMSSTimeStrings(\n first: string,\n second: string,\n timeRegex: RegExp | string,\n): string {\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n return getSecondsAsHHMMSS(\n getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex),\n );\n}\n\n/**\n * Flatten a JSON object down to string paths for each values\n * @param {object} data\n * @return {object}\n */\nexport function flatten(data: StringKeyMap): object {\n const result: StringKeyMap = {};\n\n /**\n * Recurse through the object\n * @param {*} cur\n * @param {*} prop\n */\n function recurse(cur: any, prop: any) {\n if (Object(cur) !== cur) {\n result[prop] = cur;\n } else if (Array.isArray(cur)) {\n for (let i = 0, l = cur.length; i < l; i++) {\n recurse(cur[i], prop + \"[\" + i + \"]\");\n if (l === 0) result[prop] = [];\n }\n } else {\n let isEmpty = true;\n\n for (const p in cur) {\n if ({}.hasOwnProperty.call(cur, p)) {\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p);\n }\n }\n\n if (isEmpty && prop) result[prop] = {};\n }\n }\n\n recurse(data, \"\");\n return result;\n}\n\n/**\n * Un-flatten a flat JSON object\n * @param {object} data\n * @return {object}\n */\nexport function unflatten(data: StringKeyMap): object {\n \"use strict\";\n\n if (Object(data) !== data || Array.isArray(data)) return data;\n const regex = /\\.?([^.[\\]]+)|\\[(\\d+)]/g;\n const result: StringKeyMap = {};\n\n for (const p in data) {\n if ({}.hasOwnProperty.call(data, p)) {\n let cur = result;\n let prop = \"\";\n let m = regex.exec(p);\n\n while (m) {\n cur = cur[prop] || (cur[prop] = m[2] ? [] : {});\n prop = m[2] || m[1];\n m = regex.exec(p);\n }\n\n cur[prop] = data[p];\n }\n }\n\n return result[\"\"] || result;\n}\n\n/**\n * Counts the number of decimal places\n * @param {number} num\n * @return {number}\n */\nexport function countDecimals(num: number): number {\n if (Math.floor(num) === num || String(num).indexOf(\".\") < 0) return 0;\n const parts = num.toString().split(\".\")[1];\n return parts.length || 0;\n}\n\n/**\n * Formats the SCORM messages for easy reading\n *\n * @param {string} functionName\n * @param {string} message\n * @param {string} CMIElement\n * @return {string}\n */\nexport function formatMessage(\n functionName: string,\n message: string,\n CMIElement?: string,\n): string {\n const baseLength = 20;\n let messageString = \"\";\n\n messageString += functionName;\n\n let fillChars = baseLength - messageString.length;\n\n for (let i = 0; i < fillChars; i++) {\n messageString += \" \";\n }\n\n messageString += \": \";\n\n if (CMIElement) {\n const CMIElementBaseLength = 70;\n\n messageString += CMIElement;\n\n fillChars = CMIElementBaseLength - messageString.length;\n\n for (let j = 0; j < fillChars; j++) {\n messageString += \" \";\n }\n }\n\n if (message) {\n messageString += message;\n }\n\n return messageString;\n}\n\n/**\n * Checks to see if {str} contains {tester}\n *\n * @param {string} str String to check against\n * @param {string} tester String to check for\n * @return {boolean}\n */\nexport function stringMatches(str: string, tester: string): boolean {\n return str?.match(tester) !== null;\n}\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","import { AICCImpl } from \"./AICC\";\nimport { Scorm12Impl } from \"./Scorm12API\";\nimport { Scorm2004Impl } from \"./Scorm2004API\";\n\nconst Scorm12API = Scorm12Impl;\nconst Scorm2004API = Scorm2004Impl;\nconst AICC = AICCImpl;\n\nexport { Scorm12API, Scorm2004API, AICC };\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/dist/esm/scorm-again.min.js b/dist/esm/scorm-again.min.js new file mode 100644 index 0000000..a28c60c --- /dev/null +++ b/dist/esm/scorm-again.min.js @@ -0,0 +1,2 @@ +var e={531:function(e,t,i){i.d(t,{X:function(){return R}});var r=i(635),n=i(941),o=i(989),s=i(340),a=i(589),c=i(784),l=i(319),u=i(797),h=i(449),_=u.A.scorm12;function m(e,t,i){return(0,h.q)(e,t,_.TYPE_MISMATCH,c.gv,i)}var d=i(417),p=function(e){function t(){var t=e.call(this)||this;return t.comments=new f,t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.comments)||void 0===t||t.initialize()},t.prototype.toJSON=function(){this.jsonString=!0;var e={comments:this.comments};return delete this.jsonString,e},t}(l.J),f=function(e){function t(){return e.call(this,{children:s.A.aicc.comments_children,errorCode:u.A.scorm12.INVALID_SET_VALUE,errorClass:c.gv})||this}return(0,r.C6)(t,e),t}(a.B),g=function(e){function t(){var t=e.call(this)||this;return t._content="",t._location="",t._time="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"content",{get:function(){return this._content},set:function(e){m(e,d.A.aicc.CMIString256)&&(this._content=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"location",{get:function(){return this._location},set:function(e){m(e,d.A.aicc.CMIString256)&&(this._location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){return this._time},set:function(e){m(e,d.A.aicc.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={content:this.content,location:this.location,time:this.time};return delete this.jsonString,e},t}(l.J),E=function(e){function t(){var t=e.call(this,s.A.aicc.student_preference_children)||this;return t._lesson_type="",t._text_color="",t._text_location="",t._text_size="",t._video="",t.windows=new a.B({errorCode:u.A.scorm12.INVALID_SET_VALUE,errorClass:c.gv,children:""}),t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.windows)||void 0===t||t.initialize()},Object.defineProperty(t.prototype,"lesson_type",{get:function(){return this._lesson_type},set:function(e){m(e,d.A.aicc.CMIString256)&&(this._lesson_type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text_color",{get:function(){return this._text_color},set:function(e){m(e,d.A.aicc.CMIString256)&&(this._text_color=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text_location",{get:function(){return this._text_location},set:function(e){m(e,d.A.aicc.CMIString256)&&(this._text_location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text_size",{get:function(){return this._text_size},set:function(e){m(e,d.A.aicc.CMIString256)&&(this._text_size=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"video",{get:function(){return this._video},set:function(e){m(e,d.A.aicc.CMIString256)&&(this._video=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,lesson_type:this.lesson_type,speed:this.speed,text:this.text,text_color:this.text_color,text_location:this.text_location,text_size:this.text_size,video:this.video,windows:this.windows};return delete this.jsonString,e},t}(i(181).G),b=function(e){function t(){var t=e.call(this)||this;return t.__children=s.A.aicc.student_demographics_children,t._city="",t._class="",t._company="",t._country="",t._experience="",t._familiar_name="",t._instructor_name="",t._title="",t._native_language="",t._state="",t._street_address="",t._telephone="",t._years_experience="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"city",{get:function(){return this._city},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._city=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"class",{get:function(){return this._class},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._class=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"company",{get:function(){return this._company},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._company=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"country",{get:function(){return this._country},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._country=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"experience",{get:function(){return this._experience},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._experience=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"familiar_name",{get:function(){return this._familiar_name},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._familiar_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"instructor_name",{get:function(){return this._instructor_name},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._instructor_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){return this._title},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._title=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"native_language",{get:function(){return this._native_language},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._native_language=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._state=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"street_address",{get:function(){return this._street_address},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._street_address=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"telephone",{get:function(){return this._telephone},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._telephone=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"years_experience",{get:function(){return this._years_experience},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._years_experience=e},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={city:this.city,class:this.class,company:this.company,country:this.country,experience:this.experience,familiar_name:this.familiar_name,instructor_name:this.instructor_name,title:this.title,native_language:this.native_language,state:this.state,street_address:this.street_address,telephone:this.telephone,years_experience:this.years_experience};return delete this.jsonString,e},t}(l.J),y=i(434),A=function(e){function t(){return e.call(this,{children:s.A.aicc.tries_children})||this}return(0,r.C6)(t,e),t}(a.B),M=function(e){function t(){var t=e.call(this)||this;return t._status="",t._time="",t.score=new y._({score_children:s.A.aicc.score_children,score_range:d.A.aicc.score_range,invalidErrorCode:u.A.scorm12.INVALID_SET_VALUE,invalidTypeCode:u.A.scorm12.TYPE_MISMATCH,invalidRangeCode:u.A.scorm12.VALUE_OUT_OF_RANGE,errorClass:c.gv}),t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(t.prototype,"status",{get:function(){return this._status},set:function(e){m(e,d.A.aicc.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){return this._time},set:function(e){m(e,d.A.aicc.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={status:this.status,time:this.time,score:this.score};return delete this.jsonString,e},t}(l.J),C=i(532),v=function(e){function t(){return e.call(this,{children:s.A.aicc.attempt_records_children})||this}return(0,r.C6)(t,e),t}(a.B),I=function(e){function t(){var t=e.call(this)||this;return t._lesson_status="",t.score=new y._({score_children:s.A.aicc.score_children,score_range:d.A.aicc.score_range,invalidErrorCode:u.A.scorm12.INVALID_SET_VALUE,invalidTypeCode:u.A.scorm12.TYPE_MISMATCH,invalidRangeCode:u.A.scorm12.VALUE_OUT_OF_RANGE,errorClass:c.gv}),t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(t.prototype,"lesson_status",{get:function(){return this._lesson_status},set:function(e){m(e,d.A.aicc.CMIStatus2)&&(this._lesson_status=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={lesson_status:this.lesson_status,score:this.score};return delete this.jsonString,e},t}(l.J),S=function(e){function t(){var t=e.call(this,s.A.aicc.student_data_children)||this;return t._tries_during_lesson="",t.tries=new A,t.attempt_records=new v,t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t,i;e.prototype.initialize.call(this),null===(t=this.tries)||void 0===t||t.initialize(),null===(i=this.attempt_records)||void 0===i||i.initialize()},Object.defineProperty(t.prototype,"tries_during_lesson",{get:function(){return this._tries_during_lesson},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._tries_during_lesson=e},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={mastery_score:this.mastery_score,max_time_allowed:this.max_time_allowed,time_limit_action:this.time_limit_action,tries:this.tries,attempt_records:this.attempt_records};return delete this.jsonString,e},t}(C.X),w=function(e){function t(){return e.call(this,{children:s.A.aicc.paths_children})||this}return(0,r.C6)(t,e),t}(a.B),O=function(e){function t(){var t=e.call(this)||this;return t._location_id="",t._date="",t._time="",t._status="",t._why_left="",t._time_in_element="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"location_id",{get:function(){return this._location_id},set:function(e){m(e,d.A.aicc.CMIString256)&&(this._location_id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"date",{get:function(){return this._date},set:function(e){m(e,d.A.aicc.CMIString256)&&(this._date=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){return this._time},set:function(e){m(e,d.A.aicc.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},set:function(e){m(e,d.A.aicc.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"why_left",{get:function(){return this._why_left},set:function(e){m(e,d.A.aicc.CMIString256)&&(this._why_left=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time_in_element",{get:function(){return this._time_in_element},set:function(e){m(e,d.A.aicc.CMITime)&&(this._time_in_element=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={location_id:this.location_id,date:this.date,time:this.time,status:this.status,why_left:this.why_left,time_in_element:this.time_in_element};return delete this.jsonString,e},t}(l.J),T=function(e){function t(t){void 0===t&&(t=!1);var i=e.call(this,s.A.aicc.cmi_children)||this;return t&&i.initialize(),i.student_preference=new E,i.student_data=new S,i.student_demographics=new b,i.evaluation=new p,i.paths=new w,i}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t,i,r,n,o;e.prototype.initialize.call(this),null===(t=this.student_preference)||void 0===t||t.initialize(),null===(i=this.student_data)||void 0===i||i.initialize(),null===(r=this.student_demographics)||void 0===r||r.initialize(),null===(n=this.evaluation)||void 0===n||n.initialize(),null===(o=this.paths)||void 0===o||o.initialize()},t.prototype.toJSON=function(){this.jsonString=!0;var e={suspend_data:this.suspend_data,launch_data:this.launch_data,comments:this.comments,comments_from_lms:this.comments_from_lms,core:this.core,objectives:this.objectives,student_data:this.student_data,student_preference:this.student_preference,student_demographics:this.student_demographics,interactions:this.interactions,evaluation:this.evaluation,paths:this.paths};return delete this.jsonString,e},t}(o.Y),L=i(331),N=i(864),R=function(e){function t(t){var i=e.call(this,t)||this;return i.cmi=new T,i.nav=new L.A,i}return(0,r.C6)(t,e),t.prototype.getChildElement=function(t,i,r){var n=e.prototype.getChildElement.call(this,t,i,r);return n||((0,N.J6)(t,"cmi\\.evaluation\\.comments\\.\\d+")?n=new g:(0,N.J6)(t,"cmi\\.student_data\\.tries\\.\\d+")?n=new M:(0,N.J6)(t,"cmi\\.student_data\\.attempt_records\\.\\d+")?n=new I:(0,N.J6)(t,"cmi\\.paths\\.\\d+")&&(n=new O)),n},t.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi,this.nav=e.nav},t}(n.C)},900:function(e,t,i){i.d(t,{A:function(){return _}});var r=i(635),n=i(589),o=i(784),s=i(797),a=i(340),c=i(864);var l={autocommit:!1,autocommitSeconds:10,asyncCommit:!1,sendFullCommit:!0,lmsCommitUrl:!1,dataCommitFormat:"json",commitRequestDataType:"application/json;charset=UTF-8",autoProgress:!1,logLevel:a.A.global.LOG_LEVEL_ERROR,selfReportSessionTime:!1,alwaysSendTotalTime:!1,renderCommonCommitFields:!1,strict_errors:!0,xhrHeaders:{},xhrWithCredentials:!1,responseHandler:function(e){return(0,r.sH)(this,void 0,void 0,(function(){var t,i,n;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return void 0===e?[3,2]:(n=(i=JSON).parse,[4,e.text()]);case 1:return null!==(t=n.apply(i,[r.sent()]))&&{}.hasOwnProperty.call(t,"result")?[2,{result:t.result,errorCode:t.errorCode?t.errorCode:t.result===a.A.global.SCORM_TRUE?0:101}]:200===e.status?[2,{result:a.A.global.SCORM_TRUE,errorCode:0}]:[2,{result:a.A.global.SCORM_FALSE,errorCode:101}];case 2:return[2,{result:a.A.global.SCORM_FALSE,errorCode:101}]}}))}))},requestHandler:function(e){return e},onLogMessage:function(e,t){switch(e){case a.A.global.LOG_LEVEL_ERROR:console.error(t);break;case a.A.global.LOG_LEVEL_WARNING:console.warn(t);break;case a.A.global.LOG_LEVEL_INFO:console.info(t);break;case a.A.global.LOG_LEVEL_DEBUG:console.debug?console.debug(t):console.log(t)}},scoItemIds:[],scoItemIdValidator:!1},u=function(){function e(e,t,i){this._cancelled=!1,this._API=e,this._timeout=setTimeout(this.wrapper.bind(this),t),this._callback=i}return e.prototype.cancel=function(){this._cancelled=!0,this._timeout&&clearTimeout(this._timeout)},e.prototype.wrapper=function(){var e=this;this._cancelled||(0,r.sH)(e,void 0,void 0,(function(){return(0,r.YH)(this,(function(e){switch(e.label){case 0:return[4,this._API.commit(this._callback)];case 1:return[2,e.sent()]}}))}))},e}(),h=function(){function e(t,i){var r=this.constructor;if(this._settings=l,r===e)throw new TypeError("Cannot construct BaseAPI instances directly");this.currentState=a.A.global.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[],this._error_codes=t,i&&(this.settings=i),this.apiLogLevel=this.settings.logLevel,this.selfReportSessionTime=this.settings.selfReportSessionTime}return e.prototype.commonReset=function(e){this.settings=(0,r.Cl)((0,r.Cl)({},this.settings),e),this.currentState=a.A.global.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[]},e.prototype.initialize=function(e,t,i){var r=a.A.global.SCORM_FALSE;return this.isInitialized()?this.throwSCORMError(this._error_codes.INITIALIZED,t):this.isTerminated()?this.throwSCORMError(this._error_codes.TERMINATED,i):(this.selfReportSessionTime&&this.cmi.setStartTime(),this.currentState=a.A.global.STATE_INITIALIZED,this.lastErrorCode="0",r=a.A.global.SCORM_TRUE,this.processListeners(e)),this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(r),r},e.prototype.apiLog=function(e,t,i,r){t=(0,c.hw)(e,t,r),i>=this.apiLogLevel&&this.settings.onLogMessage(i,t)},Object.defineProperty(e.prototype,"error_codes",{get:function(){return this._error_codes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"settings",{get:function(){return this._settings},set:function(e){this._settings=(0,r.Cl)((0,r.Cl)({},this._settings),e)},enumerable:!1,configurable:!0}),e.prototype.terminate=function(e,t){return(0,r.sH)(this,void 0,void 0,(function(){var i,n;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return i=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.TERMINATION_BEFORE_INIT,this._error_codes.MULTIPLE_TERMINATION)?(this.currentState=a.A.global.STATE_TERMINATED,[4,this.storeData(!0)]):[3,2];case 1:void 0!==(n=r.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),i=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,t&&(this.lastErrorCode="0"),i=a.A.global.SCORM_TRUE,this.processListeners(e),r.label=2;case 2:return this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(i),[2,i]}}))}))},e.prototype.getValue=function(e,t,i){var r="";if(this.checkState(t,this._error_codes.RETRIEVE_BEFORE_INIT,this._error_codes.RETRIEVE_AFTER_TERM)){t&&(this.lastErrorCode="0");try{r=this.getCMIValue(i)}catch(e){r=this.handleValueAccessException(e,r)}this.processListeners(e,i)}return this.apiLog(e,": returned: "+r,a.A.global.LOG_LEVEL_INFO,i),void 0===r?"":(this.clearSCORMError(r),r)},e.prototype.setValue=function(e,t,i,r,n){void 0!==n&&(n=String(n));var o=a.A.global.SCORM_FALSE;if(this.checkState(i,this._error_codes.STORE_BEFORE_INIT,this._error_codes.STORE_AFTER_TERM)){i&&(this.lastErrorCode="0");try{o=this.setCMIValue(r,n)}catch(e){this.handleValueAccessException(e,o)}this.processListeners(e,r,n)}return void 0===o&&(o=a.A.global.SCORM_FALSE),"0"===String(this.lastErrorCode)&&this.settings.autocommit&&!this._timeout&&this.scheduleCommit(1e3*this.settings.autocommitSeconds,t),this.apiLog(e,": "+n+": result: "+o,a.A.global.LOG_LEVEL_INFO,r),this.clearSCORMError(o),o},e.prototype.commit=function(e){return(0,r.sH)(this,arguments,void 0,(function(e,t){var i,n;return void 0===t&&(t=!1),(0,r.YH)(this,(function(r){switch(r.label){case 0:return this.clearScheduledCommit(),i=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.COMMIT_BEFORE_INIT,this._error_codes.COMMIT_AFTER_TERM)?[4,this.storeData(!1)]:[3,2];case 1:(n=r.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),i=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,this.apiLog(e," Result: "+i,a.A.global.LOG_LEVEL_DEBUG,"HttpRequest"),t&&(this.lastErrorCode="0"),this.processListeners(e),r.label=2;case 2:return this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(i),[2,i]}}))}))},e.prototype.getLastError=function(e){var t=String(this.lastErrorCode);return this.processListeners(e),this.apiLog(e,"returned: "+t,a.A.global.LOG_LEVEL_INFO),t},e.prototype.getErrorString=function(e,t){var i="";return null!==t&&""!==t&&(i=this.getLmsErrorMessageDetails(t),this.processListeners(e)),this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),i},e.prototype.getDiagnostic=function(e,t){var i="";return null!==t&&""!==t&&(i=this.getLmsErrorMessageDetails(t,!0),this.processListeners(e)),this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),i},e.prototype.checkState=function(e,t,i){return this.isNotInitialized()?(this.throwSCORMError(t),!1):!e||!this.isTerminated()||(this.throwSCORMError(i),!1)},e.prototype.getLmsErrorMessageDetails=function(e,t){throw void 0===t&&(t=!1),new Error("The getLmsErrorMessageDetails method has not been implemented")},e.prototype.getCMIValue=function(e){throw new Error("The getCMIValue method has not been implemented")},e.prototype.setCMIValue=function(e,t){throw new Error("The setCMIValue method has not been implemented")},e.prototype._commonSetCMIValue=function(e,t,i,o){if(!i||""===i)return a.A.global.SCORM_FALSE;for(var s=i.split("."),l=this,u=a.A.global.SCORM_FALSE,h=!1,_="The data model element passed to ".concat(e," (").concat(i,") is not a valid SCORM data model element."),m=t?this._error_codes.UNDEFINED_DATA_MODEL:this._error_codes.GENERAL,d=0;d1&&(s=e.replace(o+".","")),this.listenerArray.push({functionName:o,CMIElement:s,callback:t}),this.apiLog("on","Added event listener: ".concat(this.listenerArray.length),a.A.global.LOG_LEVEL_INFO,o)}},e.prototype.off=function(e,t){if(t)for(var i=e.split(" "),r=function(r){var o=i[r].split(".");if(0===o.length)return{value:void 0};var s=o[0],c=null;o.length>1&&(c=e.replace(s+".",""));var l=n.listenerArray.findIndex((function(e){return e.functionName===s&&e.CMIElement===c&&e.callback===t}));-1!==l&&(n.listenerArray.splice(l,1),n.apiLog("off","Removed event listener: ".concat(n.listenerArray.length),a.A.global.LOG_LEVEL_INFO,s))},n=this,o=0;o1&&(s=e.replace(o+".","")),r.listenerArray=r.listenerArray.filter((function(e){return e.functionName!==o&&e.CMIElement!==s}))},r=this,n=0;ns?1:0})),s.forEach((function(e){(r={})[e[0]]=e[1],i.loadFromJSON((0,c.sB)(r),t)}))}else console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize.");function a(e,t,i){var r,n=e.match(i);if(null!==n&&null!==(r=t.match(i))){var o=Number(n[2]),s=Number(r[2]);return o===s?"id"===n[3]?-1:"type"===n[3]?"id"===r[3]?1:-1:1:o-s}return null}},e.prototype.loadFromJSON=function(e,t){if(this.isNotInitialized()){for(var i in t=void 0!==t?t:"cmi",this.startingData=e,e)if({}.hasOwnProperty.call(e,i)&&e[i]){var r=(t?t+".":"")+i,n=e[i];if(n.childArray)for(var o=0;o=200&&e.status<=299&&(!0===t.result||t.result===a.A.global.SCORM_TRUE)?this.processListeners("CommitSuccess"):this.processListeners("CommitError"),[2,t]}}))}))},e}(),_=h},941:function(e,t,i){i.d(t,{C:function(){return m}});var r=i(635),n=i(989),o=i(864),s=i(340),a=i(797),c=i(176),l=i(833),u=i(331),h=i(417),_=i(56),m=function(e){function t(t){var i=this;return t&&void 0===t.mastery_override&&(t.mastery_override=!1),(i=e.call(this,a.A.scorm12,t)||this).statusSetByModule=!1,i.cmi=new n.Y,i.nav=new u.A,i.LMSInitialize=i.lmsInitialize,i.LMSFinish=i.lmsFinish,i.LMSGetValue=i.lmsGetValue,i.LMSSetValue=i.lmsSetValue,i.LMSCommit=i.lmsCommit,i.LMSGetLastError=i.lmsGetLastError,i.LMSGetErrorString=i.lmsGetErrorString,i.LMSGetDiagnostic=i.lmsGetDiagnostic,i}return(0,r.C6)(t,e),t.prototype.reset=function(e){this.commonReset(e),this.cmi=new n.Y,this.nav=new u.A},t.prototype.lmsInitialize=function(){return this.cmi.initialize(),this.cmi.core.lesson_status?this.statusSetByModule=!0:this.cmi.core.lesson_status="not attempted",this.initialize("LMSInitialize","LMS was already initialized!","LMS is already finished!")},t.prototype.lmsFinish=function(){var e=this;return(0,r.sH)(e,void 0,void 0,(function(){return(0,r.YH)(this,(function(e){switch(e.label){case 0:return[4,this.internalFinish()];case 1:return e.sent(),[2]}}))})),s.A.global.SCORM_TRUE},t.prototype.internalFinish=function(){return(0,r.sH)(this,void 0,void 0,(function(){var e;return(0,r.YH)(this,(function(t){switch(t.label){case 0:return[4,this.terminate("LMSFinish",!0)];case 1:return(e=t.sent())===s.A.global.SCORM_TRUE&&(""!==this.nav.event?"continue"===this.nav.event?this.processListeners("SequenceNext"):this.processListeners("SequencePrevious"):this.settings.autoProgress&&this.processListeners("SequenceNext")),[2,e]}}))}))},t.prototype.lmsGetValue=function(e){return this.getValue("LMSGetValue",!1,e)},t.prototype.lmsSetValue=function(e,t){return"cmi.core.lesson_status"===e&&(this.statusSetByModule=!0),this.setValue("LMSSetValue","LMSCommit",!1,e,t)},t.prototype.lmsCommit=function(){var e=this;return(0,r.sH)(e,void 0,void 0,(function(){return(0,r.YH)(this,(function(e){switch(e.label){case 0:return[4,this.commit("LMSCommit",!1)];case 1:return e.sent(),[2]}}))})),s.A.global.SCORM_TRUE},t.prototype.lmsGetLastError=function(){return this.getLastError("LMSGetLastError")},t.prototype.lmsGetErrorString=function(e){return this.getErrorString("LMSGetErrorString",e)},t.prototype.lmsGetDiagnostic=function(e){return this.getDiagnostic("LMSGetDiagnostic",e)},t.prototype.setCMIValue=function(e,t){return this._commonSetCMIValue("LMSSetValue",!1,e,t)},t.prototype.getCMIValue=function(e){return this._commonGetCMIValue("getCMIValue",!1,e)},t.prototype.getChildElement=function(e,t,i){return(0,o.J6)(e,"cmi\\.objectives\\.\\d+")?new c.N:i&&(0,o.J6)(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")?new l.cb:i&&(0,o.J6)(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")?new l.Oh:!i&&(0,o.J6)(e,"cmi\\.interactions\\.\\d+")?new l.WP:null},t.prototype.validateCorrectResponse=function(e,t){},t.prototype.getLmsErrorMessageDetails=function(e,t){var i="No Error",r="No Error";return e=String(e),s.A.scorm12.error_descriptions[e]&&(i=s.A.scorm12.error_descriptions[e].basicMessage,r=s.A.scorm12.error_descriptions[e].detailMessage),t?r:i},t.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi},t.prototype.renderCommitCMI=function(e){var t=this.renderCMIToJSONObject();e&&(t.cmi.core.total_time=this.cmi.getCurrentTotalTime());var i=[],r=o.Bq(t);switch(this.settings.dataCommitFormat){case"flattened":return o.Bq(t);case"params":for(var n in r)({}).hasOwnProperty.call(r,n)&&i.push("".concat(n,"=").concat(r[n]));return i;default:return t}},t.prototype.renderCommitObject=function(e){var t=this.renderCommitCMI(e),i=this.cmi.getCurrentTotalTime(),r=o.f4(i,h.A.scorm12.CMITimespan),n=this.cmi.core.lesson_status,s=_.lC.unknown,a=_.YE.unknown;n&&(s="completed"===n||"passed"===n?_.lC.completed:_.lC.incomplete,"passed"===n?a=_.YE.passed:"failed"===n&&(a=_.YE.failed));var c=this.cmi.core.score,l=null;c&&(l={},Number.isNaN(Number.parseFloat(c.raw))||(l.raw=Number.parseFloat(c.raw)),Number.isNaN(Number.parseFloat(c.min))||(l.min=Number.parseFloat(c.min)),Number.isNaN(Number.parseFloat(c.max))||(l.max=Number.parseFloat(c.max)));var u={successStatus:a,completionStatus:s,runtimeData:t,totalTimeSeconds:r};return l&&(u.score=l),u},t.prototype.storeData=function(e){return(0,r.sH)(this,void 0,void 0,(function(){var t,i,n,o,a,c;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return e&&(t=this.cmi.core.lesson_status,this.cmi.core.lesson_status&&(this.statusSetByModule||"not attempted"!==this.cmi.core.lesson_status)||(this.cmi.core.lesson_status="completed"),"normal"===this.cmi.core.lesson_mode?"credit"===this.cmi.core.credit&&this.settings.mastery_override&&""!==this.cmi.student_data.mastery_score&&""!==this.cmi.core.score.raw&&(this.cmi.core.lesson_status=parseFloat(this.cmi.core.score.raw)>=parseFloat(this.cmi.student_data.mastery_score)?"passed":"failed"):"browse"===this.cmi.core.lesson_mode&&""===((null===(c=null===(a=null===(o=this.startingData)||void 0===o?void 0:o.cmi)||void 0===a?void 0:a.core)||void 0===c?void 0:c.lesson_status)||"")&&"not attempted"===t&&(this.cmi.core.lesson_status="browsed")),i=e||this.settings.alwaysSendTotalTime,n=this.settings.renderCommonCommitFields?this.renderCommitObject(i):this.renderCommitCMI(i),this.apiLogLevel===s.A.global.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(n)),"string"!=typeof this.settings.lmsCommitUrl?[3,2]:[4,this.processHttpRequest(this.settings.lmsCommitUrl,n,e)];case 1:return[2,r.sent()];case 2:return[2,{result:s.A.global.SCORM_TRUE,errorCode:0}]}}))}))},t}(i(900).A)},180:function(e,t,i){i.d(t,{Z:function(){return P}});var r=i(635),n=i(900),o=i(340),s=i(417),a=i(797),c=i(784),l=i(864),u=i(319),h=i(449);function _(e,t,i){return(0,h.q)(e,t,a.A.scorm2004.TYPE_MISMATCH,c.wq,i)}function m(e,t){return(0,h.W)(e,t,a.A.scorm2004.VALUE_OUT_OF_RANGE,c.wq)}var d=function(e){function t(){var t=e.call(this)||this;return t.__children=o.A.scorm2004.student_preference_children,t._audio_level="1",t._language="",t._delivery_speed="1",t._audio_captioning="0",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new c.wq(a.A.scorm2004.READ_ONLY_ELEMENT)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audio_level",{get:function(){return this._audio_level},set:function(e){_(e,s.A.scorm2004.CMIDecimal)&&m(e,s.A.scorm2004.audio_range)&&(this._audio_level=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"language",{get:function(){return this._language},set:function(e){_(e,s.A.scorm2004.CMILang)&&(this._language=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"delivery_speed",{get:function(){return this._delivery_speed},set:function(e){_(e,s.A.scorm2004.CMIDecimal)&&m(e,s.A.scorm2004.speed_range)&&(this._delivery_speed=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audio_captioning",{get:function(){return this._audio_captioning},set:function(e){_(e,s.A.scorm2004.CMISInteger)&&m(e,s.A.scorm2004.text_range)&&(this._audio_captioning=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={audio_level:this.audio_level,language:this.language,delivery_speed:this.delivery_speed,audio_captioning:this.audio_captioning};return delete this.jsonString,e},t}(u.J),p=i(589),f=s.A.scorm2004,g={"true-false":{format:"^true$|^false$",max:1,delimiter:"",unique:!1},choice:{format:f.CMILongIdentifier,max:36,delimiter:"[,]",unique:!0},"fill-in":{format:f.CMILangString250,max:10,delimiter:"[,]",unique:!1},"long-fill-in":{format:f.CMILangString4000,max:1,delimiter:"",unique:!1},matching:{format:f.CMIShortIdentifier,format2:f.CMIShortIdentifier,max:36,delimiter:"[,]",delimiter2:"[.]",unique:!1},performance:{format:"^$|"+f.CMIShortIdentifier,format2:f.CMIDecimal+"|^$|"+f.CMIShortIdentifier,max:250,delimiter:"[,]",delimiter2:"[.]",unique:!1},sequencing:{format:f.CMIShortIdentifier,max:36,delimiter:"[,]",unique:!1},likert:{format:f.CMIShortIdentifier,max:1,delimiter:"",unique:!1},numeric:{format:f.CMIDecimal,max:1,delimiter:"",unique:!1},other:{format:f.CMIString4000,max:1,delimiter:"",unique:!1}},E={"true-false":{max:1,delimiter:"",unique:!1,duplicate:!1,format:"^true$|^false$",limit:1},choice:{max:36,delimiter:"[,]",unique:!0,duplicate:!1,format:f.CMILongIdentifier},"fill-in":{max:10,delimiter:"[,]",unique:!1,duplicate:!1,format:f.CMILangString250cr},"long-fill-in":{max:1,delimiter:"",unique:!1,duplicate:!0,format:f.CMILangString4000},matching:{max:36,delimiter:"[,]",delimiter2:"[.]",unique:!1,duplicate:!1,format:f.CMIShortIdentifier,format2:f.CMIShortIdentifier},performance:{max:250,delimiter:"[,]",delimiter2:"[.]",delimiter3:"[:]",unique:!1,duplicate:!1,format:"^$|"+f.CMIShortIdentifier,format2:f.CMIDecimal+"|^$|"+f.CMIShortIdentifier},sequencing:{max:36,delimiter:"[,]",unique:!1,duplicate:!1,format:f.CMIShortIdentifier},likert:{max:1,delimiter:"",unique:!1,duplicate:!1,format:f.CMIShortIdentifier,limit:1},numeric:{max:2,delimiter:"[:]",unique:!1,duplicate:!1,format:f.CMIDecimal,limit:1},other:{max:1,delimiter:"",unique:!1,duplicate:!1,format:f.CMIString4000,limit:1}},b=function(e){function t(){return e.call(this,{children:o.A.scorm2004.interactions_children,errorCode:a.A.scorm2004.READ_ONLY_ELEMENT,errorClass:c.wq})||this}return(0,r.C6)(t,e),t}(p.B),y=function(e){function t(){var t=e.call(this)||this;return t._id="",t._type="",t._timestamp="",t._weighting="",t._learner_response="",t._result="",t._latency="",t._description="",t.objectives=new p.B({errorCode:a.A.scorm2004.READ_ONLY_ELEMENT,errorClass:c.wq,children:o.A.scorm2004.objectives_children}),t.correct_responses=new p.B({errorCode:a.A.scorm2004.READ_ONLY_ELEMENT,errorClass:c.wq,children:o.A.scorm2004.correct_responses_children}),t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t,i;e.prototype.initialize.call(this),null===(t=this.objectives)||void 0===t||t.initialize(),null===(i=this.correct_responses)||void 0===i||i.initialize()},Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(e){_(e,s.A.scorm2004.CMILongIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this._type},set:function(e){if(this.initialized&&""===this._id)throw new c.wq(a.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED);_(e,s.A.scorm2004.CMIType)&&(this._type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"timestamp",{get:function(){return this._timestamp},set:function(e){if(this.initialized&&""===this._id)throw new c.wq(a.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED);_(e,s.A.scorm2004.CMITime)&&(this._timestamp=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weighting",{get:function(){return this._weighting},set:function(e){if(this.initialized&&""===this._id)throw new c.wq(a.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED);_(e,s.A.scorm2004.CMIDecimal)&&(this._weighting=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"learner_response",{get:function(){return this._learner_response},set:function(e){if(this.initialized&&(""===this._type||""===this._id))throw new c.wq(a.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED);var t=[],i=g[this.type];if(!i)throw new c.wq(a.A.scorm2004.TYPE_MISMATCH);if((null==i?void 0:i.delimiter)?t=e.split(i.delimiter):t[0]=e,!(t.length>0&&t.length<=i.max))throw new c.wq(a.A.scorm2004.GENERAL_SET_FAILURE);for(var r=new RegExp(i.format),n=0;n2&&(c=a[2],i=a[1].replace(c,"")),(l=t[i])&&this.processListeners(l,"adl.nav.request",c)):this.settings.autoProgress&&this.processListeners("SequenceNext")),[2,e]}}))}))},t.prototype.lmsGetValue=function(e){var t="^adl\\.nav\\.request_valid\\.(choice|jump)\\.{target=\\S{0,}([a-zA-Z0-9-_]+)}$";if((0,l.J6)(e,t)){var i=e.match(t),r=i[1],n=i[2].replace("{target=","").replace("}","");if("choice"===r||"jump"===r)return this.settings.scoItemIdValidator?String(this.settings.scoItemIdValidator(n)):String(this.settings.scoItemIds.includes(n))}return this.getValue("GetValue",!0,e)},t.prototype.lmsSetValue=function(e,t){return this.setValue("SetValue","Commit",!0,e,t)},t.prototype.lmsCommit=function(){var e=this;return(0,r.sH)(e,void 0,void 0,(function(){return(0,r.YH)(this,(function(e){switch(e.label){case 0:return[4,this.commit("Commit")];case 1:return e.sent(),[2]}}))})),o.A.global.SCORM_TRUE},t.prototype.lmsGetLastError=function(){return this.getLastError("GetLastError")},t.prototype.lmsGetErrorString=function(e){return this.getErrorString("GetErrorString",e)},t.prototype.lmsGetDiagnostic=function(e){return this.getDiagnostic("GetDiagnostic",e)},t.prototype.setCMIValue=function(e,t){return this._commonSetCMIValue("SetValue",!0,e,t)},t.prototype.getChildElement=function(e,t,i){if((0,l.J6)(e,"cmi\\.objectives\\.\\d+"))return new O;if(i){if((0,l.J6)(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+"))return this.createCorrectResponsesObject(e,t);if((0,l.J6)(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+"))return new A}else if((0,l.J6)(e,"cmi\\.interactions\\.\\d+"))return new y;return(0,l.J6)(e,"cmi\\.comments_from_learner\\.\\d+")?new S:(0,l.J6)(e,"cmi\\.comments_from_lms\\.\\d+")?new S(!0):null},t.prototype.createCorrectResponsesObject=function(e,t){var i=e.split("."),r=Number(i[2]),n=this.cmi.interactions.childArray[r];if(this.isInitialized())if(n.type){this.checkDuplicateChoiceResponse(n,t);var o=E[n.type];o?this.checkValidResponseType(o,t,n.type):this.throwSCORMError(a.A.scorm2004.GENERAL_SET_FAILURE,"Incorrect Response Type: "+n.type)}else this.throwSCORMError(a.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED);return"0"===this.lastErrorCode?new M:null},t.prototype.checkValidResponseType=function(e,t,i){var r=[];(null==e?void 0:e.delimiter)?r=String(t).split(e.delimiter):r[0]=t,r.length>0&&r.length<=e.max?this.checkCorrectResponseValue(i,r,t):r.length>e.max&&this.throwSCORMError(a.A.scorm2004.GENERAL_SET_FAILURE,"Data Model Element Pattern Too Long")},t.prototype.checkDuplicateChoiceResponse=function(e,t){var i=e.correct_responses._count;if("choice"===e.type)for(var r=0;r1)Number(t[0])>Number(t[1])&&this.throwSCORMError(a.A.scorm2004.TYPE_MISMATCH);else if(""!==t[o]&&r.unique)for(var l=0;l0&&(L.includes(l.toLowerCase())||this.throwSCORMError(a.A.scorm2004.TYPE_MISMATCH))}r=!0;break;case"case_matters":r||t||i||"true"!==o[3]&&"false"!==o[3]&&this.throwSCORMError(a.A.scorm2004.TYPE_MISMATCH),i=!0;break;case"order_matters":i||r||t||"true"!==o[3]&&"false"!==o[3]&&this.throwSCORMError(a.A.scorm2004.TYPE_MISMATCH),t=!0}o=(e=e.substring(o[1].length)).match(n)}return e},t.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi,this.adl=e.adl},t.prototype.renderCommitCMI=function(e){var t=this.renderCMIToJSONObject();e&&(t.cmi.total_time=this.cmi.getCurrentTotalTime());var i=[],r=l.Bq(t);switch(this.settings.dataCommitFormat){case"flattened":return l.Bq(t);case"params":for(var n in r)({}).hasOwnProperty.call(r,n)&&i.push("".concat(n,"=").concat(r[n]));return i;default:return t}},t.prototype.renderCommitObject=function(e){var t=this.renderCommitCMI(e),i=this.cmi.getCurrentTotalTime(),r=l.OI(i,s.A.scorm2004.CMITimespan),n=N.lC.unknown,o=N.YE.unknown;this.cmi.completion_status&&("completed"===this.cmi.completion_status?n=N.lC.completed:"incomplete"===this.cmi.completion_status&&(n=N.lC.incomplete)),this.cmi.success_status&&("passed"===this.cmi.success_status?o=N.YE.passed:"failed"===this.cmi.success_status&&(o=N.YE.failed));var a=this.cmi.score,c=null;a&&(c={},Number.isNaN(Number.parseFloat(a.raw))||(c.raw=Number.parseFloat(a.raw)),Number.isNaN(Number.parseFloat(a.min))||(c.min=Number.parseFloat(a.min)),Number.isNaN(Number.parseFloat(a.max))||(c.max=Number.parseFloat(a.max)),Number.isNaN(Number.parseFloat(a.scaled))||(c.scaled=Number.parseFloat(a.scaled)));var u={completionStatus:n,successStatus:o,totalTimeSeconds:r,runtimeData:t};return c&&(u.score=c),u},t.prototype.storeData=function(e){return(0,r.sH)(this,void 0,void 0,(function(){var t,i,n,s,a,c,l;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return e&&"normal"===this.cmi.mode&&"credit"===this.cmi.credit&&(this.cmi.completion_threshold&&this.cmi.progress_measure&&(this.cmi.progress_measure>=this.cmi.completion_threshold?this.cmi.completion_status="completed":this.cmi.completion_status="incomplete"),this.cmi.scaled_passing_score&&this.cmi.score.scaled&&(this.cmi.score.scaled>=this.cmi.scaled_passing_score?this.cmi.success_status="passed":this.cmi.success_status="failed")),t=!1,this.adl.nav.request!==(null===(l=null===(c=null===(a=this.startingData)||void 0===a?void 0:a.adl)||void 0===c?void 0:c.nav)||void 0===l?void 0:l.request)&&"_none_"!==this.adl.nav.request&&(this.adl.nav.request=encodeURIComponent(this.adl.nav.request),t=!0),i=e||this.settings.alwaysSendTotalTime,n=this.settings.renderCommonCommitFields?this.renderCommitObject(i):this.renderCommitCMI(i),this.apiLogLevel===o.A.global.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(n)),"string"!=typeof this.settings.lmsCommitUrl?[3,2]:[4,this.processHttpRequest(this.settings.lmsCommitUrl,n,e)];case 1:return s=r.sent(),t&&void 0!==s.navRequest&&""!==s.navRequest&&Function('"use strict";(() => { '.concat(s.navRequest," })()"))(),[2,s];case 2:return[2,{result:o.A.global.SCORM_TRUE,errorCode:0}]}}))}))},t}(n.A)},589:function(e,t,i){i.d(t,{B:function(){return c}});var r=i(635),n=i(319),o=i(797),s=i(784),a=o.A.scorm12,c=function(e){function t(t){var i=e.call(this)||this;return i.__children=t.children,i._errorCode=t.errorCode||a.GENERAL,i._errorClass=t.errorClass||s.$h,i.childArray=[],i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_count",{get:function(){return this.childArray.length},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;for(var e={},t=0;t=n[0]){if("*"===n[1]||e<=n[1])return!0;throw new r(i)}throw new r(i)}i.d(t,{W:function(){return n},q:function(){return r}})},989:function(e,t,i){i.d(t,{Y:function(){return g}});var r=i(635),n=i(340),o=i(797),s=i(417),a=i(784),c=i(319),l=i(915),u=i(434),h=i(864),_=function(e){function t(){var t=e.call(this)||this;return t.__children=n.A.scorm12.core_children,t._student_id="",t._student_name="",t._lesson_location="",t._credit="",t._lesson_status="not attempted",t._entry="",t._total_time="",t._lesson_mode="normal",t._exit="",t._session_time="00:00:00",t._suspend_data="",t.score=new u._({score_children:n.A.scorm12.score_children,score_range:s.A.scorm12.score_range,invalidErrorCode:o.A.scorm12.INVALID_SET_VALUE,invalidTypeCode:o.A.scorm12.TYPE_MISMATCH,invalidRangeCode:o.A.scorm12.VALUE_OUT_OF_RANGE,errorClass:a.tQ}),t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_id",{get:function(){return this._student_id},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._student_id=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_name",{get:function(){return this._student_name},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._student_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_location",{get:function(){return this._lesson_location},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString256,!0)&&(this._lesson_location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"credit",{get:function(){return this._credit},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._credit=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_status",{get:function(){return this._lesson_status},set:function(e){this.initialized?(0,l.p)(e,s.A.scorm12.CMIStatus)&&(this._lesson_status=e):(0,l.p)(e,s.A.scorm12.CMIStatus2)&&(this._lesson_status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"entry",{get:function(){return this._entry},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._entry=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"total_time",{get:function(){return this._total_time},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._total_time=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_mode",{get:function(){return this._lesson_mode},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._lesson_mode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"exit",{get:function(){if(!this.jsonString)throw new a.tQ(o.A.scorm12.WRITE_ONLY_ELEMENT);return this._exit},set:function(e){(0,l.p)(e,s.A.scorm12.CMIExit,!0)&&(this._exit=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"session_time",{get:function(){if(!this.jsonString)throw new a.tQ(o.A.scorm12.WRITE_ONLY_ELEMENT);return this._session_time},set:function(e){(0,l.p)(e,s.A.scorm12.CMITimespan)&&(this._session_time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"suspend_data",{get:function(){return this._suspend_data},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString4096,!0)&&(this._suspend_data=e)},enumerable:!1,configurable:!0}),t.prototype.getCurrentTotalTime=function(e){var t=this._session_time,i=e;if(null!=i){var r=(new Date).getTime()-i;t=h.UZ(r/1e3)}return h.HT(this._total_time,t,new RegExp(s.A.scorm12.CMITimespan))},t.prototype.toJSON=function(){this.jsonString=!0;var e={student_id:this.student_id,student_name:this.student_name,lesson_location:this.lesson_location,credit:this.credit,lesson_status:this.lesson_status,entry:this.entry,lesson_mode:this.lesson_mode,exit:this.exit,session_time:this.session_time,score:this.score};return delete this.jsonString,e},t}(c.J),m=i(176),d=i(532),p=i(181),f=i(833),g=function(e){function t(t,i,r){var o=e.call(this)||this;return o.__children="",o.__version="3.4",o._launch_data="",o._comments="",o._comments_from_lms="",r&&o.initialize(),o.__children=t||n.A.scorm12.cmi_children,o.core=new _,o.objectives=new m.C,o.student_data=i||new d.X,o.student_preference=new p.G,o.interactions=new f.Xb,o}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t,i,r,n,o;e.prototype.initialize.call(this),null===(t=this.core)||void 0===t||t.initialize(),null===(i=this.objectives)||void 0===i||i.initialize(),null===(r=this.student_data)||void 0===r||r.initialize(),null===(n=this.student_preference)||void 0===n||n.initialize(),null===(o=this.interactions)||void 0===o||o.initialize()},t.prototype.toJSON=function(){this.jsonString=!0;var e={suspend_data:this.suspend_data,launch_data:this.launch_data,comments:this.comments,comments_from_lms:this.comments_from_lms,core:this.core,objectives:this.objectives,student_data:this.student_data,student_preference:this.student_preference,interactions:this.interactions};return delete this.jsonString,e},Object.defineProperty(t.prototype,"_version",{get:function(){return this.__version},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"suspend_data",{get:function(){var e;return null===(e=this.core)||void 0===e?void 0:e.suspend_data},set:function(e){this.core&&(this.core.suspend_data=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"launch_data",{get:function(){return this._launch_data},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._launch_data=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"comments",{get:function(){return this._comments},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString4096,!0)&&(this._comments=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"comments_from_lms",{get:function(){return this._comments_from_lms},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._comments_from_lms=e},enumerable:!1,configurable:!0}),t.prototype.getCurrentTotalTime=function(){return this.core.getCurrentTotalTime(this.start_time)},t}(c.r)},833:function(e,t,i){i.d(t,{Oh:function(){return m},WP:function(){return _},Xb:function(){return h},cb:function(){return d}});var r=i(635),n=i(589),o=i(340),s=i(797),a=i(784),c=i(319),l=i(915),u=i(417),h=function(e){function t(){return e.call(this,{children:o.A.scorm12.interactions_children,errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ})||this}return(0,r.C6)(t,e),t}(n.B),_=function(e){function t(){var t=e.call(this)||this;return t._id="",t._time="",t._type="",t._weighting="",t._student_response="",t._result="",t._latency="",t.objectives=new n.B({errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ,children:o.A.scorm12.objectives_children}),t.correct_responses=new n.B({errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ,children:o.A.scorm12.correct_responses_children}),t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t,i;e.prototype.initialize.call(this),null===(t=this.objectives)||void 0===t||t.initialize(),null===(i=this.correct_responses)||void 0===i||i.initialize()},Object.defineProperty(t.prototype,"id",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._id},set:function(e){(0,l.p)(e,u.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._time},set:function(e){(0,l.p)(e,u.A.scorm12.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._type},set:function(e){(0,l.p)(e,u.A.scorm12.CMIType)&&(this._type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weighting",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._weighting},set:function(e){(0,l.p)(e,u.A.scorm12.CMIDecimal)&&(0,l.h)(e,u.A.scorm12.weighting_range)&&(this._weighting=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_response",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._student_response},set:function(e){(0,l.p)(e,u.A.scorm12.CMIFeedback,!0)&&(this._student_response=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"result",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._result},set:function(e){(0,l.p)(e,u.A.scorm12.CMIResult)&&(this._result=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"latency",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._latency},set:function(e){(0,l.p)(e,u.A.scorm12.CMITimespan)&&(this._latency=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,time:this.time,type:this.type,weighting:this.weighting,student_response:this.student_response,result:this.result,latency:this.latency,objectives:this.objectives,correct_responses:this.correct_responses};return delete this.jsonString,e},t}(c.J),m=function(e){function t(){var t=e.call(this)||this;return t._id="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(e){(0,l.p)(e,u.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id};return delete this.jsonString,e},t}(c.J),d=function(e){function t(){var t=e.call(this)||this;return t._pattern="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"pattern",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._pattern},set:function(e){(0,l.p)(e,u.A.scorm12.CMIFeedback,!0)&&(this._pattern=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={pattern:this._pattern};return delete this.jsonString,e},t}(c.J)},331:function(e,t,i){i.d(t,{A:function(){return a}});var r=i(635),n=i(319),o=i(915),s=i(417),a=function(e){function t(){var t=e.call(this)||this;return t._event="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"event",{get:function(){return this._event},set:function(e){(0,o.p)(e,s.A.scorm12.NAVEvent)&&(this._event=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={event:this.event};return delete this.jsonString,e},t}(n.J)},176:function(e,t,i){i.d(t,{C:function(){return h},N:function(){return _}});var r=i(635),n=i(319),o=i(434),s=i(340),a=i(417),c=i(797),l=i(784),u=i(915),h=function(e){function t(){return e.call(this,{children:s.A.scorm12.objectives_children,errorCode:c.A.scorm12.INVALID_SET_VALUE,errorClass:l.tQ})||this}return(0,r.C6)(t,e),t}(i(589).B),_=function(e){function t(){var t=e.call(this)||this;return t._id="",t._status="",t.score=new o._({score_children:s.A.scorm12.score_children,score_range:a.A.scorm12.score_range,invalidErrorCode:c.A.scorm12.INVALID_SET_VALUE,invalidTypeCode:c.A.scorm12.TYPE_MISMATCH,invalidRangeCode:c.A.scorm12.VALUE_OUT_OF_RANGE,errorClass:l.tQ}),t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(e){(0,u.p)(e,a.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},set:function(e){(0,u.p)(e,a.A.scorm12.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,status:this.status,score:this.score};return delete this.jsonString,e},t}(n.J)},532:function(e,t,i){i.d(t,{X:function(){return c}});var r=i(635),n=i(319),o=i(340),s=i(784),a=i(797),c=function(e){function t(t){var i=e.call(this)||this;return i._mastery_score="",i._max_time_allowed="",i._time_limit_action="",i.__children=t||o.A.scorm12.student_data_children,i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new s.tQ(a.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mastery_score",{get:function(){return this._mastery_score},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._mastery_score=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"max_time_allowed",{get:function(){return this._max_time_allowed},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._max_time_allowed=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time_limit_action",{get:function(){return this._time_limit_action},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._time_limit_action=e},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={mastery_score:this.mastery_score,max_time_allowed:this.max_time_allowed,time_limit_action:this.time_limit_action};return delete this.jsonString,e},t}(n.J)},181:function(e,t,i){i.d(t,{G:function(){return u}});var r=i(635),n=i(319),o=i(340),s=i(784),a=i(797),c=i(915),l=i(417),u=function(e){function t(t){var i=e.call(this)||this;return i._audio="",i._language="",i._speed="",i._text="",i.__children=t||o.A.scorm12.student_preference_children,i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new s.tQ(a.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audio",{get:function(){return this._audio},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.audio_range)&&(this._audio=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"language",{get:function(){return this._language},set:function(e){(0,c.p)(e,l.A.scorm12.CMIString256)&&(this._language=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speed",{get:function(){return this._speed},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.speed_range)&&(this._speed=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this._text},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.text_range)&&(this._text=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,speed:this.speed,text:this.text};return delete this.jsonString,e},t}(n.J)},915:function(e,t,i){i.d(t,{h:function(){return a},p:function(){return s}});var r=i(449),n=i(797),o=i(784);function s(e,t,i){return(0,r.q)(e,t,n.A.scorm12.TYPE_MISMATCH,o.tQ,i)}function a(e,t,i){if(!i&&""===e)throw new o.tQ(n.A.scorm12.VALUE_OUT_OF_RANGE);return(0,r.W)(e,t,n.A.scorm12.VALUE_OUT_OF_RANGE,o.tQ)}},340:function(e,t,i){var r=i(635),n={cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",core_children:"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time",score_children:"raw,min,max",comments_children:"content,location,time",objectives_children:"id,score,status",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio,language,speed,text",interactions_children:"id,objectives,time,type,correct_responses,weighting,student_response,result,latency",error_descriptions:{101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information"},201:{basicMessage:"Invalid argument error",detailMessage:"Indicates that an argument represents an invalid data model element or is otherwise incorrect."},202:{basicMessage:"Element cannot have children",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.'},203:{basicMessage:"Element not an array - cannot have count",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.'},301:{basicMessage:"Not initialized",detailMessage:"Indicates that an API call was made before the call to lmsInitialize."},401:{basicMessage:"Not implemented error",detailMessage:"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement."},402:{basicMessage:"Invalid set value, element is a keyword",detailMessage:'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").'},403:{basicMessage:"Element is read only",detailMessage:"LMSSetValue was called with a data model element that can only be read."},404:{basicMessage:"Element is write only",detailMessage:"LMSGetValue was called on a data model element that can only be written to."},405:{basicMessage:"Incorrect Data Type",detailMessage:"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Element Value Out Of Range",detailMessage:"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}},o={global:{SCORM_TRUE:"true",SCORM_FALSE:"false",STATE_NOT_INITIALIZED:0,STATE_INITIALIZED:1,STATE_TERMINATED:2,LOG_LEVEL_DEBUG:1,LOG_LEVEL_INFO:2,LOG_LEVEL_WARNING:3,LOG_LEVEL_ERROR:4,LOG_LEVEL_NONE:5},scorm12:n,aicc:(0,r.Cl)((0,r.Cl)({},n),{cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation",student_preference_children:"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows",student_data_children:"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action",student_demographics_children:"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience",tries_children:"time,status,score",attempt_records_children:"score,lesson_status",paths_children:"location_id,date,time,status,why_left,time_in_element"}),scorm2004:{cmi_children:"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time",comments_children:"comment,timestamp,location",score_children:"max,raw,scaled,min",objectives_children:"progress_measure,completion_status,success_status,description,score,id",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio_level,audio_captioning,delivery_speed,language",interactions_children:"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description",error_descriptions:{0:{basicMessage:"No Error",detailMessage:"No error occurred, the previous API call was successful."},101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use GetDiagnostic for more information."},102:{basicMessage:"General Initialization Failure",detailMessage:"Call to Initialize failed for an unknown reason."},103:{basicMessage:"Already Initialized",detailMessage:"Call to Initialize failed because Initialize was already called."},104:{basicMessage:"Content Instance Terminated",detailMessage:"Call to Initialize failed because Terminate was already called."},111:{basicMessage:"General Termination Failure",detailMessage:"Call to Terminate failed for an unknown reason."},112:{basicMessage:"Termination Before Initialization",detailMessage:"Call to Terminate failed because it was made before the call to Initialize."},113:{basicMessage:"Termination After Termination",detailMessage:"Call to Terminate failed because Terminate was already called."},122:{basicMessage:"Retrieve Data Before Initialization",detailMessage:"Call to GetValue failed because it was made before the call to Initialize."},123:{basicMessage:"Retrieve Data After Termination",detailMessage:"Call to GetValue failed because it was made after the call to Terminate."},132:{basicMessage:"Store Data Before Initialization",detailMessage:"Call to SetValue failed because it was made before the call to Initialize."},133:{basicMessage:"Store Data After Termination",detailMessage:"Call to SetValue failed because it was made after the call to Terminate."},142:{basicMessage:"Commit Before Initialization",detailMessage:"Call to Commit failed because it was made before the call to Initialize."},143:{basicMessage:"Commit After Termination",detailMessage:"Call to Commit failed because it was made after the call to Terminate."},201:{basicMessage:"General Argument Error",detailMessage:"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument."},301:{basicMessage:"General Get Failure",detailMessage:"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},351:{basicMessage:"General Set Failure",detailMessage:"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},391:{basicMessage:"General Commit Failure",detailMessage:"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information."},401:{basicMessage:"Undefined Data Model Element",detailMessage:"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element."},402:{basicMessage:"Unimplemented Data Model Element",detailMessage:"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant."},403:{basicMessage:"Data Model Element Value Not Initialized",detailMessage:"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO."},404:{basicMessage:"Data Model Element Is Read Only",detailMessage:"SetValue was called with a data model element that can only be read."},405:{basicMessage:"Data Model Element Is Write Only",detailMessage:"GetValue was called on a data model element that can only be written to."},406:{basicMessage:"Data Model Element Type Mismatch",detailMessage:"SetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Data Model Element Value Out Of Range",detailMessage:"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}}};t.A=o},56:function(e,t,i){var r,n,o;i.d(t,{K$:function(){return r},YE:function(){return n},lC:function(){return o}}),function(e){e.unknown="unknown",e.true="true",e.false="false"}(r||(r={})),function(e){e.passed="passed",e.failed="failed",e.unknown="unknown"}(n||(n={})),function(e){e.completed="completed",e.incomplete="incomplete",e.unknown="unknown"}(o||(o={}))},797:function(e,t,i){var r=i(635),n={GENERAL:101,INITIALIZATION_FAILED:101,INITIALIZED:101,TERMINATED:101,TERMINATION_FAILURE:101,TERMINATION_BEFORE_INIT:101,MULTIPLE_TERMINATION:101,RETRIEVE_BEFORE_INIT:101,RETRIEVE_AFTER_TERM:101,STORE_BEFORE_INIT:101,STORE_AFTER_TERM:101,COMMIT_BEFORE_INIT:101,COMMIT_AFTER_TERM:101,ARGUMENT_ERROR:101,CHILDREN_ERROR:101,COUNT_ERROR:101,GENERAL_GET_FAILURE:101,GENERAL_SET_FAILURE:101,GENERAL_COMMIT_FAILURE:101,UNDEFINED_DATA_MODEL:101,UNIMPLEMENTED_ELEMENT:101,VALUE_NOT_INITIALIZED:101,INVALID_SET_VALUE:101,READ_ONLY_ELEMENT:101,WRITE_ONLY_ELEMENT:101,TYPE_MISMATCH:101,VALUE_OUT_OF_RANGE:101,DEPENDENCY_NOT_ESTABLISHED:101},o={scorm12:(0,r.Cl)((0,r.Cl)({},n),{RETRIEVE_BEFORE_INIT:301,STORE_BEFORE_INIT:301,COMMIT_BEFORE_INIT:301,ARGUMENT_ERROR:201,CHILDREN_ERROR:202,COUNT_ERROR:203,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:401,VALUE_NOT_INITIALIZED:301,INVALID_SET_VALUE:402,READ_ONLY_ELEMENT:403,WRITE_ONLY_ELEMENT:404,TYPE_MISMATCH:405,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408}),scorm2004:(0,r.Cl)((0,r.Cl)({},n),{INITIALIZATION_FAILED:102,INITIALIZED:103,TERMINATED:104,TERMINATION_FAILURE:111,TERMINATION_BEFORE_INIT:112,MULTIPLE_TERMINATIONS:113,RETRIEVE_BEFORE_INIT:122,RETRIEVE_AFTER_TERM:123,STORE_BEFORE_INIT:132,STORE_AFTER_TERM:133,COMMIT_BEFORE_INIT:142,COMMIT_AFTER_TERM:143,ARGUMENT_ERROR:201,GENERAL_GET_FAILURE:301,GENERAL_SET_FAILURE:351,GENERAL_COMMIT_FAILURE:391,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:402,VALUE_NOT_INITIALIZED:403,READ_ONLY_ELEMENT:404,WRITE_ONLY_ELEMENT:405,TYPE_MISMATCH:406,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408})};t.A=o},417:function(e,t,i){var r=i(635),n={CMIString256:"^.{0,255}$",CMIString4096:"^.{0,4096}$",CMITime:"^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",CMITimespan:"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{0,3})(.[0-9]*)?$",CMIIdentifier:"^[\\u0021-\\u007E\\s]{0,255}$",CMIFeedback:"^.{0,255}$",CMIIndex:"[._](\\d+).",CMIStatus:"^(passed|completed|failed|incomplete|browsed)$",CMIStatus2:"^(passed|completed|failed|incomplete|browsed|not attempted)$",CMIExit:"^(time-out|suspend|logout|)$",CMIType:"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$",CMIResult:"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$",NAVEvent:"^(previous|continue)$",score_range:"0#100",audio_range:"-1#100",speed_range:"-100#100",weighting_range:"-100#100",text_range:"-1#1"},o={aicc:(0,r.Cl)((0,r.Cl)({},n),{CMIIdentifier:"^\\w{1,255}$"}),scorm12:n,scorm2004:{CMIString200:"^[\\u0000-\\uFFFF]{0,200}$",CMIString250:"^[\\u0000-\\uFFFF]{0,250}$",CMIString1000:"^[\\u0000-\\uFFFF]{0,1000}$",CMIString4000:"^[\\u0000-\\uFFFF]{0,4000}$",CMIString64000:"^[\\u0000-\\uFFFF]{0,64000}$",CMILang:"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$",CMILangString250:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$",CMILangcr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$",CMILangString250cr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$",CMILangString4000:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$",CMITime:"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$",CMITimespan:"^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{1,5})(\\.[0-9]{1,18})?$",CMIIdentifier:"^\\S{1,250}[a-zA-Z0-9]$",CMIShortIdentifier:"^[\\w\\.\\-\\_]{1,250}$",CMILongIdentifier:"^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$",CMIFeedback:"^.*$",CMIIndex:"[._](\\d+).",CMIIndexStore:".N(\\d+).",CMICStatus:"^(completed|incomplete|not attempted|unknown)$",CMISStatus:"^(passed|failed|unknown)$",CMIExit:"^(time-out|suspend|logout|normal)$",CMIType:"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",CMIResult:"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",NAVEvent:"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$",NAVBoolean:"^(unknown|true|false$)",NAVTarget:"^{target=\\S{0,}[a-zA-Z0-9-_]+}$",scaled_range:"-1#1",audio_range:"0#*",speed_range:"0#*",text_range:"-1#1",progress_range:"0#1"}};t.A=o},784:function(e,t,i){i.d(t,{$h:function(){return c},gv:function(){return h},tQ:function(){return u},wq:function(){return _},yI:function(){return l}});var r=i(635),n=i(340),o=n.A.scorm12.error_descriptions,s=n.A.aicc.error_descriptions,a=n.A.scorm2004.error_descriptions,c=function(e){function t(t){var i=e.call(this,t.toString())||this;return i._errorCode=t,i.name="ScormValidationError",i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"errorCode",{get:function(){return this._errorCode},enumerable:!1,configurable:!0}),t.prototype.setMessage=function(e){this.message=e},t}(Error),l=function(e){function t(t,i,r){var n=e.call(this,t)||this;return n._detailedMessage="",n.setMessage(i),n._errorMessage=i,r&&(n._detailedMessage=r),n}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"errorMessage",{get:function(){return this._errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"detailedMessage",{get:function(){return this._detailedMessage},enumerable:!1,configurable:!0}),t}(c),u=function(e){function t(t){return{}.hasOwnProperty.call(o,String(t))?e.call(this,t,o[String(t)].basicMessage,o[String(t)].detailMessage)||this:e.call(this,101,o[101].basicMessage,o[101].detailMessage)||this}return(0,r.C6)(t,e),t}(l),h=function(e){function t(t){return{}.hasOwnProperty.call(s,String(t))?e.call(this,t,s[String(t)].basicMessage,s[String(t)].detailMessage)||this:e.call(this,101,s[101].basicMessage,s[101].detailMessage)||this}return(0,r.C6)(t,e),t}(l),_=function(e){function t(t){return{}.hasOwnProperty.call(a,String(t))?e.call(this,t,a[String(t)].basicMessage,a[String(t)].detailMessage)||this:e.call(this,101,a[101].basicMessage,a[101].detailMessage)||this}return(0,r.C6)(t,e),t}(l)},864:function(e,t,i){i.d(t,{$o:function(){return l},Bq:function(){return h},HT:function(){return u},J6:function(){return p},OI:function(){return c},UZ:function(){return o},f4:function(){return a},hw:function(){return d},sB:function(){return _},xE:function(){return s}});var r=3600,n={D:24*r,H:r,M:60,S:1};function o(e){if(!e||e<=0)return"00:00:00";var t=Math.floor(e/r),i=new Date(1e3*e),n=i.getUTCMinutes(),o=i.getSeconds(),s=e%1,a="";return m(s)>0&&(a="."+(a=m(s)>2?s.toFixed(2):String(s)).split(".")[1]),(t+":"+n+":"+o).replace(/\b\d\b/g,"0$&")+a}function s(e){if(!e||e<=0)return"PT0S";var t="P",i=e;for(var r in n){var o=n[r],s=Math.floor(i/o);m(i%=o)>2&&(i=Number(Number(i).toFixed(2))),"S"===r&&i>0&&(s+=i),s&&((t.indexOf("D")>0||"H"===r||"M"===r||"S"===r)&&-1===t.indexOf("T")&&(t+="T"),t+="".concat(s).concat(r))}return t}function a(e,t){if("number"!=typeof e&&"boolean"!=typeof e||(e=String(e)),"string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var i=e.split(":");return 3600*Number(i[0])+60*Number(i[1])+Number(i[2])}function c(e,t){if("string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var i=new RegExp(t).exec(e)||[],r=i[1],n=(i[2],i[4]),o=i[5],s=i[6],a=i[7],c=0;return c+=Number(a)||0,c+=60*Number(s)||0,c+=3600*Number(o)||0,c+=86400*Number(n)||0,c+=31536e3*Number(r)||0}function l(e,t,i){var r="string"==typeof i?new RegExp(i):i;return s(c(e,r)+c(t,r))}function u(e,t,i){return"string"==typeof i&&(i=new RegExp(i)),o(a(e,i)+a(t,i))}function h(e){var t={};return function e(i,r){if(Object(i)!==i)t[r]=i;else if(Array.isArray(i))for(var n=0,o=i.length;n0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1] {\n if (typeof response !== \"undefined\") {\n const httpResult = JSON.parse(await response.text());\n if (\n httpResult === null ||\n !{}.hasOwnProperty.call(httpResult, \"result\")\n ) {\n if (response.status === 200) {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n }\n } else {\n return {\n result: httpResult.result,\n errorCode: httpResult.errorCode\n ? httpResult.errorCode\n : httpResult.result === APIConstants.global.SCORM_TRUE\n ? 0\n : 101,\n };\n }\n }\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n },\n requestHandler: function (commitObject) {\n return commitObject;\n },\n onLogMessage: function (messageLevel, logMessage) {\n switch (messageLevel) {\n case APIConstants.global.LOG_LEVEL_ERROR:\n console.error(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_WARNING:\n console.warn(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_INFO:\n console.info(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_DEBUG:\n if (console.debug) {\n console.debug(logMessage);\n } else {\n console.log(logMessage);\n }\n break;\n }\n },\n scoItemIds: [],\n scoItemIdValidator: false,\n};\n","import BaseAPI from \"../BaseAPI\";\n\n/**\n * Private class that wraps a timeout call to the commit() function\n */\nexport class ScheduledCommit {\n private _API;\n private _cancelled = false;\n private readonly _timeout;\n private readonly _callback;\n\n /**\n * Constructor for ScheduledCommit\n * @param {BaseAPI} API\n * @param {number} when\n * @param {string} callback\n */\n constructor(API: BaseAPI, when: number, callback: string) {\n this._API = API;\n this._timeout = setTimeout(this.wrapper.bind(this), when);\n this._callback = callback;\n }\n\n /**\n * Cancel any currently scheduled commit\n */\n cancel() {\n this._cancelled = true;\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n }\n\n /**\n * Wrap the API commit call to check if the call has already been cancelled\n */\n wrapper() {\n if (!this._cancelled) {\n (async () => await this._API.commit(this._callback))();\n }\n }\n}\n","import { CMIArray } from \"./cmi/common/array\";\nimport { ValidationError } from \"./exceptions\";\nimport ErrorCodes, { ErrorCode } from \"./constants/error_codes\";\nimport APIConstants from \"./constants/api_constants\";\nimport { formatMessage, stringMatches, unflatten } from \"./utilities\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { debounce } from \"./utilities/debounce\";\nimport {\n RefObject,\n CommitObject,\n ResultObject,\n Settings,\n} from \"./types/api_types\";\nimport { DefaultSettings } from \"./constants/default_settings\";\nimport { IBaseAPI } from \"./interfaces/IBaseAPI\";\nimport { ScheduledCommit } from \"./helpers/scheduled_commit\";\n\n/**\n * Base API class for AICC, SCORM 1.2, and SCORM 2004. Should be considered\n * abstract, and never initialized on its own.\n */\nexport default abstract class BaseAPI implements IBaseAPI {\n private _timeout?: ScheduledCommit;\n private readonly _error_codes: ErrorCode;\n private _settings: Settings = DefaultSettings;\n\n /**\n * Constructor for Base API class. Sets some shared API fields, as well as\n * sets up options for the API.\n * @param {ErrorCode} error_codes\n * @param {Settings} settings\n */\n protected constructor(error_codes: ErrorCode, settings?: Settings) {\n if (new.target === BaseAPI) {\n throw new TypeError(\"Cannot construct BaseAPI instances directly\");\n }\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n\n this._error_codes = error_codes;\n\n if (settings) {\n this.settings = settings;\n }\n this.apiLogLevel = this.settings.logLevel;\n this.selfReportSessionTime = this.settings.selfReportSessionTime;\n }\n\n public abstract cmi: BaseCMI;\n public startingData?: RefObject;\n\n public currentState: number;\n public lastErrorCode: string;\n public listenerArray: any[];\n public apiLogLevel: number;\n public selfReportSessionTime: boolean;\n\n abstract reset(settings?: Settings): void;\n\n /**\n * Common reset method for all APIs. New settings are merged with the existing settings.\n * @param {Settings} settings\n * @protected\n */\n commonReset(settings?: Settings): void {\n this.settings = { ...this.settings, ...settings };\n\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n }\n\n /**\n * Initialize the API\n * @param {string} callbackName\n * @param {string} initializeMessage\n * @param {string} terminationMessage\n * @return {string}\n */\n initialize(\n callbackName: string,\n initializeMessage?: string,\n terminationMessage?: string,\n ): string {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);\n } else if (this.isTerminated()) {\n this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage);\n } else {\n if (this.selfReportSessionTime) {\n this.cmi.setStartTime();\n }\n\n this.currentState = APIConstants.global.STATE_INITIALIZED;\n this.lastErrorCode = \"0\";\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n abstract lmsInitialize(): string;\n\n abstract lmsFinish(): string;\n\n abstract lmsGetValue(CMIElement: string): string;\n\n abstract lmsSetValue(CMIElement: string, value: any): string;\n\n abstract lmsCommit(): string;\n\n abstract lmsGetLastError(): string;\n\n abstract lmsGetErrorString(CMIErrorCode: string | number): string;\n\n abstract lmsGetDiagnostic(CMIErrorCode: string | number): string;\n\n /**\n * Abstract method for validating that a response is correct.\n *\n * @param {string} _CMIElement\n * @param {any} _value\n */\n abstract validateCorrectResponse(_CMIElement: string, _value: any): void;\n\n /**\n * Gets or builds a new child element to add to the array.\n * APIs that inherit BaseAPI should override this method.\n *\n * @param {string} _CMIElement - unused\n * @param {*} _value - unused\n * @param {boolean} _foundFirstIndex - unused\n * @return {BaseCMI|null}\n * @abstract\n */\n abstract getChildElement(\n _CMIElement: string,\n _value: any,\n _foundFirstIndex: boolean,\n ): BaseCMI | null;\n\n /**\n * Attempts to store the data to the LMS, logs data if no LMS configured\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _calculateTotalTime\n * @return {ResultObject}\n * @abstract\n */\n abstract storeData(_calculateTotalTime: boolean): Promise;\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _terminateCommit\n * @return {RefObject|Array}\n * @abstract\n */\n abstract renderCommitCMI(_terminateCommit: boolean): RefObject | Array;\n\n /**\n * Render the commit object to the shortened format for LMS commit\n * @param {boolean} _terminateCommit\n * @return {CommitObject}\n */\n abstract renderCommitObject(_terminateCommit: boolean): CommitObject;\n\n /**\n * Logging for all SCORM actions\n *\n * @param {string} functionName\n * @param {string} logMessage\n * @param {number} messageLevel\n * @param {string} CMIElement\n */\n apiLog(\n functionName: string,\n logMessage: string,\n messageLevel: number,\n CMIElement?: string,\n ) {\n logMessage = formatMessage(functionName, logMessage, CMIElement);\n\n if (messageLevel >= this.apiLogLevel) {\n this.settings.onLogMessage(messageLevel, logMessage);\n }\n }\n\n /**\n * Getter for _error_codes\n * @return {ErrorCode}\n */\n get error_codes(): ErrorCode {\n return this._error_codes;\n }\n\n /**\n * Getter for _settings\n * @return {Settings}\n */\n get settings(): Settings {\n return this._settings;\n }\n\n /**\n * Setter for _settings\n * @param {Settings} settings\n */\n set settings(settings: Settings) {\n this._settings = { ...this._settings, ...settings };\n }\n\n /**\n * Terminates the current run of the API\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async terminate(\n callbackName: string,\n checkTerminated: boolean,\n ): Promise {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.TERMINATION_BEFORE_INIT,\n this._error_codes.MULTIPLE_TERMINATION,\n )\n ) {\n this.currentState = APIConstants.global.STATE_TERMINATED;\n\n const result: ResultObject = await this.storeData(true);\n if (typeof result.errorCode !== \"undefined\" && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Get the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @return {string}\n */\n getValue(\n callbackName: string,\n checkTerminated: boolean,\n CMIElement: string,\n ): string {\n let returnValue: string = \"\";\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.RETRIEVE_BEFORE_INIT,\n this._error_codes.RETRIEVE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.getCMIValue(CMIElement);\n } catch (e) {\n returnValue = this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement);\n }\n\n this.apiLog(\n callbackName,\n \": returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n\n if (returnValue === undefined) {\n return \"\";\n }\n\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Sets the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {string} commitCallback\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setValue(\n callbackName: string,\n commitCallback: string,\n checkTerminated: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (value !== undefined) {\n value = String(value);\n }\n let returnValue: string = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.STORE_BEFORE_INIT,\n this._error_codes.STORE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.setCMIValue(CMIElement, value);\n } catch (e) {\n this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement, value);\n }\n\n if (returnValue === undefined) {\n returnValue = APIConstants.global.SCORM_FALSE;\n }\n\n // If we didn't have any errors while setting the data, go ahead and\n // schedule a commit, if autocommit is turned on\n if (String(this.lastErrorCode) === \"0\") {\n if (this.settings.autocommit && !this._timeout) {\n this.scheduleCommit(\n this.settings.autocommitSeconds * 1000,\n commitCallback,\n );\n }\n }\n\n this.apiLog(\n callbackName,\n \": \" + value + \": result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Orders LMS to store all content parameters\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async commit(\n callbackName: string,\n checkTerminated: boolean = false,\n ): Promise {\n this.clearScheduledCommit();\n\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.COMMIT_BEFORE_INIT,\n this._error_codes.COMMIT_AFTER_TERM,\n )\n ) {\n const result = await this.storeData(false);\n if (result.errorCode && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n this.apiLog(\n callbackName,\n \" Result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"HttpRequest\",\n );\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Returns last error code\n * @param {string} callbackName\n * @return {string}\n */\n getLastError(callbackName: string): string {\n const returnValue = String(this.lastErrorCode);\n\n this.processListeners(callbackName);\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getErrorString(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getDiagnostic(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Checks the LMS state and ensures it has been initialized.\n *\n * @param {boolean} checkTerminated\n * @param {number} beforeInitError\n * @param {number} afterTermError\n * @return {boolean}\n */\n checkState(\n checkTerminated: boolean,\n beforeInitError: number,\n afterTermError: number,\n ): boolean {\n if (this.isNotInitialized()) {\n this.throwSCORMError(beforeInitError);\n return false;\n } else if (checkTerminated && this.isTerminated()) {\n this.throwSCORMError(afterTermError);\n return false;\n }\n\n return true;\n }\n\n /**\n * Returns the message that corresponds to errorNumber\n * APIs that inherit BaseAPI should override this function\n *\n * @param {(string|number)} _errorNumber\n * @param {boolean} _detail\n * @return {string}\n * @abstract\n */\n getLmsErrorMessageDetails(\n _errorNumber: string | number,\n _detail: boolean = false,\n ): string {\n throw new Error(\n \"The getLmsErrorMessageDetails method has not been implemented\",\n );\n }\n\n /**\n * Gets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @return {string}\n * @abstract\n */\n getCMIValue(_CMIElement: string): string {\n throw new Error(\"The getCMIValue method has not been implemented\");\n }\n\n /**\n * Sets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @param {any} _value\n * @return {string}\n * @abstract\n */\n setCMIValue(_CMIElement: string, _value: any): string {\n throw new Error(\"The setCMIValue method has not been implemented\");\n }\n\n /**\n * Shared API method to set a valid for a given element.\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n _commonSetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (!CMIElement || CMIElement === \"\") {\n return APIConstants.global.SCORM_FALSE;\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let returnValue = APIConstants.global.SCORM_FALSE;\n let foundFirstIndex = false;\n\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n const attribute = structure[idx];\n\n if (idx === structure.length - 1) {\n if (scorm2004 && attribute.substring(0, 8) === \"{target=\") {\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);\n } else {\n refObject = {\n ...refObject,\n attribute: value,\n };\n }\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (\n stringMatches(CMIElement, \"\\\\.correct_responses\\\\.\\\\d+\") &&\n this.isInitialized()\n ) {\n this.validateCorrectResponse(CMIElement, value);\n }\n\n if (!scorm2004 || this.lastErrorCode === \"0\") {\n refObject[attribute] = value;\n returnValue = APIConstants.global.SCORM_TRUE;\n }\n }\n } else {\n refObject = refObject[attribute];\n if (!refObject) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n foundFirstIndex = true;\n } else {\n const newChild = this.getChildElement(\n CMIElement,\n value,\n foundFirstIndex,\n );\n foundFirstIndex = true;\n\n if (!newChild) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (refObject.initialized) newChild.initialize();\n\n refObject.childArray.push(newChild);\n refObject = newChild;\n }\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n }\n\n if (returnValue === APIConstants.global.SCORM_FALSE) {\n this.apiLog(\n methodName,\n `There was an error setting the value for: ${CMIElement}, value of: ${value}`,\n APIConstants.global.LOG_LEVEL_WARNING,\n );\n }\n\n return returnValue;\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @return {any}\n */\n _commonGetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n ): any {\n if (!CMIElement || CMIElement === \"\") {\n return \"\";\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let attribute = null;\n\n const uninitializedErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) has not been initialized.`;\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n attribute = structure[idx];\n\n if (!scorm2004) {\n if (idx === structure.length - 1) {\n if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n } else {\n if (\n String(attribute).substring(0, 8) === \"{target=\" &&\n typeof refObject._isTargetValid == \"function\"\n ) {\n const target = String(attribute).substring(\n 8,\n String(attribute).length - 9,\n );\n return refObject._isTargetValid(target);\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n\n refObject = refObject[attribute];\n if (refObject === undefined) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n } else {\n this.throwSCORMError(\n this._error_codes.VALUE_NOT_INITIALIZED,\n uninitializedErrorMessage,\n );\n break;\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n\n if (refObject === null || refObject === undefined) {\n if (!scorm2004) {\n if (attribute === \"_children\") {\n this.throwSCORMError(ErrorCodes.scorm12.CHILDREN_ERROR);\n } else if (attribute === \"_count\") {\n this.throwSCORMError(ErrorCodes.scorm12.COUNT_ERROR);\n }\n }\n } else {\n return refObject;\n }\n }\n\n /**\n * Returns true if the API's current state is STATE_INITIALIZED\n *\n * @return {boolean}\n */\n isInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_NOT_INITIALIZED\n *\n * @return {boolean}\n */\n isNotInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_NOT_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_TERMINATED\n *\n * @return {boolean}\n */\n isTerminated(): boolean {\n return this.currentState === APIConstants.global.STATE_TERMINATED;\n }\n\n /**\n * Provides a mechanism for attaching to a specific SCORM event\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n on(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray.push({\n functionName: functionName,\n CMIElement: CMIElement,\n callback: callback,\n });\n\n this.apiLog(\n \"on\",\n `Added event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n\n /**\n * Provides a mechanism for detaching a specific SCORM event listener\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n off(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n const removeIndex = this.listenerArray.findIndex(\n (obj) =>\n obj.functionName === functionName &&\n obj.CMIElement === CMIElement &&\n obj.callback === callback,\n );\n if (removeIndex !== -1) {\n this.listenerArray.splice(removeIndex, 1);\n this.apiLog(\n \"off\",\n `Removed event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n }\n\n /**\n * Provides a mechanism for clearing all listeners from a specific SCORM event\n *\n * @param {string} listenerName\n */\n clear(listenerName: string) {\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray = this.listenerArray.filter(\n (obj) =>\n obj.functionName !== functionName && obj.CMIElement !== CMIElement,\n );\n }\n }\n\n /**\n * Processes any 'on' listeners that have been created\n *\n * @param {string} functionName\n * @param {string} CMIElement\n * @param {any} value\n */\n processListeners(functionName: string, CMIElement?: string, value?: any) {\n this.apiLog(\n functionName,\n value,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n for (let i = 0; i < this.listenerArray.length; i++) {\n const listener = this.listenerArray[i];\n const functionsMatch = listener.functionName === functionName;\n const listenerHasCMIElement = !!listener.CMIElement;\n let CMIElementsMatch = false;\n if (\n CMIElement &&\n listener.CMIElement &&\n listener.CMIElement.substring(listener.CMIElement.length - 1) === \"*\"\n ) {\n CMIElementsMatch =\n CMIElement.indexOf(\n listener.CMIElement.substring(0, listener.CMIElement.length - 1),\n ) === 0;\n } else {\n CMIElementsMatch = listener.CMIElement === CMIElement;\n }\n\n if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {\n this.apiLog(\n \"processListeners\",\n `Processing listener: ${listener.functionName}`,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n listener.callback(CMIElement, value);\n }\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} errorNumber\n * @param {string} message\n */\n throwSCORMError(errorNumber: number, message?: string) {\n if (!message) {\n message = this.getLmsErrorMessageDetails(errorNumber);\n }\n\n this.apiLog(\n \"throwSCORMError\",\n errorNumber + \": \" + message,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n\n this.lastErrorCode = String(errorNumber);\n }\n\n /**\n * Clears the last SCORM error code on success.\n *\n * @param {string} success\n */\n clearSCORMError(success: string) {\n if (success !== undefined && success !== APIConstants.global.SCORM_FALSE) {\n this.lastErrorCode = \"0\";\n }\n }\n\n /**\n * Load the CMI from a flattened JSON object\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromFlattenedJSON(json: RefObject, CMIElement?: string) {\n if (!CMIElement) {\n // by default, we start from a blank string because we're expecting each element to start with `cmi`\n CMIElement = \"\";\n }\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromFlattenedJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n /**\n * Tests two strings against a given regular expression pattern and determines a numeric or null result based on the matching criterion.\n *\n * @param {string} a - The first string to be tested against the pattern.\n * @param {string} c - The second string to be tested against the pattern.\n * @param {RegExp} a_pattern - The regular expression pattern to test the strings against.\n * @return {number | null} A numeric result based on the matching criterion, or null if the strings do not match the pattern.\n */\n function testPattern(\n a: string,\n c: string,\n a_pattern: RegExp,\n ): number | null {\n const a_match = a.match(a_pattern);\n\n let c_match;\n if (a_match !== null && (c_match = c.match(a_pattern)) !== null) {\n const a_num = Number(a_match[2]);\n const c_num = Number(c_match[2]);\n if (a_num === c_num) {\n if (a_match[3] === \"id\") {\n return -1;\n } else if (a_match[3] === \"type\") {\n if (c_match[3] === \"id\") {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 1;\n }\n }\n return a_num - c_num;\n }\n\n return null;\n }\n\n const int_pattern = /^(cmi\\.interactions\\.)(\\d+)\\.(.*)$/;\n const obj_pattern = /^(cmi\\.objectives\\.)(\\d+)\\.(.*)$/;\n\n const result = Object.keys(json).map(function (key) {\n return [String(key), json[key]];\n });\n\n // CMI interactions need to have id and type loaded before any other fields\n result.sort(function ([a, _b], [c, _d]) {\n let test;\n if ((test = testPattern(a, c, int_pattern)) !== null) {\n return test;\n }\n if ((test = testPattern(a, c, obj_pattern)) !== null) {\n return test;\n }\n\n if (a < c) {\n return -1;\n }\n if (a > c) {\n return 1;\n }\n return 0;\n });\n\n let obj: RefObject;\n result.forEach((element) => {\n obj = {};\n obj[element[0]] = element[1];\n this.loadFromJSON(unflatten(obj), CMIElement);\n });\n }\n\n /**\n * Loads CMI data from a JSON object.\n *\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromJSON(json: RefObject, CMIElement: string) {\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n CMIElement = CMIElement !== undefined ? CMIElement : \"cmi\";\n\n this.startingData = json;\n\n // could this be refactored down to flatten(json) then setCMIValue on each?\n for (const key in json) {\n if ({}.hasOwnProperty.call(json, key) && json[key]) {\n const currentCMIElement = (CMIElement ? CMIElement + \".\" : \"\") + key;\n const value = json[key];\n\n if (value[\"childArray\"]) {\n for (let i = 0; i < value[\"childArray\"].length; i++) {\n this.loadFromJSON(\n value[\"childArray\"][i],\n currentCMIElement + \".\" + i,\n );\n }\n } else if (value.constructor === Object) {\n this.loadFromJSON(value, currentCMIElement);\n } else {\n this.setCMIValue(currentCMIElement, value);\n }\n }\n }\n }\n\n /**\n * Render the CMI object to JSON for sending to an LMS.\n *\n * @return {string}\n */\n renderCMIToJSONString(): string {\n const cmi = this.cmi;\n // Do we want/need to return fields that have no set value?\n if (this.settings.sendFullCommit) {\n return JSON.stringify({ cmi });\n }\n return JSON.stringify({ cmi }, (k, v) => (v === undefined ? null : v), 2);\n }\n\n /**\n * Returns a JS object representing the current cmi\n * @return {object}\n */\n renderCMIToJSONObject(): object {\n return JSON.parse(this.renderCMIToJSONString());\n }\n\n /**\n * Send the request to the LMS\n * @param {string} url\n * @param {CommitObject|RefObject|Array} params\n * @param {boolean} immediate\n * @return {ResultObject}\n */\n async processHttpRequest(\n url: string,\n params: CommitObject | RefObject | Array,\n immediate: boolean = false,\n ): Promise {\n const api = this;\n const genericError: ResultObject = {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: this.error_codes.GENERAL,\n };\n\n // if we are terminating the module or closing the browser window/tab, we need to make this fetch ASAP.\n // Some browsers, especially Chrome, do not like synchronous requests to be made when the window is closing.\n if (immediate) {\n this.performFetch(url, params).then(async (response) => {\n await this.transformResponse(response);\n });\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n\n const process = async (\n url: string,\n params: CommitObject | RefObject | Array,\n settings: Settings,\n ): Promise => {\n try {\n params = settings.requestHandler(params);\n const response = await this.performFetch(url, params);\n\n return this.transformResponse(response);\n } catch (e) {\n this.apiLog(\n \"processHttpRequest\",\n e,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n api.processListeners(\"CommitError\");\n return genericError;\n }\n };\n\n if (this.settings.asyncCommit) {\n const debouncedProcess = debounce(process, 500, immediate);\n debouncedProcess(url, params, this.settings);\n\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return await process(url, params, this.settings);\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} when - the number of milliseconds to wait before committing\n * @param {string} callback - the name of the commit event callback\n */\n scheduleCommit(when: number, callback: string) {\n this._timeout = new ScheduledCommit(this, when, callback);\n this.apiLog(\n \"scheduleCommit\",\n \"scheduled\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n\n /**\n * Clears and cancels any currently scheduled commits\n */\n clearScheduledCommit() {\n if (this._timeout) {\n this._timeout.cancel();\n this._timeout = undefined;\n this.apiLog(\n \"clearScheduledCommit\",\n \"cleared\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n }\n\n /**\n * Check to see if the specific object has the given property\n * @param {RefObject} refObject\n * @param {string} attribute\n * @return {boolean}\n * @private\n */\n private _checkObjectHasProperty(\n refObject: RefObject,\n attribute: string,\n ): boolean {\n return (\n Object.hasOwnProperty.call(refObject, attribute) ||\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(refObject),\n attribute,\n ) != null ||\n attribute in refObject\n );\n }\n\n /**\n * Handles the error that occurs when trying to access a value\n * @param {any} e\n * @param {string} returnValue\n * @return {string}\n * @private\n */\n private handleValueAccessException(e: any, returnValue: string): string {\n if (e instanceof ValidationError) {\n this.lastErrorCode = String(e.errorCode);\n returnValue = APIConstants.global.SCORM_FALSE;\n } else {\n if (e instanceof Error && e.message) {\n console.error(e.message);\n } else {\n console.error(e);\n }\n this.throwSCORMError(this._error_codes.GENERAL);\n }\n return returnValue;\n }\n\n /**\n * Perform the fetch request to the LMS\n * @param {string} url\n * @param {RefObject|Array} params\n * @return {Promise}\n * @private\n */\n private async performFetch(\n url: string,\n params: RefObject | Array,\n ): Promise {\n return fetch(url, {\n method: \"POST\",\n body: params instanceof Array ? params.join(\"&\") : JSON.stringify(params),\n headers: {\n ...this.settings.xhrHeaders,\n \"Content-Type\": this.settings.commitRequestDataType,\n },\n credentials: this.settings.xhrWithCredentials ? \"include\" : undefined,\n keepalive: true,\n });\n }\n\n /**\n * Transforms the response from the LMS to a ResultObject\n * @param {Response} response\n * @return {Promise}\n * @private\n */\n private async transformResponse(response: Response): Promise {\n const result =\n typeof this.settings.responseHandler === \"function\"\n ? await this.settings.responseHandler(response)\n : await response.json();\n\n if (\n response.status >= 200 &&\n response.status <= 299 &&\n (result.result === true ||\n result.result === APIConstants.global.SCORM_TRUE)\n ) {\n this.processListeners(\"CommitSuccess\");\n } else {\n this.processListeners(\"CommitError\");\n }\n return result;\n }\n}\n","/**\n * Debounce function to delay the execution of a given function.\n *\n * @param func - The function to debounce.\n * @param wait - The number of milliseconds to delay.\n * @param immediate - If `true`, the function will be triggered on the leading edge instead of the trailing.\n * @returns A debounced version of the provided function.\n */\nexport function debounce void>(\n func: T,\n wait: number,\n immediate = false,\n): (...args: Parameters) => void {\n let timeout: ReturnType | null;\n\n return function (this: any, ...args: Parameters) {\n const context = this;\n\n const later = () => {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n const callNow = immediate && !timeout;\n\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) func.apply(context, args);\n };\n}\n","import { CMI } from \"./cmi/scorm12/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMIObjectivesObject } from \"./cmi/scorm12/objectives\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm12/interactions\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport Regex from \"./constants/regex\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\nimport BaseAPI from \"./BaseAPI\";\n\n/**\n * API class for SCORM 1.2\n */\nclass Scorm12Impl extends BaseAPI {\n /**\n * Constructor for SCORM 1.2 API\n * @param {object} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm12, settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n\n // Rename functions to match 1.2 Spec and expose to modules\n this.LMSInitialize = this.lmsInitialize;\n this.LMSFinish = this.lmsFinish;\n this.LMSGetValue = this.lmsGetValue;\n this.LMSSetValue = this.lmsSetValue;\n this.LMSCommit = this.lmsCommit;\n this.LMSGetLastError = this.lmsGetLastError;\n this.LMSGetErrorString = this.lmsGetErrorString;\n this.LMSGetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public statusSetByModule = false;\n\n cmi: CMI;\n nav: NAV;\n\n LMSInitialize: () => string;\n LMSFinish: () => string;\n LMSGetValue: (CMIElement: string) => string;\n LMSSetValue: (CMIElement: string, value: any) => string;\n LMSCommit: () => string;\n LMSGetLastError: () => string;\n LMSGetErrorString: (CMIErrorCode: string) => string;\n LMSGetDiagnostic: (CMIErrorCode: string) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * lmsInitialize function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n if (this.cmi.core.lesson_status) {\n this.statusSetByModule = true;\n } else {\n this.cmi.core.lesson_status = \"not attempted\";\n }\n return this.initialize(\n \"LMSInitialize\",\n \"LMS was already initialized!\",\n \"LMS is already finished!\",\n );\n }\n\n /**\n * LMSFinish function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"LMSFinish\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.nav.event !== \"\") {\n if (this.nav.event === \"continue\") {\n this.processListeners(\"SequenceNext\");\n } else {\n this.processListeners(\"SequencePrevious\");\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * LMSGetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n return this.getValue(\"LMSGetValue\", false, CMIElement);\n }\n\n /**\n * LMSSetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n if (CMIElement === \"cmi.core.lesson_status\") {\n this.statusSetByModule = true;\n }\n return this.setValue(\"LMSSetValue\", \"LMSCommit\", false, CMIElement, value);\n }\n\n /**\n * LMSCommit function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"LMSCommit\", false);\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * LMSGetLastError function from SCORM 1.2 Spec\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"LMSGetLastError\");\n }\n\n /**\n * LMSGetErrorString function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string): string {\n return this.getErrorString(\"LMSGetErrorString\", CMIErrorCode);\n }\n\n /**\n * LMSGetDiagnostic function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string): string {\n return this.getDiagnostic(\"LMSGetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"LMSSetValue\", false, CMIElement, value);\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"getCMIValue\", false, CMIElement);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {*} _value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n _value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsCorrectResponsesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObjectivesObject();\n } else if (\n !foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObject();\n }\n\n return null;\n }\n\n /**\n * Validates Correct Response values\n *\n * @param {string} _CMIElement\n * @param {*} _value\n */\n validateCorrectResponse(_CMIElement: string, _value: any) {\n // do nothing\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {number|string} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: number | string,\n detail: boolean,\n ): string {\n let basicMessage = \"No Error\";\n let detailMessage = \"No Error\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm12.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {Scorm12Impl} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm12Impl) {\n // Data Model\n this.cmi = newAPI.cmi;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeHHMMSS = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getTimeAsSeconds(\n totalTimeHHMMSS,\n Regex.scorm12.CMITimespan,\n );\n const lessonStatus = this.cmi.core.lesson_status;\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (lessonStatus) {\n completionStatus =\n lessonStatus === \"completed\" || lessonStatus === \"passed\"\n ? CompletionStatus.completed\n : CompletionStatus.incomplete;\n if (lessonStatus === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (lessonStatus === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.core.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n }\n\n const commitObject: CommitObject = {\n successStatus: successStatus,\n completionStatus: completionStatus,\n runtimeData: cmiExport,\n totalTimeSeconds: totalTimeSeconds,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n const originalStatus = this.cmi.core.lesson_status;\n if (\n !this.cmi.core.lesson_status ||\n (!this.statusSetByModule &&\n this.cmi.core.lesson_status === \"not attempted\")\n ) {\n this.cmi.core.lesson_status = \"completed\";\n }\n\n if (this.cmi.core.lesson_mode === \"normal\") {\n if (this.cmi.core.credit === \"credit\") {\n if (\n this.settings.mastery_override &&\n this.cmi.student_data.mastery_score !== \"\" &&\n this.cmi.core.score.raw !== \"\"\n ) {\n this.cmi.core.lesson_status =\n parseFloat(this.cmi.core.score.raw) >=\n parseFloat(this.cmi.student_data.mastery_score)\n ? \"passed\"\n : \"failed\";\n }\n }\n } else if (this.cmi.core.lesson_mode === \"browse\") {\n if (\n (this.startingData?.cmi?.core?.lesson_status || \"\") === \"\" &&\n originalStatus === \"not attempted\"\n ) {\n this.cmi.core.lesson_status = \"browsed\";\n }\n }\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n return await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n\nexport { Scorm12Impl };\n","import { checkValidFormat, checkValidRange } from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check2004ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n Scorm2004ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @return {boolean}\n */\nexport function check2004ValidRange(\n value: string,\n rangePattern: string,\n): boolean {\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm2004.VALUE_OUT_OF_RANGE,\n Scorm2004ValidationError,\n );\n}\n","/**\n * Class for SCORM 2004's cmi.learner_preference object\n */\nimport { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\nexport class CMILearnerPreference extends BaseCMI {\n private __children = APIConstants.scorm2004.student_preference_children;\n private _audio_level = \"1\";\n private _language = \"\";\n private _delivery_speed = \"1\";\n private _audio_captioning = \"0\";\n\n /**\n * Constructor for cmi.learner_preference\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for _audio_level\n * @return {string}\n */\n get audio_level(): string {\n return this._audio_level;\n }\n\n /**\n * Setter for _audio_level\n * @param {string} audio_level\n */\n set audio_level(audio_level: string) {\n if (\n check2004ValidFormat(audio_level, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(audio_level, Regex.scorm2004.audio_range)\n ) {\n this._audio_level = audio_level;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check2004ValidFormat(language, Regex.scorm2004.CMILang)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _delivery_speed\n * @return {string}\n */\n get delivery_speed(): string {\n return this._delivery_speed;\n }\n\n /**\n * Setter for _delivery_speed\n * @param {string} delivery_speed\n */\n set delivery_speed(delivery_speed: string) {\n if (\n check2004ValidFormat(delivery_speed, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(delivery_speed, Regex.scorm2004.speed_range)\n ) {\n this._delivery_speed = delivery_speed;\n }\n }\n\n /**\n * Getter for _audio_captioning\n * @return {string}\n */\n get audio_captioning(): string {\n return this._audio_captioning;\n }\n\n /**\n * Setter for _audio_captioning\n * @param {string} audio_captioning\n */\n set audio_captioning(audio_captioning: string) {\n if (\n check2004ValidFormat(audio_captioning, Regex.scorm2004.CMISInteger) &&\n check2004ValidRange(audio_captioning, Regex.scorm2004.text_range)\n ) {\n this._audio_captioning = audio_captioning;\n }\n }\n\n /**\n * toJSON for cmi.learner_preference\n *\n * @return {\n * {\n * audio_level: string,\n * language: string,\n * delivery_speed: string,\n * audio_captioning: string\n * }\n * }\n */\n toJSON(): {\n audio_level: string;\n language: string;\n delivery_speed: string;\n audio_captioning: string;\n } {\n this.jsonString = true;\n const result = {\n audio_level: this.audio_level,\n language: this.language,\n delivery_speed: this.delivery_speed,\n audio_captioning: this.audio_captioning,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import Regex from \"./regex\";\n\nconst scorm2004_regex = Regex.scorm2004;\nexport const LearnerResponses: Responses = {\n \"true-false\": {\n format: \"^true$|^false$\",\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n choice: {\n format: scorm2004_regex.CMILongIdentifier,\n max: 36,\n delimiter: \"[,]\",\n unique: true,\n },\n \"fill-in\": {\n format: scorm2004_regex.CMILangString250,\n max: 10,\n delimiter: \"[,]\",\n unique: false,\n },\n \"long-fill-in\": {\n format: scorm2004_regex.CMILangString4000,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n matching: {\n format: scorm2004_regex.CMIShortIdentifier,\n format2: scorm2004_regex.CMIShortIdentifier,\n max: 36,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n },\n performance: {\n format: \"^$|\" + scorm2004_regex.CMIShortIdentifier,\n format2:\n scorm2004_regex.CMIDecimal + \"|^$|\" + scorm2004_regex.CMIShortIdentifier,\n max: 250,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n },\n sequencing: {\n format: scorm2004_regex.CMIShortIdentifier,\n max: 36,\n delimiter: \"[,]\",\n unique: false,\n },\n likert: {\n format: scorm2004_regex.CMIShortIdentifier,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n numeric: {\n format: scorm2004_regex.CMIDecimal,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n other: {\n format: scorm2004_regex.CMIString4000,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n};\nexport const CorrectResponses: Responses = {\n \"true-false\": {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: \"^true$|^false$\",\n limit: 1,\n },\n choice: {\n max: 36,\n delimiter: \"[,]\",\n unique: true,\n duplicate: false,\n format: scorm2004_regex.CMILongIdentifier,\n },\n \"fill-in\": {\n max: 10,\n delimiter: \"[,]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMILangString250cr,\n },\n \"long-fill-in\": {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: true,\n format: scorm2004_regex.CMILangString4000,\n },\n matching: {\n max: 36,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n format2: scorm2004_regex.CMIShortIdentifier,\n },\n performance: {\n max: 250,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n delimiter3: \"[:]\",\n unique: false,\n duplicate: false,\n format: \"^$|\" + scorm2004_regex.CMIShortIdentifier,\n format2:\n scorm2004_regex.CMIDecimal + \"|^$|\" + scorm2004_regex.CMIShortIdentifier,\n },\n sequencing: {\n max: 36,\n delimiter: \"[,]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n },\n likert: {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n limit: 1,\n },\n numeric: {\n max: 2,\n delimiter: \"[:]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIDecimal,\n limit: 1,\n },\n other: {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIString4000,\n limit: 1,\n },\n};\n\nexport type ResponseType = {\n format: string;\n max: number;\n delimiter: string;\n unique: boolean;\n duplicate?: boolean;\n format2?: string;\n delimiter2?: string;\n limit?: number;\n delimiter3?: string;\n};\n\nexport type Responses = {\n [key: string]: ResponseType;\n};\n","/**\n * Class representing SCORM 2004's `cmi.interactions` object\n */\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { CMIArray } from \"../common/array\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\nimport { LearnerResponses } from \"../../constants/response_constants\";\n\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.objectives` Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.interactions_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class for SCORM 2004's cmi.interaction.n object\n */\n\nexport class CMIInteractionsObject extends BaseCMI {\n private _id = \"\";\n private _type = \"\";\n private _timestamp = \"\";\n private _weighting = \"\";\n private _learner_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n private _description = \"\";\n\n /**\n * Constructor for cmi.interaction.n\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n children: APIConstants.scorm2004.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n children: APIConstants.scorm2004.correct_responses_children,\n });\n }\n\n public objectives: CMIArray;\n public correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _type\n * @return {string}\n */\n get type(): string {\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(type, Regex.scorm2004.CMIType)) {\n this._type = type;\n }\n }\n }\n\n /**\n * Getter for _timestamp\n * @return {string}\n */\n get timestamp(): string {\n return this._timestamp;\n }\n\n /**\n * Setter for _timestamp\n * @param {string} timestamp\n */\n set timestamp(timestamp: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(timestamp, Regex.scorm2004.CMITime)) {\n this._timestamp = timestamp;\n }\n }\n }\n\n /**\n * Getter for _weighting\n * @return {string}\n */\n get weighting(): string {\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(weighting, Regex.scorm2004.CMIDecimal)) {\n this._weighting = weighting;\n }\n }\n }\n\n /**\n * Getter for _learner_response\n * @return {string}\n */\n get learner_response(): string {\n return this._learner_response;\n }\n\n /**\n * Setter for _learner_response. Does type validation to make sure response\n * matches SCORM 2004's spec\n * @param {string} learner_response\n */\n set learner_response(learner_response: string) {\n if (this.initialized && (this._type === \"\" || this._id === \"\")) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n let nodes = [];\n const response_type = LearnerResponses[this.type];\n\n if (response_type) {\n if (response_type?.delimiter) {\n nodes = learner_response.split(response_type.delimiter);\n } else {\n nodes[0] = learner_response;\n }\n\n if (nodes.length > 0 && nodes.length <= response_type.max) {\n const formatRegex = new RegExp(response_type.format);\n\n for (let i = 0; i < nodes.length; i++) {\n if (response_type?.delimiter2) {\n const values = nodes[i].split(response_type.delimiter2);\n\n if (values.length === 2) {\n if (!values[0].match(formatRegex)) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n } else {\n if (\n !response_type.format2 ||\n !values[1].match(new RegExp(response_type.format2))\n ) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n }\n } else {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n } else {\n if (!nodes[i].match(formatRegex)) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n } else {\n if (nodes[i] !== \"\" && response_type.unique) {\n for (let j = 0; j < i; j++) {\n if (nodes[i] === nodes[j]) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n }\n }\n }\n }\n }\n } else {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n );\n }\n\n this._learner_response = learner_response;\n } else {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n\n /**\n * Getter for _result\n * @return {string}\n */\n get result(): string {\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check2004ValidFormat(result, Regex.scorm2004.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency\n * @return {string}\n */\n get latency(): string {\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(latency, Regex.scorm2004.CMITimespan)) {\n this._latency = latency;\n }\n }\n }\n\n /**\n * Getter for _description\n * @return {string}\n */\n get description(): string {\n return this._description;\n }\n\n /**\n * Setter for _description\n * @param {string} description\n */\n set description(description: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(\n description,\n Regex.scorm2004.CMILangString250,\n true,\n )\n ) {\n this._description = description;\n }\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * type: string,\n * objectives: CMIArray,\n * timestamp: string,\n * correct_responses: CMIArray,\n * weighting: string,\n * learner_response: string,\n * result: string,\n * latency: string,\n * description: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n type: string;\n objectives: CMIArray;\n timestamp: string;\n correct_responses: CMIArray;\n weighting: string;\n learner_response: string;\n result: string;\n latency: string;\n description: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n type: this.type,\n objectives: this.objectives,\n timestamp: this.timestamp,\n weighting: this.weighting,\n learner_response: this.learner_response,\n result: this.result,\n latency: this.latency,\n description: this.description,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.interactions.n.objectives.n object\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n private _id = \"\";\n\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.interactions.n.correct_responses.n object\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n private _pattern = \"\";\n\n /**\n * Constructor for cmi.interactions.n.correct_responses.n\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check2004ValidFormat(pattern, Regex.scorm2004.CMIFeedback)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON cmi.interactions.n.correct_responses.n object\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this.pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","/**\n * Class for SCORM 2004's cmi *.score object\n */\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\n\nexport class Scorm2004CMIScore extends CMIScore {\n private _scaled = \"\";\n\n /**\n * Constructor for cmi *.score\n */\n constructor() {\n super({\n score_children: APIConstants.scorm2004.score_children,\n max: \"\",\n invalidErrorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n invalidTypeCode: ErrorCodes.scorm2004.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm2004.VALUE_OUT_OF_RANGE,\n decimalRegex: Regex.scorm2004.CMIDecimal,\n errorClass: Scorm2004ValidationError,\n });\n }\n\n /**\n * Getter for _scaled\n * @return {string}\n */\n get scaled(): string {\n return this._scaled;\n }\n\n /**\n * Setter for _scaled\n * @param {string} scaled\n */\n set scaled(scaled: string) {\n if (\n check2004ValidFormat(scaled, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(scaled, Regex.scorm2004.scaled_range)\n ) {\n this._scaled = scaled;\n }\n }\n\n /**\n * toJSON for cmi *.score\n *\n * @return {\n * {\n * scaled: string,\n * raw: string,\n * min: string,\n * max: string\n * }\n * }\n */\n toJSON(): {\n scaled: string;\n raw: string;\n min: string;\n max: string;\n } {\n this.jsonString = true;\n const result = {\n scaled: this.scaled,\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_lms object\n * @extends CMIArray\n */\nexport class CMICommentsFromLMS extends CMIArray {\n /**\n * Constructor for cmi.comments_from_lms Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.comments_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_learner object\n */\n\nexport class CMICommentsFromLearner extends CMIArray {\n /**\n * Constructor for cmi.comments_from_learner Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.comments_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_learner.n and cmi.comments_from_lms.n object\n */\n\nexport class CMICommentsObject extends BaseCMI {\n private _comment = \"\";\n private _location = \"\";\n private _timestamp = \"\";\n private readonly _readOnlyAfterInit: boolean;\n\n /**\n * Constructor for cmi.comments_from_learner.n and cmi.comments_from_lms.n\n * @param {boolean} readOnlyAfterInit\n */\n constructor(readOnlyAfterInit: boolean = false) {\n super();\n this._comment = \"\";\n this._location = \"\";\n this._timestamp = \"\";\n this._readOnlyAfterInit = readOnlyAfterInit;\n }\n\n /**\n * Getter for _comment\n * @return {string}\n */\n get comment(): string {\n return this._comment;\n }\n\n /**\n * Setter for _comment\n * @param {string} comment\n */\n set comment(comment: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (\n check2004ValidFormat(comment, Regex.scorm2004.CMILangString4000, true)\n ) {\n this._comment = comment;\n }\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (check2004ValidFormat(location, Regex.scorm2004.CMIString250)) {\n this._location = location;\n }\n }\n }\n\n /**\n * Getter for _timestamp\n * @return {string}\n */\n get timestamp(): string {\n return this._timestamp;\n }\n\n /**\n * Setter for _timestamp\n * @param {string} timestamp\n */\n set timestamp(timestamp: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (check2004ValidFormat(timestamp, Regex.scorm2004.CMITime)) {\n this._timestamp = timestamp;\n }\n }\n }\n\n /**\n * toJSON for cmi.comments_from_learner.n object\n * @return {\n * {\n * comment: string,\n * location: string,\n * timestamp: string\n * }\n * }\n */\n toJSON(): {\n comment: string;\n location: string;\n timestamp: string;\n } {\n this.jsonString = true;\n const result = {\n comment: this.comment,\n location: this.location,\n timestamp: this.timestamp,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { Scorm2004CMIScore } from \"./score\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing SCORM 2004's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives` Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.objectives_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class for SCORM 2004's cmi.objectives.n object\n */\nexport class CMIObjectivesObject extends BaseCMI {\n private _id = \"\";\n private _success_status = \"unknown\";\n private _completion_status = \"unknown\";\n private _progress_measure = \"\";\n private _description = \"\";\n\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new Scorm2004CMIScore();\n }\n\n public score: Scorm2004CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _success_status\n * @return {string}\n */\n get success_status(): string {\n return this._success_status;\n }\n\n /**\n * Setter for _success_status\n * @param {string} success_status\n */\n set success_status(success_status: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(success_status, Regex.scorm2004.CMISStatus)) {\n this._success_status = success_status;\n }\n }\n }\n\n /**\n * Getter for _completion_status\n * @return {string}\n */\n get completion_status(): string {\n return this._completion_status;\n }\n\n /**\n * Setter for _completion_status\n * @param {string} completion_status\n */\n set completion_status(completion_status: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(completion_status, Regex.scorm2004.CMICStatus)) {\n this._completion_status = completion_status;\n }\n }\n }\n\n /**\n * Getter for _progress_measure\n * @return {string}\n */\n get progress_measure(): string {\n return this._progress_measure;\n }\n\n /**\n * Setter for _progress_measure\n * @param {string} progress_measure\n */\n set progress_measure(progress_measure: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(progress_measure, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(progress_measure, Regex.scorm2004.progress_range)\n ) {\n this._progress_measure = progress_measure;\n }\n }\n }\n\n /**\n * Getter for _description\n * @return {string}\n */\n get description(): string {\n return this._description;\n }\n\n /**\n * Setter for _description\n * @param {string} description\n */\n set description(description: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(\n description,\n Regex.scorm2004.CMILangString250,\n true,\n )\n ) {\n this._description = description;\n }\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n *\n * @return {\n * {\n * id: string,\n * success_status: string,\n * completion_status: string,\n * progress_measure: string,\n * description: string,\n * score: Scorm2004CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n success_status: string;\n completion_status: string;\n progress_measure: string;\n description: string;\n score: Scorm2004CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n success_status: this.success_status,\n completion_status: this.completion_status,\n progress_measure: this.progress_measure,\n description: this.description,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport * as Util from \"../../utilities\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport { CMILearnerPreference } from \"./learner_preference\";\nimport { CMIInteractions } from \"./interactions\";\nimport { Scorm2004CMIScore } from \"./score\";\nimport { CMICommentsFromLearner, CMICommentsFromLMS } from \"./comments\";\nimport { CMIObjectives } from \"./objectives\";\n\n/**\n * Class representing cmi object for SCORM 2004\n */\nexport class CMI extends BaseRootCMI {\n /**\n * Constructor for the SCORM 2004 cmi object\n * @param {boolean} initialized\n */\n constructor(initialized: boolean = false) {\n super();\n this.learner_preference = new CMILearnerPreference();\n this.score = new Scorm2004CMIScore();\n this.comments_from_learner = new CMICommentsFromLearner();\n this.comments_from_lms = new CMICommentsFromLMS();\n this.interactions = new CMIInteractions();\n this.objectives = new CMIObjectives();\n if (initialized) this.initialize();\n }\n\n public learner_preference: CMILearnerPreference;\n public score: Scorm2004CMIScore;\n public comments_from_learner: CMICommentsFromLearner;\n public comments_from_lms: CMICommentsFromLMS;\n public interactions: CMIInteractions;\n public objectives: CMIObjectives;\n\n private __version = \"1.0\";\n private __children = APIConstants.scorm2004.cmi_children;\n private _completion_status = \"unknown\";\n private _completion_threshold = \"\";\n private _credit = \"credit\";\n private _entry = \"\";\n private _exit = \"\";\n private _launch_data = \"\";\n private _learner_id = \"\";\n private _learner_name = \"\";\n private _location = \"\";\n private _max_time_allowed = \"\";\n private _mode = \"normal\";\n private _progress_measure = \"\";\n private _scaled_passing_score = \"\";\n private _session_time = \"PT0H0M0S\";\n private _success_status = \"unknown\";\n private _suspend_data = \"\";\n private _time_limit_action = \"continue,no message\";\n private _total_time = \"\";\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.learner_preference?.initialize();\n this.score?.initialize();\n this.comments_from_learner?.initialize();\n this.comments_from_lms?.initialize();\n this.interactions?.initialize();\n this.objectives?.initialize();\n }\n\n /**\n * Getter for __version\n * @return {string}\n * @private\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n * @private\n */\n set _version(_version: string) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {number} _children\n * @private\n */\n set _children(_children: number) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for _completion_status\n * @return {string}\n */\n get completion_status(): string {\n return this._completion_status;\n }\n\n /**\n * Setter for _completion_status\n * @param {string} completion_status\n */\n set completion_status(completion_status: string) {\n if (check2004ValidFormat(completion_status, Regex.scorm2004.CMICStatus)) {\n this._completion_status = completion_status;\n }\n }\n\n /**\n * Getter for _completion_threshold\n * @return {string}\n */\n get completion_threshold(): string {\n return this._completion_threshold;\n }\n\n /**\n * Setter for _completion_threshold. Can only be called before initialization.\n * @param {string} completion_threshold\n */\n set completion_threshold(completion_threshold: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._completion_threshold = completion_threshold;\n }\n }\n\n /**\n * Setter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.WRITE_ONLY_ELEMENT,\n );\n }\n return this._exit;\n }\n\n /**\n * Getter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check2004ValidFormat(exit, Regex.scorm2004.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _learner_id\n * @return {string}\n */\n get learner_id(): string {\n return this._learner_id;\n }\n\n /**\n * Setter for _learner_id. Can only be called before initialization.\n * @param {string} learner_id\n */\n set learner_id(learner_id: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._learner_id = learner_id;\n }\n }\n\n /**\n * Getter for _learner_name\n * @return {string}\n */\n get learner_name(): string {\n return this._learner_name;\n }\n\n /**\n * Setter for _learner_name. Can only be called before initialization.\n * @param {string} learner_name\n */\n set learner_name(learner_name: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._learner_name = learner_name;\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (check2004ValidFormat(location, Regex.scorm2004.CMIString1000)) {\n this._location = location;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _mode\n * @return {string}\n */\n get mode(): string {\n return this._mode;\n }\n\n /**\n * Setter for _mode. Can only be called before initialization.\n * @param {string} mode\n */\n set mode(mode: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._mode = mode;\n }\n }\n\n /**\n * Getter for _progress_measure\n * @return {string}\n */\n get progress_measure(): string {\n return this._progress_measure;\n }\n\n /**\n * Setter for _progress_measure\n * @param {string} progress_measure\n */\n set progress_measure(progress_measure: string) {\n if (\n check2004ValidFormat(progress_measure, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(progress_measure, Regex.scorm2004.progress_range)\n ) {\n this._progress_measure = progress_measure;\n }\n }\n\n /**\n * Getter for _scaled_passing_score\n * @return {string}\n */\n get scaled_passing_score(): string {\n return this._scaled_passing_score;\n }\n\n /**\n * Setter for _scaled_passing_score. Can only be called before initialization.\n * @param {string} scaled_passing_score\n */\n set scaled_passing_score(scaled_passing_score: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._scaled_passing_score = scaled_passing_score;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.WRITE_ONLY_ELEMENT,\n );\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check2004ValidFormat(session_time, Regex.scorm2004.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _success_status\n * @return {string}\n */\n get success_status(): string {\n return this._success_status;\n }\n\n /**\n * Setter for _success_status\n * @param {string} success_status\n */\n set success_status(success_status: string) {\n if (check2004ValidFormat(success_status, Regex.scorm2004.CMISStatus)) {\n this._success_status = success_status;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (\n check2004ValidFormat(suspend_data, Regex.scorm2004.CMIString64000, true)\n ) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string} ISO8601 Duration\n */\n getCurrentTotalTime(): string {\n let sessionTime = this._session_time;\n const startTime = this.start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsISODuration(seconds / 1000);\n }\n\n return Util.addTwoDurations(\n this._total_time,\n sessionTime,\n Regex.scorm2004.CMITimespan,\n );\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * comments_from_learner: CMICommentsFromLearner,\n * comments_from_lms: CMICommentsFromLMS,\n * completion_status: string,\n * completion_threshold: string,\n * credit: string,\n * entry: string,\n * exit: string,\n * interactions: CMIInteractions,\n * launch_data: string,\n * learner_id: string,\n * learner_name: string,\n * learner_preference: CMILearnerPreference,\n * location: string,\n * max_time_allowed: string,\n * mode: string,\n * objectives: CMIObjectives,\n * progress_measure: string,\n * scaled_passing_score: string,\n * score: Scorm2004CMIScore,\n * session_time: string,\n * success_status: string,\n * suspend_data: string,\n * time_limit_action: string\n * }\n * }\n */\n toJSON(): {\n comments_from_learner: CMICommentsFromLearner;\n comments_from_lms: CMICommentsFromLMS;\n completion_status: string;\n completion_threshold: string;\n credit: string;\n entry: string;\n exit: string;\n interactions: CMIInteractions;\n launch_data: string;\n learner_id: string;\n learner_name: string;\n learner_preference: CMILearnerPreference;\n location: string;\n max_time_allowed: string;\n mode: string;\n objectives: CMIObjectives;\n progress_measure: string;\n scaled_passing_score: string;\n score: Scorm2004CMIScore;\n session_time: string;\n success_status: string;\n suspend_data: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n comments_from_learner: this.comments_from_learner,\n comments_from_lms: this.comments_from_lms,\n completion_status: this.completion_status,\n completion_threshold: this.completion_threshold,\n credit: this.credit,\n entry: this.entry,\n exit: this.exit,\n interactions: this.interactions,\n launch_data: this.launch_data,\n learner_id: this.learner_id,\n learner_name: this.learner_name,\n learner_preference: this.learner_preference,\n location: this.location,\n max_time_allowed: this.max_time_allowed,\n mode: this.mode,\n objectives: this.objectives,\n progress_measure: this.progress_measure,\n scaled_passing_score: this.scaled_passing_score,\n score: this.score,\n session_time: this.session_time,\n success_status: this.success_status,\n suspend_data: this.suspend_data,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","const ValidLanguages: string[] = [\n \"aa\",\n \"ab\",\n \"ae\",\n \"af\",\n \"ak\",\n \"am\",\n \"an\",\n \"ar\",\n \"as\",\n \"av\",\n \"ay\",\n \"az\",\n \"ba\",\n \"be\",\n \"bg\",\n \"bh\",\n \"bi\",\n \"bm\",\n \"bn\",\n \"bo\",\n \"br\",\n \"bs\",\n \"ca\",\n \"ce\",\n \"ch\",\n \"co\",\n \"cr\",\n \"cs\",\n \"cu\",\n \"cv\",\n \"cy\",\n \"da\",\n \"de\",\n \"dv\",\n \"dz\",\n \"ee\",\n \"el\",\n \"en\",\n \"eo\",\n \"es\",\n \"et\",\n \"eu\",\n \"fa\",\n \"ff\",\n \"fi\",\n \"fj\",\n \"fo\",\n \"fr\",\n \"fy\",\n \"ga\",\n \"gd\",\n \"gl\",\n \"gn\",\n \"gu\",\n \"gv\",\n \"ha\",\n \"he\",\n \"hi\",\n \"ho\",\n \"hr\",\n \"ht\",\n \"hu\",\n \"hy\",\n \"hz\",\n \"ia\",\n \"id\",\n \"ie\",\n \"ig\",\n \"ii\",\n \"ik\",\n \"io\",\n \"is\",\n \"it\",\n \"iu\",\n \"ja\",\n \"jv\",\n \"ka\",\n \"kg\",\n \"ki\",\n \"kj\",\n \"kk\",\n \"kl\",\n \"km\",\n \"kn\",\n \"ko\",\n \"kr\",\n \"ks\",\n \"ku\",\n \"kv\",\n \"kw\",\n \"ky\",\n \"la\",\n \"lb\",\n \"lg\",\n \"li\",\n \"ln\",\n \"lo\",\n \"lt\",\n \"lu\",\n \"lv\",\n \"mg\",\n \"mh\",\n \"mi\",\n \"mk\",\n \"ml\",\n \"mn\",\n \"mo\",\n \"mr\",\n \"ms\",\n \"mt\",\n \"my\",\n \"na\",\n \"nb\",\n \"nd\",\n \"ne\",\n \"ng\",\n \"nl\",\n \"nn\",\n \"no\",\n \"nr\",\n \"nv\",\n \"ny\",\n \"oc\",\n \"oj\",\n \"om\",\n \"or\",\n \"os\",\n \"pa\",\n \"pi\",\n \"pl\",\n \"ps\",\n \"pt\",\n \"qu\",\n \"rm\",\n \"rn\",\n \"ro\",\n \"ru\",\n \"rw\",\n \"sa\",\n \"sc\",\n \"sd\",\n \"se\",\n \"sg\",\n \"sh\",\n \"si\",\n \"sk\",\n \"sl\",\n \"sm\",\n \"sn\",\n \"so\",\n \"sq\",\n \"sr\",\n \"ss\",\n \"st\",\n \"su\",\n \"sv\",\n \"sw\",\n \"ta\",\n \"te\",\n \"tg\",\n \"th\",\n \"ti\",\n \"tk\",\n \"tl\",\n \"tn\",\n \"to\",\n \"tr\",\n \"ts\",\n \"tt\",\n \"tw\",\n \"ty\",\n \"ug\",\n \"uk\",\n \"ur\",\n \"uz\",\n \"ve\",\n \"vi\",\n \"vo\",\n \"wa\",\n \"wo\",\n \"xh\",\n \"yi\",\n \"yo\",\n \"za\",\n \"zh\",\n \"zu\",\n \"aar\",\n \"abk\",\n \"ave\",\n \"afr\",\n \"aka\",\n \"amh\",\n \"arg\",\n \"ara\",\n \"asm\",\n \"ava\",\n \"aym\",\n \"aze\",\n \"bak\",\n \"bel\",\n \"bul\",\n \"bih\",\n \"bis\",\n \"bam\",\n \"ben\",\n \"tib\",\n \"bod\",\n \"bre\",\n \"bos\",\n \"cat\",\n \"che\",\n \"cha\",\n \"cos\",\n \"cre\",\n \"cze\",\n \"ces\",\n \"chu\",\n \"chv\",\n \"wel\",\n \"cym\",\n \"dan\",\n \"ger\",\n \"deu\",\n \"div\",\n \"dzo\",\n \"ewe\",\n \"gre\",\n \"ell\",\n \"eng\",\n \"epo\",\n \"spa\",\n \"est\",\n \"baq\",\n \"eus\",\n \"per\",\n \"fas\",\n \"ful\",\n \"fin\",\n \"fij\",\n \"fao\",\n \"fre\",\n \"fra\",\n \"fry\",\n \"gle\",\n \"gla\",\n \"glg\",\n \"grn\",\n \"guj\",\n \"glv\",\n \"hau\",\n \"heb\",\n \"hin\",\n \"hmo\",\n \"hrv\",\n \"hat\",\n \"hun\",\n \"arm\",\n \"hye\",\n \"her\",\n \"ina\",\n \"ind\",\n \"ile\",\n \"ibo\",\n \"iii\",\n \"ipk\",\n \"ido\",\n \"ice\",\n \"isl\",\n \"ita\",\n \"iku\",\n \"jpn\",\n \"jav\",\n \"geo\",\n \"kat\",\n \"kon\",\n \"kik\",\n \"kua\",\n \"kaz\",\n \"kal\",\n \"khm\",\n \"kan\",\n \"kor\",\n \"kau\",\n \"kas\",\n \"kur\",\n \"kom\",\n \"cor\",\n \"kir\",\n \"lat\",\n \"ltz\",\n \"lug\",\n \"lim\",\n \"lin\",\n \"lao\",\n \"lit\",\n \"lub\",\n \"lav\",\n \"mlg\",\n \"mah\",\n \"mao\",\n \"mri\",\n \"mac\",\n \"mkd\",\n \"mal\",\n \"mon\",\n \"mol\",\n \"mar\",\n \"may\",\n \"msa\",\n \"mlt\",\n \"bur\",\n \"mya\",\n \"nau\",\n \"nob\",\n \"nde\",\n \"nep\",\n \"ndo\",\n \"dut\",\n \"nld\",\n \"nno\",\n \"nor\",\n \"nbl\",\n \"nav\",\n \"nya\",\n \"oci\",\n \"oji\",\n \"orm\",\n \"ori\",\n \"oss\",\n \"pan\",\n \"pli\",\n \"pol\",\n \"pus\",\n \"por\",\n \"que\",\n \"roh\",\n \"run\",\n \"rum\",\n \"ron\",\n \"rus\",\n \"kin\",\n \"san\",\n \"srd\",\n \"snd\",\n \"sme\",\n \"sag\",\n \"slo\",\n \"sin\",\n \"slk\",\n \"slv\",\n \"smo\",\n \"sna\",\n \"som\",\n \"alb\",\n \"sqi\",\n \"srp\",\n \"ssw\",\n \"sot\",\n \"sun\",\n \"swe\",\n \"swa\",\n \"tam\",\n \"tel\",\n \"tgk\",\n \"tha\",\n \"tir\",\n \"tuk\",\n \"tgl\",\n \"tsn\",\n \"ton\",\n \"tur\",\n \"tso\",\n \"tat\",\n \"twi\",\n \"tah\",\n \"uig\",\n \"ukr\",\n \"urd\",\n \"uzb\",\n \"ven\",\n \"vie\",\n \"vol\",\n \"wln\",\n \"wol\",\n \"xho\",\n \"yid\",\n \"yor\",\n \"zha\",\n \"chi\",\n \"zho\",\n \"zul\",\n];\nexport default ValidLanguages;\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\nimport { NAVBoolean } from \"../../constants/enums\";\n\n/**\n * Class representing SCORM 2004's adl object\n */\nexport class ADL extends BaseCMI {\n /**\n * Constructor for adl\n */\n constructor() {\n super();\n this.nav = new ADLNav();\n }\n\n public nav: ADLNav;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.nav?.initialize();\n }\n\n /**\n * toJSON for adl\n * @return {\n * {\n * nav: ADLNav\n * }\n * }\n */\n toJSON(): {\n nav: ADLNav;\n } {\n this.jsonString = true;\n const result = {\n nav: this.nav,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's `adl.nav` object\n */\n\nexport class ADLNav extends BaseCMI {\n private _request = \"_none_\";\n\n /**\n * Constructor for `adl.nav`\n */\n constructor() {\n super();\n this.request_valid = new ADLNavRequestValid();\n }\n\n public request_valid: ADLNavRequestValid;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.request_valid?.initialize();\n }\n\n /**\n * Getter for _request\n * @return {string}\n */\n get request(): string {\n return this._request;\n }\n\n /**\n * Setter for _request\n * @param {string} request\n */\n set request(request: string) {\n if (check2004ValidFormat(request, Regex.scorm2004.NAVEvent)) {\n this._request = request;\n }\n }\n\n /**\n * toJSON for adl.nav\n *\n * @return {\n * {\n * request: string\n * }\n * }\n */\n toJSON(): {\n request: string;\n } {\n this.jsonString = true;\n const result = {\n request: this.request,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's adl.nav.request_valid object\n */\n\nexport class ADLNavRequestValid extends BaseCMI {\n private _continue = \"unknown\";\n private _previous = \"unknown\";\n private _choice: {\n [key: string]: NAVBoolean;\n } = {};\n private _jump: {\n [key: string]: NAVBoolean;\n } = {};\n\n /**\n * Constructor for adl.nav.request_valid\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _continue\n * @return {string}\n */\n get continue(): string {\n return this._continue;\n }\n\n /**\n * Setter for _continue. Just throws an error.\n * @param {string} _continue\n */\n set continue(_continue: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (check2004ValidFormat(_continue, Regex.scorm2004.NAVBoolean)) {\n this._continue = _continue;\n }\n }\n\n /**\n * Getter for _previous\n * @return {string}\n */\n get previous(): string {\n return this._previous;\n }\n\n /**\n * Setter for _previous. Just throws an error.\n * @param {string} _previous\n */\n set previous(_previous: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (check2004ValidFormat(_previous, Regex.scorm2004.NAVBoolean)) {\n this._previous = _previous;\n }\n }\n\n /**\n * Getter for _choice\n * @return {{ [key: string]: NAVBoolean }}\n */\n get choice(): { [key: string]: NAVBoolean } {\n return this._choice;\n }\n\n /**\n * Setter for _choice\n * @param {{ [key: string]: string }} choice\n */\n set choice(choice: { [key: string]: string }) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (typeof choice !== \"object\") {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n for (const key in choice) {\n if ({}.hasOwnProperty.call(choice, key)) {\n if (\n check2004ValidFormat(choice[key], Regex.scorm2004.NAVBoolean) &&\n check2004ValidFormat(key, Regex.scorm2004.NAVTarget)\n ) {\n this._choice[key] =\n NAVBoolean[choice[key] as keyof typeof NAVBoolean];\n }\n }\n }\n }\n\n /**\n * Getter for _jump\n * @return {{ [key: string]: NAVBoolean }}\n */\n get jump(): { [key: string]: NAVBoolean } {\n return this._jump;\n }\n\n /**\n * Setter for _jump\n * @param {{ [key: string]: string }} jump\n */\n set jump(jump: { [key: string]: string }) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (typeof jump !== \"object\") {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n for (const key in jump) {\n if ({}.hasOwnProperty.call(jump, key)) {\n if (\n check2004ValidFormat(jump[key], Regex.scorm2004.NAVBoolean) &&\n check2004ValidFormat(key, Regex.scorm2004.NAVTarget)\n ) {\n this._jump[key] = NAVBoolean[jump[key] as keyof typeof NAVBoolean];\n }\n }\n }\n }\n\n /**\n * toJSON for adl.nav.request_valid\n *\n * @return {\n * {\n * previous: string,\n * continue: string\n * }\n * }\n */\n toJSON(): {\n previous: string;\n continue: string;\n } {\n this.jsonString = true;\n const result = {\n previous: this._previous,\n continue: this._continue,\n choice: this._choice,\n jump: this._jump,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import BaseAPI from \"./BaseAPI\";\nimport { CMI } from \"./cmi/scorm2004/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\nimport { CorrectResponses, ResponseType } from \"./constants/response_constants\";\nimport ValidLanguages from \"./constants/language_constants\";\nimport Regex from \"./constants/regex\";\nimport regex from \"./constants/regex\";\nimport { CMIArray } from \"./cmi/common/array\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm2004/interactions\";\nimport { CMICommentsObject } from \"./cmi/scorm2004/comments\";\nimport { CMIObjectivesObject } from \"./cmi/scorm2004/objectives\";\nimport { ADL } from \"./cmi/scorm2004/adl\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\n\n/**\n * API class for SCORM 2004\n */\nclass Scorm2004Impl extends BaseAPI {\n private _version: string = \"1.0\";\n\n /**\n * Constructor for SCORM 2004 API\n * @param {Settings} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm2004, settings);\n\n this.cmi = new CMI();\n this.adl = new ADL();\n\n // Rename functions to match 2004 Spec and expose to modules\n this.Initialize = this.lmsInitialize;\n this.Terminate = this.lmsFinish;\n this.GetValue = this.lmsGetValue;\n this.SetValue = this.lmsSetValue;\n this.Commit = this.lmsCommit;\n this.GetLastError = this.lmsGetLastError;\n this.GetErrorString = this.lmsGetErrorString;\n this.GetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public cmi: CMI;\n public adl: ADL;\n\n public Initialize: () => string;\n public Terminate: () => string;\n public GetValue: (CMIElement: string) => string;\n public SetValue: (CMIElement: string, value: any) => string;\n public Commit: () => string;\n public GetLastError: () => string;\n public GetErrorString: (CMIErrorCode: string | number) => string;\n public GetDiagnostic: (CMIErrorCode: string | number) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.adl = new ADL();\n }\n\n /**\n * Getter for _version\n * @return {string}\n */\n get version(): string {\n return this._version;\n }\n\n /**\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n return this.initialize(\"Initialize\");\n }\n\n /**\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"Terminate\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.adl.nav.request !== \"_none_\") {\n const navActions: { [key: string]: string } = {\n continue: \"SequenceNext\",\n previous: \"SequencePrevious\",\n choice: \"SequenceChoice\",\n jump: \"SequenceJump\",\n exit: \"SequenceExit\",\n exitAll: \"SequenceExitAll\",\n abandon: \"SequenceAbandon\",\n abandonAll: \"SequenceAbandonAll\",\n };\n\n let request = this.adl.nav.request;\n const choiceJumpRegex = new RegExp(regex.scorm2004.NAVEvent);\n const matches = request.match(choiceJumpRegex);\n let target = \"\";\n if (matches && matches.length > 2) {\n target = matches[2];\n request = matches[1].replace(target, \"\");\n }\n const action = navActions[request];\n if (action) {\n this.processListeners(action, \"adl.nav.request\", target);\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n const adlNavRequestRegex =\n \"^adl\\\\.nav\\\\.request_valid\\\\.(choice|jump)\\\\.{target=\\\\S{0,}([a-zA-Z0-9-_]+)}$\";\n if (stringMatches(CMIElement, adlNavRequestRegex)) {\n const matches = CMIElement.match(adlNavRequestRegex);\n const request = matches[1];\n const target = matches[2].replace(\"{target=\", \"\").replace(\"}\", \"\");\n if (request === \"choice\" || request === \"jump\") {\n if (this.settings.scoItemIdValidator) {\n return String(this.settings.scoItemIdValidator(target));\n }\n return String(this.settings.scoItemIds.includes(target));\n }\n }\n return this.getValue(\"GetValue\", true, CMIElement);\n }\n\n /**\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n return this.setValue(\"SetValue\", \"Commit\", true, CMIElement, value);\n }\n\n /**\n * Orders LMS to store all content parameters\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"Commit\");\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * Returns last error code\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"GetLastError\");\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string | number): string {\n return this.getErrorString(\"GetErrorString\", CMIErrorCode);\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string | number): string {\n return this.getDiagnostic(\"GetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"SetValue\", true, CMIElement, value);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {any} value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n }\n\n if (foundFirstIndex) {\n if (\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return this.createCorrectResponsesObject(CMIElement, value);\n } else if (\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsObjectivesObject();\n }\n } else if (stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")) {\n return new CMIInteractionsObject();\n }\n\n if (stringMatches(CMIElement, \"cmi\\\\.comments_from_learner\\\\.\\\\d+\")) {\n return new CMICommentsObject();\n } else if (stringMatches(CMIElement, \"cmi\\\\.comments_from_lms\\\\.\\\\d+\")) {\n return new CMICommentsObject(true);\n }\n\n return null;\n }\n\n private createCorrectResponsesObject(\n CMIElement: string,\n value: any,\n ): BaseCMI | null {\n const parts = CMIElement.split(\".\");\n const index = Number(parts[2]);\n const interaction = this.cmi.interactions.childArray[index];\n\n if (this.isInitialized()) {\n if (!interaction.type) {\n this.throwSCORMError(ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED);\n } else {\n this.checkDuplicateChoiceResponse(interaction, value);\n const response_type = CorrectResponses[interaction.type];\n if (response_type) {\n this.checkValidResponseType(response_type, value, interaction.type);\n } else {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Incorrect Response Type: \" + interaction.type,\n );\n }\n }\n }\n\n if (this.lastErrorCode === \"0\") {\n return new CMIInteractionsCorrectResponsesObject();\n }\n\n return null;\n }\n\n /**\n * Checks for valid response types\n * @param {object} response_type\n * @param {any} value\n * @param {string} interaction_type\n */\n checkValidResponseType(\n response_type: ResponseType,\n value: any,\n interaction_type: string,\n ) {\n let nodes = [];\n if (response_type?.delimiter) {\n nodes = String(value).split(response_type.delimiter);\n } else {\n nodes[0] = value;\n }\n\n if (nodes.length > 0 && nodes.length <= response_type.max) {\n this.checkCorrectResponseValue(interaction_type, nodes, value);\n } else if (nodes.length > response_type.max) {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Pattern Too Long\",\n );\n }\n }\n\n /**\n * Checks for duplicate 'choice' responses.\n * @param {CMIInteractionsObject} interaction\n * @param {any} value\n */\n checkDuplicateChoiceResponse(interaction: CMIInteractionsObject, value: any) {\n const interaction_count = interaction.correct_responses._count;\n if (interaction.type === \"choice\") {\n for (\n let i = 0;\n i < interaction_count && this.lastErrorCode === \"0\";\n i++\n ) {\n const response = interaction.correct_responses.childArray[i];\n if (response.pattern === value) {\n this.throwSCORMError(ErrorCodes.scorm2004.GENERAL_SET_FAILURE);\n }\n }\n }\n }\n\n /**\n * Validate correct response.\n * @param {string} CMIElement\n * @param {*} value\n */\n validateCorrectResponse(CMIElement: string, value: any) {\n const parts = CMIElement.split(\".\");\n const index = Number(parts[2]);\n const pattern_index = Number(parts[4]);\n const interaction = this.cmi.interactions.childArray[index];\n\n const interaction_count = interaction.correct_responses._count;\n this.checkDuplicateChoiceResponse(interaction, value);\n\n const response_type = CorrectResponses[interaction.type];\n if (\n typeof response_type.limit === \"undefined\" ||\n interaction_count <= response_type.limit\n ) {\n this.checkValidResponseType(response_type, value, interaction.type);\n\n if (\n (this.lastErrorCode === \"0\" &&\n (!response_type.duplicate ||\n !this.checkDuplicatedPattern(\n interaction.correct_responses,\n pattern_index,\n value,\n ))) ||\n (this.lastErrorCode === \"0\" && value === \"\")\n ) {\n // do nothing, we want the inverse\n } else {\n if (this.lastErrorCode === \"0\") {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Pattern Already Exists\",\n );\n }\n }\n } else {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Collection Limit Reached\",\n );\n }\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"GetValue\", true, CMIElement);\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {(string|number)} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: string | number,\n detail: boolean,\n ): string {\n let basicMessage = \"\";\n let detailMessage = \"\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm2004.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm2004.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm2004.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Check to see if a correct_response value has been duplicated\n * @param {CMIArray} correct_response\n * @param {number} current_index\n * @param {*} value\n * @return {boolean}\n */\n checkDuplicatedPattern(\n correct_response: CMIArray,\n current_index: number,\n value: any,\n ): boolean {\n let found = false;\n const count = correct_response._count;\n for (let i = 0; i < count && !found; i++) {\n if (i !== current_index && correct_response.childArray[i] === value) {\n found = true;\n }\n }\n return found;\n }\n\n /**\n * Checks for a valid correct_response value\n * @param {string} interaction_type\n * @param {Array} nodes\n * @param {*} value\n */\n checkCorrectResponseValue(\n interaction_type: string,\n nodes: Array,\n value: any,\n ) {\n const response = CorrectResponses[interaction_type];\n const formatRegex = new RegExp(response.format);\n for (let i = 0; i < nodes.length && this.lastErrorCode === \"0\"; i++) {\n if (\n interaction_type.match(\n \"^(fill-in|long-fill-in|matching|performance|sequencing)$\",\n )\n ) {\n nodes[i] = this.removeCorrectResponsePrefixes(nodes[i]);\n }\n\n if (response?.delimiter2) {\n const values = nodes[i].split(response.delimiter2);\n if (values.length === 2) {\n const matches = values[0].match(formatRegex);\n if (!matches) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n } else {\n if (\n !response.format2 ||\n !values[1].match(new RegExp(response.format2))\n ) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n } else {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n } else {\n const matches = nodes[i].match(formatRegex);\n if (\n (!matches && value !== \"\") ||\n (!matches && interaction_type === \"true-false\")\n ) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n } else {\n if (interaction_type === \"numeric\" && nodes.length > 1) {\n if (Number(nodes[0]) > Number(nodes[1])) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n } else {\n if (nodes[i] !== \"\" && response.unique) {\n for (let j = 0; j < i && this.lastErrorCode === \"0\"; j++) {\n if (nodes[i] === nodes[j]) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n }\n }\n }\n }\n }\n\n /**\n * Remove prefixes from correct_response\n * @param {string} node\n * @return {*}\n */\n removeCorrectResponsePrefixes(node: string): any {\n let seenOrder = false;\n let seenCase = false;\n let seenLang = false;\n\n const prefixRegex = new RegExp(\n \"^({(lang|case_matters|order_matters)=([^}]+)})\",\n );\n let matches = node.match(prefixRegex);\n let langMatches = null;\n while (matches) {\n switch (matches[2]) {\n case \"lang\":\n langMatches = node.match(Regex.scorm2004.CMILangcr);\n if (langMatches) {\n const lang = langMatches[3];\n if (lang !== undefined && lang.length > 0) {\n if (!ValidLanguages.includes(lang.toLowerCase())) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n seenLang = true;\n break;\n case \"case_matters\":\n if (!seenLang && !seenOrder && !seenCase) {\n if (matches[3] !== \"true\" && matches[3] !== \"false\") {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n\n seenCase = true;\n break;\n case \"order_matters\":\n if (!seenCase && !seenLang && !seenOrder) {\n if (matches[3] !== \"true\" && matches[3] !== \"false\") {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n\n seenOrder = true;\n break;\n }\n node = node.substring(matches[1].length);\n matches = node.match(prefixRegex);\n }\n\n return node;\n }\n\n /**\n * Replace the whole API with another\n * @param {Scorm2004Impl} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm2004Impl) {\n // Data Model\n this.cmi = newAPI.cmi;\n this.adl = newAPI.adl;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeDuration = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getDurationAsSeconds(\n totalTimeDuration,\n Regex.scorm2004.CMITimespan,\n );\n\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (this.cmi.completion_status) {\n if (this.cmi.completion_status === \"completed\") {\n completionStatus = CompletionStatus.completed;\n } else if (this.cmi.completion_status === \"incomplete\") {\n completionStatus = CompletionStatus.incomplete;\n }\n }\n if (this.cmi.success_status) {\n if (this.cmi.success_status === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (this.cmi.success_status === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n if (!Number.isNaN(Number.parseFloat(score.scaled))) {\n scoreObject.scaled = Number.parseFloat(score.scaled);\n }\n }\n\n const commitObject: CommitObject = {\n completionStatus: completionStatus,\n successStatus: successStatus,\n totalTimeSeconds: totalTimeSeconds,\n runtimeData: cmiExport,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n if (this.cmi.mode === \"normal\") {\n if (this.cmi.credit === \"credit\") {\n if (this.cmi.completion_threshold && this.cmi.progress_measure) {\n if (this.cmi.progress_measure >= this.cmi.completion_threshold) {\n this.cmi.completion_status = \"completed\";\n } else {\n this.cmi.completion_status = \"incomplete\";\n }\n }\n if (this.cmi.scaled_passing_score && this.cmi.score.scaled) {\n if (this.cmi.score.scaled >= this.cmi.scaled_passing_score) {\n this.cmi.success_status = \"passed\";\n } else {\n this.cmi.success_status = \"failed\";\n }\n }\n }\n }\n }\n\n let navRequest = false;\n if (\n this.adl.nav.request !== this.startingData?.adl?.nav?.request &&\n this.adl.nav.request !== \"_none_\"\n ) {\n this.adl.nav.request = encodeURIComponent(this.adl.nav.request);\n navRequest = true;\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n const result = await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n\n // check if this is a sequencing call, and then call the necessary JS\n {\n if (\n navRequest &&\n result.navRequest !== undefined &&\n result.navRequest !== \"\"\n ) {\n Function(`\"use strict\";(() => { ${result.navRequest} })()`)();\n }\n }\n return result;\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n\nexport { Scorm2004Impl };\n","import { BaseCMI } from \"./base_cmi\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.n objects\n */\nexport class CMIArray extends BaseCMI {\n private readonly _errorCode: number;\n private readonly _errorClass: typeof BaseScormValidationError;\n private readonly __children: string;\n childArray: any[];\n\n /**\n * Constructor cmi *.n arrays\n * @param {object} params\n */\n constructor(params: {\n children: string;\n errorCode?: number;\n errorClass?: typeof BaseScormValidationError;\n }) {\n super();\n this.__children = params.children;\n this._errorCode = params.errorCode || scorm12_error_codes.GENERAL;\n this._errorClass = params.errorClass || BaseScormValidationError;\n this.childArray = [];\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * Getter for _count\n * @return {number}\n */\n get _count(): number {\n return this.childArray.length;\n }\n\n /**\n * Setter for _count. Just throws an error.\n * @param {number} _count\n */\n set _count(_count: number) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * toJSON for *.n arrays\n * @return {object}\n */\n toJSON(): object {\n this.jsonString = true;\n const result: { [key: string]: any } = {};\n for (let i = 0; i < this.childArray.length; i++) {\n result[i + \"\"] = this.childArray[i];\n }\n delete this.jsonString;\n return result;\n }\n}\n","/**\n * Base class for API cmi objects\n */\nexport abstract class BaseCMI {\n jsonString? = false;\n private _initialized = false;\n private _start_time: number | undefined;\n\n /**\n * Getter for _initialized\n * @return {boolean}\n */\n get initialized(): boolean {\n return this._initialized;\n }\n\n /**\n * Getter for _start_time\n * @return {number | undefined}\n */\n get start_time(): number | undefined {\n return this._start_time;\n }\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize(): void {\n this._initialized = true;\n }\n\n /**\n * Called when the player should override the 'session_time' provided by\n * the module\n */\n setStartTime(): void {\n this._start_time = new Date().getTime();\n }\n}\n\n/**\n * Base class for cmi root objects\n */\nexport abstract class BaseRootCMI extends BaseCMI {\n abstract getCurrentTotalTime(): string;\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport { BaseCMI } from \"./base_cmi\";\nimport { checkValidFormat, checkValidRange } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nconst scorm12_constants = APIConstants.scorm12;\nconst scorm12_regex = Regex.scorm12;\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.score objects\n */\nexport class CMIScore extends BaseCMI {\n private readonly __children: string;\n private readonly __score_range: string | false;\n private readonly __invalid_error_code: number;\n private readonly __invalid_type_code: number;\n private readonly __invalid_range_code: number;\n private readonly __decimal_regex: string;\n private readonly __error_class: typeof BaseScormValidationError;\n private _raw = \"\";\n private _min = \"\";\n private _max: string;\n\n /**\n * Constructor for *.score\n * @param {\n * score_children: string,\n * score_range: string,\n * max: string,\n * invalidErrorCode: number,\n * invalidTypeCode: number,\n * invalidRangeCode: number,\n * decimalRegex: string,\n * errorClass: typeof BaseScormValidationError\n * } params\n */\n constructor(params: {\n score_children?: string;\n score_range?: string;\n max?: string;\n invalidErrorCode?: number;\n invalidTypeCode?: number;\n invalidRangeCode?: number;\n decimalRegex?: string;\n errorClass: typeof BaseScormValidationError;\n }) {\n super();\n\n this.__children = params.score_children || scorm12_constants.score_children;\n this.__score_range = !params.score_range\n ? false\n : scorm12_regex.score_range;\n this._max = params.max || params.max === \"\" ? params.max : \"100\";\n this.__invalid_error_code =\n params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE;\n this.__invalid_type_code =\n params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH;\n this.__invalid_range_code =\n params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE;\n this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;\n this.__error_class = params.errorClass;\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this.__error_class(this.__invalid_error_code);\n }\n\n /**\n * Getter for _raw\n * @return {string}\n */\n get raw(): string {\n return this._raw;\n }\n\n /**\n * Setter for _raw\n * @param {string} raw\n */\n set raw(raw: string) {\n if (\n checkValidFormat(\n raw,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n raw,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._raw = raw;\n }\n }\n\n /**\n * Getter for _min\n * @return {string}\n */\n get min(): string {\n return this._min;\n }\n\n /**\n * Setter for _min\n * @param {string} min\n */\n set min(min: string) {\n if (\n checkValidFormat(\n min,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n min,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._min = min;\n }\n }\n\n /**\n * Getter for _max\n * @return {string}\n */\n get max(): string {\n return this._max;\n }\n\n /**\n * Setter for _max\n * @param {string} max\n */\n set max(max: string) {\n if (\n checkValidFormat(\n max,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n max,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._max = max;\n }\n }\n\n /**\n * toJSON for *.score\n * @return {\n * {\n * min: string,\n * max: string,\n * raw: string\n * }\n * }\n */\n toJSON(): {\n min: string;\n max: string;\n raw: string;\n } {\n this.jsonString = true;\n const result = {\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseScormValidationError } from \"../../exceptions\";\n\n/**\n * Check if the value matches the proper format. If not, throw proper error code.\n *\n * @param {string} value\n * @param {string} regexPattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @param {boolean} [allowEmptyString]\n * @return {boolean}\n */\nexport function checkValidFormat(\n value: string,\n regexPattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n allowEmptyString?: boolean,\n): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n const formatRegex = new RegExp(regexPattern);\n const matches = value.match(formatRegex);\n if (allowEmptyString && value === \"\") {\n return true;\n }\n if (value === undefined || !matches || matches[0] === \"\") {\n throw new errorClass(errorCode);\n }\n return true;\n}\n\n/**\n * Check if the value matches the proper range. If not, throw proper error code.\n *\n * @param {any} value\n * @param {string} rangePattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @return {boolean}\n */\nexport function checkValidRange(\n value: any,\n rangePattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n): boolean {\n const ranges = rangePattern.split(\"#\");\n value = value * 1.0;\n if (value >= ranges[0]) {\n if (ranges[1] === \"*\" || value <= ranges[1]) {\n return true;\n } else {\n throw new errorClass(errorCode);\n }\n } else {\n throw new errorClass(errorCode);\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { check12ValidFormat } from \"../scorm12/validation\";\nimport * as Util from \"../../utilities\";\n\n/**\n * Class representing the `cmi.core` object\n * @extends BaseCMI\n */\nexport class CMICore extends BaseCMI {\n /**\n * Constructor for `cmi.core`\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private __children = APIConstants.scorm12.core_children;\n private _student_id = \"\";\n private _student_name = \"\";\n private _lesson_location = \"\";\n private _credit = \"\";\n private _lesson_status = \"not attempted\";\n private _entry = \"\";\n private _total_time = \"\";\n private _lesson_mode = \"normal\";\n private _exit = \"\";\n private _session_time = \"00:00:00\";\n private _suspend_data = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _student_id\n * @return {string}\n */\n get student_id(): string {\n return this._student_id;\n }\n\n /**\n * Setter for _student_id. Can only be called before initialization.\n * @param {string} student_id\n */\n set student_id(student_id: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_id = student_id;\n }\n }\n\n /**\n * Getter for _student_name\n * @return {string}\n */\n get student_name(): string {\n return this._student_name;\n }\n\n /**\n * Setter for _student_name. Can only be called before initialization.\n * @param {string} student_name\n */\n set student_name(student_name: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_name = student_name;\n }\n }\n\n /**\n * Getter for _lesson_location\n * @return {string}\n */\n get lesson_location(): string {\n return this._lesson_location;\n }\n\n /**\n * Setter for _lesson_location\n * @param {string} lesson_location\n */\n set lesson_location(lesson_location: string) {\n if (check12ValidFormat(lesson_location, Regex.scorm12.CMIString256, true)) {\n this._lesson_location = lesson_location;\n }\n }\n\n /**\n * Getter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (this.initialized) {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus)) {\n this._lesson_status = lesson_status;\n }\n } else {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Getter for _lesson_mode\n * @return {string}\n */\n get lesson_mode(): string {\n return this._lesson_mode;\n }\n\n /**\n * Setter for _lesson_mode. Can only be called before initialization.\n * @param {string} lesson_mode\n */\n set lesson_mode(lesson_mode: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._lesson_mode = lesson_mode;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._exit;\n }\n\n /**\n * Setter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check12ValidFormat(exit, Regex.scorm12.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check12ValidFormat(session_time, Regex.scorm12.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (check12ValidFormat(suspend_data, Regex.scorm12.CMIString4096, true)) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n * @param {number} start_time\n * @return {string}\n */\n getCurrentTotalTime(start_time: number | undefined): string {\n let sessionTime = this._session_time;\n const startTime = start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsHHMMSS(seconds / 1000);\n }\n\n return Util.addHHMMSSTimeStrings(\n this._total_time,\n sessionTime,\n new RegExp(Regex.scorm12.CMITimespan),\n );\n }\n\n /**\n * toJSON for cmi.core\n *\n * @return {\n * {\n * student_name: string,\n * entry: string,\n * exit: string,\n * score: CMIScore,\n * student_id: string,\n * lesson_mode: string,\n * lesson_location: string,\n * lesson_status: string,\n * credit: string,\n * session_time: string\n * }\n * }\n */\n toJSON(): {\n student_name: string;\n entry: string;\n exit: string;\n score: CMIScore;\n student_id: string;\n lesson_mode: string;\n lesson_location: string;\n lesson_status: string;\n credit: string;\n session_time: string;\n } {\n this.jsonString = true;\n const result = {\n student_id: this.student_id,\n student_name: this.student_name,\n lesson_location: this.lesson_location,\n credit: this.credit,\n lesson_status: this.lesson_status,\n entry: this.entry,\n lesson_mode: this.lesson_mode,\n exit: this.exit,\n session_time: this.session_time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat } from \"./validation\";\nimport { CMICore } from \"../aicc/core\";\nimport { CMIObjectives } from \"./objectives\";\nimport { CMIStudentData } from \"./student_data\";\nimport { CMIStudentPreference } from \"./student_preference\";\nimport { CMIInteractions } from \"./interactions\";\n\n/**\n * Class representing the cmi object for SCORM 1.2\n */\nexport class CMI extends BaseRootCMI {\n private readonly __children: string = \"\";\n private __version: string = \"3.4\";\n private _launch_data: string = \"\";\n private _comments: string = \"\";\n private _comments_from_lms: string = \"\";\n\n /**\n * Constructor for the SCORM 1.2 cmi object\n * @param {string} cmi_children\n * @param {(CMIStudentData|AICCCMIStudentData)} student_data\n * @param {boolean} initialized\n */\n constructor(\n cmi_children?: string,\n student_data?: CMIStudentData,\n initialized?: boolean,\n ) {\n super();\n if (initialized) this.initialize();\n this.__children = cmi_children\n ? cmi_children\n : APIConstants.scorm12.cmi_children;\n this.core = new CMICore();\n this.objectives = new CMIObjectives();\n this.student_data = student_data ? student_data : new CMIStudentData();\n this.student_preference = new CMIStudentPreference();\n this.interactions = new CMIInteractions();\n }\n\n public core: CMICore;\n public objectives: CMIObjectives;\n public student_data: CMIStudentData;\n public student_preference: CMIStudentPreference;\n public interactions: CMIInteractions;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.core?.initialize();\n this.objectives?.initialize();\n this.student_data?.initialize();\n this.student_preference?.initialize();\n this.interactions?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n interactions: CMIInteractions;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n interactions: this.interactions,\n };\n delete this.jsonString;\n return result;\n }\n\n /**\n * Getter for __version\n * @return {string}\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n */\n set _version(_version: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for __children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this.core?.suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (this.core) {\n this.core.suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _comments\n * @return {string}\n */\n get comments(): string {\n return this._comments;\n }\n\n /**\n * Setter for _comments\n * @param {string} comments\n */\n set comments(comments: string) {\n if (check12ValidFormat(comments, Regex.scorm12.CMIString4096, true)) {\n this._comments = comments;\n }\n }\n\n /**\n * Getter for _comments_from_lms\n * @return {string}\n */\n get comments_from_lms(): string {\n return this._comments_from_lms;\n }\n\n /**\n * Setter for _comments_from_lms. Can only be called before initialization.\n * @param {string} comments_from_lms\n */\n set comments_from_lms(comments_from_lms: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._comments_from_lms = comments_from_lms;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string}\n */\n getCurrentTotalTime(): string {\n return this.core.getCurrentTotalTime(this.start_time);\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 `cmi.interactions`\n * @extends CMIArray\n */\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.interactions`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.interactions_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n object\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.correct_responses_children,\n });\n }\n\n public readonly objectives: CMIArray;\n public readonly correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n private _id = \"\";\n private _time = \"\";\n private _type = \"\";\n private _weighting = \"\";\n private _student_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n\n /**\n * Getter for _id. Should only be called during JSON export.\n * @return {string}\n */\n get id(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _time. Should only be called during JSON export.\n * @return {string}\n */\n get time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (check12ValidFormat(time, Regex.scorm12.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _type. Should only be called during JSON export.\n * @return {string}\n */\n get type(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (check12ValidFormat(type, Regex.scorm12.CMIType)) {\n this._type = type;\n }\n }\n\n /**\n * Getter for _weighting. Should only be called during JSON export.\n * @return {string}\n */\n get weighting(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (\n check12ValidFormat(weighting, Regex.scorm12.CMIDecimal) &&\n check12ValidRange(weighting, Regex.scorm12.weighting_range)\n ) {\n this._weighting = weighting;\n }\n }\n\n /**\n * Getter for _student_response. Should only be called during JSON export.\n * @return {string}\n */\n get student_response(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._student_response;\n }\n\n /**\n * Setter for _student_response\n * @param {string} student_response\n */\n set student_response(student_response: string) {\n if (check12ValidFormat(student_response, Regex.scorm12.CMIFeedback, true)) {\n this._student_response = student_response;\n }\n }\n\n /**\n * Getter for _result. Should only be called during JSON export.\n * @return {string}\n */\n get result(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check12ValidFormat(result, Regex.scorm12.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency. Should only be called during JSON export.\n * @return {string}\n */\n get latency(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (check12ValidFormat(latency, Regex.scorm12.CMITimespan)) {\n this._latency = latency;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * time: string,\n * type: string,\n * weighting: string,\n * student_response: string,\n * result: string,\n * latency: string,\n * objectives: CMIArray,\n * correct_responses: CMIArray\n * }\n * }\n */\n toJSON(): {\n id: string;\n time: string;\n type: string;\n weighting: string;\n student_response: string;\n result: string;\n latency: string;\n objectives: CMIArray;\n correct_responses: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n time: this.time,\n type: this.type,\n weighting: this.weighting,\n student_response: this.student_response,\n result: this.result,\n latency: this.latency,\n objectives: this.objectives,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n private _id = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.correct_responses.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.correct_responses.n\n */\n constructor() {\n super();\n }\n\n private _pattern = \"\";\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check12ValidFormat(pattern, Regex.scorm12.CMIFeedback, true)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON for cmi.interactions.correct_responses.n\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this._pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {BaseCMI} from \"../common/base_cmi\";\nimport {check12ValidFormat} from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class for AICC Navigation object\n */\nexport class NAV extends BaseCMI {\n /**\n * Constructor for NAV object\n */\n constructor() {\n super();\n }\n\n private _event = \"\";\n\n /**\n * Getter for _event\n * @return {string}\n */\n get event(): string {\n return this._event;\n }\n\n /**\n * Setter for _event\n * @param {string} event\n */\n set event(event: string) {\n if (check12ValidFormat(event, Regex.scorm12.NAVEvent)) {\n this._event = event;\n }\n }\n\n /**\n * toJSON for nav object\n * @return {\n * {\n * event: string\n * }\n * }\n */\n toJSON(): {\n event: string;\n } {\n this.jsonString = true;\n const result = {\n event: this.event,\n };\n delete this.jsonString;\n return result;\n }\n}","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\nimport {check12ValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class representing SCORM 1.2's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.objectives_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n private _id = \"\";\n private _status = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (check12ValidFormat(status, Regex.scorm12.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n * @return {\n * {\n * id: string,\n * status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n status: this.status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_data object\n * @extends BaseCMI\n */\nexport class CMIStudentData extends BaseCMI {\n private readonly __children;\n private _mastery_score = \"\";\n private _max_time_allowed = \"\";\n private _time_limit_action = \"\";\n\n /**\n * Constructor for cmi.student_data\n * @param {string} student_data_children\n */\n constructor(student_data_children?: string) {\n super();\n this.__children = student_data_children\n ? student_data_children\n : APIConstants.scorm12.student_data_children;\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _master_score\n * @return {string}\n */\n get mastery_score(): string {\n return this._mastery_score;\n }\n\n /**\n * Setter for _master_score. Can only be called before initialization.\n * @param {string} mastery_score\n */\n set mastery_score(mastery_score: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._mastery_score = mastery_score;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * toJSON for cmi.student_data\n *\n * @return {\n * {\n * max_time_allowed: string,\n * time_limit_action: string,\n * mastery_score: string\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_preference object\n * @extends BaseCMI\n */\nexport class CMIStudentPreference extends BaseCMI {\n private readonly __children;\n\n /**\n * Constructor for cmi.student_preference\n * @param {string} student_preference_children\n */\n constructor(student_preference_children?: string) {\n super();\n this.__children = student_preference_children\n ? student_preference_children\n : APIConstants.scorm12.student_preference_children;\n }\n\n private _audio = \"\";\n private _language = \"\";\n private _speed = \"\";\n private _text = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _audio\n * @return {string}\n */\n get audio(): string {\n return this._audio;\n }\n\n /**\n * Setter for _audio\n * @param {string} audio\n */\n set audio(audio: string) {\n if (\n check12ValidFormat(audio, Regex.scorm12.CMISInteger) &&\n check12ValidRange(audio, Regex.scorm12.audio_range)\n ) {\n this._audio = audio;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check12ValidFormat(language, Regex.scorm12.CMIString256)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _speed\n * @return {string}\n */\n get speed(): string {\n return this._speed;\n }\n\n /**\n * Setter for _speed\n * @param {string} speed\n */\n set speed(speed: string) {\n if (\n check12ValidFormat(speed, Regex.scorm12.CMISInteger) &&\n check12ValidRange(speed, Regex.scorm12.speed_range)\n ) {\n this._speed = speed;\n }\n }\n\n /**\n * Getter for _text\n * @return {string}\n */\n get text(): string {\n return this._text;\n }\n\n /**\n * Setter for _text\n * @param {string} text\n */\n set text(text: string) {\n if (\n check12ValidFormat(text, Regex.scorm12.CMISInteger) &&\n check12ValidRange(text, Regex.scorm12.text_range)\n ) {\n this._text = text;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n speed: string;\n text: string;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n speed: this.speed,\n text: this.text,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {checkValidFormat, checkValidRange} from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm12.TYPE_MISMATCH,\n Scorm12ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidRange(\n value: any,\n rangePattern: string,\n allowEmptyString?: boolean,\n): boolean {\n if (!allowEmptyString && value === \"\") {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.VALUE_OUT_OF_RANGE);\n }\n\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n Scorm12ValidationError,\n );\n}","interface ErrorDescription {\n basicMessage: string;\n detailMessage: string;\n}\n\ninterface ErrorDescriptions {\n [key: string]: ErrorDescription;\n}\n\ninterface ScormConstants {\n cmi_children: string;\n core_children: string;\n score_children: string;\n comments_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface AiccConstants extends ScormConstants {\n student_demographics_children: string;\n tries_children: string;\n attempt_records_children: string;\n paths_children: string;\n}\n\ninterface Scorm2004Constants {\n cmi_children: string;\n comments_children: string;\n score_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface GlobalConstants {\n SCORM_TRUE: string;\n SCORM_FALSE: string;\n STATE_NOT_INITIALIZED: number;\n STATE_INITIALIZED: number;\n STATE_TERMINATED: number;\n LOG_LEVEL_DEBUG: number;\n LOG_LEVEL_INFO: number;\n LOG_LEVEL_WARNING: number;\n LOG_LEVEL_ERROR: number;\n LOG_LEVEL_NONE: number;\n}\n\ninterface APIConstants {\n global: GlobalConstants;\n scorm12: ScormConstants;\n aicc: AiccConstants;\n scorm2004: Scorm2004Constants;\n}\n\nconst global: GlobalConstants = {\n SCORM_TRUE: \"true\",\n SCORM_FALSE: \"false\",\n STATE_NOT_INITIALIZED: 0,\n STATE_INITIALIZED: 1,\n STATE_TERMINATED: 2,\n LOG_LEVEL_DEBUG: 1,\n LOG_LEVEL_INFO: 2,\n LOG_LEVEL_WARNING: 3,\n LOG_LEVEL_ERROR: 4,\n LOG_LEVEL_NONE: 5,\n};\n\nconst scorm12: ScormConstants = {\n // Children lists\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions\",\n core_children:\n \"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time\",\n score_children: \"raw,min,max\",\n comments_children: \"content,location,time\",\n objectives_children: \"id,score,status\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children: \"audio,language,speed,text\",\n interactions_children:\n \"id,objectives,time,type,correct_responses,weighting,student_response,result,latency\",\n error_descriptions: {\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information\",\n },\n \"201\": {\n basicMessage: \"Invalid argument error\",\n detailMessage:\n \"Indicates that an argument represents an invalid data model element or is otherwise incorrect.\",\n },\n \"202\": {\n basicMessage: \"Element cannot have children\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_children\" for a data model element that does not support the \"_children\" suffix.',\n },\n \"203\": {\n basicMessage: \"Element not an array - cannot have count\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_count\" for a data model element that does not support the \"_count\" suffix.',\n },\n \"301\": {\n basicMessage: \"Not initialized\",\n detailMessage:\n \"Indicates that an API call was made before the call to lmsInitialize.\",\n },\n \"401\": {\n basicMessage: \"Not implemented error\",\n detailMessage:\n \"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.\",\n },\n \"402\": {\n basicMessage: \"Invalid set value, element is a keyword\",\n detailMessage:\n 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in \"_children\" and \"_count\").',\n },\n \"403\": {\n basicMessage: \"Element is read only\",\n detailMessage:\n \"LMSSetValue was called with a data model element that can only be read.\",\n },\n \"404\": {\n basicMessage: \"Element is write only\",\n detailMessage:\n \"LMSGetValue was called on a data model element that can only be written to.\",\n },\n \"405\": {\n basicMessage: \"Incorrect Data Type\",\n detailMessage:\n \"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst aicc: AiccConstants = {\n ...scorm12,\n ...{\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation\",\n student_preference_children:\n \"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows\",\n student_data_children:\n \"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action\",\n student_demographics_children:\n \"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience\",\n tries_children: \"time,status,score\",\n attempt_records_children: \"score,lesson_status\",\n paths_children: \"location_id,date,time,status,why_left,time_in_element\",\n },\n};\nconst scorm2004: Scorm2004Constants = {\n // Children lists\n cmi_children:\n \"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time\",\n comments_children: \"comment,timestamp,location\",\n score_children: \"max,raw,scaled,min\",\n objectives_children:\n \"progress_measure,completion_status,success_status,description,score,id\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children:\n \"audio_level,audio_captioning,delivery_speed,language\",\n interactions_children:\n \"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description\",\n error_descriptions: {\n \"0\": {\n basicMessage: \"No Error\",\n detailMessage: \"No error occurred, the previous API call was successful.\",\n },\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use GetDiagnostic for more information.\",\n },\n \"102\": {\n basicMessage: \"General Initialization Failure\",\n detailMessage: \"Call to Initialize failed for an unknown reason.\",\n },\n \"103\": {\n basicMessage: \"Already Initialized\",\n detailMessage:\n \"Call to Initialize failed because Initialize was already called.\",\n },\n \"104\": {\n basicMessage: \"Content Instance Terminated\",\n detailMessage:\n \"Call to Initialize failed because Terminate was already called.\",\n },\n \"111\": {\n basicMessage: \"General Termination Failure\",\n detailMessage: \"Call to Terminate failed for an unknown reason.\",\n },\n \"112\": {\n basicMessage: \"Termination Before Initialization\",\n detailMessage:\n \"Call to Terminate failed because it was made before the call to Initialize.\",\n },\n \"113\": {\n basicMessage: \"Termination After Termination\",\n detailMessage:\n \"Call to Terminate failed because Terminate was already called.\",\n },\n \"122\": {\n basicMessage: \"Retrieve Data Before Initialization\",\n detailMessage:\n \"Call to GetValue failed because it was made before the call to Initialize.\",\n },\n \"123\": {\n basicMessage: \"Retrieve Data After Termination\",\n detailMessage:\n \"Call to GetValue failed because it was made after the call to Terminate.\",\n },\n \"132\": {\n basicMessage: \"Store Data Before Initialization\",\n detailMessage:\n \"Call to SetValue failed because it was made before the call to Initialize.\",\n },\n \"133\": {\n basicMessage: \"Store Data After Termination\",\n detailMessage:\n \"Call to SetValue failed because it was made after the call to Terminate.\",\n },\n \"142\": {\n basicMessage: \"Commit Before Initialization\",\n detailMessage:\n \"Call to Commit failed because it was made before the call to Initialize.\",\n },\n \"143\": {\n basicMessage: \"Commit After Termination\",\n detailMessage:\n \"Call to Commit failed because it was made after the call to Terminate.\",\n },\n \"201\": {\n basicMessage: \"General Argument Error\",\n detailMessage:\n \"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.\",\n },\n \"301\": {\n basicMessage: \"General Get Failure\",\n detailMessage:\n \"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"351\": {\n basicMessage: \"General Set Failure\",\n detailMessage:\n \"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"391\": {\n basicMessage: \"General Commit Failure\",\n detailMessage:\n \"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"401\": {\n basicMessage: \"Undefined Data Model Element\",\n detailMessage:\n \"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.\",\n },\n \"402\": {\n basicMessage: \"Unimplemented Data Model Element\",\n detailMessage:\n \"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.\",\n },\n \"403\": {\n basicMessage: \"Data Model Element Value Not Initialized\",\n detailMessage:\n \"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.\",\n },\n \"404\": {\n basicMessage: \"Data Model Element Is Read Only\",\n detailMessage:\n \"SetValue was called with a data model element that can only be read.\",\n },\n \"405\": {\n basicMessage: \"Data Model Element Is Write Only\",\n detailMessage:\n \"GetValue was called on a data model element that can only be written to.\",\n },\n \"406\": {\n basicMessage: \"Data Model Element Type Mismatch\",\n detailMessage:\n \"SetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Data Model Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst APIConstants: APIConstants = {\n global: global,\n scorm12: scorm12,\n aicc: aicc,\n scorm2004: scorm2004,\n};\nexport default APIConstants;\n","export enum NAVBoolean {\n unknown = \"unknown\",\n true = \"true\",\n false = \"false\",\n}\n\nexport enum SuccessStatus {\n passed = \"passed\",\n failed = \"failed\",\n unknown = \"unknown\",\n}\n\nexport enum CompletionStatus {\n completed = \"completed\",\n incomplete = \"incomplete\",\n unknown = \"unknown\",\n}\n","export type ErrorCode = {\n [key: string]: number;\n};\n\nconst global: ErrorCode = {\n GENERAL: 101,\n INITIALIZATION_FAILED: 101,\n INITIALIZED: 101,\n TERMINATED: 101,\n TERMINATION_FAILURE: 101,\n TERMINATION_BEFORE_INIT: 101,\n MULTIPLE_TERMINATION: 101,\n RETRIEVE_BEFORE_INIT: 101,\n RETRIEVE_AFTER_TERM: 101,\n STORE_BEFORE_INIT: 101,\n STORE_AFTER_TERM: 101,\n COMMIT_BEFORE_INIT: 101,\n COMMIT_AFTER_TERM: 101,\n ARGUMENT_ERROR: 101,\n CHILDREN_ERROR: 101,\n COUNT_ERROR: 101,\n GENERAL_GET_FAILURE: 101,\n GENERAL_SET_FAILURE: 101,\n GENERAL_COMMIT_FAILURE: 101,\n UNDEFINED_DATA_MODEL: 101,\n UNIMPLEMENTED_ELEMENT: 101,\n VALUE_NOT_INITIALIZED: 101,\n INVALID_SET_VALUE: 101,\n READ_ONLY_ELEMENT: 101,\n WRITE_ONLY_ELEMENT: 101,\n TYPE_MISMATCH: 101,\n VALUE_OUT_OF_RANGE: 101,\n DEPENDENCY_NOT_ESTABLISHED: 101,\n};\n\nconst scorm12: ErrorCode = {\n ...global,\n RETRIEVE_BEFORE_INIT: 301,\n STORE_BEFORE_INIT: 301,\n COMMIT_BEFORE_INIT: 301,\n ARGUMENT_ERROR: 201,\n CHILDREN_ERROR: 202,\n COUNT_ERROR: 203,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 401,\n VALUE_NOT_INITIALIZED: 301,\n INVALID_SET_VALUE: 402,\n READ_ONLY_ELEMENT: 403,\n WRITE_ONLY_ELEMENT: 404,\n TYPE_MISMATCH: 405,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst scorm2004: ErrorCode = {\n ...global,\n INITIALIZATION_FAILED: 102,\n INITIALIZED: 103,\n TERMINATED: 104,\n TERMINATION_FAILURE: 111,\n TERMINATION_BEFORE_INIT: 112,\n MULTIPLE_TERMINATIONS: 113,\n RETRIEVE_BEFORE_INIT: 122,\n RETRIEVE_AFTER_TERM: 123,\n STORE_BEFORE_INIT: 132,\n STORE_AFTER_TERM: 133,\n COMMIT_BEFORE_INIT: 142,\n COMMIT_AFTER_TERM: 143,\n ARGUMENT_ERROR: 201,\n GENERAL_GET_FAILURE: 301,\n GENERAL_SET_FAILURE: 351,\n GENERAL_COMMIT_FAILURE: 391,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 402,\n VALUE_NOT_INITIALIZED: 403,\n READ_ONLY_ELEMENT: 404,\n WRITE_ONLY_ELEMENT: 405,\n TYPE_MISMATCH: 406,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst ErrorCodes = {\n scorm12,\n scorm2004,\n};\n\nexport default ErrorCodes;\n","const scorm12 = {\n CMIString256: \"^.{0,255}$\",\n CMIString4096: \"^.{0,4096}$\",\n CMITime: \"^(?:[01]\\\\d|2[0123]):(?:[012345]\\\\d):(?:[012345]\\\\d)$\",\n CMITimespan: \"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$\",\n\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{0,3})(.[0-9]*)?$\",\n\n CMIIdentifier: \"^[\\\\u0021-\\\\u007E\\\\s]{0,255}$\",\n CMIFeedback: \"^.{0,255}$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n // Vocabulary Data Type Definition\n CMIStatus: \"^(passed|completed|failed|incomplete|browsed)$\",\n CMIStatus2: \"^(passed|completed|failed|incomplete|browsed|not attempted)$\",\n CMIExit: \"^(time-out|suspend|logout|)$\",\n CMIType:\n \"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$\",\n CMIResult:\n \"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\\\.[0-9]*)?)$\",\n NAVEvent: \"^(previous|continue)$\",\n // Data ranges\n score_range: \"0#100\",\n audio_range: \"-1#100\",\n speed_range: \"-100#100\",\n weighting_range: \"-100#100\",\n text_range: \"-1#1\",\n};\nconst aicc = {\n ...scorm12,\n ...{\n CMIIdentifier: \"^\\\\w{1,255}$\",\n },\n};\nconst scorm2004 = {\n CMIString200: \"^[\\\\u0000-\\\\uFFFF]{0,200}$\",\n CMIString250: \"^[\\\\u0000-\\\\uFFFF]{0,250}$\",\n CMIString1000: \"^[\\\\u0000-\\\\uFFFF]{0,1000}$\",\n CMIString4000: \"^[\\\\u0000-\\\\uFFFF]{0,4000}$\",\n CMIString64000: \"^[\\\\u0000-\\\\uFFFF]{0,64000}$\",\n CMILang: \"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$\",\n\n CMILangString250:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$\",\n\n CMILangcr: \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$\",\n\n CMILangString250cr:\n \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$\",\n\n CMILangString4000:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$\",\n\n CMITime:\n \"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$\",\n CMITimespan:\n \"^P(?:([.,\\\\d]+)Y)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)W)?(?:([.,\\\\d]+)D)?(?:T?(?:([.,\\\\d]+)H)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)S)?)?$\",\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{1,5})(\\\\.[0-9]{1,18})?$\",\n CMIIdentifier: \"^\\\\S{1,250}[a-zA-Z0-9]$\",\n CMIShortIdentifier: \"^[\\\\w\\\\.\\\\-\\\\_]{1,250}$\",\n CMILongIdentifier:\n \"^(?:(?!urn:)\\\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\\\S{1,4000}|.{1,4000})$\",\n // need to re-examine this\n CMIFeedback: \"^.*$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n CMIIndexStore: \".N(\\\\d+).\",\n // Vocabulary Data Type Definition\n CMICStatus: \"^(completed|incomplete|not attempted|unknown)$\",\n CMISStatus: \"^(passed|failed|unknown)$\",\n CMIExit: \"^(time-out|suspend|logout|normal)$\",\n CMIType:\n \"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$\",\n CMIResult:\n \"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\\\.[0-9]{1,18})?)$\",\n NAVEvent:\n \"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?jump)$\",\n\n NAVBoolean: \"^(unknown|true|false$)\",\n NAVTarget: \"^{target=\\\\S{0,}[a-zA-Z0-9-_]+}$\",\n // Data ranges\n scaled_range: \"-1#1\",\n audio_range: \"0#*\",\n speed_range: \"0#*\",\n text_range: \"-1#1\",\n progress_range: \"0#1\",\n};\nconst Regex = {\n aicc: aicc,\n scorm12: scorm12,\n scorm2004: scorm2004,\n};\nexport default Regex;\n","import APIConstants from \"./constants/api_constants\";\n\nconst scorm12_errors = APIConstants.scorm12.error_descriptions;\nconst aicc_errors = APIConstants.aicc.error_descriptions;\nconst scorm2004_errors = APIConstants.scorm2004.error_descriptions;\n\ntype APIError = {\n errorCode: number;\n errorMessage: string;\n detailedMessage: string;\n};\n\nexport class BaseScormValidationError extends Error {\n constructor(errorCode: number) {\n super(errorCode.toString());\n this._errorCode = errorCode;\n this.name = \"ScormValidationError\";\n }\n\n private readonly _errorCode: number;\n\n /**\n * Getter for _errorCode\n * @return {number}\n */\n get errorCode(): number {\n return this._errorCode;\n }\n\n setMessage(message: string) {\n this.message = message;\n }\n}\n\n/**\n * Base Validation Exception\n */\nexport class ValidationError\n extends BaseScormValidationError\n implements APIError\n{\n /**\n * Constructor to take in an error message and code\n * @param {number} errorCode\n * @param {string} errorMessage\n * @param {string} detailedMessage\n */\n constructor(\n errorCode: number,\n errorMessage: string,\n detailedMessage?: string,\n ) {\n super(errorCode);\n this.setMessage(errorMessage);\n this._errorMessage = errorMessage;\n if (detailedMessage) {\n this._detailedMessage = detailedMessage;\n }\n }\n\n private readonly _errorMessage: string;\n private readonly _detailedMessage: string = \"\";\n\n /**\n * Getter for _errorMessage\n * @return {string}\n */\n get errorMessage(): string {\n return this._errorMessage;\n }\n\n /**\n * Getter for _detailedMessage\n * @return {string}\n */\n get detailedMessage(): string {\n return this._detailedMessage;\n }\n}\n\n/**\n * SCORM 1.2 Validation Error\n */\nexport class Scorm12ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {\n super(\n errorCode,\n scorm12_errors[String(errorCode)].basicMessage,\n scorm12_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm12_errors[\"101\"].basicMessage,\n scorm12_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * AICC Validation Error\n */\nexport class AICCValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {\n super(\n errorCode,\n aicc_errors[String(errorCode)].basicMessage,\n aicc_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n aicc_errors[\"101\"].basicMessage,\n aicc_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * SCORM 2004 Validation Error\n */\nexport class Scorm2004ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {\n super(\n errorCode,\n scorm2004_errors[String(errorCode)].basicMessage,\n scorm2004_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm2004_errors[\"101\"].basicMessage,\n scorm2004_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n","export const SECONDS_PER_SECOND = 1.0;\nexport const SECONDS_PER_MINUTE = 60;\nexport const SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;\nexport const SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR;\n\ntype Designation = {\n [key: string]: number;\n};\n\ntype StringKeyMap = {\n [key: string]: any;\n};\n\nconst designations: Designation = {\n D: SECONDS_PER_DAY,\n H: SECONDS_PER_HOUR,\n M: SECONDS_PER_MINUTE,\n S: SECONDS_PER_SECOND,\n};\n\n/**\n * Converts a Number to a String of HH:MM:SS\n *\n * @param {number} totalSeconds\n * @return {string}\n */\nexport function getSecondsAsHHMMSS(totalSeconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!totalSeconds || totalSeconds <= 0) {\n return \"00:00:00\";\n }\n\n const hours = Math.floor(totalSeconds / SECONDS_PER_HOUR);\n const dateObj = new Date(totalSeconds * 1000);\n const minutes = dateObj.getUTCMinutes();\n // make sure we add any possible decimal value\n const seconds = dateObj.getSeconds();\n const ms = totalSeconds % 1.0;\n let msStr = \"\";\n\n if (countDecimals(ms) > 0) {\n if (countDecimals(ms) > 2) {\n msStr = ms.toFixed(2);\n } else {\n msStr = String(ms);\n }\n\n msStr = \".\" + msStr.split(\".\")[1];\n }\n\n return (\n (hours + \":\" + minutes + \":\" + seconds).replace(/\\b\\d\\b/g, \"0$&\") + msStr\n );\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {number} seconds\n * @return {string}\n */\nexport function getSecondsAsISODuration(seconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!seconds || seconds <= 0) {\n return \"PT0S\";\n }\n\n let duration = \"P\";\n let remainder = seconds;\n for (const designationsKey in designations) {\n const current_seconds = designations[designationsKey];\n let value = Math.floor(remainder / current_seconds);\n remainder = remainder % current_seconds;\n\n if (countDecimals(remainder) > 2) {\n remainder = Number(Number(remainder).toFixed(2));\n }\n\n // If we have anything left in the remainder, and we're currently adding\n // seconds to the duration, go ahead and add the decimal to the seconds\n if (designationsKey === \"S\" && remainder > 0) {\n value += remainder;\n }\n\n if (value) {\n if (\n (duration.indexOf(\"D\") > 0 ||\n designationsKey === \"H\" ||\n designationsKey === \"M\" ||\n designationsKey === \"S\") &&\n duration.indexOf(\"T\") === -1\n ) {\n duration += \"T\";\n }\n\n duration += `${value}${designationsKey}`;\n }\n }\n return duration;\n}\n\n/**\n * Calculate the number of seconds from HH:MM:SS.DDDDDD\n *\n * @param {string} timeString\n * @param {RegExp} timeRegex\n * @return {number}\n */\nexport function getTimeAsSeconds(\n timeString: string | number | boolean | null,\n timeRegex: RegExp | string,\n): number {\n if (typeof timeString === \"number\" || typeof timeString === \"boolean\") {\n timeString = String(timeString);\n }\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n if (!timeString || !timeString.match(timeRegex)) {\n return 0;\n }\n\n const parts = timeString.split(\":\");\n const hours = Number(parts[0]);\n const minutes = Number(parts[1]);\n const seconds = Number(parts[2]);\n return hours * 3600 + minutes * 60 + seconds;\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {string} duration\n * @param {RegExp} durationRegex\n * @return {number}\n */\nexport function getDurationAsSeconds(\n duration: string | null,\n durationRegex: RegExp | string,\n): number {\n if (typeof durationRegex === \"string\") {\n durationRegex = new RegExp(durationRegex);\n }\n\n if (!duration || !duration.match(durationRegex)) {\n return 0;\n }\n\n const [, years, _, , days, hours, minutes, seconds] =\n new RegExp(durationRegex).exec(duration) || [];\n let result = 0.0;\n result += Number(seconds) || 0.0;\n result += Number(minutes) * 60.0 || 0.0;\n result += Number(hours) * 3600.0 || 0.0;\n result += Number(days) * (60 * 60 * 24.0) || 0.0;\n result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0;\n return result;\n}\n\n/**\n * Adds together two ISO8601 Duration strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp|string} durationRegex\n * @return {string}\n */\nexport function addTwoDurations(\n first: string,\n second: string,\n durationRegex: RegExp | string,\n): string {\n const regex: RegExp =\n typeof durationRegex === \"string\"\n ? new RegExp(durationRegex)\n : durationRegex;\n return getSecondsAsISODuration(\n getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex),\n );\n}\n\n/**\n * Add together two HH:MM:SS.DD strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp} timeRegex\n * @return {string}\n */\nexport function addHHMMSSTimeStrings(\n first: string,\n second: string,\n timeRegex: RegExp | string,\n): string {\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n return getSecondsAsHHMMSS(\n getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex),\n );\n}\n\n/**\n * Flatten a JSON object down to string paths for each values\n * @param {object} data\n * @return {object}\n */\nexport function flatten(data: StringKeyMap): object {\n const result: StringKeyMap = {};\n\n /**\n * Recurse through the object\n * @param {*} cur\n * @param {*} prop\n */\n function recurse(cur: any, prop: any) {\n if (Object(cur) !== cur) {\n result[prop] = cur;\n } else if (Array.isArray(cur)) {\n for (let i = 0, l = cur.length; i < l; i++) {\n recurse(cur[i], prop + \"[\" + i + \"]\");\n if (l === 0) result[prop] = [];\n }\n } else {\n let isEmpty = true;\n\n for (const p in cur) {\n if ({}.hasOwnProperty.call(cur, p)) {\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p);\n }\n }\n\n if (isEmpty && prop) result[prop] = {};\n }\n }\n\n recurse(data, \"\");\n return result;\n}\n\n/**\n * Un-flatten a flat JSON object\n * @param {object} data\n * @return {object}\n */\nexport function unflatten(data: StringKeyMap): object {\n \"use strict\";\n\n if (Object(data) !== data || Array.isArray(data)) return data;\n const regex = /\\.?([^.[\\]]+)|\\[(\\d+)]/g;\n const result: StringKeyMap = {};\n\n for (const p in data) {\n if ({}.hasOwnProperty.call(data, p)) {\n let cur = result;\n let prop = \"\";\n let m = regex.exec(p);\n\n while (m) {\n cur = cur[prop] || (cur[prop] = m[2] ? [] : {});\n prop = m[2] || m[1];\n m = regex.exec(p);\n }\n\n cur[prop] = data[p];\n }\n }\n\n return result[\"\"] || result;\n}\n\n/**\n * Counts the number of decimal places\n * @param {number} num\n * @return {number}\n */\nexport function countDecimals(num: number): number {\n if (Math.floor(num) === num || String(num).indexOf(\".\") < 0) return 0;\n const parts = num.toString().split(\".\")[1];\n return parts.length || 0;\n}\n\n/**\n * Formats the SCORM messages for easy reading\n *\n * @param {string} functionName\n * @param {string} message\n * @param {string} CMIElement\n * @return {string}\n */\nexport function formatMessage(\n functionName: string,\n message: string,\n CMIElement?: string,\n): string {\n const baseLength = 20;\n let messageString = \"\";\n\n messageString += functionName;\n\n let fillChars = baseLength - messageString.length;\n\n for (let i = 0; i < fillChars; i++) {\n messageString += \" \";\n }\n\n messageString += \": \";\n\n if (CMIElement) {\n const CMIElementBaseLength = 70;\n\n messageString += CMIElement;\n\n fillChars = CMIElementBaseLength - messageString.length;\n\n for (let j = 0; j < fillChars; j++) {\n messageString += \" \";\n }\n }\n\n if (message) {\n messageString += message;\n }\n\n return messageString;\n}\n\n/**\n * Checks to see if {str} contains {tester}\n *\n * @param {string} str String to check against\n * @param {string} tester String to check for\n * @return {boolean}\n */\nexport function stringMatches(str: string, tester: string): boolean {\n return str?.match(tester) !== null;\n}\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","import { AICCImpl } from \"./AICC\";\nimport { Scorm12Impl } from \"./Scorm12API\";\nimport { Scorm2004Impl } from \"./Scorm2004API\";\n\nconst Scorm12API = Scorm12Impl;\nconst Scorm2004API = Scorm2004Impl;\nconst AICC = AICCImpl;\n\nexport { Scorm12API, Scorm2004API, AICC };\n"],"names":["aicc_error_codes","scorm12","checkAICCValidFormat","value","regexPattern","allowEmptyString","TYPE_MISMATCH","comments","CMIEvaluationComments","initialize","this","toJSON","jsonString","result","children","A","aicc","comments_children","errorCode","INVALID_SET_VALUE","errorClass","_content","_location","_time","content","CMIString256","location","time","CMITime","student_preference_children","_lesson_type","_text_color","_text_location","_text_size","_video","windows","lesson_type","text_color","text_location","text_size","video","audio","language","speed","text","__children","student_demographics_children","_city","_class","_company","_country","_experience","_familiar_name","_instructor_name","_title","_native_language","_state","_street_address","_telephone","_years_experience","city","initialized","READ_ONLY_ELEMENT","clazz","company","country","experience","familiar_name","instructor_name","title","native_language","state","street_address","telephone","years_experience","class","tries_children","_status","score","score_children","score_range","invalidErrorCode","invalidTypeCode","invalidRangeCode","VALUE_OUT_OF_RANGE","status","CMIStatus2","attempt_records_children","_lesson_status","lesson_status","student_data_children","_tries_during_lesson","tries","CMITries","attempt_records","CMIAttemptRecords","tries_during_lesson","mastery_score","max_time_allowed","time_limit_action","paths_children","_location_id","_date","_why_left","_time_in_element","location_id","date","why_left","time_in_element","cmi_children","student_preference","AICCStudentPreferences","student_data","AICCCMIStudentData","student_demographics","CMIStudentDemographics","evaluation","CMIEvaluation","paths","CMIPaths","suspend_data","launch_data","comments_from_lms","core","objectives","interactions","settings","cmi","CMI","nav","getChildElement","CMIElement","foundFirstIndex","newChild","CMIEvaluationCommentsObject","CMITriesObject","CMIAttemptRecordsObject","CMIPathsObject","replaceWithAnotherScormAPI","newAPI","DefaultSettings","autocommit","autocommitSeconds","asyncCommit","sendFullCommit","lmsCommitUrl","dataCommitFormat","commitRequestDataType","autoProgress","logLevel","global","LOG_LEVEL_ERROR","selfReportSessionTime","alwaysSendTotalTime","renderCommonCommitFields","strict_errors","xhrHeaders","xhrWithCredentials","responseHandler","response","JSON","parse","httpResult","hasOwnProperty","call","SCORM_TRUE","SCORM_FALSE","requestHandler","commitObject","onLogMessage","messageLevel","logMessage","console","error","LOG_LEVEL_WARNING","warn","LOG_LEVEL_INFO","info","LOG_LEVEL_DEBUG","debug","log","scoItemIds","scoItemIdValidator","API","when","callback","_cancelled","_API","_timeout","setTimeout","wrapper","bind","_callback","cancel","clearTimeout","commit","error_codes","_settings","BaseAPI","TypeError","currentState","STATE_NOT_INITIALIZED","lastErrorCode","listenerArray","_error_codes","apiLogLevel","commonReset","callbackName","initializeMessage","terminationMessage","returnValue","isInitialized","throwSCORMError","INITIALIZED","isTerminated","TERMINATED","setStartTime","STATE_INITIALIZED","processListeners","apiLog","clearSCORMError","functionName","terminate","checkTerminated","checkState","TERMINATION_BEFORE_INIT","MULTIPLE_TERMINATION","STATE_TERMINATED","storeData","getValue","RETRIEVE_BEFORE_INIT","RETRIEVE_AFTER_TERM","getCMIValue","e","handleValueAccessException","undefined","setValue","commitCallback","String","STORE_BEFORE_INIT","STORE_AFTER_TERM","setCMIValue","scheduleCommit","clearScheduledCommit","COMMIT_BEFORE_INIT","COMMIT_AFTER_TERM","getLastError","getErrorString","CMIErrorCode","getLmsErrorMessageDetails","getDiagnostic","beforeInitError","afterTermError","isNotInitialized","_errorNumber","_detail","Error","_CMIElement","_value","_commonSetCMIValue","methodName","scorm2004","structure","split","refObject","invalidErrorMessage","UNDEFINED_DATA_MODEL","GENERAL","idx","length","attribute","substring","_checkObjectHasProperty","validateCorrectResponse","index","parseInt","isNaN","item","childArray","push","_commonGetCMIValue","uninitializedErrorMessage","_isTargetValid","target","VALUE_NOT_INITIALIZED","CHILDREN_ERROR","COUNT_ERROR","on","listenerName","listenerFunctions","i","listenerSplit","replace","off","removeIndex","findIndex","obj","splice","clear","filter","listener","functionsMatch","listenerHasCMIElement","CMIElementsMatch","indexOf","errorNumber","message","success","loadFromFlattenedJSON","json","int_pattern","obj_pattern","Object","keys","map","key","sort","test","a","c","testPattern","forEach","element","loadFromJSON","a_pattern","c_match","a_match","match","a_num","Number","c_num","startingData","currentCMIElement","constructor","renderCMIToJSONString","stringify","k","v","renderCMIToJSONObject","processHttpRequest","url","params","immediate","api","genericError","performFetch","then","transformResponse","process","debouncedProcess","func","wait","timeout","context","callNow","apply","args","debounce","ScheduledCommit","getOwnPropertyDescriptor","getPrototypeOf","fetch","method","body","Array","join","headers","credentials","keepalive","mastery_override","statusSetByModule","LMSInitialize","lmsInitialize","LMSFinish","lmsFinish","LMSGetValue","lmsGetValue","LMSSetValue","lmsSetValue","LMSCommit","lmsCommit","LMSGetLastError","lmsGetLastError","LMSGetErrorString","lmsGetErrorString","LMSGetDiagnostic","lmsGetDiagnostic","reset","internalFinish","event","detail","basicMessage","detailMessage","error_descriptions","renderCommitCMI","terminateCommit","cmiExport","total_time","getCurrentTotalTime","flattened","renderCommitObject","totalTimeHHMMSS","totalTimeSeconds","CMITimespan","lessonStatus","completionStatus","unknown","successStatus","completed","incomplete","passed","failed","scoreObject","parseFloat","raw","min","max","runtimeData","originalStatus","lesson_mode","credit","shouldTerminateCommit","check2004ValidFormat","check2004ValidRange","rangePattern","_audio_level","_language","_delivery_speed","_audio_captioning","_children","audio_level","CMIDecimal","audio_range","CMILang","delivery_speed","speed_range","audio_captioning","CMISInteger","text_range","scorm2004_regex","LearnerResponses","format","delimiter","unique","choice","CMILongIdentifier","CMILangString250","CMILangString4000","matching","CMIShortIdentifier","format2","delimiter2","performance","sequencing","likert","numeric","other","CMIString4000","CorrectResponses","duplicate","limit","CMILangString250cr","delimiter3","interactions_children","_id","_type","_timestamp","_weighting","_learner_response","_result","_latency","_description","objectives_children","correct_responses","correct_responses_children","id","type","DEPENDENCY_NOT_ESTABLISHED","CMIType","timestamp","weighting","learner_response","nodes","response_type","GENERAL_SET_FAILURE","formatRegex","RegExp","values","j","CMIResult","latency","description","_pattern","pattern","CMIFeedback","decimalRegex","_scaled","scaled","scaled_range","readOnlyAfterInit","_comment","_readOnlyAfterInit","comment","CMIString250","_success_status","_completion_status","_progress_measure","Scorm2004CMIScore","success_status","CMISStatus","completion_status","CMICStatus","progress_measure","progress_range","__version","_completion_threshold","_credit","_entry","_exit","_launch_data","_learner_id","_learner_name","_max_time_allowed","_mode","_scaled_passing_score","_session_time","_suspend_data","_time_limit_action","_total_time","learner_preference","CMILearnerPreference","comments_from_learner","CMICommentsFromLearner","CMICommentsFromLMS","CMIInteractions","CMIObjectives","_version","completion_threshold","entry","WRITE_ONLY_ELEMENT","exit","CMIExit","learner_id","learner_name","CMIString1000","mode","scaled_passing_score","session_time","CMIString64000","sessionTime","startTime","start_time","seconds","Date","getTime","ADLNav","_request","request_valid","ADLNavRequestValid","request","NAVEvent","_continue","_previous","_choice","_jump","NAVBoolean","NAVTarget","jump","previous","continue","adl","ADL","Initialize","Terminate","GetValue","SetValue","Commit","GetLastError","GetErrorString","GetDiagnostic","navActions","exitAll","abandon","abandonAll","choiceJumpRegex","regex","matches","action","adlNavRequestRegex","includes","CMIObjectivesObject","createCorrectResponsesObject","CMIInteractionsObjectivesObject","CMIInteractionsObject","CMICommentsObject","parts","interaction","checkDuplicateChoiceResponse","checkValidResponseType","CMIInteractionsCorrectResponsesObject","interaction_type","checkCorrectResponseValue","interaction_count","_count","pattern_index","checkDuplicatedPattern","correct_response","current_index","found","count","removeCorrectResponsePrefixes","node","seenOrder","seenCase","seenLang","prefixRegex","langMatches","CMILangcr","lang","toLowerCase","totalTimeDuration","navRequest","encodeURIComponent","Function","scorm12_error_codes","_errorCode","_errorClass","_initialized","_start_time","BaseCMI","scorm12_constants","scorm12_regex","_raw","_min","__score_range","_max","__invalid_error_code","__invalid_type_code","__invalid_range_code","__decimal_regex","__error_class","checkValidFormat","checkValidRange","ranges","core_children","_student_id","_student_name","_lesson_location","_lesson_mode","student_id","student_name","lesson_location","CMIStatus","CMIString4096","_comments","_comments_from_lms","CMICore","C","_student_response","CMIIdentifier","weighting_range","student_response","_event","_mastery_score","_audio","_speed","_text","check12ValidFormat","check12ValidRange","APIConstants","LOG_LEVEL_NONE","SuccessStatus","CompletionStatus","INITIALIZATION_FAILED","TERMINATION_FAILURE","ARGUMENT_ERROR","GENERAL_GET_FAILURE","GENERAL_COMMIT_FAILURE","UNIMPLEMENTED_ELEMENT","ErrorCodes","MULTIPLE_TERMINATIONS","CMIInteger","CMIIndex","Regex","CMIString200","CMIIndexStore","scorm12_errors","aicc_errors","scorm2004_errors","toString","name","setMessage","errorMessage","detailedMessage","_detailedMessage","_errorMessage","BaseScormValidationError","ValidationError","SECONDS_PER_HOUR","designations","D","H","M","S","getSecondsAsHHMMSS","totalSeconds","hours","Math","floor","dateObj","minutes","getUTCMinutes","getSeconds","ms","msStr","countDecimals","toFixed","getSecondsAsISODuration","duration","remainder","designationsKey","current_seconds","getTimeAsSeconds","timeString","timeRegex","getDurationAsSeconds","durationRegex","exec","years","days","addTwoDurations","first","second","addHHMMSSTimeStrings","flatten","data","recurse","cur","prop","isArray","l","isEmpty","p","unflatten","m","num","formatMessage","messageString","fillChars","stringMatches","str","tester","extendStatics","d","b","setPrototypeOf","__proto__","prototype","__extends","__","create","__assign","assign","t","s","n","arguments","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","step","next","rejected","done","__generator","f","y","_","label","sent","trys","ops","g","Iterator","verb","Symbol","iterator","op","pop","SuppressedError","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","__webpack_modules__","definition","o","defineProperty","enumerable","get","Scorm12API","Scorm2004API","AICC"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/esm/scorm12.js b/dist/esm/scorm12.js new file mode 100644 index 0000000..653fc7f --- /dev/null +++ b/dist/esm/scorm12.js @@ -0,0 +1,3655 @@ +/******/ var __webpack_modules__ = ({ + +/***/ 900: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + A: function() { return /* binding */ src_BaseAPI; } +}); + +// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs +var tslib_es6 = __webpack_require__(635); +// EXTERNAL MODULE: ./src/cmi/common/array.ts +var array = __webpack_require__(589); +// EXTERNAL MODULE: ./src/exceptions.ts +var exceptions = __webpack_require__(784); +// EXTERNAL MODULE: ./src/constants/error_codes.ts +var error_codes = __webpack_require__(797); +// EXTERNAL MODULE: ./src/constants/api_constants.ts +var api_constants = __webpack_require__(340); +// EXTERNAL MODULE: ./src/utilities.ts +var utilities = __webpack_require__(864); +;// ./src/utilities/debounce.ts +function debounce(func, wait, immediate) { + if (immediate === void 0) { immediate = false; } + var timeout; + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var context = this; + var later = function () { + timeout = null; + if (!immediate) + func.apply(context, args); + }; + var callNow = immediate && !timeout; + if (timeout) + clearTimeout(timeout); + timeout = setTimeout(later, wait); + if (callNow) + func.apply(context, args); + }; +} + +;// ./src/constants/default_settings.ts + + +var DefaultSettings = { + autocommit: false, + autocommitSeconds: 10, + asyncCommit: false, + sendFullCommit: true, + lmsCommitUrl: false, + dataCommitFormat: "json", + commitRequestDataType: "application/json;charset=UTF-8", + autoProgress: false, + logLevel: api_constants/* default */.A.global.LOG_LEVEL_ERROR, + selfReportSessionTime: false, + alwaysSendTotalTime: false, + renderCommonCommitFields: false, + strict_errors: true, + xhrHeaders: {}, + xhrWithCredentials: false, + responseHandler: function (response) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + var httpResult, _a, _b; + return (0,tslib_es6/* __generator */.YH)(this, function (_c) { + switch (_c.label) { + case 0: + if (!(typeof response !== "undefined")) return [3, 2]; + _b = (_a = JSON).parse; + return [4, response.text()]; + case 1: + httpResult = _b.apply(_a, [_c.sent()]); + if (httpResult === null || + !{}.hasOwnProperty.call(httpResult, "result")) { + if (response.status === 200) { + return [2, { + result: api_constants/* default */.A.global.SCORM_TRUE, + errorCode: 0, + }]; + } + else { + return [2, { + result: api_constants/* default */.A.global.SCORM_FALSE, + errorCode: 101, + }]; + } + } + else { + return [2, { + result: httpResult.result, + errorCode: httpResult.errorCode + ? httpResult.errorCode + : httpResult.result === api_constants/* default */.A.global.SCORM_TRUE + ? 0 + : 101, + }]; + } + _c.label = 2; + case 2: return [2, { + result: api_constants/* default */.A.global.SCORM_FALSE, + errorCode: 101, + }]; + } + }); + }); + }, + requestHandler: function (commitObject) { + return commitObject; + }, + onLogMessage: function (messageLevel, logMessage) { + switch (messageLevel) { + case api_constants/* default */.A.global.LOG_LEVEL_ERROR: + console.error(logMessage); + break; + case api_constants/* default */.A.global.LOG_LEVEL_WARNING: + console.warn(logMessage); + break; + case api_constants/* default */.A.global.LOG_LEVEL_INFO: + console.info(logMessage); + break; + case api_constants/* default */.A.global.LOG_LEVEL_DEBUG: + if (console.debug) { + console.debug(logMessage); + } + else { + console.log(logMessage); + } + break; + } + }, + scoItemIds: [], + scoItemIdValidator: false, +}; + +;// ./src/helpers/scheduled_commit.ts + +var ScheduledCommit = (function () { + function ScheduledCommit(API, when, callback) { + this._cancelled = false; + this._API = API; + this._timeout = setTimeout(this.wrapper.bind(this), when); + this._callback = callback; + } + ScheduledCommit.prototype.cancel = function () { + this._cancelled = true; + if (this._timeout) { + clearTimeout(this._timeout); + } + }; + ScheduledCommit.prototype.wrapper = function () { + var _this = this; + if (!this._cancelled) { + (function () { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this._API.commit(this._callback)]; + case 1: return [2, _a.sent()]; + } + }); }); })(); + } + }; + return ScheduledCommit; +}()); + + +;// ./src/BaseAPI.ts + + + + + + + + + +var BaseAPI = (function () { + function BaseAPI(error_codes, settings) { + var _newTarget = this.constructor; + this._settings = DefaultSettings; + if (_newTarget === BaseAPI) { + throw new TypeError("Cannot construct BaseAPI instances directly"); + } + this.currentState = api_constants/* default */.A.global.STATE_NOT_INITIALIZED; + this.lastErrorCode = "0"; + this.listenerArray = []; + this._error_codes = error_codes; + if (settings) { + this.settings = settings; + } + this.apiLogLevel = this.settings.logLevel; + this.selfReportSessionTime = this.settings.selfReportSessionTime; + } + BaseAPI.prototype.commonReset = function (settings) { + this.settings = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, this.settings), settings); + this.currentState = api_constants/* default */.A.global.STATE_NOT_INITIALIZED; + this.lastErrorCode = "0"; + this.listenerArray = []; + }; + BaseAPI.prototype.initialize = function (callbackName, initializeMessage, terminationMessage) { + var returnValue = api_constants/* default */.A.global.SCORM_FALSE; + if (this.isInitialized()) { + this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage); + } + else if (this.isTerminated()) { + this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage); + } + else { + if (this.selfReportSessionTime) { + this.cmi.setStartTime(); + } + this.currentState = api_constants/* default */.A.global.STATE_INITIALIZED; + this.lastErrorCode = "0"; + returnValue = api_constants/* default */.A.global.SCORM_TRUE; + this.processListeners(callbackName); + } + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + this.clearSCORMError(returnValue); + return returnValue; + }; + BaseAPI.prototype.apiLog = function (functionName, logMessage, messageLevel, CMIElement) { + logMessage = (0,utilities/* formatMessage */.hw)(functionName, logMessage, CMIElement); + if (messageLevel >= this.apiLogLevel) { + this.settings.onLogMessage(messageLevel, logMessage); + } + }; + Object.defineProperty(BaseAPI.prototype, "error_codes", { + get: function () { + return this._error_codes; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BaseAPI.prototype, "settings", { + get: function () { + return this._settings; + }, + set: function (settings) { + this._settings = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, this._settings), settings); + }, + enumerable: false, + configurable: true + }); + BaseAPI.prototype.terminate = function (callbackName, checkTerminated) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + var returnValue, result; + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: + returnValue = api_constants/* default */.A.global.SCORM_FALSE; + if (!this.checkState(checkTerminated, this._error_codes.TERMINATION_BEFORE_INIT, this._error_codes.MULTIPLE_TERMINATION)) return [3, 2]; + this.currentState = api_constants/* default */.A.global.STATE_TERMINATED; + return [4, this.storeData(true)]; + case 1: + result = _a.sent(); + if (typeof result.errorCode !== "undefined" && result.errorCode > 0) { + this.throwSCORMError(result.errorCode); + } + returnValue = + typeof result !== "undefined" && result.result + ? result.result + : api_constants/* default */.A.global.SCORM_FALSE; + if (checkTerminated) + this.lastErrorCode = "0"; + returnValue = api_constants/* default */.A.global.SCORM_TRUE; + this.processListeners(callbackName); + _a.label = 2; + case 2: + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + this.clearSCORMError(returnValue); + return [2, returnValue]; + } + }); + }); + }; + BaseAPI.prototype.getValue = function (callbackName, checkTerminated, CMIElement) { + var returnValue = ""; + if (this.checkState(checkTerminated, this._error_codes.RETRIEVE_BEFORE_INIT, this._error_codes.RETRIEVE_AFTER_TERM)) { + if (checkTerminated) + this.lastErrorCode = "0"; + try { + returnValue = this.getCMIValue(CMIElement); + } + catch (e) { + returnValue = this.handleValueAccessException(e, returnValue); + } + this.processListeners(callbackName, CMIElement); + } + this.apiLog(callbackName, ": returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); + if (returnValue === undefined) { + return ""; + } + this.clearSCORMError(returnValue); + return returnValue; + }; + BaseAPI.prototype.setValue = function (callbackName, commitCallback, checkTerminated, CMIElement, value) { + if (value !== undefined) { + value = String(value); + } + var returnValue = api_constants/* default */.A.global.SCORM_FALSE; + if (this.checkState(checkTerminated, this._error_codes.STORE_BEFORE_INIT, this._error_codes.STORE_AFTER_TERM)) { + if (checkTerminated) + this.lastErrorCode = "0"; + try { + returnValue = this.setCMIValue(CMIElement, value); + } + catch (e) { + this.handleValueAccessException(e, returnValue); + } + this.processListeners(callbackName, CMIElement, value); + } + if (returnValue === undefined) { + returnValue = api_constants/* default */.A.global.SCORM_FALSE; + } + if (String(this.lastErrorCode) === "0") { + if (this.settings.autocommit && !this._timeout) { + this.scheduleCommit(this.settings.autocommitSeconds * 1000, commitCallback); + } + } + this.apiLog(callbackName, ": " + value + ": result: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); + this.clearSCORMError(returnValue); + return returnValue; + }; + BaseAPI.prototype.commit = function (callbackName_1) { + return (0,tslib_es6/* __awaiter */.sH)(this, arguments, void 0, function (callbackName, checkTerminated) { + var returnValue, result; + if (checkTerminated === void 0) { checkTerminated = false; } + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: + this.clearScheduledCommit(); + returnValue = api_constants/* default */.A.global.SCORM_FALSE; + if (!this.checkState(checkTerminated, this._error_codes.COMMIT_BEFORE_INIT, this._error_codes.COMMIT_AFTER_TERM)) return [3, 2]; + return [4, this.storeData(false)]; + case 1: + result = _a.sent(); + if (result.errorCode && result.errorCode > 0) { + this.throwSCORMError(result.errorCode); + } + returnValue = + typeof result !== "undefined" && result.result + ? result.result + : api_constants/* default */.A.global.SCORM_FALSE; + this.apiLog(callbackName, " Result: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_DEBUG, "HttpRequest"); + if (checkTerminated) + this.lastErrorCode = "0"; + this.processListeners(callbackName); + _a.label = 2; + case 2: + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + this.clearSCORMError(returnValue); + return [2, returnValue]; + } + }); + }); + }; + BaseAPI.prototype.getLastError = function (callbackName) { + var returnValue = String(this.lastErrorCode); + this.processListeners(callbackName); + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + return returnValue; + }; + BaseAPI.prototype.getErrorString = function (callbackName, CMIErrorCode) { + var returnValue = ""; + if (CMIErrorCode !== null && CMIErrorCode !== "") { + returnValue = this.getLmsErrorMessageDetails(CMIErrorCode); + this.processListeners(callbackName); + } + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + return returnValue; + }; + BaseAPI.prototype.getDiagnostic = function (callbackName, CMIErrorCode) { + var returnValue = ""; + if (CMIErrorCode !== null && CMIErrorCode !== "") { + returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true); + this.processListeners(callbackName); + } + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + return returnValue; + }; + BaseAPI.prototype.checkState = function (checkTerminated, beforeInitError, afterTermError) { + if (this.isNotInitialized()) { + this.throwSCORMError(beforeInitError); + return false; + } + else if (checkTerminated && this.isTerminated()) { + this.throwSCORMError(afterTermError); + return false; + } + return true; + }; + BaseAPI.prototype.getLmsErrorMessageDetails = function (_errorNumber, _detail) { + if (_detail === void 0) { _detail = false; } + throw new Error("The getLmsErrorMessageDetails method has not been implemented"); + }; + BaseAPI.prototype.getCMIValue = function (_CMIElement) { + throw new Error("The getCMIValue method has not been implemented"); + }; + BaseAPI.prototype.setCMIValue = function (_CMIElement, _value) { + throw new Error("The setCMIValue method has not been implemented"); + }; + BaseAPI.prototype._commonSetCMIValue = function (methodName, scorm2004, CMIElement, value) { + if (!CMIElement || CMIElement === "") { + return api_constants/* default */.A.global.SCORM_FALSE; + } + var structure = CMIElement.split("."); + var refObject = this; + var returnValue = api_constants/* default */.A.global.SCORM_FALSE; + var foundFirstIndex = false; + var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element."); + var invalidErrorCode = scorm2004 + ? this._error_codes.UNDEFINED_DATA_MODEL + : this._error_codes.GENERAL; + for (var idx = 0; idx < structure.length; idx++) { + var attribute = structure[idx]; + if (idx === structure.length - 1) { + if (scorm2004 && attribute.substring(0, 8) === "{target=") { + if (this.isInitialized()) { + this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT); + } + else { + refObject = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, refObject), { attribute: value }); + } + } + else if (!this._checkObjectHasProperty(refObject, attribute)) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + } + else { + if ((0,utilities/* stringMatches */.J6)(CMIElement, "\\.correct_responses\\.\\d+") && + this.isInitialized()) { + this.validateCorrectResponse(CMIElement, value); + } + if (!scorm2004 || this.lastErrorCode === "0") { + refObject[attribute] = value; + returnValue = api_constants/* default */.A.global.SCORM_TRUE; + } + } + } + else { + refObject = refObject[attribute]; + if (!refObject) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + break; + } + if (refObject instanceof array/* CMIArray */.B) { + var index = parseInt(structure[idx + 1], 10); + if (!isNaN(index)) { + var item = refObject.childArray[index]; + if (item) { + refObject = item; + foundFirstIndex = true; + } + else { + var newChild = this.getChildElement(CMIElement, value, foundFirstIndex); + foundFirstIndex = true; + if (!newChild) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + } + else { + if (refObject.initialized) + newChild.initialize(); + refObject.childArray.push(newChild); + refObject = newChild; + } + } + idx++; + } + } + } + } + if (returnValue === api_constants/* default */.A.global.SCORM_FALSE) { + this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value), api_constants/* default */.A.global.LOG_LEVEL_WARNING); + } + return returnValue; + }; + BaseAPI.prototype._commonGetCMIValue = function (methodName, scorm2004, CMIElement) { + if (!CMIElement || CMIElement === "") { + return ""; + } + var structure = CMIElement.split("."); + var refObject = this; + var attribute = null; + var uninitializedErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") has not been initialized."); + var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element."); + var invalidErrorCode = scorm2004 + ? this._error_codes.UNDEFINED_DATA_MODEL + : this._error_codes.GENERAL; + for (var idx = 0; idx < structure.length; idx++) { + attribute = structure[idx]; + if (!scorm2004) { + if (idx === structure.length - 1) { + if (!this._checkObjectHasProperty(refObject, attribute)) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + return; + } + } + } + else { + if (String(attribute).substring(0, 8) === "{target=" && + typeof refObject._isTargetValid == "function") { + var target = String(attribute).substring(8, String(attribute).length - 9); + return refObject._isTargetValid(target); + } + else if (!this._checkObjectHasProperty(refObject, attribute)) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + return; + } + } + refObject = refObject[attribute]; + if (refObject === undefined) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + break; + } + if (refObject instanceof array/* CMIArray */.B) { + var index = parseInt(structure[idx + 1], 10); + if (!isNaN(index)) { + var item = refObject.childArray[index]; + if (item) { + refObject = item; + } + else { + this.throwSCORMError(this._error_codes.VALUE_NOT_INITIALIZED, uninitializedErrorMessage); + break; + } + idx++; + } + } + } + if (refObject === null || refObject === undefined) { + if (!scorm2004) { + if (attribute === "_children") { + this.throwSCORMError(error_codes/* default */.A.scorm12.CHILDREN_ERROR); + } + else if (attribute === "_count") { + this.throwSCORMError(error_codes/* default */.A.scorm12.COUNT_ERROR); + } + } + } + else { + return refObject; + } + }; + BaseAPI.prototype.isInitialized = function () { + return this.currentState === api_constants/* default */.A.global.STATE_INITIALIZED; + }; + BaseAPI.prototype.isNotInitialized = function () { + return this.currentState === api_constants/* default */.A.global.STATE_NOT_INITIALIZED; + }; + BaseAPI.prototype.isTerminated = function () { + return this.currentState === api_constants/* default */.A.global.STATE_TERMINATED; + }; + BaseAPI.prototype.on = function (listenerName, callback) { + if (!callback) + return; + var listenerFunctions = listenerName.split(" "); + for (var i = 0; i < listenerFunctions.length; i++) { + var listenerSplit = listenerFunctions[i].split("."); + if (listenerSplit.length === 0) + return; + var functionName = listenerSplit[0]; + var CMIElement = null; + if (listenerSplit.length > 1) { + CMIElement = listenerName.replace(functionName + ".", ""); + } + this.listenerArray.push({ + functionName: functionName, + CMIElement: CMIElement, + callback: callback, + }); + this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length), api_constants/* default */.A.global.LOG_LEVEL_INFO, functionName); + } + }; + BaseAPI.prototype.off = function (listenerName, callback) { + if (!callback) + return; + var listenerFunctions = listenerName.split(" "); + var _loop_1 = function (i) { + var listenerSplit = listenerFunctions[i].split("."); + if (listenerSplit.length === 0) + return { value: void 0 }; + var functionName = listenerSplit[0]; + var CMIElement = null; + if (listenerSplit.length > 1) { + CMIElement = listenerName.replace(functionName + ".", ""); + } + var removeIndex = this_1.listenerArray.findIndex(function (obj) { + return obj.functionName === functionName && + obj.CMIElement === CMIElement && + obj.callback === callback; + }); + if (removeIndex !== -1) { + this_1.listenerArray.splice(removeIndex, 1); + this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length), api_constants/* default */.A.global.LOG_LEVEL_INFO, functionName); + } + }; + var this_1 = this; + for (var i = 0; i < listenerFunctions.length; i++) { + var state_1 = _loop_1(i); + if (typeof state_1 === "object") + return state_1.value; + } + }; + BaseAPI.prototype.clear = function (listenerName) { + var listenerFunctions = listenerName.split(" "); + var _loop_2 = function (i) { + var listenerSplit = listenerFunctions[i].split("."); + if (listenerSplit.length === 0) + return { value: void 0 }; + var functionName = listenerSplit[0]; + var CMIElement = null; + if (listenerSplit.length > 1) { + CMIElement = listenerName.replace(functionName + ".", ""); + } + this_2.listenerArray = this_2.listenerArray.filter(function (obj) { + return obj.functionName !== functionName && obj.CMIElement !== CMIElement; + }); + }; + var this_2 = this; + for (var i = 0; i < listenerFunctions.length; i++) { + var state_2 = _loop_2(i); + if (typeof state_2 === "object") + return state_2.value; + } + }; + BaseAPI.prototype.processListeners = function (functionName, CMIElement, value) { + this.apiLog(functionName, value, api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); + for (var i = 0; i < this.listenerArray.length; i++) { + var listener = this.listenerArray[i]; + var functionsMatch = listener.functionName === functionName; + var listenerHasCMIElement = !!listener.CMIElement; + var CMIElementsMatch = false; + if (CMIElement && + listener.CMIElement && + listener.CMIElement.substring(listener.CMIElement.length - 1) === "*") { + CMIElementsMatch = + CMIElement.indexOf(listener.CMIElement.substring(0, listener.CMIElement.length - 1)) === 0; + } + else { + CMIElementsMatch = listener.CMIElement === CMIElement; + } + if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) { + this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName), api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); + listener.callback(CMIElement, value); + } + } + }; + BaseAPI.prototype.throwSCORMError = function (errorNumber, message) { + if (!message) { + message = this.getLmsErrorMessageDetails(errorNumber); + } + this.apiLog("throwSCORMError", errorNumber + ": " + message, api_constants/* default */.A.global.LOG_LEVEL_ERROR); + this.lastErrorCode = String(errorNumber); + }; + BaseAPI.prototype.clearSCORMError = function (success) { + if (success !== undefined && success !== api_constants/* default */.A.global.SCORM_FALSE) { + this.lastErrorCode = "0"; + } + }; + BaseAPI.prototype.loadFromFlattenedJSON = function (json, CMIElement) { + var _this = this; + if (!CMIElement) { + CMIElement = ""; + } + if (!this.isNotInitialized()) { + console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize."); + return; + } + function testPattern(a, c, a_pattern) { + var a_match = a.match(a_pattern); + var c_match; + if (a_match !== null && (c_match = c.match(a_pattern)) !== null) { + var a_num = Number(a_match[2]); + var c_num = Number(c_match[2]); + if (a_num === c_num) { + if (a_match[3] === "id") { + return -1; + } + else if (a_match[3] === "type") { + if (c_match[3] === "id") { + return 1; + } + else { + return -1; + } + } + else { + return 1; + } + } + return a_num - c_num; + } + return null; + } + var int_pattern = /^(cmi\.interactions\.)(\d+)\.(.*)$/; + var obj_pattern = /^(cmi\.objectives\.)(\d+)\.(.*)$/; + var result = Object.keys(json).map(function (key) { + return [String(key), json[key]]; + }); + result.sort(function (_a, _c) { + var a = _a[0], _b = _a[1]; + var c = _c[0], _d = _c[1]; + var test; + if ((test = testPattern(a, c, int_pattern)) !== null) { + return test; + } + if ((test = testPattern(a, c, obj_pattern)) !== null) { + return test; + } + if (a < c) { + return -1; + } + if (a > c) { + return 1; + } + return 0; + }); + var obj; + result.forEach(function (element) { + obj = {}; + obj[element[0]] = element[1]; + _this.loadFromJSON((0,utilities/* unflatten */.sB)(obj), CMIElement); + }); + }; + BaseAPI.prototype.loadFromJSON = function (json, CMIElement) { + if (!this.isNotInitialized()) { + console.error("loadFromJSON can only be called before the call to lmsInitialize."); + return; + } + CMIElement = CMIElement !== undefined ? CMIElement : "cmi"; + this.startingData = json; + for (var key in json) { + if ({}.hasOwnProperty.call(json, key) && json[key]) { + var currentCMIElement = (CMIElement ? CMIElement + "." : "") + key; + var value = json[key]; + if (value["childArray"]) { + for (var i = 0; i < value["childArray"].length; i++) { + this.loadFromJSON(value["childArray"][i], currentCMIElement + "." + i); + } + } + else if (value.constructor === Object) { + this.loadFromJSON(value, currentCMIElement); + } + else { + this.setCMIValue(currentCMIElement, value); + } + } + } + }; + BaseAPI.prototype.renderCMIToJSONString = function () { + var cmi = this.cmi; + if (this.settings.sendFullCommit) { + return JSON.stringify({ cmi: cmi }); + } + return JSON.stringify({ cmi: cmi }, function (k, v) { return (v === undefined ? null : v); }, 2); + }; + BaseAPI.prototype.renderCMIToJSONObject = function () { + return JSON.parse(this.renderCMIToJSONString()); + }; + BaseAPI.prototype.processHttpRequest = function (url_1, params_1) { + return (0,tslib_es6/* __awaiter */.sH)(this, arguments, void 0, function (url, params, immediate) { + var api, genericError, process, debouncedProcess; + var _this = this; + if (immediate === void 0) { immediate = false; } + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: + api = this; + genericError = { + result: api_constants/* default */.A.global.SCORM_FALSE, + errorCode: this.error_codes.GENERAL, + }; + if (immediate) { + this.performFetch(url, params).then(function (response) { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this.transformResponse(response)]; + case 1: + _a.sent(); + return [2]; + } + }); + }); }); + return [2, { + result: api_constants/* default */.A.global.SCORM_TRUE, + errorCode: 0, + }]; + } + process = function (url, params, settings) { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { + var response, e_1; + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + params = settings.requestHandler(params); + return [4, this.performFetch(url, params)]; + case 1: + response = _a.sent(); + return [2, this.transformResponse(response)]; + case 2: + e_1 = _a.sent(); + this.apiLog("processHttpRequest", e_1, api_constants/* default */.A.global.LOG_LEVEL_ERROR); + api.processListeners("CommitError"); + return [2, genericError]; + case 3: return [2]; + } + }); + }); }; + if (!this.settings.asyncCommit) return [3, 1]; + debouncedProcess = debounce(process, 500, immediate); + debouncedProcess(url, params, this.settings); + return [2, { + result: api_constants/* default */.A.global.SCORM_TRUE, + errorCode: 0, + }]; + case 1: return [4, process(url, params, this.settings)]; + case 2: return [2, _a.sent()]; + } + }); + }); + }; + BaseAPI.prototype.scheduleCommit = function (when, callback) { + this._timeout = new ScheduledCommit(this, when, callback); + this.apiLog("scheduleCommit", "scheduled", api_constants/* default */.A.global.LOG_LEVEL_DEBUG, ""); + }; + BaseAPI.prototype.clearScheduledCommit = function () { + if (this._timeout) { + this._timeout.cancel(); + this._timeout = undefined; + this.apiLog("clearScheduledCommit", "cleared", api_constants/* default */.A.global.LOG_LEVEL_DEBUG, ""); + } + }; + BaseAPI.prototype._checkObjectHasProperty = function (refObject, attribute) { + return (Object.hasOwnProperty.call(refObject, attribute) || + Object.getOwnPropertyDescriptor(Object.getPrototypeOf(refObject), attribute) != null || + attribute in refObject); + }; + BaseAPI.prototype.handleValueAccessException = function (e, returnValue) { + if (e instanceof exceptions/* ValidationError */.yI) { + this.lastErrorCode = String(e.errorCode); + returnValue = api_constants/* default */.A.global.SCORM_FALSE; + } + else { + if (e instanceof Error && e.message) { + console.error(e.message); + } + else { + console.error(e); + } + this.throwSCORMError(this._error_codes.GENERAL); + } + return returnValue; + }; + BaseAPI.prototype.performFetch = function (url, params) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + return [2, fetch(url, { + method: "POST", + body: params instanceof Array ? params.join("&") : JSON.stringify(params), + headers: (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, this.settings.xhrHeaders), { "Content-Type": this.settings.commitRequestDataType }), + credentials: this.settings.xhrWithCredentials ? "include" : undefined, + keepalive: true, + })]; + }); + }); + }; + BaseAPI.prototype.transformResponse = function (response) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + var result, _a; + return (0,tslib_es6/* __generator */.YH)(this, function (_c) { + switch (_c.label) { + case 0: + if (!(typeof this.settings.responseHandler === "function")) return [3, 2]; + return [4, this.settings.responseHandler(response)]; + case 1: + _a = _c.sent(); + return [3, 4]; + case 2: return [4, response.json()]; + case 3: + _a = _c.sent(); + _c.label = 4; + case 4: + result = _a; + if (response.status >= 200 && + response.status <= 299 && + (result.result === true || + result.result === api_constants/* default */.A.global.SCORM_TRUE)) { + this.processListeners("CommitSuccess"); + } + else { + this.processListeners("CommitError"); + } + return [2, result]; + } + }); + }); + }; + return BaseAPI; +}()); +/* harmony default export */ var src_BaseAPI = (BaseAPI); + + +/***/ }), + +/***/ 589: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ B: function() { return /* binding */ CMIArray; } +/* harmony export */ }); +/* unused harmony export scorm12_error_codes */ +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635); +/* harmony import */ var _base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(797); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(784); + + + + +var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12; +var CMIArray = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__extends */ .C6)(CMIArray, _super); + function CMIArray(params) { + var _this = _super.call(this) || this; + _this.__children = params.children; + _this._errorCode = params.errorCode || scorm12_error_codes.GENERAL; + _this._errorClass = params.errorClass || _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .BaseScormValidationError */ .$h; + _this.childArray = []; + return _this; + } + Object.defineProperty(CMIArray.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new this._errorClass(this._errorCode); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIArray.prototype, "_count", { + get: function () { + return this.childArray.length; + }, + set: function (_count) { + throw new this._errorClass(this._errorCode); + }, + enumerable: false, + configurable: true + }); + CMIArray.prototype.toJSON = function () { + this.jsonString = true; + var result = {}; + for (var i = 0; i < this.childArray.length; i++) { + result[i + ""] = this.childArray[i]; + } + delete this.jsonString; + return result; + }; + return CMIArray; +}(_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 319: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ J: function() { return /* binding */ BaseCMI; }, +/* harmony export */ r: function() { return /* binding */ BaseRootCMI; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); + +var BaseCMI = (function () { + function BaseCMI() { + this.jsonString = false; + this._initialized = false; + } + Object.defineProperty(BaseCMI.prototype, "initialized", { + get: function () { + return this._initialized; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BaseCMI.prototype, "start_time", { + get: function () { + return this._start_time; + }, + enumerable: false, + configurable: true + }); + BaseCMI.prototype.initialize = function () { + this._initialized = true; + }; + BaseCMI.prototype.setStartTime = function () { + this._start_time = new Date().getTime(); + }; + return BaseCMI; +}()); + +var BaseRootCMI = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__extends */ .C6)(BaseRootCMI, _super); + function BaseRootCMI() { + return _super !== null && _super.apply(this, arguments) || this; + } + return BaseRootCMI; +}(BaseCMI)); + + + +/***/ }), + +/***/ 434: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ _: function() { return /* binding */ CMIScore; } +/* harmony export */ }); +/* unused harmony export scorm12_error_codes */ +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(417); +/* harmony import */ var _base_cmi__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(319); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(449); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797); + + + + + + +var scorm12_constants = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12; +var scorm12_regex = _constants_regex__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12; +var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12; +var CMIScore = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__extends */ .C6)(CMIScore, _super); + function CMIScore(params) { + var _this = _super.call(this) || this; + _this._raw = ""; + _this._min = ""; + _this.__children = params.score_children || scorm12_constants.score_children; + _this.__score_range = !params.score_range + ? false + : scorm12_regex.score_range; + _this._max = params.max || params.max === "" ? params.max : "100"; + _this.__invalid_error_code = + params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE; + _this.__invalid_type_code = + params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH; + _this.__invalid_range_code = + params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE; + _this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal; + _this.__error_class = params.errorClass; + return _this; + } + Object.defineProperty(CMIScore.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new this.__error_class(this.__invalid_error_code); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIScore.prototype, "raw", { + get: function () { + return this._raw; + }, + set: function (raw) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidFormat */ .q)(raw, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && + (!this.__score_range || + (0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidRange */ .W)(raw, this.__score_range, this.__invalid_range_code, this.__error_class))) { + this._raw = raw; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIScore.prototype, "min", { + get: function () { + return this._min; + }, + set: function (min) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidFormat */ .q)(min, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && + (!this.__score_range || + (0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidRange */ .W)(min, this.__score_range, this.__invalid_range_code, this.__error_class))) { + this._min = min; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIScore.prototype, "max", { + get: function () { + return this._max; + }, + set: function (max) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidFormat */ .q)(max, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && + (!this.__score_range || + (0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidRange */ .W)(max, this.__score_range, this.__invalid_range_code, this.__error_class))) { + this._max = max; + } + }, + enumerable: false, + configurable: true + }); + CMIScore.prototype.toJSON = function () { + this.jsonString = true; + var result = { + raw: this.raw, + min: this.min, + max: this.max, + }; + delete this.jsonString; + return result; + }; + return CMIScore; +}(_base_cmi__WEBPACK_IMPORTED_MODULE_2__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 449: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ W: function() { return /* binding */ checkValidRange; }, +/* harmony export */ q: function() { return /* binding */ checkValidFormat; } +/* harmony export */ }); +function checkValidFormat(value, regexPattern, errorCode, errorClass, allowEmptyString) { + if (typeof value !== "string") { + return false; + } + var formatRegex = new RegExp(regexPattern); + var matches = value.match(formatRegex); + if (allowEmptyString && value === "") { + return true; + } + if (value === undefined || !matches || matches[0] === "") { + throw new errorClass(errorCode); + } + return true; +} +function checkValidRange(value, rangePattern, errorCode, errorClass) { + var ranges = rangePattern.split("#"); + value = value * 1.0; + if (value >= ranges[0]) { + if (ranges[1] === "*" || value <= ranges[1]) { + return true; + } + else { + throw new errorClass(errorCode); + } + } + else { + throw new errorClass(errorCode); + } +} + + +/***/ }), + +/***/ 989: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + Y: function() { return /* binding */ CMI; } +}); + +// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs +var tslib_es6 = __webpack_require__(635); +// EXTERNAL MODULE: ./src/constants/api_constants.ts +var api_constants = __webpack_require__(340); +// EXTERNAL MODULE: ./src/constants/error_codes.ts +var error_codes = __webpack_require__(797); +// EXTERNAL MODULE: ./src/constants/regex.ts +var regex = __webpack_require__(417); +// EXTERNAL MODULE: ./src/exceptions.ts +var exceptions = __webpack_require__(784); +// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts +var base_cmi = __webpack_require__(319); +// EXTERNAL MODULE: ./src/cmi/scorm12/validation.ts +var validation = __webpack_require__(915); +// EXTERNAL MODULE: ./src/cmi/common/score.ts +var score = __webpack_require__(434); +// EXTERNAL MODULE: ./src/utilities.ts +var utilities = __webpack_require__(864); +;// ./src/cmi/aicc/core.ts + + + + + + + + + +var CMICore = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMICore, _super); + function CMICore() { + var _this = _super.call(this) || this; + _this.__children = api_constants/* default */.A.scorm12.core_children; + _this._student_id = ""; + _this._student_name = ""; + _this._lesson_location = ""; + _this._credit = ""; + _this._lesson_status = "not attempted"; + _this._entry = ""; + _this._total_time = ""; + _this._lesson_mode = "normal"; + _this._exit = ""; + _this._session_time = "00:00:00"; + _this._suspend_data = ""; + _this.score = new score/* CMIScore */._({ + score_children: api_constants/* default */.A.scorm12.score_children, + score_range: regex/* default */.A.scorm12.score_range, + invalidErrorCode: error_codes/* default */.A.scorm12.INVALID_SET_VALUE, + invalidTypeCode: error_codes/* default */.A.scorm12.TYPE_MISMATCH, + invalidRangeCode: error_codes/* default */.A.scorm12.VALUE_OUT_OF_RANGE, + errorClass: exceptions/* Scorm12ValidationError */.tQ, + }); + return _this; + } + CMICore.prototype.initialize = function () { + var _a; + _super.prototype.initialize.call(this); + (_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize(); + }; + Object.defineProperty(CMICore.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.INVALID_SET_VALUE); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "student_id", { + get: function () { + return this._student_id; + }, + set: function (student_id) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._student_id = student_id; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "student_name", { + get: function () { + return this._student_name; + }, + set: function (student_name) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._student_name = student_name; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "lesson_location", { + get: function () { + return this._lesson_location; + }, + set: function (lesson_location) { + if ((0,validation/* check12ValidFormat */.p)(lesson_location, regex/* default */.A.scorm12.CMIString256, true)) { + this._lesson_location = lesson_location; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "credit", { + get: function () { + return this._credit; + }, + set: function (credit) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._credit = credit; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "lesson_status", { + get: function () { + return this._lesson_status; + }, + set: function (lesson_status) { + if (this.initialized) { + if ((0,validation/* check12ValidFormat */.p)(lesson_status, regex/* default */.A.scorm12.CMIStatus)) { + this._lesson_status = lesson_status; + } + } + else { + if ((0,validation/* check12ValidFormat */.p)(lesson_status, regex/* default */.A.scorm12.CMIStatus2)) { + this._lesson_status = lesson_status; + } + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "entry", { + get: function () { + return this._entry; + }, + set: function (entry) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._entry = entry; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "total_time", { + get: function () { + return this._total_time; + }, + set: function (total_time) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._total_time = total_time; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "lesson_mode", { + get: function () { + return this._lesson_mode; + }, + set: function (lesson_mode) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._lesson_mode = lesson_mode; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "exit", { + get: function () { + if (!this.jsonString) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._exit; + }, + set: function (exit) { + if ((0,validation/* check12ValidFormat */.p)(exit, regex/* default */.A.scorm12.CMIExit, true)) { + this._exit = exit; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "session_time", { + get: function () { + if (!this.jsonString) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._session_time; + }, + set: function (session_time) { + if ((0,validation/* check12ValidFormat */.p)(session_time, regex/* default */.A.scorm12.CMITimespan)) { + this._session_time = session_time; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "suspend_data", { + get: function () { + return this._suspend_data; + }, + set: function (suspend_data) { + if ((0,validation/* check12ValidFormat */.p)(suspend_data, regex/* default */.A.scorm12.CMIString4096, true)) { + this._suspend_data = suspend_data; + } + }, + enumerable: false, + configurable: true + }); + CMICore.prototype.getCurrentTotalTime = function (start_time) { + var sessionTime = this._session_time; + var startTime = start_time; + if (typeof startTime !== "undefined" && startTime !== null) { + var seconds = new Date().getTime() - startTime; + sessionTime = utilities/* getSecondsAsHHMMSS */.UZ(seconds / 1000); + } + return utilities/* addHHMMSSTimeStrings */.HT(this._total_time, sessionTime, new RegExp(regex/* default */.A.scorm12.CMITimespan)); + }; + CMICore.prototype.toJSON = function () { + this.jsonString = true; + var result = { + student_id: this.student_id, + student_name: this.student_name, + lesson_location: this.lesson_location, + credit: this.credit, + lesson_status: this.lesson_status, + entry: this.entry, + lesson_mode: this.lesson_mode, + exit: this.exit, + session_time: this.session_time, + score: this.score, + }; + delete this.jsonString; + return result; + }; + return CMICore; +}(base_cmi/* BaseCMI */.J)); + + +// EXTERNAL MODULE: ./src/cmi/scorm12/objectives.ts +var objectives = __webpack_require__(176); +// EXTERNAL MODULE: ./src/cmi/scorm12/student_data.ts +var scorm12_student_data = __webpack_require__(532); +// EXTERNAL MODULE: ./src/cmi/scorm12/student_preference.ts +var student_preference = __webpack_require__(181); +// EXTERNAL MODULE: ./src/cmi/scorm12/interactions.ts +var interactions = __webpack_require__(833); +;// ./src/cmi/scorm12/cmi.ts + + + + + + + + + + + + +var CMI = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMI, _super); + function CMI(cmi_children, student_data, initialized) { + var _this = _super.call(this) || this; + _this.__children = ""; + _this.__version = "3.4"; + _this._launch_data = ""; + _this._comments = ""; + _this._comments_from_lms = ""; + if (initialized) + _this.initialize(); + _this.__children = cmi_children + ? cmi_children + : api_constants/* default */.A.scorm12.cmi_children; + _this.core = new CMICore(); + _this.objectives = new objectives/* CMIObjectives */.C(); + _this.student_data = student_data ? student_data : new scorm12_student_data/* CMIStudentData */.X(); + _this.student_preference = new student_preference/* CMIStudentPreference */.G(); + _this.interactions = new interactions/* CMIInteractions */.Xb(); + return _this; + } + CMI.prototype.initialize = function () { + var _a, _b, _c, _d, _e; + _super.prototype.initialize.call(this); + (_a = this.core) === null || _a === void 0 ? void 0 : _a.initialize(); + (_b = this.objectives) === null || _b === void 0 ? void 0 : _b.initialize(); + (_c = this.student_data) === null || _c === void 0 ? void 0 : _c.initialize(); + (_d = this.student_preference) === null || _d === void 0 ? void 0 : _d.initialize(); + (_e = this.interactions) === null || _e === void 0 ? void 0 : _e.initialize(); + }; + CMI.prototype.toJSON = function () { + this.jsonString = true; + var result = { + suspend_data: this.suspend_data, + launch_data: this.launch_data, + comments: this.comments, + comments_from_lms: this.comments_from_lms, + core: this.core, + objectives: this.objectives, + student_data: this.student_data, + student_preference: this.student_preference, + interactions: this.interactions, + }; + delete this.jsonString; + return result; + }; + Object.defineProperty(CMI.prototype, "_version", { + get: function () { + return this.__version; + }, + set: function (_version) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.INVALID_SET_VALUE); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.INVALID_SET_VALUE); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "suspend_data", { + get: function () { + var _a; + return (_a = this.core) === null || _a === void 0 ? void 0 : _a.suspend_data; + }, + set: function (suspend_data) { + if (this.core) { + this.core.suspend_data = suspend_data; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "launch_data", { + get: function () { + return this._launch_data; + }, + set: function (launch_data) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._launch_data = launch_data; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "comments", { + get: function () { + return this._comments; + }, + set: function (comments) { + if ((0,validation/* check12ValidFormat */.p)(comments, regex/* default */.A.scorm12.CMIString4096, true)) { + this._comments = comments; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "comments_from_lms", { + get: function () { + return this._comments_from_lms; + }, + set: function (comments_from_lms) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._comments_from_lms = comments_from_lms; + } + }, + enumerable: false, + configurable: true + }); + CMI.prototype.getCurrentTotalTime = function () { + return this.core.getCurrentTotalTime(this.start_time); + }; + return CMI; +}(base_cmi/* BaseRootCMI */.r)); + + + +/***/ }), + +/***/ 833: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Oh: function() { return /* binding */ CMIInteractionsObjectivesObject; }, +/* harmony export */ WP: function() { return /* binding */ CMIInteractionsObject; }, +/* harmony export */ Xb: function() { return /* binding */ CMIInteractions; }, +/* harmony export */ cb: function() { return /* binding */ CMIInteractionsCorrectResponsesObject; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(635); +/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(589); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(797); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(784); +/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(319); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(915); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(417); + + + + + + + + +var CMIInteractions = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(CMIInteractions, _super); + function CMIInteractions() { + return _super.call(this, { + children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.interactions_children, + errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE, + errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ, + }) || this; + } + return CMIInteractions; +}(_common_array__WEBPACK_IMPORTED_MODULE_0__/* .CMIArray */ .B)); + +var CMIInteractionsObject = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(CMIInteractionsObject, _super); + function CMIInteractionsObject() { + var _this = _super.call(this) || this; + _this._id = ""; + _this._time = ""; + _this._type = ""; + _this._weighting = ""; + _this._student_response = ""; + _this._result = ""; + _this._latency = ""; + _this.objectives = new _common_array__WEBPACK_IMPORTED_MODULE_0__/* .CMIArray */ .B({ + errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE, + errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ, + children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.objectives_children, + }); + _this.correct_responses = new _common_array__WEBPACK_IMPORTED_MODULE_0__/* .CMIArray */ .B({ + errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE, + errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ, + children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.correct_responses_children, + }); + return _this; + } + CMIInteractionsObject.prototype.initialize = function () { + var _a, _b; + _super.prototype.initialize.call(this); + (_a = this.objectives) === null || _a === void 0 ? void 0 : _a.initialize(); + (_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.initialize(); + }; + Object.defineProperty(CMIInteractionsObject.prototype, "id", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._id; + }, + set: function (id) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIIdentifier)) { + this._id = id; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "time", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._time; + }, + set: function (time) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(time, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMITime)) { + this._time = time; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "type", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._type; + }, + set: function (type) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(type, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIType)) { + this._type = type; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "weighting", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._weighting; + }, + set: function (weighting) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(weighting, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIDecimal) && + (0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidRange */ .h)(weighting, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.weighting_range)) { + this._weighting = weighting; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "student_response", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._student_response; + }, + set: function (student_response) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(student_response, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIFeedback, true)) { + this._student_response = student_response; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "result", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._result; + }, + set: function (result) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(result, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIResult)) { + this._result = result; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "latency", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._latency; + }, + set: function (latency) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(latency, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMITimespan)) { + this._latency = latency; + } + }, + enumerable: false, + configurable: true + }); + CMIInteractionsObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + id: this.id, + time: this.time, + type: this.type, + weighting: this.weighting, + student_response: this.student_response, + result: this.result, + latency: this.latency, + objectives: this.objectives, + correct_responses: this.correct_responses, + }; + delete this.jsonString; + return result; + }; + return CMIInteractionsObject; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__/* .BaseCMI */ .J)); + +var CMIInteractionsObjectivesObject = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(CMIInteractionsObjectivesObject, _super); + function CMIInteractionsObjectivesObject() { + var _this = _super.call(this) || this; + _this._id = ""; + return _this; + } + Object.defineProperty(CMIInteractionsObjectivesObject.prototype, "id", { + get: function () { + return this._id; + }, + set: function (id) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIIdentifier)) { + this._id = id; + } + }, + enumerable: false, + configurable: true + }); + CMIInteractionsObjectivesObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + id: this.id, + }; + delete this.jsonString; + return result; + }; + return CMIInteractionsObjectivesObject; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__/* .BaseCMI */ .J)); + +var CMIInteractionsCorrectResponsesObject = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(CMIInteractionsCorrectResponsesObject, _super); + function CMIInteractionsCorrectResponsesObject() { + var _this = _super.call(this) || this; + _this._pattern = ""; + return _this; + } + Object.defineProperty(CMIInteractionsCorrectResponsesObject.prototype, "pattern", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._pattern; + }, + set: function (pattern) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(pattern, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIFeedback, true)) { + this._pattern = pattern; + } + }, + enumerable: false, + configurable: true + }); + CMIInteractionsCorrectResponsesObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + pattern: this._pattern, + }; + delete this.jsonString; + return result; + }; + return CMIInteractionsCorrectResponsesObject; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 331: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ A: function() { return /* binding */ NAV; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635); +/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(915); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(417); + + + + +var NAV = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__extends */ .C6)(NAV, _super); + function NAV() { + var _this = _super.call(this) || this; + _this._event = ""; + return _this; + } + Object.defineProperty(NAV.prototype, "event", { + get: function () { + return this._event; + }, + set: function (event) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_1__/* .check12ValidFormat */ .p)(event, _constants_regex__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.NAVEvent)) { + this._event = event; + } + }, + enumerable: false, + configurable: true + }); + NAV.prototype.toJSON = function () { + this.jsonString = true; + var result = { + event: this.event, + }; + delete this.jsonString; + return result; + }; + return NAV; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 176: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ C: function() { return /* binding */ CMIObjectives; }, +/* harmony export */ N: function() { return /* binding */ CMIObjectivesObject; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(635); +/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _common_score__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(434); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(340); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(417); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(797); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(784); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(915); +/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(589); + + + + + + + + + +var CMIObjectives = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__extends */ .C6)(CMIObjectives, _super); + function CMIObjectives() { + return _super.call(this, { + children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.objectives_children, + errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE, + errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_5__/* .Scorm12ValidationError */ .tQ, + }) || this; + } + return CMIObjectives; +}(_common_array__WEBPACK_IMPORTED_MODULE_7__/* .CMIArray */ .B)); + +var CMIObjectivesObject = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__extends */ .C6)(CMIObjectivesObject, _super); + function CMIObjectivesObject() { + var _this = _super.call(this) || this; + _this._id = ""; + _this._status = ""; + _this.score = new _common_score__WEBPACK_IMPORTED_MODULE_1__/* .CMIScore */ ._({ + score_children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.score_children, + score_range: _constants_regex__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.score_range, + invalidErrorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE, + invalidTypeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.scorm12.TYPE_MISMATCH, + invalidRangeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.scorm12.VALUE_OUT_OF_RANGE, + errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_5__/* .Scorm12ValidationError */ .tQ, + }); + return _this; + } + Object.defineProperty(CMIObjectivesObject.prototype, "id", { + get: function () { + return this._id; + }, + set: function (id) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__/* .check12ValidFormat */ .p)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.CMIIdentifier)) { + this._id = id; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIObjectivesObject.prototype, "status", { + get: function () { + return this._status; + }, + set: function (status) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__/* .check12ValidFormat */ .p)(status, _constants_regex__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.CMIStatus2)) { + this._status = status; + } + }, + enumerable: false, + configurable: true + }); + CMIObjectivesObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + id: this.id, + status: this.status, + score: this.score, + }; + delete this.jsonString; + return result; + }; + return CMIObjectivesObject; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 532: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ X: function() { return /* binding */ CMIStudentData; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635); +/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(784); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797); + + + + + +var CMIStudentData = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__extends */ .C6)(CMIStudentData, _super); + function CMIStudentData(student_data_children) { + var _this = _super.call(this) || this; + _this._mastery_score = ""; + _this._max_time_allowed = ""; + _this._time_limit_action = ""; + _this.__children = student_data_children + ? student_data_children + : _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.student_data_children; + return _this; + } + Object.defineProperty(CMIStudentData.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentData.prototype, "mastery_score", { + get: function () { + return this._mastery_score; + }, + set: function (mastery_score) { + if (this.initialized) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._mastery_score = mastery_score; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentData.prototype, "max_time_allowed", { + get: function () { + return this._max_time_allowed; + }, + set: function (max_time_allowed) { + if (this.initialized) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._max_time_allowed = max_time_allowed; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentData.prototype, "time_limit_action", { + get: function () { + return this._time_limit_action; + }, + set: function (time_limit_action) { + if (this.initialized) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._time_limit_action = time_limit_action; + } + }, + enumerable: false, + configurable: true + }); + CMIStudentData.prototype.toJSON = function () { + this.jsonString = true; + var result = { + mastery_score: this.mastery_score, + max_time_allowed: this.max_time_allowed, + time_limit_action: this.time_limit_action, + }; + delete this.jsonString; + return result; + }; + return CMIStudentData; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 181: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ G: function() { return /* binding */ CMIStudentPreference; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(635); +/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(784); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(915); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(417); + + + + + + + +var CMIStudentPreference = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__extends */ .C6)(CMIStudentPreference, _super); + function CMIStudentPreference(student_preference_children) { + var _this = _super.call(this) || this; + _this._audio = ""; + _this._language = ""; + _this._speed = ""; + _this._text = ""; + _this.__children = student_preference_children + ? student_preference_children + : _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.student_preference_children; + return _this; + } + Object.defineProperty(CMIStudentPreference.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentPreference.prototype, "audio", { + get: function () { + return this._audio; + }, + set: function (audio) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidFormat */ .p)(audio, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.CMISInteger) && + (0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidRange */ .h)(audio, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.audio_range)) { + this._audio = audio; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentPreference.prototype, "language", { + get: function () { + return this._language; + }, + set: function (language) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidFormat */ .p)(language, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.CMIString256)) { + this._language = language; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentPreference.prototype, "speed", { + get: function () { + return this._speed; + }, + set: function (speed) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidFormat */ .p)(speed, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.CMISInteger) && + (0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidRange */ .h)(speed, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.speed_range)) { + this._speed = speed; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentPreference.prototype, "text", { + get: function () { + return this._text; + }, + set: function (text) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidFormat */ .p)(text, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.CMISInteger) && + (0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidRange */ .h)(text, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.text_range)) { + this._text = text; + } + }, + enumerable: false, + configurable: true + }); + CMIStudentPreference.prototype.toJSON = function () { + this.jsonString = true; + var result = { + audio: this.audio, + language: this.language, + speed: this.speed, + text: this.text, + }; + delete this.jsonString; + return result; + }; + return CMIStudentPreference; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 915: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ h: function() { return /* binding */ check12ValidRange; }, +/* harmony export */ p: function() { return /* binding */ check12ValidFormat; } +/* harmony export */ }); +/* harmony import */ var _common_validation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(449); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(797); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(784); + + + +function check12ValidFormat(value, regexPattern, allowEmptyString) { + return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__/* .checkValidFormat */ .q)(value, regexPattern, _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.TYPE_MISMATCH, _exceptions__WEBPACK_IMPORTED_MODULE_1__/* .Scorm12ValidationError */ .tQ, allowEmptyString); +} +function check12ValidRange(value, rangePattern, allowEmptyString) { + if (!allowEmptyString && value === "") { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_1__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.VALUE_OUT_OF_RANGE); + } + return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__/* .checkValidRange */ .W)(value, rangePattern, _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.VALUE_OUT_OF_RANGE, _exceptions__WEBPACK_IMPORTED_MODULE_1__/* .Scorm12ValidationError */ .tQ); +} + + +/***/ }), + +/***/ 340: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); + +var global = { + SCORM_TRUE: "true", + SCORM_FALSE: "false", + STATE_NOT_INITIALIZED: 0, + STATE_INITIALIZED: 1, + STATE_TERMINATED: 2, + LOG_LEVEL_DEBUG: 1, + LOG_LEVEL_INFO: 2, + LOG_LEVEL_WARNING: 3, + LOG_LEVEL_ERROR: 4, + LOG_LEVEL_NONE: 5, +}; +var scorm12 = { + cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions", + core_children: "student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time", + score_children: "raw,min,max", + comments_children: "content,location,time", + objectives_children: "id,score,status", + correct_responses_children: "pattern", + student_data_children: "mastery_score,max_time_allowed,time_limit_action", + student_preference_children: "audio,language,speed,text", + interactions_children: "id,objectives,time,type,correct_responses,weighting,student_response,result,latency", + error_descriptions: { + "101": { + basicMessage: "General Exception", + detailMessage: "No specific error code exists to describe the error. Use LMSGetDiagnostic for more information", + }, + "201": { + basicMessage: "Invalid argument error", + detailMessage: "Indicates that an argument represents an invalid data model element or is otherwise incorrect.", + }, + "202": { + basicMessage: "Element cannot have children", + detailMessage: 'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.', + }, + "203": { + basicMessage: "Element not an array - cannot have count", + detailMessage: 'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.', + }, + "301": { + basicMessage: "Not initialized", + detailMessage: "Indicates that an API call was made before the call to lmsInitialize.", + }, + "401": { + basicMessage: "Not implemented error", + detailMessage: "The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.", + }, + "402": { + basicMessage: "Invalid set value, element is a keyword", + detailMessage: 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").', + }, + "403": { + basicMessage: "Element is read only", + detailMessage: "LMSSetValue was called with a data model element that can only be read.", + }, + "404": { + basicMessage: "Element is write only", + detailMessage: "LMSGetValue was called on a data model element that can only be written to.", + }, + "405": { + basicMessage: "Incorrect Data Type", + detailMessage: "LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.", + }, + "407": { + basicMessage: "Element Value Out Of Range", + detailMessage: "The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.", + }, + "408": { + basicMessage: "Data Model Dependency Not Established", + detailMessage: "Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.", + }, + }, +}; +var aicc = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, scorm12), { + cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation", + student_preference_children: "audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows", + student_data_children: "attempt_number,tries,mastery_score,max_time_allowed,time_limit_action", + student_demographics_children: "city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience", + tries_children: "time,status,score", + attempt_records_children: "score,lesson_status", + paths_children: "location_id,date,time,status,why_left,time_in_element", +}); +var scorm2004 = { + cmi_children: "_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time", + comments_children: "comment,timestamp,location", + score_children: "max,raw,scaled,min", + objectives_children: "progress_measure,completion_status,success_status,description,score,id", + correct_responses_children: "pattern", + student_data_children: "mastery_score,max_time_allowed,time_limit_action", + student_preference_children: "audio_level,audio_captioning,delivery_speed,language", + interactions_children: "id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description", + error_descriptions: { + "0": { + basicMessage: "No Error", + detailMessage: "No error occurred, the previous API call was successful.", + }, + "101": { + basicMessage: "General Exception", + detailMessage: "No specific error code exists to describe the error. Use GetDiagnostic for more information.", + }, + "102": { + basicMessage: "General Initialization Failure", + detailMessage: "Call to Initialize failed for an unknown reason.", + }, + "103": { + basicMessage: "Already Initialized", + detailMessage: "Call to Initialize failed because Initialize was already called.", + }, + "104": { + basicMessage: "Content Instance Terminated", + detailMessage: "Call to Initialize failed because Terminate was already called.", + }, + "111": { + basicMessage: "General Termination Failure", + detailMessage: "Call to Terminate failed for an unknown reason.", + }, + "112": { + basicMessage: "Termination Before Initialization", + detailMessage: "Call to Terminate failed because it was made before the call to Initialize.", + }, + "113": { + basicMessage: "Termination After Termination", + detailMessage: "Call to Terminate failed because Terminate was already called.", + }, + "122": { + basicMessage: "Retrieve Data Before Initialization", + detailMessage: "Call to GetValue failed because it was made before the call to Initialize.", + }, + "123": { + basicMessage: "Retrieve Data After Termination", + detailMessage: "Call to GetValue failed because it was made after the call to Terminate.", + }, + "132": { + basicMessage: "Store Data Before Initialization", + detailMessage: "Call to SetValue failed because it was made before the call to Initialize.", + }, + "133": { + basicMessage: "Store Data After Termination", + detailMessage: "Call to SetValue failed because it was made after the call to Terminate.", + }, + "142": { + basicMessage: "Commit Before Initialization", + detailMessage: "Call to Commit failed because it was made before the call to Initialize.", + }, + "143": { + basicMessage: "Commit After Termination", + detailMessage: "Call to Commit failed because it was made after the call to Terminate.", + }, + "201": { + basicMessage: "General Argument Error", + detailMessage: "An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.", + }, + "301": { + basicMessage: "General Get Failure", + detailMessage: "Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.", + }, + "351": { + basicMessage: "General Set Failure", + detailMessage: "Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.", + }, + "391": { + basicMessage: "General Commit Failure", + detailMessage: "Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.", + }, + "401": { + basicMessage: "Undefined Data Model Element", + detailMessage: "The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.", + }, + "402": { + basicMessage: "Unimplemented Data Model Element", + detailMessage: "The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.", + }, + "403": { + basicMessage: "Data Model Element Value Not Initialized", + detailMessage: "Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.", + }, + "404": { + basicMessage: "Data Model Element Is Read Only", + detailMessage: "SetValue was called with a data model element that can only be read.", + }, + "405": { + basicMessage: "Data Model Element Is Write Only", + detailMessage: "GetValue was called on a data model element that can only be written to.", + }, + "406": { + basicMessage: "Data Model Element Type Mismatch", + detailMessage: "SetValue was called with a value that is not consistent with the data format of the supplied data model element.", + }, + "407": { + basicMessage: "Data Model Element Value Out Of Range", + detailMessage: "The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.", + }, + "408": { + basicMessage: "Data Model Dependency Not Established", + detailMessage: "Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.", + }, + }, +}; +var APIConstants = { + global: global, + scorm12: scorm12, + aicc: aicc, + scorm2004: scorm2004, +}; +/* harmony default export */ __webpack_exports__.A = (APIConstants); + + +/***/ }), + +/***/ 56: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ YE: function() { return /* binding */ SuccessStatus; }, +/* harmony export */ lC: function() { return /* binding */ CompletionStatus; } +/* harmony export */ }); +/* unused harmony export NAVBoolean */ +var NAVBoolean; +(function (NAVBoolean) { + NAVBoolean["unknown"] = "unknown"; + NAVBoolean["true"] = "true"; + NAVBoolean["false"] = "false"; +})(NAVBoolean || (NAVBoolean = {})); +var SuccessStatus; +(function (SuccessStatus) { + SuccessStatus["passed"] = "passed"; + SuccessStatus["failed"] = "failed"; + SuccessStatus["unknown"] = "unknown"; +})(SuccessStatus || (SuccessStatus = {})); +var CompletionStatus; +(function (CompletionStatus) { + CompletionStatus["completed"] = "completed"; + CompletionStatus["incomplete"] = "incomplete"; + CompletionStatus["unknown"] = "unknown"; +})(CompletionStatus || (CompletionStatus = {})); + + +/***/ }), + +/***/ 797: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); + +var global = { + GENERAL: 101, + INITIALIZATION_FAILED: 101, + INITIALIZED: 101, + TERMINATED: 101, + TERMINATION_FAILURE: 101, + TERMINATION_BEFORE_INIT: 101, + MULTIPLE_TERMINATION: 101, + RETRIEVE_BEFORE_INIT: 101, + RETRIEVE_AFTER_TERM: 101, + STORE_BEFORE_INIT: 101, + STORE_AFTER_TERM: 101, + COMMIT_BEFORE_INIT: 101, + COMMIT_AFTER_TERM: 101, + ARGUMENT_ERROR: 101, + CHILDREN_ERROR: 101, + COUNT_ERROR: 101, + GENERAL_GET_FAILURE: 101, + GENERAL_SET_FAILURE: 101, + GENERAL_COMMIT_FAILURE: 101, + UNDEFINED_DATA_MODEL: 101, + UNIMPLEMENTED_ELEMENT: 101, + VALUE_NOT_INITIALIZED: 101, + INVALID_SET_VALUE: 101, + READ_ONLY_ELEMENT: 101, + WRITE_ONLY_ELEMENT: 101, + TYPE_MISMATCH: 101, + VALUE_OUT_OF_RANGE: 101, + DEPENDENCY_NOT_ESTABLISHED: 101, +}; +var scorm12 = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, global), { RETRIEVE_BEFORE_INIT: 301, STORE_BEFORE_INIT: 301, COMMIT_BEFORE_INIT: 301, ARGUMENT_ERROR: 201, CHILDREN_ERROR: 202, COUNT_ERROR: 203, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 401, VALUE_NOT_INITIALIZED: 301, INVALID_SET_VALUE: 402, READ_ONLY_ELEMENT: 403, WRITE_ONLY_ELEMENT: 404, TYPE_MISMATCH: 405, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 }); +var scorm2004 = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, global), { INITIALIZATION_FAILED: 102, INITIALIZED: 103, TERMINATED: 104, TERMINATION_FAILURE: 111, TERMINATION_BEFORE_INIT: 112, MULTIPLE_TERMINATIONS: 113, RETRIEVE_BEFORE_INIT: 122, RETRIEVE_AFTER_TERM: 123, STORE_BEFORE_INIT: 132, STORE_AFTER_TERM: 133, COMMIT_BEFORE_INIT: 142, COMMIT_AFTER_TERM: 143, ARGUMENT_ERROR: 201, GENERAL_GET_FAILURE: 301, GENERAL_SET_FAILURE: 351, GENERAL_COMMIT_FAILURE: 391, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 402, VALUE_NOT_INITIALIZED: 403, READ_ONLY_ELEMENT: 404, WRITE_ONLY_ELEMENT: 405, TYPE_MISMATCH: 406, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 }); +var ErrorCodes = { + scorm12: scorm12, + scorm2004: scorm2004, +}; +/* harmony default export */ __webpack_exports__.A = (ErrorCodes); + + +/***/ }), + +/***/ 417: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); + +var scorm12 = { + CMIString256: "^.{0,255}$", + CMIString4096: "^.{0,4096}$", + CMITime: "^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$", + CMITimespan: "^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$", + CMIInteger: "^\\d+$", + CMISInteger: "^-?([0-9]+)$", + CMIDecimal: "^-?([0-9]{0,3})(.[0-9]*)?$", + CMIIdentifier: "^[\\u0021-\\u007E\\s]{0,255}$", + CMIFeedback: "^.{0,255}$", + CMIIndex: "[._](\\d+).", + CMIStatus: "^(passed|completed|failed|incomplete|browsed)$", + CMIStatus2: "^(passed|completed|failed|incomplete|browsed|not attempted)$", + CMIExit: "^(time-out|suspend|logout|)$", + CMIType: "^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$", + CMIResult: "^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$", + NAVEvent: "^(previous|continue)$", + score_range: "0#100", + audio_range: "-1#100", + speed_range: "-100#100", + weighting_range: "-100#100", + text_range: "-1#1", +}; +var aicc = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, scorm12), { + CMIIdentifier: "^\\w{1,255}$", +}); +var scorm2004 = { + CMIString200: "^[\\u0000-\\uFFFF]{0,200}$", + CMIString250: "^[\\u0000-\\uFFFF]{0,250}$", + CMIString1000: "^[\\u0000-\\uFFFF]{0,1000}$", + CMIString4000: "^[\\u0000-\\uFFFF]{0,4000}$", + CMIString64000: "^[\\u0000-\\uFFFF]{0,64000}$", + CMILang: "^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$", + CMILangString250: "^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$", + CMILangcr: "^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$", + CMILangString250cr: "^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$", + CMILangString4000: "^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$", + CMITime: "^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$", + CMITimespan: "^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$", + CMIInteger: "^\\d+$", + CMISInteger: "^-?([0-9]+)$", + CMIDecimal: "^-?([0-9]{1,5})(\\.[0-9]{1,18})?$", + CMIIdentifier: "^\\S{1,250}[a-zA-Z0-9]$", + CMIShortIdentifier: "^[\\w\\.\\-\\_]{1,250}$", + CMILongIdentifier: "^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$", + CMIFeedback: "^.*$", + CMIIndex: "[._](\\d+).", + CMIIndexStore: ".N(\\d+).", + CMICStatus: "^(completed|incomplete|not attempted|unknown)$", + CMISStatus: "^(passed|failed|unknown)$", + CMIExit: "^(time-out|suspend|logout|normal)$", + CMIType: "^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$", + CMIResult: "^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$", + NAVEvent: "^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$", + NAVBoolean: "^(unknown|true|false$)", + NAVTarget: "^{target=\\S{0,}[a-zA-Z0-9-_]+}$", + scaled_range: "-1#1", + audio_range: "0#*", + speed_range: "0#*", + text_range: "-1#1", + progress_range: "0#1", +}; +var Regex = { + aicc: aicc, + scorm12: scorm12, + scorm2004: scorm2004, +}; +/* harmony default export */ __webpack_exports__.A = (Regex); + + +/***/ }), + +/***/ 784: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ $h: function() { return /* binding */ BaseScormValidationError; }, +/* harmony export */ tQ: function() { return /* binding */ Scorm12ValidationError; }, +/* harmony export */ yI: function() { return /* binding */ ValidationError; } +/* harmony export */ }); +/* unused harmony exports AICCValidationError, Scorm2004ValidationError */ +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(635); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340); + + +var scorm12_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.error_descriptions; +var aicc_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.aicc.error_descriptions; +var scorm2004_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm2004.error_descriptions; +var BaseScormValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(BaseScormValidationError, _super); + function BaseScormValidationError(errorCode) { + var _this = _super.call(this, errorCode.toString()) || this; + _this._errorCode = errorCode; + _this.name = "ScormValidationError"; + return _this; + } + Object.defineProperty(BaseScormValidationError.prototype, "errorCode", { + get: function () { + return this._errorCode; + }, + enumerable: false, + configurable: true + }); + BaseScormValidationError.prototype.setMessage = function (message) { + this.message = message; + }; + return BaseScormValidationError; +}(Error)); + +var ValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(ValidationError, _super); + function ValidationError(errorCode, errorMessage, detailedMessage) { + var _this = _super.call(this, errorCode) || this; + _this._detailedMessage = ""; + _this.setMessage(errorMessage); + _this._errorMessage = errorMessage; + if (detailedMessage) { + _this._detailedMessage = detailedMessage; + } + return _this; + } + Object.defineProperty(ValidationError.prototype, "errorMessage", { + get: function () { + return this._errorMessage; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(ValidationError.prototype, "detailedMessage", { + get: function () { + return this._detailedMessage; + }, + enumerable: false, + configurable: true + }); + return ValidationError; +}(BaseScormValidationError)); + +var Scorm12ValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(Scorm12ValidationError, _super); + function Scorm12ValidationError(errorCode) { + var _this = this; + if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) { + _this = _super.call(this, errorCode, scorm12_errors[String(errorCode)].basicMessage, scorm12_errors[String(errorCode)].detailMessage) || this; + } + else { + _this = _super.call(this, 101, scorm12_errors["101"].basicMessage, scorm12_errors["101"].detailMessage) || this; + } + return _this; + } + return Scorm12ValidationError; +}(ValidationError)); + +var AICCValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(AICCValidationError, _super); + function AICCValidationError(errorCode) { + var _this = this; + if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) { + _this = _super.call(this, errorCode, aicc_errors[String(errorCode)].basicMessage, aicc_errors[String(errorCode)].detailMessage) || this; + } + else { + _this = _super.call(this, 101, aicc_errors["101"].basicMessage, aicc_errors["101"].detailMessage) || this; + } + return _this; + } + return AICCValidationError; +}(ValidationError)); + +var Scorm2004ValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(Scorm2004ValidationError, _super); + function Scorm2004ValidationError(errorCode) { + var _this = this; + if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) { + _this = _super.call(this, errorCode, scorm2004_errors[String(errorCode)].basicMessage, scorm2004_errors[String(errorCode)].detailMessage) || this; + } + else { + _this = _super.call(this, 101, scorm2004_errors["101"].basicMessage, scorm2004_errors["101"].detailMessage) || this; + } + return _this; + } + return Scorm2004ValidationError; +}(ValidationError)); + + + +/***/ }), + +/***/ 864: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Bq: function() { return /* binding */ flatten; }, +/* harmony export */ HT: function() { return /* binding */ addHHMMSSTimeStrings; }, +/* harmony export */ J6: function() { return /* binding */ stringMatches; }, +/* harmony export */ UZ: function() { return /* binding */ getSecondsAsHHMMSS; }, +/* harmony export */ f4: function() { return /* binding */ getTimeAsSeconds; }, +/* harmony export */ hw: function() { return /* binding */ formatMessage; }, +/* harmony export */ sB: function() { return /* binding */ unflatten; } +/* harmony export */ }); +/* unused harmony exports SECONDS_PER_SECOND, SECONDS_PER_MINUTE, SECONDS_PER_HOUR, SECONDS_PER_DAY, getSecondsAsISODuration, getDurationAsSeconds, addTwoDurations, countDecimals */ +var SECONDS_PER_SECOND = 1.0; +var SECONDS_PER_MINUTE = 60; +var SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE; +var SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR; +var designations = { + D: SECONDS_PER_DAY, + H: SECONDS_PER_HOUR, + M: SECONDS_PER_MINUTE, + S: SECONDS_PER_SECOND, +}; +function getSecondsAsHHMMSS(totalSeconds) { + if (!totalSeconds || totalSeconds <= 0) { + return "00:00:00"; + } + var hours = Math.floor(totalSeconds / SECONDS_PER_HOUR); + var dateObj = new Date(totalSeconds * 1000); + var minutes = dateObj.getUTCMinutes(); + var seconds = dateObj.getSeconds(); + var ms = totalSeconds % 1.0; + var msStr = ""; + if (countDecimals(ms) > 0) { + if (countDecimals(ms) > 2) { + msStr = ms.toFixed(2); + } + else { + msStr = String(ms); + } + msStr = "." + msStr.split(".")[1]; + } + return ((hours + ":" + minutes + ":" + seconds).replace(/\b\d\b/g, "0$&") + msStr); +} +function getSecondsAsISODuration(seconds) { + if (!seconds || seconds <= 0) { + return "PT0S"; + } + var duration = "P"; + var remainder = seconds; + for (var designationsKey in designations) { + var current_seconds = designations[designationsKey]; + var value = Math.floor(remainder / current_seconds); + remainder = remainder % current_seconds; + if (countDecimals(remainder) > 2) { + remainder = Number(Number(remainder).toFixed(2)); + } + if (designationsKey === "S" && remainder > 0) { + value += remainder; + } + if (value) { + if ((duration.indexOf("D") > 0 || + designationsKey === "H" || + designationsKey === "M" || + designationsKey === "S") && + duration.indexOf("T") === -1) { + duration += "T"; + } + duration += "".concat(value).concat(designationsKey); + } + } + return duration; +} +function getTimeAsSeconds(timeString, timeRegex) { + if (typeof timeString === "number" || typeof timeString === "boolean") { + timeString = String(timeString); + } + if (typeof timeRegex === "string") { + timeRegex = new RegExp(timeRegex); + } + if (!timeString || !timeString.match(timeRegex)) { + return 0; + } + var parts = timeString.split(":"); + var hours = Number(parts[0]); + var minutes = Number(parts[1]); + var seconds = Number(parts[2]); + return hours * 3600 + minutes * 60 + seconds; +} +function getDurationAsSeconds(duration, durationRegex) { + if (typeof durationRegex === "string") { + durationRegex = new RegExp(durationRegex); + } + if (!duration || !duration.match(durationRegex)) { + return 0; + } + var _a = new RegExp(durationRegex).exec(duration) || [], years = _a[1], _ = _a[2], days = _a[4], hours = _a[5], minutes = _a[6], seconds = _a[7]; + var result = 0.0; + result += Number(seconds) || 0.0; + result += Number(minutes) * 60.0 || 0.0; + result += Number(hours) * 3600.0 || 0.0; + result += Number(days) * (60 * 60 * 24.0) || 0.0; + result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0; + return result; +} +function addTwoDurations(first, second, durationRegex) { + var regex = typeof durationRegex === "string" + ? new RegExp(durationRegex) + : durationRegex; + return getSecondsAsISODuration(getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex)); +} +function addHHMMSSTimeStrings(first, second, timeRegex) { + if (typeof timeRegex === "string") { + timeRegex = new RegExp(timeRegex); + } + return getSecondsAsHHMMSS(getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex)); +} +function flatten(data) { + var result = {}; + function recurse(cur, prop) { + if (Object(cur) !== cur) { + result[prop] = cur; + } + else if (Array.isArray(cur)) { + for (var i = 0, l = cur.length; i < l; i++) { + recurse(cur[i], prop + "[" + i + "]"); + if (l === 0) + result[prop] = []; + } + } + else { + var isEmpty = true; + for (var p in cur) { + if ({}.hasOwnProperty.call(cur, p)) { + isEmpty = false; + recurse(cur[p], prop ? prop + "." + p : p); + } + } + if (isEmpty && prop) + result[prop] = {}; + } + } + recurse(data, ""); + return result; +} +function unflatten(data) { + "use strict"; + if (Object(data) !== data || Array.isArray(data)) + return data; + var regex = /\.?([^.[\]]+)|\[(\d+)]/g; + var result = {}; + for (var p in data) { + if ({}.hasOwnProperty.call(data, p)) { + var cur = result; + var prop = ""; + var m = regex.exec(p); + while (m) { + cur = cur[prop] || (cur[prop] = m[2] ? [] : {}); + prop = m[2] || m[1]; + m = regex.exec(p); + } + cur[prop] = data[p]; + } + } + return result[""] || result; +} +function countDecimals(num) { + if (Math.floor(num) === num || String(num).indexOf(".") < 0) + return 0; + var parts = num.toString().split(".")[1]; + return parts.length || 0; +} +function formatMessage(functionName, message, CMIElement) { + var baseLength = 20; + var messageString = ""; + messageString += functionName; + var fillChars = baseLength - messageString.length; + for (var i = 0; i < fillChars; i++) { + messageString += " "; + } + messageString += ": "; + if (CMIElement) { + var CMIElementBaseLength = 70; + messageString += CMIElement; + fillChars = CMIElementBaseLength - messageString.length; + for (var j = 0; j < fillChars; j++) { + messageString += " "; + } + } + if (message) { + messageString += message; + } + return messageString; +} +function stringMatches(str, tester) { + return (str === null || str === void 0 ? void 0 : str.match(tester)) !== null; +} + + +/***/ }), + +/***/ 635: +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ C6: function() { return /* binding */ __extends; }, +/* harmony export */ Cl: function() { return /* binding */ __assign; }, +/* harmony export */ YH: function() { return /* binding */ __generator; }, +/* harmony export */ sH: function() { return /* binding */ __awaiter; } +/* harmony export */ }); +/* unused harmony exports __rest, __decorate, __param, __esDecorate, __runInitializers, __propKey, __setFunctionName, __metadata, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn, __addDisposableResource, __disposeResources */ +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise, SuppressedError, Symbol, Iterator */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + } + return __assign.apply(this, arguments); +} + +function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +} + +function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +} + +function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } + var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context = {}; + for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context.access[p] = contextIn.access[p]; + context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } + else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; + } + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; +}; + +function __runInitializers(thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) { + value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + } + return useValue ? value : void 0; +}; + +function __propKey(x) { + return typeof x === "symbol" ? x : "".concat(x); +}; + +function __setFunctionName(f, name, prefix) { + if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; + return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); +}; + +function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} + +function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +var __createBinding = Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); + +function __exportStar(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); +} + +function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} + +function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +/** @deprecated */ +function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} + +/** @deprecated */ +function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +} + +function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +} + +function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} + +function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; + function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } + function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} + +function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } +} + +function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} + +function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; + +var __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}; + +function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +} + +function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; +} + +function __classPrivateFieldGet(receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +} + +function __classPrivateFieldSet(receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; +} + +function __classPrivateFieldIn(state, receiver) { + if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); + return typeof state === "function" ? receiver === state : state.has(receiver); +} + +function __addDisposableResource(env, value, async) { + if (value !== null && value !== void 0) { + if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); + var dispose, inner; + if (async) { + if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value[Symbol.asyncDispose]; + } + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + if (async) inner = dispose; + } + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; + env.stack.push({ value: value, dispose: dispose, async: async }); + } + else if (async) { + env.stack.push({ async: true }); + } + return value; +} + +var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; +}; + +function __disposeResources(env) { + function fail(e) { + env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; + env.hasError = true; + } + var r, s = 0; + function next() { + while (r = env.stack.pop()) { + try { + if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); + if (r.dispose) { + var result = r.dispose.call(r.value); + if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); + } + else s |= 1; + } + catch (e) { + fail(e); + } + } + if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); + if (env.hasError) throw env.error; + } + return next(); +} + +/* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ({ + __extends, + __assign, + __rest, + __decorate, + __param, + __metadata, + __awaiter, + __generator, + __createBinding, + __exportStar, + __values, + __read, + __spread, + __spreadArrays, + __spreadArray, + __await, + __asyncGenerator, + __asyncDelegator, + __asyncValues, + __makeTemplateObject, + __importStar, + __importDefault, + __classPrivateFieldGet, + __classPrivateFieldSet, + __classPrivateFieldIn, + __addDisposableResource, + __disposeResources, +}); + + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ !function() { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = function(exports, definition) { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ !function() { +/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ }(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ C: function() { return /* binding */ Scorm12Impl; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(635); +/* harmony import */ var _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(989); +/* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(864); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(340); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797); +/* harmony import */ var _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(176); +/* harmony import */ var _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(833); +/* harmony import */ var _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(331); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(417); +/* harmony import */ var _constants_enums__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(56); +/* harmony import */ var _BaseAPI__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(900); + + + + + + + + + + + + +var Scorm12Impl = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__extends */ .C6)(Scorm12Impl, _super); + function Scorm12Impl(settings) { + var _this = this; + if (settings) { + if (settings.mastery_override === undefined) { + settings.mastery_override = false; + } + } + _this = _super.call(this, _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12, settings) || this; + _this.statusSetByModule = false; + _this.cmi = new _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__/* .CMI */ .Y(); + _this.nav = new _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__/* .NAV */ .A(); + _this.LMSInitialize = _this.lmsInitialize; + _this.LMSFinish = _this.lmsFinish; + _this.LMSGetValue = _this.lmsGetValue; + _this.LMSSetValue = _this.lmsSetValue; + _this.LMSCommit = _this.lmsCommit; + _this.LMSGetLastError = _this.lmsGetLastError; + _this.LMSGetErrorString = _this.lmsGetErrorString; + _this.LMSGetDiagnostic = _this.lmsGetDiagnostic; + return _this; + } + Scorm12Impl.prototype.reset = function (settings) { + this.commonReset(settings); + this.cmi = new _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_0__/* .CMI */ .Y(); + this.nav = new _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_6__/* .NAV */ .A(); + }; + Scorm12Impl.prototype.lmsInitialize = function () { + this.cmi.initialize(); + if (this.cmi.core.lesson_status) { + this.statusSetByModule = true; + } + else { + this.cmi.core.lesson_status = "not attempted"; + } + return this.initialize("LMSInitialize", "LMS was already initialized!", "LMS is already finished!"); + }; + Scorm12Impl.prototype.lmsFinish = function () { + var _this = this; + (function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__awaiter */ .sH)(_this, void 0, void 0, function () { + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__generator */ .YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this.internalFinish()]; + case 1: + _a.sent(); + return [2]; + } + }); + }); })(); + return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.global.SCORM_TRUE; + }; + Scorm12Impl.prototype.internalFinish = function () { + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__awaiter */ .sH)(this, void 0, void 0, function () { + var result; + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__generator */ .YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this.terminate("LMSFinish", true)]; + case 1: + result = _a.sent(); + if (result === _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.global.SCORM_TRUE) { + if (this.nav.event !== "") { + if (this.nav.event === "continue") { + this.processListeners("SequenceNext"); + } + else { + this.processListeners("SequencePrevious"); + } + } + else if (this.settings.autoProgress) { + this.processListeners("SequenceNext"); + } + } + return [2, result]; + } + }); + }); + }; + Scorm12Impl.prototype.lmsGetValue = function (CMIElement) { + return this.getValue("LMSGetValue", false, CMIElement); + }; + Scorm12Impl.prototype.lmsSetValue = function (CMIElement, value) { + if (CMIElement === "cmi.core.lesson_status") { + this.statusSetByModule = true; + } + return this.setValue("LMSSetValue", "LMSCommit", false, CMIElement, value); + }; + Scorm12Impl.prototype.lmsCommit = function () { + var _this = this; + (function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__awaiter */ .sH)(_this, void 0, void 0, function () { + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__generator */ .YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this.commit("LMSCommit", false)]; + case 1: + _a.sent(); + return [2]; + } + }); + }); })(); + return _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.global.SCORM_TRUE; + }; + Scorm12Impl.prototype.lmsGetLastError = function () { + return this.getLastError("LMSGetLastError"); + }; + Scorm12Impl.prototype.lmsGetErrorString = function (CMIErrorCode) { + return this.getErrorString("LMSGetErrorString", CMIErrorCode); + }; + Scorm12Impl.prototype.lmsGetDiagnostic = function (CMIErrorCode) { + return this.getDiagnostic("LMSGetDiagnostic", CMIErrorCode); + }; + Scorm12Impl.prototype.setCMIValue = function (CMIElement, value) { + return this._commonSetCMIValue("LMSSetValue", false, CMIElement, value); + }; + Scorm12Impl.prototype.getCMIValue = function (CMIElement) { + return this._commonGetCMIValue("getCMIValue", false, CMIElement); + }; + Scorm12Impl.prototype.getChildElement = function (CMIElement, _value, foundFirstIndex) { + if ((0,_utilities__WEBPACK_IMPORTED_MODULE_1__/* .stringMatches */ .J6)(CMIElement, "cmi\\.objectives\\.\\d+")) { + return new _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_4__/* .CMIObjectivesObject */ .N(); + } + else if (foundFirstIndex && + (0,_utilities__WEBPACK_IMPORTED_MODULE_1__/* .stringMatches */ .J6)(CMIElement, "cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")) { + return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__/* .CMIInteractionsCorrectResponsesObject */ .cb(); + } + else if (foundFirstIndex && + (0,_utilities__WEBPACK_IMPORTED_MODULE_1__/* .stringMatches */ .J6)(CMIElement, "cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")) { + return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__/* .CMIInteractionsObjectivesObject */ .Oh(); + } + else if (!foundFirstIndex && + (0,_utilities__WEBPACK_IMPORTED_MODULE_1__/* .stringMatches */ .J6)(CMIElement, "cmi\\.interactions\\.\\d+")) { + return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_5__/* .CMIInteractionsObject */ .WP(); + } + return null; + }; + Scorm12Impl.prototype.validateCorrectResponse = function (_CMIElement, _value) { + }; + Scorm12Impl.prototype.getLmsErrorMessageDetails = function (errorNumber, detail) { + var basicMessage = "No Error"; + var detailMessage = "No Error"; + errorNumber = String(errorNumber); + if (_constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.error_descriptions[errorNumber]) { + basicMessage = + _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.error_descriptions[errorNumber].basicMessage; + detailMessage = + _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.error_descriptions[errorNumber].detailMessage; + } + return detail ? detailMessage : basicMessage; + }; + Scorm12Impl.prototype.replaceWithAnotherScormAPI = function (newAPI) { + this.cmi = newAPI.cmi; + }; + Scorm12Impl.prototype.renderCommitCMI = function (terminateCommit) { + var cmiExport = this.renderCMIToJSONObject(); + if (terminateCommit) { + cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime(); + } + var result = []; + var flattened = _utilities__WEBPACK_IMPORTED_MODULE_1__/* .flatten */ .Bq(cmiExport); + switch (this.settings.dataCommitFormat) { + case "flattened": + return _utilities__WEBPACK_IMPORTED_MODULE_1__/* .flatten */ .Bq(cmiExport); + case "params": + for (var item in flattened) { + if ({}.hasOwnProperty.call(flattened, item)) { + result.push("".concat(item, "=").concat(flattened[item])); + } + } + return result; + case "json": + default: + return cmiExport; + } + }; + Scorm12Impl.prototype.renderCommitObject = function (terminateCommit) { + var cmiExport = this.renderCommitCMI(terminateCommit); + var totalTimeHHMMSS = this.cmi.getCurrentTotalTime(); + var totalTimeSeconds = _utilities__WEBPACK_IMPORTED_MODULE_1__/* .getTimeAsSeconds */ .f4(totalTimeHHMMSS, _constants_regex__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A.scorm12.CMITimespan); + var lessonStatus = this.cmi.core.lesson_status; + var completionStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_8__/* .CompletionStatus */ .lC.unknown; + var successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_8__/* .SuccessStatus */ .YE.unknown; + if (lessonStatus) { + completionStatus = + lessonStatus === "completed" || lessonStatus === "passed" + ? _constants_enums__WEBPACK_IMPORTED_MODULE_8__/* .CompletionStatus */ .lC.completed + : _constants_enums__WEBPACK_IMPORTED_MODULE_8__/* .CompletionStatus */ .lC.incomplete; + if (lessonStatus === "passed") { + successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_8__/* .SuccessStatus */ .YE.passed; + } + else if (lessonStatus === "failed") { + successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_8__/* .SuccessStatus */ .YE.failed; + } + } + var score = this.cmi.core.score; + var scoreObject = null; + if (score) { + scoreObject = {}; + if (!Number.isNaN(Number.parseFloat(score.raw))) { + scoreObject.raw = Number.parseFloat(score.raw); + } + if (!Number.isNaN(Number.parseFloat(score.min))) { + scoreObject.min = Number.parseFloat(score.min); + } + if (!Number.isNaN(Number.parseFloat(score.max))) { + scoreObject.max = Number.parseFloat(score.max); + } + } + var commitObject = { + successStatus: successStatus, + completionStatus: completionStatus, + runtimeData: cmiExport, + totalTimeSeconds: totalTimeSeconds, + }; + if (scoreObject) { + commitObject.score = scoreObject; + } + return commitObject; + }; + Scorm12Impl.prototype.storeData = function (terminateCommit) { + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__awaiter */ .sH)(this, void 0, void 0, function () { + var originalStatus, shouldTerminateCommit, commitObject; + var _a, _b, _c; + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__generator */ .YH)(this, function (_d) { + switch (_d.label) { + case 0: + if (terminateCommit) { + originalStatus = this.cmi.core.lesson_status; + if (!this.cmi.core.lesson_status || + (!this.statusSetByModule && + this.cmi.core.lesson_status === "not attempted")) { + this.cmi.core.lesson_status = "completed"; + } + if (this.cmi.core.lesson_mode === "normal") { + if (this.cmi.core.credit === "credit") { + if (this.settings.mastery_override && + this.cmi.student_data.mastery_score !== "" && + this.cmi.core.score.raw !== "") { + this.cmi.core.lesson_status = + parseFloat(this.cmi.core.score.raw) >= + parseFloat(this.cmi.student_data.mastery_score) + ? "passed" + : "failed"; + } + } + } + else if (this.cmi.core.lesson_mode === "browse") { + if ((((_c = (_b = (_a = this.startingData) === null || _a === void 0 ? void 0 : _a.cmi) === null || _b === void 0 ? void 0 : _b.core) === null || _c === void 0 ? void 0 : _c.lesson_status) || "") === "" && + originalStatus === "not attempted") { + this.cmi.core.lesson_status = "browsed"; + } + } + } + shouldTerminateCommit = terminateCommit || this.settings.alwaysSendTotalTime; + commitObject = this.settings.renderCommonCommitFields + ? this.renderCommitObject(shouldTerminateCommit) + : this.renderCommitCMI(shouldTerminateCommit); + if (this.apiLogLevel === _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.global.LOG_LEVEL_DEBUG) { + console.debug("Commit (terminated: " + (terminateCommit ? "yes" : "no") + "): "); + console.debug(commitObject); + } + if (!(typeof this.settings.lmsCommitUrl === "string")) return [3, 2]; + return [4, this.processHttpRequest(this.settings.lmsCommitUrl, commitObject, terminateCommit)]; + case 1: return [2, _d.sent()]; + case 2: return [2, { + result: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.global.SCORM_TRUE, + errorCode: 0, + }]; + } + }); + }); + }; + return Scorm12Impl; +}(_BaseAPI__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A)); + + +var __webpack_exports__Scorm12Impl = __webpack_exports__.C; +export { __webpack_exports__Scorm12Impl as Scorm12Impl }; + +//# sourceMappingURL=scorm12.js.map \ No newline at end of file diff --git a/dist/esm/scorm12.js.map b/dist/esm/scorm12.js.map new file mode 100644 index 0000000..bd63f07 --- /dev/null +++ b/dist/esm/scorm12.js.map @@ -0,0 +1 @@ +{"version":3,"file":"scorm12.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAQO,SAAS,QAAQ,CACtB,IAAO,EACP,IAAY,EACZ,SAAiB;IAAjB,6CAAiB;IAEjB,IAAI,OAA6C,CAAC;IAElD,OAAO;QAAqB,cAAsB;aAAtB,UAAsB,EAAtB,qBAAsB,EAAtB,IAAsB;YAAtB,yBAAsB;;QAChD,IAAM,OAAO,GAAG,IAAI,CAAC;QAErB,IAAM,KAAK,GAAG;YACZ,OAAO,GAAG,IAAI,CAAC;YACf,IAAI,CAAC,SAAS;gBAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC5C,CAAC,CAAC;QAEF,IAAM,OAAO,GAAG,SAAS,IAAI,CAAC,OAAO,CAAC;QAEtC,IAAI,OAAO;YAAE,YAAY,CAAC,OAAO,CAAC,CAAC;QACnC,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAElC,IAAI,OAAO;YAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACzC,CAAC,CAAC;AACJ,CAAC;;;;AC7B0C;AAKpC,IAAM,eAAe,GAAa;IACvC,UAAU,EAAE,KAAK;IACjB,iBAAiB,EAAE,EAAE;IACrB,WAAW,EAAE,KAAK;IAClB,cAAc,EAAE,IAAI;IACpB,YAAY,EAAE,KAAK;IACnB,gBAAgB,EAAE,MAAM;IACxB,qBAAqB,EAAE,gCAAgC;IACvD,YAAY,EAAE,KAAK;IACnB,QAAQ,EAAE,4BAAY,CAAC,MAAM,CAAC,eAAe;IAC7C,qBAAqB,EAAE,KAAK;IAC5B,mBAAmB,EAAE,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;AACP,+BAA+B,uCAAuC,YAAY,KAAK,OAAO;AAC9F;AACA;;AAEA;AACA,wCAAwC,4BAA4B;AACpE,CAAC;AACD;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,2CAA2C;AAC3C;;AAEO;AACP;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,MAAM,oBAAoB,YAAY;AAC5E,qBAAqB,8CAA8C;AACnE;AACA;AACA,qBAAqB,aAAa;AAClC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uFAAuF,SAAS,gBAAgB;AAChH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sEAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAC;;;;;;;SCzXF;SACA;;SAEA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;;SAEA;SACA;;SAEA;SACA;SACA;;;;;UCtBA;UACA;UACA;UACA;UACA,yCAAyC,wCAAwC;UACjF;UACA;UACA;;;;;UCPA,8CAA8C;;;;;;;;;;;;;;;;;;;;ACAN;AACC;AACG;AACS;AACJ;AAGc;AAK3B;AACI;AAQF;AAC8B;AACpC;AAKhC;IAA0B,iFAAO;IAK/B,qBAAY,QAAmB;QAA/B,iBAqBC;QApBC,IAAI,QAAQ,EAAE,CAAC;YACb,IAAI,QAAQ,CAAC,gBAAgB,KAAK,SAAS,EAAE,CAAC;gBAC5C,QAAQ,CAAC,gBAAgB,GAAG,KAAK,CAAC;YACpC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AC;4BACH,CAAC;wBACH,CAAC;wBAEK,qBAAqB,GACzB,eAAe,IAAI,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC;wBACjD,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,wBAAwB;4BACzD,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,qBAAqB,CAAC;4BAChD,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,qBAAqB,CAAC,CAAC;wBAEhD,IAAI,IAAI,CAAC,WAAW,KAAK,yEAAY,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC;4BAC7D,OAAO,CAAC,KAAK,CACX,sBAAsB,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,KAAK,CAClE,CAAC;4BACF,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;wBAC9B,CAAC;6BACG,QAAO,IAAI,CAAC,QAAQ,CAAC,YAAY,KAAK,QAAQ,GAA9C,cAA8C;wBACzC,WAAM,IAAI,CAAC,kBAAkB,CAClC,IAAI,CAAC,QAAQ,CAAC,YAAY,EAC1B,YAAY,EACZ,eAAe,CAChB;4BAJD,WAAO,SAIN,EAAC;4BAEF,WAAO;4BACL,MAAM,EAAE,yEAAY,CAAC,MAAM,CAAC,UAAU;4BACtC,SAAS,EAAE,CAAC;yBACb,EAAC;;;;KAEL;IACH,kBAAC;AAAD,CAAC,CAvayB,yDAAO,GAuahC;AAEsB","sources":["webpack://scorm-again/./src/utilities/debounce.ts","webpack://scorm-again/./src/constants/default_settings.ts","webpack://scorm-again/./src/helpers/scheduled_commit.ts","webpack://scorm-again/./src/BaseAPI.ts","webpack://scorm-again/./src/cmi/common/array.ts","webpack://scorm-again/./src/cmi/common/base_cmi.ts","webpack://scorm-again/./src/cmi/common/score.ts","webpack://scorm-again/./src/cmi/common/validation.ts","webpack://scorm-again/./src/cmi/aicc/core.ts","webpack://scorm-again/./src/cmi/scorm12/cmi.ts","webpack://scorm-again/./src/cmi/scorm12/interactions.ts","webpack://scorm-again/./src/cmi/scorm12/nav.ts","webpack://scorm-again/./src/cmi/scorm12/objectives.ts","webpack://scorm-again/./src/cmi/scorm12/student_data.ts","webpack://scorm-again/./src/cmi/scorm12/student_preference.ts","webpack://scorm-again/./src/cmi/scorm12/validation.ts","webpack://scorm-again/./src/constants/api_constants.ts","webpack://scorm-again/./src/constants/enums.ts","webpack://scorm-again/./src/constants/error_codes.ts","webpack://scorm-again/./src/constants/regex.ts","webpack://scorm-again/./src/exceptions.ts","webpack://scorm-again/./src/utilities.ts","webpack://scorm-again/./node_modules/tslib/tslib.es6.mjs","webpack://scorm-again/webpack/bootstrap","webpack://scorm-again/webpack/runtime/define property getters","webpack://scorm-again/webpack/runtime/hasOwnProperty shorthand","webpack://scorm-again/./src/Scorm12API.ts"],"sourcesContent":["/**\n * Debounce function to delay the execution of a given function.\n *\n * @param func - The function to debounce.\n * @param wait - The number of milliseconds to delay.\n * @param immediate - If `true`, the function will be triggered on the leading edge instead of the trailing.\n * @returns A debounced version of the provided function.\n */\nexport function debounce void>(\n func: T,\n wait: number,\n immediate = false,\n): (...args: Parameters) => void {\n let timeout: ReturnType | null;\n\n return function (this: any, ...args: Parameters) {\n const context = this;\n\n const later = () => {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n const callNow = immediate && !timeout;\n\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) func.apply(context, args);\n };\n}\n","import { ResultObject, Settings } from \"../types/api_types\";\nimport APIConstants from \"./api_constants\";\n\n/**\n * Default settings for the SCORM API\n */\nexport const DefaultSettings: Settings = {\n autocommit: false,\n autocommitSeconds: 10,\n asyncCommit: false,\n sendFullCommit: true,\n lmsCommitUrl: false,\n dataCommitFormat: \"json\",\n commitRequestDataType: \"application/json;charset=UTF-8\",\n autoProgress: false,\n logLevel: APIConstants.global.LOG_LEVEL_ERROR,\n selfReportSessionTime: false,\n alwaysSendTotalTime: false,\n renderCommonCommitFields: false,\n strict_errors: true,\n xhrHeaders: {},\n xhrWithCredentials: false,\n responseHandler: async function (response: Response): Promise {\n if (typeof response !== \"undefined\") {\n const httpResult = JSON.parse(await response.text());\n if (\n httpResult === null ||\n !{}.hasOwnProperty.call(httpResult, \"result\")\n ) {\n if (response.status === 200) {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n }\n } else {\n return {\n result: httpResult.result,\n errorCode: httpResult.errorCode\n ? httpResult.errorCode\n : httpResult.result === APIConstants.global.SCORM_TRUE\n ? 0\n : 101,\n };\n }\n }\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n },\n requestHandler: function (commitObject) {\n return commitObject;\n },\n onLogMessage: function (messageLevel, logMessage) {\n switch (messageLevel) {\n case APIConstants.global.LOG_LEVEL_ERROR:\n console.error(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_WARNING:\n console.warn(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_INFO:\n console.info(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_DEBUG:\n if (console.debug) {\n console.debug(logMessage);\n } else {\n console.log(logMessage);\n }\n break;\n }\n },\n scoItemIds: [],\n scoItemIdValidator: false,\n};\n","import BaseAPI from \"../BaseAPI\";\n\n/**\n * Private class that wraps a timeout call to the commit() function\n */\nexport class ScheduledCommit {\n private _API;\n private _cancelled = false;\n private readonly _timeout;\n private readonly _callback;\n\n /**\n * Constructor for ScheduledCommit\n * @param {BaseAPI} API\n * @param {number} when\n * @param {string} callback\n */\n constructor(API: BaseAPI, when: number, callback: string) {\n this._API = API;\n this._timeout = setTimeout(this.wrapper.bind(this), when);\n this._callback = callback;\n }\n\n /**\n * Cancel any currently scheduled commit\n */\n cancel() {\n this._cancelled = true;\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n }\n\n /**\n * Wrap the API commit call to check if the call has already been cancelled\n */\n wrapper() {\n if (!this._cancelled) {\n (async () => await this._API.commit(this._callback))();\n }\n }\n}\n","import { CMIArray } from \"./cmi/common/array\";\nimport { ValidationError } from \"./exceptions\";\nimport ErrorCodes, { ErrorCode } from \"./constants/error_codes\";\nimport APIConstants from \"./constants/api_constants\";\nimport { formatMessage, stringMatches, unflatten } from \"./utilities\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { debounce } from \"./utilities/debounce\";\nimport {\n RefObject,\n CommitObject,\n ResultObject,\n Settings,\n} from \"./types/api_types\";\nimport { DefaultSettings } from \"./constants/default_settings\";\nimport { IBaseAPI } from \"./interfaces/IBaseAPI\";\nimport { ScheduledCommit } from \"./helpers/scheduled_commit\";\n\n/**\n * Base API class for AICC, SCORM 1.2, and SCORM 2004. Should be considered\n * abstract, and never initialized on its own.\n */\nexport default abstract class BaseAPI implements IBaseAPI {\n private _timeout?: ScheduledCommit;\n private readonly _error_codes: ErrorCode;\n private _settings: Settings = DefaultSettings;\n\n /**\n * Constructor for Base API class. Sets some shared API fields, as well as\n * sets up options for the API.\n * @param {ErrorCode} error_codes\n * @param {Settings} settings\n */\n protected constructor(error_codes: ErrorCode, settings?: Settings) {\n if (new.target === BaseAPI) {\n throw new TypeError(\"Cannot construct BaseAPI instances directly\");\n }\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n\n this._error_codes = error_codes;\n\n if (settings) {\n this.settings = settings;\n }\n this.apiLogLevel = this.settings.logLevel;\n this.selfReportSessionTime = this.settings.selfReportSessionTime;\n }\n\n public abstract cmi: BaseCMI;\n public startingData?: RefObject;\n\n public currentState: number;\n public lastErrorCode: string;\n public listenerArray: any[];\n public apiLogLevel: number;\n public selfReportSessionTime: boolean;\n\n abstract reset(settings?: Settings): void;\n\n /**\n * Common reset method for all APIs. New settings are merged with the existing settings.\n * @param {Settings} settings\n * @protected\n */\n commonReset(settings?: Settings): void {\n this.settings = { ...this.settings, ...settings };\n\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n }\n\n /**\n * Initialize the API\n * @param {string} callbackName\n * @param {string} initializeMessage\n * @param {string} terminationMessage\n * @return {string}\n */\n initialize(\n callbackName: string,\n initializeMessage?: string,\n terminationMessage?: string,\n ): string {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);\n } else if (this.isTerminated()) {\n this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage);\n } else {\n if (this.selfReportSessionTime) {\n this.cmi.setStartTime();\n }\n\n this.currentState = APIConstants.global.STATE_INITIALIZED;\n this.lastErrorCode = \"0\";\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n abstract lmsInitialize(): string;\n\n abstract lmsFinish(): string;\n\n abstract lmsGetValue(CMIElement: string): string;\n\n abstract lmsSetValue(CMIElement: string, value: any): string;\n\n abstract lmsCommit(): string;\n\n abstract lmsGetLastError(): string;\n\n abstract lmsGetErrorString(CMIErrorCode: string | number): string;\n\n abstract lmsGetDiagnostic(CMIErrorCode: string | number): string;\n\n /**\n * Abstract method for validating that a response is correct.\n *\n * @param {string} _CMIElement\n * @param {any} _value\n */\n abstract validateCorrectResponse(_CMIElement: string, _value: any): void;\n\n /**\n * Gets or builds a new child element to add to the array.\n * APIs that inherit BaseAPI should override this method.\n *\n * @param {string} _CMIElement - unused\n * @param {*} _value - unused\n * @param {boolean} _foundFirstIndex - unused\n * @return {BaseCMI|null}\n * @abstract\n */\n abstract getChildElement(\n _CMIElement: string,\n _value: any,\n _foundFirstIndex: boolean,\n ): BaseCMI | null;\n\n /**\n * Attempts to store the data to the LMS, logs data if no LMS configured\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _calculateTotalTime\n * @return {ResultObject}\n * @abstract\n */\n abstract storeData(_calculateTotalTime: boolean): Promise;\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _terminateCommit\n * @return {RefObject|Array}\n * @abstract\n */\n abstract renderCommitCMI(_terminateCommit: boolean): RefObject | Array;\n\n /**\n * Render the commit object to the shortened format for LMS commit\n * @param {boolean} _terminateCommit\n * @return {CommitObject}\n */\n abstract renderCommitObject(_terminateCommit: boolean): CommitObject;\n\n /**\n * Logging for all SCORM actions\n *\n * @param {string} functionName\n * @param {string} logMessage\n * @param {number} messageLevel\n * @param {string} CMIElement\n */\n apiLog(\n functionName: string,\n logMessage: string,\n messageLevel: number,\n CMIElement?: string,\n ) {\n logMessage = formatMessage(functionName, logMessage, CMIElement);\n\n if (messageLevel >= this.apiLogLevel) {\n this.settings.onLogMessage(messageLevel, logMessage);\n }\n }\n\n /**\n * Getter for _error_codes\n * @return {ErrorCode}\n */\n get error_codes(): ErrorCode {\n return this._error_codes;\n }\n\n /**\n * Getter for _settings\n * @return {Settings}\n */\n get settings(): Settings {\n return this._settings;\n }\n\n /**\n * Setter for _settings\n * @param {Settings} settings\n */\n set settings(settings: Settings) {\n this._settings = { ...this._settings, ...settings };\n }\n\n /**\n * Terminates the current run of the API\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async terminate(\n callbackName: string,\n checkTerminated: boolean,\n ): Promise {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.TERMINATION_BEFORE_INIT,\n this._error_codes.MULTIPLE_TERMINATION,\n )\n ) {\n this.currentState = APIConstants.global.STATE_TERMINATED;\n\n const result: ResultObject = await this.storeData(true);\n if (typeof result.errorCode !== \"undefined\" && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Get the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @return {string}\n */\n getValue(\n callbackName: string,\n checkTerminated: boolean,\n CMIElement: string,\n ): string {\n let returnValue: string = \"\";\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.RETRIEVE_BEFORE_INIT,\n this._error_codes.RETRIEVE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.getCMIValue(CMIElement);\n } catch (e) {\n returnValue = this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement);\n }\n\n this.apiLog(\n callbackName,\n \": returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n\n if (returnValue === undefined) {\n return \"\";\n }\n\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Sets the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {string} commitCallback\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setValue(\n callbackName: string,\n commitCallback: string,\n checkTerminated: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (value !== undefined) {\n value = String(value);\n }\n let returnValue: string = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.STORE_BEFORE_INIT,\n this._error_codes.STORE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.setCMIValue(CMIElement, value);\n } catch (e) {\n this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement, value);\n }\n\n if (returnValue === undefined) {\n returnValue = APIConstants.global.SCORM_FALSE;\n }\n\n // If we didn't have any errors while setting the data, go ahead and\n // schedule a commit, if autocommit is turned on\n if (String(this.lastErrorCode) === \"0\") {\n if (this.settings.autocommit && !this._timeout) {\n this.scheduleCommit(\n this.settings.autocommitSeconds * 1000,\n commitCallback,\n );\n }\n }\n\n this.apiLog(\n callbackName,\n \": \" + value + \": result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Orders LMS to store all content parameters\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async commit(\n callbackName: string,\n checkTerminated: boolean = false,\n ): Promise {\n this.clearScheduledCommit();\n\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.COMMIT_BEFORE_INIT,\n this._error_codes.COMMIT_AFTER_TERM,\n )\n ) {\n const result = await this.storeData(false);\n if (result.errorCode && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n this.apiLog(\n callbackName,\n \" Result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"HttpRequest\",\n );\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Returns last error code\n * @param {string} callbackName\n * @return {string}\n */\n getLastError(callbackName: string): string {\n const returnValue = String(this.lastErrorCode);\n\n this.processListeners(callbackName);\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getErrorString(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getDiagnostic(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Checks the LMS state and ensures it has been initialized.\n *\n * @param {boolean} checkTerminated\n * @param {number} beforeInitError\n * @param {number} afterTermError\n * @return {boolean}\n */\n checkState(\n checkTerminated: boolean,\n beforeInitError: number,\n afterTermError: number,\n ): boolean {\n if (this.isNotInitialized()) {\n this.throwSCORMError(beforeInitError);\n return false;\n } else if (checkTerminated && this.isTerminated()) {\n this.throwSCORMError(afterTermError);\n return false;\n }\n\n return true;\n }\n\n /**\n * Returns the message that corresponds to errorNumber\n * APIs that inherit BaseAPI should override this function\n *\n * @param {(string|number)} _errorNumber\n * @param {boolean} _detail\n * @return {string}\n * @abstract\n */\n getLmsErrorMessageDetails(\n _errorNumber: string | number,\n _detail: boolean = false,\n ): string {\n throw new Error(\n \"The getLmsErrorMessageDetails method has not been implemented\",\n );\n }\n\n /**\n * Gets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @return {string}\n * @abstract\n */\n getCMIValue(_CMIElement: string): string {\n throw new Error(\"The getCMIValue method has not been implemented\");\n }\n\n /**\n * Sets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @param {any} _value\n * @return {string}\n * @abstract\n */\n setCMIValue(_CMIElement: string, _value: any): string {\n throw new Error(\"The setCMIValue method has not been implemented\");\n }\n\n /**\n * Shared API method to set a valid for a given element.\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n _commonSetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (!CMIElement || CMIElement === \"\") {\n return APIConstants.global.SCORM_FALSE;\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let returnValue = APIConstants.global.SCORM_FALSE;\n let foundFirstIndex = false;\n\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n const attribute = structure[idx];\n\n if (idx === structure.length - 1) {\n if (scorm2004 && attribute.substring(0, 8) === \"{target=\") {\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);\n } else {\n refObject = {\n ...refObject,\n attribute: value,\n };\n }\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (\n stringMatches(CMIElement, \"\\\\.correct_responses\\\\.\\\\d+\") &&\n this.isInitialized()\n ) {\n this.validateCorrectResponse(CMIElement, value);\n }\n\n if (!scorm2004 || this.lastErrorCode === \"0\") {\n refObject[attribute] = value;\n returnValue = APIConstants.global.SCORM_TRUE;\n }\n }\n } else {\n refObject = refObject[attribute];\n if (!refObject) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n foundFirstIndex = true;\n } else {\n const newChild = this.getChildElement(\n CMIElement,\n value,\n foundFirstIndex,\n );\n foundFirstIndex = true;\n\n if (!newChild) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (refObject.initialized) newChild.initialize();\n\n refObject.childArray.push(newChild);\n refObject = newChild;\n }\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n }\n\n if (returnValue === APIConstants.global.SCORM_FALSE) {\n this.apiLog(\n methodName,\n `There was an error setting the value for: ${CMIElement}, value of: ${value}`,\n APIConstants.global.LOG_LEVEL_WARNING,\n );\n }\n\n return returnValue;\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @return {any}\n */\n _commonGetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n ): any {\n if (!CMIElement || CMIElement === \"\") {\n return \"\";\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let attribute = null;\n\n const uninitializedErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) has not been initialized.`;\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n attribute = structure[idx];\n\n if (!scorm2004) {\n if (idx === structure.length - 1) {\n if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n } else {\n if (\n String(attribute).substring(0, 8) === \"{target=\" &&\n typeof refObject._isTargetValid == \"function\"\n ) {\n const target = String(attribute).substring(\n 8,\n String(attribute).length - 9,\n );\n return refObject._isTargetValid(target);\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n\n refObject = refObject[attribute];\n if (refObject === undefined) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n } else {\n this.throwSCORMError(\n this._error_codes.VALUE_NOT_INITIALIZED,\n uninitializedErrorMessage,\n );\n break;\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n\n if (refObject === null || refObject === undefined) {\n if (!scorm2004) {\n if (attribute === \"_children\") {\n this.throwSCORMError(ErrorCodes.scorm12.CHILDREN_ERROR);\n } else if (attribute === \"_count\") {\n this.throwSCORMError(ErrorCodes.scorm12.COUNT_ERROR);\n }\n }\n } else {\n return refObject;\n }\n }\n\n /**\n * Returns true if the API's current state is STATE_INITIALIZED\n *\n * @return {boolean}\n */\n isInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_NOT_INITIALIZED\n *\n * @return {boolean}\n */\n isNotInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_NOT_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_TERMINATED\n *\n * @return {boolean}\n */\n isTerminated(): boolean {\n return this.currentState === APIConstants.global.STATE_TERMINATED;\n }\n\n /**\n * Provides a mechanism for attaching to a specific SCORM event\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n on(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray.push({\n functionName: functionName,\n CMIElement: CMIElement,\n callback: callback,\n });\n\n this.apiLog(\n \"on\",\n `Added event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n\n /**\n * Provides a mechanism for detaching a specific SCORM event listener\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n off(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n const removeIndex = this.listenerArray.findIndex(\n (obj) =>\n obj.functionName === functionName &&\n obj.CMIElement === CMIElement &&\n obj.callback === callback,\n );\n if (removeIndex !== -1) {\n this.listenerArray.splice(removeIndex, 1);\n this.apiLog(\n \"off\",\n `Removed event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n }\n\n /**\n * Provides a mechanism for clearing all listeners from a specific SCORM event\n *\n * @param {string} listenerName\n */\n clear(listenerName: string) {\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray = this.listenerArray.filter(\n (obj) =>\n obj.functionName !== functionName && obj.CMIElement !== CMIElement,\n );\n }\n }\n\n /**\n * Processes any 'on' listeners that have been created\n *\n * @param {string} functionName\n * @param {string} CMIElement\n * @param {any} value\n */\n processListeners(functionName: string, CMIElement?: string, value?: any) {\n this.apiLog(\n functionName,\n value,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n for (let i = 0; i < this.listenerArray.length; i++) {\n const listener = this.listenerArray[i];\n const functionsMatch = listener.functionName === functionName;\n const listenerHasCMIElement = !!listener.CMIElement;\n let CMIElementsMatch = false;\n if (\n CMIElement &&\n listener.CMIElement &&\n listener.CMIElement.substring(listener.CMIElement.length - 1) === \"*\"\n ) {\n CMIElementsMatch =\n CMIElement.indexOf(\n listener.CMIElement.substring(0, listener.CMIElement.length - 1),\n ) === 0;\n } else {\n CMIElementsMatch = listener.CMIElement === CMIElement;\n }\n\n if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {\n this.apiLog(\n \"processListeners\",\n `Processing listener: ${listener.functionName}`,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n listener.callback(CMIElement, value);\n }\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} errorNumber\n * @param {string} message\n */\n throwSCORMError(errorNumber: number, message?: string) {\n if (!message) {\n message = this.getLmsErrorMessageDetails(errorNumber);\n }\n\n this.apiLog(\n \"throwSCORMError\",\n errorNumber + \": \" + message,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n\n this.lastErrorCode = String(errorNumber);\n }\n\n /**\n * Clears the last SCORM error code on success.\n *\n * @param {string} success\n */\n clearSCORMError(success: string) {\n if (success !== undefined && success !== APIConstants.global.SCORM_FALSE) {\n this.lastErrorCode = \"0\";\n }\n }\n\n /**\n * Load the CMI from a flattened JSON object\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromFlattenedJSON(json: RefObject, CMIElement?: string) {\n if (!CMIElement) {\n // by default, we start from a blank string because we're expecting each element to start with `cmi`\n CMIElement = \"\";\n }\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromFlattenedJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n /**\n * Tests two strings against a given regular expression pattern and determines a numeric or null result based on the matching criterion.\n *\n * @param {string} a - The first string to be tested against the pattern.\n * @param {string} c - The second string to be tested against the pattern.\n * @param {RegExp} a_pattern - The regular expression pattern to test the strings against.\n * @return {number | null} A numeric result based on the matching criterion, or null if the strings do not match the pattern.\n */\n function testPattern(\n a: string,\n c: string,\n a_pattern: RegExp,\n ): number | null {\n const a_match = a.match(a_pattern);\n\n let c_match;\n if (a_match !== null && (c_match = c.match(a_pattern)) !== null) {\n const a_num = Number(a_match[2]);\n const c_num = Number(c_match[2]);\n if (a_num === c_num) {\n if (a_match[3] === \"id\") {\n return -1;\n } else if (a_match[3] === \"type\") {\n if (c_match[3] === \"id\") {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 1;\n }\n }\n return a_num - c_num;\n }\n\n return null;\n }\n\n const int_pattern = /^(cmi\\.interactions\\.)(\\d+)\\.(.*)$/;\n const obj_pattern = /^(cmi\\.objectives\\.)(\\d+)\\.(.*)$/;\n\n const result = Object.keys(json).map(function (key) {\n return [String(key), json[key]];\n });\n\n // CMI interactions need to have id and type loaded before any other fields\n result.sort(function ([a, _b], [c, _d]) {\n let test;\n if ((test = testPattern(a, c, int_pattern)) !== null) {\n return test;\n }\n if ((test = testPattern(a, c, obj_pattern)) !== null) {\n return test;\n }\n\n if (a < c) {\n return -1;\n }\n if (a > c) {\n return 1;\n }\n return 0;\n });\n\n let obj: RefObject;\n result.forEach((element) => {\n obj = {};\n obj[element[0]] = element[1];\n this.loadFromJSON(unflatten(obj), CMIElement);\n });\n }\n\n /**\n * Loads CMI data from a JSON object.\n *\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromJSON(json: RefObject, CMIElement: string) {\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n CMIElement = CMIElement !== undefined ? CMIElement : \"cmi\";\n\n this.startingData = json;\n\n // could this be refactored down to flatten(json) then setCMIValue on each?\n for (const key in json) {\n if ({}.hasOwnProperty.call(json, key) && json[key]) {\n const currentCMIElement = (CMIElement ? CMIElement + \".\" : \"\") + key;\n const value = json[key];\n\n if (value[\"childArray\"]) {\n for (let i = 0; i < value[\"childArray\"].length; i++) {\n this.loadFromJSON(\n value[\"childArray\"][i],\n currentCMIElement + \".\" + i,\n );\n }\n } else if (value.constructor === Object) {\n this.loadFromJSON(value, currentCMIElement);\n } else {\n this.setCMIValue(currentCMIElement, value);\n }\n }\n }\n }\n\n /**\n * Render the CMI object to JSON for sending to an LMS.\n *\n * @return {string}\n */\n renderCMIToJSONString(): string {\n const cmi = this.cmi;\n // Do we want/need to return fields that have no set value?\n if (this.settings.sendFullCommit) {\n return JSON.stringify({ cmi });\n }\n return JSON.stringify({ cmi }, (k, v) => (v === undefined ? null : v), 2);\n }\n\n /**\n * Returns a JS object representing the current cmi\n * @return {object}\n */\n renderCMIToJSONObject(): object {\n return JSON.parse(this.renderCMIToJSONString());\n }\n\n /**\n * Send the request to the LMS\n * @param {string} url\n * @param {CommitObject|RefObject|Array} params\n * @param {boolean} immediate\n * @return {ResultObject}\n */\n async processHttpRequest(\n url: string,\n params: CommitObject | RefObject | Array,\n immediate: boolean = false,\n ): Promise {\n const api = this;\n const genericError: ResultObject = {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: this.error_codes.GENERAL,\n };\n\n // if we are terminating the module or closing the browser window/tab, we need to make this fetch ASAP.\n // Some browsers, especially Chrome, do not like synchronous requests to be made when the window is closing.\n if (immediate) {\n this.performFetch(url, params).then(async (response) => {\n await this.transformResponse(response);\n });\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n\n const process = async (\n url: string,\n params: CommitObject | RefObject | Array,\n settings: Settings,\n ): Promise => {\n try {\n params = settings.requestHandler(params);\n const response = await this.performFetch(url, params);\n\n return this.transformResponse(response);\n } catch (e) {\n this.apiLog(\n \"processHttpRequest\",\n e,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n api.processListeners(\"CommitError\");\n return genericError;\n }\n };\n\n if (this.settings.asyncCommit) {\n const debouncedProcess = debounce(process, 500, immediate);\n debouncedProcess(url, params, this.settings);\n\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return await process(url, params, this.settings);\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} when - the number of milliseconds to wait before committing\n * @param {string} callback - the name of the commit event callback\n */\n scheduleCommit(when: number, callback: string) {\n this._timeout = new ScheduledCommit(this, when, callback);\n this.apiLog(\n \"scheduleCommit\",\n \"scheduled\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n\n /**\n * Clears and cancels any currently scheduled commits\n */\n clearScheduledCommit() {\n if (this._timeout) {\n this._timeout.cancel();\n this._timeout = undefined;\n this.apiLog(\n \"clearScheduledCommit\",\n \"cleared\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n }\n\n /**\n * Check to see if the specific object has the given property\n * @param {RefObject} refObject\n * @param {string} attribute\n * @return {boolean}\n * @private\n */\n private _checkObjectHasProperty(\n refObject: RefObject,\n attribute: string,\n ): boolean {\n return (\n Object.hasOwnProperty.call(refObject, attribute) ||\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(refObject),\n attribute,\n ) != null ||\n attribute in refObject\n );\n }\n\n /**\n * Handles the error that occurs when trying to access a value\n * @param {any} e\n * @param {string} returnValue\n * @return {string}\n * @private\n */\n private handleValueAccessException(e: any, returnValue: string): string {\n if (e instanceof ValidationError) {\n this.lastErrorCode = String(e.errorCode);\n returnValue = APIConstants.global.SCORM_FALSE;\n } else {\n if (e instanceof Error && e.message) {\n console.error(e.message);\n } else {\n console.error(e);\n }\n this.throwSCORMError(this._error_codes.GENERAL);\n }\n return returnValue;\n }\n\n /**\n * Perform the fetch request to the LMS\n * @param {string} url\n * @param {RefObject|Array} params\n * @return {Promise}\n * @private\n */\n private async performFetch(\n url: string,\n params: RefObject | Array,\n ): Promise {\n return fetch(url, {\n method: \"POST\",\n body: params instanceof Array ? params.join(\"&\") : JSON.stringify(params),\n headers: {\n ...this.settings.xhrHeaders,\n \"Content-Type\": this.settings.commitRequestDataType,\n },\n credentials: this.settings.xhrWithCredentials ? \"include\" : undefined,\n keepalive: true,\n });\n }\n\n /**\n * Transforms the response from the LMS to a ResultObject\n * @param {Response} response\n * @return {Promise}\n * @private\n */\n private async transformResponse(response: Response): Promise {\n const result =\n typeof this.settings.responseHandler === \"function\"\n ? await this.settings.responseHandler(response)\n : await response.json();\n\n if (\n response.status >= 200 &&\n response.status <= 299 &&\n (result.result === true ||\n result.result === APIConstants.global.SCORM_TRUE)\n ) {\n this.processListeners(\"CommitSuccess\");\n } else {\n this.processListeners(\"CommitError\");\n }\n return result;\n }\n}\n","import { BaseCMI } from \"./base_cmi\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.n objects\n */\nexport class CMIArray extends BaseCMI {\n private readonly _errorCode: number;\n private readonly _errorClass: typeof BaseScormValidationError;\n private readonly __children: string;\n childArray: any[];\n\n /**\n * Constructor cmi *.n arrays\n * @param {object} params\n */\n constructor(params: {\n children: string;\n errorCode?: number;\n errorClass?: typeof BaseScormValidationError;\n }) {\n super();\n this.__children = params.children;\n this._errorCode = params.errorCode || scorm12_error_codes.GENERAL;\n this._errorClass = params.errorClass || BaseScormValidationError;\n this.childArray = [];\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * Getter for _count\n * @return {number}\n */\n get _count(): number {\n return this.childArray.length;\n }\n\n /**\n * Setter for _count. Just throws an error.\n * @param {number} _count\n */\n set _count(_count: number) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * toJSON for *.n arrays\n * @return {object}\n */\n toJSON(): object {\n this.jsonString = true;\n const result: { [key: string]: any } = {};\n for (let i = 0; i < this.childArray.length; i++) {\n result[i + \"\"] = this.childArray[i];\n }\n delete this.jsonString;\n return result;\n }\n}\n","/**\n * Base class for API cmi objects\n */\nexport abstract class BaseCMI {\n jsonString? = false;\n private _initialized = false;\n private _start_time: number | undefined;\n\n /**\n * Getter for _initialized\n * @return {boolean}\n */\n get initialized(): boolean {\n return this._initialized;\n }\n\n /**\n * Getter for _start_time\n * @return {number | undefined}\n */\n get start_time(): number | undefined {\n return this._start_time;\n }\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize(): void {\n this._initialized = true;\n }\n\n /**\n * Called when the player should override the 'session_time' provided by\n * the module\n */\n setStartTime(): void {\n this._start_time = new Date().getTime();\n }\n}\n\n/**\n * Base class for cmi root objects\n */\nexport abstract class BaseRootCMI extends BaseCMI {\n abstract getCurrentTotalTime(): string;\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport { BaseCMI } from \"./base_cmi\";\nimport { checkValidFormat, checkValidRange } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nconst scorm12_constants = APIConstants.scorm12;\nconst scorm12_regex = Regex.scorm12;\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.score objects\n */\nexport class CMIScore extends BaseCMI {\n private readonly __children: string;\n private readonly __score_range: string | false;\n private readonly __invalid_error_code: number;\n private readonly __invalid_type_code: number;\n private readonly __invalid_range_code: number;\n private readonly __decimal_regex: string;\n private readonly __error_class: typeof BaseScormValidationError;\n private _raw = \"\";\n private _min = \"\";\n private _max: string;\n\n /**\n * Constructor for *.score\n * @param {\n * score_children: string,\n * score_range: string,\n * max: string,\n * invalidErrorCode: number,\n * invalidTypeCode: number,\n * invalidRangeCode: number,\n * decimalRegex: string,\n * errorClass: typeof BaseScormValidationError\n * } params\n */\n constructor(params: {\n score_children?: string;\n score_range?: string;\n max?: string;\n invalidErrorCode?: number;\n invalidTypeCode?: number;\n invalidRangeCode?: number;\n decimalRegex?: string;\n errorClass: typeof BaseScormValidationError;\n }) {\n super();\n\n this.__children = params.score_children || scorm12_constants.score_children;\n this.__score_range = !params.score_range\n ? false\n : scorm12_regex.score_range;\n this._max = params.max || params.max === \"\" ? params.max : \"100\";\n this.__invalid_error_code =\n params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE;\n this.__invalid_type_code =\n params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH;\n this.__invalid_range_code =\n params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE;\n this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;\n this.__error_class = params.errorClass;\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this.__error_class(this.__invalid_error_code);\n }\n\n /**\n * Getter for _raw\n * @return {string}\n */\n get raw(): string {\n return this._raw;\n }\n\n /**\n * Setter for _raw\n * @param {string} raw\n */\n set raw(raw: string) {\n if (\n checkValidFormat(\n raw,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n raw,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._raw = raw;\n }\n }\n\n /**\n * Getter for _min\n * @return {string}\n */\n get min(): string {\n return this._min;\n }\n\n /**\n * Setter for _min\n * @param {string} min\n */\n set min(min: string) {\n if (\n checkValidFormat(\n min,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n min,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._min = min;\n }\n }\n\n /**\n * Getter for _max\n * @return {string}\n */\n get max(): string {\n return this._max;\n }\n\n /**\n * Setter for _max\n * @param {string} max\n */\n set max(max: string) {\n if (\n checkValidFormat(\n max,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n max,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._max = max;\n }\n }\n\n /**\n * toJSON for *.score\n * @return {\n * {\n * min: string,\n * max: string,\n * raw: string\n * }\n * }\n */\n toJSON(): {\n min: string;\n max: string;\n raw: string;\n } {\n this.jsonString = true;\n const result = {\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseScormValidationError } from \"../../exceptions\";\n\n/**\n * Check if the value matches the proper format. If not, throw proper error code.\n *\n * @param {string} value\n * @param {string} regexPattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @param {boolean} [allowEmptyString]\n * @return {boolean}\n */\nexport function checkValidFormat(\n value: string,\n regexPattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n allowEmptyString?: boolean,\n): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n const formatRegex = new RegExp(regexPattern);\n const matches = value.match(formatRegex);\n if (allowEmptyString && value === \"\") {\n return true;\n }\n if (value === undefined || !matches || matches[0] === \"\") {\n throw new errorClass(errorCode);\n }\n return true;\n}\n\n/**\n * Check if the value matches the proper range. If not, throw proper error code.\n *\n * @param {any} value\n * @param {string} rangePattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @return {boolean}\n */\nexport function checkValidRange(\n value: any,\n rangePattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n): boolean {\n const ranges = rangePattern.split(\"#\");\n value = value * 1.0;\n if (value >= ranges[0]) {\n if (ranges[1] === \"*\" || value <= ranges[1]) {\n return true;\n } else {\n throw new errorClass(errorCode);\n }\n } else {\n throw new errorClass(errorCode);\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { check12ValidFormat } from \"../scorm12/validation\";\nimport * as Util from \"../../utilities\";\n\n/**\n * Class representing the `cmi.core` object\n * @extends BaseCMI\n */\nexport class CMICore extends BaseCMI {\n /**\n * Constructor for `cmi.core`\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private __children = APIConstants.scorm12.core_children;\n private _student_id = \"\";\n private _student_name = \"\";\n private _lesson_location = \"\";\n private _credit = \"\";\n private _lesson_status = \"not attempted\";\n private _entry = \"\";\n private _total_time = \"\";\n private _lesson_mode = \"normal\";\n private _exit = \"\";\n private _session_time = \"00:00:00\";\n private _suspend_data = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _student_id\n * @return {string}\n */\n get student_id(): string {\n return this._student_id;\n }\n\n /**\n * Setter for _student_id. Can only be called before initialization.\n * @param {string} student_id\n */\n set student_id(student_id: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_id = student_id;\n }\n }\n\n /**\n * Getter for _student_name\n * @return {string}\n */\n get student_name(): string {\n return this._student_name;\n }\n\n /**\n * Setter for _student_name. Can only be called before initialization.\n * @param {string} student_name\n */\n set student_name(student_name: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_name = student_name;\n }\n }\n\n /**\n * Getter for _lesson_location\n * @return {string}\n */\n get lesson_location(): string {\n return this._lesson_location;\n }\n\n /**\n * Setter for _lesson_location\n * @param {string} lesson_location\n */\n set lesson_location(lesson_location: string) {\n if (check12ValidFormat(lesson_location, Regex.scorm12.CMIString256, true)) {\n this._lesson_location = lesson_location;\n }\n }\n\n /**\n * Getter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (this.initialized) {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus)) {\n this._lesson_status = lesson_status;\n }\n } else {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Getter for _lesson_mode\n * @return {string}\n */\n get lesson_mode(): string {\n return this._lesson_mode;\n }\n\n /**\n * Setter for _lesson_mode. Can only be called before initialization.\n * @param {string} lesson_mode\n */\n set lesson_mode(lesson_mode: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._lesson_mode = lesson_mode;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._exit;\n }\n\n /**\n * Setter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check12ValidFormat(exit, Regex.scorm12.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check12ValidFormat(session_time, Regex.scorm12.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (check12ValidFormat(suspend_data, Regex.scorm12.CMIString4096, true)) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n * @param {number} start_time\n * @return {string}\n */\n getCurrentTotalTime(start_time: number | undefined): string {\n let sessionTime = this._session_time;\n const startTime = start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsHHMMSS(seconds / 1000);\n }\n\n return Util.addHHMMSSTimeStrings(\n this._total_time,\n sessionTime,\n new RegExp(Regex.scorm12.CMITimespan),\n );\n }\n\n /**\n * toJSON for cmi.core\n *\n * @return {\n * {\n * student_name: string,\n * entry: string,\n * exit: string,\n * score: CMIScore,\n * student_id: string,\n * lesson_mode: string,\n * lesson_location: string,\n * lesson_status: string,\n * credit: string,\n * session_time: string\n * }\n * }\n */\n toJSON(): {\n student_name: string;\n entry: string;\n exit: string;\n score: CMIScore;\n student_id: string;\n lesson_mode: string;\n lesson_location: string;\n lesson_status: string;\n credit: string;\n session_time: string;\n } {\n this.jsonString = true;\n const result = {\n student_id: this.student_id,\n student_name: this.student_name,\n lesson_location: this.lesson_location,\n credit: this.credit,\n lesson_status: this.lesson_status,\n entry: this.entry,\n lesson_mode: this.lesson_mode,\n exit: this.exit,\n session_time: this.session_time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat } from \"./validation\";\nimport { CMICore } from \"../aicc/core\";\nimport { CMIObjectives } from \"./objectives\";\nimport { CMIStudentData } from \"./student_data\";\nimport { CMIStudentPreference } from \"./student_preference\";\nimport { CMIInteractions } from \"./interactions\";\n\n/**\n * Class representing the cmi object for SCORM 1.2\n */\nexport class CMI extends BaseRootCMI {\n private readonly __children: string = \"\";\n private __version: string = \"3.4\";\n private _launch_data: string = \"\";\n private _comments: string = \"\";\n private _comments_from_lms: string = \"\";\n\n /**\n * Constructor for the SCORM 1.2 cmi object\n * @param {string} cmi_children\n * @param {(CMIStudentData|AICCCMIStudentData)} student_data\n * @param {boolean} initialized\n */\n constructor(\n cmi_children?: string,\n student_data?: CMIStudentData,\n initialized?: boolean,\n ) {\n super();\n if (initialized) this.initialize();\n this.__children = cmi_children\n ? cmi_children\n : APIConstants.scorm12.cmi_children;\n this.core = new CMICore();\n this.objectives = new CMIObjectives();\n this.student_data = student_data ? student_data : new CMIStudentData();\n this.student_preference = new CMIStudentPreference();\n this.interactions = new CMIInteractions();\n }\n\n public core: CMICore;\n public objectives: CMIObjectives;\n public student_data: CMIStudentData;\n public student_preference: CMIStudentPreference;\n public interactions: CMIInteractions;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.core?.initialize();\n this.objectives?.initialize();\n this.student_data?.initialize();\n this.student_preference?.initialize();\n this.interactions?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n interactions: CMIInteractions;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n interactions: this.interactions,\n };\n delete this.jsonString;\n return result;\n }\n\n /**\n * Getter for __version\n * @return {string}\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n */\n set _version(_version: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for __children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this.core?.suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (this.core) {\n this.core.suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _comments\n * @return {string}\n */\n get comments(): string {\n return this._comments;\n }\n\n /**\n * Setter for _comments\n * @param {string} comments\n */\n set comments(comments: string) {\n if (check12ValidFormat(comments, Regex.scorm12.CMIString4096, true)) {\n this._comments = comments;\n }\n }\n\n /**\n * Getter for _comments_from_lms\n * @return {string}\n */\n get comments_from_lms(): string {\n return this._comments_from_lms;\n }\n\n /**\n * Setter for _comments_from_lms. Can only be called before initialization.\n * @param {string} comments_from_lms\n */\n set comments_from_lms(comments_from_lms: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._comments_from_lms = comments_from_lms;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string}\n */\n getCurrentTotalTime(): string {\n return this.core.getCurrentTotalTime(this.start_time);\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 `cmi.interactions`\n * @extends CMIArray\n */\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.interactions`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.interactions_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n object\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.correct_responses_children,\n });\n }\n\n public readonly objectives: CMIArray;\n public readonly correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n private _id = \"\";\n private _time = \"\";\n private _type = \"\";\n private _weighting = \"\";\n private _student_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n\n /**\n * Getter for _id. Should only be called during JSON export.\n * @return {string}\n */\n get id(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _time. Should only be called during JSON export.\n * @return {string}\n */\n get time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (check12ValidFormat(time, Regex.scorm12.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _type. Should only be called during JSON export.\n * @return {string}\n */\n get type(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (check12ValidFormat(type, Regex.scorm12.CMIType)) {\n this._type = type;\n }\n }\n\n /**\n * Getter for _weighting. Should only be called during JSON export.\n * @return {string}\n */\n get weighting(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (\n check12ValidFormat(weighting, Regex.scorm12.CMIDecimal) &&\n check12ValidRange(weighting, Regex.scorm12.weighting_range)\n ) {\n this._weighting = weighting;\n }\n }\n\n /**\n * Getter for _student_response. Should only be called during JSON export.\n * @return {string}\n */\n get student_response(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._student_response;\n }\n\n /**\n * Setter for _student_response\n * @param {string} student_response\n */\n set student_response(student_response: string) {\n if (check12ValidFormat(student_response, Regex.scorm12.CMIFeedback, true)) {\n this._student_response = student_response;\n }\n }\n\n /**\n * Getter for _result. Should only be called during JSON export.\n * @return {string}\n */\n get result(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check12ValidFormat(result, Regex.scorm12.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency. Should only be called during JSON export.\n * @return {string}\n */\n get latency(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (check12ValidFormat(latency, Regex.scorm12.CMITimespan)) {\n this._latency = latency;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * time: string,\n * type: string,\n * weighting: string,\n * student_response: string,\n * result: string,\n * latency: string,\n * objectives: CMIArray,\n * correct_responses: CMIArray\n * }\n * }\n */\n toJSON(): {\n id: string;\n time: string;\n type: string;\n weighting: string;\n student_response: string;\n result: string;\n latency: string;\n objectives: CMIArray;\n correct_responses: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n time: this.time,\n type: this.type,\n weighting: this.weighting,\n student_response: this.student_response,\n result: this.result,\n latency: this.latency,\n objectives: this.objectives,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n private _id = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.correct_responses.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.correct_responses.n\n */\n constructor() {\n super();\n }\n\n private _pattern = \"\";\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check12ValidFormat(pattern, Regex.scorm12.CMIFeedback, true)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON for cmi.interactions.correct_responses.n\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this._pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {BaseCMI} from \"../common/base_cmi\";\nimport {check12ValidFormat} from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class for AICC Navigation object\n */\nexport class NAV extends BaseCMI {\n /**\n * Constructor for NAV object\n */\n constructor() {\n super();\n }\n\n private _event = \"\";\n\n /**\n * Getter for _event\n * @return {string}\n */\n get event(): string {\n return this._event;\n }\n\n /**\n * Setter for _event\n * @param {string} event\n */\n set event(event: string) {\n if (check12ValidFormat(event, Regex.scorm12.NAVEvent)) {\n this._event = event;\n }\n }\n\n /**\n * toJSON for nav object\n * @return {\n * {\n * event: string\n * }\n * }\n */\n toJSON(): {\n event: string;\n } {\n this.jsonString = true;\n const result = {\n event: this.event,\n };\n delete this.jsonString;\n return result;\n }\n}","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\nimport {check12ValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class representing SCORM 1.2's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.objectives_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n private _id = \"\";\n private _status = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (check12ValidFormat(status, Regex.scorm12.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n * @return {\n * {\n * id: string,\n * status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n status: this.status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_data object\n * @extends BaseCMI\n */\nexport class CMIStudentData extends BaseCMI {\n private readonly __children;\n private _mastery_score = \"\";\n private _max_time_allowed = \"\";\n private _time_limit_action = \"\";\n\n /**\n * Constructor for cmi.student_data\n * @param {string} student_data_children\n */\n constructor(student_data_children?: string) {\n super();\n this.__children = student_data_children\n ? student_data_children\n : APIConstants.scorm12.student_data_children;\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _master_score\n * @return {string}\n */\n get mastery_score(): string {\n return this._mastery_score;\n }\n\n /**\n * Setter for _master_score. Can only be called before initialization.\n * @param {string} mastery_score\n */\n set mastery_score(mastery_score: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._mastery_score = mastery_score;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * toJSON for cmi.student_data\n *\n * @return {\n * {\n * max_time_allowed: string,\n * time_limit_action: string,\n * mastery_score: string\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_preference object\n * @extends BaseCMI\n */\nexport class CMIStudentPreference extends BaseCMI {\n private readonly __children;\n\n /**\n * Constructor for cmi.student_preference\n * @param {string} student_preference_children\n */\n constructor(student_preference_children?: string) {\n super();\n this.__children = student_preference_children\n ? student_preference_children\n : APIConstants.scorm12.student_preference_children;\n }\n\n private _audio = \"\";\n private _language = \"\";\n private _speed = \"\";\n private _text = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _audio\n * @return {string}\n */\n get audio(): string {\n return this._audio;\n }\n\n /**\n * Setter for _audio\n * @param {string} audio\n */\n set audio(audio: string) {\n if (\n check12ValidFormat(audio, Regex.scorm12.CMISInteger) &&\n check12ValidRange(audio, Regex.scorm12.audio_range)\n ) {\n this._audio = audio;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check12ValidFormat(language, Regex.scorm12.CMIString256)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _speed\n * @return {string}\n */\n get speed(): string {\n return this._speed;\n }\n\n /**\n * Setter for _speed\n * @param {string} speed\n */\n set speed(speed: string) {\n if (\n check12ValidFormat(speed, Regex.scorm12.CMISInteger) &&\n check12ValidRange(speed, Regex.scorm12.speed_range)\n ) {\n this._speed = speed;\n }\n }\n\n /**\n * Getter for _text\n * @return {string}\n */\n get text(): string {\n return this._text;\n }\n\n /**\n * Setter for _text\n * @param {string} text\n */\n set text(text: string) {\n if (\n check12ValidFormat(text, Regex.scorm12.CMISInteger) &&\n check12ValidRange(text, Regex.scorm12.text_range)\n ) {\n this._text = text;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n speed: string;\n text: string;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n speed: this.speed,\n text: this.text,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {checkValidFormat, checkValidRange} from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm12.TYPE_MISMATCH,\n Scorm12ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidRange(\n value: any,\n rangePattern: string,\n allowEmptyString?: boolean,\n): boolean {\n if (!allowEmptyString && value === \"\") {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.VALUE_OUT_OF_RANGE);\n }\n\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n Scorm12ValidationError,\n );\n}","interface ErrorDescription {\n basicMessage: string;\n detailMessage: string;\n}\n\ninterface ErrorDescriptions {\n [key: string]: ErrorDescription;\n}\n\ninterface ScormConstants {\n cmi_children: string;\n core_children: string;\n score_children: string;\n comments_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface AiccConstants extends ScormConstants {\n student_demographics_children: string;\n tries_children: string;\n attempt_records_children: string;\n paths_children: string;\n}\n\ninterface Scorm2004Constants {\n cmi_children: string;\n comments_children: string;\n score_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface GlobalConstants {\n SCORM_TRUE: string;\n SCORM_FALSE: string;\n STATE_NOT_INITIALIZED: number;\n STATE_INITIALIZED: number;\n STATE_TERMINATED: number;\n LOG_LEVEL_DEBUG: number;\n LOG_LEVEL_INFO: number;\n LOG_LEVEL_WARNING: number;\n LOG_LEVEL_ERROR: number;\n LOG_LEVEL_NONE: number;\n}\n\ninterface APIConstants {\n global: GlobalConstants;\n scorm12: ScormConstants;\n aicc: AiccConstants;\n scorm2004: Scorm2004Constants;\n}\n\nconst global: GlobalConstants = {\n SCORM_TRUE: \"true\",\n SCORM_FALSE: \"false\",\n STATE_NOT_INITIALIZED: 0,\n STATE_INITIALIZED: 1,\n STATE_TERMINATED: 2,\n LOG_LEVEL_DEBUG: 1,\n LOG_LEVEL_INFO: 2,\n LOG_LEVEL_WARNING: 3,\n LOG_LEVEL_ERROR: 4,\n LOG_LEVEL_NONE: 5,\n};\n\nconst scorm12: ScormConstants = {\n // Children lists\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions\",\n core_children:\n \"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time\",\n score_children: \"raw,min,max\",\n comments_children: \"content,location,time\",\n objectives_children: \"id,score,status\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children: \"audio,language,speed,text\",\n interactions_children:\n \"id,objectives,time,type,correct_responses,weighting,student_response,result,latency\",\n error_descriptions: {\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information\",\n },\n \"201\": {\n basicMessage: \"Invalid argument error\",\n detailMessage:\n \"Indicates that an argument represents an invalid data model element or is otherwise incorrect.\",\n },\n \"202\": {\n basicMessage: \"Element cannot have children\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_children\" for a data model element that does not support the \"_children\" suffix.',\n },\n \"203\": {\n basicMessage: \"Element not an array - cannot have count\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_count\" for a data model element that does not support the \"_count\" suffix.',\n },\n \"301\": {\n basicMessage: \"Not initialized\",\n detailMessage:\n \"Indicates that an API call was made before the call to lmsInitialize.\",\n },\n \"401\": {\n basicMessage: \"Not implemented error\",\n detailMessage:\n \"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.\",\n },\n \"402\": {\n basicMessage: \"Invalid set value, element is a keyword\",\n detailMessage:\n 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in \"_children\" and \"_count\").',\n },\n \"403\": {\n basicMessage: \"Element is read only\",\n detailMessage:\n \"LMSSetValue was called with a data model element that can only be read.\",\n },\n \"404\": {\n basicMessage: \"Element is write only\",\n detailMessage:\n \"LMSGetValue was called on a data model element that can only be written to.\",\n },\n \"405\": {\n basicMessage: \"Incorrect Data Type\",\n detailMessage:\n \"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst aicc: AiccConstants = {\n ...scorm12,\n ...{\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation\",\n student_preference_children:\n \"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows\",\n student_data_children:\n \"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action\",\n student_demographics_children:\n \"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience\",\n tries_children: \"time,status,score\",\n attempt_records_children: \"score,lesson_status\",\n paths_children: \"location_id,date,time,status,why_left,time_in_element\",\n },\n};\nconst scorm2004: Scorm2004Constants = {\n // Children lists\n cmi_children:\n \"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time\",\n comments_children: \"comment,timestamp,location\",\n score_children: \"max,raw,scaled,min\",\n objectives_children:\n \"progress_measure,completion_status,success_status,description,score,id\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children:\n \"audio_level,audio_captioning,delivery_speed,language\",\n interactions_children:\n \"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description\",\n error_descriptions: {\n \"0\": {\n basicMessage: \"No Error\",\n detailMessage: \"No error occurred, the previous API call was successful.\",\n },\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use GetDiagnostic for more information.\",\n },\n \"102\": {\n basicMessage: \"General Initialization Failure\",\n detailMessage: \"Call to Initialize failed for an unknown reason.\",\n },\n \"103\": {\n basicMessage: \"Already Initialized\",\n detailMessage:\n \"Call to Initialize failed because Initialize was already called.\",\n },\n \"104\": {\n basicMessage: \"Content Instance Terminated\",\n detailMessage:\n \"Call to Initialize failed because Terminate was already called.\",\n },\n \"111\": {\n basicMessage: \"General Termination Failure\",\n detailMessage: \"Call to Terminate failed for an unknown reason.\",\n },\n \"112\": {\n basicMessage: \"Termination Before Initialization\",\n detailMessage:\n \"Call to Terminate failed because it was made before the call to Initialize.\",\n },\n \"113\": {\n basicMessage: \"Termination After Termination\",\n detailMessage:\n \"Call to Terminate failed because Terminate was already called.\",\n },\n \"122\": {\n basicMessage: \"Retrieve Data Before Initialization\",\n detailMessage:\n \"Call to GetValue failed because it was made before the call to Initialize.\",\n },\n \"123\": {\n basicMessage: \"Retrieve Data After Termination\",\n detailMessage:\n \"Call to GetValue failed because it was made after the call to Terminate.\",\n },\n \"132\": {\n basicMessage: \"Store Data Before Initialization\",\n detailMessage:\n \"Call to SetValue failed because it was made before the call to Initialize.\",\n },\n \"133\": {\n basicMessage: \"Store Data After Termination\",\n detailMessage:\n \"Call to SetValue failed because it was made after the call to Terminate.\",\n },\n \"142\": {\n basicMessage: \"Commit Before Initialization\",\n detailMessage:\n \"Call to Commit failed because it was made before the call to Initialize.\",\n },\n \"143\": {\n basicMessage: \"Commit After Termination\",\n detailMessage:\n \"Call to Commit failed because it was made after the call to Terminate.\",\n },\n \"201\": {\n basicMessage: \"General Argument Error\",\n detailMessage:\n \"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.\",\n },\n \"301\": {\n basicMessage: \"General Get Failure\",\n detailMessage:\n \"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"351\": {\n basicMessage: \"General Set Failure\",\n detailMessage:\n \"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"391\": {\n basicMessage: \"General Commit Failure\",\n detailMessage:\n \"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"401\": {\n basicMessage: \"Undefined Data Model Element\",\n detailMessage:\n \"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.\",\n },\n \"402\": {\n basicMessage: \"Unimplemented Data Model Element\",\n detailMessage:\n \"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.\",\n },\n \"403\": {\n basicMessage: \"Data Model Element Value Not Initialized\",\n detailMessage:\n \"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.\",\n },\n \"404\": {\n basicMessage: \"Data Model Element Is Read Only\",\n detailMessage:\n \"SetValue was called with a data model element that can only be read.\",\n },\n \"405\": {\n basicMessage: \"Data Model Element Is Write Only\",\n detailMessage:\n \"GetValue was called on a data model element that can only be written to.\",\n },\n \"406\": {\n basicMessage: \"Data Model Element Type Mismatch\",\n detailMessage:\n \"SetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Data Model Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst APIConstants: APIConstants = {\n global: global,\n scorm12: scorm12,\n aicc: aicc,\n scorm2004: scorm2004,\n};\nexport default APIConstants;\n","export enum NAVBoolean {\n unknown = \"unknown\",\n true = \"true\",\n false = \"false\",\n}\n\nexport enum SuccessStatus {\n passed = \"passed\",\n failed = \"failed\",\n unknown = \"unknown\",\n}\n\nexport enum CompletionStatus {\n completed = \"completed\",\n incomplete = \"incomplete\",\n unknown = \"unknown\",\n}\n","export type ErrorCode = {\n [key: string]: number;\n};\n\nconst global: ErrorCode = {\n GENERAL: 101,\n INITIALIZATION_FAILED: 101,\n INITIALIZED: 101,\n TERMINATED: 101,\n TERMINATION_FAILURE: 101,\n TERMINATION_BEFORE_INIT: 101,\n MULTIPLE_TERMINATION: 101,\n RETRIEVE_BEFORE_INIT: 101,\n RETRIEVE_AFTER_TERM: 101,\n STORE_BEFORE_INIT: 101,\n STORE_AFTER_TERM: 101,\n COMMIT_BEFORE_INIT: 101,\n COMMIT_AFTER_TERM: 101,\n ARGUMENT_ERROR: 101,\n CHILDREN_ERROR: 101,\n COUNT_ERROR: 101,\n GENERAL_GET_FAILURE: 101,\n GENERAL_SET_FAILURE: 101,\n GENERAL_COMMIT_FAILURE: 101,\n UNDEFINED_DATA_MODEL: 101,\n UNIMPLEMENTED_ELEMENT: 101,\n VALUE_NOT_INITIALIZED: 101,\n INVALID_SET_VALUE: 101,\n READ_ONLY_ELEMENT: 101,\n WRITE_ONLY_ELEMENT: 101,\n TYPE_MISMATCH: 101,\n VALUE_OUT_OF_RANGE: 101,\n DEPENDENCY_NOT_ESTABLISHED: 101,\n};\n\nconst scorm12: ErrorCode = {\n ...global,\n RETRIEVE_BEFORE_INIT: 301,\n STORE_BEFORE_INIT: 301,\n COMMIT_BEFORE_INIT: 301,\n ARGUMENT_ERROR: 201,\n CHILDREN_ERROR: 202,\n COUNT_ERROR: 203,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 401,\n VALUE_NOT_INITIALIZED: 301,\n INVALID_SET_VALUE: 402,\n READ_ONLY_ELEMENT: 403,\n WRITE_ONLY_ELEMENT: 404,\n TYPE_MISMATCH: 405,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst scorm2004: ErrorCode = {\n ...global,\n INITIALIZATION_FAILED: 102,\n INITIALIZED: 103,\n TERMINATED: 104,\n TERMINATION_FAILURE: 111,\n TERMINATION_BEFORE_INIT: 112,\n MULTIPLE_TERMINATIONS: 113,\n RETRIEVE_BEFORE_INIT: 122,\n RETRIEVE_AFTER_TERM: 123,\n STORE_BEFORE_INIT: 132,\n STORE_AFTER_TERM: 133,\n COMMIT_BEFORE_INIT: 142,\n COMMIT_AFTER_TERM: 143,\n ARGUMENT_ERROR: 201,\n GENERAL_GET_FAILURE: 301,\n GENERAL_SET_FAILURE: 351,\n GENERAL_COMMIT_FAILURE: 391,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 402,\n VALUE_NOT_INITIALIZED: 403,\n READ_ONLY_ELEMENT: 404,\n WRITE_ONLY_ELEMENT: 405,\n TYPE_MISMATCH: 406,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst ErrorCodes = {\n scorm12,\n scorm2004,\n};\n\nexport default ErrorCodes;\n","const scorm12 = {\n CMIString256: \"^.{0,255}$\",\n CMIString4096: \"^.{0,4096}$\",\n CMITime: \"^(?:[01]\\\\d|2[0123]):(?:[012345]\\\\d):(?:[012345]\\\\d)$\",\n CMITimespan: \"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$\",\n\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{0,3})(.[0-9]*)?$\",\n\n CMIIdentifier: \"^[\\\\u0021-\\\\u007E\\\\s]{0,255}$\",\n CMIFeedback: \"^.{0,255}$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n // Vocabulary Data Type Definition\n CMIStatus: \"^(passed|completed|failed|incomplete|browsed)$\",\n CMIStatus2: \"^(passed|completed|failed|incomplete|browsed|not attempted)$\",\n CMIExit: \"^(time-out|suspend|logout|)$\",\n CMIType:\n \"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$\",\n CMIResult:\n \"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\\\.[0-9]*)?)$\",\n NAVEvent: \"^(previous|continue)$\",\n // Data ranges\n score_range: \"0#100\",\n audio_range: \"-1#100\",\n speed_range: \"-100#100\",\n weighting_range: \"-100#100\",\n text_range: \"-1#1\",\n};\nconst aicc = {\n ...scorm12,\n ...{\n CMIIdentifier: \"^\\\\w{1,255}$\",\n },\n};\nconst scorm2004 = {\n CMIString200: \"^[\\\\u0000-\\\\uFFFF]{0,200}$\",\n CMIString250: \"^[\\\\u0000-\\\\uFFFF]{0,250}$\",\n CMIString1000: \"^[\\\\u0000-\\\\uFFFF]{0,1000}$\",\n CMIString4000: \"^[\\\\u0000-\\\\uFFFF]{0,4000}$\",\n CMIString64000: \"^[\\\\u0000-\\\\uFFFF]{0,64000}$\",\n CMILang: \"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$\",\n\n CMILangString250:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$\",\n\n CMILangcr: \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$\",\n\n CMILangString250cr:\n \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$\",\n\n CMILangString4000:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$\",\n\n CMITime:\n \"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$\",\n CMITimespan:\n \"^P(?:([.,\\\\d]+)Y)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)W)?(?:([.,\\\\d]+)D)?(?:T?(?:([.,\\\\d]+)H)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)S)?)?$\",\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{1,5})(\\\\.[0-9]{1,18})?$\",\n CMIIdentifier: \"^\\\\S{1,250}[a-zA-Z0-9]$\",\n CMIShortIdentifier: \"^[\\\\w\\\\.\\\\-\\\\_]{1,250}$\",\n CMILongIdentifier:\n \"^(?:(?!urn:)\\\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\\\S{1,4000}|.{1,4000})$\",\n // need to re-examine this\n CMIFeedback: \"^.*$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n CMIIndexStore: \".N(\\\\d+).\",\n // Vocabulary Data Type Definition\n CMICStatus: \"^(completed|incomplete|not attempted|unknown)$\",\n CMISStatus: \"^(passed|failed|unknown)$\",\n CMIExit: \"^(time-out|suspend|logout|normal)$\",\n CMIType:\n \"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$\",\n CMIResult:\n \"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\\\.[0-9]{1,18})?)$\",\n NAVEvent:\n \"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?jump)$\",\n\n NAVBoolean: \"^(unknown|true|false$)\",\n NAVTarget: \"^{target=\\\\S{0,}[a-zA-Z0-9-_]+}$\",\n // Data ranges\n scaled_range: \"-1#1\",\n audio_range: \"0#*\",\n speed_range: \"0#*\",\n text_range: \"-1#1\",\n progress_range: \"0#1\",\n};\nconst Regex = {\n aicc: aicc,\n scorm12: scorm12,\n scorm2004: scorm2004,\n};\nexport default Regex;\n","import APIConstants from \"./constants/api_constants\";\n\nconst scorm12_errors = APIConstants.scorm12.error_descriptions;\nconst aicc_errors = APIConstants.aicc.error_descriptions;\nconst scorm2004_errors = APIConstants.scorm2004.error_descriptions;\n\ntype APIError = {\n errorCode: number;\n errorMessage: string;\n detailedMessage: string;\n};\n\nexport class BaseScormValidationError extends Error {\n constructor(errorCode: number) {\n super(errorCode.toString());\n this._errorCode = errorCode;\n this.name = \"ScormValidationError\";\n }\n\n private readonly _errorCode: number;\n\n /**\n * Getter for _errorCode\n * @return {number}\n */\n get errorCode(): number {\n return this._errorCode;\n }\n\n setMessage(message: string) {\n this.message = message;\n }\n}\n\n/**\n * Base Validation Exception\n */\nexport class ValidationError\n extends BaseScormValidationError\n implements APIError\n{\n /**\n * Constructor to take in an error message and code\n * @param {number} errorCode\n * @param {string} errorMessage\n * @param {string} detailedMessage\n */\n constructor(\n errorCode: number,\n errorMessage: string,\n detailedMessage?: string,\n ) {\n super(errorCode);\n this.setMessage(errorMessage);\n this._errorMessage = errorMessage;\n if (detailedMessage) {\n this._detailedMessage = detailedMessage;\n }\n }\n\n private readonly _errorMessage: string;\n private readonly _detailedMessage: string = \"\";\n\n /**\n * Getter for _errorMessage\n * @return {string}\n */\n get errorMessage(): string {\n return this._errorMessage;\n }\n\n /**\n * Getter for _detailedMessage\n * @return {string}\n */\n get detailedMessage(): string {\n return this._detailedMessage;\n }\n}\n\n/**\n * SCORM 1.2 Validation Error\n */\nexport class Scorm12ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {\n super(\n errorCode,\n scorm12_errors[String(errorCode)].basicMessage,\n scorm12_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm12_errors[\"101\"].basicMessage,\n scorm12_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * AICC Validation Error\n */\nexport class AICCValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {\n super(\n errorCode,\n aicc_errors[String(errorCode)].basicMessage,\n aicc_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n aicc_errors[\"101\"].basicMessage,\n aicc_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * SCORM 2004 Validation Error\n */\nexport class Scorm2004ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {\n super(\n errorCode,\n scorm2004_errors[String(errorCode)].basicMessage,\n scorm2004_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm2004_errors[\"101\"].basicMessage,\n scorm2004_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n","export const SECONDS_PER_SECOND = 1.0;\nexport const SECONDS_PER_MINUTE = 60;\nexport const SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;\nexport const SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR;\n\ntype Designation = {\n [key: string]: number;\n};\n\ntype StringKeyMap = {\n [key: string]: any;\n};\n\nconst designations: Designation = {\n D: SECONDS_PER_DAY,\n H: SECONDS_PER_HOUR,\n M: SECONDS_PER_MINUTE,\n S: SECONDS_PER_SECOND,\n};\n\n/**\n * Converts a Number to a String of HH:MM:SS\n *\n * @param {number} totalSeconds\n * @return {string}\n */\nexport function getSecondsAsHHMMSS(totalSeconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!totalSeconds || totalSeconds <= 0) {\n return \"00:00:00\";\n }\n\n const hours = Math.floor(totalSeconds / SECONDS_PER_HOUR);\n const dateObj = new Date(totalSeconds * 1000);\n const minutes = dateObj.getUTCMinutes();\n // make sure we add any possible decimal value\n const seconds = dateObj.getSeconds();\n const ms = totalSeconds % 1.0;\n let msStr = \"\";\n\n if (countDecimals(ms) > 0) {\n if (countDecimals(ms) > 2) {\n msStr = ms.toFixed(2);\n } else {\n msStr = String(ms);\n }\n\n msStr = \".\" + msStr.split(\".\")[1];\n }\n\n return (\n (hours + \":\" + minutes + \":\" + seconds).replace(/\\b\\d\\b/g, \"0$&\") + msStr\n );\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {number} seconds\n * @return {string}\n */\nexport function getSecondsAsISODuration(seconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!seconds || seconds <= 0) {\n return \"PT0S\";\n }\n\n let duration = \"P\";\n let remainder = seconds;\n for (const designationsKey in designations) {\n const current_seconds = designations[designationsKey];\n let value = Math.floor(remainder / current_seconds);\n remainder = remainder % current_seconds;\n\n if (countDecimals(remainder) > 2) {\n remainder = Number(Number(remainder).toFixed(2));\n }\n\n // If we have anything left in the remainder, and we're currently adding\n // seconds to the duration, go ahead and add the decimal to the seconds\n if (designationsKey === \"S\" && remainder > 0) {\n value += remainder;\n }\n\n if (value) {\n if (\n (duration.indexOf(\"D\") > 0 ||\n designationsKey === \"H\" ||\n designationsKey === \"M\" ||\n designationsKey === \"S\") &&\n duration.indexOf(\"T\") === -1\n ) {\n duration += \"T\";\n }\n\n duration += `${value}${designationsKey}`;\n }\n }\n return duration;\n}\n\n/**\n * Calculate the number of seconds from HH:MM:SS.DDDDDD\n *\n * @param {string} timeString\n * @param {RegExp} timeRegex\n * @return {number}\n */\nexport function getTimeAsSeconds(\n timeString: string | number | boolean | null,\n timeRegex: RegExp | string,\n): number {\n if (typeof timeString === \"number\" || typeof timeString === \"boolean\") {\n timeString = String(timeString);\n }\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n if (!timeString || !timeString.match(timeRegex)) {\n return 0;\n }\n\n const parts = timeString.split(\":\");\n const hours = Number(parts[0]);\n const minutes = Number(parts[1]);\n const seconds = Number(parts[2]);\n return hours * 3600 + minutes * 60 + seconds;\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {string} duration\n * @param {RegExp} durationRegex\n * @return {number}\n */\nexport function getDurationAsSeconds(\n duration: string | null,\n durationRegex: RegExp | string,\n): number {\n if (typeof durationRegex === \"string\") {\n durationRegex = new RegExp(durationRegex);\n }\n\n if (!duration || !duration.match(durationRegex)) {\n return 0;\n }\n\n const [, years, _, , days, hours, minutes, seconds] =\n new RegExp(durationRegex).exec(duration) || [];\n let result = 0.0;\n result += Number(seconds) || 0.0;\n result += Number(minutes) * 60.0 || 0.0;\n result += Number(hours) * 3600.0 || 0.0;\n result += Number(days) * (60 * 60 * 24.0) || 0.0;\n result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0;\n return result;\n}\n\n/**\n * Adds together two ISO8601 Duration strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp|string} durationRegex\n * @return {string}\n */\nexport function addTwoDurations(\n first: string,\n second: string,\n durationRegex: RegExp | string,\n): string {\n const regex: RegExp =\n typeof durationRegex === \"string\"\n ? new RegExp(durationRegex)\n : durationRegex;\n return getSecondsAsISODuration(\n getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex),\n );\n}\n\n/**\n * Add together two HH:MM:SS.DD strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp} timeRegex\n * @return {string}\n */\nexport function addHHMMSSTimeStrings(\n first: string,\n second: string,\n timeRegex: RegExp | string,\n): string {\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n return getSecondsAsHHMMSS(\n getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex),\n );\n}\n\n/**\n * Flatten a JSON object down to string paths for each values\n * @param {object} data\n * @return {object}\n */\nexport function flatten(data: StringKeyMap): object {\n const result: StringKeyMap = {};\n\n /**\n * Recurse through the object\n * @param {*} cur\n * @param {*} prop\n */\n function recurse(cur: any, prop: any) {\n if (Object(cur) !== cur) {\n result[prop] = cur;\n } else if (Array.isArray(cur)) {\n for (let i = 0, l = cur.length; i < l; i++) {\n recurse(cur[i], prop + \"[\" + i + \"]\");\n if (l === 0) result[prop] = [];\n }\n } else {\n let isEmpty = true;\n\n for (const p in cur) {\n if ({}.hasOwnProperty.call(cur, p)) {\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p);\n }\n }\n\n if (isEmpty && prop) result[prop] = {};\n }\n }\n\n recurse(data, \"\");\n return result;\n}\n\n/**\n * Un-flatten a flat JSON object\n * @param {object} data\n * @return {object}\n */\nexport function unflatten(data: StringKeyMap): object {\n \"use strict\";\n\n if (Object(data) !== data || Array.isArray(data)) return data;\n const regex = /\\.?([^.[\\]]+)|\\[(\\d+)]/g;\n const result: StringKeyMap = {};\n\n for (const p in data) {\n if ({}.hasOwnProperty.call(data, p)) {\n let cur = result;\n let prop = \"\";\n let m = regex.exec(p);\n\n while (m) {\n cur = cur[prop] || (cur[prop] = m[2] ? [] : {});\n prop = m[2] || m[1];\n m = regex.exec(p);\n }\n\n cur[prop] = data[p];\n }\n }\n\n return result[\"\"] || result;\n}\n\n/**\n * Counts the number of decimal places\n * @param {number} num\n * @return {number}\n */\nexport function countDecimals(num: number): number {\n if (Math.floor(num) === num || String(num).indexOf(\".\") < 0) return 0;\n const parts = num.toString().split(\".\")[1];\n return parts.length || 0;\n}\n\n/**\n * Formats the SCORM messages for easy reading\n *\n * @param {string} functionName\n * @param {string} message\n * @param {string} CMIElement\n * @return {string}\n */\nexport function formatMessage(\n functionName: string,\n message: string,\n CMIElement?: string,\n): string {\n const baseLength = 20;\n let messageString = \"\";\n\n messageString += functionName;\n\n let fillChars = baseLength - messageString.length;\n\n for (let i = 0; i < fillChars; i++) {\n messageString += \" \";\n }\n\n messageString += \": \";\n\n if (CMIElement) {\n const CMIElementBaseLength = 70;\n\n messageString += CMIElement;\n\n fillChars = CMIElementBaseLength - messageString.length;\n\n for (let j = 0; j < fillChars; j++) {\n messageString += \" \";\n }\n }\n\n if (message) {\n messageString += message;\n }\n\n return messageString;\n}\n\n/**\n * Checks to see if {str} contains {tester}\n *\n * @param {string} str String to check against\n * @param {string} tester String to check for\n * @return {boolean}\n */\nexport function stringMatches(str: string, tester: string): boolean {\n return str?.match(tester) !== null;\n}\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","import { CMI } from \"./cmi/scorm12/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMIObjectivesObject } from \"./cmi/scorm12/objectives\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm12/interactions\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport Regex from \"./constants/regex\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\nimport BaseAPI from \"./BaseAPI\";\n\n/**\n * API class for SCORM 1.2\n */\nclass Scorm12Impl extends BaseAPI {\n /**\n * Constructor for SCORM 1.2 API\n * @param {object} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm12, settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n\n // Rename functions to match 1.2 Spec and expose to modules\n this.LMSInitialize = this.lmsInitialize;\n this.LMSFinish = this.lmsFinish;\n this.LMSGetValue = this.lmsGetValue;\n this.LMSSetValue = this.lmsSetValue;\n this.LMSCommit = this.lmsCommit;\n this.LMSGetLastError = this.lmsGetLastError;\n this.LMSGetErrorString = this.lmsGetErrorString;\n this.LMSGetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public statusSetByModule = false;\n\n cmi: CMI;\n nav: NAV;\n\n LMSInitialize: () => string;\n LMSFinish: () => string;\n LMSGetValue: (CMIElement: string) => string;\n LMSSetValue: (CMIElement: string, value: any) => string;\n LMSCommit: () => string;\n LMSGetLastError: () => string;\n LMSGetErrorString: (CMIErrorCode: string) => string;\n LMSGetDiagnostic: (CMIErrorCode: string) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * lmsInitialize function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n if (this.cmi.core.lesson_status) {\n this.statusSetByModule = true;\n } else {\n this.cmi.core.lesson_status = \"not attempted\";\n }\n return this.initialize(\n \"LMSInitialize\",\n \"LMS was already initialized!\",\n \"LMS is already finished!\",\n );\n }\n\n /**\n * LMSFinish function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"LMSFinish\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.nav.event !== \"\") {\n if (this.nav.event === \"continue\") {\n this.processListeners(\"SequenceNext\");\n } else {\n this.processListeners(\"SequencePrevious\");\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * LMSGetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n return this.getValue(\"LMSGetValue\", false, CMIElement);\n }\n\n /**\n * LMSSetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n if (CMIElement === \"cmi.core.lesson_status\") {\n this.statusSetByModule = true;\n }\n return this.setValue(\"LMSSetValue\", \"LMSCommit\", false, CMIElement, value);\n }\n\n /**\n * LMSCommit function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"LMSCommit\", false);\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * LMSGetLastError function from SCORM 1.2 Spec\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"LMSGetLastError\");\n }\n\n /**\n * LMSGetErrorString function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string): string {\n return this.getErrorString(\"LMSGetErrorString\", CMIErrorCode);\n }\n\n /**\n * LMSGetDiagnostic function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string): string {\n return this.getDiagnostic(\"LMSGetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"LMSSetValue\", false, CMIElement, value);\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"getCMIValue\", false, CMIElement);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {*} _value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n _value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsCorrectResponsesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObjectivesObject();\n } else if (\n !foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObject();\n }\n\n return null;\n }\n\n /**\n * Validates Correct Response values\n *\n * @param {string} _CMIElement\n * @param {*} _value\n */\n validateCorrectResponse(_CMIElement: string, _value: any) {\n // do nothing\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {number|string} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: number | string,\n detail: boolean,\n ): string {\n let basicMessage = \"No Error\";\n let detailMessage = \"No Error\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm12.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {Scorm12Impl} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm12Impl) {\n // Data Model\n this.cmi = newAPI.cmi;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeHHMMSS = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getTimeAsSeconds(\n totalTimeHHMMSS,\n Regex.scorm12.CMITimespan,\n );\n const lessonStatus = this.cmi.core.lesson_status;\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (lessonStatus) {\n completionStatus =\n lessonStatus === \"completed\" || lessonStatus === \"passed\"\n ? CompletionStatus.completed\n : CompletionStatus.incomplete;\n if (lessonStatus === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (lessonStatus === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.core.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n }\n\n const commitObject: CommitObject = {\n successStatus: successStatus,\n completionStatus: completionStatus,\n runtimeData: cmiExport,\n totalTimeSeconds: totalTimeSeconds,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n const originalStatus = this.cmi.core.lesson_status;\n if (\n !this.cmi.core.lesson_status ||\n (!this.statusSetByModule &&\n this.cmi.core.lesson_status === \"not attempted\")\n ) {\n this.cmi.core.lesson_status = \"completed\";\n }\n\n if (this.cmi.core.lesson_mode === \"normal\") {\n if (this.cmi.core.credit === \"credit\") {\n if (\n this.settings.mastery_override &&\n this.cmi.student_data.mastery_score !== \"\" &&\n this.cmi.core.score.raw !== \"\"\n ) {\n this.cmi.core.lesson_status =\n parseFloat(this.cmi.core.score.raw) >=\n parseFloat(this.cmi.student_data.mastery_score)\n ? \"passed\"\n : \"failed\";\n }\n }\n } else if (this.cmi.core.lesson_mode === \"browse\") {\n if (\n (this.startingData?.cmi?.core?.lesson_status || \"\") === \"\" &&\n originalStatus === \"not attempted\"\n ) {\n this.cmi.core.lesson_status = \"browsed\";\n }\n }\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n return await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n\nexport { Scorm12Impl };\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/dist/esm/scorm12.min.js b/dist/esm/scorm12.min.js new file mode 100644 index 0000000..7a747e4 --- /dev/null +++ b/dist/esm/scorm12.min.js @@ -0,0 +1,2 @@ +var e={900:function(e,t,r){r.d(t,{A:function(){return _}});var i=r(635),n=r(589),o=r(784),s=r(797),a=r(340),c=r(864);var l={autocommit:!1,autocommitSeconds:10,asyncCommit:!1,sendFullCommit:!0,lmsCommitUrl:!1,dataCommitFormat:"json",commitRequestDataType:"application/json;charset=UTF-8",autoProgress:!1,logLevel:a.A.global.LOG_LEVEL_ERROR,selfReportSessionTime:!1,alwaysSendTotalTime:!1,renderCommonCommitFields:!1,strict_errors:!0,xhrHeaders:{},xhrWithCredentials:!1,responseHandler:function(e){return(0,i.sH)(this,void 0,void 0,(function(){var t,r,n;return(0,i.YH)(this,(function(i){switch(i.label){case 0:return void 0===e?[3,2]:(n=(r=JSON).parse,[4,e.text()]);case 1:return null!==(t=n.apply(r,[i.sent()]))&&{}.hasOwnProperty.call(t,"result")?[2,{result:t.result,errorCode:t.errorCode?t.errorCode:t.result===a.A.global.SCORM_TRUE?0:101}]:200===e.status?[2,{result:a.A.global.SCORM_TRUE,errorCode:0}]:[2,{result:a.A.global.SCORM_FALSE,errorCode:101}];case 2:return[2,{result:a.A.global.SCORM_FALSE,errorCode:101}]}}))}))},requestHandler:function(e){return e},onLogMessage:function(e,t){switch(e){case a.A.global.LOG_LEVEL_ERROR:console.error(t);break;case a.A.global.LOG_LEVEL_WARNING:console.warn(t);break;case a.A.global.LOG_LEVEL_INFO:console.info(t);break;case a.A.global.LOG_LEVEL_DEBUG:console.debug?console.debug(t):console.log(t)}},scoItemIds:[],scoItemIdValidator:!1},u=function(){function e(e,t,r){this._cancelled=!1,this._API=e,this._timeout=setTimeout(this.wrapper.bind(this),t),this._callback=r}return e.prototype.cancel=function(){this._cancelled=!0,this._timeout&&clearTimeout(this._timeout)},e.prototype.wrapper=function(){var e=this;this._cancelled||(0,i.sH)(e,void 0,void 0,(function(){return(0,i.YH)(this,(function(e){switch(e.label){case 0:return[4,this._API.commit(this._callback)];case 1:return[2,e.sent()]}}))}))},e}(),d=function(){function e(t,r){var i=this.constructor;if(this._settings=l,i===e)throw new TypeError("Cannot construct BaseAPI instances directly");this.currentState=a.A.global.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[],this._error_codes=t,r&&(this.settings=r),this.apiLogLevel=this.settings.logLevel,this.selfReportSessionTime=this.settings.selfReportSessionTime}return e.prototype.commonReset=function(e){this.settings=(0,i.Cl)((0,i.Cl)({},this.settings),e),this.currentState=a.A.global.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[]},e.prototype.initialize=function(e,t,r){var i=a.A.global.SCORM_FALSE;return this.isInitialized()?this.throwSCORMError(this._error_codes.INITIALIZED,t):this.isTerminated()?this.throwSCORMError(this._error_codes.TERMINATED,r):(this.selfReportSessionTime&&this.cmi.setStartTime(),this.currentState=a.A.global.STATE_INITIALIZED,this.lastErrorCode="0",i=a.A.global.SCORM_TRUE,this.processListeners(e)),this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(i),i},e.prototype.apiLog=function(e,t,r,i){t=(0,c.hw)(e,t,i),r>=this.apiLogLevel&&this.settings.onLogMessage(r,t)},Object.defineProperty(e.prototype,"error_codes",{get:function(){return this._error_codes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"settings",{get:function(){return this._settings},set:function(e){this._settings=(0,i.Cl)((0,i.Cl)({},this._settings),e)},enumerable:!1,configurable:!0}),e.prototype.terminate=function(e,t){return(0,i.sH)(this,void 0,void 0,(function(){var r,n;return(0,i.YH)(this,(function(i){switch(i.label){case 0:return r=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.TERMINATION_BEFORE_INIT,this._error_codes.MULTIPLE_TERMINATION)?(this.currentState=a.A.global.STATE_TERMINATED,[4,this.storeData(!0)]):[3,2];case 1:void 0!==(n=i.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),r=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,t&&(this.lastErrorCode="0"),r=a.A.global.SCORM_TRUE,this.processListeners(e),i.label=2;case 2:return this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(r),[2,r]}}))}))},e.prototype.getValue=function(e,t,r){var i="";if(this.checkState(t,this._error_codes.RETRIEVE_BEFORE_INIT,this._error_codes.RETRIEVE_AFTER_TERM)){t&&(this.lastErrorCode="0");try{i=this.getCMIValue(r)}catch(e){i=this.handleValueAccessException(e,i)}this.processListeners(e,r)}return this.apiLog(e,": returned: "+i,a.A.global.LOG_LEVEL_INFO,r),void 0===i?"":(this.clearSCORMError(i),i)},e.prototype.setValue=function(e,t,r,i,n){void 0!==n&&(n=String(n));var o=a.A.global.SCORM_FALSE;if(this.checkState(r,this._error_codes.STORE_BEFORE_INIT,this._error_codes.STORE_AFTER_TERM)){r&&(this.lastErrorCode="0");try{o=this.setCMIValue(i,n)}catch(e){this.handleValueAccessException(e,o)}this.processListeners(e,i,n)}return void 0===o&&(o=a.A.global.SCORM_FALSE),"0"===String(this.lastErrorCode)&&this.settings.autocommit&&!this._timeout&&this.scheduleCommit(1e3*this.settings.autocommitSeconds,t),this.apiLog(e,": "+n+": result: "+o,a.A.global.LOG_LEVEL_INFO,i),this.clearSCORMError(o),o},e.prototype.commit=function(e){return(0,i.sH)(this,arguments,void 0,(function(e,t){var r,n;return void 0===t&&(t=!1),(0,i.YH)(this,(function(i){switch(i.label){case 0:return this.clearScheduledCommit(),r=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.COMMIT_BEFORE_INIT,this._error_codes.COMMIT_AFTER_TERM)?[4,this.storeData(!1)]:[3,2];case 1:(n=i.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),r=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,this.apiLog(e," Result: "+r,a.A.global.LOG_LEVEL_DEBUG,"HttpRequest"),t&&(this.lastErrorCode="0"),this.processListeners(e),i.label=2;case 2:return this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(r),[2,r]}}))}))},e.prototype.getLastError=function(e){var t=String(this.lastErrorCode);return this.processListeners(e),this.apiLog(e,"returned: "+t,a.A.global.LOG_LEVEL_INFO),t},e.prototype.getErrorString=function(e,t){var r="";return null!==t&&""!==t&&(r=this.getLmsErrorMessageDetails(t),this.processListeners(e)),this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),r},e.prototype.getDiagnostic=function(e,t){var r="";return null!==t&&""!==t&&(r=this.getLmsErrorMessageDetails(t,!0),this.processListeners(e)),this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),r},e.prototype.checkState=function(e,t,r){return this.isNotInitialized()?(this.throwSCORMError(t),!1):!e||!this.isTerminated()||(this.throwSCORMError(r),!1)},e.prototype.getLmsErrorMessageDetails=function(e,t){throw void 0===t&&(t=!1),new Error("The getLmsErrorMessageDetails method has not been implemented")},e.prototype.getCMIValue=function(e){throw new Error("The getCMIValue method has not been implemented")},e.prototype.setCMIValue=function(e,t){throw new Error("The setCMIValue method has not been implemented")},e.prototype._commonSetCMIValue=function(e,t,r,o){if(!r||""===r)return a.A.global.SCORM_FALSE;for(var s=r.split("."),l=this,u=a.A.global.SCORM_FALSE,d=!1,_="The data model element passed to ".concat(e," (").concat(r,") is not a valid SCORM data model element."),h=t?this._error_codes.UNDEFINED_DATA_MODEL:this._error_codes.GENERAL,m=0;m1&&(s=e.replace(o+".","")),this.listenerArray.push({functionName:o,CMIElement:s,callback:t}),this.apiLog("on","Added event listener: ".concat(this.listenerArray.length),a.A.global.LOG_LEVEL_INFO,o)}},e.prototype.off=function(e,t){if(t)for(var r=e.split(" "),i=function(i){var o=r[i].split(".");if(0===o.length)return{value:void 0};var s=o[0],c=null;o.length>1&&(c=e.replace(s+".",""));var l=n.listenerArray.findIndex((function(e){return e.functionName===s&&e.CMIElement===c&&e.callback===t}));-1!==l&&(n.listenerArray.splice(l,1),n.apiLog("off","Removed event listener: ".concat(n.listenerArray.length),a.A.global.LOG_LEVEL_INFO,s))},n=this,o=0;o1&&(s=e.replace(o+".","")),i.listenerArray=i.listenerArray.filter((function(e){return e.functionName!==o&&e.CMIElement!==s}))},i=this,n=0;ns?1:0})),s.forEach((function(e){(i={})[e[0]]=e[1],r.loadFromJSON((0,c.sB)(i),t)}))}else console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize.");function a(e,t,r){var i,n=e.match(r);if(null!==n&&null!==(i=t.match(r))){var o=Number(n[2]),s=Number(i[2]);return o===s?"id"===n[3]?-1:"type"===n[3]?"id"===i[3]?1:-1:1:o-s}return null}},e.prototype.loadFromJSON=function(e,t){if(this.isNotInitialized()){for(var r in t=void 0!==t?t:"cmi",this.startingData=e,e)if({}.hasOwnProperty.call(e,r)&&e[r]){var i=(t?t+".":"")+r,n=e[r];if(n.childArray)for(var o=0;o=200&&e.status<=299&&(!0===t.result||t.result===a.A.global.SCORM_TRUE)?this.processListeners("CommitSuccess"):this.processListeners("CommitError"),[2,t]}}))}))},e}(),_=d},589:function(e,t,r){r.d(t,{B:function(){return c}});var i=r(635),n=r(319),o=r(797),s=r(784),a=o.A.scorm12,c=function(e){function t(t){var r=e.call(this)||this;return r.__children=t.children,r._errorCode=t.errorCode||a.GENERAL,r._errorClass=t.errorClass||s.$h,r.childArray=[],r}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_count",{get:function(){return this.childArray.length},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;for(var e={},t=0;t=n[0]){if("*"===n[1]||e<=n[1])return!0;throw new i(r)}throw new i(r)}r.d(t,{W:function(){return n},q:function(){return i}})},989:function(e,t,r){r.d(t,{Y:function(){return g}});var i=r(635),n=r(340),o=r(797),s=r(417),a=r(784),c=r(319),l=r(915),u=r(434),d=r(864),_=function(e){function t(){var t=e.call(this)||this;return t.__children=n.A.scorm12.core_children,t._student_id="",t._student_name="",t._lesson_location="",t._credit="",t._lesson_status="not attempted",t._entry="",t._total_time="",t._lesson_mode="normal",t._exit="",t._session_time="00:00:00",t._suspend_data="",t.score=new u._({score_children:n.A.scorm12.score_children,score_range:s.A.scorm12.score_range,invalidErrorCode:o.A.scorm12.INVALID_SET_VALUE,invalidTypeCode:o.A.scorm12.TYPE_MISMATCH,invalidRangeCode:o.A.scorm12.VALUE_OUT_OF_RANGE,errorClass:a.tQ}),t}return(0,i.C6)(t,e),t.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_id",{get:function(){return this._student_id},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._student_id=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_name",{get:function(){return this._student_name},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._student_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_location",{get:function(){return this._lesson_location},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString256,!0)&&(this._lesson_location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"credit",{get:function(){return this._credit},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._credit=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_status",{get:function(){return this._lesson_status},set:function(e){this.initialized?(0,l.p)(e,s.A.scorm12.CMIStatus)&&(this._lesson_status=e):(0,l.p)(e,s.A.scorm12.CMIStatus2)&&(this._lesson_status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"entry",{get:function(){return this._entry},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._entry=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"total_time",{get:function(){return this._total_time},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._total_time=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_mode",{get:function(){return this._lesson_mode},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._lesson_mode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"exit",{get:function(){if(!this.jsonString)throw new a.tQ(o.A.scorm12.WRITE_ONLY_ELEMENT);return this._exit},set:function(e){(0,l.p)(e,s.A.scorm12.CMIExit,!0)&&(this._exit=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"session_time",{get:function(){if(!this.jsonString)throw new a.tQ(o.A.scorm12.WRITE_ONLY_ELEMENT);return this._session_time},set:function(e){(0,l.p)(e,s.A.scorm12.CMITimespan)&&(this._session_time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"suspend_data",{get:function(){return this._suspend_data},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString4096,!0)&&(this._suspend_data=e)},enumerable:!1,configurable:!0}),t.prototype.getCurrentTotalTime=function(e){var t=this._session_time,r=e;if(null!=r){var i=(new Date).getTime()-r;t=d.UZ(i/1e3)}return d.HT(this._total_time,t,new RegExp(s.A.scorm12.CMITimespan))},t.prototype.toJSON=function(){this.jsonString=!0;var e={student_id:this.student_id,student_name:this.student_name,lesson_location:this.lesson_location,credit:this.credit,lesson_status:this.lesson_status,entry:this.entry,lesson_mode:this.lesson_mode,exit:this.exit,session_time:this.session_time,score:this.score};return delete this.jsonString,e},t}(c.J),h=r(176),m=r(532),f=r(181),p=r(833),g=function(e){function t(t,r,i){var o=e.call(this)||this;return o.__children="",o.__version="3.4",o._launch_data="",o._comments="",o._comments_from_lms="",i&&o.initialize(),o.__children=t||n.A.scorm12.cmi_children,o.core=new _,o.objectives=new h.C,o.student_data=r||new m.X,o.student_preference=new f.G,o.interactions=new p.Xb,o}return(0,i.C6)(t,e),t.prototype.initialize=function(){var t,r,i,n,o;e.prototype.initialize.call(this),null===(t=this.core)||void 0===t||t.initialize(),null===(r=this.objectives)||void 0===r||r.initialize(),null===(i=this.student_data)||void 0===i||i.initialize(),null===(n=this.student_preference)||void 0===n||n.initialize(),null===(o=this.interactions)||void 0===o||o.initialize()},t.prototype.toJSON=function(){this.jsonString=!0;var e={suspend_data:this.suspend_data,launch_data:this.launch_data,comments:this.comments,comments_from_lms:this.comments_from_lms,core:this.core,objectives:this.objectives,student_data:this.student_data,student_preference:this.student_preference,interactions:this.interactions};return delete this.jsonString,e},Object.defineProperty(t.prototype,"_version",{get:function(){return this.__version},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"suspend_data",{get:function(){var e;return null===(e=this.core)||void 0===e?void 0:e.suspend_data},set:function(e){this.core&&(this.core.suspend_data=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"launch_data",{get:function(){return this._launch_data},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._launch_data=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"comments",{get:function(){return this._comments},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString4096,!0)&&(this._comments=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"comments_from_lms",{get:function(){return this._comments_from_lms},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._comments_from_lms=e},enumerable:!1,configurable:!0}),t.prototype.getCurrentTotalTime=function(){return this.core.getCurrentTotalTime(this.start_time)},t}(c.r)},833:function(e,t,r){r.d(t,{Oh:function(){return h},WP:function(){return _},Xb:function(){return d},cb:function(){return m}});var i=r(635),n=r(589),o=r(340),s=r(797),a=r(784),c=r(319),l=r(915),u=r(417),d=function(e){function t(){return e.call(this,{children:o.A.scorm12.interactions_children,errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ})||this}return(0,i.C6)(t,e),t}(n.B),_=function(e){function t(){var t=e.call(this)||this;return t._id="",t._time="",t._type="",t._weighting="",t._student_response="",t._result="",t._latency="",t.objectives=new n.B({errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ,children:o.A.scorm12.objectives_children}),t.correct_responses=new n.B({errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ,children:o.A.scorm12.correct_responses_children}),t}return(0,i.C6)(t,e),t.prototype.initialize=function(){var t,r;e.prototype.initialize.call(this),null===(t=this.objectives)||void 0===t||t.initialize(),null===(r=this.correct_responses)||void 0===r||r.initialize()},Object.defineProperty(t.prototype,"id",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._id},set:function(e){(0,l.p)(e,u.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._time},set:function(e){(0,l.p)(e,u.A.scorm12.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._type},set:function(e){(0,l.p)(e,u.A.scorm12.CMIType)&&(this._type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weighting",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._weighting},set:function(e){(0,l.p)(e,u.A.scorm12.CMIDecimal)&&(0,l.h)(e,u.A.scorm12.weighting_range)&&(this._weighting=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_response",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._student_response},set:function(e){(0,l.p)(e,u.A.scorm12.CMIFeedback,!0)&&(this._student_response=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"result",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._result},set:function(e){(0,l.p)(e,u.A.scorm12.CMIResult)&&(this._result=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"latency",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._latency},set:function(e){(0,l.p)(e,u.A.scorm12.CMITimespan)&&(this._latency=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,time:this.time,type:this.type,weighting:this.weighting,student_response:this.student_response,result:this.result,latency:this.latency,objectives:this.objectives,correct_responses:this.correct_responses};return delete this.jsonString,e},t}(c.J),h=function(e){function t(){var t=e.call(this)||this;return t._id="",t}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(e){(0,l.p)(e,u.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id};return delete this.jsonString,e},t}(c.J),m=function(e){function t(){var t=e.call(this)||this;return t._pattern="",t}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"pattern",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._pattern},set:function(e){(0,l.p)(e,u.A.scorm12.CMIFeedback,!0)&&(this._pattern=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={pattern:this._pattern};return delete this.jsonString,e},t}(c.J)},331:function(e,t,r){r.d(t,{A:function(){return a}});var i=r(635),n=r(319),o=r(915),s=r(417),a=function(e){function t(){var t=e.call(this)||this;return t._event="",t}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"event",{get:function(){return this._event},set:function(e){(0,o.p)(e,s.A.scorm12.NAVEvent)&&(this._event=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={event:this.event};return delete this.jsonString,e},t}(n.J)},176:function(e,t,r){r.d(t,{C:function(){return d},N:function(){return _}});var i=r(635),n=r(319),o=r(434),s=r(340),a=r(417),c=r(797),l=r(784),u=r(915),d=function(e){function t(){return e.call(this,{children:s.A.scorm12.objectives_children,errorCode:c.A.scorm12.INVALID_SET_VALUE,errorClass:l.tQ})||this}return(0,i.C6)(t,e),t}(r(589).B),_=function(e){function t(){var t=e.call(this)||this;return t._id="",t._status="",t.score=new o._({score_children:s.A.scorm12.score_children,score_range:a.A.scorm12.score_range,invalidErrorCode:c.A.scorm12.INVALID_SET_VALUE,invalidTypeCode:c.A.scorm12.TYPE_MISMATCH,invalidRangeCode:c.A.scorm12.VALUE_OUT_OF_RANGE,errorClass:l.tQ}),t}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(e){(0,u.p)(e,a.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},set:function(e){(0,u.p)(e,a.A.scorm12.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,status:this.status,score:this.score};return delete this.jsonString,e},t}(n.J)},532:function(e,t,r){r.d(t,{X:function(){return c}});var i=r(635),n=r(319),o=r(340),s=r(784),a=r(797),c=function(e){function t(t){var r=e.call(this)||this;return r._mastery_score="",r._max_time_allowed="",r._time_limit_action="",r.__children=t||o.A.scorm12.student_data_children,r}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new s.tQ(a.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mastery_score",{get:function(){return this._mastery_score},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._mastery_score=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"max_time_allowed",{get:function(){return this._max_time_allowed},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._max_time_allowed=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time_limit_action",{get:function(){return this._time_limit_action},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._time_limit_action=e},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={mastery_score:this.mastery_score,max_time_allowed:this.max_time_allowed,time_limit_action:this.time_limit_action};return delete this.jsonString,e},t}(n.J)},181:function(e,t,r){r.d(t,{G:function(){return u}});var i=r(635),n=r(319),o=r(340),s=r(784),a=r(797),c=r(915),l=r(417),u=function(e){function t(t){var r=e.call(this)||this;return r._audio="",r._language="",r._speed="",r._text="",r.__children=t||o.A.scorm12.student_preference_children,r}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new s.tQ(a.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audio",{get:function(){return this._audio},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.audio_range)&&(this._audio=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"language",{get:function(){return this._language},set:function(e){(0,c.p)(e,l.A.scorm12.CMIString256)&&(this._language=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speed",{get:function(){return this._speed},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.speed_range)&&(this._speed=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this._text},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.text_range)&&(this._text=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,speed:this.speed,text:this.text};return delete this.jsonString,e},t}(n.J)},915:function(e,t,r){r.d(t,{h:function(){return a},p:function(){return s}});var i=r(449),n=r(797),o=r(784);function s(e,t,r){return(0,i.q)(e,t,n.A.scorm12.TYPE_MISMATCH,o.tQ,r)}function a(e,t,r){if(!r&&""===e)throw new o.tQ(n.A.scorm12.VALUE_OUT_OF_RANGE);return(0,i.W)(e,t,n.A.scorm12.VALUE_OUT_OF_RANGE,o.tQ)}},340:function(e,t,r){var i=r(635),n={cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",core_children:"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time",score_children:"raw,min,max",comments_children:"content,location,time",objectives_children:"id,score,status",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio,language,speed,text",interactions_children:"id,objectives,time,type,correct_responses,weighting,student_response,result,latency",error_descriptions:{101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information"},201:{basicMessage:"Invalid argument error",detailMessage:"Indicates that an argument represents an invalid data model element or is otherwise incorrect."},202:{basicMessage:"Element cannot have children",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.'},203:{basicMessage:"Element not an array - cannot have count",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.'},301:{basicMessage:"Not initialized",detailMessage:"Indicates that an API call was made before the call to lmsInitialize."},401:{basicMessage:"Not implemented error",detailMessage:"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement."},402:{basicMessage:"Invalid set value, element is a keyword",detailMessage:'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").'},403:{basicMessage:"Element is read only",detailMessage:"LMSSetValue was called with a data model element that can only be read."},404:{basicMessage:"Element is write only",detailMessage:"LMSGetValue was called on a data model element that can only be written to."},405:{basicMessage:"Incorrect Data Type",detailMessage:"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Element Value Out Of Range",detailMessage:"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}},o={global:{SCORM_TRUE:"true",SCORM_FALSE:"false",STATE_NOT_INITIALIZED:0,STATE_INITIALIZED:1,STATE_TERMINATED:2,LOG_LEVEL_DEBUG:1,LOG_LEVEL_INFO:2,LOG_LEVEL_WARNING:3,LOG_LEVEL_ERROR:4,LOG_LEVEL_NONE:5},scorm12:n,aicc:(0,i.Cl)((0,i.Cl)({},n),{cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation",student_preference_children:"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows",student_data_children:"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action",student_demographics_children:"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience",tries_children:"time,status,score",attempt_records_children:"score,lesson_status",paths_children:"location_id,date,time,status,why_left,time_in_element"}),scorm2004:{cmi_children:"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time",comments_children:"comment,timestamp,location",score_children:"max,raw,scaled,min",objectives_children:"progress_measure,completion_status,success_status,description,score,id",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio_level,audio_captioning,delivery_speed,language",interactions_children:"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description",error_descriptions:{0:{basicMessage:"No Error",detailMessage:"No error occurred, the previous API call was successful."},101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use GetDiagnostic for more information."},102:{basicMessage:"General Initialization Failure",detailMessage:"Call to Initialize failed for an unknown reason."},103:{basicMessage:"Already Initialized",detailMessage:"Call to Initialize failed because Initialize was already called."},104:{basicMessage:"Content Instance Terminated",detailMessage:"Call to Initialize failed because Terminate was already called."},111:{basicMessage:"General Termination Failure",detailMessage:"Call to Terminate failed for an unknown reason."},112:{basicMessage:"Termination Before Initialization",detailMessage:"Call to Terminate failed because it was made before the call to Initialize."},113:{basicMessage:"Termination After Termination",detailMessage:"Call to Terminate failed because Terminate was already called."},122:{basicMessage:"Retrieve Data Before Initialization",detailMessage:"Call to GetValue failed because it was made before the call to Initialize."},123:{basicMessage:"Retrieve Data After Termination",detailMessage:"Call to GetValue failed because it was made after the call to Terminate."},132:{basicMessage:"Store Data Before Initialization",detailMessage:"Call to SetValue failed because it was made before the call to Initialize."},133:{basicMessage:"Store Data After Termination",detailMessage:"Call to SetValue failed because it was made after the call to Terminate."},142:{basicMessage:"Commit Before Initialization",detailMessage:"Call to Commit failed because it was made before the call to Initialize."},143:{basicMessage:"Commit After Termination",detailMessage:"Call to Commit failed because it was made after the call to Terminate."},201:{basicMessage:"General Argument Error",detailMessage:"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument."},301:{basicMessage:"General Get Failure",detailMessage:"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},351:{basicMessage:"General Set Failure",detailMessage:"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},391:{basicMessage:"General Commit Failure",detailMessage:"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information."},401:{basicMessage:"Undefined Data Model Element",detailMessage:"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element."},402:{basicMessage:"Unimplemented Data Model Element",detailMessage:"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant."},403:{basicMessage:"Data Model Element Value Not Initialized",detailMessage:"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO."},404:{basicMessage:"Data Model Element Is Read Only",detailMessage:"SetValue was called with a data model element that can only be read."},405:{basicMessage:"Data Model Element Is Write Only",detailMessage:"GetValue was called on a data model element that can only be written to."},406:{basicMessage:"Data Model Element Type Mismatch",detailMessage:"SetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Data Model Element Value Out Of Range",detailMessage:"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}}};t.A=o},56:function(e,t,r){var i,n,o;r.d(t,{YE:function(){return n},lC:function(){return o}}),function(e){e.unknown="unknown",e.true="true",e.false="false"}(i||(i={})),function(e){e.passed="passed",e.failed="failed",e.unknown="unknown"}(n||(n={})),function(e){e.completed="completed",e.incomplete="incomplete",e.unknown="unknown"}(o||(o={}))},797:function(e,t,r){var i=r(635),n={GENERAL:101,INITIALIZATION_FAILED:101,INITIALIZED:101,TERMINATED:101,TERMINATION_FAILURE:101,TERMINATION_BEFORE_INIT:101,MULTIPLE_TERMINATION:101,RETRIEVE_BEFORE_INIT:101,RETRIEVE_AFTER_TERM:101,STORE_BEFORE_INIT:101,STORE_AFTER_TERM:101,COMMIT_BEFORE_INIT:101,COMMIT_AFTER_TERM:101,ARGUMENT_ERROR:101,CHILDREN_ERROR:101,COUNT_ERROR:101,GENERAL_GET_FAILURE:101,GENERAL_SET_FAILURE:101,GENERAL_COMMIT_FAILURE:101,UNDEFINED_DATA_MODEL:101,UNIMPLEMENTED_ELEMENT:101,VALUE_NOT_INITIALIZED:101,INVALID_SET_VALUE:101,READ_ONLY_ELEMENT:101,WRITE_ONLY_ELEMENT:101,TYPE_MISMATCH:101,VALUE_OUT_OF_RANGE:101,DEPENDENCY_NOT_ESTABLISHED:101},o={scorm12:(0,i.Cl)((0,i.Cl)({},n),{RETRIEVE_BEFORE_INIT:301,STORE_BEFORE_INIT:301,COMMIT_BEFORE_INIT:301,ARGUMENT_ERROR:201,CHILDREN_ERROR:202,COUNT_ERROR:203,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:401,VALUE_NOT_INITIALIZED:301,INVALID_SET_VALUE:402,READ_ONLY_ELEMENT:403,WRITE_ONLY_ELEMENT:404,TYPE_MISMATCH:405,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408}),scorm2004:(0,i.Cl)((0,i.Cl)({},n),{INITIALIZATION_FAILED:102,INITIALIZED:103,TERMINATED:104,TERMINATION_FAILURE:111,TERMINATION_BEFORE_INIT:112,MULTIPLE_TERMINATIONS:113,RETRIEVE_BEFORE_INIT:122,RETRIEVE_AFTER_TERM:123,STORE_BEFORE_INIT:132,STORE_AFTER_TERM:133,COMMIT_BEFORE_INIT:142,COMMIT_AFTER_TERM:143,ARGUMENT_ERROR:201,GENERAL_GET_FAILURE:301,GENERAL_SET_FAILURE:351,GENERAL_COMMIT_FAILURE:391,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:402,VALUE_NOT_INITIALIZED:403,READ_ONLY_ELEMENT:404,WRITE_ONLY_ELEMENT:405,TYPE_MISMATCH:406,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408})};t.A=o},417:function(e,t,r){var i=r(635),n={CMIString256:"^.{0,255}$",CMIString4096:"^.{0,4096}$",CMITime:"^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",CMITimespan:"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{0,3})(.[0-9]*)?$",CMIIdentifier:"^[\\u0021-\\u007E\\s]{0,255}$",CMIFeedback:"^.{0,255}$",CMIIndex:"[._](\\d+).",CMIStatus:"^(passed|completed|failed|incomplete|browsed)$",CMIStatus2:"^(passed|completed|failed|incomplete|browsed|not attempted)$",CMIExit:"^(time-out|suspend|logout|)$",CMIType:"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$",CMIResult:"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$",NAVEvent:"^(previous|continue)$",score_range:"0#100",audio_range:"-1#100",speed_range:"-100#100",weighting_range:"-100#100",text_range:"-1#1"},o={aicc:(0,i.Cl)((0,i.Cl)({},n),{CMIIdentifier:"^\\w{1,255}$"}),scorm12:n,scorm2004:{CMIString200:"^[\\u0000-\\uFFFF]{0,200}$",CMIString250:"^[\\u0000-\\uFFFF]{0,250}$",CMIString1000:"^[\\u0000-\\uFFFF]{0,1000}$",CMIString4000:"^[\\u0000-\\uFFFF]{0,4000}$",CMIString64000:"^[\\u0000-\\uFFFF]{0,64000}$",CMILang:"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$",CMILangString250:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$",CMILangcr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$",CMILangString250cr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$",CMILangString4000:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$",CMITime:"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$",CMITimespan:"^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{1,5})(\\.[0-9]{1,18})?$",CMIIdentifier:"^\\S{1,250}[a-zA-Z0-9]$",CMIShortIdentifier:"^[\\w\\.\\-\\_]{1,250}$",CMILongIdentifier:"^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$",CMIFeedback:"^.*$",CMIIndex:"[._](\\d+).",CMIIndexStore:".N(\\d+).",CMICStatus:"^(completed|incomplete|not attempted|unknown)$",CMISStatus:"^(passed|failed|unknown)$",CMIExit:"^(time-out|suspend|logout|normal)$",CMIType:"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",CMIResult:"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",NAVEvent:"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$",NAVBoolean:"^(unknown|true|false$)",NAVTarget:"^{target=\\S{0,}[a-zA-Z0-9-_]+}$",scaled_range:"-1#1",audio_range:"0#*",speed_range:"0#*",text_range:"-1#1",progress_range:"0#1"}};t.A=o},784:function(e,t,r){r.d(t,{$h:function(){return c},tQ:function(){return u},yI:function(){return l}});var i=r(635),n=r(340),o=n.A.scorm12.error_descriptions,s=n.A.aicc.error_descriptions,a=n.A.scorm2004.error_descriptions,c=function(e){function t(t){var r=e.call(this,t.toString())||this;return r._errorCode=t,r.name="ScormValidationError",r}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"errorCode",{get:function(){return this._errorCode},enumerable:!1,configurable:!0}),t.prototype.setMessage=function(e){this.message=e},t}(Error),l=function(e){function t(t,r,i){var n=e.call(this,t)||this;return n._detailedMessage="",n.setMessage(r),n._errorMessage=r,i&&(n._detailedMessage=i),n}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"errorMessage",{get:function(){return this._errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"detailedMessage",{get:function(){return this._detailedMessage},enumerable:!1,configurable:!0}),t}(c),u=function(e){function t(t){return{}.hasOwnProperty.call(o,String(t))?e.call(this,t,o[String(t)].basicMessage,o[String(t)].detailMessage)||this:e.call(this,101,o[101].basicMessage,o[101].detailMessage)||this}return(0,i.C6)(t,e),t}(l);(function(e){function t(t){return{}.hasOwnProperty.call(s,String(t))?e.call(this,t,s[String(t)].basicMessage,s[String(t)].detailMessage)||this:e.call(this,101,s[101].basicMessage,s[101].detailMessage)||this}(0,i.C6)(t,e)})(l),function(e){function t(t){return{}.hasOwnProperty.call(a,String(t))?e.call(this,t,a[String(t)].basicMessage,a[String(t)].detailMessage)||this:e.call(this,101,a[101].basicMessage,a[101].detailMessage)||this}(0,i.C6)(t,e)}(l)},864:function(e,t,r){r.d(t,{Bq:function(){return a},HT:function(){return s},J6:function(){return d},UZ:function(){return n},f4:function(){return o},hw:function(){return u},sB:function(){return c}});var i=3600;function n(e){if(!e||e<=0)return"00:00:00";var t=Math.floor(e/i),r=new Date(1e3*e),n=r.getUTCMinutes(),o=r.getSeconds(),s=e%1,a="";return l(s)>0&&(a="."+(a=l(s)>2?s.toFixed(2):String(s)).split(".")[1]),(t+":"+n+":"+o).replace(/\b\d\b/g,"0$&")+a}function o(e,t){if("number"!=typeof e&&"boolean"!=typeof e||(e=String(e)),"string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var r=e.split(":");return 3600*Number(r[0])+60*Number(r[1])+Number(r[2])}function s(e,t,r){return"string"==typeof r&&(r=new RegExp(r)),n(o(e,r)+o(t,r))}function a(e){var t={};return function e(r,i){if(Object(r)!==r)t[i]=r;else if(Array.isArray(r))for(var n=0,o=r.length;n0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]=parseFloat(this.cmi.student_data.mastery_score)?"passed":"failed"):"browse"===this.cmi.core.lesson_mode&&""===((null===(c=null===(s=null===(o=this.startingData)||void 0===o?void 0:o.cmi)||void 0===s?void 0:s.core)||void 0===c?void 0:c.lesson_status)||"")&&"not attempted"===t&&(this.cmi.core.lesson_status="browsed")),r=e||this.settings.alwaysSendTotalTime,i=this.settings.renderCommonCommitFields?this.renderCommitObject(r):this.renderCommitCMI(r),this.apiLogLevel===a.A.global.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(i)),"string"!=typeof this.settings.lmsCommitUrl?[3,2]:[4,this.processHttpRequest(this.settings.lmsCommitUrl,i,e)];case 1:return[2,n.sent()];case 2:return[2,{result:a.A.global.SCORM_TRUE,errorCode:0}]}}))}))},t}(r(900).A),f=i.C;export{f as Scorm12Impl}; +//# sourceMappingURL=scorm12.min.js.map \ No newline at end of file diff --git a/dist/esm/scorm12.min.js.map b/dist/esm/scorm12.min.js.map new file mode 100644 index 0000000..1f9b20e --- /dev/null +++ b/dist/esm/scorm12.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"scorm12.min.js","mappings":"qHAMO,IAAMA,EAA4B,CACvCC,YAAY,EACZC,kBAAmB,GACnBC,aAAa,EACbC,gBAAgB,EAChBC,cAAc,EACdC,iBAAkB,OAClBC,sBAAuB,iCACvBC,cAAc,EACdC,SAAU,EAAAC,EAAaC,OAAOC,gBAC9BC,uBAAuB,EACvBC,qBAAqB,EACrBC,0BAA0B,EAC1BC,eAAe,EACfC,WAAY,CAAC,EACbC,oBAAoB,EACpBC,gBAAiB,SAAgBC,G,4HACP,IAAbA,EAAP,OACiB,KAAAC,MAAKC,MAAM,GAAMF,EAASG,S,OAC7C,OACiB,QAFXC,EAAa,WAAW,aAG3B,CAAC,EAAEC,eAAeC,KAAKF,EAAY,UAc7B,CAAP,EAAO,CACLG,OAAQH,EAAWG,OACnBC,UAAWJ,EAAWI,UAClBJ,EAAWI,UACXJ,EAAWG,SAAW,EAAAjB,EAAaC,OAAOkB,WACxC,EACA,MAlBgB,MAApBT,EAASU,OACJ,CAAP,EAAO,CACLH,OAAQ,EAAAjB,EAAaC,OAAOkB,WAC5BD,UAAW,IAGN,CAAP,EAAO,CACLD,OAAQ,EAAAjB,EAAaC,OAAOoB,YAC5BH,UAAW,M,OAcnB,MAAO,CAAP,EAAO,CACLD,OAAQ,EAAAjB,EAAaC,OAAOoB,YAC5BH,UAAW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A7hB,KAAKgC,IAAI4P,KAAKxB,cAAgB,YAK9B0R,EACJlB,GAAmB5gB,KAAKW,SAASjD,oBAC7BmB,EAAemB,KAAKW,SAAShD,yBAC/BqC,KAAK+gB,mBAAmBe,GACxB9hB,KAAK2gB,gBAAgBmB,GAErB9hB,KAAKoB,cAAgB,EAAA9D,EAAaC,OAAOgC,kBAC3CN,QAAQO,MACN,wBAA0BohB,EAAkB,MAAQ,MAAQ,OAE9D3hB,QAAQO,MAAMX,IAE0B,iBAA/BmB,KAAKW,SAAS1D,aAArB,MACK,GAAM+C,KAAKqK,mBAChBrK,KAAKW,SAAS1D,aACd4B,EACA+hB,I,OAHF,MAAO,CAAP,EAAO,U,OAMP,MAAO,CAAP,EAAO,CACLriB,OAAQ,EAAAjB,EAAaC,OAAOkB,WAC5BD,UAAW,I,QAInB,EAvaA,C,OAA0B,G","sources":["webpack://scorm-again/./src/constants/default_settings.ts","webpack://scorm-again/./src/helpers/scheduled_commit.ts","webpack://scorm-again/./src/BaseAPI.ts","webpack://scorm-again/./src/utilities/debounce.ts","webpack://scorm-again/./src/cmi/common/array.ts","webpack://scorm-again/./src/cmi/common/base_cmi.ts","webpack://scorm-again/./src/cmi/common/score.ts","webpack://scorm-again/./src/cmi/common/validation.ts","webpack://scorm-again/./src/cmi/aicc/core.ts","webpack://scorm-again/./src/cmi/scorm12/cmi.ts","webpack://scorm-again/./src/cmi/scorm12/interactions.ts","webpack://scorm-again/./src/cmi/scorm12/nav.ts","webpack://scorm-again/./src/cmi/scorm12/objectives.ts","webpack://scorm-again/./src/cmi/scorm12/student_data.ts","webpack://scorm-again/./src/cmi/scorm12/student_preference.ts","webpack://scorm-again/./src/cmi/scorm12/validation.ts","webpack://scorm-again/./src/constants/api_constants.ts","webpack://scorm-again/./src/constants/enums.ts","webpack://scorm-again/./src/constants/error_codes.ts","webpack://scorm-again/./src/constants/regex.ts","webpack://scorm-again/./src/exceptions.ts","webpack://scorm-again/./src/utilities.ts","webpack://scorm-again/./node_modules/tslib/tslib.es6.mjs","webpack://scorm-again/webpack/bootstrap","webpack://scorm-again/webpack/runtime/define property getters","webpack://scorm-again/webpack/runtime/hasOwnProperty shorthand","webpack://scorm-again/./src/Scorm12API.ts"],"sourcesContent":["import { ResultObject, Settings } from \"../types/api_types\";\nimport APIConstants from \"./api_constants\";\n\n/**\n * Default settings for the SCORM API\n */\nexport const DefaultSettings: Settings = {\n autocommit: false,\n autocommitSeconds: 10,\n asyncCommit: false,\n sendFullCommit: true,\n lmsCommitUrl: false,\n dataCommitFormat: \"json\",\n commitRequestDataType: \"application/json;charset=UTF-8\",\n autoProgress: false,\n logLevel: APIConstants.global.LOG_LEVEL_ERROR,\n selfReportSessionTime: false,\n alwaysSendTotalTime: false,\n renderCommonCommitFields: false,\n strict_errors: true,\n xhrHeaders: {},\n xhrWithCredentials: false,\n responseHandler: async function (response: Response): Promise {\n if (typeof response !== \"undefined\") {\n const httpResult = JSON.parse(await response.text());\n if (\n httpResult === null ||\n !{}.hasOwnProperty.call(httpResult, \"result\")\n ) {\n if (response.status === 200) {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n }\n } else {\n return {\n result: httpResult.result,\n errorCode: httpResult.errorCode\n ? httpResult.errorCode\n : httpResult.result === APIConstants.global.SCORM_TRUE\n ? 0\n : 101,\n };\n }\n }\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n },\n requestHandler: function (commitObject) {\n return commitObject;\n },\n onLogMessage: function (messageLevel, logMessage) {\n switch (messageLevel) {\n case APIConstants.global.LOG_LEVEL_ERROR:\n console.error(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_WARNING:\n console.warn(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_INFO:\n console.info(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_DEBUG:\n if (console.debug) {\n console.debug(logMessage);\n } else {\n console.log(logMessage);\n }\n break;\n }\n },\n scoItemIds: [],\n scoItemIdValidator: false,\n};\n","import BaseAPI from \"../BaseAPI\";\n\n/**\n * Private class that wraps a timeout call to the commit() function\n */\nexport class ScheduledCommit {\n private _API;\n private _cancelled = false;\n private readonly _timeout;\n private readonly _callback;\n\n /**\n * Constructor for ScheduledCommit\n * @param {BaseAPI} API\n * @param {number} when\n * @param {string} callback\n */\n constructor(API: BaseAPI, when: number, callback: string) {\n this._API = API;\n this._timeout = setTimeout(this.wrapper.bind(this), when);\n this._callback = callback;\n }\n\n /**\n * Cancel any currently scheduled commit\n */\n cancel() {\n this._cancelled = true;\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n }\n\n /**\n * Wrap the API commit call to check if the call has already been cancelled\n */\n wrapper() {\n if (!this._cancelled) {\n (async () => await this._API.commit(this._callback))();\n }\n }\n}\n","import { CMIArray } from \"./cmi/common/array\";\nimport { ValidationError } from \"./exceptions\";\nimport ErrorCodes, { ErrorCode } from \"./constants/error_codes\";\nimport APIConstants from \"./constants/api_constants\";\nimport { formatMessage, stringMatches, unflatten } from \"./utilities\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { debounce } from \"./utilities/debounce\";\nimport {\n RefObject,\n CommitObject,\n ResultObject,\n Settings,\n} from \"./types/api_types\";\nimport { DefaultSettings } from \"./constants/default_settings\";\nimport { IBaseAPI } from \"./interfaces/IBaseAPI\";\nimport { ScheduledCommit } from \"./helpers/scheduled_commit\";\n\n/**\n * Base API class for AICC, SCORM 1.2, and SCORM 2004. Should be considered\n * abstract, and never initialized on its own.\n */\nexport default abstract class BaseAPI implements IBaseAPI {\n private _timeout?: ScheduledCommit;\n private readonly _error_codes: ErrorCode;\n private _settings: Settings = DefaultSettings;\n\n /**\n * Constructor for Base API class. Sets some shared API fields, as well as\n * sets up options for the API.\n * @param {ErrorCode} error_codes\n * @param {Settings} settings\n */\n protected constructor(error_codes: ErrorCode, settings?: Settings) {\n if (new.target === BaseAPI) {\n throw new TypeError(\"Cannot construct BaseAPI instances directly\");\n }\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n\n this._error_codes = error_codes;\n\n if (settings) {\n this.settings = settings;\n }\n this.apiLogLevel = this.settings.logLevel;\n this.selfReportSessionTime = this.settings.selfReportSessionTime;\n }\n\n public abstract cmi: BaseCMI;\n public startingData?: RefObject;\n\n public currentState: number;\n public lastErrorCode: string;\n public listenerArray: any[];\n public apiLogLevel: number;\n public selfReportSessionTime: boolean;\n\n abstract reset(settings?: Settings): void;\n\n /**\n * Common reset method for all APIs. New settings are merged with the existing settings.\n * @param {Settings} settings\n * @protected\n */\n commonReset(settings?: Settings): void {\n this.settings = { ...this.settings, ...settings };\n\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n }\n\n /**\n * Initialize the API\n * @param {string} callbackName\n * @param {string} initializeMessage\n * @param {string} terminationMessage\n * @return {string}\n */\n initialize(\n callbackName: string,\n initializeMessage?: string,\n terminationMessage?: string,\n ): string {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);\n } else if (this.isTerminated()) {\n this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage);\n } else {\n if (this.selfReportSessionTime) {\n this.cmi.setStartTime();\n }\n\n this.currentState = APIConstants.global.STATE_INITIALIZED;\n this.lastErrorCode = \"0\";\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n abstract lmsInitialize(): string;\n\n abstract lmsFinish(): string;\n\n abstract lmsGetValue(CMIElement: string): string;\n\n abstract lmsSetValue(CMIElement: string, value: any): string;\n\n abstract lmsCommit(): string;\n\n abstract lmsGetLastError(): string;\n\n abstract lmsGetErrorString(CMIErrorCode: string | number): string;\n\n abstract lmsGetDiagnostic(CMIErrorCode: string | number): string;\n\n /**\n * Abstract method for validating that a response is correct.\n *\n * @param {string} _CMIElement\n * @param {any} _value\n */\n abstract validateCorrectResponse(_CMIElement: string, _value: any): void;\n\n /**\n * Gets or builds a new child element to add to the array.\n * APIs that inherit BaseAPI should override this method.\n *\n * @param {string} _CMIElement - unused\n * @param {*} _value - unused\n * @param {boolean} _foundFirstIndex - unused\n * @return {BaseCMI|null}\n * @abstract\n */\n abstract getChildElement(\n _CMIElement: string,\n _value: any,\n _foundFirstIndex: boolean,\n ): BaseCMI | null;\n\n /**\n * Attempts to store the data to the LMS, logs data if no LMS configured\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _calculateTotalTime\n * @return {ResultObject}\n * @abstract\n */\n abstract storeData(_calculateTotalTime: boolean): Promise;\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _terminateCommit\n * @return {RefObject|Array}\n * @abstract\n */\n abstract renderCommitCMI(_terminateCommit: boolean): RefObject | Array;\n\n /**\n * Render the commit object to the shortened format for LMS commit\n * @param {boolean} _terminateCommit\n * @return {CommitObject}\n */\n abstract renderCommitObject(_terminateCommit: boolean): CommitObject;\n\n /**\n * Logging for all SCORM actions\n *\n * @param {string} functionName\n * @param {string} logMessage\n * @param {number} messageLevel\n * @param {string} CMIElement\n */\n apiLog(\n functionName: string,\n logMessage: string,\n messageLevel: number,\n CMIElement?: string,\n ) {\n logMessage = formatMessage(functionName, logMessage, CMIElement);\n\n if (messageLevel >= this.apiLogLevel) {\n this.settings.onLogMessage(messageLevel, logMessage);\n }\n }\n\n /**\n * Getter for _error_codes\n * @return {ErrorCode}\n */\n get error_codes(): ErrorCode {\n return this._error_codes;\n }\n\n /**\n * Getter for _settings\n * @return {Settings}\n */\n get settings(): Settings {\n return this._settings;\n }\n\n /**\n * Setter for _settings\n * @param {Settings} settings\n */\n set settings(settings: Settings) {\n this._settings = { ...this._settings, ...settings };\n }\n\n /**\n * Terminates the current run of the API\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async terminate(\n callbackName: string,\n checkTerminated: boolean,\n ): Promise {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.TERMINATION_BEFORE_INIT,\n this._error_codes.MULTIPLE_TERMINATION,\n )\n ) {\n this.currentState = APIConstants.global.STATE_TERMINATED;\n\n const result: ResultObject = await this.storeData(true);\n if (typeof result.errorCode !== \"undefined\" && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Get the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @return {string}\n */\n getValue(\n callbackName: string,\n checkTerminated: boolean,\n CMIElement: string,\n ): string {\n let returnValue: string = \"\";\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.RETRIEVE_BEFORE_INIT,\n this._error_codes.RETRIEVE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.getCMIValue(CMIElement);\n } catch (e) {\n returnValue = this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement);\n }\n\n this.apiLog(\n callbackName,\n \": returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n\n if (returnValue === undefined) {\n return \"\";\n }\n\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Sets the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {string} commitCallback\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setValue(\n callbackName: string,\n commitCallback: string,\n checkTerminated: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (value !== undefined) {\n value = String(value);\n }\n let returnValue: string = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.STORE_BEFORE_INIT,\n this._error_codes.STORE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.setCMIValue(CMIElement, value);\n } catch (e) {\n this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement, value);\n }\n\n if (returnValue === undefined) {\n returnValue = APIConstants.global.SCORM_FALSE;\n }\n\n // If we didn't have any errors while setting the data, go ahead and\n // schedule a commit, if autocommit is turned on\n if (String(this.lastErrorCode) === \"0\") {\n if (this.settings.autocommit && !this._timeout) {\n this.scheduleCommit(\n this.settings.autocommitSeconds * 1000,\n commitCallback,\n );\n }\n }\n\n this.apiLog(\n callbackName,\n \": \" + value + \": result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Orders LMS to store all content parameters\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async commit(\n callbackName: string,\n checkTerminated: boolean = false,\n ): Promise {\n this.clearScheduledCommit();\n\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.COMMIT_BEFORE_INIT,\n this._error_codes.COMMIT_AFTER_TERM,\n )\n ) {\n const result = await this.storeData(false);\n if (result.errorCode && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n this.apiLog(\n callbackName,\n \" Result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"HttpRequest\",\n );\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Returns last error code\n * @param {string} callbackName\n * @return {string}\n */\n getLastError(callbackName: string): string {\n const returnValue = String(this.lastErrorCode);\n\n this.processListeners(callbackName);\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getErrorString(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getDiagnostic(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Checks the LMS state and ensures it has been initialized.\n *\n * @param {boolean} checkTerminated\n * @param {number} beforeInitError\n * @param {number} afterTermError\n * @return {boolean}\n */\n checkState(\n checkTerminated: boolean,\n beforeInitError: number,\n afterTermError: number,\n ): boolean {\n if (this.isNotInitialized()) {\n this.throwSCORMError(beforeInitError);\n return false;\n } else if (checkTerminated && this.isTerminated()) {\n this.throwSCORMError(afterTermError);\n return false;\n }\n\n return true;\n }\n\n /**\n * Returns the message that corresponds to errorNumber\n * APIs that inherit BaseAPI should override this function\n *\n * @param {(string|number)} _errorNumber\n * @param {boolean} _detail\n * @return {string}\n * @abstract\n */\n getLmsErrorMessageDetails(\n _errorNumber: string | number,\n _detail: boolean = false,\n ): string {\n throw new Error(\n \"The getLmsErrorMessageDetails method has not been implemented\",\n );\n }\n\n /**\n * Gets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @return {string}\n * @abstract\n */\n getCMIValue(_CMIElement: string): string {\n throw new Error(\"The getCMIValue method has not been implemented\");\n }\n\n /**\n * Sets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @param {any} _value\n * @return {string}\n * @abstract\n */\n setCMIValue(_CMIElement: string, _value: any): string {\n throw new Error(\"The setCMIValue method has not been implemented\");\n }\n\n /**\n * Shared API method to set a valid for a given element.\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n _commonSetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (!CMIElement || CMIElement === \"\") {\n return APIConstants.global.SCORM_FALSE;\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let returnValue = APIConstants.global.SCORM_FALSE;\n let foundFirstIndex = false;\n\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n const attribute = structure[idx];\n\n if (idx === structure.length - 1) {\n if (scorm2004 && attribute.substring(0, 8) === \"{target=\") {\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);\n } else {\n refObject = {\n ...refObject,\n attribute: value,\n };\n }\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (\n stringMatches(CMIElement, \"\\\\.correct_responses\\\\.\\\\d+\") &&\n this.isInitialized()\n ) {\n this.validateCorrectResponse(CMIElement, value);\n }\n\n if (!scorm2004 || this.lastErrorCode === \"0\") {\n refObject[attribute] = value;\n returnValue = APIConstants.global.SCORM_TRUE;\n }\n }\n } else {\n refObject = refObject[attribute];\n if (!refObject) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n foundFirstIndex = true;\n } else {\n const newChild = this.getChildElement(\n CMIElement,\n value,\n foundFirstIndex,\n );\n foundFirstIndex = true;\n\n if (!newChild) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (refObject.initialized) newChild.initialize();\n\n refObject.childArray.push(newChild);\n refObject = newChild;\n }\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n }\n\n if (returnValue === APIConstants.global.SCORM_FALSE) {\n this.apiLog(\n methodName,\n `There was an error setting the value for: ${CMIElement}, value of: ${value}`,\n APIConstants.global.LOG_LEVEL_WARNING,\n );\n }\n\n return returnValue;\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @return {any}\n */\n _commonGetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n ): any {\n if (!CMIElement || CMIElement === \"\") {\n return \"\";\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let attribute = null;\n\n const uninitializedErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) has not been initialized.`;\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n attribute = structure[idx];\n\n if (!scorm2004) {\n if (idx === structure.length - 1) {\n if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n } else {\n if (\n String(attribute).substring(0, 8) === \"{target=\" &&\n typeof refObject._isTargetValid == \"function\"\n ) {\n const target = String(attribute).substring(\n 8,\n String(attribute).length - 9,\n );\n return refObject._isTargetValid(target);\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n\n refObject = refObject[attribute];\n if (refObject === undefined) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n } else {\n this.throwSCORMError(\n this._error_codes.VALUE_NOT_INITIALIZED,\n uninitializedErrorMessage,\n );\n break;\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n\n if (refObject === null || refObject === undefined) {\n if (!scorm2004) {\n if (attribute === \"_children\") {\n this.throwSCORMError(ErrorCodes.scorm12.CHILDREN_ERROR);\n } else if (attribute === \"_count\") {\n this.throwSCORMError(ErrorCodes.scorm12.COUNT_ERROR);\n }\n }\n } else {\n return refObject;\n }\n }\n\n /**\n * Returns true if the API's current state is STATE_INITIALIZED\n *\n * @return {boolean}\n */\n isInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_NOT_INITIALIZED\n *\n * @return {boolean}\n */\n isNotInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_NOT_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_TERMINATED\n *\n * @return {boolean}\n */\n isTerminated(): boolean {\n return this.currentState === APIConstants.global.STATE_TERMINATED;\n }\n\n /**\n * Provides a mechanism for attaching to a specific SCORM event\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n on(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray.push({\n functionName: functionName,\n CMIElement: CMIElement,\n callback: callback,\n });\n\n this.apiLog(\n \"on\",\n `Added event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n\n /**\n * Provides a mechanism for detaching a specific SCORM event listener\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n off(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n const removeIndex = this.listenerArray.findIndex(\n (obj) =>\n obj.functionName === functionName &&\n obj.CMIElement === CMIElement &&\n obj.callback === callback,\n );\n if (removeIndex !== -1) {\n this.listenerArray.splice(removeIndex, 1);\n this.apiLog(\n \"off\",\n `Removed event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n }\n\n /**\n * Provides a mechanism for clearing all listeners from a specific SCORM event\n *\n * @param {string} listenerName\n */\n clear(listenerName: string) {\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray = this.listenerArray.filter(\n (obj) =>\n obj.functionName !== functionName && obj.CMIElement !== CMIElement,\n );\n }\n }\n\n /**\n * Processes any 'on' listeners that have been created\n *\n * @param {string} functionName\n * @param {string} CMIElement\n * @param {any} value\n */\n processListeners(functionName: string, CMIElement?: string, value?: any) {\n this.apiLog(\n functionName,\n value,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n for (let i = 0; i < this.listenerArray.length; i++) {\n const listener = this.listenerArray[i];\n const functionsMatch = listener.functionName === functionName;\n const listenerHasCMIElement = !!listener.CMIElement;\n let CMIElementsMatch = false;\n if (\n CMIElement &&\n listener.CMIElement &&\n listener.CMIElement.substring(listener.CMIElement.length - 1) === \"*\"\n ) {\n CMIElementsMatch =\n CMIElement.indexOf(\n listener.CMIElement.substring(0, listener.CMIElement.length - 1),\n ) === 0;\n } else {\n CMIElementsMatch = listener.CMIElement === CMIElement;\n }\n\n if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {\n this.apiLog(\n \"processListeners\",\n `Processing listener: ${listener.functionName}`,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n listener.callback(CMIElement, value);\n }\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} errorNumber\n * @param {string} message\n */\n throwSCORMError(errorNumber: number, message?: string) {\n if (!message) {\n message = this.getLmsErrorMessageDetails(errorNumber);\n }\n\n this.apiLog(\n \"throwSCORMError\",\n errorNumber + \": \" + message,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n\n this.lastErrorCode = String(errorNumber);\n }\n\n /**\n * Clears the last SCORM error code on success.\n *\n * @param {string} success\n */\n clearSCORMError(success: string) {\n if (success !== undefined && success !== APIConstants.global.SCORM_FALSE) {\n this.lastErrorCode = \"0\";\n }\n }\n\n /**\n * Load the CMI from a flattened JSON object\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromFlattenedJSON(json: RefObject, CMIElement?: string) {\n if (!CMIElement) {\n // by default, we start from a blank string because we're expecting each element to start with `cmi`\n CMIElement = \"\";\n }\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromFlattenedJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n /**\n * Tests two strings against a given regular expression pattern and determines a numeric or null result based on the matching criterion.\n *\n * @param {string} a - The first string to be tested against the pattern.\n * @param {string} c - The second string to be tested against the pattern.\n * @param {RegExp} a_pattern - The regular expression pattern to test the strings against.\n * @return {number | null} A numeric result based on the matching criterion, or null if the strings do not match the pattern.\n */\n function testPattern(\n a: string,\n c: string,\n a_pattern: RegExp,\n ): number | null {\n const a_match = a.match(a_pattern);\n\n let c_match;\n if (a_match !== null && (c_match = c.match(a_pattern)) !== null) {\n const a_num = Number(a_match[2]);\n const c_num = Number(c_match[2]);\n if (a_num === c_num) {\n if (a_match[3] === \"id\") {\n return -1;\n } else if (a_match[3] === \"type\") {\n if (c_match[3] === \"id\") {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 1;\n }\n }\n return a_num - c_num;\n }\n\n return null;\n }\n\n const int_pattern = /^(cmi\\.interactions\\.)(\\d+)\\.(.*)$/;\n const obj_pattern = /^(cmi\\.objectives\\.)(\\d+)\\.(.*)$/;\n\n const result = Object.keys(json).map(function (key) {\n return [String(key), json[key]];\n });\n\n // CMI interactions need to have id and type loaded before any other fields\n result.sort(function ([a, _b], [c, _d]) {\n let test;\n if ((test = testPattern(a, c, int_pattern)) !== null) {\n return test;\n }\n if ((test = testPattern(a, c, obj_pattern)) !== null) {\n return test;\n }\n\n if (a < c) {\n return -1;\n }\n if (a > c) {\n return 1;\n }\n return 0;\n });\n\n let obj: RefObject;\n result.forEach((element) => {\n obj = {};\n obj[element[0]] = element[1];\n this.loadFromJSON(unflatten(obj), CMIElement);\n });\n }\n\n /**\n * Loads CMI data from a JSON object.\n *\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromJSON(json: RefObject, CMIElement: string) {\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n CMIElement = CMIElement !== undefined ? CMIElement : \"cmi\";\n\n this.startingData = json;\n\n // could this be refactored down to flatten(json) then setCMIValue on each?\n for (const key in json) {\n if ({}.hasOwnProperty.call(json, key) && json[key]) {\n const currentCMIElement = (CMIElement ? CMIElement + \".\" : \"\") + key;\n const value = json[key];\n\n if (value[\"childArray\"]) {\n for (let i = 0; i < value[\"childArray\"].length; i++) {\n this.loadFromJSON(\n value[\"childArray\"][i],\n currentCMIElement + \".\" + i,\n );\n }\n } else if (value.constructor === Object) {\n this.loadFromJSON(value, currentCMIElement);\n } else {\n this.setCMIValue(currentCMIElement, value);\n }\n }\n }\n }\n\n /**\n * Render the CMI object to JSON for sending to an LMS.\n *\n * @return {string}\n */\n renderCMIToJSONString(): string {\n const cmi = this.cmi;\n // Do we want/need to return fields that have no set value?\n if (this.settings.sendFullCommit) {\n return JSON.stringify({ cmi });\n }\n return JSON.stringify({ cmi }, (k, v) => (v === undefined ? null : v), 2);\n }\n\n /**\n * Returns a JS object representing the current cmi\n * @return {object}\n */\n renderCMIToJSONObject(): object {\n return JSON.parse(this.renderCMIToJSONString());\n }\n\n /**\n * Send the request to the LMS\n * @param {string} url\n * @param {CommitObject|RefObject|Array} params\n * @param {boolean} immediate\n * @return {ResultObject}\n */\n async processHttpRequest(\n url: string,\n params: CommitObject | RefObject | Array,\n immediate: boolean = false,\n ): Promise {\n const api = this;\n const genericError: ResultObject = {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: this.error_codes.GENERAL,\n };\n\n // if we are terminating the module or closing the browser window/tab, we need to make this fetch ASAP.\n // Some browsers, especially Chrome, do not like synchronous requests to be made when the window is closing.\n if (immediate) {\n this.performFetch(url, params).then(async (response) => {\n await this.transformResponse(response);\n });\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n\n const process = async (\n url: string,\n params: CommitObject | RefObject | Array,\n settings: Settings,\n ): Promise => {\n try {\n params = settings.requestHandler(params);\n const response = await this.performFetch(url, params);\n\n return this.transformResponse(response);\n } catch (e) {\n this.apiLog(\n \"processHttpRequest\",\n e,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n api.processListeners(\"CommitError\");\n return genericError;\n }\n };\n\n if (this.settings.asyncCommit) {\n const debouncedProcess = debounce(process, 500, immediate);\n debouncedProcess(url, params, this.settings);\n\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return await process(url, params, this.settings);\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} when - the number of milliseconds to wait before committing\n * @param {string} callback - the name of the commit event callback\n */\n scheduleCommit(when: number, callback: string) {\n this._timeout = new ScheduledCommit(this, when, callback);\n this.apiLog(\n \"scheduleCommit\",\n \"scheduled\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n\n /**\n * Clears and cancels any currently scheduled commits\n */\n clearScheduledCommit() {\n if (this._timeout) {\n this._timeout.cancel();\n this._timeout = undefined;\n this.apiLog(\n \"clearScheduledCommit\",\n \"cleared\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n }\n\n /**\n * Check to see if the specific object has the given property\n * @param {RefObject} refObject\n * @param {string} attribute\n * @return {boolean}\n * @private\n */\n private _checkObjectHasProperty(\n refObject: RefObject,\n attribute: string,\n ): boolean {\n return (\n Object.hasOwnProperty.call(refObject, attribute) ||\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(refObject),\n attribute,\n ) != null ||\n attribute in refObject\n );\n }\n\n /**\n * Handles the error that occurs when trying to access a value\n * @param {any} e\n * @param {string} returnValue\n * @return {string}\n * @private\n */\n private handleValueAccessException(e: any, returnValue: string): string {\n if (e instanceof ValidationError) {\n this.lastErrorCode = String(e.errorCode);\n returnValue = APIConstants.global.SCORM_FALSE;\n } else {\n if (e instanceof Error && e.message) {\n console.error(e.message);\n } else {\n console.error(e);\n }\n this.throwSCORMError(this._error_codes.GENERAL);\n }\n return returnValue;\n }\n\n /**\n * Perform the fetch request to the LMS\n * @param {string} url\n * @param {RefObject|Array} params\n * @return {Promise}\n * @private\n */\n private async performFetch(\n url: string,\n params: RefObject | Array,\n ): Promise {\n return fetch(url, {\n method: \"POST\",\n body: params instanceof Array ? params.join(\"&\") : JSON.stringify(params),\n headers: {\n ...this.settings.xhrHeaders,\n \"Content-Type\": this.settings.commitRequestDataType,\n },\n credentials: this.settings.xhrWithCredentials ? \"include\" : undefined,\n keepalive: true,\n });\n }\n\n /**\n * Transforms the response from the LMS to a ResultObject\n * @param {Response} response\n * @return {Promise}\n * @private\n */\n private async transformResponse(response: Response): Promise {\n const result =\n typeof this.settings.responseHandler === \"function\"\n ? await this.settings.responseHandler(response)\n : await response.json();\n\n if (\n response.status >= 200 &&\n response.status <= 299 &&\n (result.result === true ||\n result.result === APIConstants.global.SCORM_TRUE)\n ) {\n this.processListeners(\"CommitSuccess\");\n } else {\n this.processListeners(\"CommitError\");\n }\n return result;\n }\n}\n","/**\n * Debounce function to delay the execution of a given function.\n *\n * @param func - The function to debounce.\n * @param wait - The number of milliseconds to delay.\n * @param immediate - If `true`, the function will be triggered on the leading edge instead of the trailing.\n * @returns A debounced version of the provided function.\n */\nexport function debounce void>(\n func: T,\n wait: number,\n immediate = false,\n): (...args: Parameters) => void {\n let timeout: ReturnType | null;\n\n return function (this: any, ...args: Parameters) {\n const context = this;\n\n const later = () => {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n const callNow = immediate && !timeout;\n\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) func.apply(context, args);\n };\n}\n","import { BaseCMI } from \"./base_cmi\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.n objects\n */\nexport class CMIArray extends BaseCMI {\n private readonly _errorCode: number;\n private readonly _errorClass: typeof BaseScormValidationError;\n private readonly __children: string;\n childArray: any[];\n\n /**\n * Constructor cmi *.n arrays\n * @param {object} params\n */\n constructor(params: {\n children: string;\n errorCode?: number;\n errorClass?: typeof BaseScormValidationError;\n }) {\n super();\n this.__children = params.children;\n this._errorCode = params.errorCode || scorm12_error_codes.GENERAL;\n this._errorClass = params.errorClass || BaseScormValidationError;\n this.childArray = [];\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * Getter for _count\n * @return {number}\n */\n get _count(): number {\n return this.childArray.length;\n }\n\n /**\n * Setter for _count. Just throws an error.\n * @param {number} _count\n */\n set _count(_count: number) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * toJSON for *.n arrays\n * @return {object}\n */\n toJSON(): object {\n this.jsonString = true;\n const result: { [key: string]: any } = {};\n for (let i = 0; i < this.childArray.length; i++) {\n result[i + \"\"] = this.childArray[i];\n }\n delete this.jsonString;\n return result;\n }\n}\n","/**\n * Base class for API cmi objects\n */\nexport abstract class BaseCMI {\n jsonString? = false;\n private _initialized = false;\n private _start_time: number | undefined;\n\n /**\n * Getter for _initialized\n * @return {boolean}\n */\n get initialized(): boolean {\n return this._initialized;\n }\n\n /**\n * Getter for _start_time\n * @return {number | undefined}\n */\n get start_time(): number | undefined {\n return this._start_time;\n }\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize(): void {\n this._initialized = true;\n }\n\n /**\n * Called when the player should override the 'session_time' provided by\n * the module\n */\n setStartTime(): void {\n this._start_time = new Date().getTime();\n }\n}\n\n/**\n * Base class for cmi root objects\n */\nexport abstract class BaseRootCMI extends BaseCMI {\n abstract getCurrentTotalTime(): string;\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport { BaseCMI } from \"./base_cmi\";\nimport { checkValidFormat, checkValidRange } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nconst scorm12_constants = APIConstants.scorm12;\nconst scorm12_regex = Regex.scorm12;\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.score objects\n */\nexport class CMIScore extends BaseCMI {\n private readonly __children: string;\n private readonly __score_range: string | false;\n private readonly __invalid_error_code: number;\n private readonly __invalid_type_code: number;\n private readonly __invalid_range_code: number;\n private readonly __decimal_regex: string;\n private readonly __error_class: typeof BaseScormValidationError;\n private _raw = \"\";\n private _min = \"\";\n private _max: string;\n\n /**\n * Constructor for *.score\n * @param {\n * score_children: string,\n * score_range: string,\n * max: string,\n * invalidErrorCode: number,\n * invalidTypeCode: number,\n * invalidRangeCode: number,\n * decimalRegex: string,\n * errorClass: typeof BaseScormValidationError\n * } params\n */\n constructor(params: {\n score_children?: string;\n score_range?: string;\n max?: string;\n invalidErrorCode?: number;\n invalidTypeCode?: number;\n invalidRangeCode?: number;\n decimalRegex?: string;\n errorClass: typeof BaseScormValidationError;\n }) {\n super();\n\n this.__children = params.score_children || scorm12_constants.score_children;\n this.__score_range = !params.score_range\n ? false\n : scorm12_regex.score_range;\n this._max = params.max || params.max === \"\" ? params.max : \"100\";\n this.__invalid_error_code =\n params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE;\n this.__invalid_type_code =\n params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH;\n this.__invalid_range_code =\n params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE;\n this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;\n this.__error_class = params.errorClass;\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this.__error_class(this.__invalid_error_code);\n }\n\n /**\n * Getter for _raw\n * @return {string}\n */\n get raw(): string {\n return this._raw;\n }\n\n /**\n * Setter for _raw\n * @param {string} raw\n */\n set raw(raw: string) {\n if (\n checkValidFormat(\n raw,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n raw,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._raw = raw;\n }\n }\n\n /**\n * Getter for _min\n * @return {string}\n */\n get min(): string {\n return this._min;\n }\n\n /**\n * Setter for _min\n * @param {string} min\n */\n set min(min: string) {\n if (\n checkValidFormat(\n min,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n min,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._min = min;\n }\n }\n\n /**\n * Getter for _max\n * @return {string}\n */\n get max(): string {\n return this._max;\n }\n\n /**\n * Setter for _max\n * @param {string} max\n */\n set max(max: string) {\n if (\n checkValidFormat(\n max,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n max,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._max = max;\n }\n }\n\n /**\n * toJSON for *.score\n * @return {\n * {\n * min: string,\n * max: string,\n * raw: string\n * }\n * }\n */\n toJSON(): {\n min: string;\n max: string;\n raw: string;\n } {\n this.jsonString = true;\n const result = {\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseScormValidationError } from \"../../exceptions\";\n\n/**\n * Check if the value matches the proper format. If not, throw proper error code.\n *\n * @param {string} value\n * @param {string} regexPattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @param {boolean} [allowEmptyString]\n * @return {boolean}\n */\nexport function checkValidFormat(\n value: string,\n regexPattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n allowEmptyString?: boolean,\n): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n const formatRegex = new RegExp(regexPattern);\n const matches = value.match(formatRegex);\n if (allowEmptyString && value === \"\") {\n return true;\n }\n if (value === undefined || !matches || matches[0] === \"\") {\n throw new errorClass(errorCode);\n }\n return true;\n}\n\n/**\n * Check if the value matches the proper range. If not, throw proper error code.\n *\n * @param {any} value\n * @param {string} rangePattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @return {boolean}\n */\nexport function checkValidRange(\n value: any,\n rangePattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n): boolean {\n const ranges = rangePattern.split(\"#\");\n value = value * 1.0;\n if (value >= ranges[0]) {\n if (ranges[1] === \"*\" || value <= ranges[1]) {\n return true;\n } else {\n throw new errorClass(errorCode);\n }\n } else {\n throw new errorClass(errorCode);\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { check12ValidFormat } from \"../scorm12/validation\";\nimport * as Util from \"../../utilities\";\n\n/**\n * Class representing the `cmi.core` object\n * @extends BaseCMI\n */\nexport class CMICore extends BaseCMI {\n /**\n * Constructor for `cmi.core`\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private __children = APIConstants.scorm12.core_children;\n private _student_id = \"\";\n private _student_name = \"\";\n private _lesson_location = \"\";\n private _credit = \"\";\n private _lesson_status = \"not attempted\";\n private _entry = \"\";\n private _total_time = \"\";\n private _lesson_mode = \"normal\";\n private _exit = \"\";\n private _session_time = \"00:00:00\";\n private _suspend_data = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _student_id\n * @return {string}\n */\n get student_id(): string {\n return this._student_id;\n }\n\n /**\n * Setter for _student_id. Can only be called before initialization.\n * @param {string} student_id\n */\n set student_id(student_id: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_id = student_id;\n }\n }\n\n /**\n * Getter for _student_name\n * @return {string}\n */\n get student_name(): string {\n return this._student_name;\n }\n\n /**\n * Setter for _student_name. Can only be called before initialization.\n * @param {string} student_name\n */\n set student_name(student_name: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_name = student_name;\n }\n }\n\n /**\n * Getter for _lesson_location\n * @return {string}\n */\n get lesson_location(): string {\n return this._lesson_location;\n }\n\n /**\n * Setter for _lesson_location\n * @param {string} lesson_location\n */\n set lesson_location(lesson_location: string) {\n if (check12ValidFormat(lesson_location, Regex.scorm12.CMIString256, true)) {\n this._lesson_location = lesson_location;\n }\n }\n\n /**\n * Getter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (this.initialized) {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus)) {\n this._lesson_status = lesson_status;\n }\n } else {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Getter for _lesson_mode\n * @return {string}\n */\n get lesson_mode(): string {\n return this._lesson_mode;\n }\n\n /**\n * Setter for _lesson_mode. Can only be called before initialization.\n * @param {string} lesson_mode\n */\n set lesson_mode(lesson_mode: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._lesson_mode = lesson_mode;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._exit;\n }\n\n /**\n * Setter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check12ValidFormat(exit, Regex.scorm12.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check12ValidFormat(session_time, Regex.scorm12.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (check12ValidFormat(suspend_data, Regex.scorm12.CMIString4096, true)) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n * @param {number} start_time\n * @return {string}\n */\n getCurrentTotalTime(start_time: number | undefined): string {\n let sessionTime = this._session_time;\n const startTime = start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsHHMMSS(seconds / 1000);\n }\n\n return Util.addHHMMSSTimeStrings(\n this._total_time,\n sessionTime,\n new RegExp(Regex.scorm12.CMITimespan),\n );\n }\n\n /**\n * toJSON for cmi.core\n *\n * @return {\n * {\n * student_name: string,\n * entry: string,\n * exit: string,\n * score: CMIScore,\n * student_id: string,\n * lesson_mode: string,\n * lesson_location: string,\n * lesson_status: string,\n * credit: string,\n * session_time: string\n * }\n * }\n */\n toJSON(): {\n student_name: string;\n entry: string;\n exit: string;\n score: CMIScore;\n student_id: string;\n lesson_mode: string;\n lesson_location: string;\n lesson_status: string;\n credit: string;\n session_time: string;\n } {\n this.jsonString = true;\n const result = {\n student_id: this.student_id,\n student_name: this.student_name,\n lesson_location: this.lesson_location,\n credit: this.credit,\n lesson_status: this.lesson_status,\n entry: this.entry,\n lesson_mode: this.lesson_mode,\n exit: this.exit,\n session_time: this.session_time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat } from \"./validation\";\nimport { CMICore } from \"../aicc/core\";\nimport { CMIObjectives } from \"./objectives\";\nimport { CMIStudentData } from \"./student_data\";\nimport { CMIStudentPreference } from \"./student_preference\";\nimport { CMIInteractions } from \"./interactions\";\n\n/**\n * Class representing the cmi object for SCORM 1.2\n */\nexport class CMI extends BaseRootCMI {\n private readonly __children: string = \"\";\n private __version: string = \"3.4\";\n private _launch_data: string = \"\";\n private _comments: string = \"\";\n private _comments_from_lms: string = \"\";\n\n /**\n * Constructor for the SCORM 1.2 cmi object\n * @param {string} cmi_children\n * @param {(CMIStudentData|AICCCMIStudentData)} student_data\n * @param {boolean} initialized\n */\n constructor(\n cmi_children?: string,\n student_data?: CMIStudentData,\n initialized?: boolean,\n ) {\n super();\n if (initialized) this.initialize();\n this.__children = cmi_children\n ? cmi_children\n : APIConstants.scorm12.cmi_children;\n this.core = new CMICore();\n this.objectives = new CMIObjectives();\n this.student_data = student_data ? student_data : new CMIStudentData();\n this.student_preference = new CMIStudentPreference();\n this.interactions = new CMIInteractions();\n }\n\n public core: CMICore;\n public objectives: CMIObjectives;\n public student_data: CMIStudentData;\n public student_preference: CMIStudentPreference;\n public interactions: CMIInteractions;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.core?.initialize();\n this.objectives?.initialize();\n this.student_data?.initialize();\n this.student_preference?.initialize();\n this.interactions?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n interactions: CMIInteractions;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n interactions: this.interactions,\n };\n delete this.jsonString;\n return result;\n }\n\n /**\n * Getter for __version\n * @return {string}\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n */\n set _version(_version: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for __children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this.core?.suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (this.core) {\n this.core.suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _comments\n * @return {string}\n */\n get comments(): string {\n return this._comments;\n }\n\n /**\n * Setter for _comments\n * @param {string} comments\n */\n set comments(comments: string) {\n if (check12ValidFormat(comments, Regex.scorm12.CMIString4096, true)) {\n this._comments = comments;\n }\n }\n\n /**\n * Getter for _comments_from_lms\n * @return {string}\n */\n get comments_from_lms(): string {\n return this._comments_from_lms;\n }\n\n /**\n * Setter for _comments_from_lms. Can only be called before initialization.\n * @param {string} comments_from_lms\n */\n set comments_from_lms(comments_from_lms: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._comments_from_lms = comments_from_lms;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string}\n */\n getCurrentTotalTime(): string {\n return this.core.getCurrentTotalTime(this.start_time);\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 `cmi.interactions`\n * @extends CMIArray\n */\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.interactions`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.interactions_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n object\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.correct_responses_children,\n });\n }\n\n public readonly objectives: CMIArray;\n public readonly correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n private _id = \"\";\n private _time = \"\";\n private _type = \"\";\n private _weighting = \"\";\n private _student_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n\n /**\n * Getter for _id. Should only be called during JSON export.\n * @return {string}\n */\n get id(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _time. Should only be called during JSON export.\n * @return {string}\n */\n get time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (check12ValidFormat(time, Regex.scorm12.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _type. Should only be called during JSON export.\n * @return {string}\n */\n get type(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (check12ValidFormat(type, Regex.scorm12.CMIType)) {\n this._type = type;\n }\n }\n\n /**\n * Getter for _weighting. Should only be called during JSON export.\n * @return {string}\n */\n get weighting(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (\n check12ValidFormat(weighting, Regex.scorm12.CMIDecimal) &&\n check12ValidRange(weighting, Regex.scorm12.weighting_range)\n ) {\n this._weighting = weighting;\n }\n }\n\n /**\n * Getter for _student_response. Should only be called during JSON export.\n * @return {string}\n */\n get student_response(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._student_response;\n }\n\n /**\n * Setter for _student_response\n * @param {string} student_response\n */\n set student_response(student_response: string) {\n if (check12ValidFormat(student_response, Regex.scorm12.CMIFeedback, true)) {\n this._student_response = student_response;\n }\n }\n\n /**\n * Getter for _result. Should only be called during JSON export.\n * @return {string}\n */\n get result(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check12ValidFormat(result, Regex.scorm12.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency. Should only be called during JSON export.\n * @return {string}\n */\n get latency(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (check12ValidFormat(latency, Regex.scorm12.CMITimespan)) {\n this._latency = latency;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * time: string,\n * type: string,\n * weighting: string,\n * student_response: string,\n * result: string,\n * latency: string,\n * objectives: CMIArray,\n * correct_responses: CMIArray\n * }\n * }\n */\n toJSON(): {\n id: string;\n time: string;\n type: string;\n weighting: string;\n student_response: string;\n result: string;\n latency: string;\n objectives: CMIArray;\n correct_responses: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n time: this.time,\n type: this.type,\n weighting: this.weighting,\n student_response: this.student_response,\n result: this.result,\n latency: this.latency,\n objectives: this.objectives,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n private _id = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.correct_responses.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.correct_responses.n\n */\n constructor() {\n super();\n }\n\n private _pattern = \"\";\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check12ValidFormat(pattern, Regex.scorm12.CMIFeedback, true)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON for cmi.interactions.correct_responses.n\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this._pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {BaseCMI} from \"../common/base_cmi\";\nimport {check12ValidFormat} from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class for AICC Navigation object\n */\nexport class NAV extends BaseCMI {\n /**\n * Constructor for NAV object\n */\n constructor() {\n super();\n }\n\n private _event = \"\";\n\n /**\n * Getter for _event\n * @return {string}\n */\n get event(): string {\n return this._event;\n }\n\n /**\n * Setter for _event\n * @param {string} event\n */\n set event(event: string) {\n if (check12ValidFormat(event, Regex.scorm12.NAVEvent)) {\n this._event = event;\n }\n }\n\n /**\n * toJSON for nav object\n * @return {\n * {\n * event: string\n * }\n * }\n */\n toJSON(): {\n event: string;\n } {\n this.jsonString = true;\n const result = {\n event: this.event,\n };\n delete this.jsonString;\n return result;\n }\n}","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\nimport {check12ValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class representing SCORM 1.2's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.objectives_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n private _id = \"\";\n private _status = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (check12ValidFormat(status, Regex.scorm12.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n * @return {\n * {\n * id: string,\n * status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n status: this.status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_data object\n * @extends BaseCMI\n */\nexport class CMIStudentData extends BaseCMI {\n private readonly __children;\n private _mastery_score = \"\";\n private _max_time_allowed = \"\";\n private _time_limit_action = \"\";\n\n /**\n * Constructor for cmi.student_data\n * @param {string} student_data_children\n */\n constructor(student_data_children?: string) {\n super();\n this.__children = student_data_children\n ? student_data_children\n : APIConstants.scorm12.student_data_children;\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _master_score\n * @return {string}\n */\n get mastery_score(): string {\n return this._mastery_score;\n }\n\n /**\n * Setter for _master_score. Can only be called before initialization.\n * @param {string} mastery_score\n */\n set mastery_score(mastery_score: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._mastery_score = mastery_score;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * toJSON for cmi.student_data\n *\n * @return {\n * {\n * max_time_allowed: string,\n * time_limit_action: string,\n * mastery_score: string\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_preference object\n * @extends BaseCMI\n */\nexport class CMIStudentPreference extends BaseCMI {\n private readonly __children;\n\n /**\n * Constructor for cmi.student_preference\n * @param {string} student_preference_children\n */\n constructor(student_preference_children?: string) {\n super();\n this.__children = student_preference_children\n ? student_preference_children\n : APIConstants.scorm12.student_preference_children;\n }\n\n private _audio = \"\";\n private _language = \"\";\n private _speed = \"\";\n private _text = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _audio\n * @return {string}\n */\n get audio(): string {\n return this._audio;\n }\n\n /**\n * Setter for _audio\n * @param {string} audio\n */\n set audio(audio: string) {\n if (\n check12ValidFormat(audio, Regex.scorm12.CMISInteger) &&\n check12ValidRange(audio, Regex.scorm12.audio_range)\n ) {\n this._audio = audio;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check12ValidFormat(language, Regex.scorm12.CMIString256)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _speed\n * @return {string}\n */\n get speed(): string {\n return this._speed;\n }\n\n /**\n * Setter for _speed\n * @param {string} speed\n */\n set speed(speed: string) {\n if (\n check12ValidFormat(speed, Regex.scorm12.CMISInteger) &&\n check12ValidRange(speed, Regex.scorm12.speed_range)\n ) {\n this._speed = speed;\n }\n }\n\n /**\n * Getter for _text\n * @return {string}\n */\n get text(): string {\n return this._text;\n }\n\n /**\n * Setter for _text\n * @param {string} text\n */\n set text(text: string) {\n if (\n check12ValidFormat(text, Regex.scorm12.CMISInteger) &&\n check12ValidRange(text, Regex.scorm12.text_range)\n ) {\n this._text = text;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n speed: string;\n text: string;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n speed: this.speed,\n text: this.text,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {checkValidFormat, checkValidRange} from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm12.TYPE_MISMATCH,\n Scorm12ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidRange(\n value: any,\n rangePattern: string,\n allowEmptyString?: boolean,\n): boolean {\n if (!allowEmptyString && value === \"\") {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.VALUE_OUT_OF_RANGE);\n }\n\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n Scorm12ValidationError,\n );\n}","interface ErrorDescription {\n basicMessage: string;\n detailMessage: string;\n}\n\ninterface ErrorDescriptions {\n [key: string]: ErrorDescription;\n}\n\ninterface ScormConstants {\n cmi_children: string;\n core_children: string;\n score_children: string;\n comments_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface AiccConstants extends ScormConstants {\n student_demographics_children: string;\n tries_children: string;\n attempt_records_children: string;\n paths_children: string;\n}\n\ninterface Scorm2004Constants {\n cmi_children: string;\n comments_children: string;\n score_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface GlobalConstants {\n SCORM_TRUE: string;\n SCORM_FALSE: string;\n STATE_NOT_INITIALIZED: number;\n STATE_INITIALIZED: number;\n STATE_TERMINATED: number;\n LOG_LEVEL_DEBUG: number;\n LOG_LEVEL_INFO: number;\n LOG_LEVEL_WARNING: number;\n LOG_LEVEL_ERROR: number;\n LOG_LEVEL_NONE: number;\n}\n\ninterface APIConstants {\n global: GlobalConstants;\n scorm12: ScormConstants;\n aicc: AiccConstants;\n scorm2004: Scorm2004Constants;\n}\n\nconst global: GlobalConstants = {\n SCORM_TRUE: \"true\",\n SCORM_FALSE: \"false\",\n STATE_NOT_INITIALIZED: 0,\n STATE_INITIALIZED: 1,\n STATE_TERMINATED: 2,\n LOG_LEVEL_DEBUG: 1,\n LOG_LEVEL_INFO: 2,\n LOG_LEVEL_WARNING: 3,\n LOG_LEVEL_ERROR: 4,\n LOG_LEVEL_NONE: 5,\n};\n\nconst scorm12: ScormConstants = {\n // Children lists\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions\",\n core_children:\n \"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time\",\n score_children: \"raw,min,max\",\n comments_children: \"content,location,time\",\n objectives_children: \"id,score,status\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children: \"audio,language,speed,text\",\n interactions_children:\n \"id,objectives,time,type,correct_responses,weighting,student_response,result,latency\",\n error_descriptions: {\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information\",\n },\n \"201\": {\n basicMessage: \"Invalid argument error\",\n detailMessage:\n \"Indicates that an argument represents an invalid data model element or is otherwise incorrect.\",\n },\n \"202\": {\n basicMessage: \"Element cannot have children\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_children\" for a data model element that does not support the \"_children\" suffix.',\n },\n \"203\": {\n basicMessage: \"Element not an array - cannot have count\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_count\" for a data model element that does not support the \"_count\" suffix.',\n },\n \"301\": {\n basicMessage: \"Not initialized\",\n detailMessage:\n \"Indicates that an API call was made before the call to lmsInitialize.\",\n },\n \"401\": {\n basicMessage: \"Not implemented error\",\n detailMessage:\n \"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.\",\n },\n \"402\": {\n basicMessage: \"Invalid set value, element is a keyword\",\n detailMessage:\n 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in \"_children\" and \"_count\").',\n },\n \"403\": {\n basicMessage: \"Element is read only\",\n detailMessage:\n \"LMSSetValue was called with a data model element that can only be read.\",\n },\n \"404\": {\n basicMessage: \"Element is write only\",\n detailMessage:\n \"LMSGetValue was called on a data model element that can only be written to.\",\n },\n \"405\": {\n basicMessage: \"Incorrect Data Type\",\n detailMessage:\n \"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst aicc: AiccConstants = {\n ...scorm12,\n ...{\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation\",\n student_preference_children:\n \"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows\",\n student_data_children:\n \"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action\",\n student_demographics_children:\n \"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience\",\n tries_children: \"time,status,score\",\n attempt_records_children: \"score,lesson_status\",\n paths_children: \"location_id,date,time,status,why_left,time_in_element\",\n },\n};\nconst scorm2004: Scorm2004Constants = {\n // Children lists\n cmi_children:\n \"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time\",\n comments_children: \"comment,timestamp,location\",\n score_children: \"max,raw,scaled,min\",\n objectives_children:\n \"progress_measure,completion_status,success_status,description,score,id\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children:\n \"audio_level,audio_captioning,delivery_speed,language\",\n interactions_children:\n \"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description\",\n error_descriptions: {\n \"0\": {\n basicMessage: \"No Error\",\n detailMessage: \"No error occurred, the previous API call was successful.\",\n },\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use GetDiagnostic for more information.\",\n },\n \"102\": {\n basicMessage: \"General Initialization Failure\",\n detailMessage: \"Call to Initialize failed for an unknown reason.\",\n },\n \"103\": {\n basicMessage: \"Already Initialized\",\n detailMessage:\n \"Call to Initialize failed because Initialize was already called.\",\n },\n \"104\": {\n basicMessage: \"Content Instance Terminated\",\n detailMessage:\n \"Call to Initialize failed because Terminate was already called.\",\n },\n \"111\": {\n basicMessage: \"General Termination Failure\",\n detailMessage: \"Call to Terminate failed for an unknown reason.\",\n },\n \"112\": {\n basicMessage: \"Termination Before Initialization\",\n detailMessage:\n \"Call to Terminate failed because it was made before the call to Initialize.\",\n },\n \"113\": {\n basicMessage: \"Termination After Termination\",\n detailMessage:\n \"Call to Terminate failed because Terminate was already called.\",\n },\n \"122\": {\n basicMessage: \"Retrieve Data Before Initialization\",\n detailMessage:\n \"Call to GetValue failed because it was made before the call to Initialize.\",\n },\n \"123\": {\n basicMessage: \"Retrieve Data After Termination\",\n detailMessage:\n \"Call to GetValue failed because it was made after the call to Terminate.\",\n },\n \"132\": {\n basicMessage: \"Store Data Before Initialization\",\n detailMessage:\n \"Call to SetValue failed because it was made before the call to Initialize.\",\n },\n \"133\": {\n basicMessage: \"Store Data After Termination\",\n detailMessage:\n \"Call to SetValue failed because it was made after the call to Terminate.\",\n },\n \"142\": {\n basicMessage: \"Commit Before Initialization\",\n detailMessage:\n \"Call to Commit failed because it was made before the call to Initialize.\",\n },\n \"143\": {\n basicMessage: \"Commit After Termination\",\n detailMessage:\n \"Call to Commit failed because it was made after the call to Terminate.\",\n },\n \"201\": {\n basicMessage: \"General Argument Error\",\n detailMessage:\n \"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.\",\n },\n \"301\": {\n basicMessage: \"General Get Failure\",\n detailMessage:\n \"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"351\": {\n basicMessage: \"General Set Failure\",\n detailMessage:\n \"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"391\": {\n basicMessage: \"General Commit Failure\",\n detailMessage:\n \"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"401\": {\n basicMessage: \"Undefined Data Model Element\",\n detailMessage:\n \"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.\",\n },\n \"402\": {\n basicMessage: \"Unimplemented Data Model Element\",\n detailMessage:\n \"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.\",\n },\n \"403\": {\n basicMessage: \"Data Model Element Value Not Initialized\",\n detailMessage:\n \"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.\",\n },\n \"404\": {\n basicMessage: \"Data Model Element Is Read Only\",\n detailMessage:\n \"SetValue was called with a data model element that can only be read.\",\n },\n \"405\": {\n basicMessage: \"Data Model Element Is Write Only\",\n detailMessage:\n \"GetValue was called on a data model element that can only be written to.\",\n },\n \"406\": {\n basicMessage: \"Data Model Element Type Mismatch\",\n detailMessage:\n \"SetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Data Model Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst APIConstants: APIConstants = {\n global: global,\n scorm12: scorm12,\n aicc: aicc,\n scorm2004: scorm2004,\n};\nexport default APIConstants;\n","export enum NAVBoolean {\n unknown = \"unknown\",\n true = \"true\",\n false = \"false\",\n}\n\nexport enum SuccessStatus {\n passed = \"passed\",\n failed = \"failed\",\n unknown = \"unknown\",\n}\n\nexport enum CompletionStatus {\n completed = \"completed\",\n incomplete = \"incomplete\",\n unknown = \"unknown\",\n}\n","export type ErrorCode = {\n [key: string]: number;\n};\n\nconst global: ErrorCode = {\n GENERAL: 101,\n INITIALIZATION_FAILED: 101,\n INITIALIZED: 101,\n TERMINATED: 101,\n TERMINATION_FAILURE: 101,\n TERMINATION_BEFORE_INIT: 101,\n MULTIPLE_TERMINATION: 101,\n RETRIEVE_BEFORE_INIT: 101,\n RETRIEVE_AFTER_TERM: 101,\n STORE_BEFORE_INIT: 101,\n STORE_AFTER_TERM: 101,\n COMMIT_BEFORE_INIT: 101,\n COMMIT_AFTER_TERM: 101,\n ARGUMENT_ERROR: 101,\n CHILDREN_ERROR: 101,\n COUNT_ERROR: 101,\n GENERAL_GET_FAILURE: 101,\n GENERAL_SET_FAILURE: 101,\n GENERAL_COMMIT_FAILURE: 101,\n UNDEFINED_DATA_MODEL: 101,\n UNIMPLEMENTED_ELEMENT: 101,\n VALUE_NOT_INITIALIZED: 101,\n INVALID_SET_VALUE: 101,\n READ_ONLY_ELEMENT: 101,\n WRITE_ONLY_ELEMENT: 101,\n TYPE_MISMATCH: 101,\n VALUE_OUT_OF_RANGE: 101,\n DEPENDENCY_NOT_ESTABLISHED: 101,\n};\n\nconst scorm12: ErrorCode = {\n ...global,\n RETRIEVE_BEFORE_INIT: 301,\n STORE_BEFORE_INIT: 301,\n COMMIT_BEFORE_INIT: 301,\n ARGUMENT_ERROR: 201,\n CHILDREN_ERROR: 202,\n COUNT_ERROR: 203,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 401,\n VALUE_NOT_INITIALIZED: 301,\n INVALID_SET_VALUE: 402,\n READ_ONLY_ELEMENT: 403,\n WRITE_ONLY_ELEMENT: 404,\n TYPE_MISMATCH: 405,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst scorm2004: ErrorCode = {\n ...global,\n INITIALIZATION_FAILED: 102,\n INITIALIZED: 103,\n TERMINATED: 104,\n TERMINATION_FAILURE: 111,\n TERMINATION_BEFORE_INIT: 112,\n MULTIPLE_TERMINATIONS: 113,\n RETRIEVE_BEFORE_INIT: 122,\n RETRIEVE_AFTER_TERM: 123,\n STORE_BEFORE_INIT: 132,\n STORE_AFTER_TERM: 133,\n COMMIT_BEFORE_INIT: 142,\n COMMIT_AFTER_TERM: 143,\n ARGUMENT_ERROR: 201,\n GENERAL_GET_FAILURE: 301,\n GENERAL_SET_FAILURE: 351,\n GENERAL_COMMIT_FAILURE: 391,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 402,\n VALUE_NOT_INITIALIZED: 403,\n READ_ONLY_ELEMENT: 404,\n WRITE_ONLY_ELEMENT: 405,\n TYPE_MISMATCH: 406,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst ErrorCodes = {\n scorm12,\n scorm2004,\n};\n\nexport default ErrorCodes;\n","const scorm12 = {\n CMIString256: \"^.{0,255}$\",\n CMIString4096: \"^.{0,4096}$\",\n CMITime: \"^(?:[01]\\\\d|2[0123]):(?:[012345]\\\\d):(?:[012345]\\\\d)$\",\n CMITimespan: \"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$\",\n\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{0,3})(.[0-9]*)?$\",\n\n CMIIdentifier: \"^[\\\\u0021-\\\\u007E\\\\s]{0,255}$\",\n CMIFeedback: \"^.{0,255}$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n // Vocabulary Data Type Definition\n CMIStatus: \"^(passed|completed|failed|incomplete|browsed)$\",\n CMIStatus2: \"^(passed|completed|failed|incomplete|browsed|not attempted)$\",\n CMIExit: \"^(time-out|suspend|logout|)$\",\n CMIType:\n \"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$\",\n CMIResult:\n \"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\\\.[0-9]*)?)$\",\n NAVEvent: \"^(previous|continue)$\",\n // Data ranges\n score_range: \"0#100\",\n audio_range: \"-1#100\",\n speed_range: \"-100#100\",\n weighting_range: \"-100#100\",\n text_range: \"-1#1\",\n};\nconst aicc = {\n ...scorm12,\n ...{\n CMIIdentifier: \"^\\\\w{1,255}$\",\n },\n};\nconst scorm2004 = {\n CMIString200: \"^[\\\\u0000-\\\\uFFFF]{0,200}$\",\n CMIString250: \"^[\\\\u0000-\\\\uFFFF]{0,250}$\",\n CMIString1000: \"^[\\\\u0000-\\\\uFFFF]{0,1000}$\",\n CMIString4000: \"^[\\\\u0000-\\\\uFFFF]{0,4000}$\",\n CMIString64000: \"^[\\\\u0000-\\\\uFFFF]{0,64000}$\",\n CMILang: \"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$\",\n\n CMILangString250:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$\",\n\n CMILangcr: \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$\",\n\n CMILangString250cr:\n \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$\",\n\n CMILangString4000:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$\",\n\n CMITime:\n \"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$\",\n CMITimespan:\n \"^P(?:([.,\\\\d]+)Y)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)W)?(?:([.,\\\\d]+)D)?(?:T?(?:([.,\\\\d]+)H)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)S)?)?$\",\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{1,5})(\\\\.[0-9]{1,18})?$\",\n CMIIdentifier: \"^\\\\S{1,250}[a-zA-Z0-9]$\",\n CMIShortIdentifier: \"^[\\\\w\\\\.\\\\-\\\\_]{1,250}$\",\n CMILongIdentifier:\n \"^(?:(?!urn:)\\\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\\\S{1,4000}|.{1,4000})$\",\n // need to re-examine this\n CMIFeedback: \"^.*$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n CMIIndexStore: \".N(\\\\d+).\",\n // Vocabulary Data Type Definition\n CMICStatus: \"^(completed|incomplete|not attempted|unknown)$\",\n CMISStatus: \"^(passed|failed|unknown)$\",\n CMIExit: \"^(time-out|suspend|logout|normal)$\",\n CMIType:\n \"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$\",\n CMIResult:\n \"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\\\.[0-9]{1,18})?)$\",\n NAVEvent:\n \"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?jump)$\",\n\n NAVBoolean: \"^(unknown|true|false$)\",\n NAVTarget: \"^{target=\\\\S{0,}[a-zA-Z0-9-_]+}$\",\n // Data ranges\n scaled_range: \"-1#1\",\n audio_range: \"0#*\",\n speed_range: \"0#*\",\n text_range: \"-1#1\",\n progress_range: \"0#1\",\n};\nconst Regex = {\n aicc: aicc,\n scorm12: scorm12,\n scorm2004: scorm2004,\n};\nexport default Regex;\n","import APIConstants from \"./constants/api_constants\";\n\nconst scorm12_errors = APIConstants.scorm12.error_descriptions;\nconst aicc_errors = APIConstants.aicc.error_descriptions;\nconst scorm2004_errors = APIConstants.scorm2004.error_descriptions;\n\ntype APIError = {\n errorCode: number;\n errorMessage: string;\n detailedMessage: string;\n};\n\nexport class BaseScormValidationError extends Error {\n constructor(errorCode: number) {\n super(errorCode.toString());\n this._errorCode = errorCode;\n this.name = \"ScormValidationError\";\n }\n\n private readonly _errorCode: number;\n\n /**\n * Getter for _errorCode\n * @return {number}\n */\n get errorCode(): number {\n return this._errorCode;\n }\n\n setMessage(message: string) {\n this.message = message;\n }\n}\n\n/**\n * Base Validation Exception\n */\nexport class ValidationError\n extends BaseScormValidationError\n implements APIError\n{\n /**\n * Constructor to take in an error message and code\n * @param {number} errorCode\n * @param {string} errorMessage\n * @param {string} detailedMessage\n */\n constructor(\n errorCode: number,\n errorMessage: string,\n detailedMessage?: string,\n ) {\n super(errorCode);\n this.setMessage(errorMessage);\n this._errorMessage = errorMessage;\n if (detailedMessage) {\n this._detailedMessage = detailedMessage;\n }\n }\n\n private readonly _errorMessage: string;\n private readonly _detailedMessage: string = \"\";\n\n /**\n * Getter for _errorMessage\n * @return {string}\n */\n get errorMessage(): string {\n return this._errorMessage;\n }\n\n /**\n * Getter for _detailedMessage\n * @return {string}\n */\n get detailedMessage(): string {\n return this._detailedMessage;\n }\n}\n\n/**\n * SCORM 1.2 Validation Error\n */\nexport class Scorm12ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {\n super(\n errorCode,\n scorm12_errors[String(errorCode)].basicMessage,\n scorm12_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm12_errors[\"101\"].basicMessage,\n scorm12_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * AICC Validation Error\n */\nexport class AICCValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {\n super(\n errorCode,\n aicc_errors[String(errorCode)].basicMessage,\n aicc_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n aicc_errors[\"101\"].basicMessage,\n aicc_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * SCORM 2004 Validation Error\n */\nexport class Scorm2004ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {\n super(\n errorCode,\n scorm2004_errors[String(errorCode)].basicMessage,\n scorm2004_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm2004_errors[\"101\"].basicMessage,\n scorm2004_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n","export const SECONDS_PER_SECOND = 1.0;\nexport const SECONDS_PER_MINUTE = 60;\nexport const SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;\nexport const SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR;\n\ntype Designation = {\n [key: string]: number;\n};\n\ntype StringKeyMap = {\n [key: string]: any;\n};\n\nconst designations: Designation = {\n D: SECONDS_PER_DAY,\n H: SECONDS_PER_HOUR,\n M: SECONDS_PER_MINUTE,\n S: SECONDS_PER_SECOND,\n};\n\n/**\n * Converts a Number to a String of HH:MM:SS\n *\n * @param {number} totalSeconds\n * @return {string}\n */\nexport function getSecondsAsHHMMSS(totalSeconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!totalSeconds || totalSeconds <= 0) {\n return \"00:00:00\";\n }\n\n const hours = Math.floor(totalSeconds / SECONDS_PER_HOUR);\n const dateObj = new Date(totalSeconds * 1000);\n const minutes = dateObj.getUTCMinutes();\n // make sure we add any possible decimal value\n const seconds = dateObj.getSeconds();\n const ms = totalSeconds % 1.0;\n let msStr = \"\";\n\n if (countDecimals(ms) > 0) {\n if (countDecimals(ms) > 2) {\n msStr = ms.toFixed(2);\n } else {\n msStr = String(ms);\n }\n\n msStr = \".\" + msStr.split(\".\")[1];\n }\n\n return (\n (hours + \":\" + minutes + \":\" + seconds).replace(/\\b\\d\\b/g, \"0$&\") + msStr\n );\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {number} seconds\n * @return {string}\n */\nexport function getSecondsAsISODuration(seconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!seconds || seconds <= 0) {\n return \"PT0S\";\n }\n\n let duration = \"P\";\n let remainder = seconds;\n for (const designationsKey in designations) {\n const current_seconds = designations[designationsKey];\n let value = Math.floor(remainder / current_seconds);\n remainder = remainder % current_seconds;\n\n if (countDecimals(remainder) > 2) {\n remainder = Number(Number(remainder).toFixed(2));\n }\n\n // If we have anything left in the remainder, and we're currently adding\n // seconds to the duration, go ahead and add the decimal to the seconds\n if (designationsKey === \"S\" && remainder > 0) {\n value += remainder;\n }\n\n if (value) {\n if (\n (duration.indexOf(\"D\") > 0 ||\n designationsKey === \"H\" ||\n designationsKey === \"M\" ||\n designationsKey === \"S\") &&\n duration.indexOf(\"T\") === -1\n ) {\n duration += \"T\";\n }\n\n duration += `${value}${designationsKey}`;\n }\n }\n return duration;\n}\n\n/**\n * Calculate the number of seconds from HH:MM:SS.DDDDDD\n *\n * @param {string} timeString\n * @param {RegExp} timeRegex\n * @return {number}\n */\nexport function getTimeAsSeconds(\n timeString: string | number | boolean | null,\n timeRegex: RegExp | string,\n): number {\n if (typeof timeString === \"number\" || typeof timeString === \"boolean\") {\n timeString = String(timeString);\n }\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n if (!timeString || !timeString.match(timeRegex)) {\n return 0;\n }\n\n const parts = timeString.split(\":\");\n const hours = Number(parts[0]);\n const minutes = Number(parts[1]);\n const seconds = Number(parts[2]);\n return hours * 3600 + minutes * 60 + seconds;\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {string} duration\n * @param {RegExp} durationRegex\n * @return {number}\n */\nexport function getDurationAsSeconds(\n duration: string | null,\n durationRegex: RegExp | string,\n): number {\n if (typeof durationRegex === \"string\") {\n durationRegex = new RegExp(durationRegex);\n }\n\n if (!duration || !duration.match(durationRegex)) {\n return 0;\n }\n\n const [, years, _, , days, hours, minutes, seconds] =\n new RegExp(durationRegex).exec(duration) || [];\n let result = 0.0;\n result += Number(seconds) || 0.0;\n result += Number(minutes) * 60.0 || 0.0;\n result += Number(hours) * 3600.0 || 0.0;\n result += Number(days) * (60 * 60 * 24.0) || 0.0;\n result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0;\n return result;\n}\n\n/**\n * Adds together two ISO8601 Duration strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp|string} durationRegex\n * @return {string}\n */\nexport function addTwoDurations(\n first: string,\n second: string,\n durationRegex: RegExp | string,\n): string {\n const regex: RegExp =\n typeof durationRegex === \"string\"\n ? new RegExp(durationRegex)\n : durationRegex;\n return getSecondsAsISODuration(\n getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex),\n );\n}\n\n/**\n * Add together two HH:MM:SS.DD strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp} timeRegex\n * @return {string}\n */\nexport function addHHMMSSTimeStrings(\n first: string,\n second: string,\n timeRegex: RegExp | string,\n): string {\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n return getSecondsAsHHMMSS(\n getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex),\n );\n}\n\n/**\n * Flatten a JSON object down to string paths for each values\n * @param {object} data\n * @return {object}\n */\nexport function flatten(data: StringKeyMap): object {\n const result: StringKeyMap = {};\n\n /**\n * Recurse through the object\n * @param {*} cur\n * @param {*} prop\n */\n function recurse(cur: any, prop: any) {\n if (Object(cur) !== cur) {\n result[prop] = cur;\n } else if (Array.isArray(cur)) {\n for (let i = 0, l = cur.length; i < l; i++) {\n recurse(cur[i], prop + \"[\" + i + \"]\");\n if (l === 0) result[prop] = [];\n }\n } else {\n let isEmpty = true;\n\n for (const p in cur) {\n if ({}.hasOwnProperty.call(cur, p)) {\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p);\n }\n }\n\n if (isEmpty && prop) result[prop] = {};\n }\n }\n\n recurse(data, \"\");\n return result;\n}\n\n/**\n * Un-flatten a flat JSON object\n * @param {object} data\n * @return {object}\n */\nexport function unflatten(data: StringKeyMap): object {\n \"use strict\";\n\n if (Object(data) !== data || Array.isArray(data)) return data;\n const regex = /\\.?([^.[\\]]+)|\\[(\\d+)]/g;\n const result: StringKeyMap = {};\n\n for (const p in data) {\n if ({}.hasOwnProperty.call(data, p)) {\n let cur = result;\n let prop = \"\";\n let m = regex.exec(p);\n\n while (m) {\n cur = cur[prop] || (cur[prop] = m[2] ? [] : {});\n prop = m[2] || m[1];\n m = regex.exec(p);\n }\n\n cur[prop] = data[p];\n }\n }\n\n return result[\"\"] || result;\n}\n\n/**\n * Counts the number of decimal places\n * @param {number} num\n * @return {number}\n */\nexport function countDecimals(num: number): number {\n if (Math.floor(num) === num || String(num).indexOf(\".\") < 0) return 0;\n const parts = num.toString().split(\".\")[1];\n return parts.length || 0;\n}\n\n/**\n * Formats the SCORM messages for easy reading\n *\n * @param {string} functionName\n * @param {string} message\n * @param {string} CMIElement\n * @return {string}\n */\nexport function formatMessage(\n functionName: string,\n message: string,\n CMIElement?: string,\n): string {\n const baseLength = 20;\n let messageString = \"\";\n\n messageString += functionName;\n\n let fillChars = baseLength - messageString.length;\n\n for (let i = 0; i < fillChars; i++) {\n messageString += \" \";\n }\n\n messageString += \": \";\n\n if (CMIElement) {\n const CMIElementBaseLength = 70;\n\n messageString += CMIElement;\n\n fillChars = CMIElementBaseLength - messageString.length;\n\n for (let j = 0; j < fillChars; j++) {\n messageString += \" \";\n }\n }\n\n if (message) {\n messageString += message;\n }\n\n return messageString;\n}\n\n/**\n * Checks to see if {str} contains {tester}\n *\n * @param {string} str String to check against\n * @param {string} tester String to check for\n * @return {boolean}\n */\nexport function stringMatches(str: string, tester: string): boolean {\n return str?.match(tester) !== null;\n}\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","import { CMI } from \"./cmi/scorm12/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMIObjectivesObject } from \"./cmi/scorm12/objectives\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm12/interactions\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport Regex from \"./constants/regex\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\nimport BaseAPI from \"./BaseAPI\";\n\n/**\n * API class for SCORM 1.2\n */\nclass Scorm12Impl extends BaseAPI {\n /**\n * Constructor for SCORM 1.2 API\n * @param {object} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm12, settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n\n // Rename functions to match 1.2 Spec and expose to modules\n this.LMSInitialize = this.lmsInitialize;\n this.LMSFinish = this.lmsFinish;\n this.LMSGetValue = this.lmsGetValue;\n this.LMSSetValue = this.lmsSetValue;\n this.LMSCommit = this.lmsCommit;\n this.LMSGetLastError = this.lmsGetLastError;\n this.LMSGetErrorString = this.lmsGetErrorString;\n this.LMSGetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public statusSetByModule = false;\n\n cmi: CMI;\n nav: NAV;\n\n LMSInitialize: () => string;\n LMSFinish: () => string;\n LMSGetValue: (CMIElement: string) => string;\n LMSSetValue: (CMIElement: string, value: any) => string;\n LMSCommit: () => string;\n LMSGetLastError: () => string;\n LMSGetErrorString: (CMIErrorCode: string) => string;\n LMSGetDiagnostic: (CMIErrorCode: string) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * lmsInitialize function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n if (this.cmi.core.lesson_status) {\n this.statusSetByModule = true;\n } else {\n this.cmi.core.lesson_status = \"not attempted\";\n }\n return this.initialize(\n \"LMSInitialize\",\n \"LMS was already initialized!\",\n \"LMS is already finished!\",\n );\n }\n\n /**\n * LMSFinish function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"LMSFinish\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.nav.event !== \"\") {\n if (this.nav.event === \"continue\") {\n this.processListeners(\"SequenceNext\");\n } else {\n this.processListeners(\"SequencePrevious\");\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * LMSGetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n return this.getValue(\"LMSGetValue\", false, CMIElement);\n }\n\n /**\n * LMSSetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n if (CMIElement === \"cmi.core.lesson_status\") {\n this.statusSetByModule = true;\n }\n return this.setValue(\"LMSSetValue\", \"LMSCommit\", false, CMIElement, value);\n }\n\n /**\n * LMSCommit function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"LMSCommit\", false);\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * LMSGetLastError function from SCORM 1.2 Spec\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"LMSGetLastError\");\n }\n\n /**\n * LMSGetErrorString function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string): string {\n return this.getErrorString(\"LMSGetErrorString\", CMIErrorCode);\n }\n\n /**\n * LMSGetDiagnostic function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string): string {\n return this.getDiagnostic(\"LMSGetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"LMSSetValue\", false, CMIElement, value);\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"getCMIValue\", false, CMIElement);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {*} _value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n _value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsCorrectResponsesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObjectivesObject();\n } else if (\n !foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObject();\n }\n\n return null;\n }\n\n /**\n * Validates Correct Response values\n *\n * @param {string} _CMIElement\n * @param {*} _value\n */\n validateCorrectResponse(_CMIElement: string, _value: any) {\n // do nothing\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {number|string} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: number | string,\n detail: boolean,\n ): string {\n let basicMessage = \"No Error\";\n let detailMessage = \"No Error\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm12.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {Scorm12Impl} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm12Impl) {\n // Data Model\n this.cmi = newAPI.cmi;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeHHMMSS = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getTimeAsSeconds(\n totalTimeHHMMSS,\n Regex.scorm12.CMITimespan,\n );\n const lessonStatus = this.cmi.core.lesson_status;\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (lessonStatus) {\n completionStatus =\n lessonStatus === \"completed\" || lessonStatus === \"passed\"\n ? CompletionStatus.completed\n : CompletionStatus.incomplete;\n if (lessonStatus === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (lessonStatus === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.core.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n }\n\n const commitObject: CommitObject = {\n successStatus: successStatus,\n completionStatus: completionStatus,\n runtimeData: cmiExport,\n totalTimeSeconds: totalTimeSeconds,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n const originalStatus = this.cmi.core.lesson_status;\n if (\n !this.cmi.core.lesson_status ||\n (!this.statusSetByModule &&\n this.cmi.core.lesson_status === \"not attempted\")\n ) {\n this.cmi.core.lesson_status = \"completed\";\n }\n\n if (this.cmi.core.lesson_mode === \"normal\") {\n if (this.cmi.core.credit === \"credit\") {\n if (\n this.settings.mastery_override &&\n this.cmi.student_data.mastery_score !== \"\" &&\n this.cmi.core.score.raw !== \"\"\n ) {\n this.cmi.core.lesson_status =\n parseFloat(this.cmi.core.score.raw) >=\n parseFloat(this.cmi.student_data.mastery_score)\n ? \"passed\"\n : \"failed\";\n }\n }\n } else if (this.cmi.core.lesson_mode === \"browse\") {\n if (\n (this.startingData?.cmi?.core?.lesson_status || \"\") === \"\" &&\n originalStatus === \"not attempted\"\n ) {\n this.cmi.core.lesson_status = \"browsed\";\n }\n }\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n return await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n\nexport { Scorm12Impl };\n"],"names":["DefaultSettings","autocommit","autocommitSeconds","asyncCommit","sendFullCommit","lmsCommitUrl","dataCommitFormat","commitRequestDataType","autoProgress","logLevel","A","global","LOG_LEVEL_ERROR","selfReportSessionTime","alwaysSendTotalTime","renderCommonCommitFields","strict_errors","xhrHeaders","xhrWithCredentials","responseHandler","response","JSON","parse","text","httpResult","hasOwnProperty","call","result","errorCode","SCORM_TRUE","status","SCORM_FALSE","requestHandler","commitObject","onLogMessage","messageLevel","logMessage","console","error","LOG_LEVEL_WARNING","warn","LOG_LEVEL_INFO","info","LOG_LEVEL_DEBUG","debug","log","scoItemIds","scoItemIdValidator","API","when","callback","_cancelled","this","_API","_timeout","setTimeout","wrapper","bind","_callback","cancel","clearTimeout","commit","error_codes","settings","_settings","BaseAPI","TypeError","currentState","STATE_NOT_INITIALIZED","lastErrorCode","listenerArray","_error_codes","apiLogLevel","commonReset","initialize","callbackName","initializeMessage","terminationMessage","returnValue","isInitialized","throwSCORMError","INITIALIZED","isTerminated","TERMINATED","cmi","setStartTime","STATE_INITIALIZED","processListeners","apiLog","clearSCORMError","functionName","CMIElement","terminate","checkTerminated","checkState","TERMINATION_BEFORE_INIT","MULTIPLE_TERMINATION","STATE_TERMINATED","storeData","getValue","RETRIEVE_BEFORE_INIT","RETRIEVE_AFTER_TERM","getCMIValue","e","handleValueAccessException","undefined","setValue","commitCallback","value","String","STORE_BEFORE_INIT","STORE_AFTER_TERM","setCMIValue","scheduleCommit","clearScheduledCommit","COMMIT_BEFORE_INIT","COMMIT_AFTER_TERM","getLastError","getErrorString","CMIErrorCode","getLmsErrorMessageDetails","getDiagnostic","beforeInitError","afterTermError","isNotInitialized","_errorNumber","_detail","Error","_CMIElement","_value","_commonSetCMIValue","methodName","scorm2004","structure","split","refObject","foundFirstIndex","invalidErrorMessage","invalidErrorCode","UNDEFINED_DATA_MODEL","GENERAL","idx","length","attribute","substring","READ_ONLY_ELEMENT","_checkObjectHasProperty","validateCorrectResponse","index","parseInt","isNaN","item","childArray","newChild","getChildElement","initialized","push","_commonGetCMIValue","uninitializedErrorMessage","_isTargetValid","target","VALUE_NOT_INITIALIZED","scorm12","CHILDREN_ERROR","COUNT_ERROR","on","listenerName","listenerFunctions","i","listenerSplit","replace","off","removeIndex","findIndex","obj","splice","clear","filter","listener","functionsMatch","listenerHasCMIElement","CMIElementsMatch","indexOf","errorNumber","message","success","loadFromFlattenedJSON","json","int_pattern","obj_pattern","Object","keys","map","key","sort","test","a","c","testPattern","forEach","element","loadFromJSON","a_pattern","c_match","a_match","match","a_num","Number","c_num","startingData","currentCMIElement","constructor","renderCMIToJSONString","stringify","k","v","renderCMIToJSONObject","processHttpRequest","url","params","immediate","api","genericError","performFetch","then","transformResponse","process","debouncedProcess","func","wait","timeout","context","callNow","apply","args","debounce","ScheduledCommit","getOwnPropertyDescriptor","getPrototypeOf","fetch","method","body","Array","join","headers","credentials","keepalive","scorm12_error_codes","__children","children","_errorCode","_errorClass","errorClass","_children","_count","toJSON","jsonString","_initialized","_start_time","Date","getTime","BaseCMI","scorm12_constants","scorm12_regex","_raw","_min","score_children","__score_range","score_range","_max","max","__invalid_error_code","INVALID_SET_VALUE","__invalid_type_code","invalidTypeCode","TYPE_MISMATCH","__invalid_range_code","invalidRangeCode","VALUE_OUT_OF_RANGE","__decimal_regex","decimalRegex","CMIDecimal","__error_class","raw","min","checkValidFormat","regexPattern","allowEmptyString","formatRegex","RegExp","matches","checkValidRange","rangePattern","ranges","core_children","_student_id","_student_name","_lesson_location","_credit","_lesson_status","_entry","_total_time","_lesson_mode","_exit","_session_time","_suspend_data","score","student_id","student_name","lesson_location","CMIString256","credit","lesson_status","CMIStatus","CMIStatus2","entry","total_time","lesson_mode","WRITE_ONLY_ELEMENT","exit","CMIExit","session_time","CMITimespan","suspend_data","CMIString4096","getCurrentTotalTime","start_time","sessionTime","startTime","seconds","cmi_children","student_data","__version","_launch_data","_comments","_comments_from_lms","core","CMICore","objectives","C","student_preference","interactions","launch_data","comments","comments_from_lms","_version","interactions_children","_id","_time","_type","_weighting","_student_response","_result","_latency","objectives_children","correct_responses","correct_responses_children","id","CMIIdentifier","time","CMITime","type","CMIType","weighting","weighting_range","student_response","CMIFeedback","CMIResult","latency","_pattern","pattern","_event","event","NAVEvent","_status","student_data_children","_mastery_score","_max_time_allowed","_time_limit_action","mastery_score","max_time_allowed","time_limit_action","student_preference_children","_audio","_language","_speed","_text","audio","CMISInteger","audio_range","language","speed","speed_range","text_range","check12ValidFormat","check12ValidRange","comments_children","error_descriptions","basicMessage","detailMessage","APIConstants","LOG_LEVEL_NONE","aicc","student_demographics_children","tries_children","attempt_records_children","paths_children","NAVBoolean","SuccessStatus","CompletionStatus","INITIALIZATION_FAILED","TERMINATION_FAILURE","ARGUMENT_ERROR","GENERAL_GET_FAILURE","GENERAL_SET_FAILURE","GENERAL_COMMIT_FAILURE","UNIMPLEMENTED_ELEMENT","DEPENDENCY_NOT_ESTABLISHED","ErrorCodes","MULTIPLE_TERMINATIONS","CMIInteger","CMIIndex","Regex","CMIString200","CMIString250","CMIString1000","CMIString4000","CMIString64000","CMILang","CMILangString250","CMILangcr","CMILangString250cr","CMILangString4000","CMIShortIdentifier","CMILongIdentifier","CMIIndexStore","CMICStatus","CMISStatus","NAVTarget","scaled_range","progress_range","scorm12_errors","aicc_errors","scorm2004_errors","toString","name","setMessage","errorMessage","detailedMessage","_detailedMessage","_errorMessage","BaseScormValidationError","ValidationError","SECONDS_PER_HOUR","getSecondsAsHHMMSS","totalSeconds","hours","Math","floor","dateObj","minutes","getUTCMinutes","getSeconds","ms","msStr","countDecimals","toFixed","getTimeAsSeconds","timeString","timeRegex","parts","addHHMMSSTimeStrings","first","second","flatten","data","recurse","cur","prop","isArray","l","isEmpty","p","unflatten","regex","m","exec","num","formatMessage","messageString","fillChars","j","stringMatches","str","tester","extendStatics","d","b","setPrototypeOf","__proto__","prototype","__extends","__","create","__assign","assign","t","s","n","arguments","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","step","next","rejected","done","__generator","f","y","_","label","sent","trys","ops","g","Iterator","verb","Symbol","iterator","op","pop","SuppressedError","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","__webpack_modules__","definition","o","defineProperty","enumerable","get","mastery_override","statusSetByModule","nav","LMSInitialize","lmsInitialize","LMSFinish","lmsFinish","LMSGetValue","lmsGetValue","LMSSetValue","lmsSetValue","LMSCommit","lmsCommit","LMSGetLastError","lmsGetLastError","LMSGetErrorString","lmsGetErrorString","LMSGetDiagnostic","lmsGetDiagnostic","reset","internalFinish","detail","replaceWithAnotherScormAPI","newAPI","renderCommitCMI","terminateCommit","cmiExport","flattened","renderCommitObject","totalTimeHHMMSS","totalTimeSeconds","lessonStatus","completionStatus","unknown","successStatus","completed","incomplete","passed","failed","scoreObject","parseFloat","runtimeData","originalStatus","shouldTerminateCommit"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/esm/scorm2004.js b/dist/esm/scorm2004.js new file mode 100644 index 0000000..2dedf71 --- /dev/null +++ b/dist/esm/scorm2004.js @@ -0,0 +1,4649 @@ +/******/ var __webpack_modules__ = ({ + +/***/ 900: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + A: function() { return /* binding */ src_BaseAPI; } +}); + +// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs +var tslib_es6 = __webpack_require__(635); +// EXTERNAL MODULE: ./src/cmi/common/array.ts +var array = __webpack_require__(589); +// EXTERNAL MODULE: ./src/exceptions.ts +var exceptions = __webpack_require__(784); +// EXTERNAL MODULE: ./src/constants/error_codes.ts +var error_codes = __webpack_require__(797); +// EXTERNAL MODULE: ./src/constants/api_constants.ts +var api_constants = __webpack_require__(340); +// EXTERNAL MODULE: ./src/utilities.ts +var utilities = __webpack_require__(864); +;// ./src/utilities/debounce.ts +function debounce(func, wait, immediate) { + if (immediate === void 0) { immediate = false; } + var timeout; + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var context = this; + var later = function () { + timeout = null; + if (!immediate) + func.apply(context, args); + }; + var callNow = immediate && !timeout; + if (timeout) + clearTimeout(timeout); + timeout = setTimeout(later, wait); + if (callNow) + func.apply(context, args); + }; +} + +;// ./src/constants/default_settings.ts + + +var DefaultSettings = { + autocommit: false, + autocommitSeconds: 10, + asyncCommit: false, + sendFullCommit: true, + lmsCommitUrl: false, + dataCommitFormat: "json", + commitRequestDataType: "application/json;charset=UTF-8", + autoProgress: false, + logLevel: api_constants/* default */.A.global.LOG_LEVEL_ERROR, + selfReportSessionTime: false, + alwaysSendTotalTime: false, + renderCommonCommitFields: false, + strict_errors: true, + xhrHeaders: {}, + xhrWithCredentials: false, + responseHandler: function (response) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + var httpResult, _a, _b; + return (0,tslib_es6/* __generator */.YH)(this, function (_c) { + switch (_c.label) { + case 0: + if (!(typeof response !== "undefined")) return [3, 2]; + _b = (_a = JSON).parse; + return [4, response.text()]; + case 1: + httpResult = _b.apply(_a, [_c.sent()]); + if (httpResult === null || + !{}.hasOwnProperty.call(httpResult, "result")) { + if (response.status === 200) { + return [2, { + result: api_constants/* default */.A.global.SCORM_TRUE, + errorCode: 0, + }]; + } + else { + return [2, { + result: api_constants/* default */.A.global.SCORM_FALSE, + errorCode: 101, + }]; + } + } + else { + return [2, { + result: httpResult.result, + errorCode: httpResult.errorCode + ? httpResult.errorCode + : httpResult.result === api_constants/* default */.A.global.SCORM_TRUE + ? 0 + : 101, + }]; + } + _c.label = 2; + case 2: return [2, { + result: api_constants/* default */.A.global.SCORM_FALSE, + errorCode: 101, + }]; + } + }); + }); + }, + requestHandler: function (commitObject) { + return commitObject; + }, + onLogMessage: function (messageLevel, logMessage) { + switch (messageLevel) { + case api_constants/* default */.A.global.LOG_LEVEL_ERROR: + console.error(logMessage); + break; + case api_constants/* default */.A.global.LOG_LEVEL_WARNING: + console.warn(logMessage); + break; + case api_constants/* default */.A.global.LOG_LEVEL_INFO: + console.info(logMessage); + break; + case api_constants/* default */.A.global.LOG_LEVEL_DEBUG: + if (console.debug) { + console.debug(logMessage); + } + else { + console.log(logMessage); + } + break; + } + }, + scoItemIds: [], + scoItemIdValidator: false, +}; + +;// ./src/helpers/scheduled_commit.ts + +var ScheduledCommit = (function () { + function ScheduledCommit(API, when, callback) { + this._cancelled = false; + this._API = API; + this._timeout = setTimeout(this.wrapper.bind(this), when); + this._callback = callback; + } + ScheduledCommit.prototype.cancel = function () { + this._cancelled = true; + if (this._timeout) { + clearTimeout(this._timeout); + } + }; + ScheduledCommit.prototype.wrapper = function () { + var _this = this; + if (!this._cancelled) { + (function () { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this._API.commit(this._callback)]; + case 1: return [2, _a.sent()]; + } + }); }); })(); + } + }; + return ScheduledCommit; +}()); + + +;// ./src/BaseAPI.ts + + + + + + + + + +var BaseAPI = (function () { + function BaseAPI(error_codes, settings) { + var _newTarget = this.constructor; + this._settings = DefaultSettings; + if (_newTarget === BaseAPI) { + throw new TypeError("Cannot construct BaseAPI instances directly"); + } + this.currentState = api_constants/* default */.A.global.STATE_NOT_INITIALIZED; + this.lastErrorCode = "0"; + this.listenerArray = []; + this._error_codes = error_codes; + if (settings) { + this.settings = settings; + } + this.apiLogLevel = this.settings.logLevel; + this.selfReportSessionTime = this.settings.selfReportSessionTime; + } + BaseAPI.prototype.commonReset = function (settings) { + this.settings = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, this.settings), settings); + this.currentState = api_constants/* default */.A.global.STATE_NOT_INITIALIZED; + this.lastErrorCode = "0"; + this.listenerArray = []; + }; + BaseAPI.prototype.initialize = function (callbackName, initializeMessage, terminationMessage) { + var returnValue = api_constants/* default */.A.global.SCORM_FALSE; + if (this.isInitialized()) { + this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage); + } + else if (this.isTerminated()) { + this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage); + } + else { + if (this.selfReportSessionTime) { + this.cmi.setStartTime(); + } + this.currentState = api_constants/* default */.A.global.STATE_INITIALIZED; + this.lastErrorCode = "0"; + returnValue = api_constants/* default */.A.global.SCORM_TRUE; + this.processListeners(callbackName); + } + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + this.clearSCORMError(returnValue); + return returnValue; + }; + BaseAPI.prototype.apiLog = function (functionName, logMessage, messageLevel, CMIElement) { + logMessage = (0,utilities/* formatMessage */.hw)(functionName, logMessage, CMIElement); + if (messageLevel >= this.apiLogLevel) { + this.settings.onLogMessage(messageLevel, logMessage); + } + }; + Object.defineProperty(BaseAPI.prototype, "error_codes", { + get: function () { + return this._error_codes; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BaseAPI.prototype, "settings", { + get: function () { + return this._settings; + }, + set: function (settings) { + this._settings = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, this._settings), settings); + }, + enumerable: false, + configurable: true + }); + BaseAPI.prototype.terminate = function (callbackName, checkTerminated) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + var returnValue, result; + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: + returnValue = api_constants/* default */.A.global.SCORM_FALSE; + if (!this.checkState(checkTerminated, this._error_codes.TERMINATION_BEFORE_INIT, this._error_codes.MULTIPLE_TERMINATION)) return [3, 2]; + this.currentState = api_constants/* default */.A.global.STATE_TERMINATED; + return [4, this.storeData(true)]; + case 1: + result = _a.sent(); + if (typeof result.errorCode !== "undefined" && result.errorCode > 0) { + this.throwSCORMError(result.errorCode); + } + returnValue = + typeof result !== "undefined" && result.result + ? result.result + : api_constants/* default */.A.global.SCORM_FALSE; + if (checkTerminated) + this.lastErrorCode = "0"; + returnValue = api_constants/* default */.A.global.SCORM_TRUE; + this.processListeners(callbackName); + _a.label = 2; + case 2: + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + this.clearSCORMError(returnValue); + return [2, returnValue]; + } + }); + }); + }; + BaseAPI.prototype.getValue = function (callbackName, checkTerminated, CMIElement) { + var returnValue = ""; + if (this.checkState(checkTerminated, this._error_codes.RETRIEVE_BEFORE_INIT, this._error_codes.RETRIEVE_AFTER_TERM)) { + if (checkTerminated) + this.lastErrorCode = "0"; + try { + returnValue = this.getCMIValue(CMIElement); + } + catch (e) { + returnValue = this.handleValueAccessException(e, returnValue); + } + this.processListeners(callbackName, CMIElement); + } + this.apiLog(callbackName, ": returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); + if (returnValue === undefined) { + return ""; + } + this.clearSCORMError(returnValue); + return returnValue; + }; + BaseAPI.prototype.setValue = function (callbackName, commitCallback, checkTerminated, CMIElement, value) { + if (value !== undefined) { + value = String(value); + } + var returnValue = api_constants/* default */.A.global.SCORM_FALSE; + if (this.checkState(checkTerminated, this._error_codes.STORE_BEFORE_INIT, this._error_codes.STORE_AFTER_TERM)) { + if (checkTerminated) + this.lastErrorCode = "0"; + try { + returnValue = this.setCMIValue(CMIElement, value); + } + catch (e) { + this.handleValueAccessException(e, returnValue); + } + this.processListeners(callbackName, CMIElement, value); + } + if (returnValue === undefined) { + returnValue = api_constants/* default */.A.global.SCORM_FALSE; + } + if (String(this.lastErrorCode) === "0") { + if (this.settings.autocommit && !this._timeout) { + this.scheduleCommit(this.settings.autocommitSeconds * 1000, commitCallback); + } + } + this.apiLog(callbackName, ": " + value + ": result: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); + this.clearSCORMError(returnValue); + return returnValue; + }; + BaseAPI.prototype.commit = function (callbackName_1) { + return (0,tslib_es6/* __awaiter */.sH)(this, arguments, void 0, function (callbackName, checkTerminated) { + var returnValue, result; + if (checkTerminated === void 0) { checkTerminated = false; } + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: + this.clearScheduledCommit(); + returnValue = api_constants/* default */.A.global.SCORM_FALSE; + if (!this.checkState(checkTerminated, this._error_codes.COMMIT_BEFORE_INIT, this._error_codes.COMMIT_AFTER_TERM)) return [3, 2]; + return [4, this.storeData(false)]; + case 1: + result = _a.sent(); + if (result.errorCode && result.errorCode > 0) { + this.throwSCORMError(result.errorCode); + } + returnValue = + typeof result !== "undefined" && result.result + ? result.result + : api_constants/* default */.A.global.SCORM_FALSE; + this.apiLog(callbackName, " Result: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_DEBUG, "HttpRequest"); + if (checkTerminated) + this.lastErrorCode = "0"; + this.processListeners(callbackName); + _a.label = 2; + case 2: + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + this.clearSCORMError(returnValue); + return [2, returnValue]; + } + }); + }); + }; + BaseAPI.prototype.getLastError = function (callbackName) { + var returnValue = String(this.lastErrorCode); + this.processListeners(callbackName); + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + return returnValue; + }; + BaseAPI.prototype.getErrorString = function (callbackName, CMIErrorCode) { + var returnValue = ""; + if (CMIErrorCode !== null && CMIErrorCode !== "") { + returnValue = this.getLmsErrorMessageDetails(CMIErrorCode); + this.processListeners(callbackName); + } + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + return returnValue; + }; + BaseAPI.prototype.getDiagnostic = function (callbackName, CMIErrorCode) { + var returnValue = ""; + if (CMIErrorCode !== null && CMIErrorCode !== "") { + returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true); + this.processListeners(callbackName); + } + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + return returnValue; + }; + BaseAPI.prototype.checkState = function (checkTerminated, beforeInitError, afterTermError) { + if (this.isNotInitialized()) { + this.throwSCORMError(beforeInitError); + return false; + } + else if (checkTerminated && this.isTerminated()) { + this.throwSCORMError(afterTermError); + return false; + } + return true; + }; + BaseAPI.prototype.getLmsErrorMessageDetails = function (_errorNumber, _detail) { + if (_detail === void 0) { _detail = false; } + throw new Error("The getLmsErrorMessageDetails method has not been implemented"); + }; + BaseAPI.prototype.getCMIValue = function (_CMIElement) { + throw new Error("The getCMIValue method has not been implemented"); + }; + BaseAPI.prototype.setCMIValue = function (_CMIElement, _value) { + throw new Error("The setCMIValue method has not been implemented"); + }; + BaseAPI.prototype._commonSetCMIValue = function (methodName, scorm2004, CMIElement, value) { + if (!CMIElement || CMIElement === "") { + return api_constants/* default */.A.global.SCORM_FALSE; + } + var structure = CMIElement.split("."); + var refObject = this; + var returnValue = api_constants/* default */.A.global.SCORM_FALSE; + var foundFirstIndex = false; + var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element."); + var invalidErrorCode = scorm2004 + ? this._error_codes.UNDEFINED_DATA_MODEL + : this._error_codes.GENERAL; + for (var idx = 0; idx < structure.length; idx++) { + var attribute = structure[idx]; + if (idx === structure.length - 1) { + if (scorm2004 && attribute.substring(0, 8) === "{target=") { + if (this.isInitialized()) { + this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT); + } + else { + refObject = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, refObject), { attribute: value }); + } + } + else if (!this._checkObjectHasProperty(refObject, attribute)) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + } + else { + if ((0,utilities/* stringMatches */.J6)(CMIElement, "\\.correct_responses\\.\\d+") && + this.isInitialized()) { + this.validateCorrectResponse(CMIElement, value); + } + if (!scorm2004 || this.lastErrorCode === "0") { + refObject[attribute] = value; + returnValue = api_constants/* default */.A.global.SCORM_TRUE; + } + } + } + else { + refObject = refObject[attribute]; + if (!refObject) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + break; + } + if (refObject instanceof array/* CMIArray */.B) { + var index = parseInt(structure[idx + 1], 10); + if (!isNaN(index)) { + var item = refObject.childArray[index]; + if (item) { + refObject = item; + foundFirstIndex = true; + } + else { + var newChild = this.getChildElement(CMIElement, value, foundFirstIndex); + foundFirstIndex = true; + if (!newChild) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + } + else { + if (refObject.initialized) + newChild.initialize(); + refObject.childArray.push(newChild); + refObject = newChild; + } + } + idx++; + } + } + } + } + if (returnValue === api_constants/* default */.A.global.SCORM_FALSE) { + this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value), api_constants/* default */.A.global.LOG_LEVEL_WARNING); + } + return returnValue; + }; + BaseAPI.prototype._commonGetCMIValue = function (methodName, scorm2004, CMIElement) { + if (!CMIElement || CMIElement === "") { + return ""; + } + var structure = CMIElement.split("."); + var refObject = this; + var attribute = null; + var uninitializedErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") has not been initialized."); + var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element."); + var invalidErrorCode = scorm2004 + ? this._error_codes.UNDEFINED_DATA_MODEL + : this._error_codes.GENERAL; + for (var idx = 0; idx < structure.length; idx++) { + attribute = structure[idx]; + if (!scorm2004) { + if (idx === structure.length - 1) { + if (!this._checkObjectHasProperty(refObject, attribute)) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + return; + } + } + } + else { + if (String(attribute).substring(0, 8) === "{target=" && + typeof refObject._isTargetValid == "function") { + var target = String(attribute).substring(8, String(attribute).length - 9); + return refObject._isTargetValid(target); + } + else if (!this._checkObjectHasProperty(refObject, attribute)) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + return; + } + } + refObject = refObject[attribute]; + if (refObject === undefined) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + break; + } + if (refObject instanceof array/* CMIArray */.B) { + var index = parseInt(structure[idx + 1], 10); + if (!isNaN(index)) { + var item = refObject.childArray[index]; + if (item) { + refObject = item; + } + else { + this.throwSCORMError(this._error_codes.VALUE_NOT_INITIALIZED, uninitializedErrorMessage); + break; + } + idx++; + } + } + } + if (refObject === null || refObject === undefined) { + if (!scorm2004) { + if (attribute === "_children") { + this.throwSCORMError(error_codes/* default */.A.scorm12.CHILDREN_ERROR); + } + else if (attribute === "_count") { + this.throwSCORMError(error_codes/* default */.A.scorm12.COUNT_ERROR); + } + } + } + else { + return refObject; + } + }; + BaseAPI.prototype.isInitialized = function () { + return this.currentState === api_constants/* default */.A.global.STATE_INITIALIZED; + }; + BaseAPI.prototype.isNotInitialized = function () { + return this.currentState === api_constants/* default */.A.global.STATE_NOT_INITIALIZED; + }; + BaseAPI.prototype.isTerminated = function () { + return this.currentState === api_constants/* default */.A.global.STATE_TERMINATED; + }; + BaseAPI.prototype.on = function (listenerName, callback) { + if (!callback) + return; + var listenerFunctions = listenerName.split(" "); + for (var i = 0; i < listenerFunctions.length; i++) { + var listenerSplit = listenerFunctions[i].split("."); + if (listenerSplit.length === 0) + return; + var functionName = listenerSplit[0]; + var CMIElement = null; + if (listenerSplit.length > 1) { + CMIElement = listenerName.replace(functionName + ".", ""); + } + this.listenerArray.push({ + functionName: functionName, + CMIElement: CMIElement, + callback: callback, + }); + this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length), api_constants/* default */.A.global.LOG_LEVEL_INFO, functionName); + } + }; + BaseAPI.prototype.off = function (listenerName, callback) { + if (!callback) + return; + var listenerFunctions = listenerName.split(" "); + var _loop_1 = function (i) { + var listenerSplit = listenerFunctions[i].split("."); + if (listenerSplit.length === 0) + return { value: void 0 }; + var functionName = listenerSplit[0]; + var CMIElement = null; + if (listenerSplit.length > 1) { + CMIElement = listenerName.replace(functionName + ".", ""); + } + var removeIndex = this_1.listenerArray.findIndex(function (obj) { + return obj.functionName === functionName && + obj.CMIElement === CMIElement && + obj.callback === callback; + }); + if (removeIndex !== -1) { + this_1.listenerArray.splice(removeIndex, 1); + this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length), api_constants/* default */.A.global.LOG_LEVEL_INFO, functionName); + } + }; + var this_1 = this; + for (var i = 0; i < listenerFunctions.length; i++) { + var state_1 = _loop_1(i); + if (typeof state_1 === "object") + return state_1.value; + } + }; + BaseAPI.prototype.clear = function (listenerName) { + var listenerFunctions = listenerName.split(" "); + var _loop_2 = function (i) { + var listenerSplit = listenerFunctions[i].split("."); + if (listenerSplit.length === 0) + return { value: void 0 }; + var functionName = listenerSplit[0]; + var CMIElement = null; + if (listenerSplit.length > 1) { + CMIElement = listenerName.replace(functionName + ".", ""); + } + this_2.listenerArray = this_2.listenerArray.filter(function (obj) { + return obj.functionName !== functionName && obj.CMIElement !== CMIElement; + }); + }; + var this_2 = this; + for (var i = 0; i < listenerFunctions.length; i++) { + var state_2 = _loop_2(i); + if (typeof state_2 === "object") + return state_2.value; + } + }; + BaseAPI.prototype.processListeners = function (functionName, CMIElement, value) { + this.apiLog(functionName, value, api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); + for (var i = 0; i < this.listenerArray.length; i++) { + var listener = this.listenerArray[i]; + var functionsMatch = listener.functionName === functionName; + var listenerHasCMIElement = !!listener.CMIElement; + var CMIElementsMatch = false; + if (CMIElement && + listener.CMIElement && + listener.CMIElement.substring(listener.CMIElement.length - 1) === "*") { + CMIElementsMatch = + CMIElement.indexOf(listener.CMIElement.substring(0, listener.CMIElement.length - 1)) === 0; + } + else { + CMIElementsMatch = listener.CMIElement === CMIElement; + } + if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) { + this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName), api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); + listener.callback(CMIElement, value); + } + } + }; + BaseAPI.prototype.throwSCORMError = function (errorNumber, message) { + if (!message) { + message = this.getLmsErrorMessageDetails(errorNumber); + } + this.apiLog("throwSCORMError", errorNumber + ": " + message, api_constants/* default */.A.global.LOG_LEVEL_ERROR); + this.lastErrorCode = String(errorNumber); + }; + BaseAPI.prototype.clearSCORMError = function (success) { + if (success !== undefined && success !== api_constants/* default */.A.global.SCORM_FALSE) { + this.lastErrorCode = "0"; + } + }; + BaseAPI.prototype.loadFromFlattenedJSON = function (json, CMIElement) { + var _this = this; + if (!CMIElement) { + CMIElement = ""; + } + if (!this.isNotInitialized()) { + console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize."); + return; + } + function testPattern(a, c, a_pattern) { + var a_match = a.match(a_pattern); + var c_match; + if (a_match !== null && (c_match = c.match(a_pattern)) !== null) { + var a_num = Number(a_match[2]); + var c_num = Number(c_match[2]); + if (a_num === c_num) { + if (a_match[3] === "id") { + return -1; + } + else if (a_match[3] === "type") { + if (c_match[3] === "id") { + return 1; + } + else { + return -1; + } + } + else { + return 1; + } + } + return a_num - c_num; + } + return null; + } + var int_pattern = /^(cmi\.interactions\.)(\d+)\.(.*)$/; + var obj_pattern = /^(cmi\.objectives\.)(\d+)\.(.*)$/; + var result = Object.keys(json).map(function (key) { + return [String(key), json[key]]; + }); + result.sort(function (_a, _c) { + var a = _a[0], _b = _a[1]; + var c = _c[0], _d = _c[1]; + var test; + if ((test = testPattern(a, c, int_pattern)) !== null) { + return test; + } + if ((test = testPattern(a, c, obj_pattern)) !== null) { + return test; + } + if (a < c) { + return -1; + } + if (a > c) { + return 1; + } + return 0; + }); + var obj; + result.forEach(function (element) { + obj = {}; + obj[element[0]] = element[1]; + _this.loadFromJSON((0,utilities/* unflatten */.sB)(obj), CMIElement); + }); + }; + BaseAPI.prototype.loadFromJSON = function (json, CMIElement) { + if (!this.isNotInitialized()) { + console.error("loadFromJSON can only be called before the call to lmsInitialize."); + return; + } + CMIElement = CMIElement !== undefined ? CMIElement : "cmi"; + this.startingData = json; + for (var key in json) { + if ({}.hasOwnProperty.call(json, key) && json[key]) { + var currentCMIElement = (CMIElement ? CMIElement + "." : "") + key; + var value = json[key]; + if (value["childArray"]) { + for (var i = 0; i < value["childArray"].length; i++) { + this.loadFromJSON(value["childArray"][i], currentCMIElement + "." + i); + } + } + else if (value.constructor === Object) { + this.loadFromJSON(value, currentCMIElement); + } + else { + this.setCMIValue(currentCMIElement, value); + } + } + } + }; + BaseAPI.prototype.renderCMIToJSONString = function () { + var cmi = this.cmi; + if (this.settings.sendFullCommit) { + return JSON.stringify({ cmi: cmi }); + } + return JSON.stringify({ cmi: cmi }, function (k, v) { return (v === undefined ? null : v); }, 2); + }; + BaseAPI.prototype.renderCMIToJSONObject = function () { + return JSON.parse(this.renderCMIToJSONString()); + }; + BaseAPI.prototype.processHttpRequest = function (url_1, params_1) { + return (0,tslib_es6/* __awaiter */.sH)(this, arguments, void 0, function (url, params, immediate) { + var api, genericError, process, debouncedProcess; + var _this = this; + if (immediate === void 0) { immediate = false; } + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: + api = this; + genericError = { + result: api_constants/* default */.A.global.SCORM_FALSE, + errorCode: this.error_codes.GENERAL, + }; + if (immediate) { + this.performFetch(url, params).then(function (response) { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this.transformResponse(response)]; + case 1: + _a.sent(); + return [2]; + } + }); + }); }); + return [2, { + result: api_constants/* default */.A.global.SCORM_TRUE, + errorCode: 0, + }]; + } + process = function (url, params, settings) { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { + var response, e_1; + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + params = settings.requestHandler(params); + return [4, this.performFetch(url, params)]; + case 1: + response = _a.sent(); + return [2, this.transformResponse(response)]; + case 2: + e_1 = _a.sent(); + this.apiLog("processHttpRequest", e_1, api_constants/* default */.A.global.LOG_LEVEL_ERROR); + api.processListeners("CommitError"); + return [2, genericError]; + case 3: return [2]; + } + }); + }); }; + if (!this.settings.asyncCommit) return [3, 1]; + debouncedProcess = debounce(process, 500, immediate); + debouncedProcess(url, params, this.settings); + return [2, { + result: api_constants/* default */.A.global.SCORM_TRUE, + errorCode: 0, + }]; + case 1: return [4, process(url, params, this.settings)]; + case 2: return [2, _a.sent()]; + } + }); + }); + }; + BaseAPI.prototype.scheduleCommit = function (when, callback) { + this._timeout = new ScheduledCommit(this, when, callback); + this.apiLog("scheduleCommit", "scheduled", api_constants/* default */.A.global.LOG_LEVEL_DEBUG, ""); + }; + BaseAPI.prototype.clearScheduledCommit = function () { + if (this._timeout) { + this._timeout.cancel(); + this._timeout = undefined; + this.apiLog("clearScheduledCommit", "cleared", api_constants/* default */.A.global.LOG_LEVEL_DEBUG, ""); + } + }; + BaseAPI.prototype._checkObjectHasProperty = function (refObject, attribute) { + return (Object.hasOwnProperty.call(refObject, attribute) || + Object.getOwnPropertyDescriptor(Object.getPrototypeOf(refObject), attribute) != null || + attribute in refObject); + }; + BaseAPI.prototype.handleValueAccessException = function (e, returnValue) { + if (e instanceof exceptions/* ValidationError */.yI) { + this.lastErrorCode = String(e.errorCode); + returnValue = api_constants/* default */.A.global.SCORM_FALSE; + } + else { + if (e instanceof Error && e.message) { + console.error(e.message); + } + else { + console.error(e); + } + this.throwSCORMError(this._error_codes.GENERAL); + } + return returnValue; + }; + BaseAPI.prototype.performFetch = function (url, params) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + return [2, fetch(url, { + method: "POST", + body: params instanceof Array ? params.join("&") : JSON.stringify(params), + headers: (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, this.settings.xhrHeaders), { "Content-Type": this.settings.commitRequestDataType }), + credentials: this.settings.xhrWithCredentials ? "include" : undefined, + keepalive: true, + })]; + }); + }); + }; + BaseAPI.prototype.transformResponse = function (response) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + var result, _a; + return (0,tslib_es6/* __generator */.YH)(this, function (_c) { + switch (_c.label) { + case 0: + if (!(typeof this.settings.responseHandler === "function")) return [3, 2]; + return [4, this.settings.responseHandler(response)]; + case 1: + _a = _c.sent(); + return [3, 4]; + case 2: return [4, response.json()]; + case 3: + _a = _c.sent(); + _c.label = 4; + case 4: + result = _a; + if (response.status >= 200 && + response.status <= 299 && + (result.result === true || + result.result === api_constants/* default */.A.global.SCORM_TRUE)) { + this.processListeners("CommitSuccess"); + } + else { + this.processListeners("CommitError"); + } + return [2, result]; + } + }); + }); + }; + return BaseAPI; +}()); +/* harmony default export */ var src_BaseAPI = (BaseAPI); + + +/***/ }), + +/***/ 589: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ B: function() { return /* binding */ CMIArray; } +/* harmony export */ }); +/* unused harmony export scorm12_error_codes */ +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635); +/* harmony import */ var _base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(797); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(784); + + + + +var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12; +var CMIArray = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__extends */ .C6)(CMIArray, _super); + function CMIArray(params) { + var _this = _super.call(this) || this; + _this.__children = params.children; + _this._errorCode = params.errorCode || scorm12_error_codes.GENERAL; + _this._errorClass = params.errorClass || _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .BaseScormValidationError */ .$h; + _this.childArray = []; + return _this; + } + Object.defineProperty(CMIArray.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new this._errorClass(this._errorCode); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIArray.prototype, "_count", { + get: function () { + return this.childArray.length; + }, + set: function (_count) { + throw new this._errorClass(this._errorCode); + }, + enumerable: false, + configurable: true + }); + CMIArray.prototype.toJSON = function () { + this.jsonString = true; + var result = {}; + for (var i = 0; i < this.childArray.length; i++) { + result[i + ""] = this.childArray[i]; + } + delete this.jsonString; + return result; + }; + return CMIArray; +}(_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 319: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ J: function() { return /* binding */ BaseCMI; }, +/* harmony export */ r: function() { return /* binding */ BaseRootCMI; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); + +var BaseCMI = (function () { + function BaseCMI() { + this.jsonString = false; + this._initialized = false; + } + Object.defineProperty(BaseCMI.prototype, "initialized", { + get: function () { + return this._initialized; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BaseCMI.prototype, "start_time", { + get: function () { + return this._start_time; + }, + enumerable: false, + configurable: true + }); + BaseCMI.prototype.initialize = function () { + this._initialized = true; + }; + BaseCMI.prototype.setStartTime = function () { + this._start_time = new Date().getTime(); + }; + return BaseCMI; +}()); + +var BaseRootCMI = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__extends */ .C6)(BaseRootCMI, _super); + function BaseRootCMI() { + return _super !== null && _super.apply(this, arguments) || this; + } + return BaseRootCMI; +}(BaseCMI)); + + + +/***/ }), + +/***/ 434: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ _: function() { return /* binding */ CMIScore; } +/* harmony export */ }); +/* unused harmony export scorm12_error_codes */ +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(417); +/* harmony import */ var _base_cmi__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(319); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(449); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797); + + + + + + +var scorm12_constants = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12; +var scorm12_regex = _constants_regex__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12; +var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12; +var CMIScore = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__extends */ .C6)(CMIScore, _super); + function CMIScore(params) { + var _this = _super.call(this) || this; + _this._raw = ""; + _this._min = ""; + _this.__children = params.score_children || scorm12_constants.score_children; + _this.__score_range = !params.score_range + ? false + : scorm12_regex.score_range; + _this._max = params.max || params.max === "" ? params.max : "100"; + _this.__invalid_error_code = + params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE; + _this.__invalid_type_code = + params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH; + _this.__invalid_range_code = + params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE; + _this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal; + _this.__error_class = params.errorClass; + return _this; + } + Object.defineProperty(CMIScore.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new this.__error_class(this.__invalid_error_code); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIScore.prototype, "raw", { + get: function () { + return this._raw; + }, + set: function (raw) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidFormat */ .q)(raw, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && + (!this.__score_range || + (0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidRange */ .W)(raw, this.__score_range, this.__invalid_range_code, this.__error_class))) { + this._raw = raw; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIScore.prototype, "min", { + get: function () { + return this._min; + }, + set: function (min) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidFormat */ .q)(min, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && + (!this.__score_range || + (0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidRange */ .W)(min, this.__score_range, this.__invalid_range_code, this.__error_class))) { + this._min = min; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIScore.prototype, "max", { + get: function () { + return this._max; + }, + set: function (max) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidFormat */ .q)(max, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && + (!this.__score_range || + (0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidRange */ .W)(max, this.__score_range, this.__invalid_range_code, this.__error_class))) { + this._max = max; + } + }, + enumerable: false, + configurable: true + }); + CMIScore.prototype.toJSON = function () { + this.jsonString = true; + var result = { + raw: this.raw, + min: this.min, + max: this.max, + }; + delete this.jsonString; + return result; + }; + return CMIScore; +}(_base_cmi__WEBPACK_IMPORTED_MODULE_2__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 449: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ W: function() { return /* binding */ checkValidRange; }, +/* harmony export */ q: function() { return /* binding */ checkValidFormat; } +/* harmony export */ }); +function checkValidFormat(value, regexPattern, errorCode, errorClass, allowEmptyString) { + if (typeof value !== "string") { + return false; + } + var formatRegex = new RegExp(regexPattern); + var matches = value.match(formatRegex); + if (allowEmptyString && value === "") { + return true; + } + if (value === undefined || !matches || matches[0] === "") { + throw new errorClass(errorCode); + } + return true; +} +function checkValidRange(value, rangePattern, errorCode, errorClass) { + var ranges = rangePattern.split("#"); + value = value * 1.0; + if (value >= ranges[0]) { + if (ranges[1] === "*" || value <= ranges[1]) { + return true; + } + else { + throw new errorClass(errorCode); + } + } + else { + throw new errorClass(errorCode); + } +} + + +/***/ }), + +/***/ 340: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); + +var global = { + SCORM_TRUE: "true", + SCORM_FALSE: "false", + STATE_NOT_INITIALIZED: 0, + STATE_INITIALIZED: 1, + STATE_TERMINATED: 2, + LOG_LEVEL_DEBUG: 1, + LOG_LEVEL_INFO: 2, + LOG_LEVEL_WARNING: 3, + LOG_LEVEL_ERROR: 4, + LOG_LEVEL_NONE: 5, +}; +var scorm12 = { + cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions", + core_children: "student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time", + score_children: "raw,min,max", + comments_children: "content,location,time", + objectives_children: "id,score,status", + correct_responses_children: "pattern", + student_data_children: "mastery_score,max_time_allowed,time_limit_action", + student_preference_children: "audio,language,speed,text", + interactions_children: "id,objectives,time,type,correct_responses,weighting,student_response,result,latency", + error_descriptions: { + "101": { + basicMessage: "General Exception", + detailMessage: "No specific error code exists to describe the error. Use LMSGetDiagnostic for more information", + }, + "201": { + basicMessage: "Invalid argument error", + detailMessage: "Indicates that an argument represents an invalid data model element or is otherwise incorrect.", + }, + "202": { + basicMessage: "Element cannot have children", + detailMessage: 'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.', + }, + "203": { + basicMessage: "Element not an array - cannot have count", + detailMessage: 'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.', + }, + "301": { + basicMessage: "Not initialized", + detailMessage: "Indicates that an API call was made before the call to lmsInitialize.", + }, + "401": { + basicMessage: "Not implemented error", + detailMessage: "The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.", + }, + "402": { + basicMessage: "Invalid set value, element is a keyword", + detailMessage: 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").', + }, + "403": { + basicMessage: "Element is read only", + detailMessage: "LMSSetValue was called with a data model element that can only be read.", + }, + "404": { + basicMessage: "Element is write only", + detailMessage: "LMSGetValue was called on a data model element that can only be written to.", + }, + "405": { + basicMessage: "Incorrect Data Type", + detailMessage: "LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.", + }, + "407": { + basicMessage: "Element Value Out Of Range", + detailMessage: "The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.", + }, + "408": { + basicMessage: "Data Model Dependency Not Established", + detailMessage: "Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.", + }, + }, +}; +var aicc = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, scorm12), { + cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation", + student_preference_children: "audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows", + student_data_children: "attempt_number,tries,mastery_score,max_time_allowed,time_limit_action", + student_demographics_children: "city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience", + tries_children: "time,status,score", + attempt_records_children: "score,lesson_status", + paths_children: "location_id,date,time,status,why_left,time_in_element", +}); +var scorm2004 = { + cmi_children: "_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time", + comments_children: "comment,timestamp,location", + score_children: "max,raw,scaled,min", + objectives_children: "progress_measure,completion_status,success_status,description,score,id", + correct_responses_children: "pattern", + student_data_children: "mastery_score,max_time_allowed,time_limit_action", + student_preference_children: "audio_level,audio_captioning,delivery_speed,language", + interactions_children: "id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description", + error_descriptions: { + "0": { + basicMessage: "No Error", + detailMessage: "No error occurred, the previous API call was successful.", + }, + "101": { + basicMessage: "General Exception", + detailMessage: "No specific error code exists to describe the error. Use GetDiagnostic for more information.", + }, + "102": { + basicMessage: "General Initialization Failure", + detailMessage: "Call to Initialize failed for an unknown reason.", + }, + "103": { + basicMessage: "Already Initialized", + detailMessage: "Call to Initialize failed because Initialize was already called.", + }, + "104": { + basicMessage: "Content Instance Terminated", + detailMessage: "Call to Initialize failed because Terminate was already called.", + }, + "111": { + basicMessage: "General Termination Failure", + detailMessage: "Call to Terminate failed for an unknown reason.", + }, + "112": { + basicMessage: "Termination Before Initialization", + detailMessage: "Call to Terminate failed because it was made before the call to Initialize.", + }, + "113": { + basicMessage: "Termination After Termination", + detailMessage: "Call to Terminate failed because Terminate was already called.", + }, + "122": { + basicMessage: "Retrieve Data Before Initialization", + detailMessage: "Call to GetValue failed because it was made before the call to Initialize.", + }, + "123": { + basicMessage: "Retrieve Data After Termination", + detailMessage: "Call to GetValue failed because it was made after the call to Terminate.", + }, + "132": { + basicMessage: "Store Data Before Initialization", + detailMessage: "Call to SetValue failed because it was made before the call to Initialize.", + }, + "133": { + basicMessage: "Store Data After Termination", + detailMessage: "Call to SetValue failed because it was made after the call to Terminate.", + }, + "142": { + basicMessage: "Commit Before Initialization", + detailMessage: "Call to Commit failed because it was made before the call to Initialize.", + }, + "143": { + basicMessage: "Commit After Termination", + detailMessage: "Call to Commit failed because it was made after the call to Terminate.", + }, + "201": { + basicMessage: "General Argument Error", + detailMessage: "An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.", + }, + "301": { + basicMessage: "General Get Failure", + detailMessage: "Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.", + }, + "351": { + basicMessage: "General Set Failure", + detailMessage: "Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.", + }, + "391": { + basicMessage: "General Commit Failure", + detailMessage: "Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.", + }, + "401": { + basicMessage: "Undefined Data Model Element", + detailMessage: "The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.", + }, + "402": { + basicMessage: "Unimplemented Data Model Element", + detailMessage: "The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.", + }, + "403": { + basicMessage: "Data Model Element Value Not Initialized", + detailMessage: "Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.", + }, + "404": { + basicMessage: "Data Model Element Is Read Only", + detailMessage: "SetValue was called with a data model element that can only be read.", + }, + "405": { + basicMessage: "Data Model Element Is Write Only", + detailMessage: "GetValue was called on a data model element that can only be written to.", + }, + "406": { + basicMessage: "Data Model Element Type Mismatch", + detailMessage: "SetValue was called with a value that is not consistent with the data format of the supplied data model element.", + }, + "407": { + basicMessage: "Data Model Element Value Out Of Range", + detailMessage: "The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.", + }, + "408": { + basicMessage: "Data Model Dependency Not Established", + detailMessage: "Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.", + }, + }, +}; +var APIConstants = { + global: global, + scorm12: scorm12, + aicc: aicc, + scorm2004: scorm2004, +}; +/* harmony default export */ __webpack_exports__.A = (APIConstants); + + +/***/ }), + +/***/ 56: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ K$: function() { return /* binding */ NAVBoolean; }, +/* harmony export */ YE: function() { return /* binding */ SuccessStatus; }, +/* harmony export */ lC: function() { return /* binding */ CompletionStatus; } +/* harmony export */ }); +var NAVBoolean; +(function (NAVBoolean) { + NAVBoolean["unknown"] = "unknown"; + NAVBoolean["true"] = "true"; + NAVBoolean["false"] = "false"; +})(NAVBoolean || (NAVBoolean = {})); +var SuccessStatus; +(function (SuccessStatus) { + SuccessStatus["passed"] = "passed"; + SuccessStatus["failed"] = "failed"; + SuccessStatus["unknown"] = "unknown"; +})(SuccessStatus || (SuccessStatus = {})); +var CompletionStatus; +(function (CompletionStatus) { + CompletionStatus["completed"] = "completed"; + CompletionStatus["incomplete"] = "incomplete"; + CompletionStatus["unknown"] = "unknown"; +})(CompletionStatus || (CompletionStatus = {})); + + +/***/ }), + +/***/ 797: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); + +var global = { + GENERAL: 101, + INITIALIZATION_FAILED: 101, + INITIALIZED: 101, + TERMINATED: 101, + TERMINATION_FAILURE: 101, + TERMINATION_BEFORE_INIT: 101, + MULTIPLE_TERMINATION: 101, + RETRIEVE_BEFORE_INIT: 101, + RETRIEVE_AFTER_TERM: 101, + STORE_BEFORE_INIT: 101, + STORE_AFTER_TERM: 101, + COMMIT_BEFORE_INIT: 101, + COMMIT_AFTER_TERM: 101, + ARGUMENT_ERROR: 101, + CHILDREN_ERROR: 101, + COUNT_ERROR: 101, + GENERAL_GET_FAILURE: 101, + GENERAL_SET_FAILURE: 101, + GENERAL_COMMIT_FAILURE: 101, + UNDEFINED_DATA_MODEL: 101, + UNIMPLEMENTED_ELEMENT: 101, + VALUE_NOT_INITIALIZED: 101, + INVALID_SET_VALUE: 101, + READ_ONLY_ELEMENT: 101, + WRITE_ONLY_ELEMENT: 101, + TYPE_MISMATCH: 101, + VALUE_OUT_OF_RANGE: 101, + DEPENDENCY_NOT_ESTABLISHED: 101, +}; +var scorm12 = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, global), { RETRIEVE_BEFORE_INIT: 301, STORE_BEFORE_INIT: 301, COMMIT_BEFORE_INIT: 301, ARGUMENT_ERROR: 201, CHILDREN_ERROR: 202, COUNT_ERROR: 203, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 401, VALUE_NOT_INITIALIZED: 301, INVALID_SET_VALUE: 402, READ_ONLY_ELEMENT: 403, WRITE_ONLY_ELEMENT: 404, TYPE_MISMATCH: 405, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 }); +var scorm2004 = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, global), { INITIALIZATION_FAILED: 102, INITIALIZED: 103, TERMINATED: 104, TERMINATION_FAILURE: 111, TERMINATION_BEFORE_INIT: 112, MULTIPLE_TERMINATIONS: 113, RETRIEVE_BEFORE_INIT: 122, RETRIEVE_AFTER_TERM: 123, STORE_BEFORE_INIT: 132, STORE_AFTER_TERM: 133, COMMIT_BEFORE_INIT: 142, COMMIT_AFTER_TERM: 143, ARGUMENT_ERROR: 201, GENERAL_GET_FAILURE: 301, GENERAL_SET_FAILURE: 351, GENERAL_COMMIT_FAILURE: 391, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 402, VALUE_NOT_INITIALIZED: 403, READ_ONLY_ELEMENT: 404, WRITE_ONLY_ELEMENT: 405, TYPE_MISMATCH: 406, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 }); +var ErrorCodes = { + scorm12: scorm12, + scorm2004: scorm2004, +}; +/* harmony default export */ __webpack_exports__.A = (ErrorCodes); + + +/***/ }), + +/***/ 417: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); + +var scorm12 = { + CMIString256: "^.{0,255}$", + CMIString4096: "^.{0,4096}$", + CMITime: "^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$", + CMITimespan: "^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$", + CMIInteger: "^\\d+$", + CMISInteger: "^-?([0-9]+)$", + CMIDecimal: "^-?([0-9]{0,3})(.[0-9]*)?$", + CMIIdentifier: "^[\\u0021-\\u007E\\s]{0,255}$", + CMIFeedback: "^.{0,255}$", + CMIIndex: "[._](\\d+).", + CMIStatus: "^(passed|completed|failed|incomplete|browsed)$", + CMIStatus2: "^(passed|completed|failed|incomplete|browsed|not attempted)$", + CMIExit: "^(time-out|suspend|logout|)$", + CMIType: "^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$", + CMIResult: "^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$", + NAVEvent: "^(previous|continue)$", + score_range: "0#100", + audio_range: "-1#100", + speed_range: "-100#100", + weighting_range: "-100#100", + text_range: "-1#1", +}; +var aicc = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, scorm12), { + CMIIdentifier: "^\\w{1,255}$", +}); +var scorm2004 = { + CMIString200: "^[\\u0000-\\uFFFF]{0,200}$", + CMIString250: "^[\\u0000-\\uFFFF]{0,250}$", + CMIString1000: "^[\\u0000-\\uFFFF]{0,1000}$", + CMIString4000: "^[\\u0000-\\uFFFF]{0,4000}$", + CMIString64000: "^[\\u0000-\\uFFFF]{0,64000}$", + CMILang: "^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$", + CMILangString250: "^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$", + CMILangcr: "^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$", + CMILangString250cr: "^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$", + CMILangString4000: "^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$", + CMITime: "^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$", + CMITimespan: "^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$", + CMIInteger: "^\\d+$", + CMISInteger: "^-?([0-9]+)$", + CMIDecimal: "^-?([0-9]{1,5})(\\.[0-9]{1,18})?$", + CMIIdentifier: "^\\S{1,250}[a-zA-Z0-9]$", + CMIShortIdentifier: "^[\\w\\.\\-\\_]{1,250}$", + CMILongIdentifier: "^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$", + CMIFeedback: "^.*$", + CMIIndex: "[._](\\d+).", + CMIIndexStore: ".N(\\d+).", + CMICStatus: "^(completed|incomplete|not attempted|unknown)$", + CMISStatus: "^(passed|failed|unknown)$", + CMIExit: "^(time-out|suspend|logout|normal)$", + CMIType: "^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$", + CMIResult: "^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$", + NAVEvent: "^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$", + NAVBoolean: "^(unknown|true|false$)", + NAVTarget: "^{target=\\S{0,}[a-zA-Z0-9-_]+}$", + scaled_range: "-1#1", + audio_range: "0#*", + speed_range: "0#*", + text_range: "-1#1", + progress_range: "0#1", +}; +var Regex = { + aicc: aicc, + scorm12: scorm12, + scorm2004: scorm2004, +}; +/* harmony default export */ __webpack_exports__.A = (Regex); + + +/***/ }), + +/***/ 784: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ $h: function() { return /* binding */ BaseScormValidationError; }, +/* harmony export */ wq: function() { return /* binding */ Scorm2004ValidationError; }, +/* harmony export */ yI: function() { return /* binding */ ValidationError; } +/* harmony export */ }); +/* unused harmony exports Scorm12ValidationError, AICCValidationError */ +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(635); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340); + + +var scorm12_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.error_descriptions; +var aicc_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.aicc.error_descriptions; +var scorm2004_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm2004.error_descriptions; +var BaseScormValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(BaseScormValidationError, _super); + function BaseScormValidationError(errorCode) { + var _this = _super.call(this, errorCode.toString()) || this; + _this._errorCode = errorCode; + _this.name = "ScormValidationError"; + return _this; + } + Object.defineProperty(BaseScormValidationError.prototype, "errorCode", { + get: function () { + return this._errorCode; + }, + enumerable: false, + configurable: true + }); + BaseScormValidationError.prototype.setMessage = function (message) { + this.message = message; + }; + return BaseScormValidationError; +}(Error)); + +var ValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(ValidationError, _super); + function ValidationError(errorCode, errorMessage, detailedMessage) { + var _this = _super.call(this, errorCode) || this; + _this._detailedMessage = ""; + _this.setMessage(errorMessage); + _this._errorMessage = errorMessage; + if (detailedMessage) { + _this._detailedMessage = detailedMessage; + } + return _this; + } + Object.defineProperty(ValidationError.prototype, "errorMessage", { + get: function () { + return this._errorMessage; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(ValidationError.prototype, "detailedMessage", { + get: function () { + return this._detailedMessage; + }, + enumerable: false, + configurable: true + }); + return ValidationError; +}(BaseScormValidationError)); + +var Scorm12ValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(Scorm12ValidationError, _super); + function Scorm12ValidationError(errorCode) { + var _this = this; + if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) { + _this = _super.call(this, errorCode, scorm12_errors[String(errorCode)].basicMessage, scorm12_errors[String(errorCode)].detailMessage) || this; + } + else { + _this = _super.call(this, 101, scorm12_errors["101"].basicMessage, scorm12_errors["101"].detailMessage) || this; + } + return _this; + } + return Scorm12ValidationError; +}(ValidationError)); + +var AICCValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(AICCValidationError, _super); + function AICCValidationError(errorCode) { + var _this = this; + if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) { + _this = _super.call(this, errorCode, aicc_errors[String(errorCode)].basicMessage, aicc_errors[String(errorCode)].detailMessage) || this; + } + else { + _this = _super.call(this, 101, aicc_errors["101"].basicMessage, aicc_errors["101"].detailMessage) || this; + } + return _this; + } + return AICCValidationError; +}(ValidationError)); + +var Scorm2004ValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(Scorm2004ValidationError, _super); + function Scorm2004ValidationError(errorCode) { + var _this = this; + if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) { + _this = _super.call(this, errorCode, scorm2004_errors[String(errorCode)].basicMessage, scorm2004_errors[String(errorCode)].detailMessage) || this; + } + else { + _this = _super.call(this, 101, scorm2004_errors["101"].basicMessage, scorm2004_errors["101"].detailMessage) || this; + } + return _this; + } + return Scorm2004ValidationError; +}(ValidationError)); + + + +/***/ }), + +/***/ 864: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ $o: function() { return /* binding */ addTwoDurations; }, +/* harmony export */ Bq: function() { return /* binding */ flatten; }, +/* harmony export */ J6: function() { return /* binding */ stringMatches; }, +/* harmony export */ OI: function() { return /* binding */ getDurationAsSeconds; }, +/* harmony export */ hw: function() { return /* binding */ formatMessage; }, +/* harmony export */ sB: function() { return /* binding */ unflatten; }, +/* harmony export */ xE: function() { return /* binding */ getSecondsAsISODuration; } +/* harmony export */ }); +/* unused harmony exports SECONDS_PER_SECOND, SECONDS_PER_MINUTE, SECONDS_PER_HOUR, SECONDS_PER_DAY, getSecondsAsHHMMSS, getTimeAsSeconds, addHHMMSSTimeStrings, countDecimals */ +var SECONDS_PER_SECOND = 1.0; +var SECONDS_PER_MINUTE = 60; +var SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE; +var SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR; +var designations = { + D: SECONDS_PER_DAY, + H: SECONDS_PER_HOUR, + M: SECONDS_PER_MINUTE, + S: SECONDS_PER_SECOND, +}; +function getSecondsAsHHMMSS(totalSeconds) { + if (!totalSeconds || totalSeconds <= 0) { + return "00:00:00"; + } + var hours = Math.floor(totalSeconds / SECONDS_PER_HOUR); + var dateObj = new Date(totalSeconds * 1000); + var minutes = dateObj.getUTCMinutes(); + var seconds = dateObj.getSeconds(); + var ms = totalSeconds % 1.0; + var msStr = ""; + if (countDecimals(ms) > 0) { + if (countDecimals(ms) > 2) { + msStr = ms.toFixed(2); + } + else { + msStr = String(ms); + } + msStr = "." + msStr.split(".")[1]; + } + return ((hours + ":" + minutes + ":" + seconds).replace(/\b\d\b/g, "0$&") + msStr); +} +function getSecondsAsISODuration(seconds) { + if (!seconds || seconds <= 0) { + return "PT0S"; + } + var duration = "P"; + var remainder = seconds; + for (var designationsKey in designations) { + var current_seconds = designations[designationsKey]; + var value = Math.floor(remainder / current_seconds); + remainder = remainder % current_seconds; + if (countDecimals(remainder) > 2) { + remainder = Number(Number(remainder).toFixed(2)); + } + if (designationsKey === "S" && remainder > 0) { + value += remainder; + } + if (value) { + if ((duration.indexOf("D") > 0 || + designationsKey === "H" || + designationsKey === "M" || + designationsKey === "S") && + duration.indexOf("T") === -1) { + duration += "T"; + } + duration += "".concat(value).concat(designationsKey); + } + } + return duration; +} +function getTimeAsSeconds(timeString, timeRegex) { + if (typeof timeString === "number" || typeof timeString === "boolean") { + timeString = String(timeString); + } + if (typeof timeRegex === "string") { + timeRegex = new RegExp(timeRegex); + } + if (!timeString || !timeString.match(timeRegex)) { + return 0; + } + var parts = timeString.split(":"); + var hours = Number(parts[0]); + var minutes = Number(parts[1]); + var seconds = Number(parts[2]); + return hours * 3600 + minutes * 60 + seconds; +} +function getDurationAsSeconds(duration, durationRegex) { + if (typeof durationRegex === "string") { + durationRegex = new RegExp(durationRegex); + } + if (!duration || !duration.match(durationRegex)) { + return 0; + } + var _a = new RegExp(durationRegex).exec(duration) || [], years = _a[1], _ = _a[2], days = _a[4], hours = _a[5], minutes = _a[6], seconds = _a[7]; + var result = 0.0; + result += Number(seconds) || 0.0; + result += Number(minutes) * 60.0 || 0.0; + result += Number(hours) * 3600.0 || 0.0; + result += Number(days) * (60 * 60 * 24.0) || 0.0; + result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0; + return result; +} +function addTwoDurations(first, second, durationRegex) { + var regex = typeof durationRegex === "string" + ? new RegExp(durationRegex) + : durationRegex; + return getSecondsAsISODuration(getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex)); +} +function addHHMMSSTimeStrings(first, second, timeRegex) { + if (typeof timeRegex === "string") { + timeRegex = new RegExp(timeRegex); + } + return getSecondsAsHHMMSS(getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex)); +} +function flatten(data) { + var result = {}; + function recurse(cur, prop) { + if (Object(cur) !== cur) { + result[prop] = cur; + } + else if (Array.isArray(cur)) { + for (var i = 0, l = cur.length; i < l; i++) { + recurse(cur[i], prop + "[" + i + "]"); + if (l === 0) + result[prop] = []; + } + } + else { + var isEmpty = true; + for (var p in cur) { + if ({}.hasOwnProperty.call(cur, p)) { + isEmpty = false; + recurse(cur[p], prop ? prop + "." + p : p); + } + } + if (isEmpty && prop) + result[prop] = {}; + } + } + recurse(data, ""); + return result; +} +function unflatten(data) { + "use strict"; + if (Object(data) !== data || Array.isArray(data)) + return data; + var regex = /\.?([^.[\]]+)|\[(\d+)]/g; + var result = {}; + for (var p in data) { + if ({}.hasOwnProperty.call(data, p)) { + var cur = result; + var prop = ""; + var m = regex.exec(p); + while (m) { + cur = cur[prop] || (cur[prop] = m[2] ? [] : {}); + prop = m[2] || m[1]; + m = regex.exec(p); + } + cur[prop] = data[p]; + } + } + return result[""] || result; +} +function countDecimals(num) { + if (Math.floor(num) === num || String(num).indexOf(".") < 0) + return 0; + var parts = num.toString().split(".")[1]; + return parts.length || 0; +} +function formatMessage(functionName, message, CMIElement) { + var baseLength = 20; + var messageString = ""; + messageString += functionName; + var fillChars = baseLength - messageString.length; + for (var i = 0; i < fillChars; i++) { + messageString += " "; + } + messageString += ": "; + if (CMIElement) { + var CMIElementBaseLength = 70; + messageString += CMIElement; + fillChars = CMIElementBaseLength - messageString.length; + for (var j = 0; j < fillChars; j++) { + messageString += " "; + } + } + if (message) { + messageString += message; + } + return messageString; +} +function stringMatches(str, tester) { + return (str === null || str === void 0 ? void 0 : str.match(tester)) !== null; +} + + +/***/ }), + +/***/ 635: +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ C6: function() { return /* binding */ __extends; }, +/* harmony export */ Cl: function() { return /* binding */ __assign; }, +/* harmony export */ YH: function() { return /* binding */ __generator; }, +/* harmony export */ sH: function() { return /* binding */ __awaiter; } +/* harmony export */ }); +/* unused harmony exports __rest, __decorate, __param, __esDecorate, __runInitializers, __propKey, __setFunctionName, __metadata, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn, __addDisposableResource, __disposeResources */ +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise, SuppressedError, Symbol, Iterator */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + } + return __assign.apply(this, arguments); +} + +function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +} + +function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +} + +function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } + var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context = {}; + for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context.access[p] = contextIn.access[p]; + context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } + else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; + } + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; +}; + +function __runInitializers(thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) { + value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + } + return useValue ? value : void 0; +}; + +function __propKey(x) { + return typeof x === "symbol" ? x : "".concat(x); +}; + +function __setFunctionName(f, name, prefix) { + if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; + return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); +}; + +function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} + +function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +var __createBinding = Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); + +function __exportStar(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); +} + +function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} + +function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +/** @deprecated */ +function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} + +/** @deprecated */ +function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +} + +function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +} + +function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} + +function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; + function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } + function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} + +function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } +} + +function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} + +function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; + +var __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}; + +function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +} + +function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; +} + +function __classPrivateFieldGet(receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +} + +function __classPrivateFieldSet(receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; +} + +function __classPrivateFieldIn(state, receiver) { + if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); + return typeof state === "function" ? receiver === state : state.has(receiver); +} + +function __addDisposableResource(env, value, async) { + if (value !== null && value !== void 0) { + if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); + var dispose, inner; + if (async) { + if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value[Symbol.asyncDispose]; + } + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + if (async) inner = dispose; + } + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; + env.stack.push({ value: value, dispose: dispose, async: async }); + } + else if (async) { + env.stack.push({ async: true }); + } + return value; +} + +var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; +}; + +function __disposeResources(env) { + function fail(e) { + env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; + env.hasError = true; + } + var r, s = 0; + function next() { + while (r = env.stack.pop()) { + try { + if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); + if (r.dispose) { + var result = r.dispose.call(r.value); + if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); + } + else s |= 1; + } + catch (e) { + fail(e); + } + } + if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); + if (env.hasError) throw env.error; + } + return next(); +} + +/* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ({ + __extends, + __assign, + __rest, + __decorate, + __param, + __metadata, + __awaiter, + __generator, + __createBinding, + __exportStar, + __values, + __read, + __spread, + __spreadArrays, + __spreadArray, + __await, + __asyncGenerator, + __asyncDelegator, + __asyncValues, + __makeTemplateObject, + __importStar, + __importDefault, + __classPrivateFieldGet, + __classPrivateFieldSet, + __classPrivateFieldIn, + __addDisposableResource, + __disposeResources, +}); + + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ !function() { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = function(exports, definition) { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ !function() { +/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ }(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + Z: function() { return /* binding */ Scorm2004Impl; } +}); + +// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs +var tslib_es6 = __webpack_require__(635); +// EXTERNAL MODULE: ./src/BaseAPI.ts + 3 modules +var BaseAPI = __webpack_require__(900); +// EXTERNAL MODULE: ./src/constants/api_constants.ts +var api_constants = __webpack_require__(340); +// EXTERNAL MODULE: ./src/constants/regex.ts +var regex = __webpack_require__(417); +// EXTERNAL MODULE: ./src/constants/error_codes.ts +var error_codes = __webpack_require__(797); +// EXTERNAL MODULE: ./src/exceptions.ts +var exceptions = __webpack_require__(784); +// EXTERNAL MODULE: ./src/utilities.ts +var utilities = __webpack_require__(864); +// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts +var base_cmi = __webpack_require__(319); +// EXTERNAL MODULE: ./src/cmi/common/validation.ts +var validation = __webpack_require__(449); +;// ./src/cmi/scorm2004/validation.ts + + + +function check2004ValidFormat(value, regexPattern, allowEmptyString) { + return (0,validation/* checkValidFormat */.q)(value, regexPattern, error_codes/* default */.A.scorm2004.TYPE_MISMATCH, exceptions/* Scorm2004ValidationError */.wq, allowEmptyString); +} +function check2004ValidRange(value, rangePattern) { + return (0,validation/* checkValidRange */.W)(value, rangePattern, error_codes/* default */.A.scorm2004.VALUE_OUT_OF_RANGE, exceptions/* Scorm2004ValidationError */.wq); +} + +;// ./src/cmi/scorm2004/learner_preference.ts + + + + + + + +var CMILearnerPreference = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMILearnerPreference, _super); + function CMILearnerPreference() { + var _this = _super.call(this) || this; + _this.__children = api_constants/* default */.A.scorm2004.student_preference_children; + _this._audio_level = "1"; + _this._language = ""; + _this._delivery_speed = "1"; + _this._audio_captioning = "0"; + return _this; + } + Object.defineProperty(CMILearnerPreference.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMILearnerPreference.prototype, "audio_level", { + get: function () { + return this._audio_level; + }, + set: function (audio_level) { + if (check2004ValidFormat(audio_level, regex/* default */.A.scorm2004.CMIDecimal) && + check2004ValidRange(audio_level, regex/* default */.A.scorm2004.audio_range)) { + this._audio_level = audio_level; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMILearnerPreference.prototype, "language", { + get: function () { + return this._language; + }, + set: function (language) { + if (check2004ValidFormat(language, regex/* default */.A.scorm2004.CMILang)) { + this._language = language; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMILearnerPreference.prototype, "delivery_speed", { + get: function () { + return this._delivery_speed; + }, + set: function (delivery_speed) { + if (check2004ValidFormat(delivery_speed, regex/* default */.A.scorm2004.CMIDecimal) && + check2004ValidRange(delivery_speed, regex/* default */.A.scorm2004.speed_range)) { + this._delivery_speed = delivery_speed; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMILearnerPreference.prototype, "audio_captioning", { + get: function () { + return this._audio_captioning; + }, + set: function (audio_captioning) { + if (check2004ValidFormat(audio_captioning, regex/* default */.A.scorm2004.CMISInteger) && + check2004ValidRange(audio_captioning, regex/* default */.A.scorm2004.text_range)) { + this._audio_captioning = audio_captioning; + } + }, + enumerable: false, + configurable: true + }); + CMILearnerPreference.prototype.toJSON = function () { + this.jsonString = true; + var result = { + audio_level: this.audio_level, + language: this.language, + delivery_speed: this.delivery_speed, + audio_captioning: this.audio_captioning, + }; + delete this.jsonString; + return result; + }; + return CMILearnerPreference; +}(base_cmi/* BaseCMI */.J)); + + +// EXTERNAL MODULE: ./src/cmi/common/array.ts +var array = __webpack_require__(589); +;// ./src/constants/response_constants.ts + +var scorm2004_regex = regex/* default */.A.scorm2004; +var LearnerResponses = { + "true-false": { + format: "^true$|^false$", + max: 1, + delimiter: "", + unique: false, + }, + choice: { + format: scorm2004_regex.CMILongIdentifier, + max: 36, + delimiter: "[,]", + unique: true, + }, + "fill-in": { + format: scorm2004_regex.CMILangString250, + max: 10, + delimiter: "[,]", + unique: false, + }, + "long-fill-in": { + format: scorm2004_regex.CMILangString4000, + max: 1, + delimiter: "", + unique: false, + }, + matching: { + format: scorm2004_regex.CMIShortIdentifier, + format2: scorm2004_regex.CMIShortIdentifier, + max: 36, + delimiter: "[,]", + delimiter2: "[.]", + unique: false, + }, + performance: { + format: "^$|" + scorm2004_regex.CMIShortIdentifier, + format2: scorm2004_regex.CMIDecimal + "|^$|" + scorm2004_regex.CMIShortIdentifier, + max: 250, + delimiter: "[,]", + delimiter2: "[.]", + unique: false, + }, + sequencing: { + format: scorm2004_regex.CMIShortIdentifier, + max: 36, + delimiter: "[,]", + unique: false, + }, + likert: { + format: scorm2004_regex.CMIShortIdentifier, + max: 1, + delimiter: "", + unique: false, + }, + numeric: { + format: scorm2004_regex.CMIDecimal, + max: 1, + delimiter: "", + unique: false, + }, + other: { + format: scorm2004_regex.CMIString4000, + max: 1, + delimiter: "", + unique: false, + }, +}; +var CorrectResponses = { + "true-false": { + max: 1, + delimiter: "", + unique: false, + duplicate: false, + format: "^true$|^false$", + limit: 1, + }, + choice: { + max: 36, + delimiter: "[,]", + unique: true, + duplicate: false, + format: scorm2004_regex.CMILongIdentifier, + }, + "fill-in": { + max: 10, + delimiter: "[,]", + unique: false, + duplicate: false, + format: scorm2004_regex.CMILangString250cr, + }, + "long-fill-in": { + max: 1, + delimiter: "", + unique: false, + duplicate: true, + format: scorm2004_regex.CMILangString4000, + }, + matching: { + max: 36, + delimiter: "[,]", + delimiter2: "[.]", + unique: false, + duplicate: false, + format: scorm2004_regex.CMIShortIdentifier, + format2: scorm2004_regex.CMIShortIdentifier, + }, + performance: { + max: 250, + delimiter: "[,]", + delimiter2: "[.]", + delimiter3: "[:]", + unique: false, + duplicate: false, + format: "^$|" + scorm2004_regex.CMIShortIdentifier, + format2: scorm2004_regex.CMIDecimal + "|^$|" + scorm2004_regex.CMIShortIdentifier, + }, + sequencing: { + max: 36, + delimiter: "[,]", + unique: false, + duplicate: false, + format: scorm2004_regex.CMIShortIdentifier, + }, + likert: { + max: 1, + delimiter: "", + unique: false, + duplicate: false, + format: scorm2004_regex.CMIShortIdentifier, + limit: 1, + }, + numeric: { + max: 2, + delimiter: "[:]", + unique: false, + duplicate: false, + format: scorm2004_regex.CMIDecimal, + limit: 1, + }, + other: { + max: 1, + delimiter: "", + unique: false, + duplicate: false, + format: scorm2004_regex.CMIString4000, + limit: 1, + }, +}; + +;// ./src/cmi/scorm2004/interactions.ts + + + + + + + + + +var CMIInteractions = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIInteractions, _super); + function CMIInteractions() { + return _super.call(this, { + children: api_constants/* default */.A.scorm2004.interactions_children, + errorCode: error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT, + errorClass: exceptions/* Scorm2004ValidationError */.wq, + }) || this; + } + return CMIInteractions; +}(array/* CMIArray */.B)); + +var CMIInteractionsObject = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIInteractionsObject, _super); + function CMIInteractionsObject() { + var _this = _super.call(this) || this; + _this._id = ""; + _this._type = ""; + _this._timestamp = ""; + _this._weighting = ""; + _this._learner_response = ""; + _this._result = ""; + _this._latency = ""; + _this._description = ""; + _this.objectives = new array/* CMIArray */.B({ + errorCode: error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT, + errorClass: exceptions/* Scorm2004ValidationError */.wq, + children: api_constants/* default */.A.scorm2004.objectives_children, + }); + _this.correct_responses = new array/* CMIArray */.B({ + errorCode: error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT, + errorClass: exceptions/* Scorm2004ValidationError */.wq, + children: api_constants/* default */.A.scorm2004.correct_responses_children, + }); + return _this; + } + CMIInteractionsObject.prototype.initialize = function () { + var _a, _b; + _super.prototype.initialize.call(this); + (_a = this.objectives) === null || _a === void 0 ? void 0 : _a.initialize(); + (_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.initialize(); + }; + Object.defineProperty(CMIInteractionsObject.prototype, "id", { + get: function () { + return this._id; + }, + set: function (id) { + if (check2004ValidFormat(id, regex/* default */.A.scorm2004.CMILongIdentifier)) { + this._id = id; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "type", { + get: function () { + return this._type; + }, + set: function (type) { + if (this.initialized && this._id === "") { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + } + else { + if (check2004ValidFormat(type, regex/* default */.A.scorm2004.CMIType)) { + this._type = type; + } + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "timestamp", { + get: function () { + return this._timestamp; + }, + set: function (timestamp) { + if (this.initialized && this._id === "") { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + } + else { + if (check2004ValidFormat(timestamp, regex/* default */.A.scorm2004.CMITime)) { + this._timestamp = timestamp; + } + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "weighting", { + get: function () { + return this._weighting; + }, + set: function (weighting) { + if (this.initialized && this._id === "") { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + } + else { + if (check2004ValidFormat(weighting, regex/* default */.A.scorm2004.CMIDecimal)) { + this._weighting = weighting; + } + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "learner_response", { + get: function () { + return this._learner_response; + }, + set: function (learner_response) { + if (this.initialized && (this._type === "" || this._id === "")) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + } + else { + var nodes = []; + var response_type = LearnerResponses[this.type]; + if (response_type) { + if (response_type === null || response_type === void 0 ? void 0 : response_type.delimiter) { + nodes = learner_response.split(response_type.delimiter); + } + else { + nodes[0] = learner_response; + } + if (nodes.length > 0 && nodes.length <= response_type.max) { + var formatRegex = new RegExp(response_type.format); + for (var i = 0; i < nodes.length; i++) { + if (response_type === null || response_type === void 0 ? void 0 : response_type.delimiter2) { + var values = nodes[i].split(response_type.delimiter2); + if (values.length === 2) { + if (!values[0].match(formatRegex)) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + else { + if (!response_type.format2 || + !values[1].match(new RegExp(response_type.format2))) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + } + } + else { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + } + else { + if (!nodes[i].match(formatRegex)) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + else { + if (nodes[i] !== "" && response_type.unique) { + for (var j = 0; j < i; j++) { + if (nodes[i] === nodes[j]) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + } + } + } + } + } + } + else { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.GENERAL_SET_FAILURE); + } + this._learner_response = learner_response; + } + else { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "result", { + get: function () { + return this._result; + }, + set: function (result) { + if (check2004ValidFormat(result, regex/* default */.A.scorm2004.CMIResult)) { + this._result = result; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "latency", { + get: function () { + return this._latency; + }, + set: function (latency) { + if (this.initialized && this._id === "") { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + } + else { + if (check2004ValidFormat(latency, regex/* default */.A.scorm2004.CMITimespan)) { + this._latency = latency; + } + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "description", { + get: function () { + return this._description; + }, + set: function (description) { + if (this.initialized && this._id === "") { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + } + else { + if (check2004ValidFormat(description, regex/* default */.A.scorm2004.CMILangString250, true)) { + this._description = description; + } + } + }, + enumerable: false, + configurable: true + }); + CMIInteractionsObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + id: this.id, + type: this.type, + objectives: this.objectives, + timestamp: this.timestamp, + weighting: this.weighting, + learner_response: this.learner_response, + result: this.result, + latency: this.latency, + description: this.description, + correct_responses: this.correct_responses, + }; + delete this.jsonString; + return result; + }; + return CMIInteractionsObject; +}(base_cmi/* BaseCMI */.J)); + +var CMIInteractionsObjectivesObject = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIInteractionsObjectivesObject, _super); + function CMIInteractionsObjectivesObject() { + var _this = _super.call(this) || this; + _this._id = ""; + return _this; + } + Object.defineProperty(CMIInteractionsObjectivesObject.prototype, "id", { + get: function () { + return this._id; + }, + set: function (id) { + if (check2004ValidFormat(id, regex/* default */.A.scorm2004.CMILongIdentifier)) { + this._id = id; + } + }, + enumerable: false, + configurable: true + }); + CMIInteractionsObjectivesObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + id: this.id, + }; + delete this.jsonString; + return result; + }; + return CMIInteractionsObjectivesObject; +}(base_cmi/* BaseCMI */.J)); + +var CMIInteractionsCorrectResponsesObject = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIInteractionsCorrectResponsesObject, _super); + function CMIInteractionsCorrectResponsesObject() { + var _this = _super.call(this) || this; + _this._pattern = ""; + return _this; + } + Object.defineProperty(CMIInteractionsCorrectResponsesObject.prototype, "pattern", { + get: function () { + return this._pattern; + }, + set: function (pattern) { + if (check2004ValidFormat(pattern, regex/* default */.A.scorm2004.CMIFeedback)) { + this._pattern = pattern; + } + }, + enumerable: false, + configurable: true + }); + CMIInteractionsCorrectResponsesObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + pattern: this.pattern, + }; + delete this.jsonString; + return result; + }; + return CMIInteractionsCorrectResponsesObject; +}(base_cmi/* BaseCMI */.J)); + + +// EXTERNAL MODULE: ./src/cmi/common/score.ts +var score = __webpack_require__(434); +;// ./src/cmi/scorm2004/score.ts + + + + + + + +var Scorm2004CMIScore = (function (_super) { + (0,tslib_es6/* __extends */.C6)(Scorm2004CMIScore, _super); + function Scorm2004CMIScore() { + var _this = _super.call(this, { + score_children: api_constants/* default */.A.scorm2004.score_children, + max: "", + invalidErrorCode: error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT, + invalidTypeCode: error_codes/* default */.A.scorm2004.TYPE_MISMATCH, + invalidRangeCode: error_codes/* default */.A.scorm2004.VALUE_OUT_OF_RANGE, + decimalRegex: regex/* default */.A.scorm2004.CMIDecimal, + errorClass: exceptions/* Scorm2004ValidationError */.wq, + }) || this; + _this._scaled = ""; + return _this; + } + Object.defineProperty(Scorm2004CMIScore.prototype, "scaled", { + get: function () { + return this._scaled; + }, + set: function (scaled) { + if (check2004ValidFormat(scaled, regex/* default */.A.scorm2004.CMIDecimal) && + check2004ValidRange(scaled, regex/* default */.A.scorm2004.scaled_range)) { + this._scaled = scaled; + } + }, + enumerable: false, + configurable: true + }); + Scorm2004CMIScore.prototype.toJSON = function () { + this.jsonString = true; + var result = { + scaled: this.scaled, + raw: this.raw, + min: this.min, + max: this.max, + }; + delete this.jsonString; + return result; + }; + return Scorm2004CMIScore; +}(score/* CMIScore */._)); + + +;// ./src/cmi/scorm2004/comments.ts + + + + + + + + +var CMICommentsFromLMS = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMICommentsFromLMS, _super); + function CMICommentsFromLMS() { + return _super.call(this, { + children: api_constants/* default */.A.scorm2004.comments_children, + errorCode: error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT, + errorClass: exceptions/* Scorm2004ValidationError */.wq, + }) || this; + } + return CMICommentsFromLMS; +}(array/* CMIArray */.B)); + +var CMICommentsFromLearner = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMICommentsFromLearner, _super); + function CMICommentsFromLearner() { + return _super.call(this, { + children: api_constants/* default */.A.scorm2004.comments_children, + errorCode: error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT, + errorClass: exceptions/* Scorm2004ValidationError */.wq, + }) || this; + } + return CMICommentsFromLearner; +}(array/* CMIArray */.B)); + +var CMICommentsObject = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMICommentsObject, _super); + function CMICommentsObject(readOnlyAfterInit) { + if (readOnlyAfterInit === void 0) { readOnlyAfterInit = false; } + var _this = _super.call(this) || this; + _this._comment = ""; + _this._location = ""; + _this._timestamp = ""; + _this._comment = ""; + _this._location = ""; + _this._timestamp = ""; + _this._readOnlyAfterInit = readOnlyAfterInit; + return _this; + } + Object.defineProperty(CMICommentsObject.prototype, "comment", { + get: function () { + return this._comment; + }, + set: function (comment) { + if (this.initialized && this._readOnlyAfterInit) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + else { + if (check2004ValidFormat(comment, regex/* default */.A.scorm2004.CMILangString4000, true)) { + this._comment = comment; + } + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICommentsObject.prototype, "location", { + get: function () { + return this._location; + }, + set: function (location) { + if (this.initialized && this._readOnlyAfterInit) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + else { + if (check2004ValidFormat(location, regex/* default */.A.scorm2004.CMIString250)) { + this._location = location; + } + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICommentsObject.prototype, "timestamp", { + get: function () { + return this._timestamp; + }, + set: function (timestamp) { + if (this.initialized && this._readOnlyAfterInit) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + else { + if (check2004ValidFormat(timestamp, regex/* default */.A.scorm2004.CMITime)) { + this._timestamp = timestamp; + } + } + }, + enumerable: false, + configurable: true + }); + CMICommentsObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + comment: this.comment, + location: this.location, + timestamp: this.timestamp, + }; + delete this.jsonString; + return result; + }; + return CMICommentsObject; +}(base_cmi/* BaseCMI */.J)); + + +;// ./src/cmi/scorm2004/objectives.ts + + + + + + + + + +var CMIObjectives = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIObjectives, _super); + function CMIObjectives() { + return _super.call(this, { + children: api_constants/* default */.A.scorm2004.objectives_children, + errorCode: error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT, + errorClass: exceptions/* Scorm2004ValidationError */.wq, + }) || this; + } + return CMIObjectives; +}(array/* CMIArray */.B)); + +var CMIObjectivesObject = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIObjectivesObject, _super); + function CMIObjectivesObject() { + var _this = _super.call(this) || this; + _this._id = ""; + _this._success_status = "unknown"; + _this._completion_status = "unknown"; + _this._progress_measure = ""; + _this._description = ""; + _this.score = new Scorm2004CMIScore(); + return _this; + } + CMIObjectivesObject.prototype.initialize = function () { + var _a; + _super.prototype.initialize.call(this); + (_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize(); + }; + Object.defineProperty(CMIObjectivesObject.prototype, "id", { + get: function () { + return this._id; + }, + set: function (id) { + if (check2004ValidFormat(id, regex/* default */.A.scorm2004.CMILongIdentifier)) { + this._id = id; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIObjectivesObject.prototype, "success_status", { + get: function () { + return this._success_status; + }, + set: function (success_status) { + if (this.initialized && this._id === "") { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + } + else { + if (check2004ValidFormat(success_status, regex/* default */.A.scorm2004.CMISStatus)) { + this._success_status = success_status; + } + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIObjectivesObject.prototype, "completion_status", { + get: function () { + return this._completion_status; + }, + set: function (completion_status) { + if (this.initialized && this._id === "") { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + } + else { + if (check2004ValidFormat(completion_status, regex/* default */.A.scorm2004.CMICStatus)) { + this._completion_status = completion_status; + } + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIObjectivesObject.prototype, "progress_measure", { + get: function () { + return this._progress_measure; + }, + set: function (progress_measure) { + if (this.initialized && this._id === "") { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + } + else { + if (check2004ValidFormat(progress_measure, regex/* default */.A.scorm2004.CMIDecimal) && + check2004ValidRange(progress_measure, regex/* default */.A.scorm2004.progress_range)) { + this._progress_measure = progress_measure; + } + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIObjectivesObject.prototype, "description", { + get: function () { + return this._description; + }, + set: function (description) { + if (this.initialized && this._id === "") { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + } + else { + if (check2004ValidFormat(description, regex/* default */.A.scorm2004.CMILangString250, true)) { + this._description = description; + } + } + }, + enumerable: false, + configurable: true + }); + CMIObjectivesObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + id: this.id, + success_status: this.success_status, + completion_status: this.completion_status, + progress_measure: this.progress_measure, + description: this.description, + score: this.score, + }; + delete this.jsonString; + return result; + }; + return CMIObjectivesObject; +}(base_cmi/* BaseCMI */.J)); + + +;// ./src/cmi/scorm2004/cmi.ts + + + + + + + + + + + + + +var CMI = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMI, _super); + function CMI(initialized) { + if (initialized === void 0) { initialized = false; } + var _this = _super.call(this) || this; + _this.__version = "1.0"; + _this.__children = api_constants/* default */.A.scorm2004.cmi_children; + _this._completion_status = "unknown"; + _this._completion_threshold = ""; + _this._credit = "credit"; + _this._entry = ""; + _this._exit = ""; + _this._launch_data = ""; + _this._learner_id = ""; + _this._learner_name = ""; + _this._location = ""; + _this._max_time_allowed = ""; + _this._mode = "normal"; + _this._progress_measure = ""; + _this._scaled_passing_score = ""; + _this._session_time = "PT0H0M0S"; + _this._success_status = "unknown"; + _this._suspend_data = ""; + _this._time_limit_action = "continue,no message"; + _this._total_time = ""; + _this.learner_preference = new CMILearnerPreference(); + _this.score = new Scorm2004CMIScore(); + _this.comments_from_learner = new CMICommentsFromLearner(); + _this.comments_from_lms = new CMICommentsFromLMS(); + _this.interactions = new CMIInteractions(); + _this.objectives = new CMIObjectives(); + if (initialized) + _this.initialize(); + return _this; + } + CMI.prototype.initialize = function () { + var _a, _b, _c, _d, _e, _f; + _super.prototype.initialize.call(this); + (_a = this.learner_preference) === null || _a === void 0 ? void 0 : _a.initialize(); + (_b = this.score) === null || _b === void 0 ? void 0 : _b.initialize(); + (_c = this.comments_from_learner) === null || _c === void 0 ? void 0 : _c.initialize(); + (_d = this.comments_from_lms) === null || _d === void 0 ? void 0 : _d.initialize(); + (_e = this.interactions) === null || _e === void 0 ? void 0 : _e.initialize(); + (_f = this.objectives) === null || _f === void 0 ? void 0 : _f.initialize(); + }; + Object.defineProperty(CMI.prototype, "_version", { + get: function () { + return this.__version; + }, + set: function (_version) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "completion_status", { + get: function () { + return this._completion_status; + }, + set: function (completion_status) { + if (check2004ValidFormat(completion_status, regex/* default */.A.scorm2004.CMICStatus)) { + this._completion_status = completion_status; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "completion_threshold", { + get: function () { + return this._completion_threshold; + }, + set: function (completion_threshold) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + else { + this._completion_threshold = completion_threshold; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "credit", { + get: function () { + return this._credit; + }, + set: function (credit) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + else { + this._credit = credit; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "entry", { + get: function () { + return this._entry; + }, + set: function (entry) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + else { + this._entry = entry; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "exit", { + get: function () { + if (!this.jsonString) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.WRITE_ONLY_ELEMENT); + } + return this._exit; + }, + set: function (exit) { + if (check2004ValidFormat(exit, regex/* default */.A.scorm2004.CMIExit, true)) { + this._exit = exit; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "launch_data", { + get: function () { + return this._launch_data; + }, + set: function (launch_data) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + else { + this._launch_data = launch_data; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "learner_id", { + get: function () { + return this._learner_id; + }, + set: function (learner_id) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + else { + this._learner_id = learner_id; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "learner_name", { + get: function () { + return this._learner_name; + }, + set: function (learner_name) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + else { + this._learner_name = learner_name; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "location", { + get: function () { + return this._location; + }, + set: function (location) { + if (check2004ValidFormat(location, regex/* default */.A.scorm2004.CMIString1000)) { + this._location = location; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "max_time_allowed", { + get: function () { + return this._max_time_allowed; + }, + set: function (max_time_allowed) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + else { + this._max_time_allowed = max_time_allowed; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "mode", { + get: function () { + return this._mode; + }, + set: function (mode) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + else { + this._mode = mode; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "progress_measure", { + get: function () { + return this._progress_measure; + }, + set: function (progress_measure) { + if (check2004ValidFormat(progress_measure, regex/* default */.A.scorm2004.CMIDecimal) && + check2004ValidRange(progress_measure, regex/* default */.A.scorm2004.progress_range)) { + this._progress_measure = progress_measure; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "scaled_passing_score", { + get: function () { + return this._scaled_passing_score; + }, + set: function (scaled_passing_score) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + else { + this._scaled_passing_score = scaled_passing_score; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "session_time", { + get: function () { + if (!this.jsonString) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.WRITE_ONLY_ELEMENT); + } + return this._session_time; + }, + set: function (session_time) { + if (check2004ValidFormat(session_time, regex/* default */.A.scorm2004.CMITimespan)) { + this._session_time = session_time; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "success_status", { + get: function () { + return this._success_status; + }, + set: function (success_status) { + if (check2004ValidFormat(success_status, regex/* default */.A.scorm2004.CMISStatus)) { + this._success_status = success_status; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "suspend_data", { + get: function () { + return this._suspend_data; + }, + set: function (suspend_data) { + if (check2004ValidFormat(suspend_data, regex/* default */.A.scorm2004.CMIString64000, true)) { + this._suspend_data = suspend_data; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "time_limit_action", { + get: function () { + return this._time_limit_action; + }, + set: function (time_limit_action) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + else { + this._time_limit_action = time_limit_action; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "total_time", { + get: function () { + return this._total_time; + }, + set: function (total_time) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + else { + this._total_time = total_time; + } + }, + enumerable: false, + configurable: true + }); + CMI.prototype.getCurrentTotalTime = function () { + var sessionTime = this._session_time; + var startTime = this.start_time; + if (typeof startTime !== "undefined" && startTime !== null) { + var seconds = new Date().getTime() - startTime; + sessionTime = utilities/* getSecondsAsISODuration */.xE(seconds / 1000); + } + return utilities/* addTwoDurations */.$o(this._total_time, sessionTime, regex/* default */.A.scorm2004.CMITimespan); + }; + CMI.prototype.toJSON = function () { + this.jsonString = true; + var result = { + comments_from_learner: this.comments_from_learner, + comments_from_lms: this.comments_from_lms, + completion_status: this.completion_status, + completion_threshold: this.completion_threshold, + credit: this.credit, + entry: this.entry, + exit: this.exit, + interactions: this.interactions, + launch_data: this.launch_data, + learner_id: this.learner_id, + learner_name: this.learner_name, + learner_preference: this.learner_preference, + location: this.location, + max_time_allowed: this.max_time_allowed, + mode: this.mode, + objectives: this.objectives, + progress_measure: this.progress_measure, + scaled_passing_score: this.scaled_passing_score, + score: this.score, + session_time: this.session_time, + success_status: this.success_status, + suspend_data: this.suspend_data, + time_limit_action: this.time_limit_action, + }; + delete this.jsonString; + return result; + }; + return CMI; +}(base_cmi/* BaseRootCMI */.r)); + + +;// ./src/constants/language_constants.ts +var ValidLanguages = [ + "aa", + "ab", + "ae", + "af", + "ak", + "am", + "an", + "ar", + "as", + "av", + "ay", + "az", + "ba", + "be", + "bg", + "bh", + "bi", + "bm", + "bn", + "bo", + "br", + "bs", + "ca", + "ce", + "ch", + "co", + "cr", + "cs", + "cu", + "cv", + "cy", + "da", + "de", + "dv", + "dz", + "ee", + "el", + "en", + "eo", + "es", + "et", + "eu", + "fa", + "ff", + "fi", + "fj", + "fo", + "fr", + "fy", + "ga", + "gd", + "gl", + "gn", + "gu", + "gv", + "ha", + "he", + "hi", + "ho", + "hr", + "ht", + "hu", + "hy", + "hz", + "ia", + "id", + "ie", + "ig", + "ii", + "ik", + "io", + "is", + "it", + "iu", + "ja", + "jv", + "ka", + "kg", + "ki", + "kj", + "kk", + "kl", + "km", + "kn", + "ko", + "kr", + "ks", + "ku", + "kv", + "kw", + "ky", + "la", + "lb", + "lg", + "li", + "ln", + "lo", + "lt", + "lu", + "lv", + "mg", + "mh", + "mi", + "mk", + "ml", + "mn", + "mo", + "mr", + "ms", + "mt", + "my", + "na", + "nb", + "nd", + "ne", + "ng", + "nl", + "nn", + "no", + "nr", + "nv", + "ny", + "oc", + "oj", + "om", + "or", + "os", + "pa", + "pi", + "pl", + "ps", + "pt", + "qu", + "rm", + "rn", + "ro", + "ru", + "rw", + "sa", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sk", + "sl", + "sm", + "sn", + "so", + "sq", + "sr", + "ss", + "st", + "su", + "sv", + "sw", + "ta", + "te", + "tg", + "th", + "ti", + "tk", + "tl", + "tn", + "to", + "tr", + "ts", + "tt", + "tw", + "ty", + "ug", + "uk", + "ur", + "uz", + "ve", + "vi", + "vo", + "wa", + "wo", + "xh", + "yi", + "yo", + "za", + "zh", + "zu", + "aar", + "abk", + "ave", + "afr", + "aka", + "amh", + "arg", + "ara", + "asm", + "ava", + "aym", + "aze", + "bak", + "bel", + "bul", + "bih", + "bis", + "bam", + "ben", + "tib", + "bod", + "bre", + "bos", + "cat", + "che", + "cha", + "cos", + "cre", + "cze", + "ces", + "chu", + "chv", + "wel", + "cym", + "dan", + "ger", + "deu", + "div", + "dzo", + "ewe", + "gre", + "ell", + "eng", + "epo", + "spa", + "est", + "baq", + "eus", + "per", + "fas", + "ful", + "fin", + "fij", + "fao", + "fre", + "fra", + "fry", + "gle", + "gla", + "glg", + "grn", + "guj", + "glv", + "hau", + "heb", + "hin", + "hmo", + "hrv", + "hat", + "hun", + "arm", + "hye", + "her", + "ina", + "ind", + "ile", + "ibo", + "iii", + "ipk", + "ido", + "ice", + "isl", + "ita", + "iku", + "jpn", + "jav", + "geo", + "kat", + "kon", + "kik", + "kua", + "kaz", + "kal", + "khm", + "kan", + "kor", + "kau", + "kas", + "kur", + "kom", + "cor", + "kir", + "lat", + "ltz", + "lug", + "lim", + "lin", + "lao", + "lit", + "lub", + "lav", + "mlg", + "mah", + "mao", + "mri", + "mac", + "mkd", + "mal", + "mon", + "mol", + "mar", + "may", + "msa", + "mlt", + "bur", + "mya", + "nau", + "nob", + "nde", + "nep", + "ndo", + "dut", + "nld", + "nno", + "nor", + "nbl", + "nav", + "nya", + "oci", + "oji", + "orm", + "ori", + "oss", + "pan", + "pli", + "pol", + "pus", + "por", + "que", + "roh", + "run", + "rum", + "ron", + "rus", + "kin", + "san", + "srd", + "snd", + "sme", + "sag", + "slo", + "sin", + "slk", + "slv", + "smo", + "sna", + "som", + "alb", + "sqi", + "srp", + "ssw", + "sot", + "sun", + "swe", + "swa", + "tam", + "tel", + "tgk", + "tha", + "tir", + "tuk", + "tgl", + "tsn", + "ton", + "tur", + "tso", + "tat", + "twi", + "tah", + "uig", + "ukr", + "urd", + "uzb", + "ven", + "vie", + "vol", + "wln", + "wol", + "xho", + "yid", + "yor", + "zha", + "chi", + "zho", + "zul", +]; +/* harmony default export */ var language_constants = (ValidLanguages); + +// EXTERNAL MODULE: ./src/constants/enums.ts +var enums = __webpack_require__(56); +;// ./src/cmi/scorm2004/adl.ts + + + + + + + +var ADL = (function (_super) { + (0,tslib_es6/* __extends */.C6)(ADL, _super); + function ADL() { + var _this = _super.call(this) || this; + _this.nav = new ADLNav(); + return _this; + } + ADL.prototype.initialize = function () { + var _a; + _super.prototype.initialize.call(this); + (_a = this.nav) === null || _a === void 0 ? void 0 : _a.initialize(); + }; + ADL.prototype.toJSON = function () { + this.jsonString = true; + var result = { + nav: this.nav, + }; + delete this.jsonString; + return result; + }; + return ADL; +}(base_cmi/* BaseCMI */.J)); + +var ADLNav = (function (_super) { + (0,tslib_es6/* __extends */.C6)(ADLNav, _super); + function ADLNav() { + var _this = _super.call(this) || this; + _this._request = "_none_"; + _this.request_valid = new ADLNavRequestValid(); + return _this; + } + ADLNav.prototype.initialize = function () { + var _a; + _super.prototype.initialize.call(this); + (_a = this.request_valid) === null || _a === void 0 ? void 0 : _a.initialize(); + }; + Object.defineProperty(ADLNav.prototype, "request", { + get: function () { + return this._request; + }, + set: function (request) { + if (check2004ValidFormat(request, regex/* default */.A.scorm2004.NAVEvent)) { + this._request = request; + } + }, + enumerable: false, + configurable: true + }); + ADLNav.prototype.toJSON = function () { + this.jsonString = true; + var result = { + request: this.request, + }; + delete this.jsonString; + return result; + }; + return ADLNav; +}(base_cmi/* BaseCMI */.J)); + +var ADLNavRequestValid = (function (_super) { + (0,tslib_es6/* __extends */.C6)(ADLNavRequestValid, _super); + function ADLNavRequestValid() { + var _this = _super.call(this) || this; + _this._continue = "unknown"; + _this._previous = "unknown"; + _this._choice = {}; + _this._jump = {}; + return _this; + } + Object.defineProperty(ADLNavRequestValid.prototype, "continue", { + get: function () { + return this._continue; + }, + set: function (_continue) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + if (check2004ValidFormat(_continue, regex/* default */.A.scorm2004.NAVBoolean)) { + this._continue = _continue; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(ADLNavRequestValid.prototype, "previous", { + get: function () { + return this._previous; + }, + set: function (_previous) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + if (check2004ValidFormat(_previous, regex/* default */.A.scorm2004.NAVBoolean)) { + this._previous = _previous; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(ADLNavRequestValid.prototype, "choice", { + get: function () { + return this._choice; + }, + set: function (choice) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + if (typeof choice !== "object") { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + for (var key in choice) { + if ({}.hasOwnProperty.call(choice, key)) { + if (check2004ValidFormat(choice[key], regex/* default */.A.scorm2004.NAVBoolean) && + check2004ValidFormat(key, regex/* default */.A.scorm2004.NAVTarget)) { + this._choice[key] = + enums/* NAVBoolean */.K$[choice[key]]; + } + } + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(ADLNavRequestValid.prototype, "jump", { + get: function () { + return this._jump; + }, + set: function (jump) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + if (typeof jump !== "object") { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + for (var key in jump) { + if ({}.hasOwnProperty.call(jump, key)) { + if (check2004ValidFormat(jump[key], regex/* default */.A.scorm2004.NAVBoolean) && + check2004ValidFormat(key, regex/* default */.A.scorm2004.NAVTarget)) { + this._jump[key] = enums/* NAVBoolean */.K$[jump[key]]; + } + } + } + }, + enumerable: false, + configurable: true + }); + ADLNavRequestValid.prototype.toJSON = function () { + this.jsonString = true; + var result = { + previous: this._previous, + continue: this._continue, + choice: this._choice, + jump: this._jump, + }; + delete this.jsonString; + return result; + }; + return ADLNavRequestValid; +}(base_cmi/* BaseCMI */.J)); + + +;// ./src/Scorm2004API.ts + + + + + + + + + + + + + + + + +var Scorm2004Impl = (function (_super) { + (0,tslib_es6/* __extends */.C6)(Scorm2004Impl, _super); + function Scorm2004Impl(settings) { + var _this = this; + if (settings) { + if (settings.mastery_override === undefined) { + settings.mastery_override = false; + } + } + _this = _super.call(this, error_codes/* default */.A.scorm2004, settings) || this; + _this._version = "1.0"; + _this.cmi = new CMI(); + _this.adl = new ADL(); + _this.Initialize = _this.lmsInitialize; + _this.Terminate = _this.lmsFinish; + _this.GetValue = _this.lmsGetValue; + _this.SetValue = _this.lmsSetValue; + _this.Commit = _this.lmsCommit; + _this.GetLastError = _this.lmsGetLastError; + _this.GetErrorString = _this.lmsGetErrorString; + _this.GetDiagnostic = _this.lmsGetDiagnostic; + return _this; + } + Scorm2004Impl.prototype.reset = function (settings) { + this.commonReset(settings); + this.cmi = new CMI(); + this.adl = new ADL(); + }; + Object.defineProperty(Scorm2004Impl.prototype, "version", { + get: function () { + return this._version; + }, + enumerable: false, + configurable: true + }); + Scorm2004Impl.prototype.lmsInitialize = function () { + this.cmi.initialize(); + return this.initialize("Initialize"); + }; + Scorm2004Impl.prototype.lmsFinish = function () { + var _this = this; + (function () { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this.internalFinish()]; + case 1: + _a.sent(); + return [2]; + } + }); + }); })(); + return api_constants/* default */.A.global.SCORM_TRUE; + }; + Scorm2004Impl.prototype.internalFinish = function () { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + var result, navActions, request, choiceJumpRegex, matches, target, action; + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this.terminate("Terminate", true)]; + case 1: + result = _a.sent(); + if (result === api_constants/* default */.A.global.SCORM_TRUE) { + if (this.adl.nav.request !== "_none_") { + navActions = { + continue: "SequenceNext", + previous: "SequencePrevious", + choice: "SequenceChoice", + jump: "SequenceJump", + exit: "SequenceExit", + exitAll: "SequenceExitAll", + abandon: "SequenceAbandon", + abandonAll: "SequenceAbandonAll", + }; + request = this.adl.nav.request; + choiceJumpRegex = new RegExp(regex/* default */.A.scorm2004.NAVEvent); + matches = request.match(choiceJumpRegex); + target = ""; + if (matches && matches.length > 2) { + target = matches[2]; + request = matches[1].replace(target, ""); + } + action = navActions[request]; + if (action) { + this.processListeners(action, "adl.nav.request", target); + } + } + else if (this.settings.autoProgress) { + this.processListeners("SequenceNext"); + } + } + return [2, result]; + } + }); + }); + }; + Scorm2004Impl.prototype.lmsGetValue = function (CMIElement) { + var adlNavRequestRegex = "^adl\\.nav\\.request_valid\\.(choice|jump)\\.{target=\\S{0,}([a-zA-Z0-9-_]+)}$"; + if ((0,utilities/* stringMatches */.J6)(CMIElement, adlNavRequestRegex)) { + var matches = CMIElement.match(adlNavRequestRegex); + var request = matches[1]; + var target = matches[2].replace("{target=", "").replace("}", ""); + if (request === "choice" || request === "jump") { + if (this.settings.scoItemIdValidator) { + return String(this.settings.scoItemIdValidator(target)); + } + return String(this.settings.scoItemIds.includes(target)); + } + } + return this.getValue("GetValue", true, CMIElement); + }; + Scorm2004Impl.prototype.lmsSetValue = function (CMIElement, value) { + return this.setValue("SetValue", "Commit", true, CMIElement, value); + }; + Scorm2004Impl.prototype.lmsCommit = function () { + var _this = this; + (function () { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this.commit("Commit")]; + case 1: + _a.sent(); + return [2]; + } + }); + }); })(); + return api_constants/* default */.A.global.SCORM_TRUE; + }; + Scorm2004Impl.prototype.lmsGetLastError = function () { + return this.getLastError("GetLastError"); + }; + Scorm2004Impl.prototype.lmsGetErrorString = function (CMIErrorCode) { + return this.getErrorString("GetErrorString", CMIErrorCode); + }; + Scorm2004Impl.prototype.lmsGetDiagnostic = function (CMIErrorCode) { + return this.getDiagnostic("GetDiagnostic", CMIErrorCode); + }; + Scorm2004Impl.prototype.setCMIValue = function (CMIElement, value) { + return this._commonSetCMIValue("SetValue", true, CMIElement, value); + }; + Scorm2004Impl.prototype.getChildElement = function (CMIElement, value, foundFirstIndex) { + if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.objectives\\.\\d+")) { + return new CMIObjectivesObject(); + } + if (foundFirstIndex) { + if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")) { + return this.createCorrectResponsesObject(CMIElement, value); + } + else if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")) { + return new CMIInteractionsObjectivesObject(); + } + } + else if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.interactions\\.\\d+")) { + return new CMIInteractionsObject(); + } + if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.comments_from_learner\\.\\d+")) { + return new CMICommentsObject(); + } + else if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.comments_from_lms\\.\\d+")) { + return new CMICommentsObject(true); + } + return null; + }; + Scorm2004Impl.prototype.createCorrectResponsesObject = function (CMIElement, value) { + var parts = CMIElement.split("."); + var index = Number(parts[2]); + var interaction = this.cmi.interactions.childArray[index]; + if (this.isInitialized()) { + if (!interaction.type) { + this.throwSCORMError(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + } + else { + this.checkDuplicateChoiceResponse(interaction, value); + var response_type = CorrectResponses[interaction.type]; + if (response_type) { + this.checkValidResponseType(response_type, value, interaction.type); + } + else { + this.throwSCORMError(error_codes/* default */.A.scorm2004.GENERAL_SET_FAILURE, "Incorrect Response Type: " + interaction.type); + } + } + } + if (this.lastErrorCode === "0") { + return new CMIInteractionsCorrectResponsesObject(); + } + return null; + }; + Scorm2004Impl.prototype.checkValidResponseType = function (response_type, value, interaction_type) { + var nodes = []; + if (response_type === null || response_type === void 0 ? void 0 : response_type.delimiter) { + nodes = String(value).split(response_type.delimiter); + } + else { + nodes[0] = value; + } + if (nodes.length > 0 && nodes.length <= response_type.max) { + this.checkCorrectResponseValue(interaction_type, nodes, value); + } + else if (nodes.length > response_type.max) { + this.throwSCORMError(error_codes/* default */.A.scorm2004.GENERAL_SET_FAILURE, "Data Model Element Pattern Too Long"); + } + }; + Scorm2004Impl.prototype.checkDuplicateChoiceResponse = function (interaction, value) { + var interaction_count = interaction.correct_responses._count; + if (interaction.type === "choice") { + for (var i = 0; i < interaction_count && this.lastErrorCode === "0"; i++) { + var response = interaction.correct_responses.childArray[i]; + if (response.pattern === value) { + this.throwSCORMError(error_codes/* default */.A.scorm2004.GENERAL_SET_FAILURE); + } + } + } + }; + Scorm2004Impl.prototype.validateCorrectResponse = function (CMIElement, value) { + var parts = CMIElement.split("."); + var index = Number(parts[2]); + var pattern_index = Number(parts[4]); + var interaction = this.cmi.interactions.childArray[index]; + var interaction_count = interaction.correct_responses._count; + this.checkDuplicateChoiceResponse(interaction, value); + var response_type = CorrectResponses[interaction.type]; + if (typeof response_type.limit === "undefined" || + interaction_count <= response_type.limit) { + this.checkValidResponseType(response_type, value, interaction.type); + if ((this.lastErrorCode === "0" && + (!response_type.duplicate || + !this.checkDuplicatedPattern(interaction.correct_responses, pattern_index, value))) || + (this.lastErrorCode === "0" && value === "")) { + } + else { + if (this.lastErrorCode === "0") { + this.throwSCORMError(error_codes/* default */.A.scorm2004.GENERAL_SET_FAILURE, "Data Model Element Pattern Already Exists"); + } + } + } + else { + this.throwSCORMError(error_codes/* default */.A.scorm2004.GENERAL_SET_FAILURE, "Data Model Element Collection Limit Reached"); + } + }; + Scorm2004Impl.prototype.getCMIValue = function (CMIElement) { + return this._commonGetCMIValue("GetValue", true, CMIElement); + }; + Scorm2004Impl.prototype.getLmsErrorMessageDetails = function (errorNumber, detail) { + var basicMessage = ""; + var detailMessage = ""; + errorNumber = String(errorNumber); + if (api_constants/* default */.A.scorm2004.error_descriptions[errorNumber]) { + basicMessage = + api_constants/* default */.A.scorm2004.error_descriptions[errorNumber].basicMessage; + detailMessage = + api_constants/* default */.A.scorm2004.error_descriptions[errorNumber].detailMessage; + } + return detail ? detailMessage : basicMessage; + }; + Scorm2004Impl.prototype.checkDuplicatedPattern = function (correct_response, current_index, value) { + var found = false; + var count = correct_response._count; + for (var i = 0; i < count && !found; i++) { + if (i !== current_index && correct_response.childArray[i] === value) { + found = true; + } + } + return found; + }; + Scorm2004Impl.prototype.checkCorrectResponseValue = function (interaction_type, nodes, value) { + var response = CorrectResponses[interaction_type]; + var formatRegex = new RegExp(response.format); + for (var i = 0; i < nodes.length && this.lastErrorCode === "0"; i++) { + if (interaction_type.match("^(fill-in|long-fill-in|matching|performance|sequencing)$")) { + nodes[i] = this.removeCorrectResponsePrefixes(nodes[i]); + } + if (response === null || response === void 0 ? void 0 : response.delimiter2) { + var values = nodes[i].split(response.delimiter2); + if (values.length === 2) { + var matches = values[0].match(formatRegex); + if (!matches) { + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + else { + if (!response.format2 || + !values[1].match(new RegExp(response.format2))) { + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + } + } + else { + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + } + else { + var matches = nodes[i].match(formatRegex); + if ((!matches && value !== "") || + (!matches && interaction_type === "true-false")) { + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + else { + if (interaction_type === "numeric" && nodes.length > 1) { + if (Number(nodes[0]) > Number(nodes[1])) { + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + } + else { + if (nodes[i] !== "" && response.unique) { + for (var j = 0; j < i && this.lastErrorCode === "0"; j++) { + if (nodes[i] === nodes[j]) { + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + } + } + } + } + } + } + }; + Scorm2004Impl.prototype.removeCorrectResponsePrefixes = function (node) { + var seenOrder = false; + var seenCase = false; + var seenLang = false; + var prefixRegex = new RegExp("^({(lang|case_matters|order_matters)=([^}]+)})"); + var matches = node.match(prefixRegex); + var langMatches = null; + while (matches) { + switch (matches[2]) { + case "lang": + langMatches = node.match(regex/* default */.A.scorm2004.CMILangcr); + if (langMatches) { + var lang = langMatches[3]; + if (lang !== undefined && lang.length > 0) { + if (!language_constants.includes(lang.toLowerCase())) { + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + } + } + seenLang = true; + break; + case "case_matters": + if (!seenLang && !seenOrder && !seenCase) { + if (matches[3] !== "true" && matches[3] !== "false") { + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + } + seenCase = true; + break; + case "order_matters": + if (!seenCase && !seenLang && !seenOrder) { + if (matches[3] !== "true" && matches[3] !== "false") { + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + } + seenOrder = true; + break; + } + node = node.substring(matches[1].length); + matches = node.match(prefixRegex); + } + return node; + }; + Scorm2004Impl.prototype.replaceWithAnotherScormAPI = function (newAPI) { + this.cmi = newAPI.cmi; + this.adl = newAPI.adl; + }; + Scorm2004Impl.prototype.renderCommitCMI = function (terminateCommit) { + var cmiExport = this.renderCMIToJSONObject(); + if (terminateCommit) { + cmiExport.cmi.total_time = this.cmi.getCurrentTotalTime(); + } + var result = []; + var flattened = utilities/* flatten */.Bq(cmiExport); + switch (this.settings.dataCommitFormat) { + case "flattened": + return utilities/* flatten */.Bq(cmiExport); + case "params": + for (var item in flattened) { + if ({}.hasOwnProperty.call(flattened, item)) { + result.push("".concat(item, "=").concat(flattened[item])); + } + } + return result; + case "json": + default: + return cmiExport; + } + }; + Scorm2004Impl.prototype.renderCommitObject = function (terminateCommit) { + var cmiExport = this.renderCommitCMI(terminateCommit); + var totalTimeDuration = this.cmi.getCurrentTotalTime(); + var totalTimeSeconds = utilities/* getDurationAsSeconds */.OI(totalTimeDuration, regex/* default */.A.scorm2004.CMITimespan); + var completionStatus = enums/* CompletionStatus */.lC.unknown; + var successStatus = enums/* SuccessStatus */.YE.unknown; + if (this.cmi.completion_status) { + if (this.cmi.completion_status === "completed") { + completionStatus = enums/* CompletionStatus */.lC.completed; + } + else if (this.cmi.completion_status === "incomplete") { + completionStatus = enums/* CompletionStatus */.lC.incomplete; + } + } + if (this.cmi.success_status) { + if (this.cmi.success_status === "passed") { + successStatus = enums/* SuccessStatus */.YE.passed; + } + else if (this.cmi.success_status === "failed") { + successStatus = enums/* SuccessStatus */.YE.failed; + } + } + var score = this.cmi.score; + var scoreObject = null; + if (score) { + scoreObject = {}; + if (!Number.isNaN(Number.parseFloat(score.raw))) { + scoreObject.raw = Number.parseFloat(score.raw); + } + if (!Number.isNaN(Number.parseFloat(score.min))) { + scoreObject.min = Number.parseFloat(score.min); + } + if (!Number.isNaN(Number.parseFloat(score.max))) { + scoreObject.max = Number.parseFloat(score.max); + } + if (!Number.isNaN(Number.parseFloat(score.scaled))) { + scoreObject.scaled = Number.parseFloat(score.scaled); + } + } + var commitObject = { + completionStatus: completionStatus, + successStatus: successStatus, + totalTimeSeconds: totalTimeSeconds, + runtimeData: cmiExport, + }; + if (scoreObject) { + commitObject.score = scoreObject; + } + return commitObject; + }; + Scorm2004Impl.prototype.storeData = function (terminateCommit) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + var navRequest, shouldTerminateCommit, commitObject, result; + var _a, _b, _c; + return (0,tslib_es6/* __generator */.YH)(this, function (_d) { + switch (_d.label) { + case 0: + if (terminateCommit) { + if (this.cmi.mode === "normal") { + if (this.cmi.credit === "credit") { + if (this.cmi.completion_threshold && this.cmi.progress_measure) { + if (this.cmi.progress_measure >= this.cmi.completion_threshold) { + this.cmi.completion_status = "completed"; + } + else { + this.cmi.completion_status = "incomplete"; + } + } + if (this.cmi.scaled_passing_score && this.cmi.score.scaled) { + if (this.cmi.score.scaled >= this.cmi.scaled_passing_score) { + this.cmi.success_status = "passed"; + } + else { + this.cmi.success_status = "failed"; + } + } + } + } + } + navRequest = false; + if (this.adl.nav.request !== ((_c = (_b = (_a = this.startingData) === null || _a === void 0 ? void 0 : _a.adl) === null || _b === void 0 ? void 0 : _b.nav) === null || _c === void 0 ? void 0 : _c.request) && + this.adl.nav.request !== "_none_") { + this.adl.nav.request = encodeURIComponent(this.adl.nav.request); + navRequest = true; + } + shouldTerminateCommit = terminateCommit || this.settings.alwaysSendTotalTime; + commitObject = this.settings.renderCommonCommitFields + ? this.renderCommitObject(shouldTerminateCommit) + : this.renderCommitCMI(shouldTerminateCommit); + if (this.apiLogLevel === api_constants/* default */.A.global.LOG_LEVEL_DEBUG) { + console.debug("Commit (terminated: " + (terminateCommit ? "yes" : "no") + "): "); + console.debug(commitObject); + } + if (!(typeof this.settings.lmsCommitUrl === "string")) return [3, 2]; + return [4, this.processHttpRequest(this.settings.lmsCommitUrl, commitObject, terminateCommit)]; + case 1: + result = _d.sent(); + { + if (navRequest && + result.navRequest !== undefined && + result.navRequest !== "") { + Function("\"use strict\";(() => { ".concat(result.navRequest, " })()"))(); + } + } + return [2, result]; + case 2: return [2, { + result: api_constants/* default */.A.global.SCORM_TRUE, + errorCode: 0, + }]; + } + }); + }); + }; + return Scorm2004Impl; +}(BaseAPI/* default */.A)); + + +var __webpack_exports__Scorm2004Impl = __webpack_exports__.Z; +export { __webpack_exports__Scorm2004Impl as Scorm2004Impl }; + +//# sourceMappingURL=scorm2004.js.map \ No newline at end of file diff --git a/dist/esm/scorm2004.js.map b/dist/esm/scorm2004.js.map new file mode 100644 index 0000000..1a04695 --- /dev/null +++ b/dist/esm/scorm2004.js.map @@ -0,0 +1 @@ +{"version":3,"file":"scorm2004.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAQO,SAAS,QAAQ,CACtB,IAAO,EACP,IAAY,EACZ,SAAiB;IAAjB,6CAAiB;IAEjB,IAAI,OAA6C,CAAC;IAElD,OAAO;QAAqB,cAAsB;aAAtB,UAAsB,EAAtB,qBAAsB,EAAtB,IAAsB;YAAtB,yBAAsB;;QAChD,IAAM,OAAO,GAAG,IAAI,CAAC;QAErB,IAAM,KAAK,GAAG;YACZ,OAAO,GAAG,IAAI,CAAC;YACf,IAAI,CAAC,SAAS;gBAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC5C,CAAC,CAAC;QAEF,IAAM,OAAO,GAAG,SAAS,IAAI,CAAC,OAAO,CAAC;QAEtC,IAAI,OAAO;YAAE,YAAY,CAAC,OAAO,CAAC,CAAC;QACnC,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAElC,IAAI,OAAO;YAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACzC,CAAC,CAAC;AACJ,CAAC;;;;AC7B0C;AAKpC,IAAM,eAAe,GAAa;IACvC,UAAU,EAAE,KAAK;IACjB,iBAAiB,EAAE,EAAE;IACrB,WAAW,EAAE,KAAK;IAClB,cAAc,EAAE,IAAI;IACpB,YAAY,EAAE,KAAK;IACnB,gBAAgB,EAAE,MAAM;IACxB,qBAAqB,EAAE,gCAAgC;IACv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BAAqB,8BAA8B,gDAAgD,wDAAwD;AAC3J,2CAA2C,sCAAsC,UAAU,mBAAmB,IAAI;AAClH;;AAEO;AACP,+BAA+B,uCAAuC,YAAY,KAAK,OAAO;AAC9F;AACA;;AAEA;AACA,wCAAwC,4BAA4B;AACpE,CAAC;AACD;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,2CAA2C;AAC3C;;AAEO;AACP;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,MAAM,oBAAoB,YAAY;AAC5E,qBAAqB,8CAA8C;AACnE;AACA;AACA,qBAAqB,aAAa;AAClC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uFAAuF,SAAS,gBAAgB;AAChH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sEAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAC;;;;;;;SCzXF;SACA;;SAEA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;;SAEA;SACA;;SAEA;SACA;SACA;;;;;UCtBA;UACA;UACA;UACA;UACA,yCAAyC,wCAAwC;UACjF;UACA;UACA;;;;;UCPA,8CAA8C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACA2B;AACpB;AACO;AASrD,SAAS,oBAAoB,CAClC,KAAa,EACb,YAAoB,EACpB,gBAA0B;IAE1B,OAAO,sCAAgB,CACrB,KAAK,EACL,YAAY,EACZ,0BAAU,CAAC,SAAS,CAAC,aAAa,EACl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;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KA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,eAAe,CAChB;;wBAJK,MAAM,GAAG,SAId;wBAGD,CAAC;4BACC,IACE,UAAU;gCACV,MAAM,CAAC,UAAU,KAAK,SAAS;gCAC/B,MAAM,CAAC,UAAU,KAAK,EAAE,EACxB,CAAC;gCACD,QAAQ,CAAC,kCAAyB,MAAM,CAAC,UAAU,UAAO,CAAC,EAAE,CAAC;4BAChE,CAAC;wBACH,CAAC;wBACD,WAAO,MAAM,EAAC;4BAEd,WAAO;4BACL,MAAM,EAAE,4BAAY,CAAC,MAAM,CAAC,UAAU;4BACtC,SAAS,EAAE,CAAC;yBACb,EAAC;;;;KAEL;IACH,oBAAC;AAAD,CAAC,CArtB2B,sBAAO,GAqtBlC;AAEwB","sources":["webpack://scorm-again/./src/utilities/debounce.ts","webpack://scorm-again/./src/constants/default_settings.ts","webpack://scorm-again/./src/helpers/scheduled_commit.ts","webpack://scorm-again/./src/BaseAPI.ts","webpack://scorm-again/./src/cmi/common/array.ts","webpack://scorm-again/./src/cmi/common/base_cmi.ts","webpack://scorm-again/./src/cmi/common/score.ts","webpack://scorm-again/./src/cmi/common/validation.ts","webpack://scorm-again/./src/constants/api_constants.ts","webpack://scorm-again/./src/constants/enums.ts","webpack://scorm-again/./src/constants/error_codes.ts","webpack://scorm-again/./src/constants/regex.ts","webpack://scorm-again/./src/exceptions.ts","webpack://scorm-again/./src/utilities.ts","webpack://scorm-again/./node_modules/tslib/tslib.es6.mjs","webpack://scorm-again/webpack/bootstrap","webpack://scorm-again/webpack/runtime/define property getters","webpack://scorm-again/webpack/runtime/hasOwnProperty shorthand","webpack://scorm-again/./src/cmi/scorm2004/validation.ts","webpack://scorm-again/./src/cmi/scorm2004/learner_preference.ts","webpack://scorm-again/./src/constants/response_constants.ts","webpack://scorm-again/./src/cmi/scorm2004/interactions.ts","webpack://scorm-again/./src/cmi/scorm2004/score.ts","webpack://scorm-again/./src/cmi/scorm2004/comments.ts","webpack://scorm-again/./src/cmi/scorm2004/objectives.ts","webpack://scorm-again/./src/cmi/scorm2004/cmi.ts","webpack://scorm-again/./src/constants/language_constants.ts","webpack://scorm-again/./src/cmi/scorm2004/adl.ts","webpack://scorm-again/./src/Scorm2004API.ts"],"sourcesContent":["/**\n * Debounce function to delay the execution of a given function.\n *\n * @param func - The function to debounce.\n * @param wait - The number of milliseconds to delay.\n * @param immediate - If `true`, the function will be triggered on the leading edge instead of the trailing.\n * @returns A debounced version of the provided function.\n */\nexport function debounce void>(\n func: T,\n wait: number,\n immediate = false,\n): (...args: Parameters) => void {\n let timeout: ReturnType | null;\n\n return function (this: any, ...args: Parameters) {\n const context = this;\n\n const later = () => {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n const callNow = immediate && !timeout;\n\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) func.apply(context, args);\n };\n}\n","import { ResultObject, Settings } from \"../types/api_types\";\nimport APIConstants from \"./api_constants\";\n\n/**\n * Default settings for the SCORM API\n */\nexport const DefaultSettings: Settings = {\n autocommit: false,\n autocommitSeconds: 10,\n asyncCommit: false,\n sendFullCommit: true,\n lmsCommitUrl: false,\n dataCommitFormat: \"json\",\n commitRequestDataType: \"application/json;charset=UTF-8\",\n autoProgress: false,\n logLevel: APIConstants.global.LOG_LEVEL_ERROR,\n selfReportSessionTime: false,\n alwaysSendTotalTime: false,\n renderCommonCommitFields: false,\n strict_errors: true,\n xhrHeaders: {},\n xhrWithCredentials: false,\n responseHandler: async function (response: Response): Promise {\n if (typeof response !== \"undefined\") {\n const httpResult = JSON.parse(await response.text());\n if (\n httpResult === null ||\n !{}.hasOwnProperty.call(httpResult, \"result\")\n ) {\n if (response.status === 200) {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n }\n } else {\n return {\n result: httpResult.result,\n errorCode: httpResult.errorCode\n ? httpResult.errorCode\n : httpResult.result === APIConstants.global.SCORM_TRUE\n ? 0\n : 101,\n };\n }\n }\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n },\n requestHandler: function (commitObject) {\n return commitObject;\n },\n onLogMessage: function (messageLevel, logMessage) {\n switch (messageLevel) {\n case APIConstants.global.LOG_LEVEL_ERROR:\n console.error(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_WARNING:\n console.warn(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_INFO:\n console.info(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_DEBUG:\n if (console.debug) {\n console.debug(logMessage);\n } else {\n console.log(logMessage);\n }\n break;\n }\n },\n scoItemIds: [],\n scoItemIdValidator: false,\n};\n","import BaseAPI from \"../BaseAPI\";\n\n/**\n * Private class that wraps a timeout call to the commit() function\n */\nexport class ScheduledCommit {\n private _API;\n private _cancelled = false;\n private readonly _timeout;\n private readonly _callback;\n\n /**\n * Constructor for ScheduledCommit\n * @param {BaseAPI} API\n * @param {number} when\n * @param {string} callback\n */\n constructor(API: BaseAPI, when: number, callback: string) {\n this._API = API;\n this._timeout = setTimeout(this.wrapper.bind(this), when);\n this._callback = callback;\n }\n\n /**\n * Cancel any currently scheduled commit\n */\n cancel() {\n this._cancelled = true;\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n }\n\n /**\n * Wrap the API commit call to check if the call has already been cancelled\n */\n wrapper() {\n if (!this._cancelled) {\n (async () => await this._API.commit(this._callback))();\n }\n }\n}\n","import { CMIArray } from \"./cmi/common/array\";\nimport { ValidationError } from \"./exceptions\";\nimport ErrorCodes, { ErrorCode } from \"./constants/error_codes\";\nimport APIConstants from \"./constants/api_constants\";\nimport { formatMessage, stringMatches, unflatten } from \"./utilities\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { debounce } from \"./utilities/debounce\";\nimport {\n RefObject,\n CommitObject,\n ResultObject,\n Settings,\n} from \"./types/api_types\";\nimport { DefaultSettings } from \"./constants/default_settings\";\nimport { IBaseAPI } from \"./interfaces/IBaseAPI\";\nimport { ScheduledCommit } from \"./helpers/scheduled_commit\";\n\n/**\n * Base API class for AICC, SCORM 1.2, and SCORM 2004. Should be considered\n * abstract, and never initialized on its own.\n */\nexport default abstract class BaseAPI implements IBaseAPI {\n private _timeout?: ScheduledCommit;\n private readonly _error_codes: ErrorCode;\n private _settings: Settings = DefaultSettings;\n\n /**\n * Constructor for Base API class. Sets some shared API fields, as well as\n * sets up options for the API.\n * @param {ErrorCode} error_codes\n * @param {Settings} settings\n */\n protected constructor(error_codes: ErrorCode, settings?: Settings) {\n if (new.target === BaseAPI) {\n throw new TypeError(\"Cannot construct BaseAPI instances directly\");\n }\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n\n this._error_codes = error_codes;\n\n if (settings) {\n this.settings = settings;\n }\n this.apiLogLevel = this.settings.logLevel;\n this.selfReportSessionTime = this.settings.selfReportSessionTime;\n }\n\n public abstract cmi: BaseCMI;\n public startingData?: RefObject;\n\n public currentState: number;\n public lastErrorCode: string;\n public listenerArray: any[];\n public apiLogLevel: number;\n public selfReportSessionTime: boolean;\n\n abstract reset(settings?: Settings): void;\n\n /**\n * Common reset method for all APIs. New settings are merged with the existing settings.\n * @param {Settings} settings\n * @protected\n */\n commonReset(settings?: Settings): void {\n this.settings = { ...this.settings, ...settings };\n\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n }\n\n /**\n * Initialize the API\n * @param {string} callbackName\n * @param {string} initializeMessage\n * @param {string} terminationMessage\n * @return {string}\n */\n initialize(\n callbackName: string,\n initializeMessage?: string,\n terminationMessage?: string,\n ): string {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);\n } else if (this.isTerminated()) {\n this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage);\n } else {\n if (this.selfReportSessionTime) {\n this.cmi.setStartTime();\n }\n\n this.currentState = APIConstants.global.STATE_INITIALIZED;\n this.lastErrorCode = \"0\";\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n abstract lmsInitialize(): string;\n\n abstract lmsFinish(): string;\n\n abstract lmsGetValue(CMIElement: string): string;\n\n abstract lmsSetValue(CMIElement: string, value: any): string;\n\n abstract lmsCommit(): string;\n\n abstract lmsGetLastError(): string;\n\n abstract lmsGetErrorString(CMIErrorCode: string | number): string;\n\n abstract lmsGetDiagnostic(CMIErrorCode: string | number): string;\n\n /**\n * Abstract method for validating that a response is correct.\n *\n * @param {string} _CMIElement\n * @param {any} _value\n */\n abstract validateCorrectResponse(_CMIElement: string, _value: any): void;\n\n /**\n * Gets or builds a new child element to add to the array.\n * APIs that inherit BaseAPI should override this method.\n *\n * @param {string} _CMIElement - unused\n * @param {*} _value - unused\n * @param {boolean} _foundFirstIndex - unused\n * @return {BaseCMI|null}\n * @abstract\n */\n abstract getChildElement(\n _CMIElement: string,\n _value: any,\n _foundFirstIndex: boolean,\n ): BaseCMI | null;\n\n /**\n * Attempts to store the data to the LMS, logs data if no LMS configured\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _calculateTotalTime\n * @return {ResultObject}\n * @abstract\n */\n abstract storeData(_calculateTotalTime: boolean): Promise;\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _terminateCommit\n * @return {RefObject|Array}\n * @abstract\n */\n abstract renderCommitCMI(_terminateCommit: boolean): RefObject | Array;\n\n /**\n * Render the commit object to the shortened format for LMS commit\n * @param {boolean} _terminateCommit\n * @return {CommitObject}\n */\n abstract renderCommitObject(_terminateCommit: boolean): CommitObject;\n\n /**\n * Logging for all SCORM actions\n *\n * @param {string} functionName\n * @param {string} logMessage\n * @param {number} messageLevel\n * @param {string} CMIElement\n */\n apiLog(\n functionName: string,\n logMessage: string,\n messageLevel: number,\n CMIElement?: string,\n ) {\n logMessage = formatMessage(functionName, logMessage, CMIElement);\n\n if (messageLevel >= this.apiLogLevel) {\n this.settings.onLogMessage(messageLevel, logMessage);\n }\n }\n\n /**\n * Getter for _error_codes\n * @return {ErrorCode}\n */\n get error_codes(): ErrorCode {\n return this._error_codes;\n }\n\n /**\n * Getter for _settings\n * @return {Settings}\n */\n get settings(): Settings {\n return this._settings;\n }\n\n /**\n * Setter for _settings\n * @param {Settings} settings\n */\n set settings(settings: Settings) {\n this._settings = { ...this._settings, ...settings };\n }\n\n /**\n * Terminates the current run of the API\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async terminate(\n callbackName: string,\n checkTerminated: boolean,\n ): Promise {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.TERMINATION_BEFORE_INIT,\n this._error_codes.MULTIPLE_TERMINATION,\n )\n ) {\n this.currentState = APIConstants.global.STATE_TERMINATED;\n\n const result: ResultObject = await this.storeData(true);\n if (typeof result.errorCode !== \"undefined\" && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Get the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @return {string}\n */\n getValue(\n callbackName: string,\n checkTerminated: boolean,\n CMIElement: string,\n ): string {\n let returnValue: string = \"\";\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.RETRIEVE_BEFORE_INIT,\n this._error_codes.RETRIEVE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.getCMIValue(CMIElement);\n } catch (e) {\n returnValue = this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement);\n }\n\n this.apiLog(\n callbackName,\n \": returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n\n if (returnValue === undefined) {\n return \"\";\n }\n\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Sets the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {string} commitCallback\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setValue(\n callbackName: string,\n commitCallback: string,\n checkTerminated: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (value !== undefined) {\n value = String(value);\n }\n let returnValue: string = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.STORE_BEFORE_INIT,\n this._error_codes.STORE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.setCMIValue(CMIElement, value);\n } catch (e) {\n this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement, value);\n }\n\n if (returnValue === undefined) {\n returnValue = APIConstants.global.SCORM_FALSE;\n }\n\n // If we didn't have any errors while setting the data, go ahead and\n // schedule a commit, if autocommit is turned on\n if (String(this.lastErrorCode) === \"0\") {\n if (this.settings.autocommit && !this._timeout) {\n this.scheduleCommit(\n this.settings.autocommitSeconds * 1000,\n commitCallback,\n );\n }\n }\n\n this.apiLog(\n callbackName,\n \": \" + value + \": result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Orders LMS to store all content parameters\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async commit(\n callbackName: string,\n checkTerminated: boolean = false,\n ): Promise {\n this.clearScheduledCommit();\n\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.COMMIT_BEFORE_INIT,\n this._error_codes.COMMIT_AFTER_TERM,\n )\n ) {\n const result = await this.storeData(false);\n if (result.errorCode && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n this.apiLog(\n callbackName,\n \" Result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"HttpRequest\",\n );\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Returns last error code\n * @param {string} callbackName\n * @return {string}\n */\n getLastError(callbackName: string): string {\n const returnValue = String(this.lastErrorCode);\n\n this.processListeners(callbackName);\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getErrorString(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getDiagnostic(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Checks the LMS state and ensures it has been initialized.\n *\n * @param {boolean} checkTerminated\n * @param {number} beforeInitError\n * @param {number} afterTermError\n * @return {boolean}\n */\n checkState(\n checkTerminated: boolean,\n beforeInitError: number,\n afterTermError: number,\n ): boolean {\n if (this.isNotInitialized()) {\n this.throwSCORMError(beforeInitError);\n return false;\n } else if (checkTerminated && this.isTerminated()) {\n this.throwSCORMError(afterTermError);\n return false;\n }\n\n return true;\n }\n\n /**\n * Returns the message that corresponds to errorNumber\n * APIs that inherit BaseAPI should override this function\n *\n * @param {(string|number)} _errorNumber\n * @param {boolean} _detail\n * @return {string}\n * @abstract\n */\n getLmsErrorMessageDetails(\n _errorNumber: string | number,\n _detail: boolean = false,\n ): string {\n throw new Error(\n \"The getLmsErrorMessageDetails method has not been implemented\",\n );\n }\n\n /**\n * Gets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @return {string}\n * @abstract\n */\n getCMIValue(_CMIElement: string): string {\n throw new Error(\"The getCMIValue method has not been implemented\");\n }\n\n /**\n * Sets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @param {any} _value\n * @return {string}\n * @abstract\n */\n setCMIValue(_CMIElement: string, _value: any): string {\n throw new Error(\"The setCMIValue method has not been implemented\");\n }\n\n /**\n * Shared API method to set a valid for a given element.\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n _commonSetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (!CMIElement || CMIElement === \"\") {\n return APIConstants.global.SCORM_FALSE;\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let returnValue = APIConstants.global.SCORM_FALSE;\n let foundFirstIndex = false;\n\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n const attribute = structure[idx];\n\n if (idx === structure.length - 1) {\n if (scorm2004 && attribute.substring(0, 8) === \"{target=\") {\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);\n } else {\n refObject = {\n ...refObject,\n attribute: value,\n };\n }\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (\n stringMatches(CMIElement, \"\\\\.correct_responses\\\\.\\\\d+\") &&\n this.isInitialized()\n ) {\n this.validateCorrectResponse(CMIElement, value);\n }\n\n if (!scorm2004 || this.lastErrorCode === \"0\") {\n refObject[attribute] = value;\n returnValue = APIConstants.global.SCORM_TRUE;\n }\n }\n } else {\n refObject = refObject[attribute];\n if (!refObject) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n foundFirstIndex = true;\n } else {\n const newChild = this.getChildElement(\n CMIElement,\n value,\n foundFirstIndex,\n );\n foundFirstIndex = true;\n\n if (!newChild) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (refObject.initialized) newChild.initialize();\n\n refObject.childArray.push(newChild);\n refObject = newChild;\n }\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n }\n\n if (returnValue === APIConstants.global.SCORM_FALSE) {\n this.apiLog(\n methodName,\n `There was an error setting the value for: ${CMIElement}, value of: ${value}`,\n APIConstants.global.LOG_LEVEL_WARNING,\n );\n }\n\n return returnValue;\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @return {any}\n */\n _commonGetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n ): any {\n if (!CMIElement || CMIElement === \"\") {\n return \"\";\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let attribute = null;\n\n const uninitializedErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) has not been initialized.`;\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n attribute = structure[idx];\n\n if (!scorm2004) {\n if (idx === structure.length - 1) {\n if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n } else {\n if (\n String(attribute).substring(0, 8) === \"{target=\" &&\n typeof refObject._isTargetValid == \"function\"\n ) {\n const target = String(attribute).substring(\n 8,\n String(attribute).length - 9,\n );\n return refObject._isTargetValid(target);\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n\n refObject = refObject[attribute];\n if (refObject === undefined) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n } else {\n this.throwSCORMError(\n this._error_codes.VALUE_NOT_INITIALIZED,\n uninitializedErrorMessage,\n );\n break;\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n\n if (refObject === null || refObject === undefined) {\n if (!scorm2004) {\n if (attribute === \"_children\") {\n this.throwSCORMError(ErrorCodes.scorm12.CHILDREN_ERROR);\n } else if (attribute === \"_count\") {\n this.throwSCORMError(ErrorCodes.scorm12.COUNT_ERROR);\n }\n }\n } else {\n return refObject;\n }\n }\n\n /**\n * Returns true if the API's current state is STATE_INITIALIZED\n *\n * @return {boolean}\n */\n isInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_NOT_INITIALIZED\n *\n * @return {boolean}\n */\n isNotInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_NOT_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_TERMINATED\n *\n * @return {boolean}\n */\n isTerminated(): boolean {\n return this.currentState === APIConstants.global.STATE_TERMINATED;\n }\n\n /**\n * Provides a mechanism for attaching to a specific SCORM event\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n on(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray.push({\n functionName: functionName,\n CMIElement: CMIElement,\n callback: callback,\n });\n\n this.apiLog(\n \"on\",\n `Added event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n\n /**\n * Provides a mechanism for detaching a specific SCORM event listener\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n off(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n const removeIndex = this.listenerArray.findIndex(\n (obj) =>\n obj.functionName === functionName &&\n obj.CMIElement === CMIElement &&\n obj.callback === callback,\n );\n if (removeIndex !== -1) {\n this.listenerArray.splice(removeIndex, 1);\n this.apiLog(\n \"off\",\n `Removed event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n }\n\n /**\n * Provides a mechanism for clearing all listeners from a specific SCORM event\n *\n * @param {string} listenerName\n */\n clear(listenerName: string) {\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray = this.listenerArray.filter(\n (obj) =>\n obj.functionName !== functionName && obj.CMIElement !== CMIElement,\n );\n }\n }\n\n /**\n * Processes any 'on' listeners that have been created\n *\n * @param {string} functionName\n * @param {string} CMIElement\n * @param {any} value\n */\n processListeners(functionName: string, CMIElement?: string, value?: any) {\n this.apiLog(\n functionName,\n value,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n for (let i = 0; i < this.listenerArray.length; i++) {\n const listener = this.listenerArray[i];\n const functionsMatch = listener.functionName === functionName;\n const listenerHasCMIElement = !!listener.CMIElement;\n let CMIElementsMatch = false;\n if (\n CMIElement &&\n listener.CMIElement &&\n listener.CMIElement.substring(listener.CMIElement.length - 1) === \"*\"\n ) {\n CMIElementsMatch =\n CMIElement.indexOf(\n listener.CMIElement.substring(0, listener.CMIElement.length - 1),\n ) === 0;\n } else {\n CMIElementsMatch = listener.CMIElement === CMIElement;\n }\n\n if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {\n this.apiLog(\n \"processListeners\",\n `Processing listener: ${listener.functionName}`,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n listener.callback(CMIElement, value);\n }\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} errorNumber\n * @param {string} message\n */\n throwSCORMError(errorNumber: number, message?: string) {\n if (!message) {\n message = this.getLmsErrorMessageDetails(errorNumber);\n }\n\n this.apiLog(\n \"throwSCORMError\",\n errorNumber + \": \" + message,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n\n this.lastErrorCode = String(errorNumber);\n }\n\n /**\n * Clears the last SCORM error code on success.\n *\n * @param {string} success\n */\n clearSCORMError(success: string) {\n if (success !== undefined && success !== APIConstants.global.SCORM_FALSE) {\n this.lastErrorCode = \"0\";\n }\n }\n\n /**\n * Load the CMI from a flattened JSON object\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromFlattenedJSON(json: RefObject, CMIElement?: string) {\n if (!CMIElement) {\n // by default, we start from a blank string because we're expecting each element to start with `cmi`\n CMIElement = \"\";\n }\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromFlattenedJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n /**\n * Tests two strings against a given regular expression pattern and determines a numeric or null result based on the matching criterion.\n *\n * @param {string} a - The first string to be tested against the pattern.\n * @param {string} c - The second string to be tested against the pattern.\n * @param {RegExp} a_pattern - The regular expression pattern to test the strings against.\n * @return {number | null} A numeric result based on the matching criterion, or null if the strings do not match the pattern.\n */\n function testPattern(\n a: string,\n c: string,\n a_pattern: RegExp,\n ): number | null {\n const a_match = a.match(a_pattern);\n\n let c_match;\n if (a_match !== null && (c_match = c.match(a_pattern)) !== null) {\n const a_num = Number(a_match[2]);\n const c_num = Number(c_match[2]);\n if (a_num === c_num) {\n if (a_match[3] === \"id\") {\n return -1;\n } else if (a_match[3] === \"type\") {\n if (c_match[3] === \"id\") {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 1;\n }\n }\n return a_num - c_num;\n }\n\n return null;\n }\n\n const int_pattern = /^(cmi\\.interactions\\.)(\\d+)\\.(.*)$/;\n const obj_pattern = /^(cmi\\.objectives\\.)(\\d+)\\.(.*)$/;\n\n const result = Object.keys(json).map(function (key) {\n return [String(key), json[key]];\n });\n\n // CMI interactions need to have id and type loaded before any other fields\n result.sort(function ([a, _b], [c, _d]) {\n let test;\n if ((test = testPattern(a, c, int_pattern)) !== null) {\n return test;\n }\n if ((test = testPattern(a, c, obj_pattern)) !== null) {\n return test;\n }\n\n if (a < c) {\n return -1;\n }\n if (a > c) {\n return 1;\n }\n return 0;\n });\n\n let obj: RefObject;\n result.forEach((element) => {\n obj = {};\n obj[element[0]] = element[1];\n this.loadFromJSON(unflatten(obj), CMIElement);\n });\n }\n\n /**\n * Loads CMI data from a JSON object.\n *\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromJSON(json: RefObject, CMIElement: string) {\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n CMIElement = CMIElement !== undefined ? CMIElement : \"cmi\";\n\n this.startingData = json;\n\n // could this be refactored down to flatten(json) then setCMIValue on each?\n for (const key in json) {\n if ({}.hasOwnProperty.call(json, key) && json[key]) {\n const currentCMIElement = (CMIElement ? CMIElement + \".\" : \"\") + key;\n const value = json[key];\n\n if (value[\"childArray\"]) {\n for (let i = 0; i < value[\"childArray\"].length; i++) {\n this.loadFromJSON(\n value[\"childArray\"][i],\n currentCMIElement + \".\" + i,\n );\n }\n } else if (value.constructor === Object) {\n this.loadFromJSON(value, currentCMIElement);\n } else {\n this.setCMIValue(currentCMIElement, value);\n }\n }\n }\n }\n\n /**\n * Render the CMI object to JSON for sending to an LMS.\n *\n * @return {string}\n */\n renderCMIToJSONString(): string {\n const cmi = this.cmi;\n // Do we want/need to return fields that have no set value?\n if (this.settings.sendFullCommit) {\n return JSON.stringify({ cmi });\n }\n return JSON.stringify({ cmi }, (k, v) => (v === undefined ? null : v), 2);\n }\n\n /**\n * Returns a JS object representing the current cmi\n * @return {object}\n */\n renderCMIToJSONObject(): object {\n return JSON.parse(this.renderCMIToJSONString());\n }\n\n /**\n * Send the request to the LMS\n * @param {string} url\n * @param {CommitObject|RefObject|Array} params\n * @param {boolean} immediate\n * @return {ResultObject}\n */\n async processHttpRequest(\n url: string,\n params: CommitObject | RefObject | Array,\n immediate: boolean = false,\n ): Promise {\n const api = this;\n const genericError: ResultObject = {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: this.error_codes.GENERAL,\n };\n\n // if we are terminating the module or closing the browser window/tab, we need to make this fetch ASAP.\n // Some browsers, especially Chrome, do not like synchronous requests to be made when the window is closing.\n if (immediate) {\n this.performFetch(url, params).then(async (response) => {\n await this.transformResponse(response);\n });\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n\n const process = async (\n url: string,\n params: CommitObject | RefObject | Array,\n settings: Settings,\n ): Promise => {\n try {\n params = settings.requestHandler(params);\n const response = await this.performFetch(url, params);\n\n return this.transformResponse(response);\n } catch (e) {\n this.apiLog(\n \"processHttpRequest\",\n e,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n api.processListeners(\"CommitError\");\n return genericError;\n }\n };\n\n if (this.settings.asyncCommit) {\n const debouncedProcess = debounce(process, 500, immediate);\n debouncedProcess(url, params, this.settings);\n\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return await process(url, params, this.settings);\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} when - the number of milliseconds to wait before committing\n * @param {string} callback - the name of the commit event callback\n */\n scheduleCommit(when: number, callback: string) {\n this._timeout = new ScheduledCommit(this, when, callback);\n this.apiLog(\n \"scheduleCommit\",\n \"scheduled\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n\n /**\n * Clears and cancels any currently scheduled commits\n */\n clearScheduledCommit() {\n if (this._timeout) {\n this._timeout.cancel();\n this._timeout = undefined;\n this.apiLog(\n \"clearScheduledCommit\",\n \"cleared\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n }\n\n /**\n * Check to see if the specific object has the given property\n * @param {RefObject} refObject\n * @param {string} attribute\n * @return {boolean}\n * @private\n */\n private _checkObjectHasProperty(\n refObject: RefObject,\n attribute: string,\n ): boolean {\n return (\n Object.hasOwnProperty.call(refObject, attribute) ||\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(refObject),\n attribute,\n ) != null ||\n attribute in refObject\n );\n }\n\n /**\n * Handles the error that occurs when trying to access a value\n * @param {any} e\n * @param {string} returnValue\n * @return {string}\n * @private\n */\n private handleValueAccessException(e: any, returnValue: string): string {\n if (e instanceof ValidationError) {\n this.lastErrorCode = String(e.errorCode);\n returnValue = APIConstants.global.SCORM_FALSE;\n } else {\n if (e instanceof Error && e.message) {\n console.error(e.message);\n } else {\n console.error(e);\n }\n this.throwSCORMError(this._error_codes.GENERAL);\n }\n return returnValue;\n }\n\n /**\n * Perform the fetch request to the LMS\n * @param {string} url\n * @param {RefObject|Array} params\n * @return {Promise}\n * @private\n */\n private async performFetch(\n url: string,\n params: RefObject | Array,\n ): Promise {\n return fetch(url, {\n method: \"POST\",\n body: params instanceof Array ? params.join(\"&\") : JSON.stringify(params),\n headers: {\n ...this.settings.xhrHeaders,\n \"Content-Type\": this.settings.commitRequestDataType,\n },\n credentials: this.settings.xhrWithCredentials ? \"include\" : undefined,\n keepalive: true,\n });\n }\n\n /**\n * Transforms the response from the LMS to a ResultObject\n * @param {Response} response\n * @return {Promise}\n * @private\n */\n private async transformResponse(response: Response): Promise {\n const result =\n typeof this.settings.responseHandler === \"function\"\n ? await this.settings.responseHandler(response)\n : await response.json();\n\n if (\n response.status >= 200 &&\n response.status <= 299 &&\n (result.result === true ||\n result.result === APIConstants.global.SCORM_TRUE)\n ) {\n this.processListeners(\"CommitSuccess\");\n } else {\n this.processListeners(\"CommitError\");\n }\n return result;\n }\n}\n","import { BaseCMI } from \"./base_cmi\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.n objects\n */\nexport class CMIArray extends BaseCMI {\n private readonly _errorCode: number;\n private readonly _errorClass: typeof BaseScormValidationError;\n private readonly __children: string;\n childArray: any[];\n\n /**\n * Constructor cmi *.n arrays\n * @param {object} params\n */\n constructor(params: {\n children: string;\n errorCode?: number;\n errorClass?: typeof BaseScormValidationError;\n }) {\n super();\n this.__children = params.children;\n this._errorCode = params.errorCode || scorm12_error_codes.GENERAL;\n this._errorClass = params.errorClass || BaseScormValidationError;\n this.childArray = [];\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * Getter for _count\n * @return {number}\n */\n get _count(): number {\n return this.childArray.length;\n }\n\n /**\n * Setter for _count. Just throws an error.\n * @param {number} _count\n */\n set _count(_count: number) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * toJSON for *.n arrays\n * @return {object}\n */\n toJSON(): object {\n this.jsonString = true;\n const result: { [key: string]: any } = {};\n for (let i = 0; i < this.childArray.length; i++) {\n result[i + \"\"] = this.childArray[i];\n }\n delete this.jsonString;\n return result;\n }\n}\n","/**\n * Base class for API cmi objects\n */\nexport abstract class BaseCMI {\n jsonString? = false;\n private _initialized = false;\n private _start_time: number | undefined;\n\n /**\n * Getter for _initialized\n * @return {boolean}\n */\n get initialized(): boolean {\n return this._initialized;\n }\n\n /**\n * Getter for _start_time\n * @return {number | undefined}\n */\n get start_time(): number | undefined {\n return this._start_time;\n }\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize(): void {\n this._initialized = true;\n }\n\n /**\n * Called when the player should override the 'session_time' provided by\n * the module\n */\n setStartTime(): void {\n this._start_time = new Date().getTime();\n }\n}\n\n/**\n * Base class for cmi root objects\n */\nexport abstract class BaseRootCMI extends BaseCMI {\n abstract getCurrentTotalTime(): string;\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport { BaseCMI } from \"./base_cmi\";\nimport { checkValidFormat, checkValidRange } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nconst scorm12_constants = APIConstants.scorm12;\nconst scorm12_regex = Regex.scorm12;\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.score objects\n */\nexport class CMIScore extends BaseCMI {\n private readonly __children: string;\n private readonly __score_range: string | false;\n private readonly __invalid_error_code: number;\n private readonly __invalid_type_code: number;\n private readonly __invalid_range_code: number;\n private readonly __decimal_regex: string;\n private readonly __error_class: typeof BaseScormValidationError;\n private _raw = \"\";\n private _min = \"\";\n private _max: string;\n\n /**\n * Constructor for *.score\n * @param {\n * score_children: string,\n * score_range: string,\n * max: string,\n * invalidErrorCode: number,\n * invalidTypeCode: number,\n * invalidRangeCode: number,\n * decimalRegex: string,\n * errorClass: typeof BaseScormValidationError\n * } params\n */\n constructor(params: {\n score_children?: string;\n score_range?: string;\n max?: string;\n invalidErrorCode?: number;\n invalidTypeCode?: number;\n invalidRangeCode?: number;\n decimalRegex?: string;\n errorClass: typeof BaseScormValidationError;\n }) {\n super();\n\n this.__children = params.score_children || scorm12_constants.score_children;\n this.__score_range = !params.score_range\n ? false\n : scorm12_regex.score_range;\n this._max = params.max || params.max === \"\" ? params.max : \"100\";\n this.__invalid_error_code =\n params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE;\n this.__invalid_type_code =\n params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH;\n this.__invalid_range_code =\n params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE;\n this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;\n this.__error_class = params.errorClass;\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this.__error_class(this.__invalid_error_code);\n }\n\n /**\n * Getter for _raw\n * @return {string}\n */\n get raw(): string {\n return this._raw;\n }\n\n /**\n * Setter for _raw\n * @param {string} raw\n */\n set raw(raw: string) {\n if (\n checkValidFormat(\n raw,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n raw,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._raw = raw;\n }\n }\n\n /**\n * Getter for _min\n * @return {string}\n */\n get min(): string {\n return this._min;\n }\n\n /**\n * Setter for _min\n * @param {string} min\n */\n set min(min: string) {\n if (\n checkValidFormat(\n min,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n min,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._min = min;\n }\n }\n\n /**\n * Getter for _max\n * @return {string}\n */\n get max(): string {\n return this._max;\n }\n\n /**\n * Setter for _max\n * @param {string} max\n */\n set max(max: string) {\n if (\n checkValidFormat(\n max,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n max,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._max = max;\n }\n }\n\n /**\n * toJSON for *.score\n * @return {\n * {\n * min: string,\n * max: string,\n * raw: string\n * }\n * }\n */\n toJSON(): {\n min: string;\n max: string;\n raw: string;\n } {\n this.jsonString = true;\n const result = {\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseScormValidationError } from \"../../exceptions\";\n\n/**\n * Check if the value matches the proper format. If not, throw proper error code.\n *\n * @param {string} value\n * @param {string} regexPattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @param {boolean} [allowEmptyString]\n * @return {boolean}\n */\nexport function checkValidFormat(\n value: string,\n regexPattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n allowEmptyString?: boolean,\n): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n const formatRegex = new RegExp(regexPattern);\n const matches = value.match(formatRegex);\n if (allowEmptyString && value === \"\") {\n return true;\n }\n if (value === undefined || !matches || matches[0] === \"\") {\n throw new errorClass(errorCode);\n }\n return true;\n}\n\n/**\n * Check if the value matches the proper range. If not, throw proper error code.\n *\n * @param {any} value\n * @param {string} rangePattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @return {boolean}\n */\nexport function checkValidRange(\n value: any,\n rangePattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n): boolean {\n const ranges = rangePattern.split(\"#\");\n value = value * 1.0;\n if (value >= ranges[0]) {\n if (ranges[1] === \"*\" || value <= ranges[1]) {\n return true;\n } else {\n throw new errorClass(errorCode);\n }\n } else {\n throw new errorClass(errorCode);\n }\n}\n","interface ErrorDescription {\n basicMessage: string;\n detailMessage: string;\n}\n\ninterface ErrorDescriptions {\n [key: string]: ErrorDescription;\n}\n\ninterface ScormConstants {\n cmi_children: string;\n core_children: string;\n score_children: string;\n comments_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface AiccConstants extends ScormConstants {\n student_demographics_children: string;\n tries_children: string;\n attempt_records_children: string;\n paths_children: string;\n}\n\ninterface Scorm2004Constants {\n cmi_children: string;\n comments_children: string;\n score_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface GlobalConstants {\n SCORM_TRUE: string;\n SCORM_FALSE: string;\n STATE_NOT_INITIALIZED: number;\n STATE_INITIALIZED: number;\n STATE_TERMINATED: number;\n LOG_LEVEL_DEBUG: number;\n LOG_LEVEL_INFO: number;\n LOG_LEVEL_WARNING: number;\n LOG_LEVEL_ERROR: number;\n LOG_LEVEL_NONE: number;\n}\n\ninterface APIConstants {\n global: GlobalConstants;\n scorm12: ScormConstants;\n aicc: AiccConstants;\n scorm2004: Scorm2004Constants;\n}\n\nconst global: GlobalConstants = {\n SCORM_TRUE: \"true\",\n SCORM_FALSE: \"false\",\n STATE_NOT_INITIALIZED: 0,\n STATE_INITIALIZED: 1,\n STATE_TERMINATED: 2,\n LOG_LEVEL_DEBUG: 1,\n LOG_LEVEL_INFO: 2,\n LOG_LEVEL_WARNING: 3,\n LOG_LEVEL_ERROR: 4,\n LOG_LEVEL_NONE: 5,\n};\n\nconst scorm12: ScormConstants = {\n // Children lists\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions\",\n core_children:\n \"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time\",\n score_children: \"raw,min,max\",\n comments_children: \"content,location,time\",\n objectives_children: \"id,score,status\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children: \"audio,language,speed,text\",\n interactions_children:\n \"id,objectives,time,type,correct_responses,weighting,student_response,result,latency\",\n error_descriptions: {\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information\",\n },\n \"201\": {\n basicMessage: \"Invalid argument error\",\n detailMessage:\n \"Indicates that an argument represents an invalid data model element or is otherwise incorrect.\",\n },\n \"202\": {\n basicMessage: \"Element cannot have children\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_children\" for a data model element that does not support the \"_children\" suffix.',\n },\n \"203\": {\n basicMessage: \"Element not an array - cannot have count\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_count\" for a data model element that does not support the \"_count\" suffix.',\n },\n \"301\": {\n basicMessage: \"Not initialized\",\n detailMessage:\n \"Indicates that an API call was made before the call to lmsInitialize.\",\n },\n \"401\": {\n basicMessage: \"Not implemented error\",\n detailMessage:\n \"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.\",\n },\n \"402\": {\n basicMessage: \"Invalid set value, element is a keyword\",\n detailMessage:\n 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in \"_children\" and \"_count\").',\n },\n \"403\": {\n basicMessage: \"Element is read only\",\n detailMessage:\n \"LMSSetValue was called with a data model element that can only be read.\",\n },\n \"404\": {\n basicMessage: \"Element is write only\",\n detailMessage:\n \"LMSGetValue was called on a data model element that can only be written to.\",\n },\n \"405\": {\n basicMessage: \"Incorrect Data Type\",\n detailMessage:\n \"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst aicc: AiccConstants = {\n ...scorm12,\n ...{\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation\",\n student_preference_children:\n \"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows\",\n student_data_children:\n \"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action\",\n student_demographics_children:\n \"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience\",\n tries_children: \"time,status,score\",\n attempt_records_children: \"score,lesson_status\",\n paths_children: \"location_id,date,time,status,why_left,time_in_element\",\n },\n};\nconst scorm2004: Scorm2004Constants = {\n // Children lists\n cmi_children:\n \"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time\",\n comments_children: \"comment,timestamp,location\",\n score_children: \"max,raw,scaled,min\",\n objectives_children:\n \"progress_measure,completion_status,success_status,description,score,id\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children:\n \"audio_level,audio_captioning,delivery_speed,language\",\n interactions_children:\n \"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description\",\n error_descriptions: {\n \"0\": {\n basicMessage: \"No Error\",\n detailMessage: \"No error occurred, the previous API call was successful.\",\n },\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use GetDiagnostic for more information.\",\n },\n \"102\": {\n basicMessage: \"General Initialization Failure\",\n detailMessage: \"Call to Initialize failed for an unknown reason.\",\n },\n \"103\": {\n basicMessage: \"Already Initialized\",\n detailMessage:\n \"Call to Initialize failed because Initialize was already called.\",\n },\n \"104\": {\n basicMessage: \"Content Instance Terminated\",\n detailMessage:\n \"Call to Initialize failed because Terminate was already called.\",\n },\n \"111\": {\n basicMessage: \"General Termination Failure\",\n detailMessage: \"Call to Terminate failed for an unknown reason.\",\n },\n \"112\": {\n basicMessage: \"Termination Before Initialization\",\n detailMessage:\n \"Call to Terminate failed because it was made before the call to Initialize.\",\n },\n \"113\": {\n basicMessage: \"Termination After Termination\",\n detailMessage:\n \"Call to Terminate failed because Terminate was already called.\",\n },\n \"122\": {\n basicMessage: \"Retrieve Data Before Initialization\",\n detailMessage:\n \"Call to GetValue failed because it was made before the call to Initialize.\",\n },\n \"123\": {\n basicMessage: \"Retrieve Data After Termination\",\n detailMessage:\n \"Call to GetValue failed because it was made after the call to Terminate.\",\n },\n \"132\": {\n basicMessage: \"Store Data Before Initialization\",\n detailMessage:\n \"Call to SetValue failed because it was made before the call to Initialize.\",\n },\n \"133\": {\n basicMessage: \"Store Data After Termination\",\n detailMessage:\n \"Call to SetValue failed because it was made after the call to Terminate.\",\n },\n \"142\": {\n basicMessage: \"Commit Before Initialization\",\n detailMessage:\n \"Call to Commit failed because it was made before the call to Initialize.\",\n },\n \"143\": {\n basicMessage: \"Commit After Termination\",\n detailMessage:\n \"Call to Commit failed because it was made after the call to Terminate.\",\n },\n \"201\": {\n basicMessage: \"General Argument Error\",\n detailMessage:\n \"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.\",\n },\n \"301\": {\n basicMessage: \"General Get Failure\",\n detailMessage:\n \"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"351\": {\n basicMessage: \"General Set Failure\",\n detailMessage:\n \"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"391\": {\n basicMessage: \"General Commit Failure\",\n detailMessage:\n \"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"401\": {\n basicMessage: \"Undefined Data Model Element\",\n detailMessage:\n \"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.\",\n },\n \"402\": {\n basicMessage: \"Unimplemented Data Model Element\",\n detailMessage:\n \"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.\",\n },\n \"403\": {\n basicMessage: \"Data Model Element Value Not Initialized\",\n detailMessage:\n \"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.\",\n },\n \"404\": {\n basicMessage: \"Data Model Element Is Read Only\",\n detailMessage:\n \"SetValue was called with a data model element that can only be read.\",\n },\n \"405\": {\n basicMessage: \"Data Model Element Is Write Only\",\n detailMessage:\n \"GetValue was called on a data model element that can only be written to.\",\n },\n \"406\": {\n basicMessage: \"Data Model Element Type Mismatch\",\n detailMessage:\n \"SetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Data Model Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst APIConstants: APIConstants = {\n global: global,\n scorm12: scorm12,\n aicc: aicc,\n scorm2004: scorm2004,\n};\nexport default APIConstants;\n","export enum NAVBoolean {\n unknown = \"unknown\",\n true = \"true\",\n false = \"false\",\n}\n\nexport enum SuccessStatus {\n passed = \"passed\",\n failed = \"failed\",\n unknown = \"unknown\",\n}\n\nexport enum CompletionStatus {\n completed = \"completed\",\n incomplete = \"incomplete\",\n unknown = \"unknown\",\n}\n","export type ErrorCode = {\n [key: string]: number;\n};\n\nconst global: ErrorCode = {\n GENERAL: 101,\n INITIALIZATION_FAILED: 101,\n INITIALIZED: 101,\n TERMINATED: 101,\n TERMINATION_FAILURE: 101,\n TERMINATION_BEFORE_INIT: 101,\n MULTIPLE_TERMINATION: 101,\n RETRIEVE_BEFORE_INIT: 101,\n RETRIEVE_AFTER_TERM: 101,\n STORE_BEFORE_INIT: 101,\n STORE_AFTER_TERM: 101,\n COMMIT_BEFORE_INIT: 101,\n COMMIT_AFTER_TERM: 101,\n ARGUMENT_ERROR: 101,\n CHILDREN_ERROR: 101,\n COUNT_ERROR: 101,\n GENERAL_GET_FAILURE: 101,\n GENERAL_SET_FAILURE: 101,\n GENERAL_COMMIT_FAILURE: 101,\n UNDEFINED_DATA_MODEL: 101,\n UNIMPLEMENTED_ELEMENT: 101,\n VALUE_NOT_INITIALIZED: 101,\n INVALID_SET_VALUE: 101,\n READ_ONLY_ELEMENT: 101,\n WRITE_ONLY_ELEMENT: 101,\n TYPE_MISMATCH: 101,\n VALUE_OUT_OF_RANGE: 101,\n DEPENDENCY_NOT_ESTABLISHED: 101,\n};\n\nconst scorm12: ErrorCode = {\n ...global,\n RETRIEVE_BEFORE_INIT: 301,\n STORE_BEFORE_INIT: 301,\n COMMIT_BEFORE_INIT: 301,\n ARGUMENT_ERROR: 201,\n CHILDREN_ERROR: 202,\n COUNT_ERROR: 203,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 401,\n VALUE_NOT_INITIALIZED: 301,\n INVALID_SET_VALUE: 402,\n READ_ONLY_ELEMENT: 403,\n WRITE_ONLY_ELEMENT: 404,\n TYPE_MISMATCH: 405,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst scorm2004: ErrorCode = {\n ...global,\n INITIALIZATION_FAILED: 102,\n INITIALIZED: 103,\n TERMINATED: 104,\n TERMINATION_FAILURE: 111,\n TERMINATION_BEFORE_INIT: 112,\n MULTIPLE_TERMINATIONS: 113,\n RETRIEVE_BEFORE_INIT: 122,\n RETRIEVE_AFTER_TERM: 123,\n STORE_BEFORE_INIT: 132,\n STORE_AFTER_TERM: 133,\n COMMIT_BEFORE_INIT: 142,\n COMMIT_AFTER_TERM: 143,\n ARGUMENT_ERROR: 201,\n GENERAL_GET_FAILURE: 301,\n GENERAL_SET_FAILURE: 351,\n GENERAL_COMMIT_FAILURE: 391,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 402,\n VALUE_NOT_INITIALIZED: 403,\n READ_ONLY_ELEMENT: 404,\n WRITE_ONLY_ELEMENT: 405,\n TYPE_MISMATCH: 406,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst ErrorCodes = {\n scorm12,\n scorm2004,\n};\n\nexport default ErrorCodes;\n","const scorm12 = {\n CMIString256: \"^.{0,255}$\",\n CMIString4096: \"^.{0,4096}$\",\n CMITime: \"^(?:[01]\\\\d|2[0123]):(?:[012345]\\\\d):(?:[012345]\\\\d)$\",\n CMITimespan: \"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$\",\n\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{0,3})(.[0-9]*)?$\",\n\n CMIIdentifier: \"^[\\\\u0021-\\\\u007E\\\\s]{0,255}$\",\n CMIFeedback: \"^.{0,255}$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n // Vocabulary Data Type Definition\n CMIStatus: \"^(passed|completed|failed|incomplete|browsed)$\",\n CMIStatus2: \"^(passed|completed|failed|incomplete|browsed|not attempted)$\",\n CMIExit: \"^(time-out|suspend|logout|)$\",\n CMIType:\n \"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$\",\n CMIResult:\n \"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\\\.[0-9]*)?)$\",\n NAVEvent: \"^(previous|continue)$\",\n // Data ranges\n score_range: \"0#100\",\n audio_range: \"-1#100\",\n speed_range: \"-100#100\",\n weighting_range: \"-100#100\",\n text_range: \"-1#1\",\n};\nconst aicc = {\n ...scorm12,\n ...{\n CMIIdentifier: \"^\\\\w{1,255}$\",\n },\n};\nconst scorm2004 = {\n CMIString200: \"^[\\\\u0000-\\\\uFFFF]{0,200}$\",\n CMIString250: \"^[\\\\u0000-\\\\uFFFF]{0,250}$\",\n CMIString1000: \"^[\\\\u0000-\\\\uFFFF]{0,1000}$\",\n CMIString4000: \"^[\\\\u0000-\\\\uFFFF]{0,4000}$\",\n CMIString64000: \"^[\\\\u0000-\\\\uFFFF]{0,64000}$\",\n CMILang: \"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$\",\n\n CMILangString250:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$\",\n\n CMILangcr: \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$\",\n\n CMILangString250cr:\n \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$\",\n\n CMILangString4000:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$\",\n\n CMITime:\n \"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$\",\n CMITimespan:\n \"^P(?:([.,\\\\d]+)Y)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)W)?(?:([.,\\\\d]+)D)?(?:T?(?:([.,\\\\d]+)H)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)S)?)?$\",\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{1,5})(\\\\.[0-9]{1,18})?$\",\n CMIIdentifier: \"^\\\\S{1,250}[a-zA-Z0-9]$\",\n CMIShortIdentifier: \"^[\\\\w\\\\.\\\\-\\\\_]{1,250}$\",\n CMILongIdentifier:\n \"^(?:(?!urn:)\\\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\\\S{1,4000}|.{1,4000})$\",\n // need to re-examine this\n CMIFeedback: \"^.*$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n CMIIndexStore: \".N(\\\\d+).\",\n // Vocabulary Data Type Definition\n CMICStatus: \"^(completed|incomplete|not attempted|unknown)$\",\n CMISStatus: \"^(passed|failed|unknown)$\",\n CMIExit: \"^(time-out|suspend|logout|normal)$\",\n CMIType:\n \"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$\",\n CMIResult:\n \"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\\\.[0-9]{1,18})?)$\",\n NAVEvent:\n \"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?jump)$\",\n\n NAVBoolean: \"^(unknown|true|false$)\",\n NAVTarget: \"^{target=\\\\S{0,}[a-zA-Z0-9-_]+}$\",\n // Data ranges\n scaled_range: \"-1#1\",\n audio_range: \"0#*\",\n speed_range: \"0#*\",\n text_range: \"-1#1\",\n progress_range: \"0#1\",\n};\nconst Regex = {\n aicc: aicc,\n scorm12: scorm12,\n scorm2004: scorm2004,\n};\nexport default Regex;\n","import APIConstants from \"./constants/api_constants\";\n\nconst scorm12_errors = APIConstants.scorm12.error_descriptions;\nconst aicc_errors = APIConstants.aicc.error_descriptions;\nconst scorm2004_errors = APIConstants.scorm2004.error_descriptions;\n\ntype APIError = {\n errorCode: number;\n errorMessage: string;\n detailedMessage: string;\n};\n\nexport class BaseScormValidationError extends Error {\n constructor(errorCode: number) {\n super(errorCode.toString());\n this._errorCode = errorCode;\n this.name = \"ScormValidationError\";\n }\n\n private readonly _errorCode: number;\n\n /**\n * Getter for _errorCode\n * @return {number}\n */\n get errorCode(): number {\n return this._errorCode;\n }\n\n setMessage(message: string) {\n this.message = message;\n }\n}\n\n/**\n * Base Validation Exception\n */\nexport class ValidationError\n extends BaseScormValidationError\n implements APIError\n{\n /**\n * Constructor to take in an error message and code\n * @param {number} errorCode\n * @param {string} errorMessage\n * @param {string} detailedMessage\n */\n constructor(\n errorCode: number,\n errorMessage: string,\n detailedMessage?: string,\n ) {\n super(errorCode);\n this.setMessage(errorMessage);\n this._errorMessage = errorMessage;\n if (detailedMessage) {\n this._detailedMessage = detailedMessage;\n }\n }\n\n private readonly _errorMessage: string;\n private readonly _detailedMessage: string = \"\";\n\n /**\n * Getter for _errorMessage\n * @return {string}\n */\n get errorMessage(): string {\n return this._errorMessage;\n }\n\n /**\n * Getter for _detailedMessage\n * @return {string}\n */\n get detailedMessage(): string {\n return this._detailedMessage;\n }\n}\n\n/**\n * SCORM 1.2 Validation Error\n */\nexport class Scorm12ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {\n super(\n errorCode,\n scorm12_errors[String(errorCode)].basicMessage,\n scorm12_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm12_errors[\"101\"].basicMessage,\n scorm12_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * AICC Validation Error\n */\nexport class AICCValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {\n super(\n errorCode,\n aicc_errors[String(errorCode)].basicMessage,\n aicc_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n aicc_errors[\"101\"].basicMessage,\n aicc_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * SCORM 2004 Validation Error\n */\nexport class Scorm2004ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {\n super(\n errorCode,\n scorm2004_errors[String(errorCode)].basicMessage,\n scorm2004_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm2004_errors[\"101\"].basicMessage,\n scorm2004_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n","export const SECONDS_PER_SECOND = 1.0;\nexport const SECONDS_PER_MINUTE = 60;\nexport const SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;\nexport const SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR;\n\ntype Designation = {\n [key: string]: number;\n};\n\ntype StringKeyMap = {\n [key: string]: any;\n};\n\nconst designations: Designation = {\n D: SECONDS_PER_DAY,\n H: SECONDS_PER_HOUR,\n M: SECONDS_PER_MINUTE,\n S: SECONDS_PER_SECOND,\n};\n\n/**\n * Converts a Number to a String of HH:MM:SS\n *\n * @param {number} totalSeconds\n * @return {string}\n */\nexport function getSecondsAsHHMMSS(totalSeconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!totalSeconds || totalSeconds <= 0) {\n return \"00:00:00\";\n }\n\n const hours = Math.floor(totalSeconds / SECONDS_PER_HOUR);\n const dateObj = new Date(totalSeconds * 1000);\n const minutes = dateObj.getUTCMinutes();\n // make sure we add any possible decimal value\n const seconds = dateObj.getSeconds();\n const ms = totalSeconds % 1.0;\n let msStr = \"\";\n\n if (countDecimals(ms) > 0) {\n if (countDecimals(ms) > 2) {\n msStr = ms.toFixed(2);\n } else {\n msStr = String(ms);\n }\n\n msStr = \".\" + msStr.split(\".\")[1];\n }\n\n return (\n (hours + \":\" + minutes + \":\" + seconds).replace(/\\b\\d\\b/g, \"0$&\") + msStr\n );\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {number} seconds\n * @return {string}\n */\nexport function getSecondsAsISODuration(seconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!seconds || seconds <= 0) {\n return \"PT0S\";\n }\n\n let duration = \"P\";\n let remainder = seconds;\n for (const designationsKey in designations) {\n const current_seconds = designations[designationsKey];\n let value = Math.floor(remainder / current_seconds);\n remainder = remainder % current_seconds;\n\n if (countDecimals(remainder) > 2) {\n remainder = Number(Number(remainder).toFixed(2));\n }\n\n // If we have anything left in the remainder, and we're currently adding\n // seconds to the duration, go ahead and add the decimal to the seconds\n if (designationsKey === \"S\" && remainder > 0) {\n value += remainder;\n }\n\n if (value) {\n if (\n (duration.indexOf(\"D\") > 0 ||\n designationsKey === \"H\" ||\n designationsKey === \"M\" ||\n designationsKey === \"S\") &&\n duration.indexOf(\"T\") === -1\n ) {\n duration += \"T\";\n }\n\n duration += `${value}${designationsKey}`;\n }\n }\n return duration;\n}\n\n/**\n * Calculate the number of seconds from HH:MM:SS.DDDDDD\n *\n * @param {string} timeString\n * @param {RegExp} timeRegex\n * @return {number}\n */\nexport function getTimeAsSeconds(\n timeString: string | number | boolean | null,\n timeRegex: RegExp | string,\n): number {\n if (typeof timeString === \"number\" || typeof timeString === \"boolean\") {\n timeString = String(timeString);\n }\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n if (!timeString || !timeString.match(timeRegex)) {\n return 0;\n }\n\n const parts = timeString.split(\":\");\n const hours = Number(parts[0]);\n const minutes = Number(parts[1]);\n const seconds = Number(parts[2]);\n return hours * 3600 + minutes * 60 + seconds;\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {string} duration\n * @param {RegExp} durationRegex\n * @return {number}\n */\nexport function getDurationAsSeconds(\n duration: string | null,\n durationRegex: RegExp | string,\n): number {\n if (typeof durationRegex === \"string\") {\n durationRegex = new RegExp(durationRegex);\n }\n\n if (!duration || !duration.match(durationRegex)) {\n return 0;\n }\n\n const [, years, _, , days, hours, minutes, seconds] =\n new RegExp(durationRegex).exec(duration) || [];\n let result = 0.0;\n result += Number(seconds) || 0.0;\n result += Number(minutes) * 60.0 || 0.0;\n result += Number(hours) * 3600.0 || 0.0;\n result += Number(days) * (60 * 60 * 24.0) || 0.0;\n result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0;\n return result;\n}\n\n/**\n * Adds together two ISO8601 Duration strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp|string} durationRegex\n * @return {string}\n */\nexport function addTwoDurations(\n first: string,\n second: string,\n durationRegex: RegExp | string,\n): string {\n const regex: RegExp =\n typeof durationRegex === \"string\"\n ? new RegExp(durationRegex)\n : durationRegex;\n return getSecondsAsISODuration(\n getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex),\n );\n}\n\n/**\n * Add together two HH:MM:SS.DD strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp} timeRegex\n * @return {string}\n */\nexport function addHHMMSSTimeStrings(\n first: string,\n second: string,\n timeRegex: RegExp | string,\n): string {\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n return getSecondsAsHHMMSS(\n getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex),\n );\n}\n\n/**\n * Flatten a JSON object down to string paths for each values\n * @param {object} data\n * @return {object}\n */\nexport function flatten(data: StringKeyMap): object {\n const result: StringKeyMap = {};\n\n /**\n * Recurse through the object\n * @param {*} cur\n * @param {*} prop\n */\n function recurse(cur: any, prop: any) {\n if (Object(cur) !== cur) {\n result[prop] = cur;\n } else if (Array.isArray(cur)) {\n for (let i = 0, l = cur.length; i < l; i++) {\n recurse(cur[i], prop + \"[\" + i + \"]\");\n if (l === 0) result[prop] = [];\n }\n } else {\n let isEmpty = true;\n\n for (const p in cur) {\n if ({}.hasOwnProperty.call(cur, p)) {\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p);\n }\n }\n\n if (isEmpty && prop) result[prop] = {};\n }\n }\n\n recurse(data, \"\");\n return result;\n}\n\n/**\n * Un-flatten a flat JSON object\n * @param {object} data\n * @return {object}\n */\nexport function unflatten(data: StringKeyMap): object {\n \"use strict\";\n\n if (Object(data) !== data || Array.isArray(data)) return data;\n const regex = /\\.?([^.[\\]]+)|\\[(\\d+)]/g;\n const result: StringKeyMap = {};\n\n for (const p in data) {\n if ({}.hasOwnProperty.call(data, p)) {\n let cur = result;\n let prop = \"\";\n let m = regex.exec(p);\n\n while (m) {\n cur = cur[prop] || (cur[prop] = m[2] ? [] : {});\n prop = m[2] || m[1];\n m = regex.exec(p);\n }\n\n cur[prop] = data[p];\n }\n }\n\n return result[\"\"] || result;\n}\n\n/**\n * Counts the number of decimal places\n * @param {number} num\n * @return {number}\n */\nexport function countDecimals(num: number): number {\n if (Math.floor(num) === num || String(num).indexOf(\".\") < 0) return 0;\n const parts = num.toString().split(\".\")[1];\n return parts.length || 0;\n}\n\n/**\n * Formats the SCORM messages for easy reading\n *\n * @param {string} functionName\n * @param {string} message\n * @param {string} CMIElement\n * @return {string}\n */\nexport function formatMessage(\n functionName: string,\n message: string,\n CMIElement?: string,\n): string {\n const baseLength = 20;\n let messageString = \"\";\n\n messageString += functionName;\n\n let fillChars = baseLength - messageString.length;\n\n for (let i = 0; i < fillChars; i++) {\n messageString += \" \";\n }\n\n messageString += \": \";\n\n if (CMIElement) {\n const CMIElementBaseLength = 70;\n\n messageString += CMIElement;\n\n fillChars = CMIElementBaseLength - messageString.length;\n\n for (let j = 0; j < fillChars; j++) {\n messageString += \" \";\n }\n }\n\n if (message) {\n messageString += message;\n }\n\n return messageString;\n}\n\n/**\n * Checks to see if {str} contains {tester}\n *\n * @param {string} str String to check against\n * @param {string} tester String to check for\n * @return {boolean}\n */\nexport function stringMatches(str: string, tester: string): boolean {\n return str?.match(tester) !== null;\n}\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","import { checkValidFormat, checkValidRange } from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check2004ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n Scorm2004ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @return {boolean}\n */\nexport function check2004ValidRange(\n value: string,\n rangePattern: string,\n): boolean {\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm2004.VALUE_OUT_OF_RANGE,\n Scorm2004ValidationError,\n );\n}\n","/**\n * Class for SCORM 2004's cmi.learner_preference object\n */\nimport { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\nexport class CMILearnerPreference extends BaseCMI {\n private __children = APIConstants.scorm2004.student_preference_children;\n private _audio_level = \"1\";\n private _language = \"\";\n private _delivery_speed = \"1\";\n private _audio_captioning = \"0\";\n\n /**\n * Constructor for cmi.learner_preference\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for _audio_level\n * @return {string}\n */\n get audio_level(): string {\n return this._audio_level;\n }\n\n /**\n * Setter for _audio_level\n * @param {string} audio_level\n */\n set audio_level(audio_level: string) {\n if (\n check2004ValidFormat(audio_level, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(audio_level, Regex.scorm2004.audio_range)\n ) {\n this._audio_level = audio_level;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check2004ValidFormat(language, Regex.scorm2004.CMILang)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _delivery_speed\n * @return {string}\n */\n get delivery_speed(): string {\n return this._delivery_speed;\n }\n\n /**\n * Setter for _delivery_speed\n * @param {string} delivery_speed\n */\n set delivery_speed(delivery_speed: string) {\n if (\n check2004ValidFormat(delivery_speed, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(delivery_speed, Regex.scorm2004.speed_range)\n ) {\n this._delivery_speed = delivery_speed;\n }\n }\n\n /**\n * Getter for _audio_captioning\n * @return {string}\n */\n get audio_captioning(): string {\n return this._audio_captioning;\n }\n\n /**\n * Setter for _audio_captioning\n * @param {string} audio_captioning\n */\n set audio_captioning(audio_captioning: string) {\n if (\n check2004ValidFormat(audio_captioning, Regex.scorm2004.CMISInteger) &&\n check2004ValidRange(audio_captioning, Regex.scorm2004.text_range)\n ) {\n this._audio_captioning = audio_captioning;\n }\n }\n\n /**\n * toJSON for cmi.learner_preference\n *\n * @return {\n * {\n * audio_level: string,\n * language: string,\n * delivery_speed: string,\n * audio_captioning: string\n * }\n * }\n */\n toJSON(): {\n audio_level: string;\n language: string;\n delivery_speed: string;\n audio_captioning: string;\n } {\n this.jsonString = true;\n const result = {\n audio_level: this.audio_level,\n language: this.language,\n delivery_speed: this.delivery_speed,\n audio_captioning: this.audio_captioning,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import Regex from \"./regex\";\n\nconst scorm2004_regex = Regex.scorm2004;\nexport const LearnerResponses: Responses = {\n \"true-false\": {\n format: \"^true$|^false$\",\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n choice: {\n format: scorm2004_regex.CMILongIdentifier,\n max: 36,\n delimiter: \"[,]\",\n unique: true,\n },\n \"fill-in\": {\n format: scorm2004_regex.CMILangString250,\n max: 10,\n delimiter: \"[,]\",\n unique: false,\n },\n \"long-fill-in\": {\n format: scorm2004_regex.CMILangString4000,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n matching: {\n format: scorm2004_regex.CMIShortIdentifier,\n format2: scorm2004_regex.CMIShortIdentifier,\n max: 36,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n },\n performance: {\n format: \"^$|\" + scorm2004_regex.CMIShortIdentifier,\n format2:\n scorm2004_regex.CMIDecimal + \"|^$|\" + scorm2004_regex.CMIShortIdentifier,\n max: 250,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n },\n sequencing: {\n format: scorm2004_regex.CMIShortIdentifier,\n max: 36,\n delimiter: \"[,]\",\n unique: false,\n },\n likert: {\n format: scorm2004_regex.CMIShortIdentifier,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n numeric: {\n format: scorm2004_regex.CMIDecimal,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n other: {\n format: scorm2004_regex.CMIString4000,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n};\nexport const CorrectResponses: Responses = {\n \"true-false\": {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: \"^true$|^false$\",\n limit: 1,\n },\n choice: {\n max: 36,\n delimiter: \"[,]\",\n unique: true,\n duplicate: false,\n format: scorm2004_regex.CMILongIdentifier,\n },\n \"fill-in\": {\n max: 10,\n delimiter: \"[,]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMILangString250cr,\n },\n \"long-fill-in\": {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: true,\n format: scorm2004_regex.CMILangString4000,\n },\n matching: {\n max: 36,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n format2: scorm2004_regex.CMIShortIdentifier,\n },\n performance: {\n max: 250,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n delimiter3: \"[:]\",\n unique: false,\n duplicate: false,\n format: \"^$|\" + scorm2004_regex.CMIShortIdentifier,\n format2:\n scorm2004_regex.CMIDecimal + \"|^$|\" + scorm2004_regex.CMIShortIdentifier,\n },\n sequencing: {\n max: 36,\n delimiter: \"[,]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n },\n likert: {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n limit: 1,\n },\n numeric: {\n max: 2,\n delimiter: \"[:]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIDecimal,\n limit: 1,\n },\n other: {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIString4000,\n limit: 1,\n },\n};\n\nexport type ResponseType = {\n format: string;\n max: number;\n delimiter: string;\n unique: boolean;\n duplicate?: boolean;\n format2?: string;\n delimiter2?: string;\n limit?: number;\n delimiter3?: string;\n};\n\nexport type Responses = {\n [key: string]: ResponseType;\n};\n","/**\n * Class representing SCORM 2004's `cmi.interactions` object\n */\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { CMIArray } from \"../common/array\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\nimport { LearnerResponses } from \"../../constants/response_constants\";\n\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.objectives` Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.interactions_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class for SCORM 2004's cmi.interaction.n object\n */\n\nexport class CMIInteractionsObject extends BaseCMI {\n private _id = \"\";\n private _type = \"\";\n private _timestamp = \"\";\n private _weighting = \"\";\n private _learner_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n private _description = \"\";\n\n /**\n * Constructor for cmi.interaction.n\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n children: APIConstants.scorm2004.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n children: APIConstants.scorm2004.correct_responses_children,\n });\n }\n\n public objectives: CMIArray;\n public correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _type\n * @return {string}\n */\n get type(): string {\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(type, Regex.scorm2004.CMIType)) {\n this._type = type;\n }\n }\n }\n\n /**\n * Getter for _timestamp\n * @return {string}\n */\n get timestamp(): string {\n return this._timestamp;\n }\n\n /**\n * Setter for _timestamp\n * @param {string} timestamp\n */\n set timestamp(timestamp: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(timestamp, Regex.scorm2004.CMITime)) {\n this._timestamp = timestamp;\n }\n }\n }\n\n /**\n * Getter for _weighting\n * @return {string}\n */\n get weighting(): string {\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(weighting, Regex.scorm2004.CMIDecimal)) {\n this._weighting = weighting;\n }\n }\n }\n\n /**\n * Getter for _learner_response\n * @return {string}\n */\n get learner_response(): string {\n return this._learner_response;\n }\n\n /**\n * Setter for _learner_response. Does type validation to make sure response\n * matches SCORM 2004's spec\n * @param {string} learner_response\n */\n set learner_response(learner_response: string) {\n if (this.initialized && (this._type === \"\" || this._id === \"\")) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n let nodes = [];\n const response_type = LearnerResponses[this.type];\n\n if (response_type) {\n if (response_type?.delimiter) {\n nodes = learner_response.split(response_type.delimiter);\n } else {\n nodes[0] = learner_response;\n }\n\n if (nodes.length > 0 && nodes.length <= response_type.max) {\n const formatRegex = new RegExp(response_type.format);\n\n for (let i = 0; i < nodes.length; i++) {\n if (response_type?.delimiter2) {\n const values = nodes[i].split(response_type.delimiter2);\n\n if (values.length === 2) {\n if (!values[0].match(formatRegex)) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n } else {\n if (\n !response_type.format2 ||\n !values[1].match(new RegExp(response_type.format2))\n ) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n }\n } else {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n } else {\n if (!nodes[i].match(formatRegex)) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n } else {\n if (nodes[i] !== \"\" && response_type.unique) {\n for (let j = 0; j < i; j++) {\n if (nodes[i] === nodes[j]) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n }\n }\n }\n }\n }\n } else {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n );\n }\n\n this._learner_response = learner_response;\n } else {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n\n /**\n * Getter for _result\n * @return {string}\n */\n get result(): string {\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check2004ValidFormat(result, Regex.scorm2004.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency\n * @return {string}\n */\n get latency(): string {\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(latency, Regex.scorm2004.CMITimespan)) {\n this._latency = latency;\n }\n }\n }\n\n /**\n * Getter for _description\n * @return {string}\n */\n get description(): string {\n return this._description;\n }\n\n /**\n * Setter for _description\n * @param {string} description\n */\n set description(description: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(\n description,\n Regex.scorm2004.CMILangString250,\n true,\n )\n ) {\n this._description = description;\n }\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * type: string,\n * objectives: CMIArray,\n * timestamp: string,\n * correct_responses: CMIArray,\n * weighting: string,\n * learner_response: string,\n * result: string,\n * latency: string,\n * description: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n type: string;\n objectives: CMIArray;\n timestamp: string;\n correct_responses: CMIArray;\n weighting: string;\n learner_response: string;\n result: string;\n latency: string;\n description: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n type: this.type,\n objectives: this.objectives,\n timestamp: this.timestamp,\n weighting: this.weighting,\n learner_response: this.learner_response,\n result: this.result,\n latency: this.latency,\n description: this.description,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.interactions.n.objectives.n object\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n private _id = \"\";\n\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.interactions.n.correct_responses.n object\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n private _pattern = \"\";\n\n /**\n * Constructor for cmi.interactions.n.correct_responses.n\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check2004ValidFormat(pattern, Regex.scorm2004.CMIFeedback)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON cmi.interactions.n.correct_responses.n object\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this.pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","/**\n * Class for SCORM 2004's cmi *.score object\n */\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\n\nexport class Scorm2004CMIScore extends CMIScore {\n private _scaled = \"\";\n\n /**\n * Constructor for cmi *.score\n */\n constructor() {\n super({\n score_children: APIConstants.scorm2004.score_children,\n max: \"\",\n invalidErrorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n invalidTypeCode: ErrorCodes.scorm2004.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm2004.VALUE_OUT_OF_RANGE,\n decimalRegex: Regex.scorm2004.CMIDecimal,\n errorClass: Scorm2004ValidationError,\n });\n }\n\n /**\n * Getter for _scaled\n * @return {string}\n */\n get scaled(): string {\n return this._scaled;\n }\n\n /**\n * Setter for _scaled\n * @param {string} scaled\n */\n set scaled(scaled: string) {\n if (\n check2004ValidFormat(scaled, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(scaled, Regex.scorm2004.scaled_range)\n ) {\n this._scaled = scaled;\n }\n }\n\n /**\n * toJSON for cmi *.score\n *\n * @return {\n * {\n * scaled: string,\n * raw: string,\n * min: string,\n * max: string\n * }\n * }\n */\n toJSON(): {\n scaled: string;\n raw: string;\n min: string;\n max: string;\n } {\n this.jsonString = true;\n const result = {\n scaled: this.scaled,\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_lms object\n * @extends CMIArray\n */\nexport class CMICommentsFromLMS extends CMIArray {\n /**\n * Constructor for cmi.comments_from_lms Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.comments_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_learner object\n */\n\nexport class CMICommentsFromLearner extends CMIArray {\n /**\n * Constructor for cmi.comments_from_learner Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.comments_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_learner.n and cmi.comments_from_lms.n object\n */\n\nexport class CMICommentsObject extends BaseCMI {\n private _comment = \"\";\n private _location = \"\";\n private _timestamp = \"\";\n private readonly _readOnlyAfterInit: boolean;\n\n /**\n * Constructor for cmi.comments_from_learner.n and cmi.comments_from_lms.n\n * @param {boolean} readOnlyAfterInit\n */\n constructor(readOnlyAfterInit: boolean = false) {\n super();\n this._comment = \"\";\n this._location = \"\";\n this._timestamp = \"\";\n this._readOnlyAfterInit = readOnlyAfterInit;\n }\n\n /**\n * Getter for _comment\n * @return {string}\n */\n get comment(): string {\n return this._comment;\n }\n\n /**\n * Setter for _comment\n * @param {string} comment\n */\n set comment(comment: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (\n check2004ValidFormat(comment, Regex.scorm2004.CMILangString4000, true)\n ) {\n this._comment = comment;\n }\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (check2004ValidFormat(location, Regex.scorm2004.CMIString250)) {\n this._location = location;\n }\n }\n }\n\n /**\n * Getter for _timestamp\n * @return {string}\n */\n get timestamp(): string {\n return this._timestamp;\n }\n\n /**\n * Setter for _timestamp\n * @param {string} timestamp\n */\n set timestamp(timestamp: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (check2004ValidFormat(timestamp, Regex.scorm2004.CMITime)) {\n this._timestamp = timestamp;\n }\n }\n }\n\n /**\n * toJSON for cmi.comments_from_learner.n object\n * @return {\n * {\n * comment: string,\n * location: string,\n * timestamp: string\n * }\n * }\n */\n toJSON(): {\n comment: string;\n location: string;\n timestamp: string;\n } {\n this.jsonString = true;\n const result = {\n comment: this.comment,\n location: this.location,\n timestamp: this.timestamp,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { Scorm2004CMIScore } from \"./score\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing SCORM 2004's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives` Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.objectives_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class for SCORM 2004's cmi.objectives.n object\n */\nexport class CMIObjectivesObject extends BaseCMI {\n private _id = \"\";\n private _success_status = \"unknown\";\n private _completion_status = \"unknown\";\n private _progress_measure = \"\";\n private _description = \"\";\n\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new Scorm2004CMIScore();\n }\n\n public score: Scorm2004CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _success_status\n * @return {string}\n */\n get success_status(): string {\n return this._success_status;\n }\n\n /**\n * Setter for _success_status\n * @param {string} success_status\n */\n set success_status(success_status: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(success_status, Regex.scorm2004.CMISStatus)) {\n this._success_status = success_status;\n }\n }\n }\n\n /**\n * Getter for _completion_status\n * @return {string}\n */\n get completion_status(): string {\n return this._completion_status;\n }\n\n /**\n * Setter for _completion_status\n * @param {string} completion_status\n */\n set completion_status(completion_status: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(completion_status, Regex.scorm2004.CMICStatus)) {\n this._completion_status = completion_status;\n }\n }\n }\n\n /**\n * Getter for _progress_measure\n * @return {string}\n */\n get progress_measure(): string {\n return this._progress_measure;\n }\n\n /**\n * Setter for _progress_measure\n * @param {string} progress_measure\n */\n set progress_measure(progress_measure: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(progress_measure, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(progress_measure, Regex.scorm2004.progress_range)\n ) {\n this._progress_measure = progress_measure;\n }\n }\n }\n\n /**\n * Getter for _description\n * @return {string}\n */\n get description(): string {\n return this._description;\n }\n\n /**\n * Setter for _description\n * @param {string} description\n */\n set description(description: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(\n description,\n Regex.scorm2004.CMILangString250,\n true,\n )\n ) {\n this._description = description;\n }\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n *\n * @return {\n * {\n * id: string,\n * success_status: string,\n * completion_status: string,\n * progress_measure: string,\n * description: string,\n * score: Scorm2004CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n success_status: string;\n completion_status: string;\n progress_measure: string;\n description: string;\n score: Scorm2004CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n success_status: this.success_status,\n completion_status: this.completion_status,\n progress_measure: this.progress_measure,\n description: this.description,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport * as Util from \"../../utilities\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport { CMILearnerPreference } from \"./learner_preference\";\nimport { CMIInteractions } from \"./interactions\";\nimport { Scorm2004CMIScore } from \"./score\";\nimport { CMICommentsFromLearner, CMICommentsFromLMS } from \"./comments\";\nimport { CMIObjectives } from \"./objectives\";\n\n/**\n * Class representing cmi object for SCORM 2004\n */\nexport class CMI extends BaseRootCMI {\n /**\n * Constructor for the SCORM 2004 cmi object\n * @param {boolean} initialized\n */\n constructor(initialized: boolean = false) {\n super();\n this.learner_preference = new CMILearnerPreference();\n this.score = new Scorm2004CMIScore();\n this.comments_from_learner = new CMICommentsFromLearner();\n this.comments_from_lms = new CMICommentsFromLMS();\n this.interactions = new CMIInteractions();\n this.objectives = new CMIObjectives();\n if (initialized) this.initialize();\n }\n\n public learner_preference: CMILearnerPreference;\n public score: Scorm2004CMIScore;\n public comments_from_learner: CMICommentsFromLearner;\n public comments_from_lms: CMICommentsFromLMS;\n public interactions: CMIInteractions;\n public objectives: CMIObjectives;\n\n private __version = \"1.0\";\n private __children = APIConstants.scorm2004.cmi_children;\n private _completion_status = \"unknown\";\n private _completion_threshold = \"\";\n private _credit = \"credit\";\n private _entry = \"\";\n private _exit = \"\";\n private _launch_data = \"\";\n private _learner_id = \"\";\n private _learner_name = \"\";\n private _location = \"\";\n private _max_time_allowed = \"\";\n private _mode = \"normal\";\n private _progress_measure = \"\";\n private _scaled_passing_score = \"\";\n private _session_time = \"PT0H0M0S\";\n private _success_status = \"unknown\";\n private _suspend_data = \"\";\n private _time_limit_action = \"continue,no message\";\n private _total_time = \"\";\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.learner_preference?.initialize();\n this.score?.initialize();\n this.comments_from_learner?.initialize();\n this.comments_from_lms?.initialize();\n this.interactions?.initialize();\n this.objectives?.initialize();\n }\n\n /**\n * Getter for __version\n * @return {string}\n * @private\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n * @private\n */\n set _version(_version: string) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {number} _children\n * @private\n */\n set _children(_children: number) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for _completion_status\n * @return {string}\n */\n get completion_status(): string {\n return this._completion_status;\n }\n\n /**\n * Setter for _completion_status\n * @param {string} completion_status\n */\n set completion_status(completion_status: string) {\n if (check2004ValidFormat(completion_status, Regex.scorm2004.CMICStatus)) {\n this._completion_status = completion_status;\n }\n }\n\n /**\n * Getter for _completion_threshold\n * @return {string}\n */\n get completion_threshold(): string {\n return this._completion_threshold;\n }\n\n /**\n * Setter for _completion_threshold. Can only be called before initialization.\n * @param {string} completion_threshold\n */\n set completion_threshold(completion_threshold: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._completion_threshold = completion_threshold;\n }\n }\n\n /**\n * Setter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.WRITE_ONLY_ELEMENT,\n );\n }\n return this._exit;\n }\n\n /**\n * Getter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check2004ValidFormat(exit, Regex.scorm2004.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _learner_id\n * @return {string}\n */\n get learner_id(): string {\n return this._learner_id;\n }\n\n /**\n * Setter for _learner_id. Can only be called before initialization.\n * @param {string} learner_id\n */\n set learner_id(learner_id: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._learner_id = learner_id;\n }\n }\n\n /**\n * Getter for _learner_name\n * @return {string}\n */\n get learner_name(): string {\n return this._learner_name;\n }\n\n /**\n * Setter for _learner_name. Can only be called before initialization.\n * @param {string} learner_name\n */\n set learner_name(learner_name: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._learner_name = learner_name;\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (check2004ValidFormat(location, Regex.scorm2004.CMIString1000)) {\n this._location = location;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _mode\n * @return {string}\n */\n get mode(): string {\n return this._mode;\n }\n\n /**\n * Setter for _mode. Can only be called before initialization.\n * @param {string} mode\n */\n set mode(mode: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._mode = mode;\n }\n }\n\n /**\n * Getter for _progress_measure\n * @return {string}\n */\n get progress_measure(): string {\n return this._progress_measure;\n }\n\n /**\n * Setter for _progress_measure\n * @param {string} progress_measure\n */\n set progress_measure(progress_measure: string) {\n if (\n check2004ValidFormat(progress_measure, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(progress_measure, Regex.scorm2004.progress_range)\n ) {\n this._progress_measure = progress_measure;\n }\n }\n\n /**\n * Getter for _scaled_passing_score\n * @return {string}\n */\n get scaled_passing_score(): string {\n return this._scaled_passing_score;\n }\n\n /**\n * Setter for _scaled_passing_score. Can only be called before initialization.\n * @param {string} scaled_passing_score\n */\n set scaled_passing_score(scaled_passing_score: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._scaled_passing_score = scaled_passing_score;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.WRITE_ONLY_ELEMENT,\n );\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check2004ValidFormat(session_time, Regex.scorm2004.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _success_status\n * @return {string}\n */\n get success_status(): string {\n return this._success_status;\n }\n\n /**\n * Setter for _success_status\n * @param {string} success_status\n */\n set success_status(success_status: string) {\n if (check2004ValidFormat(success_status, Regex.scorm2004.CMISStatus)) {\n this._success_status = success_status;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (\n check2004ValidFormat(suspend_data, Regex.scorm2004.CMIString64000, true)\n ) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string} ISO8601 Duration\n */\n getCurrentTotalTime(): string {\n let sessionTime = this._session_time;\n const startTime = this.start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsISODuration(seconds / 1000);\n }\n\n return Util.addTwoDurations(\n this._total_time,\n sessionTime,\n Regex.scorm2004.CMITimespan,\n );\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * comments_from_learner: CMICommentsFromLearner,\n * comments_from_lms: CMICommentsFromLMS,\n * completion_status: string,\n * completion_threshold: string,\n * credit: string,\n * entry: string,\n * exit: string,\n * interactions: CMIInteractions,\n * launch_data: string,\n * learner_id: string,\n * learner_name: string,\n * learner_preference: CMILearnerPreference,\n * location: string,\n * max_time_allowed: string,\n * mode: string,\n * objectives: CMIObjectives,\n * progress_measure: string,\n * scaled_passing_score: string,\n * score: Scorm2004CMIScore,\n * session_time: string,\n * success_status: string,\n * suspend_data: string,\n * time_limit_action: string\n * }\n * }\n */\n toJSON(): {\n comments_from_learner: CMICommentsFromLearner;\n comments_from_lms: CMICommentsFromLMS;\n completion_status: string;\n completion_threshold: string;\n credit: string;\n entry: string;\n exit: string;\n interactions: CMIInteractions;\n launch_data: string;\n learner_id: string;\n learner_name: string;\n learner_preference: CMILearnerPreference;\n location: string;\n max_time_allowed: string;\n mode: string;\n objectives: CMIObjectives;\n progress_measure: string;\n scaled_passing_score: string;\n score: Scorm2004CMIScore;\n session_time: string;\n success_status: string;\n suspend_data: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n comments_from_learner: this.comments_from_learner,\n comments_from_lms: this.comments_from_lms,\n completion_status: this.completion_status,\n completion_threshold: this.completion_threshold,\n credit: this.credit,\n entry: this.entry,\n exit: this.exit,\n interactions: this.interactions,\n launch_data: this.launch_data,\n learner_id: this.learner_id,\n learner_name: this.learner_name,\n learner_preference: this.learner_preference,\n location: this.location,\n max_time_allowed: this.max_time_allowed,\n mode: this.mode,\n objectives: this.objectives,\n progress_measure: this.progress_measure,\n scaled_passing_score: this.scaled_passing_score,\n score: this.score,\n session_time: this.session_time,\n success_status: this.success_status,\n suspend_data: this.suspend_data,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","const ValidLanguages: string[] = [\n \"aa\",\n \"ab\",\n \"ae\",\n \"af\",\n \"ak\",\n \"am\",\n \"an\",\n \"ar\",\n \"as\",\n \"av\",\n \"ay\",\n \"az\",\n \"ba\",\n \"be\",\n \"bg\",\n \"bh\",\n \"bi\",\n \"bm\",\n \"bn\",\n \"bo\",\n \"br\",\n \"bs\",\n \"ca\",\n \"ce\",\n \"ch\",\n \"co\",\n \"cr\",\n \"cs\",\n \"cu\",\n \"cv\",\n \"cy\",\n \"da\",\n \"de\",\n \"dv\",\n \"dz\",\n \"ee\",\n \"el\",\n \"en\",\n \"eo\",\n \"es\",\n \"et\",\n \"eu\",\n \"fa\",\n \"ff\",\n \"fi\",\n \"fj\",\n \"fo\",\n \"fr\",\n \"fy\",\n \"ga\",\n \"gd\",\n \"gl\",\n \"gn\",\n \"gu\",\n \"gv\",\n \"ha\",\n \"he\",\n \"hi\",\n \"ho\",\n \"hr\",\n \"ht\",\n \"hu\",\n \"hy\",\n \"hz\",\n \"ia\",\n \"id\",\n \"ie\",\n \"ig\",\n \"ii\",\n \"ik\",\n \"io\",\n \"is\",\n \"it\",\n \"iu\",\n \"ja\",\n \"jv\",\n \"ka\",\n \"kg\",\n \"ki\",\n \"kj\",\n \"kk\",\n \"kl\",\n \"km\",\n \"kn\",\n \"ko\",\n \"kr\",\n \"ks\",\n \"ku\",\n \"kv\",\n \"kw\",\n \"ky\",\n \"la\",\n \"lb\",\n \"lg\",\n \"li\",\n \"ln\",\n \"lo\",\n \"lt\",\n \"lu\",\n \"lv\",\n \"mg\",\n \"mh\",\n \"mi\",\n \"mk\",\n \"ml\",\n \"mn\",\n \"mo\",\n \"mr\",\n \"ms\",\n \"mt\",\n \"my\",\n \"na\",\n \"nb\",\n \"nd\",\n \"ne\",\n \"ng\",\n \"nl\",\n \"nn\",\n \"no\",\n \"nr\",\n \"nv\",\n \"ny\",\n \"oc\",\n \"oj\",\n \"om\",\n \"or\",\n \"os\",\n \"pa\",\n \"pi\",\n \"pl\",\n \"ps\",\n \"pt\",\n \"qu\",\n \"rm\",\n \"rn\",\n \"ro\",\n \"ru\",\n \"rw\",\n \"sa\",\n \"sc\",\n \"sd\",\n \"se\",\n \"sg\",\n \"sh\",\n \"si\",\n \"sk\",\n \"sl\",\n \"sm\",\n \"sn\",\n \"so\",\n \"sq\",\n \"sr\",\n \"ss\",\n \"st\",\n \"su\",\n \"sv\",\n \"sw\",\n \"ta\",\n \"te\",\n \"tg\",\n \"th\",\n \"ti\",\n \"tk\",\n \"tl\",\n \"tn\",\n \"to\",\n \"tr\",\n \"ts\",\n \"tt\",\n \"tw\",\n \"ty\",\n \"ug\",\n \"uk\",\n \"ur\",\n \"uz\",\n \"ve\",\n \"vi\",\n \"vo\",\n \"wa\",\n \"wo\",\n \"xh\",\n \"yi\",\n \"yo\",\n \"za\",\n \"zh\",\n \"zu\",\n \"aar\",\n \"abk\",\n \"ave\",\n \"afr\",\n \"aka\",\n \"amh\",\n \"arg\",\n \"ara\",\n \"asm\",\n \"ava\",\n \"aym\",\n \"aze\",\n \"bak\",\n \"bel\",\n \"bul\",\n \"bih\",\n \"bis\",\n \"bam\",\n \"ben\",\n \"tib\",\n \"bod\",\n \"bre\",\n \"bos\",\n \"cat\",\n \"che\",\n \"cha\",\n \"cos\",\n \"cre\",\n \"cze\",\n \"ces\",\n \"chu\",\n \"chv\",\n \"wel\",\n \"cym\",\n \"dan\",\n \"ger\",\n \"deu\",\n \"div\",\n \"dzo\",\n \"ewe\",\n \"gre\",\n \"ell\",\n \"eng\",\n \"epo\",\n \"spa\",\n \"est\",\n \"baq\",\n \"eus\",\n \"per\",\n \"fas\",\n \"ful\",\n \"fin\",\n \"fij\",\n \"fao\",\n \"fre\",\n \"fra\",\n \"fry\",\n \"gle\",\n \"gla\",\n \"glg\",\n \"grn\",\n \"guj\",\n \"glv\",\n \"hau\",\n \"heb\",\n \"hin\",\n \"hmo\",\n \"hrv\",\n \"hat\",\n \"hun\",\n \"arm\",\n \"hye\",\n \"her\",\n \"ina\",\n \"ind\",\n \"ile\",\n \"ibo\",\n \"iii\",\n \"ipk\",\n \"ido\",\n \"ice\",\n \"isl\",\n \"ita\",\n \"iku\",\n \"jpn\",\n \"jav\",\n \"geo\",\n \"kat\",\n \"kon\",\n \"kik\",\n \"kua\",\n \"kaz\",\n \"kal\",\n \"khm\",\n \"kan\",\n \"kor\",\n \"kau\",\n \"kas\",\n \"kur\",\n \"kom\",\n \"cor\",\n \"kir\",\n \"lat\",\n \"ltz\",\n \"lug\",\n \"lim\",\n \"lin\",\n \"lao\",\n \"lit\",\n \"lub\",\n \"lav\",\n \"mlg\",\n \"mah\",\n \"mao\",\n \"mri\",\n \"mac\",\n \"mkd\",\n \"mal\",\n \"mon\",\n \"mol\",\n \"mar\",\n \"may\",\n \"msa\",\n \"mlt\",\n \"bur\",\n \"mya\",\n \"nau\",\n \"nob\",\n \"nde\",\n \"nep\",\n \"ndo\",\n \"dut\",\n \"nld\",\n \"nno\",\n \"nor\",\n \"nbl\",\n \"nav\",\n \"nya\",\n \"oci\",\n \"oji\",\n \"orm\",\n \"ori\",\n \"oss\",\n \"pan\",\n \"pli\",\n \"pol\",\n \"pus\",\n \"por\",\n \"que\",\n \"roh\",\n \"run\",\n \"rum\",\n \"ron\",\n \"rus\",\n \"kin\",\n \"san\",\n \"srd\",\n \"snd\",\n \"sme\",\n \"sag\",\n \"slo\",\n \"sin\",\n \"slk\",\n \"slv\",\n \"smo\",\n \"sna\",\n \"som\",\n \"alb\",\n \"sqi\",\n \"srp\",\n \"ssw\",\n \"sot\",\n \"sun\",\n \"swe\",\n \"swa\",\n \"tam\",\n \"tel\",\n \"tgk\",\n \"tha\",\n \"tir\",\n \"tuk\",\n \"tgl\",\n \"tsn\",\n \"ton\",\n \"tur\",\n \"tso\",\n \"tat\",\n \"twi\",\n \"tah\",\n \"uig\",\n \"ukr\",\n \"urd\",\n \"uzb\",\n \"ven\",\n \"vie\",\n \"vol\",\n \"wln\",\n \"wol\",\n \"xho\",\n \"yid\",\n \"yor\",\n \"zha\",\n \"chi\",\n \"zho\",\n \"zul\",\n];\nexport default ValidLanguages;\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\nimport { NAVBoolean } from \"../../constants/enums\";\n\n/**\n * Class representing SCORM 2004's adl object\n */\nexport class ADL extends BaseCMI {\n /**\n * Constructor for adl\n */\n constructor() {\n super();\n this.nav = new ADLNav();\n }\n\n public nav: ADLNav;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.nav?.initialize();\n }\n\n /**\n * toJSON for adl\n * @return {\n * {\n * nav: ADLNav\n * }\n * }\n */\n toJSON(): {\n nav: ADLNav;\n } {\n this.jsonString = true;\n const result = {\n nav: this.nav,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's `adl.nav` object\n */\n\nexport class ADLNav extends BaseCMI {\n private _request = \"_none_\";\n\n /**\n * Constructor for `adl.nav`\n */\n constructor() {\n super();\n this.request_valid = new ADLNavRequestValid();\n }\n\n public request_valid: ADLNavRequestValid;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.request_valid?.initialize();\n }\n\n /**\n * Getter for _request\n * @return {string}\n */\n get request(): string {\n return this._request;\n }\n\n /**\n * Setter for _request\n * @param {string} request\n */\n set request(request: string) {\n if (check2004ValidFormat(request, Regex.scorm2004.NAVEvent)) {\n this._request = request;\n }\n }\n\n /**\n * toJSON for adl.nav\n *\n * @return {\n * {\n * request: string\n * }\n * }\n */\n toJSON(): {\n request: string;\n } {\n this.jsonString = true;\n const result = {\n request: this.request,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's adl.nav.request_valid object\n */\n\nexport class ADLNavRequestValid extends BaseCMI {\n private _continue = \"unknown\";\n private _previous = \"unknown\";\n private _choice: {\n [key: string]: NAVBoolean;\n } = {};\n private _jump: {\n [key: string]: NAVBoolean;\n } = {};\n\n /**\n * Constructor for adl.nav.request_valid\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _continue\n * @return {string}\n */\n get continue(): string {\n return this._continue;\n }\n\n /**\n * Setter for _continue. Just throws an error.\n * @param {string} _continue\n */\n set continue(_continue: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (check2004ValidFormat(_continue, Regex.scorm2004.NAVBoolean)) {\n this._continue = _continue;\n }\n }\n\n /**\n * Getter for _previous\n * @return {string}\n */\n get previous(): string {\n return this._previous;\n }\n\n /**\n * Setter for _previous. Just throws an error.\n * @param {string} _previous\n */\n set previous(_previous: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (check2004ValidFormat(_previous, Regex.scorm2004.NAVBoolean)) {\n this._previous = _previous;\n }\n }\n\n /**\n * Getter for _choice\n * @return {{ [key: string]: NAVBoolean }}\n */\n get choice(): { [key: string]: NAVBoolean } {\n return this._choice;\n }\n\n /**\n * Setter for _choice\n * @param {{ [key: string]: string }} choice\n */\n set choice(choice: { [key: string]: string }) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (typeof choice !== \"object\") {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n for (const key in choice) {\n if ({}.hasOwnProperty.call(choice, key)) {\n if (\n check2004ValidFormat(choice[key], Regex.scorm2004.NAVBoolean) &&\n check2004ValidFormat(key, Regex.scorm2004.NAVTarget)\n ) {\n this._choice[key] =\n NAVBoolean[choice[key] as keyof typeof NAVBoolean];\n }\n }\n }\n }\n\n /**\n * Getter for _jump\n * @return {{ [key: string]: NAVBoolean }}\n */\n get jump(): { [key: string]: NAVBoolean } {\n return this._jump;\n }\n\n /**\n * Setter for _jump\n * @param {{ [key: string]: string }} jump\n */\n set jump(jump: { [key: string]: string }) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (typeof jump !== \"object\") {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n for (const key in jump) {\n if ({}.hasOwnProperty.call(jump, key)) {\n if (\n check2004ValidFormat(jump[key], Regex.scorm2004.NAVBoolean) &&\n check2004ValidFormat(key, Regex.scorm2004.NAVTarget)\n ) {\n this._jump[key] = NAVBoolean[jump[key] as keyof typeof NAVBoolean];\n }\n }\n }\n }\n\n /**\n * toJSON for adl.nav.request_valid\n *\n * @return {\n * {\n * previous: string,\n * continue: string\n * }\n * }\n */\n toJSON(): {\n previous: string;\n continue: string;\n } {\n this.jsonString = true;\n const result = {\n previous: this._previous,\n continue: this._continue,\n choice: this._choice,\n jump: this._jump,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import BaseAPI from \"./BaseAPI\";\nimport { CMI } from \"./cmi/scorm2004/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\nimport { CorrectResponses, ResponseType } from \"./constants/response_constants\";\nimport ValidLanguages from \"./constants/language_constants\";\nimport Regex from \"./constants/regex\";\nimport regex from \"./constants/regex\";\nimport { CMIArray } from \"./cmi/common/array\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm2004/interactions\";\nimport { CMICommentsObject } from \"./cmi/scorm2004/comments\";\nimport { CMIObjectivesObject } from \"./cmi/scorm2004/objectives\";\nimport { ADL } from \"./cmi/scorm2004/adl\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\n\n/**\n * API class for SCORM 2004\n */\nclass Scorm2004Impl extends BaseAPI {\n private _version: string = \"1.0\";\n\n /**\n * Constructor for SCORM 2004 API\n * @param {Settings} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm2004, settings);\n\n this.cmi = new CMI();\n this.adl = new ADL();\n\n // Rename functions to match 2004 Spec and expose to modules\n this.Initialize = this.lmsInitialize;\n this.Terminate = this.lmsFinish;\n this.GetValue = this.lmsGetValue;\n this.SetValue = this.lmsSetValue;\n this.Commit = this.lmsCommit;\n this.GetLastError = this.lmsGetLastError;\n this.GetErrorString = this.lmsGetErrorString;\n this.GetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public cmi: CMI;\n public adl: ADL;\n\n public Initialize: () => string;\n public Terminate: () => string;\n public GetValue: (CMIElement: string) => string;\n public SetValue: (CMIElement: string, value: any) => string;\n public Commit: () => string;\n public GetLastError: () => string;\n public GetErrorString: (CMIErrorCode: string | number) => string;\n public GetDiagnostic: (CMIErrorCode: string | number) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.adl = new ADL();\n }\n\n /**\n * Getter for _version\n * @return {string}\n */\n get version(): string {\n return this._version;\n }\n\n /**\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n return this.initialize(\"Initialize\");\n }\n\n /**\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"Terminate\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.adl.nav.request !== \"_none_\") {\n const navActions: { [key: string]: string } = {\n continue: \"SequenceNext\",\n previous: \"SequencePrevious\",\n choice: \"SequenceChoice\",\n jump: \"SequenceJump\",\n exit: \"SequenceExit\",\n exitAll: \"SequenceExitAll\",\n abandon: \"SequenceAbandon\",\n abandonAll: \"SequenceAbandonAll\",\n };\n\n let request = this.adl.nav.request;\n const choiceJumpRegex = new RegExp(regex.scorm2004.NAVEvent);\n const matches = request.match(choiceJumpRegex);\n let target = \"\";\n if (matches && matches.length > 2) {\n target = matches[2];\n request = matches[1].replace(target, \"\");\n }\n const action = navActions[request];\n if (action) {\n this.processListeners(action, \"adl.nav.request\", target);\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n const adlNavRequestRegex =\n \"^adl\\\\.nav\\\\.request_valid\\\\.(choice|jump)\\\\.{target=\\\\S{0,}([a-zA-Z0-9-_]+)}$\";\n if (stringMatches(CMIElement, adlNavRequestRegex)) {\n const matches = CMIElement.match(adlNavRequestRegex);\n const request = matches[1];\n const target = matches[2].replace(\"{target=\", \"\").replace(\"}\", \"\");\n if (request === \"choice\" || request === \"jump\") {\n if (this.settings.scoItemIdValidator) {\n return String(this.settings.scoItemIdValidator(target));\n }\n return String(this.settings.scoItemIds.includes(target));\n }\n }\n return this.getValue(\"GetValue\", true, CMIElement);\n }\n\n /**\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n return this.setValue(\"SetValue\", \"Commit\", true, CMIElement, value);\n }\n\n /**\n * Orders LMS to store all content parameters\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"Commit\");\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * Returns last error code\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"GetLastError\");\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string | number): string {\n return this.getErrorString(\"GetErrorString\", CMIErrorCode);\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string | number): string {\n return this.getDiagnostic(\"GetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"SetValue\", true, CMIElement, value);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {any} value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n }\n\n if (foundFirstIndex) {\n if (\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return this.createCorrectResponsesObject(CMIElement, value);\n } else if (\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsObjectivesObject();\n }\n } else if (stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")) {\n return new CMIInteractionsObject();\n }\n\n if (stringMatches(CMIElement, \"cmi\\\\.comments_from_learner\\\\.\\\\d+\")) {\n return new CMICommentsObject();\n } else if (stringMatches(CMIElement, \"cmi\\\\.comments_from_lms\\\\.\\\\d+\")) {\n return new CMICommentsObject(true);\n }\n\n return null;\n }\n\n private createCorrectResponsesObject(\n CMIElement: string,\n value: any,\n ): BaseCMI | null {\n const parts = CMIElement.split(\".\");\n const index = Number(parts[2]);\n const interaction = this.cmi.interactions.childArray[index];\n\n if (this.isInitialized()) {\n if (!interaction.type) {\n this.throwSCORMError(ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED);\n } else {\n this.checkDuplicateChoiceResponse(interaction, value);\n const response_type = CorrectResponses[interaction.type];\n if (response_type) {\n this.checkValidResponseType(response_type, value, interaction.type);\n } else {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Incorrect Response Type: \" + interaction.type,\n );\n }\n }\n }\n\n if (this.lastErrorCode === \"0\") {\n return new CMIInteractionsCorrectResponsesObject();\n }\n\n return null;\n }\n\n /**\n * Checks for valid response types\n * @param {object} response_type\n * @param {any} value\n * @param {string} interaction_type\n */\n checkValidResponseType(\n response_type: ResponseType,\n value: any,\n interaction_type: string,\n ) {\n let nodes = [];\n if (response_type?.delimiter) {\n nodes = String(value).split(response_type.delimiter);\n } else {\n nodes[0] = value;\n }\n\n if (nodes.length > 0 && nodes.length <= response_type.max) {\n this.checkCorrectResponseValue(interaction_type, nodes, value);\n } else if (nodes.length > response_type.max) {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Pattern Too Long\",\n );\n }\n }\n\n /**\n * Checks for duplicate 'choice' responses.\n * @param {CMIInteractionsObject} interaction\n * @param {any} value\n */\n checkDuplicateChoiceResponse(interaction: CMIInteractionsObject, value: any) {\n const interaction_count = interaction.correct_responses._count;\n if (interaction.type === \"choice\") {\n for (\n let i = 0;\n i < interaction_count && this.lastErrorCode === \"0\";\n i++\n ) {\n const response = interaction.correct_responses.childArray[i];\n if (response.pattern === value) {\n this.throwSCORMError(ErrorCodes.scorm2004.GENERAL_SET_FAILURE);\n }\n }\n }\n }\n\n /**\n * Validate correct response.\n * @param {string} CMIElement\n * @param {*} value\n */\n validateCorrectResponse(CMIElement: string, value: any) {\n const parts = CMIElement.split(\".\");\n const index = Number(parts[2]);\n const pattern_index = Number(parts[4]);\n const interaction = this.cmi.interactions.childArray[index];\n\n const interaction_count = interaction.correct_responses._count;\n this.checkDuplicateChoiceResponse(interaction, value);\n\n const response_type = CorrectResponses[interaction.type];\n if (\n typeof response_type.limit === \"undefined\" ||\n interaction_count <= response_type.limit\n ) {\n this.checkValidResponseType(response_type, value, interaction.type);\n\n if (\n (this.lastErrorCode === \"0\" &&\n (!response_type.duplicate ||\n !this.checkDuplicatedPattern(\n interaction.correct_responses,\n pattern_index,\n value,\n ))) ||\n (this.lastErrorCode === \"0\" && value === \"\")\n ) {\n // do nothing, we want the inverse\n } else {\n if (this.lastErrorCode === \"0\") {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Pattern Already Exists\",\n );\n }\n }\n } else {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Collection Limit Reached\",\n );\n }\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"GetValue\", true, CMIElement);\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {(string|number)} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: string | number,\n detail: boolean,\n ): string {\n let basicMessage = \"\";\n let detailMessage = \"\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm2004.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm2004.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm2004.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Check to see if a correct_response value has been duplicated\n * @param {CMIArray} correct_response\n * @param {number} current_index\n * @param {*} value\n * @return {boolean}\n */\n checkDuplicatedPattern(\n correct_response: CMIArray,\n current_index: number,\n value: any,\n ): boolean {\n let found = false;\n const count = correct_response._count;\n for (let i = 0; i < count && !found; i++) {\n if (i !== current_index && correct_response.childArray[i] === value) {\n found = true;\n }\n }\n return found;\n }\n\n /**\n * Checks for a valid correct_response value\n * @param {string} interaction_type\n * @param {Array} nodes\n * @param {*} value\n */\n checkCorrectResponseValue(\n interaction_type: string,\n nodes: Array,\n value: any,\n ) {\n const response = CorrectResponses[interaction_type];\n const formatRegex = new RegExp(response.format);\n for (let i = 0; i < nodes.length && this.lastErrorCode === \"0\"; i++) {\n if (\n interaction_type.match(\n \"^(fill-in|long-fill-in|matching|performance|sequencing)$\",\n )\n ) {\n nodes[i] = this.removeCorrectResponsePrefixes(nodes[i]);\n }\n\n if (response?.delimiter2) {\n const values = nodes[i].split(response.delimiter2);\n if (values.length === 2) {\n const matches = values[0].match(formatRegex);\n if (!matches) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n } else {\n if (\n !response.format2 ||\n !values[1].match(new RegExp(response.format2))\n ) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n } else {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n } else {\n const matches = nodes[i].match(formatRegex);\n if (\n (!matches && value !== \"\") ||\n (!matches && interaction_type === \"true-false\")\n ) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n } else {\n if (interaction_type === \"numeric\" && nodes.length > 1) {\n if (Number(nodes[0]) > Number(nodes[1])) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n } else {\n if (nodes[i] !== \"\" && response.unique) {\n for (let j = 0; j < i && this.lastErrorCode === \"0\"; j++) {\n if (nodes[i] === nodes[j]) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n }\n }\n }\n }\n }\n\n /**\n * Remove prefixes from correct_response\n * @param {string} node\n * @return {*}\n */\n removeCorrectResponsePrefixes(node: string): any {\n let seenOrder = false;\n let seenCase = false;\n let seenLang = false;\n\n const prefixRegex = new RegExp(\n \"^({(lang|case_matters|order_matters)=([^}]+)})\",\n );\n let matches = node.match(prefixRegex);\n let langMatches = null;\n while (matches) {\n switch (matches[2]) {\n case \"lang\":\n langMatches = node.match(Regex.scorm2004.CMILangcr);\n if (langMatches) {\n const lang = langMatches[3];\n if (lang !== undefined && lang.length > 0) {\n if (!ValidLanguages.includes(lang.toLowerCase())) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n seenLang = true;\n break;\n case \"case_matters\":\n if (!seenLang && !seenOrder && !seenCase) {\n if (matches[3] !== \"true\" && matches[3] !== \"false\") {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n\n seenCase = true;\n break;\n case \"order_matters\":\n if (!seenCase && !seenLang && !seenOrder) {\n if (matches[3] !== \"true\" && matches[3] !== \"false\") {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n\n seenOrder = true;\n break;\n }\n node = node.substring(matches[1].length);\n matches = node.match(prefixRegex);\n }\n\n return node;\n }\n\n /**\n * Replace the whole API with another\n * @param {Scorm2004Impl} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm2004Impl) {\n // Data Model\n this.cmi = newAPI.cmi;\n this.adl = newAPI.adl;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeDuration = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getDurationAsSeconds(\n totalTimeDuration,\n Regex.scorm2004.CMITimespan,\n );\n\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (this.cmi.completion_status) {\n if (this.cmi.completion_status === \"completed\") {\n completionStatus = CompletionStatus.completed;\n } else if (this.cmi.completion_status === \"incomplete\") {\n completionStatus = CompletionStatus.incomplete;\n }\n }\n if (this.cmi.success_status) {\n if (this.cmi.success_status === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (this.cmi.success_status === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n if (!Number.isNaN(Number.parseFloat(score.scaled))) {\n scoreObject.scaled = Number.parseFloat(score.scaled);\n }\n }\n\n const commitObject: CommitObject = {\n completionStatus: completionStatus,\n successStatus: successStatus,\n totalTimeSeconds: totalTimeSeconds,\n runtimeData: cmiExport,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n if (this.cmi.mode === \"normal\") {\n if (this.cmi.credit === \"credit\") {\n if (this.cmi.completion_threshold && this.cmi.progress_measure) {\n if (this.cmi.progress_measure >= this.cmi.completion_threshold) {\n this.cmi.completion_status = \"completed\";\n } else {\n this.cmi.completion_status = \"incomplete\";\n }\n }\n if (this.cmi.scaled_passing_score && this.cmi.score.scaled) {\n if (this.cmi.score.scaled >= this.cmi.scaled_passing_score) {\n this.cmi.success_status = \"passed\";\n } else {\n this.cmi.success_status = \"failed\";\n }\n }\n }\n }\n }\n\n let navRequest = false;\n if (\n this.adl.nav.request !== this.startingData?.adl?.nav?.request &&\n this.adl.nav.request !== \"_none_\"\n ) {\n this.adl.nav.request = encodeURIComponent(this.adl.nav.request);\n navRequest = true;\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n const result = await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n\n // check if this is a sequencing call, and then call the necessary JS\n {\n if (\n navRequest &&\n result.navRequest !== undefined &&\n result.navRequest !== \"\"\n ) {\n Function(`\"use strict\";(() => { ${result.navRequest} })()`)();\n }\n }\n return result;\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n\nexport { Scorm2004Impl };\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/dist/esm/scorm2004.min.js b/dist/esm/scorm2004.min.js new file mode 100644 index 0000000..1e74163 --- /dev/null +++ b/dist/esm/scorm2004.min.js @@ -0,0 +1,2 @@ +var e={900:function(e,t,r){r.d(t,{A:function(){return d}});var i=r(635),n=r(589),o=r(784),s=r(797),a=r(340),c=r(864);var l={autocommit:!1,autocommitSeconds:10,asyncCommit:!1,sendFullCommit:!0,lmsCommitUrl:!1,dataCommitFormat:"json",commitRequestDataType:"application/json;charset=UTF-8",autoProgress:!1,logLevel:a.A.global.LOG_LEVEL_ERROR,selfReportSessionTime:!1,alwaysSendTotalTime:!1,renderCommonCommitFields:!1,strict_errors:!0,xhrHeaders:{},xhrWithCredentials:!1,responseHandler:function(e){return(0,i.sH)(this,void 0,void 0,(function(){var t,r,n;return(0,i.YH)(this,(function(i){switch(i.label){case 0:return void 0===e?[3,2]:(n=(r=JSON).parse,[4,e.text()]);case 1:return null!==(t=n.apply(r,[i.sent()]))&&{}.hasOwnProperty.call(t,"result")?[2,{result:t.result,errorCode:t.errorCode?t.errorCode:t.result===a.A.global.SCORM_TRUE?0:101}]:200===e.status?[2,{result:a.A.global.SCORM_TRUE,errorCode:0}]:[2,{result:a.A.global.SCORM_FALSE,errorCode:101}];case 2:return[2,{result:a.A.global.SCORM_FALSE,errorCode:101}]}}))}))},requestHandler:function(e){return e},onLogMessage:function(e,t){switch(e){case a.A.global.LOG_LEVEL_ERROR:console.error(t);break;case a.A.global.LOG_LEVEL_WARNING:console.warn(t);break;case a.A.global.LOG_LEVEL_INFO:console.info(t);break;case a.A.global.LOG_LEVEL_DEBUG:console.debug?console.debug(t):console.log(t)}},scoItemIds:[],scoItemIdValidator:!1},u=function(){function e(e,t,r){this._cancelled=!1,this._API=e,this._timeout=setTimeout(this.wrapper.bind(this),t),this._callback=r}return e.prototype.cancel=function(){this._cancelled=!0,this._timeout&&clearTimeout(this._timeout)},e.prototype.wrapper=function(){var e=this;this._cancelled||(0,i.sH)(e,void 0,void 0,(function(){return(0,i.YH)(this,(function(e){switch(e.label){case 0:return[4,this._API.commit(this._callback)];case 1:return[2,e.sent()]}}))}))},e}(),h=function(){function e(t,r){var i=this.constructor;if(this._settings=l,i===e)throw new TypeError("Cannot construct BaseAPI instances directly");this.currentState=a.A.global.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[],this._error_codes=t,r&&(this.settings=r),this.apiLogLevel=this.settings.logLevel,this.selfReportSessionTime=this.settings.selfReportSessionTime}return e.prototype.commonReset=function(e){this.settings=(0,i.Cl)((0,i.Cl)({},this.settings),e),this.currentState=a.A.global.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[]},e.prototype.initialize=function(e,t,r){var i=a.A.global.SCORM_FALSE;return this.isInitialized()?this.throwSCORMError(this._error_codes.INITIALIZED,t):this.isTerminated()?this.throwSCORMError(this._error_codes.TERMINATED,r):(this.selfReportSessionTime&&this.cmi.setStartTime(),this.currentState=a.A.global.STATE_INITIALIZED,this.lastErrorCode="0",i=a.A.global.SCORM_TRUE,this.processListeners(e)),this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(i),i},e.prototype.apiLog=function(e,t,r,i){t=(0,c.hw)(e,t,i),r>=this.apiLogLevel&&this.settings.onLogMessage(r,t)},Object.defineProperty(e.prototype,"error_codes",{get:function(){return this._error_codes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"settings",{get:function(){return this._settings},set:function(e){this._settings=(0,i.Cl)((0,i.Cl)({},this._settings),e)},enumerable:!1,configurable:!0}),e.prototype.terminate=function(e,t){return(0,i.sH)(this,void 0,void 0,(function(){var r,n;return(0,i.YH)(this,(function(i){switch(i.label){case 0:return r=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.TERMINATION_BEFORE_INIT,this._error_codes.MULTIPLE_TERMINATION)?(this.currentState=a.A.global.STATE_TERMINATED,[4,this.storeData(!0)]):[3,2];case 1:void 0!==(n=i.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),r=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,t&&(this.lastErrorCode="0"),r=a.A.global.SCORM_TRUE,this.processListeners(e),i.label=2;case 2:return this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(r),[2,r]}}))}))},e.prototype.getValue=function(e,t,r){var i="";if(this.checkState(t,this._error_codes.RETRIEVE_BEFORE_INIT,this._error_codes.RETRIEVE_AFTER_TERM)){t&&(this.lastErrorCode="0");try{i=this.getCMIValue(r)}catch(e){i=this.handleValueAccessException(e,i)}this.processListeners(e,r)}return this.apiLog(e,": returned: "+i,a.A.global.LOG_LEVEL_INFO,r),void 0===i?"":(this.clearSCORMError(i),i)},e.prototype.setValue=function(e,t,r,i,n){void 0!==n&&(n=String(n));var o=a.A.global.SCORM_FALSE;if(this.checkState(r,this._error_codes.STORE_BEFORE_INIT,this._error_codes.STORE_AFTER_TERM)){r&&(this.lastErrorCode="0");try{o=this.setCMIValue(i,n)}catch(e){this.handleValueAccessException(e,o)}this.processListeners(e,i,n)}return void 0===o&&(o=a.A.global.SCORM_FALSE),"0"===String(this.lastErrorCode)&&this.settings.autocommit&&!this._timeout&&this.scheduleCommit(1e3*this.settings.autocommitSeconds,t),this.apiLog(e,": "+n+": result: "+o,a.A.global.LOG_LEVEL_INFO,i),this.clearSCORMError(o),o},e.prototype.commit=function(e){return(0,i.sH)(this,arguments,void 0,(function(e,t){var r,n;return void 0===t&&(t=!1),(0,i.YH)(this,(function(i){switch(i.label){case 0:return this.clearScheduledCommit(),r=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.COMMIT_BEFORE_INIT,this._error_codes.COMMIT_AFTER_TERM)?[4,this.storeData(!1)]:[3,2];case 1:(n=i.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),r=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,this.apiLog(e," Result: "+r,a.A.global.LOG_LEVEL_DEBUG,"HttpRequest"),t&&(this.lastErrorCode="0"),this.processListeners(e),i.label=2;case 2:return this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(r),[2,r]}}))}))},e.prototype.getLastError=function(e){var t=String(this.lastErrorCode);return this.processListeners(e),this.apiLog(e,"returned: "+t,a.A.global.LOG_LEVEL_INFO),t},e.prototype.getErrorString=function(e,t){var r="";return null!==t&&""!==t&&(r=this.getLmsErrorMessageDetails(t),this.processListeners(e)),this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),r},e.prototype.getDiagnostic=function(e,t){var r="";return null!==t&&""!==t&&(r=this.getLmsErrorMessageDetails(t,!0),this.processListeners(e)),this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),r},e.prototype.checkState=function(e,t,r){return this.isNotInitialized()?(this.throwSCORMError(t),!1):!e||!this.isTerminated()||(this.throwSCORMError(r),!1)},e.prototype.getLmsErrorMessageDetails=function(e,t){throw void 0===t&&(t=!1),new Error("The getLmsErrorMessageDetails method has not been implemented")},e.prototype.getCMIValue=function(e){throw new Error("The getCMIValue method has not been implemented")},e.prototype.setCMIValue=function(e,t){throw new Error("The setCMIValue method has not been implemented")},e.prototype._commonSetCMIValue=function(e,t,r,o){if(!r||""===r)return a.A.global.SCORM_FALSE;for(var s=r.split("."),l=this,u=a.A.global.SCORM_FALSE,h=!1,d="The data model element passed to ".concat(e," (").concat(r,") is not a valid SCORM data model element."),m=t?this._error_codes.UNDEFINED_DATA_MODEL:this._error_codes.GENERAL,_=0;_1&&(s=e.replace(o+".","")),this.listenerArray.push({functionName:o,CMIElement:s,callback:t}),this.apiLog("on","Added event listener: ".concat(this.listenerArray.length),a.A.global.LOG_LEVEL_INFO,o)}},e.prototype.off=function(e,t){if(t)for(var r=e.split(" "),i=function(i){var o=r[i].split(".");if(0===o.length)return{value:void 0};var s=o[0],c=null;o.length>1&&(c=e.replace(s+".",""));var l=n.listenerArray.findIndex((function(e){return e.functionName===s&&e.CMIElement===c&&e.callback===t}));-1!==l&&(n.listenerArray.splice(l,1),n.apiLog("off","Removed event listener: ".concat(n.listenerArray.length),a.A.global.LOG_LEVEL_INFO,s))},n=this,o=0;o1&&(s=e.replace(o+".","")),i.listenerArray=i.listenerArray.filter((function(e){return e.functionName!==o&&e.CMIElement!==s}))},i=this,n=0;ns?1:0})),s.forEach((function(e){(i={})[e[0]]=e[1],r.loadFromJSON((0,c.sB)(i),t)}))}else console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize.");function a(e,t,r){var i,n=e.match(r);if(null!==n&&null!==(i=t.match(r))){var o=Number(n[2]),s=Number(i[2]);return o===s?"id"===n[3]?-1:"type"===n[3]?"id"===i[3]?1:-1:1:o-s}return null}},e.prototype.loadFromJSON=function(e,t){if(this.isNotInitialized()){for(var r in t=void 0!==t?t:"cmi",this.startingData=e,e)if({}.hasOwnProperty.call(e,r)&&e[r]){var i=(t?t+".":"")+r,n=e[r];if(n.childArray)for(var o=0;o=200&&e.status<=299&&(!0===t.result||t.result===a.A.global.SCORM_TRUE)?this.processListeners("CommitSuccess"):this.processListeners("CommitError"),[2,t]}}))}))},e}(),d=h},589:function(e,t,r){r.d(t,{B:function(){return c}});var i=r(635),n=r(319),o=r(797),s=r(784),a=o.A.scorm12,c=function(e){function t(t){var r=e.call(this)||this;return r.__children=t.children,r._errorCode=t.errorCode||a.GENERAL,r._errorClass=t.errorClass||s.$h,r.childArray=[],r}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_count",{get:function(){return this.childArray.length},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;for(var e={},t=0;t=n[0]){if("*"===n[1]||e<=n[1])return!0;throw new i(r)}throw new i(r)}r.d(t,{W:function(){return n},q:function(){return i}})},340:function(e,t,r){var i=r(635),n={cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",core_children:"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time",score_children:"raw,min,max",comments_children:"content,location,time",objectives_children:"id,score,status",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio,language,speed,text",interactions_children:"id,objectives,time,type,correct_responses,weighting,student_response,result,latency",error_descriptions:{101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information"},201:{basicMessage:"Invalid argument error",detailMessage:"Indicates that an argument represents an invalid data model element or is otherwise incorrect."},202:{basicMessage:"Element cannot have children",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.'},203:{basicMessage:"Element not an array - cannot have count",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.'},301:{basicMessage:"Not initialized",detailMessage:"Indicates that an API call was made before the call to lmsInitialize."},401:{basicMessage:"Not implemented error",detailMessage:"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement."},402:{basicMessage:"Invalid set value, element is a keyword",detailMessage:'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").'},403:{basicMessage:"Element is read only",detailMessage:"LMSSetValue was called with a data model element that can only be read."},404:{basicMessage:"Element is write only",detailMessage:"LMSGetValue was called on a data model element that can only be written to."},405:{basicMessage:"Incorrect Data Type",detailMessage:"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Element Value Out Of Range",detailMessage:"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}},o={global:{SCORM_TRUE:"true",SCORM_FALSE:"false",STATE_NOT_INITIALIZED:0,STATE_INITIALIZED:1,STATE_TERMINATED:2,LOG_LEVEL_DEBUG:1,LOG_LEVEL_INFO:2,LOG_LEVEL_WARNING:3,LOG_LEVEL_ERROR:4,LOG_LEVEL_NONE:5},scorm12:n,aicc:(0,i.Cl)((0,i.Cl)({},n),{cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation",student_preference_children:"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows",student_data_children:"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action",student_demographics_children:"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience",tries_children:"time,status,score",attempt_records_children:"score,lesson_status",paths_children:"location_id,date,time,status,why_left,time_in_element"}),scorm2004:{cmi_children:"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time",comments_children:"comment,timestamp,location",score_children:"max,raw,scaled,min",objectives_children:"progress_measure,completion_status,success_status,description,score,id",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio_level,audio_captioning,delivery_speed,language",interactions_children:"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description",error_descriptions:{0:{basicMessage:"No Error",detailMessage:"No error occurred, the previous API call was successful."},101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use GetDiagnostic for more information."},102:{basicMessage:"General Initialization Failure",detailMessage:"Call to Initialize failed for an unknown reason."},103:{basicMessage:"Already Initialized",detailMessage:"Call to Initialize failed because Initialize was already called."},104:{basicMessage:"Content Instance Terminated",detailMessage:"Call to Initialize failed because Terminate was already called."},111:{basicMessage:"General Termination Failure",detailMessage:"Call to Terminate failed for an unknown reason."},112:{basicMessage:"Termination Before Initialization",detailMessage:"Call to Terminate failed because it was made before the call to Initialize."},113:{basicMessage:"Termination After Termination",detailMessage:"Call to Terminate failed because Terminate was already called."},122:{basicMessage:"Retrieve Data Before Initialization",detailMessage:"Call to GetValue failed because it was made before the call to Initialize."},123:{basicMessage:"Retrieve Data After Termination",detailMessage:"Call to GetValue failed because it was made after the call to Terminate."},132:{basicMessage:"Store Data Before Initialization",detailMessage:"Call to SetValue failed because it was made before the call to Initialize."},133:{basicMessage:"Store Data After Termination",detailMessage:"Call to SetValue failed because it was made after the call to Terminate."},142:{basicMessage:"Commit Before Initialization",detailMessage:"Call to Commit failed because it was made before the call to Initialize."},143:{basicMessage:"Commit After Termination",detailMessage:"Call to Commit failed because it was made after the call to Terminate."},201:{basicMessage:"General Argument Error",detailMessage:"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument."},301:{basicMessage:"General Get Failure",detailMessage:"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},351:{basicMessage:"General Set Failure",detailMessage:"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},391:{basicMessage:"General Commit Failure",detailMessage:"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information."},401:{basicMessage:"Undefined Data Model Element",detailMessage:"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element."},402:{basicMessage:"Unimplemented Data Model Element",detailMessage:"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant."},403:{basicMessage:"Data Model Element Value Not Initialized",detailMessage:"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO."},404:{basicMessage:"Data Model Element Is Read Only",detailMessage:"SetValue was called with a data model element that can only be read."},405:{basicMessage:"Data Model Element Is Write Only",detailMessage:"GetValue was called on a data model element that can only be written to."},406:{basicMessage:"Data Model Element Type Mismatch",detailMessage:"SetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Data Model Element Value Out Of Range",detailMessage:"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}}};t.A=o},56:function(e,t,r){var i,n,o;r.d(t,{K$:function(){return i},YE:function(){return n},lC:function(){return o}}),function(e){e.unknown="unknown",e.true="true",e.false="false"}(i||(i={})),function(e){e.passed="passed",e.failed="failed",e.unknown="unknown"}(n||(n={})),function(e){e.completed="completed",e.incomplete="incomplete",e.unknown="unknown"}(o||(o={}))},797:function(e,t,r){var i=r(635),n={GENERAL:101,INITIALIZATION_FAILED:101,INITIALIZED:101,TERMINATED:101,TERMINATION_FAILURE:101,TERMINATION_BEFORE_INIT:101,MULTIPLE_TERMINATION:101,RETRIEVE_BEFORE_INIT:101,RETRIEVE_AFTER_TERM:101,STORE_BEFORE_INIT:101,STORE_AFTER_TERM:101,COMMIT_BEFORE_INIT:101,COMMIT_AFTER_TERM:101,ARGUMENT_ERROR:101,CHILDREN_ERROR:101,COUNT_ERROR:101,GENERAL_GET_FAILURE:101,GENERAL_SET_FAILURE:101,GENERAL_COMMIT_FAILURE:101,UNDEFINED_DATA_MODEL:101,UNIMPLEMENTED_ELEMENT:101,VALUE_NOT_INITIALIZED:101,INVALID_SET_VALUE:101,READ_ONLY_ELEMENT:101,WRITE_ONLY_ELEMENT:101,TYPE_MISMATCH:101,VALUE_OUT_OF_RANGE:101,DEPENDENCY_NOT_ESTABLISHED:101},o={scorm12:(0,i.Cl)((0,i.Cl)({},n),{RETRIEVE_BEFORE_INIT:301,STORE_BEFORE_INIT:301,COMMIT_BEFORE_INIT:301,ARGUMENT_ERROR:201,CHILDREN_ERROR:202,COUNT_ERROR:203,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:401,VALUE_NOT_INITIALIZED:301,INVALID_SET_VALUE:402,READ_ONLY_ELEMENT:403,WRITE_ONLY_ELEMENT:404,TYPE_MISMATCH:405,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408}),scorm2004:(0,i.Cl)((0,i.Cl)({},n),{INITIALIZATION_FAILED:102,INITIALIZED:103,TERMINATED:104,TERMINATION_FAILURE:111,TERMINATION_BEFORE_INIT:112,MULTIPLE_TERMINATIONS:113,RETRIEVE_BEFORE_INIT:122,RETRIEVE_AFTER_TERM:123,STORE_BEFORE_INIT:132,STORE_AFTER_TERM:133,COMMIT_BEFORE_INIT:142,COMMIT_AFTER_TERM:143,ARGUMENT_ERROR:201,GENERAL_GET_FAILURE:301,GENERAL_SET_FAILURE:351,GENERAL_COMMIT_FAILURE:391,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:402,VALUE_NOT_INITIALIZED:403,READ_ONLY_ELEMENT:404,WRITE_ONLY_ELEMENT:405,TYPE_MISMATCH:406,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408})};t.A=o},417:function(e,t,r){var i=r(635),n={CMIString256:"^.{0,255}$",CMIString4096:"^.{0,4096}$",CMITime:"^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",CMITimespan:"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{0,3})(.[0-9]*)?$",CMIIdentifier:"^[\\u0021-\\u007E\\s]{0,255}$",CMIFeedback:"^.{0,255}$",CMIIndex:"[._](\\d+).",CMIStatus:"^(passed|completed|failed|incomplete|browsed)$",CMIStatus2:"^(passed|completed|failed|incomplete|browsed|not attempted)$",CMIExit:"^(time-out|suspend|logout|)$",CMIType:"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$",CMIResult:"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$",NAVEvent:"^(previous|continue)$",score_range:"0#100",audio_range:"-1#100",speed_range:"-100#100",weighting_range:"-100#100",text_range:"-1#1"},o={aicc:(0,i.Cl)((0,i.Cl)({},n),{CMIIdentifier:"^\\w{1,255}$"}),scorm12:n,scorm2004:{CMIString200:"^[\\u0000-\\uFFFF]{0,200}$",CMIString250:"^[\\u0000-\\uFFFF]{0,250}$",CMIString1000:"^[\\u0000-\\uFFFF]{0,1000}$",CMIString4000:"^[\\u0000-\\uFFFF]{0,4000}$",CMIString64000:"^[\\u0000-\\uFFFF]{0,64000}$",CMILang:"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$",CMILangString250:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$",CMILangcr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$",CMILangString250cr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$",CMILangString4000:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$",CMITime:"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$",CMITimespan:"^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{1,5})(\\.[0-9]{1,18})?$",CMIIdentifier:"^\\S{1,250}[a-zA-Z0-9]$",CMIShortIdentifier:"^[\\w\\.\\-\\_]{1,250}$",CMILongIdentifier:"^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$",CMIFeedback:"^.*$",CMIIndex:"[._](\\d+).",CMIIndexStore:".N(\\d+).",CMICStatus:"^(completed|incomplete|not attempted|unknown)$",CMISStatus:"^(passed|failed|unknown)$",CMIExit:"^(time-out|suspend|logout|normal)$",CMIType:"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",CMIResult:"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",NAVEvent:"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$",NAVBoolean:"^(unknown|true|false$)",NAVTarget:"^{target=\\S{0,}[a-zA-Z0-9-_]+}$",scaled_range:"-1#1",audio_range:"0#*",speed_range:"0#*",text_range:"-1#1",progress_range:"0#1"}};t.A=o},784:function(e,t,r){r.d(t,{$h:function(){return c},wq:function(){return u},yI:function(){return l}});var i=r(635),n=r(340),o=n.A.scorm12.error_descriptions,s=n.A.aicc.error_descriptions,a=n.A.scorm2004.error_descriptions,c=function(e){function t(t){var r=e.call(this,t.toString())||this;return r._errorCode=t,r.name="ScormValidationError",r}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"errorCode",{get:function(){return this._errorCode},enumerable:!1,configurable:!0}),t.prototype.setMessage=function(e){this.message=e},t}(Error),l=function(e){function t(t,r,i){var n=e.call(this,t)||this;return n._detailedMessage="",n.setMessage(r),n._errorMessage=r,i&&(n._detailedMessage=i),n}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"errorMessage",{get:function(){return this._errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"detailedMessage",{get:function(){return this._detailedMessage},enumerable:!1,configurable:!0}),t}(c),u=(function(e){function t(t){return{}.hasOwnProperty.call(o,String(t))?e.call(this,t,o[String(t)].basicMessage,o[String(t)].detailMessage)||this:e.call(this,101,o[101].basicMessage,o[101].detailMessage)||this}(0,i.C6)(t,e)}(l),function(e){function t(t){return{}.hasOwnProperty.call(s,String(t))?e.call(this,t,s[String(t)].basicMessage,s[String(t)].detailMessage)||this:e.call(this,101,s[101].basicMessage,s[101].detailMessage)||this}(0,i.C6)(t,e)}(l),function(e){function t(t){return{}.hasOwnProperty.call(a,String(t))?e.call(this,t,a[String(t)].basicMessage,a[String(t)].detailMessage)||this:e.call(this,101,a[101].basicMessage,a[101].detailMessage)||this}return(0,i.C6)(t,e),t}(l))},864:function(e,t,r){r.d(t,{$o:function(){return a},Bq:function(){return c},J6:function(){return d},OI:function(){return s},hw:function(){return h},sB:function(){return l},xE:function(){return o}});var i=3600,n={D:24*i,H:i,M:60,S:1};function o(e){if(!e||e<=0)return"PT0S";var t="P",r=e;for(var i in n){var o=n[i],s=Math.floor(r/o);u(r%=o)>2&&(r=Number(Number(r).toFixed(2))),"S"===i&&r>0&&(s+=r),s&&((t.indexOf("D")>0||"H"===i||"M"===i||"S"===i)&&-1===t.indexOf("T")&&(t+="T"),t+="".concat(s).concat(i))}return t}function s(e,t){if("string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var r=new RegExp(t).exec(e)||[],i=r[1],n=(r[2],r[4]),o=r[5],s=r[6],a=r[7],c=0;return c+=Number(a)||0,c+=60*Number(s)||0,c+=3600*Number(o)||0,c+=86400*Number(n)||0,c+=31536e3*Number(i)||0}function a(e,t,r){var i="string"==typeof r?new RegExp(r):r;return o(s(e,i)+s(t,i))}function c(e){var t={};return function e(r,i){if(Object(r)!==r)t[i]=r;else if(Array.isArray(r))for(var n=0,o=r.length;n0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]0&&t.length<=r.max))throw new l.wq(c.A.scorm2004.GENERAL_SET_FAILURE);for(var i=new RegExp(r.format),n=0;n2&&(c=o[2],r=o[1].replace(c,"")),(l=t[r])&&this.processListeners(l,"adl.nav.request",c)):this.settings.autoProgress&&this.processListeners("SequenceNext")),[2,e]}}))}))},t.prototype.lmsGetValue=function(e){var t="^adl\\.nav\\.request_valid\\.(choice|jump)\\.{target=\\S{0,}([a-zA-Z0-9-_]+)}$";if((0,u.J6)(e,t)){var r=e.match(t),i=r[1],n=r[2].replace("{target=","").replace("}","");if("choice"===i||"jump"===i)return this.settings.scoItemIdValidator?String(this.settings.scoItemIdValidator(n)):String(this.settings.scoItemIds.includes(n))}return this.getValue("GetValue",!0,e)},t.prototype.lmsSetValue=function(e,t){return this.setValue("SetValue","Commit",!0,e,t)},t.prototype.lmsCommit=function(){var e=this;return(0,n.sH)(e,void 0,void 0,(function(){return(0,n.YH)(this,(function(e){switch(e.label){case 0:return[4,this.commit("Commit")];case 1:return e.sent(),[2]}}))})),s.A.global.SCORM_TRUE},t.prototype.lmsGetLastError=function(){return this.getLastError("GetLastError")},t.prototype.lmsGetErrorString=function(e){return this.getErrorString("GetErrorString",e)},t.prototype.lmsGetDiagnostic=function(e){return this.getDiagnostic("GetDiagnostic",e)},t.prototype.setCMIValue=function(e,t){return this._commonSetCMIValue("SetValue",!0,e,t)},t.prototype.getChildElement=function(e,t,r){if((0,u.J6)(e,"cmi\\.objectives\\.\\d+"))return new w;if(r){if((0,u.J6)(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+"))return this.createCorrectResponsesObject(e,t);if((0,u.J6)(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+"))return new I}else if((0,u.J6)(e,"cmi\\.interactions\\.\\d+"))return new M;return(0,u.J6)(e,"cmi\\.comments_from_learner\\.\\d+")?new T:(0,u.J6)(e,"cmi\\.comments_from_lms\\.\\d+")?new T(!0):null},t.prototype.createCorrectResponsesObject=function(e,t){var r=e.split("."),i=Number(r[2]),n=this.cmi.interactions.childArray[i];if(this.isInitialized())if(n.type){this.checkDuplicateChoiceResponse(n,t);var o=b[n.type];o?this.checkValidResponseType(o,t,n.type):this.throwSCORMError(c.A.scorm2004.GENERAL_SET_FAILURE,"Incorrect Response Type: "+n.type)}else this.throwSCORMError(c.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED);return"0"===this.lastErrorCode?new C:null},t.prototype.checkValidResponseType=function(e,t,r){var i=[];(null==e?void 0:e.delimiter)?i=String(t).split(e.delimiter):i[0]=t,i.length>0&&i.length<=e.max?this.checkCorrectResponseValue(r,i,t):i.length>e.max&&this.throwSCORMError(c.A.scorm2004.GENERAL_SET_FAILURE,"Data Model Element Pattern Too Long")},t.prototype.checkDuplicateChoiceResponse=function(e,t){var r=e.correct_responses._count;if("choice"===e.type)for(var i=0;i1)Number(t[0])>Number(t[1])&&this.throwSCORMError(c.A.scorm2004.TYPE_MISMATCH);else if(""!==t[o]&&i.unique)for(var l=0;l0&&(N.includes(l.toLowerCase())||this.throwSCORMError(c.A.scorm2004.TYPE_MISMATCH))}i=!0;break;case"case_matters":i||t||r||"true"!==o[3]&&"false"!==o[3]&&this.throwSCORMError(c.A.scorm2004.TYPE_MISMATCH),r=!0;break;case"order_matters":r||i||t||"true"!==o[3]&&"false"!==o[3]&&this.throwSCORMError(c.A.scorm2004.TYPE_MISMATCH),t=!0}o=(e=e.substring(o[1].length)).match(n)}return e},t.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi,this.adl=e.adl},t.prototype.renderCommitCMI=function(e){var t=this.renderCMIToJSONObject();e&&(t.cmi.total_time=this.cmi.getCurrentTotalTime());var r=[],i=u.Bq(t);switch(this.settings.dataCommitFormat){case"flattened":return u.Bq(t);case"params":for(var n in i)({}).hasOwnProperty.call(i,n)&&r.push("".concat(n,"=").concat(i[n]));return r;default:return t}},t.prototype.renderCommitObject=function(e){var t=this.renderCommitCMI(e),r=this.cmi.getCurrentTotalTime(),i=u.OI(r,a.A.scorm2004.CMITimespan),n=R.lC.unknown,o=R.YE.unknown;this.cmi.completion_status&&("completed"===this.cmi.completion_status?n=R.lC.completed:"incomplete"===this.cmi.completion_status&&(n=R.lC.incomplete)),this.cmi.success_status&&("passed"===this.cmi.success_status?o=R.YE.passed:"failed"===this.cmi.success_status&&(o=R.YE.failed));var s=this.cmi.score,c=null;s&&(c={},Number.isNaN(Number.parseFloat(s.raw))||(c.raw=Number.parseFloat(s.raw)),Number.isNaN(Number.parseFloat(s.min))||(c.min=Number.parseFloat(s.min)),Number.isNaN(Number.parseFloat(s.max))||(c.max=Number.parseFloat(s.max)),Number.isNaN(Number.parseFloat(s.scaled))||(c.scaled=Number.parseFloat(s.scaled)));var l={completionStatus:n,successStatus:o,totalTimeSeconds:i,runtimeData:t};return c&&(l.score=c),l},t.prototype.storeData=function(e){return(0,n.sH)(this,void 0,void 0,(function(){var t,r,i,o,a,c,l;return(0,n.YH)(this,(function(n){switch(n.label){case 0:return e&&"normal"===this.cmi.mode&&"credit"===this.cmi.credit&&(this.cmi.completion_threshold&&this.cmi.progress_measure&&(this.cmi.progress_measure>=this.cmi.completion_threshold?this.cmi.completion_status="completed":this.cmi.completion_status="incomplete"),this.cmi.scaled_passing_score&&this.cmi.score.scaled&&(this.cmi.score.scaled>=this.cmi.scaled_passing_score?this.cmi.success_status="passed":this.cmi.success_status="failed")),t=!1,this.adl.nav.request!==(null===(l=null===(c=null===(a=this.startingData)||void 0===a?void 0:a.adl)||void 0===c?void 0:c.nav)||void 0===l?void 0:l.request)&&"_none_"!==this.adl.nav.request&&(this.adl.nav.request=encodeURIComponent(this.adl.nav.request),t=!0),r=e||this.settings.alwaysSendTotalTime,i=this.settings.renderCommonCommitFields?this.renderCommitObject(r):this.renderCommitCMI(r),this.apiLogLevel===s.A.global.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(i)),"string"!=typeof this.settings.lmsCommitUrl?[3,2]:[4,this.processHttpRequest(this.settings.lmsCommitUrl,i,e)];case 1:return o=n.sent(),t&&void 0!==o.navRequest&&""!==o.navRequest&&Function('"use strict";(() => { '.concat(o.navRequest," })()"))(),[2,o];case 2:return[2,{result:s.A.global.SCORM_TRUE,errorCode:0}]}}))}))},t}(o.A),F=i.Z;export{F as Scorm2004Impl}; +//# sourceMappingURL=scorm2004.min.js.map \ No newline at end of file diff --git a/dist/esm/scorm2004.min.js.map b/dist/esm/scorm2004.min.js.map new file mode 100644 index 0000000..34515ec --- /dev/null +++ b/dist/esm/scorm2004.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"scorm2004.min.js","mappings":"qHAMO,IAAMA,EAA4B,CACvCC,YAAY,EACZC,kBAAmB,GACnBC,aAAa,EACbC,gBAAgB,EAChBC,cAAc,EACdC,iBAAkB,OAClBC,sBAAuB,iCACvBC,cAAc,EACdC,SAAU,EAAAC,EAAaC,OAAOC,gBAC9BC,uBAAuB,EACvBC,qBAAqB,EACrBC,0BAA0B,EAC1BC,eAAe,EACfC,WAAY,CAAC,EACbC,oBAAoB,EACpBC,gBAAiB,SAAgBC,G,4HACP,IAAbA,EAAP,OACiB,KAAAC,MAAKC,MAAM,GAAMF,EAASG,S,OAC7C,OACiB,QAFXC,EAAa,WAAW,aAG3B,CAAC,EAAEC,eAAeC,KAAKF,EAAY,UAc7B,CAAP,EAAO,CACLG,OAAQH,EAAWG,OACnBC,UAAWJ,EAAWI,UAClBJ,EAAWI,UACXJ,EAAWG,SAAW,EAAAjB,EAAaC,OAAOkB,WACxC,EACA,MAlBgB,MAApBT,EAASU,OACJ,CAAP,EAAO,CACLH,OAAQ,EAAAjB,EAAaC,OAAOkB,WAC5BD,UAAW,IAGN,CAAP,EAAO,CACLD,OAAQ,EAAAjB,EAAaC,OAAOoB,YAC5BH,UAAW,M,OAcnB,MAAO,CAAP,EAAO,CACLD,OAAQ,EAAAjB,EAAaC,OAAOoB,YAC5BH,UAAW,M,QAGfI,eAAgB,SAAUC,GACxB,OAAOA,CACT,EACAC,aAAc,SAAUC,EAAcC,GACpC,OAAQD,GACN,KAAK,EAAAzB,EAAaC,OAAOC,gBACvByB,QAAQC,MAAMF,GACd,MACF,KAAK,EAAA1B,EAAaC,OAAO4B,kBACvBF,QAAQG,KAAKJ,GACb,MACF,KAAK,EAAA1B,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AAK8gB,qBAC3BvC,MAAOve,KAAKue,MACZwC,aAAc/gB,KAAK+gB,aACnBtC,eAAgBze,KAAKye,eACrBuC,aAAchhB,KAAKghB,aACnBC,kBAAmBjhB,KAAKihB,mBAG1B,cADOjhB,KAAK4M,WACLrO,CACT,EACF,EAtkBA,CAAyB,KCyXzB,EAzYiC,CAC/B,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,O,QC7XF,cAIE,aACE,QAAK,YAAE,K,OACP,EAAKgjB,IAAM,IAAIC,E,CACjB,CA8BF,OArCyB,aAcvB,YAAAlgB,WAAA,W,MACE,YAAMA,WAAU,WACR,QAAR,EAAAtB,KAAKuhB,WAAG,SAAEjgB,YACZ,EAUA,YAAAqL,OAAA,WAGE3M,KAAK4M,YAAa,EAClB,IAAMrO,EAAS,CACbgjB,IAAKvhB,KAAKuhB,KAGZ,cADOvhB,KAAK4M,WACLrO,CACT,EACF,EArCA,CAAyB,KA2CzB,cAME,aACE,QAAK,YAAE,K,OAND,EAAAk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AW,I,QAInB,EArtBA,CAA4BqC,EAAA,G","sources":["webpack://scorm-again/./src/constants/default_settings.ts","webpack://scorm-again/./src/helpers/scheduled_commit.ts","webpack://scorm-again/./src/BaseAPI.ts","webpack://scorm-again/./src/utilities/debounce.ts","webpack://scorm-again/./src/cmi/common/array.ts","webpack://scorm-again/./src/cmi/common/base_cmi.ts","webpack://scorm-again/./src/cmi/common/score.ts","webpack://scorm-again/./src/cmi/common/validation.ts","webpack://scorm-again/./src/constants/api_constants.ts","webpack://scorm-again/./src/constants/enums.ts","webpack://scorm-again/./src/constants/error_codes.ts","webpack://scorm-again/./src/constants/regex.ts","webpack://scorm-again/./src/exceptions.ts","webpack://scorm-again/./src/utilities.ts","webpack://scorm-again/./node_modules/tslib/tslib.es6.mjs","webpack://scorm-again/webpack/bootstrap","webpack://scorm-again/webpack/runtime/define property getters","webpack://scorm-again/webpack/runtime/hasOwnProperty shorthand","webpack://scorm-again/./src/cmi/scorm2004/validation.ts","webpack://scorm-again/./src/cmi/scorm2004/learner_preference.ts","webpack://scorm-again/./src/constants/response_constants.ts","webpack://scorm-again/./src/cmi/scorm2004/interactions.ts","webpack://scorm-again/./src/cmi/scorm2004/score.ts","webpack://scorm-again/./src/cmi/scorm2004/comments.ts","webpack://scorm-again/./src/cmi/scorm2004/objectives.ts","webpack://scorm-again/./src/cmi/scorm2004/cmi.ts","webpack://scorm-again/./src/constants/language_constants.ts","webpack://scorm-again/./src/cmi/scorm2004/adl.ts","webpack://scorm-again/./src/Scorm2004API.ts"],"sourcesContent":["import { ResultObject, Settings } from \"../types/api_types\";\nimport APIConstants from \"./api_constants\";\n\n/**\n * Default settings for the SCORM API\n */\nexport const DefaultSettings: Settings = {\n autocommit: false,\n autocommitSeconds: 10,\n asyncCommit: false,\n sendFullCommit: true,\n lmsCommitUrl: false,\n dataCommitFormat: \"json\",\n commitRequestDataType: \"application/json;charset=UTF-8\",\n autoProgress: false,\n logLevel: APIConstants.global.LOG_LEVEL_ERROR,\n selfReportSessionTime: false,\n alwaysSendTotalTime: false,\n renderCommonCommitFields: false,\n strict_errors: true,\n xhrHeaders: {},\n xhrWithCredentials: false,\n responseHandler: async function (response: Response): Promise {\n if (typeof response !== \"undefined\") {\n const httpResult = JSON.parse(await response.text());\n if (\n httpResult === null ||\n !{}.hasOwnProperty.call(httpResult, \"result\")\n ) {\n if (response.status === 200) {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n }\n } else {\n return {\n result: httpResult.result,\n errorCode: httpResult.errorCode\n ? httpResult.errorCode\n : httpResult.result === APIConstants.global.SCORM_TRUE\n ? 0\n : 101,\n };\n }\n }\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n },\n requestHandler: function (commitObject) {\n return commitObject;\n },\n onLogMessage: function (messageLevel, logMessage) {\n switch (messageLevel) {\n case APIConstants.global.LOG_LEVEL_ERROR:\n console.error(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_WARNING:\n console.warn(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_INFO:\n console.info(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_DEBUG:\n if (console.debug) {\n console.debug(logMessage);\n } else {\n console.log(logMessage);\n }\n break;\n }\n },\n scoItemIds: [],\n scoItemIdValidator: false,\n};\n","import BaseAPI from \"../BaseAPI\";\n\n/**\n * Private class that wraps a timeout call to the commit() function\n */\nexport class ScheduledCommit {\n private _API;\n private _cancelled = false;\n private readonly _timeout;\n private readonly _callback;\n\n /**\n * Constructor for ScheduledCommit\n * @param {BaseAPI} API\n * @param {number} when\n * @param {string} callback\n */\n constructor(API: BaseAPI, when: number, callback: string) {\n this._API = API;\n this._timeout = setTimeout(this.wrapper.bind(this), when);\n this._callback = callback;\n }\n\n /**\n * Cancel any currently scheduled commit\n */\n cancel() {\n this._cancelled = true;\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n }\n\n /**\n * Wrap the API commit call to check if the call has already been cancelled\n */\n wrapper() {\n if (!this._cancelled) {\n (async () => await this._API.commit(this._callback))();\n }\n }\n}\n","import { CMIArray } from \"./cmi/common/array\";\nimport { ValidationError } from \"./exceptions\";\nimport ErrorCodes, { ErrorCode } from \"./constants/error_codes\";\nimport APIConstants from \"./constants/api_constants\";\nimport { formatMessage, stringMatches, unflatten } from \"./utilities\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { debounce } from \"./utilities/debounce\";\nimport {\n RefObject,\n CommitObject,\n ResultObject,\n Settings,\n} from \"./types/api_types\";\nimport { DefaultSettings } from \"./constants/default_settings\";\nimport { IBaseAPI } from \"./interfaces/IBaseAPI\";\nimport { ScheduledCommit } from \"./helpers/scheduled_commit\";\n\n/**\n * Base API class for AICC, SCORM 1.2, and SCORM 2004. Should be considered\n * abstract, and never initialized on its own.\n */\nexport default abstract class BaseAPI implements IBaseAPI {\n private _timeout?: ScheduledCommit;\n private readonly _error_codes: ErrorCode;\n private _settings: Settings = DefaultSettings;\n\n /**\n * Constructor for Base API class. Sets some shared API fields, as well as\n * sets up options for the API.\n * @param {ErrorCode} error_codes\n * @param {Settings} settings\n */\n protected constructor(error_codes: ErrorCode, settings?: Settings) {\n if (new.target === BaseAPI) {\n throw new TypeError(\"Cannot construct BaseAPI instances directly\");\n }\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n\n this._error_codes = error_codes;\n\n if (settings) {\n this.settings = settings;\n }\n this.apiLogLevel = this.settings.logLevel;\n this.selfReportSessionTime = this.settings.selfReportSessionTime;\n }\n\n public abstract cmi: BaseCMI;\n public startingData?: RefObject;\n\n public currentState: number;\n public lastErrorCode: string;\n public listenerArray: any[];\n public apiLogLevel: number;\n public selfReportSessionTime: boolean;\n\n abstract reset(settings?: Settings): void;\n\n /**\n * Common reset method for all APIs. New settings are merged with the existing settings.\n * @param {Settings} settings\n * @protected\n */\n commonReset(settings?: Settings): void {\n this.settings = { ...this.settings, ...settings };\n\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n }\n\n /**\n * Initialize the API\n * @param {string} callbackName\n * @param {string} initializeMessage\n * @param {string} terminationMessage\n * @return {string}\n */\n initialize(\n callbackName: string,\n initializeMessage?: string,\n terminationMessage?: string,\n ): string {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);\n } else if (this.isTerminated()) {\n this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage);\n } else {\n if (this.selfReportSessionTime) {\n this.cmi.setStartTime();\n }\n\n this.currentState = APIConstants.global.STATE_INITIALIZED;\n this.lastErrorCode = \"0\";\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n abstract lmsInitialize(): string;\n\n abstract lmsFinish(): string;\n\n abstract lmsGetValue(CMIElement: string): string;\n\n abstract lmsSetValue(CMIElement: string, value: any): string;\n\n abstract lmsCommit(): string;\n\n abstract lmsGetLastError(): string;\n\n abstract lmsGetErrorString(CMIErrorCode: string | number): string;\n\n abstract lmsGetDiagnostic(CMIErrorCode: string | number): string;\n\n /**\n * Abstract method for validating that a response is correct.\n *\n * @param {string} _CMIElement\n * @param {any} _value\n */\n abstract validateCorrectResponse(_CMIElement: string, _value: any): void;\n\n /**\n * Gets or builds a new child element to add to the array.\n * APIs that inherit BaseAPI should override this method.\n *\n * @param {string} _CMIElement - unused\n * @param {*} _value - unused\n * @param {boolean} _foundFirstIndex - unused\n * @return {BaseCMI|null}\n * @abstract\n */\n abstract getChildElement(\n _CMIElement: string,\n _value: any,\n _foundFirstIndex: boolean,\n ): BaseCMI | null;\n\n /**\n * Attempts to store the data to the LMS, logs data if no LMS configured\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _calculateTotalTime\n * @return {ResultObject}\n * @abstract\n */\n abstract storeData(_calculateTotalTime: boolean): Promise;\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _terminateCommit\n * @return {RefObject|Array}\n * @abstract\n */\n abstract renderCommitCMI(_terminateCommit: boolean): RefObject | Array;\n\n /**\n * Render the commit object to the shortened format for LMS commit\n * @param {boolean} _terminateCommit\n * @return {CommitObject}\n */\n abstract renderCommitObject(_terminateCommit: boolean): CommitObject;\n\n /**\n * Logging for all SCORM actions\n *\n * @param {string} functionName\n * @param {string} logMessage\n * @param {number} messageLevel\n * @param {string} CMIElement\n */\n apiLog(\n functionName: string,\n logMessage: string,\n messageLevel: number,\n CMIElement?: string,\n ) {\n logMessage = formatMessage(functionName, logMessage, CMIElement);\n\n if (messageLevel >= this.apiLogLevel) {\n this.settings.onLogMessage(messageLevel, logMessage);\n }\n }\n\n /**\n * Getter for _error_codes\n * @return {ErrorCode}\n */\n get error_codes(): ErrorCode {\n return this._error_codes;\n }\n\n /**\n * Getter for _settings\n * @return {Settings}\n */\n get settings(): Settings {\n return this._settings;\n }\n\n /**\n * Setter for _settings\n * @param {Settings} settings\n */\n set settings(settings: Settings) {\n this._settings = { ...this._settings, ...settings };\n }\n\n /**\n * Terminates the current run of the API\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async terminate(\n callbackName: string,\n checkTerminated: boolean,\n ): Promise {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.TERMINATION_BEFORE_INIT,\n this._error_codes.MULTIPLE_TERMINATION,\n )\n ) {\n this.currentState = APIConstants.global.STATE_TERMINATED;\n\n const result: ResultObject = await this.storeData(true);\n if (typeof result.errorCode !== \"undefined\" && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Get the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @return {string}\n */\n getValue(\n callbackName: string,\n checkTerminated: boolean,\n CMIElement: string,\n ): string {\n let returnValue: string = \"\";\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.RETRIEVE_BEFORE_INIT,\n this._error_codes.RETRIEVE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.getCMIValue(CMIElement);\n } catch (e) {\n returnValue = this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement);\n }\n\n this.apiLog(\n callbackName,\n \": returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n\n if (returnValue === undefined) {\n return \"\";\n }\n\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Sets the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {string} commitCallback\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setValue(\n callbackName: string,\n commitCallback: string,\n checkTerminated: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (value !== undefined) {\n value = String(value);\n }\n let returnValue: string = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.STORE_BEFORE_INIT,\n this._error_codes.STORE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.setCMIValue(CMIElement, value);\n } catch (e) {\n this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement, value);\n }\n\n if (returnValue === undefined) {\n returnValue = APIConstants.global.SCORM_FALSE;\n }\n\n // If we didn't have any errors while setting the data, go ahead and\n // schedule a commit, if autocommit is turned on\n if (String(this.lastErrorCode) === \"0\") {\n if (this.settings.autocommit && !this._timeout) {\n this.scheduleCommit(\n this.settings.autocommitSeconds * 1000,\n commitCallback,\n );\n }\n }\n\n this.apiLog(\n callbackName,\n \": \" + value + \": result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Orders LMS to store all content parameters\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async commit(\n callbackName: string,\n checkTerminated: boolean = false,\n ): Promise {\n this.clearScheduledCommit();\n\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.COMMIT_BEFORE_INIT,\n this._error_codes.COMMIT_AFTER_TERM,\n )\n ) {\n const result = await this.storeData(false);\n if (result.errorCode && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n this.apiLog(\n callbackName,\n \" Result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"HttpRequest\",\n );\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Returns last error code\n * @param {string} callbackName\n * @return {string}\n */\n getLastError(callbackName: string): string {\n const returnValue = String(this.lastErrorCode);\n\n this.processListeners(callbackName);\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getErrorString(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getDiagnostic(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Checks the LMS state and ensures it has been initialized.\n *\n * @param {boolean} checkTerminated\n * @param {number} beforeInitError\n * @param {number} afterTermError\n * @return {boolean}\n */\n checkState(\n checkTerminated: boolean,\n beforeInitError: number,\n afterTermError: number,\n ): boolean {\n if (this.isNotInitialized()) {\n this.throwSCORMError(beforeInitError);\n return false;\n } else if (checkTerminated && this.isTerminated()) {\n this.throwSCORMError(afterTermError);\n return false;\n }\n\n return true;\n }\n\n /**\n * Returns the message that corresponds to errorNumber\n * APIs that inherit BaseAPI should override this function\n *\n * @param {(string|number)} _errorNumber\n * @param {boolean} _detail\n * @return {string}\n * @abstract\n */\n getLmsErrorMessageDetails(\n _errorNumber: string | number,\n _detail: boolean = false,\n ): string {\n throw new Error(\n \"The getLmsErrorMessageDetails method has not been implemented\",\n );\n }\n\n /**\n * Gets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @return {string}\n * @abstract\n */\n getCMIValue(_CMIElement: string): string {\n throw new Error(\"The getCMIValue method has not been implemented\");\n }\n\n /**\n * Sets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @param {any} _value\n * @return {string}\n * @abstract\n */\n setCMIValue(_CMIElement: string, _value: any): string {\n throw new Error(\"The setCMIValue method has not been implemented\");\n }\n\n /**\n * Shared API method to set a valid for a given element.\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n _commonSetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (!CMIElement || CMIElement === \"\") {\n return APIConstants.global.SCORM_FALSE;\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let returnValue = APIConstants.global.SCORM_FALSE;\n let foundFirstIndex = false;\n\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n const attribute = structure[idx];\n\n if (idx === structure.length - 1) {\n if (scorm2004 && attribute.substring(0, 8) === \"{target=\") {\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);\n } else {\n refObject = {\n ...refObject,\n attribute: value,\n };\n }\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (\n stringMatches(CMIElement, \"\\\\.correct_responses\\\\.\\\\d+\") &&\n this.isInitialized()\n ) {\n this.validateCorrectResponse(CMIElement, value);\n }\n\n if (!scorm2004 || this.lastErrorCode === \"0\") {\n refObject[attribute] = value;\n returnValue = APIConstants.global.SCORM_TRUE;\n }\n }\n } else {\n refObject = refObject[attribute];\n if (!refObject) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n foundFirstIndex = true;\n } else {\n const newChild = this.getChildElement(\n CMIElement,\n value,\n foundFirstIndex,\n );\n foundFirstIndex = true;\n\n if (!newChild) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (refObject.initialized) newChild.initialize();\n\n refObject.childArray.push(newChild);\n refObject = newChild;\n }\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n }\n\n if (returnValue === APIConstants.global.SCORM_FALSE) {\n this.apiLog(\n methodName,\n `There was an error setting the value for: ${CMIElement}, value of: ${value}`,\n APIConstants.global.LOG_LEVEL_WARNING,\n );\n }\n\n return returnValue;\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @return {any}\n */\n _commonGetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n ): any {\n if (!CMIElement || CMIElement === \"\") {\n return \"\";\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let attribute = null;\n\n const uninitializedErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) has not been initialized.`;\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n attribute = structure[idx];\n\n if (!scorm2004) {\n if (idx === structure.length - 1) {\n if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n } else {\n if (\n String(attribute).substring(0, 8) === \"{target=\" &&\n typeof refObject._isTargetValid == \"function\"\n ) {\n const target = String(attribute).substring(\n 8,\n String(attribute).length - 9,\n );\n return refObject._isTargetValid(target);\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n\n refObject = refObject[attribute];\n if (refObject === undefined) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n } else {\n this.throwSCORMError(\n this._error_codes.VALUE_NOT_INITIALIZED,\n uninitializedErrorMessage,\n );\n break;\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n\n if (refObject === null || refObject === undefined) {\n if (!scorm2004) {\n if (attribute === \"_children\") {\n this.throwSCORMError(ErrorCodes.scorm12.CHILDREN_ERROR);\n } else if (attribute === \"_count\") {\n this.throwSCORMError(ErrorCodes.scorm12.COUNT_ERROR);\n }\n }\n } else {\n return refObject;\n }\n }\n\n /**\n * Returns true if the API's current state is STATE_INITIALIZED\n *\n * @return {boolean}\n */\n isInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_NOT_INITIALIZED\n *\n * @return {boolean}\n */\n isNotInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_NOT_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_TERMINATED\n *\n * @return {boolean}\n */\n isTerminated(): boolean {\n return this.currentState === APIConstants.global.STATE_TERMINATED;\n }\n\n /**\n * Provides a mechanism for attaching to a specific SCORM event\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n on(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray.push({\n functionName: functionName,\n CMIElement: CMIElement,\n callback: callback,\n });\n\n this.apiLog(\n \"on\",\n `Added event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n\n /**\n * Provides a mechanism for detaching a specific SCORM event listener\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n off(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n const removeIndex = this.listenerArray.findIndex(\n (obj) =>\n obj.functionName === functionName &&\n obj.CMIElement === CMIElement &&\n obj.callback === callback,\n );\n if (removeIndex !== -1) {\n this.listenerArray.splice(removeIndex, 1);\n this.apiLog(\n \"off\",\n `Removed event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n }\n\n /**\n * Provides a mechanism for clearing all listeners from a specific SCORM event\n *\n * @param {string} listenerName\n */\n clear(listenerName: string) {\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray = this.listenerArray.filter(\n (obj) =>\n obj.functionName !== functionName && obj.CMIElement !== CMIElement,\n );\n }\n }\n\n /**\n * Processes any 'on' listeners that have been created\n *\n * @param {string} functionName\n * @param {string} CMIElement\n * @param {any} value\n */\n processListeners(functionName: string, CMIElement?: string, value?: any) {\n this.apiLog(\n functionName,\n value,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n for (let i = 0; i < this.listenerArray.length; i++) {\n const listener = this.listenerArray[i];\n const functionsMatch = listener.functionName === functionName;\n const listenerHasCMIElement = !!listener.CMIElement;\n let CMIElementsMatch = false;\n if (\n CMIElement &&\n listener.CMIElement &&\n listener.CMIElement.substring(listener.CMIElement.length - 1) === \"*\"\n ) {\n CMIElementsMatch =\n CMIElement.indexOf(\n listener.CMIElement.substring(0, listener.CMIElement.length - 1),\n ) === 0;\n } else {\n CMIElementsMatch = listener.CMIElement === CMIElement;\n }\n\n if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {\n this.apiLog(\n \"processListeners\",\n `Processing listener: ${listener.functionName}`,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n listener.callback(CMIElement, value);\n }\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} errorNumber\n * @param {string} message\n */\n throwSCORMError(errorNumber: number, message?: string) {\n if (!message) {\n message = this.getLmsErrorMessageDetails(errorNumber);\n }\n\n this.apiLog(\n \"throwSCORMError\",\n errorNumber + \": \" + message,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n\n this.lastErrorCode = String(errorNumber);\n }\n\n /**\n * Clears the last SCORM error code on success.\n *\n * @param {string} success\n */\n clearSCORMError(success: string) {\n if (success !== undefined && success !== APIConstants.global.SCORM_FALSE) {\n this.lastErrorCode = \"0\";\n }\n }\n\n /**\n * Load the CMI from a flattened JSON object\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromFlattenedJSON(json: RefObject, CMIElement?: string) {\n if (!CMIElement) {\n // by default, we start from a blank string because we're expecting each element to start with `cmi`\n CMIElement = \"\";\n }\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromFlattenedJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n /**\n * Tests two strings against a given regular expression pattern and determines a numeric or null result based on the matching criterion.\n *\n * @param {string} a - The first string to be tested against the pattern.\n * @param {string} c - The second string to be tested against the pattern.\n * @param {RegExp} a_pattern - The regular expression pattern to test the strings against.\n * @return {number | null} A numeric result based on the matching criterion, or null if the strings do not match the pattern.\n */\n function testPattern(\n a: string,\n c: string,\n a_pattern: RegExp,\n ): number | null {\n const a_match = a.match(a_pattern);\n\n let c_match;\n if (a_match !== null && (c_match = c.match(a_pattern)) !== null) {\n const a_num = Number(a_match[2]);\n const c_num = Number(c_match[2]);\n if (a_num === c_num) {\n if (a_match[3] === \"id\") {\n return -1;\n } else if (a_match[3] === \"type\") {\n if (c_match[3] === \"id\") {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 1;\n }\n }\n return a_num - c_num;\n }\n\n return null;\n }\n\n const int_pattern = /^(cmi\\.interactions\\.)(\\d+)\\.(.*)$/;\n const obj_pattern = /^(cmi\\.objectives\\.)(\\d+)\\.(.*)$/;\n\n const result = Object.keys(json).map(function (key) {\n return [String(key), json[key]];\n });\n\n // CMI interactions need to have id and type loaded before any other fields\n result.sort(function ([a, _b], [c, _d]) {\n let test;\n if ((test = testPattern(a, c, int_pattern)) !== null) {\n return test;\n }\n if ((test = testPattern(a, c, obj_pattern)) !== null) {\n return test;\n }\n\n if (a < c) {\n return -1;\n }\n if (a > c) {\n return 1;\n }\n return 0;\n });\n\n let obj: RefObject;\n result.forEach((element) => {\n obj = {};\n obj[element[0]] = element[1];\n this.loadFromJSON(unflatten(obj), CMIElement);\n });\n }\n\n /**\n * Loads CMI data from a JSON object.\n *\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromJSON(json: RefObject, CMIElement: string) {\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n CMIElement = CMIElement !== undefined ? CMIElement : \"cmi\";\n\n this.startingData = json;\n\n // could this be refactored down to flatten(json) then setCMIValue on each?\n for (const key in json) {\n if ({}.hasOwnProperty.call(json, key) && json[key]) {\n const currentCMIElement = (CMIElement ? CMIElement + \".\" : \"\") + key;\n const value = json[key];\n\n if (value[\"childArray\"]) {\n for (let i = 0; i < value[\"childArray\"].length; i++) {\n this.loadFromJSON(\n value[\"childArray\"][i],\n currentCMIElement + \".\" + i,\n );\n }\n } else if (value.constructor === Object) {\n this.loadFromJSON(value, currentCMIElement);\n } else {\n this.setCMIValue(currentCMIElement, value);\n }\n }\n }\n }\n\n /**\n * Render the CMI object to JSON for sending to an LMS.\n *\n * @return {string}\n */\n renderCMIToJSONString(): string {\n const cmi = this.cmi;\n // Do we want/need to return fields that have no set value?\n if (this.settings.sendFullCommit) {\n return JSON.stringify({ cmi });\n }\n return JSON.stringify({ cmi }, (k, v) => (v === undefined ? null : v), 2);\n }\n\n /**\n * Returns a JS object representing the current cmi\n * @return {object}\n */\n renderCMIToJSONObject(): object {\n return JSON.parse(this.renderCMIToJSONString());\n }\n\n /**\n * Send the request to the LMS\n * @param {string} url\n * @param {CommitObject|RefObject|Array} params\n * @param {boolean} immediate\n * @return {ResultObject}\n */\n async processHttpRequest(\n url: string,\n params: CommitObject | RefObject | Array,\n immediate: boolean = false,\n ): Promise {\n const api = this;\n const genericError: ResultObject = {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: this.error_codes.GENERAL,\n };\n\n // if we are terminating the module or closing the browser window/tab, we need to make this fetch ASAP.\n // Some browsers, especially Chrome, do not like synchronous requests to be made when the window is closing.\n if (immediate) {\n this.performFetch(url, params).then(async (response) => {\n await this.transformResponse(response);\n });\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n\n const process = async (\n url: string,\n params: CommitObject | RefObject | Array,\n settings: Settings,\n ): Promise => {\n try {\n params = settings.requestHandler(params);\n const response = await this.performFetch(url, params);\n\n return this.transformResponse(response);\n } catch (e) {\n this.apiLog(\n \"processHttpRequest\",\n e,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n api.processListeners(\"CommitError\");\n return genericError;\n }\n };\n\n if (this.settings.asyncCommit) {\n const debouncedProcess = debounce(process, 500, immediate);\n debouncedProcess(url, params, this.settings);\n\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return await process(url, params, this.settings);\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} when - the number of milliseconds to wait before committing\n * @param {string} callback - the name of the commit event callback\n */\n scheduleCommit(when: number, callback: string) {\n this._timeout = new ScheduledCommit(this, when, callback);\n this.apiLog(\n \"scheduleCommit\",\n \"scheduled\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n\n /**\n * Clears and cancels any currently scheduled commits\n */\n clearScheduledCommit() {\n if (this._timeout) {\n this._timeout.cancel();\n this._timeout = undefined;\n this.apiLog(\n \"clearScheduledCommit\",\n \"cleared\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n }\n\n /**\n * Check to see if the specific object has the given property\n * @param {RefObject} refObject\n * @param {string} attribute\n * @return {boolean}\n * @private\n */\n private _checkObjectHasProperty(\n refObject: RefObject,\n attribute: string,\n ): boolean {\n return (\n Object.hasOwnProperty.call(refObject, attribute) ||\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(refObject),\n attribute,\n ) != null ||\n attribute in refObject\n );\n }\n\n /**\n * Handles the error that occurs when trying to access a value\n * @param {any} e\n * @param {string} returnValue\n * @return {string}\n * @private\n */\n private handleValueAccessException(e: any, returnValue: string): string {\n if (e instanceof ValidationError) {\n this.lastErrorCode = String(e.errorCode);\n returnValue = APIConstants.global.SCORM_FALSE;\n } else {\n if (e instanceof Error && e.message) {\n console.error(e.message);\n } else {\n console.error(e);\n }\n this.throwSCORMError(this._error_codes.GENERAL);\n }\n return returnValue;\n }\n\n /**\n * Perform the fetch request to the LMS\n * @param {string} url\n * @param {RefObject|Array} params\n * @return {Promise}\n * @private\n */\n private async performFetch(\n url: string,\n params: RefObject | Array,\n ): Promise {\n return fetch(url, {\n method: \"POST\",\n body: params instanceof Array ? params.join(\"&\") : JSON.stringify(params),\n headers: {\n ...this.settings.xhrHeaders,\n \"Content-Type\": this.settings.commitRequestDataType,\n },\n credentials: this.settings.xhrWithCredentials ? \"include\" : undefined,\n keepalive: true,\n });\n }\n\n /**\n * Transforms the response from the LMS to a ResultObject\n * @param {Response} response\n * @return {Promise}\n * @private\n */\n private async transformResponse(response: Response): Promise {\n const result =\n typeof this.settings.responseHandler === \"function\"\n ? await this.settings.responseHandler(response)\n : await response.json();\n\n if (\n response.status >= 200 &&\n response.status <= 299 &&\n (result.result === true ||\n result.result === APIConstants.global.SCORM_TRUE)\n ) {\n this.processListeners(\"CommitSuccess\");\n } else {\n this.processListeners(\"CommitError\");\n }\n return result;\n }\n}\n","/**\n * Debounce function to delay the execution of a given function.\n *\n * @param func - The function to debounce.\n * @param wait - The number of milliseconds to delay.\n * @param immediate - If `true`, the function will be triggered on the leading edge instead of the trailing.\n * @returns A debounced version of the provided function.\n */\nexport function debounce void>(\n func: T,\n wait: number,\n immediate = false,\n): (...args: Parameters) => void {\n let timeout: ReturnType | null;\n\n return function (this: any, ...args: Parameters) {\n const context = this;\n\n const later = () => {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n const callNow = immediate && !timeout;\n\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) func.apply(context, args);\n };\n}\n","import { BaseCMI } from \"./base_cmi\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.n objects\n */\nexport class CMIArray extends BaseCMI {\n private readonly _errorCode: number;\n private readonly _errorClass: typeof BaseScormValidationError;\n private readonly __children: string;\n childArray: any[];\n\n /**\n * Constructor cmi *.n arrays\n * @param {object} params\n */\n constructor(params: {\n children: string;\n errorCode?: number;\n errorClass?: typeof BaseScormValidationError;\n }) {\n super();\n this.__children = params.children;\n this._errorCode = params.errorCode || scorm12_error_codes.GENERAL;\n this._errorClass = params.errorClass || BaseScormValidationError;\n this.childArray = [];\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * Getter for _count\n * @return {number}\n */\n get _count(): number {\n return this.childArray.length;\n }\n\n /**\n * Setter for _count. Just throws an error.\n * @param {number} _count\n */\n set _count(_count: number) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * toJSON for *.n arrays\n * @return {object}\n */\n toJSON(): object {\n this.jsonString = true;\n const result: { [key: string]: any } = {};\n for (let i = 0; i < this.childArray.length; i++) {\n result[i + \"\"] = this.childArray[i];\n }\n delete this.jsonString;\n return result;\n }\n}\n","/**\n * Base class for API cmi objects\n */\nexport abstract class BaseCMI {\n jsonString? = false;\n private _initialized = false;\n private _start_time: number | undefined;\n\n /**\n * Getter for _initialized\n * @return {boolean}\n */\n get initialized(): boolean {\n return this._initialized;\n }\n\n /**\n * Getter for _start_time\n * @return {number | undefined}\n */\n get start_time(): number | undefined {\n return this._start_time;\n }\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize(): void {\n this._initialized = true;\n }\n\n /**\n * Called when the player should override the 'session_time' provided by\n * the module\n */\n setStartTime(): void {\n this._start_time = new Date().getTime();\n }\n}\n\n/**\n * Base class for cmi root objects\n */\nexport abstract class BaseRootCMI extends BaseCMI {\n abstract getCurrentTotalTime(): string;\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport { BaseCMI } from \"./base_cmi\";\nimport { checkValidFormat, checkValidRange } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nconst scorm12_constants = APIConstants.scorm12;\nconst scorm12_regex = Regex.scorm12;\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.score objects\n */\nexport class CMIScore extends BaseCMI {\n private readonly __children: string;\n private readonly __score_range: string | false;\n private readonly __invalid_error_code: number;\n private readonly __invalid_type_code: number;\n private readonly __invalid_range_code: number;\n private readonly __decimal_regex: string;\n private readonly __error_class: typeof BaseScormValidationError;\n private _raw = \"\";\n private _min = \"\";\n private _max: string;\n\n /**\n * Constructor for *.score\n * @param {\n * score_children: string,\n * score_range: string,\n * max: string,\n * invalidErrorCode: number,\n * invalidTypeCode: number,\n * invalidRangeCode: number,\n * decimalRegex: string,\n * errorClass: typeof BaseScormValidationError\n * } params\n */\n constructor(params: {\n score_children?: string;\n score_range?: string;\n max?: string;\n invalidErrorCode?: number;\n invalidTypeCode?: number;\n invalidRangeCode?: number;\n decimalRegex?: string;\n errorClass: typeof BaseScormValidationError;\n }) {\n super();\n\n this.__children = params.score_children || scorm12_constants.score_children;\n this.__score_range = !params.score_range\n ? false\n : scorm12_regex.score_range;\n this._max = params.max || params.max === \"\" ? params.max : \"100\";\n this.__invalid_error_code =\n params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE;\n this.__invalid_type_code =\n params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH;\n this.__invalid_range_code =\n params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE;\n this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;\n this.__error_class = params.errorClass;\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this.__error_class(this.__invalid_error_code);\n }\n\n /**\n * Getter for _raw\n * @return {string}\n */\n get raw(): string {\n return this._raw;\n }\n\n /**\n * Setter for _raw\n * @param {string} raw\n */\n set raw(raw: string) {\n if (\n checkValidFormat(\n raw,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n raw,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._raw = raw;\n }\n }\n\n /**\n * Getter for _min\n * @return {string}\n */\n get min(): string {\n return this._min;\n }\n\n /**\n * Setter for _min\n * @param {string} min\n */\n set min(min: string) {\n if (\n checkValidFormat(\n min,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n min,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._min = min;\n }\n }\n\n /**\n * Getter for _max\n * @return {string}\n */\n get max(): string {\n return this._max;\n }\n\n /**\n * Setter for _max\n * @param {string} max\n */\n set max(max: string) {\n if (\n checkValidFormat(\n max,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n max,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._max = max;\n }\n }\n\n /**\n * toJSON for *.score\n * @return {\n * {\n * min: string,\n * max: string,\n * raw: string\n * }\n * }\n */\n toJSON(): {\n min: string;\n max: string;\n raw: string;\n } {\n this.jsonString = true;\n const result = {\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseScormValidationError } from \"../../exceptions\";\n\n/**\n * Check if the value matches the proper format. If not, throw proper error code.\n *\n * @param {string} value\n * @param {string} regexPattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @param {boolean} [allowEmptyString]\n * @return {boolean}\n */\nexport function checkValidFormat(\n value: string,\n regexPattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n allowEmptyString?: boolean,\n): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n const formatRegex = new RegExp(regexPattern);\n const matches = value.match(formatRegex);\n if (allowEmptyString && value === \"\") {\n return true;\n }\n if (value === undefined || !matches || matches[0] === \"\") {\n throw new errorClass(errorCode);\n }\n return true;\n}\n\n/**\n * Check if the value matches the proper range. If not, throw proper error code.\n *\n * @param {any} value\n * @param {string} rangePattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @return {boolean}\n */\nexport function checkValidRange(\n value: any,\n rangePattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n): boolean {\n const ranges = rangePattern.split(\"#\");\n value = value * 1.0;\n if (value >= ranges[0]) {\n if (ranges[1] === \"*\" || value <= ranges[1]) {\n return true;\n } else {\n throw new errorClass(errorCode);\n }\n } else {\n throw new errorClass(errorCode);\n }\n}\n","interface ErrorDescription {\n basicMessage: string;\n detailMessage: string;\n}\n\ninterface ErrorDescriptions {\n [key: string]: ErrorDescription;\n}\n\ninterface ScormConstants {\n cmi_children: string;\n core_children: string;\n score_children: string;\n comments_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface AiccConstants extends ScormConstants {\n student_demographics_children: string;\n tries_children: string;\n attempt_records_children: string;\n paths_children: string;\n}\n\ninterface Scorm2004Constants {\n cmi_children: string;\n comments_children: string;\n score_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface GlobalConstants {\n SCORM_TRUE: string;\n SCORM_FALSE: string;\n STATE_NOT_INITIALIZED: number;\n STATE_INITIALIZED: number;\n STATE_TERMINATED: number;\n LOG_LEVEL_DEBUG: number;\n LOG_LEVEL_INFO: number;\n LOG_LEVEL_WARNING: number;\n LOG_LEVEL_ERROR: number;\n LOG_LEVEL_NONE: number;\n}\n\ninterface APIConstants {\n global: GlobalConstants;\n scorm12: ScormConstants;\n aicc: AiccConstants;\n scorm2004: Scorm2004Constants;\n}\n\nconst global: GlobalConstants = {\n SCORM_TRUE: \"true\",\n SCORM_FALSE: \"false\",\n STATE_NOT_INITIALIZED: 0,\n STATE_INITIALIZED: 1,\n STATE_TERMINATED: 2,\n LOG_LEVEL_DEBUG: 1,\n LOG_LEVEL_INFO: 2,\n LOG_LEVEL_WARNING: 3,\n LOG_LEVEL_ERROR: 4,\n LOG_LEVEL_NONE: 5,\n};\n\nconst scorm12: ScormConstants = {\n // Children lists\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions\",\n core_children:\n \"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time\",\n score_children: \"raw,min,max\",\n comments_children: \"content,location,time\",\n objectives_children: \"id,score,status\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children: \"audio,language,speed,text\",\n interactions_children:\n \"id,objectives,time,type,correct_responses,weighting,student_response,result,latency\",\n error_descriptions: {\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information\",\n },\n \"201\": {\n basicMessage: \"Invalid argument error\",\n detailMessage:\n \"Indicates that an argument represents an invalid data model element or is otherwise incorrect.\",\n },\n \"202\": {\n basicMessage: \"Element cannot have children\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_children\" for a data model element that does not support the \"_children\" suffix.',\n },\n \"203\": {\n basicMessage: \"Element not an array - cannot have count\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_count\" for a data model element that does not support the \"_count\" suffix.',\n },\n \"301\": {\n basicMessage: \"Not initialized\",\n detailMessage:\n \"Indicates that an API call was made before the call to lmsInitialize.\",\n },\n \"401\": {\n basicMessage: \"Not implemented error\",\n detailMessage:\n \"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.\",\n },\n \"402\": {\n basicMessage: \"Invalid set value, element is a keyword\",\n detailMessage:\n 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in \"_children\" and \"_count\").',\n },\n \"403\": {\n basicMessage: \"Element is read only\",\n detailMessage:\n \"LMSSetValue was called with a data model element that can only be read.\",\n },\n \"404\": {\n basicMessage: \"Element is write only\",\n detailMessage:\n \"LMSGetValue was called on a data model element that can only be written to.\",\n },\n \"405\": {\n basicMessage: \"Incorrect Data Type\",\n detailMessage:\n \"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst aicc: AiccConstants = {\n ...scorm12,\n ...{\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation\",\n student_preference_children:\n \"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows\",\n student_data_children:\n \"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action\",\n student_demographics_children:\n \"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience\",\n tries_children: \"time,status,score\",\n attempt_records_children: \"score,lesson_status\",\n paths_children: \"location_id,date,time,status,why_left,time_in_element\",\n },\n};\nconst scorm2004: Scorm2004Constants = {\n // Children lists\n cmi_children:\n \"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time\",\n comments_children: \"comment,timestamp,location\",\n score_children: \"max,raw,scaled,min\",\n objectives_children:\n \"progress_measure,completion_status,success_status,description,score,id\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children:\n \"audio_level,audio_captioning,delivery_speed,language\",\n interactions_children:\n \"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description\",\n error_descriptions: {\n \"0\": {\n basicMessage: \"No Error\",\n detailMessage: \"No error occurred, the previous API call was successful.\",\n },\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use GetDiagnostic for more information.\",\n },\n \"102\": {\n basicMessage: \"General Initialization Failure\",\n detailMessage: \"Call to Initialize failed for an unknown reason.\",\n },\n \"103\": {\n basicMessage: \"Already Initialized\",\n detailMessage:\n \"Call to Initialize failed because Initialize was already called.\",\n },\n \"104\": {\n basicMessage: \"Content Instance Terminated\",\n detailMessage:\n \"Call to Initialize failed because Terminate was already called.\",\n },\n \"111\": {\n basicMessage: \"General Termination Failure\",\n detailMessage: \"Call to Terminate failed for an unknown reason.\",\n },\n \"112\": {\n basicMessage: \"Termination Before Initialization\",\n detailMessage:\n \"Call to Terminate failed because it was made before the call to Initialize.\",\n },\n \"113\": {\n basicMessage: \"Termination After Termination\",\n detailMessage:\n \"Call to Terminate failed because Terminate was already called.\",\n },\n \"122\": {\n basicMessage: \"Retrieve Data Before Initialization\",\n detailMessage:\n \"Call to GetValue failed because it was made before the call to Initialize.\",\n },\n \"123\": {\n basicMessage: \"Retrieve Data After Termination\",\n detailMessage:\n \"Call to GetValue failed because it was made after the call to Terminate.\",\n },\n \"132\": {\n basicMessage: \"Store Data Before Initialization\",\n detailMessage:\n \"Call to SetValue failed because it was made before the call to Initialize.\",\n },\n \"133\": {\n basicMessage: \"Store Data After Termination\",\n detailMessage:\n \"Call to SetValue failed because it was made after the call to Terminate.\",\n },\n \"142\": {\n basicMessage: \"Commit Before Initialization\",\n detailMessage:\n \"Call to Commit failed because it was made before the call to Initialize.\",\n },\n \"143\": {\n basicMessage: \"Commit After Termination\",\n detailMessage:\n \"Call to Commit failed because it was made after the call to Terminate.\",\n },\n \"201\": {\n basicMessage: \"General Argument Error\",\n detailMessage:\n \"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.\",\n },\n \"301\": {\n basicMessage: \"General Get Failure\",\n detailMessage:\n \"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"351\": {\n basicMessage: \"General Set Failure\",\n detailMessage:\n \"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"391\": {\n basicMessage: \"General Commit Failure\",\n detailMessage:\n \"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"401\": {\n basicMessage: \"Undefined Data Model Element\",\n detailMessage:\n \"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.\",\n },\n \"402\": {\n basicMessage: \"Unimplemented Data Model Element\",\n detailMessage:\n \"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.\",\n },\n \"403\": {\n basicMessage: \"Data Model Element Value Not Initialized\",\n detailMessage:\n \"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.\",\n },\n \"404\": {\n basicMessage: \"Data Model Element Is Read Only\",\n detailMessage:\n \"SetValue was called with a data model element that can only be read.\",\n },\n \"405\": {\n basicMessage: \"Data Model Element Is Write Only\",\n detailMessage:\n \"GetValue was called on a data model element that can only be written to.\",\n },\n \"406\": {\n basicMessage: \"Data Model Element Type Mismatch\",\n detailMessage:\n \"SetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Data Model Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst APIConstants: APIConstants = {\n global: global,\n scorm12: scorm12,\n aicc: aicc,\n scorm2004: scorm2004,\n};\nexport default APIConstants;\n","export enum NAVBoolean {\n unknown = \"unknown\",\n true = \"true\",\n false = \"false\",\n}\n\nexport enum SuccessStatus {\n passed = \"passed\",\n failed = \"failed\",\n unknown = \"unknown\",\n}\n\nexport enum CompletionStatus {\n completed = \"completed\",\n incomplete = \"incomplete\",\n unknown = \"unknown\",\n}\n","export type ErrorCode = {\n [key: string]: number;\n};\n\nconst global: ErrorCode = {\n GENERAL: 101,\n INITIALIZATION_FAILED: 101,\n INITIALIZED: 101,\n TERMINATED: 101,\n TERMINATION_FAILURE: 101,\n TERMINATION_BEFORE_INIT: 101,\n MULTIPLE_TERMINATION: 101,\n RETRIEVE_BEFORE_INIT: 101,\n RETRIEVE_AFTER_TERM: 101,\n STORE_BEFORE_INIT: 101,\n STORE_AFTER_TERM: 101,\n COMMIT_BEFORE_INIT: 101,\n COMMIT_AFTER_TERM: 101,\n ARGUMENT_ERROR: 101,\n CHILDREN_ERROR: 101,\n COUNT_ERROR: 101,\n GENERAL_GET_FAILURE: 101,\n GENERAL_SET_FAILURE: 101,\n GENERAL_COMMIT_FAILURE: 101,\n UNDEFINED_DATA_MODEL: 101,\n UNIMPLEMENTED_ELEMENT: 101,\n VALUE_NOT_INITIALIZED: 101,\n INVALID_SET_VALUE: 101,\n READ_ONLY_ELEMENT: 101,\n WRITE_ONLY_ELEMENT: 101,\n TYPE_MISMATCH: 101,\n VALUE_OUT_OF_RANGE: 101,\n DEPENDENCY_NOT_ESTABLISHED: 101,\n};\n\nconst scorm12: ErrorCode = {\n ...global,\n RETRIEVE_BEFORE_INIT: 301,\n STORE_BEFORE_INIT: 301,\n COMMIT_BEFORE_INIT: 301,\n ARGUMENT_ERROR: 201,\n CHILDREN_ERROR: 202,\n COUNT_ERROR: 203,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 401,\n VALUE_NOT_INITIALIZED: 301,\n INVALID_SET_VALUE: 402,\n READ_ONLY_ELEMENT: 403,\n WRITE_ONLY_ELEMENT: 404,\n TYPE_MISMATCH: 405,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst scorm2004: ErrorCode = {\n ...global,\n INITIALIZATION_FAILED: 102,\n INITIALIZED: 103,\n TERMINATED: 104,\n TERMINATION_FAILURE: 111,\n TERMINATION_BEFORE_INIT: 112,\n MULTIPLE_TERMINATIONS: 113,\n RETRIEVE_BEFORE_INIT: 122,\n RETRIEVE_AFTER_TERM: 123,\n STORE_BEFORE_INIT: 132,\n STORE_AFTER_TERM: 133,\n COMMIT_BEFORE_INIT: 142,\n COMMIT_AFTER_TERM: 143,\n ARGUMENT_ERROR: 201,\n GENERAL_GET_FAILURE: 301,\n GENERAL_SET_FAILURE: 351,\n GENERAL_COMMIT_FAILURE: 391,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 402,\n VALUE_NOT_INITIALIZED: 403,\n READ_ONLY_ELEMENT: 404,\n WRITE_ONLY_ELEMENT: 405,\n TYPE_MISMATCH: 406,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst ErrorCodes = {\n scorm12,\n scorm2004,\n};\n\nexport default ErrorCodes;\n","const scorm12 = {\n CMIString256: \"^.{0,255}$\",\n CMIString4096: \"^.{0,4096}$\",\n CMITime: \"^(?:[01]\\\\d|2[0123]):(?:[012345]\\\\d):(?:[012345]\\\\d)$\",\n CMITimespan: \"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$\",\n\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{0,3})(.[0-9]*)?$\",\n\n CMIIdentifier: \"^[\\\\u0021-\\\\u007E\\\\s]{0,255}$\",\n CMIFeedback: \"^.{0,255}$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n // Vocabulary Data Type Definition\n CMIStatus: \"^(passed|completed|failed|incomplete|browsed)$\",\n CMIStatus2: \"^(passed|completed|failed|incomplete|browsed|not attempted)$\",\n CMIExit: \"^(time-out|suspend|logout|)$\",\n CMIType:\n \"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$\",\n CMIResult:\n \"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\\\.[0-9]*)?)$\",\n NAVEvent: \"^(previous|continue)$\",\n // Data ranges\n score_range: \"0#100\",\n audio_range: \"-1#100\",\n speed_range: \"-100#100\",\n weighting_range: \"-100#100\",\n text_range: \"-1#1\",\n};\nconst aicc = {\n ...scorm12,\n ...{\n CMIIdentifier: \"^\\\\w{1,255}$\",\n },\n};\nconst scorm2004 = {\n CMIString200: \"^[\\\\u0000-\\\\uFFFF]{0,200}$\",\n CMIString250: \"^[\\\\u0000-\\\\uFFFF]{0,250}$\",\n CMIString1000: \"^[\\\\u0000-\\\\uFFFF]{0,1000}$\",\n CMIString4000: \"^[\\\\u0000-\\\\uFFFF]{0,4000}$\",\n CMIString64000: \"^[\\\\u0000-\\\\uFFFF]{0,64000}$\",\n CMILang: \"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$\",\n\n CMILangString250:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$\",\n\n CMILangcr: \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$\",\n\n CMILangString250cr:\n \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$\",\n\n CMILangString4000:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$\",\n\n CMITime:\n \"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$\",\n CMITimespan:\n \"^P(?:([.,\\\\d]+)Y)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)W)?(?:([.,\\\\d]+)D)?(?:T?(?:([.,\\\\d]+)H)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)S)?)?$\",\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{1,5})(\\\\.[0-9]{1,18})?$\",\n CMIIdentifier: \"^\\\\S{1,250}[a-zA-Z0-9]$\",\n CMIShortIdentifier: \"^[\\\\w\\\\.\\\\-\\\\_]{1,250}$\",\n CMILongIdentifier:\n \"^(?:(?!urn:)\\\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\\\S{1,4000}|.{1,4000})$\",\n // need to re-examine this\n CMIFeedback: \"^.*$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n CMIIndexStore: \".N(\\\\d+).\",\n // Vocabulary Data Type Definition\n CMICStatus: \"^(completed|incomplete|not attempted|unknown)$\",\n CMISStatus: \"^(passed|failed|unknown)$\",\n CMIExit: \"^(time-out|suspend|logout|normal)$\",\n CMIType:\n \"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$\",\n CMIResult:\n \"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\\\.[0-9]{1,18})?)$\",\n NAVEvent:\n \"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?jump)$\",\n\n NAVBoolean: \"^(unknown|true|false$)\",\n NAVTarget: \"^{target=\\\\S{0,}[a-zA-Z0-9-_]+}$\",\n // Data ranges\n scaled_range: \"-1#1\",\n audio_range: \"0#*\",\n speed_range: \"0#*\",\n text_range: \"-1#1\",\n progress_range: \"0#1\",\n};\nconst Regex = {\n aicc: aicc,\n scorm12: scorm12,\n scorm2004: scorm2004,\n};\nexport default Regex;\n","import APIConstants from \"./constants/api_constants\";\n\nconst scorm12_errors = APIConstants.scorm12.error_descriptions;\nconst aicc_errors = APIConstants.aicc.error_descriptions;\nconst scorm2004_errors = APIConstants.scorm2004.error_descriptions;\n\ntype APIError = {\n errorCode: number;\n errorMessage: string;\n detailedMessage: string;\n};\n\nexport class BaseScormValidationError extends Error {\n constructor(errorCode: number) {\n super(errorCode.toString());\n this._errorCode = errorCode;\n this.name = \"ScormValidationError\";\n }\n\n private readonly _errorCode: number;\n\n /**\n * Getter for _errorCode\n * @return {number}\n */\n get errorCode(): number {\n return this._errorCode;\n }\n\n setMessage(message: string) {\n this.message = message;\n }\n}\n\n/**\n * Base Validation Exception\n */\nexport class ValidationError\n extends BaseScormValidationError\n implements APIError\n{\n /**\n * Constructor to take in an error message and code\n * @param {number} errorCode\n * @param {string} errorMessage\n * @param {string} detailedMessage\n */\n constructor(\n errorCode: number,\n errorMessage: string,\n detailedMessage?: string,\n ) {\n super(errorCode);\n this.setMessage(errorMessage);\n this._errorMessage = errorMessage;\n if (detailedMessage) {\n this._detailedMessage = detailedMessage;\n }\n }\n\n private readonly _errorMessage: string;\n private readonly _detailedMessage: string = \"\";\n\n /**\n * Getter for _errorMessage\n * @return {string}\n */\n get errorMessage(): string {\n return this._errorMessage;\n }\n\n /**\n * Getter for _detailedMessage\n * @return {string}\n */\n get detailedMessage(): string {\n return this._detailedMessage;\n }\n}\n\n/**\n * SCORM 1.2 Validation Error\n */\nexport class Scorm12ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {\n super(\n errorCode,\n scorm12_errors[String(errorCode)].basicMessage,\n scorm12_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm12_errors[\"101\"].basicMessage,\n scorm12_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * AICC Validation Error\n */\nexport class AICCValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {\n super(\n errorCode,\n aicc_errors[String(errorCode)].basicMessage,\n aicc_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n aicc_errors[\"101\"].basicMessage,\n aicc_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * SCORM 2004 Validation Error\n */\nexport class Scorm2004ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {\n super(\n errorCode,\n scorm2004_errors[String(errorCode)].basicMessage,\n scorm2004_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm2004_errors[\"101\"].basicMessage,\n scorm2004_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n","export const SECONDS_PER_SECOND = 1.0;\nexport const SECONDS_PER_MINUTE = 60;\nexport const SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;\nexport const SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR;\n\ntype Designation = {\n [key: string]: number;\n};\n\ntype StringKeyMap = {\n [key: string]: any;\n};\n\nconst designations: Designation = {\n D: SECONDS_PER_DAY,\n H: SECONDS_PER_HOUR,\n M: SECONDS_PER_MINUTE,\n S: SECONDS_PER_SECOND,\n};\n\n/**\n * Converts a Number to a String of HH:MM:SS\n *\n * @param {number} totalSeconds\n * @return {string}\n */\nexport function getSecondsAsHHMMSS(totalSeconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!totalSeconds || totalSeconds <= 0) {\n return \"00:00:00\";\n }\n\n const hours = Math.floor(totalSeconds / SECONDS_PER_HOUR);\n const dateObj = new Date(totalSeconds * 1000);\n const minutes = dateObj.getUTCMinutes();\n // make sure we add any possible decimal value\n const seconds = dateObj.getSeconds();\n const ms = totalSeconds % 1.0;\n let msStr = \"\";\n\n if (countDecimals(ms) > 0) {\n if (countDecimals(ms) > 2) {\n msStr = ms.toFixed(2);\n } else {\n msStr = String(ms);\n }\n\n msStr = \".\" + msStr.split(\".\")[1];\n }\n\n return (\n (hours + \":\" + minutes + \":\" + seconds).replace(/\\b\\d\\b/g, \"0$&\") + msStr\n );\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {number} seconds\n * @return {string}\n */\nexport function getSecondsAsISODuration(seconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!seconds || seconds <= 0) {\n return \"PT0S\";\n }\n\n let duration = \"P\";\n let remainder = seconds;\n for (const designationsKey in designations) {\n const current_seconds = designations[designationsKey];\n let value = Math.floor(remainder / current_seconds);\n remainder = remainder % current_seconds;\n\n if (countDecimals(remainder) > 2) {\n remainder = Number(Number(remainder).toFixed(2));\n }\n\n // If we have anything left in the remainder, and we're currently adding\n // seconds to the duration, go ahead and add the decimal to the seconds\n if (designationsKey === \"S\" && remainder > 0) {\n value += remainder;\n }\n\n if (value) {\n if (\n (duration.indexOf(\"D\") > 0 ||\n designationsKey === \"H\" ||\n designationsKey === \"M\" ||\n designationsKey === \"S\") &&\n duration.indexOf(\"T\") === -1\n ) {\n duration += \"T\";\n }\n\n duration += `${value}${designationsKey}`;\n }\n }\n return duration;\n}\n\n/**\n * Calculate the number of seconds from HH:MM:SS.DDDDDD\n *\n * @param {string} timeString\n * @param {RegExp} timeRegex\n * @return {number}\n */\nexport function getTimeAsSeconds(\n timeString: string | number | boolean | null,\n timeRegex: RegExp | string,\n): number {\n if (typeof timeString === \"number\" || typeof timeString === \"boolean\") {\n timeString = String(timeString);\n }\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n if (!timeString || !timeString.match(timeRegex)) {\n return 0;\n }\n\n const parts = timeString.split(\":\");\n const hours = Number(parts[0]);\n const minutes = Number(parts[1]);\n const seconds = Number(parts[2]);\n return hours * 3600 + minutes * 60 + seconds;\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {string} duration\n * @param {RegExp} durationRegex\n * @return {number}\n */\nexport function getDurationAsSeconds(\n duration: string | null,\n durationRegex: RegExp | string,\n): number {\n if (typeof durationRegex === \"string\") {\n durationRegex = new RegExp(durationRegex);\n }\n\n if (!duration || !duration.match(durationRegex)) {\n return 0;\n }\n\n const [, years, _, , days, hours, minutes, seconds] =\n new RegExp(durationRegex).exec(duration) || [];\n let result = 0.0;\n result += Number(seconds) || 0.0;\n result += Number(minutes) * 60.0 || 0.0;\n result += Number(hours) * 3600.0 || 0.0;\n result += Number(days) * (60 * 60 * 24.0) || 0.0;\n result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0;\n return result;\n}\n\n/**\n * Adds together two ISO8601 Duration strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp|string} durationRegex\n * @return {string}\n */\nexport function addTwoDurations(\n first: string,\n second: string,\n durationRegex: RegExp | string,\n): string {\n const regex: RegExp =\n typeof durationRegex === \"string\"\n ? new RegExp(durationRegex)\n : durationRegex;\n return getSecondsAsISODuration(\n getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex),\n );\n}\n\n/**\n * Add together two HH:MM:SS.DD strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp} timeRegex\n * @return {string}\n */\nexport function addHHMMSSTimeStrings(\n first: string,\n second: string,\n timeRegex: RegExp | string,\n): string {\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n return getSecondsAsHHMMSS(\n getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex),\n );\n}\n\n/**\n * Flatten a JSON object down to string paths for each values\n * @param {object} data\n * @return {object}\n */\nexport function flatten(data: StringKeyMap): object {\n const result: StringKeyMap = {};\n\n /**\n * Recurse through the object\n * @param {*} cur\n * @param {*} prop\n */\n function recurse(cur: any, prop: any) {\n if (Object(cur) !== cur) {\n result[prop] = cur;\n } else if (Array.isArray(cur)) {\n for (let i = 0, l = cur.length; i < l; i++) {\n recurse(cur[i], prop + \"[\" + i + \"]\");\n if (l === 0) result[prop] = [];\n }\n } else {\n let isEmpty = true;\n\n for (const p in cur) {\n if ({}.hasOwnProperty.call(cur, p)) {\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p);\n }\n }\n\n if (isEmpty && prop) result[prop] = {};\n }\n }\n\n recurse(data, \"\");\n return result;\n}\n\n/**\n * Un-flatten a flat JSON object\n * @param {object} data\n * @return {object}\n */\nexport function unflatten(data: StringKeyMap): object {\n \"use strict\";\n\n if (Object(data) !== data || Array.isArray(data)) return data;\n const regex = /\\.?([^.[\\]]+)|\\[(\\d+)]/g;\n const result: StringKeyMap = {};\n\n for (const p in data) {\n if ({}.hasOwnProperty.call(data, p)) {\n let cur = result;\n let prop = \"\";\n let m = regex.exec(p);\n\n while (m) {\n cur = cur[prop] || (cur[prop] = m[2] ? [] : {});\n prop = m[2] || m[1];\n m = regex.exec(p);\n }\n\n cur[prop] = data[p];\n }\n }\n\n return result[\"\"] || result;\n}\n\n/**\n * Counts the number of decimal places\n * @param {number} num\n * @return {number}\n */\nexport function countDecimals(num: number): number {\n if (Math.floor(num) === num || String(num).indexOf(\".\") < 0) return 0;\n const parts = num.toString().split(\".\")[1];\n return parts.length || 0;\n}\n\n/**\n * Formats the SCORM messages for easy reading\n *\n * @param {string} functionName\n * @param {string} message\n * @param {string} CMIElement\n * @return {string}\n */\nexport function formatMessage(\n functionName: string,\n message: string,\n CMIElement?: string,\n): string {\n const baseLength = 20;\n let messageString = \"\";\n\n messageString += functionName;\n\n let fillChars = baseLength - messageString.length;\n\n for (let i = 0; i < fillChars; i++) {\n messageString += \" \";\n }\n\n messageString += \": \";\n\n if (CMIElement) {\n const CMIElementBaseLength = 70;\n\n messageString += CMIElement;\n\n fillChars = CMIElementBaseLength - messageString.length;\n\n for (let j = 0; j < fillChars; j++) {\n messageString += \" \";\n }\n }\n\n if (message) {\n messageString += message;\n }\n\n return messageString;\n}\n\n/**\n * Checks to see if {str} contains {tester}\n *\n * @param {string} str String to check against\n * @param {string} tester String to check for\n * @return {boolean}\n */\nexport function stringMatches(str: string, tester: string): boolean {\n return str?.match(tester) !== null;\n}\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","import { checkValidFormat, checkValidRange } from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check2004ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n Scorm2004ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @return {boolean}\n */\nexport function check2004ValidRange(\n value: string,\n rangePattern: string,\n): boolean {\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm2004.VALUE_OUT_OF_RANGE,\n Scorm2004ValidationError,\n );\n}\n","/**\n * Class for SCORM 2004's cmi.learner_preference object\n */\nimport { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\nexport class CMILearnerPreference extends BaseCMI {\n private __children = APIConstants.scorm2004.student_preference_children;\n private _audio_level = \"1\";\n private _language = \"\";\n private _delivery_speed = \"1\";\n private _audio_captioning = \"0\";\n\n /**\n * Constructor for cmi.learner_preference\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for _audio_level\n * @return {string}\n */\n get audio_level(): string {\n return this._audio_level;\n }\n\n /**\n * Setter for _audio_level\n * @param {string} audio_level\n */\n set audio_level(audio_level: string) {\n if (\n check2004ValidFormat(audio_level, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(audio_level, Regex.scorm2004.audio_range)\n ) {\n this._audio_level = audio_level;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check2004ValidFormat(language, Regex.scorm2004.CMILang)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _delivery_speed\n * @return {string}\n */\n get delivery_speed(): string {\n return this._delivery_speed;\n }\n\n /**\n * Setter for _delivery_speed\n * @param {string} delivery_speed\n */\n set delivery_speed(delivery_speed: string) {\n if (\n check2004ValidFormat(delivery_speed, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(delivery_speed, Regex.scorm2004.speed_range)\n ) {\n this._delivery_speed = delivery_speed;\n }\n }\n\n /**\n * Getter for _audio_captioning\n * @return {string}\n */\n get audio_captioning(): string {\n return this._audio_captioning;\n }\n\n /**\n * Setter for _audio_captioning\n * @param {string} audio_captioning\n */\n set audio_captioning(audio_captioning: string) {\n if (\n check2004ValidFormat(audio_captioning, Regex.scorm2004.CMISInteger) &&\n check2004ValidRange(audio_captioning, Regex.scorm2004.text_range)\n ) {\n this._audio_captioning = audio_captioning;\n }\n }\n\n /**\n * toJSON for cmi.learner_preference\n *\n * @return {\n * {\n * audio_level: string,\n * language: string,\n * delivery_speed: string,\n * audio_captioning: string\n * }\n * }\n */\n toJSON(): {\n audio_level: string;\n language: string;\n delivery_speed: string;\n audio_captioning: string;\n } {\n this.jsonString = true;\n const result = {\n audio_level: this.audio_level,\n language: this.language,\n delivery_speed: this.delivery_speed,\n audio_captioning: this.audio_captioning,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import Regex from \"./regex\";\n\nconst scorm2004_regex = Regex.scorm2004;\nexport const LearnerResponses: Responses = {\n \"true-false\": {\n format: \"^true$|^false$\",\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n choice: {\n format: scorm2004_regex.CMILongIdentifier,\n max: 36,\n delimiter: \"[,]\",\n unique: true,\n },\n \"fill-in\": {\n format: scorm2004_regex.CMILangString250,\n max: 10,\n delimiter: \"[,]\",\n unique: false,\n },\n \"long-fill-in\": {\n format: scorm2004_regex.CMILangString4000,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n matching: {\n format: scorm2004_regex.CMIShortIdentifier,\n format2: scorm2004_regex.CMIShortIdentifier,\n max: 36,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n },\n performance: {\n format: \"^$|\" + scorm2004_regex.CMIShortIdentifier,\n format2:\n scorm2004_regex.CMIDecimal + \"|^$|\" + scorm2004_regex.CMIShortIdentifier,\n max: 250,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n },\n sequencing: {\n format: scorm2004_regex.CMIShortIdentifier,\n max: 36,\n delimiter: \"[,]\",\n unique: false,\n },\n likert: {\n format: scorm2004_regex.CMIShortIdentifier,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n numeric: {\n format: scorm2004_regex.CMIDecimal,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n other: {\n format: scorm2004_regex.CMIString4000,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n};\nexport const CorrectResponses: Responses = {\n \"true-false\": {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: \"^true$|^false$\",\n limit: 1,\n },\n choice: {\n max: 36,\n delimiter: \"[,]\",\n unique: true,\n duplicate: false,\n format: scorm2004_regex.CMILongIdentifier,\n },\n \"fill-in\": {\n max: 10,\n delimiter: \"[,]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMILangString250cr,\n },\n \"long-fill-in\": {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: true,\n format: scorm2004_regex.CMILangString4000,\n },\n matching: {\n max: 36,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n format2: scorm2004_regex.CMIShortIdentifier,\n },\n performance: {\n max: 250,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n delimiter3: \"[:]\",\n unique: false,\n duplicate: false,\n format: \"^$|\" + scorm2004_regex.CMIShortIdentifier,\n format2:\n scorm2004_regex.CMIDecimal + \"|^$|\" + scorm2004_regex.CMIShortIdentifier,\n },\n sequencing: {\n max: 36,\n delimiter: \"[,]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n },\n likert: {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n limit: 1,\n },\n numeric: {\n max: 2,\n delimiter: \"[:]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIDecimal,\n limit: 1,\n },\n other: {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIString4000,\n limit: 1,\n },\n};\n\nexport type ResponseType = {\n format: string;\n max: number;\n delimiter: string;\n unique: boolean;\n duplicate?: boolean;\n format2?: string;\n delimiter2?: string;\n limit?: number;\n delimiter3?: string;\n};\n\nexport type Responses = {\n [key: string]: ResponseType;\n};\n","/**\n * Class representing SCORM 2004's `cmi.interactions` object\n */\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { CMIArray } from \"../common/array\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\nimport { LearnerResponses } from \"../../constants/response_constants\";\n\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.objectives` Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.interactions_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class for SCORM 2004's cmi.interaction.n object\n */\n\nexport class CMIInteractionsObject extends BaseCMI {\n private _id = \"\";\n private _type = \"\";\n private _timestamp = \"\";\n private _weighting = \"\";\n private _learner_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n private _description = \"\";\n\n /**\n * Constructor for cmi.interaction.n\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n children: APIConstants.scorm2004.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n children: APIConstants.scorm2004.correct_responses_children,\n });\n }\n\n public objectives: CMIArray;\n public correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _type\n * @return {string}\n */\n get type(): string {\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(type, Regex.scorm2004.CMIType)) {\n this._type = type;\n }\n }\n }\n\n /**\n * Getter for _timestamp\n * @return {string}\n */\n get timestamp(): string {\n return this._timestamp;\n }\n\n /**\n * Setter for _timestamp\n * @param {string} timestamp\n */\n set timestamp(timestamp: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(timestamp, Regex.scorm2004.CMITime)) {\n this._timestamp = timestamp;\n }\n }\n }\n\n /**\n * Getter for _weighting\n * @return {string}\n */\n get weighting(): string {\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(weighting, Regex.scorm2004.CMIDecimal)) {\n this._weighting = weighting;\n }\n }\n }\n\n /**\n * Getter for _learner_response\n * @return {string}\n */\n get learner_response(): string {\n return this._learner_response;\n }\n\n /**\n * Setter for _learner_response. Does type validation to make sure response\n * matches SCORM 2004's spec\n * @param {string} learner_response\n */\n set learner_response(learner_response: string) {\n if (this.initialized && (this._type === \"\" || this._id === \"\")) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n let nodes = [];\n const response_type = LearnerResponses[this.type];\n\n if (response_type) {\n if (response_type?.delimiter) {\n nodes = learner_response.split(response_type.delimiter);\n } else {\n nodes[0] = learner_response;\n }\n\n if (nodes.length > 0 && nodes.length <= response_type.max) {\n const formatRegex = new RegExp(response_type.format);\n\n for (let i = 0; i < nodes.length; i++) {\n if (response_type?.delimiter2) {\n const values = nodes[i].split(response_type.delimiter2);\n\n if (values.length === 2) {\n if (!values[0].match(formatRegex)) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n } else {\n if (\n !response_type.format2 ||\n !values[1].match(new RegExp(response_type.format2))\n ) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n }\n } else {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n } else {\n if (!nodes[i].match(formatRegex)) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n } else {\n if (nodes[i] !== \"\" && response_type.unique) {\n for (let j = 0; j < i; j++) {\n if (nodes[i] === nodes[j]) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n }\n }\n }\n }\n }\n } else {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n );\n }\n\n this._learner_response = learner_response;\n } else {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n\n /**\n * Getter for _result\n * @return {string}\n */\n get result(): string {\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check2004ValidFormat(result, Regex.scorm2004.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency\n * @return {string}\n */\n get latency(): string {\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(latency, Regex.scorm2004.CMITimespan)) {\n this._latency = latency;\n }\n }\n }\n\n /**\n * Getter for _description\n * @return {string}\n */\n get description(): string {\n return this._description;\n }\n\n /**\n * Setter for _description\n * @param {string} description\n */\n set description(description: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(\n description,\n Regex.scorm2004.CMILangString250,\n true,\n )\n ) {\n this._description = description;\n }\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * type: string,\n * objectives: CMIArray,\n * timestamp: string,\n * correct_responses: CMIArray,\n * weighting: string,\n * learner_response: string,\n * result: string,\n * latency: string,\n * description: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n type: string;\n objectives: CMIArray;\n timestamp: string;\n correct_responses: CMIArray;\n weighting: string;\n learner_response: string;\n result: string;\n latency: string;\n description: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n type: this.type,\n objectives: this.objectives,\n timestamp: this.timestamp,\n weighting: this.weighting,\n learner_response: this.learner_response,\n result: this.result,\n latency: this.latency,\n description: this.description,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.interactions.n.objectives.n object\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n private _id = \"\";\n\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.interactions.n.correct_responses.n object\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n private _pattern = \"\";\n\n /**\n * Constructor for cmi.interactions.n.correct_responses.n\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check2004ValidFormat(pattern, Regex.scorm2004.CMIFeedback)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON cmi.interactions.n.correct_responses.n object\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this.pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","/**\n * Class for SCORM 2004's cmi *.score object\n */\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\n\nexport class Scorm2004CMIScore extends CMIScore {\n private _scaled = \"\";\n\n /**\n * Constructor for cmi *.score\n */\n constructor() {\n super({\n score_children: APIConstants.scorm2004.score_children,\n max: \"\",\n invalidErrorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n invalidTypeCode: ErrorCodes.scorm2004.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm2004.VALUE_OUT_OF_RANGE,\n decimalRegex: Regex.scorm2004.CMIDecimal,\n errorClass: Scorm2004ValidationError,\n });\n }\n\n /**\n * Getter for _scaled\n * @return {string}\n */\n get scaled(): string {\n return this._scaled;\n }\n\n /**\n * Setter for _scaled\n * @param {string} scaled\n */\n set scaled(scaled: string) {\n if (\n check2004ValidFormat(scaled, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(scaled, Regex.scorm2004.scaled_range)\n ) {\n this._scaled = scaled;\n }\n }\n\n /**\n * toJSON for cmi *.score\n *\n * @return {\n * {\n * scaled: string,\n * raw: string,\n * min: string,\n * max: string\n * }\n * }\n */\n toJSON(): {\n scaled: string;\n raw: string;\n min: string;\n max: string;\n } {\n this.jsonString = true;\n const result = {\n scaled: this.scaled,\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_lms object\n * @extends CMIArray\n */\nexport class CMICommentsFromLMS extends CMIArray {\n /**\n * Constructor for cmi.comments_from_lms Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.comments_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_learner object\n */\n\nexport class CMICommentsFromLearner extends CMIArray {\n /**\n * Constructor for cmi.comments_from_learner Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.comments_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_learner.n and cmi.comments_from_lms.n object\n */\n\nexport class CMICommentsObject extends BaseCMI {\n private _comment = \"\";\n private _location = \"\";\n private _timestamp = \"\";\n private readonly _readOnlyAfterInit: boolean;\n\n /**\n * Constructor for cmi.comments_from_learner.n and cmi.comments_from_lms.n\n * @param {boolean} readOnlyAfterInit\n */\n constructor(readOnlyAfterInit: boolean = false) {\n super();\n this._comment = \"\";\n this._location = \"\";\n this._timestamp = \"\";\n this._readOnlyAfterInit = readOnlyAfterInit;\n }\n\n /**\n * Getter for _comment\n * @return {string}\n */\n get comment(): string {\n return this._comment;\n }\n\n /**\n * Setter for _comment\n * @param {string} comment\n */\n set comment(comment: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (\n check2004ValidFormat(comment, Regex.scorm2004.CMILangString4000, true)\n ) {\n this._comment = comment;\n }\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (check2004ValidFormat(location, Regex.scorm2004.CMIString250)) {\n this._location = location;\n }\n }\n }\n\n /**\n * Getter for _timestamp\n * @return {string}\n */\n get timestamp(): string {\n return this._timestamp;\n }\n\n /**\n * Setter for _timestamp\n * @param {string} timestamp\n */\n set timestamp(timestamp: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (check2004ValidFormat(timestamp, Regex.scorm2004.CMITime)) {\n this._timestamp = timestamp;\n }\n }\n }\n\n /**\n * toJSON for cmi.comments_from_learner.n object\n * @return {\n * {\n * comment: string,\n * location: string,\n * timestamp: string\n * }\n * }\n */\n toJSON(): {\n comment: string;\n location: string;\n timestamp: string;\n } {\n this.jsonString = true;\n const result = {\n comment: this.comment,\n location: this.location,\n timestamp: this.timestamp,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { Scorm2004CMIScore } from \"./score\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing SCORM 2004's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives` Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.objectives_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class for SCORM 2004's cmi.objectives.n object\n */\nexport class CMIObjectivesObject extends BaseCMI {\n private _id = \"\";\n private _success_status = \"unknown\";\n private _completion_status = \"unknown\";\n private _progress_measure = \"\";\n private _description = \"\";\n\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new Scorm2004CMIScore();\n }\n\n public score: Scorm2004CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _success_status\n * @return {string}\n */\n get success_status(): string {\n return this._success_status;\n }\n\n /**\n * Setter for _success_status\n * @param {string} success_status\n */\n set success_status(success_status: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(success_status, Regex.scorm2004.CMISStatus)) {\n this._success_status = success_status;\n }\n }\n }\n\n /**\n * Getter for _completion_status\n * @return {string}\n */\n get completion_status(): string {\n return this._completion_status;\n }\n\n /**\n * Setter for _completion_status\n * @param {string} completion_status\n */\n set completion_status(completion_status: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(completion_status, Regex.scorm2004.CMICStatus)) {\n this._completion_status = completion_status;\n }\n }\n }\n\n /**\n * Getter for _progress_measure\n * @return {string}\n */\n get progress_measure(): string {\n return this._progress_measure;\n }\n\n /**\n * Setter for _progress_measure\n * @param {string} progress_measure\n */\n set progress_measure(progress_measure: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(progress_measure, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(progress_measure, Regex.scorm2004.progress_range)\n ) {\n this._progress_measure = progress_measure;\n }\n }\n }\n\n /**\n * Getter for _description\n * @return {string}\n */\n get description(): string {\n return this._description;\n }\n\n /**\n * Setter for _description\n * @param {string} description\n */\n set description(description: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(\n description,\n Regex.scorm2004.CMILangString250,\n true,\n )\n ) {\n this._description = description;\n }\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n *\n * @return {\n * {\n * id: string,\n * success_status: string,\n * completion_status: string,\n * progress_measure: string,\n * description: string,\n * score: Scorm2004CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n success_status: string;\n completion_status: string;\n progress_measure: string;\n description: string;\n score: Scorm2004CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n success_status: this.success_status,\n completion_status: this.completion_status,\n progress_measure: this.progress_measure,\n description: this.description,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport * as Util from \"../../utilities\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport { CMILearnerPreference } from \"./learner_preference\";\nimport { CMIInteractions } from \"./interactions\";\nimport { Scorm2004CMIScore } from \"./score\";\nimport { CMICommentsFromLearner, CMICommentsFromLMS } from \"./comments\";\nimport { CMIObjectives } from \"./objectives\";\n\n/**\n * Class representing cmi object for SCORM 2004\n */\nexport class CMI extends BaseRootCMI {\n /**\n * Constructor for the SCORM 2004 cmi object\n * @param {boolean} initialized\n */\n constructor(initialized: boolean = false) {\n super();\n this.learner_preference = new CMILearnerPreference();\n this.score = new Scorm2004CMIScore();\n this.comments_from_learner = new CMICommentsFromLearner();\n this.comments_from_lms = new CMICommentsFromLMS();\n this.interactions = new CMIInteractions();\n this.objectives = new CMIObjectives();\n if (initialized) this.initialize();\n }\n\n public learner_preference: CMILearnerPreference;\n public score: Scorm2004CMIScore;\n public comments_from_learner: CMICommentsFromLearner;\n public comments_from_lms: CMICommentsFromLMS;\n public interactions: CMIInteractions;\n public objectives: CMIObjectives;\n\n private __version = \"1.0\";\n private __children = APIConstants.scorm2004.cmi_children;\n private _completion_status = \"unknown\";\n private _completion_threshold = \"\";\n private _credit = \"credit\";\n private _entry = \"\";\n private _exit = \"\";\n private _launch_data = \"\";\n private _learner_id = \"\";\n private _learner_name = \"\";\n private _location = \"\";\n private _max_time_allowed = \"\";\n private _mode = \"normal\";\n private _progress_measure = \"\";\n private _scaled_passing_score = \"\";\n private _session_time = \"PT0H0M0S\";\n private _success_status = \"unknown\";\n private _suspend_data = \"\";\n private _time_limit_action = \"continue,no message\";\n private _total_time = \"\";\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.learner_preference?.initialize();\n this.score?.initialize();\n this.comments_from_learner?.initialize();\n this.comments_from_lms?.initialize();\n this.interactions?.initialize();\n this.objectives?.initialize();\n }\n\n /**\n * Getter for __version\n * @return {string}\n * @private\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n * @private\n */\n set _version(_version: string) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {number} _children\n * @private\n */\n set _children(_children: number) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for _completion_status\n * @return {string}\n */\n get completion_status(): string {\n return this._completion_status;\n }\n\n /**\n * Setter for _completion_status\n * @param {string} completion_status\n */\n set completion_status(completion_status: string) {\n if (check2004ValidFormat(completion_status, Regex.scorm2004.CMICStatus)) {\n this._completion_status = completion_status;\n }\n }\n\n /**\n * Getter for _completion_threshold\n * @return {string}\n */\n get completion_threshold(): string {\n return this._completion_threshold;\n }\n\n /**\n * Setter for _completion_threshold. Can only be called before initialization.\n * @param {string} completion_threshold\n */\n set completion_threshold(completion_threshold: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._completion_threshold = completion_threshold;\n }\n }\n\n /**\n * Setter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.WRITE_ONLY_ELEMENT,\n );\n }\n return this._exit;\n }\n\n /**\n * Getter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check2004ValidFormat(exit, Regex.scorm2004.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _learner_id\n * @return {string}\n */\n get learner_id(): string {\n return this._learner_id;\n }\n\n /**\n * Setter for _learner_id. Can only be called before initialization.\n * @param {string} learner_id\n */\n set learner_id(learner_id: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._learner_id = learner_id;\n }\n }\n\n /**\n * Getter for _learner_name\n * @return {string}\n */\n get learner_name(): string {\n return this._learner_name;\n }\n\n /**\n * Setter for _learner_name. Can only be called before initialization.\n * @param {string} learner_name\n */\n set learner_name(learner_name: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._learner_name = learner_name;\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (check2004ValidFormat(location, Regex.scorm2004.CMIString1000)) {\n this._location = location;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _mode\n * @return {string}\n */\n get mode(): string {\n return this._mode;\n }\n\n /**\n * Setter for _mode. Can only be called before initialization.\n * @param {string} mode\n */\n set mode(mode: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._mode = mode;\n }\n }\n\n /**\n * Getter for _progress_measure\n * @return {string}\n */\n get progress_measure(): string {\n return this._progress_measure;\n }\n\n /**\n * Setter for _progress_measure\n * @param {string} progress_measure\n */\n set progress_measure(progress_measure: string) {\n if (\n check2004ValidFormat(progress_measure, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(progress_measure, Regex.scorm2004.progress_range)\n ) {\n this._progress_measure = progress_measure;\n }\n }\n\n /**\n * Getter for _scaled_passing_score\n * @return {string}\n */\n get scaled_passing_score(): string {\n return this._scaled_passing_score;\n }\n\n /**\n * Setter for _scaled_passing_score. Can only be called before initialization.\n * @param {string} scaled_passing_score\n */\n set scaled_passing_score(scaled_passing_score: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._scaled_passing_score = scaled_passing_score;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.WRITE_ONLY_ELEMENT,\n );\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check2004ValidFormat(session_time, Regex.scorm2004.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _success_status\n * @return {string}\n */\n get success_status(): string {\n return this._success_status;\n }\n\n /**\n * Setter for _success_status\n * @param {string} success_status\n */\n set success_status(success_status: string) {\n if (check2004ValidFormat(success_status, Regex.scorm2004.CMISStatus)) {\n this._success_status = success_status;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (\n check2004ValidFormat(suspend_data, Regex.scorm2004.CMIString64000, true)\n ) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string} ISO8601 Duration\n */\n getCurrentTotalTime(): string {\n let sessionTime = this._session_time;\n const startTime = this.start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsISODuration(seconds / 1000);\n }\n\n return Util.addTwoDurations(\n this._total_time,\n sessionTime,\n Regex.scorm2004.CMITimespan,\n );\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * comments_from_learner: CMICommentsFromLearner,\n * comments_from_lms: CMICommentsFromLMS,\n * completion_status: string,\n * completion_threshold: string,\n * credit: string,\n * entry: string,\n * exit: string,\n * interactions: CMIInteractions,\n * launch_data: string,\n * learner_id: string,\n * learner_name: string,\n * learner_preference: CMILearnerPreference,\n * location: string,\n * max_time_allowed: string,\n * mode: string,\n * objectives: CMIObjectives,\n * progress_measure: string,\n * scaled_passing_score: string,\n * score: Scorm2004CMIScore,\n * session_time: string,\n * success_status: string,\n * suspend_data: string,\n * time_limit_action: string\n * }\n * }\n */\n toJSON(): {\n comments_from_learner: CMICommentsFromLearner;\n comments_from_lms: CMICommentsFromLMS;\n completion_status: string;\n completion_threshold: string;\n credit: string;\n entry: string;\n exit: string;\n interactions: CMIInteractions;\n launch_data: string;\n learner_id: string;\n learner_name: string;\n learner_preference: CMILearnerPreference;\n location: string;\n max_time_allowed: string;\n mode: string;\n objectives: CMIObjectives;\n progress_measure: string;\n scaled_passing_score: string;\n score: Scorm2004CMIScore;\n session_time: string;\n success_status: string;\n suspend_data: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n comments_from_learner: this.comments_from_learner,\n comments_from_lms: this.comments_from_lms,\n completion_status: this.completion_status,\n completion_threshold: this.completion_threshold,\n credit: this.credit,\n entry: this.entry,\n exit: this.exit,\n interactions: this.interactions,\n launch_data: this.launch_data,\n learner_id: this.learner_id,\n learner_name: this.learner_name,\n learner_preference: this.learner_preference,\n location: this.location,\n max_time_allowed: this.max_time_allowed,\n mode: this.mode,\n objectives: this.objectives,\n progress_measure: this.progress_measure,\n scaled_passing_score: this.scaled_passing_score,\n score: this.score,\n session_time: this.session_time,\n success_status: this.success_status,\n suspend_data: this.suspend_data,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","const ValidLanguages: string[] = [\n \"aa\",\n \"ab\",\n \"ae\",\n \"af\",\n \"ak\",\n \"am\",\n \"an\",\n \"ar\",\n \"as\",\n \"av\",\n \"ay\",\n \"az\",\n \"ba\",\n \"be\",\n \"bg\",\n \"bh\",\n \"bi\",\n \"bm\",\n \"bn\",\n \"bo\",\n \"br\",\n \"bs\",\n \"ca\",\n \"ce\",\n \"ch\",\n \"co\",\n \"cr\",\n \"cs\",\n \"cu\",\n \"cv\",\n \"cy\",\n \"da\",\n \"de\",\n \"dv\",\n \"dz\",\n \"ee\",\n \"el\",\n \"en\",\n \"eo\",\n \"es\",\n \"et\",\n \"eu\",\n \"fa\",\n \"ff\",\n \"fi\",\n \"fj\",\n \"fo\",\n \"fr\",\n \"fy\",\n \"ga\",\n \"gd\",\n \"gl\",\n \"gn\",\n \"gu\",\n \"gv\",\n \"ha\",\n \"he\",\n \"hi\",\n \"ho\",\n \"hr\",\n \"ht\",\n \"hu\",\n \"hy\",\n \"hz\",\n \"ia\",\n \"id\",\n \"ie\",\n \"ig\",\n \"ii\",\n \"ik\",\n \"io\",\n \"is\",\n \"it\",\n \"iu\",\n \"ja\",\n \"jv\",\n \"ka\",\n \"kg\",\n \"ki\",\n \"kj\",\n \"kk\",\n \"kl\",\n \"km\",\n \"kn\",\n \"ko\",\n \"kr\",\n \"ks\",\n \"ku\",\n \"kv\",\n \"kw\",\n \"ky\",\n \"la\",\n \"lb\",\n \"lg\",\n \"li\",\n \"ln\",\n \"lo\",\n \"lt\",\n \"lu\",\n \"lv\",\n \"mg\",\n \"mh\",\n \"mi\",\n \"mk\",\n \"ml\",\n \"mn\",\n \"mo\",\n \"mr\",\n \"ms\",\n \"mt\",\n \"my\",\n \"na\",\n \"nb\",\n \"nd\",\n \"ne\",\n \"ng\",\n \"nl\",\n \"nn\",\n \"no\",\n \"nr\",\n \"nv\",\n \"ny\",\n \"oc\",\n \"oj\",\n \"om\",\n \"or\",\n \"os\",\n \"pa\",\n \"pi\",\n \"pl\",\n \"ps\",\n \"pt\",\n \"qu\",\n \"rm\",\n \"rn\",\n \"ro\",\n \"ru\",\n \"rw\",\n \"sa\",\n \"sc\",\n \"sd\",\n \"se\",\n \"sg\",\n \"sh\",\n \"si\",\n \"sk\",\n \"sl\",\n \"sm\",\n \"sn\",\n \"so\",\n \"sq\",\n \"sr\",\n \"ss\",\n \"st\",\n \"su\",\n \"sv\",\n \"sw\",\n \"ta\",\n \"te\",\n \"tg\",\n \"th\",\n \"ti\",\n \"tk\",\n \"tl\",\n \"tn\",\n \"to\",\n \"tr\",\n \"ts\",\n \"tt\",\n \"tw\",\n \"ty\",\n \"ug\",\n \"uk\",\n \"ur\",\n \"uz\",\n \"ve\",\n \"vi\",\n \"vo\",\n \"wa\",\n \"wo\",\n \"xh\",\n \"yi\",\n \"yo\",\n \"za\",\n \"zh\",\n \"zu\",\n \"aar\",\n \"abk\",\n \"ave\",\n \"afr\",\n \"aka\",\n \"amh\",\n \"arg\",\n \"ara\",\n \"asm\",\n \"ava\",\n \"aym\",\n \"aze\",\n \"bak\",\n \"bel\",\n \"bul\",\n \"bih\",\n \"bis\",\n \"bam\",\n \"ben\",\n \"tib\",\n \"bod\",\n \"bre\",\n \"bos\",\n \"cat\",\n \"che\",\n \"cha\",\n \"cos\",\n \"cre\",\n \"cze\",\n \"ces\",\n \"chu\",\n \"chv\",\n \"wel\",\n \"cym\",\n \"dan\",\n \"ger\",\n \"deu\",\n \"div\",\n \"dzo\",\n \"ewe\",\n \"gre\",\n \"ell\",\n \"eng\",\n \"epo\",\n \"spa\",\n \"est\",\n \"baq\",\n \"eus\",\n \"per\",\n \"fas\",\n \"ful\",\n \"fin\",\n \"fij\",\n \"fao\",\n \"fre\",\n \"fra\",\n \"fry\",\n \"gle\",\n \"gla\",\n \"glg\",\n \"grn\",\n \"guj\",\n \"glv\",\n \"hau\",\n \"heb\",\n \"hin\",\n \"hmo\",\n \"hrv\",\n \"hat\",\n \"hun\",\n \"arm\",\n \"hye\",\n \"her\",\n \"ina\",\n \"ind\",\n \"ile\",\n \"ibo\",\n \"iii\",\n \"ipk\",\n \"ido\",\n \"ice\",\n \"isl\",\n \"ita\",\n \"iku\",\n \"jpn\",\n \"jav\",\n \"geo\",\n \"kat\",\n \"kon\",\n \"kik\",\n \"kua\",\n \"kaz\",\n \"kal\",\n \"khm\",\n \"kan\",\n \"kor\",\n \"kau\",\n \"kas\",\n \"kur\",\n \"kom\",\n \"cor\",\n \"kir\",\n \"lat\",\n \"ltz\",\n \"lug\",\n \"lim\",\n \"lin\",\n \"lao\",\n \"lit\",\n \"lub\",\n \"lav\",\n \"mlg\",\n \"mah\",\n \"mao\",\n \"mri\",\n \"mac\",\n \"mkd\",\n \"mal\",\n \"mon\",\n \"mol\",\n \"mar\",\n \"may\",\n \"msa\",\n \"mlt\",\n \"bur\",\n \"mya\",\n \"nau\",\n \"nob\",\n \"nde\",\n \"nep\",\n \"ndo\",\n \"dut\",\n \"nld\",\n \"nno\",\n \"nor\",\n \"nbl\",\n \"nav\",\n \"nya\",\n \"oci\",\n \"oji\",\n \"orm\",\n \"ori\",\n \"oss\",\n \"pan\",\n \"pli\",\n \"pol\",\n \"pus\",\n \"por\",\n \"que\",\n \"roh\",\n \"run\",\n \"rum\",\n \"ron\",\n \"rus\",\n \"kin\",\n \"san\",\n \"srd\",\n \"snd\",\n \"sme\",\n \"sag\",\n \"slo\",\n \"sin\",\n \"slk\",\n \"slv\",\n \"smo\",\n \"sna\",\n \"som\",\n \"alb\",\n \"sqi\",\n \"srp\",\n \"ssw\",\n \"sot\",\n \"sun\",\n \"swe\",\n \"swa\",\n \"tam\",\n \"tel\",\n \"tgk\",\n \"tha\",\n \"tir\",\n \"tuk\",\n \"tgl\",\n \"tsn\",\n \"ton\",\n \"tur\",\n \"tso\",\n \"tat\",\n \"twi\",\n \"tah\",\n \"uig\",\n \"ukr\",\n \"urd\",\n \"uzb\",\n \"ven\",\n \"vie\",\n \"vol\",\n \"wln\",\n \"wol\",\n \"xho\",\n \"yid\",\n \"yor\",\n \"zha\",\n \"chi\",\n \"zho\",\n \"zul\",\n];\nexport default ValidLanguages;\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\nimport { NAVBoolean } from \"../../constants/enums\";\n\n/**\n * Class representing SCORM 2004's adl object\n */\nexport class ADL extends BaseCMI {\n /**\n * Constructor for adl\n */\n constructor() {\n super();\n this.nav = new ADLNav();\n }\n\n public nav: ADLNav;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.nav?.initialize();\n }\n\n /**\n * toJSON for adl\n * @return {\n * {\n * nav: ADLNav\n * }\n * }\n */\n toJSON(): {\n nav: ADLNav;\n } {\n this.jsonString = true;\n const result = {\n nav: this.nav,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's `adl.nav` object\n */\n\nexport class ADLNav extends BaseCMI {\n private _request = \"_none_\";\n\n /**\n * Constructor for `adl.nav`\n */\n constructor() {\n super();\n this.request_valid = new ADLNavRequestValid();\n }\n\n public request_valid: ADLNavRequestValid;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.request_valid?.initialize();\n }\n\n /**\n * Getter for _request\n * @return {string}\n */\n get request(): string {\n return this._request;\n }\n\n /**\n * Setter for _request\n * @param {string} request\n */\n set request(request: string) {\n if (check2004ValidFormat(request, Regex.scorm2004.NAVEvent)) {\n this._request = request;\n }\n }\n\n /**\n * toJSON for adl.nav\n *\n * @return {\n * {\n * request: string\n * }\n * }\n */\n toJSON(): {\n request: string;\n } {\n this.jsonString = true;\n const result = {\n request: this.request,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's adl.nav.request_valid object\n */\n\nexport class ADLNavRequestValid extends BaseCMI {\n private _continue = \"unknown\";\n private _previous = \"unknown\";\n private _choice: {\n [key: string]: NAVBoolean;\n } = {};\n private _jump: {\n [key: string]: NAVBoolean;\n } = {};\n\n /**\n * Constructor for adl.nav.request_valid\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _continue\n * @return {string}\n */\n get continue(): string {\n return this._continue;\n }\n\n /**\n * Setter for _continue. Just throws an error.\n * @param {string} _continue\n */\n set continue(_continue: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (check2004ValidFormat(_continue, Regex.scorm2004.NAVBoolean)) {\n this._continue = _continue;\n }\n }\n\n /**\n * Getter for _previous\n * @return {string}\n */\n get previous(): string {\n return this._previous;\n }\n\n /**\n * Setter for _previous. Just throws an error.\n * @param {string} _previous\n */\n set previous(_previous: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (check2004ValidFormat(_previous, Regex.scorm2004.NAVBoolean)) {\n this._previous = _previous;\n }\n }\n\n /**\n * Getter for _choice\n * @return {{ [key: string]: NAVBoolean }}\n */\n get choice(): { [key: string]: NAVBoolean } {\n return this._choice;\n }\n\n /**\n * Setter for _choice\n * @param {{ [key: string]: string }} choice\n */\n set choice(choice: { [key: string]: string }) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (typeof choice !== \"object\") {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n for (const key in choice) {\n if ({}.hasOwnProperty.call(choice, key)) {\n if (\n check2004ValidFormat(choice[key], Regex.scorm2004.NAVBoolean) &&\n check2004ValidFormat(key, Regex.scorm2004.NAVTarget)\n ) {\n this._choice[key] =\n NAVBoolean[choice[key] as keyof typeof NAVBoolean];\n }\n }\n }\n }\n\n /**\n * Getter for _jump\n * @return {{ [key: string]: NAVBoolean }}\n */\n get jump(): { [key: string]: NAVBoolean } {\n return this._jump;\n }\n\n /**\n * Setter for _jump\n * @param {{ [key: string]: string }} jump\n */\n set jump(jump: { [key: string]: string }) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (typeof jump !== \"object\") {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n for (const key in jump) {\n if ({}.hasOwnProperty.call(jump, key)) {\n if (\n check2004ValidFormat(jump[key], Regex.scorm2004.NAVBoolean) &&\n check2004ValidFormat(key, Regex.scorm2004.NAVTarget)\n ) {\n this._jump[key] = NAVBoolean[jump[key] as keyof typeof NAVBoolean];\n }\n }\n }\n }\n\n /**\n * toJSON for adl.nav.request_valid\n *\n * @return {\n * {\n * previous: string,\n * continue: string\n * }\n * }\n */\n toJSON(): {\n previous: string;\n continue: string;\n } {\n this.jsonString = true;\n const result = {\n previous: this._previous,\n continue: this._continue,\n choice: this._choice,\n jump: this._jump,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import BaseAPI from \"./BaseAPI\";\nimport { CMI } from \"./cmi/scorm2004/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\nimport { CorrectResponses, ResponseType } from \"./constants/response_constants\";\nimport ValidLanguages from \"./constants/language_constants\";\nimport Regex from \"./constants/regex\";\nimport regex from \"./constants/regex\";\nimport { CMIArray } from \"./cmi/common/array\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm2004/interactions\";\nimport { CMICommentsObject } from \"./cmi/scorm2004/comments\";\nimport { CMIObjectivesObject } from \"./cmi/scorm2004/objectives\";\nimport { ADL } from \"./cmi/scorm2004/adl\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\n\n/**\n * API class for SCORM 2004\n */\nclass Scorm2004Impl extends BaseAPI {\n private _version: string = \"1.0\";\n\n /**\n * Constructor for SCORM 2004 API\n * @param {Settings} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm2004, settings);\n\n this.cmi = new CMI();\n this.adl = new ADL();\n\n // Rename functions to match 2004 Spec and expose to modules\n this.Initialize = this.lmsInitialize;\n this.Terminate = this.lmsFinish;\n this.GetValue = this.lmsGetValue;\n this.SetValue = this.lmsSetValue;\n this.Commit = this.lmsCommit;\n this.GetLastError = this.lmsGetLastError;\n this.GetErrorString = this.lmsGetErrorString;\n this.GetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public cmi: CMI;\n public adl: ADL;\n\n public Initialize: () => string;\n public Terminate: () => string;\n public GetValue: (CMIElement: string) => string;\n public SetValue: (CMIElement: string, value: any) => string;\n public Commit: () => string;\n public GetLastError: () => string;\n public GetErrorString: (CMIErrorCode: string | number) => string;\n public GetDiagnostic: (CMIErrorCode: string | number) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.adl = new ADL();\n }\n\n /**\n * Getter for _version\n * @return {string}\n */\n get version(): string {\n return this._version;\n }\n\n /**\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n return this.initialize(\"Initialize\");\n }\n\n /**\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"Terminate\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.adl.nav.request !== \"_none_\") {\n const navActions: { [key: string]: string } = {\n continue: \"SequenceNext\",\n previous: \"SequencePrevious\",\n choice: \"SequenceChoice\",\n jump: \"SequenceJump\",\n exit: \"SequenceExit\",\n exitAll: \"SequenceExitAll\",\n abandon: \"SequenceAbandon\",\n abandonAll: \"SequenceAbandonAll\",\n };\n\n let request = this.adl.nav.request;\n const choiceJumpRegex = new RegExp(regex.scorm2004.NAVEvent);\n const matches = request.match(choiceJumpRegex);\n let target = \"\";\n if (matches && matches.length > 2) {\n target = matches[2];\n request = matches[1].replace(target, \"\");\n }\n const action = navActions[request];\n if (action) {\n this.processListeners(action, \"adl.nav.request\", target);\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n const adlNavRequestRegex =\n \"^adl\\\\.nav\\\\.request_valid\\\\.(choice|jump)\\\\.{target=\\\\S{0,}([a-zA-Z0-9-_]+)}$\";\n if (stringMatches(CMIElement, adlNavRequestRegex)) {\n const matches = CMIElement.match(adlNavRequestRegex);\n const request = matches[1];\n const target = matches[2].replace(\"{target=\", \"\").replace(\"}\", \"\");\n if (request === \"choice\" || request === \"jump\") {\n if (this.settings.scoItemIdValidator) {\n return String(this.settings.scoItemIdValidator(target));\n }\n return String(this.settings.scoItemIds.includes(target));\n }\n }\n return this.getValue(\"GetValue\", true, CMIElement);\n }\n\n /**\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n return this.setValue(\"SetValue\", \"Commit\", true, CMIElement, value);\n }\n\n /**\n * Orders LMS to store all content parameters\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"Commit\");\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * Returns last error code\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"GetLastError\");\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string | number): string {\n return this.getErrorString(\"GetErrorString\", CMIErrorCode);\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string | number): string {\n return this.getDiagnostic(\"GetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"SetValue\", true, CMIElement, value);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {any} value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n }\n\n if (foundFirstIndex) {\n if (\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return this.createCorrectResponsesObject(CMIElement, value);\n } else if (\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsObjectivesObject();\n }\n } else if (stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")) {\n return new CMIInteractionsObject();\n }\n\n if (stringMatches(CMIElement, \"cmi\\\\.comments_from_learner\\\\.\\\\d+\")) {\n return new CMICommentsObject();\n } else if (stringMatches(CMIElement, \"cmi\\\\.comments_from_lms\\\\.\\\\d+\")) {\n return new CMICommentsObject(true);\n }\n\n return null;\n }\n\n private createCorrectResponsesObject(\n CMIElement: string,\n value: any,\n ): BaseCMI | null {\n const parts = CMIElement.split(\".\");\n const index = Number(parts[2]);\n const interaction = this.cmi.interactions.childArray[index];\n\n if (this.isInitialized()) {\n if (!interaction.type) {\n this.throwSCORMError(ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED);\n } else {\n this.checkDuplicateChoiceResponse(interaction, value);\n const response_type = CorrectResponses[interaction.type];\n if (response_type) {\n this.checkValidResponseType(response_type, value, interaction.type);\n } else {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Incorrect Response Type: \" + interaction.type,\n );\n }\n }\n }\n\n if (this.lastErrorCode === \"0\") {\n return new CMIInteractionsCorrectResponsesObject();\n }\n\n return null;\n }\n\n /**\n * Checks for valid response types\n * @param {object} response_type\n * @param {any} value\n * @param {string} interaction_type\n */\n checkValidResponseType(\n response_type: ResponseType,\n value: any,\n interaction_type: string,\n ) {\n let nodes = [];\n if (response_type?.delimiter) {\n nodes = String(value).split(response_type.delimiter);\n } else {\n nodes[0] = value;\n }\n\n if (nodes.length > 0 && nodes.length <= response_type.max) {\n this.checkCorrectResponseValue(interaction_type, nodes, value);\n } else if (nodes.length > response_type.max) {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Pattern Too Long\",\n );\n }\n }\n\n /**\n * Checks for duplicate 'choice' responses.\n * @param {CMIInteractionsObject} interaction\n * @param {any} value\n */\n checkDuplicateChoiceResponse(interaction: CMIInteractionsObject, value: any) {\n const interaction_count = interaction.correct_responses._count;\n if (interaction.type === \"choice\") {\n for (\n let i = 0;\n i < interaction_count && this.lastErrorCode === \"0\";\n i++\n ) {\n const response = interaction.correct_responses.childArray[i];\n if (response.pattern === value) {\n this.throwSCORMError(ErrorCodes.scorm2004.GENERAL_SET_FAILURE);\n }\n }\n }\n }\n\n /**\n * Validate correct response.\n * @param {string} CMIElement\n * @param {*} value\n */\n validateCorrectResponse(CMIElement: string, value: any) {\n const parts = CMIElement.split(\".\");\n const index = Number(parts[2]);\n const pattern_index = Number(parts[4]);\n const interaction = this.cmi.interactions.childArray[index];\n\n const interaction_count = interaction.correct_responses._count;\n this.checkDuplicateChoiceResponse(interaction, value);\n\n const response_type = CorrectResponses[interaction.type];\n if (\n typeof response_type.limit === \"undefined\" ||\n interaction_count <= response_type.limit\n ) {\n this.checkValidResponseType(response_type, value, interaction.type);\n\n if (\n (this.lastErrorCode === \"0\" &&\n (!response_type.duplicate ||\n !this.checkDuplicatedPattern(\n interaction.correct_responses,\n pattern_index,\n value,\n ))) ||\n (this.lastErrorCode === \"0\" && value === \"\")\n ) {\n // do nothing, we want the inverse\n } else {\n if (this.lastErrorCode === \"0\") {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Pattern Already Exists\",\n );\n }\n }\n } else {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Collection Limit Reached\",\n );\n }\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"GetValue\", true, CMIElement);\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {(string|number)} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: string | number,\n detail: boolean,\n ): string {\n let basicMessage = \"\";\n let detailMessage = \"\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm2004.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm2004.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm2004.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Check to see if a correct_response value has been duplicated\n * @param {CMIArray} correct_response\n * @param {number} current_index\n * @param {*} value\n * @return {boolean}\n */\n checkDuplicatedPattern(\n correct_response: CMIArray,\n current_index: number,\n value: any,\n ): boolean {\n let found = false;\n const count = correct_response._count;\n for (let i = 0; i < count && !found; i++) {\n if (i !== current_index && correct_response.childArray[i] === value) {\n found = true;\n }\n }\n return found;\n }\n\n /**\n * Checks for a valid correct_response value\n * @param {string} interaction_type\n * @param {Array} nodes\n * @param {*} value\n */\n checkCorrectResponseValue(\n interaction_type: string,\n nodes: Array,\n value: any,\n ) {\n const response = CorrectResponses[interaction_type];\n const formatRegex = new RegExp(response.format);\n for (let i = 0; i < nodes.length && this.lastErrorCode === \"0\"; i++) {\n if (\n interaction_type.match(\n \"^(fill-in|long-fill-in|matching|performance|sequencing)$\",\n )\n ) {\n nodes[i] = this.removeCorrectResponsePrefixes(nodes[i]);\n }\n\n if (response?.delimiter2) {\n const values = nodes[i].split(response.delimiter2);\n if (values.length === 2) {\n const matches = values[0].match(formatRegex);\n if (!matches) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n } else {\n if (\n !response.format2 ||\n !values[1].match(new RegExp(response.format2))\n ) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n } else {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n } else {\n const matches = nodes[i].match(formatRegex);\n if (\n (!matches && value !== \"\") ||\n (!matches && interaction_type === \"true-false\")\n ) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n } else {\n if (interaction_type === \"numeric\" && nodes.length > 1) {\n if (Number(nodes[0]) > Number(nodes[1])) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n } else {\n if (nodes[i] !== \"\" && response.unique) {\n for (let j = 0; j < i && this.lastErrorCode === \"0\"; j++) {\n if (nodes[i] === nodes[j]) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n }\n }\n }\n }\n }\n\n /**\n * Remove prefixes from correct_response\n * @param {string} node\n * @return {*}\n */\n removeCorrectResponsePrefixes(node: string): any {\n let seenOrder = false;\n let seenCase = false;\n let seenLang = false;\n\n const prefixRegex = new RegExp(\n \"^({(lang|case_matters|order_matters)=([^}]+)})\",\n );\n let matches = node.match(prefixRegex);\n let langMatches = null;\n while (matches) {\n switch (matches[2]) {\n case \"lang\":\n langMatches = node.match(Regex.scorm2004.CMILangcr);\n if (langMatches) {\n const lang = langMatches[3];\n if (lang !== undefined && lang.length > 0) {\n if (!ValidLanguages.includes(lang.toLowerCase())) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n seenLang = true;\n break;\n case \"case_matters\":\n if (!seenLang && !seenOrder && !seenCase) {\n if (matches[3] !== \"true\" && matches[3] !== \"false\") {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n\n seenCase = true;\n break;\n case \"order_matters\":\n if (!seenCase && !seenLang && !seenOrder) {\n if (matches[3] !== \"true\" && matches[3] !== \"false\") {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n\n seenOrder = true;\n break;\n }\n node = node.substring(matches[1].length);\n matches = node.match(prefixRegex);\n }\n\n return node;\n }\n\n /**\n * Replace the whole API with another\n * @param {Scorm2004Impl} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm2004Impl) {\n // Data Model\n this.cmi = newAPI.cmi;\n this.adl = newAPI.adl;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeDuration = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getDurationAsSeconds(\n totalTimeDuration,\n Regex.scorm2004.CMITimespan,\n );\n\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (this.cmi.completion_status) {\n if (this.cmi.completion_status === \"completed\") {\n completionStatus = CompletionStatus.completed;\n } else if (this.cmi.completion_status === \"incomplete\") {\n completionStatus = CompletionStatus.incomplete;\n }\n }\n if (this.cmi.success_status) {\n if (this.cmi.success_status === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (this.cmi.success_status === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n if (!Number.isNaN(Number.parseFloat(score.scaled))) {\n scoreObject.scaled = Number.parseFloat(score.scaled);\n }\n }\n\n const commitObject: CommitObject = {\n completionStatus: completionStatus,\n successStatus: successStatus,\n totalTimeSeconds: totalTimeSeconds,\n runtimeData: cmiExport,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n if (this.cmi.mode === \"normal\") {\n if (this.cmi.credit === \"credit\") {\n if (this.cmi.completion_threshold && this.cmi.progress_measure) {\n if (this.cmi.progress_measure >= this.cmi.completion_threshold) {\n this.cmi.completion_status = \"completed\";\n } else {\n this.cmi.completion_status = \"incomplete\";\n }\n }\n if (this.cmi.scaled_passing_score && this.cmi.score.scaled) {\n if (this.cmi.score.scaled >= this.cmi.scaled_passing_score) {\n this.cmi.success_status = \"passed\";\n } else {\n this.cmi.success_status = \"failed\";\n }\n }\n }\n }\n }\n\n let navRequest = false;\n if (\n this.adl.nav.request !== this.startingData?.adl?.nav?.request &&\n this.adl.nav.request !== \"_none_\"\n ) {\n this.adl.nav.request = encodeURIComponent(this.adl.nav.request);\n navRequest = true;\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n const result = await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n\n // check if this is a sequencing call, and then call the necessary JS\n {\n if (\n navRequest &&\n result.navRequest !== undefined &&\n result.navRequest !== \"\"\n ) {\n Function(`\"use strict\";(() => { ${result.navRequest} })()`)();\n }\n }\n return result;\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n\nexport { Scorm2004Impl };\n"],"names":["DefaultSettings","autocommit","autocommitSeconds","asyncCommit","sendFullCommit","lmsCommitUrl","dataCommitFormat","commitRequestDataType","autoProgress","logLevel","A","global","LOG_LEVEL_ERROR","selfReportSessionTime","alwaysSendTotalTime","renderCommonCommitFields","strict_errors","xhrHeaders","xhrWithCredentials","responseHandler","response","JSON","parse","text","httpResult","hasOwnProperty","call","result","errorCode","SCORM_TRUE","status","SCORM_FALSE","requestHandler","commitObject","onLogMessage","messageLevel","logMessage","console","error","LOG_LEVEL_WARNING","warn","LOG_LEVEL_INFO","info","LOG_LEVEL_DEBUG","debug","log","scoItemIds","scoItemIdValidator","API","when","callback","_cancelled","this","_API","_timeout","setTimeout","wrapper","bind","_callback","cancel","clearTimeout","commit","error_codes","settings","_settings","BaseAPI","TypeError","currentState","STATE_NOT_INITIALIZED","lastErrorCode","listenerArray","_error_codes","apiLogLevel","commonReset","initialize","callbackName","initializeMessage","terminationMessage","returnValue","isInitialized","throwSCORMError","INITIALIZED","isTerminated","TERMINATED","cmi","setStartTime","STATE_INITIALIZED","processListeners","apiLog","clearSCORMError","functionName","CMIElement","terminate","checkTerminated","checkState","TERMINATION_BEFORE_INIT","MULTIPLE_TERMINATION","STATE_TERMINATED","storeData","getValue","RETRIEVE_BEFORE_INIT","RETRIEVE_AFTER_TERM","getCMIValue","e","handleValueAccessException","undefined","setValue","commitCallback","value","String","STORE_BEFORE_INIT","STORE_AFTER_TERM","setCMIValue","scheduleCommit","clearScheduledCommit","COMMIT_BEFORE_INIT","COMMIT_AFTER_TERM","getLastError","getErrorString","CMIErrorCode","getLmsErrorMessageDetails","getDiagnostic","beforeInitError","afterTermError","isNotInitialized","_errorNumber","_detail","Error","_CMIElement","_value","_commonSetCMIValue","methodName","scorm2004","structure","split","refObject","foundFirstIndex","invalidErrorMessage","invalidErrorCode","UNDEFINED_DATA_MODEL","GENERAL","idx","length","attribute","substring","READ_ONLY_ELEMENT","_checkObjectHasProperty","validateCorrectResponse","index","parseInt","isNaN","item","childArray","newChild","getChildElement","initialized","push","_commonGetCMIValue","uninitializedErrorMessage","_isTargetValid","target","VALUE_NOT_INITIALIZED","scorm12","CHILDREN_ERROR","COUNT_ERROR","on","listenerName","listenerFunctions","i","listenerSplit","replace","off","removeIndex","findIndex","obj","splice","clear","filter","listener","functionsMatch","listenerHasCMIElement","CMIElementsMatch","indexOf","errorNumber","message","success","loadFromFlattenedJSON","json","int_pattern","obj_pattern","Object","keys","map","key","sort","test","a","c","testPattern","forEach","element","loadFromJSON","a_pattern","c_match","a_match","match","a_num","Number","c_num","startingData","currentCMIElement","constructor","renderCMIToJSONString","stringify","k","v","renderCMIToJSONObject","processHttpRequest","url","params","immediate","api","genericError","performFetch","then","transformResponse","process","debouncedProcess","func","wait","timeout","context","callNow","apply","args","debounce","ScheduledCommit","getOwnPropertyDescriptor","getPrototypeOf","fetch","method","body","Array","join","headers","credentials","keepalive","scorm12_error_codes","__children","children","_errorCode","_errorClass","errorClass","_children","_count","toJSON","jsonString","_initialized","_start_time","Date","getTime","BaseCMI","scorm12_constants","scorm12_regex","_raw","_min","score_children","__score_range","score_range","_max","max","__invalid_error_code","INVALID_SET_VALUE","__invalid_type_code","invalidTypeCode","TYPE_MISMATCH","__invalid_range_code","invalidRangeCode","VALUE_OUT_OF_RANGE","__decimal_regex","decimalRegex","CMIDecimal","__error_class","raw","min","checkValidFormat","regexPattern","allowEmptyString","formatRegex","RegExp","matches","checkValidRange","rangePattern","ranges","cmi_children","core_children","comments_children","objectives_children","correct_responses_children","student_data_children","student_preference_children","interactions_children","error_descriptions","basicMessage","detailMessage","APIConstants","LOG_LEVEL_NONE","aicc","student_demographics_children","tries_children","attempt_records_children","paths_children","NAVBoolean","SuccessStatus","CompletionStatus","INITIALIZATION_FAILED","TERMINATION_FAILURE","ARGUMENT_ERROR","GENERAL_GET_FAILURE","GENERAL_SET_FAILURE","GENERAL_COMMIT_FAILURE","UNIMPLEMENTED_ELEMENT","WRITE_ONLY_ELEMENT","DEPENDENCY_NOT_ESTABLISHED","ErrorCodes","MULTIPLE_TERMINATIONS","CMIString256","CMIString4096","CMITime","CMITimespan","CMIInteger","CMISInteger","CMIIdentifier","CMIFeedback","CMIIndex","CMIStatus","CMIStatus2","CMIExit","CMIType","CMIResult","NAVEvent","audio_range","speed_range","weighting_range","text_range","Regex","CMIString200","CMIString250","CMIString1000","CMIString4000","CMIString64000","CMILang","CMILangString250","CMILangcr","CMILangString250cr","CMILangString4000","CMIShortIdentifier","CMILongIdentifier","CMIIndexStore","CMICStatus","CMISStatus","NAVTarget","scaled_range","progress_range","scorm12_errors","aicc_errors","scorm2004_errors","toString","name","setMessage","errorMessage","detailedMessage","_detailedMessage","_errorMessage","BaseScormValidationError","ValidationError","SECONDS_PER_HOUR","designations","D","H","M","S","getSecondsAsISODuration","seconds","duration","remainder","designationsKey","current_seconds","Math","floor","countDecimals","toFixed","getDurationAsSeconds","durationRegex","exec","years","days","hours","minutes","addTwoDurations","first","second","regex","flatten","data","recurse","cur","prop","isArray","l","isEmpty","p","unflatten","m","num","formatMessage","messageString","fillChars","j","stringMatches","str","tester","extendStatics","d","b","setPrototypeOf","__proto__","prototype","__extends","__","create","__assign","assign","t","s","n","arguments","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","step","next","rejected","done","__generator","f","y","_","label","sent","trys","ops","g","Iterator","verb","Symbol","iterator","op","pop","SuppressedError","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","__webpack_modules__","definition","o","defineProperty","enumerable","get","check2004ValidFormat","check2004ValidRange","_audio_level","_language","_delivery_speed","_audio_captioning","audio_level","language","delivery_speed","audio_captioning","scorm2004_regex","LearnerResponses","format","delimiter","unique","choice","matching","format2","delimiter2","performance","sequencing","likert","numeric","other","CorrectResponses","duplicate","limit","delimiter3","_id","_type","_timestamp","_weighting","_learner_response","_result","_latency","_description","objectives","correct_responses","id","type","timestamp","weighting","learner_response","nodes","response_type","values","latency","description","_pattern","pattern","_scaled","scaled","readOnlyAfterInit","_comment","_location","_readOnlyAfterInit","comment","location","_success_status","_completion_status","_progress_measure","score","Scorm2004CMIScore","success_status","completion_status","progress_measure","__version","_completion_threshold","_credit","_entry","_exit","_launch_data","_learner_id","_learner_name","_max_time_allowed","_mode","_scaled_passing_score","_session_time","_suspend_data","_time_limit_action","_total_time","learner_preference","CMILearnerPreference","comments_from_learner","CMICommentsFromLearner","comments_from_lms","CMICommentsFromLMS","interactions","CMIInteractions","CMIObjectives","_version","completion_threshold","credit","entry","exit","launch_data","learner_id","learner_name","max_time_allowed","mode","scaled_passing_score","session_time","suspend_data","time_limit_action","total_time","getCurrentTotalTime","sessionTime","startTime","start_time","nav","ADLNav","_request","request_valid","ADLNavRequestValid","request","_continue","_previous","_choice","_jump","jump","previous","continue","mastery_override","CMI","adl","ADL","Initialize","lmsInitialize","Terminate","lmsFinish","GetValue","lmsGetValue","SetValue","lmsSetValue","Commit","lmsCommit","GetLastError","lmsGetLastError","GetErrorString","lmsGetErrorString","GetDiagnostic","lmsGetDiagnostic","reset","internalFinish","navActions","exitAll","abandon","abandonAll","choiceJumpRegex","action","adlNavRequestRegex","includes","CMIObjectivesObject","createCorrectResponsesObject","CMIInteractionsObjectivesObject","CMIInteractionsObject","CMICommentsObject","parts","interaction","checkDuplicateChoiceResponse","checkValidResponseType","CMIInteractionsCorrectResponsesObject","interaction_type","checkCorrectResponseValue","interaction_count","pattern_index","checkDuplicatedPattern","detail","correct_response","current_index","found","count","removeCorrectResponsePrefixes","node","seenOrder","seenCase","seenLang","prefixRegex","langMatches","lang","toLowerCase","replaceWithAnotherScormAPI","newAPI","renderCommitCMI","terminateCommit","cmiExport","flattened","renderCommitObject","totalTimeDuration","totalTimeSeconds","completionStatus","unknown","successStatus","completed","incomplete","passed","failed","scoreObject","parseFloat","runtimeData","navRequest","encodeURIComponent","shouldTerminateCommit","Function"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/scorm-again.js b/dist/scorm-again.js index 42436f5..554259d 100644 --- a/dist/scorm-again.js +++ b/dist/scorm-again.js @@ -6981,7 +6981,9 @@ var Scorm2004API = _Scorm2004API__WEBPACK_IMPORTED_MODULE_2__.Scorm2004Impl; var AICC = _AICC__WEBPACK_IMPORTED_MODULE_0__.AICCImpl; -module.exports = __webpack_exports__; +var __webpack_export_target__ = this; +for(var i in __webpack_exports__) __webpack_export_target__[i] = __webpack_exports__[i]; +if(__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, "__esModule", { value: true }); /******/ })() ; //# sourceMappingURL=scorm-again.js.map \ No newline at end of file diff --git a/dist/scorm-again.min.js b/dist/scorm-again.min.js index cf20bdc..e7632f4 100644 --- a/dist/scorm-again.min.js +++ b/dist/scorm-again.min.js @@ -1,2 +1,2 @@ -!function(){"use strict";var e={531:function(e,t,i){i.d(t,{AICCImpl:function(){return R}});var r=i(635),n=i(941),o=i(989),s=i(340),a=i(589),c=i(784),l=i(319),u=i(797),h=i(449),_=u.A.scorm12;function m(e,t,i){return(0,h.q)(e,t,_.TYPE_MISMATCH,c.gv,i)}var d=i(417),p=function(e){function t(){var t=e.call(this)||this;return t.comments=new f,t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.comments)||void 0===t||t.initialize()},t.prototype.toJSON=function(){this.jsonString=!0;var e={comments:this.comments};return delete this.jsonString,e},t}(l.J),f=function(e){function t(){return e.call(this,{children:s.A.aicc.comments_children,errorCode:u.A.scorm12.INVALID_SET_VALUE,errorClass:c.gv})||this}return(0,r.C6)(t,e),t}(a.B),g=function(e){function t(){var t=e.call(this)||this;return t._content="",t._location="",t._time="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"content",{get:function(){return this._content},set:function(e){m(e,d.A.aicc.CMIString256)&&(this._content=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"location",{get:function(){return this._location},set:function(e){m(e,d.A.aicc.CMIString256)&&(this._location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){return this._time},set:function(e){m(e,d.A.aicc.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={content:this.content,location:this.location,time:this.time};return delete this.jsonString,e},t}(l.J),E=function(e){function t(){var t=e.call(this,s.A.aicc.student_preference_children)||this;return t._lesson_type="",t._text_color="",t._text_location="",t._text_size="",t._video="",t.windows=new a.B({errorCode:u.A.scorm12.INVALID_SET_VALUE,errorClass:c.gv,children:""}),t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.windows)||void 0===t||t.initialize()},Object.defineProperty(t.prototype,"lesson_type",{get:function(){return this._lesson_type},set:function(e){m(e,d.A.aicc.CMIString256)&&(this._lesson_type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text_color",{get:function(){return this._text_color},set:function(e){m(e,d.A.aicc.CMIString256)&&(this._text_color=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text_location",{get:function(){return this._text_location},set:function(e){m(e,d.A.aicc.CMIString256)&&(this._text_location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text_size",{get:function(){return this._text_size},set:function(e){m(e,d.A.aicc.CMIString256)&&(this._text_size=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"video",{get:function(){return this._video},set:function(e){m(e,d.A.aicc.CMIString256)&&(this._video=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,lesson_type:this.lesson_type,speed:this.speed,text:this.text,text_color:this.text_color,text_location:this.text_location,text_size:this.text_size,video:this.video,windows:this.windows};return delete this.jsonString,e},t}(i(181).G),b=function(e){function t(){var t=e.call(this)||this;return t.__children=s.A.aicc.student_demographics_children,t._city="",t._class="",t._company="",t._country="",t._experience="",t._familiar_name="",t._instructor_name="",t._title="",t._native_language="",t._state="",t._street_address="",t._telephone="",t._years_experience="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"city",{get:function(){return this._city},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._city=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"class",{get:function(){return this._class},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._class=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"company",{get:function(){return this._company},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._company=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"country",{get:function(){return this._country},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._country=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"experience",{get:function(){return this._experience},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._experience=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"familiar_name",{get:function(){return this._familiar_name},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._familiar_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"instructor_name",{get:function(){return this._instructor_name},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._instructor_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){return this._title},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._title=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"native_language",{get:function(){return this._native_language},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._native_language=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._state=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"street_address",{get:function(){return this._street_address},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._street_address=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"telephone",{get:function(){return this._telephone},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._telephone=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"years_experience",{get:function(){return this._years_experience},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._years_experience=e},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={city:this.city,class:this.class,company:this.company,country:this.country,experience:this.experience,familiar_name:this.familiar_name,instructor_name:this.instructor_name,title:this.title,native_language:this.native_language,state:this.state,street_address:this.street_address,telephone:this.telephone,years_experience:this.years_experience};return delete this.jsonString,e},t}(l.J),y=i(434),A=function(e){function t(){return e.call(this,{children:s.A.aicc.tries_children})||this}return(0,r.C6)(t,e),t}(a.B),M=function(e){function t(){var t=e.call(this)||this;return t._status="",t._time="",t.score=new y._({score_children:s.A.aicc.score_children,score_range:d.A.aicc.score_range,invalidErrorCode:u.A.scorm12.INVALID_SET_VALUE,invalidTypeCode:u.A.scorm12.TYPE_MISMATCH,invalidRangeCode:u.A.scorm12.VALUE_OUT_OF_RANGE,errorClass:c.gv}),t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(t.prototype,"status",{get:function(){return this._status},set:function(e){m(e,d.A.aicc.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){return this._time},set:function(e){m(e,d.A.aicc.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={status:this.status,time:this.time,score:this.score};return delete this.jsonString,e},t}(l.J),C=i(532),v=function(e){function t(){return e.call(this,{children:s.A.aicc.attempt_records_children})||this}return(0,r.C6)(t,e),t}(a.B),I=function(e){function t(){var t=e.call(this)||this;return t._lesson_status="",t.score=new y._({score_children:s.A.aicc.score_children,score_range:d.A.aicc.score_range,invalidErrorCode:u.A.scorm12.INVALID_SET_VALUE,invalidTypeCode:u.A.scorm12.TYPE_MISMATCH,invalidRangeCode:u.A.scorm12.VALUE_OUT_OF_RANGE,errorClass:c.gv}),t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(t.prototype,"lesson_status",{get:function(){return this._lesson_status},set:function(e){m(e,d.A.aicc.CMIStatus2)&&(this._lesson_status=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={lesson_status:this.lesson_status,score:this.score};return delete this.jsonString,e},t}(l.J),S=function(e){function t(){var t=e.call(this,s.A.aicc.student_data_children)||this;return t._tries_during_lesson="",t.tries=new A,t.attempt_records=new v,t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t,i;e.prototype.initialize.call(this),null===(t=this.tries)||void 0===t||t.initialize(),null===(i=this.attempt_records)||void 0===i||i.initialize()},Object.defineProperty(t.prototype,"tries_during_lesson",{get:function(){return this._tries_during_lesson},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._tries_during_lesson=e},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={mastery_score:this.mastery_score,max_time_allowed:this.max_time_allowed,time_limit_action:this.time_limit_action,tries:this.tries,attempt_records:this.attempt_records};return delete this.jsonString,e},t}(C.X),w=function(e){function t(){return e.call(this,{children:s.A.aicc.paths_children})||this}return(0,r.C6)(t,e),t}(a.B),O=function(e){function t(){var t=e.call(this)||this;return t._location_id="",t._date="",t._time="",t._status="",t._why_left="",t._time_in_element="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"location_id",{get:function(){return this._location_id},set:function(e){m(e,d.A.aicc.CMIString256)&&(this._location_id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"date",{get:function(){return this._date},set:function(e){m(e,d.A.aicc.CMIString256)&&(this._date=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){return this._time},set:function(e){m(e,d.A.aicc.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},set:function(e){m(e,d.A.aicc.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"why_left",{get:function(){return this._why_left},set:function(e){m(e,d.A.aicc.CMIString256)&&(this._why_left=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time_in_element",{get:function(){return this._time_in_element},set:function(e){m(e,d.A.aicc.CMITime)&&(this._time_in_element=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={location_id:this.location_id,date:this.date,time:this.time,status:this.status,why_left:this.why_left,time_in_element:this.time_in_element};return delete this.jsonString,e},t}(l.J),T=function(e){function t(t){void 0===t&&(t=!1);var i=e.call(this,s.A.aicc.cmi_children)||this;return t&&i.initialize(),i.student_preference=new E,i.student_data=new S,i.student_demographics=new b,i.evaluation=new p,i.paths=new w,i}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t,i,r,n,o;e.prototype.initialize.call(this),null===(t=this.student_preference)||void 0===t||t.initialize(),null===(i=this.student_data)||void 0===i||i.initialize(),null===(r=this.student_demographics)||void 0===r||r.initialize(),null===(n=this.evaluation)||void 0===n||n.initialize(),null===(o=this.paths)||void 0===o||o.initialize()},t.prototype.toJSON=function(){this.jsonString=!0;var e={suspend_data:this.suspend_data,launch_data:this.launch_data,comments:this.comments,comments_from_lms:this.comments_from_lms,core:this.core,objectives:this.objectives,student_data:this.student_data,student_preference:this.student_preference,student_demographics:this.student_demographics,interactions:this.interactions,evaluation:this.evaluation,paths:this.paths};return delete this.jsonString,e},t}(o.Y),L=i(331),N=i(864),R=function(e){function t(t){var i=e.call(this,t)||this;return i.cmi=new T,i.nav=new L.A,i}return(0,r.C6)(t,e),t.prototype.getChildElement=function(t,i,r){var n=e.prototype.getChildElement.call(this,t,i,r);return n||((0,N.J6)(t,"cmi\\.evaluation\\.comments\\.\\d+")?n=new g:(0,N.J6)(t,"cmi\\.student_data\\.tries\\.\\d+")?n=new M:(0,N.J6)(t,"cmi\\.student_data\\.attempt_records\\.\\d+")?n=new I:(0,N.J6)(t,"cmi\\.paths\\.\\d+")&&(n=new O)),n},t.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi,this.nav=e.nav},t}(n.Scorm12Impl)},900:function(e,t,i){i.d(t,{A:function(){return _}});var r=i(635),n=i(589),o=i(784),s=i(797),a=i(340),c=i(864);var l={autocommit:!1,autocommitSeconds:10,asyncCommit:!1,sendFullCommit:!0,lmsCommitUrl:!1,dataCommitFormat:"json",commitRequestDataType:"application/json;charset=UTF-8",autoProgress:!1,logLevel:a.A.global.LOG_LEVEL_ERROR,selfReportSessionTime:!1,alwaysSendTotalTime:!1,renderCommonCommitFields:!1,strict_errors:!0,xhrHeaders:{},xhrWithCredentials:!1,responseHandler:function(e){return(0,r.sH)(this,void 0,void 0,(function(){var t,i,n;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return void 0===e?[3,2]:(n=(i=JSON).parse,[4,e.text()]);case 1:return null!==(t=n.apply(i,[r.sent()]))&&{}.hasOwnProperty.call(t,"result")?[2,{result:t.result,errorCode:t.errorCode?t.errorCode:t.result===a.A.global.SCORM_TRUE?0:101}]:200===e.status?[2,{result:a.A.global.SCORM_TRUE,errorCode:0}]:[2,{result:a.A.global.SCORM_FALSE,errorCode:101}];case 2:return[2,{result:a.A.global.SCORM_FALSE,errorCode:101}]}}))}))},requestHandler:function(e){return e},onLogMessage:function(e,t){switch(e){case a.A.global.LOG_LEVEL_ERROR:console.error(t);break;case a.A.global.LOG_LEVEL_WARNING:console.warn(t);break;case a.A.global.LOG_LEVEL_INFO:console.info(t);break;case a.A.global.LOG_LEVEL_DEBUG:console.debug?console.debug(t):console.log(t)}},scoItemIds:[],scoItemIdValidator:!1},u=function(){function e(e,t,i){this._cancelled=!1,this._API=e,this._timeout=setTimeout(this.wrapper.bind(this),t),this._callback=i}return e.prototype.cancel=function(){this._cancelled=!0,this._timeout&&clearTimeout(this._timeout)},e.prototype.wrapper=function(){var e=this;this._cancelled||(0,r.sH)(e,void 0,void 0,(function(){return(0,r.YH)(this,(function(e){switch(e.label){case 0:return[4,this._API.commit(this._callback)];case 1:return[2,e.sent()]}}))}))},e}(),h=function(){function e(t,i){var r=this.constructor;if(this._settings=l,r===e)throw new TypeError("Cannot construct BaseAPI instances directly");this.currentState=a.A.global.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[],this._error_codes=t,i&&(this.settings=i),this.apiLogLevel=this.settings.logLevel,this.selfReportSessionTime=this.settings.selfReportSessionTime}return e.prototype.commonReset=function(e){this.settings=(0,r.Cl)((0,r.Cl)({},this.settings),e),this.currentState=a.A.global.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[]},e.prototype.initialize=function(e,t,i){var r=a.A.global.SCORM_FALSE;return this.isInitialized()?this.throwSCORMError(this._error_codes.INITIALIZED,t):this.isTerminated()?this.throwSCORMError(this._error_codes.TERMINATED,i):(this.selfReportSessionTime&&this.cmi.setStartTime(),this.currentState=a.A.global.STATE_INITIALIZED,this.lastErrorCode="0",r=a.A.global.SCORM_TRUE,this.processListeners(e)),this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(r),r},e.prototype.apiLog=function(e,t,i,r){t=(0,c.hw)(e,t,r),i>=this.apiLogLevel&&this.settings.onLogMessage(i,t)},Object.defineProperty(e.prototype,"error_codes",{get:function(){return this._error_codes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"settings",{get:function(){return this._settings},set:function(e){this._settings=(0,r.Cl)((0,r.Cl)({},this._settings),e)},enumerable:!1,configurable:!0}),e.prototype.terminate=function(e,t){return(0,r.sH)(this,void 0,void 0,(function(){var i,n;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return i=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.TERMINATION_BEFORE_INIT,this._error_codes.MULTIPLE_TERMINATION)?(this.currentState=a.A.global.STATE_TERMINATED,[4,this.storeData(!0)]):[3,2];case 1:void 0!==(n=r.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),i=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,t&&(this.lastErrorCode="0"),i=a.A.global.SCORM_TRUE,this.processListeners(e),r.label=2;case 2:return this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(i),[2,i]}}))}))},e.prototype.getValue=function(e,t,i){var r="";if(this.checkState(t,this._error_codes.RETRIEVE_BEFORE_INIT,this._error_codes.RETRIEVE_AFTER_TERM)){t&&(this.lastErrorCode="0");try{r=this.getCMIValue(i)}catch(e){r=this.handleValueAccessException(e,r)}this.processListeners(e,i)}return this.apiLog(e,": returned: "+r,a.A.global.LOG_LEVEL_INFO,i),void 0===r?"":(this.clearSCORMError(r),r)},e.prototype.setValue=function(e,t,i,r,n){void 0!==n&&(n=String(n));var o=a.A.global.SCORM_FALSE;if(this.checkState(i,this._error_codes.STORE_BEFORE_INIT,this._error_codes.STORE_AFTER_TERM)){i&&(this.lastErrorCode="0");try{o=this.setCMIValue(r,n)}catch(e){this.handleValueAccessException(e,o)}this.processListeners(e,r,n)}return void 0===o&&(o=a.A.global.SCORM_FALSE),"0"===String(this.lastErrorCode)&&this.settings.autocommit&&!this._timeout&&this.scheduleCommit(1e3*this.settings.autocommitSeconds,t),this.apiLog(e,": "+n+": result: "+o,a.A.global.LOG_LEVEL_INFO,r),this.clearSCORMError(o),o},e.prototype.commit=function(e){return(0,r.sH)(this,arguments,void 0,(function(e,t){var i,n;return void 0===t&&(t=!1),(0,r.YH)(this,(function(r){switch(r.label){case 0:return this.clearScheduledCommit(),i=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.COMMIT_BEFORE_INIT,this._error_codes.COMMIT_AFTER_TERM)?[4,this.storeData(!1)]:[3,2];case 1:(n=r.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),i=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,this.apiLog(e," Result: "+i,a.A.global.LOG_LEVEL_DEBUG,"HttpRequest"),t&&(this.lastErrorCode="0"),this.processListeners(e),r.label=2;case 2:return this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(i),[2,i]}}))}))},e.prototype.getLastError=function(e){var t=String(this.lastErrorCode);return this.processListeners(e),this.apiLog(e,"returned: "+t,a.A.global.LOG_LEVEL_INFO),t},e.prototype.getErrorString=function(e,t){var i="";return null!==t&&""!==t&&(i=this.getLmsErrorMessageDetails(t),this.processListeners(e)),this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),i},e.prototype.getDiagnostic=function(e,t){var i="";return null!==t&&""!==t&&(i=this.getLmsErrorMessageDetails(t,!0),this.processListeners(e)),this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),i},e.prototype.checkState=function(e,t,i){return this.isNotInitialized()?(this.throwSCORMError(t),!1):!e||!this.isTerminated()||(this.throwSCORMError(i),!1)},e.prototype.getLmsErrorMessageDetails=function(e,t){throw void 0===t&&(t=!1),new Error("The getLmsErrorMessageDetails method has not been implemented")},e.prototype.getCMIValue=function(e){throw new Error("The getCMIValue method has not been implemented")},e.prototype.setCMIValue=function(e,t){throw new Error("The setCMIValue method has not been implemented")},e.prototype._commonSetCMIValue=function(e,t,i,o){if(!i||""===i)return a.A.global.SCORM_FALSE;for(var s=i.split("."),l=this,u=a.A.global.SCORM_FALSE,h=!1,_="The data model element passed to ".concat(e," (").concat(i,") is not a valid SCORM data model element."),m=t?this._error_codes.UNDEFINED_DATA_MODEL:this._error_codes.GENERAL,d=0;d1&&(s=e.replace(o+".","")),this.listenerArray.push({functionName:o,CMIElement:s,callback:t}),this.apiLog("on","Added event listener: ".concat(this.listenerArray.length),a.A.global.LOG_LEVEL_INFO,o)}},e.prototype.off=function(e,t){if(t)for(var i=e.split(" "),r=function(r){var o=i[r].split(".");if(0===o.length)return{value:void 0};var s=o[0],c=null;o.length>1&&(c=e.replace(s+".",""));var l=n.listenerArray.findIndex((function(e){return e.functionName===s&&e.CMIElement===c&&e.callback===t}));-1!==l&&(n.listenerArray.splice(l,1),n.apiLog("off","Removed event listener: ".concat(n.listenerArray.length),a.A.global.LOG_LEVEL_INFO,s))},n=this,o=0;o1&&(s=e.replace(o+".","")),r.listenerArray=r.listenerArray.filter((function(e){return e.functionName!==o&&e.CMIElement!==s}))},r=this,n=0;ns?1:0})),s.forEach((function(e){(r={})[e[0]]=e[1],i.loadFromJSON((0,c.sB)(r),t)}))}else console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize.");function a(e,t,i){var r,n=e.match(i);if(null!==n&&null!==(r=t.match(i))){var o=Number(n[2]),s=Number(r[2]);return o===s?"id"===n[3]?-1:"type"===n[3]?"id"===r[3]?1:-1:1:o-s}return null}},e.prototype.loadFromJSON=function(e,t){if(this.isNotInitialized()){for(var i in t=void 0!==t?t:"cmi",this.startingData=e,e)if({}.hasOwnProperty.call(e,i)&&e[i]){var r=(t?t+".":"")+i,n=e[i];if(n.childArray)for(var o=0;o=200&&e.status<=299&&(!0===t.result||t.result===a.A.global.SCORM_TRUE)?this.processListeners("CommitSuccess"):this.processListeners("CommitError"),[2,t]}}))}))},e}(),_=h},941:function(e,t,i){i.d(t,{Scorm12Impl:function(){return m}});var r=i(635),n=i(989),o=i(864),s=i(340),a=i(797),c=i(176),l=i(833),u=i(331),h=i(417),_=i(56),m=function(e){function t(t){var i=this;return t&&void 0===t.mastery_override&&(t.mastery_override=!1),(i=e.call(this,a.A.scorm12,t)||this).statusSetByModule=!1,i.cmi=new n.Y,i.nav=new u.A,i.LMSInitialize=i.lmsInitialize,i.LMSFinish=i.lmsFinish,i.LMSGetValue=i.lmsGetValue,i.LMSSetValue=i.lmsSetValue,i.LMSCommit=i.lmsCommit,i.LMSGetLastError=i.lmsGetLastError,i.LMSGetErrorString=i.lmsGetErrorString,i.LMSGetDiagnostic=i.lmsGetDiagnostic,i}return(0,r.C6)(t,e),t.prototype.reset=function(e){this.commonReset(e),this.cmi=new n.Y,this.nav=new u.A},t.prototype.lmsInitialize=function(){return this.cmi.initialize(),this.cmi.core.lesson_status?this.statusSetByModule=!0:this.cmi.core.lesson_status="not attempted",this.initialize("LMSInitialize","LMS was already initialized!","LMS is already finished!")},t.prototype.lmsFinish=function(){var e=this;return(0,r.sH)(e,void 0,void 0,(function(){return(0,r.YH)(this,(function(e){switch(e.label){case 0:return[4,this.internalFinish()];case 1:return e.sent(),[2]}}))})),s.A.global.SCORM_TRUE},t.prototype.internalFinish=function(){return(0,r.sH)(this,void 0,void 0,(function(){var e;return(0,r.YH)(this,(function(t){switch(t.label){case 0:return[4,this.terminate("LMSFinish",!0)];case 1:return(e=t.sent())===s.A.global.SCORM_TRUE&&(""!==this.nav.event?"continue"===this.nav.event?this.processListeners("SequenceNext"):this.processListeners("SequencePrevious"):this.settings.autoProgress&&this.processListeners("SequenceNext")),[2,e]}}))}))},t.prototype.lmsGetValue=function(e){return this.getValue("LMSGetValue",!1,e)},t.prototype.lmsSetValue=function(e,t){return"cmi.core.lesson_status"===e&&(this.statusSetByModule=!0),this.setValue("LMSSetValue","LMSCommit",!1,e,t)},t.prototype.lmsCommit=function(){var e=this;return(0,r.sH)(e,void 0,void 0,(function(){return(0,r.YH)(this,(function(e){switch(e.label){case 0:return[4,this.commit("LMSCommit",!1)];case 1:return e.sent(),[2]}}))})),s.A.global.SCORM_TRUE},t.prototype.lmsGetLastError=function(){return this.getLastError("LMSGetLastError")},t.prototype.lmsGetErrorString=function(e){return this.getErrorString("LMSGetErrorString",e)},t.prototype.lmsGetDiagnostic=function(e){return this.getDiagnostic("LMSGetDiagnostic",e)},t.prototype.setCMIValue=function(e,t){return this._commonSetCMIValue("LMSSetValue",!1,e,t)},t.prototype.getCMIValue=function(e){return this._commonGetCMIValue("getCMIValue",!1,e)},t.prototype.getChildElement=function(e,t,i){return(0,o.J6)(e,"cmi\\.objectives\\.\\d+")?new c.N:i&&(0,o.J6)(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")?new l.cb:i&&(0,o.J6)(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")?new l.Oh:!i&&(0,o.J6)(e,"cmi\\.interactions\\.\\d+")?new l.WP:null},t.prototype.validateCorrectResponse=function(e,t){},t.prototype.getLmsErrorMessageDetails=function(e,t){var i="No Error",r="No Error";return e=String(e),s.A.scorm12.error_descriptions[e]&&(i=s.A.scorm12.error_descriptions[e].basicMessage,r=s.A.scorm12.error_descriptions[e].detailMessage),t?r:i},t.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi},t.prototype.renderCommitCMI=function(e){var t=this.renderCMIToJSONObject();e&&(t.cmi.core.total_time=this.cmi.getCurrentTotalTime());var i=[],r=o.Bq(t);switch(this.settings.dataCommitFormat){case"flattened":return o.Bq(t);case"params":for(var n in r)({}).hasOwnProperty.call(r,n)&&i.push("".concat(n,"=").concat(r[n]));return i;default:return t}},t.prototype.renderCommitObject=function(e){var t=this.renderCommitCMI(e),i=this.cmi.getCurrentTotalTime(),r=o.f4(i,h.A.scorm12.CMITimespan),n=this.cmi.core.lesson_status,s=_.lC.unknown,a=_.YE.unknown;n&&(s="completed"===n||"passed"===n?_.lC.completed:_.lC.incomplete,"passed"===n?a=_.YE.passed:"failed"===n&&(a=_.YE.failed));var c=this.cmi.core.score,l=null;c&&(l={},Number.isNaN(Number.parseFloat(c.raw))||(l.raw=Number.parseFloat(c.raw)),Number.isNaN(Number.parseFloat(c.min))||(l.min=Number.parseFloat(c.min)),Number.isNaN(Number.parseFloat(c.max))||(l.max=Number.parseFloat(c.max)));var u={successStatus:a,completionStatus:s,runtimeData:t,totalTimeSeconds:r};return l&&(u.score=l),u},t.prototype.storeData=function(e){return(0,r.sH)(this,void 0,void 0,(function(){var t,i,n,o,a,c;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return e&&(t=this.cmi.core.lesson_status,this.cmi.core.lesson_status&&(this.statusSetByModule||"not attempted"!==this.cmi.core.lesson_status)||(this.cmi.core.lesson_status="completed"),"normal"===this.cmi.core.lesson_mode?"credit"===this.cmi.core.credit&&this.settings.mastery_override&&""!==this.cmi.student_data.mastery_score&&""!==this.cmi.core.score.raw&&(this.cmi.core.lesson_status=parseFloat(this.cmi.core.score.raw)>=parseFloat(this.cmi.student_data.mastery_score)?"passed":"failed"):"browse"===this.cmi.core.lesson_mode&&""===((null===(c=null===(a=null===(o=this.startingData)||void 0===o?void 0:o.cmi)||void 0===a?void 0:a.core)||void 0===c?void 0:c.lesson_status)||"")&&"not attempted"===t&&(this.cmi.core.lesson_status="browsed")),i=e||this.settings.alwaysSendTotalTime,n=this.settings.renderCommonCommitFields?this.renderCommitObject(i):this.renderCommitCMI(i),this.apiLogLevel===s.A.global.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(n)),"string"!=typeof this.settings.lmsCommitUrl?[3,2]:[4,this.processHttpRequest(this.settings.lmsCommitUrl,n,e)];case 1:return[2,r.sent()];case 2:return[2,{result:s.A.global.SCORM_TRUE,errorCode:0}]}}))}))},t}(i(900).A)},180:function(e,t,i){i.d(t,{Scorm2004Impl:function(){return P}});var r=i(635),n=i(900),o=i(340),s=i(417),a=i(797),c=i(784),l=i(864),u=i(319),h=i(449);function _(e,t,i){return(0,h.q)(e,t,a.A.scorm2004.TYPE_MISMATCH,c.wq,i)}function m(e,t){return(0,h.W)(e,t,a.A.scorm2004.VALUE_OUT_OF_RANGE,c.wq)}var d=function(e){function t(){var t=e.call(this)||this;return t.__children=o.A.scorm2004.student_preference_children,t._audio_level="1",t._language="",t._delivery_speed="1",t._audio_captioning="0",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new c.wq(a.A.scorm2004.READ_ONLY_ELEMENT)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audio_level",{get:function(){return this._audio_level},set:function(e){_(e,s.A.scorm2004.CMIDecimal)&&m(e,s.A.scorm2004.audio_range)&&(this._audio_level=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"language",{get:function(){return this._language},set:function(e){_(e,s.A.scorm2004.CMILang)&&(this._language=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"delivery_speed",{get:function(){return this._delivery_speed},set:function(e){_(e,s.A.scorm2004.CMIDecimal)&&m(e,s.A.scorm2004.speed_range)&&(this._delivery_speed=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audio_captioning",{get:function(){return this._audio_captioning},set:function(e){_(e,s.A.scorm2004.CMISInteger)&&m(e,s.A.scorm2004.text_range)&&(this._audio_captioning=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={audio_level:this.audio_level,language:this.language,delivery_speed:this.delivery_speed,audio_captioning:this.audio_captioning};return delete this.jsonString,e},t}(u.J),p=i(589),f=s.A.scorm2004,g={"true-false":{format:"^true$|^false$",max:1,delimiter:"",unique:!1},choice:{format:f.CMILongIdentifier,max:36,delimiter:"[,]",unique:!0},"fill-in":{format:f.CMILangString250,max:10,delimiter:"[,]",unique:!1},"long-fill-in":{format:f.CMILangString4000,max:1,delimiter:"",unique:!1},matching:{format:f.CMIShortIdentifier,format2:f.CMIShortIdentifier,max:36,delimiter:"[,]",delimiter2:"[.]",unique:!1},performance:{format:"^$|"+f.CMIShortIdentifier,format2:f.CMIDecimal+"|^$|"+f.CMIShortIdentifier,max:250,delimiter:"[,]",delimiter2:"[.]",unique:!1},sequencing:{format:f.CMIShortIdentifier,max:36,delimiter:"[,]",unique:!1},likert:{format:f.CMIShortIdentifier,max:1,delimiter:"",unique:!1},numeric:{format:f.CMIDecimal,max:1,delimiter:"",unique:!1},other:{format:f.CMIString4000,max:1,delimiter:"",unique:!1}},E={"true-false":{max:1,delimiter:"",unique:!1,duplicate:!1,format:"^true$|^false$",limit:1},choice:{max:36,delimiter:"[,]",unique:!0,duplicate:!1,format:f.CMILongIdentifier},"fill-in":{max:10,delimiter:"[,]",unique:!1,duplicate:!1,format:f.CMILangString250cr},"long-fill-in":{max:1,delimiter:"",unique:!1,duplicate:!0,format:f.CMILangString4000},matching:{max:36,delimiter:"[,]",delimiter2:"[.]",unique:!1,duplicate:!1,format:f.CMIShortIdentifier,format2:f.CMIShortIdentifier},performance:{max:250,delimiter:"[,]",delimiter2:"[.]",delimiter3:"[:]",unique:!1,duplicate:!1,format:"^$|"+f.CMIShortIdentifier,format2:f.CMIDecimal+"|^$|"+f.CMIShortIdentifier},sequencing:{max:36,delimiter:"[,]",unique:!1,duplicate:!1,format:f.CMIShortIdentifier},likert:{max:1,delimiter:"",unique:!1,duplicate:!1,format:f.CMIShortIdentifier,limit:1},numeric:{max:2,delimiter:"[:]",unique:!1,duplicate:!1,format:f.CMIDecimal,limit:1},other:{max:1,delimiter:"",unique:!1,duplicate:!1,format:f.CMIString4000,limit:1}},b=function(e){function t(){return e.call(this,{children:o.A.scorm2004.interactions_children,errorCode:a.A.scorm2004.READ_ONLY_ELEMENT,errorClass:c.wq})||this}return(0,r.C6)(t,e),t}(p.B),y=function(e){function t(){var t=e.call(this)||this;return t._id="",t._type="",t._timestamp="",t._weighting="",t._learner_response="",t._result="",t._latency="",t._description="",t.objectives=new p.B({errorCode:a.A.scorm2004.READ_ONLY_ELEMENT,errorClass:c.wq,children:o.A.scorm2004.objectives_children}),t.correct_responses=new p.B({errorCode:a.A.scorm2004.READ_ONLY_ELEMENT,errorClass:c.wq,children:o.A.scorm2004.correct_responses_children}),t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t,i;e.prototype.initialize.call(this),null===(t=this.objectives)||void 0===t||t.initialize(),null===(i=this.correct_responses)||void 0===i||i.initialize()},Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(e){_(e,s.A.scorm2004.CMILongIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this._type},set:function(e){if(this.initialized&&""===this._id)throw new c.wq(a.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED);_(e,s.A.scorm2004.CMIType)&&(this._type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"timestamp",{get:function(){return this._timestamp},set:function(e){if(this.initialized&&""===this._id)throw new c.wq(a.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED);_(e,s.A.scorm2004.CMITime)&&(this._timestamp=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weighting",{get:function(){return this._weighting},set:function(e){if(this.initialized&&""===this._id)throw new c.wq(a.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED);_(e,s.A.scorm2004.CMIDecimal)&&(this._weighting=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"learner_response",{get:function(){return this._learner_response},set:function(e){if(this.initialized&&(""===this._type||""===this._id))throw new c.wq(a.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED);var t=[],i=g[this.type];if(!i)throw new c.wq(a.A.scorm2004.TYPE_MISMATCH);if((null==i?void 0:i.delimiter)?t=e.split(i.delimiter):t[0]=e,!(t.length>0&&t.length<=i.max))throw new c.wq(a.A.scorm2004.GENERAL_SET_FAILURE);for(var r=new RegExp(i.format),n=0;n2&&(c=a[2],i=a[1].replace(c,"")),(l=t[i])&&this.processListeners(l,"adl.nav.request",c)):this.settings.autoProgress&&this.processListeners("SequenceNext")),[2,e]}}))}))},t.prototype.lmsGetValue=function(e){var t="^adl\\.nav\\.request_valid\\.(choice|jump)\\.{target=\\S{0,}([a-zA-Z0-9-_]+)}$";if((0,l.J6)(e,t)){var i=e.match(t),r=i[1],n=i[2].replace("{target=","").replace("}","");if("choice"===r||"jump"===r)return this.settings.scoItemIdValidator?String(this.settings.scoItemIdValidator(n)):String(this.settings.scoItemIds.includes(n))}return this.getValue("GetValue",!0,e)},t.prototype.lmsSetValue=function(e,t){return this.setValue("SetValue","Commit",!0,e,t)},t.prototype.lmsCommit=function(){var e=this;return(0,r.sH)(e,void 0,void 0,(function(){return(0,r.YH)(this,(function(e){switch(e.label){case 0:return[4,this.commit("Commit")];case 1:return e.sent(),[2]}}))})),o.A.global.SCORM_TRUE},t.prototype.lmsGetLastError=function(){return this.getLastError("GetLastError")},t.prototype.lmsGetErrorString=function(e){return this.getErrorString("GetErrorString",e)},t.prototype.lmsGetDiagnostic=function(e){return this.getDiagnostic("GetDiagnostic",e)},t.prototype.setCMIValue=function(e,t){return this._commonSetCMIValue("SetValue",!0,e,t)},t.prototype.getChildElement=function(e,t,i){if((0,l.J6)(e,"cmi\\.objectives\\.\\d+"))return new O;if(i){if((0,l.J6)(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+"))return this.createCorrectResponsesObject(e,t);if((0,l.J6)(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+"))return new A}else if((0,l.J6)(e,"cmi\\.interactions\\.\\d+"))return new y;return(0,l.J6)(e,"cmi\\.comments_from_learner\\.\\d+")?new S:(0,l.J6)(e,"cmi\\.comments_from_lms\\.\\d+")?new S(!0):null},t.prototype.createCorrectResponsesObject=function(e,t){var i=e.split("."),r=Number(i[2]),n=this.cmi.interactions.childArray[r];if(this.isInitialized())if(n.type){this.checkDuplicateChoiceResponse(n,t);var o=E[n.type];o?this.checkValidResponseType(o,t,n.type):this.throwSCORMError(a.A.scorm2004.GENERAL_SET_FAILURE,"Incorrect Response Type: "+n.type)}else this.throwSCORMError(a.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED);return"0"===this.lastErrorCode?new M:null},t.prototype.checkValidResponseType=function(e,t,i){var r=[];(null==e?void 0:e.delimiter)?r=String(t).split(e.delimiter):r[0]=t,r.length>0&&r.length<=e.max?this.checkCorrectResponseValue(i,r,t):r.length>e.max&&this.throwSCORMError(a.A.scorm2004.GENERAL_SET_FAILURE,"Data Model Element Pattern Too Long")},t.prototype.checkDuplicateChoiceResponse=function(e,t){var i=e.correct_responses._count;if("choice"===e.type)for(var r=0;r1)Number(t[0])>Number(t[1])&&this.throwSCORMError(a.A.scorm2004.TYPE_MISMATCH);else if(""!==t[o]&&r.unique)for(var l=0;l0&&(L.includes(l.toLowerCase())||this.throwSCORMError(a.A.scorm2004.TYPE_MISMATCH))}r=!0;break;case"case_matters":r||t||i||"true"!==o[3]&&"false"!==o[3]&&this.throwSCORMError(a.A.scorm2004.TYPE_MISMATCH),i=!0;break;case"order_matters":i||r||t||"true"!==o[3]&&"false"!==o[3]&&this.throwSCORMError(a.A.scorm2004.TYPE_MISMATCH),t=!0}o=(e=e.substring(o[1].length)).match(n)}return e},t.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi,this.adl=e.adl},t.prototype.renderCommitCMI=function(e){var t=this.renderCMIToJSONObject();e&&(t.cmi.total_time=this.cmi.getCurrentTotalTime());var i=[],r=l.Bq(t);switch(this.settings.dataCommitFormat){case"flattened":return l.Bq(t);case"params":for(var n in r)({}).hasOwnProperty.call(r,n)&&i.push("".concat(n,"=").concat(r[n]));return i;default:return t}},t.prototype.renderCommitObject=function(e){var t=this.renderCommitCMI(e),i=this.cmi.getCurrentTotalTime(),r=l.OI(i,s.A.scorm2004.CMITimespan),n=N.lC.unknown,o=N.YE.unknown;this.cmi.completion_status&&("completed"===this.cmi.completion_status?n=N.lC.completed:"incomplete"===this.cmi.completion_status&&(n=N.lC.incomplete)),this.cmi.success_status&&("passed"===this.cmi.success_status?o=N.YE.passed:"failed"===this.cmi.success_status&&(o=N.YE.failed));var a=this.cmi.score,c=null;a&&(c={},Number.isNaN(Number.parseFloat(a.raw))||(c.raw=Number.parseFloat(a.raw)),Number.isNaN(Number.parseFloat(a.min))||(c.min=Number.parseFloat(a.min)),Number.isNaN(Number.parseFloat(a.max))||(c.max=Number.parseFloat(a.max)),Number.isNaN(Number.parseFloat(a.scaled))||(c.scaled=Number.parseFloat(a.scaled)));var u={completionStatus:n,successStatus:o,totalTimeSeconds:r,runtimeData:t};return c&&(u.score=c),u},t.prototype.storeData=function(e){return(0,r.sH)(this,void 0,void 0,(function(){var t,i,n,s,a,c,l;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return e&&"normal"===this.cmi.mode&&"credit"===this.cmi.credit&&(this.cmi.completion_threshold&&this.cmi.progress_measure&&(this.cmi.progress_measure>=this.cmi.completion_threshold?this.cmi.completion_status="completed":this.cmi.completion_status="incomplete"),this.cmi.scaled_passing_score&&this.cmi.score.scaled&&(this.cmi.score.scaled>=this.cmi.scaled_passing_score?this.cmi.success_status="passed":this.cmi.success_status="failed")),t=!1,this.adl.nav.request!==(null===(l=null===(c=null===(a=this.startingData)||void 0===a?void 0:a.adl)||void 0===c?void 0:c.nav)||void 0===l?void 0:l.request)&&"_none_"!==this.adl.nav.request&&(this.adl.nav.request=encodeURIComponent(this.adl.nav.request),t=!0),i=e||this.settings.alwaysSendTotalTime,n=this.settings.renderCommonCommitFields?this.renderCommitObject(i):this.renderCommitCMI(i),this.apiLogLevel===o.A.global.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(n)),"string"!=typeof this.settings.lmsCommitUrl?[3,2]:[4,this.processHttpRequest(this.settings.lmsCommitUrl,n,e)];case 1:return s=r.sent(),t&&void 0!==s.navRequest&&""!==s.navRequest&&Function('"use strict";(() => { '.concat(s.navRequest," })()"))(),[2,s];case 2:return[2,{result:o.A.global.SCORM_TRUE,errorCode:0}]}}))}))},t}(n.A)},589:function(e,t,i){i.d(t,{B:function(){return c}});var r=i(635),n=i(319),o=i(797),s=i(784),a=o.A.scorm12,c=function(e){function t(t){var i=e.call(this)||this;return i.__children=t.children,i._errorCode=t.errorCode||a.GENERAL,i._errorClass=t.errorClass||s.$h,i.childArray=[],i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_count",{get:function(){return this.childArray.length},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;for(var e={},t=0;t=n[0]){if("*"===n[1]||e<=n[1])return!0;throw new r(i)}throw new r(i)}i.d(t,{W:function(){return n},q:function(){return r}})},989:function(e,t,i){i.d(t,{Y:function(){return g}});var r=i(635),n=i(340),o=i(797),s=i(417),a=i(784),c=i(319),l=i(915),u=i(434),h=i(864),_=function(e){function t(){var t=e.call(this)||this;return t.__children=n.A.scorm12.core_children,t._student_id="",t._student_name="",t._lesson_location="",t._credit="",t._lesson_status="not attempted",t._entry="",t._total_time="",t._lesson_mode="normal",t._exit="",t._session_time="00:00:00",t._suspend_data="",t.score=new u._({score_children:n.A.scorm12.score_children,score_range:s.A.scorm12.score_range,invalidErrorCode:o.A.scorm12.INVALID_SET_VALUE,invalidTypeCode:o.A.scorm12.TYPE_MISMATCH,invalidRangeCode:o.A.scorm12.VALUE_OUT_OF_RANGE,errorClass:a.tQ}),t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_id",{get:function(){return this._student_id},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._student_id=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_name",{get:function(){return this._student_name},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._student_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_location",{get:function(){return this._lesson_location},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString256,!0)&&(this._lesson_location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"credit",{get:function(){return this._credit},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._credit=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_status",{get:function(){return this._lesson_status},set:function(e){this.initialized?(0,l.p)(e,s.A.scorm12.CMIStatus)&&(this._lesson_status=e):(0,l.p)(e,s.A.scorm12.CMIStatus2)&&(this._lesson_status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"entry",{get:function(){return this._entry},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._entry=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"total_time",{get:function(){return this._total_time},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._total_time=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_mode",{get:function(){return this._lesson_mode},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._lesson_mode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"exit",{get:function(){if(!this.jsonString)throw new a.tQ(o.A.scorm12.WRITE_ONLY_ELEMENT);return this._exit},set:function(e){(0,l.p)(e,s.A.scorm12.CMIExit,!0)&&(this._exit=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"session_time",{get:function(){if(!this.jsonString)throw new a.tQ(o.A.scorm12.WRITE_ONLY_ELEMENT);return this._session_time},set:function(e){(0,l.p)(e,s.A.scorm12.CMITimespan)&&(this._session_time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"suspend_data",{get:function(){return this._suspend_data},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString4096,!0)&&(this._suspend_data=e)},enumerable:!1,configurable:!0}),t.prototype.getCurrentTotalTime=function(e){var t=this._session_time,i=e;if(null!=i){var r=(new Date).getTime()-i;t=h.UZ(r/1e3)}return h.HT(this._total_time,t,new RegExp(s.A.scorm12.CMITimespan))},t.prototype.toJSON=function(){this.jsonString=!0;var e={student_id:this.student_id,student_name:this.student_name,lesson_location:this.lesson_location,credit:this.credit,lesson_status:this.lesson_status,entry:this.entry,lesson_mode:this.lesson_mode,exit:this.exit,session_time:this.session_time,score:this.score};return delete this.jsonString,e},t}(c.J),m=i(176),d=i(532),p=i(181),f=i(833),g=function(e){function t(t,i,r){var o=e.call(this)||this;return o.__children="",o.__version="3.4",o._launch_data="",o._comments="",o._comments_from_lms="",r&&o.initialize(),o.__children=t||n.A.scorm12.cmi_children,o.core=new _,o.objectives=new m.C,o.student_data=i||new d.X,o.student_preference=new p.G,o.interactions=new f.Xb,o}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t,i,r,n,o;e.prototype.initialize.call(this),null===(t=this.core)||void 0===t||t.initialize(),null===(i=this.objectives)||void 0===i||i.initialize(),null===(r=this.student_data)||void 0===r||r.initialize(),null===(n=this.student_preference)||void 0===n||n.initialize(),null===(o=this.interactions)||void 0===o||o.initialize()},t.prototype.toJSON=function(){this.jsonString=!0;var e={suspend_data:this.suspend_data,launch_data:this.launch_data,comments:this.comments,comments_from_lms:this.comments_from_lms,core:this.core,objectives:this.objectives,student_data:this.student_data,student_preference:this.student_preference,interactions:this.interactions};return delete this.jsonString,e},Object.defineProperty(t.prototype,"_version",{get:function(){return this.__version},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"suspend_data",{get:function(){var e;return null===(e=this.core)||void 0===e?void 0:e.suspend_data},set:function(e){this.core&&(this.core.suspend_data=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"launch_data",{get:function(){return this._launch_data},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._launch_data=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"comments",{get:function(){return this._comments},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString4096,!0)&&(this._comments=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"comments_from_lms",{get:function(){return this._comments_from_lms},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._comments_from_lms=e},enumerable:!1,configurable:!0}),t.prototype.getCurrentTotalTime=function(){return this.core.getCurrentTotalTime(this.start_time)},t}(c.r)},833:function(e,t,i){i.d(t,{Oh:function(){return m},WP:function(){return _},Xb:function(){return h},cb:function(){return d}});var r=i(635),n=i(589),o=i(340),s=i(797),a=i(784),c=i(319),l=i(915),u=i(417),h=function(e){function t(){return e.call(this,{children:o.A.scorm12.interactions_children,errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ})||this}return(0,r.C6)(t,e),t}(n.B),_=function(e){function t(){var t=e.call(this)||this;return t._id="",t._time="",t._type="",t._weighting="",t._student_response="",t._result="",t._latency="",t.objectives=new n.B({errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ,children:o.A.scorm12.objectives_children}),t.correct_responses=new n.B({errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ,children:o.A.scorm12.correct_responses_children}),t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t,i;e.prototype.initialize.call(this),null===(t=this.objectives)||void 0===t||t.initialize(),null===(i=this.correct_responses)||void 0===i||i.initialize()},Object.defineProperty(t.prototype,"id",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._id},set:function(e){(0,l.p)(e,u.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._time},set:function(e){(0,l.p)(e,u.A.scorm12.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._type},set:function(e){(0,l.p)(e,u.A.scorm12.CMIType)&&(this._type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weighting",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._weighting},set:function(e){(0,l.p)(e,u.A.scorm12.CMIDecimal)&&(0,l.h)(e,u.A.scorm12.weighting_range)&&(this._weighting=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_response",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._student_response},set:function(e){(0,l.p)(e,u.A.scorm12.CMIFeedback,!0)&&(this._student_response=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"result",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._result},set:function(e){(0,l.p)(e,u.A.scorm12.CMIResult)&&(this._result=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"latency",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._latency},set:function(e){(0,l.p)(e,u.A.scorm12.CMITimespan)&&(this._latency=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,time:this.time,type:this.type,weighting:this.weighting,student_response:this.student_response,result:this.result,latency:this.latency,objectives:this.objectives,correct_responses:this.correct_responses};return delete this.jsonString,e},t}(c.J),m=function(e){function t(){var t=e.call(this)||this;return t._id="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(e){(0,l.p)(e,u.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id};return delete this.jsonString,e},t}(c.J),d=function(e){function t(){var t=e.call(this)||this;return t._pattern="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"pattern",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._pattern},set:function(e){(0,l.p)(e,u.A.scorm12.CMIFeedback,!0)&&(this._pattern=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={pattern:this._pattern};return delete this.jsonString,e},t}(c.J)},331:function(e,t,i){i.d(t,{A:function(){return a}});var r=i(635),n=i(319),o=i(915),s=i(417),a=function(e){function t(){var t=e.call(this)||this;return t._event="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"event",{get:function(){return this._event},set:function(e){(0,o.p)(e,s.A.scorm12.NAVEvent)&&(this._event=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={event:this.event};return delete this.jsonString,e},t}(n.J)},176:function(e,t,i){i.d(t,{C:function(){return h},N:function(){return _}});var r=i(635),n=i(319),o=i(434),s=i(340),a=i(417),c=i(797),l=i(784),u=i(915),h=function(e){function t(){return e.call(this,{children:s.A.scorm12.objectives_children,errorCode:c.A.scorm12.INVALID_SET_VALUE,errorClass:l.tQ})||this}return(0,r.C6)(t,e),t}(i(589).B),_=function(e){function t(){var t=e.call(this)||this;return t._id="",t._status="",t.score=new o._({score_children:s.A.scorm12.score_children,score_range:a.A.scorm12.score_range,invalidErrorCode:c.A.scorm12.INVALID_SET_VALUE,invalidTypeCode:c.A.scorm12.TYPE_MISMATCH,invalidRangeCode:c.A.scorm12.VALUE_OUT_OF_RANGE,errorClass:l.tQ}),t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(e){(0,u.p)(e,a.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},set:function(e){(0,u.p)(e,a.A.scorm12.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,status:this.status,score:this.score};return delete this.jsonString,e},t}(n.J)},532:function(e,t,i){i.d(t,{X:function(){return c}});var r=i(635),n=i(319),o=i(340),s=i(784),a=i(797),c=function(e){function t(t){var i=e.call(this)||this;return i._mastery_score="",i._max_time_allowed="",i._time_limit_action="",i.__children=t||o.A.scorm12.student_data_children,i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new s.tQ(a.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mastery_score",{get:function(){return this._mastery_score},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._mastery_score=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"max_time_allowed",{get:function(){return this._max_time_allowed},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._max_time_allowed=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time_limit_action",{get:function(){return this._time_limit_action},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._time_limit_action=e},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={mastery_score:this.mastery_score,max_time_allowed:this.max_time_allowed,time_limit_action:this.time_limit_action};return delete this.jsonString,e},t}(n.J)},181:function(e,t,i){i.d(t,{G:function(){return u}});var r=i(635),n=i(319),o=i(340),s=i(784),a=i(797),c=i(915),l=i(417),u=function(e){function t(t){var i=e.call(this)||this;return i._audio="",i._language="",i._speed="",i._text="",i.__children=t||o.A.scorm12.student_preference_children,i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new s.tQ(a.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audio",{get:function(){return this._audio},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.audio_range)&&(this._audio=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"language",{get:function(){return this._language},set:function(e){(0,c.p)(e,l.A.scorm12.CMIString256)&&(this._language=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speed",{get:function(){return this._speed},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.speed_range)&&(this._speed=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this._text},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.text_range)&&(this._text=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,speed:this.speed,text:this.text};return delete this.jsonString,e},t}(n.J)},915:function(e,t,i){i.d(t,{h:function(){return a},p:function(){return s}});var r=i(449),n=i(797),o=i(784);function s(e,t,i){return(0,r.q)(e,t,n.A.scorm12.TYPE_MISMATCH,o.tQ,i)}function a(e,t,i){if(!i&&""===e)throw new o.tQ(n.A.scorm12.VALUE_OUT_OF_RANGE);return(0,r.W)(e,t,n.A.scorm12.VALUE_OUT_OF_RANGE,o.tQ)}},340:function(e,t,i){var r=i(635),n={cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",core_children:"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time",score_children:"raw,min,max",comments_children:"content,location,time",objectives_children:"id,score,status",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio,language,speed,text",interactions_children:"id,objectives,time,type,correct_responses,weighting,student_response,result,latency",error_descriptions:{101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information"},201:{basicMessage:"Invalid argument error",detailMessage:"Indicates that an argument represents an invalid data model element or is otherwise incorrect."},202:{basicMessage:"Element cannot have children",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.'},203:{basicMessage:"Element not an array - cannot have count",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.'},301:{basicMessage:"Not initialized",detailMessage:"Indicates that an API call was made before the call to lmsInitialize."},401:{basicMessage:"Not implemented error",detailMessage:"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement."},402:{basicMessage:"Invalid set value, element is a keyword",detailMessage:'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").'},403:{basicMessage:"Element is read only",detailMessage:"LMSSetValue was called with a data model element that can only be read."},404:{basicMessage:"Element is write only",detailMessage:"LMSGetValue was called on a data model element that can only be written to."},405:{basicMessage:"Incorrect Data Type",detailMessage:"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Element Value Out Of Range",detailMessage:"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}},o={global:{SCORM_TRUE:"true",SCORM_FALSE:"false",STATE_NOT_INITIALIZED:0,STATE_INITIALIZED:1,STATE_TERMINATED:2,LOG_LEVEL_DEBUG:1,LOG_LEVEL_INFO:2,LOG_LEVEL_WARNING:3,LOG_LEVEL_ERROR:4,LOG_LEVEL_NONE:5},scorm12:n,aicc:(0,r.Cl)((0,r.Cl)({},n),{cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation",student_preference_children:"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows",student_data_children:"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action",student_demographics_children:"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience",tries_children:"time,status,score",attempt_records_children:"score,lesson_status",paths_children:"location_id,date,time,status,why_left,time_in_element"}),scorm2004:{cmi_children:"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time",comments_children:"comment,timestamp,location",score_children:"max,raw,scaled,min",objectives_children:"progress_measure,completion_status,success_status,description,score,id",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio_level,audio_captioning,delivery_speed,language",interactions_children:"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description",error_descriptions:{0:{basicMessage:"No Error",detailMessage:"No error occurred, the previous API call was successful."},101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use GetDiagnostic for more information."},102:{basicMessage:"General Initialization Failure",detailMessage:"Call to Initialize failed for an unknown reason."},103:{basicMessage:"Already Initialized",detailMessage:"Call to Initialize failed because Initialize was already called."},104:{basicMessage:"Content Instance Terminated",detailMessage:"Call to Initialize failed because Terminate was already called."},111:{basicMessage:"General Termination Failure",detailMessage:"Call to Terminate failed for an unknown reason."},112:{basicMessage:"Termination Before Initialization",detailMessage:"Call to Terminate failed because it was made before the call to Initialize."},113:{basicMessage:"Termination After Termination",detailMessage:"Call to Terminate failed because Terminate was already called."},122:{basicMessage:"Retrieve Data Before Initialization",detailMessage:"Call to GetValue failed because it was made before the call to Initialize."},123:{basicMessage:"Retrieve Data After Termination",detailMessage:"Call to GetValue failed because it was made after the call to Terminate."},132:{basicMessage:"Store Data Before Initialization",detailMessage:"Call to SetValue failed because it was made before the call to Initialize."},133:{basicMessage:"Store Data After Termination",detailMessage:"Call to SetValue failed because it was made after the call to Terminate."},142:{basicMessage:"Commit Before Initialization",detailMessage:"Call to Commit failed because it was made before the call to Initialize."},143:{basicMessage:"Commit After Termination",detailMessage:"Call to Commit failed because it was made after the call to Terminate."},201:{basicMessage:"General Argument Error",detailMessage:"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument."},301:{basicMessage:"General Get Failure",detailMessage:"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},351:{basicMessage:"General Set Failure",detailMessage:"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},391:{basicMessage:"General Commit Failure",detailMessage:"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information."},401:{basicMessage:"Undefined Data Model Element",detailMessage:"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element."},402:{basicMessage:"Unimplemented Data Model Element",detailMessage:"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant."},403:{basicMessage:"Data Model Element Value Not Initialized",detailMessage:"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO."},404:{basicMessage:"Data Model Element Is Read Only",detailMessage:"SetValue was called with a data model element that can only be read."},405:{basicMessage:"Data Model Element Is Write Only",detailMessage:"GetValue was called on a data model element that can only be written to."},406:{basicMessage:"Data Model Element Type Mismatch",detailMessage:"SetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Data Model Element Value Out Of Range",detailMessage:"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}}};t.A=o},56:function(e,t,i){var r,n,o;i.d(t,{K$:function(){return r},YE:function(){return n},lC:function(){return o}}),function(e){e.unknown="unknown",e.true="true",e.false="false"}(r||(r={})),function(e){e.passed="passed",e.failed="failed",e.unknown="unknown"}(n||(n={})),function(e){e.completed="completed",e.incomplete="incomplete",e.unknown="unknown"}(o||(o={}))},797:function(e,t,i){var r=i(635),n={GENERAL:101,INITIALIZATION_FAILED:101,INITIALIZED:101,TERMINATED:101,TERMINATION_FAILURE:101,TERMINATION_BEFORE_INIT:101,MULTIPLE_TERMINATION:101,RETRIEVE_BEFORE_INIT:101,RETRIEVE_AFTER_TERM:101,STORE_BEFORE_INIT:101,STORE_AFTER_TERM:101,COMMIT_BEFORE_INIT:101,COMMIT_AFTER_TERM:101,ARGUMENT_ERROR:101,CHILDREN_ERROR:101,COUNT_ERROR:101,GENERAL_GET_FAILURE:101,GENERAL_SET_FAILURE:101,GENERAL_COMMIT_FAILURE:101,UNDEFINED_DATA_MODEL:101,UNIMPLEMENTED_ELEMENT:101,VALUE_NOT_INITIALIZED:101,INVALID_SET_VALUE:101,READ_ONLY_ELEMENT:101,WRITE_ONLY_ELEMENT:101,TYPE_MISMATCH:101,VALUE_OUT_OF_RANGE:101,DEPENDENCY_NOT_ESTABLISHED:101},o={scorm12:(0,r.Cl)((0,r.Cl)({},n),{RETRIEVE_BEFORE_INIT:301,STORE_BEFORE_INIT:301,COMMIT_BEFORE_INIT:301,ARGUMENT_ERROR:201,CHILDREN_ERROR:202,COUNT_ERROR:203,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:401,VALUE_NOT_INITIALIZED:301,INVALID_SET_VALUE:402,READ_ONLY_ELEMENT:403,WRITE_ONLY_ELEMENT:404,TYPE_MISMATCH:405,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408}),scorm2004:(0,r.Cl)((0,r.Cl)({},n),{INITIALIZATION_FAILED:102,INITIALIZED:103,TERMINATED:104,TERMINATION_FAILURE:111,TERMINATION_BEFORE_INIT:112,MULTIPLE_TERMINATIONS:113,RETRIEVE_BEFORE_INIT:122,RETRIEVE_AFTER_TERM:123,STORE_BEFORE_INIT:132,STORE_AFTER_TERM:133,COMMIT_BEFORE_INIT:142,COMMIT_AFTER_TERM:143,ARGUMENT_ERROR:201,GENERAL_GET_FAILURE:301,GENERAL_SET_FAILURE:351,GENERAL_COMMIT_FAILURE:391,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:402,VALUE_NOT_INITIALIZED:403,READ_ONLY_ELEMENT:404,WRITE_ONLY_ELEMENT:405,TYPE_MISMATCH:406,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408})};t.A=o},417:function(e,t,i){var r=i(635),n={CMIString256:"^.{0,255}$",CMIString4096:"^.{0,4096}$",CMITime:"^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",CMITimespan:"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{0,3})(.[0-9]*)?$",CMIIdentifier:"^[\\u0021-\\u007E\\s]{0,255}$",CMIFeedback:"^.{0,255}$",CMIIndex:"[._](\\d+).",CMIStatus:"^(passed|completed|failed|incomplete|browsed)$",CMIStatus2:"^(passed|completed|failed|incomplete|browsed|not attempted)$",CMIExit:"^(time-out|suspend|logout|)$",CMIType:"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$",CMIResult:"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$",NAVEvent:"^(previous|continue)$",score_range:"0#100",audio_range:"-1#100",speed_range:"-100#100",weighting_range:"-100#100",text_range:"-1#1"},o={aicc:(0,r.Cl)((0,r.Cl)({},n),{CMIIdentifier:"^\\w{1,255}$"}),scorm12:n,scorm2004:{CMIString200:"^[\\u0000-\\uFFFF]{0,200}$",CMIString250:"^[\\u0000-\\uFFFF]{0,250}$",CMIString1000:"^[\\u0000-\\uFFFF]{0,1000}$",CMIString4000:"^[\\u0000-\\uFFFF]{0,4000}$",CMIString64000:"^[\\u0000-\\uFFFF]{0,64000}$",CMILang:"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$",CMILangString250:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$",CMILangcr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$",CMILangString250cr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$",CMILangString4000:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$",CMITime:"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$",CMITimespan:"^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{1,5})(\\.[0-9]{1,18})?$",CMIIdentifier:"^\\S{1,250}[a-zA-Z0-9]$",CMIShortIdentifier:"^[\\w\\.\\-\\_]{1,250}$",CMILongIdentifier:"^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$",CMIFeedback:"^.*$",CMIIndex:"[._](\\d+).",CMIIndexStore:".N(\\d+).",CMICStatus:"^(completed|incomplete|not attempted|unknown)$",CMISStatus:"^(passed|failed|unknown)$",CMIExit:"^(time-out|suspend|logout|normal)$",CMIType:"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",CMIResult:"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",NAVEvent:"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$",NAVBoolean:"^(unknown|true|false$)",NAVTarget:"^{target=\\S{0,}[a-zA-Z0-9-_]+}$",scaled_range:"-1#1",audio_range:"0#*",speed_range:"0#*",text_range:"-1#1",progress_range:"0#1"}};t.A=o},784:function(e,t,i){i.d(t,{$h:function(){return c},gv:function(){return h},tQ:function(){return u},wq:function(){return _},yI:function(){return l}});var r=i(635),n=i(340),o=n.A.scorm12.error_descriptions,s=n.A.aicc.error_descriptions,a=n.A.scorm2004.error_descriptions,c=function(e){function t(t){var i=e.call(this,t.toString())||this;return i._errorCode=t,i.name="ScormValidationError",i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"errorCode",{get:function(){return this._errorCode},enumerable:!1,configurable:!0}),t.prototype.setMessage=function(e){this.message=e},t}(Error),l=function(e){function t(t,i,r){var n=e.call(this,t)||this;return n._detailedMessage="",n.setMessage(i),n._errorMessage=i,r&&(n._detailedMessage=r),n}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"errorMessage",{get:function(){return this._errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"detailedMessage",{get:function(){return this._detailedMessage},enumerable:!1,configurable:!0}),t}(c),u=function(e){function t(t){return{}.hasOwnProperty.call(o,String(t))?e.call(this,t,o[String(t)].basicMessage,o[String(t)].detailMessage)||this:e.call(this,101,o[101].basicMessage,o[101].detailMessage)||this}return(0,r.C6)(t,e),t}(l),h=function(e){function t(t){return{}.hasOwnProperty.call(s,String(t))?e.call(this,t,s[String(t)].basicMessage,s[String(t)].detailMessage)||this:e.call(this,101,s[101].basicMessage,s[101].detailMessage)||this}return(0,r.C6)(t,e),t}(l),_=function(e){function t(t){return{}.hasOwnProperty.call(a,String(t))?e.call(this,t,a[String(t)].basicMessage,a[String(t)].detailMessage)||this:e.call(this,101,a[101].basicMessage,a[101].detailMessage)||this}return(0,r.C6)(t,e),t}(l)},864:function(e,t,i){i.d(t,{$o:function(){return l},Bq:function(){return h},HT:function(){return u},J6:function(){return p},OI:function(){return c},UZ:function(){return o},f4:function(){return a},hw:function(){return d},sB:function(){return _},xE:function(){return s}});var r=3600,n={D:24*r,H:r,M:60,S:1};function o(e){if(!e||e<=0)return"00:00:00";var t=Math.floor(e/r),i=new Date(1e3*e),n=i.getUTCMinutes(),o=i.getSeconds(),s=e%1,a="";return m(s)>0&&(a="."+(a=m(s)>2?s.toFixed(2):String(s)).split(".")[1]),(t+":"+n+":"+o).replace(/\b\d\b/g,"0$&")+a}function s(e){if(!e||e<=0)return"PT0S";var t="P",i=e;for(var r in n){var o=n[r],s=Math.floor(i/o);m(i%=o)>2&&(i=Number(Number(i).toFixed(2))),"S"===r&&i>0&&(s+=i),s&&((t.indexOf("D")>0||"H"===r||"M"===r||"S"===r)&&-1===t.indexOf("T")&&(t+="T"),t+="".concat(s).concat(r))}return t}function a(e,t){if("number"!=typeof e&&"boolean"!=typeof e||(e=String(e)),"string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var i=e.split(":");return 3600*Number(i[0])+60*Number(i[1])+Number(i[2])}function c(e,t){if("string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var i=new RegExp(t).exec(e)||[],r=i[1],n=(i[2],i[4]),o=i[5],s=i[6],a=i[7],c=0;return c+=Number(a)||0,c+=60*Number(s)||0,c+=3600*Number(o)||0,c+=86400*Number(n)||0,c+=31536e3*Number(r)||0}function l(e,t,i){var r="string"==typeof i?new RegExp(i):i;return s(c(e,r)+c(t,r))}function u(e,t,i){return"string"==typeof i&&(i=new RegExp(i)),o(a(e,i)+a(t,i))}function h(e){var t={};return function e(i,r){if(Object(i)!==i)t[r]=i;else if(Array.isArray(i))for(var n=0,o=i.length;n0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]=this.apiLogLevel&&this.settings.onLogMessage(i,t)},Object.defineProperty(e.prototype,"error_codes",{get:function(){return this._error_codes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"settings",{get:function(){return this._settings},set:function(e){this._settings=(0,r.Cl)((0,r.Cl)({},this._settings),e)},enumerable:!1,configurable:!0}),e.prototype.terminate=function(e,t){return(0,r.sH)(this,void 0,void 0,(function(){var i,n;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return i=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.TERMINATION_BEFORE_INIT,this._error_codes.MULTIPLE_TERMINATION)?(this.currentState=a.A.global.STATE_TERMINATED,[4,this.storeData(!0)]):[3,2];case 1:void 0!==(n=r.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),i=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,t&&(this.lastErrorCode="0"),i=a.A.global.SCORM_TRUE,this.processListeners(e),r.label=2;case 2:return this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(i),[2,i]}}))}))},e.prototype.getValue=function(e,t,i){var r="";if(this.checkState(t,this._error_codes.RETRIEVE_BEFORE_INIT,this._error_codes.RETRIEVE_AFTER_TERM)){t&&(this.lastErrorCode="0");try{r=this.getCMIValue(i)}catch(e){r=this.handleValueAccessException(e,r)}this.processListeners(e,i)}return this.apiLog(e,": returned: "+r,a.A.global.LOG_LEVEL_INFO,i),void 0===r?"":(this.clearSCORMError(r),r)},e.prototype.setValue=function(e,t,i,r,n){void 0!==n&&(n=String(n));var o=a.A.global.SCORM_FALSE;if(this.checkState(i,this._error_codes.STORE_BEFORE_INIT,this._error_codes.STORE_AFTER_TERM)){i&&(this.lastErrorCode="0");try{o=this.setCMIValue(r,n)}catch(e){this.handleValueAccessException(e,o)}this.processListeners(e,r,n)}return void 0===o&&(o=a.A.global.SCORM_FALSE),"0"===String(this.lastErrorCode)&&this.settings.autocommit&&!this._timeout&&this.scheduleCommit(1e3*this.settings.autocommitSeconds,t),this.apiLog(e,": "+n+": result: "+o,a.A.global.LOG_LEVEL_INFO,r),this.clearSCORMError(o),o},e.prototype.commit=function(e){return(0,r.sH)(this,arguments,void 0,(function(e,t){var i,n;return void 0===t&&(t=!1),(0,r.YH)(this,(function(r){switch(r.label){case 0:return this.clearScheduledCommit(),i=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.COMMIT_BEFORE_INIT,this._error_codes.COMMIT_AFTER_TERM)?[4,this.storeData(!1)]:[3,2];case 1:(n=r.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),i=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,this.apiLog(e," Result: "+i,a.A.global.LOG_LEVEL_DEBUG,"HttpRequest"),t&&(this.lastErrorCode="0"),this.processListeners(e),r.label=2;case 2:return this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(i),[2,i]}}))}))},e.prototype.getLastError=function(e){var t=String(this.lastErrorCode);return this.processListeners(e),this.apiLog(e,"returned: "+t,a.A.global.LOG_LEVEL_INFO),t},e.prototype.getErrorString=function(e,t){var i="";return null!==t&&""!==t&&(i=this.getLmsErrorMessageDetails(t),this.processListeners(e)),this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),i},e.prototype.getDiagnostic=function(e,t){var i="";return null!==t&&""!==t&&(i=this.getLmsErrorMessageDetails(t,!0),this.processListeners(e)),this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),i},e.prototype.checkState=function(e,t,i){return this.isNotInitialized()?(this.throwSCORMError(t),!1):!e||!this.isTerminated()||(this.throwSCORMError(i),!1)},e.prototype.getLmsErrorMessageDetails=function(e,t){throw void 0===t&&(t=!1),new Error("The getLmsErrorMessageDetails method has not been implemented")},e.prototype.getCMIValue=function(e){throw new Error("The getCMIValue method has not been implemented")},e.prototype.setCMIValue=function(e,t){throw new Error("The setCMIValue method has not been implemented")},e.prototype._commonSetCMIValue=function(e,t,i,o){if(!i||""===i)return a.A.global.SCORM_FALSE;for(var s=i.split("."),l=this,u=a.A.global.SCORM_FALSE,h=!1,_="The data model element passed to ".concat(e," (").concat(i,") is not a valid SCORM data model element."),m=t?this._error_codes.UNDEFINED_DATA_MODEL:this._error_codes.GENERAL,d=0;d1&&(s=e.replace(o+".","")),this.listenerArray.push({functionName:o,CMIElement:s,callback:t}),this.apiLog("on","Added event listener: ".concat(this.listenerArray.length),a.A.global.LOG_LEVEL_INFO,o)}},e.prototype.off=function(e,t){if(t)for(var i=e.split(" "),r=function(r){var o=i[r].split(".");if(0===o.length)return{value:void 0};var s=o[0],c=null;o.length>1&&(c=e.replace(s+".",""));var l=n.listenerArray.findIndex((function(e){return e.functionName===s&&e.CMIElement===c&&e.callback===t}));-1!==l&&(n.listenerArray.splice(l,1),n.apiLog("off","Removed event listener: ".concat(n.listenerArray.length),a.A.global.LOG_LEVEL_INFO,s))},n=this,o=0;o1&&(s=e.replace(o+".","")),r.listenerArray=r.listenerArray.filter((function(e){return e.functionName!==o&&e.CMIElement!==s}))},r=this,n=0;ns?1:0})),s.forEach((function(e){(r={})[e[0]]=e[1],i.loadFromJSON((0,c.sB)(r),t)}))}else console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize.");function a(e,t,i){var r,n=e.match(i);if(null!==n&&null!==(r=t.match(i))){var o=Number(n[2]),s=Number(r[2]);return o===s?"id"===n[3]?-1:"type"===n[3]?"id"===r[3]?1:-1:1:o-s}return null}},e.prototype.loadFromJSON=function(e,t){if(this.isNotInitialized()){for(var i in t=void 0!==t?t:"cmi",this.startingData=e,e)if({}.hasOwnProperty.call(e,i)&&e[i]){var r=(t?t+".":"")+i,n=e[i];if(n.childArray)for(var o=0;o=200&&e.status<=299&&(!0===t.result||t.result===a.A.global.SCORM_TRUE)?this.processListeners("CommitSuccess"):this.processListeners("CommitError"),[2,t]}}))}))},e}(),_=h},941:function(e,t,i){i.d(t,{Scorm12Impl:function(){return m}});var r=i(635),n=i(989),o=i(864),s=i(340),a=i(797),c=i(176),l=i(833),u=i(331),h=i(417),_=i(56),m=function(e){function t(t){var i=this;return t&&void 0===t.mastery_override&&(t.mastery_override=!1),(i=e.call(this,a.A.scorm12,t)||this).statusSetByModule=!1,i.cmi=new n.Y,i.nav=new u.A,i.LMSInitialize=i.lmsInitialize,i.LMSFinish=i.lmsFinish,i.LMSGetValue=i.lmsGetValue,i.LMSSetValue=i.lmsSetValue,i.LMSCommit=i.lmsCommit,i.LMSGetLastError=i.lmsGetLastError,i.LMSGetErrorString=i.lmsGetErrorString,i.LMSGetDiagnostic=i.lmsGetDiagnostic,i}return(0,r.C6)(t,e),t.prototype.reset=function(e){this.commonReset(e),this.cmi=new n.Y,this.nav=new u.A},t.prototype.lmsInitialize=function(){return this.cmi.initialize(),this.cmi.core.lesson_status?this.statusSetByModule=!0:this.cmi.core.lesson_status="not attempted",this.initialize("LMSInitialize","LMS was already initialized!","LMS is already finished!")},t.prototype.lmsFinish=function(){var e=this;return(0,r.sH)(e,void 0,void 0,(function(){return(0,r.YH)(this,(function(e){switch(e.label){case 0:return[4,this.internalFinish()];case 1:return e.sent(),[2]}}))})),s.A.global.SCORM_TRUE},t.prototype.internalFinish=function(){return(0,r.sH)(this,void 0,void 0,(function(){var e;return(0,r.YH)(this,(function(t){switch(t.label){case 0:return[4,this.terminate("LMSFinish",!0)];case 1:return(e=t.sent())===s.A.global.SCORM_TRUE&&(""!==this.nav.event?"continue"===this.nav.event?this.processListeners("SequenceNext"):this.processListeners("SequencePrevious"):this.settings.autoProgress&&this.processListeners("SequenceNext")),[2,e]}}))}))},t.prototype.lmsGetValue=function(e){return this.getValue("LMSGetValue",!1,e)},t.prototype.lmsSetValue=function(e,t){return"cmi.core.lesson_status"===e&&(this.statusSetByModule=!0),this.setValue("LMSSetValue","LMSCommit",!1,e,t)},t.prototype.lmsCommit=function(){var e=this;return(0,r.sH)(e,void 0,void 0,(function(){return(0,r.YH)(this,(function(e){switch(e.label){case 0:return[4,this.commit("LMSCommit",!1)];case 1:return e.sent(),[2]}}))})),s.A.global.SCORM_TRUE},t.prototype.lmsGetLastError=function(){return this.getLastError("LMSGetLastError")},t.prototype.lmsGetErrorString=function(e){return this.getErrorString("LMSGetErrorString",e)},t.prototype.lmsGetDiagnostic=function(e){return this.getDiagnostic("LMSGetDiagnostic",e)},t.prototype.setCMIValue=function(e,t){return this._commonSetCMIValue("LMSSetValue",!1,e,t)},t.prototype.getCMIValue=function(e){return this._commonGetCMIValue("getCMIValue",!1,e)},t.prototype.getChildElement=function(e,t,i){return(0,o.J6)(e,"cmi\\.objectives\\.\\d+")?new c.N:i&&(0,o.J6)(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")?new l.cb:i&&(0,o.J6)(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")?new l.Oh:!i&&(0,o.J6)(e,"cmi\\.interactions\\.\\d+")?new l.WP:null},t.prototype.validateCorrectResponse=function(e,t){},t.prototype.getLmsErrorMessageDetails=function(e,t){var i="No Error",r="No Error";return e=String(e),s.A.scorm12.error_descriptions[e]&&(i=s.A.scorm12.error_descriptions[e].basicMessage,r=s.A.scorm12.error_descriptions[e].detailMessage),t?r:i},t.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi},t.prototype.renderCommitCMI=function(e){var t=this.renderCMIToJSONObject();e&&(t.cmi.core.total_time=this.cmi.getCurrentTotalTime());var i=[],r=o.Bq(t);switch(this.settings.dataCommitFormat){case"flattened":return o.Bq(t);case"params":for(var n in r)({}).hasOwnProperty.call(r,n)&&i.push("".concat(n,"=").concat(r[n]));return i;default:return t}},t.prototype.renderCommitObject=function(e){var t=this.renderCommitCMI(e),i=this.cmi.getCurrentTotalTime(),r=o.f4(i,h.A.scorm12.CMITimespan),n=this.cmi.core.lesson_status,s=_.lC.unknown,a=_.YE.unknown;n&&(s="completed"===n||"passed"===n?_.lC.completed:_.lC.incomplete,"passed"===n?a=_.YE.passed:"failed"===n&&(a=_.YE.failed));var c=this.cmi.core.score,l=null;c&&(l={},Number.isNaN(Number.parseFloat(c.raw))||(l.raw=Number.parseFloat(c.raw)),Number.isNaN(Number.parseFloat(c.min))||(l.min=Number.parseFloat(c.min)),Number.isNaN(Number.parseFloat(c.max))||(l.max=Number.parseFloat(c.max)));var u={successStatus:a,completionStatus:s,runtimeData:t,totalTimeSeconds:r};return l&&(u.score=l),u},t.prototype.storeData=function(e){return(0,r.sH)(this,void 0,void 0,(function(){var t,i,n,o,a,c;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return e&&(t=this.cmi.core.lesson_status,this.cmi.core.lesson_status&&(this.statusSetByModule||"not attempted"!==this.cmi.core.lesson_status)||(this.cmi.core.lesson_status="completed"),"normal"===this.cmi.core.lesson_mode?"credit"===this.cmi.core.credit&&this.settings.mastery_override&&""!==this.cmi.student_data.mastery_score&&""!==this.cmi.core.score.raw&&(this.cmi.core.lesson_status=parseFloat(this.cmi.core.score.raw)>=parseFloat(this.cmi.student_data.mastery_score)?"passed":"failed"):"browse"===this.cmi.core.lesson_mode&&""===((null===(c=null===(a=null===(o=this.startingData)||void 0===o?void 0:o.cmi)||void 0===a?void 0:a.core)||void 0===c?void 0:c.lesson_status)||"")&&"not attempted"===t&&(this.cmi.core.lesson_status="browsed")),i=e||this.settings.alwaysSendTotalTime,n=this.settings.renderCommonCommitFields?this.renderCommitObject(i):this.renderCommitCMI(i),this.apiLogLevel===s.A.global.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(n)),"string"!=typeof this.settings.lmsCommitUrl?[3,2]:[4,this.processHttpRequest(this.settings.lmsCommitUrl,n,e)];case 1:return[2,r.sent()];case 2:return[2,{result:s.A.global.SCORM_TRUE,errorCode:0}]}}))}))},t}(i(900).A)},180:function(e,t,i){i.d(t,{Scorm2004Impl:function(){return P}});var r=i(635),n=i(900),o=i(340),s=i(417),a=i(797),c=i(784),l=i(864),u=i(319),h=i(449);function _(e,t,i){return(0,h.q)(e,t,a.A.scorm2004.TYPE_MISMATCH,c.wq,i)}function m(e,t){return(0,h.W)(e,t,a.A.scorm2004.VALUE_OUT_OF_RANGE,c.wq)}var d=function(e){function t(){var t=e.call(this)||this;return t.__children=o.A.scorm2004.student_preference_children,t._audio_level="1",t._language="",t._delivery_speed="1",t._audio_captioning="0",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new c.wq(a.A.scorm2004.READ_ONLY_ELEMENT)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audio_level",{get:function(){return this._audio_level},set:function(e){_(e,s.A.scorm2004.CMIDecimal)&&m(e,s.A.scorm2004.audio_range)&&(this._audio_level=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"language",{get:function(){return this._language},set:function(e){_(e,s.A.scorm2004.CMILang)&&(this._language=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"delivery_speed",{get:function(){return this._delivery_speed},set:function(e){_(e,s.A.scorm2004.CMIDecimal)&&m(e,s.A.scorm2004.speed_range)&&(this._delivery_speed=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audio_captioning",{get:function(){return this._audio_captioning},set:function(e){_(e,s.A.scorm2004.CMISInteger)&&m(e,s.A.scorm2004.text_range)&&(this._audio_captioning=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={audio_level:this.audio_level,language:this.language,delivery_speed:this.delivery_speed,audio_captioning:this.audio_captioning};return delete this.jsonString,e},t}(u.J),p=i(589),f=s.A.scorm2004,g={"true-false":{format:"^true$|^false$",max:1,delimiter:"",unique:!1},choice:{format:f.CMILongIdentifier,max:36,delimiter:"[,]",unique:!0},"fill-in":{format:f.CMILangString250,max:10,delimiter:"[,]",unique:!1},"long-fill-in":{format:f.CMILangString4000,max:1,delimiter:"",unique:!1},matching:{format:f.CMIShortIdentifier,format2:f.CMIShortIdentifier,max:36,delimiter:"[,]",delimiter2:"[.]",unique:!1},performance:{format:"^$|"+f.CMIShortIdentifier,format2:f.CMIDecimal+"|^$|"+f.CMIShortIdentifier,max:250,delimiter:"[,]",delimiter2:"[.]",unique:!1},sequencing:{format:f.CMIShortIdentifier,max:36,delimiter:"[,]",unique:!1},likert:{format:f.CMIShortIdentifier,max:1,delimiter:"",unique:!1},numeric:{format:f.CMIDecimal,max:1,delimiter:"",unique:!1},other:{format:f.CMIString4000,max:1,delimiter:"",unique:!1}},E={"true-false":{max:1,delimiter:"",unique:!1,duplicate:!1,format:"^true$|^false$",limit:1},choice:{max:36,delimiter:"[,]",unique:!0,duplicate:!1,format:f.CMILongIdentifier},"fill-in":{max:10,delimiter:"[,]",unique:!1,duplicate:!1,format:f.CMILangString250cr},"long-fill-in":{max:1,delimiter:"",unique:!1,duplicate:!0,format:f.CMILangString4000},matching:{max:36,delimiter:"[,]",delimiter2:"[.]",unique:!1,duplicate:!1,format:f.CMIShortIdentifier,format2:f.CMIShortIdentifier},performance:{max:250,delimiter:"[,]",delimiter2:"[.]",delimiter3:"[:]",unique:!1,duplicate:!1,format:"^$|"+f.CMIShortIdentifier,format2:f.CMIDecimal+"|^$|"+f.CMIShortIdentifier},sequencing:{max:36,delimiter:"[,]",unique:!1,duplicate:!1,format:f.CMIShortIdentifier},likert:{max:1,delimiter:"",unique:!1,duplicate:!1,format:f.CMIShortIdentifier,limit:1},numeric:{max:2,delimiter:"[:]",unique:!1,duplicate:!1,format:f.CMIDecimal,limit:1},other:{max:1,delimiter:"",unique:!1,duplicate:!1,format:f.CMIString4000,limit:1}},b=function(e){function t(){return e.call(this,{children:o.A.scorm2004.interactions_children,errorCode:a.A.scorm2004.READ_ONLY_ELEMENT,errorClass:c.wq})||this}return(0,r.C6)(t,e),t}(p.B),y=function(e){function t(){var t=e.call(this)||this;return t._id="",t._type="",t._timestamp="",t._weighting="",t._learner_response="",t._result="",t._latency="",t._description="",t.objectives=new p.B({errorCode:a.A.scorm2004.READ_ONLY_ELEMENT,errorClass:c.wq,children:o.A.scorm2004.objectives_children}),t.correct_responses=new p.B({errorCode:a.A.scorm2004.READ_ONLY_ELEMENT,errorClass:c.wq,children:o.A.scorm2004.correct_responses_children}),t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t,i;e.prototype.initialize.call(this),null===(t=this.objectives)||void 0===t||t.initialize(),null===(i=this.correct_responses)||void 0===i||i.initialize()},Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(e){_(e,s.A.scorm2004.CMILongIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this._type},set:function(e){if(this.initialized&&""===this._id)throw new c.wq(a.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED);_(e,s.A.scorm2004.CMIType)&&(this._type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"timestamp",{get:function(){return this._timestamp},set:function(e){if(this.initialized&&""===this._id)throw new c.wq(a.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED);_(e,s.A.scorm2004.CMITime)&&(this._timestamp=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weighting",{get:function(){return this._weighting},set:function(e){if(this.initialized&&""===this._id)throw new c.wq(a.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED);_(e,s.A.scorm2004.CMIDecimal)&&(this._weighting=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"learner_response",{get:function(){return this._learner_response},set:function(e){if(this.initialized&&(""===this._type||""===this._id))throw new c.wq(a.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED);var t=[],i=g[this.type];if(!i)throw new c.wq(a.A.scorm2004.TYPE_MISMATCH);if((null==i?void 0:i.delimiter)?t=e.split(i.delimiter):t[0]=e,!(t.length>0&&t.length<=i.max))throw new c.wq(a.A.scorm2004.GENERAL_SET_FAILURE);for(var r=new RegExp(i.format),n=0;n2&&(c=a[2],i=a[1].replace(c,"")),(l=t[i])&&this.processListeners(l,"adl.nav.request",c)):this.settings.autoProgress&&this.processListeners("SequenceNext")),[2,e]}}))}))},t.prototype.lmsGetValue=function(e){var t="^adl\\.nav\\.request_valid\\.(choice|jump)\\.{target=\\S{0,}([a-zA-Z0-9-_]+)}$";if((0,l.J6)(e,t)){var i=e.match(t),r=i[1],n=i[2].replace("{target=","").replace("}","");if("choice"===r||"jump"===r)return this.settings.scoItemIdValidator?String(this.settings.scoItemIdValidator(n)):String(this.settings.scoItemIds.includes(n))}return this.getValue("GetValue",!0,e)},t.prototype.lmsSetValue=function(e,t){return this.setValue("SetValue","Commit",!0,e,t)},t.prototype.lmsCommit=function(){var e=this;return(0,r.sH)(e,void 0,void 0,(function(){return(0,r.YH)(this,(function(e){switch(e.label){case 0:return[4,this.commit("Commit")];case 1:return e.sent(),[2]}}))})),o.A.global.SCORM_TRUE},t.prototype.lmsGetLastError=function(){return this.getLastError("GetLastError")},t.prototype.lmsGetErrorString=function(e){return this.getErrorString("GetErrorString",e)},t.prototype.lmsGetDiagnostic=function(e){return this.getDiagnostic("GetDiagnostic",e)},t.prototype.setCMIValue=function(e,t){return this._commonSetCMIValue("SetValue",!0,e,t)},t.prototype.getChildElement=function(e,t,i){if((0,l.J6)(e,"cmi\\.objectives\\.\\d+"))return new O;if(i){if((0,l.J6)(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+"))return this.createCorrectResponsesObject(e,t);if((0,l.J6)(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+"))return new A}else if((0,l.J6)(e,"cmi\\.interactions\\.\\d+"))return new y;return(0,l.J6)(e,"cmi\\.comments_from_learner\\.\\d+")?new S:(0,l.J6)(e,"cmi\\.comments_from_lms\\.\\d+")?new S(!0):null},t.prototype.createCorrectResponsesObject=function(e,t){var i=e.split("."),r=Number(i[2]),n=this.cmi.interactions.childArray[r];if(this.isInitialized())if(n.type){this.checkDuplicateChoiceResponse(n,t);var o=E[n.type];o?this.checkValidResponseType(o,t,n.type):this.throwSCORMError(a.A.scorm2004.GENERAL_SET_FAILURE,"Incorrect Response Type: "+n.type)}else this.throwSCORMError(a.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED);return"0"===this.lastErrorCode?new M:null},t.prototype.checkValidResponseType=function(e,t,i){var r=[];(null==e?void 0:e.delimiter)?r=String(t).split(e.delimiter):r[0]=t,r.length>0&&r.length<=e.max?this.checkCorrectResponseValue(i,r,t):r.length>e.max&&this.throwSCORMError(a.A.scorm2004.GENERAL_SET_FAILURE,"Data Model Element Pattern Too Long")},t.prototype.checkDuplicateChoiceResponse=function(e,t){var i=e.correct_responses._count;if("choice"===e.type)for(var r=0;r1)Number(t[0])>Number(t[1])&&this.throwSCORMError(a.A.scorm2004.TYPE_MISMATCH);else if(""!==t[o]&&r.unique)for(var l=0;l0&&(L.includes(l.toLowerCase())||this.throwSCORMError(a.A.scorm2004.TYPE_MISMATCH))}r=!0;break;case"case_matters":r||t||i||"true"!==o[3]&&"false"!==o[3]&&this.throwSCORMError(a.A.scorm2004.TYPE_MISMATCH),i=!0;break;case"order_matters":i||r||t||"true"!==o[3]&&"false"!==o[3]&&this.throwSCORMError(a.A.scorm2004.TYPE_MISMATCH),t=!0}o=(e=e.substring(o[1].length)).match(n)}return e},t.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi,this.adl=e.adl},t.prototype.renderCommitCMI=function(e){var t=this.renderCMIToJSONObject();e&&(t.cmi.total_time=this.cmi.getCurrentTotalTime());var i=[],r=l.Bq(t);switch(this.settings.dataCommitFormat){case"flattened":return l.Bq(t);case"params":for(var n in r)({}).hasOwnProperty.call(r,n)&&i.push("".concat(n,"=").concat(r[n]));return i;default:return t}},t.prototype.renderCommitObject=function(e){var t=this.renderCommitCMI(e),i=this.cmi.getCurrentTotalTime(),r=l.OI(i,s.A.scorm2004.CMITimespan),n=N.lC.unknown,o=N.YE.unknown;this.cmi.completion_status&&("completed"===this.cmi.completion_status?n=N.lC.completed:"incomplete"===this.cmi.completion_status&&(n=N.lC.incomplete)),this.cmi.success_status&&("passed"===this.cmi.success_status?o=N.YE.passed:"failed"===this.cmi.success_status&&(o=N.YE.failed));var a=this.cmi.score,c=null;a&&(c={},Number.isNaN(Number.parseFloat(a.raw))||(c.raw=Number.parseFloat(a.raw)),Number.isNaN(Number.parseFloat(a.min))||(c.min=Number.parseFloat(a.min)),Number.isNaN(Number.parseFloat(a.max))||(c.max=Number.parseFloat(a.max)),Number.isNaN(Number.parseFloat(a.scaled))||(c.scaled=Number.parseFloat(a.scaled)));var u={completionStatus:n,successStatus:o,totalTimeSeconds:r,runtimeData:t};return c&&(u.score=c),u},t.prototype.storeData=function(e){return(0,r.sH)(this,void 0,void 0,(function(){var t,i,n,s,a,c,l;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return e&&"normal"===this.cmi.mode&&"credit"===this.cmi.credit&&(this.cmi.completion_threshold&&this.cmi.progress_measure&&(this.cmi.progress_measure>=this.cmi.completion_threshold?this.cmi.completion_status="completed":this.cmi.completion_status="incomplete"),this.cmi.scaled_passing_score&&this.cmi.score.scaled&&(this.cmi.score.scaled>=this.cmi.scaled_passing_score?this.cmi.success_status="passed":this.cmi.success_status="failed")),t=!1,this.adl.nav.request!==(null===(l=null===(c=null===(a=this.startingData)||void 0===a?void 0:a.adl)||void 0===c?void 0:c.nav)||void 0===l?void 0:l.request)&&"_none_"!==this.adl.nav.request&&(this.adl.nav.request=encodeURIComponent(this.adl.nav.request),t=!0),i=e||this.settings.alwaysSendTotalTime,n=this.settings.renderCommonCommitFields?this.renderCommitObject(i):this.renderCommitCMI(i),this.apiLogLevel===o.A.global.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(n)),"string"!=typeof this.settings.lmsCommitUrl?[3,2]:[4,this.processHttpRequest(this.settings.lmsCommitUrl,n,e)];case 1:return s=r.sent(),t&&void 0!==s.navRequest&&""!==s.navRequest&&Function('"use strict";(() => { '.concat(s.navRequest," })()"))(),[2,s];case 2:return[2,{result:o.A.global.SCORM_TRUE,errorCode:0}]}}))}))},t}(n.A)},589:function(e,t,i){i.d(t,{B:function(){return c}});var r=i(635),n=i(319),o=i(797),s=i(784),a=o.A.scorm12,c=function(e){function t(t){var i=e.call(this)||this;return i.__children=t.children,i._errorCode=t.errorCode||a.GENERAL,i._errorClass=t.errorClass||s.$h,i.childArray=[],i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_count",{get:function(){return this.childArray.length},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;for(var e={},t=0;t=n[0]){if("*"===n[1]||e<=n[1])return!0;throw new r(i)}throw new r(i)}i.d(t,{W:function(){return n},q:function(){return r}})},989:function(e,t,i){i.d(t,{Y:function(){return g}});var r=i(635),n=i(340),o=i(797),s=i(417),a=i(784),c=i(319),l=i(915),u=i(434),h=i(864),_=function(e){function t(){var t=e.call(this)||this;return t.__children=n.A.scorm12.core_children,t._student_id="",t._student_name="",t._lesson_location="",t._credit="",t._lesson_status="not attempted",t._entry="",t._total_time="",t._lesson_mode="normal",t._exit="",t._session_time="00:00:00",t._suspend_data="",t.score=new u._({score_children:n.A.scorm12.score_children,score_range:s.A.scorm12.score_range,invalidErrorCode:o.A.scorm12.INVALID_SET_VALUE,invalidTypeCode:o.A.scorm12.TYPE_MISMATCH,invalidRangeCode:o.A.scorm12.VALUE_OUT_OF_RANGE,errorClass:a.tQ}),t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_id",{get:function(){return this._student_id},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._student_id=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_name",{get:function(){return this._student_name},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._student_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_location",{get:function(){return this._lesson_location},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString256,!0)&&(this._lesson_location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"credit",{get:function(){return this._credit},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._credit=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_status",{get:function(){return this._lesson_status},set:function(e){this.initialized?(0,l.p)(e,s.A.scorm12.CMIStatus)&&(this._lesson_status=e):(0,l.p)(e,s.A.scorm12.CMIStatus2)&&(this._lesson_status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"entry",{get:function(){return this._entry},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._entry=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"total_time",{get:function(){return this._total_time},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._total_time=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_mode",{get:function(){return this._lesson_mode},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._lesson_mode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"exit",{get:function(){if(!this.jsonString)throw new a.tQ(o.A.scorm12.WRITE_ONLY_ELEMENT);return this._exit},set:function(e){(0,l.p)(e,s.A.scorm12.CMIExit,!0)&&(this._exit=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"session_time",{get:function(){if(!this.jsonString)throw new a.tQ(o.A.scorm12.WRITE_ONLY_ELEMENT);return this._session_time},set:function(e){(0,l.p)(e,s.A.scorm12.CMITimespan)&&(this._session_time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"suspend_data",{get:function(){return this._suspend_data},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString4096,!0)&&(this._suspend_data=e)},enumerable:!1,configurable:!0}),t.prototype.getCurrentTotalTime=function(e){var t=this._session_time,i=e;if(null!=i){var r=(new Date).getTime()-i;t=h.UZ(r/1e3)}return h.HT(this._total_time,t,new RegExp(s.A.scorm12.CMITimespan))},t.prototype.toJSON=function(){this.jsonString=!0;var e={student_id:this.student_id,student_name:this.student_name,lesson_location:this.lesson_location,credit:this.credit,lesson_status:this.lesson_status,entry:this.entry,lesson_mode:this.lesson_mode,exit:this.exit,session_time:this.session_time,score:this.score};return delete this.jsonString,e},t}(c.J),m=i(176),d=i(532),p=i(181),f=i(833),g=function(e){function t(t,i,r){var o=e.call(this)||this;return o.__children="",o.__version="3.4",o._launch_data="",o._comments="",o._comments_from_lms="",r&&o.initialize(),o.__children=t||n.A.scorm12.cmi_children,o.core=new _,o.objectives=new m.C,o.student_data=i||new d.X,o.student_preference=new p.G,o.interactions=new f.Xb,o}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t,i,r,n,o;e.prototype.initialize.call(this),null===(t=this.core)||void 0===t||t.initialize(),null===(i=this.objectives)||void 0===i||i.initialize(),null===(r=this.student_data)||void 0===r||r.initialize(),null===(n=this.student_preference)||void 0===n||n.initialize(),null===(o=this.interactions)||void 0===o||o.initialize()},t.prototype.toJSON=function(){this.jsonString=!0;var e={suspend_data:this.suspend_data,launch_data:this.launch_data,comments:this.comments,comments_from_lms:this.comments_from_lms,core:this.core,objectives:this.objectives,student_data:this.student_data,student_preference:this.student_preference,interactions:this.interactions};return delete this.jsonString,e},Object.defineProperty(t.prototype,"_version",{get:function(){return this.__version},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"suspend_data",{get:function(){var e;return null===(e=this.core)||void 0===e?void 0:e.suspend_data},set:function(e){this.core&&(this.core.suspend_data=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"launch_data",{get:function(){return this._launch_data},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._launch_data=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"comments",{get:function(){return this._comments},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString4096,!0)&&(this._comments=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"comments_from_lms",{get:function(){return this._comments_from_lms},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._comments_from_lms=e},enumerable:!1,configurable:!0}),t.prototype.getCurrentTotalTime=function(){return this.core.getCurrentTotalTime(this.start_time)},t}(c.r)},833:function(e,t,i){i.d(t,{Oh:function(){return m},WP:function(){return _},Xb:function(){return h},cb:function(){return d}});var r=i(635),n=i(589),o=i(340),s=i(797),a=i(784),c=i(319),l=i(915),u=i(417),h=function(e){function t(){return e.call(this,{children:o.A.scorm12.interactions_children,errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ})||this}return(0,r.C6)(t,e),t}(n.B),_=function(e){function t(){var t=e.call(this)||this;return t._id="",t._time="",t._type="",t._weighting="",t._student_response="",t._result="",t._latency="",t.objectives=new n.B({errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ,children:o.A.scorm12.objectives_children}),t.correct_responses=new n.B({errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ,children:o.A.scorm12.correct_responses_children}),t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t,i;e.prototype.initialize.call(this),null===(t=this.objectives)||void 0===t||t.initialize(),null===(i=this.correct_responses)||void 0===i||i.initialize()},Object.defineProperty(t.prototype,"id",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._id},set:function(e){(0,l.p)(e,u.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._time},set:function(e){(0,l.p)(e,u.A.scorm12.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._type},set:function(e){(0,l.p)(e,u.A.scorm12.CMIType)&&(this._type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weighting",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._weighting},set:function(e){(0,l.p)(e,u.A.scorm12.CMIDecimal)&&(0,l.h)(e,u.A.scorm12.weighting_range)&&(this._weighting=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_response",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._student_response},set:function(e){(0,l.p)(e,u.A.scorm12.CMIFeedback,!0)&&(this._student_response=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"result",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._result},set:function(e){(0,l.p)(e,u.A.scorm12.CMIResult)&&(this._result=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"latency",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._latency},set:function(e){(0,l.p)(e,u.A.scorm12.CMITimespan)&&(this._latency=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,time:this.time,type:this.type,weighting:this.weighting,student_response:this.student_response,result:this.result,latency:this.latency,objectives:this.objectives,correct_responses:this.correct_responses};return delete this.jsonString,e},t}(c.J),m=function(e){function t(){var t=e.call(this)||this;return t._id="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(e){(0,l.p)(e,u.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id};return delete this.jsonString,e},t}(c.J),d=function(e){function t(){var t=e.call(this)||this;return t._pattern="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"pattern",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._pattern},set:function(e){(0,l.p)(e,u.A.scorm12.CMIFeedback,!0)&&(this._pattern=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={pattern:this._pattern};return delete this.jsonString,e},t}(c.J)},331:function(e,t,i){i.d(t,{A:function(){return a}});var r=i(635),n=i(319),o=i(915),s=i(417),a=function(e){function t(){var t=e.call(this)||this;return t._event="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"event",{get:function(){return this._event},set:function(e){(0,o.p)(e,s.A.scorm12.NAVEvent)&&(this._event=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={event:this.event};return delete this.jsonString,e},t}(n.J)},176:function(e,t,i){i.d(t,{C:function(){return h},N:function(){return _}});var r=i(635),n=i(319),o=i(434),s=i(340),a=i(417),c=i(797),l=i(784),u=i(915),h=function(e){function t(){return e.call(this,{children:s.A.scorm12.objectives_children,errorCode:c.A.scorm12.INVALID_SET_VALUE,errorClass:l.tQ})||this}return(0,r.C6)(t,e),t}(i(589).B),_=function(e){function t(){var t=e.call(this)||this;return t._id="",t._status="",t.score=new o._({score_children:s.A.scorm12.score_children,score_range:a.A.scorm12.score_range,invalidErrorCode:c.A.scorm12.INVALID_SET_VALUE,invalidTypeCode:c.A.scorm12.TYPE_MISMATCH,invalidRangeCode:c.A.scorm12.VALUE_OUT_OF_RANGE,errorClass:l.tQ}),t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(e){(0,u.p)(e,a.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},set:function(e){(0,u.p)(e,a.A.scorm12.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,status:this.status,score:this.score};return delete this.jsonString,e},t}(n.J)},532:function(e,t,i){i.d(t,{X:function(){return c}});var r=i(635),n=i(319),o=i(340),s=i(784),a=i(797),c=function(e){function t(t){var i=e.call(this)||this;return i._mastery_score="",i._max_time_allowed="",i._time_limit_action="",i.__children=t||o.A.scorm12.student_data_children,i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new s.tQ(a.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mastery_score",{get:function(){return this._mastery_score},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._mastery_score=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"max_time_allowed",{get:function(){return this._max_time_allowed},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._max_time_allowed=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time_limit_action",{get:function(){return this._time_limit_action},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._time_limit_action=e},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={mastery_score:this.mastery_score,max_time_allowed:this.max_time_allowed,time_limit_action:this.time_limit_action};return delete this.jsonString,e},t}(n.J)},181:function(e,t,i){i.d(t,{G:function(){return u}});var r=i(635),n=i(319),o=i(340),s=i(784),a=i(797),c=i(915),l=i(417),u=function(e){function t(t){var i=e.call(this)||this;return i._audio="",i._language="",i._speed="",i._text="",i.__children=t||o.A.scorm12.student_preference_children,i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new s.tQ(a.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audio",{get:function(){return this._audio},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.audio_range)&&(this._audio=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"language",{get:function(){return this._language},set:function(e){(0,c.p)(e,l.A.scorm12.CMIString256)&&(this._language=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speed",{get:function(){return this._speed},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.speed_range)&&(this._speed=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this._text},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.text_range)&&(this._text=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,speed:this.speed,text:this.text};return delete this.jsonString,e},t}(n.J)},915:function(e,t,i){i.d(t,{h:function(){return a},p:function(){return s}});var r=i(449),n=i(797),o=i(784);function s(e,t,i){return(0,r.q)(e,t,n.A.scorm12.TYPE_MISMATCH,o.tQ,i)}function a(e,t,i){if(!i&&""===e)throw new o.tQ(n.A.scorm12.VALUE_OUT_OF_RANGE);return(0,r.W)(e,t,n.A.scorm12.VALUE_OUT_OF_RANGE,o.tQ)}},340:function(e,t,i){var r=i(635),n={cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",core_children:"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time",score_children:"raw,min,max",comments_children:"content,location,time",objectives_children:"id,score,status",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio,language,speed,text",interactions_children:"id,objectives,time,type,correct_responses,weighting,student_response,result,latency",error_descriptions:{101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information"},201:{basicMessage:"Invalid argument error",detailMessage:"Indicates that an argument represents an invalid data model element or is otherwise incorrect."},202:{basicMessage:"Element cannot have children",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.'},203:{basicMessage:"Element not an array - cannot have count",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.'},301:{basicMessage:"Not initialized",detailMessage:"Indicates that an API call was made before the call to lmsInitialize."},401:{basicMessage:"Not implemented error",detailMessage:"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement."},402:{basicMessage:"Invalid set value, element is a keyword",detailMessage:'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").'},403:{basicMessage:"Element is read only",detailMessage:"LMSSetValue was called with a data model element that can only be read."},404:{basicMessage:"Element is write only",detailMessage:"LMSGetValue was called on a data model element that can only be written to."},405:{basicMessage:"Incorrect Data Type",detailMessage:"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Element Value Out Of Range",detailMessage:"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}},o={global:{SCORM_TRUE:"true",SCORM_FALSE:"false",STATE_NOT_INITIALIZED:0,STATE_INITIALIZED:1,STATE_TERMINATED:2,LOG_LEVEL_DEBUG:1,LOG_LEVEL_INFO:2,LOG_LEVEL_WARNING:3,LOG_LEVEL_ERROR:4,LOG_LEVEL_NONE:5},scorm12:n,aicc:(0,r.Cl)((0,r.Cl)({},n),{cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation",student_preference_children:"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows",student_data_children:"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action",student_demographics_children:"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience",tries_children:"time,status,score",attempt_records_children:"score,lesson_status",paths_children:"location_id,date,time,status,why_left,time_in_element"}),scorm2004:{cmi_children:"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time",comments_children:"comment,timestamp,location",score_children:"max,raw,scaled,min",objectives_children:"progress_measure,completion_status,success_status,description,score,id",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio_level,audio_captioning,delivery_speed,language",interactions_children:"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description",error_descriptions:{0:{basicMessage:"No Error",detailMessage:"No error occurred, the previous API call was successful."},101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use GetDiagnostic for more information."},102:{basicMessage:"General Initialization Failure",detailMessage:"Call to Initialize failed for an unknown reason."},103:{basicMessage:"Already Initialized",detailMessage:"Call to Initialize failed because Initialize was already called."},104:{basicMessage:"Content Instance Terminated",detailMessage:"Call to Initialize failed because Terminate was already called."},111:{basicMessage:"General Termination Failure",detailMessage:"Call to Terminate failed for an unknown reason."},112:{basicMessage:"Termination Before Initialization",detailMessage:"Call to Terminate failed because it was made before the call to Initialize."},113:{basicMessage:"Termination After Termination",detailMessage:"Call to Terminate failed because Terminate was already called."},122:{basicMessage:"Retrieve Data Before Initialization",detailMessage:"Call to GetValue failed because it was made before the call to Initialize."},123:{basicMessage:"Retrieve Data After Termination",detailMessage:"Call to GetValue failed because it was made after the call to Terminate."},132:{basicMessage:"Store Data Before Initialization",detailMessage:"Call to SetValue failed because it was made before the call to Initialize."},133:{basicMessage:"Store Data After Termination",detailMessage:"Call to SetValue failed because it was made after the call to Terminate."},142:{basicMessage:"Commit Before Initialization",detailMessage:"Call to Commit failed because it was made before the call to Initialize."},143:{basicMessage:"Commit After Termination",detailMessage:"Call to Commit failed because it was made after the call to Terminate."},201:{basicMessage:"General Argument Error",detailMessage:"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument."},301:{basicMessage:"General Get Failure",detailMessage:"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},351:{basicMessage:"General Set Failure",detailMessage:"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},391:{basicMessage:"General Commit Failure",detailMessage:"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information."},401:{basicMessage:"Undefined Data Model Element",detailMessage:"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element."},402:{basicMessage:"Unimplemented Data Model Element",detailMessage:"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant."},403:{basicMessage:"Data Model Element Value Not Initialized",detailMessage:"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO."},404:{basicMessage:"Data Model Element Is Read Only",detailMessage:"SetValue was called with a data model element that can only be read."},405:{basicMessage:"Data Model Element Is Write Only",detailMessage:"GetValue was called on a data model element that can only be written to."},406:{basicMessage:"Data Model Element Type Mismatch",detailMessage:"SetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Data Model Element Value Out Of Range",detailMessage:"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}}};t.A=o},56:function(e,t,i){var r,n,o;i.d(t,{K$:function(){return r},YE:function(){return n},lC:function(){return o}}),function(e){e.unknown="unknown",e.true="true",e.false="false"}(r||(r={})),function(e){e.passed="passed",e.failed="failed",e.unknown="unknown"}(n||(n={})),function(e){e.completed="completed",e.incomplete="incomplete",e.unknown="unknown"}(o||(o={}))},797:function(e,t,i){var r=i(635),n={GENERAL:101,INITIALIZATION_FAILED:101,INITIALIZED:101,TERMINATED:101,TERMINATION_FAILURE:101,TERMINATION_BEFORE_INIT:101,MULTIPLE_TERMINATION:101,RETRIEVE_BEFORE_INIT:101,RETRIEVE_AFTER_TERM:101,STORE_BEFORE_INIT:101,STORE_AFTER_TERM:101,COMMIT_BEFORE_INIT:101,COMMIT_AFTER_TERM:101,ARGUMENT_ERROR:101,CHILDREN_ERROR:101,COUNT_ERROR:101,GENERAL_GET_FAILURE:101,GENERAL_SET_FAILURE:101,GENERAL_COMMIT_FAILURE:101,UNDEFINED_DATA_MODEL:101,UNIMPLEMENTED_ELEMENT:101,VALUE_NOT_INITIALIZED:101,INVALID_SET_VALUE:101,READ_ONLY_ELEMENT:101,WRITE_ONLY_ELEMENT:101,TYPE_MISMATCH:101,VALUE_OUT_OF_RANGE:101,DEPENDENCY_NOT_ESTABLISHED:101},o={scorm12:(0,r.Cl)((0,r.Cl)({},n),{RETRIEVE_BEFORE_INIT:301,STORE_BEFORE_INIT:301,COMMIT_BEFORE_INIT:301,ARGUMENT_ERROR:201,CHILDREN_ERROR:202,COUNT_ERROR:203,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:401,VALUE_NOT_INITIALIZED:301,INVALID_SET_VALUE:402,READ_ONLY_ELEMENT:403,WRITE_ONLY_ELEMENT:404,TYPE_MISMATCH:405,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408}),scorm2004:(0,r.Cl)((0,r.Cl)({},n),{INITIALIZATION_FAILED:102,INITIALIZED:103,TERMINATED:104,TERMINATION_FAILURE:111,TERMINATION_BEFORE_INIT:112,MULTIPLE_TERMINATIONS:113,RETRIEVE_BEFORE_INIT:122,RETRIEVE_AFTER_TERM:123,STORE_BEFORE_INIT:132,STORE_AFTER_TERM:133,COMMIT_BEFORE_INIT:142,COMMIT_AFTER_TERM:143,ARGUMENT_ERROR:201,GENERAL_GET_FAILURE:301,GENERAL_SET_FAILURE:351,GENERAL_COMMIT_FAILURE:391,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:402,VALUE_NOT_INITIALIZED:403,READ_ONLY_ELEMENT:404,WRITE_ONLY_ELEMENT:405,TYPE_MISMATCH:406,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408})};t.A=o},417:function(e,t,i){var r=i(635),n={CMIString256:"^.{0,255}$",CMIString4096:"^.{0,4096}$",CMITime:"^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",CMITimespan:"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{0,3})(.[0-9]*)?$",CMIIdentifier:"^[\\u0021-\\u007E\\s]{0,255}$",CMIFeedback:"^.{0,255}$",CMIIndex:"[._](\\d+).",CMIStatus:"^(passed|completed|failed|incomplete|browsed)$",CMIStatus2:"^(passed|completed|failed|incomplete|browsed|not attempted)$",CMIExit:"^(time-out|suspend|logout|)$",CMIType:"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$",CMIResult:"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$",NAVEvent:"^(previous|continue)$",score_range:"0#100",audio_range:"-1#100",speed_range:"-100#100",weighting_range:"-100#100",text_range:"-1#1"},o={aicc:(0,r.Cl)((0,r.Cl)({},n),{CMIIdentifier:"^\\w{1,255}$"}),scorm12:n,scorm2004:{CMIString200:"^[\\u0000-\\uFFFF]{0,200}$",CMIString250:"^[\\u0000-\\uFFFF]{0,250}$",CMIString1000:"^[\\u0000-\\uFFFF]{0,1000}$",CMIString4000:"^[\\u0000-\\uFFFF]{0,4000}$",CMIString64000:"^[\\u0000-\\uFFFF]{0,64000}$",CMILang:"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$",CMILangString250:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$",CMILangcr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$",CMILangString250cr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$",CMILangString4000:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$",CMITime:"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$",CMITimespan:"^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{1,5})(\\.[0-9]{1,18})?$",CMIIdentifier:"^\\S{1,250}[a-zA-Z0-9]$",CMIShortIdentifier:"^[\\w\\.\\-\\_]{1,250}$",CMILongIdentifier:"^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$",CMIFeedback:"^.*$",CMIIndex:"[._](\\d+).",CMIIndexStore:".N(\\d+).",CMICStatus:"^(completed|incomplete|not attempted|unknown)$",CMISStatus:"^(passed|failed|unknown)$",CMIExit:"^(time-out|suspend|logout|normal)$",CMIType:"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",CMIResult:"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",NAVEvent:"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$",NAVBoolean:"^(unknown|true|false$)",NAVTarget:"^{target=\\S{0,}[a-zA-Z0-9-_]+}$",scaled_range:"-1#1",audio_range:"0#*",speed_range:"0#*",text_range:"-1#1",progress_range:"0#1"}};t.A=o},784:function(e,t,i){i.d(t,{$h:function(){return c},gv:function(){return h},tQ:function(){return u},wq:function(){return _},yI:function(){return l}});var r=i(635),n=i(340),o=n.A.scorm12.error_descriptions,s=n.A.aicc.error_descriptions,a=n.A.scorm2004.error_descriptions,c=function(e){function t(t){var i=e.call(this,t.toString())||this;return i._errorCode=t,i.name="ScormValidationError",i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"errorCode",{get:function(){return this._errorCode},enumerable:!1,configurable:!0}),t.prototype.setMessage=function(e){this.message=e},t}(Error),l=function(e){function t(t,i,r){var n=e.call(this,t)||this;return n._detailedMessage="",n.setMessage(i),n._errorMessage=i,r&&(n._detailedMessage=r),n}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"errorMessage",{get:function(){return this._errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"detailedMessage",{get:function(){return this._detailedMessage},enumerable:!1,configurable:!0}),t}(c),u=function(e){function t(t){return{}.hasOwnProperty.call(o,String(t))?e.call(this,t,o[String(t)].basicMessage,o[String(t)].detailMessage)||this:e.call(this,101,o[101].basicMessage,o[101].detailMessage)||this}return(0,r.C6)(t,e),t}(l),h=function(e){function t(t){return{}.hasOwnProperty.call(s,String(t))?e.call(this,t,s[String(t)].basicMessage,s[String(t)].detailMessage)||this:e.call(this,101,s[101].basicMessage,s[101].detailMessage)||this}return(0,r.C6)(t,e),t}(l),_=function(e){function t(t){return{}.hasOwnProperty.call(a,String(t))?e.call(this,t,a[String(t)].basicMessage,a[String(t)].detailMessage)||this:e.call(this,101,a[101].basicMessage,a[101].detailMessage)||this}return(0,r.C6)(t,e),t}(l)},864:function(e,t,i){i.d(t,{$o:function(){return l},Bq:function(){return h},HT:function(){return u},J6:function(){return p},OI:function(){return c},UZ:function(){return o},f4:function(){return a},hw:function(){return d},sB:function(){return _},xE:function(){return s}});var r=3600,n={D:24*r,H:r,M:60,S:1};function o(e){if(!e||e<=0)return"00:00:00";var t=Math.floor(e/r),i=new Date(1e3*e),n=i.getUTCMinutes(),o=i.getSeconds(),s=e%1,a="";return m(s)>0&&(a="."+(a=m(s)>2?s.toFixed(2):String(s)).split(".")[1]),(t+":"+n+":"+o).replace(/\b\d\b/g,"0$&")+a}function s(e){if(!e||e<=0)return"PT0S";var t="P",i=e;for(var r in n){var o=n[r],s=Math.floor(i/o);m(i%=o)>2&&(i=Number(Number(i).toFixed(2))),"S"===r&&i>0&&(s+=i),s&&((t.indexOf("D")>0||"H"===r||"M"===r||"S"===r)&&-1===t.indexOf("T")&&(t+="T"),t+="".concat(s).concat(r))}return t}function a(e,t){if("number"!=typeof e&&"boolean"!=typeof e||(e=String(e)),"string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var i=e.split(":");return 3600*Number(i[0])+60*Number(i[1])+Number(i[2])}function c(e,t){if("string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var i=new RegExp(t).exec(e)||[],r=i[1],n=(i[2],i[4]),o=i[5],s=i[6],a=i[7],c=0;return c+=Number(a)||0,c+=60*Number(s)||0,c+=3600*Number(o)||0,c+=86400*Number(n)||0,c+=31536e3*Number(r)||0}function l(e,t,i){var r="string"==typeof i?new RegExp(i):i;return s(c(e,r)+c(t,r))}function u(e,t,i){return"string"==typeof i&&(i=new RegExp(i)),o(a(e,i)+a(t,i))}function h(e){var t={};return function e(i,r){if(Object(i)!==i)t[r]=i;else if(Array.isArray(i))for(var n=0,o=i.length;n0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]=this.apiLogLevel&&this.settings.onLogMessage(r,t)},Object.defineProperty(e.prototype,"error_codes",{get:function(){return this._error_codes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"settings",{get:function(){return this._settings},set:function(e){this._settings=(0,i.Cl)((0,i.Cl)({},this._settings),e)},enumerable:!1,configurable:!0}),e.prototype.terminate=function(e,t){return(0,i.sH)(this,void 0,void 0,(function(){var r,n;return(0,i.YH)(this,(function(i){switch(i.label){case 0:return r=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.TERMINATION_BEFORE_INIT,this._error_codes.MULTIPLE_TERMINATION)?(this.currentState=a.A.global.STATE_TERMINATED,[4,this.storeData(!0)]):[3,2];case 1:void 0!==(n=i.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),r=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,t&&(this.lastErrorCode="0"),r=a.A.global.SCORM_TRUE,this.processListeners(e),i.label=2;case 2:return this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(r),[2,r]}}))}))},e.prototype.getValue=function(e,t,r){var i="";if(this.checkState(t,this._error_codes.RETRIEVE_BEFORE_INIT,this._error_codes.RETRIEVE_AFTER_TERM)){t&&(this.lastErrorCode="0");try{i=this.getCMIValue(r)}catch(e){i=this.handleValueAccessException(e,i)}this.processListeners(e,r)}return this.apiLog(e,": returned: "+i,a.A.global.LOG_LEVEL_INFO,r),void 0===i?"":(this.clearSCORMError(i),i)},e.prototype.setValue=function(e,t,r,i,n){void 0!==n&&(n=String(n));var o=a.A.global.SCORM_FALSE;if(this.checkState(r,this._error_codes.STORE_BEFORE_INIT,this._error_codes.STORE_AFTER_TERM)){r&&(this.lastErrorCode="0");try{o=this.setCMIValue(i,n)}catch(e){this.handleValueAccessException(e,o)}this.processListeners(e,i,n)}return void 0===o&&(o=a.A.global.SCORM_FALSE),"0"===String(this.lastErrorCode)&&this.settings.autocommit&&!this._timeout&&this.scheduleCommit(1e3*this.settings.autocommitSeconds,t),this.apiLog(e,": "+n+": result: "+o,a.A.global.LOG_LEVEL_INFO,i),this.clearSCORMError(o),o},e.prototype.commit=function(e){return(0,i.sH)(this,arguments,void 0,(function(e,t){var r,n;return void 0===t&&(t=!1),(0,i.YH)(this,(function(i){switch(i.label){case 0:return this.clearScheduledCommit(),r=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.COMMIT_BEFORE_INIT,this._error_codes.COMMIT_AFTER_TERM)?[4,this.storeData(!1)]:[3,2];case 1:(n=i.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),r=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,this.apiLog(e," Result: "+r,a.A.global.LOG_LEVEL_DEBUG,"HttpRequest"),t&&(this.lastErrorCode="0"),this.processListeners(e),i.label=2;case 2:return this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(r),[2,r]}}))}))},e.prototype.getLastError=function(e){var t=String(this.lastErrorCode);return this.processListeners(e),this.apiLog(e,"returned: "+t,a.A.global.LOG_LEVEL_INFO),t},e.prototype.getErrorString=function(e,t){var r="";return null!==t&&""!==t&&(r=this.getLmsErrorMessageDetails(t),this.processListeners(e)),this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),r},e.prototype.getDiagnostic=function(e,t){var r="";return null!==t&&""!==t&&(r=this.getLmsErrorMessageDetails(t,!0),this.processListeners(e)),this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),r},e.prototype.checkState=function(e,t,r){return this.isNotInitialized()?(this.throwSCORMError(t),!1):!e||!this.isTerminated()||(this.throwSCORMError(r),!1)},e.prototype.getLmsErrorMessageDetails=function(e,t){throw void 0===t&&(t=!1),new Error("The getLmsErrorMessageDetails method has not been implemented")},e.prototype.getCMIValue=function(e){throw new Error("The getCMIValue method has not been implemented")},e.prototype.setCMIValue=function(e,t){throw new Error("The setCMIValue method has not been implemented")},e.prototype._commonSetCMIValue=function(e,t,r,o){if(!r||""===r)return a.A.global.SCORM_FALSE;for(var s=r.split("."),l=this,u=a.A.global.SCORM_FALSE,d=!1,_="The data model element passed to ".concat(e," (").concat(r,") is not a valid SCORM data model element."),h=t?this._error_codes.UNDEFINED_DATA_MODEL:this._error_codes.GENERAL,m=0;m1&&(s=e.replace(o+".","")),this.listenerArray.push({functionName:o,CMIElement:s,callback:t}),this.apiLog("on","Added event listener: ".concat(this.listenerArray.length),a.A.global.LOG_LEVEL_INFO,o)}},e.prototype.off=function(e,t){if(t)for(var r=e.split(" "),i=function(i){var o=r[i].split(".");if(0===o.length)return{value:void 0};var s=o[0],c=null;o.length>1&&(c=e.replace(s+".",""));var l=n.listenerArray.findIndex((function(e){return e.functionName===s&&e.CMIElement===c&&e.callback===t}));-1!==l&&(n.listenerArray.splice(l,1),n.apiLog("off","Removed event listener: ".concat(n.listenerArray.length),a.A.global.LOG_LEVEL_INFO,s))},n=this,o=0;o1&&(s=e.replace(o+".","")),i.listenerArray=i.listenerArray.filter((function(e){return e.functionName!==o&&e.CMIElement!==s}))},i=this,n=0;ns?1:0})),s.forEach((function(e){(i={})[e[0]]=e[1],r.loadFromJSON((0,c.sB)(i),t)}))}else console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize.");function a(e,t,r){var i,n=e.match(r);if(null!==n&&null!==(i=t.match(r))){var o=Number(n[2]),s=Number(i[2]);return o===s?"id"===n[3]?-1:"type"===n[3]?"id"===i[3]?1:-1:1:o-s}return null}},e.prototype.loadFromJSON=function(e,t){if(this.isNotInitialized()){for(var r in t=void 0!==t?t:"cmi",this.startingData=e,e)if({}.hasOwnProperty.call(e,r)&&e[r]){var i=(t?t+".":"")+r,n=e[r];if(n.childArray)for(var o=0;o=200&&e.status<=299&&(!0===t.result||t.result===a.A.global.SCORM_TRUE)?this.processListeners("CommitSuccess"):this.processListeners("CommitError"),[2,t]}}))}))},e}(),_=d},589:function(e,t,r){r.d(t,{B:function(){return c}});var i=r(635),n=r(319),o=r(797),s=r(784),a=o.A.scorm12,c=function(e){function t(t){var r=e.call(this)||this;return r.__children=t.children,r._errorCode=t.errorCode||a.GENERAL,r._errorClass=t.errorClass||s.$h,r.childArray=[],r}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_count",{get:function(){return this.childArray.length},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;for(var e={},t=0;t=n[0]){if("*"===n[1]||e<=n[1])return!0;throw new i(r)}throw new i(r)}r.d(t,{W:function(){return n},q:function(){return i}})},989:function(e,t,r){r.d(t,{Y:function(){return g}});var i=r(635),n=r(340),o=r(797),s=r(417),a=r(784),c=r(319),l=r(915),u=r(434),d=r(864),_=function(e){function t(){var t=e.call(this)||this;return t.__children=n.A.scorm12.core_children,t._student_id="",t._student_name="",t._lesson_location="",t._credit="",t._lesson_status="not attempted",t._entry="",t._total_time="",t._lesson_mode="normal",t._exit="",t._session_time="00:00:00",t._suspend_data="",t.score=new u._({score_children:n.A.scorm12.score_children,score_range:s.A.scorm12.score_range,invalidErrorCode:o.A.scorm12.INVALID_SET_VALUE,invalidTypeCode:o.A.scorm12.TYPE_MISMATCH,invalidRangeCode:o.A.scorm12.VALUE_OUT_OF_RANGE,errorClass:a.tQ}),t}return(0,i.C6)(t,e),t.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_id",{get:function(){return this._student_id},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._student_id=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_name",{get:function(){return this._student_name},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._student_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_location",{get:function(){return this._lesson_location},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString256,!0)&&(this._lesson_location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"credit",{get:function(){return this._credit},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._credit=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_status",{get:function(){return this._lesson_status},set:function(e){this.initialized?(0,l.p)(e,s.A.scorm12.CMIStatus)&&(this._lesson_status=e):(0,l.p)(e,s.A.scorm12.CMIStatus2)&&(this._lesson_status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"entry",{get:function(){return this._entry},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._entry=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"total_time",{get:function(){return this._total_time},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._total_time=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_mode",{get:function(){return this._lesson_mode},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._lesson_mode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"exit",{get:function(){if(!this.jsonString)throw new a.tQ(o.A.scorm12.WRITE_ONLY_ELEMENT);return this._exit},set:function(e){(0,l.p)(e,s.A.scorm12.CMIExit,!0)&&(this._exit=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"session_time",{get:function(){if(!this.jsonString)throw new a.tQ(o.A.scorm12.WRITE_ONLY_ELEMENT);return this._session_time},set:function(e){(0,l.p)(e,s.A.scorm12.CMITimespan)&&(this._session_time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"suspend_data",{get:function(){return this._suspend_data},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString4096,!0)&&(this._suspend_data=e)},enumerable:!1,configurable:!0}),t.prototype.getCurrentTotalTime=function(e){var t=this._session_time,r=e;if(null!=r){var i=(new Date).getTime()-r;t=d.UZ(i/1e3)}return d.HT(this._total_time,t,new RegExp(s.A.scorm12.CMITimespan))},t.prototype.toJSON=function(){this.jsonString=!0;var e={student_id:this.student_id,student_name:this.student_name,lesson_location:this.lesson_location,credit:this.credit,lesson_status:this.lesson_status,entry:this.entry,lesson_mode:this.lesson_mode,exit:this.exit,session_time:this.session_time,score:this.score};return delete this.jsonString,e},t}(c.J),h=r(176),m=r(532),f=r(181),p=r(833),g=function(e){function t(t,r,i){var o=e.call(this)||this;return o.__children="",o.__version="3.4",o._launch_data="",o._comments="",o._comments_from_lms="",i&&o.initialize(),o.__children=t||n.A.scorm12.cmi_children,o.core=new _,o.objectives=new h.C,o.student_data=r||new m.X,o.student_preference=new f.G,o.interactions=new p.Xb,o}return(0,i.C6)(t,e),t.prototype.initialize=function(){var t,r,i,n,o;e.prototype.initialize.call(this),null===(t=this.core)||void 0===t||t.initialize(),null===(r=this.objectives)||void 0===r||r.initialize(),null===(i=this.student_data)||void 0===i||i.initialize(),null===(n=this.student_preference)||void 0===n||n.initialize(),null===(o=this.interactions)||void 0===o||o.initialize()},t.prototype.toJSON=function(){this.jsonString=!0;var e={suspend_data:this.suspend_data,launch_data:this.launch_data,comments:this.comments,comments_from_lms:this.comments_from_lms,core:this.core,objectives:this.objectives,student_data:this.student_data,student_preference:this.student_preference,interactions:this.interactions};return delete this.jsonString,e},Object.defineProperty(t.prototype,"_version",{get:function(){return this.__version},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"suspend_data",{get:function(){var e;return null===(e=this.core)||void 0===e?void 0:e.suspend_data},set:function(e){this.core&&(this.core.suspend_data=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"launch_data",{get:function(){return this._launch_data},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._launch_data=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"comments",{get:function(){return this._comments},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString4096,!0)&&(this._comments=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"comments_from_lms",{get:function(){return this._comments_from_lms},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._comments_from_lms=e},enumerable:!1,configurable:!0}),t.prototype.getCurrentTotalTime=function(){return this.core.getCurrentTotalTime(this.start_time)},t}(c.r)},833:function(e,t,r){r.d(t,{Oh:function(){return h},WP:function(){return _},Xb:function(){return d},cb:function(){return m}});var i=r(635),n=r(589),o=r(340),s=r(797),a=r(784),c=r(319),l=r(915),u=r(417),d=function(e){function t(){return e.call(this,{children:o.A.scorm12.interactions_children,errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ})||this}return(0,i.C6)(t,e),t}(n.B),_=function(e){function t(){var t=e.call(this)||this;return t._id="",t._time="",t._type="",t._weighting="",t._student_response="",t._result="",t._latency="",t.objectives=new n.B({errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ,children:o.A.scorm12.objectives_children}),t.correct_responses=new n.B({errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ,children:o.A.scorm12.correct_responses_children}),t}return(0,i.C6)(t,e),t.prototype.initialize=function(){var t,r;e.prototype.initialize.call(this),null===(t=this.objectives)||void 0===t||t.initialize(),null===(r=this.correct_responses)||void 0===r||r.initialize()},Object.defineProperty(t.prototype,"id",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._id},set:function(e){(0,l.p)(e,u.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._time},set:function(e){(0,l.p)(e,u.A.scorm12.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._type},set:function(e){(0,l.p)(e,u.A.scorm12.CMIType)&&(this._type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weighting",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._weighting},set:function(e){(0,l.p)(e,u.A.scorm12.CMIDecimal)&&(0,l.h)(e,u.A.scorm12.weighting_range)&&(this._weighting=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_response",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._student_response},set:function(e){(0,l.p)(e,u.A.scorm12.CMIFeedback,!0)&&(this._student_response=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"result",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._result},set:function(e){(0,l.p)(e,u.A.scorm12.CMIResult)&&(this._result=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"latency",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._latency},set:function(e){(0,l.p)(e,u.A.scorm12.CMITimespan)&&(this._latency=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,time:this.time,type:this.type,weighting:this.weighting,student_response:this.student_response,result:this.result,latency:this.latency,objectives:this.objectives,correct_responses:this.correct_responses};return delete this.jsonString,e},t}(c.J),h=function(e){function t(){var t=e.call(this)||this;return t._id="",t}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(e){(0,l.p)(e,u.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id};return delete this.jsonString,e},t}(c.J),m=function(e){function t(){var t=e.call(this)||this;return t._pattern="",t}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"pattern",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._pattern},set:function(e){(0,l.p)(e,u.A.scorm12.CMIFeedback,!0)&&(this._pattern=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={pattern:this._pattern};return delete this.jsonString,e},t}(c.J)},331:function(e,t,r){r.d(t,{A:function(){return a}});var i=r(635),n=r(319),o=r(915),s=r(417),a=function(e){function t(){var t=e.call(this)||this;return t._event="",t}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"event",{get:function(){return this._event},set:function(e){(0,o.p)(e,s.A.scorm12.NAVEvent)&&(this._event=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={event:this.event};return delete this.jsonString,e},t}(n.J)},176:function(e,t,r){r.d(t,{C:function(){return d},N:function(){return _}});var i=r(635),n=r(319),o=r(434),s=r(340),a=r(417),c=r(797),l=r(784),u=r(915),d=function(e){function t(){return e.call(this,{children:s.A.scorm12.objectives_children,errorCode:c.A.scorm12.INVALID_SET_VALUE,errorClass:l.tQ})||this}return(0,i.C6)(t,e),t}(r(589).B),_=function(e){function t(){var t=e.call(this)||this;return t._id="",t._status="",t.score=new o._({score_children:s.A.scorm12.score_children,score_range:a.A.scorm12.score_range,invalidErrorCode:c.A.scorm12.INVALID_SET_VALUE,invalidTypeCode:c.A.scorm12.TYPE_MISMATCH,invalidRangeCode:c.A.scorm12.VALUE_OUT_OF_RANGE,errorClass:l.tQ}),t}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(e){(0,u.p)(e,a.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},set:function(e){(0,u.p)(e,a.A.scorm12.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,status:this.status,score:this.score};return delete this.jsonString,e},t}(n.J)},532:function(e,t,r){r.d(t,{X:function(){return c}});var i=r(635),n=r(319),o=r(340),s=r(784),a=r(797),c=function(e){function t(t){var r=e.call(this)||this;return r._mastery_score="",r._max_time_allowed="",r._time_limit_action="",r.__children=t||o.A.scorm12.student_data_children,r}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new s.tQ(a.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mastery_score",{get:function(){return this._mastery_score},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._mastery_score=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"max_time_allowed",{get:function(){return this._max_time_allowed},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._max_time_allowed=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time_limit_action",{get:function(){return this._time_limit_action},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._time_limit_action=e},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={mastery_score:this.mastery_score,max_time_allowed:this.max_time_allowed,time_limit_action:this.time_limit_action};return delete this.jsonString,e},t}(n.J)},181:function(e,t,r){r.d(t,{G:function(){return u}});var i=r(635),n=r(319),o=r(340),s=r(784),a=r(797),c=r(915),l=r(417),u=function(e){function t(t){var r=e.call(this)||this;return r._audio="",r._language="",r._speed="",r._text="",r.__children=t||o.A.scorm12.student_preference_children,r}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new s.tQ(a.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audio",{get:function(){return this._audio},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.audio_range)&&(this._audio=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"language",{get:function(){return this._language},set:function(e){(0,c.p)(e,l.A.scorm12.CMIString256)&&(this._language=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speed",{get:function(){return this._speed},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.speed_range)&&(this._speed=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this._text},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.text_range)&&(this._text=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,speed:this.speed,text:this.text};return delete this.jsonString,e},t}(n.J)},915:function(e,t,r){r.d(t,{h:function(){return a},p:function(){return s}});var i=r(449),n=r(797),o=r(784);function s(e,t,r){return(0,i.q)(e,t,n.A.scorm12.TYPE_MISMATCH,o.tQ,r)}function a(e,t,r){if(!r&&""===e)throw new o.tQ(n.A.scorm12.VALUE_OUT_OF_RANGE);return(0,i.W)(e,t,n.A.scorm12.VALUE_OUT_OF_RANGE,o.tQ)}},340:function(e,t,r){var i=r(635),n={cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",core_children:"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time",score_children:"raw,min,max",comments_children:"content,location,time",objectives_children:"id,score,status",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio,language,speed,text",interactions_children:"id,objectives,time,type,correct_responses,weighting,student_response,result,latency",error_descriptions:{101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information"},201:{basicMessage:"Invalid argument error",detailMessage:"Indicates that an argument represents an invalid data model element or is otherwise incorrect."},202:{basicMessage:"Element cannot have children",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.'},203:{basicMessage:"Element not an array - cannot have count",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.'},301:{basicMessage:"Not initialized",detailMessage:"Indicates that an API call was made before the call to lmsInitialize."},401:{basicMessage:"Not implemented error",detailMessage:"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement."},402:{basicMessage:"Invalid set value, element is a keyword",detailMessage:'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").'},403:{basicMessage:"Element is read only",detailMessage:"LMSSetValue was called with a data model element that can only be read."},404:{basicMessage:"Element is write only",detailMessage:"LMSGetValue was called on a data model element that can only be written to."},405:{basicMessage:"Incorrect Data Type",detailMessage:"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Element Value Out Of Range",detailMessage:"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}},o={global:{SCORM_TRUE:"true",SCORM_FALSE:"false",STATE_NOT_INITIALIZED:0,STATE_INITIALIZED:1,STATE_TERMINATED:2,LOG_LEVEL_DEBUG:1,LOG_LEVEL_INFO:2,LOG_LEVEL_WARNING:3,LOG_LEVEL_ERROR:4,LOG_LEVEL_NONE:5},scorm12:n,aicc:(0,i.Cl)((0,i.Cl)({},n),{cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation",student_preference_children:"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows",student_data_children:"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action",student_demographics_children:"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience",tries_children:"time,status,score",attempt_records_children:"score,lesson_status",paths_children:"location_id,date,time,status,why_left,time_in_element"}),scorm2004:{cmi_children:"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time",comments_children:"comment,timestamp,location",score_children:"max,raw,scaled,min",objectives_children:"progress_measure,completion_status,success_status,description,score,id",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio_level,audio_captioning,delivery_speed,language",interactions_children:"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description",error_descriptions:{0:{basicMessage:"No Error",detailMessage:"No error occurred, the previous API call was successful."},101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use GetDiagnostic for more information."},102:{basicMessage:"General Initialization Failure",detailMessage:"Call to Initialize failed for an unknown reason."},103:{basicMessage:"Already Initialized",detailMessage:"Call to Initialize failed because Initialize was already called."},104:{basicMessage:"Content Instance Terminated",detailMessage:"Call to Initialize failed because Terminate was already called."},111:{basicMessage:"General Termination Failure",detailMessage:"Call to Terminate failed for an unknown reason."},112:{basicMessage:"Termination Before Initialization",detailMessage:"Call to Terminate failed because it was made before the call to Initialize."},113:{basicMessage:"Termination After Termination",detailMessage:"Call to Terminate failed because Terminate was already called."},122:{basicMessage:"Retrieve Data Before Initialization",detailMessage:"Call to GetValue failed because it was made before the call to Initialize."},123:{basicMessage:"Retrieve Data After Termination",detailMessage:"Call to GetValue failed because it was made after the call to Terminate."},132:{basicMessage:"Store Data Before Initialization",detailMessage:"Call to SetValue failed because it was made before the call to Initialize."},133:{basicMessage:"Store Data After Termination",detailMessage:"Call to SetValue failed because it was made after the call to Terminate."},142:{basicMessage:"Commit Before Initialization",detailMessage:"Call to Commit failed because it was made before the call to Initialize."},143:{basicMessage:"Commit After Termination",detailMessage:"Call to Commit failed because it was made after the call to Terminate."},201:{basicMessage:"General Argument Error",detailMessage:"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument."},301:{basicMessage:"General Get Failure",detailMessage:"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},351:{basicMessage:"General Set Failure",detailMessage:"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},391:{basicMessage:"General Commit Failure",detailMessage:"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information."},401:{basicMessage:"Undefined Data Model Element",detailMessage:"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element."},402:{basicMessage:"Unimplemented Data Model Element",detailMessage:"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant."},403:{basicMessage:"Data Model Element Value Not Initialized",detailMessage:"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO."},404:{basicMessage:"Data Model Element Is Read Only",detailMessage:"SetValue was called with a data model element that can only be read."},405:{basicMessage:"Data Model Element Is Write Only",detailMessage:"GetValue was called on a data model element that can only be written to."},406:{basicMessage:"Data Model Element Type Mismatch",detailMessage:"SetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Data Model Element Value Out Of Range",detailMessage:"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}}};t.A=o},56:function(e,t,r){var i,n,o;r.d(t,{YE:function(){return n},lC:function(){return o}}),function(e){e.unknown="unknown",e.true="true",e.false="false"}(i||(i={})),function(e){e.passed="passed",e.failed="failed",e.unknown="unknown"}(n||(n={})),function(e){e.completed="completed",e.incomplete="incomplete",e.unknown="unknown"}(o||(o={}))},797:function(e,t,r){var i=r(635),n={GENERAL:101,INITIALIZATION_FAILED:101,INITIALIZED:101,TERMINATED:101,TERMINATION_FAILURE:101,TERMINATION_BEFORE_INIT:101,MULTIPLE_TERMINATION:101,RETRIEVE_BEFORE_INIT:101,RETRIEVE_AFTER_TERM:101,STORE_BEFORE_INIT:101,STORE_AFTER_TERM:101,COMMIT_BEFORE_INIT:101,COMMIT_AFTER_TERM:101,ARGUMENT_ERROR:101,CHILDREN_ERROR:101,COUNT_ERROR:101,GENERAL_GET_FAILURE:101,GENERAL_SET_FAILURE:101,GENERAL_COMMIT_FAILURE:101,UNDEFINED_DATA_MODEL:101,UNIMPLEMENTED_ELEMENT:101,VALUE_NOT_INITIALIZED:101,INVALID_SET_VALUE:101,READ_ONLY_ELEMENT:101,WRITE_ONLY_ELEMENT:101,TYPE_MISMATCH:101,VALUE_OUT_OF_RANGE:101,DEPENDENCY_NOT_ESTABLISHED:101},o={scorm12:(0,i.Cl)((0,i.Cl)({},n),{RETRIEVE_BEFORE_INIT:301,STORE_BEFORE_INIT:301,COMMIT_BEFORE_INIT:301,ARGUMENT_ERROR:201,CHILDREN_ERROR:202,COUNT_ERROR:203,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:401,VALUE_NOT_INITIALIZED:301,INVALID_SET_VALUE:402,READ_ONLY_ELEMENT:403,WRITE_ONLY_ELEMENT:404,TYPE_MISMATCH:405,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408}),scorm2004:(0,i.Cl)((0,i.Cl)({},n),{INITIALIZATION_FAILED:102,INITIALIZED:103,TERMINATED:104,TERMINATION_FAILURE:111,TERMINATION_BEFORE_INIT:112,MULTIPLE_TERMINATIONS:113,RETRIEVE_BEFORE_INIT:122,RETRIEVE_AFTER_TERM:123,STORE_BEFORE_INIT:132,STORE_AFTER_TERM:133,COMMIT_BEFORE_INIT:142,COMMIT_AFTER_TERM:143,ARGUMENT_ERROR:201,GENERAL_GET_FAILURE:301,GENERAL_SET_FAILURE:351,GENERAL_COMMIT_FAILURE:391,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:402,VALUE_NOT_INITIALIZED:403,READ_ONLY_ELEMENT:404,WRITE_ONLY_ELEMENT:405,TYPE_MISMATCH:406,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408})};t.A=o},417:function(e,t,r){var i=r(635),n={CMIString256:"^.{0,255}$",CMIString4096:"^.{0,4096}$",CMITime:"^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",CMITimespan:"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{0,3})(.[0-9]*)?$",CMIIdentifier:"^[\\u0021-\\u007E\\s]{0,255}$",CMIFeedback:"^.{0,255}$",CMIIndex:"[._](\\d+).",CMIStatus:"^(passed|completed|failed|incomplete|browsed)$",CMIStatus2:"^(passed|completed|failed|incomplete|browsed|not attempted)$",CMIExit:"^(time-out|suspend|logout|)$",CMIType:"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$",CMIResult:"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$",NAVEvent:"^(previous|continue)$",score_range:"0#100",audio_range:"-1#100",speed_range:"-100#100",weighting_range:"-100#100",text_range:"-1#1"},o={aicc:(0,i.Cl)((0,i.Cl)({},n),{CMIIdentifier:"^\\w{1,255}$"}),scorm12:n,scorm2004:{CMIString200:"^[\\u0000-\\uFFFF]{0,200}$",CMIString250:"^[\\u0000-\\uFFFF]{0,250}$",CMIString1000:"^[\\u0000-\\uFFFF]{0,1000}$",CMIString4000:"^[\\u0000-\\uFFFF]{0,4000}$",CMIString64000:"^[\\u0000-\\uFFFF]{0,64000}$",CMILang:"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$",CMILangString250:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$",CMILangcr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$",CMILangString250cr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$",CMILangString4000:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$",CMITime:"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$",CMITimespan:"^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{1,5})(\\.[0-9]{1,18})?$",CMIIdentifier:"^\\S{1,250}[a-zA-Z0-9]$",CMIShortIdentifier:"^[\\w\\.\\-\\_]{1,250}$",CMILongIdentifier:"^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$",CMIFeedback:"^.*$",CMIIndex:"[._](\\d+).",CMIIndexStore:".N(\\d+).",CMICStatus:"^(completed|incomplete|not attempted|unknown)$",CMISStatus:"^(passed|failed|unknown)$",CMIExit:"^(time-out|suspend|logout|normal)$",CMIType:"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",CMIResult:"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",NAVEvent:"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$",NAVBoolean:"^(unknown|true|false$)",NAVTarget:"^{target=\\S{0,}[a-zA-Z0-9-_]+}$",scaled_range:"-1#1",audio_range:"0#*",speed_range:"0#*",text_range:"-1#1",progress_range:"0#1"}};t.A=o},784:function(e,t,r){r.d(t,{$h:function(){return c},tQ:function(){return u},yI:function(){return l}});var i=r(635),n=r(340),o=n.A.scorm12.error_descriptions,s=n.A.aicc.error_descriptions,a=n.A.scorm2004.error_descriptions,c=function(e){function t(t){var r=e.call(this,t.toString())||this;return r._errorCode=t,r.name="ScormValidationError",r}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"errorCode",{get:function(){return this._errorCode},enumerable:!1,configurable:!0}),t.prototype.setMessage=function(e){this.message=e},t}(Error),l=function(e){function t(t,r,i){var n=e.call(this,t)||this;return n._detailedMessage="",n.setMessage(r),n._errorMessage=r,i&&(n._detailedMessage=i),n}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"errorMessage",{get:function(){return this._errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"detailedMessage",{get:function(){return this._detailedMessage},enumerable:!1,configurable:!0}),t}(c),u=function(e){function t(t){return{}.hasOwnProperty.call(o,String(t))?e.call(this,t,o[String(t)].basicMessage,o[String(t)].detailMessage)||this:e.call(this,101,o[101].basicMessage,o[101].detailMessage)||this}return(0,i.C6)(t,e),t}(l);(function(e){function t(t){return{}.hasOwnProperty.call(s,String(t))?e.call(this,t,s[String(t)].basicMessage,s[String(t)].detailMessage)||this:e.call(this,101,s[101].basicMessage,s[101].detailMessage)||this}(0,i.C6)(t,e)})(l),function(e){function t(t){return{}.hasOwnProperty.call(a,String(t))?e.call(this,t,a[String(t)].basicMessage,a[String(t)].detailMessage)||this:e.call(this,101,a[101].basicMessage,a[101].detailMessage)||this}(0,i.C6)(t,e)}(l)},864:function(e,t,r){r.d(t,{Bq:function(){return a},HT:function(){return s},J6:function(){return d},UZ:function(){return n},f4:function(){return o},hw:function(){return u},sB:function(){return c}});var i=3600;function n(e){if(!e||e<=0)return"00:00:00";var t=Math.floor(e/i),r=new Date(1e3*e),n=r.getUTCMinutes(),o=r.getSeconds(),s=e%1,a="";return l(s)>0&&(a="."+(a=l(s)>2?s.toFixed(2):String(s)).split(".")[1]),(t+":"+n+":"+o).replace(/\b\d\b/g,"0$&")+a}function o(e,t){if("number"!=typeof e&&"boolean"!=typeof e||(e=String(e)),"string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var r=e.split(":");return 3600*Number(r[0])+60*Number(r[1])+Number(r[2])}function s(e,t,r){return"string"==typeof r&&(r=new RegExp(r)),n(o(e,r)+o(t,r))}function a(e){var t={};return function e(r,i){if(Object(r)!==r)t[i]=r;else if(Array.isArray(r))for(var n=0,o=r.length;n0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]=parseFloat(this.cmi.student_data.mastery_score)?"passed":"failed"):"browse"===this.cmi.core.lesson_mode&&""===((null===(c=null===(s=null===(o=this.startingData)||void 0===o?void 0:o.cmi)||void 0===s?void 0:s.core)||void 0===c?void 0:c.lesson_status)||"")&&"not attempted"===t&&(this.cmi.core.lesson_status="browsed")),r=e||this.settings.alwaysSendTotalTime,i=this.settings.renderCommonCommitFields?this.renderCommitObject(r):this.renderCommitCMI(r),this.apiLogLevel===a.A.global.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(i)),"string"!=typeof this.settings.lmsCommitUrl?[3,2]:[4,this.processHttpRequest(this.settings.lmsCommitUrl,i,e)];case 1:return[2,n.sent()];case 2:return[2,{result:a.A.global.SCORM_TRUE,errorCode:0}]}}))}))},t}(r(900).A);module.exports=i}(); +!function(){"use strict";var e={900:function(e,t,r){r.d(t,{A:function(){return _}});var i=r(635),n=r(589),o=r(784),s=r(797),a=r(340),c=r(864);var l={autocommit:!1,autocommitSeconds:10,asyncCommit:!1,sendFullCommit:!0,lmsCommitUrl:!1,dataCommitFormat:"json",commitRequestDataType:"application/json;charset=UTF-8",autoProgress:!1,logLevel:a.A.global.LOG_LEVEL_ERROR,selfReportSessionTime:!1,alwaysSendTotalTime:!1,renderCommonCommitFields:!1,strict_errors:!0,xhrHeaders:{},xhrWithCredentials:!1,responseHandler:function(e){return(0,i.sH)(this,void 0,void 0,(function(){var t,r,n;return(0,i.YH)(this,(function(i){switch(i.label){case 0:return void 0===e?[3,2]:(n=(r=JSON).parse,[4,e.text()]);case 1:return null!==(t=n.apply(r,[i.sent()]))&&{}.hasOwnProperty.call(t,"result")?[2,{result:t.result,errorCode:t.errorCode?t.errorCode:t.result===a.A.global.SCORM_TRUE?0:101}]:200===e.status?[2,{result:a.A.global.SCORM_TRUE,errorCode:0}]:[2,{result:a.A.global.SCORM_FALSE,errorCode:101}];case 2:return[2,{result:a.A.global.SCORM_FALSE,errorCode:101}]}}))}))},requestHandler:function(e){return e},onLogMessage:function(e,t){switch(e){case a.A.global.LOG_LEVEL_ERROR:console.error(t);break;case a.A.global.LOG_LEVEL_WARNING:console.warn(t);break;case a.A.global.LOG_LEVEL_INFO:console.info(t);break;case a.A.global.LOG_LEVEL_DEBUG:console.debug?console.debug(t):console.log(t)}},scoItemIds:[],scoItemIdValidator:!1},u=function(){function e(e,t,r){this._cancelled=!1,this._API=e,this._timeout=setTimeout(this.wrapper.bind(this),t),this._callback=r}return e.prototype.cancel=function(){this._cancelled=!0,this._timeout&&clearTimeout(this._timeout)},e.prototype.wrapper=function(){var e=this;this._cancelled||(0,i.sH)(e,void 0,void 0,(function(){return(0,i.YH)(this,(function(e){switch(e.label){case 0:return[4,this._API.commit(this._callback)];case 1:return[2,e.sent()]}}))}))},e}(),d=function(){function e(t,r){var i=this.constructor;if(this._settings=l,i===e)throw new TypeError("Cannot construct BaseAPI instances directly");this.currentState=a.A.global.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[],this._error_codes=t,r&&(this.settings=r),this.apiLogLevel=this.settings.logLevel,this.selfReportSessionTime=this.settings.selfReportSessionTime}return e.prototype.commonReset=function(e){this.settings=(0,i.Cl)((0,i.Cl)({},this.settings),e),this.currentState=a.A.global.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[]},e.prototype.initialize=function(e,t,r){var i=a.A.global.SCORM_FALSE;return this.isInitialized()?this.throwSCORMError(this._error_codes.INITIALIZED,t):this.isTerminated()?this.throwSCORMError(this._error_codes.TERMINATED,r):(this.selfReportSessionTime&&this.cmi.setStartTime(),this.currentState=a.A.global.STATE_INITIALIZED,this.lastErrorCode="0",i=a.A.global.SCORM_TRUE,this.processListeners(e)),this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(i),i},e.prototype.apiLog=function(e,t,r,i){t=(0,c.hw)(e,t,i),r>=this.apiLogLevel&&this.settings.onLogMessage(r,t)},Object.defineProperty(e.prototype,"error_codes",{get:function(){return this._error_codes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"settings",{get:function(){return this._settings},set:function(e){this._settings=(0,i.Cl)((0,i.Cl)({},this._settings),e)},enumerable:!1,configurable:!0}),e.prototype.terminate=function(e,t){return(0,i.sH)(this,void 0,void 0,(function(){var r,n;return(0,i.YH)(this,(function(i){switch(i.label){case 0:return r=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.TERMINATION_BEFORE_INIT,this._error_codes.MULTIPLE_TERMINATION)?(this.currentState=a.A.global.STATE_TERMINATED,[4,this.storeData(!0)]):[3,2];case 1:void 0!==(n=i.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),r=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,t&&(this.lastErrorCode="0"),r=a.A.global.SCORM_TRUE,this.processListeners(e),i.label=2;case 2:return this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(r),[2,r]}}))}))},e.prototype.getValue=function(e,t,r){var i="";if(this.checkState(t,this._error_codes.RETRIEVE_BEFORE_INIT,this._error_codes.RETRIEVE_AFTER_TERM)){t&&(this.lastErrorCode="0");try{i=this.getCMIValue(r)}catch(e){i=this.handleValueAccessException(e,i)}this.processListeners(e,r)}return this.apiLog(e,": returned: "+i,a.A.global.LOG_LEVEL_INFO,r),void 0===i?"":(this.clearSCORMError(i),i)},e.prototype.setValue=function(e,t,r,i,n){void 0!==n&&(n=String(n));var o=a.A.global.SCORM_FALSE;if(this.checkState(r,this._error_codes.STORE_BEFORE_INIT,this._error_codes.STORE_AFTER_TERM)){r&&(this.lastErrorCode="0");try{o=this.setCMIValue(i,n)}catch(e){this.handleValueAccessException(e,o)}this.processListeners(e,i,n)}return void 0===o&&(o=a.A.global.SCORM_FALSE),"0"===String(this.lastErrorCode)&&this.settings.autocommit&&!this._timeout&&this.scheduleCommit(1e3*this.settings.autocommitSeconds,t),this.apiLog(e,": "+n+": result: "+o,a.A.global.LOG_LEVEL_INFO,i),this.clearSCORMError(o),o},e.prototype.commit=function(e){return(0,i.sH)(this,arguments,void 0,(function(e,t){var r,n;return void 0===t&&(t=!1),(0,i.YH)(this,(function(i){switch(i.label){case 0:return this.clearScheduledCommit(),r=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.COMMIT_BEFORE_INIT,this._error_codes.COMMIT_AFTER_TERM)?[4,this.storeData(!1)]:[3,2];case 1:(n=i.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),r=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,this.apiLog(e," Result: "+r,a.A.global.LOG_LEVEL_DEBUG,"HttpRequest"),t&&(this.lastErrorCode="0"),this.processListeners(e),i.label=2;case 2:return this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(r),[2,r]}}))}))},e.prototype.getLastError=function(e){var t=String(this.lastErrorCode);return this.processListeners(e),this.apiLog(e,"returned: "+t,a.A.global.LOG_LEVEL_INFO),t},e.prototype.getErrorString=function(e,t){var r="";return null!==t&&""!==t&&(r=this.getLmsErrorMessageDetails(t),this.processListeners(e)),this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),r},e.prototype.getDiagnostic=function(e,t){var r="";return null!==t&&""!==t&&(r=this.getLmsErrorMessageDetails(t,!0),this.processListeners(e)),this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),r},e.prototype.checkState=function(e,t,r){return this.isNotInitialized()?(this.throwSCORMError(t),!1):!e||!this.isTerminated()||(this.throwSCORMError(r),!1)},e.prototype.getLmsErrorMessageDetails=function(e,t){throw void 0===t&&(t=!1),new Error("The getLmsErrorMessageDetails method has not been implemented")},e.prototype.getCMIValue=function(e){throw new Error("The getCMIValue method has not been implemented")},e.prototype.setCMIValue=function(e,t){throw new Error("The setCMIValue method has not been implemented")},e.prototype._commonSetCMIValue=function(e,t,r,o){if(!r||""===r)return a.A.global.SCORM_FALSE;for(var s=r.split("."),l=this,u=a.A.global.SCORM_FALSE,d=!1,_="The data model element passed to ".concat(e," (").concat(r,") is not a valid SCORM data model element."),h=t?this._error_codes.UNDEFINED_DATA_MODEL:this._error_codes.GENERAL,m=0;m1&&(s=e.replace(o+".","")),this.listenerArray.push({functionName:o,CMIElement:s,callback:t}),this.apiLog("on","Added event listener: ".concat(this.listenerArray.length),a.A.global.LOG_LEVEL_INFO,o)}},e.prototype.off=function(e,t){if(t)for(var r=e.split(" "),i=function(i){var o=r[i].split(".");if(0===o.length)return{value:void 0};var s=o[0],c=null;o.length>1&&(c=e.replace(s+".",""));var l=n.listenerArray.findIndex((function(e){return e.functionName===s&&e.CMIElement===c&&e.callback===t}));-1!==l&&(n.listenerArray.splice(l,1),n.apiLog("off","Removed event listener: ".concat(n.listenerArray.length),a.A.global.LOG_LEVEL_INFO,s))},n=this,o=0;o1&&(s=e.replace(o+".","")),i.listenerArray=i.listenerArray.filter((function(e){return e.functionName!==o&&e.CMIElement!==s}))},i=this,n=0;ns?1:0})),s.forEach((function(e){(i={})[e[0]]=e[1],r.loadFromJSON((0,c.sB)(i),t)}))}else console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize.");function a(e,t,r){var i,n=e.match(r);if(null!==n&&null!==(i=t.match(r))){var o=Number(n[2]),s=Number(i[2]);return o===s?"id"===n[3]?-1:"type"===n[3]?"id"===i[3]?1:-1:1:o-s}return null}},e.prototype.loadFromJSON=function(e,t){if(this.isNotInitialized()){for(var r in t=void 0!==t?t:"cmi",this.startingData=e,e)if({}.hasOwnProperty.call(e,r)&&e[r]){var i=(t?t+".":"")+r,n=e[r];if(n.childArray)for(var o=0;o=200&&e.status<=299&&(!0===t.result||t.result===a.A.global.SCORM_TRUE)?this.processListeners("CommitSuccess"):this.processListeners("CommitError"),[2,t]}}))}))},e}(),_=d},589:function(e,t,r){r.d(t,{B:function(){return c}});var i=r(635),n=r(319),o=r(797),s=r(784),a=o.A.scorm12,c=function(e){function t(t){var r=e.call(this)||this;return r.__children=t.children,r._errorCode=t.errorCode||a.GENERAL,r._errorClass=t.errorClass||s.$h,r.childArray=[],r}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_count",{get:function(){return this.childArray.length},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;for(var e={},t=0;t=n[0]){if("*"===n[1]||e<=n[1])return!0;throw new i(r)}throw new i(r)}r.d(t,{W:function(){return n},q:function(){return i}})},989:function(e,t,r){r.d(t,{Y:function(){return g}});var i=r(635),n=r(340),o=r(797),s=r(417),a=r(784),c=r(319),l=r(915),u=r(434),d=r(864),_=function(e){function t(){var t=e.call(this)||this;return t.__children=n.A.scorm12.core_children,t._student_id="",t._student_name="",t._lesson_location="",t._credit="",t._lesson_status="not attempted",t._entry="",t._total_time="",t._lesson_mode="normal",t._exit="",t._session_time="00:00:00",t._suspend_data="",t.score=new u._({score_children:n.A.scorm12.score_children,score_range:s.A.scorm12.score_range,invalidErrorCode:o.A.scorm12.INVALID_SET_VALUE,invalidTypeCode:o.A.scorm12.TYPE_MISMATCH,invalidRangeCode:o.A.scorm12.VALUE_OUT_OF_RANGE,errorClass:a.tQ}),t}return(0,i.C6)(t,e),t.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_id",{get:function(){return this._student_id},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._student_id=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_name",{get:function(){return this._student_name},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._student_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_location",{get:function(){return this._lesson_location},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString256,!0)&&(this._lesson_location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"credit",{get:function(){return this._credit},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._credit=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_status",{get:function(){return this._lesson_status},set:function(e){this.initialized?(0,l.p)(e,s.A.scorm12.CMIStatus)&&(this._lesson_status=e):(0,l.p)(e,s.A.scorm12.CMIStatus2)&&(this._lesson_status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"entry",{get:function(){return this._entry},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._entry=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"total_time",{get:function(){return this._total_time},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._total_time=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_mode",{get:function(){return this._lesson_mode},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._lesson_mode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"exit",{get:function(){if(!this.jsonString)throw new a.tQ(o.A.scorm12.WRITE_ONLY_ELEMENT);return this._exit},set:function(e){(0,l.p)(e,s.A.scorm12.CMIExit,!0)&&(this._exit=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"session_time",{get:function(){if(!this.jsonString)throw new a.tQ(o.A.scorm12.WRITE_ONLY_ELEMENT);return this._session_time},set:function(e){(0,l.p)(e,s.A.scorm12.CMITimespan)&&(this._session_time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"suspend_data",{get:function(){return this._suspend_data},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString4096,!0)&&(this._suspend_data=e)},enumerable:!1,configurable:!0}),t.prototype.getCurrentTotalTime=function(e){var t=this._session_time,r=e;if(null!=r){var i=(new Date).getTime()-r;t=d.UZ(i/1e3)}return d.HT(this._total_time,t,new RegExp(s.A.scorm12.CMITimespan))},t.prototype.toJSON=function(){this.jsonString=!0;var e={student_id:this.student_id,student_name:this.student_name,lesson_location:this.lesson_location,credit:this.credit,lesson_status:this.lesson_status,entry:this.entry,lesson_mode:this.lesson_mode,exit:this.exit,session_time:this.session_time,score:this.score};return delete this.jsonString,e},t}(c.J),h=r(176),m=r(532),f=r(181),p=r(833),g=function(e){function t(t,r,i){var o=e.call(this)||this;return o.__children="",o.__version="3.4",o._launch_data="",o._comments="",o._comments_from_lms="",i&&o.initialize(),o.__children=t||n.A.scorm12.cmi_children,o.core=new _,o.objectives=new h.C,o.student_data=r||new m.X,o.student_preference=new f.G,o.interactions=new p.Xb,o}return(0,i.C6)(t,e),t.prototype.initialize=function(){var t,r,i,n,o;e.prototype.initialize.call(this),null===(t=this.core)||void 0===t||t.initialize(),null===(r=this.objectives)||void 0===r||r.initialize(),null===(i=this.student_data)||void 0===i||i.initialize(),null===(n=this.student_preference)||void 0===n||n.initialize(),null===(o=this.interactions)||void 0===o||o.initialize()},t.prototype.toJSON=function(){this.jsonString=!0;var e={suspend_data:this.suspend_data,launch_data:this.launch_data,comments:this.comments,comments_from_lms:this.comments_from_lms,core:this.core,objectives:this.objectives,student_data:this.student_data,student_preference:this.student_preference,interactions:this.interactions};return delete this.jsonString,e},Object.defineProperty(t.prototype,"_version",{get:function(){return this.__version},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"suspend_data",{get:function(){var e;return null===(e=this.core)||void 0===e?void 0:e.suspend_data},set:function(e){this.core&&(this.core.suspend_data=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"launch_data",{get:function(){return this._launch_data},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._launch_data=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"comments",{get:function(){return this._comments},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString4096,!0)&&(this._comments=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"comments_from_lms",{get:function(){return this._comments_from_lms},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._comments_from_lms=e},enumerable:!1,configurable:!0}),t.prototype.getCurrentTotalTime=function(){return this.core.getCurrentTotalTime(this.start_time)},t}(c.r)},833:function(e,t,r){r.d(t,{Oh:function(){return h},WP:function(){return _},Xb:function(){return d},cb:function(){return m}});var i=r(635),n=r(589),o=r(340),s=r(797),a=r(784),c=r(319),l=r(915),u=r(417),d=function(e){function t(){return e.call(this,{children:o.A.scorm12.interactions_children,errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ})||this}return(0,i.C6)(t,e),t}(n.B),_=function(e){function t(){var t=e.call(this)||this;return t._id="",t._time="",t._type="",t._weighting="",t._student_response="",t._result="",t._latency="",t.objectives=new n.B({errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ,children:o.A.scorm12.objectives_children}),t.correct_responses=new n.B({errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ,children:o.A.scorm12.correct_responses_children}),t}return(0,i.C6)(t,e),t.prototype.initialize=function(){var t,r;e.prototype.initialize.call(this),null===(t=this.objectives)||void 0===t||t.initialize(),null===(r=this.correct_responses)||void 0===r||r.initialize()},Object.defineProperty(t.prototype,"id",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._id},set:function(e){(0,l.p)(e,u.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._time},set:function(e){(0,l.p)(e,u.A.scorm12.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._type},set:function(e){(0,l.p)(e,u.A.scorm12.CMIType)&&(this._type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weighting",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._weighting},set:function(e){(0,l.p)(e,u.A.scorm12.CMIDecimal)&&(0,l.h)(e,u.A.scorm12.weighting_range)&&(this._weighting=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_response",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._student_response},set:function(e){(0,l.p)(e,u.A.scorm12.CMIFeedback,!0)&&(this._student_response=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"result",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._result},set:function(e){(0,l.p)(e,u.A.scorm12.CMIResult)&&(this._result=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"latency",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._latency},set:function(e){(0,l.p)(e,u.A.scorm12.CMITimespan)&&(this._latency=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,time:this.time,type:this.type,weighting:this.weighting,student_response:this.student_response,result:this.result,latency:this.latency,objectives:this.objectives,correct_responses:this.correct_responses};return delete this.jsonString,e},t}(c.J),h=function(e){function t(){var t=e.call(this)||this;return t._id="",t}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(e){(0,l.p)(e,u.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id};return delete this.jsonString,e},t}(c.J),m=function(e){function t(){var t=e.call(this)||this;return t._pattern="",t}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"pattern",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._pattern},set:function(e){(0,l.p)(e,u.A.scorm12.CMIFeedback,!0)&&(this._pattern=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={pattern:this._pattern};return delete this.jsonString,e},t}(c.J)},331:function(e,t,r){r.d(t,{A:function(){return a}});var i=r(635),n=r(319),o=r(915),s=r(417),a=function(e){function t(){var t=e.call(this)||this;return t._event="",t}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"event",{get:function(){return this._event},set:function(e){(0,o.p)(e,s.A.scorm12.NAVEvent)&&(this._event=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={event:this.event};return delete this.jsonString,e},t}(n.J)},176:function(e,t,r){r.d(t,{C:function(){return d},N:function(){return _}});var i=r(635),n=r(319),o=r(434),s=r(340),a=r(417),c=r(797),l=r(784),u=r(915),d=function(e){function t(){return e.call(this,{children:s.A.scorm12.objectives_children,errorCode:c.A.scorm12.INVALID_SET_VALUE,errorClass:l.tQ})||this}return(0,i.C6)(t,e),t}(r(589).B),_=function(e){function t(){var t=e.call(this)||this;return t._id="",t._status="",t.score=new o._({score_children:s.A.scorm12.score_children,score_range:a.A.scorm12.score_range,invalidErrorCode:c.A.scorm12.INVALID_SET_VALUE,invalidTypeCode:c.A.scorm12.TYPE_MISMATCH,invalidRangeCode:c.A.scorm12.VALUE_OUT_OF_RANGE,errorClass:l.tQ}),t}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(e){(0,u.p)(e,a.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},set:function(e){(0,u.p)(e,a.A.scorm12.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,status:this.status,score:this.score};return delete this.jsonString,e},t}(n.J)},532:function(e,t,r){r.d(t,{X:function(){return c}});var i=r(635),n=r(319),o=r(340),s=r(784),a=r(797),c=function(e){function t(t){var r=e.call(this)||this;return r._mastery_score="",r._max_time_allowed="",r._time_limit_action="",r.__children=t||o.A.scorm12.student_data_children,r}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new s.tQ(a.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mastery_score",{get:function(){return this._mastery_score},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._mastery_score=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"max_time_allowed",{get:function(){return this._max_time_allowed},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._max_time_allowed=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time_limit_action",{get:function(){return this._time_limit_action},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._time_limit_action=e},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={mastery_score:this.mastery_score,max_time_allowed:this.max_time_allowed,time_limit_action:this.time_limit_action};return delete this.jsonString,e},t}(n.J)},181:function(e,t,r){r.d(t,{G:function(){return u}});var i=r(635),n=r(319),o=r(340),s=r(784),a=r(797),c=r(915),l=r(417),u=function(e){function t(t){var r=e.call(this)||this;return r._audio="",r._language="",r._speed="",r._text="",r.__children=t||o.A.scorm12.student_preference_children,r}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new s.tQ(a.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audio",{get:function(){return this._audio},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.audio_range)&&(this._audio=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"language",{get:function(){return this._language},set:function(e){(0,c.p)(e,l.A.scorm12.CMIString256)&&(this._language=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speed",{get:function(){return this._speed},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.speed_range)&&(this._speed=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this._text},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.text_range)&&(this._text=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,speed:this.speed,text:this.text};return delete this.jsonString,e},t}(n.J)},915:function(e,t,r){r.d(t,{h:function(){return a},p:function(){return s}});var i=r(449),n=r(797),o=r(784);function s(e,t,r){return(0,i.q)(e,t,n.A.scorm12.TYPE_MISMATCH,o.tQ,r)}function a(e,t,r){if(!r&&""===e)throw new o.tQ(n.A.scorm12.VALUE_OUT_OF_RANGE);return(0,i.W)(e,t,n.A.scorm12.VALUE_OUT_OF_RANGE,o.tQ)}},340:function(e,t,r){var i=r(635),n={cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",core_children:"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time",score_children:"raw,min,max",comments_children:"content,location,time",objectives_children:"id,score,status",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio,language,speed,text",interactions_children:"id,objectives,time,type,correct_responses,weighting,student_response,result,latency",error_descriptions:{101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information"},201:{basicMessage:"Invalid argument error",detailMessage:"Indicates that an argument represents an invalid data model element or is otherwise incorrect."},202:{basicMessage:"Element cannot have children",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.'},203:{basicMessage:"Element not an array - cannot have count",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.'},301:{basicMessage:"Not initialized",detailMessage:"Indicates that an API call was made before the call to lmsInitialize."},401:{basicMessage:"Not implemented error",detailMessage:"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement."},402:{basicMessage:"Invalid set value, element is a keyword",detailMessage:'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").'},403:{basicMessage:"Element is read only",detailMessage:"LMSSetValue was called with a data model element that can only be read."},404:{basicMessage:"Element is write only",detailMessage:"LMSGetValue was called on a data model element that can only be written to."},405:{basicMessage:"Incorrect Data Type",detailMessage:"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Element Value Out Of Range",detailMessage:"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}},o={global:{SCORM_TRUE:"true",SCORM_FALSE:"false",STATE_NOT_INITIALIZED:0,STATE_INITIALIZED:1,STATE_TERMINATED:2,LOG_LEVEL_DEBUG:1,LOG_LEVEL_INFO:2,LOG_LEVEL_WARNING:3,LOG_LEVEL_ERROR:4,LOG_LEVEL_NONE:5},scorm12:n,aicc:(0,i.Cl)((0,i.Cl)({},n),{cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation",student_preference_children:"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows",student_data_children:"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action",student_demographics_children:"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience",tries_children:"time,status,score",attempt_records_children:"score,lesson_status",paths_children:"location_id,date,time,status,why_left,time_in_element"}),scorm2004:{cmi_children:"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time",comments_children:"comment,timestamp,location",score_children:"max,raw,scaled,min",objectives_children:"progress_measure,completion_status,success_status,description,score,id",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio_level,audio_captioning,delivery_speed,language",interactions_children:"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description",error_descriptions:{0:{basicMessage:"No Error",detailMessage:"No error occurred, the previous API call was successful."},101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use GetDiagnostic for more information."},102:{basicMessage:"General Initialization Failure",detailMessage:"Call to Initialize failed for an unknown reason."},103:{basicMessage:"Already Initialized",detailMessage:"Call to Initialize failed because Initialize was already called."},104:{basicMessage:"Content Instance Terminated",detailMessage:"Call to Initialize failed because Terminate was already called."},111:{basicMessage:"General Termination Failure",detailMessage:"Call to Terminate failed for an unknown reason."},112:{basicMessage:"Termination Before Initialization",detailMessage:"Call to Terminate failed because it was made before the call to Initialize."},113:{basicMessage:"Termination After Termination",detailMessage:"Call to Terminate failed because Terminate was already called."},122:{basicMessage:"Retrieve Data Before Initialization",detailMessage:"Call to GetValue failed because it was made before the call to Initialize."},123:{basicMessage:"Retrieve Data After Termination",detailMessage:"Call to GetValue failed because it was made after the call to Terminate."},132:{basicMessage:"Store Data Before Initialization",detailMessage:"Call to SetValue failed because it was made before the call to Initialize."},133:{basicMessage:"Store Data After Termination",detailMessage:"Call to SetValue failed because it was made after the call to Terminate."},142:{basicMessage:"Commit Before Initialization",detailMessage:"Call to Commit failed because it was made before the call to Initialize."},143:{basicMessage:"Commit After Termination",detailMessage:"Call to Commit failed because it was made after the call to Terminate."},201:{basicMessage:"General Argument Error",detailMessage:"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument."},301:{basicMessage:"General Get Failure",detailMessage:"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},351:{basicMessage:"General Set Failure",detailMessage:"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},391:{basicMessage:"General Commit Failure",detailMessage:"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information."},401:{basicMessage:"Undefined Data Model Element",detailMessage:"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element."},402:{basicMessage:"Unimplemented Data Model Element",detailMessage:"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant."},403:{basicMessage:"Data Model Element Value Not Initialized",detailMessage:"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO."},404:{basicMessage:"Data Model Element Is Read Only",detailMessage:"SetValue was called with a data model element that can only be read."},405:{basicMessage:"Data Model Element Is Write Only",detailMessage:"GetValue was called on a data model element that can only be written to."},406:{basicMessage:"Data Model Element Type Mismatch",detailMessage:"SetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Data Model Element Value Out Of Range",detailMessage:"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}}};t.A=o},56:function(e,t,r){var i,n,o;r.d(t,{YE:function(){return n},lC:function(){return o}}),function(e){e.unknown="unknown",e.true="true",e.false="false"}(i||(i={})),function(e){e.passed="passed",e.failed="failed",e.unknown="unknown"}(n||(n={})),function(e){e.completed="completed",e.incomplete="incomplete",e.unknown="unknown"}(o||(o={}))},797:function(e,t,r){var i=r(635),n={GENERAL:101,INITIALIZATION_FAILED:101,INITIALIZED:101,TERMINATED:101,TERMINATION_FAILURE:101,TERMINATION_BEFORE_INIT:101,MULTIPLE_TERMINATION:101,RETRIEVE_BEFORE_INIT:101,RETRIEVE_AFTER_TERM:101,STORE_BEFORE_INIT:101,STORE_AFTER_TERM:101,COMMIT_BEFORE_INIT:101,COMMIT_AFTER_TERM:101,ARGUMENT_ERROR:101,CHILDREN_ERROR:101,COUNT_ERROR:101,GENERAL_GET_FAILURE:101,GENERAL_SET_FAILURE:101,GENERAL_COMMIT_FAILURE:101,UNDEFINED_DATA_MODEL:101,UNIMPLEMENTED_ELEMENT:101,VALUE_NOT_INITIALIZED:101,INVALID_SET_VALUE:101,READ_ONLY_ELEMENT:101,WRITE_ONLY_ELEMENT:101,TYPE_MISMATCH:101,VALUE_OUT_OF_RANGE:101,DEPENDENCY_NOT_ESTABLISHED:101},o={scorm12:(0,i.Cl)((0,i.Cl)({},n),{RETRIEVE_BEFORE_INIT:301,STORE_BEFORE_INIT:301,COMMIT_BEFORE_INIT:301,ARGUMENT_ERROR:201,CHILDREN_ERROR:202,COUNT_ERROR:203,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:401,VALUE_NOT_INITIALIZED:301,INVALID_SET_VALUE:402,READ_ONLY_ELEMENT:403,WRITE_ONLY_ELEMENT:404,TYPE_MISMATCH:405,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408}),scorm2004:(0,i.Cl)((0,i.Cl)({},n),{INITIALIZATION_FAILED:102,INITIALIZED:103,TERMINATED:104,TERMINATION_FAILURE:111,TERMINATION_BEFORE_INIT:112,MULTIPLE_TERMINATIONS:113,RETRIEVE_BEFORE_INIT:122,RETRIEVE_AFTER_TERM:123,STORE_BEFORE_INIT:132,STORE_AFTER_TERM:133,COMMIT_BEFORE_INIT:142,COMMIT_AFTER_TERM:143,ARGUMENT_ERROR:201,GENERAL_GET_FAILURE:301,GENERAL_SET_FAILURE:351,GENERAL_COMMIT_FAILURE:391,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:402,VALUE_NOT_INITIALIZED:403,READ_ONLY_ELEMENT:404,WRITE_ONLY_ELEMENT:405,TYPE_MISMATCH:406,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408})};t.A=o},417:function(e,t,r){var i=r(635),n={CMIString256:"^.{0,255}$",CMIString4096:"^.{0,4096}$",CMITime:"^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",CMITimespan:"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{0,3})(.[0-9]*)?$",CMIIdentifier:"^[\\u0021-\\u007E\\s]{0,255}$",CMIFeedback:"^.{0,255}$",CMIIndex:"[._](\\d+).",CMIStatus:"^(passed|completed|failed|incomplete|browsed)$",CMIStatus2:"^(passed|completed|failed|incomplete|browsed|not attempted)$",CMIExit:"^(time-out|suspend|logout|)$",CMIType:"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$",CMIResult:"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$",NAVEvent:"^(previous|continue)$",score_range:"0#100",audio_range:"-1#100",speed_range:"-100#100",weighting_range:"-100#100",text_range:"-1#1"},o={aicc:(0,i.Cl)((0,i.Cl)({},n),{CMIIdentifier:"^\\w{1,255}$"}),scorm12:n,scorm2004:{CMIString200:"^[\\u0000-\\uFFFF]{0,200}$",CMIString250:"^[\\u0000-\\uFFFF]{0,250}$",CMIString1000:"^[\\u0000-\\uFFFF]{0,1000}$",CMIString4000:"^[\\u0000-\\uFFFF]{0,4000}$",CMIString64000:"^[\\u0000-\\uFFFF]{0,64000}$",CMILang:"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$",CMILangString250:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$",CMILangcr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$",CMILangString250cr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$",CMILangString4000:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$",CMITime:"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$",CMITimespan:"^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{1,5})(\\.[0-9]{1,18})?$",CMIIdentifier:"^\\S{1,250}[a-zA-Z0-9]$",CMIShortIdentifier:"^[\\w\\.\\-\\_]{1,250}$",CMILongIdentifier:"^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$",CMIFeedback:"^.*$",CMIIndex:"[._](\\d+).",CMIIndexStore:".N(\\d+).",CMICStatus:"^(completed|incomplete|not attempted|unknown)$",CMISStatus:"^(passed|failed|unknown)$",CMIExit:"^(time-out|suspend|logout|normal)$",CMIType:"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",CMIResult:"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",NAVEvent:"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$",NAVBoolean:"^(unknown|true|false$)",NAVTarget:"^{target=\\S{0,}[a-zA-Z0-9-_]+}$",scaled_range:"-1#1",audio_range:"0#*",speed_range:"0#*",text_range:"-1#1",progress_range:"0#1"}};t.A=o},784:function(e,t,r){r.d(t,{$h:function(){return c},tQ:function(){return u},yI:function(){return l}});var i=r(635),n=r(340),o=n.A.scorm12.error_descriptions,s=n.A.aicc.error_descriptions,a=n.A.scorm2004.error_descriptions,c=function(e){function t(t){var r=e.call(this,t.toString())||this;return r._errorCode=t,r.name="ScormValidationError",r}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"errorCode",{get:function(){return this._errorCode},enumerable:!1,configurable:!0}),t.prototype.setMessage=function(e){this.message=e},t}(Error),l=function(e){function t(t,r,i){var n=e.call(this,t)||this;return n._detailedMessage="",n.setMessage(r),n._errorMessage=r,i&&(n._detailedMessage=i),n}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"errorMessage",{get:function(){return this._errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"detailedMessage",{get:function(){return this._detailedMessage},enumerable:!1,configurable:!0}),t}(c),u=function(e){function t(t){return{}.hasOwnProperty.call(o,String(t))?e.call(this,t,o[String(t)].basicMessage,o[String(t)].detailMessage)||this:e.call(this,101,o[101].basicMessage,o[101].detailMessage)||this}return(0,i.C6)(t,e),t}(l);(function(e){function t(t){return{}.hasOwnProperty.call(s,String(t))?e.call(this,t,s[String(t)].basicMessage,s[String(t)].detailMessage)||this:e.call(this,101,s[101].basicMessage,s[101].detailMessage)||this}(0,i.C6)(t,e)})(l),function(e){function t(t){return{}.hasOwnProperty.call(a,String(t))?e.call(this,t,a[String(t)].basicMessage,a[String(t)].detailMessage)||this:e.call(this,101,a[101].basicMessage,a[101].detailMessage)||this}(0,i.C6)(t,e)}(l)},864:function(e,t,r){r.d(t,{Bq:function(){return a},HT:function(){return s},J6:function(){return d},UZ:function(){return n},f4:function(){return o},hw:function(){return u},sB:function(){return c}});var i=3600;function n(e){if(!e||e<=0)return"00:00:00";var t=Math.floor(e/i),r=new Date(1e3*e),n=r.getUTCMinutes(),o=r.getSeconds(),s=e%1,a="";return l(s)>0&&(a="."+(a=l(s)>2?s.toFixed(2):String(s)).split(".")[1]),(t+":"+n+":"+o).replace(/\b\d\b/g,"0$&")+a}function o(e,t){if("number"!=typeof e&&"boolean"!=typeof e||(e=String(e)),"string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var r=e.split(":");return 3600*Number(r[0])+60*Number(r[1])+Number(r[2])}function s(e,t,r){return"string"==typeof r&&(r=new RegExp(r)),n(o(e,r)+o(t,r))}function a(e){var t={};return function e(r,i){if(Object(r)!==r)t[i]=r;else if(Array.isArray(r))for(var n=0,o=r.length;n0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]=parseFloat(this.cmi.student_data.mastery_score)?"passed":"failed"):"browse"===this.cmi.core.lesson_mode&&""===((null===(c=null===(s=null===(o=this.startingData)||void 0===o?void 0:o.cmi)||void 0===s?void 0:s.core)||void 0===c?void 0:c.lesson_status)||"")&&"not attempted"===t&&(this.cmi.core.lesson_status="browsed")),r=e||this.settings.alwaysSendTotalTime,i=this.settings.renderCommonCommitFields?this.renderCommitObject(r):this.renderCommitCMI(r),this.apiLogLevel===a.A.global.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(i)),"string"!=typeof this.settings.lmsCommitUrl?[3,2]:[4,this.processHttpRequest(this.settings.lmsCommitUrl,i,e)];case 1:return[2,n.sent()];case 2:return[2,{result:a.A.global.SCORM_TRUE,errorCode:0}]}}))}))},t}(r(900).A);for(var f in i)this[f]=i[f];i.__esModule&&Object.defineProperty(this,"__esModule",{value:!0})}(); //# sourceMappingURL=scorm12.min.js.map \ No newline at end of file diff --git a/dist/scorm2004.js b/dist/scorm2004.js index 95de0f5..18d984d 100644 --- a/dist/scorm2004.js +++ b/dist/scorm2004.js @@ -4658,7 +4658,9 @@ var Scorm2004Impl = (function (_super) { }(BaseAPI/* default */.A)); -module.exports = __webpack_exports__; +var __webpack_export_target__ = this; +for(var i in __webpack_exports__) __webpack_export_target__[i] = __webpack_exports__[i]; +if(__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, "__esModule", { value: true }); /******/ })() ; //# sourceMappingURL=scorm2004.js.map \ No newline at end of file diff --git a/dist/scorm2004.min.js b/dist/scorm2004.min.js index 9e62a0c..9566073 100644 --- a/dist/scorm2004.min.js +++ b/dist/scorm2004.min.js @@ -1,2 +1,2 @@ -!function(){"use strict";var e={900:function(e,t,r){r.d(t,{A:function(){return d}});var i=r(635),n=r(589),o=r(784),s=r(797),a=r(340),c=r(864);var l={autocommit:!1,autocommitSeconds:10,asyncCommit:!1,sendFullCommit:!0,lmsCommitUrl:!1,dataCommitFormat:"json",commitRequestDataType:"application/json;charset=UTF-8",autoProgress:!1,logLevel:a.A.global.LOG_LEVEL_ERROR,selfReportSessionTime:!1,alwaysSendTotalTime:!1,renderCommonCommitFields:!1,strict_errors:!0,xhrHeaders:{},xhrWithCredentials:!1,responseHandler:function(e){return(0,i.sH)(this,void 0,void 0,(function(){var t,r,n;return(0,i.YH)(this,(function(i){switch(i.label){case 0:return void 0===e?[3,2]:(n=(r=JSON).parse,[4,e.text()]);case 1:return null!==(t=n.apply(r,[i.sent()]))&&{}.hasOwnProperty.call(t,"result")?[2,{result:t.result,errorCode:t.errorCode?t.errorCode:t.result===a.A.global.SCORM_TRUE?0:101}]:200===e.status?[2,{result:a.A.global.SCORM_TRUE,errorCode:0}]:[2,{result:a.A.global.SCORM_FALSE,errorCode:101}];case 2:return[2,{result:a.A.global.SCORM_FALSE,errorCode:101}]}}))}))},requestHandler:function(e){return e},onLogMessage:function(e,t){switch(e){case a.A.global.LOG_LEVEL_ERROR:console.error(t);break;case a.A.global.LOG_LEVEL_WARNING:console.warn(t);break;case a.A.global.LOG_LEVEL_INFO:console.info(t);break;case a.A.global.LOG_LEVEL_DEBUG:console.debug?console.debug(t):console.log(t)}},scoItemIds:[],scoItemIdValidator:!1},u=function(){function e(e,t,r){this._cancelled=!1,this._API=e,this._timeout=setTimeout(this.wrapper.bind(this),t),this._callback=r}return e.prototype.cancel=function(){this._cancelled=!0,this._timeout&&clearTimeout(this._timeout)},e.prototype.wrapper=function(){var e=this;this._cancelled||(0,i.sH)(e,void 0,void 0,(function(){return(0,i.YH)(this,(function(e){switch(e.label){case 0:return[4,this._API.commit(this._callback)];case 1:return[2,e.sent()]}}))}))},e}(),h=function(){function e(t,r){var i=this.constructor;if(this._settings=l,i===e)throw new TypeError("Cannot construct BaseAPI instances directly");this.currentState=a.A.global.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[],this._error_codes=t,r&&(this.settings=r),this.apiLogLevel=this.settings.logLevel,this.selfReportSessionTime=this.settings.selfReportSessionTime}return e.prototype.commonReset=function(e){this.settings=(0,i.Cl)((0,i.Cl)({},this.settings),e),this.currentState=a.A.global.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[]},e.prototype.initialize=function(e,t,r){var i=a.A.global.SCORM_FALSE;return this.isInitialized()?this.throwSCORMError(this._error_codes.INITIALIZED,t):this.isTerminated()?this.throwSCORMError(this._error_codes.TERMINATED,r):(this.selfReportSessionTime&&this.cmi.setStartTime(),this.currentState=a.A.global.STATE_INITIALIZED,this.lastErrorCode="0",i=a.A.global.SCORM_TRUE,this.processListeners(e)),this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(i),i},e.prototype.apiLog=function(e,t,r,i){t=(0,c.hw)(e,t,i),r>=this.apiLogLevel&&this.settings.onLogMessage(r,t)},Object.defineProperty(e.prototype,"error_codes",{get:function(){return this._error_codes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"settings",{get:function(){return this._settings},set:function(e){this._settings=(0,i.Cl)((0,i.Cl)({},this._settings),e)},enumerable:!1,configurable:!0}),e.prototype.terminate=function(e,t){return(0,i.sH)(this,void 0,void 0,(function(){var r,n;return(0,i.YH)(this,(function(i){switch(i.label){case 0:return r=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.TERMINATION_BEFORE_INIT,this._error_codes.MULTIPLE_TERMINATION)?(this.currentState=a.A.global.STATE_TERMINATED,[4,this.storeData(!0)]):[3,2];case 1:void 0!==(n=i.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),r=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,t&&(this.lastErrorCode="0"),r=a.A.global.SCORM_TRUE,this.processListeners(e),i.label=2;case 2:return this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(r),[2,r]}}))}))},e.prototype.getValue=function(e,t,r){var i="";if(this.checkState(t,this._error_codes.RETRIEVE_BEFORE_INIT,this._error_codes.RETRIEVE_AFTER_TERM)){t&&(this.lastErrorCode="0");try{i=this.getCMIValue(r)}catch(e){i=this.handleValueAccessException(e,i)}this.processListeners(e,r)}return this.apiLog(e,": returned: "+i,a.A.global.LOG_LEVEL_INFO,r),void 0===i?"":(this.clearSCORMError(i),i)},e.prototype.setValue=function(e,t,r,i,n){void 0!==n&&(n=String(n));var o=a.A.global.SCORM_FALSE;if(this.checkState(r,this._error_codes.STORE_BEFORE_INIT,this._error_codes.STORE_AFTER_TERM)){r&&(this.lastErrorCode="0");try{o=this.setCMIValue(i,n)}catch(e){this.handleValueAccessException(e,o)}this.processListeners(e,i,n)}return void 0===o&&(o=a.A.global.SCORM_FALSE),"0"===String(this.lastErrorCode)&&this.settings.autocommit&&!this._timeout&&this.scheduleCommit(1e3*this.settings.autocommitSeconds,t),this.apiLog(e,": "+n+": result: "+o,a.A.global.LOG_LEVEL_INFO,i),this.clearSCORMError(o),o},e.prototype.commit=function(e){return(0,i.sH)(this,arguments,void 0,(function(e,t){var r,n;return void 0===t&&(t=!1),(0,i.YH)(this,(function(i){switch(i.label){case 0:return this.clearScheduledCommit(),r=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.COMMIT_BEFORE_INIT,this._error_codes.COMMIT_AFTER_TERM)?[4,this.storeData(!1)]:[3,2];case 1:(n=i.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),r=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,this.apiLog(e," Result: "+r,a.A.global.LOG_LEVEL_DEBUG,"HttpRequest"),t&&(this.lastErrorCode="0"),this.processListeners(e),i.label=2;case 2:return this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(r),[2,r]}}))}))},e.prototype.getLastError=function(e){var t=String(this.lastErrorCode);return this.processListeners(e),this.apiLog(e,"returned: "+t,a.A.global.LOG_LEVEL_INFO),t},e.prototype.getErrorString=function(e,t){var r="";return null!==t&&""!==t&&(r=this.getLmsErrorMessageDetails(t),this.processListeners(e)),this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),r},e.prototype.getDiagnostic=function(e,t){var r="";return null!==t&&""!==t&&(r=this.getLmsErrorMessageDetails(t,!0),this.processListeners(e)),this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),r},e.prototype.checkState=function(e,t,r){return this.isNotInitialized()?(this.throwSCORMError(t),!1):!e||!this.isTerminated()||(this.throwSCORMError(r),!1)},e.prototype.getLmsErrorMessageDetails=function(e,t){throw void 0===t&&(t=!1),new Error("The getLmsErrorMessageDetails method has not been implemented")},e.prototype.getCMIValue=function(e){throw new Error("The getCMIValue method has not been implemented")},e.prototype.setCMIValue=function(e,t){throw new Error("The setCMIValue method has not been implemented")},e.prototype._commonSetCMIValue=function(e,t,r,o){if(!r||""===r)return a.A.global.SCORM_FALSE;for(var s=r.split("."),l=this,u=a.A.global.SCORM_FALSE,h=!1,d="The data model element passed to ".concat(e," (").concat(r,") is not a valid SCORM data model element."),m=t?this._error_codes.UNDEFINED_DATA_MODEL:this._error_codes.GENERAL,_=0;_1&&(s=e.replace(o+".","")),this.listenerArray.push({functionName:o,CMIElement:s,callback:t}),this.apiLog("on","Added event listener: ".concat(this.listenerArray.length),a.A.global.LOG_LEVEL_INFO,o)}},e.prototype.off=function(e,t){if(t)for(var r=e.split(" "),i=function(i){var o=r[i].split(".");if(0===o.length)return{value:void 0};var s=o[0],c=null;o.length>1&&(c=e.replace(s+".",""));var l=n.listenerArray.findIndex((function(e){return e.functionName===s&&e.CMIElement===c&&e.callback===t}));-1!==l&&(n.listenerArray.splice(l,1),n.apiLog("off","Removed event listener: ".concat(n.listenerArray.length),a.A.global.LOG_LEVEL_INFO,s))},n=this,o=0;o1&&(s=e.replace(o+".","")),i.listenerArray=i.listenerArray.filter((function(e){return e.functionName!==o&&e.CMIElement!==s}))},i=this,n=0;ns?1:0})),s.forEach((function(e){(i={})[e[0]]=e[1],r.loadFromJSON((0,c.sB)(i),t)}))}else console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize.");function a(e,t,r){var i,n=e.match(r);if(null!==n&&null!==(i=t.match(r))){var o=Number(n[2]),s=Number(i[2]);return o===s?"id"===n[3]?-1:"type"===n[3]?"id"===i[3]?1:-1:1:o-s}return null}},e.prototype.loadFromJSON=function(e,t){if(this.isNotInitialized()){for(var r in t=void 0!==t?t:"cmi",this.startingData=e,e)if({}.hasOwnProperty.call(e,r)&&e[r]){var i=(t?t+".":"")+r,n=e[r];if(n.childArray)for(var o=0;o=200&&e.status<=299&&(!0===t.result||t.result===a.A.global.SCORM_TRUE)?this.processListeners("CommitSuccess"):this.processListeners("CommitError"),[2,t]}}))}))},e}(),d=h},589:function(e,t,r){r.d(t,{B:function(){return c}});var i=r(635),n=r(319),o=r(797),s=r(784),a=o.A.scorm12,c=function(e){function t(t){var r=e.call(this)||this;return r.__children=t.children,r._errorCode=t.errorCode||a.GENERAL,r._errorClass=t.errorClass||s.$h,r.childArray=[],r}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_count",{get:function(){return this.childArray.length},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;for(var e={},t=0;t=n[0]){if("*"===n[1]||e<=n[1])return!0;throw new i(r)}throw new i(r)}r.d(t,{W:function(){return n},q:function(){return i}})},340:function(e,t,r){var i=r(635),n={cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",core_children:"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time",score_children:"raw,min,max",comments_children:"content,location,time",objectives_children:"id,score,status",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio,language,speed,text",interactions_children:"id,objectives,time,type,correct_responses,weighting,student_response,result,latency",error_descriptions:{101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information"},201:{basicMessage:"Invalid argument error",detailMessage:"Indicates that an argument represents an invalid data model element or is otherwise incorrect."},202:{basicMessage:"Element cannot have children",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.'},203:{basicMessage:"Element not an array - cannot have count",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.'},301:{basicMessage:"Not initialized",detailMessage:"Indicates that an API call was made before the call to lmsInitialize."},401:{basicMessage:"Not implemented error",detailMessage:"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement."},402:{basicMessage:"Invalid set value, element is a keyword",detailMessage:'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").'},403:{basicMessage:"Element is read only",detailMessage:"LMSSetValue was called with a data model element that can only be read."},404:{basicMessage:"Element is write only",detailMessage:"LMSGetValue was called on a data model element that can only be written to."},405:{basicMessage:"Incorrect Data Type",detailMessage:"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Element Value Out Of Range",detailMessage:"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}},o={global:{SCORM_TRUE:"true",SCORM_FALSE:"false",STATE_NOT_INITIALIZED:0,STATE_INITIALIZED:1,STATE_TERMINATED:2,LOG_LEVEL_DEBUG:1,LOG_LEVEL_INFO:2,LOG_LEVEL_WARNING:3,LOG_LEVEL_ERROR:4,LOG_LEVEL_NONE:5},scorm12:n,aicc:(0,i.Cl)((0,i.Cl)({},n),{cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation",student_preference_children:"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows",student_data_children:"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action",student_demographics_children:"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience",tries_children:"time,status,score",attempt_records_children:"score,lesson_status",paths_children:"location_id,date,time,status,why_left,time_in_element"}),scorm2004:{cmi_children:"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time",comments_children:"comment,timestamp,location",score_children:"max,raw,scaled,min",objectives_children:"progress_measure,completion_status,success_status,description,score,id",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio_level,audio_captioning,delivery_speed,language",interactions_children:"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description",error_descriptions:{0:{basicMessage:"No Error",detailMessage:"No error occurred, the previous API call was successful."},101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use GetDiagnostic for more information."},102:{basicMessage:"General Initialization Failure",detailMessage:"Call to Initialize failed for an unknown reason."},103:{basicMessage:"Already Initialized",detailMessage:"Call to Initialize failed because Initialize was already called."},104:{basicMessage:"Content Instance Terminated",detailMessage:"Call to Initialize failed because Terminate was already called."},111:{basicMessage:"General Termination Failure",detailMessage:"Call to Terminate failed for an unknown reason."},112:{basicMessage:"Termination Before Initialization",detailMessage:"Call to Terminate failed because it was made before the call to Initialize."},113:{basicMessage:"Termination After Termination",detailMessage:"Call to Terminate failed because Terminate was already called."},122:{basicMessage:"Retrieve Data Before Initialization",detailMessage:"Call to GetValue failed because it was made before the call to Initialize."},123:{basicMessage:"Retrieve Data After Termination",detailMessage:"Call to GetValue failed because it was made after the call to Terminate."},132:{basicMessage:"Store Data Before Initialization",detailMessage:"Call to SetValue failed because it was made before the call to Initialize."},133:{basicMessage:"Store Data After Termination",detailMessage:"Call to SetValue failed because it was made after the call to Terminate."},142:{basicMessage:"Commit Before Initialization",detailMessage:"Call to Commit failed because it was made before the call to Initialize."},143:{basicMessage:"Commit After Termination",detailMessage:"Call to Commit failed because it was made after the call to Terminate."},201:{basicMessage:"General Argument Error",detailMessage:"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument."},301:{basicMessage:"General Get Failure",detailMessage:"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},351:{basicMessage:"General Set Failure",detailMessage:"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},391:{basicMessage:"General Commit Failure",detailMessage:"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information."},401:{basicMessage:"Undefined Data Model Element",detailMessage:"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element."},402:{basicMessage:"Unimplemented Data Model Element",detailMessage:"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant."},403:{basicMessage:"Data Model Element Value Not Initialized",detailMessage:"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO."},404:{basicMessage:"Data Model Element Is Read Only",detailMessage:"SetValue was called with a data model element that can only be read."},405:{basicMessage:"Data Model Element Is Write Only",detailMessage:"GetValue was called on a data model element that can only be written to."},406:{basicMessage:"Data Model Element Type Mismatch",detailMessage:"SetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Data Model Element Value Out Of Range",detailMessage:"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}}};t.A=o},56:function(e,t,r){var i,n,o;r.d(t,{K$:function(){return i},YE:function(){return n},lC:function(){return o}}),function(e){e.unknown="unknown",e.true="true",e.false="false"}(i||(i={})),function(e){e.passed="passed",e.failed="failed",e.unknown="unknown"}(n||(n={})),function(e){e.completed="completed",e.incomplete="incomplete",e.unknown="unknown"}(o||(o={}))},797:function(e,t,r){var i=r(635),n={GENERAL:101,INITIALIZATION_FAILED:101,INITIALIZED:101,TERMINATED:101,TERMINATION_FAILURE:101,TERMINATION_BEFORE_INIT:101,MULTIPLE_TERMINATION:101,RETRIEVE_BEFORE_INIT:101,RETRIEVE_AFTER_TERM:101,STORE_BEFORE_INIT:101,STORE_AFTER_TERM:101,COMMIT_BEFORE_INIT:101,COMMIT_AFTER_TERM:101,ARGUMENT_ERROR:101,CHILDREN_ERROR:101,COUNT_ERROR:101,GENERAL_GET_FAILURE:101,GENERAL_SET_FAILURE:101,GENERAL_COMMIT_FAILURE:101,UNDEFINED_DATA_MODEL:101,UNIMPLEMENTED_ELEMENT:101,VALUE_NOT_INITIALIZED:101,INVALID_SET_VALUE:101,READ_ONLY_ELEMENT:101,WRITE_ONLY_ELEMENT:101,TYPE_MISMATCH:101,VALUE_OUT_OF_RANGE:101,DEPENDENCY_NOT_ESTABLISHED:101},o={scorm12:(0,i.Cl)((0,i.Cl)({},n),{RETRIEVE_BEFORE_INIT:301,STORE_BEFORE_INIT:301,COMMIT_BEFORE_INIT:301,ARGUMENT_ERROR:201,CHILDREN_ERROR:202,COUNT_ERROR:203,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:401,VALUE_NOT_INITIALIZED:301,INVALID_SET_VALUE:402,READ_ONLY_ELEMENT:403,WRITE_ONLY_ELEMENT:404,TYPE_MISMATCH:405,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408}),scorm2004:(0,i.Cl)((0,i.Cl)({},n),{INITIALIZATION_FAILED:102,INITIALIZED:103,TERMINATED:104,TERMINATION_FAILURE:111,TERMINATION_BEFORE_INIT:112,MULTIPLE_TERMINATIONS:113,RETRIEVE_BEFORE_INIT:122,RETRIEVE_AFTER_TERM:123,STORE_BEFORE_INIT:132,STORE_AFTER_TERM:133,COMMIT_BEFORE_INIT:142,COMMIT_AFTER_TERM:143,ARGUMENT_ERROR:201,GENERAL_GET_FAILURE:301,GENERAL_SET_FAILURE:351,GENERAL_COMMIT_FAILURE:391,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:402,VALUE_NOT_INITIALIZED:403,READ_ONLY_ELEMENT:404,WRITE_ONLY_ELEMENT:405,TYPE_MISMATCH:406,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408})};t.A=o},417:function(e,t,r){var i=r(635),n={CMIString256:"^.{0,255}$",CMIString4096:"^.{0,4096}$",CMITime:"^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",CMITimespan:"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{0,3})(.[0-9]*)?$",CMIIdentifier:"^[\\u0021-\\u007E\\s]{0,255}$",CMIFeedback:"^.{0,255}$",CMIIndex:"[._](\\d+).",CMIStatus:"^(passed|completed|failed|incomplete|browsed)$",CMIStatus2:"^(passed|completed|failed|incomplete|browsed|not attempted)$",CMIExit:"^(time-out|suspend|logout|)$",CMIType:"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$",CMIResult:"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$",NAVEvent:"^(previous|continue)$",score_range:"0#100",audio_range:"-1#100",speed_range:"-100#100",weighting_range:"-100#100",text_range:"-1#1"},o={aicc:(0,i.Cl)((0,i.Cl)({},n),{CMIIdentifier:"^\\w{1,255}$"}),scorm12:n,scorm2004:{CMIString200:"^[\\u0000-\\uFFFF]{0,200}$",CMIString250:"^[\\u0000-\\uFFFF]{0,250}$",CMIString1000:"^[\\u0000-\\uFFFF]{0,1000}$",CMIString4000:"^[\\u0000-\\uFFFF]{0,4000}$",CMIString64000:"^[\\u0000-\\uFFFF]{0,64000}$",CMILang:"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$",CMILangString250:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$",CMILangcr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$",CMILangString250cr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$",CMILangString4000:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$",CMITime:"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$",CMITimespan:"^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{1,5})(\\.[0-9]{1,18})?$",CMIIdentifier:"^\\S{1,250}[a-zA-Z0-9]$",CMIShortIdentifier:"^[\\w\\.\\-\\_]{1,250}$",CMILongIdentifier:"^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$",CMIFeedback:"^.*$",CMIIndex:"[._](\\d+).",CMIIndexStore:".N(\\d+).",CMICStatus:"^(completed|incomplete|not attempted|unknown)$",CMISStatus:"^(passed|failed|unknown)$",CMIExit:"^(time-out|suspend|logout|normal)$",CMIType:"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",CMIResult:"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",NAVEvent:"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$",NAVBoolean:"^(unknown|true|false$)",NAVTarget:"^{target=\\S{0,}[a-zA-Z0-9-_]+}$",scaled_range:"-1#1",audio_range:"0#*",speed_range:"0#*",text_range:"-1#1",progress_range:"0#1"}};t.A=o},784:function(e,t,r){r.d(t,{$h:function(){return c},wq:function(){return u},yI:function(){return l}});var i=r(635),n=r(340),o=n.A.scorm12.error_descriptions,s=n.A.aicc.error_descriptions,a=n.A.scorm2004.error_descriptions,c=function(e){function t(t){var r=e.call(this,t.toString())||this;return r._errorCode=t,r.name="ScormValidationError",r}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"errorCode",{get:function(){return this._errorCode},enumerable:!1,configurable:!0}),t.prototype.setMessage=function(e){this.message=e},t}(Error),l=function(e){function t(t,r,i){var n=e.call(this,t)||this;return n._detailedMessage="",n.setMessage(r),n._errorMessage=r,i&&(n._detailedMessage=i),n}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"errorMessage",{get:function(){return this._errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"detailedMessage",{get:function(){return this._detailedMessage},enumerable:!1,configurable:!0}),t}(c),u=(function(e){function t(t){return{}.hasOwnProperty.call(o,String(t))?e.call(this,t,o[String(t)].basicMessage,o[String(t)].detailMessage)||this:e.call(this,101,o[101].basicMessage,o[101].detailMessage)||this}(0,i.C6)(t,e)}(l),function(e){function t(t){return{}.hasOwnProperty.call(s,String(t))?e.call(this,t,s[String(t)].basicMessage,s[String(t)].detailMessage)||this:e.call(this,101,s[101].basicMessage,s[101].detailMessage)||this}(0,i.C6)(t,e)}(l),function(e){function t(t){return{}.hasOwnProperty.call(a,String(t))?e.call(this,t,a[String(t)].basicMessage,a[String(t)].detailMessage)||this:e.call(this,101,a[101].basicMessage,a[101].detailMessage)||this}return(0,i.C6)(t,e),t}(l))},864:function(e,t,r){r.d(t,{$o:function(){return a},Bq:function(){return c},J6:function(){return d},OI:function(){return s},hw:function(){return h},sB:function(){return l},xE:function(){return o}});var i=3600,n={D:24*i,H:i,M:60,S:1};function o(e){if(!e||e<=0)return"PT0S";var t="P",r=e;for(var i in n){var o=n[i],s=Math.floor(r/o);u(r%=o)>2&&(r=Number(Number(r).toFixed(2))),"S"===i&&r>0&&(s+=r),s&&((t.indexOf("D")>0||"H"===i||"M"===i||"S"===i)&&-1===t.indexOf("T")&&(t+="T"),t+="".concat(s).concat(i))}return t}function s(e,t){if("string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var r=new RegExp(t).exec(e)||[],i=r[1],n=(r[2],r[4]),o=r[5],s=r[6],a=r[7],c=0;return c+=Number(a)||0,c+=60*Number(s)||0,c+=3600*Number(o)||0,c+=86400*Number(n)||0,c+=31536e3*Number(i)||0}function a(e,t,r){var i="string"==typeof r?new RegExp(r):r;return o(s(e,i)+s(t,i))}function c(e){var t={};return function e(r,i){if(Object(r)!==r)t[i]=r;else if(Array.isArray(r))for(var n=0,o=r.length;n0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]0&&t.length<=r.max))throw new l.wq(c.A.scorm2004.GENERAL_SET_FAILURE);for(var i=new RegExp(r.format),n=0;n2&&(c=o[2],r=o[1].replace(c,"")),(l=t[r])&&this.processListeners(l,"adl.nav.request",c)):this.settings.autoProgress&&this.processListeners("SequenceNext")),[2,e]}}))}))},t.prototype.lmsGetValue=function(e){var t="^adl\\.nav\\.request_valid\\.(choice|jump)\\.{target=\\S{0,}([a-zA-Z0-9-_]+)}$";if((0,u.J6)(e,t)){var r=e.match(t),i=r[1],n=r[2].replace("{target=","").replace("}","");if("choice"===i||"jump"===i)return this.settings.scoItemIdValidator?String(this.settings.scoItemIdValidator(n)):String(this.settings.scoItemIds.includes(n))}return this.getValue("GetValue",!0,e)},t.prototype.lmsSetValue=function(e,t){return this.setValue("SetValue","Commit",!0,e,t)},t.prototype.lmsCommit=function(){var e=this;return(0,n.sH)(e,void 0,void 0,(function(){return(0,n.YH)(this,(function(e){switch(e.label){case 0:return[4,this.commit("Commit")];case 1:return e.sent(),[2]}}))})),s.A.global.SCORM_TRUE},t.prototype.lmsGetLastError=function(){return this.getLastError("GetLastError")},t.prototype.lmsGetErrorString=function(e){return this.getErrorString("GetErrorString",e)},t.prototype.lmsGetDiagnostic=function(e){return this.getDiagnostic("GetDiagnostic",e)},t.prototype.setCMIValue=function(e,t){return this._commonSetCMIValue("SetValue",!0,e,t)},t.prototype.getChildElement=function(e,t,r){if((0,u.J6)(e,"cmi\\.objectives\\.\\d+"))return new w;if(r){if((0,u.J6)(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+"))return this.createCorrectResponsesObject(e,t);if((0,u.J6)(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+"))return new I}else if((0,u.J6)(e,"cmi\\.interactions\\.\\d+"))return new M;return(0,u.J6)(e,"cmi\\.comments_from_learner\\.\\d+")?new T:(0,u.J6)(e,"cmi\\.comments_from_lms\\.\\d+")?new T(!0):null},t.prototype.createCorrectResponsesObject=function(e,t){var r=e.split("."),i=Number(r[2]),n=this.cmi.interactions.childArray[i];if(this.isInitialized())if(n.type){this.checkDuplicateChoiceResponse(n,t);var o=b[n.type];o?this.checkValidResponseType(o,t,n.type):this.throwSCORMError(c.A.scorm2004.GENERAL_SET_FAILURE,"Incorrect Response Type: "+n.type)}else this.throwSCORMError(c.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED);return"0"===this.lastErrorCode?new y:null},t.prototype.checkValidResponseType=function(e,t,r){var i=[];(null==e?void 0:e.delimiter)?i=String(t).split(e.delimiter):i[0]=t,i.length>0&&i.length<=e.max?this.checkCorrectResponseValue(r,i,t):i.length>e.max&&this.throwSCORMError(c.A.scorm2004.GENERAL_SET_FAILURE,"Data Model Element Pattern Too Long")},t.prototype.checkDuplicateChoiceResponse=function(e,t){var r=e.correct_responses._count;if("choice"===e.type)for(var i=0;i1)Number(t[0])>Number(t[1])&&this.throwSCORMError(c.A.scorm2004.TYPE_MISMATCH);else if(""!==t[o]&&i.unique)for(var l=0;l0&&(N.includes(l.toLowerCase())||this.throwSCORMError(c.A.scorm2004.TYPE_MISMATCH))}i=!0;break;case"case_matters":i||t||r||"true"!==o[3]&&"false"!==o[3]&&this.throwSCORMError(c.A.scorm2004.TYPE_MISMATCH),r=!0;break;case"order_matters":r||i||t||"true"!==o[3]&&"false"!==o[3]&&this.throwSCORMError(c.A.scorm2004.TYPE_MISMATCH),t=!0}o=(e=e.substring(o[1].length)).match(n)}return e},t.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi,this.adl=e.adl},t.prototype.renderCommitCMI=function(e){var t=this.renderCMIToJSONObject();e&&(t.cmi.total_time=this.cmi.getCurrentTotalTime());var r=[],i=u.Bq(t);switch(this.settings.dataCommitFormat){case"flattened":return u.Bq(t);case"params":for(var n in i)({}).hasOwnProperty.call(i,n)&&r.push("".concat(n,"=").concat(i[n]));return r;default:return t}},t.prototype.renderCommitObject=function(e){var t=this.renderCommitCMI(e),r=this.cmi.getCurrentTotalTime(),i=u.OI(r,a.A.scorm2004.CMITimespan),n=R.lC.unknown,o=R.YE.unknown;this.cmi.completion_status&&("completed"===this.cmi.completion_status?n=R.lC.completed:"incomplete"===this.cmi.completion_status&&(n=R.lC.incomplete)),this.cmi.success_status&&("passed"===this.cmi.success_status?o=R.YE.passed:"failed"===this.cmi.success_status&&(o=R.YE.failed));var s=this.cmi.score,c=null;s&&(c={},Number.isNaN(Number.parseFloat(s.raw))||(c.raw=Number.parseFloat(s.raw)),Number.isNaN(Number.parseFloat(s.min))||(c.min=Number.parseFloat(s.min)),Number.isNaN(Number.parseFloat(s.max))||(c.max=Number.parseFloat(s.max)),Number.isNaN(Number.parseFloat(s.scaled))||(c.scaled=Number.parseFloat(s.scaled)));var l={completionStatus:n,successStatus:o,totalTimeSeconds:i,runtimeData:t};return c&&(l.score=c),l},t.prototype.storeData=function(e){return(0,n.sH)(this,void 0,void 0,(function(){var t,r,i,o,a,c,l;return(0,n.YH)(this,(function(n){switch(n.label){case 0:return e&&"normal"===this.cmi.mode&&"credit"===this.cmi.credit&&(this.cmi.completion_threshold&&this.cmi.progress_measure&&(this.cmi.progress_measure>=this.cmi.completion_threshold?this.cmi.completion_status="completed":this.cmi.completion_status="incomplete"),this.cmi.scaled_passing_score&&this.cmi.score.scaled&&(this.cmi.score.scaled>=this.cmi.scaled_passing_score?this.cmi.success_status="passed":this.cmi.success_status="failed")),t=!1,this.adl.nav.request!==(null===(l=null===(c=null===(a=this.startingData)||void 0===a?void 0:a.adl)||void 0===c?void 0:c.nav)||void 0===l?void 0:l.request)&&"_none_"!==this.adl.nav.request&&(this.adl.nav.request=encodeURIComponent(this.adl.nav.request),t=!0),r=e||this.settings.alwaysSendTotalTime,i=this.settings.renderCommonCommitFields?this.renderCommitObject(r):this.renderCommitCMI(r),this.apiLogLevel===s.A.global.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(i)),"string"!=typeof this.settings.lmsCommitUrl?[3,2]:[4,this.processHttpRequest(this.settings.lmsCommitUrl,i,e)];case 1:return o=n.sent(),t&&void 0!==o.navRequest&&""!==o.navRequest&&Function('"use strict";(() => { '.concat(o.navRequest," })()"))(),[2,o];case 2:return[2,{result:s.A.global.SCORM_TRUE,errorCode:0}]}}))}))},t}(o.A);module.exports=i}(); +!function(){"use strict";var e={900:function(e,t,r){r.d(t,{A:function(){return d}});var i=r(635),n=r(589),o=r(784),s=r(797),a=r(340),c=r(864);var l={autocommit:!1,autocommitSeconds:10,asyncCommit:!1,sendFullCommit:!0,lmsCommitUrl:!1,dataCommitFormat:"json",commitRequestDataType:"application/json;charset=UTF-8",autoProgress:!1,logLevel:a.A.global.LOG_LEVEL_ERROR,selfReportSessionTime:!1,alwaysSendTotalTime:!1,renderCommonCommitFields:!1,strict_errors:!0,xhrHeaders:{},xhrWithCredentials:!1,responseHandler:function(e){return(0,i.sH)(this,void 0,void 0,(function(){var t,r,n;return(0,i.YH)(this,(function(i){switch(i.label){case 0:return void 0===e?[3,2]:(n=(r=JSON).parse,[4,e.text()]);case 1:return null!==(t=n.apply(r,[i.sent()]))&&{}.hasOwnProperty.call(t,"result")?[2,{result:t.result,errorCode:t.errorCode?t.errorCode:t.result===a.A.global.SCORM_TRUE?0:101}]:200===e.status?[2,{result:a.A.global.SCORM_TRUE,errorCode:0}]:[2,{result:a.A.global.SCORM_FALSE,errorCode:101}];case 2:return[2,{result:a.A.global.SCORM_FALSE,errorCode:101}]}}))}))},requestHandler:function(e){return e},onLogMessage:function(e,t){switch(e){case a.A.global.LOG_LEVEL_ERROR:console.error(t);break;case a.A.global.LOG_LEVEL_WARNING:console.warn(t);break;case a.A.global.LOG_LEVEL_INFO:console.info(t);break;case a.A.global.LOG_LEVEL_DEBUG:console.debug?console.debug(t):console.log(t)}},scoItemIds:[],scoItemIdValidator:!1},u=function(){function e(e,t,r){this._cancelled=!1,this._API=e,this._timeout=setTimeout(this.wrapper.bind(this),t),this._callback=r}return e.prototype.cancel=function(){this._cancelled=!0,this._timeout&&clearTimeout(this._timeout)},e.prototype.wrapper=function(){var e=this;this._cancelled||(0,i.sH)(e,void 0,void 0,(function(){return(0,i.YH)(this,(function(e){switch(e.label){case 0:return[4,this._API.commit(this._callback)];case 1:return[2,e.sent()]}}))}))},e}(),h=function(){function e(t,r){var i=this.constructor;if(this._settings=l,i===e)throw new TypeError("Cannot construct BaseAPI instances directly");this.currentState=a.A.global.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[],this._error_codes=t,r&&(this.settings=r),this.apiLogLevel=this.settings.logLevel,this.selfReportSessionTime=this.settings.selfReportSessionTime}return e.prototype.commonReset=function(e){this.settings=(0,i.Cl)((0,i.Cl)({},this.settings),e),this.currentState=a.A.global.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[]},e.prototype.initialize=function(e,t,r){var i=a.A.global.SCORM_FALSE;return this.isInitialized()?this.throwSCORMError(this._error_codes.INITIALIZED,t):this.isTerminated()?this.throwSCORMError(this._error_codes.TERMINATED,r):(this.selfReportSessionTime&&this.cmi.setStartTime(),this.currentState=a.A.global.STATE_INITIALIZED,this.lastErrorCode="0",i=a.A.global.SCORM_TRUE,this.processListeners(e)),this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(i),i},e.prototype.apiLog=function(e,t,r,i){t=(0,c.hw)(e,t,i),r>=this.apiLogLevel&&this.settings.onLogMessage(r,t)},Object.defineProperty(e.prototype,"error_codes",{get:function(){return this._error_codes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"settings",{get:function(){return this._settings},set:function(e){this._settings=(0,i.Cl)((0,i.Cl)({},this._settings),e)},enumerable:!1,configurable:!0}),e.prototype.terminate=function(e,t){return(0,i.sH)(this,void 0,void 0,(function(){var r,n;return(0,i.YH)(this,(function(i){switch(i.label){case 0:return r=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.TERMINATION_BEFORE_INIT,this._error_codes.MULTIPLE_TERMINATION)?(this.currentState=a.A.global.STATE_TERMINATED,[4,this.storeData(!0)]):[3,2];case 1:void 0!==(n=i.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),r=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,t&&(this.lastErrorCode="0"),r=a.A.global.SCORM_TRUE,this.processListeners(e),i.label=2;case 2:return this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(r),[2,r]}}))}))},e.prototype.getValue=function(e,t,r){var i="";if(this.checkState(t,this._error_codes.RETRIEVE_BEFORE_INIT,this._error_codes.RETRIEVE_AFTER_TERM)){t&&(this.lastErrorCode="0");try{i=this.getCMIValue(r)}catch(e){i=this.handleValueAccessException(e,i)}this.processListeners(e,r)}return this.apiLog(e,": returned: "+i,a.A.global.LOG_LEVEL_INFO,r),void 0===i?"":(this.clearSCORMError(i),i)},e.prototype.setValue=function(e,t,r,i,n){void 0!==n&&(n=String(n));var o=a.A.global.SCORM_FALSE;if(this.checkState(r,this._error_codes.STORE_BEFORE_INIT,this._error_codes.STORE_AFTER_TERM)){r&&(this.lastErrorCode="0");try{o=this.setCMIValue(i,n)}catch(e){this.handleValueAccessException(e,o)}this.processListeners(e,i,n)}return void 0===o&&(o=a.A.global.SCORM_FALSE),"0"===String(this.lastErrorCode)&&this.settings.autocommit&&!this._timeout&&this.scheduleCommit(1e3*this.settings.autocommitSeconds,t),this.apiLog(e,": "+n+": result: "+o,a.A.global.LOG_LEVEL_INFO,i),this.clearSCORMError(o),o},e.prototype.commit=function(e){return(0,i.sH)(this,arguments,void 0,(function(e,t){var r,n;return void 0===t&&(t=!1),(0,i.YH)(this,(function(i){switch(i.label){case 0:return this.clearScheduledCommit(),r=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.COMMIT_BEFORE_INIT,this._error_codes.COMMIT_AFTER_TERM)?[4,this.storeData(!1)]:[3,2];case 1:(n=i.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),r=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,this.apiLog(e," Result: "+r,a.A.global.LOG_LEVEL_DEBUG,"HttpRequest"),t&&(this.lastErrorCode="0"),this.processListeners(e),i.label=2;case 2:return this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(r),[2,r]}}))}))},e.prototype.getLastError=function(e){var t=String(this.lastErrorCode);return this.processListeners(e),this.apiLog(e,"returned: "+t,a.A.global.LOG_LEVEL_INFO),t},e.prototype.getErrorString=function(e,t){var r="";return null!==t&&""!==t&&(r=this.getLmsErrorMessageDetails(t),this.processListeners(e)),this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),r},e.prototype.getDiagnostic=function(e,t){var r="";return null!==t&&""!==t&&(r=this.getLmsErrorMessageDetails(t,!0),this.processListeners(e)),this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),r},e.prototype.checkState=function(e,t,r){return this.isNotInitialized()?(this.throwSCORMError(t),!1):!e||!this.isTerminated()||(this.throwSCORMError(r),!1)},e.prototype.getLmsErrorMessageDetails=function(e,t){throw void 0===t&&(t=!1),new Error("The getLmsErrorMessageDetails method has not been implemented")},e.prototype.getCMIValue=function(e){throw new Error("The getCMIValue method has not been implemented")},e.prototype.setCMIValue=function(e,t){throw new Error("The setCMIValue method has not been implemented")},e.prototype._commonSetCMIValue=function(e,t,r,o){if(!r||""===r)return a.A.global.SCORM_FALSE;for(var s=r.split("."),l=this,u=a.A.global.SCORM_FALSE,h=!1,d="The data model element passed to ".concat(e," (").concat(r,") is not a valid SCORM data model element."),m=t?this._error_codes.UNDEFINED_DATA_MODEL:this._error_codes.GENERAL,_=0;_1&&(s=e.replace(o+".","")),this.listenerArray.push({functionName:o,CMIElement:s,callback:t}),this.apiLog("on","Added event listener: ".concat(this.listenerArray.length),a.A.global.LOG_LEVEL_INFO,o)}},e.prototype.off=function(e,t){if(t)for(var r=e.split(" "),i=function(i){var o=r[i].split(".");if(0===o.length)return{value:void 0};var s=o[0],c=null;o.length>1&&(c=e.replace(s+".",""));var l=n.listenerArray.findIndex((function(e){return e.functionName===s&&e.CMIElement===c&&e.callback===t}));-1!==l&&(n.listenerArray.splice(l,1),n.apiLog("off","Removed event listener: ".concat(n.listenerArray.length),a.A.global.LOG_LEVEL_INFO,s))},n=this,o=0;o1&&(s=e.replace(o+".","")),i.listenerArray=i.listenerArray.filter((function(e){return e.functionName!==o&&e.CMIElement!==s}))},i=this,n=0;ns?1:0})),s.forEach((function(e){(i={})[e[0]]=e[1],r.loadFromJSON((0,c.sB)(i),t)}))}else console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize.");function a(e,t,r){var i,n=e.match(r);if(null!==n&&null!==(i=t.match(r))){var o=Number(n[2]),s=Number(i[2]);return o===s?"id"===n[3]?-1:"type"===n[3]?"id"===i[3]?1:-1:1:o-s}return null}},e.prototype.loadFromJSON=function(e,t){if(this.isNotInitialized()){for(var r in t=void 0!==t?t:"cmi",this.startingData=e,e)if({}.hasOwnProperty.call(e,r)&&e[r]){var i=(t?t+".":"")+r,n=e[r];if(n.childArray)for(var o=0;o=200&&e.status<=299&&(!0===t.result||t.result===a.A.global.SCORM_TRUE)?this.processListeners("CommitSuccess"):this.processListeners("CommitError"),[2,t]}}))}))},e}(),d=h},589:function(e,t,r){r.d(t,{B:function(){return c}});var i=r(635),n=r(319),o=r(797),s=r(784),a=o.A.scorm12,c=function(e){function t(t){var r=e.call(this)||this;return r.__children=t.children,r._errorCode=t.errorCode||a.GENERAL,r._errorClass=t.errorClass||s.$h,r.childArray=[],r}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_count",{get:function(){return this.childArray.length},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;for(var e={},t=0;t=n[0]){if("*"===n[1]||e<=n[1])return!0;throw new i(r)}throw new i(r)}r.d(t,{W:function(){return n},q:function(){return i}})},340:function(e,t,r){var i=r(635),n={cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",core_children:"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time",score_children:"raw,min,max",comments_children:"content,location,time",objectives_children:"id,score,status",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio,language,speed,text",interactions_children:"id,objectives,time,type,correct_responses,weighting,student_response,result,latency",error_descriptions:{101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information"},201:{basicMessage:"Invalid argument error",detailMessage:"Indicates that an argument represents an invalid data model element or is otherwise incorrect."},202:{basicMessage:"Element cannot have children",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.'},203:{basicMessage:"Element not an array - cannot have count",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.'},301:{basicMessage:"Not initialized",detailMessage:"Indicates that an API call was made before the call to lmsInitialize."},401:{basicMessage:"Not implemented error",detailMessage:"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement."},402:{basicMessage:"Invalid set value, element is a keyword",detailMessage:'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").'},403:{basicMessage:"Element is read only",detailMessage:"LMSSetValue was called with a data model element that can only be read."},404:{basicMessage:"Element is write only",detailMessage:"LMSGetValue was called on a data model element that can only be written to."},405:{basicMessage:"Incorrect Data Type",detailMessage:"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Element Value Out Of Range",detailMessage:"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}},o={global:{SCORM_TRUE:"true",SCORM_FALSE:"false",STATE_NOT_INITIALIZED:0,STATE_INITIALIZED:1,STATE_TERMINATED:2,LOG_LEVEL_DEBUG:1,LOG_LEVEL_INFO:2,LOG_LEVEL_WARNING:3,LOG_LEVEL_ERROR:4,LOG_LEVEL_NONE:5},scorm12:n,aicc:(0,i.Cl)((0,i.Cl)({},n),{cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation",student_preference_children:"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows",student_data_children:"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action",student_demographics_children:"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience",tries_children:"time,status,score",attempt_records_children:"score,lesson_status",paths_children:"location_id,date,time,status,why_left,time_in_element"}),scorm2004:{cmi_children:"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time",comments_children:"comment,timestamp,location",score_children:"max,raw,scaled,min",objectives_children:"progress_measure,completion_status,success_status,description,score,id",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio_level,audio_captioning,delivery_speed,language",interactions_children:"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description",error_descriptions:{0:{basicMessage:"No Error",detailMessage:"No error occurred, the previous API call was successful."},101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use GetDiagnostic for more information."},102:{basicMessage:"General Initialization Failure",detailMessage:"Call to Initialize failed for an unknown reason."},103:{basicMessage:"Already Initialized",detailMessage:"Call to Initialize failed because Initialize was already called."},104:{basicMessage:"Content Instance Terminated",detailMessage:"Call to Initialize failed because Terminate was already called."},111:{basicMessage:"General Termination Failure",detailMessage:"Call to Terminate failed for an unknown reason."},112:{basicMessage:"Termination Before Initialization",detailMessage:"Call to Terminate failed because it was made before the call to Initialize."},113:{basicMessage:"Termination After Termination",detailMessage:"Call to Terminate failed because Terminate was already called."},122:{basicMessage:"Retrieve Data Before Initialization",detailMessage:"Call to GetValue failed because it was made before the call to Initialize."},123:{basicMessage:"Retrieve Data After Termination",detailMessage:"Call to GetValue failed because it was made after the call to Terminate."},132:{basicMessage:"Store Data Before Initialization",detailMessage:"Call to SetValue failed because it was made before the call to Initialize."},133:{basicMessage:"Store Data After Termination",detailMessage:"Call to SetValue failed because it was made after the call to Terminate."},142:{basicMessage:"Commit Before Initialization",detailMessage:"Call to Commit failed because it was made before the call to Initialize."},143:{basicMessage:"Commit After Termination",detailMessage:"Call to Commit failed because it was made after the call to Terminate."},201:{basicMessage:"General Argument Error",detailMessage:"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument."},301:{basicMessage:"General Get Failure",detailMessage:"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},351:{basicMessage:"General Set Failure",detailMessage:"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},391:{basicMessage:"General Commit Failure",detailMessage:"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information."},401:{basicMessage:"Undefined Data Model Element",detailMessage:"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element."},402:{basicMessage:"Unimplemented Data Model Element",detailMessage:"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant."},403:{basicMessage:"Data Model Element Value Not Initialized",detailMessage:"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO."},404:{basicMessage:"Data Model Element Is Read Only",detailMessage:"SetValue was called with a data model element that can only be read."},405:{basicMessage:"Data Model Element Is Write Only",detailMessage:"GetValue was called on a data model element that can only be written to."},406:{basicMessage:"Data Model Element Type Mismatch",detailMessage:"SetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Data Model Element Value Out Of Range",detailMessage:"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}}};t.A=o},56:function(e,t,r){var i,n,o;r.d(t,{K$:function(){return i},YE:function(){return n},lC:function(){return o}}),function(e){e.unknown="unknown",e.true="true",e.false="false"}(i||(i={})),function(e){e.passed="passed",e.failed="failed",e.unknown="unknown"}(n||(n={})),function(e){e.completed="completed",e.incomplete="incomplete",e.unknown="unknown"}(o||(o={}))},797:function(e,t,r){var i=r(635),n={GENERAL:101,INITIALIZATION_FAILED:101,INITIALIZED:101,TERMINATED:101,TERMINATION_FAILURE:101,TERMINATION_BEFORE_INIT:101,MULTIPLE_TERMINATION:101,RETRIEVE_BEFORE_INIT:101,RETRIEVE_AFTER_TERM:101,STORE_BEFORE_INIT:101,STORE_AFTER_TERM:101,COMMIT_BEFORE_INIT:101,COMMIT_AFTER_TERM:101,ARGUMENT_ERROR:101,CHILDREN_ERROR:101,COUNT_ERROR:101,GENERAL_GET_FAILURE:101,GENERAL_SET_FAILURE:101,GENERAL_COMMIT_FAILURE:101,UNDEFINED_DATA_MODEL:101,UNIMPLEMENTED_ELEMENT:101,VALUE_NOT_INITIALIZED:101,INVALID_SET_VALUE:101,READ_ONLY_ELEMENT:101,WRITE_ONLY_ELEMENT:101,TYPE_MISMATCH:101,VALUE_OUT_OF_RANGE:101,DEPENDENCY_NOT_ESTABLISHED:101},o={scorm12:(0,i.Cl)((0,i.Cl)({},n),{RETRIEVE_BEFORE_INIT:301,STORE_BEFORE_INIT:301,COMMIT_BEFORE_INIT:301,ARGUMENT_ERROR:201,CHILDREN_ERROR:202,COUNT_ERROR:203,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:401,VALUE_NOT_INITIALIZED:301,INVALID_SET_VALUE:402,READ_ONLY_ELEMENT:403,WRITE_ONLY_ELEMENT:404,TYPE_MISMATCH:405,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408}),scorm2004:(0,i.Cl)((0,i.Cl)({},n),{INITIALIZATION_FAILED:102,INITIALIZED:103,TERMINATED:104,TERMINATION_FAILURE:111,TERMINATION_BEFORE_INIT:112,MULTIPLE_TERMINATIONS:113,RETRIEVE_BEFORE_INIT:122,RETRIEVE_AFTER_TERM:123,STORE_BEFORE_INIT:132,STORE_AFTER_TERM:133,COMMIT_BEFORE_INIT:142,COMMIT_AFTER_TERM:143,ARGUMENT_ERROR:201,GENERAL_GET_FAILURE:301,GENERAL_SET_FAILURE:351,GENERAL_COMMIT_FAILURE:391,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:402,VALUE_NOT_INITIALIZED:403,READ_ONLY_ELEMENT:404,WRITE_ONLY_ELEMENT:405,TYPE_MISMATCH:406,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408})};t.A=o},417:function(e,t,r){var i=r(635),n={CMIString256:"^.{0,255}$",CMIString4096:"^.{0,4096}$",CMITime:"^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",CMITimespan:"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{0,3})(.[0-9]*)?$",CMIIdentifier:"^[\\u0021-\\u007E\\s]{0,255}$",CMIFeedback:"^.{0,255}$",CMIIndex:"[._](\\d+).",CMIStatus:"^(passed|completed|failed|incomplete|browsed)$",CMIStatus2:"^(passed|completed|failed|incomplete|browsed|not attempted)$",CMIExit:"^(time-out|suspend|logout|)$",CMIType:"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$",CMIResult:"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$",NAVEvent:"^(previous|continue)$",score_range:"0#100",audio_range:"-1#100",speed_range:"-100#100",weighting_range:"-100#100",text_range:"-1#1"},o={aicc:(0,i.Cl)((0,i.Cl)({},n),{CMIIdentifier:"^\\w{1,255}$"}),scorm12:n,scorm2004:{CMIString200:"^[\\u0000-\\uFFFF]{0,200}$",CMIString250:"^[\\u0000-\\uFFFF]{0,250}$",CMIString1000:"^[\\u0000-\\uFFFF]{0,1000}$",CMIString4000:"^[\\u0000-\\uFFFF]{0,4000}$",CMIString64000:"^[\\u0000-\\uFFFF]{0,64000}$",CMILang:"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$",CMILangString250:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$",CMILangcr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$",CMILangString250cr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$",CMILangString4000:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$",CMITime:"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$",CMITimespan:"^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{1,5})(\\.[0-9]{1,18})?$",CMIIdentifier:"^\\S{1,250}[a-zA-Z0-9]$",CMIShortIdentifier:"^[\\w\\.\\-\\_]{1,250}$",CMILongIdentifier:"^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$",CMIFeedback:"^.*$",CMIIndex:"[._](\\d+).",CMIIndexStore:".N(\\d+).",CMICStatus:"^(completed|incomplete|not attempted|unknown)$",CMISStatus:"^(passed|failed|unknown)$",CMIExit:"^(time-out|suspend|logout|normal)$",CMIType:"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",CMIResult:"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",NAVEvent:"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$",NAVBoolean:"^(unknown|true|false$)",NAVTarget:"^{target=\\S{0,}[a-zA-Z0-9-_]+}$",scaled_range:"-1#1",audio_range:"0#*",speed_range:"0#*",text_range:"-1#1",progress_range:"0#1"}};t.A=o},784:function(e,t,r){r.d(t,{$h:function(){return c},wq:function(){return u},yI:function(){return l}});var i=r(635),n=r(340),o=n.A.scorm12.error_descriptions,s=n.A.aicc.error_descriptions,a=n.A.scorm2004.error_descriptions,c=function(e){function t(t){var r=e.call(this,t.toString())||this;return r._errorCode=t,r.name="ScormValidationError",r}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"errorCode",{get:function(){return this._errorCode},enumerable:!1,configurable:!0}),t.prototype.setMessage=function(e){this.message=e},t}(Error),l=function(e){function t(t,r,i){var n=e.call(this,t)||this;return n._detailedMessage="",n.setMessage(r),n._errorMessage=r,i&&(n._detailedMessage=i),n}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"errorMessage",{get:function(){return this._errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"detailedMessage",{get:function(){return this._detailedMessage},enumerable:!1,configurable:!0}),t}(c),u=(function(e){function t(t){return{}.hasOwnProperty.call(o,String(t))?e.call(this,t,o[String(t)].basicMessage,o[String(t)].detailMessage)||this:e.call(this,101,o[101].basicMessage,o[101].detailMessage)||this}(0,i.C6)(t,e)}(l),function(e){function t(t){return{}.hasOwnProperty.call(s,String(t))?e.call(this,t,s[String(t)].basicMessage,s[String(t)].detailMessage)||this:e.call(this,101,s[101].basicMessage,s[101].detailMessage)||this}(0,i.C6)(t,e)}(l),function(e){function t(t){return{}.hasOwnProperty.call(a,String(t))?e.call(this,t,a[String(t)].basicMessage,a[String(t)].detailMessage)||this:e.call(this,101,a[101].basicMessage,a[101].detailMessage)||this}return(0,i.C6)(t,e),t}(l))},864:function(e,t,r){r.d(t,{$o:function(){return a},Bq:function(){return c},J6:function(){return d},OI:function(){return s},hw:function(){return h},sB:function(){return l},xE:function(){return o}});var i=3600,n={D:24*i,H:i,M:60,S:1};function o(e){if(!e||e<=0)return"PT0S";var t="P",r=e;for(var i in n){var o=n[i],s=Math.floor(r/o);u(r%=o)>2&&(r=Number(Number(r).toFixed(2))),"S"===i&&r>0&&(s+=r),s&&((t.indexOf("D")>0||"H"===i||"M"===i||"S"===i)&&-1===t.indexOf("T")&&(t+="T"),t+="".concat(s).concat(i))}return t}function s(e,t){if("string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var r=new RegExp(t).exec(e)||[],i=r[1],n=(r[2],r[4]),o=r[5],s=r[6],a=r[7],c=0;return c+=Number(a)||0,c+=60*Number(s)||0,c+=3600*Number(o)||0,c+=86400*Number(n)||0,c+=31536e3*Number(i)||0}function a(e,t,r){var i="string"==typeof r?new RegExp(r):r;return o(s(e,i)+s(t,i))}function c(e){var t={};return function e(r,i){if(Object(r)!==r)t[i]=r;else if(Array.isArray(r))for(var n=0,o=r.length;n0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]0&&t.length<=r.max))throw new l.wq(c.A.scorm2004.GENERAL_SET_FAILURE);for(var i=new RegExp(r.format),n=0;n2&&(c=o[2],r=o[1].replace(c,"")),(l=t[r])&&this.processListeners(l,"adl.nav.request",c)):this.settings.autoProgress&&this.processListeners("SequenceNext")),[2,e]}}))}))},t.prototype.lmsGetValue=function(e){var t="^adl\\.nav\\.request_valid\\.(choice|jump)\\.{target=\\S{0,}([a-zA-Z0-9-_]+)}$";if((0,u.J6)(e,t)){var r=e.match(t),i=r[1],n=r[2].replace("{target=","").replace("}","");if("choice"===i||"jump"===i)return this.settings.scoItemIdValidator?String(this.settings.scoItemIdValidator(n)):String(this.settings.scoItemIds.includes(n))}return this.getValue("GetValue",!0,e)},t.prototype.lmsSetValue=function(e,t){return this.setValue("SetValue","Commit",!0,e,t)},t.prototype.lmsCommit=function(){var e=this;return(0,n.sH)(e,void 0,void 0,(function(){return(0,n.YH)(this,(function(e){switch(e.label){case 0:return[4,this.commit("Commit")];case 1:return e.sent(),[2]}}))})),s.A.global.SCORM_TRUE},t.prototype.lmsGetLastError=function(){return this.getLastError("GetLastError")},t.prototype.lmsGetErrorString=function(e){return this.getErrorString("GetErrorString",e)},t.prototype.lmsGetDiagnostic=function(e){return this.getDiagnostic("GetDiagnostic",e)},t.prototype.setCMIValue=function(e,t){return this._commonSetCMIValue("SetValue",!0,e,t)},t.prototype.getChildElement=function(e,t,r){if((0,u.J6)(e,"cmi\\.objectives\\.\\d+"))return new w;if(r){if((0,u.J6)(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+"))return this.createCorrectResponsesObject(e,t);if((0,u.J6)(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+"))return new I}else if((0,u.J6)(e,"cmi\\.interactions\\.\\d+"))return new M;return(0,u.J6)(e,"cmi\\.comments_from_learner\\.\\d+")?new v:(0,u.J6)(e,"cmi\\.comments_from_lms\\.\\d+")?new v(!0):null},t.prototype.createCorrectResponsesObject=function(e,t){var r=e.split("."),i=Number(r[2]),n=this.cmi.interactions.childArray[i];if(this.isInitialized())if(n.type){this.checkDuplicateChoiceResponse(n,t);var o=b[n.type];o?this.checkValidResponseType(o,t,n.type):this.throwSCORMError(c.A.scorm2004.GENERAL_SET_FAILURE,"Incorrect Response Type: "+n.type)}else this.throwSCORMError(c.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED);return"0"===this.lastErrorCode?new y:null},t.prototype.checkValidResponseType=function(e,t,r){var i=[];(null==e?void 0:e.delimiter)?i=String(t).split(e.delimiter):i[0]=t,i.length>0&&i.length<=e.max?this.checkCorrectResponseValue(r,i,t):i.length>e.max&&this.throwSCORMError(c.A.scorm2004.GENERAL_SET_FAILURE,"Data Model Element Pattern Too Long")},t.prototype.checkDuplicateChoiceResponse=function(e,t){var r=e.correct_responses._count;if("choice"===e.type)for(var i=0;i1)Number(t[0])>Number(t[1])&&this.throwSCORMError(c.A.scorm2004.TYPE_MISMATCH);else if(""!==t[o]&&i.unique)for(var l=0;l0&&(N.includes(l.toLowerCase())||this.throwSCORMError(c.A.scorm2004.TYPE_MISMATCH))}i=!0;break;case"case_matters":i||t||r||"true"!==o[3]&&"false"!==o[3]&&this.throwSCORMError(c.A.scorm2004.TYPE_MISMATCH),r=!0;break;case"order_matters":r||i||t||"true"!==o[3]&&"false"!==o[3]&&this.throwSCORMError(c.A.scorm2004.TYPE_MISMATCH),t=!0}o=(e=e.substring(o[1].length)).match(n)}return e},t.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi,this.adl=e.adl},t.prototype.renderCommitCMI=function(e){var t=this.renderCMIToJSONObject();e&&(t.cmi.total_time=this.cmi.getCurrentTotalTime());var r=[],i=u.Bq(t);switch(this.settings.dataCommitFormat){case"flattened":return u.Bq(t);case"params":for(var n in i)({}).hasOwnProperty.call(i,n)&&r.push("".concat(n,"=").concat(i[n]));return r;default:return t}},t.prototype.renderCommitObject=function(e){var t=this.renderCommitCMI(e),r=this.cmi.getCurrentTotalTime(),i=u.OI(r,a.A.scorm2004.CMITimespan),n=R.lC.unknown,o=R.YE.unknown;this.cmi.completion_status&&("completed"===this.cmi.completion_status?n=R.lC.completed:"incomplete"===this.cmi.completion_status&&(n=R.lC.incomplete)),this.cmi.success_status&&("passed"===this.cmi.success_status?o=R.YE.passed:"failed"===this.cmi.success_status&&(o=R.YE.failed));var s=this.cmi.score,c=null;s&&(c={},Number.isNaN(Number.parseFloat(s.raw))||(c.raw=Number.parseFloat(s.raw)),Number.isNaN(Number.parseFloat(s.min))||(c.min=Number.parseFloat(s.min)),Number.isNaN(Number.parseFloat(s.max))||(c.max=Number.parseFloat(s.max)),Number.isNaN(Number.parseFloat(s.scaled))||(c.scaled=Number.parseFloat(s.scaled)));var l={completionStatus:n,successStatus:o,totalTimeSeconds:i,runtimeData:t};return c&&(l.score=c),l},t.prototype.storeData=function(e){return(0,n.sH)(this,void 0,void 0,(function(){var t,r,i,o,a,c,l;return(0,n.YH)(this,(function(n){switch(n.label){case 0:return e&&"normal"===this.cmi.mode&&"credit"===this.cmi.credit&&(this.cmi.completion_threshold&&this.cmi.progress_measure&&(this.cmi.progress_measure>=this.cmi.completion_threshold?this.cmi.completion_status="completed":this.cmi.completion_status="incomplete"),this.cmi.scaled_passing_score&&this.cmi.score.scaled&&(this.cmi.score.scaled>=this.cmi.scaled_passing_score?this.cmi.success_status="passed":this.cmi.success_status="failed")),t=!1,this.adl.nav.request!==(null===(l=null===(c=null===(a=this.startingData)||void 0===a?void 0:a.adl)||void 0===c?void 0:c.nav)||void 0===l?void 0:l.request)&&"_none_"!==this.adl.nav.request&&(this.adl.nav.request=encodeURIComponent(this.adl.nav.request),t=!0),r=e||this.settings.alwaysSendTotalTime,i=this.settings.renderCommonCommitFields?this.renderCommitObject(r):this.renderCommitCMI(r),this.apiLogLevel===s.A.global.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(i)),"string"!=typeof this.settings.lmsCommitUrl?[3,2]:[4,this.processHttpRequest(this.settings.lmsCommitUrl,i,e)];case 1:return o=n.sent(),t&&void 0!==o.navRequest&&""!==o.navRequest&&Function('"use strict";(() => { '.concat(o.navRequest," })()"))(),[2,o];case 2:return[2,{result:s.A.global.SCORM_TRUE,errorCode:0}]}}))}))},t}(o.A);for(var F in i)this[F]=i[F];i.__esModule&&Object.defineProperty(this,"__esModule",{value:!0})}(); //# sourceMappingURL=scorm2004.min.js.map \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index a52a7d9..169423a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -63,26 +63,26 @@ const cjsConfig = { output: { path: path.resolve(__dirname, "dist"), filename: "[name].js", - libraryTarget: "commonjs2", + libraryTarget: "this", environment: { arrowFunction: false, }, }, }; -// const esmConfig = { -// ...commonConfig, -// experiments: { -// outputModule: true, -// }, -// output: { -// path: path.resolve(__dirname, "dist/esm"), -// filename: "[name].js", -// libraryTarget: "module", -// environment: { -// arrowFunction: false, -// }, -// }, -// }; +const esmConfig = { + ...commonConfig, + experiments: { + outputModule: true, + }, + output: { + path: path.resolve(__dirname, "dist/esm"), + filename: "[name].js", + libraryTarget: "module", + environment: { + arrowFunction: false, + }, + }, +}; -export default [cjsConfig]; +export default [cjsConfig, esmConfig];