scorm-again 1.7.1 → 2.0.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.
Files changed (85) hide show
  1. package/.babelrc +18 -7
  2. package/.github/dependabot.yml +5 -0
  3. package/.github/workflows/main.yml +79 -0
  4. package/.jsdoc.json +4 -5
  5. package/.mocharc.json +8 -0
  6. package/.run/Mocha Unit Tests.run.xml +5 -2
  7. package/CONTRIBUTING.md +1 -1
  8. package/README.md +14 -1
  9. package/dist/aicc.js +3661 -7170
  10. package/dist/aicc.js.map +1 -1
  11. package/dist/aicc.min.js +2 -40
  12. package/dist/aicc.min.js.map +1 -0
  13. package/dist/scorm-again.js +5671 -10695
  14. package/dist/scorm-again.js.map +1 -1
  15. package/dist/scorm-again.min.js +2 -52
  16. package/dist/scorm-again.min.js.map +1 -0
  17. package/dist/scorm12.js +2871 -5433
  18. package/dist/scorm12.js.map +1 -1
  19. package/dist/scorm12.min.js +2 -34
  20. package/dist/scorm12.min.js.map +1 -0
  21. package/dist/scorm2004.js +3868 -6797
  22. package/dist/scorm2004.js.map +1 -1
  23. package/dist/scorm2004.min.js +2 -40
  24. package/dist/scorm2004.min.js.map +1 -0
  25. package/eslint.config.js +21 -0
  26. package/package.json +72 -34
  27. package/results.json +34254 -0
  28. package/src/{AICC.js → AICC.ts} +27 -21
  29. package/src/BaseAPI.ts +1449 -0
  30. package/src/Scorm12API.ts +360 -0
  31. package/src/{Scorm2004API.js → Scorm2004API.ts} +245 -163
  32. package/src/cmi/aicc_cmi.ts +1248 -0
  33. package/src/cmi/common.ts +411 -0
  34. package/src/cmi/scorm12_cmi.ts +1426 -0
  35. package/src/cmi/scorm2004_cmi.ts +1874 -0
  36. package/src/constants/api_constants.ts +318 -0
  37. package/src/constants/error_codes.ts +88 -0
  38. package/src/constants/language_constants.ts +394 -0
  39. package/src/constants/regex.ts +97 -0
  40. package/src/constants/{response_constants.js → response_constants.ts} +67 -62
  41. package/src/exceptions.ts +133 -0
  42. package/src/exports/aicc.js +1 -1
  43. package/src/exports/scorm-again.js +3 -3
  44. package/src/exports/scorm12.js +1 -1
  45. package/src/exports/scorm2004.js +1 -1
  46. package/src/{utilities.js → utilities.ts} +114 -74
  47. package/tea.yaml +6 -0
  48. package/test/{AICC.spec.js → AICC.spec.ts} +70 -72
  49. package/test/Scorm12API.spec.ts +580 -0
  50. package/test/Scorm2004API.spec.ts +812 -0
  51. package/test/api_helpers.ts +176 -0
  52. package/test/cmi/{aicc_cmi.spec.js → aicc_cmi.spec.ts} +193 -209
  53. package/test/cmi/{scorm12_cmi.spec.js → scorm12_cmi.spec.ts} +251 -269
  54. package/test/cmi/scorm2004_cmi.spec.ts +1031 -0
  55. package/test/cmi_helpers.ts +207 -0
  56. package/test/exceptions.spec.ts +79 -0
  57. package/test/field_values.ts +202 -0
  58. package/test/utilities.spec.ts +322 -0
  59. package/tsconfig.json +18 -0
  60. package/webpack.config.js +65 -0
  61. package/.circleci/config.yml +0 -99
  62. package/.codeclimate.yml +0 -7
  63. package/.eslintrc.js +0 -36
  64. package/src/.flowconfig +0 -11
  65. package/src/BaseAPI.js +0 -1275
  66. package/src/Scorm12API.js +0 -308
  67. package/src/cmi/aicc_cmi.js +0 -1141
  68. package/src/cmi/common.js +0 -328
  69. package/src/cmi/scorm12_cmi.js +0 -1312
  70. package/src/cmi/scorm2004_cmi.js +0 -1692
  71. package/src/constants/api_constants.js +0 -218
  72. package/src/constants/error_codes.js +0 -87
  73. package/src/constants/language_constants.js +0 -76
  74. package/src/constants/regex.js +0 -84
  75. package/src/exceptions.js +0 -104
  76. package/test/Scorm12API.spec.js +0 -528
  77. package/test/Scorm2004API.spec.js +0 -775
  78. package/test/abstract_classes.spec.js +0 -17
  79. package/test/api_helpers.js +0 -128
  80. package/test/cmi/scorm2004_cmi.spec.js +0 -1066
  81. package/test/cmi_helpers.js +0 -161
  82. package/test/exceptions.spec.js +0 -71
  83. package/test/field_values.js +0 -353
  84. package/test/utilities.spec.js +0 -339
  85. package/webpack.js +0 -78
