scorm-again
Version:
A modern SCORM JavaScript run-time library for AICC, SCORM 1.2, and SCORM 2004
1 lines • 91.4 kB
JavaScript
!function(){"use strict";var e={429:function(e,t,r){r.r(t),r.d(t,{default:function(){return d}});var i=r(635),n=r(589),o=r(784),s=r(340),a=r(864),c=r(56),l={autocommit:!1,autocommitSeconds:10,asyncCommit:!1,sendFullCommit:!0,lmsCommitUrl:!1,dataCommitFormat:"json",commitRequestDataType:"application/json;charset=UTF-8",autoProgress:!1,logLevel:c.LogLevelEnum.ERROR,selfReportSessionTime:!1,alwaysSendTotalTime:!1,renderCommonCommitFields:!1,strict_errors:!0,xhrHeaders:{},xhrWithCredentials:!1,fetchMode:"cors",responseHandler:function(e){return(0,i.__awaiter)(this,void 0,void 0,(function(){var t,r;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return void 0===e?[3,2]:[4,e.text()];case 1:return t=i.sent(),r=null,t&&(r=JSON.parse(t)),null!==r&&{}.hasOwnProperty.call(r,"result")?[2,{result:r.result,errorCode:r.errorCode?r.errorCode:r.result===s.global_constants.SCORM_TRUE?0:101}]:200===e.status?[2,{result:s.global_constants.SCORM_TRUE,errorCode:0}]:[2,{result:s.global_constants.SCORM_FALSE,errorCode:101}];case 2:return[2,{result:s.global_constants.SCORM_FALSE,errorCode:101}]}}))}))},requestHandler:function(e){return e},onLogMessage:function(e,t){switch(e){case"4":case 4:case"ERROR":case c.LogLevelEnum.ERROR:console.error(t);break;case"3":case 3:case"WARN":case c.LogLevelEnum.WARN:console.warn(t);break;case"2":case 2:case"INFO":case c.LogLevelEnum.INFO:console.info(t);break;case"1":case 1:case"DEBUG":case c.LogLevelEnum.DEBUG:console.debug?console.debug(t):console.log(t)}},scoItemIds:[],scoItemIdValidator:!1,globalObjectiveIds:[]},u=function(){function e(e,t,r){this._cancelled=!1,this._API=e,this._timeout=setTimeout(this.wrapper.bind(this),t),this._callback=r}return e.prototype.cancel=function(){this._cancelled=!0,this._timeout&&clearTimeout(this._timeout)},e.prototype.wrapper=function(){this._cancelled||(0,i.__awaiter)(this,void 0,void 0,(function(){return(0,i.__generator)(this,(function(e){switch(e.label){case 0:return[4,this._API.commit(this._callback)];case 1:return[2,e.sent()]}}))}))},e}(),_=function(){function e(t,r){var n,o,a=this.constructor;if(this._settings=l,a===e)throw new TypeError("Cannot construct BaseAPI instances directly");this.currentState=s.global_constants.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[],this._error_codes=t,r&&(this.settings=(0,i.__assign)((0,i.__assign)({},l),r)),this.apiLogLevel=null!==(n=this.settings.logLevel)&&void 0!==n?n:c.LogLevelEnum.ERROR,this.selfReportSessionTime=null!==(o=this.settings.selfReportSessionTime)&&void 0!==o&&o}return e.prototype.commonReset=function(e){this.apiLog("reset","Called",c.LogLevelEnum.INFO),this.settings=(0,i.__assign)((0,i.__assign)({},this.settings),e),this.clearScheduledCommit(),this.currentState=s.global_constants.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[],this.startingData={}},e.prototype.initialize=function(e,t,r){var i=s.global_constants.SCORM_FALSE;return this.isInitialized()?this.throwSCORMError(this._error_codes.INITIALIZED,t):this.isTerminated()?this.throwSCORMError(this._error_codes.TERMINATED,r):(this.selfReportSessionTime&&this.cmi.setStartTime(),this.currentState=s.global_constants.STATE_INITIALIZED,this.lastErrorCode="0",i=s.global_constants.SCORM_TRUE,this.processListeners(e)),this.apiLog(e,"returned: "+i,c.LogLevelEnum.INFO),this.clearSCORMError(i),i},e.prototype.apiLog=function(e,t,r,i){t=(0,a.formatMessage)(e,t,i),r>=this.apiLogLevel&&this.settings.onLogMessage(r,t)},Object.defineProperty(e.prototype,"error_codes",{get:function(){return this._error_codes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"settings",{get:function(){return this._settings},set:function(e){this._settings=(0,i.__assign)((0,i.__assign)({},this._settings),e)},enumerable:!1,configurable:!0}),e.prototype.terminate=function(e,t){return(0,i.__awaiter)(this,void 0,void 0,(function(){var r,n;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return r=s.global_constants.SCORM_FALSE,this.checkState(t,this._error_codes.TERMINATION_BEFORE_INIT,this._error_codes.MULTIPLE_TERMINATION)?(this.currentState=s.global_constants.STATE_TERMINATED,[4,this.storeData(!0)]):[3,2];case 1:void 0!==(n=i.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),r=void 0===n||!0!==n.result&&n.result!==s.global_constants.SCORM_TRUE?s.global_constants.SCORM_FALSE:s.global_constants.SCORM_TRUE,t&&(this.lastErrorCode="0"),r=s.global_constants.SCORM_TRUE,this.processListeners(e),i.label=2;case 2:return this.apiLog(e,"returned: "+r,c.LogLevelEnum.INFO),this.clearSCORMError(r),[2,r]}}))}))},e.prototype.getValue=function(e,t,r){var i="";if(this.checkState(t,this._error_codes.RETRIEVE_BEFORE_INIT,this._error_codes.RETRIEVE_AFTER_TERM)){t&&(this.lastErrorCode="0");try{i=this.getCMIValue(r)}catch(e){i=this.handleValueAccessException(e,i)}this.processListeners(e,r)}return this.apiLog(e,": returned: "+i,c.LogLevelEnum.INFO,r),void 0===i?"":(this.clearSCORMError(i),i)},e.prototype.setValue=function(e,t,r,i,n){void 0!==n&&(n=String(n));var o=s.global_constants.SCORM_FALSE;if(this.checkState(r,this._error_codes.STORE_BEFORE_INIT,this._error_codes.STORE_AFTER_TERM)){r&&(this.lastErrorCode="0");try{o=this.setCMIValue(i,n)}catch(e){this.handleValueAccessException(e,o)}this.processListeners(e,i,n)}return void 0===o&&(o=s.global_constants.SCORM_FALSE),"0"===String(this.lastErrorCode)&&this.settings.autocommit&&this.scheduleCommit(1e3*this.settings.autocommitSeconds,t),this.apiLog(e,": "+n+": result: "+o,c.LogLevelEnum.INFO,i),this.clearSCORMError(o),o},e.prototype.commit=function(e){return(0,i.__awaiter)(this,arguments,void 0,(function(e,t){var r,n;return void 0===t&&(t=!1),(0,i.__generator)(this,(function(i){switch(i.label){case 0:return this.clearScheduledCommit(),r=s.global_constants.SCORM_FALSE,this.checkState(t,this._error_codes.COMMIT_BEFORE_INIT,this._error_codes.COMMIT_AFTER_TERM)?[4,this.storeData(!1)]:[3,2];case 1:(n=i.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),r=void 0===n||!0!==n.result&&n.result!==s.global_constants.SCORM_TRUE?s.global_constants.SCORM_FALSE:s.global_constants.SCORM_TRUE,this.apiLog(e," Result: "+r,c.LogLevelEnum.DEBUG,"HttpRequest"),t&&(this.lastErrorCode="0"),this.processListeners(e),i.label=2;case 2:return this.apiLog(e,"returned: "+r,c.LogLevelEnum.INFO),this.clearSCORMError(r),[2,r]}}))}))},e.prototype.getLastError=function(e){var t=String(this.lastErrorCode);return this.processListeners(e),this.apiLog(e,"returned: "+t,c.LogLevelEnum.INFO),t},e.prototype.getErrorString=function(e,t){var r="";return null!==t&&""!==t&&(r=this.getLmsErrorMessageDetails(t),this.processListeners(e)),this.apiLog(e,"returned: "+r,c.LogLevelEnum.INFO),r},e.prototype.getDiagnostic=function(e,t){var r="";return null!==t&&""!==t&&(r=this.getLmsErrorMessageDetails(t,!0),this.processListeners(e)),this.apiLog(e,"returned: "+r,c.LogLevelEnum.INFO),r},e.prototype.checkState=function(e,t,r){return this.isNotInitialized()?(this.throwSCORMError(t),!1):!e||!this.isTerminated()||(this.throwSCORMError(r),!1)},e.prototype.getLmsErrorMessageDetails=function(e,t){throw void 0===t&&(t=!1),new Error("The getLmsErrorMessageDetails method has not been implemented")},e.prototype.getCMIValue=function(e){throw new Error("The getCMIValue method has not been implemented")},e.prototype.setCMIValue=function(e,t){throw new Error("The setCMIValue method has not been implemented")},e.prototype._commonSetCMIValue=function(e,t,r,o){if(!r||""===r)return s.global_constants.SCORM_FALSE;for(var l=r.split("."),u=this,_=s.global_constants.SCORM_FALSE,d=!1,h="The data model element passed to ".concat(e," (").concat(r,") is not a valid SCORM data model element."),m=t?this._error_codes.UNDEFINED_DATA_MODEL:this._error_codes.GENERAL,f=0;f<l.length;f++){var p=l[f];if(!p)return this.throwSCORMError(m,h),s.global_constants.SCORM_FALSE;if(f===l.length-1)t&&"{target="===p.substring(0,8)?this.isInitialized()?this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT):u=(0,i.__assign)((0,i.__assign)({},u),{attribute:o}):this._checkObjectHasProperty(u,p)?((0,a.stringMatches)(r,"\\.correct_responses\\.\\d+")&&this.isInitialized()&&this.validateCorrectResponse(r,o),t&&"0"!==this.lastErrorCode||(u[p]=o,_=s.global_constants.SCORM_TRUE)):this.throwSCORMError(m,h);else{if(!(u=u[p])){this.throwSCORMError(m,h);break}if(u instanceof n.CMIArray){var g=parseInt(l[f+1]||"0",10);if(!isNaN(g)){var E=u.childArray[g];if(E)u=E,d=!0;else{var b=this.getChildElement(r,o,d);d=!0,b?(u.initialized&&b.initialize(),u.childArray.push(b),u=b):this.throwSCORMError(m,h)}f++}}}}return _===s.global_constants.SCORM_FALSE&&this.apiLog(e,"There was an error setting the value for: ".concat(r,", value of: ").concat(o),c.LogLevelEnum.WARN),_},e.prototype._commonGetCMIValue=function(e,t,r){if(!r||""===r)return"";for(var i=r.split("."),o=this,s=null,a="The data model element passed to ".concat(e," (").concat(r,") has not been initialized."),c="The data model element passed to ".concat(e," (").concat(r,") is not a valid SCORM data model element."),l=t?this._error_codes.UNDEFINED_DATA_MODEL:this._error_codes.GENERAL,u=0;u<i.length;u++){if(!(s=i[u]))return void this.throwSCORMError(l,c);if(t){if("{target="===String(s).substring(0,8)&&"function"==typeof o._isTargetValid){var _=String(s).substring(8,String(s).length-9);return o._isTargetValid(_)}if(!this._checkObjectHasProperty(o,s))return void this.throwSCORMError(l,c)}else if(u===i.length-1&&!this._checkObjectHasProperty(o,s))return void this.throwSCORMError(l,c);if(void 0===(o=o[s])){this.throwSCORMError(l,c);break}if(o instanceof n.CMIArray){var d=parseInt(i[u+1]||"",10);if(!isNaN(d)){var h=o.childArray[d];if(!h){this.throwSCORMError(this._error_codes.VALUE_NOT_INITIALIZED,a);break}o=h,u++}}}if(null!=o)return o;t||("_children"===s?this.throwSCORMError(this._error_codes.CHILDREN_ERROR):"_count"===s&&this.throwSCORMError(this._error_codes.COUNT_ERROR))},e.prototype.isInitialized=function(){return this.currentState===s.global_constants.STATE_INITIALIZED},e.prototype.isNotInitialized=function(){return this.currentState===s.global_constants.STATE_NOT_INITIALIZED},e.prototype.isTerminated=function(){return this.currentState===s.global_constants.STATE_TERMINATED},e.prototype.on=function(e,t){var r,i;if(t)for(var n=e.split(" "),o=0;o<n.length;o++){var s=null===(r=n[o])||void 0===r?void 0:r.split(".");if(!s||0===s.length)return;var a=s[0],l=null;s.length>1&&(l=null===(i=n[o])||void 0===i?void 0:i.replace(a+".","")),this.listenerArray.push({functionName:a,CMIElement:l,callback:t}),this.apiLog("on","Added event listener: ".concat(this.listenerArray.length),c.LogLevelEnum.INFO,a)}},e.prototype.off=function(e,t){var r,i;if(t)for(var n=e.split(" "),o=function(e){var o=null===(r=n[e])||void 0===r?void 0:r.split(".");if(!o||0===o.length)return{value:void 0};var a=o[0],l=null;o.length>1&&(l=null===(i=n[e])||void 0===i?void 0:i.replace(a+".",""));var u=s.listenerArray.findIndex((function(e){return e.functionName===a&&e.CMIElement===l&&e.callback===t}));-1!==u&&(s.listenerArray.splice(u,1),s.apiLog("off","Removed event listener: ".concat(s.listenerArray.length),c.LogLevelEnum.INFO,a))},s=this,a=0;a<n.length;a++){var l=o(a);if("object"==typeof l)return l.value}},e.prototype.clear=function(e){for(var t,r,i=e.split(" "),n=function(e){var n=null===(t=i[e])||void 0===t?void 0:t.split(".");if(!n||0===(null==n?void 0:n.length))return{value:void 0};var s=n[0],a=null;n.length>1&&(a=null===(r=i[e])||void 0===r?void 0:r.replace(s+".","")),o.listenerArray=o.listenerArray.filter((function(e){return e.functionName!==s&&e.CMIElement!==a}))},o=this,s=0;s<i.length;s++){var a=n(s);if("object"==typeof a)return a.value}},e.prototype.processListeners=function(e,t,r){this.apiLog(e,r,c.LogLevelEnum.INFO,t);for(var i=0;i<this.listenerArray.length;i++){var n,o=this.listenerArray[i],s=o.functionName===e,a=!!o.CMIElement;n=t&&o.CMIElement&&"*"===o.CMIElement.substring(o.CMIElement.length-1)?0===t.indexOf(o.CMIElement.substring(0,o.CMIElement.length-1)):o.CMIElement===t,!s||a&&!n||(this.apiLog("processListeners","Processing listener: ".concat(o.functionName),c.LogLevelEnum.INFO,t),o.callback(t,r))}},e.prototype.throwSCORMError=function(e,t){t||(t=this.getLmsErrorMessageDetails(e)),this.apiLog("throwSCORMError",e+": "+t,c.LogLevelEnum.ERROR),this.lastErrorCode=String(e)},e.prototype.clearSCORMError=function(e){void 0!==e&&e!==s.global_constants.SCORM_FALSE&&(this.lastErrorCode="0")},e.prototype.loadFromFlattenedJSON=function(e,t){var r=this;if(t||(t=""),this.isNotInitialized()){var i,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 r,i=e[0],s=(e[1],t[0]);return t[1],null!==(r=c(i,s,n))||null!==(r=c(i,s,o))?r:i<s?-1:i>s?1:0})),s.forEach((function(e){(i={})[e[0]]=e[1],r.loadFromJSON((0,a.unflatten)(i),t)}))}else console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize.");function c(e,t,r){var i,n=e.match(r);if(null!==n&&null!==(i=t.match(r))){var o=Number(n[2]),s=Number(i[2]);return o===s?"id"===n[3]?-1:"type"===n[3]?"id"===i[3]?1:-1:1:o-s}return null}},e.prototype.loadFromJSON=function(e,t){if(void 0===t&&(t=""),t&&""!==t||Object.hasOwnProperty.call(e,"cmi")||Object.hasOwnProperty.call(e,"adl")||(t="cmi"),this.isNotInitialized()){for(var r in t=void 0!==t?t:"cmi",this.startingData=e,e)if({}.hasOwnProperty.call(e,r)&&e[r]){var i=(t?t+".":"")+r,n=e[r];if(n.childArray)for(var o=0;o<n.childArray.length;o++)this.loadFromJSON(n.childArray[o],i+"."+o);else n.constructor===Object?this.loadFromJSON(n,i):this.setCMIValue(i,n)}}else console.error("loadFromJSON can only be called before the call to lmsInitialize.")},e.prototype.renderCMIToJSONString=function(){var e=this.cmi;return this.settings.sendFullCommit?JSON.stringify({cmi:e}):JSON.stringify({cmi:e},(function(e,t){return void 0===t?null:t}),2)},e.prototype.renderCMIToJSONObject=function(){return JSON.parse(this.renderCMIToJSONString())},e.prototype.processHttpRequest=function(e,t){return(0,i.__awaiter)(this,arguments,void 0,(function(e,t,r){var n,o,a,l=this;return void 0===r&&(r=!1),(0,i.__generator)(this,(function(u){switch(u.label){case 0:return n=this,o={result:s.global_constants.SCORM_FALSE,errorCode:this.error_codes.GENERAL},r?(t=this.settings.requestHandler(t),this.performFetch(e,t).then((function(e){return(0,i.__awaiter)(l,void 0,void 0,(function(){return(0,i.__generator)(this,(function(t){switch(t.label){case 0:return[4,this.transformResponse(e)];case 1:return t.sent(),[2]}}))}))})),[2,{result:s.global_constants.SCORM_TRUE,errorCode:0}]):(a=function(e,t,r){return(0,i.__awaiter)(l,void 0,void 0,(function(){var s,a,l;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),t=r.requestHandler(t),[4,this.performFetch(e,t)];case 1:return s=i.sent(),[2,this.transformResponse(s)];case 2:return a=i.sent(),l=a instanceof Error?a.message:String(a),this.apiLog("processHttpRequest",l,c.LogLevelEnum.ERROR),n.processListeners("CommitError"),[2,o];case 3:return[2]}}))}))},[4,a(e,t,this.settings)]);case 1:return[2,u.sent()]}}))}))},e.prototype.scheduleCommit=function(e,t){this._timeout||(this._timeout=new u(this,e,t),this.apiLog("scheduleCommit","scheduled",c.LogLevelEnum.DEBUG,""))},e.prototype.clearScheduledCommit=function(){this._timeout&&(this._timeout.cancel(),this._timeout=void 0,this.apiLog("clearScheduledCommit","cleared",c.LogLevelEnum.DEBUG,""))},e.prototype._checkObjectHasProperty=function(e,t){return Object.hasOwnProperty.call(e,t)||null!=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),t)||t in e},e.prototype.handleValueAccessException=function(e,t){return e instanceof o.ValidationError?(this.lastErrorCode=String(e.errorCode),t=s.global_constants.SCORM_FALSE):(e instanceof Error&&e.message?console.error(e.message):console.error(e),this.throwSCORMError(this._error_codes.GENERAL)),t},e.prototype.getCommitObject=function(e){var t=e||this.settings.alwaysSendTotalTime,r=this.settings.renderCommonCommitFields?this.renderCommitObject(t):this.renderCommitCMI(t);return[c.LogLevelEnum.DEBUG,"1",1,"DEBUG"].includes(this.apiLogLevel)&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(r)),r},e.prototype.performFetch=function(e,t){return(0,i.__awaiter)(this,void 0,void 0,(function(){var r;return(0,i.__generator)(this,(function(n){return r={method:"POST",mode:this.settings.fetchMode,body:t instanceof Array?t.join("&"):JSON.stringify(t),headers:(0,i.__assign)((0,i.__assign)({},this.settings.xhrHeaders),{"Content-Type":this.settings.commitRequestDataType}),keepalive:!0},this.settings.xhrWithCredentials&&(r=(0,i.__assign)((0,i.__assign)({},r),{credentials:"include"})),[2,fetch(e,r)]}))}))},e.prototype.transformResponse=function(e){return(0,i.__awaiter)(this,void 0,void 0,(function(){var t,r;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return"function"!=typeof this.settings.responseHandler?[3,2]:[4,this.settings.responseHandler(e)];case 1:return r=i.sent(),[3,4];case 2:return[4,e.json()];case 3:r=i.sent(),i.label=4;case 4:return t=r,e.status>=200&&e.status<=299&&(!0===t.result||t.result===s.global_constants.SCORM_TRUE)?this.processListeners("CommitSuccess"):this.processListeners("CommitError"),[2,t]}}))}))},e}(),d=_},589:function(e,t,r){r.r(t),r.d(t,{CMIArray:function(){return a}});var i=r(635),n=r(319),o=r(784),s=r(797),a=function(e){function t(t){var r=e.call(this)||this;return r.__children=t.children,r._errorCode=t.errorCode||s.scorm12_errors.GENERAL,r._errorClass=t.errorClass||o.BaseScormValidationError,r.childArray=[],r}return(0,i.__extends)(t,e),t.prototype.reset=function(e){if(void 0===e&&(e=!1),this._initialized=!1,e)this.childArray=[];else for(var t=0;t<this.childArray.length;t++)this.childArray[t].reset()},Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_count",{get:function(){return this.childArray.length},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;for(var e={},t=0;t<this.childArray.length;t++)e[t+""]=this.childArray[t];return delete this.jsonString,e},t}(n.BaseCMI)},319:function(e,t,r){r.r(t),r.d(t,{BaseCMI:function(){return n},BaseRootCMI:function(){return o}});var i=r(635),n=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}(),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,i.__extends)(t,e),t}(n)},434:function(e,t,r){r.r(t),r.d(t,{CMIScore:function(){return l}});var i=r(635),n=r(340),o=r(417),s=r(319),a=r(449),c=r(797),l=function(e){function t(t){var r=e.call(this)||this;return r._raw="",r._min="",r.__children=t.score_children||n.scorm12_constants.score_children,r.__score_range=!!t.score_range&&o.scorm12_regex.score_range,r._max=t.max||""===t.max?t.max:"100",r.__invalid_error_code=t.invalidErrorCode||c.scorm12_errors.INVALID_SET_VALUE,r.__invalid_type_code=t.invalidTypeCode||c.scorm12_errors.TYPE_MISMATCH,r.__invalid_range_code=t.invalidRangeCode||c.scorm12_errors.VALUE_OUT_OF_RANGE,r.__decimal_regex=t.decimalRegex||o.scorm12_regex.CMIDecimal,r.__error_class=t.errorClass,r}return(0,i.__extends)(t,e),t.prototype.reset=function(){this._initialized=!1},Object.defineProperty(t.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(t.prototype,"raw",{get:function(){return this._raw},set:function(e){!(0,a.checkValidFormat)(e,this.__decimal_regex,this.__invalid_type_code,this.__error_class)||this.__score_range&&!(0,a.checkValidRange)(e,this.__score_range,this.__invalid_range_code,this.__error_class)||(this._raw=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"min",{get:function(){return this._min},set:function(e){!(0,a.checkValidFormat)(e,this.__decimal_regex,this.__invalid_type_code,this.__error_class)||this.__score_range&&!(0,a.checkValidRange)(e,this.__score_range,this.__invalid_range_code,this.__error_class)||(this._min=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"max",{get:function(){return this._max},set:function(e){!(0,a.checkValidFormat)(e,this.__decimal_regex,this.__invalid_type_code,this.__error_class)||this.__score_range&&!(0,a.checkValidRange)(e,this.__score_range,this.__invalid_range_code,this.__error_class)||(this._max=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={raw:this.raw,min:this.min,max:this.max};return delete this.jsonString,e},t}(s.BaseCMI)},449:function(e,t,r){function i(e,t,r,i,n){if("string"!=typeof e)return!1;var o=new RegExp(t),s=e.match(o);if(n&&""===e)return!0;if(void 0===e||!s||""===s[0])throw new i(r);return!0}function n(e,t,r,i){var n=t.split("#");if(e*=1,n[0]&&e>=n[0]){if(n[1]&&("*"===n[1]||e<=n[1]))return!0;throw new i(r)}throw new i(r)}r.r(t),r.d(t,{checkValidFormat:function(){return i},checkValidRange:function(){return n}})},340:function(e,t,r){r.r(t),r.d(t,{aicc_constants:function(){return s},global_constants:function(){return n},scorm12_constants:function(){return o},scorm2004_constants:function(){return a}});var i=r(635),n={SCORM_TRUE:"true",SCORM_FALSE:"false",STATE_NOT_INITIALIZED:0,STATE_INITIALIZED:1,STATE_TERMINATED:2},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=(0,i.__assign)((0,i.__assign)({},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"}),a={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",adl_data_children:"id,store",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."}}}},56:function(e,t,r){var i,n,o,s;r.r(t),r.d(t,{CompletionStatus:function(){return o},LogLevelEnum:function(){return s},NAVBoolean:function(){return i},SuccessStatus:function(){return n}}),function(e){e.unknown="unknown",e.true="true",e.false="false"}(i||(i={})),function(e){e.passed="passed",e.failed="failed",e.unknown="unknown"}(n||(n={})),function(e){e.completed="completed",e.incomplete="incomplete",e.unknown="unknown"}(o||(o={})),function(e){e[e._=0]="_",e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.NONE=5]="NONE"}(s||(s={}))},797:function(e,t,r){r.r(t),r.d(t,{global_errors:function(){return n},scorm12_errors:function(){return o},scorm2004_errors:function(){return s}});var i=r(635),n={GENERAL:101,INITIALIZATION_FAILED:101,INITIALIZED:101,TERMINATED:101,TERMINATION_FAILURE:101,TERMINATION_BEFORE_INIT:101,MULTIPLE_TERMINATION:101,RETRIEVE_BEFORE_INIT:101,RETRIEVE_AFTER_TERM:101,STORE_BEFORE_INIT:101,STORE_AFTER_TERM:101,COMMIT_BEFORE_INIT:101,COMMIT_AFTER_TERM:101,ARGUMENT_ERROR:101,CHILDREN_ERROR:101,COUNT_ERROR:101,GENERAL_GET_FAILURE:101,GENERAL_SET_FAILURE:101,GENERAL_COMMIT_FAILURE:101,UNDEFINED_DATA_MODEL:101,UNIMPLEMENTED_ELEMENT:101,VALUE_NOT_INITIALIZED:101,INVALID_SET_VALUE:101,READ_ONLY_ELEMENT:101,WRITE_ONLY_ELEMENT:101,TYPE_MISMATCH:101,VALUE_OUT_OF_RANGE:101,DEPENDENCY_NOT_ESTABLISHED:101},o=(0,i.__assign)((0,i.__assign)({},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}),s=(0,i.__assign)((0,i.__assign)({},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})},417:function(e,t,r){r.r(t),r.d(t,{aicc_regex:function(){return o},scorm12_regex:function(){return n},scorm2004_regex:function(){return s}});var i=r(635),n={CMIString256:"^.{0,255}$",CMIString4096:"^.{0,4096}$",CMITime:"^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",CMITimespan:"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{0,3})(.[0-9]*)?$",CMIIdentifier:"^[\\u0021-\\u007E\\s]{0,255}$",CMIFeedback:"^.*$",CMIIndex:"[._](\\d+).",CMIStatus:"^(passed|completed|failed|incomplete|browsed)$",CMIStatus2:"^(passed|completed|failed|incomplete|browsed|not attempted)$",CMIExit:"^(time-out|suspend|logout|)$",CMIType:"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$",CMIResult:"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$",NAVEvent:"^(previous|continue)$",score_range:"0#100",audio_range:"-1#100",speed_range:"-100#100",weighting_range:"-100#100",text_range:"-1#1"},o=(0,i.__assign)((0,i.__assign)({},n),{CMIIdentifier:"^\\w{1,255}$"}),s={CMIString200:"^[\\u0000-\\uFFFF]{0,200}$",CMIString250:"^[\\u0000-\\uFFFF]{0,250}$",CMIString1000:"^[\\u0000-\\uFFFF]{0,1000}$",CMIString4000:"^[\\u0000-\\uFFFF]{0,4000}$",CMIString64000:"^[\\u0000-\\uFFFF]{0,64000}$",CMILang:"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$",CMILangString250:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$",CMILangcr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$",CMILangString250cr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$",CMILangString4000:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$",CMITime:"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$",CMITimespan:"^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{1,5})(\\.[0-9]{1,18})?$",CMIIdentifier:"^\\S{1,250}[a-zA-Z0-9]$",CMIShortIdentifier:"^[\\w\\.\\-\\_]{1,250}$",CMILongIdentifier:"^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$",CMIFeedback:"^.*$",CMIIndex:"[._](\\d+).",CMIIndexStore:".N(\\d+).",CMICStatus:"^(completed|incomplete|not attempted|unknown)$",CMISStatus:"^(passed|failed|unknown)$",CMIExit:"^(time-out|suspend|logout|normal)$",CMIType:"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",CMIResult:"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",NAVEvent:"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=(?<choice_target>\\S{0,}[a-zA-Z0-9-_]+)})?choice|(\\{target=(?<jump_target>\\S{0,}[a-zA-Z0-9-_]+)})?jump)$",NAVBoolean:"^(unknown|true|false$)",NAVTarget:"^{target=\\S{0,}[a-zA-Z0-9-_]+}$",scaled_range:"-1#1",audio_range:"0#*",speed_range:"0#*",text_range:"-1#1",progress_range:"0#1"}},784:function(e,t,r){r.r(t),r.d(t,{BaseScormValidationError:function(){return n},ValidationError:function(){return o}});var i=r(635),n=function(e){function t(t){var r=e.call(this,t.toString())||this;return r._errorCode=t,r.name="ScormValidationError",r}return(0,i.__extends)(t,e),Object.defineProperty(t.prototype,"errorCode",{get:function(){return this._errorCode},enumerable:!1,configurable:!0}),t}(Error),o=function(e){function t(t,r,i){var n=e.call(this,t)||this;return n._detailedMessage="",n.message=r,n._errorMessage=r,i&&(n._detailedMessage=i),n}return(0,i.__extends)(t,e),Object.defineProperty(t.prototype,"errorMessage",{get:function(){return this._errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"detailedMessage",{get:function(){return this._detailedMessage},enumerable:!1,configurable:!0}),t}(n)},864:function(e,t,r){r.r(t),r.d(t,{SECONDS_PER_DAY:function(){return s},SECONDS_PER_HOUR:function(){return o},SECONDS_PER_MINUTE:function(){return n},SECONDS_PER_SECOND:function(){return i},addHHMMSSTimeStrings:function(){return h},addTwoDurations:function(){return d},countDecimals:function(){return p},flatten:function(){return m},formatMessage:function(){return g},getDurationAsSeconds:function(){return _},getSecondsAsHHMMSS:function(){return c},getSecondsAsISODuration:function(){return l},getTimeAsSeconds:function(){return u},stringMatches:function(){return E},unflatten:function(){return f}});var i=1,n=60,o=60*n,s=24*o,a={D:s,H:o,M:n,S:i};function c(e){if(!e||e<=0)return"00:00:00";var t=Math.floor(e/o),r=new Date(1e3*e),i=r.getUTCMinutes(),n=r.getSeconds(),s=e%1,a="";return p(s)>0&&(a="."+(a=p(s)>2?s.toFixed(2):String(s)).split(".")[1]),(t+":"+i+":"+n).replace(/\b\d\b/g,"0$&")+a}function l(e){if(!e||e<=0)return"PT0S";var t="P",r=e;for(var i in a){var n=a[i]||1,o=Math.floor(r/n);p(r%=n)>2&&(r=Number(Number(r).toFixed(2))),"S"===i&&r>0&&(o+=r),o&&((t.indexOf("D")>0||"H"===i||"M"===i||"S"===i)&&-1===t.indexOf("T")&&(t+="T"),t+="".concat(o).concat(i))}return t}function u(e,t){if("number"!=typeof e&&"boolean"!=typeof e||(e=String(e)),"string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var r=e.split(":");return 3600*Number(r[0])+60*Number(r[1])+Number(r[2])}function _(e,t){if("string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var r=new RegExp(t).exec(e)||[],i=r[1],n=(r[2],r[4]),o=r[5],s=r[6],a=r[7],c=0;return c+=Number(a)||0,c+=60*Number(s)||0,c+=3600*Number(o)||0,(c+=86400*Number(n)||0)+(31536e3*Number(i)||0)}function d(e,t,r){var i="string"==typeof r?new RegExp(r):r;return l(_(e,i)+_(t,i))}function h(e,t,r){return"string"==typeof r&&(r=new RegExp(r)),c(u(e,r)+u(t,r))}function m(e){var t={};return function e(r,i){if(Object(r)!==r)t[i]=r;else if(Array.isArray(r))for(var n=0,o=r.length;n<o;n++)e(r[n],i+"["+n+"]"),0===o&&(t[i]=[]);else{var s=!0;for(var a in r)({}).hasOwnProperty.call(r,a)&&(s=!1,e(r[a],i?i+"."+a:a));s&&i&&(t[i]={})}}(e,""),t}function f(e){if(Object(e)!==e||Array.isArray(e))return e;var t=/\.?([^.[\]]+)|\[(\d+)]/g,r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){for(var n=r,o="",s=t.exec(i);s;)n=n[o]||(n[o]=s[2]?[]:{}),o=s[2]||s[1]||"",s=t.exec(i);n[o]=e[i]}return r[""]||r}function p(e){if(Math.floor(e)===e||String(e).indexOf(".")<0)return 0;var t=e.toString().split(".")[1];return(null==t?void 0:t.length)||0}function g(e,t,r){for(var i="",n=20-(i+=e).length,o=0;o<n;o++)i+=" ";if(i+=": ",r){n=70-(i+=r).length;for(var s=0;s<n;s++)i+=" "}return t&&(i+=t),i}function E(e,t){return null!==(null==e?void 0:e.match(t))}},635:function(e,t,r){r.r(t),r.d(t,{__addDisposableResource:function(){return j},__assign:function(){return o},__asyncDelegator:function(){return C},__asyncGenerator:function(){return S},__asyncValues:function(){return O},__await:function(){return I},__awaiter:function(){return m},__classPrivateFieldGet:function(){return L},__classPrivateFieldIn:function(){return x},__classPrivateFieldSet:function(){return A},__createBinding:function(){return p},__decorate:function(){return a},__disposeResources:function(){return P},__esDecorate:function(){return l},__exportStar:function(){return g},__extends:function(){return n},__generator:function(){return f},__importDefault:function(){return N},__importStar:function(){return R},__makeTemplateObject:function(){return w},__metadata:function(){return h},__param:function(){return c},__propKey:function(){return _},__read:function(){return b},__rest:function(){return s},__runInitializers:function(){return u},__setFunctionName:function(){return d},__spread:function(){return y},__spreadArray:function(){return M},__spreadArrays:function(){return v},__values:function(){return E}});var i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},i(e,t)};function n(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var o=function(){return o=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},o.apply(this,arguments)};function s(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(e);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(r[i[n]]=e[i[n]])}return r}function a(e,t,r,i){var n,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}function c(e,t){return function(r,i){t(r,i,e)}}function l(e,t,r,i,n,o){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,c=i.kind,l="getter"===c?"get":"setter"===c?"set":"value",u=!t&&e?i.static?e:e.prototype:null,_=t||(u?Object.getOwnPropertyDescriptor(u,i.name):{}),d=!1,h=r.length-1;h>=0;h--){var m={};for(var f in i)m[f]="access"===f?{}:i[f];for(var f in i.access)m.access[f]=i.access[f];m.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(e||null))};var p=(0,r[h])("accessor"===c?{get:_.get,set:_.set}:_[l],m);if("accessor"===c){if(void 0===p)continue;if(null===p||"object"!=typeof p)throw new TypeError("Object expected");(a=s(p.get))&&(_.get=a),(a=s(p.set))&&(_.set=a),(a=s(p.init))&&n.unshift(a)}else(a=s(p))&&("field"===c?n.unshift(a):_[l]=a)}u&&Object.defineProperty(u,i.name,_),d=!0}function u(e,t,r){for(var i=arguments.length>2,n=0;n<t.length;n++)r=i?t[n].call(e,r):t[n].call(e);return i?r:void 0}function _(e){return"symbol"==typeof e?e:"".concat(e)}function d(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function h(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function m(e,t,r,i){return new(r||(r=Promise))((function(n,o){function s(e){try{c(i.next(e))}catch(e){o(e)}}function a(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((i=i.apply(e,t||[])).next())}))}function f(e,t){var r,i,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(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,i&&(n=2&a[0]?i.return:a[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,a[1])).done)return n;switch(i=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++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).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],i=0}finally{r=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}var p=Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]};function g(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||p(t,e,r)}function E(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function b(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return s}function y(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(b(arguments[t]));return e}function v(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var i=Array(e),n=0;for(t=0;t<r;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,n++)i[n]=o[s];return i}function M(e,t,r){if(r||2===arguments.length)for(var i,n=0,o=t.length;n<o;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}function I(e){return this instanceof I?(this.v=e,this):new I(e)}function S(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i,n=r.apply(e,t||[]),o=[];return i=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",(function(e){return function(t){return Promise.resolve(t).then(e,l)}})),i[Symbol.asyncIterator]=function(){return this},i;function s(e,t){n[e]&&(i[e]=function(t){return new Promise((function(r,i){o.push([e,t,r,i])>1||a(e,t)}))},t&&(i[e]=t(i[e])))}function a(e,t){try{(r=n[e](t)).value instanceof I?Promise.resolve(r.value.v).then(c,l):u(o[0][2],r)}catch(e){u(o[0][3],e)}var r}function c(e){a("next",e)}function l(e){a("throw",e)}function u(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function C(e){var t,r;return t={},i("next"),i("throw",(function(e){throw e})),i("return"),t[Symbol.iterator]=function(){return this},t;function i(i,n){t[i]=e[i]?function(t){return(r=!r)?{value:I(e[i](t)),done:!1}:n?n(t):t}:n}}function O(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=E(e),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(r){t[r]=e[r]&&function(t){return new Promise((function(i,n){!function(e,t,r,i){Promise.resolve(i).then((function(t){e({value:t,done:r})}),t)}(i,n,(t=e[r](t)).done,t.value)}))}}}function w(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var T=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function R(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&p(t,e,r);return T(t,e),t}function N(e){return e&&e.__esModule?e:{default:e}}function L(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}function A(e,t,r,i,n){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?n.call(e,r):n?n.value=r:t.set(e,r),r}function x(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function j(e,t,r){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var i,n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],r&&(n=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");n&&(i=function(){try{n.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:i,async:r})}else r&&e.stack.push({async:!0});return t}var D="function"==typeof SuppressedError?SuppressedError:function(e,t,r){var i=new Error(r);return i.name="SuppressedError",i.error=e,i.suppressed=t,i};function P(e){function t(t){e.error=e.hasError?new D(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}var r,i=0;return function n(){for(;r=e.stack.pop();)