scorm-again 1.5.3 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,41 +1,52 @@
1
- (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
2
- (function (global){(function (){
3
- function debounce(e,t,r){function o(t){var r=s,o=v;return s=v=void 0,O=t,j=e.apply(o,r)}function n(e){return O=e,y=setTimeout(a,t),d?o(e):j}function i(e){var r=e-p,o=e-O,n=t-r;return T?nativeMin(n,m-o):n}function u(e){var r=e-p,o=e-O;return void 0===p||r>=t||r<0||T&&o>=m}function a(){var e=now();if(u(e))return f(e);y=setTimeout(a,i(e))}function f(e){return y=void 0,g&&s?o(e):(s=v=void 0,j)}function c(){void 0!==y&&clearTimeout(y),O=0,s=p=v=y=void 0}function l(){return void 0===y?j:f(now())}function b(){var e=now(),r=u(e);if(s=arguments,v=this,p=e,r){if(void 0===y)return n(p);if(T)return y=setTimeout(a,t),o(p)}return void 0===y&&(y=setTimeout(a,t)),j}var s,v,m,j,y,p,O=0,d=!1,T=!1,g=!0;if("function"!=typeof e)throw new TypeError(FUNC_ERROR_TEXT);return t=toNumber(t)||0,isObject(r)&&(d=!!r.leading,T="maxWait"in r,m=T?nativeMax(toNumber(r.maxWait)||0,t):m,g="trailing"in r?!!r.trailing:g),b.cancel=c,b.flush=l,b}function isObject(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function isObjectLike(e){return!!e&&"object"==typeof e}function isSymbol(e){return"symbol"==typeof e||isObjectLike(e)&&objectToString.call(e)==symbolTag}function toNumber(e){if("number"==typeof e)return e;if(isSymbol(e))return NAN;if(isObject(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=isObject(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(reTrim,"");var r=reIsBinary.test(e);return r||reIsOctal.test(e)?freeParseInt(e.slice(2),r?2:8):reIsBadHex.test(e)?NAN:+e}var FUNC_ERROR_TEXT="Expected a function",NAN=NaN,symbolTag="[object Symbol]",reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),objectProto=Object.prototype,objectToString=objectProto.toString,nativeMax=Math.max,nativeMin=Math.min,now=function(){return root.Date.now()};module.exports=debounce;
4
- }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
5
-
6
- },{}],2:[function(require,module,exports){
7
- "use strict";function _typeof(e){"@babel/helpers - typeof";return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){_defineProperty(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),e}function _get(e,t,r){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var o=_superPropBase(e,t);if(o){var n=Object.getOwnPropertyDescriptor(o,t);return n.get?n.get.call(r):n.value}})(e,t,r||e)}function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf(e)););return e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var r,o=_getPrototypeOf(e);if(t){var n=_getPrototypeOf(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return _possibleConstructorReturn(this,r)}}function _possibleConstructorReturn(e,t){return!t||"object"!==_typeof(t)&&"function"!=typeof t?_assertThisInitialized(e):t}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _Scorm12API2=_interopRequireDefault(require("./Scorm12API")),_aicc_cmi=require("./cmi/aicc_cmi"),_scorm12_cmi=require("./cmi/scorm12_cmi"),AICC=function(e){function t(e){var o;_classCallCheck(this,t);var n=_objectSpread(_objectSpread({},{mastery_override:!1}),e);return o=r.call(this,n),o.cmi=new _aicc_cmi.CMI,o.nav=new _scorm12_cmi.NAV,o}_inherits(t,e);var r=_createSuper(t);return _createClass(t,[{key:"getChildElement",value:function(e,r,o){var n=_get(_getPrototypeOf(t.prototype),"getChildElement",this).call(this,e,r,o);return n||(this.stringMatches(e,"cmi\\.evaluation\\.comments\\.\\d+")?n=new _aicc_cmi.CMIEvaluationCommentsObject:this.stringMatches(e,"cmi\\.student_data\\.tries\\.\\d+")?n=new _aicc_cmi.CMITriesObject:this.stringMatches(e,"cmi\\.student_data\\.attempt_records\\.\\d+")&&(n=new _aicc_cmi.CMIAttemptRecordsObject)),n}},{key:"replaceWithAnotherScormAPI",value:function(e){this.cmi=e.cmi,this.nav=e.nav}}]),t}(_Scorm12API2.default);exports.default=AICC;
8
- },{"./Scorm12API":4,"./cmi/aicc_cmi":6,"./cmi/scorm12_cmi":8}],3:[function(require,module,exports){
9
- "use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,s=new Array(t);r<t;r++)s[r]=e[r];return s}function _iterableToArrayLimit(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],s=!0,o=!1,i=void 0;try{for(var n,a=e[Symbol.iterator]();!(s=(n=a.next()).done)&&(r.push(n.value),!t||r.length!==t);s=!0);}catch(e){o=!0,i=e}finally{try{s||null==a.return||a.return()}finally{if(o)throw i}}return r}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _typeof(e){"@babel/helpers - typeof";return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,s)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){_defineProperty(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var s=t[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _classPrivateFieldGet(e,t){return _classApplyDescriptorGet(e,_classExtractFieldDescriptor(e,t,"get"))}function _classApplyDescriptorGet(e,t){return t.get?t.get.call(e):t.value}function _classPrivateFieldSet(e,t,r){return _classApplyDescriptorSet(e,_classExtractFieldDescriptor(e,t,"set"),r),r}function _classExtractFieldDescriptor(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}function _classApplyDescriptorSet(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _common=require("./cmi/common"),_exceptions=require("./exceptions"),_error_codes2=_interopRequireDefault(require("./constants/error_codes")),_api_constants=_interopRequireDefault(require("./constants/api_constants")),_utilities=require("./utilities"),_lodash=_interopRequireDefault(require("lodash.debounce")),global_constants=_api_constants.default.global,scorm12_error_codes=_error_codes2.default.scorm12,_timeout=new WeakMap,_error_codes=new WeakMap,_settings=new WeakMap,BaseAPI=function(){function e(t,r){if(_classCallCheck(this,e),_timeout.set(this,{writable:!0,value:void 0}),_error_codes.set(this,{writable:!0,value:void 0}),_settings.set(this,{writable:!0,value:{autocommit:!1,autocommitSeconds:10,asyncCommit:!1,sendBeaconCommit:!1,lmsCommitUrl:!1,dataCommitFormat:"json",commitRequestDataType:"application/json;charset=UTF-8",autoProgress:!1,logLevel:global_constants.LOG_LEVEL_ERROR,selfReportSessionTime:!1,alwaysSendTotalTime:!1,responseHandler:function(e){var t;return void 0!==e&&(null!==(t=JSON.parse(e.responseText))&&{}.hasOwnProperty.call(t,"result")||(t={},200===e.status?(t.result=global_constants.SCORM_TRUE,t.errorCode=0):(t.result=global_constants.SCORM_FALSE,t.errorCode=101))),t}}}),_defineProperty(this,"cmi",void 0),_defineProperty(this,"startingData",void 0),(this instanceof e?this.constructor:void 0)===e)throw new TypeError("Cannot construct BaseAPI instances directly");this.currentState=global_constants.STATE_NOT_INITIALIZED,this.lastErrorCode=0,this.listenerArray=[],_classPrivateFieldSet(this,_timeout,null),_classPrivateFieldSet(this,_error_codes,t),this.settings=r,this.apiLogLevel=this.settings.logLevel,this.selfReportSessionTime=this.settings.selfReportSessionTime}return _createClass(e,[{key:"initialize",value:function(e,t,r){var s=global_constants.SCORM_FALSE;return this.isInitialized()?this.throwSCORMError(_classPrivateFieldGet(this,_error_codes).INITIALIZED,t):this.isTerminated()?this.throwSCORMError(_classPrivateFieldGet(this,_error_codes).TERMINATED,r):(this.selfReportSessionTime&&this.cmi.setStartTime(),this.currentState=global_constants.STATE_INITIALIZED,this.lastErrorCode=0,s=global_constants.SCORM_TRUE,this.processListeners(e)),this.apiLog(e,null,"returned: "+s,global_constants.LOG_LEVEL_INFO),this.clearSCORMError(s),s}},{key:"error_codes",get:function(){return _classPrivateFieldGet(this,_error_codes)}},{key:"settings",get:function(){return _classPrivateFieldGet(this,_settings)},set:function(e){_classPrivateFieldSet(this,_settings,_objectSpread(_objectSpread({},_classPrivateFieldGet(this,_settings)),e))}},{key:"terminate",value:function(e,t){var r=global_constants.SCORM_FALSE;if(this.checkState(t,_classPrivateFieldGet(this,_error_codes).TERMINATION_BEFORE_INIT,_classPrivateFieldGet(this,_error_codes).MULTIPLE_TERMINATION)){this.currentState=global_constants.STATE_TERMINATED;var s=this.storeData(!0);!this.settings.sendBeaconCommit&&!this.settings.asyncCommit&&void 0!==s.errorCode&&s.errorCode>0&&this.throwSCORMError(s.errorCode),r=void 0!==s&&s.result?s.result:global_constants.SCORM_FALSE,t&&(this.lastErrorCode=0),r=global_constants.SCORM_TRUE,this.processListeners(e)}return this.apiLog(e,null,"returned: "+r,global_constants.LOG_LEVEL_INFO),this.clearSCORMError(r),r}},{key:"getValue",value:function(e,t,r){var s;return this.checkState(t,_classPrivateFieldGet(this,_error_codes).RETRIEVE_BEFORE_INIT,_classPrivateFieldGet(this,_error_codes).RETRIEVE_AFTER_TERM)&&(t&&(this.lastErrorCode=0),s=this.getCMIValue(r),this.processListeners(e,r)),this.apiLog(e,r,": returned: "+s,global_constants.LOG_LEVEL_INFO),this.clearSCORMError(s),s}},{key:"setValue",value:function(e,t,r,s,o){void 0!==o&&(o=String(o));var i=global_constants.SCORM_FALSE;if(this.checkState(r,_classPrivateFieldGet(this,_error_codes).STORE_BEFORE_INIT,_classPrivateFieldGet(this,_error_codes).STORE_AFTER_TERM)){r&&(this.lastErrorCode=0);try{i=this.setCMIValue(s,o)}catch(e){e instanceof _exceptions.ValidationError?(this.lastErrorCode=e.errorCode,i=global_constants.SCORM_FALSE):(e.message?console.error(e.message):console.error(e),this.throwSCORMError(_classPrivateFieldGet(this,_error_codes).GENERAL))}this.processListeners(e,s,o)}return void 0===i&&(i=global_constants.SCORM_FALSE),"0"===String(this.lastErrorCode)&&this.settings.autocommit&&!_classPrivateFieldGet(this,_timeout)&&this.scheduleCommit(1e3*this.settings.autocommitSeconds,t),this.apiLog(e,s,": "+o+": result: "+i,global_constants.LOG_LEVEL_INFO),this.clearSCORMError(i),i}},{key:"commit",value:function(e,t){this.clearScheduledCommit();var r=global_constants.SCORM_FALSE;if(this.checkState(t,_classPrivateFieldGet(this,_error_codes).COMMIT_BEFORE_INIT,_classPrivateFieldGet(this,_error_codes).COMMIT_AFTER_TERM)){var s=this.storeData(!1);!this.settings.sendBeaconCommit&&!this.settings.asyncCommit&&s.errorCode&&s.errorCode>0&&this.throwSCORMError(s.errorCode),r=void 0!==s&&s.result?s.result:global_constants.SCORM_FALSE,this.apiLog(e,"HttpRequest"," Result: "+r,global_constants.LOG_LEVEL_DEBUG),t&&(this.lastErrorCode=0),this.processListeners(e)}return this.apiLog(e,null,"returned: "+r,global_constants.LOG_LEVEL_INFO),this.clearSCORMError(r),r}},{key:"getLastError",value:function(e){var t=String(this.lastErrorCode);return this.processListeners(e),this.apiLog(e,null,"returned: "+t,global_constants.LOG_LEVEL_INFO),t}},{key:"getErrorString",value:function(e,t){var r="";return null!==t&&""!==t&&(r=this.getLmsErrorMessageDetails(t),this.processListeners(e)),this.apiLog(e,null,"returned: "+r,global_constants.LOG_LEVEL_INFO),r}},{key:"getDiagnostic",value:function(e,t){var r="";return null!==t&&""!==t&&(r=this.getLmsErrorMessageDetails(t,!0),this.processListeners(e)),this.apiLog(e,null,"returned: "+r,global_constants.LOG_LEVEL_INFO),r}},{key:"checkState",value:function(e,t,r){return this.isNotInitialized()?(this.throwSCORMError(t),!1):!e||!this.isTerminated()||(this.throwSCORMError(r),!1)}},{key:"apiLog",value:function(e,t,r,s){if(r=this.formatMessage(e,t,r),s>=this.apiLogLevel)switch(s){case global_constants.LOG_LEVEL_ERROR:console.error(r);break;case global_constants.LOG_LEVEL_WARNING:console.warn(r);break;case global_constants.LOG_LEVEL_INFO:console.info(r);break;case global_constants.LOG_LEVEL_DEBUG:console.debug?console.debug(r):console.log(r)}}},{key:"formatMessage",value:function(e,t,r){var s="";s+=e;for(var o=20-s.length,i=0;i<o;i++)s+=" ";if(s+=": ",t){s+=t,o=70-s.length;for(var n=0;n<o;n++)s+=" "}return r&&(s+=r),s}},{key:"stringMatches",value:function(e,t){return e&&t&&e.match(t)}},{key:"_checkObjectHasProperty",value:function(e,t){return Object.hasOwnProperty.call(e,t)||Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),t)||t in e}},{key:"getLmsErrorMessageDetails",value:function(e,t){throw new Error("The getLmsErrorMessageDetails method has not been implemented")}},{key:"getCMIValue",value:function(e){throw new Error("The getCMIValue method has not been implemented")}},{key:"setCMIValue",value:function(e,t){throw new Error("The setCMIValue method has not been implemented")}},{key:"_commonSetCMIValue",value:function(e,t,r,s){if(!r||""===r)return global_constants.SCORM_FALSE;for(var o=r.split("."),i=this,n=global_constants.SCORM_FALSE,a=!1,l="The data model element passed to ".concat(e," (").concat(r,") is not a valid SCORM data model element."),c=t?_classPrivateFieldGet(this,_error_codes).UNDEFINED_DATA_MODEL:_classPrivateFieldGet(this,_error_codes).GENERAL,u=0;u<o.length;u++){var _=o[u];if(u===o.length-1)t&&"{target="===_.substr(0,8)&&"function"==typeof i._isTargetValid?this.throwSCORMError(_classPrivateFieldGet(this,_error_codes).READ_ONLY_ELEMENT):this._checkObjectHasProperty(i,_)?(this.isInitialized()&&this.stringMatches(r,"\\.correct_responses\\.\\d+")&&this.validateCorrectResponse(r,s),t&&0!==this.lastErrorCode||(i[_]=s,n=global_constants.SCORM_TRUE)):this.throwSCORMError(c,l);else{if(!(i=i[_])){this.throwSCORMError(c,l);break}if(i instanceof _common.CMIArray){var h=parseInt(o[u+1],10);if(!isNaN(h)){var d=i.childArray[h];if(d)i=d,a=!0;else{var f=this.getChildElement(r,s,a);a=!0,f?(i.initialized&&f.initialize(),i.childArray.push(f),i=f):this.throwSCORMError(c,l)}u++}}}}return n===global_constants.SCORM_FALSE&&this.apiLog(e,null,"There was an error setting the value for: ".concat(r,", value of: ").concat(s),global_constants.LOG_LEVEL_WARNING),n}},{key:"validateCorrectResponse",value:function(e,t){}},{key:"getChildElement",value:function(e,t,r){throw new Error("The getChildElement method has not been implemented")}},{key:"_commonGetCMIValue",value:function(e,t,r){if(!r||""===r)return"";for(var s=r.split("."),o=this,i=null,n="The data model element passed to ".concat(e," (").concat(r,") has not been initialized."),a="The data model element passed to ".concat(e," (").concat(r,") is not a valid SCORM data model element."),l=t?_classPrivateFieldGet(this,_error_codes).UNDEFINED_DATA_MODEL:_classPrivateFieldGet(this,_error_codes).GENERAL,c=0;c<s.length;c++){if(i=s[c],t){if("{target="===String(i).substr(0,8)&&"function"==typeof o._isTargetValid){var u=String(i).substr(8,String(i).length-9);return o._isTargetValid(u)}if(!this._checkObjectHasProperty(o,i))return void this.throwSCORMError(l,a)}else if(c===s.length-1&&!this._checkObjectHasProperty(o,i))return void this.throwSCORMError(l,a);if(void 0===(o=o[i])){this.throwSCORMError(l,a);break}if(o instanceof _common.CMIArray){var _=parseInt(s[c+1],10);if(!isNaN(_)){var h=o.childArray[_];if(!h){this.throwSCORMError(_classPrivateFieldGet(this,_error_codes).VALUE_NOT_INITIALIZED,n);break}o=h,c++}}}if(null!==o&&void 0!==o)return o;t||("_children"===i?this.throwSCORMError(scorm12_error_codes.CHILDREN_ERROR):"_count"===i&&this.throwSCORMError(scorm12_error_codes.COUNT_ERROR))}},{key:"isInitialized",value:function(){return this.currentState===global_constants.STATE_INITIALIZED}},{key:"isNotInitialized",value:function(){return this.currentState===global_constants.STATE_NOT_INITIALIZED}},{key:"isTerminated",value:function(){return this.currentState===global_constants.STATE_TERMINATED}},{key:"on",value:function(e,t){if(t)for(var r=e.split(" "),s=0;s<r.length;s++){var o=r[s].split(".");if(0===o.length)return;var i=o[0],n=null;o.length>1&&(n=e.replace(i+".","")),this.listenerArray.push({functionName:i,CMIElement:n,callback:t}),this.apiLog("on",i,"Added event listener: ".concat(this.listenerArray.length),global_constants.LOG_LEVEL_INFO)}}},{key:"off",value:function(e,t){var r=this;if(t)for(var s=e.split(" "),o=0;o<s.length;o++){var i=function(o){var i=s[o].split(".");if(0===i.length)return{v:void 0};var n=i[0],a=null;i.length>1&&(a=e.replace(n+".",""));var l=r.listenerArray.findIndex(function(e){return e.functionName===n&&e.CMIElement===a&&e.callback===t});-1!==l&&(r.listenerArray.splice(l,1),r.apiLog("off",n,"Removed event listener: ".concat(r.listenerArray.length),global_constants.LOG_LEVEL_INFO))}(o);if("object"===_typeof(i))return i.v}}},{key:"clear",value:function(e){for(var t=this,r=e.split(" "),s=0;s<r.length;s++){var o=function(s){var o=r[s].split(".");if(0===o.length)return{v:void 0};var i=o[0],n=null;o.length>1&&(n=e.replace(i+".","")),t.listenerArray=t.listenerArray.filter(function(e){return e.functionName!==i&&e.CMIElement!==n})}(s);if("object"===_typeof(o))return o.v}}},{key:"processListeners",value:function(e,t,r){this.apiLog(e,t,r);for(var s=0;s<this.listenerArray.length;s++){var o=this.listenerArray[s],i=o.functionName===e,n=!!o.CMIElement,a=!1;a=t&&o.CMIElement&&"*"===o.CMIElement.substring(o.CMIElement.length-1)?0===t.indexOf(o.CMIElement.substring(0,o.CMIElement.length-1)):o.CMIElement===t,!i||n&&!a||o.callback(t,r)}}},{key:"throwSCORMError",value:function(e,t){t||(t=this.getLmsErrorMessageDetails(e)),this.apiLog("throwSCORMError",null,e+": "+t,global_constants.LOG_LEVEL_ERROR),this.lastErrorCode=String(e)}},{key:"clearSCORMError",value:function(e){void 0!==e&&e!==global_constants.SCORM_FALSE&&(this.lastErrorCode=0)}},{key:"storeData",value:function(e){throw new Error("The storeData method has not been implemented")}},{key:"loadFromFlattenedJSON",value:function(e,t){function r(e,t,r){var s,o=e.match(r);if(null!==o&&null!==(s=t.match(r))){var i=Number(o[2]),n=Number(s[2]);return i===n?"id"===o[3]?-1:"type"===o[3]?"id"===s[3]?1:-1:1:i-n}return null}var s=this;if(!this.isNotInitialized())return void console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize.");var o=/^(cmi\.interactions\.)(\d+)\.(.*)$/,i=/^(cmi\.objectives\.)(\d+)\.(.*)$/,n=Object.keys(e).map(function(t){return[String(t),e[t]]});n.sort(function(e,t){var s,n=_slicedToArray(e,2),a=n[0],l=(n[1],_slicedToArray(t,2)),c=l[0];l[1];return null!==(s=r(a,c,o))?s:null!==(s=r(a,c,i))?s:a<c?-1:a>c?1:0});var a;n.forEach(function(e){a={},a[e[0]]=e[1],s.loadFromJSON((0,_utilities.unflatten)(a),t)})}},{key:"loadFromJSON",value:function(e,t){if(!this.isNotInitialized())return void console.error("loadFromJSON can only be called before the call to lmsInitialize.");t=void 0!==t?t:"cmi",this.startingData=e;for(var r in e)if({}.hasOwnProperty.call(e,r)&&e[r]){var s=(t?t+".":"")+r,o=e[r];if(o.childArray)for(var i=0;i<o.childArray.length;i++)this.loadFromJSON(o.childArray[i],s+"."+i);else o.constructor===Object?this.loadFromJSON(o,s):this.setCMIValue(s,o)}}},{key:"renderCMIToJSONString",value:function(){var e=this.cmi;return JSON.stringify({cmi:e})}},{key:"renderCMIToJSONObject",value:function(){return JSON.parse(this.renderCMIToJSONString())}},{key:"renderCommitCMI",value:function(e){throw new Error("The storeData method has not been implemented")}},{key:"processHttpRequest",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=this,o=function(e,t,r,o){var i,n={result:global_constants.SCORM_FALSE,errorCode:o.GENERAL};if(r.sendBeaconCommit)try{var a,l={type:r.commitRequestDataType};a=t instanceof Array?new Blob([t.join("&")],l):new Blob([JSON.stringify(t)],l),i={},navigator.sendBeacon(e,a)?(i.result=global_constants.SCORM_TRUE,i.errorCode=0):(i.result=global_constants.SCORM_FALSE,i.errorCode=101)}catch(e){return console.error(e),s.processListeners("CommitError"),n}else{var c=new XMLHttpRequest;c.open("POST",e,r.asyncCommit),r.asyncCommit&&(c.onload=function(e){i="function"==typeof r.responseHandler?r.responseHandler(c):JSON.parse(c.responseText)});try{if(t instanceof Array?(c.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),c.send(t.join("&"))):(c.setRequestHeader("Content-Type",r.commitRequestDataType),c.send(JSON.stringify(t))),r.asyncCommit)return i={},i.result=global_constants.SCORM_TRUE,i.errorCode=0,s.processListeners("CommitSuccess"),i;i="function"==typeof r.responseHandler?r.responseHandler(c):JSON.parse(c.responseText)}catch(e){return console.error(e),s.processListeners("CommitError"),n}}return void 0===i?(s.processListeners("CommitError"),n):(!0===i.result||i.result===global_constants.SCORM_TRUE?s.processListeners("CommitSuccess"):s.processListeners("CommitError"),i)};if(void 0!==_lodash.default){var i=(0,_lodash.default)(o,500);return i(e,t,this.settings,this.error_codes),r&&i.flush(),{result:global_constants.SCORM_TRUE,errorCode:0}}return o(e,t,this.settings,this.error_codes)}},{key:"scheduleCommit",value:function(e,t){_classPrivateFieldSet(this,_timeout,new ScheduledCommit(this,e,t)),this.apiLog("scheduleCommit","","scheduled",global_constants.LOG_LEVEL_DEBUG)}},{key:"clearScheduledCommit",value:function(){_classPrivateFieldGet(this,_timeout)&&(_classPrivateFieldGet(this,_timeout).cancel(),_classPrivateFieldSet(this,_timeout,null),this.apiLog("clearScheduledCommit","","cleared",global_constants.LOG_LEVEL_DEBUG))}}]),e}();exports.default=BaseAPI;var _API=new WeakMap,_cancelled=new WeakMap,_timeout2=new WeakMap,_callback=new WeakMap,ScheduledCommit=function(){function e(t,r,s){_classCallCheck(this,e),_API.set(this,{writable:!0,value:void 0}),_cancelled.set(this,{writable:!0,value:!1}),_timeout2.set(this,{writable:!0,value:void 0}),_callback.set(this,{writable:!0,value:void 0}),_classPrivateFieldSet(this,_API,t),_classPrivateFieldSet(this,_timeout2,setTimeout(this.wrapper.bind(this),r)),_classPrivateFieldSet(this,_callback,s)}return _createClass(e,[{key:"cancel",value:function(){_classPrivateFieldSet(this,_cancelled,!0),_classPrivateFieldGet(this,_timeout2)&&clearTimeout(_classPrivateFieldGet(this,_timeout2))}},{key:"wrapper",value:function(){_classPrivateFieldGet(this,_cancelled)||_classPrivateFieldGet(this,_API).commit(_classPrivateFieldGet(this,_callback))}}]),e}();
10
- },{"./cmi/common":7,"./constants/api_constants":10,"./constants/error_codes":11,"./exceptions":15,"./utilities":17,"lodash.debounce":1}],4:[function(require,module,exports){
11
- "use strict";function _typeof(e){"@babel/helpers - typeof";return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function(){return e},e}function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!==_typeof(e)&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var n=o?Object.getOwnPropertyDescriptor(e,i):null;n&&(n.get||n.set)?Object.defineProperty(r,i,n):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){_defineProperty(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var r,o=_getPrototypeOf(e);if(t){var i=_getPrototypeOf(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return _possibleConstructorReturn(this,r)}}function _possibleConstructorReturn(e,t){return!t||"object"!==_typeof(t)&&"function"!=typeof t?_assertThisInitialized(e):t}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _BaseAPI2=_interopRequireDefault(require("./BaseAPI")),_scorm12_cmi=require("./cmi/scorm12_cmi"),Utilities=_interopRequireWildcard(require("./utilities")),_api_constants=_interopRequireDefault(require("./constants/api_constants")),_error_codes=_interopRequireDefault(require("./constants/error_codes")),scorm12_constants=_api_constants.default.scorm12,global_constants=_api_constants.default.global,scorm12_error_codes=_error_codes.default.scorm12,Scorm12API=function(e){function t(e){var o;_classCallCheck(this,t);var i=_objectSpread(_objectSpread({},{mastery_override:!1}),e);return o=r.call(this,scorm12_error_codes,i),o.cmi=new _scorm12_cmi.CMI,o.nav=new _scorm12_cmi.NAV,o.LMSInitialize=o.lmsInitialize,o.LMSFinish=o.lmsFinish,o.LMSGetValue=o.lmsGetValue,o.LMSSetValue=o.lmsSetValue,o.LMSCommit=o.lmsCommit,o.LMSGetLastError=o.lmsGetLastError,o.LMSGetErrorString=o.lmsGetErrorString,o.LMSGetDiagnostic=o.lmsGetDiagnostic,o}_inherits(t,e);var r=_createSuper(t);return _createClass(t,[{key:"lmsInitialize",value:function(){return this.cmi.initialize(),this.initialize("LMSInitialize","LMS was already initialized!","LMS is already finished!")}},{key:"lmsFinish",value:function(){var e=this.terminate("LMSFinish",!0);return e===global_constants.SCORM_TRUE&&(""!==this.nav.event?"continue"===this.nav.event?this.processListeners("SequenceNext"):this.processListeners("SequencePrevious"):this.settings.autoProgress&&this.processListeners("SequenceNext")),e}},{key:"lmsGetValue",value:function(e){return this.getValue("LMSGetValue",!1,e)}},{key:"lmsSetValue",value:function(e,t){return this.setValue("LMSSetValue","LMSCommit",!1,e,t)}},{key:"lmsCommit",value:function(){return this.commit("LMSCommit",!1)}},{key:"lmsGetLastError",value:function(){return this.getLastError("LMSGetLastError")}},{key:"lmsGetErrorString",value:function(e){return this.getErrorString("LMSGetErrorString",e)}},{key:"lmsGetDiagnostic",value:function(e){return this.getDiagnostic("LMSGetDiagnostic",e)}},{key:"setCMIValue",value:function(e,t){return this._commonSetCMIValue("LMSSetValue",!1,e,t)}},{key:"getCMIValue",value:function(e){return this._commonGetCMIValue("getCMIValue",!1,e)}},{key:"getChildElement",value:function(e,t,r){var o;return this.stringMatches(e,"cmi\\.objectives\\.\\d+")?o=new _scorm12_cmi.CMIObjectivesObject:r&&this.stringMatches(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")?o=new _scorm12_cmi.CMIInteractionsCorrectResponsesObject:r&&this.stringMatches(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")?o=new _scorm12_cmi.CMIInteractionsObjectivesObject:!r&&this.stringMatches(e,"cmi\\.interactions\\.\\d+")&&(o=new _scorm12_cmi.CMIInteractionsObject),o}},{key:"validateCorrectResponse",value:function(e,t){return!0}},{key:"getLmsErrorMessageDetails",value:function(e,t){var r="No Error",o="No Error";return e=String(e),scorm12_constants.error_descriptions[e]&&(r=scorm12_constants.error_descriptions[e].basicMessage,o=scorm12_constants.error_descriptions[e].detailMessage),t?o:r}},{key:"replaceWithAnotherScormAPI",value:function(e){this.cmi=e.cmi}},{key:"renderCommitCMI",value:function(e){var t=this.renderCMIToJSONObject();e&&(t.cmi.core.total_time=this.cmi.getCurrentTotalTime());var r=[],o=Utilities.flatten(t);switch(this.settings.dataCommitFormat){case"flattened":return Utilities.flatten(t);case"params":for(var i in o)({}).hasOwnProperty.call(o,i)&&r.push("".concat(i,"=").concat(o[i]));return r;case"json":default:return t}}},{key:"storeData",value:function(e){if(e){var t=this.cmi.core.lesson_status;if("not attempted"===t&&(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&&(parseFloat(this.cmi.core.score.raw)>=parseFloat(this.cmi.student_data.mastery_score)?this.cmi.core.lesson_status="passed":this.cmi.core.lesson_status="failed");else if("browse"===this.cmi.core.lesson_mode){var r,o,i;""===((null===(r=this.startingData)||void 0===r?void 0:null===(o=r.cmi)||void 0===o?void 0:null===(i=o.core)||void 0===i?void 0:i.lesson_status)||"")&&"not attempted"===t&&(this.cmi.core.lesson_status="browsed")}}var n=this.renderCommitCMI(e||this.settings.alwaysSendTotalTime);return this.settings.lmsCommitUrl?(this.apiLogLevel===global_constants.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(n)),this.processHttpRequest(this.settings.lmsCommitUrl,n,e)):(console.log("Commit (terminated: "+(e?"yes":"no")+"): "),console.log(n),global_constants.SCORM_TRUE)}}]),t}(_BaseAPI2.default);exports.default=Scorm12API;
12
- },{"./BaseAPI":3,"./cmi/scorm12_cmi":8,"./constants/api_constants":10,"./constants/error_codes":11,"./utilities":17}],5:[function(require,module,exports){
13
- "use strict";function _typeof(e){"@babel/helpers - typeof";return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function(){return e},e}function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!==_typeof(e)&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var r={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=s?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,s)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){_defineProperty(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var s=t[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var r,s=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;r=Reflect.construct(s,arguments,o)}else r=s.apply(this,arguments);return _possibleConstructorReturn(this,r)}}function _possibleConstructorReturn(e,t){return!t||"object"!==_typeof(t)&&"function"!=typeof t?_assertThisInitialized(e):t}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _classPrivateFieldGet(e,t){return _classApplyDescriptorGet(e,_classExtractFieldDescriptor(e,t,"get"))}function _classExtractFieldDescriptor(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}function _classApplyDescriptorGet(e,t){return t.get?t.get.call(e):t.value}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _BaseAPI2=_interopRequireDefault(require("./BaseAPI")),_scorm2004_cmi=require("./cmi/scorm2004_cmi"),Utilities=_interopRequireWildcard(require("./utilities")),_api_constants=_interopRequireDefault(require("./constants/api_constants")),_error_codes=_interopRequireDefault(require("./constants/error_codes")),_response_constants=_interopRequireDefault(require("./constants/response_constants")),_language_constants=_interopRequireDefault(require("./constants/language_constants")),_regex=_interopRequireDefault(require("./constants/regex")),scorm2004_constants=_api_constants.default.scorm2004,global_constants=_api_constants.default.global,scorm2004_error_codes=_error_codes.default.scorm2004,correct_responses=_response_constants.default.correct,scorm2004_regex=_regex.default.scorm2004,_version=new WeakMap,Scorm2004API=function(e){function t(e){var s;_classCallCheck(this,t);var o=_objectSpread(_objectSpread({},{mastery_override:!1}),e);return s=r.call(this,scorm2004_error_codes,o),_version.set(_assertThisInitialized(s),{writable:!0,value:void 0}),_defineProperty(_assertThisInitialized(s),"checkDuplicatedPattern",function(e,t,r){for(var s=!1,o=e._count,i=0;i<o&&!s;i++)i!==t&&e.childArray[i]===r&&(s=!0);return s}),s.cmi=new _scorm2004_cmi.CMI,s.adl=new _scorm2004_cmi.ADL,s.Initialize=s.lmsInitialize,s.Terminate=s.lmsTerminate,s.GetValue=s.lmsGetValue,s.SetValue=s.lmsSetValue,s.Commit=s.lmsCommit,s.GetLastError=s.lmsGetLastError,s.GetErrorString=s.lmsGetErrorString,s.GetDiagnostic=s.lmsGetDiagnostic,s}_inherits(t,e);var r=_createSuper(t);return _createClass(t,[{key:"version",get:function(){return _classPrivateFieldGet(this,_version)}},{key:"lmsInitialize",value:function(){return this.cmi.initialize(),this.initialize("Initialize")}},{key:"lmsTerminate",value:function(){var e=this.terminate("Terminate",!0);if(e===global_constants.SCORM_TRUE)if("_none_"!==this.adl.nav.request)switch(this.adl.nav.request){case"continue":this.processListeners("SequenceNext");break;case"previous":this.processListeners("SequencePrevious");break;case"choice":this.processListeners("SequenceChoice");break;case"exit":this.processListeners("SequenceExit");break;case"exitAll":this.processListeners("SequenceExitAll");break;case"abandon":this.processListeners("SequenceAbandon");break;case"abandonAll":this.processListeners("SequenceAbandonAll")}else this.settings.autoProgress&&this.processListeners("SequenceNext");return e}},{key:"lmsGetValue",value:function(e){return this.getValue("GetValue",!0,e)}},{key:"lmsSetValue",value:function(e,t){return this.setValue("SetValue","Commit",!0,e,t)}},{key:"lmsCommit",value:function(){return this.commit("Commit")}},{key:"lmsGetLastError",value:function(){return this.getLastError("GetLastError")}},{key:"lmsGetErrorString",value:function(e){return this.getErrorString("GetErrorString",e)}},{key:"lmsGetDiagnostic",value:function(e){return this.getDiagnostic("GetDiagnostic",e)}},{key:"setCMIValue",value:function(e,t){return this._commonSetCMIValue("SetValue",!0,e,t)}},{key:"getChildElement",value:function(e,t,r){var s;if(this.stringMatches(e,"cmi\\.objectives\\.\\d+"))s=new _scorm2004_cmi.CMIObjectivesObject;else if(r&&this.stringMatches(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")){var o=e.split("."),i=Number(o[2]),n=this.cmi.interactions.childArray[i];if(this.isInitialized())if(n.type){this.checkDuplicateChoiceResponse(n,t);var c=correct_responses[n.type];c?this.checkValidResponseType(c,t,n.type):this.throwSCORMError(scorm2004_error_codes.GENERAL_SET_FAILURE,"Incorrect Response Type: "+n.type)}else this.throwSCORMError(scorm2004_error_codes.DEPENDENCY_NOT_ESTABLISHED);0===this.lastErrorCode&&(s=new _scorm2004_cmi.CMIInteractionsCorrectResponsesObject)}else r&&this.stringMatches(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")?s=new _scorm2004_cmi.CMIInteractionsObjectivesObject:!r&&this.stringMatches(e,"cmi\\.interactions\\.\\d+")?s=new _scorm2004_cmi.CMIInteractionsObject:this.stringMatches(e,"cmi\\.comments_from_learner\\.\\d+")?s=new _scorm2004_cmi.CMICommentsObject:this.stringMatches(e,"cmi\\.comments_from_lms\\.\\d+")&&(s=new _scorm2004_cmi.CMICommentsObject(!0));return s}},{key:"checkValidResponseType",value:function(e,t,r){var s=[];null!==e&&void 0!==e&&e.delimiter?s=String(t).split(e.delimiter):s[0]=t,s.length>0&&s.length<=e.max?this.checkCorrectResponseValue(r,s,t):s.length>e.max&&this.throwSCORMError(scorm2004_error_codes.GENERAL_SET_FAILURE,"Data Model Element Pattern Too Long")}},{key:"checkDuplicateChoiceResponse",value:function(e,t){var r=e.correct_responses._count;if("choice"===e.type)for(var s=0;s<r&&0===this.lastErrorCode;s++){var o=e.correct_responses.childArray[s];o.pattern===t&&this.throwSCORMError(scorm2004_error_codes.GENERAL_SET_FAILURE)}}},{key:"validateCorrectResponse",value:function(e,t){var r=e.split("."),s=Number(r[2]),o=Number(r[4]),i=this.cmi.interactions.childArray[s],n=i.correct_responses._count;this.checkDuplicateChoiceResponse(i,t);var c=correct_responses[i.type];void 0===c.limit||n<=c.limit?(this.checkValidResponseType(c,t,i.type),0===this.lastErrorCode&&(!c.duplicate||!this.checkDuplicatedPattern(i.correct_responses,o,t))||0===this.lastErrorCode&&""===t||0===this.lastErrorCode&&this.throwSCORMError(scorm2004_error_codes.GENERAL_SET_FAILURE,"Data Model Element Pattern Already Exists")):this.throwSCORMError(scorm2004_error_codes.GENERAL_SET_FAILURE,"Data Model Element Collection Limit Reached")}},{key:"getCMIValue",value:function(e){return this._commonGetCMIValue("GetValue",!0,e)}},{key:"getLmsErrorMessageDetails",value:function(e,t){var r="",s="";return e=String(e),scorm2004_constants.error_descriptions[e]&&(r=scorm2004_constants.error_descriptions[e].basicMessage,s=scorm2004_constants.error_descriptions[e].detailMessage),t?s:r}},{key:"checkCorrectResponseValue",value:function(e,t,r){for(var s=correct_responses[e],o=new RegExp(s.format),i=0;i<t.length&&0===this.lastErrorCode;i++)if(e.match("^(fill-in|long-fill-in|matching|performance|sequencing)$")&&(t[i]=this.removeCorrectResponsePrefixes(t[i])),null!==s&&void 0!==s&&s.delimiter2){var n=t[i].split(s.delimiter2);if(2===n.length){var c=n[0].match(o);c?n[1].match(new RegExp(s.format2))||this.throwSCORMError(scorm2004_error_codes.TYPE_MISMATCH):this.throwSCORMError(scorm2004_error_codes.TYPE_MISMATCH)}else this.throwSCORMError(scorm2004_error_codes.TYPE_MISMATCH)}else{var a=t[i].match(o);if(!a&&""!==r||!a&&"true-false"===e)this.throwSCORMError(scorm2004_error_codes.TYPE_MISMATCH);else if("numeric"===e&&t.length>1)Number(t[0])>Number(t[1])&&this.throwSCORMError(scorm2004_error_codes.TYPE_MISMATCH);else if(""!==t[i]&&s.unique)for(var l=0;l<i&&0===this.lastErrorCode;l++)t[i]===t[l]&&this.throwSCORMError(scorm2004_error_codes.TYPE_MISMATCH)}}},{key:"removeCorrectResponsePrefixes",value:function(e){for(var t=!1,r=!1,s=!1,o=new RegExp("^({(lang|case_matters|order_matters)=([^}]+)})"),i=e.match(o),n=null;i;){switch(i[2]){case"lang":if(n=e.match(scorm2004_regex.CMILangcr)){var c=n[3];void 0!==c&&c.length>0&&void 0===_language_constants.default[c.toLowerCase()]&&this.throwSCORMError(scorm2004_error_codes.TYPE_MISMATCH)}s=!0;break;case"case_matters":s||t||r||"true"!==i[3]&&"false"!==i[3]&&this.throwSCORMError(scorm2004_error_codes.TYPE_MISMATCH),r=!0;break;case"order_matters":r||s||t||"true"!==i[3]&&"false"!==i[3]&&this.throwSCORMError(scorm2004_error_codes.TYPE_MISMATCH),t=!0}e=e.substr(i[1].length),i=e.match(o)}return e}},{key:"replaceWithAnotherScormAPI",value:function(e){this.cmi=e.cmi,this.adl=e.adl}},{key:"renderCommitCMI",value:function(e){var t=this.renderCMIToJSONObject();e&&(t.cmi.total_time=this.cmi.getCurrentTotalTime());var r=[],s=Utilities.flatten(t);switch(this.settings.dataCommitFormat){case"flattened":return Utilities.flatten(t);case"params":for(var o in s)({}).hasOwnProperty.call(s,o)&&r.push("".concat(o,"=").concat(s[o]));return r;case"json":default:return t}}},{key:"storeData",value:function(e){var t,r,s;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?(console.debug("Setting Completion Status: Completed"),this.cmi.completion_status="completed"):(console.debug("Setting Completion Status: Incomplete"),this.cmi.completion_status="incomplete")),this.cmi.scaled_passing_score&&this.cmi.score.scaled&&(this.cmi.score.scaled>=this.cmi.scaled_passing_score?(console.debug("Setting Success Status: Passed"),this.cmi.success_status="passed"):(console.debug("Setting Success Status: Failed"),this.cmi.success_status="failed")));var o=!1;this.adl.nav.request!==(null===(t=this.startingData)||void 0===t?void 0:null===(r=t.adl)||void 0===r?void 0:null===(s=r.nav)||void 0===s?void 0:s.request)&&"_none_"!==this.adl.nav.request&&(this.adl.nav.request=encodeURIComponent(this.adl.nav.request),o=!0);var i=this.renderCommitCMI(e||this.settings.alwaysSendTotalTime);if(this.settings.lmsCommitUrl){this.apiLogLevel===global_constants.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(i));var n=this.processHttpRequest(this.settings.lmsCommitUrl,i,e);return o&&void 0!==n.navRequest&&""!==n.navRequest&&Function('"use strict";(() => { '.concat(n.navRequest," })()"))(),n}return console.log("Commit (terminated: "+(e?"yes":"no")+"): "),console.log(i),global_constants.SCORM_TRUE}}]),t}(_BaseAPI2.default);exports.default=Scorm2004API;
14
- },{"./BaseAPI":3,"./cmi/scorm2004_cmi":9,"./constants/api_constants":10,"./constants/error_codes":11,"./constants/language_constants":12,"./constants/regex":13,"./constants/response_constants":14,"./utilities":17}],6:[function(require,module,exports){
15
- "use strict";function _typeof(e){"@babel/helpers - typeof";return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function(){return e},e}function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!==_typeof(e)&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var a=r?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(i,s,a):i[s]=e[s]}return i.default=e,t&&t.set(e,i),i}function _classPrivateFieldSet(e,t,i){return _classApplyDescriptorSet(e,_classExtractFieldDescriptor(e,t,"set"),i),i}function _classApplyDescriptorSet(e,t,i){if(t.set)t.set.call(e,i);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=i}}function _classPrivateFieldGet(e,t){return _classApplyDescriptorGet(e,_classExtractFieldDescriptor(e,t,"get"))}function _classExtractFieldDescriptor(e,t,i){if(!t.has(e))throw new TypeError("attempted to "+i+" private field on non-instance");return t.get(e)}function _classApplyDescriptorGet(e,t){return t.get?t.get.call(e):t.value}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _createClass(e,t,i){return t&&_defineProperties(e.prototype,t),i&&_defineProperties(e,i),e}function _get(e,t,i){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,i){var r=_superPropBase(e,t);if(r){var s=Object.getOwnPropertyDescriptor(r,t);return s.get?s.get.call(i):s.value}})(e,t,i||e)}function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf(e)););return e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var i,r=_getPrototypeOf(e);if(t){var s=_getPrototypeOf(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return _possibleConstructorReturn(this,i)}}function _possibleConstructorReturn(e,t){return!t||"object"!==_typeof(t)&&"function"!=typeof t?_assertThisInitialized(e):t}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.CMIEvaluationCommentsObject=exports.CMIAttemptRecordsObject=exports.CMIAttemptRecords=exports.CMITriesObject=exports.CMITries=exports.CMIPathsObject=exports.CMIPaths=exports.CMIStudentDemographics=exports.CMI=void 0;var Scorm12CMI=_interopRequireWildcard(require("./scorm12_cmi")),_common=require("./common"),_api_constants=_interopRequireDefault(require("../constants/api_constants")),_regex=_interopRequireDefault(require("../constants/regex")),_error_codes=_interopRequireDefault(require("../constants/error_codes")),aicc_constants=_api_constants.default.aicc,aicc_regex=_regex.default.aicc,scorm12_error_codes=_error_codes.default.scorm12,CMI=function(e){function t(e){var r;return _classCallCheck(this,t),r=i.call(this,aicc_constants.cmi_children),e&&r.initialize(),r.student_preference=new AICCStudentPreferences,r.student_data=new AICCCMIStudentData,r.student_demographics=new CMIStudentDemographics,r.evaluation=new CMIEvaluation,r.paths=new CMIPaths,r}_inherits(t,e);var i=_createSuper(t);return _createClass(t,[{key:"initialize",value:function(){var e,i,r,s,a;_get(_getPrototypeOf(t.prototype),"initialize",this).call(this),null===(e=this.student_preference)||void 0===e||e.initialize(),null===(i=this.student_data)||void 0===i||i.initialize(),null===(r=this.student_demographics)||void 0===r||r.initialize(),null===(s=this.evaluation)||void 0===s||s.initialize(),null===(a=this.paths)||void 0===a||a.initialize()}},{key:"toJSON",value: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}(Scorm12CMI.CMI);exports.CMI=CMI;var CMIEvaluation=function(e){function t(){var e;return _classCallCheck(this,t),e=i.call(this),e.comments=new CMIEvaluationComments,e}_inherits(t,e);var i=_createSuper(t);return _createClass(t,[{key:"initialize",value:function(){var e;_get(_getPrototypeOf(t.prototype),"initialize",this).call(this),null===(e=this.comments)||void 0===e||e.initialize()}},{key:"toJSON",value:function(){this.jsonString=!0;var e={comments:this.comments};return delete this.jsonString,e}}]),t}(_common.BaseCMI),CMIEvaluationComments=function(e){function t(){return _classCallCheck(this,t),i.call(this,aicc_constants.comments_children,scorm12_error_codes.INVALID_SET_VALUE)}_inherits(t,e);var i=_createSuper(t);return t}(_common.CMIArray),_lesson_type=new WeakMap,_text_color=new WeakMap,_text_location=new WeakMap,_text_size=new WeakMap,_video=new WeakMap,AICCStudentPreferences=function(e){function t(){var e;return _classCallCheck(this,t),e=i.call(this,aicc_constants.student_preference_children),_lesson_type.set(_assertThisInitialized(e),{writable:!0,value:""}),_text_color.set(_assertThisInitialized(e),{writable:!0,value:""}),_text_location.set(_assertThisInitialized(e),{writable:!0,value:""}),_text_size.set(_assertThisInitialized(e),{writable:!0,value:""}),_video.set(_assertThisInitialized(e),{writable:!0,value:""}),e.windows=new _common.CMIArray({errorCode:scorm12_error_codes.INVALID_SET_VALUE,children:""}),e}_inherits(t,e);var i=_createSuper(t);return _createClass(t,[{key:"initialize",value:function(){var e;_get(_getPrototypeOf(t.prototype),"initialize",this).call(this),null===(e=this.windows)||void 0===e||e.initialize()}},{key:"lesson_type",get:function(){return _classPrivateFieldGet(this,_lesson_type)},set:function(e){(0,Scorm12CMI.check12ValidFormat)(e,aicc_regex.CMIString256)&&_classPrivateFieldSet(this,_lesson_type,e)}},{key:"text_color",get:function(){return _classPrivateFieldGet(this,_text_color)},set:function(e){(0,Scorm12CMI.check12ValidFormat)(e,aicc_regex.CMIString256)&&_classPrivateFieldSet(this,_text_color,e)}},{key:"text_location",get:function(){return _classPrivateFieldGet(this,_text_location)},set:function(e){(0,Scorm12CMI.check12ValidFormat)(e,aicc_regex.CMIString256)&&_classPrivateFieldSet(this,_text_location,e)}},{key:"text_size",get:function(){return _classPrivateFieldGet(this,_text_size)},set:function(e){(0,Scorm12CMI.check12ValidFormat)(e,aicc_regex.CMIString256)&&_classPrivateFieldSet(this,_text_size,e)}},{key:"video",get:function(){return _classPrivateFieldGet(this,_video)},set:function(e){(0,Scorm12CMI.check12ValidFormat)(e,aicc_regex.CMIString256)&&_classPrivateFieldSet(this,_video,e)}},{key:"toJSON",value: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}(Scorm12CMI.CMIStudentPreference),_tries_during_lesson=new WeakMap,AICCCMIStudentData=function(e){function t(){var e;return _classCallCheck(this,t),e=i.call(this,aicc_constants.student_data_children),_tries_during_lesson.set(_assertThisInitialized(e),{writable:!0,value:""}),e.tries=new CMITries,e}_inherits(t,e);var i=_createSuper(t);return _createClass(t,[{key:"initialize",value:function(){var e;_get(_getPrototypeOf(t.prototype),"initialize",this).call(this),null===(e=this.tries)||void 0===e||e.initialize()}},{key:"tries_during_lesson",get:function(){return _classPrivateFieldGet(this,_tries_during_lesson)},set:function(e){this.initialized?(0,Scorm12CMI.throwReadOnlyError)():_classPrivateFieldSet(this,_tries_during_lesson,e)}},{key:"toJSON",value: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};return delete this.jsonString,e}}]),t}(Scorm12CMI.CMIStudentData),_children=new WeakMap,_city=new WeakMap,_class=new WeakMap,_company=new WeakMap,_country=new WeakMap,_experience=new WeakMap,_familiar_name=new WeakMap,_instructor_name=new WeakMap,_title=new WeakMap,_native_language=new WeakMap,_state=new WeakMap,_street_address=new WeakMap,_telephone=new WeakMap,_years_experience=new WeakMap,CMIStudentDemographics=function(e){function t(){var e;return _classCallCheck(this,t),e=i.call(this),_children.set(_assertThisInitialized(e),{writable:!0,value:aicc_constants.student_demographics_children}),_city.set(_assertThisInitialized(e),{writable:!0,value:""}),_class.set(_assertThisInitialized(e),{writable:!0,value:""}),_company.set(_assertThisInitialized(e),{writable:!0,value:""}),_country.set(_assertThisInitialized(e),{writable:!0,value:""}),_experience.set(_assertThisInitialized(e),{writable:!0,value:""}),_familiar_name.set(_assertThisInitialized(e),{writable:!0,value:""}),_instructor_name.set(_assertThisInitialized(e),{writable:!0,value:""}),_title.set(_assertThisInitialized(e),{writable:!0,value:""}),_native_language.set(_assertThisInitialized(e),{writable:!0,value:""}),_state.set(_assertThisInitialized(e),{writable:!0,value:""}),_street_address.set(_assertThisInitialized(e),{writable:!0,value:""}),_telephone.set(_assertThisInitialized(e),{writable:!0,value:""}),_years_experience.set(_assertThisInitialized(e),{writable:!0,value:""}),e}_inherits(t,e);var i=_createSuper(t);return _createClass(t,[{key:"city",get:function(){return _classPrivateFieldGet(this,_city)},set:function(e){this.initialized?(0,Scorm12CMI.throwReadOnlyError)():_classPrivateFieldSet(this,_city,e)}},{key:"class",get:function(){return _classPrivateFieldGet(this,_class)},set:function(e){this.initialized?(0,Scorm12CMI.throwReadOnlyError)():_classPrivateFieldSet(this,_class,e)}},{key:"company",get:function(){return _classPrivateFieldGet(this,_company)},set:function(e){this.initialized?(0,Scorm12CMI.throwReadOnlyError)():_classPrivateFieldSet(this,_company,e)}},{key:"country",get:function(){return _classPrivateFieldGet(this,_country)},set:function(e){this.initialized?(0,Scorm12CMI.throwReadOnlyError)():_classPrivateFieldSet(this,_country,e)}},{key:"experience",get:function(){return _classPrivateFieldGet(this,_experience)},set:function(e){this.initialized?(0,Scorm12CMI.throwReadOnlyError)():_classPrivateFieldSet(this,_experience,e)}},{key:"familiar_name",get:function(){return _classPrivateFieldGet(this,_familiar_name)},set:function(e){this.initialized?(0,Scorm12CMI.throwReadOnlyError)():_classPrivateFieldSet(this,_familiar_name,e)}},{key:"instructor_name",get:function(){return _classPrivateFieldGet(this,_instructor_name)},set:function(e){this.initialized?(0,Scorm12CMI.throwReadOnlyError)():_classPrivateFieldSet(this,_instructor_name,e)}},{key:"title",get:function(){return _classPrivateFieldGet(this,_title)},set:function(e){this.initialized?(0,Scorm12CMI.throwReadOnlyError)():_classPrivateFieldSet(this,_title,e)}},{key:"native_language",get:function(){return _classPrivateFieldGet(this,_native_language)},set:function(e){this.initialized?(0,Scorm12CMI.throwReadOnlyError)():_classPrivateFieldSet(this,_native_language,e)}},{key:"state",get:function(){return _classPrivateFieldGet(this,_state)},set:function(e){this.initialized?(0,Scorm12CMI.throwReadOnlyError)():_classPrivateFieldSet(this,_state,e)}},{key:"street_address",get:function(){return _classPrivateFieldGet(this,_street_address)},set:function(e){this.initialized?(0,Scorm12CMI.throwReadOnlyError)():_classPrivateFieldSet(this,_street_address,e)}},{key:"telephone",get:function(){return _classPrivateFieldGet(this,_telephone)},set:function(e){this.initialized?(0,Scorm12CMI.throwReadOnlyError)():_classPrivateFieldSet(this,_telephone,e)}},{key:"years_experience",get:function(){return _classPrivateFieldGet(this,_years_experience)},set:function(e){this.initialized?(0,Scorm12CMI.throwReadOnlyError)():_classPrivateFieldSet(this,_years_experience,e)}},{key:"toJSON",value: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}(_common.BaseCMI);exports.CMIStudentDemographics=CMIStudentDemographics;var CMIPaths=function(e){function t(){return _classCallCheck(this,t),i.call(this,aicc_constants.paths_children)}_inherits(t,e);var i=_createSuper(t);return t}(_common.CMIArray);exports.CMIPaths=CMIPaths;var _location_id=new WeakMap,_date=new WeakMap,_time=new WeakMap,_status=new WeakMap,_why_left=new WeakMap,_time_in_element=new WeakMap,CMIPathsObject=function(e){function t(){var e;return _classCallCheck(this,t),e=i.call(this),_location_id.set(_assertThisInitialized(e),{writable:!0,value:""}),_date.set(_assertThisInitialized(e),{writable:!0,value:""}),_time.set(_assertThisInitialized(e),{writable:!0,value:""}),_status.set(_assertThisInitialized(e),{writable:!0,value:""}),_why_left.set(_assertThisInitialized(e),{writable:!0,value:""}),_time_in_element.set(_assertThisInitialized(e),{writable:!0,value:""}),e}_inherits(t,e);var i=_createSuper(t);return _createClass(t,[{key:"location_id",get:function(){return _classPrivateFieldGet(this,_location_id)},set:function(e){(0,Scorm12CMI.check12ValidFormat)(e,aicc_regex.CMIString256)&&_classPrivateFieldSet(this,_location_id,e)}},{key:"date",get:function(){return _classPrivateFieldGet(this,_date)},set:function(e){(0,Scorm12CMI.check12ValidFormat)(e,aicc_regex.CMIString256)&&_classPrivateFieldSet(this,_date,e)}},{key:"time",get:function(){return _classPrivateFieldGet(this,_time)},set:function(e){(0,Scorm12CMI.check12ValidFormat)(e,aicc_regex.CMITime)&&_classPrivateFieldSet(this,_time,e)}},{key:"status",get:function(){return _classPrivateFieldGet(this,_status)},set:function(e){(0,Scorm12CMI.check12ValidFormat)(e,aicc_regex.CMIStatus2)&&_classPrivateFieldSet(this,_status,e)}},{key:"why_left",get:function(){return _classPrivateFieldGet(this,_why_left)},set:function(e){(0,Scorm12CMI.check12ValidFormat)(e,aicc_regex.CMIString256)&&_classPrivateFieldSet(this,_why_left,e)}},{key:"time_in_element",get:function(){return _classPrivateFieldGet(this,_time_in_element)},set:function(e){(0,Scorm12CMI.check12ValidFormat)(e,aicc_regex.CMITime)&&_classPrivateFieldSet(this,_time_in_element,e)}},{key:"toJSON",value: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}(_common.BaseCMI);exports.CMIPathsObject=CMIPathsObject;var CMITries=function(e){function t(){return _classCallCheck(this,t),i.call(this,aicc_constants.tries_children)}_inherits(t,e);var i=_createSuper(t);return t}(_common.CMIArray);exports.CMITries=CMITries;var _status2=new WeakMap,_time2=new WeakMap,CMITriesObject=function(e){function t(){var e;return _classCallCheck(this,t),e=i.call(this),_status2.set(_assertThisInitialized(e),{writable:!0,value:""}),_time2.set(_assertThisInitialized(e),{writable:!0,value:""}),e.score=new _common.CMIScore({score_children:aicc_constants.score_children,score_range:aicc_regex.score_range,invalidErrorCode:scorm12_error_codes.INVALID_SET_VALUE,invalidTypeCode:scorm12_error_codes.TYPE_MISMATCH,invalidRangeCode:scorm12_error_codes.VALUE_OUT_OF_RANGE}),e}_inherits(t,e);var i=_createSuper(t);return _createClass(t,[{key:"initialize",value:function(){var e;_get(_getPrototypeOf(t.prototype),"initialize",this).call(this),null===(e=this.score)||void 0===e||e.initialize()}},{key:"status",get:function(){return _classPrivateFieldGet(this,_status2)},set:function(e){(0,Scorm12CMI.check12ValidFormat)(e,aicc_regex.CMIStatus2)&&_classPrivateFieldSet(this,_status2,e)}},{key:"time",get:function(){return _classPrivateFieldGet(this,_time2)},set:function(e){(0,Scorm12CMI.check12ValidFormat)(e,aicc_regex.CMITime)&&_classPrivateFieldSet(this,_time2,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={status:this.status,time:this.time,score:this.score};return delete this.jsonString,e}}]),t}(_common.BaseCMI);exports.CMITriesObject=CMITriesObject;var CMIAttemptRecords=function(e){function t(){return _classCallCheck(this,t),i.call(this,aicc_constants.attempt_records_children)}_inherits(t,e);var i=_createSuper(t);return t}(_common.CMIArray);exports.CMIAttemptRecords=CMIAttemptRecords;var _lesson_status=new WeakMap,CMIAttemptRecordsObject=function(e){function t(){var e;return _classCallCheck(this,t),e=i.call(this),_lesson_status.set(_assertThisInitialized(e),{writable:!0,value:""}),e.score=new _common.CMIScore({score_children:aicc_constants.score_children,score_range:aicc_regex.score_range,invalidErrorCode:scorm12_error_codes.INVALID_SET_VALUE,invalidTypeCode:scorm12_error_codes.TYPE_MISMATCH,invalidRangeCode:scorm12_error_codes.VALUE_OUT_OF_RANGE}),e}_inherits(t,e);var i=_createSuper(t);return _createClass(t,[{key:"initialize",value:function(){var e;_get(_getPrototypeOf(t.prototype),"initialize",this).call(this),null===(e=this.score)||void 0===e||e.initialize()}},{key:"lesson_status",get:function(){return _classPrivateFieldGet(this,_lesson_status)},set:function(e){(0,Scorm12CMI.check12ValidFormat)(e,aicc_regex.CMIStatus2)&&_classPrivateFieldSet(this,_lesson_status,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={lesson_status:this.lesson_status,score:this.score};return delete this.jsonString,e}}]),t}(_common.BaseCMI);exports.CMIAttemptRecordsObject=CMIAttemptRecordsObject;var _content=new WeakMap,_location=new WeakMap,_time3=new WeakMap,CMIEvaluationCommentsObject=function(e){function t(){var e;return _classCallCheck(this,t),e=i.call(this),_content.set(_assertThisInitialized(e),{writable:!0,value:""}),_location.set(_assertThisInitialized(e),{writable:!0,value:""}),_time3.set(_assertThisInitialized(e),{writable:!0,value:""}),e}_inherits(t,e);var i=_createSuper(t);return _createClass(t,[{key:"content",get:function(){return _classPrivateFieldGet(this,_content)},set:function(e){(0,Scorm12CMI.check12ValidFormat)(e,aicc_regex.CMIString256)&&_classPrivateFieldSet(this,_content,e)}},{key:"location",get:function(){return _classPrivateFieldGet(this,_location)},set:function(e){(0,Scorm12CMI.check12ValidFormat)(e,aicc_regex.CMIString256)&&_classPrivateFieldSet(this,_location,e)}},{key:"time",get:function(){return _classPrivateFieldGet(this,_time3)},set:function(e){(0,Scorm12CMI.check12ValidFormat)(e,aicc_regex.CMITime)&&_classPrivateFieldSet(this,_time3,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={content:this.content,location:this.location,time:this.time};return delete this.jsonString,e}}]),t}(_common.BaseCMI);exports.CMIEvaluationCommentsObject=CMIEvaluationCommentsObject;
16
- },{"../constants/api_constants":10,"../constants/error_codes":11,"../constants/regex":13,"./common":7,"./scorm12_cmi":8}],7:[function(require,module,exports){
17
- "use strict";function _typeof(e){"@babel/helpers - typeof";return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var i,r=_getPrototypeOf(e);if(t){var a=_getPrototypeOf(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return _possibleConstructorReturn(this,i)}}function _possibleConstructorReturn(e,t){return!t||"object"!==_typeof(t)&&"function"!=typeof t?_assertThisInitialized(e):t}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _createClass(e,t,i){return t&&_defineProperties(e.prototype,t),i&&_defineProperties(e,i),e}function _defineProperty(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _classPrivateFieldSet(e,t,i){return _classApplyDescriptorSet(e,_classExtractFieldDescriptor(e,t,"set"),i),i}function _classApplyDescriptorSet(e,t,i){if(t.set)t.set.call(e,i);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=i}}function _classPrivateFieldGet(e,t){return _classApplyDescriptorGet(e,_classExtractFieldDescriptor(e,t,"get"))}function _classExtractFieldDescriptor(e,t,i){if(!t.has(e))throw new TypeError("attempted to "+i+" private field on non-instance");return t.get(e)}function _classApplyDescriptorGet(e,t){return t.get?t.get.call(e):t.value}function checkValidFormat(e,t,i,r){var a=new RegExp(t),s=e.match(a);if(r&&""===e)return!0;if(void 0===e||!s||""===s[0])throw new _exceptions.ValidationError(i);return!0}function checkValidRange(e,t,i){var r=t.split("#");if((e*=1)>=r[0]){if("*"===r[1]||e<=r[1])return!0;throw new _exceptions.ValidationError(i)}throw new _exceptions.ValidationError(i)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.checkValidFormat=checkValidFormat,exports.checkValidRange=checkValidRange,exports.CMIArray=exports.CMIScore=exports.BaseCMI=void 0;var _api_constants=_interopRequireDefault(require("../constants/api_constants")),_error_codes=_interopRequireDefault(require("../constants/error_codes")),_exceptions=require("../exceptions"),_regex=_interopRequireDefault(require("../constants/regex")),scorm12_constants=_api_constants.default.scorm12,scorm12_regex=_regex.default.scorm12,scorm12_error_codes=_error_codes.default.scorm12,_initialized=new WeakMap,_start_time=new WeakMap,BaseCMI=function(){function e(){if(_classCallCheck(this,e),_defineProperty(this,"jsonString",!1),_initialized.set(this,{writable:!0,value:!1}),_start_time.set(this,{writable:!0,value:void 0}),(this instanceof e?this.constructor:void 0)===e)throw new TypeError("Cannot construct BaseCMI instances directly")}return _createClass(e,[{key:"initialized",get:function(){return _classPrivateFieldGet(this,_initialized)}},{key:"start_time",get:function(){return _classPrivateFieldGet(this,_start_time)}},{key:"initialize",value:function(){_classPrivateFieldSet(this,_initialized,!0)}},{key:"setStartTime",value:function(){_classPrivateFieldSet(this,_start_time,(new Date).getTime())}}]),e}();exports.BaseCMI=BaseCMI;var _children2=new WeakMap,_score_range=new WeakMap,_invalid_error_code=new WeakMap,_invalid_type_code=new WeakMap,_invalid_range_code=new WeakMap,_decimal_regex=new WeakMap,_raw=new WeakMap,_min=new WeakMap,_max=new WeakMap,CMIScore=function(e){function t(e){var r,a=e.score_children,s=e.score_range,n=e.max,o=e.invalidErrorCode,l=e.invalidTypeCode,c=e.invalidRangeCode,_=e.decimalRegex;return _classCallCheck(this,t),r=i.call(this),_children2.set(_assertThisInitialized(r),{writable:!0,value:void 0}),_score_range.set(_assertThisInitialized(r),{writable:!0,value:void 0}),_invalid_error_code.set(_assertThisInitialized(r),{writable:!0,value:void 0}),_invalid_type_code.set(_assertThisInitialized(r),{writable:!0,value:void 0}),_invalid_range_code.set(_assertThisInitialized(r),{writable:!0,value:void 0}),_decimal_regex.set(_assertThisInitialized(r),{writable:!0,value:void 0}),_raw.set(_assertThisInitialized(r),{writable:!0,value:""}),_min.set(_assertThisInitialized(r),{writable:!0,value:""}),_max.set(_assertThisInitialized(r),{writable:!0,value:void 0}),_classPrivateFieldSet(_assertThisInitialized(r),_children2,a||scorm12_constants.score_children),_classPrivateFieldSet(_assertThisInitialized(r),_score_range,!!s&&scorm12_regex.score_range),_classPrivateFieldSet(_assertThisInitialized(r),_max,n||""===n?n:"100"),_classPrivateFieldSet(_assertThisInitialized(r),_invalid_error_code,o||scorm12_error_codes.INVALID_SET_VALUE),_classPrivateFieldSet(_assertThisInitialized(r),_invalid_type_code,l||scorm12_error_codes.TYPE_MISMATCH),_classPrivateFieldSet(_assertThisInitialized(r),_invalid_range_code,c||scorm12_error_codes.VALUE_OUT_OF_RANGE),_classPrivateFieldSet(_assertThisInitialized(r),_decimal_regex,_||scorm12_regex.CMIDecimal),r}_inherits(t,e);var i=_createSuper(t);return _createClass(t,[{key:"_children",get:function(){return _classPrivateFieldGet(this,_children2)},set:function(e){throw new _exceptions.ValidationError(_classPrivateFieldGet(this,_invalid_error_code))}},{key:"raw",get:function(){return _classPrivateFieldGet(this,_raw)},set:function(e){!checkValidFormat(e,_classPrivateFieldGet(this,_decimal_regex),_classPrivateFieldGet(this,_invalid_type_code))||_classPrivateFieldGet(this,_score_range)&&!checkValidRange(e,_classPrivateFieldGet(this,_score_range),_classPrivateFieldGet(this,_invalid_range_code))||_classPrivateFieldSet(this,_raw,e)}},{key:"min",get:function(){return _classPrivateFieldGet(this,_min)},set:function(e){!checkValidFormat(e,_classPrivateFieldGet(this,_decimal_regex),_classPrivateFieldGet(this,_invalid_type_code))||_classPrivateFieldGet(this,_score_range)&&!checkValidRange(e,_classPrivateFieldGet(this,_score_range),_classPrivateFieldGet(this,_invalid_range_code))||_classPrivateFieldSet(this,_min,e)}},{key:"max",get:function(){return _classPrivateFieldGet(this,_max)},set:function(e){!checkValidFormat(e,_classPrivateFieldGet(this,_decimal_regex),_classPrivateFieldGet(this,_invalid_type_code))||_classPrivateFieldGet(this,_score_range)&&!checkValidRange(e,_classPrivateFieldGet(this,_score_range),_classPrivateFieldGet(this,_invalid_range_code))||_classPrivateFieldSet(this,_max,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={raw:this.raw,min:this.min,max:this.max};return delete this.jsonString,e}}]),t}(BaseCMI);exports.CMIScore=CMIScore;var _errorCode=new WeakMap,_children3=new WeakMap,CMIArray=function(e){function t(e){var r,a=e.children,s=e.errorCode;return _classCallCheck(this,t),r=i.call(this),_errorCode.set(_assertThisInitialized(r),{writable:!0,value:void 0}),_children3.set(_assertThisInitialized(r),{writable:!0,value:void 0}),_classPrivateFieldSet(_assertThisInitialized(r),_children3,a),_classPrivateFieldSet(_assertThisInitialized(r),_errorCode,s),r.childArray=[],r}_inherits(t,e);var i=_createSuper(t);return _createClass(t,[{key:"_children",get:function(){return _classPrivateFieldGet(this,_children3)},set:function(e){throw new _exceptions.ValidationError(_classPrivateFieldGet(this,_errorCode))}},{key:"_count",get:function(){return this.childArray.length},set:function(e){throw new _exceptions.ValidationError(_classPrivateFieldGet(this,_errorCode))}},{key:"toJSON",value:function(){this.jsonString=!0;for(var e={},t=0;t<this.childArray.length;t++)e[t+""]=this.childArray[t];return delete this.jsonString,e}}]),t}(BaseCMI);exports.CMIArray=CMIArray;
18
- },{"../constants/api_constants":10,"../constants/error_codes":11,"../constants/regex":13,"../exceptions":15}],8:[function(require,module,exports){
19
- "use strict";function _typeof(e){"@babel/helpers - typeof";return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function(){return e},e}function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!==_typeof(e)&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var n=r?Object.getOwnPropertyDescriptor(e,s):null;n&&(n.get||n.set)?Object.defineProperty(i,s,n):i[s]=e[s]}return i.default=e,t&&t.set(e,i),i}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _createClass(e,t,i){return t&&_defineProperties(e.prototype,t),i&&_defineProperties(e,i),e}function _get(e,t,i){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,i){var r=_superPropBase(e,t);if(r){var s=Object.getOwnPropertyDescriptor(r,t);return s.get?s.get.call(i):s.value}})(e,t,i||e)}function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf(e)););return e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var i,r=_getPrototypeOf(e);if(t){var s=_getPrototypeOf(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return _possibleConstructorReturn(this,i)}}function _possibleConstructorReturn(e,t){return!t||"object"!==_typeof(t)&&"function"!=typeof t?_assertThisInitialized(e):t}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _defineProperty(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _classPrivateFieldGet(e,t){return _classApplyDescriptorGet(e,_classExtractFieldDescriptor(e,t,"get"))}function _classApplyDescriptorGet(e,t){return t.get?t.get.call(e):t.value}function _classPrivateFieldSet(e,t,i){return _classApplyDescriptorSet(e,_classExtractFieldDescriptor(e,t,"set"),i),i}function _classExtractFieldDescriptor(e,t,i){if(!t.has(e))throw new TypeError("attempted to "+i+" private field on non-instance");return t.get(e)}function _classApplyDescriptorSet(e,t,i){if(t.set)t.set.call(e,i);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=i}}function throwReadOnlyError(){throw new _exceptions.ValidationError(scorm12_error_codes.READ_ONLY_ELEMENT)}function throwWriteOnlyError(){throw new _exceptions.ValidationError(scorm12_error_codes.WRITE_ONLY_ELEMENT)}function throwInvalidValueError(){throw new _exceptions.ValidationError(scorm12_error_codes.INVALID_SET_VALUE)}function check12ValidFormat(e,t,i){return(0,_common.checkValidFormat)(e,t,scorm12_error_codes.TYPE_MISMATCH,i)}function check12ValidRange(e,t,i){return(0,_common.checkValidRange)(e,t,scorm12_error_codes.VALUE_OUT_OF_RANGE,i)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.throwReadOnlyError=throwReadOnlyError,exports.throwWriteOnlyError=throwWriteOnlyError,exports.check12ValidFormat=check12ValidFormat,exports.check12ValidRange=check12ValidRange,exports.NAV=exports.CMIInteractionsCorrectResponsesObject=exports.CMIInteractionsObjectivesObject=exports.CMIObjectivesObject=exports.CMIInteractionsObject=exports.CMIStudentPreference=exports.CMIStudentData=exports.CMI=void 0;var _common=require("./common"),_api_constants=_interopRequireDefault(require("../constants/api_constants")),_error_codes=_interopRequireDefault(require("../constants/error_codes")),_regex=_interopRequireDefault(require("../constants/regex")),_exceptions=require("../exceptions"),Utilities=_interopRequireWildcard(require("../utilities")),Util=Utilities,scorm12_constants=_api_constants.default.scorm12,scorm12_regex=_regex.default.scorm12,scorm12_error_codes=_error_codes.default.scorm12,_children2=new WeakMap,_version2=new WeakMap,_launch_data=new WeakMap,_comments=new WeakMap,_comments_from_lms=new WeakMap,CMI=function(e){function t(e,r,s){var n;return _classCallCheck(this,t),n=i.call(this),_children2.set(_assertThisInitialized(n),{writable:!0,value:""}),_version2.set(_assertThisInitialized(n),{writable:!0,value:"3.4"}),_launch_data.set(_assertThisInitialized(n),{writable:!0,value:""}),_comments.set(_assertThisInitialized(n),{writable:!0,value:""}),_comments_from_lms.set(_assertThisInitialized(n),{writable:!0,value:""}),_defineProperty(_assertThisInitialized(n),"student_data",null),s&&n.initialize(),_classPrivateFieldSet(_assertThisInitialized(n),_children2,e||scorm12_constants.cmi_children),n.core=new CMICore,n.objectives=new CMIObjectives,n.student_data=r||new CMIStudentData,n.student_preference=new CMIStudentPreference,n.interactions=new CMIInteractions,n}_inherits(t,e);var i=_createSuper(t);return _createClass(t,[{key:"initialize",value:function(){var e,i,r,s,n;_get(_getPrototypeOf(t.prototype),"initialize",this).call(this),null===(e=this.core)||void 0===e||e.initialize(),null===(i=this.objectives)||void 0===i||i.initialize(),null===(r=this.student_data)||void 0===r||r.initialize(),null===(s=this.student_preference)||void 0===s||s.initialize(),null===(n=this.interactions)||void 0===n||n.initialize()}},{key:"toJSON",value: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}},{key:"_version",get:function(){return _classPrivateFieldGet(this,_version2)},set:function(e){throwInvalidValueError()}},{key:"_children",get:function(){return _classPrivateFieldGet(this,_children2)},set:function(e){throwInvalidValueError()}},{key:"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)}},{key:"launch_data",get:function(){return _classPrivateFieldGet(this,_launch_data)},set:function(e){this.initialized?throwReadOnlyError():_classPrivateFieldSet(this,_launch_data,e)}},{key:"comments",get:function(){return _classPrivateFieldGet(this,_comments)},set:function(e){check12ValidFormat(e,scorm12_regex.CMIString4096,!0)&&_classPrivateFieldSet(this,_comments,e)}},{key:"comments_from_lms",get:function(){return _classPrivateFieldGet(this,_comments_from_lms)},set:function(e){this.initialized?throwReadOnlyError():_classPrivateFieldSet(this,_comments_from_lms,e)}},{key:"getCurrentTotalTime",value:function(){return this.core.getCurrentTotalTime(this.start_time)}}]),t}(_common.BaseCMI);exports.CMI=CMI;var _children3=new WeakMap,_student_id=new WeakMap,_student_name=new WeakMap,_lesson_location=new WeakMap,_credit=new WeakMap,_lesson_status=new WeakMap,_entry=new WeakMap,_total_time=new WeakMap,_lesson_mode=new WeakMap,_exit=new WeakMap,_session_time=new WeakMap,_suspend_data=new WeakMap,CMICore=function(e){function t(){var e;return _classCallCheck(this,t),e=i.call(this),_children3.set(_assertThisInitialized(e),{writable:!0,value:scorm12_constants.core_children}),_student_id.set(_assertThisInitialized(e),{writable:!0,value:""}),_student_name.set(_assertThisInitialized(e),{writable:!0,value:""}),_lesson_location.set(_assertThisInitialized(e),{writable:!0,value:""}),_credit.set(_assertThisInitialized(e),{writable:!0,value:""}),_lesson_status.set(_assertThisInitialized(e),{writable:!0,value:"not attempted"}),_entry.set(_assertThisInitialized(e),{writable:!0,value:""}),_total_time.set(_assertThisInitialized(e),{writable:!0,value:""}),_lesson_mode.set(_assertThisInitialized(e),{writable:!0,value:"normal"}),_exit.set(_assertThisInitialized(e),{writable:!0,value:""}),_session_time.set(_assertThisInitialized(e),{writable:!0,value:"00:00:00"}),_suspend_data.set(_assertThisInitialized(e),{writable:!0,value:""}),e.score=new _common.CMIScore({score_children:scorm12_constants.score_children,score_range:scorm12_regex.score_range,invalidErrorCode:scorm12_error_codes.INVALID_SET_VALUE,invalidTypeCode:scorm12_error_codes.TYPE_MISMATCH,invalidRangeCode:scorm12_error_codes.VALUE_OUT_OF_RANGE}),e}_inherits(t,e);var i=_createSuper(t);return _createClass(t,[{key:"initialize",value:function(){var e;_get(_getPrototypeOf(t.prototype),"initialize",this).call(this),null===(e=this.score)||void 0===e||e.initialize()}},{key:"_children",get:function(){return _classPrivateFieldGet(this,_children3)},set:function(e){throwInvalidValueError()}},{key:"student_id",get:function(){return _classPrivateFieldGet(this,_student_id)},set:function(e){this.initialized?throwReadOnlyError():_classPrivateFieldSet(this,_student_id,e)}},{key:"student_name",get:function(){return _classPrivateFieldGet(this,_student_name)},set:function(e){this.initialized?throwReadOnlyError():_classPrivateFieldSet(this,_student_name,e)}},{key:"lesson_location",get:function(){return _classPrivateFieldGet(this,_lesson_location)},set:function(e){check12ValidFormat(e,scorm12_regex.CMIString256,!0)&&_classPrivateFieldSet(this,_lesson_location,e)}},{key:"credit",get:function(){return _classPrivateFieldGet(this,_credit)},set:function(e){this.initialized?throwReadOnlyError():_classPrivateFieldSet(this,_credit,e)}},{key:"lesson_status",get:function(){return _classPrivateFieldGet(this,_lesson_status)},set:function(e){this.initialized?check12ValidFormat(e,scorm12_regex.CMIStatus)&&_classPrivateFieldSet(this,_lesson_status,e):check12ValidFormat(e,scorm12_regex.CMIStatus2)&&_classPrivateFieldSet(this,_lesson_status,e)}},{key:"entry",get:function(){return _classPrivateFieldGet(this,_entry)},set:function(e){this.initialized?throwReadOnlyError():_classPrivateFieldSet(this,_entry,e)}},{key:"total_time",get:function(){return _classPrivateFieldGet(this,_total_time)},set:function(e){this.initialized?throwReadOnlyError():_classPrivateFieldSet(this,_total_time,e)}},{key:"lesson_mode",get:function(){return _classPrivateFieldGet(this,_lesson_mode)},set:function(e){this.initialized?throwReadOnlyError():_classPrivateFieldSet(this,_lesson_mode,e)}},{key:"exit",get:function(){return this.jsonString?_classPrivateFieldGet(this,_exit):throwWriteOnlyError()},set:function(e){check12ValidFormat(e,scorm12_regex.CMIExit,!0)&&_classPrivateFieldSet(this,_exit,e)}},{key:"session_time",get:function(){return this.jsonString?_classPrivateFieldGet(this,_session_time):throwWriteOnlyError()},set:function(e){check12ValidFormat(e,scorm12_regex.CMITimespan)&&_classPrivateFieldSet(this,_session_time,e)}},{key:"suspend_data",get:function(){return _classPrivateFieldGet(this,_suspend_data)},set:function(e){check12ValidFormat(e,scorm12_regex.CMIString4096,!0)&&_classPrivateFieldSet(this,_suspend_data,e)}},{key:"getCurrentTotalTime",value:function(e){var t=_classPrivateFieldGet(this,_session_time),i=e;if(void 0!==i&&null!==i){var r=(new Date).getTime()-i;t=Util.getSecondsAsHHMMSS(r/1e3)}return Utilities.addHHMMSSTimeStrings(_classPrivateFieldGet(this,_total_time),t,new RegExp(scorm12_regex.CMITimespan))}},{key:"toJSON",value: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}(_common.BaseCMI),CMIObjectives=function(e){function t(){return _classCallCheck(this,t),i.call(this,{children:scorm12_constants.objectives_children,errorCode:scorm12_error_codes.INVALID_SET_VALUE})}_inherits(t,e);var i=_createSuper(t);return t}(_common.CMIArray),_children4=new WeakMap,_mastery_score=new WeakMap,_max_time_allowed=new WeakMap,_time_limit_action=new WeakMap,CMIStudentData=function(e){function t(e){var r;return _classCallCheck(this,t),r=i.call(this),_children4.set(_assertThisInitialized(r),{writable:!0,value:void 0}),_mastery_score.set(_assertThisInitialized(r),{writable:!0,value:""}),_max_time_allowed.set(_assertThisInitialized(r),{writable:!0,value:""}),_time_limit_action.set(_assertThisInitialized(r),{writable:!0,value:""}),_classPrivateFieldSet(_assertThisInitialized(r),_children4,e||scorm12_constants.student_data_children),r}_inherits(t,e);var i=_createSuper(t);return _createClass(t,[{key:"_children",get:function(){return _classPrivateFieldGet(this,_children4)},set:function(e){throwInvalidValueError()}},{key:"mastery_score",get:function(){return _classPrivateFieldGet(this,_mastery_score)},set:function(e){this.initialized?throwReadOnlyError():_classPrivateFieldSet(this,_mastery_score,e)}},{key:"max_time_allowed",get:function(){return _classPrivateFieldGet(this,_max_time_allowed)},set:function(e){this.initialized?throwReadOnlyError():_classPrivateFieldSet(this,_max_time_allowed,e)}},{key:"time_limit_action",get:function(){return _classPrivateFieldGet(this,_time_limit_action)},set:function(e){this.initialized?throwReadOnlyError():_classPrivateFieldSet(this,_time_limit_action,e)}},{key:"toJSON",value: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}(_common.BaseCMI);exports.CMIStudentData=CMIStudentData;var _children5=new WeakMap,_audio=new WeakMap,_language=new WeakMap,_speed=new WeakMap,_text=new WeakMap,CMIStudentPreference=function(e){function t(e){var r;return _classCallCheck(this,t),r=i.call(this),_children5.set(_assertThisInitialized(r),{writable:!0,value:void 0}),_audio.set(_assertThisInitialized(r),{writable:!0,value:""}),_language.set(_assertThisInitialized(r),{writable:!0,value:""}),_speed.set(_assertThisInitialized(r),{writable:!0,value:""}),_text.set(_assertThisInitialized(r),{writable:!0,value:""}),_classPrivateFieldSet(_assertThisInitialized(r),_children5,e||scorm12_constants.student_preference_children),r}_inherits(t,e);var i=_createSuper(t);return _createClass(t,[{key:"_children",get:function(){return _classPrivateFieldGet(this,_children5)},set:function(e){throwInvalidValueError()}},{key:"audio",get:function(){return _classPrivateFieldGet(this,_audio)},set:function(e){check12ValidFormat(e,scorm12_regex.CMISInteger)&&check12ValidRange(e,scorm12_regex.audio_range)&&_classPrivateFieldSet(this,_audio,e)}},{key:"language",get:function(){return _classPrivateFieldGet(this,_language)},set:function(e){check12ValidFormat(e,scorm12_regex.CMIString256)&&_classPrivateFieldSet(this,_language,e)}},{key:"speed",get:function(){return _classPrivateFieldGet(this,_speed)},set:function(e){check12ValidFormat(e,scorm12_regex.CMISInteger)&&check12ValidRange(e,scorm12_regex.speed_range)&&_classPrivateFieldSet(this,_speed,e)}},{key:"text",get:function(){return _classPrivateFieldGet(this,_text)},set:function(e){check12ValidFormat(e,scorm12_regex.CMISInteger)&&check12ValidRange(e,scorm12_regex.text_range)&&_classPrivateFieldSet(this,_text,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,speed:this.speed,text:this.text};return delete this.jsonString,e}}]),t}(_common.BaseCMI);exports.CMIStudentPreference=CMIStudentPreference;var CMIInteractions=function(e){function t(){return _classCallCheck(this,t),i.call(this,{children:scorm12_constants.interactions_children,errorCode:scorm12_error_codes.INVALID_SET_VALUE})}_inherits(t,e);var i=_createSuper(t);return t}(_common.CMIArray),_id=new WeakMap,_time=new WeakMap,_type=new WeakMap,_weighting=new WeakMap,_student_response=new WeakMap,_result=new WeakMap,_latency=new WeakMap,CMIInteractionsObject=function(e){function t(){var e;return _classCallCheck(this,t),e=i.call(this),_id.set(_assertThisInitialized(e),{writable:!0,value:""}),_time.set(_assertThisInitialized(e),{writable:!0,value:""}),_type.set(_assertThisInitialized(e),{writable:!0,value:""}),_weighting.set(_assertThisInitialized(e),{writable:!0,value:""}),_student_response.set(_assertThisInitialized(e),{writable:!0,value:""}),_result.set(_assertThisInitialized(e),{writable:!0,value:""}),_latency.set(_assertThisInitialized(e),{writable:!0,value:""}),e.objectives=new _common.CMIArray({errorCode:scorm12_error_codes.INVALID_SET_VALUE,children:scorm12_constants.objectives_children}),e.correct_responses=new _common.CMIArray({errorCode:scorm12_error_codes.INVALID_SET_VALUE,children:scorm12_constants.correct_responses_children}),e}_inherits(t,e);var i=_createSuper(t);return _createClass(t,[{key:"initialize",value:function(){var e,i;_get(_getPrototypeOf(t.prototype),"initialize",this).call(this),null===(e=this.objectives)||void 0===e||e.initialize(),null===(i=this.correct_responses)||void 0===i||i.initialize()}},{key:"id",get:function(){return this.jsonString?_classPrivateFieldGet(this,_id):throwWriteOnlyError()},set:function(e){check12ValidFormat(e,scorm12_regex.CMIIdentifier)&&_classPrivateFieldSet(this,_id,e)}},{key:"time",get:function(){return this.jsonString?_classPrivateFieldGet(this,_time):throwWriteOnlyError()},set:function(e){check12ValidFormat(e,scorm12_regex.CMITime)&&_classPrivateFieldSet(this,_time,e)}},{key:"type",get:function(){return this.jsonString?_classPrivateFieldGet(this,_type):throwWriteOnlyError()},set:function(e){check12ValidFormat(e,scorm12_regex.CMIType)&&_classPrivateFieldSet(this,_type,e)}},{key:"weighting",get:function(){return this.jsonString?_classPrivateFieldGet(this,_weighting):throwWriteOnlyError()},set:function(e){check12ValidFormat(e,scorm12_regex.CMIDecimal)&&check12ValidRange(e,scorm12_regex.weighting_range)&&_classPrivateFieldSet(this,_weighting,e)}},{key:"student_response",get:function(){return this.jsonString?_classPrivateFieldGet(this,_student_response):throwWriteOnlyError()},set:function(e){check12ValidFormat(e,scorm12_regex.CMIFeedback,!0)&&_classPrivateFieldSet(this,_student_response,e)}},{key:"result",get:function(){return this.jsonString?_classPrivateFieldGet(this,_result):throwWriteOnlyError()},set:function(e){check12ValidFormat(e,scorm12_regex.CMIResult)&&_classPrivateFieldSet(this,_result,e)}},{key:"latency",get:function(){return this.jsonString?_classPrivateFieldGet(this,_latency):throwWriteOnlyError()},set:function(e){check12ValidFormat(e,scorm12_regex.CMITimespan)&&_classPrivateFieldSet(this,_latency,e)}},{key:"toJSON",value: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}(_common.BaseCMI);exports.CMIInteractionsObject=CMIInteractionsObject;var _id2=new WeakMap,_status=new WeakMap,CMIObjectivesObject=function(e){function t(){var e;return _classCallCheck(this,t),e=i.call(this),_id2.set(_assertThisInitialized(e),{writable:!0,value:""}),_status.set(_assertThisInitialized(e),{writable:!0,value:""}),e.score=new _common.CMIScore({score_children:scorm12_constants.score_children,score_range:scorm12_regex.score_range,invalidErrorCode:scorm12_error_codes.INVALID_SET_VALUE,invalidTypeCode:scorm12_error_codes.TYPE_MISMATCH,invalidRangeCode:scorm12_error_codes.VALUE_OUT_OF_RANGE}),e}_inherits(t,e);var i=_createSuper(t);return _createClass(t,[{key:"id",get:function(){return _classPrivateFieldGet(this,_id2)},set:function(e){check12ValidFormat(e,scorm12_regex.CMIIdentifier)&&_classPrivateFieldSet(this,_id2,e)}},{key:"status",get:function(){return _classPrivateFieldGet(this,_status)},set:function(e){check12ValidFormat(e,scorm12_regex.CMIStatus2)&&_classPrivateFieldSet(this,_status,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={id:this.id,status:this.status,score:this.score};return delete this.jsonString,e}}]),t}(_common.BaseCMI);exports.CMIObjectivesObject=CMIObjectivesObject;var _id3=new WeakMap,CMIInteractionsObjectivesObject=function(e){function t(){var e;return _classCallCheck(this,t),e=i.call(this),_id3.set(_assertThisInitialized(e),{writable:!0,value:""}),e}_inherits(t,e);var i=_createSuper(t);return _createClass(t,[{key:"id",get:function(){return _classPrivateFieldGet(this,_id3)},set:function(e){check12ValidFormat(e,scorm12_regex.CMIIdentifier)&&_classPrivateFieldSet(this,_id3,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={id:this.id};return delete this.jsonString,e}}]),t}(_common.BaseCMI);exports.CMIInteractionsObjectivesObject=CMIInteractionsObjectivesObject;var _pattern=new WeakMap,CMIInteractionsCorrectResponsesObject=function(e){function t(){var e;return _classCallCheck(this,t),e=i.call(this),_pattern.set(_assertThisInitialized(e),{writable:!0,value:""}),e}_inherits(t,e);var i=_createSuper(t);return _createClass(t,[{key:"pattern",get:function(){return this.jsonString?_classPrivateFieldGet(this,_pattern):throwWriteOnlyError()},set:function(e){check12ValidFormat(e,scorm12_regex.CMIFeedback,!0)&&_classPrivateFieldSet(this,_pattern,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={pattern:this.pattern};return delete this.jsonString,e}}]),t}(_common.BaseCMI);exports.CMIInteractionsCorrectResponsesObject=CMIInteractionsCorrectResponsesObject;var _event=new WeakMap,NAV=function(e){function t(){var e;return _classCallCheck(this,t),e=i.call(this),_event.set(_assertThisInitialized(e),{writable:!0,value:""}),e}_inherits(t,e);var i=_createSuper(t);return _createClass(t,[{key:"event",get:function(){return _classPrivateFieldGet(this,_event)},set:function(e){check12ValidFormat(e,scorm12_regex.NAVEvent)&&_classPrivateFieldSet(this,_event,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={event:this.event};return delete this.jsonString,e}}]),t}(_common.BaseCMI);exports.NAV=NAV;
20
- },{"../constants/api_constants":10,"../constants/error_codes":11,"../constants/regex":13,"../exceptions":15,"../utilities":17,"./common":7}],9:[function(require,module,exports){
21
- "use strict";function _typeof(e){"@babel/helpers - typeof";return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function(){return e},e}function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!==_typeof(e)&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var n=r?Object.getOwnPropertyDescriptor(e,s):null;n&&(n.get||n.set)?Object.defineProperty(i,s,n):i[s]=e[s]}return i.default=e,t&&t.set(e,i),i}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _createClass(e,t,i){return t&&_defineProperties(e.prototype,t),i&&_defineProperties(e,i),e}function _get(e,t,i){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,i){var r=_superPropBase(e,t);if(r){var s=Object.getOwnPropertyDescriptor(r,t);return s.get?s.get.call(i):s.value}})(e,t,i||e)}function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf(e)););return e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var i,r=_getPrototypeOf(e);if(t){var s=_getPrototypeOf(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return _possibleConstructorReturn(this,i)}}function _possibleConstructorReturn(e,t){return!t||"object"!==_typeof(t)&&"function"!=typeof t?_assertThisInitialized(e):t}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _classPrivateFieldSet(e,t,i){return _classApplyDescriptorSet(e,_classExtractFieldDescriptor(e,t,"set"),i),i}function _classApplyDescriptorSet(e,t,i){if(t.set)t.set.call(e,i);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=i}}function _classPrivateFieldGet(e,t){return _classApplyDescriptorGet(e,_classExtractFieldDescriptor(e,t,"get"))}function _classExtractFieldDescriptor(e,t,i){if(!t.has(e))throw new TypeError("attempted to "+i+" private field on non-instance");return t.get(e)}function _classApplyDescriptorGet(e,t){return t.get?t.get.call(e):t.value}function throwReadOnlyError(){throw new _exceptions.ValidationError(scorm2004_error_codes.READ_ONLY_ELEMENT)}function throwWriteOnlyError(){throw new _exceptions.ValidationError(scorm2004_error_codes.WRITE_ONLY_ELEMENT)}function throwTypeMismatchError(){throw new _exceptions.ValidationError(scorm2004_error_codes.TYPE_MISMATCH)}function check2004ValidFormat(e,t,i){return(0,_common.checkValidFormat)(e,t,scorm2004_error_codes.TYPE_MISMATCH,i)}function check2004ValidRange(e,t){return(0,_common.checkValidRange)(e,t,scorm2004_error_codes.VALUE_OUT_OF_RANGE)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.ADL=exports.CMIInteractionsCorrectResponsesObject=exports.CMIInteractionsObjectivesObject=exports.CMICommentsObject=exports.CMIObjectivesObject=exports.CMIInteractionsObject=exports.CMI=void 0;var _common=require("./common"),_api_constants=_interopRequireDefault(require("../constants/api_constants")),_regex=_interopRequireDefault(require("../constants/regex")),_error_codes=_interopRequireDefault(require("../constants/error_codes")),_response_constants=_interopRequireDefault(require("../constants/response_constants")),_exceptions=require("../exceptions"),Util=_interopRequireWildcard(require("../utilities")),scorm2004_constants=_api_constants.default.scorm2004,scorm2004_error_codes=_error_codes.default.scorm2004,learner_responses=_response_constants.default.learner,scorm2004_regex=_regex.default.scorm2004,_version2=new WeakMap,_children2=new WeakMap,_completion_status=new WeakMap,_completion_threshold=new WeakMap,_credit=new WeakMap,_entry=new WeakMap,_exit=new WeakMap,_launch_data=new WeakMap,_learner_id=new WeakMap,_learner_name=new WeakMap,_location=new WeakMap,_max_time_allowed=new WeakMap,_mode=new WeakMap,_progress_measure=new WeakMap,_scaled_passing_score=new WeakMap,_session_time=new WeakMap,_success_status=new WeakMap,_suspend_data=new WeakMap,_time_limit_action=new WeakMap,_total_time=new WeakMap,CMI=function(e){function t(e){var r;return _classCallCheck(this,t),r=i.call(this),_version2.set(_assertThisInitialized(r),{writable:!0,value:"1.0"}),_children2.set(_assertThisInitialized(r),{writable:!0,value:scorm2004_constants.cmi_children}),_completion_status.set(_assertThisInitialized(r),{writable:!0,value:"unknown"}),_completion_threshold.set(_assertThisInitialized(r),{writable:!0,value:""}),_credit.set(_assertThisInitialized(r),{writable:!0,value:"credit"}),_entry.set(_assertThisInitialized(r),{writable:!0,value:""}),_exit.set(_assertThisInitialized(r),{writable:!0,value:""}),_launch_data.set(_assertThisInitialized(r),{writable:!0,value:""}),_learner_id.set(_assertThisInitialized(r),{writable:!0,value:""}),_learner_name.set(_assertThisInitialized(r),{writable:!0,value:""}),_location.set(_assertThisInitialized(r),{writable:!0,value:""}),_max_time_allowed.set(_assertThisInitialized(r),{writable:!0,value:""}),_mode.set(_assertThisInitialized(r),{writable:!0,value:"normal"}),_progress_measure.set(_assertThisInitialized(r),{writable:!0,value:""}),_scaled_passing_score.set(_assertThisInitialized(r),{writable:!0,value:""}),_session_time.set(_assertThisInitialized(r),{writable:!0,value:"PT0H0M0S"}),_success_status.set(_assertThisInitialized(r),{writable:!0,value:"unknown"}),_suspend_data.set(_assertThisInitialized(r),{writable:!0,value:""}),_time_limit_action.set(_assertThisInitialized(r),{writable:!0,value:"continue,no message"}),_total_time.set(_assertThisInitialized(r),{writable:!0,value:""}),r.learner_preference=new CMILearnerPreference,r.score=new Scorm2004CMIScore,r.comments_from_learner=new CMICommentsFromLearner,r.comments_from_lms=new CMICommentsFromLMS,r.interactions=new CMIInteractions,r.objectives=new CMIObjectives,e&&r.initialize(),r}_inherits(t,e);var i=_createSuper(t);return _createClass(t,[{key:"initialize",value:function(){var e,i,r,s,n,a;_get(_getPrototypeOf(t.prototype),"initialize",this).call(this),null===(e=this.learner_preference)||void 0===e||e.initialize(),null===(i=this.score)||void 0===i||i.initialize(),null===(r=this.comments_from_learner)||void 0===r||r.initialize(),null===(s=this.comments_from_lms)||void 0===s||s.initialize(),null===(n=this.interactions)||void 0===n||n.initialize(),null===(a=this.objectives)||void 0===a||a.initialize()}},{key:"_version",get:function(){return _classPrivateFieldGet(this,_version2)},set:function(e){throwReadOnlyError()}},{key:"_children",get:function(){return _classPrivateFieldGet(this,_children2)},set:function(e){throwReadOnlyError()}},{key:"completion_status",get:function(){return _classPrivateFieldGet(this,_completion_status)},set:function(e){check2004ValidFormat(e,scorm2004_regex.CMICStatus)&&_classPrivateFieldSet(this,_completion_status,e)}},{key:"completion_threshold",get:function(){return _classPrivateFieldGet(this,_completion_threshold)},set:function(e){this.initialized?throwReadOnlyError():_classPrivateFieldSet(this,_completion_threshold,e)}},{key:"credit",get:function(){return _classPrivateFieldGet(this,_credit)},set:function(e){this.initialized?throwReadOnlyError():_classPrivateFieldSet(this,_credit,e)}},{key:"entry",get:function(){return _classPrivateFieldGet(this,_entry)},set:function(e){this.initialized?throwReadOnlyError():_classPrivateFieldSet(this,_entry,e)}},{key:"exit",get:function(){return this.jsonString?_classPrivateFieldGet(this,_exit):throwWriteOnlyError()},set:function(e){check2004ValidFormat(e,scorm2004_regex.CMIExit,!0)&&_classPrivateFieldSet(this,_exit,e)}},{key:"launch_data",get:function(){return _classPrivateFieldGet(this,_launch_data)},set:function(e){this.initialized?throwReadOnlyError():_classPrivateFieldSet(this,_launch_data,e)}},{key:"learner_id",get:function(){return _classPrivateFieldGet(this,_learner_id)},set:function(e){this.initialized?throwReadOnlyError():_classPrivateFieldSet(this,_learner_id,e)}},{key:"learner_name",get:function(){return _classPrivateFieldGet(this,_learner_name)},set:function(e){this.initialized?throwReadOnlyError():_classPrivateFieldSet(this,_learner_name,e)}},{key:"location",get:function(){return _classPrivateFieldGet(this,_location)},set:function(e){check2004ValidFormat(e,scorm2004_regex.CMIString1000)&&_classPrivateFieldSet(this,_location,e)}},{key:"max_time_allowed",get:function(){return _classPrivateFieldGet(this,_max_time_allowed)},set:function(e){this.initialized?throwReadOnlyError():_classPrivateFieldSet(this,_max_time_allowed,e)}},{key:"mode",get:function(){return _classPrivateFieldGet(this,_mode)},set:function(e){this.initialized?throwReadOnlyError():_classPrivateFieldSet(this,_mode,e)}},{key:"progress_measure",get:function(){return _classPrivateFieldGet(this,_progress_measure)},set:function(e){check2004ValidFormat(e,scorm2004_regex.CMIDecimal)&&check2004ValidRange(e,scorm2004_regex.progress_range)&&_classPrivateFieldSet(this,_progress_measure,e)}},{key:"scaled_passing_score",get:function(){return _classPrivateFieldGet(this,_scaled_passing_score)},set:function(e){this.initialized?throwReadOnlyError():_classPrivateFieldSet(this,_scaled_passing_score,e)}},{key:"session_time",get:function(){return this.jsonString?_classPrivateFieldGet(this,_session_time):throwWriteOnlyError()},set:function(e){check2004ValidFormat(e,scorm2004_regex.CMITimespan)&&_classPrivateFieldSet(this,_session_time,e)}},{key:"success_status",get:function(){return _classPrivateFieldGet(this,_success_status)},set:function(e){check2004ValidFormat(e,scorm2004_regex.CMISStatus)&&_classPrivateFieldSet(this,_success_status,e)}},{key:"suspend_data",get:function(){return _classPrivateFieldGet(this,_suspend_data)},set:function(e){check2004ValidFormat(e,scorm2004_regex.CMIString64000,!0)&&_classPrivateFieldSet(this,_suspend_data,e)}},{key:"time_limit_action",get:function(){return _classPrivateFieldGet(this,_time_limit_action)},set:function(e){this.initialized?throwReadOnlyError():_classPrivateFieldSet(this,_time_limit_action,e)}},{key:"total_time",get:function(){return _classPrivateFieldGet(this,_total_time)},set:function(e){this.initialized?throwReadOnlyError():_classPrivateFieldSet(this,_total_time,e)}},{key:"getCurrentTotalTime",value:function(){var e=_classPrivateFieldGet(this,_session_time),t=this.start_time;if(void 0!==t&&null!==t){var i=(new Date).getTime()-t;e=Util.getSecondsAsISODuration(i/1e3)}return Util.addTwoDurations(_classPrivateFieldGet(this,_total_time),e,scorm2004_regex.CMITimespan)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={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};return delete this.jsonString,e}}]),t}(_common.BaseCMI);exports.CMI=CMI;var _children3=new WeakMap,_audio_level=new WeakMap,_language=new WeakMap,_delivery_speed=new WeakMap,_audio_captioning=new WeakMap,CMILearnerPreference=function(e){function t(){var e;return _classCallCheck(this,t),e=i.call(this),_children3.set(_assertThisInitialized(e),{writable:!0,value:scorm2004_constants.student_preference_children}),_audio_level.set(_assertThisInitialized(e),{writable:!0,value:"1"}),_language.set(_assertThisInitialized(e),{writable:!0,value:""}),_delivery_speed.set(_assertThisInitialized(e),{writable:!0,value:"1"}),_audio_captioning.set(_assertThisInitialized(e),{writable:!0,value:"0"}),e}_inherits(t,e);var i=_createSuper(t);return _createClass(t,[{key:"_children",get:function(){return _classPrivateFieldGet(this,_children3)},set:function(e){throwReadOnlyError()}},{key:"audio_level",get:function(){return _classPrivateFieldGet(this,_audio_level)},set:function(e){check2004ValidFormat(e,scorm2004_regex.CMIDecimal)&&check2004ValidRange(e,scorm2004_regex.audio_range)&&_classPrivateFieldSet(this,_audio_level,e)}},{key:"language",get:function(){return _classPrivateFieldGet(this,_language)},set:function(e){check2004ValidFormat(e,scorm2004_regex.CMILang)&&_classPrivateFieldSet(this,_language,e)}},{key:"delivery_speed",get:function(){return _classPrivateFieldGet(this,_delivery_speed)},set:function(e){check2004ValidFormat(e,scorm2004_regex.CMIDecimal)&&check2004ValidRange(e,scorm2004_regex.speed_range)&&_classPrivateFieldSet(this,_delivery_speed,e)}},{key:"audio_captioning",get:function(){return _classPrivateFieldGet(this,_audio_captioning)},set:function(e){check2004ValidFormat(e,scorm2004_regex.CMISInteger)&&check2004ValidRange(e,scorm2004_regex.text_range)&&_classPrivateFieldSet(this,_audio_captioning,e)}},{key:"toJSON",value: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}(_common.BaseCMI),CMIInteractions=function(e){function t(){return _classCallCheck(this,t),i.call(this,{children:scorm2004_constants.interactions_children,errorCode:scorm2004_error_codes.READ_ONLY_ELEMENT})}_inherits(t,e);var i=_createSuper(t);return t}(_common.CMIArray),CMIObjectives=function(e){function t(){return _classCallCheck(this,t),i.call(this,{children:scorm2004_constants.objectives_children,errorCode:scorm2004_error_codes.READ_ONLY_ELEMENT})}_inherits(t,e);var i=_createSuper(t);return t}(_common.CMIArray),CMICommentsFromLMS=function(e){function t(){return _classCallCheck(this,t),i.call(this,{children:scorm2004_constants.comments_children,errorCode:scorm2004_error_codes.READ_ONLY_ELEMENT})}_inherits(t,e);var i=_createSuper(t);return t}(_common.CMIArray),CMICommentsFromLearner=function(e){function t(){return _classCallCheck(this,t),i.call(this,{children:scorm2004_constants.comments_children,errorCode:scorm2004_error_codes.READ_ONLY_ELEMENT})}_inherits(t,e);var i=_createSuper(t);return t}(_common.CMIArray),_id=new WeakMap,_type=new WeakMap,_timestamp=new WeakMap,_weighting=new WeakMap,_learner_response=new WeakMap,_result=new WeakMap,_latency=new WeakMap,_description=new WeakMap,CMIInteractionsObject=function(e){function t(){var e;return _classCallCheck(this,t),e=i.call(this),_id.set(_assertThisInitialized(e),{writable:!0,value:""}),_type.set(_assertThisInitialized(e),{writable:!0,value:""}),_timestamp.set(_assertThisInitialized(e),{writable:!0,value:""}),_weighting.set(_assertThisInitialized(e),{writable:!0,value:""}),_learner_response.set(_assertThisInitialized(e),{writable:!0,value:""}),_result.set(_assertThisInitialized(e),{writable:!0,value:""}),_latency.set(_assertThisInitialized(e),{writable:!0,value:""}),_description.set(_assertThisInitialized(e),{writable:!0,value:""}),e.objectives=new _common.CMIArray({errorCode:scorm2004_error_codes.READ_ONLY_ELEMENT,children:scorm2004_constants.objectives_children}),e.correct_responses=new _common.CMIArray({errorCode:scorm2004_error_codes.READ_ONLY_ELEMENT,children:scorm2004_constants.correct_responses_children}),e}_inherits(t,e);var i=_createSuper(t);return _createClass(t,[{key:"initialize",value:function(){var e,i;_get(_getPrototypeOf(t.prototype),"initialize",this).call(this),null===(e=this.objectives)||void 0===e||e.initialize(),null===(i=this.correct_responses)||void 0===i||i.initialize()}},{key:"id",get:function(){return _classPrivateFieldGet(this,_id)},set:function(e){check2004ValidFormat(e,scorm2004_regex.CMILongIdentifier)&&_classPrivateFieldSet(this,_id,e)}},{key:"type",get:function(){return _classPrivateFieldGet(this,_type)},set:function(e){if(this.initialized&&""===_classPrivateFieldGet(this,_id))throw new _exceptions.ValidationError(scorm2004_error_codes.DEPENDENCY_NOT_ESTABLISHED);check2004ValidFormat(e,scorm2004_regex.CMIType)&&_classPrivateFieldSet(this,_type,e)}},{key:"timestamp",get:function(){return _classPrivateFieldGet(this,_timestamp)},set:function(e){if(this.initialized&&""===_classPrivateFieldGet(this,_id))throw new _exceptions.ValidationError(scorm2004_error_codes.DEPENDENCY_NOT_ESTABLISHED);check2004ValidFormat(e,scorm2004_regex.CMITime)&&_classPrivateFieldSet(this,_timestamp,e)}},{key:"weighting",get:function(){return _classPrivateFieldGet(this,_weighting)},set:function(e){if(this.initialized&&""===_classPrivateFieldGet(this,_id))throw new _exceptions.ValidationError(scorm2004_error_codes.DEPENDENCY_NOT_ESTABLISHED);check2004ValidFormat(e,scorm2004_regex.CMIDecimal)&&_classPrivateFieldSet(this,_weighting,e)}},{key:"learner_response",get:function(){return _classPrivateFieldGet(this,_learner_response)},set:function(e){if(this.initialized&&(""===_classPrivateFieldGet(this,_type)||""===_classPrivateFieldGet(this,_id)))throw new _exceptions.ValidationError(scorm2004_error_codes.DEPENDENCY_NOT_ESTABLISHED);var t=[],i=learner_responses[this.type];if(!i)throw new _exceptions.ValidationError(scorm2004_error_codes.TYPE_MISMATCH);if(null!==i&&void 0!==i&&i.delimiter?t=e.split(i.delimiter):t[0]=e,!(t.length>0&&t.length<=i.max))throw new _exceptions.ValidationError(scorm2004_error_codes.GENERAL_SET_FAILURE);for(var r=new RegExp(i.format),s=0;s<t.length;s++)if(null!==i&&void 0!==i&&i.delimiter2){var n=t[s].split(i.delimiter2);2===n.length&&n[0].match(r)?n[1].match(new RegExp(i.format2))||throwTypeMismatchError():throwTypeMismatchError()}else if(t[s].match(r)){if(""!==t[s]&&i.unique)for(var a=0;a<s;a++)t[s]===t[a]&&throwTypeMismatchError()}else throwTypeMismatchError();_classPrivateFieldSet(this,_learner_response,e)}},{key:"result",get:function(){return _classPrivateFieldGet(this,_result)},set:function(e){check2004ValidFormat(e,scorm2004_regex.CMIResult)&&_classPrivateFieldSet(this,_result,e)}},{key:"latency",get:function(){return _classPrivateFieldGet(this,_latency)},set:function(e){if(this.initialized&&""===_classPrivateFieldGet(this,_id))throw new _exceptions.ValidationError(scorm2004_error_codes.DEPENDENCY_NOT_ESTABLISHED);check2004ValidFormat(e,scorm2004_regex.CMITimespan)&&_classPrivateFieldSet(this,_latency,e)}},{key:"description",get:function(){return _classPrivateFieldGet(this,_description)},set:function(e){if(this.initialized&&""===_classPrivateFieldGet(this,_id))throw new _exceptions.ValidationError(scorm2004_error_codes.DEPENDENCY_NOT_ESTABLISHED);check2004ValidFormat(e,scorm2004_regex.CMILangString250,!0)&&_classPrivateFieldSet(this,_description,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={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};return delete this.jsonString,e}}]),t}(_common.BaseCMI);exports.CMIInteractionsObject=CMIInteractionsObject;var _id2=new WeakMap,_success_status2=new WeakMap,_completion_status2=new WeakMap,_progress_measure2=new WeakMap,_description2=new WeakMap,CMIObjectivesObject=function(e){function t(){var e;return _classCallCheck(this,t),e=i.call(this),_id2.set(_assertThisInitialized(e),{writable:!0,value:""}),_success_status2.set(_assertThisInitialized(e),{writable:!0,value:"unknown"}),_completion_status2.set(_assertThisInitialized(e),{writable:!0,value:"unknown"}),_progress_measure2.set(_assertThisInitialized(e),{writable:!0,value:""}),_description2.set(_assertThisInitialized(e),{writable:!0,value:""}),e.score=new Scorm2004CMIScore,e}_inherits(t,e);var i=_createSuper(t);return _createClass(t,[{key:"initialize",value:function(){var e;_get(_getPrototypeOf(t.prototype),"initialize",this).call(this),null===(e=this.score)||void 0===e||e.initialize()}},{key:"id",get:function(){return _classPrivateFieldGet(this,_id2)},set:function(e){check2004ValidFormat(e,scorm2004_regex.CMILongIdentifier)&&_classPrivateFieldSet(this,_id2,e)}},{key:"success_status",get:function(){return _classPrivateFieldGet(this,_success_status2)},set:function(e){if(this.initialized&&""===_classPrivateFieldGet(this,_id2))throw new _exceptions.ValidationError(scorm2004_error_codes.DEPENDENCY_NOT_ESTABLISHED);check2004ValidFormat(e,scorm2004_regex.CMISStatus)&&_classPrivateFieldSet(this,_success_status2,e)}},{key:"completion_status",get:function(){return _classPrivateFieldGet(this,_completion_status2)},set:function(e){if(this.initialized&&""===_classPrivateFieldGet(this,_id2))throw new _exceptions.ValidationError(scorm2004_error_codes.DEPENDENCY_NOT_ESTABLISHED);check2004ValidFormat(e,scorm2004_regex.CMICStatus)&&_classPrivateFieldSet(this,_completion_status2,e)}},{key:"progress_measure",get:function(){return _classPrivateFieldGet(this,_progress_measure2)},set:function(e){if(this.initialized&&""===_classPrivateFieldGet(this,_id2))throw new _exceptions.ValidationError(scorm2004_error_codes.DEPENDENCY_NOT_ESTABLISHED);check2004ValidFormat(e,scorm2004_regex.CMIDecimal)&&check2004ValidRange(e,scorm2004_regex.progress_range)&&_classPrivateFieldSet(this,_progress_measure2,e)}},{key:"description",get:function(){return _classPrivateFieldGet(this,_description2)},set:function(e){if(this.initialized&&""===_classPrivateFieldGet(this,_id2))throw new _exceptions.ValidationError(scorm2004_error_codes.DEPENDENCY_NOT_ESTABLISHED);check2004ValidFormat(e,scorm2004_regex.CMILangString250,!0)&&_classPrivateFieldSet(this,_description2,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={id:this.id,success_status:this.success_status,completion_status:this.completion_status,progress_measure:this.progress_measure,description:this.description,score:this.score};return delete this.jsonString,e}}]),t}(_common.BaseCMI);exports.CMIObjectivesObject=CMIObjectivesObject;var _scaled=new WeakMap,Scorm2004CMIScore=function(e){function t(){var e;return _classCallCheck(this,t),e=i.call(this,{score_children:scorm2004_constants.score_children,max:"",invalidErrorCode:scorm2004_error_codes.READ_ONLY_ELEMENT,invalidTypeCode:scorm2004_error_codes.TYPE_MISMATCH,invalidRangeCode:scorm2004_error_codes.VALUE_OUT_OF_RANGE,decimalRegex:scorm2004_regex.CMIDecimal}),_scaled.set(_assertThisInitialized(e),{writable:!0,value:""}),e}_inherits(t,e);var i=_createSuper(t);return _createClass(t,[{key:"scaled",get:function(){return _classPrivateFieldGet(this,_scaled)},set:function(e){check2004ValidFormat(e,scorm2004_regex.CMIDecimal)&&check2004ValidRange(e,scorm2004_regex.scaled_range)&&_classPrivateFieldSet(this,_scaled,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={scaled:this.scaled,raw:_get(_getPrototypeOf(t.prototype),"raw",this),min:_get(_getPrototypeOf(t.prototype),"min",this),max:_get(_getPrototypeOf(t.prototype),"max",this)};return delete this.jsonString,e}}]),t}(_common.CMIScore),_comment=new WeakMap,_location2=new WeakMap,_timestamp2=new WeakMap,_readOnlyAfterInit=new WeakMap,CMICommentsObject=function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _classCallCheck(this,t),e=i.call(this),_comment.set(_assertThisInitialized(e),{writable:!0,value:""}),_location2.set(_assertThisInitialized(e),{writable:!0,value:""}),_timestamp2.set(_assertThisInitialized(e),{writable:!0,value:""}),_readOnlyAfterInit.set(_assertThisInitialized(e),{writable:!0,value:void 0}),_classPrivateFieldSet(_assertThisInitialized(e),_comment,""),_classPrivateFieldSet(_assertThisInitialized(e),_location2,""),_classPrivateFieldSet(_assertThisInitialized(e),_timestamp2,""),_classPrivateFieldSet(_assertThisInitialized(e),_readOnlyAfterInit,r),e}_inherits(t,e);var i=_createSuper(t);return _createClass(t,[{key:"comment",get:function(){return _classPrivateFieldGet(this,_comment)},set:function(e){this.initialized&&_classPrivateFieldGet(this,_readOnlyAfterInit)?throwReadOnlyError():check2004ValidFormat(e,scorm2004_regex.CMILangString4000,!0)&&_classPrivateFieldSet(this,_comment,e)}},{key:"location",get:function(){return _classPrivateFieldGet(this,_location2)},set:function(e){this.initialized&&_classPrivateFieldGet(this,_readOnlyAfterInit)?throwReadOnlyError():check2004ValidFormat(e,scorm2004_regex.CMIString250)&&_classPrivateFieldSet(this,_location2,e)}},{key:"timestamp",get:function(){return _classPrivateFieldGet(this,_timestamp2)},set:function(e){this.initialized&&_classPrivateFieldGet(this,_readOnlyAfterInit)?throwReadOnlyError():check2004ValidFormat(e,scorm2004_regex.CMITime)&&_classPrivateFieldSet(this,_timestamp2,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={comment:this.comment,location:this.location,timestamp:this.timestamp};return delete this.jsonString,e}}]),t}(_common.BaseCMI);exports.CMICommentsObject=CMICommentsObject;var _id3=new WeakMap,CMIInteractionsObjectivesObject=function(e){function t(){var e;return _classCallCheck(this,t),e=i.call(this),_id3.set(_assertThisInitialized(e),{writable:!0,value:""}),e}_inherits(t,e);var i=_createSuper(t);return _createClass(t,[{key:"id",get:function(){return _classPrivateFieldGet(this,_id3)},set:function(e){check2004ValidFormat(e,scorm2004_regex.CMILongIdentifier)&&_classPrivateFieldSet(this,_id3,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={id:this.id};return delete this.jsonString,e}}]),t}(_common.BaseCMI);exports.CMIInteractionsObjectivesObject=CMIInteractionsObjectivesObject;var _pattern=new WeakMap,CMIInteractionsCorrectResponsesObject=function(e){function t(){var e;return _classCallCheck(this,t),e=i.call(this),_pattern.set(_assertThisInitialized(e),{writable:!0,value:""}),e}_inherits(t,e);var i=_createSuper(t);return _createClass(t,[{key:"pattern",get:function(){return _classPrivateFieldGet(this,_pattern)},set:function(e){check2004ValidFormat(e,scorm2004_regex.CMIFeedback)&&_classPrivateFieldSet(this,_pattern,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={pattern:this.pattern};return delete this.jsonString,e}}]),t}(_common.BaseCMI);exports.CMIInteractionsCorrectResponsesObject=CMIInteractionsCorrectResponsesObject;var ADL=function(e){function t(){var e;return _classCallCheck(this,t),e=i.call(this),e.nav=new ADLNav,e}_inherits(t,e);var i=_createSuper(t);return _createClass(t,[{key:"initialize",value:function(){var e;_get(_getPrototypeOf(t.prototype),"initialize",this).call(this),null===(e=this.nav)||void 0===e||e.initialize()}},{key:"toJSON",value:function(){this.jsonString=!0;var e={nav:this.nav};return delete this.jsonString,e}}]),t}(_common.BaseCMI);exports.ADL=ADL;var _request=new WeakMap,ADLNav=function(e){function t(){var e;return _classCallCheck(this,t),e=i.call(this),_request.set(_assertThisInitialized(e),{writable:!0,value:"_none_"}),e.request_valid=new ADLNavRequestValid,e}_inherits(t,e);var i=_createSuper(t);return _createClass(t,[{key:"initialize",value:function(){var e;_get(_getPrototypeOf(t.prototype),"initialize",this).call(this),null===(e=this.request_valid)||void 0===e||e.initialize()}},{key:"request",get:function(){return _classPrivateFieldGet(this,_request)},set:function(e){check2004ValidFormat(e,scorm2004_regex.NAVEvent)&&_classPrivateFieldSet(this,_request,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={request:this.request};return delete this.jsonString,e}}]),t}(_common.BaseCMI),_continue=new WeakMap,_previous=new WeakMap,ADLNavRequestValid=function(e){function t(){var e;return _classCallCheck(this,t),e=i.call(this),_continue.set(_assertThisInitialized(e),{writable:!0,value:"unknown"}),_previous.set(_assertThisInitialized(e),{writable:!0,value:"unknown"}),_defineProperty(_assertThisInitialized(e),"choice",function e(){_classCallCheck(this,e),_defineProperty(this,"_isTargetValid",function(e){return"unknown"})}),_defineProperty(_assertThisInitialized(e),"jump",function e(){_classCallCheck(this,e),_defineProperty(this,"_isTargetValid",function(e){return"unknown"})}),e}_inherits(t,e);var i=_createSuper(t);return _createClass(t,[{key:"continue",get:function(){return _classPrivateFieldGet(this,_continue)},set:function(e){throwReadOnlyError()}},{key:"previous",get:function(){return _classPrivateFieldGet(this,_previous)},set:function(e){throwReadOnlyError()}},{key:"toJSON",value:function(){this.jsonString=!0;var e={previous:this.previous,continue:this.continue};return delete this.jsonString,e}}]),t}(_common.BaseCMI);
22
- },{"../constants/api_constants":10,"../constants/error_codes":11,"../constants/regex":13,"../constants/response_constants":14,"../exceptions":15,"../utilities":17,"./common":7}],10:[function(require,module,exports){
23
- "use strict";function ownKeys(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);a&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,i)}return t}function _objectSpread(e){for(var a=1;a<arguments.length;a++){var t=null!=arguments[a]?arguments[a]:{};a%2?ownKeys(Object(t),!0).forEach(function(a){_defineProperty(e,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(t,a))})}return e}function _defineProperty(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;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},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."}}},aicc=_objectSpread(_objectSpread({},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"}),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."}}},APIConstants={global:global,scorm12:scorm12,aicc:aicc,scorm2004:scorm2004},_default=APIConstants;exports.default=_default;
24
- },{}],11:[function(require,module,exports){
25
- "use strict";function ownKeys(E,_){var T=Object.keys(E);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(E);_&&(I=I.filter(function(_){return Object.getOwnPropertyDescriptor(E,_).enumerable})),T.push.apply(T,I)}return T}function _objectSpread(E){for(var _=1;_<arguments.length;_++){var T=null!=arguments[_]?arguments[_]:{};_%2?ownKeys(Object(T),!0).forEach(function(_){_defineProperty(E,_,T[_])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(T)):ownKeys(Object(T)).forEach(function(_){Object.defineProperty(E,_,Object.getOwnPropertyDescriptor(T,_))})}return E}function _defineProperty(E,_,T){return _ in E?Object.defineProperty(E,_,{value:T,enumerable:!0,configurable:!0,writable:!0}):E[_]=T,E}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;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},scorm12=_objectSpread(_objectSpread({},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}),scorm2004=_objectSpread(_objectSpread({},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}),ErrorCodes={scorm12:scorm12,scorm2004:scorm2004},_default=ErrorCodes;exports.default=_default;
26
- },{}],12:[function(require,module,exports){
27
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var ValidLanguages={aa:"aa",ab:"ab",ae:"ae",af:"af",ak:"ak",am:"am",an:"an",ar:"ar",as:"as",av:"av",ay:"ay",az:"az",ba:"ba",be:"be",bg:"bg",bh:"bh",bi:"bi",bm:"bm",bn:"bn",bo:"bo",br:"br",bs:"bs",ca:"ca",ce:"ce",ch:"ch",co:"co",cr:"cr",cs:"cs",cu:"cu",cv:"cv",cy:"cy",da:"da",de:"de",dv:"dv",dz:"dz",ee:"ee",el:"el",en:"en",eo:"eo",es:"es",et:"et",eu:"eu",fa:"fa",ff:"ff",fi:"fi",fj:"fj",fo:"fo",fr:"fr",fy:"fy",ga:"ga",gd:"gd",gl:"gl",gn:"gn",gu:"gu",gv:"gv",ha:"ha",he:"he",hi:"hi",ho:"ho",hr:"hr",ht:"ht",hu:"hu",hy:"hy",hz:"hz",ia:"ia",id:"id",ie:"ie",ig:"ig",ii:"ii",ik:"ik",io:"io",is:"is",it:"it",iu:"iu",ja:"ja",jv:"jv",ka:"ka",kg:"kg",ki:"ki",kj:"kj",kk:"kk",kl:"kl",km:"km",kn:"kn",ko:"ko",kr:"kr",ks:"ks",ku:"ku",kv:"kv",kw:"kw",ky:"ky",la:"la",lb:"lb",lg:"lg",li:"li",ln:"ln",lo:"lo",lt:"lt",lu:"lu",lv:"lv",mg:"mg",mh:"mh",mi:"mi",mk:"mk",ml:"ml",mn:"mn",mo:"mo",mr:"mr",ms:"ms",mt:"mt",my:"my",na:"na",nb:"nb",nd:"nd",ne:"ne",ng:"ng",nl:"nl",nn:"nn",no:"no",nr:"nr",nv:"nv",ny:"ny",oc:"oc",oj:"oj",om:"om",or:"or",os:"os",pa:"pa",pi:"pi",pl:"pl",ps:"ps",pt:"pt",qu:"qu",rm:"rm",rn:"rn",ro:"ro",ru:"ru",rw:"rw",sa:"sa",sc:"sc",sd:"sd",se:"se",sg:"sg",sh:"sh",si:"si",sk:"sk",sl:"sl",sm:"sm",sn:"sn",so:"so",sq:"sq",sr:"sr",ss:"ss",st:"st",su:"su",sv:"sv",sw:"sw",ta:"ta",te:"te",tg:"tg",th:"th",ti:"ti",tk:"tk",tl:"tl",tn:"tn",to:"to",tr:"tr",ts:"ts",tt:"tt",tw:"tw",ty:"ty",ug:"ug",uk:"uk",ur:"ur",uz:"uz",ve:"ve",vi:"vi",vo:"vo",wa:"wa",wo:"wo",xh:"xh",yi:"yi",yo:"yo",za:"za",zh:"zh",zu:"zu",aar:"aar",abk:"abk",ave:"ave",afr:"afr",aka:"aka",amh:"amh",arg:"arg",ara:"ara",asm:"asm",ava:"ava",aym:"aym",aze:"aze",bak:"bak",bel:"bel",bul:"bul",bih:"bih",bis:"bis",bam:"bam",ben:"ben",tib:"tib",bod:"bod",bre:"bre",bos:"bos",cat:"cat",che:"che",cha:"cha",cos:"cos",cre:"cre",cze:"cze",ces:"ces",chu:"chu",chv:"chv",wel:"wel",cym:"cym",dan:"dan",ger:"ger",deu:"deu",div:"div",dzo:"dzo",ewe:"ewe",gre:"gre",ell:"ell",eng:"eng",epo:"epo",spa:"spa",est:"est",baq:"baq",eus:"eus",per:"per",fas:"fas",ful:"ful",fin:"fin",fij:"fij",fao:"fao",fre:"fre",fra:"fra",fry:"fry",gle:"gle",gla:"gla",glg:"glg",grn:"grn",guj:"guj",glv:"glv",hau:"hau",heb:"heb",hin:"hin",hmo:"hmo",hrv:"hrv",hat:"hat",hun:"hun",arm:"arm",hye:"hye",her:"her",ina:"ina",ind:"ind",ile:"ile",ibo:"ibo",iii:"iii",ipk:"ipk",ido:"ido",ice:"ice",isl:"isl",ita:"ita",iku:"iku",jpn:"jpn",jav:"jav",geo:"geo",kat:"kat",kon:"kon",kik:"kik",kua:"kua",kaz:"kaz",kal:"kal",khm:"khm",kan:"kan",kor:"kor",kau:"kau",kas:"kas",kur:"kur",kom:"kom",cor:"cor",kir:"kir",lat:"lat",ltz:"ltz",lug:"lug",lim:"lim",lin:"lin",lao:"lao",lit:"lit",lub:"lub",lav:"lav",mlg:"mlg",mah:"mah",mao:"mao",mri:"mri",mac:"mac",mkd:"mkd",mal:"mal",mon:"mon",mol:"mol",mar:"mar",may:"may",msa:"msa",mlt:"mlt",bur:"bur",mya:"mya",nau:"nau",nob:"nob",nde:"nde",nep:"nep",ndo:"ndo",dut:"dut",nld:"nld",nno:"nno",nor:"nor",nbl:"nbl",nav:"nav",nya:"nya",oci:"oci",oji:"oji",orm:"orm",ori:"ori",oss:"oss",pan:"pan",pli:"pli",pol:"pol",pus:"pus",por:"por",que:"que",roh:"roh",run:"run",rum:"rum",ron:"ron",rus:"rus",kin:"kin",san:"san",srd:"srd",snd:"snd",sme:"sme",sag:"sag",slo:"slo",sin:"sin",slk:"slk",slv:"slv",smo:"smo",sna:"sna",som:"som",alb:"alb",sqi:"sqi",srp:"srp",ssw:"ssw",sot:"sot",sun:"sun",swe:"swe",swa:"swa",tam:"tam",tel:"tel",tgk:"tgk",tha:"tha",tir:"tir",tuk:"tuk",tgl:"tgl",tsn:"tsn",ton:"ton",tur:"tur",tso:"tso",tat:"tat",twi:"twi",tah:"tah",uig:"uig",ukr:"ukr",urd:"urd",uzb:"uzb",ven:"ven",vie:"vie",vol:"vol",wln:"wln",wol:"wol",xho:"xho",yid:"yid",yor:"yor",zha:"zha",chi:"chi",zho:"zho",zul:"zul"},_default=ValidLanguages;exports.default=_default;
28
- },{}],13:[function(require,module,exports){
29
- "use strict";function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;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"},aicc=_objectSpread(_objectSpread({},scorm12),{CMIIdentifier:"^\\w{1,255}$"}),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|{target=\\S{0,200}[a-zA-Z0-9]}choice|jump)$",NAVBoolean:"^(unknown|true|false$)",NAVTarget:"^(previous|continue|choice.{target=\\S{0,200}[a-zA-Z0-9]})$",scaled_range:"-1#1",audio_range:"0#*",speed_range:"0#*",text_range:"-1#1",progress_range:"0#1"},Regex={aicc:aicc,scorm12:scorm12,scorm2004:scorm2004},_default=Regex;exports.default=_default;
30
- },{}],14:[function(require,module,exports){
31
- "use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _regex=_interopRequireDefault(require("./regex")),scorm2004_regex=_regex.default.scorm2004,learner={"true-false":{format:"^true$|^false$",max:1,delimiter:"",unique:!1},choice:{format:scorm2004_regex.CMIShortIdentifier,max:36,delimiter:"[,]",unique:!0},"fill-in":{format:scorm2004_regex.CMILangString250,max:10,delimiter:"[,]",unique:!1},"long-fill-in":{format:scorm2004_regex.CMILangString4000,max:1,delimiter:"",unique:!1},matching:{format:scorm2004_regex.CMIShortIdentifier,format2:scorm2004_regex.CMIShortIdentifier,max:36,delimiter:"[,]",delimiter2:"[.]",unique:!1},performance:{format:"^$|"+scorm2004_regex.CMIShortIdentifier,format2:scorm2004_regex.CMIDecimal+"|^$|"+scorm2004_regex.CMIShortIdentifier,max:250,delimiter:"[,]",delimiter2:"[.]",unique:!1},sequencing:{format:scorm2004_regex.CMIShortIdentifier,max:36,delimiter:"[,]",unique:!1},likert:{format:scorm2004_regex.CMIShortIdentifier,max:1,delimiter:"",unique:!1},numeric:{format:scorm2004_regex.CMIDecimal,max:1,delimiter:"",unique:!1},other:{format:scorm2004_regex.CMIString4000,max:1,delimiter:"",unique:!1}},correct={"true-false":{max:1,delimiter:"",unique:!1,duplicate:!1,format:"^true$|^false$",limit:1},choice:{max:36,delimiter:"[,]",unique:!0,duplicate:!1,format:scorm2004_regex.CMIShortIdentifier},"fill-in":{max:10,delimiter:"[,]",unique:!1,duplicate:!1,format:scorm2004_regex.CMILangString250cr},"long-fill-in":{max:1,delimiter:"",unique:!1,duplicate:!0,format:scorm2004_regex.CMILangString4000},matching:{max:36,delimiter:"[,]",delimiter2:"[.]",unique:!1,duplicate:!1,format:scorm2004_regex.CMIShortIdentifier,format2:scorm2004_regex.CMIShortIdentifier},performance:{max:250,delimiter:"[,]",delimiter2:"[.]",unique:!1,duplicate:!1,format:"^$|"+scorm2004_regex.CMIShortIdentifier,format2:scorm2004_regex.CMIDecimal+"|^$|"+scorm2004_regex.CMIShortIdentifier},sequencing:{max:36,delimiter:"[,]",unique:!1,duplicate:!1,format:scorm2004_regex.CMIShortIdentifier},likert:{max:1,delimiter:"",unique:!1,duplicate:!1,format:scorm2004_regex.CMIShortIdentifier,limit:1},numeric:{max:2,delimiter:"[:]",unique:!1,duplicate:!1,format:scorm2004_regex.CMIDecimal,limit:1},other:{max:1,delimiter:"",unique:!1,duplicate:!1,format:scorm2004_regex.CMIString4000,limit:1}},Responses={learner:learner,correct:correct},_default=Responses;exports.default=_default;
32
- },{"./regex":13}],15:[function(require,module,exports){
33
- "use strict";function _typeof(t){"@babel/helpers - typeof";return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function _createClass(t,e,r){return e&&_defineProperties(t.prototype,e),r&&_defineProperties(t,r),t}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&_setPrototypeOf(t,e)}function _createSuper(t){var e=_isNativeReflectConstruct();return function(){var r,o=_getPrototypeOf(t);if(e){var n=_getPrototypeOf(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return _possibleConstructorReturn(this,r)}}function _possibleConstructorReturn(t,e){return!e||"object"!==_typeof(e)&&"function"!=typeof e?_assertThisInitialized(t):e}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _wrapNativeSuper(t){var e="function"==typeof Map?new Map:void 0;return(_wrapNativeSuper=function(t){function r(){return _construct(t,arguments,_getPrototypeOf(this).constructor)}if(null===t||!_isNativeFunction(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(r,t)})(t)}function _construct(t,e,r){return _construct=_isNativeReflectConstruct()?Reflect.construct:function(t,e,r){var o=[null];o.push.apply(o,e);var n=Function.bind.apply(t,o),i=new n;return r&&_setPrototypeOf(i,r.prototype),i},_construct.apply(null,arguments)}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function _isNativeFunction(t){return-1!==Function.toString.call(t).indexOf("[native code]")}function _setPrototypeOf(t,e){return(_setPrototypeOf=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function _getPrototypeOf(t){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _classPrivateFieldGet(t,e){return _classApplyDescriptorGet(t,_classExtractFieldDescriptor(t,e,"get"))}function _classApplyDescriptorGet(t,e){return e.get?e.get.call(t):e.value}function _classPrivateFieldSet(t,e,r){return _classApplyDescriptorSet(t,_classExtractFieldDescriptor(t,e,"set"),r),r}function _classExtractFieldDescriptor(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function _classApplyDescriptorSet(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.ValidationError=void 0;var _errorCode=new WeakMap,ValidationError=function(t){function e(t){var o;return _classCallCheck(this,e),o=r.call(this,t),_errorCode.set(_assertThisInitialized(o),{writable:!0,value:void 0}),_classPrivateFieldSet(_assertThisInitialized(o),_errorCode,t),o}_inherits(e,t);var r=_createSuper(e);return _createClass(e,[{key:"errorCode",get:function(){return _classPrivateFieldGet(this,_errorCode)}},{key:"message",get:function(){return _classPrivateFieldGet(this,_errorCode)+""}}]),e}(_wrapNativeSuper(Error));exports.ValidationError=ValidationError;
34
- },{}],16:[function(require,module,exports){
35
- "use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var _Scorm2004API=_interopRequireDefault(require("./Scorm2004API")),_Scorm12API=_interopRequireDefault(require("./Scorm12API")),_AICC=_interopRequireDefault(require("./AICC"));window.Scorm12API=_Scorm12API.default,window.Scorm2004API=_Scorm2004API.default,window.AICC=_AICC.default;
36
- },{"./AICC":2,"./Scorm12API":4,"./Scorm2004API":5}],17:[function(require,module,exports){
37
- "use strict";function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(r,e){if(r){if("string"==typeof r)return _arrayLikeToArray(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,e):void 0}}function _arrayLikeToArray(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function _iterableToArrayLimit(r,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(r)){var t=[],n=!0,o=!1,a=void 0;try{for(var i,s=r[Symbol.iterator]();!(n=(i=s.next()).done)&&(t.push(i.value),!e||t.length!==e);n=!0);}catch(r){o=!0,a=r}finally{try{n||null==s.return||s.return()}finally{if(o)throw a}}return t}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function getSecondsAsHHMMSS(r){if(!r||r<=0)return"00:00:00";var e=Math.floor(r/SECONDS_PER_HOUR),t=new Date(1e3*r),n=t.getUTCMinutes(),o=t.getSeconds(),a=r%1,i="";return countDecimals(a)>0&&(i=countDecimals(a)>2?a.toFixed(2):String(a),i="."+i.split(".")[1]),(e+":"+n+":"+o).replace(/\b\d\b/g,"0$&")+i}function getSecondsAsISODuration(r){if(!r||r<=0)return"PT0S";var e="P",t=r;return designations.forEach(function(r){var n=_slicedToArray(r,2),o=n[0],a=n[1],i=Math.floor(t/a);t%=a,countDecimals(t)>2&&(t=Number(Number(t).toFixed(2))),"S"===o&&t>0&&(i+=t),i&&((e.indexOf("D")>0||"H"===o||"M"===o||"S"===o)&&-1===e.indexOf("T")&&(e+="T"),e+="".concat(i).concat(o))}),e}function getTimeAsSeconds(r,e){if(!r||"string"!=typeof r||!r.match(e))return 0;var t=r.split(":");return 3600*Number(t[0])+60*Number(t[1])+Number(t[2])}function getDurationAsSeconds(r,e){if(!r||!r.match(e))return 0;var t=new RegExp(e).exec(r)||[],n=_slicedToArray(t,8),o=n[1],a=(n[2],n[4]),i=n[5],s=n[6],S=n[7],u=0;return u+=1*Number(S)||0,u+=60*Number(s)||0,u+=3600*Number(i)||0,u+=86400*Number(a)||0,u+=31536e3*Number(o)||0}function addTwoDurations(r,e,t){return getSecondsAsISODuration(getDurationAsSeconds(r,t)+getDurationAsSeconds(e,t))}function addHHMMSSTimeStrings(r,e,t){return getSecondsAsHHMMSS(getTimeAsSeconds(r,t)+getTimeAsSeconds(e,t))}function flatten(r){function e(r,n){if(Object(r)!==r)t[n]=r;else if(Array.isArray(r))for(var o=0,a=r.length;o<a;o++)e(r[o],n+"["+o+"]"),0===a&&(t[n]=[]);else{var i=!0;for(var s in r)({}).hasOwnProperty.call(r,s)&&(i=!1,e(r[s],n?n+"."+s:s));i&&n&&(t[n]={})}}var t={};return e(r,""),t}function unflatten(r){if(Object(r)!==r||Array.isArray(r))return r;var e=/\.?([^.[\]]+)|\[(\d+)]/g,t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){for(var o=t,a="",i=e.exec(n);i;)o=o[a]||(o[a]=i[2]?[]:{}),a=i[2]||i[1],i=e.exec(n);o[a]=r[n]}return t[""]||t}function countDecimals(r){return Math.floor(r)===r||String(r).indexOf(".")<0?0:r.toString().split(".")[1].length||0}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getSecondsAsHHMMSS=getSecondsAsHHMMSS,exports.getSecondsAsISODuration=getSecondsAsISODuration,exports.getTimeAsSeconds=getTimeAsSeconds,exports.getDurationAsSeconds=getDurationAsSeconds,exports.addTwoDurations=addTwoDurations,exports.addHHMMSSTimeStrings=addHHMMSSTimeStrings,exports.flatten=flatten,exports.unflatten=unflatten,exports.countDecimals=countDecimals,exports.SECONDS_PER_DAY=exports.SECONDS_PER_HOUR=exports.SECONDS_PER_MINUTE=exports.SECONDS_PER_SECOND=void 0;var SECONDS_PER_SECOND=1;exports.SECONDS_PER_SECOND=SECONDS_PER_SECOND;var SECONDS_PER_MINUTE=60;exports.SECONDS_PER_MINUTE=SECONDS_PER_MINUTE;var SECONDS_PER_HOUR=60*SECONDS_PER_MINUTE;exports.SECONDS_PER_HOUR=SECONDS_PER_HOUR;var SECONDS_PER_DAY=24*SECONDS_PER_HOUR;exports.SECONDS_PER_DAY=SECONDS_PER_DAY;var designations=[["D",SECONDS_PER_DAY],["H",SECONDS_PER_HOUR],["M",SECONDS_PER_MINUTE],["S",SECONDS_PER_SECOND]];
38
- },{}]},{},[2,3,6,7,8,9,10,11,12,13,14,15,16,4,5,17])
39
-
40
-
41
- //# sourceMappingURL=scorm-again.js.map
1
+ !function(){var n={"./node_modules/lodash.debounce/index.js":
2
+ /*!***********************************************!*\
3
+ !*** ./node_modules/lodash.debounce/index.js ***!
4
+ \***********************************************/function(e,s,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function v(){return f.Date.now()}var r=NaN,i="[object Symbol]",o=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt,t="object"==(void 0===t.g?"undefined":n(t.g))&&t.g&&t.g.Object===Object&&t.g,h="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,f=t||h||Function("return this")(),d=Object.prototype.toString,w=Math.max,M=Math.min;function _(e){var t=n(e);return e&&("object"==t||"function"==t)}function m(e){return"symbol"==n(e)||!!(t=e)&&"object"==n(t)&&d.call(e)==i;var t}function b(e){if("number"==typeof e)return e;if(m(e))return r;if("string"!=typeof(e=_(e)?_(t="function"==typeof e.valueOf?e.valueOf():e)?t+"":t:e))return 0===e?e:+e;e=e.replace(o,"");var t=c.test(e);return t||l.test(e)?u(e.slice(2),t?2:8):a.test(e)?r:+e}e.exports=function(h,n,e){var r,i,o,a,s,c,l=0,f=!1,u=!1,t=!0;if("function"!=typeof h)throw new TypeError("Expected a function");function d(e){var t=r,n=i;return r=i=void 0,l=e,a=h.apply(n,t)}function m(e){var t=e-c;return void 0===c||n<=t||t<0||u&&o<=e-l}function p(){var e,t=v();if(m(t))return y(t);s=setTimeout(p,(e=n-((t=t)-c),u?M(e,o-(t-l)):e))}function y(e){return s=void 0,t&&r?d(e):(r=i=void 0,a)}function g(){var e=v(),t=m(e);if(r=arguments,i=this,c=e,t){if(void 0===s)return l=e=c,s=setTimeout(p,n),f?d(e):a;if(u)return s=setTimeout(p,n),d(c)}return void 0===s&&(s=setTimeout(p,n)),a}return n=b(n)||0,_(e)&&(f=!!e.leading,u="maxWait"in e,o=u?w(b(e.maxWait)||0,n):o,t="trailing"in e?!!e.trailing:t),g.cancel=function(){void 0!==s&&clearTimeout(s),r=c=i=s=void(l=0)},g.flush=function(){return void 0===s?a:y(v())},g}},"./src/AICC.js":
5
+ /*!*********************!*\
6
+ !*** ./src/AICC.js ***!
7
+ \*********************/function(r,e,t){"use strict";t.r(e),t.d(e,{default:function(){return d}});var e=t(/*! ./Scorm12API */"./src/Scorm12API.js"),o=t(/*! ./cmi/aicc_cmi */"./src/cmi/aicc_cmi.js"),h=t(/*! ./cmi/scorm12_cmi */"./src/cmi/scorm12_cmi.js");function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function a(r){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?n(Object(i),!0).forEach(function(e){var t,n;t=r,n=i[e=e],e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))})}return r}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(){return(c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=u(e)););return e}(e,t);if(r)return r=Object.getOwnPropertyDescriptor(r,t),r.get?r.get.call(arguments.length<3?e:n):r.value}).apply(this,arguments)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=u(n),t=(e=r?(e=u(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),this);if(e&&("object"===i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var d=function(e){var t=i;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&l(t,e);var n,r=f(i);function i(e){if(!(this instanceof i))throw new TypeError("Cannot call a class as a function");var e=a(a({},{mastery_override:!1}),e);return(e=r.call(this,e)).cmi=new o.CMI,e.nav=new h.NAV,e}return t=i,(e=[{key:"getChildElement",value:function(e,t,n){t=c(u(i.prototype),"getChildElement",this).call(this,e,t,n);return t||(this.stringMatches(e,"cmi\\.evaluation\\.comments\\.\\d+")?t=new o.CMIEvaluationCommentsObject:this.stringMatches(e,"cmi\\.student_data\\.tries\\.\\d+")?t=new o.CMITriesObject:this.stringMatches(e,"cmi\\.student_data\\.attempt_records\\.\\d+")&&(t=new o.CMIAttemptRecordsObject)),t}},{key:"replaceWithAnotherScormAPI",value:function(e){this.cmi=e.cmi,this.nav=e.nav}}])&&s(t.prototype,e),n&&s(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(e.default)},"./src/BaseAPI.js":
8
+ /*!************************!*\
9
+ !*** ./src/BaseAPI.js ***!
10
+ \************************/function(n,e,t){"use strict";t.r(e),t.d(e,{default:function(){return k}});var p=t(/*! ./cmi/common */"./src/cmi/common.js"),c=t(/*! ./exceptions */"./src/exceptions.js"),e=t(/*! ./constants/error_codes */"./src/constants/error_codes.js"),l=t(/*! ./constants/api_constants */"./src/constants/api_constants.js"),u=t(/*! ./utilities */"./src/utilities.js"),h=t(/*! lodash.debounce */"./node_modules/lodash.debounce/index.js"),y=t.n(h);function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _(e){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function b(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function w(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?b(Object(n),!0).forEach(function(e){I(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function M(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function S(e,t,n){return t&&E(e.prototype,t),n&&E(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function I(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t,n){var r=e;if(t.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object");t.set(e,n)}function f(e,t){t=O(e,t,"get");return t.get?t.get.call(e):t.value}function o(e,t,n){var t=O(e,t,"set"),r=n;if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}return n}function O(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}var d=l.default.global,C=e.default.scorm12,a=new WeakMap,m=new WeakMap,r=new WeakMap,k=function(){function n(e,t){if(M(this,n),i(this,a,{writable:!0,value:void 0}),i(this,m,{writable:!0,value:void 0}),i(this,r,{writable:!0,value:{autocommit:!1,autocommitSeconds:10,asyncCommit:!1,sendBeaconCommit:!1,lmsCommitUrl:!1,dataCommitFormat:"json",commitRequestDataType:"application/json;charset=UTF-8",autoProgress:!1,logLevel:d.LOG_LEVEL_ERROR,selfReportSessionTime:!1,alwaysSendTotalTime:!1,strict_errors:!0,xhrHeaders:{},xhrWithCredentials:!1,responseHandler:function(e){var t;return void 0!==e&&(null!==(t=JSON.parse(e.responseText))&&{}.hasOwnProperty.call(t,"result")||(t={},200===e.status?(t.result=d.SCORM_TRUE,t.errorCode=0):(t.result=d.SCORM_FALSE,t.errorCode=101))),t},requestHandler:function(e){return e},onLogMessage:function(e,t){switch(e){case d.LOG_LEVEL_ERROR:console.error(t);break;case d.LOG_LEVEL_WARNING:console.warn(t);break;case d.LOG_LEVEL_INFO:console.info(t);break;case d.LOG_LEVEL_DEBUG:console.debug?console.debug(t):console.log(t)}}}}),I(this,"cmi",void 0),I(this,"startingData",void 0),(this instanceof n?this.constructor:void 0)===n)throw new TypeError("Cannot construct BaseAPI instances directly");this.currentState=d.STATE_NOT_INITIALIZED,this.lastErrorCode=0,this.listenerArray=[],o(this,a,null),o(this,m,e),this.settings=t,this.apiLogLevel=this.settings.logLevel,this.selfReportSessionTime=this.settings.selfReportSessionTime}return S(n,[{key:"initialize",value:function(e,t,n){var r=d.SCORM_FALSE;return this.isInitialized()?this.throwSCORMError(f(this,m).INITIALIZED,t):this.isTerminated()?this.throwSCORMError(f(this,m).TERMINATED,n):(this.selfReportSessionTime&&this.cmi.setStartTime(),this.currentState=d.STATE_INITIALIZED,this.lastErrorCode=0,r=d.SCORM_TRUE,this.processListeners(e)),this.apiLog(e,null,"returned: "+r,d.LOG_LEVEL_INFO),this.clearSCORMError(r),r}},{key:"error_codes",get:function(){return f(this,m)}},{key:"settings",get:function(){return f(this,r)},set:function(e){o(this,r,w(w({},f(this,r)),e))}},{key:"terminate",value:function(e,t){var n,r=d.SCORM_FALSE;return this.checkState(t,f(this,m).TERMINATION_BEFORE_INIT,f(this,m).MULTIPLE_TERMINATION)&&(this.currentState=d.STATE_TERMINATED,n=this.storeData(!0),!this.settings.sendBeaconCommit&&!this.settings.asyncCommit&&void 0!==n.errorCode&&0<n.errorCode&&this.throwSCORMError(n.errorCode),r=void 0!==n&&n.result?n.result:d.SCORM_FALSE,t&&(this.lastErrorCode=0),r=d.SCORM_TRUE,this.processListeners(e)),this.apiLog(e,null,"returned: "+r,d.LOG_LEVEL_INFO),this.clearSCORMError(r),r}},{key:"getValue",value:function(e,t,n){var r;if(this.checkState(t,f(this,m).RETRIEVE_BEFORE_INIT,f(this,m).RETRIEVE_AFTER_TERM)){t&&(this.lastErrorCode=0);try{r=this.getCMIValue(n)}catch(e){e instanceof c.ValidationError?(this.lastErrorCode=e.errorCode,r=d.SCORM_FALSE):(e.message?console.error(e.message):console.error(e),this.throwSCORMError(f(this,m).GENERAL))}this.processListeners(e,n)}return this.apiLog(e,n,": returned: "+r,d.LOG_LEVEL_INFO),this.clearSCORMError(r),r}},{key:"setValue",value:function(e,t,n,r,i){void 0!==i&&(i=String(i));var o=d.SCORM_FALSE;if(this.checkState(n,f(this,m).STORE_BEFORE_INIT,f(this,m).STORE_AFTER_TERM)){n&&(this.lastErrorCode=0);try{o=this.setCMIValue(r,i)}catch(e){e instanceof c.ValidationError?(this.lastErrorCode=e.errorCode,o=d.SCORM_FALSE):(e.message?console.error(e.message):console.error(e),this.throwSCORMError(f(this,m).GENERAL))}this.processListeners(e,r,i)}return void 0===o&&(o=d.SCORM_FALSE),"0"===String(this.lastErrorCode)&&this.settings.autocommit&&!f(this,a)&&this.scheduleCommit(1e3*this.settings.autocommitSeconds,t),this.apiLog(e,r,": "+i+": result: "+o,d.LOG_LEVEL_INFO),this.clearSCORMError(o),o}},{key:"commit",value:function(e,t){this.clearScheduledCommit();var n,r=d.SCORM_FALSE;return this.checkState(t,f(this,m).COMMIT_BEFORE_INIT,f(this,m).COMMIT_AFTER_TERM)&&(n=this.storeData(!1),!this.settings.sendBeaconCommit&&!this.settings.asyncCommit&&n.errorCode&&0<n.errorCode&&this.throwSCORMError(n.errorCode),r=void 0!==n&&n.result?n.result:d.SCORM_FALSE,this.apiLog(e,"HttpRequest"," Result: "+r,d.LOG_LEVEL_DEBUG),t&&(this.lastErrorCode=0),this.processListeners(e)),this.apiLog(e,null,"returned: "+r,d.LOG_LEVEL_INFO),this.clearSCORMError(r),r}},{key:"getLastError",value:function(e){var t=String(this.lastErrorCode);return this.processListeners(e),this.apiLog(e,null,"returned: "+t,d.LOG_LEVEL_INFO),t}},{key:"getErrorString",value:function(e,t){var n="";return null!==t&&""!==t&&(n=this.getLmsErrorMessageDetails(t),this.processListeners(e)),this.apiLog(e,null,"returned: "+n,d.LOG_LEVEL_INFO),n}},{key:"getDiagnostic",value:function(e,t){var n="";return null!==t&&""!==t&&(n=this.getLmsErrorMessageDetails(t,!0),this.processListeners(e)),this.apiLog(e,null,"returned: "+n,d.LOG_LEVEL_INFO),n}},{key:"checkState",value:function(e,t,n){return this.isNotInitialized()?(this.throwSCORMError(t),!1):!e||!this.isTerminated()||(this.throwSCORMError(n),!1)}},{key:"apiLog",value:function(e,t,n,r){n=this.formatMessage(e,t,n),r>=this.apiLogLevel&&this.settings.onLogMessage(r,n)}},{key:"formatMessage",value:function(e,t,n){for(var r="",i=20-(r+=e).length,o=0;o<i;o++)r+=" ";if(r+=": ",t)for(var i=70-(r+=t).length,a=0;a<i;a++)r+=" ";return n&&(r+=n),r}},{key:"stringMatches",value:function(e,t){return e&&t&&e.match(t)}},{key:"_checkObjectHasProperty",value:function(e,t){return Object.hasOwnProperty.call(e,t)||Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),t)||t in e}},{key:"getLmsErrorMessageDetails",value:function(e,t){throw new Error("The getLmsErrorMessageDetails method has not been implemented")}},{key:"getCMIValue",value:function(e){throw new Error("The getCMIValue method has not been implemented")}},{key:"setCMIValue",value:function(e,t){throw new Error("The setCMIValue method has not been implemented")}},{key:"_commonSetCMIValue",value:function(u,e,t,n){if(!t||""===t)return d.SCORM_FALSE;for(var r=t.split("."),i=this,o=d.SCORM_FALSE,a=!1,s="The data model element passed to ".concat(u," (").concat(t,") is not a valid SCORM data model element."),h=e?f(this,m).UNDEFINED_DATA_MODEL:f(this,m).GENERAL,c=0;c<r.length;c++){var l=r[c];if(c===r.length-1)e&&"{target="===l.substr(0,8)&&"function"==typeof i._isTargetValid?this.throwSCORMError(f(this,m).READ_ONLY_ELEMENT):this._checkObjectHasProperty(i,l)?(this.isInitialized()&&this.stringMatches(t,"\\.correct_responses\\.\\d+")&&this.validateCorrectResponse(t,n),e&&0!==this.lastErrorCode||(i[l]=n,o=d.SCORM_TRUE)):this.throwSCORMError(h,s);else{if(!(i=i[l])){this.throwSCORMError(h,s);break}i instanceof p.CMIArray&&(l=parseInt(r[c+1],10),isNaN(l)||((l=i.childArray[l])?(i=l,a=!0):(l=this.getChildElement(t,n,a),a=!0,l?(i.initialized&&l.initialize(),i.childArray.push(l),i=l):this.throwSCORMError(h,s)),c++))}}return o===d.SCORM_FALSE&&this.apiLog(u,null,"There was an error setting the value for: ".concat(t,", value of: ").concat(n),d.LOG_LEVEL_WARNING),o}},{key:"validateCorrectResponse",value:function(e,t){}},{key:"getChildElement",value:function(e,t,n){throw new Error("The getChildElement method has not been implemented")}},{key:"_commonGetCMIValue",value:function(e,t,n){if(!n||""===n)return"";for(var r=n.split("."),i=this,o=null,u="The data model element passed to ".concat(e," (").concat(n,") has not been initialized."),a="The data model element passed to ".concat(e," (").concat(n,") is not a valid SCORM data model element."),s=t?f(this,m).UNDEFINED_DATA_MODEL:f(this,m).GENERAL,c=0;c<r.length;c++){if(o=r[c],t){if("{target="===String(o).substr(0,8)&&"function"==typeof i._isTargetValid)return l=String(o).substr(8,String(o).length-9),i._isTargetValid(l);if(!this._checkObjectHasProperty(i,o))return void this.throwSCORMError(s,a)}else if(c===r.length-1&&!this._checkObjectHasProperty(i,o))return void this.throwSCORMError(s,a);if(void 0===(i=i[o])){this.throwSCORMError(s,a);break}if(i instanceof p.CMIArray){var l=parseInt(r[c+1],10);if(!isNaN(l)){var h=i.childArray[l];if(!h){this.throwSCORMError(f(this,m).VALUE_NOT_INITIALIZED,u);break}i=h,c++}}}if(null!=i)return i;t||("_children"===o?this.throwSCORMError(C.CHILDREN_ERROR):"_count"===o&&this.throwSCORMError(C.COUNT_ERROR))}},{key:"isInitialized",value:function(){return this.currentState===d.STATE_INITIALIZED}},{key:"isNotInitialized",value:function(){return this.currentState===d.STATE_NOT_INITIALIZED}},{key:"isTerminated",value:function(){return this.currentState===d.STATE_TERMINATED}},{key:"on",value:function(e,t){if(t)for(var n=e.split(" "),r=0;r<n.length;r++){var i=n[r].split(".");if(0===i.length)return;var o=i[0],a=null;1<i.length&&(a=e.replace(o+".","")),this.listenerArray.push({functionName:o,CMIElement:a,callback:t}),this.apiLog("on",o,"Added event listener: ".concat(this.listenerArray.length),d.LOG_LEVEL_INFO)}}},{key:"off",value:function(r,i){var o=this;if(i)for(var a=r.split(" "),e=0;e<a.length;e++){var t=function(e){e=a[e].split(".");if(0===e.length)return{v:void 0};var t=e[0],n=null,e=(1<e.length&&(n=r.replace(t+".","")),o.listenerArray.findIndex(function(e){return e.functionName===t&&e.CMIElement===n&&e.callback===i}));-1!==e&&(o.listenerArray.splice(e,1),o.apiLog("off",t,"Removed event listener: ".concat(o.listenerArray.length),d.LOG_LEVEL_INFO))}(e);if("object"===_(t))return t.v}}},{key:"clear",value:function(r){for(var i=this,o=r.split(" "),e=0;e<o.length;e++){var t=function(e){e=o[e].split(".");if(0===e.length)return{v:void 0};var t=e[0],n=null;1<e.length&&(n=r.replace(t+".","")),i.listenerArray=i.listenerArray.filter(function(e){return e.functionName!==t&&e.CMIElement!==n})}(e);if("object"===_(t))return t.v}}},{key:"processListeners",value:function(e,t,n){this.apiLog(e,t,n);for(var r=0;r<this.listenerArray.length;r++){var i=this.listenerArray[r],o=i.functionName===e,a=!!i.CMIElement,s=!1,s=t&&i.CMIElement&&"*"===i.CMIElement.substring(i.CMIElement.length-1)?0===t.indexOf(i.CMIElement.substring(0,i.CMIElement.length-1)):i.CMIElement===t;!o||a&&!s||i.callback(t,n)}}},{key:"throwSCORMError",value:function(e,t){t=t||this.getLmsErrorMessageDetails(e),this.apiLog("throwSCORMError",null,e+": "+t,d.LOG_LEVEL_ERROR),this.lastErrorCode=String(e)}},{key:"clearSCORMError",value:function(e){void 0!==e&&e!==d.SCORM_FALSE&&(this.lastErrorCode=0)}},{key:"storeData",value:function(e){throw new Error("The storeData method has not been implemented")}},{key:"loadFromFlattenedJSON",value:function(t,n){var r,i,e,o,a=this;function s(e,t,n){var r,e=e.match(n);return null!==e&&null!==(r=t.match(n))?(t=Number(e[2]))===(n=Number(r[2]))?"id"!==e[3]&&("type"!==e[3]||"id"===r[3])?1:-1:t-n:null}this.isNotInitialized()?(r=/^(cmi\.interactions\.)(\d+)\.(.*)$/,i=/^(cmi\.objectives\.)(\d+)\.(.*)$/,(e=Object.keys(t).map(function(e){return[String(e),t[e]]})).sort(function(e,t){var e=g(e,2),n=e[0],e=(e[1],g(t,2)),t=e[0];e[1];return null!==(e=s(n,t,r))||null!==(e=s(n,t,i))?e:n<t?-1:t<n?1:0}),e.forEach(function(e){(o={})[e[0]]=e[1],a.loadFromJSON((0,u.unflatten)(o),n)})):console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize.")}},{key:"loadFromJSON",value:function(e,t){if(this.isNotInitialized()){for(var n in t=void 0!==t?t:"cmi",this.startingData=e)if({}.hasOwnProperty.call(e,n)&&e[n]){var r=(t?t+".":"")+n,i=e[n];if(i.childArray)for(var o=0;o<i.childArray.length;o++)this.loadFromJSON(i.childArray[o],r+"."+o);else i.constructor===Object?this.loadFromJSON(i,r):this.setCMIValue(r,i)}}else console.error("loadFromJSON can only be called before the call to lmsInitialize.")}},{key:"renderCMIToJSONString",value:function(){var e=this.cmi;return JSON.stringify({cmi:e})}},{key:"renderCMIToJSONObject",value:function(){return JSON.parse(this.renderCMIToJSONString())}},{key:"renderCommitCMI",value:function(e){throw new Error("The storeData method has not been implemented")}},{key:"processHttpRequest",value:function(e,t){function n(e,t,n,r){if(r={result:d.SCORM_FALSE,errorCode:r.GENERAL},n.sendBeaconCommit)try{var i={type:n.commitRequestDataType},o=t instanceof Array?new Blob([t.join("&")],i):new Blob([JSON.stringify(t)],i),a={};navigator.sendBeacon(e,o)?(a.result=d.SCORM_TRUE,a.errorCode=0):(a.result=d.SCORM_FALSE,a.errorCode=101)}catch(e){return console.error(e),c.processListeners("CommitError"),r}else{var s=new XMLHttpRequest;s.open("POST",e,n.asyncCommit),Object.keys(n.xhrHeaders).length&&Object.keys(n.xhrHeaders).forEach(function(e){s.setRequestHeader(e,n.xhrHeaders[e])}),s.withCredentials=n.xhrWithCredentials,n.asyncCommit&&(s.onload=function(e){a="function"==typeof n.responseHandler?n.responseHandler(s):JSON.parse(s.responseText)});try{if((t=n.requestHandler(t))instanceof Array?(s.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),s.send(t.join("&"))):(s.setRequestHeader("Content-Type",n.commitRequestDataType),s.send(JSON.stringify(t))),n.asyncCommit)return(a={}).result=d.SCORM_TRUE,a.errorCode=0,c.processListeners("CommitSuccess"),a;a="function"==typeof n.responseHandler?n.responseHandler(s):JSON.parse(s.responseText)}catch(e){return console.error(e),c.processListeners("CommitError"),r}}return void 0===a?(c.processListeners("CommitError"),r):(!0===a.result||a.result===d.SCORM_TRUE?c.processListeners("CommitSuccess"):c.processListeners("CommitError"),a)}var r,i=2<arguments.length&&void 0!==arguments[2]&&arguments[2],c=this;return void 0!==y()?((r=y()(n,500))(e,t,this.settings,this.error_codes),i&&r.flush(),{result:d.SCORM_TRUE,errorCode:0}):n(e,t,this.settings,this.error_codes)}},{key:"scheduleCommit",value:function(e,t){o(this,a,new L(this,e,t)),this.apiLog("scheduleCommit","","scheduled",d.LOG_LEVEL_DEBUG)}},{key:"clearScheduledCommit",value:function(){f(this,a)&&(f(this,a).cancel(),o(this,a,null),this.apiLog("clearScheduledCommit","","cleared",d.LOG_LEVEL_DEBUG))}}]),n}(),T=new WeakMap,j=new WeakMap,s=new WeakMap,R=new WeakMap,L=function(){function r(e,t,n){M(this,r),i(this,T,{writable:!0,value:void 0}),i(this,j,{writable:!0,value:!1}),i(this,s,{writable:!0,value:void 0}),i(this,R,{writable:!0,value:void 0}),o(this,T,e),o(this,s,setTimeout(this.wrapper.bind(this),t)),o(this,R,n)}return S(r,[{key:"cancel",value:function(){o(this,j,!0),f(this,s)&&clearTimeout(f(this,s))}},{key:"wrapper",value:function(){f(this,j)||f(this,T).commit(f(this,R))}}]),r}()},"./src/Scorm12API.js":
11
+ /*!***************************!*\
12
+ !*** ./src/Scorm12API.js ***!
13
+ \***************************/function(r,e,t){"use strict";t.r(e),t.d(e,{default:function(){return y}});var e=t(/*! ./BaseAPI */"./src/BaseAPI.js"),o=t(/*! ./cmi/scorm12_cmi */"./src/cmi/scorm12_cmi.js"),a=t(/*! ./utilities */"./src/utilities.js"),n=t(/*! ./constants/api_constants */"./src/constants/api_constants.js"),t=t(/*! ./constants/error_codes */"./src/constants/error_codes.js");function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function h(r){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?s(Object(i),!0).forEach(function(e){var t,n;t=r,n=i[e=e],e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):s(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))})}return r}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=c(n),t=(e=r?(e=c(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),this);if(e&&("object"===i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var l=n.default.scorm12,u=n.default.global,p=t.default.scorm12,y=function(e){var t=i;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e);var n,r=m(i);function i(e){if(!(this instanceof i))throw new TypeError("Cannot call a class as a function");var e=h(h({},{mastery_override:!1}),e);return(e=r.call(this,p,e)).cmi=new o.CMI,e.nav=new o.NAV,e.LMSInitialize=e.lmsInitialize,e.LMSFinish=e.lmsFinish,e.LMSGetValue=e.lmsGetValue,e.LMSSetValue=e.lmsSetValue,e.LMSCommit=e.lmsCommit,e.LMSGetLastError=e.lmsGetLastError,e.LMSGetErrorString=e.lmsGetErrorString,e.LMSGetDiagnostic=e.lmsGetDiagnostic,e}return t=i,(e=[{key:"lmsInitialize",value:function(){return this.cmi.initialize(),this.initialize("LMSInitialize","LMS was already initialized!","LMS is already finished!")}},{key:"lmsFinish",value:function(){var e=this.terminate("LMSFinish",!0);return e===u.SCORM_TRUE&&(""!==this.nav.event?"continue"===this.nav.event?this.processListeners("SequenceNext"):this.processListeners("SequencePrevious"):this.settings.autoProgress&&this.processListeners("SequenceNext")),e}},{key:"lmsGetValue",value:function(e){return this.getValue("LMSGetValue",!1,e)}},{key:"lmsSetValue",value:function(e,t){return this.setValue("LMSSetValue","LMSCommit",!1,e,t)}},{key:"lmsCommit",value:function(){return this.commit("LMSCommit",!1)}},{key:"lmsGetLastError",value:function(){return this.getLastError("LMSGetLastError")}},{key:"lmsGetErrorString",value:function(e){return this.getErrorString("LMSGetErrorString",e)}},{key:"lmsGetDiagnostic",value:function(e){return this.getDiagnostic("LMSGetDiagnostic",e)}},{key:"setCMIValue",value:function(e,t){return this._commonSetCMIValue("LMSSetValue",!1,e,t)}},{key:"getCMIValue",value:function(e){return this._commonGetCMIValue("getCMIValue",!1,e)}},{key:"getChildElement",value:function(e,t,n){var r;return this.stringMatches(e,"cmi\\.objectives\\.\\d+")?r=new o.CMIObjectivesObject:n&&this.stringMatches(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")?r=new o.CMIInteractionsCorrectResponsesObject:n&&this.stringMatches(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")?r=new o.CMIInteractionsObjectivesObject:!n&&this.stringMatches(e,"cmi\\.interactions\\.\\d+")&&(r=new o.CMIInteractionsObject),r}},{key:"validateCorrectResponse",value:function(e,t){return!0}},{key:"getLmsErrorMessageDetails",value:function(e,t){var n="No Error",r="No Error";return e=String(e),l.error_descriptions[e]&&(n=l.error_descriptions[e].basicMessage,r=l.error_descriptions[e].detailMessage),t?r:n}},{key:"replaceWithAnotherScormAPI",value:function(e){this.cmi=e.cmi}},{key:"renderCommitCMI",value:function(e){var t=this.renderCMIToJSONObject(),n=(e&&(t.cmi.core.total_time=this.cmi.getCurrentTotalTime()),[]),r=a.flatten(t);switch(this.settings.dataCommitFormat){case"flattened":return a.flatten(t);case"params":for(var i in r)!{}.hasOwnProperty.call(r,i)||n.push("".concat(i,"=").concat(r[i]));return n;default:return t}}},{key:"storeData",value:function(e){e&&("not attempted"===(t=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&&(parseFloat(this.cmi.core.score.raw)>=parseFloat(this.cmi.student_data.mastery_score)?this.cmi.core.lesson_status="passed":this.cmi.core.lesson_status="failed"):"browse"===this.cmi.core.lesson_mode&&""===((null===(i=this.startingData)||void 0===i||null===(n=i.cmi)||void 0===n||null===(r=n.core)||void 0===r?void 0:r.lesson_status)||"")&&"not attempted"===t&&(this.cmi.core.lesson_status="browsed"));var t,n,r,i=this.renderCommitCMI(e||this.settings.alwaysSendTotalTime);return this.apiLogLevel===u.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(i)),this.settings.lmsCommitUrl?this.processHttpRequest(this.settings.lmsCommitUrl,i,e):u.SCORM_TRUE}}])&&f(t.prototype,e),n&&f(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(e.default)},"./src/Scorm2004API.js":
14
+ /*!*****************************!*\
15
+ !*** ./src/Scorm2004API.js ***!
16
+ \*****************************/function(n,e,t){"use strict";t.r(e),t.d(e,{default:function(){return O}});var e=t(/*! ./BaseAPI */"./src/BaseAPI.js"),a=t(/*! ./cmi/scorm2004_cmi */"./src/cmi/scorm2004_cmi.js"),o=t(/*! ./utilities */"./src/utilities.js"),r=t(/*! ./constants/api_constants */"./src/constants/api_constants.js"),f=t(/*! ./constants/error_codes */"./src/constants/error_codes.js"),d=t(/*! ./constants/response_constants */"./src/constants/response_constants.js"),m=t(/*! ./constants/language_constants */"./src/constants/language_constants.js"),t=t(/*! ./constants/regex */"./src/constants/regex.js");function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function y(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function g(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?y(Object(n),!0).forEach(function(e){w(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function v(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _(e,t){return(_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=i(n),t=(e=r?(e=i(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),this);if(e&&("object"===p(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return s(t)}}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M(e,t,n){var r=e;if(t.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object");t.set(e,n)}function E(e,t){t=function(e,t,n){if(t.has(e))return t.get(e);throw new TypeError("attempted to "+n+" private field on non-instance")}(e,t,"get");return t.get?t.get.call(e):t.value}var c=r.default.scorm2004,l=r.default.global,u=f.default.scorm2004,h=d.default.correct,S=t.default.scorm2004,I=new WeakMap,O=function(e){var t=i;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_(t,e);var n,r=b(i);function i(e){if(!(this instanceof i))throw new TypeError("Cannot call a class as a function");var e=g(g({},{mastery_override:!1}),e);return M(s(e=r.call(this,u,e)),I,{writable:!0,value:void 0}),w(s(e),"checkDuplicatedPattern",function(e,t,n){for(var r=!1,i=e._count,o=0;o<i&&!r;o++)o!==t&&e.childArray[o]===n&&(r=!0);return r}),e.cmi=new a.CMI,e.adl=new a.ADL,e.Initialize=e.lmsInitialize,e.Terminate=e.lmsTerminate,e.GetValue=e.lmsGetValue,e.SetValue=e.lmsSetValue,e.Commit=e.lmsCommit,e.GetLastError=e.lmsGetLastError,e.GetErrorString=e.lmsGetErrorString,e.GetDiagnostic=e.lmsGetDiagnostic,e}return t=i,(e=[{key:"version",get:function(){return E(this,I)}},{key:"lmsInitialize",value:function(){return this.cmi.initialize(),this.initialize("Initialize")}},{key:"lmsTerminate",value:function(){var e=this.terminate("Terminate",!0);if(e===l.SCORM_TRUE)if("_none_"!==this.adl.nav.request)switch(this.adl.nav.request){case"continue":this.processListeners("SequenceNext");break;case"previous":this.processListeners("SequencePrevious");break;case"choice":this.processListeners("SequenceChoice");break;case"exit":this.processListeners("SequenceExit");break;case"exitAll":this.processListeners("SequenceExitAll");break;case"abandon":this.processListeners("SequenceAbandon");break;case"abandonAll":this.processListeners("SequenceAbandonAll")}else this.settings.autoProgress&&this.processListeners("SequenceNext");return e}},{key:"lmsGetValue",value:function(e){return this.getValue("GetValue",!0,e)}},{key:"lmsSetValue",value:function(e,t){return this.setValue("SetValue","Commit",!0,e,t)}},{key:"lmsCommit",value:function(){return this.commit("Commit")}},{key:"lmsGetLastError",value:function(){return this.getLastError("GetLastError")}},{key:"lmsGetErrorString",value:function(e){return this.getErrorString("GetErrorString",e)}},{key:"lmsGetDiagnostic",value:function(e){return this.getDiagnostic("GetDiagnostic",e)}},{key:"setCMIValue",value:function(e,t){return this._commonSetCMIValue("SetValue",!0,e,t)}},{key:"getChildElement",value:function(e,t,n){var r,i,o;return this.stringMatches(e,"cmi\\.objectives\\.\\d+")?r=new a.CMIObjectivesObject:n&&this.stringMatches(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")?(i=e.split("."),i=Number(i[2]),i=this.cmi.interactions.childArray[i],this.isInitialized()&&(i.type?(this.checkDuplicateChoiceResponse(i,t),(o=h[i.type])?this.checkValidResponseType(o,t,i.type):this.throwSCORMError(u.GENERAL_SET_FAILURE,"Incorrect Response Type: "+i.type)):this.throwSCORMError(u.DEPENDENCY_NOT_ESTABLISHED)),0===this.lastErrorCode&&(r=new a.CMIInteractionsCorrectResponsesObject)):n&&this.stringMatches(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")?r=new a.CMIInteractionsObjectivesObject:!n&&this.stringMatches(e,"cmi\\.interactions\\.\\d+")?r=new a.CMIInteractionsObject:this.stringMatches(e,"cmi\\.comments_from_learner\\.\\d+")?r=new a.CMICommentsObject:this.stringMatches(e,"cmi\\.comments_from_lms\\.\\d+")&&(r=new a.CMICommentsObject(!0)),r}},{key:"checkValidResponseType",value:function(e,t,n){var r=[];null!=e&&e.delimiter?r=String(t).split(e.delimiter):r[0]=t,0<r.length&&r.length<=e.max?this.checkCorrectResponseValue(n,r,t):r.length>e.max&&this.throwSCORMError(u.GENERAL_SET_FAILURE,"Data Model Element Pattern Too Long")}},{key:"checkDuplicateChoiceResponse",value:function(e,t){var n=e.correct_responses._count;if("choice"===e.type)for(var r=0;r<n&&0===this.lastErrorCode;r++)e.correct_responses.childArray[r].pattern===t&&this.throwSCORMError(u.GENERAL_SET_FAILURE)}},{key:"validateCorrectResponse",value:function(e,t){var e=e.split("."),n=Number(e[2]),e=Number(e[4]),n=this.cmi.interactions.childArray[n],r=n.correct_responses._count,i=(this.checkDuplicateChoiceResponse(n,t),h[n.type]);void 0===i.limit||r<=i.limit?(this.checkValidResponseType(i,t,n.type),0===this.lastErrorCode&&(!i.duplicate||!this.checkDuplicatedPattern(n.correct_responses,e,t))||0===this.lastErrorCode&&""===t||0===this.lastErrorCode&&this.throwSCORMError(u.GENERAL_SET_FAILURE,"Data Model Element Pattern Already Exists")):this.throwSCORMError(u.GENERAL_SET_FAILURE,"Data Model Element Collection Limit Reached")}},{key:"getCMIValue",value:function(e){return this._commonGetCMIValue("GetValue",!0,e)}},{key:"getLmsErrorMessageDetails",value:function(e,t){var n="",r="";return e=String(e),c.error_descriptions[e]&&(n=c.error_descriptions[e].basicMessage,r=c.error_descriptions[e].detailMessage),t?r:n}},{key:"checkCorrectResponseValue",value:function(e,t,n){for(var r=h[e],i=new RegExp(r.format),o=0;o<t.length&&0===this.lastErrorCode;o++)if(e.match("^(fill-in|long-fill-in|matching|performance|sequencing)$")&&(t[o]=this.removeCorrectResponsePrefixes(t[o])),null!=r&&r.delimiter2){var a=t[o].split(r.delimiter2);2===a.length&&a[0].match(i)&&a[1].match(new RegExp(r.format2))||this.throwSCORMError(u.TYPE_MISMATCH)}else{a=t[o].match(i);if(!a&&""!==n||!a&&"true-false"===e)this.throwSCORMError(u.TYPE_MISMATCH);else if("numeric"===e&&1<t.length)Number(t[0])>Number(t[1])&&this.throwSCORMError(u.TYPE_MISMATCH);else if(""!==t[o]&&r.unique)for(var s=0;s<o&&0===this.lastErrorCode;s++)t[o]===t[s]&&this.throwSCORMError(u.TYPE_MISMATCH)}}},{key:"removeCorrectResponsePrefixes",value:function(e){for(var t,n=!1,r=!1,i=!1,o=new RegExp("^({(lang|case_matters|order_matters)=([^}]+)})"),a=e.match(o);a;){switch(a[2]){case"lang":!(t=e.match(S.CMILangcr))||void 0!==(t=t[3])&&0<t.length&&void 0===m.default[t.toLowerCase()]&&this.throwSCORMError(u.TYPE_MISMATCH),i=!0;break;case"case_matters":i||n||r||"true"!==a[3]&&"false"!==a[3]&&this.throwSCORMError(u.TYPE_MISMATCH),r=!0;break;case"order_matters":r||i||n||"true"!==a[3]&&"false"!==a[3]&&this.throwSCORMError(u.TYPE_MISMATCH),n=!0}a=(e=e.substr(a[1].length)).match(o)}return e}},{key:"replaceWithAnotherScormAPI",value:function(e){this.cmi=e.cmi,this.adl=e.adl}},{key:"renderCommitCMI",value:function(e){var t=this.renderCMIToJSONObject(),n=(e&&(t.cmi.total_time=this.cmi.getCurrentTotalTime()),[]),r=o.flatten(t);switch(this.settings.dataCommitFormat){case"flattened":return o.flatten(t);case"params":for(var i in r)!{}.hasOwnProperty.call(r,i)||n.push("".concat(i,"=").concat(r[i]));return n;default:return t}}},{key:"storeData",value:function(e){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?(console.debug("Setting Completion Status: Completed"),this.cmi.completion_status="completed"):(console.debug("Setting Completion Status: Incomplete"),this.cmi.completion_status="incomplete")),this.cmi.scaled_passing_score&&this.cmi.score.scaled&&(this.cmi.score.scaled>=this.cmi.scaled_passing_score?(console.debug("Setting Success Status: Passed"),this.cmi.success_status="passed"):(console.debug("Setting Success Status: Failed"),this.cmi.success_status="failed")));var t,n,r=!1,i=(this.adl.nav.request!==(null===(i=this.startingData)||void 0===i||null===(n=i.adl)||void 0===n||null===(t=n.nav)||void 0===t?void 0:t.request)&&"_none_"!==this.adl.nav.request&&(this.adl.nav.request=encodeURIComponent(this.adl.nav.request),r=!0),this.renderCommitCMI(e||this.settings.alwaysSendTotalTime));return this.apiLogLevel===l.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(i)),this.settings.lmsCommitUrl?(n=this.processHttpRequest(this.settings.lmsCommitUrl,i,e),r&&void 0!==n.navRequest&&""!==n.navRequest&&Function('"use strict";(() => { '.concat(n.navRequest," })()"))(),n):l.SCORM_TRUE}}])&&v(t.prototype,e),n&&v(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(e.default)},"./src/cmi/aicc_cmi.js":
17
+ /*!*****************************!*\
18
+ !*** ./src/cmi/aicc_cmi.js ***!
19
+ \*****************************/function(t,n,f){"use strict";f.r(n),f.d(n,{CMI:function(){return C},CMIStudentDemographics:function(){return K},CMIPaths:function(){return Q},CMIPathsObject:function(){return ae},CMITries:function(){return se},CMITriesObject:function(){return ue},CMIAttemptRecords:function(){return he},CMIAttemptRecordsObject:function(){return de},CMIEvaluationCommentsObject:function(){return ge}});var d=f(/*! ./scorm12_cmi */"./src/cmi/scorm12_cmi.js"),r=f(/*! ./common */"./src/cmi/common.js"),n=f(/*! ../constants/api_constants */"./src/constants/api_constants.js"),m=f(/*! ../constants/regex */"./src/constants/regex.js"),p=f(/*! ../constants/error_codes */"./src/constants/error_codes.js"),y=f(/*! ../exceptions */"./src/exceptions.js");function g(e){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t,n){var r=e;if(t.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object");t.set(e,n)}function o(e,t,n){var t=v(e,t,"set"),r=n;if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}return n}function e(e,t){t=v(e,t,"get");return t.get?t.get.call(e):t.value}function v(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t,n){return t&&_(e.prototype,t),n&&_(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function b(){return(b="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=S(e)););return e}(e,t);if(r)return r=Object.getOwnPropertyDescriptor(r,t),r.get?r.get.call(arguments.length<3?e:n):r.value}).apply(this,arguments)}function w(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&M(e,t)}function M(e,t){return(M=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function E(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=S(n),t=(e=r?(e=S(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),this);if(e&&("object"===g(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return c(t)}}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var I=n.default.aicc,l=m.default.aicc,O=p.default.scorm12;function u(){throw new y.AICCValidationError(O.READ_ONLY_ELEMENT)}function h(e,t,n){return(0,r.checkValidFormat)(e,t,O.TYPE_MISMATCH,y.AICCValidationError,n)}var C=function(){w(r,d.CMI);var n=E(r);function r(e){var t;return a(this,r),t=n.call(this,I.cmi_children),e&&t.initialize(),t.student_preference=new D,t.student_data=new z,t.student_demographics=new K,t.evaluation=new k,t.paths=new Q,t}return s(r,[{key:"initialize",value:function(){var e;b(S(r.prototype),"initialize",this).call(this),null!==(e=this.student_preference)&&void 0!==e&&e.initialize(),null!==(e=this.student_data)&&void 0!==e&&e.initialize(),null!==(e=this.student_demographics)&&void 0!==e&&e.initialize(),null!==(e=this.evaluation)&&void 0!==e&&e.initialize(),null!==(e=this.paths)&&void 0!==e&&e.initialize()}},{key:"toJSON",value: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}}]),r}(),k=function(){w(n,r.BaseCMI);var t=E(n);function n(){var e;return a(this,n),(e=t.call(this)).comments=new T,e}return s(n,[{key:"initialize",value:function(){var e;b(S(n.prototype),"initialize",this).call(this),null!==(e=this.comments)&&void 0!==e&&e.initialize()}},{key:"toJSON",value:function(){this.jsonString=!0;var e={comments:this.comments};return delete this.jsonString,e}}]),n}(),T=function(){w(t,r.CMIArray);var e=E(t);function t(){return a(this,t),e.call(this,{children:I.comments_children,errorCode:O.INVALID_SET_VALUE,errorClass:y.AICCValidationError})}return s(t)}(),j=new WeakMap,R=new WeakMap,L=new WeakMap,A=new WeakMap,N=new WeakMap,D=function(){w(n,d.CMIStudentPreference);var t=E(n);function n(){var e;return a(this,n),i(c(e=t.call(this,I.student_preference_children)),j,{writable:!0,value:""}),i(c(e),R,{writable:!0,value:""}),i(c(e),L,{writable:!0,value:""}),i(c(e),A,{writable:!0,value:""}),i(c(e),N,{writable:!0,value:""}),e.windows=new r.CMIArray({errorCode:O.INVALID_SET_VALUE,errorClass:y.AICCValidationError,children:""}),e}return s(n,[{key:"initialize",value:function(){var e;b(S(n.prototype),"initialize",this).call(this),null!==(e=this.windows)&&void 0!==e&&e.initialize()}},{key:"lesson_type",get:function(){return e(this,j)},set:function(e){h(e,l.CMIString256)&&o(this,j,e)}},{key:"text_color",get:function(){return e(this,R)},set:function(e){h(e,l.CMIString256)&&o(this,R,e)}},{key:"text_location",get:function(){return e(this,L)},set:function(e){h(e,l.CMIString256)&&o(this,L,e)}},{key:"text_size",get:function(){return e(this,A)},set:function(e){h(e,l.CMIString256)&&o(this,A,e)}},{key:"video",get:function(){return e(this,N)},set:function(e){h(e,l.CMIString256)&&o(this,N,e)}},{key:"toJSON",value: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}}]),n}(),P=new WeakMap,z=function(){w(n,d.CMIStudentData);var t=E(n);function n(){var e;return a(this,n),i(c(e=t.call(this,I.student_data_children)),P,{writable:!0,value:""}),e.tries=new se,e}return s(n,[{key:"initialize",value:function(){var e;b(S(n.prototype),"initialize",this).call(this),null!==(e=this.tries)&&void 0!==e&&e.initialize()}},{key:"tries_during_lesson",get:function(){return e(this,P)},set:function(e){this.initialized?u():o(this,P,e)}},{key:"toJSON",value: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};return delete this.jsonString,e}}]),n}(),V=new WeakMap,x=new WeakMap,W=new WeakMap,F=new WeakMap,G=new WeakMap,U=new WeakMap,B=new WeakMap,q=new WeakMap,$=new WeakMap,H=new WeakMap,J=new WeakMap,Y=new WeakMap,Z=new WeakMap,X=new WeakMap,K=function(){w(n,r.BaseCMI);var t=E(n);function n(){var e;return a(this,n),i(c(e=t.call(this)),V,{writable:!0,value:I.student_demographics_children}),i(c(e),x,{writable:!0,value:""}),i(c(e),W,{writable:!0,value:""}),i(c(e),F,{writable:!0,value:""}),i(c(e),G,{writable:!0,value:""}),i(c(e),U,{writable:!0,value:""}),i(c(e),B,{writable:!0,value:""}),i(c(e),q,{writable:!0,value:""}),i(c(e),$,{writable:!0,value:""}),i(c(e),H,{writable:!0,value:""}),i(c(e),J,{writable:!0,value:""}),i(c(e),Y,{writable:!0,value:""}),i(c(e),Z,{writable:!0,value:""}),i(c(e),X,{writable:!0,value:""}),e}return s(n,[{key:"_children",get:function(){return e(this,V)}},{key:"city",get:function(){return e(this,x)},set:function(e){this.initialized?u():o(this,x,e)}},{key:"class",get:function(){return e(this,W)},set:function(e){this.initialized?u():o(this,W,e)}},{key:"company",get:function(){return e(this,F)},set:function(e){this.initialized?u():o(this,F,e)}},{key:"country",get:function(){return e(this,G)},set:function(e){this.initialized?u():o(this,G,e)}},{key:"experience",get:function(){return e(this,U)},set:function(e){this.initialized?u():o(this,U,e)}},{key:"familiar_name",get:function(){return e(this,B)},set:function(e){this.initialized?u():o(this,B,e)}},{key:"instructor_name",get:function(){return e(this,q)},set:function(e){this.initialized?u():o(this,q,e)}},{key:"title",get:function(){return e(this,$)},set:function(e){this.initialized?u():o(this,$,e)}},{key:"native_language",get:function(){return e(this,H)},set:function(e){this.initialized?u():o(this,H,e)}},{key:"state",get:function(){return e(this,J)},set:function(e){this.initialized?u():o(this,J,e)}},{key:"street_address",get:function(){return e(this,Y)},set:function(e){this.initialized?u():o(this,Y,e)}},{key:"telephone",get:function(){return e(this,Z)},set:function(e){this.initialized?u():o(this,Z,e)}},{key:"years_experience",get:function(){return e(this,X)},set:function(e){this.initialized?u():o(this,X,e)}},{key:"toJSON",value: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}}]),n}(),Q=function(){w(t,r.CMIArray);var e=E(t);function t(){return a(this,t),e.call(this,{children:I.paths_children})}return s(t)}(),ee=new WeakMap,te=new WeakMap,ne=new WeakMap,re=new WeakMap,ie=new WeakMap,oe=new WeakMap,ae=function(){w(n,r.BaseCMI);var t=E(n);function n(){var e;return a(this,n),i(c(e=t.call(this)),ee,{writable:!0,value:""}),i(c(e),te,{writable:!0,value:""}),i(c(e),ne,{writable:!0,value:""}),i(c(e),re,{writable:!0,value:""}),i(c(e),ie,{writable:!0,value:""}),i(c(e),oe,{writable:!0,value:""}),e}return s(n,[{key:"location_id",get:function(){return e(this,ee)},set:function(e){h(e,l.CMIString256)&&o(this,ee,e)}},{key:"date",get:function(){return e(this,te)},set:function(e){h(e,l.CMIString256)&&o(this,te,e)}},{key:"time",get:function(){return e(this,ne)},set:function(e){h(e,l.CMITime)&&o(this,ne,e)}},{key:"status",get:function(){return e(this,re)},set:function(e){h(e,l.CMIStatus2)&&o(this,re,e)}},{key:"why_left",get:function(){return e(this,ie)},set:function(e){h(e,l.CMIString256)&&o(this,ie,e)}},{key:"time_in_element",get:function(){return e(this,oe)},set:function(e){h(e,l.CMITime)&&o(this,oe,e)}},{key:"toJSON",value: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}}]),n}(),se=function(){w(t,r.CMIArray);var e=E(t);function t(){return a(this,t),e.call(this,{children:I.tries_children})}return s(t)}(),ce=new WeakMap,le=new WeakMap,ue=function(){w(n,r.BaseCMI);var t=E(n);function n(){var e;return a(this,n),i(c(e=t.call(this)),ce,{writable:!0,value:""}),i(c(e),le,{writable:!0,value:""}),e.score=new r.CMIScore({score_children:I.score_children,score_range:l.score_range,invalidErrorCode:O.INVALID_SET_VALUE,invalidTypeCode:O.TYPE_MISMATCH,invalidRangeCode:O.VALUE_OUT_OF_RANGE,errorClass:y.AICCValidationError}),e}return s(n,[{key:"initialize",value:function(){var e;b(S(n.prototype),"initialize",this).call(this),null!==(e=this.score)&&void 0!==e&&e.initialize()}},{key:"status",get:function(){return e(this,ce)},set:function(e){h(e,l.CMIStatus2)&&o(this,ce,e)}},{key:"time",get:function(){return e(this,le)},set:function(e){h(e,l.CMITime)&&o(this,le,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={status:this.status,time:this.time,score:this.score};return delete this.jsonString,e}}]),n}(),he=function(){w(t,r.CMIArray);var e=E(t);function t(){return a(this,t),e.call(this,{children:I.attempt_records_children})}return s(t)}(),fe=new WeakMap,de=function(){w(n,r.BaseCMI);var t=E(n);function n(){var e;return a(this,n),i(c(e=t.call(this)),fe,{writable:!0,value:""}),e.score=new r.CMIScore({score_children:I.score_children,score_range:l.score_range,invalidErrorCode:O.INVALID_SET_VALUE,invalidTypeCode:O.TYPE_MISMATCH,invalidRangeCode:O.VALUE_OUT_OF_RANGE,errorClass:y.AICCValidationError}),e}return s(n,[{key:"initialize",value:function(){var e;b(S(n.prototype),"initialize",this).call(this),null!==(e=this.score)&&void 0!==e&&e.initialize()}},{key:"lesson_status",get:function(){return e(this,fe)},set:function(e){h(e,l.CMIStatus2)&&o(this,fe,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={lesson_status:this.lesson_status,score:this.score};return delete this.jsonString,e}}]),n}(),me=new WeakMap,pe=new WeakMap,ye=new WeakMap,ge=function(){w(n,r.BaseCMI);var t=E(n);function n(){var e;return a(this,n),i(c(e=t.call(this)),me,{writable:!0,value:""}),i(c(e),pe,{writable:!0,value:""}),i(c(e),ye,{writable:!0,value:""}),e}return s(n,[{key:"content",get:function(){return e(this,me)},set:function(e){h(e,l.CMIString256)&&o(this,me,e)}},{key:"location",get:function(){return e(this,pe)},set:function(e){h(e,l.CMIString256)&&o(this,pe,e)}},{key:"time",get:function(){return e(this,ye)},set:function(e){h(e,l.CMITime)&&o(this,ye,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={content:this.content,location:this.location,time:this.time};return delete this.jsonString,e}}]),n}()},"./src/cmi/common.js":
20
+ /*!***************************!*\
21
+ !*** ./src/cmi/common.js ***!
22
+ \***************************/function(n,r,e){"use strict";e.r(r),e.d(r,{checkValidFormat:function(){return I},checkValidRange:function(){return O},BaseCMI:function(){return T},CMIScore:function(){return D},CMIArray:function(){return x}});var r=e(/*! ../constants/api_constants */"./src/constants/api_constants.js"),i=e(/*! ../constants/error_codes */"./src/constants/error_codes.js"),e=e(/*! ../constants/regex */"./src/constants/regex.js");function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=l(n),t=(e=r?(e=l(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),this);if(e&&("object"===o(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return h(t)}}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function b(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(e,t,n){var r=e;if(t.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object");t.set(e,n)}function d(e,t,n){var t=w(e,t,"set"),r=n;if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}return n}function t(e,t){t=w(e,t,"get");return t.get?t.get.call(e):t.value}function w(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}var M=r.default.scorm12,E=e.default.scorm12,S=i.default.scorm12;function I(e,t,n,r,i){t=new RegExp(t),t=e.match(t);if(i&&""===e)return!0;if(void 0===e||!t||""===t[0])throw new r.prototype.constructor(n);return!0}function O(e,t,n,r){t=t.split("#");if((e=+e)>=t[0]){if("*"===t[1]||e<=t[1])return!0;throw new r.prototype.constructor(n)}throw new r.prototype.constructor(n)}var C=new WeakMap,k=new WeakMap,T=function(){function r(){var e,t,n;if(_(this,r),n=!(t="jsonString"),t in(e=this)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,f(this,C,{writable:!0,value:!1}),f(this,k,{writable:!0,value:void 0}),(this instanceof r?this.constructor:void 0)===r)throw new TypeError("Cannot construct BaseCMI instances directly")}return b(r,[{key:"initialized",get:function(){return t(this,C)}},{key:"start_time",get:function(){return t(this,k)}},{key:"initialize",value:function(){d(this,C,!0)}},{key:"setStartTime",value:function(){d(this,k,(new Date).getTime())}}]),r}(),j=new WeakMap,m=new WeakMap,R=new WeakMap,p=new WeakMap,y=new WeakMap,g=new WeakMap,v=new WeakMap,L=new WeakMap,A=new WeakMap,N=new WeakMap,D=function(){a(u,T);var l=c(u);function u(e){var t,n=e.score_children,r=e.score_range,i=e.max,o=e.invalidErrorCode,a=e.invalidTypeCode,s=e.invalidRangeCode,c=e.decimalRegex,e=e.errorClass;return _(this,u),f(h(t=l.call(this)),j,{writable:!0,value:void 0}),f(h(t),m,{writable:!0,value:void 0}),f(h(t),R,{writable:!0,value:void 0}),f(h(t),p,{writable:!0,value:void 0}),f(h(t),y,{writable:!0,value:void 0}),f(h(t),g,{writable:!0,value:void 0}),f(h(t),v,{writable:!0,value:void 0}),f(h(t),L,{writable:!0,value:""}),f(h(t),A,{writable:!0,value:""}),f(h(t),N,{writable:!0,value:void 0}),d(h(t),j,n||M.score_children),d(h(t),m,!!r&&E.score_range),d(h(t),N,i||""===i?i:"100"),d(h(t),R,o||S.INVALID_SET_VALUE),d(h(t),p,a||S.TYPE_MISMATCH),d(h(t),y,s||S.VALUE_OUT_OF_RANGE),d(h(t),g,c||E.CMIDecimal),d(h(t),v,e),t}return b(u,[{key:"_children",get:function(){return t(this,j)},set:function(e){throw new(t(this,v).prototype.constructor)(t(this,R))}},{key:"raw",get:function(){return t(this,L)},set:function(e){!I(e,t(this,g),t(this,p),t(this,v))||t(this,m)&&!O(e,t(this,m),t(this,y),t(this,v))||d(this,L,e)}},{key:"min",get:function(){return t(this,A)},set:function(e){!I(e,t(this,g),t(this,p),t(this,v))||t(this,m)&&!O(e,t(this,m),t(this,y),t(this,v))||d(this,A,e)}},{key:"max",get:function(){return t(this,N)},set:function(e){!I(e,t(this,g),t(this,p),t(this,v))||t(this,m)&&!O(e,t(this,m),t(this,y),t(this,v))||d(this,N,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={raw:this.raw,min:this.min,max:this.max};return delete this.jsonString,e}}]),u}(),P=new WeakMap,z=new WeakMap,V=new WeakMap,x=function(){a(o,T);var i=c(o);function o(e){var t,n=e.children,r=e.errorCode,e=e.errorClass;return _(this,o),f(h(t=i.call(this)),P,{writable:!0,value:void 0}),f(h(t),z,{writable:!0,value:void 0}),f(h(t),V,{writable:!0,value:void 0}),d(h(t),V,n),d(h(t),P,r),d(h(t),z,e),t.childArray=[],t}return b(o,[{key:"_children",get:function(){return t(this,V)},set:function(e){throw new(t(this,z).prototype.constructor)(t(this,P))}},{key:"_count",get:function(){return this.childArray.length},set:function(e){throw new(t(this,z).prototype.constructor)(t(this,P))}},{key:"toJSON",value:function(){this.jsonString=!0;for(var e={},t=0;t<this.childArray.length;t++)e[t+""]=this.childArray[t];return delete this.jsonString,e}}]),o}()},"./src/cmi/scorm12_cmi.js":
23
+ /*!********************************!*\
24
+ !*** ./src/cmi/scorm12_cmi.js ***!
25
+ \********************************/function(e,t,n){"use strict";n.r(t),n.d(t,{throwReadOnlyError:function(){return f},throwWriteOnlyError:function(){return C},check12ValidFormat:function(){return d},check12ValidRange:function(){return T},CMI:function(){return D},CMIStudentData:function(){return ee},CMIStudentPreference:function(){return ae},CMIInteractionsObject:function(){return pe},CMIObjectivesObject:function(){return ve},CMIInteractionsObjectivesObject:function(){return be},CMIInteractionsCorrectResponsesObject:function(){return Me},NAV:function(){return Se}});var i=n(/*! ./common */"./src/cmi/common.js"),t=n(/*! ../constants/api_constants */"./src/constants/api_constants.js"),c=n(/*! ../constants/error_codes */"./src/constants/error_codes.js"),m=n(/*! ../constants/regex */"./src/constants/regex.js"),r=n(/*! ../exceptions */"./src/exceptions.js"),p=n(/*! ../utilities */"./src/utilities.js");function y(e){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _(e,t,n){return t&&v(e.prototype,t),n&&v(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function b(){return(b="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=S(e)););return e}(e,t);if(r)return r=Object.getOwnPropertyDescriptor(r,t),r.get?r.get.call(arguments.length<3?e:n):r.value}).apply(this,arguments)}function w(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&M(e,t)}function M(e,t){return(M=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function E(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=S(n),t=(e=r?(e=S(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),this);if(e&&("object"===y(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return l(t)}}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t,n){var r=e;if(t.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object");t.set(e,n)}function o(e,t){t=I(e,t,"get");return t.get?t.get.call(e):t.value}function h(e,t,n){var t=I(e,t,"set"),r=n;if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}return n}function I(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}var O=t.default.scorm12,a=m.default.scorm12,s=c.default.scorm12;function f(){throw new r.Scorm12ValidationError(s.READ_ONLY_ELEMENT)}function C(){throw new r.Scorm12ValidationError(s.WRITE_ONLY_ELEMENT)}function k(){throw new r.Scorm12ValidationError(s.INVALID_SET_VALUE)}function d(e,t,n){return(0,i.checkValidFormat)(e,t,s.TYPE_MISMATCH,r.Scorm12ValidationError,n)}function T(e,t,n){return(0,i.checkValidRange)(e,t,s.VALUE_OUT_OF_RANGE,r.Scorm12ValidationError,n)}var j=new WeakMap,R=new WeakMap,L=new WeakMap,A=new WeakMap,N=new WeakMap,D=function(){w(c,i.BaseCMI);var s=E(c);function c(e,t,n){var r,i,o,a;return g(this,c),u(l(r=s.call(this)),j,{writable:!0,value:""}),u(l(r),R,{writable:!0,value:"3.4"}),u(l(r),L,{writable:!0,value:""}),u(l(r),A,{writable:!0,value:""}),u(l(r),N,{writable:!0,value:""}),i=l(r),a=null,(o="student_data")in i?Object.defineProperty(i,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[o]=a,n&&r.initialize(),h(l(r),j,e||O.cmi_children),r.core=new J,r.objectives=new Y,r.student_data=t||new ee,r.student_preference=new ae,r.interactions=new se,r}return _(c,[{key:"initialize",value:function(){var e;b(S(c.prototype),"initialize",this).call(this),null!==(e=this.core)&&void 0!==e&&e.initialize(),null!==(e=this.objectives)&&void 0!==e&&e.initialize(),null!==(e=this.student_data)&&void 0!==e&&e.initialize(),null!==(e=this.student_preference)&&void 0!==e&&e.initialize(),null!==(e=this.interactions)&&void 0!==e&&e.initialize()}},{key:"toJSON",value: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}},{key:"_version",get:function(){return o(this,R)},set:function(e){k()}},{key:"_children",get:function(){return o(this,j)},set:function(e){k()}},{key:"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)}},{key:"launch_data",get:function(){return o(this,L)},set:function(e){this.initialized?f():h(this,L,e)}},{key:"comments",get:function(){return o(this,A)},set:function(e){d(e,a.CMIString4096,!0)&&h(this,A,e)}},{key:"comments_from_lms",get:function(){return o(this,N)},set:function(e){this.initialized?f():h(this,N,e)}},{key:"getCurrentTotalTime",value:function(){return this.core.getCurrentTotalTime(this.start_time)}}]),c}(),P=new WeakMap,z=new WeakMap,V=new WeakMap,x=new WeakMap,W=new WeakMap,F=new WeakMap,G=new WeakMap,U=new WeakMap,B=new WeakMap,q=new WeakMap,$=new WeakMap,H=new WeakMap,J=function(){w(n,i.BaseCMI);var t=E(n);function n(){var e;return g(this,n),u(l(e=t.call(this)),P,{writable:!0,value:O.core_children}),u(l(e),z,{writable:!0,value:""}),u(l(e),V,{writable:!0,value:""}),u(l(e),x,{writable:!0,value:""}),u(l(e),W,{writable:!0,value:""}),u(l(e),F,{writable:!0,value:"not attempted"}),u(l(e),G,{writable:!0,value:""}),u(l(e),U,{writable:!0,value:""}),u(l(e),B,{writable:!0,value:"normal"}),u(l(e),q,{writable:!0,value:""}),u(l(e),$,{writable:!0,value:"00:00:00"}),u(l(e),H,{writable:!0,value:""}),e.score=new i.CMIScore({score_children:O.score_children,score_range:a.score_range,invalidErrorCode:s.INVALID_SET_VALUE,invalidTypeCode:s.TYPE_MISMATCH,invalidRangeCode:s.VALUE_OUT_OF_RANGE,errorClass:r.Scorm12ValidationError}),e}return _(n,[{key:"initialize",value:function(){var e;b(S(n.prototype),"initialize",this).call(this),null!==(e=this.score)&&void 0!==e&&e.initialize()}},{key:"_children",get:function(){return o(this,P)},set:function(e){k()}},{key:"student_id",get:function(){return o(this,z)},set:function(e){this.initialized?f():h(this,z,e)}},{key:"student_name",get:function(){return o(this,V)},set:function(e){this.initialized?f():h(this,V,e)}},{key:"lesson_location",get:function(){return o(this,x)},set:function(e){d(e,a.CMIString256,!0)&&h(this,x,e)}},{key:"credit",get:function(){return o(this,W)},set:function(e){this.initialized?f():h(this,W,e)}},{key:"lesson_status",get:function(){return o(this,F)},set:function(e){this.initialized?d(e,a.CMIStatus)&&h(this,F,e):d(e,a.CMIStatus2)&&h(this,F,e)}},{key:"entry",get:function(){return o(this,G)},set:function(e){this.initialized?f():h(this,G,e)}},{key:"total_time",get:function(){return o(this,U)},set:function(e){this.initialized?f():h(this,U,e)}},{key:"lesson_mode",get:function(){return o(this,B)},set:function(e){this.initialized?f():h(this,B,e)}},{key:"exit",get:function(){return this.jsonString?o(this,q):C()},set:function(e){d(e,a.CMIExit,!0)&&h(this,q,e)}},{key:"session_time",get:function(){return this.jsonString?o(this,$):C()},set:function(e){d(e,a.CMITimespan)&&h(this,$,e)}},{key:"suspend_data",get:function(){return o(this,H)},set:function(e){d(e,a.CMIString4096,!0)&&h(this,H,e)}},{key:"getCurrentTotalTime",value:function(e){var t=o(this,$);return null!=e&&(e=(new Date).getTime()-e,t=p.getSecondsAsHHMMSS(e/1e3)),p.addHHMMSSTimeStrings(o(this,U),t,new RegExp(a.CMITimespan))}},{key:"toJSON",value: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}}]),n}(),Y=function(){w(t,i.CMIArray);var e=E(t);function t(){return g(this,t),e.call(this,{children:O.objectives_children,errorCode:s.INVALID_SET_VALUE,errorClass:r.Scorm12ValidationError})}return _(t)}(),Z=new WeakMap,X=new WeakMap,K=new WeakMap,Q=new WeakMap,ee=function(){w(r,i.BaseCMI);var n=E(r);function r(e){var t;return g(this,r),u(l(t=n.call(this)),Z,{writable:!0,value:void 0}),u(l(t),X,{writable:!0,value:""}),u(l(t),K,{writable:!0,value:""}),u(l(t),Q,{writable:!0,value:""}),h(l(t),Z,e||O.student_data_children),t}return _(r,[{key:"_children",get:function(){return o(this,Z)},set:function(e){k()}},{key:"mastery_score",get:function(){return o(this,X)},set:function(e){this.initialized?f():h(this,X,e)}},{key:"max_time_allowed",get:function(){return o(this,K)},set:function(e){this.initialized?f():h(this,K,e)}},{key:"time_limit_action",get:function(){return o(this,Q)},set:function(e){this.initialized?f():h(this,Q,e)}},{key:"toJSON",value: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}}]),r}(),te=new WeakMap,ne=new WeakMap,re=new WeakMap,ie=new WeakMap,oe=new WeakMap,ae=function(){w(r,i.BaseCMI);var n=E(r);function r(e){var t;return g(this,r),u(l(t=n.call(this)),te,{writable:!0,value:void 0}),u(l(t),ne,{writable:!0,value:""}),u(l(t),re,{writable:!0,value:""}),u(l(t),ie,{writable:!0,value:""}),u(l(t),oe,{writable:!0,value:""}),h(l(t),te,e||O.student_preference_children),t}return _(r,[{key:"_children",get:function(){return o(this,te)},set:function(e){k()}},{key:"audio",get:function(){return o(this,ne)},set:function(e){d(e,a.CMISInteger)&&T(e,a.audio_range)&&h(this,ne,e)}},{key:"language",get:function(){return o(this,re)},set:function(e){d(e,a.CMIString256)&&h(this,re,e)}},{key:"speed",get:function(){return o(this,ie)},set:function(e){d(e,a.CMISInteger)&&T(e,a.speed_range)&&h(this,ie,e)}},{key:"text",get:function(){return o(this,oe)},set:function(e){d(e,a.CMISInteger)&&T(e,a.text_range)&&h(this,oe,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,speed:this.speed,text:this.text};return delete this.jsonString,e}}]),r}(),se=function(){w(t,i.CMIArray);var e=E(t);function t(){return g(this,t),e.call(this,{children:O.interactions_children,errorCode:s.INVALID_SET_VALUE,errorClass:r.Scorm12ValidationError})}return _(t)}(),ce=new WeakMap,le=new WeakMap,ue=new WeakMap,he=new WeakMap,fe=new WeakMap,de=new WeakMap,me=new WeakMap,pe=function(){w(n,i.BaseCMI);var t=E(n);function n(){var e;return g(this,n),u(l(e=t.call(this)),ce,{writable:!0,value:""}),u(l(e),le,{writable:!0,value:""}),u(l(e),ue,{writable:!0,value:""}),u(l(e),he,{writable:!0,value:""}),u(l(e),fe,{writable:!0,value:""}),u(l(e),de,{writable:!0,value:""}),u(l(e),me,{writable:!0,value:""}),e.objectives=new i.CMIArray({errorCode:s.INVALID_SET_VALUE,errorClass:r.Scorm12ValidationError,children:O.objectives_children}),e.correct_responses=new i.CMIArray({errorCode:s.INVALID_SET_VALUE,errorClass:r.Scorm12ValidationError,children:O.correct_responses_children}),e}return _(n,[{key:"initialize",value:function(){var e;b(S(n.prototype),"initialize",this).call(this),null!==(e=this.objectives)&&void 0!==e&&e.initialize(),null!==(e=this.correct_responses)&&void 0!==e&&e.initialize()}},{key:"id",get:function(){return this.jsonString?o(this,ce):C()},set:function(e){d(e,a.CMIIdentifier)&&h(this,ce,e)}},{key:"time",get:function(){return this.jsonString?o(this,le):C()},set:function(e){d(e,a.CMITime)&&h(this,le,e)}},{key:"type",get:function(){return this.jsonString?o(this,ue):C()},set:function(e){d(e,a.CMIType)&&h(this,ue,e)}},{key:"weighting",get:function(){return this.jsonString?o(this,he):C()},set:function(e){d(e,a.CMIDecimal)&&T(e,a.weighting_range)&&h(this,he,e)}},{key:"student_response",get:function(){return this.jsonString?o(this,fe):C()},set:function(e){d(e,a.CMIFeedback,!0)&&h(this,fe,e)}},{key:"result",get:function(){return this.jsonString?o(this,de):C()},set:function(e){d(e,a.CMIResult)&&h(this,de,e)}},{key:"latency",get:function(){return this.jsonString?o(this,me):C()},set:function(e){d(e,a.CMITimespan)&&h(this,me,e)}},{key:"toJSON",value: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}}]),n}(),ye=new WeakMap,ge=new WeakMap,ve=function(){w(n,i.BaseCMI);var t=E(n);function n(){var e;return g(this,n),u(l(e=t.call(this)),ye,{writable:!0,value:""}),u(l(e),ge,{writable:!0,value:""}),e.score=new i.CMIScore({score_children:O.score_children,score_range:a.score_range,invalidErrorCode:s.INVALID_SET_VALUE,invalidTypeCode:s.TYPE_MISMATCH,invalidRangeCode:s.VALUE_OUT_OF_RANGE,errorClass:r.Scorm12ValidationError}),e}return _(n,[{key:"id",get:function(){return o(this,ye)},set:function(e){d(e,a.CMIIdentifier)&&h(this,ye,e)}},{key:"status",get:function(){return o(this,ge)},set:function(e){d(e,a.CMIStatus2)&&h(this,ge,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={id:this.id,status:this.status,score:this.score};return delete this.jsonString,e}}]),n}(),_e=new WeakMap,be=function(){w(n,i.BaseCMI);var t=E(n);function n(){var e;return g(this,n),u(l(e=t.call(this)),_e,{writable:!0,value:""}),e}return _(n,[{key:"id",get:function(){return o(this,_e)},set:function(e){d(e,a.CMIIdentifier)&&h(this,_e,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={id:this.id};return delete this.jsonString,e}}]),n}(),we=new WeakMap,Me=function(){w(n,i.BaseCMI);var t=E(n);function n(){var e;return g(this,n),u(l(e=t.call(this)),we,{writable:!0,value:""}),e}return _(n,[{key:"pattern",get:function(){return this.jsonString?o(this,we):C()},set:function(e){d(e,a.CMIFeedback,!0)&&h(this,we,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={pattern:this.pattern};return delete this.jsonString,e}}]),n}(),Ee=new WeakMap,Se=function(){w(n,i.BaseCMI);var t=E(n);function n(){var e;return g(this,n),u(l(e=t.call(this)),Ee,{writable:!0,value:""}),e}return _(n,[{key:"event",get:function(){return o(this,Ee)},set:function(e){d(e,a.NAVEvent)&&h(this,Ee,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={event:this.event};return delete this.jsonString,e}}]),n}()},"./src/cmi/scorm2004_cmi.js":
26
+ /*!**********************************!*\
27
+ !*** ./src/cmi/scorm2004_cmi.js ***!
28
+ \**********************************/function(e,t,n){"use strict";n.r(t),n.d(t,{CMI:function(){return ee},CMIInteractionsObject:function(){return _e},CMIObjectivesObject:function(){return Ie},CMICommentsObject:function(){return Le},CMIInteractionsObjectivesObject:function(){return Ne},CMIInteractionsCorrectResponsesObject:function(){return Pe},ADL:function(){return ze}});var i=n(/*! ./common */"./src/cmi/common.js"),t=n(/*! ../constants/api_constants */"./src/constants/api_constants.js"),r=n(/*! ../constants/regex */"./src/constants/regex.js"),m=n(/*! ../constants/error_codes */"./src/constants/error_codes.js"),p=n(/*! ../constants/response_constants */"./src/constants/response_constants.js"),y=n(/*! ../exceptions */"./src/exceptions.js"),g=n(/*! ../utilities */"./src/utilities.js");function v(e){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,n){return t&&b(e.prototype,t),n&&b(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function w(){return(w="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=I(e)););return e}(e,t);if(r)return r=Object.getOwnPropertyDescriptor(r,t),r.get?r.get.call(arguments.length<3?e:n):r.value}).apply(this,arguments)}function M(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&E(e,t)}function E(e,t){return(E=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function S(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=I(n),t=(e=r?(e=I(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),this);if(e&&("object"===v(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return s(t)}}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function I(e){return(I=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t,n){var r=e;if(t.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object");t.set(e,n)}function l(e,t,n){var t=O(e,t,"set"),r=n;if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}return n}function u(e,t){t=O(e,t,"get");return t.get?t.get.call(e):t.value}function O(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}var C=t.default.scorm2004,k=m.default.scorm2004,T=p.default.learner,h=r.default.scorm2004;function f(){throw new y.Scorm2004ValidationError(k.READ_ONLY_ELEMENT)}function j(){throw new y.Scorm2004ValidationError(k.WRITE_ONLY_ELEMENT)}function R(){throw new y.Scorm2004ValidationError(k.TYPE_MISMATCH)}function L(){throw new y.Scorm2004ValidationError(k.DEPENDENCY_NOT_ESTABLISHED)}function d(e,t,n){return(0,i.checkValidFormat)(e,t,k.TYPE_MISMATCH,y.Scorm2004ValidationError,n)}function A(e,t){return(0,i.checkValidRange)(e,t,k.VALUE_OUT_OF_RANGE,y.Scorm2004ValidationError)}var N=new WeakMap,D=new WeakMap,P=new WeakMap,z=new WeakMap,V=new WeakMap,x=new WeakMap,W=new WeakMap,F=new WeakMap,G=new WeakMap,U=new WeakMap,B=new WeakMap,q=new WeakMap,$=new WeakMap,H=new WeakMap,J=new WeakMap,Y=new WeakMap,Z=new WeakMap,X=new WeakMap,K=new WeakMap,Q=new WeakMap,ee=function(){M(r,i.BaseCMI);var n=S(r);function r(e){var t;return o(this,r),c(s(t=n.call(this)),N,{writable:!0,value:"1.0"}),c(s(t),D,{writable:!0,value:C.cmi_children}),c(s(t),P,{writable:!0,value:"unknown"}),c(s(t),z,{writable:!0,value:""}),c(s(t),V,{writable:!0,value:"credit"}),c(s(t),x,{writable:!0,value:""}),c(s(t),W,{writable:!0,value:""}),c(s(t),F,{writable:!0,value:""}),c(s(t),G,{writable:!0,value:""}),c(s(t),U,{writable:!0,value:""}),c(s(t),B,{writable:!0,value:""}),c(s(t),q,{writable:!0,value:""}),c(s(t),$,{writable:!0,value:"normal"}),c(s(t),H,{writable:!0,value:""}),c(s(t),J,{writable:!0,value:""}),c(s(t),Y,{writable:!0,value:"PT0H0M0S"}),c(s(t),Z,{writable:!0,value:"unknown"}),c(s(t),X,{writable:!0,value:""}),c(s(t),K,{writable:!0,value:"continue,no message"}),c(s(t),Q,{writable:!0,value:""}),t.learner_preference=new ae,t.score=new Ce,t.comments_from_learner=new ue,t.comments_from_lms=new le,t.interactions=new se,t.objectives=new ce,e&&t.initialize(),t}return a(r,[{key:"initialize",value:function(){var e;w(I(r.prototype),"initialize",this).call(this),null!==(e=this.learner_preference)&&void 0!==e&&e.initialize(),null!==(e=this.score)&&void 0!==e&&e.initialize(),null!==(e=this.comments_from_learner)&&void 0!==e&&e.initialize(),null!==(e=this.comments_from_lms)&&void 0!==e&&e.initialize(),null!==(e=this.interactions)&&void 0!==e&&e.initialize(),null!==(e=this.objectives)&&void 0!==e&&e.initialize()}},{key:"_version",get:function(){return u(this,N)},set:function(e){f()}},{key:"_children",get:function(){return u(this,D)},set:function(e){f()}},{key:"completion_status",get:function(){return u(this,P)},set:function(e){d(e,h.CMICStatus)&&l(this,P,e)}},{key:"completion_threshold",get:function(){return u(this,z)},set:function(e){this.initialized?f():l(this,z,e)}},{key:"credit",get:function(){return u(this,V)},set:function(e){this.initialized?f():l(this,V,e)}},{key:"entry",get:function(){return u(this,x)},set:function(e){this.initialized?f():l(this,x,e)}},{key:"exit",get:function(){return this.jsonString?u(this,W):j()},set:function(e){d(e,h.CMIExit,!0)&&l(this,W,e)}},{key:"launch_data",get:function(){return u(this,F)},set:function(e){this.initialized?f():l(this,F,e)}},{key:"learner_id",get:function(){return u(this,G)},set:function(e){this.initialized?f():l(this,G,e)}},{key:"learner_name",get:function(){return u(this,U)},set:function(e){this.initialized?f():l(this,U,e)}},{key:"location",get:function(){return u(this,B)},set:function(e){d(e,h.CMIString1000)&&l(this,B,e)}},{key:"max_time_allowed",get:function(){return u(this,q)},set:function(e){this.initialized?f():l(this,q,e)}},{key:"mode",get:function(){return u(this,$)},set:function(e){this.initialized?f():l(this,$,e)}},{key:"progress_measure",get:function(){return u(this,H)},set:function(e){d(e,h.CMIDecimal)&&A(e,h.progress_range)&&l(this,H,e)}},{key:"scaled_passing_score",get:function(){return u(this,J)},set:function(e){this.initialized?f():l(this,J,e)}},{key:"session_time",get:function(){return this.jsonString?u(this,Y):j()},set:function(e){d(e,h.CMITimespan)&&l(this,Y,e)}},{key:"success_status",get:function(){return u(this,Z)},set:function(e){d(e,h.CMISStatus)&&l(this,Z,e)}},{key:"suspend_data",get:function(){return u(this,X)},set:function(e){d(e,h.CMIString64000,!0)&&l(this,X,e)}},{key:"time_limit_action",get:function(){return u(this,K)},set:function(e){this.initialized?f():l(this,K,e)}},{key:"total_time",get:function(){return u(this,Q)},set:function(e){this.initialized?f():l(this,Q,e)}},{key:"getCurrentTotalTime",value:function(){var e=u(this,Y),t=this.start_time;return null!=t&&(t=(new Date).getTime()-t,e=g.getSecondsAsISODuration(t/1e3)),g.addTwoDurations(u(this,Q),e,h.CMITimespan)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={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};return delete this.jsonString,e}}]),r}(),te=new WeakMap,ne=new WeakMap,re=new WeakMap,ie=new WeakMap,oe=new WeakMap,ae=function(){M(n,i.BaseCMI);var t=S(n);function n(){var e;return o(this,n),c(s(e=t.call(this)),te,{writable:!0,value:C.student_preference_children}),c(s(e),ne,{writable:!0,value:"1"}),c(s(e),re,{writable:!0,value:""}),c(s(e),ie,{writable:!0,value:"1"}),c(s(e),oe,{writable:!0,value:"0"}),e}return a(n,[{key:"_children",get:function(){return u(this,te)},set:function(e){f()}},{key:"audio_level",get:function(){return u(this,ne)},set:function(e){d(e,h.CMIDecimal)&&A(e,h.audio_range)&&l(this,ne,e)}},{key:"language",get:function(){return u(this,re)},set:function(e){d(e,h.CMILang)&&l(this,re,e)}},{key:"delivery_speed",get:function(){return u(this,ie)},set:function(e){d(e,h.CMIDecimal)&&A(e,h.speed_range)&&l(this,ie,e)}},{key:"audio_captioning",get:function(){return u(this,oe)},set:function(e){d(e,h.CMISInteger)&&A(e,h.text_range)&&l(this,oe,e)}},{key:"toJSON",value: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}}]),n}(),se=function(){M(t,i.CMIArray);var e=S(t);function t(){return o(this,t),e.call(this,{children:C.interactions_children,errorCode:k.READ_ONLY_ELEMENT,errorClass:y.Scorm2004ValidationError})}return a(t)}(),ce=function(){M(t,i.CMIArray);var e=S(t);function t(){return o(this,t),e.call(this,{children:C.objectives_children,errorCode:k.READ_ONLY_ELEMENT,errorClass:y.Scorm2004ValidationError})}return a(t)}(),le=function(){M(t,i.CMIArray);var e=S(t);function t(){return o(this,t),e.call(this,{children:C.comments_children,errorCode:k.READ_ONLY_ELEMENT,errorClass:y.Scorm2004ValidationError})}return a(t)}(),ue=function(){M(t,i.CMIArray);var e=S(t);function t(){return o(this,t),e.call(this,{children:C.comments_children,errorCode:k.READ_ONLY_ELEMENT,errorClass:y.Scorm2004ValidationError})}return a(t)}(),he=new WeakMap,fe=new WeakMap,de=new WeakMap,me=new WeakMap,pe=new WeakMap,ye=new WeakMap,ge=new WeakMap,ve=new WeakMap,_e=function(){M(n,i.BaseCMI);var t=S(n);function n(){var e;return o(this,n),c(s(e=t.call(this)),he,{writable:!0,value:""}),c(s(e),fe,{writable:!0,value:""}),c(s(e),de,{writable:!0,value:""}),c(s(e),me,{writable:!0,value:""}),c(s(e),pe,{writable:!0,value:""}),c(s(e),ye,{writable:!0,value:""}),c(s(e),ge,{writable:!0,value:""}),c(s(e),ve,{writable:!0,value:""}),e.objectives=new i.CMIArray({errorCode:k.READ_ONLY_ELEMENT,errorClass:y.Scorm2004ValidationError,children:C.objectives_children}),e.correct_responses=new i.CMIArray({errorCode:k.READ_ONLY_ELEMENT,errorClass:y.Scorm2004ValidationError,children:C.correct_responses_children}),e}return a(n,[{key:"initialize",value:function(){var e;w(I(n.prototype),"initialize",this).call(this),null!==(e=this.objectives)&&void 0!==e&&e.initialize(),null!==(e=this.correct_responses)&&void 0!==e&&e.initialize()}},{key:"id",get:function(){return u(this,he)},set:function(e){d(e,h.CMILongIdentifier)&&l(this,he,e)}},{key:"type",get:function(){return u(this,fe)},set:function(e){this.initialized&&""===u(this,he)?L():d(e,h.CMIType)&&l(this,fe,e)}},{key:"timestamp",get:function(){return u(this,de)},set:function(e){this.initialized&&""===u(this,he)?L():d(e,h.CMITime)&&l(this,de,e)}},{key:"weighting",get:function(){return u(this,me)},set:function(e){this.initialized&&""===u(this,he)?L():d(e,h.CMIDecimal)&&l(this,me,e)}},{key:"learner_response",get:function(){return u(this,pe)},set:function(e){if(!this.initialized||""!==u(this,fe)&&""!==u(this,he)){var t=[],n=T[this.type];if(n){if(null!=n&&n.delimiter?t=e.split(n.delimiter):t[0]=e,!(0<t.length&&t.length<=n.max))throw new y.Scorm2004ValidationError(k.GENERAL_SET_FAILURE);for(var r=new RegExp(n.format),i=0;i<t.length;i++)if(null!=n&&n.delimiter2){var o=t[i].split(n.delimiter2);2===o.length&&o[0].match(r)&&o[1].match(new RegExp(n.format2))||R()}else if(t[i].match(r)){if(""!==t[i]&&n.unique)for(var a=0;a<i;a++)t[i]===t[a]&&R()}else R();l(this,pe,e)}else R()}else L()}},{key:"result",get:function(){return u(this,ye)},set:function(e){d(e,h.CMIResult)&&l(this,ye,e)}},{key:"latency",get:function(){return u(this,ge)},set:function(e){this.initialized&&""===u(this,he)?L():d(e,h.CMITimespan)&&l(this,ge,e)}},{key:"description",get:function(){return u(this,ve)},set:function(e){this.initialized&&""===u(this,he)?L():d(e,h.CMILangString250,!0)&&l(this,ve,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={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};return delete this.jsonString,e}}]),n}(),be=new WeakMap,we=new WeakMap,Me=new WeakMap,Ee=new WeakMap,Se=new WeakMap,Ie=function(){M(n,i.BaseCMI);var t=S(n);function n(){var e;return o(this,n),c(s(e=t.call(this)),be,{writable:!0,value:""}),c(s(e),we,{writable:!0,value:"unknown"}),c(s(e),Me,{writable:!0,value:"unknown"}),c(s(e),Ee,{writable:!0,value:""}),c(s(e),Se,{writable:!0,value:""}),e.score=new Ce,e}return a(n,[{key:"initialize",value:function(){var e;w(I(n.prototype),"initialize",this).call(this),null!==(e=this.score)&&void 0!==e&&e.initialize()}},{key:"id",get:function(){return u(this,be)},set:function(e){d(e,h.CMILongIdentifier)&&l(this,be,e)}},{key:"success_status",get:function(){return u(this,we)},set:function(e){this.initialized&&""===u(this,be)?L():d(e,h.CMISStatus)&&l(this,we,e)}},{key:"completion_status",get:function(){return u(this,Me)},set:function(e){this.initialized&&""===u(this,be)?L():d(e,h.CMICStatus)&&l(this,Me,e)}},{key:"progress_measure",get:function(){return u(this,Ee)},set:function(e){this.initialized&&""===u(this,be)?L():d(e,h.CMIDecimal)&&A(e,h.progress_range)&&l(this,Ee,e)}},{key:"description",get:function(){return u(this,Se)},set:function(e){this.initialized&&""===u(this,be)?L():d(e,h.CMILangString250,!0)&&l(this,Se,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={id:this.id,success_status:this.success_status,completion_status:this.completion_status,progress_measure:this.progress_measure,description:this.description,score:this.score};return delete this.jsonString,e}}]),n}(),Oe=new WeakMap,Ce=function(){M(n,i.CMIScore);var t=S(n);function n(){var e;return o(this,n),c(s(e=t.call(this,{score_children:C.score_children,max:"",invalidErrorCode:k.READ_ONLY_ELEMENT,invalidTypeCode:k.TYPE_MISMATCH,invalidRangeCode:k.VALUE_OUT_OF_RANGE,decimalRegex:h.CMIDecimal,errorClass:y.Scorm2004ValidationError})),Oe,{writable:!0,value:""}),e}return a(n,[{key:"scaled",get:function(){return u(this,Oe)},set:function(e){d(e,h.CMIDecimal)&&A(e,h.scaled_range)&&l(this,Oe,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={scaled:this.scaled,raw:w(I(n.prototype),"raw",this),min:w(I(n.prototype),"min",this),max:w(I(n.prototype),"max",this)};return delete this.jsonString,e}}]),n}(),ke=new WeakMap,Te=new WeakMap,je=new WeakMap,Re=new WeakMap,Le=function(){M(r,i.BaseCMI);var n=S(r);function r(){var e,t=0<arguments.length&&void 0!==arguments[0]&&arguments[0];return o(this,r),c(s(e=n.call(this)),ke,{writable:!0,value:""}),c(s(e),Te,{writable:!0,value:""}),c(s(e),je,{writable:!0,value:""}),c(s(e),Re,{writable:!0,value:void 0}),l(s(e),ke,""),l(s(e),Te,""),l(s(e),je,""),l(s(e),Re,t),e}return a(r,[{key:"comment",get:function(){return u(this,ke)},set:function(e){this.initialized&&u(this,Re)?f():d(e,h.CMILangString4000,!0)&&l(this,ke,e)}},{key:"location",get:function(){return u(this,Te)},set:function(e){this.initialized&&u(this,Re)?f():d(e,h.CMIString250)&&l(this,Te,e)}},{key:"timestamp",get:function(){return u(this,je)},set:function(e){this.initialized&&u(this,Re)?f():d(e,h.CMITime)&&l(this,je,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={comment:this.comment,location:this.location,timestamp:this.timestamp};return delete this.jsonString,e}}]),r}(),Ae=new WeakMap,Ne=function(){M(n,i.BaseCMI);var t=S(n);function n(){var e;return o(this,n),c(s(e=t.call(this)),Ae,{writable:!0,value:""}),e}return a(n,[{key:"id",get:function(){return u(this,Ae)},set:function(e){d(e,h.CMILongIdentifier)&&l(this,Ae,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={id:this.id};return delete this.jsonString,e}}]),n}(),De=new WeakMap,Pe=function(){M(n,i.BaseCMI);var t=S(n);function n(){var e;return o(this,n),c(s(e=t.call(this)),De,{writable:!0,value:""}),e}return a(n,[{key:"pattern",get:function(){return u(this,De)},set:function(e){d(e,h.CMIFeedback)&&l(this,De,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={pattern:this.pattern};return delete this.jsonString,e}}]),n}(),ze=function(){M(n,i.BaseCMI);var t=S(n);function n(){var e;return o(this,n),(e=t.call(this)).nav=new xe,e}return a(n,[{key:"initialize",value:function(){var e;w(I(n.prototype),"initialize",this).call(this),null!==(e=this.nav)&&void 0!==e&&e.initialize()}},{key:"toJSON",value:function(){this.jsonString=!0;var e={nav:this.nav};return delete this.jsonString,e}}]),n}(),Ve=new WeakMap,xe=function(){M(n,i.BaseCMI);var t=S(n);function n(){var e;return o(this,n),c(s(e=t.call(this)),Ve,{writable:!0,value:"_none_"}),e.request_valid=new Ge,e}return a(n,[{key:"initialize",value:function(){var e;w(I(n.prototype),"initialize",this).call(this),null!==(e=this.request_valid)&&void 0!==e&&e.initialize()}},{key:"request",get:function(){return u(this,Ve)},set:function(e){d(e,h.NAVEvent)&&l(this,Ve,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={request:this.request};return delete this.jsonString,e}}]),n}(),We=new WeakMap,Fe=new WeakMap,Ge=function(){M(n,i.BaseCMI);var t=S(n);function n(){var e;return o(this,n),c(s(e=t.call(this)),We,{writable:!0,value:"unknown"}),c(s(e),Fe,{writable:!0,value:"unknown"}),_(s(e),"choice",function(){return a(function e(){o(this,e),_(this,"_isTargetValid",function(e){return"unknown"})})}()),_(s(e),"jump",function(){return a(function e(){o(this,e),_(this,"_isTargetValid",function(e){return"unknown"})})}()),e}return a(n,[{key:"continue",get:function(){return u(this,We)},set:function(e){f()}},{key:"previous",get:function(){return u(this,Fe)},set:function(e){f()}},{key:"toJSON",value:function(){this.jsonString=!0;var e={previous:this.previous,continue:this.continue};return delete this.jsonString,e}}]),n}()},"./src/constants/api_constants.js":
29
+ /*!****************************************!*\
30
+ !*** ./src/constants/api_constants.js ***!
31
+ \****************************************/function(e,t,n){"use strict";function o(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function r(r){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?o(Object(i),!0).forEach(function(e){var t,n;t=r,n=i[e=e],e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):o(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))})}return r}n.r(t);var 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."}}},i=r(r({},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"});t.default={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:i,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."}}}}},"./src/constants/error_codes.js":
32
+ /*!**************************************!*\
33
+ !*** ./src/constants/error_codes.js ***!
34
+ \**************************************/function(e,t,n){"use strict";function o(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function r(r){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?o(Object(i),!0).forEach(function(e){var t,n;t=r,n=i[e=e],e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):o(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))})}return r}n.r(t);var 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},i=r(r({},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}),n=r(r({},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.default={scorm12:i,scorm2004:n}},"./src/constants/language_constants.js":
35
+ /*!*********************************************!*\
36
+ !*** ./src/constants/language_constants.js ***!
37
+ \*********************************************/function(e,t,n){"use strict";n.r(t);t.default={aa:"aa",ab:"ab",ae:"ae",af:"af",ak:"ak",am:"am",an:"an",ar:"ar",as:"as",av:"av",ay:"ay",az:"az",ba:"ba",be:"be",bg:"bg",bh:"bh",bi:"bi",bm:"bm",bn:"bn",bo:"bo",br:"br",bs:"bs",ca:"ca",ce:"ce",ch:"ch",co:"co",cr:"cr",cs:"cs",cu:"cu",cv:"cv",cy:"cy",da:"da",de:"de",dv:"dv",dz:"dz",ee:"ee",el:"el",en:"en",eo:"eo",es:"es",et:"et",eu:"eu",fa:"fa",ff:"ff",fi:"fi",fj:"fj",fo:"fo",fr:"fr",fy:"fy",ga:"ga",gd:"gd",gl:"gl",gn:"gn",gu:"gu",gv:"gv",ha:"ha",he:"he",hi:"hi",ho:"ho",hr:"hr",ht:"ht",hu:"hu",hy:"hy",hz:"hz",ia:"ia",id:"id",ie:"ie",ig:"ig",ii:"ii",ik:"ik",io:"io",is:"is",it:"it",iu:"iu",ja:"ja",jv:"jv",ka:"ka",kg:"kg",ki:"ki",kj:"kj",kk:"kk",kl:"kl",km:"km",kn:"kn",ko:"ko",kr:"kr",ks:"ks",ku:"ku",kv:"kv",kw:"kw",ky:"ky",la:"la",lb:"lb",lg:"lg",li:"li",ln:"ln",lo:"lo",lt:"lt",lu:"lu",lv:"lv",mg:"mg",mh:"mh",mi:"mi",mk:"mk",ml:"ml",mn:"mn",mo:"mo",mr:"mr",ms:"ms",mt:"mt",my:"my",na:"na",nb:"nb",nd:"nd",ne:"ne",ng:"ng",nl:"nl",nn:"nn",no:"no",nr:"nr",nv:"nv",ny:"ny",oc:"oc",oj:"oj",om:"om",or:"or",os:"os",pa:"pa",pi:"pi",pl:"pl",ps:"ps",pt:"pt",qu:"qu",rm:"rm",rn:"rn",ro:"ro",ru:"ru",rw:"rw",sa:"sa",sc:"sc",sd:"sd",se:"se",sg:"sg",sh:"sh",si:"si",sk:"sk",sl:"sl",sm:"sm",sn:"sn",so:"so",sq:"sq",sr:"sr",ss:"ss",st:"st",su:"su",sv:"sv",sw:"sw",ta:"ta",te:"te",tg:"tg",th:"th",ti:"ti",tk:"tk",tl:"tl",tn:"tn",to:"to",tr:"tr",ts:"ts",tt:"tt",tw:"tw",ty:"ty",ug:"ug",uk:"uk",ur:"ur",uz:"uz",ve:"ve",vi:"vi",vo:"vo",wa:"wa",wo:"wo",xh:"xh",yi:"yi",yo:"yo",za:"za",zh:"zh",zu:"zu",aar:"aar",abk:"abk",ave:"ave",afr:"afr",aka:"aka",amh:"amh",arg:"arg",ara:"ara",asm:"asm",ava:"ava",aym:"aym",aze:"aze",bak:"bak",bel:"bel",bul:"bul",bih:"bih",bis:"bis",bam:"bam",ben:"ben",tib:"tib",bod:"bod",bre:"bre",bos:"bos",cat:"cat",che:"che",cha:"cha",cos:"cos",cre:"cre",cze:"cze",ces:"ces",chu:"chu",chv:"chv",wel:"wel",cym:"cym",dan:"dan",ger:"ger",deu:"deu",div:"div",dzo:"dzo",ewe:"ewe",gre:"gre",ell:"ell",eng:"eng",epo:"epo",spa:"spa",est:"est",baq:"baq",eus:"eus",per:"per",fas:"fas",ful:"ful",fin:"fin",fij:"fij",fao:"fao",fre:"fre",fra:"fra",fry:"fry",gle:"gle",gla:"gla",glg:"glg",grn:"grn",guj:"guj",glv:"glv",hau:"hau",heb:"heb",hin:"hin",hmo:"hmo",hrv:"hrv",hat:"hat",hun:"hun",arm:"arm",hye:"hye",her:"her",ina:"ina",ind:"ind",ile:"ile",ibo:"ibo",iii:"iii",ipk:"ipk",ido:"ido",ice:"ice",isl:"isl",ita:"ita",iku:"iku",jpn:"jpn",jav:"jav",geo:"geo",kat:"kat",kon:"kon",kik:"kik",kua:"kua",kaz:"kaz",kal:"kal",khm:"khm",kan:"kan",kor:"kor",kau:"kau",kas:"kas",kur:"kur",kom:"kom",cor:"cor",kir:"kir",lat:"lat",ltz:"ltz",lug:"lug",lim:"lim",lin:"lin",lao:"lao",lit:"lit",lub:"lub",lav:"lav",mlg:"mlg",mah:"mah",mao:"mao",mri:"mri",mac:"mac",mkd:"mkd",mal:"mal",mon:"mon",mol:"mol",mar:"mar",may:"may",msa:"msa",mlt:"mlt",bur:"bur",mya:"mya",nau:"nau",nob:"nob",nde:"nde",nep:"nep",ndo:"ndo",dut:"dut",nld:"nld",nno:"nno",nor:"nor",nbl:"nbl",nav:"nav",nya:"nya",oci:"oci",oji:"oji",orm:"orm",ori:"ori",oss:"oss",pan:"pan",pli:"pli",pol:"pol",pus:"pus",por:"por",que:"que",roh:"roh",run:"run",rum:"rum",ron:"ron",rus:"rus",kin:"kin",san:"san",srd:"srd",snd:"snd",sme:"sme",sag:"sag",slo:"slo",sin:"sin",slk:"slk",slv:"slv",smo:"smo",sna:"sna",som:"som",alb:"alb",sqi:"sqi",srp:"srp",ssw:"ssw",sot:"sot",sun:"sun",swe:"swe",swa:"swa",tam:"tam",tel:"tel",tgk:"tgk",tha:"tha",tir:"tir",tuk:"tuk",tgl:"tgl",tsn:"tsn",ton:"ton",tur:"tur",tso:"tso",tat:"tat",twi:"twi",tah:"tah",uig:"uig",ukr:"ukr",urd:"urd",uzb:"uzb",ven:"ven",vie:"vie",vol:"vol",wln:"wln",wol:"wol",xho:"xho",yid:"yid",yor:"yor",zha:"zha",chi:"chi",zho:"zho",zul:"zul"}},"./src/constants/regex.js":
38
+ /*!********************************!*\
39
+ !*** ./src/constants/regex.js ***!
40
+ \********************************/function(e,t,n){"use strict";function o(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function r(r){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?o(Object(i),!0).forEach(function(e){var t,n;t=r,n=i[e=e],e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):o(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))})}return r}n.r(t);var 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"},i=r(r({},n),{CMIIdentifier:"^\\w{1,255}$"});t.default={aicc:i,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|{target=\\S{0,200}[a-zA-Z0-9]}choice|jump)$",NAVBoolean:"^(unknown|true|false$)",NAVTarget:"^(previous|continue|choice.{target=\\S{0,200}[a-zA-Z0-9]})$",scaled_range:"-1#1",audio_range:"0#*",speed_range:"0#*",text_range:"-1#1",progress_range:"0#1"}}},"./src/constants/response_constants.js":
41
+ /*!*********************************************!*\
42
+ !*** ./src/constants/response_constants.js ***!
43
+ \*********************************************/function(e,t,n){"use strict";n.r(t);var n=n(/*! ./regex */"./src/constants/regex.js").default.scorm2004,r={"true-false":{format:"^true$|^false$",max:1,delimiter:"",unique:!1},choice:{format:n.CMILongIdentifier,max:36,delimiter:"[,]",unique:!0},"fill-in":{format:n.CMILangString250,max:10,delimiter:"[,]",unique:!1},"long-fill-in":{format:n.CMILangString4000,max:1,delimiter:"",unique:!1},matching:{format:n.CMIShortIdentifier,format2:n.CMIShortIdentifier,max:36,delimiter:"[,]",delimiter2:"[.]",unique:!1},performance:{format:"^$|"+n.CMIShortIdentifier,format2:n.CMIDecimal+"|^$|"+n.CMIShortIdentifier,max:250,delimiter:"[,]",delimiter2:"[.]",unique:!1},sequencing:{format:n.CMIShortIdentifier,max:36,delimiter:"[,]",unique:!1},likert:{format:n.CMIShortIdentifier,max:1,delimiter:"",unique:!1},numeric:{format:n.CMIDecimal,max:1,delimiter:"",unique:!1},other:{format:n.CMIString4000,max:1,delimiter:"",unique:!1}},n={"true-false":{max:1,delimiter:"",unique:!1,duplicate:!1,format:"^true$|^false$",limit:1},choice:{max:36,delimiter:"[,]",unique:!0,duplicate:!1,format:n.CMILongIdentifier},"fill-in":{max:10,delimiter:"[,]",unique:!1,duplicate:!1,format:n.CMILangString250cr},"long-fill-in":{max:1,delimiter:"",unique:!1,duplicate:!0,format:n.CMILangString4000},matching:{max:36,delimiter:"[,]",delimiter2:"[.]",unique:!1,duplicate:!1,format:n.CMIShortIdentifier,format2:n.CMIShortIdentifier},performance:{max:250,delimiter:"[,]",delimiter2:"[.]",unique:!1,duplicate:!1,format:"^$|"+n.CMIShortIdentifier,format2:n.CMIDecimal+"|^$|"+n.CMIShortIdentifier},sequencing:{max:36,delimiter:"[,]",unique:!1,duplicate:!1,format:n.CMIShortIdentifier},likert:{max:1,delimiter:"",unique:!1,duplicate:!1,format:n.CMIShortIdentifier,limit:1},numeric:{max:2,delimiter:"[:]",unique:!1,duplicate:!1,format:n.CMIDecimal,limit:1},other:{max:1,delimiter:"",unique:!1,duplicate:!1,format:n.CMIString4000,limit:1}};t.default={learner:r,correct:n}},"./src/exceptions.js":
44
+ /*!***************************!*\
45
+ !*** ./src/exceptions.js ***!
46
+ \***************************/function(t,e,n){"use strict";n.r(e),n.d(e,{ValidationError:function(){return O},Scorm12ValidationError:function(){return C},AICCValidationError:function(){return k},Scorm2004ValidationError:function(){return T}});e=n(/*! ./constants/api_constants */"./src/constants/api_constants.js");function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function r(e,t,n){return t&&d(e.prototype,t),n&&d(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g(e,t)}function c(n){var r=y();return function(){var e,t=v(n);return i(this,r?(e=v(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function i(e,t){if(t&&("object"===f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return l(e)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e){var n="function"==typeof Map?new Map:void 0;return function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return p(e,arguments,v(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),g(t,e)}(e)}function p(e,t,n){return(p=y()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);t=new(Function.bind.apply(e,r));return n&&g(t,n.prototype),t}).apply(null,arguments)}function y(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _(e,t,n){var r=e;if(t.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object");t.set(e,n)}function b(e,t){t=M(e,t,"get");return t.get?t.get.call(e):t.value}function w(e,t,n){var t=M(e,t,"set"),r=n;if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}return n}function M(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}var o=e.default.scorm12.error_descriptions,u=e.default.aicc.error_descriptions,h=e.default.scorm2004.error_descriptions,E=new WeakMap,S=new WeakMap,I=new WeakMap,O=function(){s(o,m(Error));var i=c(o);function o(e,t,n){var r;return a(this,o),_(l(r=i.call(this,t)),E,{writable:!0,value:void 0}),_(l(r),S,{writable:!0,value:void 0}),_(l(r),I,{writable:!0,value:void 0}),w(l(r),E,e),w(l(r),S,t),w(l(r),I,n),r}return r(o,[{key:"errorCode",get:function(){return b(this,E)}},{key:"errorMessage",get:function(){return b(this,S)}},{key:"detailedMessage",get:function(){return b(this,I)}}]),o}(),C=function(){s(n,O);var t=c(n);function n(e){return a(this,n),i({}.hasOwnProperty.call(o,String(e))?t.call(this,e,o[String(e)].basicMessage,o[String(e)].detailMessage):t.call(this,101,o[101].basicMessage,o[101].detailMessage))}return r(n)}(),k=function(){s(n,O);var t=c(n);function n(e){return a(this,n),i({}.hasOwnProperty.call(u,String(e))?t.call(this,e,u[String(e)].basicMessage,u[String(e)].detailMessage):t.call(this,101,u[101].basicMessage,u[101].detailMessage))}return r(n)}(),T=function(){s(n,O);var t=c(n);function n(e){return a(this,n),i({}.hasOwnProperty.call(h,String(e))?t.call(this,e,h[String(e)].basicMessage,h[String(e)].detailMessage):t.call(this,101,h[101].basicMessage,h[101].detailMessage))}return r(n)}()},"./src/utilities.js":
47
+ /*!**************************!*\
48
+ !*** ./src/utilities.js ***!
49
+ \**************************/function(u,e,t){"use strict";function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}t.r(e),t.d(e,{SECONDS_PER_SECOND:function(){return n},SECONDS_PER_MINUTE:function(){return i},SECONDS_PER_HOUR:function(){return o},SECONDS_PER_DAY:function(){return h},getSecondsAsHHMMSS:function(){return d},getSecondsAsISODuration:function(){return m},getTimeAsSeconds:function(){return s},getDurationAsSeconds:function(){return c},addTwoDurations:function(){return p},addHHMMSSTimeStrings:function(){return y},flatten:function(){return g},unflatten:function(){return v},countDecimals:function(){return l}});var n=1,i=60,o=60*i,h=24*o,f=[["D",h],["H",o],["M",i],["S",n]];function d(e){if(!e||e<=0)return"00:00:00";var t=Math.floor(e/o),n=new Date(1e3*e),r=n.getUTCMinutes(),n=n.getSeconds(),e=e%1,i="";return 0<l(e)&&(i="."+(i=2<l(e)?e.toFixed(2):String(e)).split(".")[1]),(t+":"+r+":"+n).replace(/\b\d\b/g,"0$&")+i}function m(e){if(!e||e<=0)return"PT0S";var r="P",i=e;return f.forEach(function(e){var e=a(e,2),t=e[0],e=e[1],n=Math.floor(i/e);2<l(i%=e)&&(i=Number(Number(i).toFixed(2))),"S"===t&&0<i&&(n+=i),n&&((0<r.indexOf("D")||"H"===t||"M"===t||"S"===t)&&-1===r.indexOf("T")&&(r+="T"),r+="".concat(n).concat(t))}),r}function s(e,t){if(!e||"string"!=typeof e||!e.match(t))return 0;t=e.split(":");return 3600*Number(t[0])+60*Number(t[1])+Number(t[2])}function c(e,t){if(!e||!e.match(t))return 0;var t=a(new RegExp(t).exec(e)||[],8),e=t[1],n=(t[2],t[4]),r=t[5],i=t[6],t=t[7],o=0;return(o+=+Number(t)||0)+(60*Number(i)||0)+(3600*Number(r)||0)+(86400*Number(n)||0)+(31536e3*Number(e)||0)}function p(e,t,n){return m(c(e,n)+c(t,n))}function y(e,t,n){return d(s(e,n)+s(t,n))}function g(e){var s={};return function e(t,n){if(Object(t)!==t)s[n]=t;else if(Array.isArray(t))for(var r=0,i=t.length;r<i;r++)e(t[r],n+"["+r+"]"),0===i&&(s[n]=[]);else{var o,a=!0;for(o in t)!{}.hasOwnProperty.call(t,o)||(a=!1,e(t[o],n?n+"."+o:o));a&&n&&(s[n]={})}}(e,""),s}function v(e){if(Object(e)!==e||Array.isArray(e))return e;var t,n=/\.?([^.[\]]+)|\[(\d+)]/g,r={};for(t in e)if({}.hasOwnProperty.call(e,t)){for(var i=r,o="",a=n.exec(t);a;)i=i[o]||(i[o]=a[2]?[]:{}),o=a[2]||a[1],a=n.exec(t);i[o]=e[t]}return r[""]||r}function l(e){return!(Math.floor(e)===e||String(e).indexOf(".")<0)&&e.toString().split(".")[1].length||0}}},r={};function i(e){var t=r[e];if(void 0!==t)return t.exports;t=r[e]={exports:{}};return n[e](t,t.exports,i),t.exports}i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};!function(){"use strict";
50
+ /*!************************************!*\
51
+ !*** ./src/exports/scorm-again.js ***!
52
+ \************************************/i.r(o);var e=i(/*! ../Scorm2004API */"./src/Scorm2004API.js"),t=i(/*! ../Scorm12API */"./src/Scorm12API.js"),n=i(/*! ../AICC */"./src/AICC.js");window.Scorm12API=t.default,window.Scorm2004API=e.default,window.AICC=n.default}()}();