package/dist/aicc.min.js CHANGED
@@ -1,40 +1,2 @@
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 _(){return h.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,f="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,h=t||f||Function("return this")(),d=Object.prototype.toString,E=Math.max,M=Math.min;function v(e){var t=n(e);return e&&("object"==t||"function"==t)}function p(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(p(e))return r;if("string"!=typeof(e=v(e)?v(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(f,n,e){var r,i,o,a,s,c,l=0,h=!1,u=!1,t=!0;if("function"!=typeof f)throw new TypeError("Expected a function");function d(e){var t=r,n=i;return r=i=void 0,l=e,a=f.apply(n,t)}function p(e){var t=e-c;return void 0===c||n<=t||t<0||u&&o<=e-l}function m(){var e,t=_();if(p(t))return y(t);s=setTimeout(m,(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=_(),t=p(e);if(r=arguments,i=this,c=e,t){if(void 0===s)return l=e=c,s=setTimeout(m,n),h?d(e):a;if(u)return s=setTimeout(m,n),d(c)}return void 0===s&&(s=setTimeout(m,n)),a}return n=b(n)||0,v(e)&&(h=!!e.leading,u="maxWait"in e,o=u?E(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(_())},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"),f=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.bind():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?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function h(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.bind():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=h(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 f.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 T}});var m=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"),f=t(/*! lodash.debounce */"./node_modules/lodash.debounce/index.js"),y=t.n(f);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 _(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)?_(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 _(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 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 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 E(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){S(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 w(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 O(e,t,n){return t&&w(e.prototype,t),n&&w(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function S(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 h(e,t){t=I(e,t,"get");return t.get?t.get.call(e):t.value}function o(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 d=l.default.global,C=e.default.scorm12,a=new WeakMap,p=new WeakMap,r=new WeakMap,T=function(){function n(e,t){if(M(this,n),i(this,a,{writable:!0,value:void 0}),i(this,p,{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)}}}}),S(this,"cmi",void 0),S(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,p,e),this.settings=t,this.apiLogLevel=this.settings.logLevel,this.selfReportSessionTime=this.settings.selfReportSessionTime}return O(n,[{key:"initialize",value:function(e,t,n){var r=d.SCORM_FALSE;return this.isInitialized()?this.throwSCORMError(h(this,p).INITIALIZED,t):this.isTerminated()?this.throwSCORMError(h(this,p).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 h(this,p)}},{key:"settings",get:function(){return h(this,r)},set:function(e){o(this,r,E(E({},h(this,r)),e))}},{key:"terminate",value:function(e,t){var n,r=d.SCORM_FALSE;return this.checkState(t,h(this,p).TERMINATION_BEFORE_INIT,h(this,p).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,h(this,p).RETRIEVE_BEFORE_INIT,h(this,p).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(h(this,p).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,h(this,p).STORE_BEFORE_INIT,h(this,p).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(h(this,p).GENERAL))}this.processListeners(e,r,i)}return void 0===o&&(o=d.SCORM_FALSE),"0"===String(this.lastErrorCode)&&this.settings.autocommit&&!h(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,h(this,p).COMMIT_BEFORE_INIT,h(this,p).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."),f=e?h(this,p).UNDEFINED_DATA_MODEL:h(this,p).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(h(this,p).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(f,s);else{if(!(i=i[l])){this.throwSCORMError(f,s);break}i instanceof m.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(f,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?h(this,p).UNDEFINED_DATA_MODEL:h(this,p).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 m.CMIArray){var l=parseInt(r[c+1],10);if(!isNaN(l)){var f=i.childArray[l];if(!f){this.throwSCORMError(h(this,p).VALUE_NOT_INITIALIZED,u);break}i=f,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"===v(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"===v(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(){h(this,a)&&(h(this,a).cancel(),o(this,a,null),this.apiLog("clearScheduledCommit","","cleared",d.LOG_LEVEL_DEBUG))}}]),n}(),j=new WeakMap,k=new WeakMap,s=new WeakMap,R=new WeakMap,L=function(){function r(e,t,n){M(this,r),i(this,j,{writable:!0,value:void 0}),i(this,k,{writable:!0,value:!1}),i(this,s,{writable:!0,value:void 0}),i(this,R,{writable:!0,value:void 0}),o(this,j,e),o(this,s,setTimeout(this.wrapper.bind(this),t)),o(this,R,n)}return O(r,[{key:"cancel",value:function(){o(this,k,!0),h(this,s)&&clearTimeout(h(this,s))}},{key:"wrapper",value:function(){h(this,k)||h(this,j).commit(h(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 f(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 h(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?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function p(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.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var l=n.default.scorm12,u=n.default.global,m=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=p(i);function i(e){if(!(this instanceof i))throw new TypeError("Cannot call a class as a function");var e=f(f({},{mastery_override:!1}),e);return(e=r.call(this,m,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}}])&&h(t.prototype,e),n&&h(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(e.default)},"./src/cmi/aicc_cmi.js":
14
- /*!*****************************!*\
15
- !*** ./src/cmi/aicc_cmi.js ***!
16
- \*****************************/function(t,n,h){"use strict";h.r(n),h.d(n,{CMI:function(){return C},CMIAttemptRecords:function(){return fe},CMIAttemptRecordsObject:function(){return de},CMIEvaluationCommentsObject:function(){return ge},CMIPaths:function(){return Q},CMIPathsObject:function(){return ae},CMIStudentDemographics:function(){return K},CMITries:function(){return se},CMITriesObject:function(){return ue}});var d=h(/*! ./scorm12_cmi */"./src/cmi/scorm12_cmi.js"),r=h(/*! ./common */"./src/cmi/common.js"),n=h(/*! ../constants/api_constants */"./src/constants/api_constants.js"),p=h(/*! ../constants/regex */"./src/constants/regex.js"),m=h(/*! ../constants/error_codes */"./src/constants/error_codes.js"),y=h(/*! ../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=_(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=_(e,t,"get");return t.get?t.get.call(e):t.value}function _(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 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 s(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.bind():function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=O(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 E(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?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function w(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=O(n),t=(e=r?(e=O(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 O(e){return(O=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var S=n.default.aicc,l=p.default.aicc,I=m.default.scorm12;function u(){throw new y.AICCValidationError(I.READ_ONLY_ELEMENT)}function f(e,t,n){return(0,r.checkValidFormat)(e,t,I.TYPE_MISMATCH,y.AICCValidationError,n)}var C=function(){E(r,d.CMI);var n=w(r);function r(e){var t;return a(this,r),t=n.call(this,S.cmi_children),e&&t.initialize(),t.student_preference=new D,t.student_data=new V,t.student_demographics=new K,t.evaluation=new T,t.paths=new Q,t}return s(r,[{key:"initialize",value:function(){var e;b(O(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}(),T=function(){E(n,r.BaseCMI);var t=w(n);function n(){var e;return a(this,n),(e=t.call(this)).comments=new j,e}return s(n,[{key:"initialize",value:function(){var e;b(O(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}(),j=function(){E(t,r.CMIArray);var e=w(t);function t(){return a(this,t),e.call(this,{children:S.comments_children,errorCode:I.INVALID_SET_VALUE,errorClass:y.AICCValidationError})}return s(t)}(),k=new WeakMap,R=new WeakMap,L=new WeakMap,A=new WeakMap,N=new WeakMap,D=function(){E(n,d.CMIStudentPreference);var t=w(n);function n(){var e;return a(this,n),i(c(e=t.call(this,S.student_preference_children)),k,{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:I.INVALID_SET_VALUE,errorClass:y.AICCValidationError,children:""}),e}return s(n,[{key:"initialize",value:function(){var e;b(O(n.prototype),"initialize",this).call(this),null!==(e=this.windows)&&void 0!==e&&e.initialize()}},{key:"lesson_type",get:function(){return e(this,k)},set:function(e){f(e,l.CMIString256)&&o(this,k,e)}},{key:"text_color",get:function(){return e(this,R)},set:function(e){f(e,l.CMIString256)&&o(this,R,e)}},{key:"text_location",get:function(){return e(this,L)},set:function(e){f(e,l.CMIString256)&&o(this,L,e)}},{key:"text_size",get:function(){return e(this,A)},set:function(e){f(e,l.CMIString256)&&o(this,A,e)}},{key:"video",get:function(){return e(this,N)},set:function(e){f(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,V=function(){E(n,d.CMIStudentData);var t=w(n);function n(){var e;return a(this,n),i(c(e=t.call(this,S.student_data_children)),P,{writable:!0,value:""}),e.tries=new se,e}return s(n,[{key:"initialize",value:function(){var e;b(O(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}(),F=new WeakMap,x=new WeakMap,z=new WeakMap,W=new WeakMap,G=new WeakMap,U=new WeakMap,B=new WeakMap,$=new WeakMap,H=new WeakMap,J=new WeakMap,Z=new WeakMap,Y=new WeakMap,q=new WeakMap,X=new WeakMap,K=function(){E(n,r.BaseCMI);var t=w(n);function n(){var e;return a(this,n),i(c(e=t.call(this)),F,{writable:!0,value:S.student_demographics_children}),i(c(e),x,{writable:!0,value:""}),i(c(e),z,{writable:!0,value:""}),i(c(e),W,{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),$,{writable:!0,value:""}),i(c(e),H,{writable:!0,value:""}),i(c(e),J,{writable:!0,value:""}),i(c(e),Z,{writable:!0,value:""}),i(c(e),Y,{writable:!0,value:""}),i(c(e),q,{writable:!0,value:""}),i(c(e),X,{writable:!0,value:""}),e}return s(n,[{key:"_children",get:function(){return e(this,F)}},{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,z)},set:function(e){this.initialized?u():o(this,z,e)}},{key:"company",get:function(){return e(this,W)},set:function(e){this.initialized?u():o(this,W,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,$)},set:function(e){this.initialized?u():o(this,$,e)}},{key:"title",get:function(){return e(this,H)},set:function(e){this.initialized?u():o(this,H,e)}},{key:"native_language",get:function(){return e(this,J)},set:function(e){this.initialized?u():o(this,J,e)}},{key:"state",get:function(){return e(this,Z)},set:function(e){this.initialized?u():o(this,Z,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,q)},set:function(e){this.initialized?u():o(this,q,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(){E(t,r.CMIArray);var e=w(t);function t(){return a(this,t),e.call(this,{children:S.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(){E(n,r.BaseCMI);var t=w(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){f(e,l.CMIString256)&&o(this,ee,e)}},{key:"date",get:function(){return e(this,te)},set:function(e){f(e,l.CMIString256)&&o(this,te,e)}},{key:"time",get:function(){return e(this,ne)},set:function(e){f(e,l.CMITime)&&o(this,ne,e)}},{key:"status",get:function(){return e(this,re)},set:function(e){f(e,l.CMIStatus2)&&o(this,re,e)}},{key:"why_left",get:function(){return e(this,ie)},set:function(e){f(e,l.CMIString256)&&o(this,ie,e)}},{key:"time_in_element",get:function(){return e(this,oe)},set:function(e){f(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(){E(t,r.CMIArray);var e=w(t);function t(){return a(this,t),e.call(this,{children:S.tries_children})}return s(t)}(),ce=new WeakMap,le=new WeakMap,ue=function(){E(n,r.BaseCMI);var t=w(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:S.score_children,score_range:l.score_range,invalidErrorCode:I.INVALID_SET_VALUE,invalidTypeCode:I.TYPE_MISMATCH,invalidRangeCode:I.VALUE_OUT_OF_RANGE,errorClass:y.AICCValidationError}),e}return s(n,[{key:"initialize",value:function(){var e;b(O(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){f(e,l.CMIStatus2)&&o(this,ce,e)}},{key:"time",get:function(){return e(this,le)},set:function(e){f(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}(),fe=function(){E(t,r.CMIArray);var e=w(t);function t(){return a(this,t),e.call(this,{children:S.attempt_records_children})}return s(t)}(),he=new WeakMap,de=function(){E(n,r.BaseCMI);var t=w(n);function n(){var e;return a(this,n),i(c(e=t.call(this)),he,{writable:!0,value:""}),e.score=new r.CMIScore({score_children:S.score_children,score_range:l.score_range,invalidErrorCode:I.INVALID_SET_VALUE,invalidTypeCode:I.TYPE_MISMATCH,invalidRangeCode:I.VALUE_OUT_OF_RANGE,errorClass:y.AICCValidationError}),e}return s(n,[{key:"initialize",value:function(){var e;b(O(n.prototype),"initialize",this).call(this),null!==(e=this.score)&&void 0!==e&&e.initialize()}},{key:"lesson_status",get:function(){return e(this,he)},set:function(e){f(e,l.CMIStatus2)&&o(this,he,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={lesson_status:this.lesson_status,score:this.score};return delete this.jsonString,e}}]),n}(),pe=new WeakMap,me=new WeakMap,ye=new WeakMap,ge=function(){E(n,r.BaseCMI);var t=w(n);function n(){var e;return a(this,n),i(c(e=t.call(this)),pe,{writable:!0,value:""}),i(c(e),me,{writable:!0,value:""}),i(c(e),ye,{writable:!0,value:""}),e}return s(n,[{key:"content",get:function(){return e(this,pe)},set:function(e){f(e,l.CMIString256)&&o(this,pe,e)}},{key:"location",get:function(){return e(this,me)},set:function(e){f(e,l.CMIString256)&&o(this,me,e)}},{key:"time",get:function(){return e(this,ye)},set:function(e){f(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":
17
- /*!***************************!*\
18
- !*** ./src/cmi/common.js ***!
19
- \***************************/function(n,r,e){"use strict";e.r(r),e.d(r,{BaseCMI:function(){return j},CMIArray:function(){return x},CMIScore:function(){return D},checkValidFormat:function(){return S},checkValidRange:function(){return I}});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?Object.setPrototypeOf.bind():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 f(t)}}function f(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.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(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 h(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=E(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=E(e,t,"get");return t.get?t.get.call(e):t.value}function E(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,w=e.default.scorm12,O=i.default.scorm12;function S(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 I(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,T=new WeakMap,j=function(){function r(){var e,t,n;if(v(this,r),n=!(t="jsonString"),t in(e=this)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,h(this,C,{writable:!0,value:!1}),h(this,T,{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,T)}},{key:"initialize",value:function(){d(this,C,!0)}},{key:"setStartTime",value:function(){d(this,T,(new Date).getTime())}}]),r}(),k=new WeakMap,p=new WeakMap,R=new WeakMap,m=new WeakMap,y=new WeakMap,g=new WeakMap,_=new WeakMap,L=new WeakMap,A=new WeakMap,N=new WeakMap,D=function(){a(u,j);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 v(this,u),h(f(t=l.call(this)),k,{writable:!0,value:void 0}),h(f(t),p,{writable:!0,value:void 0}),h(f(t),R,{writable:!0,value:void 0}),h(f(t),m,{writable:!0,value:void 0}),h(f(t),y,{writable:!0,value:void 0}),h(f(t),g,{writable:!0,value:void 0}),h(f(t),_,{writable:!0,value:void 0}),h(f(t),L,{writable:!0,value:""}),h(f(t),A,{writable:!0,value:""}),h(f(t),N,{writable:!0,value:void 0}),d(f(t),k,n||M.score_children),d(f(t),p,!!r&&w.score_range),d(f(t),N,i||""===i?i:"100"),d(f(t),R,o||O.INVALID_SET_VALUE),d(f(t),m,a||O.TYPE_MISMATCH),d(f(t),y,s||O.VALUE_OUT_OF_RANGE),d(f(t),g,c||w.CMIDecimal),d(f(t),_,e),t}return b(u,[{key:"_children",get:function(){return t(this,k)},set:function(e){throw new(t(this,_).prototype.constructor)(t(this,R))}},{key:"raw",get:function(){return t(this,L)},set:function(e){!S(e,t(this,g),t(this,m),t(this,_))||t(this,p)&&!I(e,t(this,p),t(this,y),t(this,_))||d(this,L,e)}},{key:"min",get:function(){return t(this,A)},set:function(e){!S(e,t(this,g),t(this,m),t(this,_))||t(this,p)&&!I(e,t(this,p),t(this,y),t(this,_))||d(this,A,e)}},{key:"max",get:function(){return t(this,N)},set:function(e){!S(e,t(this,g),t(this,m),t(this,_))||t(this,p)&&!I(e,t(this,p),t(this,y),t(this,_))||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,V=new WeakMap,F=new WeakMap,x=function(){a(o,j);var i=c(o);function o(e){var t,n=e.children,r=e.errorCode,e=e.errorClass;return v(this,o),h(f(t=i.call(this)),P,{writable:!0,value:void 0}),h(f(t),V,{writable:!0,value:void 0}),h(f(t),F,{writable:!0,value:void 0}),d(f(t),F,n),d(f(t),P,r),d(f(t),V,e),t.childArray=[],t}return b(o,[{key:"_children",get:function(){return t(this,F)},set:function(e){throw new(t(this,V).prototype.constructor)(t(this,P))}},{key:"_count",get:function(){return this.childArray.length},set:function(e){throw new(t(this,V).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":
20
- /*!********************************!*\
21
- !*** ./src/cmi/scorm12_cmi.js ***!
22
- \********************************/function(e,t,n){"use strict";n.r(t),n.d(t,{CMI:function(){return D},CMIInteractionsCorrectResponsesObject:function(){return Me},CMIInteractionsObject:function(){return me},CMIInteractionsObjectivesObject:function(){return be},CMIObjectivesObject:function(){return _e},CMIStudentData:function(){return ee},CMIStudentPreference:function(){return ae},NAV:function(){return Oe},check12ValidFormat:function(){return d},check12ValidRange:function(){return j},throwReadOnlyError:function(){return h},throwWriteOnlyError:function(){return C}});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"),p=n(/*! ../constants/regex */"./src/constants/regex.js"),r=n(/*! ../exceptions */"./src/exceptions.js"),m=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 _(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 v(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.bind():function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=O(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 E(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?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function w(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=O(n),t=(e=r?(e=O(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 O(e){return(O=Object.setPrototypeOf?Object.getPrototypeOf.bind():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=S(e,t,"get");return t.get?t.get.call(e):t.value}function f(e,t,n){var t=S(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 S(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}var I=t.default.scorm12,a=p.default.scorm12,s=c.default.scorm12;function h(){throw new r.Scorm12ValidationError(s.READ_ONLY_ELEMENT)}function C(){throw new r.Scorm12ValidationError(s.WRITE_ONLY_ELEMENT)}function T(){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 j(e,t,n){return(0,i.checkValidRange)(e,t,s.VALUE_OUT_OF_RANGE,r.Scorm12ValidationError,n)}var k=new WeakMap,R=new WeakMap,L=new WeakMap,A=new WeakMap,N=new WeakMap,D=function(){E(c,i.BaseCMI);var s=w(c);function c(e,t,n){var r,i,o,a;return g(this,c),u(l(r=s.call(this)),k,{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(),f(l(r),k,e||I.cmi_children),r.core=new Z,r.objectives=new Y,r.student_data=t||new ee,r.student_preference=new ae,r.interactions=new se,r}return v(c,[{key:"initialize",value:function(){var e;b(O(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){T()}},{key:"_children",get:function(){return o(this,k)},set:function(e){T()}},{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?h():f(this,L,e)}},{key:"comments",get:function(){return o(this,A)},set:function(e){d(e,a.CMIString4096,!0)&&f(this,A,e)}},{key:"comments_from_lms",get:function(){return o(this,N)},set:function(e){this.initialized?h():f(this,N,e)}},{key:"getCurrentTotalTime",value:function(){return this.core.getCurrentTotalTime(this.start_time)}}]),c}(),P=new WeakMap,V=new WeakMap,F=new WeakMap,x=new WeakMap,z=new WeakMap,W=new WeakMap,G=new WeakMap,U=new WeakMap,B=new WeakMap,$=new WeakMap,H=new WeakMap,J=new WeakMap,Z=function(){E(n,i.BaseCMI);var t=w(n);function n(){var e;return g(this,n),u(l(e=t.call(this)),P,{writable:!0,value:I.core_children}),u(l(e),V,{writable:!0,value:""}),u(l(e),F,{writable:!0,value:""}),u(l(e),x,{writable:!0,value:""}),u(l(e),z,{writable:!0,value:""}),u(l(e),W,{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),$,{writable:!0,value:""}),u(l(e),H,{writable:!0,value:"00:00:00"}),u(l(e),J,{writable:!0,value:""}),e.score=new i.CMIScore({score_children:I.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 v(n,[{key:"initialize",value:function(){var e;b(O(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){T()}},{key:"student_id",get:function(){return o(this,V)},set:function(e){this.initialized?h():f(this,V,e)}},{key:"student_name",get:function(){return o(this,F)},set:function(e){this.initialized?h():f(this,F,e)}},{key:"lesson_location",get:function(){return o(this,x)},set:function(e){d(e,a.CMIString256,!0)&&f(this,x,e)}},{key:"credit",get:function(){return o(this,z)},set:function(e){this.initialized?h():f(this,z,e)}},{key:"lesson_status",get:function(){return o(this,W)},set:function(e){this.initialized?d(e,a.CMIStatus)&&f(this,W,e):d(e,a.CMIStatus2)&&f(this,W,e)}},{key:"entry",get:function(){return o(this,G)},set:function(e){this.initialized?h():f(this,G,e)}},{key:"total_time",get:function(){return o(this,U)},set:function(e){this.initialized?h():f(this,U,e)}},{key:"lesson_mode",get:function(){return o(this,B)},set:function(e){this.initialized?h():f(this,B,e)}},{key:"exit",get:function(){return this.jsonString?o(this,$):C()},set:function(e){d(e,a.CMIExit,!0)&&f(this,$,e)}},{key:"session_time",get:function(){return this.jsonString?o(this,H):C()},set:function(e){d(e,a.CMITimespan)&&f(this,H,e)}},{key:"suspend_data",get:function(){return o(this,J)},set:function(e){d(e,a.CMIString4096,!0)&&f(this,J,e)}},{key:"getCurrentTotalTime",value:function(e){var t=o(this,H);return null!=e&&(e=(new Date).getTime()-e,t=m.getSecondsAsHHMMSS(e/1e3)),m.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(){E(t,i.CMIArray);var e=w(t);function t(){return g(this,t),e.call(this,{children:I.objectives_children,errorCode:s.INVALID_SET_VALUE,errorClass:r.Scorm12ValidationError})}return v(t)}(),q=new WeakMap,X=new WeakMap,K=new WeakMap,Q=new WeakMap,ee=function(){E(r,i.BaseCMI);var n=w(r);function r(e){var t;return g(this,r),u(l(t=n.call(this)),q,{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:""}),f(l(t),q,e||I.student_data_children),t}return v(r,[{key:"_children",get:function(){return o(this,q)},set:function(e){T()}},{key:"mastery_score",get:function(){return o(this,X)},set:function(e){this.initialized?h():f(this,X,e)}},{key:"max_time_allowed",get:function(){return o(this,K)},set:function(e){this.initialized?h():f(this,K,e)}},{key:"time_limit_action",get:function(){return o(this,Q)},set:function(e){this.initialized?h():f(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(){E(r,i.BaseCMI);var n=w(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:""}),f(l(t),te,e||I.student_preference_children),t}return v(r,[{key:"_children",get:function(){return o(this,te)},set:function(e){T()}},{key:"audio",get:function(){return o(this,ne)},set:function(e){d(e,a.CMISInteger)&&j(e,a.audio_range)&&f(this,ne,e)}},{key:"language",get:function(){return o(this,re)},set:function(e){d(e,a.CMIString256)&&f(this,re,e)}},{key:"speed",get:function(){return o(this,ie)},set:function(e){d(e,a.CMISInteger)&&j(e,a.speed_range)&&f(this,ie,e)}},{key:"text",get:function(){return o(this,oe)},set:function(e){d(e,a.CMISInteger)&&j(e,a.text_range)&&f(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(){E(t,i.CMIArray);var e=w(t);function t(){return g(this,t),e.call(this,{children:I.interactions_children,errorCode:s.INVALID_SET_VALUE,errorClass:r.Scorm12ValidationError})}return v(t)}(),ce=new WeakMap,le=new WeakMap,ue=new WeakMap,fe=new WeakMap,he=new WeakMap,de=new WeakMap,pe=new WeakMap,me=function(){E(n,i.BaseCMI);var t=w(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),fe,{writable:!0,value:""}),u(l(e),he,{writable:!0,value:""}),u(l(e),de,{writable:!0,value:""}),u(l(e),pe,{writable:!0,value:""}),e.objectives=new i.CMIArray({errorCode:s.INVALID_SET_VALUE,errorClass:r.Scorm12ValidationError,children:I.objectives_children}),e.correct_responses=new i.CMIArray({errorCode:s.INVALID_SET_VALUE,errorClass:r.Scorm12ValidationError,children:I.correct_responses_children}),e}return v(n,[{key:"initialize",value:function(){var e;b(O(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)&&f(this,ce,e)}},{key:"time",get:function(){return this.jsonString?o(this,le):C()},set:function(e){d(e,a.CMITime)&&f(this,le,e)}},{key:"type",get:function(){return this.jsonString?o(this,ue):C()},set:function(e){d(e,a.CMIType)&&f(this,ue,e)}},{key:"weighting",get:function(){return this.jsonString?o(this,fe):C()},set:function(e){d(e,a.CMIDecimal)&&j(e,a.weighting_range)&&f(this,fe,e)}},{key:"student_response",get:function(){return this.jsonString?o(this,he):C()},set:function(e){d(e,a.CMIFeedback,!0)&&f(this,he,e)}},{key:"result",get:function(){return this.jsonString?o(this,de):C()},set:function(e){d(e,a.CMIResult)&&f(this,de,e)}},{key:"latency",get:function(){return this.jsonString?o(this,pe):C()},set:function(e){d(e,a.CMITimespan)&&f(this,pe,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,_e=function(){E(n,i.BaseCMI);var t=w(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:I.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 v(n,[{key:"id",get:function(){return o(this,ye)},set:function(e){d(e,a.CMIIdentifier)&&f(this,ye,e)}},{key:"status",get:function(){return o(this,ge)},set:function(e){d(e,a.CMIStatus2)&&f(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}(),ve=new WeakMap,be=function(){E(n,i.BaseCMI);var t=w(n);function n(){var e;return g(this,n),u(l(e=t.call(this)),ve,{writable:!0,value:""}),e}return v(n,[{key:"id",get:function(){return o(this,ve)},set:function(e){d(e,a.CMIIdentifier)&&f(this,ve,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={id:this.id};return delete this.jsonString,e}}]),n}(),Ee=new WeakMap,Me=function(){E(n,i.BaseCMI);var t=w(n);function n(){var e;return g(this,n),u(l(e=t.call(this)),Ee,{writable:!0,value:""}),e}return v(n,[{key:"pattern",get:function(){return this.jsonString?o(this,Ee):C()},set:function(e){d(e,a.CMIFeedback,!0)&&f(this,Ee,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={pattern:this.pattern};return delete this.jsonString,e}}]),n}(),we=new WeakMap,Oe=function(){E(n,i.BaseCMI);var t=w(n);function n(){var e;return g(this,n),u(l(e=t.call(this)),we,{writable:!0,value:""}),e}return v(n,[{key:"event",get:function(){return o(this,we)},set:function(e){d(e,a.NAVEvent)&&f(this,we,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={event:this.event};return delete this.jsonString,e}}]),n}()},"./src/constants/api_constants.js":
23
- /*!****************************************!*\
24
- !*** ./src/constants/api_constants.js ***!
25
- \****************************************/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":
26
- /*!**************************************!*\
27
- !*** ./src/constants/error_codes.js ***!
28
- \**************************************/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/regex.js":
29
- /*!********************************!*\
30
- !*** ./src/constants/regex.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={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/exceptions.js":
32
- /*!***************************!*\
33
- !*** ./src/exceptions.js ***!
34
- \***************************/function(t,e,n){"use strict";n.r(e),n.d(e,{AICCValidationError:function(){return T},Scorm12ValidationError:function(){return C},Scorm2004ValidationError:function(){return j},ValidationError:function(){return I}});e=n(/*! ./constants/api_constants */"./src/constants/api_constants.js");function h(e){return(h="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=_(n);return i(this,r?(e=_(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function i(e,t){if(t&&("object"===h(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 p(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 m(e,arguments,_(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),g(t,e)}(e)}function m(e,t,n){return(m=y()?Reflect.construct.bind():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?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function _(e){return(_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(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 E(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,f=e.default.scorm2004.error_descriptions,w=new WeakMap,O=new WeakMap,S=new WeakMap,I=function(){s(o,p(Error));var i=c(o);function o(e,t,n){var r;return a(this,o),v(l(r=i.call(this,t)),w,{writable:!0,value:void 0}),v(l(r),O,{writable:!0,value:void 0}),v(l(r),S,{writable:!0,value:void 0}),E(l(r),w,e),E(l(r),O,t),E(l(r),S,n),r}return r(o,[{key:"errorCode",get:function(){return b(this,w)}},{key:"errorMessage",get:function(){return b(this,O)}},{key:"detailedMessage",get:function(){return b(this,S)}}]),o}(),C=function(){s(n,I);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)}(),T=function(){s(n,I);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)}(),j=function(){s(n,I);var t=c(n);function n(e){return a(this,n),i({}.hasOwnProperty.call(f,String(e))?t.call(this,e,f[String(e)].basicMessage,f[String(e)].detailMessage):t.call(this,101,f[101].basicMessage,f[101].detailMessage))}return r(n)}()},"./src/utilities.js":
35
- /*!**************************!*\
36
- !*** ./src/utilities.js ***!
37
- \**************************/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_DAY:function(){return f},SECONDS_PER_HOUR:function(){return o},SECONDS_PER_MINUTE:function(){return i},SECONDS_PER_SECOND:function(){return n},addHHMMSSTimeStrings:function(){return y},addTwoDurations:function(){return m},countDecimals:function(){return l},flatten:function(){return g},getDurationAsSeconds:function(){return c},getSecondsAsHHMMSS:function(){return d},getSecondsAsISODuration:function(){return p},getTimeAsSeconds:function(){return s},unflatten:function(){return _}});var n=1,i=60,o=60*i,f=24*o,h=[["D",f],["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 p(e){if(!e||e<=0)return"PT0S";var r="P",i=e;return h.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 m(e,t,n){return p(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 _(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 t={};!function(){"use strict";
38
- /*!*****************************!*\
39
- !*** ./src/exports/aicc.js ***!
40
- \*****************************/i.r(t);var e=i(/*! ../AICC */"./src/AICC.js");window.AICC=e.default}()}();
1
+ !function(){"use strict";var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};function t(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}var i=function(){return i=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},i.apply(this,arguments)};function r(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}function n(e,t){var i,r,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(n=o.trys,(n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){o.label=a[1];break}if(6===a[0]&&o.label<n[1]){o.label=n[1],n=a;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(a);break}n[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;var o={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."}}},s={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:o,aicc:i(i({},o),{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."}}}},a={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},c={scorm12:i(i({},a),{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:i(i({},a),{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})},l={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"},u={aicc:i(i({},l),{CMIIdentifier:"^\\w{1,255}$"}),scorm12:l,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"}},_=s.scorm12,h=u.scorm12,d=c.scorm12,p=function(e){function i(t){var i=e.call(this,t.toString())||this;return i._errorCode=t,i.name="ScormValidationError",i}return t(i,e),Object.defineProperty(i.prototype,"errorCode",{get:function(){return this._errorCode},enumerable:!1,configurable:!0}),i.prototype.setMessage=function(e){this.message=e},i}(Error),f=function(e){function i(t){var i=e.call(this,t)||this;return i.name="Scorm12ValidationError",i}return t(i,e),i}(p);!function(e){function i(t){var i=e.call(this,t)||this;return i.name="Scorm2004ValidationError",i}t(i,e)}(p);function m(e,t,i,r,n){var o=new RegExp(t),s=e.match(o);if(n&&""===e)return!0;if(void 0===e||!s||""===s[0])throw new r(i);return!0}function g(e,t,i,r){var n=t.split("#");if((e*=1)>=n[0]){if("*"===n[1]||e<=n[1])return!0;throw new r(i)}throw new r(i)}var E=function(){function e(){this.jsonString=!1,this._initialized=!1}return Object.defineProperty(e.prototype,"initialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"start_time",{get:function(){return this._start_time},enumerable:!1,configurable:!0}),e.prototype.initialize=function(){this._initialized=!0},e.prototype.setStartTime=function(){this._start_time=(new Date).getTime()},e}(),y=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return t(i,e),i}(E),M=function(e){function i(t){var i=e.call(this)||this;return i._raw="",i._min="",i.__children=t.score_children||_.score_children,i.__score_range=!!t.score_range&&h.score_range,i._max=t.max||""===t.max?t.max:"100",i.__invalid_error_code=t.invalidErrorCode||d.INVALID_SET_VALUE,i.__invalid_type_code=t.invalidTypeCode||d.TYPE_MISMATCH,i.__invalid_range_code=t.invalidRangeCode||d.VALUE_OUT_OF_RANGE,i.__decimal_regex=t.decimalRegex||h.CMIDecimal,i.__error_class=t.errorClass,i}return t(i,e),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new this.__error_class(this.__invalid_error_code)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"raw",{get:function(){return this._raw},set:function(e){!m(e,this.__decimal_regex,this.__invalid_type_code,this.__error_class)||this.__score_range&&!g(e,this.__score_range,this.__invalid_range_code,this.__error_class)||(this._raw=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"min",{get:function(){return this._min},set:function(e){!m(e,this.__decimal_regex,this.__invalid_type_code,this.__error_class)||this.__score_range&&!g(e,this.__score_range,this.__invalid_range_code,this.__error_class)||(this._min=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"max",{get:function(){return this._max},set:function(e){!m(e,this.__decimal_regex,this.__invalid_type_code,this.__error_class)||this.__score_range&&!g(e,this.__score_range,this.__invalid_range_code,this.__error_class)||(this._max=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={raw:this.raw,min:this.min,max:this.max};return delete this.jsonString,e},i}(E),b=function(e){function i(t){var i=e.call(this)||this;return i.__children=t.children,i._errorCode=t.errorCode||d.GENERAL,i._errorClass=t.errorClass||f,i.childArray=[],i}return t(i,e),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"_count",{get:function(){return this.childArray.length},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;for(var e={},t=0;t<this.childArray.length;t++)e[t+""]=this.childArray[t];return delete this.jsonString,e},i}(E),I=s.scorm12.error_descriptions,O=s.aicc.error_descriptions,L=s.scorm2004.error_descriptions,S=function(e){function i(t,i,r){var n=e.call(this,t)||this;return n._detailedMessage="",n.setMessage(i),n._errorMessage=i,r&&(n._detailedMessage=r),n}return t(i,e),Object.defineProperty(i.prototype,"errorMessage",{get:function(){return this._errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"detailedMessage",{get:function(){return this._detailedMessage},enumerable:!1,configurable:!0}),i}(p),T=function(e){function i(t){return{}.hasOwnProperty.call(I,String(t))?e.call(this,t,I[String(t)].basicMessage,I[String(t)].detailMessage)||this:e.call(this,101,I[101].basicMessage,I[101].detailMessage)||this}return t(i,e),i}(S),v=function(e){function i(t){return{}.hasOwnProperty.call(O,String(t))?e.call(this,t,O[String(t)].basicMessage,O[String(t)].detailMessage)||this:e.call(this,101,O[101].basicMessage,O[101].detailMessage)||this}return t(i,e),i}(S),C=(function(e){function i(t){return{}.hasOwnProperty.call(L,String(t))?e.call(this,t,L[String(t)].basicMessage,L[String(t)].detailMessage)||this:e.call(this,101,L[101].basicMessage,L[101].detailMessage)||this}t(i,e)}(S),3600);function N(e){if(!e||e<=0)return"00:00:00";var t=Math.floor(e/C),i=new Date(1e3*e),r=i.getUTCMinutes(),n=i.getSeconds(),o=e%1,s="";return A(o)>0&&(s="."+(s=A(o)>2?o.toFixed(2):String(o)).split(".")[1]),(t+":"+r+":"+n).replace(/\b\d\b/g,"0$&")+s}function w(e,t){if("number"!=typeof e&&"boolean"!=typeof e||(e=String(e)),"string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var i=e.split(":");return 3600*Number(i[0])+60*Number(i[1])+Number(i[2])}function R(e){var t={};return function e(i,r){if(Object(i)!==i)t[r]=i;else if(Array.isArray(i))for(var n=0,o=i.length;n<o;n++)e(i[n],r+"["+n+"]"),0===o&&(t[r]=[]);else{var s=!0;for(var a in i)({}).hasOwnProperty.call(i,a)&&(s=!1,e(i[a],r?r+"."+a:a));s&&r&&(t[r]={})}}(e,""),t}function A(e){return Math.floor(e)===e||String(e).indexOf(".")<0?0:e.toString().split(".")[1].length||0}var j=s.global,D=c.scorm12;var V={autocommit:!1,autocommitSeconds:10,asyncCommit:!1,sendBeaconCommit:!1,lmsCommitUrl:!1,dataCommitFormat:"json",commitRequestDataType:"application/json;charset=UTF-8",autoProgress:!1,logLevel:j.LOG_LEVEL_ERROR,selfReportSessionTime:!1,alwaysSendTotalTime:!1,strict_errors:!0,xhrHeaders:{},xhrWithCredentials:!1,responseHandler:function(e){return r(this,void 0,void 0,(function(){var t,i,r;return n(this,(function(n){switch(n.label){case 0:return void 0===e?[3,2]:(r=(i=JSON).parse,[4,e.text()]);case 1:return null!==(t=r.apply(i,[n.sent()]))&&{}.hasOwnProperty.call(t,"result")?[2,{result:t.result,errorCode:t.errorCode?t.errorCode:t.result===j.SCORM_TRUE?0:101}]:200===e.status?[2,{result:j.SCORM_TRUE,errorCode:0}]:[2,{result:j.SCORM_FALSE,errorCode:101}];case 2:return[2,{result:j.SCORM_FALSE,errorCode:101}]}}))}))},requestHandler:function(e){return e},onLogMessage:function(e,t){switch(e){case j.LOG_LEVEL_ERROR:console.error(t);break;case j.LOG_LEVEL_WARNING:console.warn(t);break;case j.LOG_LEVEL_INFO:console.info(t);break;case j.LOG_LEVEL_DEBUG:console.debug?console.debug(t):console.log(t)}}},P=function(){function e(t,i){var r=this.constructor;if(this._settings=V,r===e)throw new TypeError("Cannot construct BaseAPI instances directly");this.currentState=j.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[],this._error_codes=t,i&&(this.settings=i),this.apiLogLevel=this.settings.logLevel,this.selfReportSessionTime=this.settings.selfReportSessionTime}return e.prototype.initialize=function(e,t,i){var r=j.SCORM_FALSE;return this.isInitialized()?this.throwSCORMError(this._error_codes.INITIALIZED,t):this.isTerminated()?this.throwSCORMError(this._error_codes.TERMINATED,i):(this.selfReportSessionTime&&this.cmi.setStartTime(),this.currentState=j.STATE_INITIALIZED,this.lastErrorCode="0",r=j.SCORM_TRUE,this.processListeners(e)),this.apiLog(e,"returned: "+r,j.LOG_LEVEL_INFO),this.clearSCORMError(r),r},Object.defineProperty(e.prototype,"error_codes",{get:function(){return this._error_codes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"settings",{get:function(){return this._settings},set:function(e){this._settings=i(i({},this._settings),e)},enumerable:!1,configurable:!0}),e.prototype.terminate=function(e,t){var i=j.SCORM_FALSE;if(this.checkState(t,this._error_codes.TERMINATION_BEFORE_INIT,this._error_codes.MULTIPLE_TERMINATION)){this.currentState=j.STATE_TERMINATED;var r=this.storeData(!0);void 0!==r.errorCode&&r.errorCode>0&&this.throwSCORMError(r.errorCode),i=void 0!==r&&r.result?r.result:j.SCORM_FALSE,t&&(this.lastErrorCode="0"),i=j.SCORM_TRUE,this.processListeners(e)}return this.apiLog(e,"returned: "+i,j.LOG_LEVEL_INFO),this.clearSCORMError(i),i},e.prototype.getValue=function(e,t,i){var r="";if(this.checkState(t,this._error_codes.RETRIEVE_BEFORE_INIT,this._error_codes.RETRIEVE_AFTER_TERM)){t&&(this.lastErrorCode="0");try{r=this.getCMIValue(i)}catch(e){r=this.handleValueAccessException(e,r)}this.processListeners(e,i)}return this.apiLog(e,": returned: "+r,j.LOG_LEVEL_INFO,i),this.clearSCORMError(r),r},e.prototype.setValue=function(e,t,i,r,n){void 0!==n&&(n=String(n));var o=j.SCORM_FALSE;if(this.checkState(i,this._error_codes.STORE_BEFORE_INIT,this._error_codes.STORE_AFTER_TERM)){i&&(this.lastErrorCode="0");try{o=this.setCMIValue(r,n)}catch(e){this.handleValueAccessException(e,o)}this.processListeners(e,r,n)}return void 0===o&&(o=j.SCORM_FALSE),"0"===String(this.lastErrorCode)&&this.settings.autocommit&&!this._timeout&&this.scheduleCommit(1e3*this.settings.autocommitSeconds,t),this.apiLog(e,": "+n+": result: "+o,j.LOG_LEVEL_INFO,r),this.clearSCORMError(o),o},e.prototype.commit=function(e,t){void 0===t&&(t=!1),this.clearScheduledCommit();var i=j.SCORM_FALSE;if(this.checkState(t,this._error_codes.COMMIT_BEFORE_INIT,this._error_codes.COMMIT_AFTER_TERM)){var r=this.storeData(!1);r.errorCode&&r.errorCode>0&&this.throwSCORMError(r.errorCode),i=void 0!==r&&r.result?r.result:j.SCORM_FALSE,this.apiLog(e," Result: "+i,j.LOG_LEVEL_DEBUG,"HttpRequest"),t&&(this.lastErrorCode="0"),this.processListeners(e)}return this.apiLog(e,"returned: "+i,j.LOG_LEVEL_INFO),this.clearSCORMError(i),i},e.prototype.getLastError=function(e){var t=String(this.lastErrorCode);return this.processListeners(e),this.apiLog(e,"returned: "+t,j.LOG_LEVEL_INFO),t},e.prototype.getErrorString=function(e,t){var i="";return null!==t&&""!==t&&(i=this.getLmsErrorMessageDetails(t),this.processListeners(e)),this.apiLog(e,"returned: "+i,j.LOG_LEVEL_INFO),i},e.prototype.getDiagnostic=function(e,t){var i="";return null!==t&&""!==t&&(i=this.getLmsErrorMessageDetails(t,!0),this.processListeners(e)),this.apiLog(e,"returned: "+i,j.LOG_LEVEL_INFO),i},e.prototype.checkState=function(e,t,i){return this.isNotInitialized()?(this.throwSCORMError(t),!1):!e||!this.isTerminated()||(this.throwSCORMError(i),!1)},e.prototype.apiLog=function(e,t,i,r){t=this.formatMessage(e,t,r),i>=this.apiLogLevel&&this.settings.onLogMessage(i,t)},e.prototype.formatMessage=function(e,t,i){for(var r="",n=20-(r+=e).length,o=0;o<n;o++)r+=" ";if(r+=": ",i){n=70-(r+=i).length;for(var s=0;s<n;s++)r+=" "}return t&&(r+=t),r},e.prototype.stringMatches=function(e,t){return null!==(null==e?void 0:e.match(t))},e.prototype._checkObjectHasProperty=function(e,t){return Object.hasOwnProperty.call(e,t)||null!=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),t)||t in e},e.prototype.getLmsErrorMessageDetails=function(e,t){throw void 0===t&&(t=!1),new Error("The getLmsErrorMessageDetails method has not been implemented")},e.prototype.getCMIValue=function(e){throw new Error("The getCMIValue method has not been implemented")},e.prototype.setCMIValue=function(e,t){throw new Error("The setCMIValue method has not been implemented")},e.prototype._commonSetCMIValue=function(e,t,i,r){if(!i||""===i)return j.SCORM_FALSE;for(var n=i.split("."),o=this,s=j.SCORM_FALSE,a=!1,c="The data model element passed to ".concat(e," (").concat(i,") is not a valid SCORM data model element."),l=t?this._error_codes.UNDEFINED_DATA_MODEL:this._error_codes.GENERAL,u=0;u<n.length;u++){var _=n[u];if(u===n.length-1)t&&"{target="===_.substring(0,8)&&"function"==typeof o._isTargetValid?this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT):this._checkObjectHasProperty(o,_)?(this.isInitialized()&&this.stringMatches(i,"\\.correct_responses\\.\\d+")&&this.validateCorrectResponse(i,r),t&&"0"!==this.lastErrorCode||(o[_]=r,s=j.SCORM_TRUE)):this.throwSCORMError(l,c);else{if(!(o=o[_])){this.throwSCORMError(l,c);break}if(o instanceof b){var h=parseInt(n[u+1],10);if(!isNaN(h)){var d=o.childArray[h];if(d)o=d,a=!0;else{var p=this.getChildElement(i,r,a);a=!0,p?(o.initialized&&p.initialize(),o.childArray.push(p),o=p):this.throwSCORMError(l,c)}u++}}}}return s===j.SCORM_FALSE&&this.apiLog(e,"There was an error setting the value for: ".concat(i,", value of: ").concat(r),j.LOG_LEVEL_WARNING),s},e.prototype._commonGetCMIValue=function(e,t,i){if(!i||""===i)return"";for(var r=i.split("."),n=this,o=null,s="The data model element passed to ".concat(e," (").concat(i,") has not been initialized."),a="The data model element passed to ".concat(e," (").concat(i,") is not a valid SCORM data model element."),c=t?this._error_codes.UNDEFINED_DATA_MODEL:this._error_codes.GENERAL,l=0;l<r.length;l++){if(o=r[l],t){if("{target="===String(o).substring(0,8)&&"function"==typeof n._isTargetValid){var u=String(o).substring(8,String(o).length-9);return n._isTargetValid(u)}if(!this._checkObjectHasProperty(n,o))return void this.throwSCORMError(c,a)}else if(l===r.length-1&&!this._checkObjectHasProperty(n,o))return void this.throwSCORMError(c,a);if(void 0===(n=n[o])){this.throwSCORMError(c,a);break}if(n instanceof b){var _=parseInt(r[l+1],10);if(!isNaN(_)){var h=n.childArray[_];if(!h){this.throwSCORMError(this._error_codes.VALUE_NOT_INITIALIZED,s);break}n=h,l++}}}if(null!=n)return n;t||("_children"===o?this.throwSCORMError(D.CHILDREN_ERROR):"_count"===o&&this.throwSCORMError(D.COUNT_ERROR))},e.prototype.isInitialized=function(){return this.currentState===j.STATE_INITIALIZED},e.prototype.isNotInitialized=function(){return this.currentState===j.STATE_NOT_INITIALIZED},e.prototype.isTerminated=function(){return this.currentState===j.STATE_TERMINATED},e.prototype.on=function(e,t){if(t)for(var i=e.split(" "),r=0;r<i.length;r++){var n=i[r].split(".");if(0===n.length)return;var o=n[0],s=null;n.length>1&&(s=e.replace(o+".","")),this.listenerArray.push({functionName:o,CMIElement:s,callback:t}),this.apiLog("on","Added event listener: ".concat(this.listenerArray.length),j.LOG_LEVEL_INFO,o)}},e.prototype.off=function(e,t){if(t)for(var i=e.split(" "),r=function(r){var o=i[r].split(".");if(0===o.length)return{value:void 0};var s=o[0],a=null;o.length>1&&(a=e.replace(s+".",""));var c=n.listenerArray.findIndex((function(e){return e.functionName===s&&e.CMIElement===a&&e.callback===t}));-1!==c&&(n.listenerArray.splice(c,1),n.apiLog("off","Removed event listener: ".concat(n.listenerArray.length),j.LOG_LEVEL_INFO,s))},n=this,o=0;o<i.length;o++){var s=r(o);if("object"==typeof s)return s.value}},e.prototype.clear=function(e){for(var t=e.split(" "),i=function(i){var n=t[i].split(".");if(0===n.length)return{value:void 0};var o=n[0],s=null;n.length>1&&(s=e.replace(o+".","")),r.listenerArray=r.listenerArray.filter((function(e){return e.functionName!==o&&e.CMIElement!==s}))},r=this,n=0;n<t.length;n++){var o=i(n);if("object"==typeof o)return o.value}},e.prototype.processListeners=function(e,t,i){this.apiLog(e,i,j.LOG_LEVEL_INFO,t);for(var r=0;r<this.listenerArray.length;r++){var n=this.listenerArray[r],o=n.functionName===e,s=!!n.CMIElement,a=!1;a=t&&n.CMIElement&&"*"===n.CMIElement.substring(n.CMIElement.length-1)?0===t.indexOf(n.CMIElement.substring(0,n.CMIElement.length-1)):n.CMIElement===t,!o||s&&!a||(this.apiLog("processListeners","Processing listener: ".concat(n.functionName),j.LOG_LEVEL_INFO,t),n.callback(t,i))}},e.prototype.throwSCORMError=function(e,t){t||(t=this.getLmsErrorMessageDetails(e)),this.apiLog("throwSCORMError",e+": "+t,j.LOG_LEVEL_ERROR),this.lastErrorCode=String(e)},e.prototype.clearSCORMError=function(e){void 0!==e&&e!==j.SCORM_FALSE&&(this.lastErrorCode="0")},e.prototype.loadFromFlattenedJSON=function(e,t){var i=this;if(this.isNotInitialized()){var r,n=/^(cmi\.interactions\.)(\d+)\.(.*)$/,o=/^(cmi\.objectives\.)(\d+)\.(.*)$/,s=Object.keys(e).map((function(t){return[String(t),e[t]]}));s.sort((function(e,t){var i,r=e[0],s=(e[1],t[0]);t[1];return null!==(i=a(r,s,n))||null!==(i=a(r,s,o))?i:r<s?-1:r>s?1:0})),s.forEach((function(e){(r={})[e[0]]=e[1],i.loadFromJSON(function(e){if(Object(e)!==e||Array.isArray(e))return e;var t=/\.?([^.[\]]+)|\[(\d+)]/g,i={};for(var r in e)if({}.hasOwnProperty.call(e,r)){for(var n=i,o="",s=t.exec(r);s;)n=n[o]||(n[o]=s[2]?[]:{}),o=s[2]||s[1],s=t.exec(r);n[o]=e[r]}return i[""]||i}(r),t)}))}else console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize.");function a(e,t,i){var r,n=e.match(i);if(null!==n&&null!==(r=t.match(i))){var o=Number(n[2]),s=Number(r[2]);return o===s?"id"===n[3]?-1:"type"===n[3]?"id"===r[3]?1:-1:1:o-s}return null}},e.prototype.loadFromJSON=function(e,t){if(this.isNotInitialized()){for(var i in t=void 0!==t?t:"cmi",this.startingData=e,e)if({}.hasOwnProperty.call(e,i)&&e[i]){var r=(t?t+".":"")+i,n=e[i];if(n.childArray)for(var o=0;o<n.childArray.length;o++)this.loadFromJSON(n.childArray[o],r+"."+o);else n.constructor===Object?this.loadFromJSON(n,r):this.setCMIValue(r,n)}}else console.error("loadFromJSON can only be called before the call to lmsInitialize.")},e.prototype.renderCMIToJSONString=function(){var e=this.cmi;return JSON.stringify({cmi:e})},e.prototype.renderCMIToJSONObject=function(){return JSON.parse(this.renderCMIToJSONString())},e.prototype.processHttpRequest=function(e,t,o){var s=this;void 0===o&&(o=!1);var a=this,c={result:j.SCORM_FALSE,errorCode:this.error_codes.GENERAL},l=function(e,t,i){var r;return void 0===i&&(i=!1),function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var s=this,a=i&&!r;r&&clearTimeout(r),r=setTimeout((function(){r=null,i||e.apply(s,n)}),t),a&&e.apply(s,n)}}((function(e,t,o){return r(s,void 0,void 0,(function(){var r,s,l,u;return n(this,(function(n){switch(n.label){case 0:return n.trys.push([0,6,,7]),t=o.requestHandler(t),[4,fetch(e,{method:"POST",body:t instanceof Array?t.join("&"):JSON.stringify(t),headers:i(i({},o.xhrHeaders),{"Content-Type":o.commitRequestDataType}),credentials:o.xhrWithCredentials?"include":void 0,keepalive:!0})];case 1:return r=n.sent(),"function"!=typeof o.responseHandler?[3,3]:[4,o.responseHandler(r)];case 2:return l=n.sent(),[3,5];case 3:return[4,r.json()];case 4:l=n.sent(),n.label=5;case 5:return s=l,r.status>=200&&r.status<=299&&(!0===s.result||s.result===j.SCORM_TRUE)?a.processListeners("CommitSuccess"):a.processListeners("CommitError"),[2,s];case 6:return u=n.sent(),this.apiLog("processHttpRequest",u,j.LOG_LEVEL_ERROR),a.processListeners("CommitError"),[2,c];case 7:return[2]}}))}))}),500,o);return l(e,t,this.settings),{result:j.SCORM_TRUE,errorCode:0}},e.prototype.scheduleCommit=function(e,t){this._timeout=new z(this,e,t),this.apiLog("scheduleCommit","scheduled",j.LOG_LEVEL_DEBUG,"")},e.prototype.clearScheduledCommit=function(){this._timeout&&(this._timeout.cancel(),this._timeout=void 0,this.apiLog("clearScheduledCommit","cleared",j.LOG_LEVEL_DEBUG,""))},e.prototype.handleValueAccessException=function(e,t){return e instanceof S?(this.lastErrorCode=String(e.errorCode),t=j.SCORM_FALSE):(e instanceof Error&&e.message?console.error(e.message):console.error(e),this.throwSCORMError(this._error_codes.GENERAL)),t},e}(),x=P,z=function(){function e(e,t,i){this._cancelled=!1,this._API=e,this._timeout=setTimeout(this.wrapper.bind(this),t),this._callback=i}return e.prototype.cancel=function(){this._cancelled=!0,this._timeout&&clearTimeout(this._timeout)},e.prototype.wrapper=function(){this._cancelled||this._API.commit(this._callback)},e}(),F=s.scorm12,G=u.scorm12,U=c.scorm12;function Y(e,t,i){return m(e,t,U.TYPE_MISMATCH,T,i)}function $(e,t,i){if(!i&&""===e)throw new T(U.VALUE_OUT_OF_RANGE);return g(e,t,U.VALUE_OUT_OF_RANGE,T)}var k=function(e){function i(t,i,r){var n=e.call(this)||this;return n.__children="",n.__version="3.4",n._launch_data="",n._comments="",n._comments_from_lms="",r&&n.initialize(),n.__children=t||F.cmi_children,n.core=new J,n.objectives=new H,n.student_data=i||new B,n.student_preference=new Z,n.interactions=new W,n}return t(i,e),i.prototype.initialize=function(){var t,i,r,n,o;e.prototype.initialize.call(this),null===(t=this.core)||void 0===t||t.initialize(),null===(i=this.objectives)||void 0===i||i.initialize(),null===(r=this.student_data)||void 0===r||r.initialize(),null===(n=this.student_preference)||void 0===n||n.initialize(),null===(o=this.interactions)||void 0===o||o.initialize()},i.prototype.toJSON=function(){this.jsonString=!0;var e={suspend_data:this.suspend_data,launch_data:this.launch_data,comments:this.comments,comments_from_lms:this.comments_from_lms,core:this.core,objectives:this.objectives,student_data:this.student_data,student_preference:this.student_preference,interactions:this.interactions};return delete this.jsonString,e},Object.defineProperty(i.prototype,"_version",{get:function(){return this.__version},set:function(e){throw new T(U.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new T(U.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"suspend_data",{get:function(){var e;return null===(e=this.core)||void 0===e?void 0:e.suspend_data},set:function(e){this.core&&(this.core.suspend_data=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"launch_data",{get:function(){return this._launch_data},set:function(e){if(this.initialized)throw new T(U.READ_ONLY_ELEMENT);this._launch_data=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"comments",{get:function(){return this._comments},set:function(e){Y(e,G.CMIString4096,!0)&&(this._comments=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"comments_from_lms",{get:function(){return this._comments_from_lms},set:function(e){if(this.initialized)throw new T(U.READ_ONLY_ELEMENT);this._comments_from_lms=e},enumerable:!1,configurable:!0}),i.prototype.getCurrentTotalTime=function(){return this.core.getCurrentTotalTime(this.start_time)},i}(y),J=function(e){function i(){var t=e.call(this)||this;return t.__children=F.core_children,t._student_id="",t._student_name="",t._lesson_location="",t._credit="",t._lesson_status="not attempted",t._entry="",t._total_time="",t._lesson_mode="normal",t._exit="",t._session_time="00:00:00",t._suspend_data="",t.score=new M({score_children:F.score_children,score_range:G.score_range,invalidErrorCode:U.INVALID_SET_VALUE,invalidTypeCode:U.TYPE_MISMATCH,invalidRangeCode:U.VALUE_OUT_OF_RANGE,errorClass:T}),t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new T(U.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"student_id",{get:function(){return this._student_id},set:function(e){if(this.initialized)throw new T(U.READ_ONLY_ELEMENT);this._student_id=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"student_name",{get:function(){return this._student_name},set:function(e){if(this.initialized)throw new T(U.READ_ONLY_ELEMENT);this._student_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"lesson_location",{get:function(){return this._lesson_location},set:function(e){Y(e,G.CMIString256,!0)&&(this._lesson_location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"credit",{get:function(){return this._credit},set:function(e){if(this.initialized)throw new T(U.READ_ONLY_ELEMENT);this._credit=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"lesson_status",{get:function(){return this._lesson_status},set:function(e){this.initialized?Y(e,G.CMIStatus)&&(this._lesson_status=e):Y(e,G.CMIStatus2)&&(this._lesson_status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"entry",{get:function(){return this._entry},set:function(e){if(this.initialized)throw new T(U.READ_ONLY_ELEMENT);this._entry=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"total_time",{get:function(){return this._total_time},set:function(e){if(this.initialized)throw new T(U.READ_ONLY_ELEMENT);this._total_time=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"lesson_mode",{get:function(){return this._lesson_mode},set:function(e){if(this.initialized)throw new T(U.READ_ONLY_ELEMENT);this._lesson_mode=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"exit",{get:function(){if(!this.jsonString)throw new T(U.WRITE_ONLY_ELEMENT);return this._exit},set:function(e){Y(e,G.CMIExit,!0)&&(this._exit=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"session_time",{get:function(){if(!this.jsonString)throw new T(U.WRITE_ONLY_ELEMENT);return this._session_time},set:function(e){Y(e,G.CMITimespan)&&(this._session_time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"suspend_data",{get:function(){return this._suspend_data},set:function(e){Y(e,G.CMIString4096,!0)&&(this._suspend_data=e)},enumerable:!1,configurable:!0}),i.prototype.getCurrentTotalTime=function(e){var t,i,r,n=this._session_time,o=e;null!=o&&(n=N(((new Date).getTime()-o)/1e3));return t=this._total_time,i=n,"string"==typeof(r=new RegExp(G.CMITimespan))&&(r=new RegExp(r)),N(w(t,r)+w(i,r))},i.prototype.toJSON=function(){this.jsonString=!0;var e={student_id:this.student_id,student_name:this.student_name,lesson_location:this.lesson_location,credit:this.credit,lesson_status:this.lesson_status,entry:this.entry,lesson_mode:this.lesson_mode,exit:this.exit,session_time:this.session_time,score:this.score};return delete this.jsonString,e},i}(E),H=function(e){function i(){return e.call(this,{children:F.objectives_children,errorCode:U.INVALID_SET_VALUE,errorClass:T})||this}return t(i,e),i}(b),B=function(e){function i(t){var i=e.call(this)||this;return i._mastery_score="",i._max_time_allowed="",i._time_limit_action="",i.__children=t||F.student_data_children,i}return t(i,e),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new T(U.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"mastery_score",{get:function(){return this._mastery_score},set:function(e){if(this.initialized)throw new T(U.READ_ONLY_ELEMENT);this._mastery_score=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"max_time_allowed",{get:function(){return this._max_time_allowed},set:function(e){if(this.initialized)throw new T(U.READ_ONLY_ELEMENT);this._max_time_allowed=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time_limit_action",{get:function(){return this._time_limit_action},set:function(e){if(this.initialized)throw new T(U.READ_ONLY_ELEMENT);this._time_limit_action=e},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={mastery_score:this.mastery_score,max_time_allowed:this.max_time_allowed,time_limit_action:this.time_limit_action};return delete this.jsonString,e},i}(E),Z=function(e){function i(t){var i=e.call(this)||this;return i._audio="",i._language="",i._speed="",i._text="",i.__children=t||F.student_preference_children,i}return t(i,e),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new T(U.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"audio",{get:function(){return this._audio},set:function(e){Y(e,G.CMISInteger)&&$(e,G.audio_range)&&(this._audio=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"language",{get:function(){return this._language},set:function(e){Y(e,G.CMIString256)&&(this._language=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"speed",{get:function(){return this._speed},set:function(e){Y(e,G.CMISInteger)&&$(e,G.speed_range)&&(this._speed=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"text",{get:function(){return this._text},set:function(e){Y(e,G.CMISInteger)&&$(e,G.text_range)&&(this._text=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,speed:this.speed,text:this.text};return delete this.jsonString,e},i}(E),W=function(e){function i(){return e.call(this,{children:F.interactions_children,errorCode:U.INVALID_SET_VALUE,errorClass:T})||this}return t(i,e),i}(b),q=function(e){function i(){var t=e.call(this)||this;return t._id="",t._time="",t._type="",t._weighting="",t._student_response="",t._result="",t._latency="",t.objectives=new b({errorCode:U.INVALID_SET_VALUE,errorClass:T,children:F.objectives_children}),t.correct_responses=new b({errorCode:U.INVALID_SET_VALUE,errorClass:T,children:F.correct_responses_children}),t}return t(i,e),i.prototype.initialize=function(){var t,i;e.prototype.initialize.call(this),null===(t=this.objectives)||void 0===t||t.initialize(),null===(i=this.correct_responses)||void 0===i||i.initialize()},Object.defineProperty(i.prototype,"id",{get:function(){if(!this.jsonString)throw new T(U.WRITE_ONLY_ELEMENT);return this._id},set:function(e){Y(e,G.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time",{get:function(){if(!this.jsonString)throw new T(U.WRITE_ONLY_ELEMENT);return this._time},set:function(e){Y(e,G.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"type",{get:function(){if(!this.jsonString)throw new T(U.WRITE_ONLY_ELEMENT);return this._type},set:function(e){Y(e,G.CMIType)&&(this._type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"weighting",{get:function(){if(!this.jsonString)throw new T(U.WRITE_ONLY_ELEMENT);return this._weighting},set:function(e){Y(e,G.CMIDecimal)&&$(e,G.weighting_range)&&(this._weighting=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"student_response",{get:function(){if(!this.jsonString)throw new T(U.WRITE_ONLY_ELEMENT);return this._student_response},set:function(e){Y(e,G.CMIFeedback,!0)&&(this._student_response=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"result",{get:function(){if(!this.jsonString)throw new T(U.WRITE_ONLY_ELEMENT);return this._result},set:function(e){Y(e,G.CMIResult)&&(this._result=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"latency",{get:function(){if(!this.jsonString)throw new T(U.WRITE_ONLY_ELEMENT);return this._latency},set:function(e){Y(e,G.CMITimespan)&&(this._latency=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,time:this.time,type:this.type,weighting:this.weighting,student_response:this.student_response,result:this.result,latency:this.latency,objectives:this.objectives,correct_responses:this.correct_responses};return delete this.jsonString,e},i}(E),K=function(e){function i(){var t=e.call(this)||this;return t._id="",t._status="",t.score=new M({score_children:F.score_children,score_range:G.score_range,invalidErrorCode:U.INVALID_SET_VALUE,invalidTypeCode:U.TYPE_MISMATCH,invalidRangeCode:U.VALUE_OUT_OF_RANGE,errorClass:T}),t}return t(i,e),Object.defineProperty(i.prototype,"id",{get:function(){return this._id},set:function(e){Y(e,G.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"status",{get:function(){return this._status},set:function(e){Y(e,G.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,status:this.status,score:this.score};return delete this.jsonString,e},i}(E),Q=function(e){function i(){var t=e.call(this)||this;return t._id="",t}return t(i,e),Object.defineProperty(i.prototype,"id",{get:function(){return this._id},set:function(e){Y(e,G.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id};return delete this.jsonString,e},i}(E),X=function(e){function i(){var t=e.call(this)||this;return t._pattern="",t}return t(i,e),Object.defineProperty(i.prototype,"pattern",{get:function(){if(!this.jsonString)throw new T(U.WRITE_ONLY_ELEMENT);return this._pattern},set:function(e){Y(e,G.CMIFeedback,!0)&&(this._pattern=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={pattern:this._pattern};return delete this.jsonString,e},i}(E),ee=function(e){function i(){var t=e.call(this)||this;return t._event="",t}return t(i,e),Object.defineProperty(i.prototype,"event",{get:function(){return this._event},set:function(e){Y(e,G.NAVEvent)&&(this._event=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={event:this.event};return delete this.jsonString,e},i}(E),te=s.scorm12,ie=s.global,re=c.scorm12,ne=function(e){function i(t){var i=this;return t&&void 0===t.mastery_override&&(t.mastery_override=!1),(i=e.call(this,re,t)||this).cmi=new k,i.nav=new ee,i.LMSInitialize=i.lmsInitialize,i.LMSFinish=i.lmsFinish,i.LMSGetValue=i.lmsGetValue,i.LMSSetValue=i.lmsSetValue,i.LMSCommit=i.lmsCommit,i.LMSGetLastError=i.lmsGetLastError,i.LMSGetErrorString=i.lmsGetErrorString,i.LMSGetDiagnostic=i.lmsGetDiagnostic,i}return t(i,e),i.prototype.lmsInitialize=function(){return this.cmi.initialize(),this.initialize("LMSInitialize","LMS was already initialized!","LMS is already finished!")},i.prototype.lmsFinish=function(){var e=this.terminate("LMSFinish",!0);return e===ie.SCORM_TRUE&&(""!==this.nav.event?"continue"===this.nav.event?this.processListeners("SequenceNext"):this.processListeners("SequencePrevious"):this.settings.autoProgress&&this.processListeners("SequenceNext")),e},i.prototype.lmsGetValue=function(e){return this.getValue("LMSGetValue",!1,e)},i.prototype.lmsSetValue=function(e,t){return this.setValue("LMSSetValue","LMSCommit",!1,e,t)},i.prototype.lmsCommit=function(){return this.commit("LMSCommit",!1)},i.prototype.lmsGetLastError=function(){return this.getLastError("LMSGetLastError")},i.prototype.lmsGetErrorString=function(e){return this.getErrorString("LMSGetErrorString",e)},i.prototype.lmsGetDiagnostic=function(e){return this.getDiagnostic("LMSGetDiagnostic",e)},i.prototype.setCMIValue=function(e,t){return this._commonSetCMIValue("LMSSetValue",!1,e,t)},i.prototype.getCMIValue=function(e){return this._commonGetCMIValue("getCMIValue",!1,e)},i.prototype.getChildElement=function(e,t,i){return this.stringMatches(e,"cmi\\.objectives\\.\\d+")?new K:i&&this.stringMatches(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")?new X:i&&this.stringMatches(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")?new Q:!i&&this.stringMatches(e,"cmi\\.interactions\\.\\d+")?new q:null},i.prototype.validateCorrectResponse=function(e,t){},i.prototype.getLmsErrorMessageDetails=function(e,t){var i="No Error",r="No Error";return e=String(e),te.error_descriptions[e]&&(i=te.error_descriptions[e].basicMessage,r=te.error_descriptions[e].detailMessage),t?r:i},i.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi},i.prototype.renderCommitCMI=function(e){var t=this.renderCMIToJSONObject();e&&(t.cmi.core.total_time=this.cmi.getCurrentTotalTime());var i=[],r=R(t);switch(this.settings.dataCommitFormat){case"flattened":return R(t);case"params":for(var n in r)({}).hasOwnProperty.call(r,n)&&i.push("".concat(n,"=").concat(r[n]));return i;default:return t}},i.prototype.storeData=function(e){var t,i,r;if(e){var n=this.cmi.core.lesson_status;"not attempted"===n&&(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===(r=null===(i=null===(t=this.startingData)||void 0===t?void 0:t.cmi)||void 0===i?void 0:i.core)||void 0===r?void 0:r.lesson_status)||"")&&"not attempted"===n&&(this.cmi.core.lesson_status="browsed")}var o=this.renderCommitCMI(e||this.settings.alwaysSendTotalTime);return this.apiLogLevel===ie.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(o)),"string"==typeof this.settings.lmsCommitUrl?this.processHttpRequest(this.settings.lmsCommitUrl,o,e):{result:ie.SCORM_TRUE,errorCode:0}},i}(x),oe=s.aicc,se=u.aicc,ae=c.scorm12;function ce(e,t,i){return m(e,t,ae.TYPE_MISMATCH,v,i)}var le=function(e){function i(t){void 0===t&&(t=!1);var i=e.call(this,oe.cmi_children)||this;return t&&i.initialize(),i.student_preference=new he,i.student_data=new de,i.student_demographics=new pe,i.evaluation=new ue,i.paths=new fe,i}return t(i,e),i.prototype.initialize=function(){var t,i,r,n,o;e.prototype.initialize.call(this),null===(t=this.student_preference)||void 0===t||t.initialize(),null===(i=this.student_data)||void 0===i||i.initialize(),null===(r=this.student_demographics)||void 0===r||r.initialize(),null===(n=this.evaluation)||void 0===n||n.initialize(),null===(o=this.paths)||void 0===o||o.initialize()},i.prototype.toJSON=function(){this.jsonString=!0;var e={suspend_data:this.suspend_data,launch_data:this.launch_data,comments:this.comments,comments_from_lms:this.comments_from_lms,core:this.core,objectives:this.objectives,student_data:this.student_data,student_preference:this.student_preference,student_demographics:this.student_demographics,interactions:this.interactions,evaluation:this.evaluation,paths:this.paths};return delete this.jsonString,e},i}(k),ue=function(e){function i(){var t=e.call(this)||this;return t.comments=new _e,t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.comments)||void 0===t||t.initialize()},i.prototype.toJSON=function(){this.jsonString=!0;var e={comments:this.comments};return delete this.jsonString,e},i}(E),_e=function(e){function i(){return e.call(this,{children:oe.comments_children,errorCode:ae.INVALID_SET_VALUE,errorClass:v})||this}return t(i,e),i}(b),he=function(e){function i(){var t=e.call(this,oe.student_preference_children)||this;return t._lesson_type="",t._text_color="",t._text_location="",t._text_size="",t._video="",t.windows=new b({errorCode:ae.INVALID_SET_VALUE,errorClass:v,children:""}),t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.windows)||void 0===t||t.initialize()},Object.defineProperty(i.prototype,"lesson_type",{get:function(){return this._lesson_type},set:function(e){ce(e,se.CMIString256)&&(this._lesson_type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"text_color",{get:function(){return this._text_color},set:function(e){ce(e,se.CMIString256)&&(this._text_color=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"text_location",{get:function(){return this._text_location},set:function(e){ce(e,se.CMIString256)&&(this._text_location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"text_size",{get:function(){return this._text_size},set:function(e){ce(e,se.CMIString256)&&(this._text_size=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"video",{get:function(){return this._video},set:function(e){ce(e,se.CMIString256)&&(this._video=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,lesson_type:this.lesson_type,speed:this.speed,text:this.text,text_color:this.text_color,text_location:this.text_location,text_size:this.text_size,video:this.video,windows:this.windows};return delete this.jsonString,e},i}(Z),de=function(e){function i(){var t=e.call(this,oe.student_data_children)||this;return t._tries_during_lesson="",t.tries=new me,t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.tries)||void 0===t||t.initialize()},Object.defineProperty(i.prototype,"tries_during_lesson",{get:function(){return this._tries_during_lesson},set:function(e){if(this.initialized)throw new v(ae.READ_ONLY_ELEMENT);this._tries_during_lesson=e},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={mastery_score:this.mastery_score,max_time_allowed:this.max_time_allowed,time_limit_action:this.time_limit_action,tries:this.tries};return delete this.jsonString,e},i}(B),pe=function(e){function i(){var t=e.call(this)||this;return t.__children=oe.student_demographics_children,t._city="",t._class="",t._company="",t._country="",t._experience="",t._familiar_name="",t._instructor_name="",t._title="",t._native_language="",t._state="",t._street_address="",t._telephone="",t._years_experience="",t}return t(i,e),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"city",{get:function(){return this._city},set:function(e){if(this.initialized)throw new v(ae.READ_ONLY_ELEMENT);this._city=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"class",{get:function(){return this._class},set:function(e){if(this.initialized)throw new v(ae.READ_ONLY_ELEMENT);this._class=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"company",{get:function(){return this._company},set:function(e){if(this.initialized)throw new v(ae.READ_ONLY_ELEMENT);this._company=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"country",{get:function(){return this._country},set:function(e){if(this.initialized)throw new v(ae.READ_ONLY_ELEMENT);this._country=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"experience",{get:function(){return this._experience},set:function(e){if(this.initialized)throw new v(ae.READ_ONLY_ELEMENT);this._experience=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"familiar_name",{get:function(){return this._familiar_name},set:function(e){if(this.initialized)throw new v(ae.READ_ONLY_ELEMENT);this._familiar_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"instructor_name",{get:function(){return this._instructor_name},set:function(e){if(this.initialized)throw new v(ae.READ_ONLY_ELEMENT);this._instructor_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"title",{get:function(){return this._title},set:function(e){if(this.initialized)throw new v(ae.READ_ONLY_ELEMENT);this._title=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"native_language",{get:function(){return this._native_language},set:function(e){if(this.initialized)throw new v(ae.READ_ONLY_ELEMENT);this._native_language=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"state",{get:function(){return this._state},set:function(e){if(this.initialized)throw new v(ae.READ_ONLY_ELEMENT);this._state=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"street_address",{get:function(){return this._street_address},set:function(e){if(this.initialized)throw new v(ae.READ_ONLY_ELEMENT);this._street_address=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"telephone",{get:function(){return this._telephone},set:function(e){if(this.initialized)throw new v(ae.READ_ONLY_ELEMENT);this._telephone=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"years_experience",{get:function(){return this._years_experience},set:function(e){if(this.initialized)throw new v(ae.READ_ONLY_ELEMENT);this._years_experience=e},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={city:this.city,class:this.class,company:this.company,country:this.country,experience:this.experience,familiar_name:this.familiar_name,instructor_name:this.instructor_name,title:this.title,native_language:this.native_language,state:this.state,street_address:this.street_address,telephone:this.telephone,years_experience:this.years_experience};return delete this.jsonString,e},i}(E),fe=function(e){function i(){return e.call(this,{children:oe.paths_children})||this}return t(i,e),i}(b),me=(function(e){function i(){var t=e.call(this)||this;return t._location_id="",t._date="",t._time="",t._status="",t._why_left="",t._time_in_element="",t}t(i,e),Object.defineProperty(i.prototype,"location_id",{get:function(){return this._location_id},set:function(e){ce(e,se.CMIString256)&&(this._location_id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"date",{get:function(){return this._date},set:function(e){ce(e,se.CMIString256)&&(this._date=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time",{get:function(){return this._time},set:function(e){ce(e,se.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"status",{get:function(){return this._status},set:function(e){ce(e,se.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"why_left",{get:function(){return this._why_left},set:function(e){ce(e,se.CMIString256)&&(this._why_left=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time_in_element",{get:function(){return this._time_in_element},set:function(e){ce(e,se.CMITime)&&(this._time_in_element=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={location_id:this.location_id,date:this.date,time:this.time,status:this.status,why_left:this.why_left,time_in_element:this.time_in_element};return delete this.jsonString,e}}(E),function(e){function i(){return e.call(this,{children:oe.tries_children})||this}return t(i,e),i}(b)),ge=function(e){function i(){var t=e.call(this)||this;return t._status="",t._time="",t.score=new M({score_children:oe.score_children,score_range:se.score_range,invalidErrorCode:ae.INVALID_SET_VALUE,invalidTypeCode:ae.TYPE_MISMATCH,invalidRangeCode:ae.VALUE_OUT_OF_RANGE,errorClass:v}),t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(i.prototype,"status",{get:function(){return this._status},set:function(e){ce(e,se.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time",{get:function(){return this._time},set:function(e){ce(e,se.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={status:this.status,time:this.time,score:this.score};return delete this.jsonString,e},i}(E),Ee=(function(e){function i(){return e.call(this,{children:oe.attempt_records_children})||this}t(i,e)}(b),function(e){function i(){var t=e.call(this)||this;return t._lesson_status="",t.score=new M({score_children:oe.score_children,score_range:se.score_range,invalidErrorCode:ae.INVALID_SET_VALUE,invalidTypeCode:ae.TYPE_MISMATCH,invalidRangeCode:ae.VALUE_OUT_OF_RANGE,errorClass:v}),t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(i.prototype,"lesson_status",{get:function(){return this._lesson_status},set:function(e){ce(e,se.CMIStatus2)&&(this._lesson_status=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={lesson_status:this.lesson_status,score:this.score};return delete this.jsonString,e},i}(E)),ye=function(e){function i(){var t=e.call(this)||this;return t._content="",t._location="",t._time="",t}return t(i,e),Object.defineProperty(i.prototype,"content",{get:function(){return this._content},set:function(e){ce(e,se.CMIString256)&&(this._content=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"location",{get:function(){return this._location},set:function(e){ce(e,se.CMIString256)&&(this._location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time",{get:function(){return this._time},set:function(e){ce(e,se.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={content:this.content,location:this.location,time:this.time};return delete this.jsonString,e},i}(E),Me=function(e){function i(t){var i=e.call(this,t)||this;return i.cmi=new le,i.nav=new ee,i}return t(i,e),i.prototype.getChildElement=function(t,i,r){var n=e.prototype.getChildElement.call(this,t,i,r);return n||(this.stringMatches(t,"cmi\\.evaluation\\.comments\\.\\d+")?n=new ye:this.stringMatches(t,"cmi\\.student_data\\.tries\\.\\d+")?n=new ge:this.stringMatches(t,"cmi\\.student_data\\.attempt_records\\.\\d+")&&(n=new Ee)),n},i.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi,this.nav=e.nav},i}(ne);window.AICC=Me}();
2
+ //# sourceMappingURL=aicc.min.js.map