New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@xapi/cmi5

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xapi/cmi5 - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

7

CHANGELOG.md

@@ -0,1 +1,8 @@

# 1.1.3 (9 Sep 2021)
- Added npm version badge to readme
- Bumped `axios` to solve security vulnerability
- Bumped dependencies
- Added build step to automated tests
# 1.1.2 (14 Jul 2021)

@@ -2,0 +9,0 @@

2

dist/Cmi5.esm.js

@@ -1,1 +0,1 @@

"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var e={exports:{}},t=e.exports=function(){let e,t;!function(e){e.SIGNATURE="http://adlnet.gov/expapi/attachments/signature",e.CERTIFICATE_OF_COMPLETION="http://id.tincanapi.com/attachment/certificate-of-completion",e.CONTRACT="http://id.tincanapi.com/attachment/contract",e.SUPPORTING_MEDIA="http://id.tincanapi.com/attachment/supporting_media"}(e||(e={})),function(e){e.ABOUT="about",e.AGENTS="agents",e.ACTIVITIES="activities",e.ACTIVITY_PROFILE="activities/profile",e.STATE="activities/state",e.AGENT_PROFILE="agents/profile",e.STATEMENT="statements"}(t||(t={}));class n{}n.INITIALIZED={id:"http://adlnet.gov/expapi/verbs/initialized",display:{"en-US":"initialized"}},n.TERMINATED={id:"http://adlnet.gov/expapi/verbs/terminated",display:{"en-US":"terminated"}},n.SUSPENDED={id:"http://adlnet.gov/expapi/verbs/suspended",display:{"en-US":"suspended"}},n.RESUMED={id:"http://adlnet.gov/expapi/verbs/resumed",display:{"en-US":"resumed"}},n.PASSED={id:"http://adlnet.gov/expapi/verbs/passed",display:{"en-US":"passed"}},n.FAILED={id:"http://adlnet.gov/expapi/verbs/failed",display:{"en-US":"failed"}},n.SCORED={id:"http://adlnet.gov/expapi/verbs/scored",display:{"en-US":"scored"}},n.COMPLETED={id:"http://adlnet.gov/expapi/verbs/completed",display:{"en-US":"completed"}},n.RESPONDED={id:"http://adlnet.gov/expapi/verbs/responded",display:{"en-US":"responded"}},n.COMMENTED={id:"http://adlnet.gov/expapi/verbs/commented",display:{"en-US":"commented"}},n.VOIDED={id:"http://adlnet.gov/expapi/verbs/voided",display:{"en-US":"voided"}},n.PROGRESSED={id:"http://adlnet.gov/expapi/verbs/progressed",display:{"en-US":"progressed"}},n.ANSWERED={id:"http://adlnet.gov/expapi/verbs/answered",display:{"en-US":"answered"}};const r="\r\n";function o(e,t){const n=[],o=(Math.random()+" ").substring(2,10)+(Math.random()+" ").substring(2,10),i={"Content-Type":"multipart/mixed; boundary="+o};n.push(function(e,t){return["--"+t,"Content-Type: application/json",'Content-Disposition: form-data; name="statement"',"",JSON.stringify(e)].join(r)+r}(e,o));const a=Array.isArray(e)?e.reduce(((e,t)=>e.concat(t.attachments)),[]):e.attachments;return t.forEach(((e,t)=>{const i=a[t];n.push(function(e,t){return["--"+t,"Content-Type: "+e.contentType,"Content-Transfer-Encoding: binary","X-Experience-API-Hash: "+e.sha2].join(r)+r+r}(i,o)),n.push(e)})),n.push(`\r\n--${o}--\r\n`),{header:i,blob:new Blob(n)}}function i(e){const t={},n=e.split("?")[1]||null;return n?(new URLSearchParams(n).forEach(((e,n)=>{try{t[n]=JSON.parse(e)}catch{t[n]=e}var r;"actor"===n&&(t.actor=(r=t.actor,["name","mbox","account"].forEach((e=>{if(Array.isArray(r[e]))switch(e){case"account":r[e]={...r.account[0].accountServiceHomePage?{homePage:r.account[0].accountServiceHomePage}:null,...r.account[0].accountName?{name:r.account[0].accountName}:null};break;default:r[e]=r[e][0]}})),r))})),t):t}const a=3600;var s=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}},c=Object.prototype.toString;function u(e){return"[object Array]"===c.call(e)}function f(e){return void 0===e}function d(e){return null!==e&&"object"==typeof e}function p(e){if("[object Object]"!==c.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function l(e){return"[object Function]"===c.call(e)}function h(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),u(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}var m={isArray:u,isArrayBuffer:function(e){return"[object ArrayBuffer]"===c.call(e)},isBuffer:function(e){return null!==e&&!f(e)&&null!==e.constructor&&!f(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:d,isPlainObject:p,isUndefined:f,isDate:function(e){return"[object Date]"===c.call(e)},isFile:function(e){return"[object File]"===c.call(e)},isBlob:function(e){return"[object Blob]"===c.call(e)},isFunction:l,isStream:function(e){return d(e)&&l(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:h,merge:function e(){var t={};function n(n,r){p(t[r])&&p(n)?t[r]=e(t[r],n):p(n)?t[r]=e({},n):u(n)?t[r]=n.slice():t[r]=n}for(var r=0,o=arguments.length;r<o;r++)h(arguments[r],n);return t},extend:function(e,t,n){return h(t,(function(t,r){e[r]=n&&"function"==typeof t?s(t,n):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}};function g(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var y=function(e,t,n){if(!t)return e;var r;if(n)r=n(t);else if(m.isURLSearchParams(t))r=t.toString();else{var o=[];m.forEach(t,(function(e,t){null!=e&&(m.isArray(e)?t+="[]":e=[e],m.forEach(e,(function(e){m.isDate(e)?e=e.toISOString():m.isObject(e)&&(e=JSON.stringify(e)),o.push(g(t)+"="+g(e))})))})),r=o.join("&")}if(r){var i=e.indexOf("#");-1!==i&&(e=e.slice(0,i)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e};function v(){this.handlers=[]}v.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},v.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},v.prototype.forEach=function(e){m.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var E=v,S=function(e,t,n){return m.forEach(n,(function(n){e=n(e,t)})),e},b=function(e){return!(!e||!e.__CANCEL__)},T=function(e,t){m.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))},w=function(e,t,n,r,o){return function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}(new Error(e),t,n,r,o)},A=m.isStandardBrowserEnv()?{write:function(e,t,n,r,o,i){var a=[];a.push(e+"="+encodeURIComponent(t)),m.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),m.isString(r)&&a.push("path="+r),m.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},x=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],R=m.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=r(window.location.href),function(t){var n=m.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0},P=function(e){return new Promise((function(t,n){var r=e.data,o=e.headers;m.isFormData(r)&&delete o["Content-Type"];var i=new XMLHttpRequest;if(e.auth){var a=e.auth.username||"",s=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.Authorization="Basic "+btoa(a+":"+s)}var c,u,f=(c=e.baseURL,u=e.url,c&&!/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(u)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(c,u):u);if(i.open(e.method.toUpperCase(),y(f,e.params,e.paramsSerializer),!0),i.timeout=e.timeout,i.onreadystatechange=function(){if(i&&4===i.readyState&&(0!==i.status||i.responseURL&&0===i.responseURL.indexOf("file:"))){var r,o,a,s,c,u="getAllResponseHeaders"in i?(r=i.getAllResponseHeaders(),c={},r?(m.forEach(r.split("\n"),(function(e){if(s=e.indexOf(":"),o=m.trim(e.substr(0,s)).toLowerCase(),a=m.trim(e.substr(s+1)),o){if(c[o]&&x.indexOf(o)>=0)return;c[o]="set-cookie"===o?(c[o]?c[o]:[]).concat([a]):c[o]?c[o]+", "+a:a}})),c):c):null,f={data:e.responseType&&"text"!==e.responseType?i.response:i.responseText,status:i.status,statusText:i.statusText,headers:u,config:e,request:i};!function(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(w("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}(t,n,f),i=null}},i.onabort=function(){i&&(n(w("Request aborted",e,"ECONNABORTED",i)),i=null)},i.onerror=function(){n(w("Network Error",e,null,i)),i=null},i.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(w(t,e,"ECONNABORTED",i)),i=null},m.isStandardBrowserEnv()){var d=(e.withCredentials||R(f))&&e.xsrfCookieName?A.read(e.xsrfCookieName):void 0;d&&(o[e.xsrfHeaderName]=d)}if("setRequestHeader"in i&&m.forEach(o,(function(e,t){void 0===r&&"content-type"===t.toLowerCase()?delete o[t]:i.setRequestHeader(t,e)})),m.isUndefined(e.withCredentials)||(i.withCredentials=!!e.withCredentials),e.responseType)try{i.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&i.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&i.upload&&i.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){i&&(i.abort(),n(e),i=null)})),r||(r=null),i.send(r)}))},O={"Content-Type":"application/x-www-form-urlencoded"};function I(e,t){!m.isUndefined(e)&&m.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var j,C={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(j=P),j),transformRequest:[function(e,t){return T(t,"Accept"),T(t,"Content-Type"),m.isFormData(e)||m.isArrayBuffer(e)||m.isBuffer(e)||m.isStream(e)||m.isFile(e)||m.isBlob(e)?e:m.isArrayBufferView(e)?e.buffer:m.isURLSearchParams(e)?(I(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):m.isObject(e)?(I(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};m.forEach(["delete","get","head"],(function(e){C.headers[e]={}})),m.forEach(["post","put","patch"],(function(e){C.headers[e]=m.merge(O)}));var D=C;function L(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var N=function(e){return L(e),e.headers=e.headers||{},e.data=S(e.data,e.headers,e.transformRequest),e.headers=m.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),m.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||D.adapter)(e).then((function(t){return L(e),t.data=S(t.data,t.headers,e.transformResponse),t}),(function(t){return b(t)||(L(e),t&&t.response&&(t.response.data=S(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},U=function(e,t){t=t||{};var n={},r=["url","method","data"],o=["headers","auth","proxy","params"],i=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function s(e,t){return m.isPlainObject(e)&&m.isPlainObject(t)?m.merge(e,t):m.isPlainObject(t)?m.merge({},t):m.isArray(t)?t.slice():t}function c(r){m.isUndefined(t[r])?m.isUndefined(e[r])||(n[r]=s(void 0,e[r])):n[r]=s(e[r],t[r])}m.forEach(r,(function(e){m.isUndefined(t[e])||(n[e]=s(void 0,t[e]))})),m.forEach(o,c),m.forEach(i,(function(r){m.isUndefined(t[r])?m.isUndefined(e[r])||(n[r]=s(void 0,e[r])):n[r]=s(void 0,t[r])})),m.forEach(a,(function(r){r in t?n[r]=s(e[r],t[r]):r in e&&(n[r]=s(void 0,e[r]))}));var u=r.concat(o).concat(i).concat(a),f=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===u.indexOf(e)}));return m.forEach(f,c),n};function M(e){this.defaults=e,this.interceptors={request:new E,response:new E}}M.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=U(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[N,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)n=n.then(t.shift(),t.shift());return n},M.prototype.getUri=function(e){return e=U(this.defaults,e),y(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},m.forEach(["delete","get","head","options"],(function(e){M.prototype[e]=function(t,n){return this.request(U(n||{},{method:e,url:t,data:(n||{}).data}))}})),m.forEach(["post","put","patch"],(function(e){M.prototype[e]=function(t,n,r){return this.request(U(r||{},{method:e,url:t,data:n}))}}));var q=M;function B(e){this.message=e}B.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},B.prototype.__CANCEL__=!0;var F=B;function k(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new F(e),t(n.reason))}))}k.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},k.source=function(){var e;return{token:new k((function(t){e=t})),cancel:e}};var _=k;function V(e){var t=new q(e),n=s(q.prototype.request,t);return m.extend(n,q.prototype,t),m.extend(n,t),n}var $=V(D);$.Axios=q,$.create=function(e){return V(U($.defaults,e))},$.Cancel=F,$.CancelToken=_,$.isCancel=b,$.all=function(e){return Promise.all(e)},$.spread=function(e){return function(t){return e.apply(null,t)}},$.isAxiosError=function(e){return"object"==typeof e&&!0===e.isAxiosError};var H=$,z=$;H.default=z;var G=H;function X(e,t){const n=`${e}:${t}`;if("undefined"!=typeof window&&window.btoa)return"Basic "+btoa(n);if("undefined"!=typeof Buffer)return"Basic "+Buffer.from(n,"binary").toString("base64");throw new Error("Environment does not support base64 conversion.")}class J{constructor(e,t,n="1.0.3"){this.endpoint=e.endsWith("/")?e:e+"/",this.headers={"X-Experience-API-Version":n,"Content-Type":"application/json",Authorization:t||X("","")}}getAbout(){return this.requestResource(t.ABOUT)}getAgent(e){return this.requestResource(t.AGENTS,{agent:e})}getStatement(e){return this.requestResource(t.STATEMENT,e)}getVoidedStatement(e){return this.requestResource(t.STATEMENT,e)}getStatements(e){return this.requestResource(t.STATEMENT,e)}getMoreStatements(e){const t=new URL(this.endpoint),n=`${t.protocol}//${t.host}${e}`;return this.requestURL(n)}sendStatement(e,n){if(null==n?void 0:n.length){const r=o(e,n);return this.requestResource(t.STATEMENT,{},{method:"POST",headers:r.header,data:r.blob})}return this.requestResource(t.STATEMENT,{},{method:"POST",data:e})}sendStatements(e,n){if(null==n?void 0:n.length){const r=o(e,n);return this.requestResource(t.STATEMENT,{},{method:"POST",headers:r.header,data:r.blob})}return this.requestResource(t.STATEMENT,{},{method:"POST",data:e})}voidStatement(e,t){const r={actor:e,verb:n.VOIDED,object:{objectType:"StatementRef",id:t}};return this.sendStatement(r)}voidStatements(e,t){const r=t.map((t=>({actor:e,verb:n.VOIDED,object:{objectType:"StatementRef",id:t}})));return this.sendStatements(r)}createState(e,n,r,o,i,a,s){const c={};return a&&(c[s]=a),this.requestResource(t.STATE,{agent:e,activityId:n,stateId:r,...i?{registration:i}:{}},{method:"POST",data:o,headers:c})}setState(e,n,r,o,i,a,s,c){const u={};return a&&(u[s]=a),c&&(u["Content-Type"]=c),this.requestResource(t.STATE,{agent:e,activityId:n,stateId:r,...i?{registration:i}:{}},{method:"PUT",data:o,headers:u})}getStates(e,n,r,o){return this.requestResource(t.STATE,{agent:e,activityId:n,...r?{registration:r}:{},...o?{since:o}:{}})}getState(e,n,r,o){return this.requestResource(t.STATE,{agent:e,activityId:n,stateId:r,...o?{registration:o}:{}})}deleteState(e,n,r,o,i){const a={};return i&&(a["If-Match"]=i),this.requestResource(t.STATE,{agent:e,activityId:n,stateId:r,...o?{registration:o}:{}},{method:"DELETE",headers:a})}deleteStates(e,n,r,o){const i={};return o&&(i["If-Match"]=o),this.requestResource(t.STATE,{agent:e,activityId:n,...r?{registration:r}:{}},{method:"DELETE",headers:i})}getActivity(e){return this.requestResource(t.ACTIVITIES,{activityId:e})}createActivityProfile(e,n,r,o,i){const a={};return o&&(a[i]=o),this.requestResource(t.ACTIVITY_PROFILE,{activityId:e,profileId:n},{method:"POST",data:r,headers:a})}setActivityProfile(e,n,r,o,i,a){const s={};return s[i]=o,a&&(s["Content-Type"]=a),this.requestResource(t.ACTIVITY_PROFILE,{activityId:e,profileId:n},{method:"PUT",data:r,headers:s})}getActivityProfiles(e,n){return this.requestResource(t.ACTIVITY_PROFILE,{activityId:e,...n?{since:n}:{}})}getActivityProfile(e,n){return this.requestResource(t.ACTIVITY_PROFILE,{activityId:e,profileId:n})}deleteActivityProfile(e,n,r){const o={};return r&&(o["If-Match"]=r),this.requestResource(t.ACTIVITY_PROFILE,{activityId:e,profileId:n},{method:"DELETE",headers:o})}createAgentProfile(e,n,r,o,i){const a={};return o&&(a[i]=o),this.requestResource(t.AGENT_PROFILE,{agent:e,profileId:n},{method:"POST",data:r,headers:a})}setAgentProfile(e,n,r,o,i,a){const s={};return s[i]=o,a&&(s["Content-Type"]=a),this.requestResource(t.AGENT_PROFILE,{agent:e,profileId:n},{method:"PUT",data:r,headers:s})}getAgentProfiles(e,n){return this.requestResource(t.AGENT_PROFILE,{agent:e,...n?{since:n}:{}})}getAgentProfile(e,n){return this.requestResource(t.AGENT_PROFILE,{agent:e,profileId:n})}deleteAgentProfile(e,n,r){const o={};return r&&(o["If-Match"]=r),this.requestResource(t.AGENT_PROFILE,{agent:e,profileId:n},{method:"DELETE",headers:o})}requestResource(e,t={},n){const r=this.generateURL(e,t);return this.requestURL(r,n)}requestURL(e,t){return G.request({method:(null==t?void 0:t.method)||"GET",url:e,headers:{...this.headers,...null==t?void 0:t.headers},data:null==t?void 0:t.data}).then((e=>{const t=e.headers["content-type"];return e.data&&t&&-1!==t.indexOf("multipart/mixed")&&(e.data=function(e){const t=e.trim().split(r)[0].trim(),n=e.split(t).map((e=>e.trim())).filter((e=>""!==e&&"--"!==e)),o=[];for(let e=0;e<n.length;e++){const t={},i=n[e].split(r);for(let e=0;e<i.length-2;e++){const n=i[e].split(":");t[n[0]]=n[1]}let a=i[i.length-1];t["Content-Type"].indexOf("application/json")>-1&&(a=JSON.parse(a)),o.push(a)}return o}(e.data)),e}))}generateURL(e,t){const n=Object.keys(t).map((e=>{let n="agent"===e?JSON.stringify(t[e]):t[e];return n=encodeURIComponent(n),`${e}=${n}`})).join("&");return`${this.endpoint}${e}${n?"?"+n:""}`}}return J.default=J,J.AttachmentUsages=e,J.Verbs=n,J.calculateISO8601Duration=function(e,t){const n=(t.getTime()-e.getTime())/1e3,r=Math.floor(n/86400),o=n%86400,i=Math.floor(o/a),s=o%a,c=Math.floor(s/60),u=s%60,f=Math.ceil(u);return`P${r?r+"D":""}T${i?i+"H":""}${c?c+"M":""}${f?f+"S":""}`},J.getSearchQueryParamsAsObject=i,J.getXAPILaunchData=function(){const e=i(location.search);if(!e.xAPILaunchService)return Promise.reject(new Error("xAPILaunchService parameter not found in URL."));const t=new URL(e.xAPILaunchService);return t.pathname+="launch/"+e.xAPILaunchKey,G({method:"POST",url:t.toString()}).then((e=>e.data))},J.getTinCanLaunchData=function(){return i(location.search)},J.toBasicAuth=X,J}();class n{}n.MOVE_ON={id:"https://w3id.org/xapi/cmi5/context/categories/moveon"},n.CMI5={id:"https://w3id.org/xapi/cmi5/context/categories/cmi5"};class r{}r.INITIALIZED=t.Verbs.INITIALIZED,r.COMPLETED=t.Verbs.COMPLETED,r.PASSED=t.Verbs.PASSED,r.FAILED=t.Verbs.FAILED,r.TERMINATED=t.Verbs.TERMINATED;var o=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===i}(e)}(e)};var i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function a(e,t){return!1!==t.clone&&t.isMergeableObject(e)?d((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function s(e,t,n){return e.concat(t).map((function(e){return a(e,n)}))}function c(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function u(e,t){try{return t in e}catch(e){return!1}}function f(e,t,n){var r={};return n.isMergeableObject(e)&&c(e).forEach((function(t){r[t]=a(e[t],n)})),c(t).forEach((function(o){(function(e,t){return u(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(u(e,o)&&n.isMergeableObject(t[o])?r[o]=function(e,t){if(!t.customMerge)return d;var n=t.customMerge(e);return"function"==typeof n?n:d}(o,n)(e[o],t[o],n):r[o]=a(t[o],n))})),r}function d(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||s,n.isMergeableObject=n.isMergeableObject||o,n.cloneUnlessOtherwiseSpecified=a;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):f(e,t,n):a(t,n)}d.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return d(e,n,t)}),{})};var p=d,l={exports:{}},h=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}},m=h,g=Object.prototype.toString;function y(e){return"[object Array]"===g.call(e)}function v(e){return void 0===e}function E(e){return null!==e&&"object"==typeof e}function S(e){if("[object Object]"!==g.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function b(e){return"[object Function]"===g.call(e)}function T(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),y(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}var w={isArray:y,isArrayBuffer:function(e){return"[object ArrayBuffer]"===g.call(e)},isBuffer:function(e){return null!==e&&!v(e)&&null!==e.constructor&&!v(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:E,isPlainObject:S,isUndefined:v,isDate:function(e){return"[object Date]"===g.call(e)},isFile:function(e){return"[object File]"===g.call(e)},isBlob:function(e){return"[object Blob]"===g.call(e)},isFunction:b,isStream:function(e){return E(e)&&b(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:T,merge:function e(){var t={};function n(n,r){S(t[r])&&S(n)?t[r]=e(t[r],n):S(n)?t[r]=e({},n):y(n)?t[r]=n.slice():t[r]=n}for(var r=0,o=arguments.length;r<o;r++)T(arguments[r],n);return t},extend:function(e,t,n){return T(t,(function(t,r){e[r]=n&&"function"==typeof t?m(t,n):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}},A=w;function x(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var R=function(e,t,n){if(!t)return e;var r;if(n)r=n(t);else if(A.isURLSearchParams(t))r=t.toString();else{var o=[];A.forEach(t,(function(e,t){null!=e&&(A.isArray(e)?t+="[]":e=[e],A.forEach(e,(function(e){A.isDate(e)?e=e.toISOString():A.isObject(e)&&(e=JSON.stringify(e)),o.push(x(t)+"="+x(e))})))})),r=o.join("&")}if(r){var i=e.indexOf("#");-1!==i&&(e=e.slice(0,i)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e},P=w;function O(){this.handlers=[]}O.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},O.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},O.prototype.forEach=function(e){P.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var I=O,j=w,C=function(e){return!(!e||!e.__CANCEL__)},D=w,L=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e},N=function(e,t,n,r,o){var i=new Error(e);return L(i,t,n,r,o)},U=N,M=w,q=M.isStandardBrowserEnv()?{write:function(e,t,n,r,o,i){var a=[];a.push(e+"="+encodeURIComponent(t)),M.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),M.isString(r)&&a.push("path="+r),M.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},B=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)},F=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},k=w,_=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],V=w,$=V.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=r(window.location.href),function(t){var n=V.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0},H=w,z=function(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(U("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)},G=q,X=R,J=function(e,t){return e&&!B(t)?F(e,t):t},Y=function(e){var t,n,r,o={};return e?(k.forEach(e.split("\n"),(function(e){if(r=e.indexOf(":"),t=k.trim(e.substr(0,r)).toLowerCase(),n=k.trim(e.substr(r+1)),t){if(o[t]&&_.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([n]):o[t]?o[t]+", "+n:n}})),o):o},K=$,Z=N,W=function(e){return new Promise((function(t,n){var r=e.data,o=e.headers;H.isFormData(r)&&delete o["Content-Type"];var i=new XMLHttpRequest;if(e.auth){var a=e.auth.username||"",s=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.Authorization="Basic "+btoa(a+":"+s)}var c=J(e.baseURL,e.url);if(i.open(e.method.toUpperCase(),X(c,e.params,e.paramsSerializer),!0),i.timeout=e.timeout,i.onreadystatechange=function(){if(i&&4===i.readyState&&(0!==i.status||i.responseURL&&0===i.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in i?Y(i.getAllResponseHeaders()):null,o={data:e.responseType&&"text"!==e.responseType?i.response:i.responseText,status:i.status,statusText:i.statusText,headers:r,config:e,request:i};z(t,n,o),i=null}},i.onabort=function(){i&&(n(Z("Request aborted",e,"ECONNABORTED",i)),i=null)},i.onerror=function(){n(Z("Network Error",e,null,i)),i=null},i.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(Z(t,e,"ECONNABORTED",i)),i=null},H.isStandardBrowserEnv()){var u=(e.withCredentials||K(c))&&e.xsrfCookieName?G.read(e.xsrfCookieName):void 0;u&&(o[e.xsrfHeaderName]=u)}if("setRequestHeader"in i&&H.forEach(o,(function(e,t){void 0===r&&"content-type"===t.toLowerCase()?delete o[t]:i.setRequestHeader(t,e)})),H.isUndefined(e.withCredentials)||(i.withCredentials=!!e.withCredentials),e.responseType)try{i.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&i.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&i.upload&&i.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){i&&(i.abort(),n(e),i=null)})),r||(r=null),i.send(r)}))},Q=w,ee=function(e,t){D.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))},te={"Content-Type":"application/x-www-form-urlencoded"};function ne(e,t){!Q.isUndefined(e)&&Q.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var re,oe={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(re=W),re),transformRequest:[function(e,t){return ee(t,"Accept"),ee(t,"Content-Type"),Q.isFormData(e)||Q.isArrayBuffer(e)||Q.isBuffer(e)||Q.isStream(e)||Q.isFile(e)||Q.isBlob(e)?e:Q.isArrayBufferView(e)?e.buffer:Q.isURLSearchParams(e)?(ne(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):Q.isObject(e)?(ne(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};oe.headers={common:{Accept:"application/json, text/plain, */*"}},Q.forEach(["delete","get","head"],(function(e){oe.headers[e]={}})),Q.forEach(["post","put","patch"],(function(e){oe.headers[e]=Q.merge(te)}));var ie=oe,ae=w,se=function(e,t,n){return j.forEach(n,(function(n){e=n(e,t)})),e},ce=C,ue=ie;function fe(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var de=w,pe=function(e,t){t=t||{};var n={},r=["url","method","data"],o=["headers","auth","proxy","params"],i=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function s(e,t){return de.isPlainObject(e)&&de.isPlainObject(t)?de.merge(e,t):de.isPlainObject(t)?de.merge({},t):de.isArray(t)?t.slice():t}function c(r){de.isUndefined(t[r])?de.isUndefined(e[r])||(n[r]=s(void 0,e[r])):n[r]=s(e[r],t[r])}de.forEach(r,(function(e){de.isUndefined(t[e])||(n[e]=s(void 0,t[e]))})),de.forEach(o,c),de.forEach(i,(function(r){de.isUndefined(t[r])?de.isUndefined(e[r])||(n[r]=s(void 0,e[r])):n[r]=s(void 0,t[r])})),de.forEach(a,(function(r){r in t?n[r]=s(e[r],t[r]):r in e&&(n[r]=s(void 0,e[r]))}));var u=r.concat(o).concat(i).concat(a),f=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===u.indexOf(e)}));return de.forEach(f,c),n},le=w,he=R,me=I,ge=function(e){return fe(e),e.headers=e.headers||{},e.data=se(e.data,e.headers,e.transformRequest),e.headers=ae.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),ae.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||ue.adapter)(e).then((function(t){return fe(e),t.data=se(t.data,t.headers,e.transformResponse),t}),(function(t){return ce(t)||(fe(e),t&&t.response&&(t.response.data=se(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},ye=pe;function ve(e){this.defaults=e,this.interceptors={request:new me,response:new me}}ve.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=ye(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[ge,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)n=n.then(t.shift(),t.shift());return n},ve.prototype.getUri=function(e){return e=ye(this.defaults,e),he(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},le.forEach(["delete","get","head","options"],(function(e){ve.prototype[e]=function(t,n){return this.request(ye(n||{},{method:e,url:t,data:(n||{}).data}))}})),le.forEach(["post","put","patch"],(function(e){ve.prototype[e]=function(t,n,r){return this.request(ye(r||{},{method:e,url:t,data:n}))}}));var Ee=ve;function Se(e){this.message=e}Se.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},Se.prototype.__CANCEL__=!0;var be=Se,Te=be;function we(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new Te(e),t(n.reason))}))}we.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},we.source=function(){var e;return{token:new we((function(t){e=t})),cancel:e}};var Ae=we,xe=w,Re=h,Pe=Ee,Oe=pe;function Ie(e){var t=new Pe(e),n=Re(Pe.prototype.request,t);return xe.extend(n,Pe.prototype,t),xe.extend(n,t),n}var je=Ie(ie);je.Axios=Pe,je.create=function(e){return Ie(Oe(je.defaults,e))},je.Cancel=be,je.CancelToken=Ae,je.isCancel=C,je.all=function(e){return Promise.all(e)},je.spread=function(e){return function(t){return e.apply(null,t)}},je.isAxiosError=function(e){return"object"==typeof e&&!0===e.isAxiosError},l.exports=je,l.exports.default=je;var Ce,De=l.exports,Le=new Uint8Array(16);function Ne(){if(!Ce&&!(Ce="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ce(Le)}var Ue=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Me(e){return"string"==typeof e&&Ue.test(e)}for(var qe=[],Be=0;Be<256;++Be)qe.push((Be+256).toString(16).substr(1));function Fe(e,t,n){var r=(e=e||{}).random||(e.rng||Ne)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(qe[e[t+0]]+qe[e[t+1]]+qe[e[t+2]]+qe[e[t+3]]+"-"+qe[e[t+4]]+qe[e[t+5]]+"-"+qe[e[t+6]]+qe[e[t+7]]+"-"+qe[e[t+8]]+qe[e[t+9]]+"-"+qe[e[t+10]]+qe[e[t+11]]+qe[e[t+12]]+qe[e[t+13]]+qe[e[t+14]]+qe[e[t+15]]).toLowerCase();if(!Me(n))throw TypeError("Stringified UUID is invalid");return n}(r)}function ke(e){return isNaN(Number(e))?e:{scaled:Number(e)}}class _e{static get instance(){return _e._instance||(_e._instance=new _e),_e._instance}static clearInstance(){_e._instance=null}static get xapi(){return _e._xapi}constructor(){if(this.launchParameters=this.getLaunchParametersFromLMS(),!this.launchParameters.fetch)throw Error("Unable to construct, no `fetch` parameter found in URL.");if(!this.launchParameters.endpoint)throw Error("Unable to construct, no `endpoint` parameter found in URL");if(!this.launchParameters.actor)throw Error("Unable to construct, no `actor` parameter found in URL.");if(!this.launchParameters.activityId)throw Error("Unable to construct, no `activityId` parameter found in URL.");if(!this.launchParameters.registration)throw Error("Unable to construct, no `registration` parameter found in URL.")}static get isCmiAvailable(){if(!window||"object"!=typeof window)return!1;if(!window.location||"string"!=typeof window.location.search)return!1;const e=new URLSearchParams(window.location.search);return Boolean(e.get("fetch")&&e.get("endpoint")&&e.get("actor")&&e.get("registration")&&e.get("activityId"))}get isAuthenticated(){return Boolean(_e._xapi)}getLaunchParameters(){return this.launchParameters}getLaunchData(){return this.launchData}getLearnerPreferences(){return this.learnerPreferences}initialize(){return this.getAuthTokenFromLMS(this.launchParameters.fetch).then((e=>{const n=e.data["auth-token"];return _e._xapi=new t(this.launchParameters.endpoint,"Basic "+n),this.getLaunchDataFromLMS()})).then((e=>{this.launchData=e.data})).then((()=>this.getLearnerPreferencesFromLMS())).then((e=>{this.learnerPreferences=e.data||{}})).then((()=>(this.initialisedDate=new Date,this.sendCmi5DefinedStatement({verb:r.INITIALIZED}))))}complete(e){return"Normal"!==this.launchData.launchMode?Promise.reject(new Error("Can only send COMPLETED when launchMode is 'Normal'")):this.sendCmi5DefinedStatement({verb:r.COMPLETED,result:{completion:!0,duration:t.calculateISO8601Duration(this.initialisedDate,new Date)},context:{contextActivities:{category:[n.MOVE_ON]}}},e)}pass(e,o){if("Normal"!==this.launchData.launchMode)return Promise.reject(new Error("Can only send PASSED when launchMode is 'Normal'"));const i=ke(e);if(this.launchData.masteryScore&&(!i||isNaN(Number(i.scaled))||i.scaled<this.launchData.masteryScore))return Promise.reject(new Error("Learner has not met Mastery Score"));const[a,s]=(c=o)&&"Activity"===c.objectType&&"string"==typeof c.id&&c.definition&&"object"==typeof c.definition&&"http://adlnet.gov/expapi/activities/objective"===c.definition.type?[o,void 0]:[o?o.objectiveActivity:void 0,o];var c;return this.sendCmi5DefinedStatement({verb:r.PASSED,result:{...i?{score:i}:{},success:!0,duration:t.calculateISO8601Duration(this.initialisedDate,new Date)},context:{contextActivities:{category:[n.MOVE_ON],...a?{parent:[a]}:{}},...this.launchData.masteryScore?{extensions:{"https://w3id.org/xapi/cmi5/context/extensions/masteryscore":this.launchData.masteryScore}}:{}}},s)}fail(e,o){if("Normal"!==this.launchData.launchMode)return Promise.reject(new Error("Can only send FAILED when launchMode is 'Normal'"));const i=ke(e);return this.sendCmi5DefinedStatement({verb:r.FAILED,result:{...i?{score:i}:{},success:!1,duration:t.calculateISO8601Duration(this.initialisedDate,new Date)},context:{contextActivities:{category:[n.MOVE_ON]},...this.launchData.masteryScore?{extensions:{"https://w3id.org/xapi/cmi5/context/extensions/masteryscore":this.launchData.masteryScore}}:{}}},o)}terminate(){return this.sendCmi5DefinedStatement({verb:r.TERMINATED,result:{duration:t.calculateISO8601Duration(this.initialisedDate,new Date)}})}progress(e){return this.sendCmi5AllowedStatement({verb:t.Verbs.PROGRESSED,object:{objectType:"Activity",id:this.launchParameters.activityId},result:{extensions:{"https://w3id.org/xapi/cmi5/result/extensions/progress":e}}})}interactionTrueFalse(e,t,n,r,o,i,a,s,c){return this.interaction(e,t,n.toString(),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"true-false",...void 0!==r?{correctResponsesPattern:r?["true"]:["false"]}:{},...o?{name:o}:{},...i?{description:i}:{}},a,s,c)}interactionChoice(e,t,n,r,o,i,a,s,c,u){return this.interaction(e,t,n.join("[,]"),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"choice",...r?{correctResponsesPattern:[r.join("[,]")]}:{},...o?{choices:o}:{},...i?{name:i}:{},...a?{description:a}:{}},s,c,u)}interactionFillIn(e,t,n,r,o,i,a,s,c){return this.interaction(e,t,n.join("[,]"),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"fill-in",...r?{correctResponsesPattern:[r.join("[,]")]}:{},...o?{name:o}:{},...i?{description:i}:{}},a,s,c)}interactionLongFillIn(e,t,n,r,o,i,a,s,c){return this.interaction(e,t,n.join("[,]"),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"long-fill-in",...r?{correctResponsesPattern:[r.join("[,]")]}:{},...o?{name:o}:{},...i?{description:i}:{}},a,s,c)}interactionLikert(e,t,n,r,o,i,a,s,c,u){return this.interaction(e,t,n,{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"likert",...r?{correctResponsesPattern:[r]}:{},...o?{scale:o}:{},...i?{name:i}:{},...a?{description:a}:{}},s,c,u)}interactionMatching(e,t,n,r,o,i,a,s,c,u,f){return this.interaction(e,t,Object.keys(n).map((e=>`${e}[.]${n[e]}`)).join("[,]"),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"matching",...r?{correctResponsesPattern:[Object.keys(r).map((e=>`${e}[.]${r[e]}`)).join("[,]")]}:{},...o?{source:o}:{},...i?{target:i}:{},...a?{name:a}:{},...s?{description:s}:{}},c,u,f)}interactionPerformance(e,t,n,r,o,i,a,s,c,u){return this.interaction(e,t,Object.keys(n).map((e=>`${e}[.]${n[e]}`)).join("[,]"),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"performance",...r?{correctResponsesPattern:[Object.keys(r).map((e=>{const t=r[e].exact?r[e].exact.toString():"",n=r[e].min?r[e].min.toString():"",o=r[e].max?r[e].max.toString():"";return`${e}[.]${t||n+":"+o}`})).join("[,]")]}:{},...o?{steps:o}:{},...i?{name:i}:{},...a?{description:a}:{}},s,c,u)}interactionSequencing(e,t,n,r,o,i,a,s,c,u){return this.interaction(e,t,n.join("[,]"),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"sequencing",...r?{correctResponsesPattern:[r.join("[,]")]}:{},...o?{choices:o}:{},...i?{name:i}:{},...a?{description:a}:{}},s,c,u)}interactionNumeric(e,t,n,r,o,i,a,s,c){return this.interaction(e,t,n.toString(),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"numeric",...r?{correctResponsesPattern:[""+(r.exact?r.exact:r.min+":"+r.max)]}:{},...o?{name:o}:{},...i?{description:i}:{}},a,s,c)}interactionOther(e,t,n,r,o,i,a,s,c){return this.interaction(e,t,n,{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"other",...r?{correctResponsesPattern:[r]}:{},...o?{name:o}:{},...i?{description:i}:{}},a,s,c)}interaction(e,n,r,o,i,a,s){return this.sendCmi5AllowedStatement({verb:t.Verbs.ANSWERED,result:{response:r,...a?{duration:t.calculateISO8601Duration(a.start,a.end)}:{},..."boolean"==typeof i?{success:i}:{}},object:{objectType:"Activity",id:`${this.launchParameters.activityId}/test/${e}/question/${n}`,definition:o},...s?{context:{contextActivities:{parent:[s]}}}:{}})}setResultScore(e,t){return{...t,result:{...t.result||{},score:e}}}async moveOn(e){var t;let n=e;if("Normal"!==this.launchData.launchMode)return Promise.reject(new Error("Can only send FAILED when launchMode is 'Normal'"));const r=[];if(null!==(t=n)&&void 0!==t&&t.score){var o;const e=ke(null===(o=n)||void 0===o?void 0:o.score);if(this.launchData.masteryScore)e.scaled>=this.launchData.masteryScore?this.appendStatementIds(await this.pass(e,n),r):this.appendStatementIds(await this.fail(e,n),r);else{var i;const t=t=>this.setResultScore(e,t),r=null===(i=n)||void 0===i?void 0:i.transform;n={...n||{},transform:"function"==typeof r?e=>r(t(e)):e=>t(e)}}}return this.appendStatementIds(await this.complete(n),r),null!=e&&e.disableSendTerminated||this.appendStatementIds(await this.terminate(),r),r}appendStatementIds(e,t){t.push.apply(t,e.data)}getLaunchParametersFromLMS(){return t.getSearchQueryParamsAsObject(window.location.href)}getAuthTokenFromLMS(e){return De.post(e)}getLaunchDataFromLMS(){return _e._xapi.getState(this.launchParameters.actor,this.launchParameters.activityId,"LMS.LaunchData",this.launchParameters.registration)}getLearnerPreferencesFromLMS(){return _e._xapi.getAgentProfile(this.launchParameters.actor,"cmi5LearnerPreferences").then((e=>e.data),(()=>({})))}sendCmi5DefinedStatement(e,t){const r={object:{objectType:"Activity",id:this.launchParameters.activityId},context:{contextActivities:{category:[n.CMI5]}}},o=p.all([r,e]);return this.sendCmi5AllowedStatement(o,t)}sendCmi5AllowedStatement(e,t){const n=Fe(),r=this.launchParameters.actor,o=(new Date).toISOString(),i=Object.assign({},this.launchData.contextTemplate);i.registration=this.launchParameters.registration;const a={id:n,actor:r,timestamp:o,context:i},s=p.all([a,e]),c=t&&"function"==typeof t.transform?t.transform(s):s;return _e._xapi.sendStatement(c)}}_e._instance=null,_e._xapi=null;export default _e;
"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var e={exports:{}},t=e.exports=function(){let e,t;!function(e){e.SIGNATURE="http://adlnet.gov/expapi/attachments/signature",e.CERTIFICATE_OF_COMPLETION="http://id.tincanapi.com/attachment/certificate-of-completion",e.CONTRACT="http://id.tincanapi.com/attachment/contract",e.SUPPORTING_MEDIA="http://id.tincanapi.com/attachment/supporting_media"}(e||(e={})),function(e){e.ABOUT="about",e.AGENTS="agents",e.ACTIVITIES="activities",e.ACTIVITY_PROFILE="activities/profile",e.STATE="activities/state",e.AGENT_PROFILE="agents/profile",e.STATEMENT="statements"}(t||(t={}));class r{}r.INITIALIZED={id:"http://adlnet.gov/expapi/verbs/initialized",display:{"en-US":"initialized"}},r.TERMINATED={id:"http://adlnet.gov/expapi/verbs/terminated",display:{"en-US":"terminated"}},r.SUSPENDED={id:"http://adlnet.gov/expapi/verbs/suspended",display:{"en-US":"suspended"}},r.RESUMED={id:"http://adlnet.gov/expapi/verbs/resumed",display:{"en-US":"resumed"}},r.PASSED={id:"http://adlnet.gov/expapi/verbs/passed",display:{"en-US":"passed"}},r.FAILED={id:"http://adlnet.gov/expapi/verbs/failed",display:{"en-US":"failed"}},r.SCORED={id:"http://adlnet.gov/expapi/verbs/scored",display:{"en-US":"scored"}},r.COMPLETED={id:"http://adlnet.gov/expapi/verbs/completed",display:{"en-US":"completed"}},r.RESPONDED={id:"http://adlnet.gov/expapi/verbs/responded",display:{"en-US":"responded"}},r.COMMENTED={id:"http://adlnet.gov/expapi/verbs/commented",display:{"en-US":"commented"}},r.VOIDED={id:"http://adlnet.gov/expapi/verbs/voided",display:{"en-US":"voided"}},r.PROGRESSED={id:"http://adlnet.gov/expapi/verbs/progressed",display:{"en-US":"progressed"}},r.ANSWERED={id:"http://adlnet.gov/expapi/verbs/answered",display:{"en-US":"answered"}};const n="\r\n";function o(e,t){const r=[],o=(Math.random()+" ").substring(2,10)+(Math.random()+" ").substring(2,10),i={"Content-Type":"multipart/mixed; boundary="+o};r.push(function(e,t){return["--"+t,"Content-Type: application/json",'Content-Disposition: form-data; name="statement"',"",JSON.stringify(e)].join(n)+n}(e,o));const a=Array.isArray(e)?e.reduce(((e,t)=>e.concat(t.attachments)),[]):e.attachments;return t.forEach(((e,t)=>{const i=a[t];r.push(function(e,t){return["--"+t,"Content-Type: "+e.contentType,"Content-Transfer-Encoding: binary","X-Experience-API-Hash: "+e.sha2].join(n)+n+n}(i,o)),r.push(e)})),r.push(`\r\n--${o}--\r\n`),{header:i,blob:new Blob(r)}}function i(e){const t={},r=e.split("?")[1]||null;return r?(new URLSearchParams(r).forEach(((e,r)=>{try{t[r]=JSON.parse(e)}catch{t[r]=e}var n;"actor"===r&&(t.actor=(n=t.actor,["name","mbox","account"].forEach((e=>{if(Array.isArray(n[e]))switch(e){case"account":n[e]={...n.account[0].accountServiceHomePage?{homePage:n.account[0].accountServiceHomePage}:null,...n.account[0].accountName?{name:n.account[0].accountName}:null};break;default:n[e]=n[e][0]}})),n))})),t):t}const a=3600;var s={exports:{}},c=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}},u=c,l=Object.prototype.toString;function d(e){return"[object Array]"===l.call(e)}function f(e){return void 0===e}function p(e){return null!==e&&"object"==typeof e}function h(e){if("[object Object]"!==l.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function m(e){return"[object Function]"===l.call(e)}function g(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),d(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}var y={isArray:d,isArrayBuffer:function(e){return"[object ArrayBuffer]"===l.call(e)},isBuffer:function(e){return null!==e&&!f(e)&&null!==e.constructor&&!f(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:p,isPlainObject:h,isUndefined:f,isDate:function(e){return"[object Date]"===l.call(e)},isFile:function(e){return"[object File]"===l.call(e)},isBlob:function(e){return"[object Blob]"===l.call(e)},isFunction:m,isStream:function(e){return p(e)&&m(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:g,merge:function e(){var t={};function r(r,n){h(t[n])&&h(r)?t[n]=e(t[n],r):h(r)?t[n]=e({},r):d(r)?t[n]=r.slice():t[n]=r}for(var n=0,o=arguments.length;n<o;n++)g(arguments[n],r);return t},extend:function(e,t,r){return g(t,(function(t,n){e[n]=r&&"function"==typeof t?u(t,r):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}},v=y;function b(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var E=function(e,t,r){if(!t)return e;var n;if(r)n=r(t);else if(v.isURLSearchParams(t))n=t.toString();else{var o=[];v.forEach(t,(function(e,t){null!=e&&(v.isArray(e)?t+="[]":e=[e],v.forEach(e,(function(e){v.isDate(e)?e=e.toISOString():v.isObject(e)&&(e=JSON.stringify(e)),o.push(b(t)+"="+b(e))})))})),n=o.join("&")}if(n){var i=e.indexOf("#");-1!==i&&(e=e.slice(0,i)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e},S=y;function w(){this.handlers=[]}w.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},w.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},w.prototype.forEach=function(e){S.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var T=w,x=y,A=function(e,t,r,n,o){return e.config=t,r&&(e.code=r),e.request=n,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e},j=A,O=function(e,t,r,n,o){var i=new Error(e);return j(i,t,r,n,o)},P=O,R=y,I=R.isStandardBrowserEnv()?{write:function(e,t,r,n,o,i){var a=[];a.push(e+"="+encodeURIComponent(t)),R.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),R.isString(n)&&a.push("path="+n),R.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},N=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)},C=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},D=y,L=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],U=y,k=U.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=n(window.location.href),function(t){var r=U.isString(t)?n(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0},M=y,q=function(e,t,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(P("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)},B=I,_=E,F=function(e,t){return e&&!N(t)?C(e,t):t},V=function(e){var t,r,n,o={};return e?(D.forEach(e.split("\n"),(function(e){if(n=e.indexOf(":"),t=D.trim(e.substr(0,n)).toLowerCase(),r=D.trim(e.substr(n+1)),t){if(o[t]&&L.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([r]):o[t]?o[t]+", "+r:r}})),o):o},$=k,J=O,H=function(e){return new Promise((function(t,r){var n=e.data,o=e.headers,i=e.responseType;M.isFormData(n)&&delete o["Content-Type"];var a=new XMLHttpRequest;if(e.auth){var s=e.auth.username||"",c=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.Authorization="Basic "+btoa(s+":"+c)}var u=F(e.baseURL,e.url);function l(){if(a){var n="getAllResponseHeaders"in a?V(a.getAllResponseHeaders()):null,o={data:i&&"text"!==i&&"json"!==i?a.response:a.responseText,status:a.status,statusText:a.statusText,headers:n,config:e,request:a};q(t,r,o),a=null}}if(a.open(e.method.toUpperCase(),_(u,e.params,e.paramsSerializer),!0),a.timeout=e.timeout,"onloadend"in a?a.onloadend=l:a.onreadystatechange=function(){a&&4===a.readyState&&(0!==a.status||a.responseURL&&0===a.responseURL.indexOf("file:"))&&setTimeout(l)},a.onabort=function(){a&&(r(J("Request aborted",e,"ECONNABORTED",a)),a=null)},a.onerror=function(){r(J("Network Error",e,null,a)),a=null},a.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(J(t,e,e.transitional&&e.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",a)),a=null},M.isStandardBrowserEnv()){var d=(e.withCredentials||$(u))&&e.xsrfCookieName?B.read(e.xsrfCookieName):void 0;d&&(o[e.xsrfHeaderName]=d)}"setRequestHeader"in a&&M.forEach(o,(function(e,t){void 0===n&&"content-type"===t.toLowerCase()?delete o[t]:a.setRequestHeader(t,e)})),M.isUndefined(e.withCredentials)||(a.withCredentials=!!e.withCredentials),i&&"json"!==i&&(a.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&a.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&a.upload&&a.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){a&&(a.abort(),r(e),a=null)})),n||(n=null),a.send(n)}))},z=y,G=function(e,t){x.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))},X=A,W={"Content-Type":"application/x-www-form-urlencoded"};function Y(e,t){!z.isUndefined(e)&&z.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var Z,K={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(Z=H),Z),transformRequest:[function(e,t){return G(t,"Accept"),G(t,"Content-Type"),z.isFormData(e)||z.isArrayBuffer(e)||z.isBuffer(e)||z.isStream(e)||z.isFile(e)||z.isBlob(e)?e:z.isArrayBufferView(e)?e.buffer:z.isURLSearchParams(e)?(Y(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):z.isObject(e)||t&&"application/json"===t["Content-Type"]?(Y(t,"application/json"),function(e,t,r){if(z.isString(e))try{return(t||JSON.parse)(e),z.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional,r=t&&t.silentJSONParsing,n=t&&t.forcedJSONParsing,o=!r&&"json"===this.responseType;if(o||n&&z.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw X(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};z.forEach(["delete","get","head"],(function(e){K.headers[e]={}})),z.forEach(["post","put","patch"],(function(e){K.headers[e]=z.merge(W)}));var Q=K,ee=y,te=Q,re=function(e){return!(!e||!e.__CANCEL__)},ne=y,oe=function(e,t,r){var n=this||te;return ee.forEach(r,(function(r){e=r.call(n,e,t)})),e},ie=re,ae=Q;function se(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var ce=y,ue=function(e,t){t=t||{};var r={},n=["url","method","data"],o=["headers","auth","proxy","params"],i=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function s(e,t){return ce.isPlainObject(e)&&ce.isPlainObject(t)?ce.merge(e,t):ce.isPlainObject(t)?ce.merge({},t):ce.isArray(t)?t.slice():t}function c(n){ce.isUndefined(t[n])?ce.isUndefined(e[n])||(r[n]=s(void 0,e[n])):r[n]=s(e[n],t[n])}ce.forEach(n,(function(e){ce.isUndefined(t[e])||(r[e]=s(void 0,t[e]))})),ce.forEach(o,c),ce.forEach(i,(function(n){ce.isUndefined(t[n])?ce.isUndefined(e[n])||(r[n]=s(void 0,e[n])):r[n]=s(void 0,t[n])})),ce.forEach(a,(function(n){n in t?r[n]=s(e[n],t[n]):n in e&&(r[n]=s(void 0,e[n]))}));var u=n.concat(o).concat(i).concat(a),l=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===u.indexOf(e)}));return ce.forEach(l,c),r},le={name:"axios",version:"0.21.4",description:"Promise based HTTP client for the browser and node.js",main:"index.js",scripts:{test:"grunt test",start:"node ./sandbox/server.js",build:"NODE_ENV=production grunt build",preversion:"npm test",version:"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",postversion:"git push && git push --tags",examples:"node ./examples/server.js",coveralls:"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",fix:"eslint --fix lib/**/*.js"},repository:{type:"git",url:"https://github.com/axios/axios.git"},keywords:["xhr","http","ajax","promise","node"],author:"Matt Zabriskie",license:"MIT",bugs:{url:"https://github.com/axios/axios/issues"},homepage:"https://axios-http.com",devDependencies:{coveralls:"^3.0.0","es6-promise":"^4.2.4",grunt:"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1",karma:"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2",minimist:"^1.2.0",mocha:"^8.2.1",sinon:"^4.5.0","terser-webpack-plugin":"^4.2.3",typescript:"^4.0.5","url-search-params":"^0.10.0",webpack:"^4.44.2","webpack-dev-server":"^3.11.0"},browser:{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},jsdelivr:"dist/axios.min.js",unpkg:"dist/axios.min.js",typings:"./index.d.ts",dependencies:{"follow-redirects":"^1.14.0"},bundlesize:[{path:"./dist/axios.min.js",threshold:"5kB"}]},de={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){de[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var fe={},pe=le.version.split(".");function he(e,t){for(var r=t?t.split("."):pe,n=e.split("."),o=0;o<3;o++){if(r[o]>n[o])return!0;if(r[o]<n[o])return!1}return!1}de.transitional=function(e,t,r){var n=t&&he(t);function o(e,t){return"[Axios v"+le.version+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,i,a){if(!1===e)throw new Error(o(i," has been removed in "+t));return n&&!fe[i]&&(fe[i]=!0,console.warn(o(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,i,a)}};var me=y,ge=E,ye=T,ve=function(e){return se(e),e.headers=e.headers||{},e.data=oe.call(e,e.data,e.headers,e.transformRequest),e.headers=ne.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),ne.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||ae.adapter)(e).then((function(t){return se(e),t.data=oe.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return ie(t)||(se(e),t&&t.response&&(t.response.data=oe.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},be=ue,Ee={isOlderVersion:he,assertOptions:function(e,t,r){if("object"!=typeof e)throw new TypeError("options must be an object");for(var n=Object.keys(e),o=n.length;o-- >0;){var i=n[o],a=t[i];if(a){var s=e[i],c=void 0===s||a(s,i,e);if(!0!==c)throw new TypeError("option "+i+" must be "+c)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:de},Se=Ee.validators;function we(e){this.defaults=e,this.interceptors={request:new ye,response:new ye}}we.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=be(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&Ee.assertOptions(t,{silentJSONParsing:Se.transitional(Se.boolean,"1.0.0"),forcedJSONParsing:Se.transitional(Se.boolean,"1.0.0"),clarifyTimeoutError:Se.transitional(Se.boolean,"1.0.0")},!1);var r=[],n=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(n=n&&t.synchronous,r.unshift(t.fulfilled,t.rejected))}));var o,i=[];if(this.interceptors.response.forEach((function(e){i.push(e.fulfilled,e.rejected)})),!n){var a=[ve,void 0];for(Array.prototype.unshift.apply(a,r),a=a.concat(i),o=Promise.resolve(e);a.length;)o=o.then(a.shift(),a.shift());return o}for(var s=e;r.length;){var c=r.shift(),u=r.shift();try{s=c(s)}catch(e){u(e);break}}try{o=ve(s)}catch(e){return Promise.reject(e)}for(;i.length;)o=o.then(i.shift(),i.shift());return o},we.prototype.getUri=function(e){return e=be(this.defaults,e),ge(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},me.forEach(["delete","get","head","options"],(function(e){we.prototype[e]=function(t,r){return this.request(be(r||{},{method:e,url:t,data:(r||{}).data}))}})),me.forEach(["post","put","patch"],(function(e){we.prototype[e]=function(t,r,n){return this.request(be(n||{},{method:e,url:t,data:r}))}}));var Te=we;function xe(e){this.message=e}xe.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},xe.prototype.__CANCEL__=!0;var Ae=xe,je=Ae;function Oe(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new je(e),t(r.reason))}))}Oe.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Oe.source=function(){var e;return{token:new Oe((function(t){e=t})),cancel:e}};var Pe=Oe,Re=y,Ie=c,Ne=Te,Ce=ue;function De(e){var t=new Ne(e),r=Ie(Ne.prototype.request,t);return Re.extend(r,Ne.prototype,t),Re.extend(r,t),r}var Le=De(Q);Le.Axios=Ne,Le.create=function(e){return De(Ce(Le.defaults,e))},Le.Cancel=Ae,Le.CancelToken=Pe,Le.isCancel=re,Le.all=function(e){return Promise.all(e)},Le.spread=function(e){return function(t){return e.apply(null,t)}},Le.isAxiosError=function(e){return"object"==typeof e&&!0===e.isAxiosError},s.exports=Le,s.exports.default=Le;var Ue=s.exports;function ke(e,t){const r=`${e}:${t}`;if("undefined"!=typeof window&&window.btoa)return"Basic "+btoa(r);if("undefined"!=typeof Buffer)return"Basic "+Buffer.from(r,"binary").toString("base64");throw new Error("Environment does not support base64 conversion.")}class Me{constructor(e,t,r="1.0.3"){this.endpoint=e.endsWith("/")?e:e+"/",this.headers={"X-Experience-API-Version":r,"Content-Type":"application/json",Authorization:t||ke("","")}}getAbout(){return this.requestResource(t.ABOUT)}getAgent(e){return this.requestResource(t.AGENTS,{agent:e})}getStatement(e){return this.requestResource(t.STATEMENT,e)}getVoidedStatement(e){return this.requestResource(t.STATEMENT,e)}getStatements(e){return this.requestResource(t.STATEMENT,e)}getMoreStatements(e){const t=new URL(this.endpoint),r=`${t.protocol}//${t.host}${e}`;return this.requestURL(r)}sendStatement(e,r){if(null==r?void 0:r.length){const n=o(e,r);return this.requestResource(t.STATEMENT,{},{method:"POST",headers:n.header,data:n.blob})}return this.requestResource(t.STATEMENT,{},{method:"POST",data:e})}sendStatements(e,r){if(null==r?void 0:r.length){const n=o(e,r);return this.requestResource(t.STATEMENT,{},{method:"POST",headers:n.header,data:n.blob})}return this.requestResource(t.STATEMENT,{},{method:"POST",data:e})}voidStatement(e,t){const n={actor:e,verb:r.VOIDED,object:{objectType:"StatementRef",id:t}};return this.sendStatement(n)}voidStatements(e,t){const n=t.map((t=>({actor:e,verb:r.VOIDED,object:{objectType:"StatementRef",id:t}})));return this.sendStatements(n)}createState(e,r,n,o,i,a,s){const c={};return a&&(c[s]=a),this.requestResource(t.STATE,{agent:e,activityId:r,stateId:n,...i?{registration:i}:{}},{method:"POST",data:o,headers:c})}setState(e,r,n,o,i,a,s,c){const u={};return a&&(u[s]=a),c&&(u["Content-Type"]=c),this.requestResource(t.STATE,{agent:e,activityId:r,stateId:n,...i?{registration:i}:{}},{method:"PUT",data:o,headers:u})}getStates(e,r,n,o){return this.requestResource(t.STATE,{agent:e,activityId:r,...n?{registration:n}:{},...o?{since:o}:{}})}getState(e,r,n,o){return this.requestResource(t.STATE,{agent:e,activityId:r,stateId:n,...o?{registration:o}:{}})}deleteState(e,r,n,o,i){const a={};return i&&(a["If-Match"]=i),this.requestResource(t.STATE,{agent:e,activityId:r,stateId:n,...o?{registration:o}:{}},{method:"DELETE",headers:a})}deleteStates(e,r,n,o){const i={};return o&&(i["If-Match"]=o),this.requestResource(t.STATE,{agent:e,activityId:r,...n?{registration:n}:{}},{method:"DELETE",headers:i})}getActivity(e){return this.requestResource(t.ACTIVITIES,{activityId:e})}createActivityProfile(e,r,n,o,i){const a={};return o&&(a[i]=o),this.requestResource(t.ACTIVITY_PROFILE,{activityId:e,profileId:r},{method:"POST",data:n,headers:a})}setActivityProfile(e,r,n,o,i,a){const s={};return s[i]=o,a&&(s["Content-Type"]=a),this.requestResource(t.ACTIVITY_PROFILE,{activityId:e,profileId:r},{method:"PUT",data:n,headers:s})}getActivityProfiles(e,r){return this.requestResource(t.ACTIVITY_PROFILE,{activityId:e,...r?{since:r}:{}})}getActivityProfile(e,r){return this.requestResource(t.ACTIVITY_PROFILE,{activityId:e,profileId:r})}deleteActivityProfile(e,r,n){const o={};return n&&(o["If-Match"]=n),this.requestResource(t.ACTIVITY_PROFILE,{activityId:e,profileId:r},{method:"DELETE",headers:o})}createAgentProfile(e,r,n,o,i){const a={};return o&&(a[i]=o),this.requestResource(t.AGENT_PROFILE,{agent:e,profileId:r},{method:"POST",data:n,headers:a})}setAgentProfile(e,r,n,o,i,a){const s={};return s[i]=o,a&&(s["Content-Type"]=a),this.requestResource(t.AGENT_PROFILE,{agent:e,profileId:r},{method:"PUT",data:n,headers:s})}getAgentProfiles(e,r){return this.requestResource(t.AGENT_PROFILE,{agent:e,...r?{since:r}:{}})}getAgentProfile(e,r){return this.requestResource(t.AGENT_PROFILE,{agent:e,profileId:r})}deleteAgentProfile(e,r,n){const o={};return n&&(o["If-Match"]=n),this.requestResource(t.AGENT_PROFILE,{agent:e,profileId:r},{method:"DELETE",headers:o})}requestResource(e,t={},r){const n=this.generateURL(e,t);return this.requestURL(n,r)}requestURL(e,t){return Ue.request({method:(null==t?void 0:t.method)||"GET",url:e,headers:{...this.headers,...null==t?void 0:t.headers},data:null==t?void 0:t.data}).then((e=>{const t=e.headers["content-type"];return e.data&&t&&-1!==t.indexOf("multipart/mixed")&&(e.data=function(e){const t=e.trim().split(n)[0].trim(),r=e.split(t).map((e=>e.trim())).filter((e=>""!==e&&"--"!==e)),o=[];for(let e=0;e<r.length;e++){const t={},i=r[e].split(n);for(let e=0;e<i.length-2;e++){const r=i[e].split(":");t[r[0]]=r[1]}let a=i[i.length-1];t["Content-Type"].indexOf("application/json")>-1&&(a=JSON.parse(a)),o.push(a)}return o}(e.data)),e}))}generateURL(e,t){const r=Object.keys(t).map((e=>{let r="agent"===e?JSON.stringify(t[e]):t[e];return r=encodeURIComponent(r),`${e}=${r}`})).join("&");return`${this.endpoint}${e}${r?"?"+r:""}`}}return Me.default=Me,Me.AttachmentUsages=e,Me.Verbs=r,Me.calculateISO8601Duration=function(e,t){const r=(t.getTime()-e.getTime())/1e3,n=Math.floor(r/86400),o=r%86400,i=Math.floor(o/a),s=o%a,c=Math.floor(s/60),u=s%60,l=Math.ceil(u);return`P${n?n+"D":""}T${i?i+"H":""}${c?c+"M":""}${l?l+"S":""}`},Me.getSearchQueryParamsAsObject=i,Me.getXAPILaunchData=function(){const e=i(location.search);if(!e.xAPILaunchService)return Promise.reject(new Error("xAPILaunchService parameter not found in URL."));const t=new URL(e.xAPILaunchService);return t.pathname+="launch/"+e.xAPILaunchKey,Ue({method:"POST",url:t.toString()}).then((e=>e.data))},Me.getTinCanLaunchData=function(){return i(location.search)},Me.toBasicAuth=ke,Me}();class r{}r.MOVE_ON={id:"https://w3id.org/xapi/cmi5/context/categories/moveon"},r.CMI5={id:"https://w3id.org/xapi/cmi5/context/categories/cmi5"};class n{}n.INITIALIZED=t.Verbs.INITIALIZED,n.COMPLETED=t.Verbs.COMPLETED,n.PASSED=t.Verbs.PASSED,n.FAILED=t.Verbs.FAILED,n.TERMINATED=t.Verbs.TERMINATED;var o=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===i}(e)}(e)};var i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function a(e,t){return!1!==t.clone&&t.isMergeableObject(e)?d((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function s(e,t,r){return e.concat(t).map((function(e){return a(e,r)}))}function c(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function u(e,t){try{return t in e}catch(e){return!1}}function l(e,t,r){var n={};return r.isMergeableObject(e)&&c(e).forEach((function(t){n[t]=a(e[t],r)})),c(t).forEach((function(o){(function(e,t){return u(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(u(e,o)&&r.isMergeableObject(t[o])?n[o]=function(e,t){if(!t.customMerge)return d;var r=t.customMerge(e);return"function"==typeof r?r:d}(o,r)(e[o],t[o],r):n[o]=a(t[o],r))})),n}function d(e,t,r){(r=r||{}).arrayMerge=r.arrayMerge||s,r.isMergeableObject=r.isMergeableObject||o,r.cloneUnlessOtherwiseSpecified=a;var n=Array.isArray(t);return n===Array.isArray(e)?n?r.arrayMerge(e,t,r):l(e,t,r):a(t,r)}d.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,r){return d(e,r,t)}),{})};var f=d,p={exports:{}},h=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}},m=h,g=Object.prototype.toString;function y(e){return"[object Array]"===g.call(e)}function v(e){return void 0===e}function b(e){return null!==e&&"object"==typeof e}function E(e){if("[object Object]"!==g.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function S(e){return"[object Function]"===g.call(e)}function w(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),y(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}var T={isArray:y,isArrayBuffer:function(e){return"[object ArrayBuffer]"===g.call(e)},isBuffer:function(e){return null!==e&&!v(e)&&null!==e.constructor&&!v(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:b,isPlainObject:E,isUndefined:v,isDate:function(e){return"[object Date]"===g.call(e)},isFile:function(e){return"[object File]"===g.call(e)},isBlob:function(e){return"[object Blob]"===g.call(e)},isFunction:S,isStream:function(e){return b(e)&&S(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:w,merge:function e(){var t={};function r(r,n){E(t[n])&&E(r)?t[n]=e(t[n],r):E(r)?t[n]=e({},r):y(r)?t[n]=r.slice():t[n]=r}for(var n=0,o=arguments.length;n<o;n++)w(arguments[n],r);return t},extend:function(e,t,r){return w(t,(function(t,n){e[n]=r&&"function"==typeof t?m(t,r):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}},x=T;function A(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var j=function(e,t,r){if(!t)return e;var n;if(r)n=r(t);else if(x.isURLSearchParams(t))n=t.toString();else{var o=[];x.forEach(t,(function(e,t){null!=e&&(x.isArray(e)?t+="[]":e=[e],x.forEach(e,(function(e){x.isDate(e)?e=e.toISOString():x.isObject(e)&&(e=JSON.stringify(e)),o.push(A(t)+"="+A(e))})))})),n=o.join("&")}if(n){var i=e.indexOf("#");-1!==i&&(e=e.slice(0,i)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e},O=T;function P(){this.handlers=[]}P.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},P.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},P.prototype.forEach=function(e){O.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var R=P,I=T,N=function(e,t,r,n,o){return e.config=t,r&&(e.code=r),e.request=n,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e},C=N,D=function(e,t,r,n,o){var i=new Error(e);return C(i,t,r,n,o)},L=D,U=T,k=U.isStandardBrowserEnv()?{write:function(e,t,r,n,o,i){var a=[];a.push(e+"="+encodeURIComponent(t)),U.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),U.isString(n)&&a.push("path="+n),U.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},M=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)},q=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},B=T,_=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],F=T,V=F.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=n(window.location.href),function(t){var r=F.isString(t)?n(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0},$=T,J=function(e,t,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(L("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)},H=k,z=j,G=function(e,t){return e&&!M(t)?q(e,t):t},X=function(e){var t,r,n,o={};return e?(B.forEach(e.split("\n"),(function(e){if(n=e.indexOf(":"),t=B.trim(e.substr(0,n)).toLowerCase(),r=B.trim(e.substr(n+1)),t){if(o[t]&&_.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([r]):o[t]?o[t]+", "+r:r}})),o):o},W=V,Y=D,Z=function(e){return new Promise((function(t,r){var n=e.data,o=e.headers,i=e.responseType;$.isFormData(n)&&delete o["Content-Type"];var a=new XMLHttpRequest;if(e.auth){var s=e.auth.username||"",c=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.Authorization="Basic "+btoa(s+":"+c)}var u=G(e.baseURL,e.url);function l(){if(a){var n="getAllResponseHeaders"in a?X(a.getAllResponseHeaders()):null,o={data:i&&"text"!==i&&"json"!==i?a.response:a.responseText,status:a.status,statusText:a.statusText,headers:n,config:e,request:a};J(t,r,o),a=null}}if(a.open(e.method.toUpperCase(),z(u,e.params,e.paramsSerializer),!0),a.timeout=e.timeout,"onloadend"in a?a.onloadend=l:a.onreadystatechange=function(){a&&4===a.readyState&&(0!==a.status||a.responseURL&&0===a.responseURL.indexOf("file:"))&&setTimeout(l)},a.onabort=function(){a&&(r(Y("Request aborted",e,"ECONNABORTED",a)),a=null)},a.onerror=function(){r(Y("Network Error",e,null,a)),a=null},a.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(Y(t,e,e.transitional&&e.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",a)),a=null},$.isStandardBrowserEnv()){var d=(e.withCredentials||W(u))&&e.xsrfCookieName?H.read(e.xsrfCookieName):void 0;d&&(o[e.xsrfHeaderName]=d)}"setRequestHeader"in a&&$.forEach(o,(function(e,t){void 0===n&&"content-type"===t.toLowerCase()?delete o[t]:a.setRequestHeader(t,e)})),$.isUndefined(e.withCredentials)||(a.withCredentials=!!e.withCredentials),i&&"json"!==i&&(a.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&a.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&a.upload&&a.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){a&&(a.abort(),r(e),a=null)})),n||(n=null),a.send(n)}))},K=T,Q=function(e,t){I.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))},ee=N,te={"Content-Type":"application/x-www-form-urlencoded"};function re(e,t){!K.isUndefined(e)&&K.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var ne,oe={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(ne=Z),ne),transformRequest:[function(e,t){return Q(t,"Accept"),Q(t,"Content-Type"),K.isFormData(e)||K.isArrayBuffer(e)||K.isBuffer(e)||K.isStream(e)||K.isFile(e)||K.isBlob(e)?e:K.isArrayBufferView(e)?e.buffer:K.isURLSearchParams(e)?(re(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):K.isObject(e)||t&&"application/json"===t["Content-Type"]?(re(t,"application/json"),function(e,t,r){if(K.isString(e))try{return(t||JSON.parse)(e),K.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional,r=t&&t.silentJSONParsing,n=t&&t.forcedJSONParsing,o=!r&&"json"===this.responseType;if(o||n&&K.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw ee(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};oe.headers={common:{Accept:"application/json, text/plain, */*"}},K.forEach(["delete","get","head"],(function(e){oe.headers[e]={}})),K.forEach(["post","put","patch"],(function(e){oe.headers[e]=K.merge(te)}));var ie=oe,ae=T,se=ie,ce=function(e){return!(!e||!e.__CANCEL__)},ue=T,le=function(e,t,r){var n=this||se;return ae.forEach(r,(function(r){e=r.call(n,e,t)})),e},de=ce,fe=ie;function pe(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var he=T,me=function(e,t){t=t||{};var r={},n=["url","method","data"],o=["headers","auth","proxy","params"],i=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function s(e,t){return he.isPlainObject(e)&&he.isPlainObject(t)?he.merge(e,t):he.isPlainObject(t)?he.merge({},t):he.isArray(t)?t.slice():t}function c(n){he.isUndefined(t[n])?he.isUndefined(e[n])||(r[n]=s(void 0,e[n])):r[n]=s(e[n],t[n])}he.forEach(n,(function(e){he.isUndefined(t[e])||(r[e]=s(void 0,t[e]))})),he.forEach(o,c),he.forEach(i,(function(n){he.isUndefined(t[n])?he.isUndefined(e[n])||(r[n]=s(void 0,e[n])):r[n]=s(void 0,t[n])})),he.forEach(a,(function(n){n in t?r[n]=s(e[n],t[n]):n in e&&(r[n]=s(void 0,e[n]))}));var u=n.concat(o).concat(i).concat(a),l=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===u.indexOf(e)}));return he.forEach(l,c),r},ge={name:"axios",version:"0.21.4",description:"Promise based HTTP client for the browser and node.js",main:"index.js",scripts:{test:"grunt test",start:"node ./sandbox/server.js",build:"NODE_ENV=production grunt build",preversion:"npm test",version:"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",postversion:"git push && git push --tags",examples:"node ./examples/server.js",coveralls:"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",fix:"eslint --fix lib/**/*.js"},repository:{type:"git",url:"https://github.com/axios/axios.git"},keywords:["xhr","http","ajax","promise","node"],author:"Matt Zabriskie",license:"MIT",bugs:{url:"https://github.com/axios/axios/issues"},homepage:"https://axios-http.com",devDependencies:{coveralls:"^3.0.0","es6-promise":"^4.2.4",grunt:"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1",karma:"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2",minimist:"^1.2.0",mocha:"^8.2.1",sinon:"^4.5.0","terser-webpack-plugin":"^4.2.3",typescript:"^4.0.5","url-search-params":"^0.10.0",webpack:"^4.44.2","webpack-dev-server":"^3.11.0"},browser:{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},jsdelivr:"dist/axios.min.js",unpkg:"dist/axios.min.js",typings:"./index.d.ts",dependencies:{"follow-redirects":"^1.14.0"},bundlesize:[{path:"./dist/axios.min.js",threshold:"5kB"}]},ye={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){ye[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var ve={},be=ge.version.split(".");function Ee(e,t){for(var r=t?t.split("."):be,n=e.split("."),o=0;o<3;o++){if(r[o]>n[o])return!0;if(r[o]<n[o])return!1}return!1}ye.transitional=function(e,t,r){var n=t&&Ee(t);function o(e,t){return"[Axios v"+ge.version+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,i,a){if(!1===e)throw new Error(o(i," has been removed in "+t));return n&&!ve[i]&&(ve[i]=!0,console.warn(o(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,i,a)}};var Se=T,we=j,Te=R,xe=function(e){return pe(e),e.headers=e.headers||{},e.data=le.call(e,e.data,e.headers,e.transformRequest),e.headers=ue.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),ue.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||fe.adapter)(e).then((function(t){return pe(e),t.data=le.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return de(t)||(pe(e),t&&t.response&&(t.response.data=le.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},Ae=me,je={isOlderVersion:Ee,assertOptions:function(e,t,r){if("object"!=typeof e)throw new TypeError("options must be an object");for(var n=Object.keys(e),o=n.length;o-- >0;){var i=n[o],a=t[i];if(a){var s=e[i],c=void 0===s||a(s,i,e);if(!0!==c)throw new TypeError("option "+i+" must be "+c)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:ye},Oe=je.validators;function Pe(e){this.defaults=e,this.interceptors={request:new Te,response:new Te}}Pe.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=Ae(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&je.assertOptions(t,{silentJSONParsing:Oe.transitional(Oe.boolean,"1.0.0"),forcedJSONParsing:Oe.transitional(Oe.boolean,"1.0.0"),clarifyTimeoutError:Oe.transitional(Oe.boolean,"1.0.0")},!1);var r=[],n=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(n=n&&t.synchronous,r.unshift(t.fulfilled,t.rejected))}));var o,i=[];if(this.interceptors.response.forEach((function(e){i.push(e.fulfilled,e.rejected)})),!n){var a=[xe,void 0];for(Array.prototype.unshift.apply(a,r),a=a.concat(i),o=Promise.resolve(e);a.length;)o=o.then(a.shift(),a.shift());return o}for(var s=e;r.length;){var c=r.shift(),u=r.shift();try{s=c(s)}catch(e){u(e);break}}try{o=xe(s)}catch(e){return Promise.reject(e)}for(;i.length;)o=o.then(i.shift(),i.shift());return o},Pe.prototype.getUri=function(e){return e=Ae(this.defaults,e),we(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},Se.forEach(["delete","get","head","options"],(function(e){Pe.prototype[e]=function(t,r){return this.request(Ae(r||{},{method:e,url:t,data:(r||{}).data}))}})),Se.forEach(["post","put","patch"],(function(e){Pe.prototype[e]=function(t,r,n){return this.request(Ae(n||{},{method:e,url:t,data:r}))}}));var Re=Pe;function Ie(e){this.message=e}Ie.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},Ie.prototype.__CANCEL__=!0;var Ne=Ie,Ce=Ne;function De(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new Ce(e),t(r.reason))}))}De.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},De.source=function(){var e;return{token:new De((function(t){e=t})),cancel:e}};var Le=De,Ue=T,ke=h,Me=Re,qe=me;function Be(e){var t=new Me(e),r=ke(Me.prototype.request,t);return Ue.extend(r,Me.prototype,t),Ue.extend(r,t),r}var _e=Be(ie);_e.Axios=Me,_e.create=function(e){return Be(qe(_e.defaults,e))},_e.Cancel=Ne,_e.CancelToken=Le,_e.isCancel=ce,_e.all=function(e){return Promise.all(e)},_e.spread=function(e){return function(t){return e.apply(null,t)}},_e.isAxiosError=function(e){return"object"==typeof e&&!0===e.isAxiosError},p.exports=_e,p.exports.default=_e;var Fe,Ve=p.exports,$e=new Uint8Array(16);function Je(){if(!Fe&&!(Fe="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Fe($e)}var He=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function ze(e){return"string"==typeof e&&He.test(e)}for(var Ge=[],Xe=0;Xe<256;++Xe)Ge.push((Xe+256).toString(16).substr(1));function We(e,t,r){var n=(e=e||{}).random||(e.rng||Je)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var o=0;o<16;++o)t[r+o]=n[o];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(Ge[e[t+0]]+Ge[e[t+1]]+Ge[e[t+2]]+Ge[e[t+3]]+"-"+Ge[e[t+4]]+Ge[e[t+5]]+"-"+Ge[e[t+6]]+Ge[e[t+7]]+"-"+Ge[e[t+8]]+Ge[e[t+9]]+"-"+Ge[e[t+10]]+Ge[e[t+11]]+Ge[e[t+12]]+Ge[e[t+13]]+Ge[e[t+14]]+Ge[e[t+15]]).toLowerCase();if(!ze(r))throw TypeError("Stringified UUID is invalid");return r}(n)}function Ye(e){return isNaN(Number(e))?e:{scaled:Number(e)}}class Ze{static get instance(){return Ze._instance||(Ze._instance=new Ze),Ze._instance}static clearInstance(){Ze._instance=null}static get xapi(){return Ze._xapi}constructor(){if(this.launchParameters=this.getLaunchParametersFromLMS(),!this.launchParameters.fetch)throw Error("Unable to construct, no `fetch` parameter found in URL.");if(!this.launchParameters.endpoint)throw Error("Unable to construct, no `endpoint` parameter found in URL");if(!this.launchParameters.actor)throw Error("Unable to construct, no `actor` parameter found in URL.");if(!this.launchParameters.activityId)throw Error("Unable to construct, no `activityId` parameter found in URL.");if(!this.launchParameters.registration)throw Error("Unable to construct, no `registration` parameter found in URL.")}static get isCmiAvailable(){if(!window||"object"!=typeof window)return!1;if(!window.location||"string"!=typeof window.location.search)return!1;const e=new URLSearchParams(window.location.search);return Boolean(e.get("fetch")&&e.get("endpoint")&&e.get("actor")&&e.get("registration")&&e.get("activityId"))}get isAuthenticated(){return Boolean(Ze._xapi)}getLaunchParameters(){return this.launchParameters}getLaunchData(){return this.launchData}getLearnerPreferences(){return this.learnerPreferences}initialize(){return this.getAuthTokenFromLMS(this.launchParameters.fetch).then((e=>{const r=e.data["auth-token"];return Ze._xapi=new t(this.launchParameters.endpoint,"Basic "+r),this.getLaunchDataFromLMS()})).then((e=>{this.launchData=e.data})).then((()=>this.getLearnerPreferencesFromLMS())).then((e=>{this.learnerPreferences=e.data||{}})).then((()=>(this.initialisedDate=new Date,this.sendCmi5DefinedStatement({verb:n.INITIALIZED}))))}complete(e){return"Normal"!==this.launchData.launchMode?Promise.reject(new Error("Can only send COMPLETED when launchMode is 'Normal'")):this.sendCmi5DefinedStatement({verb:n.COMPLETED,result:{completion:!0,duration:t.calculateISO8601Duration(this.initialisedDate,new Date)},context:{contextActivities:{category:[r.MOVE_ON]}}},e)}pass(e,o){if("Normal"!==this.launchData.launchMode)return Promise.reject(new Error("Can only send PASSED when launchMode is 'Normal'"));const i=Ye(e);if(this.launchData.masteryScore&&(!i||isNaN(Number(i.scaled))||i.scaled<this.launchData.masteryScore))return Promise.reject(new Error("Learner has not met Mastery Score"));const[a,s]=(c=o)&&"Activity"===c.objectType&&"string"==typeof c.id&&c.definition&&"object"==typeof c.definition&&"http://adlnet.gov/expapi/activities/objective"===c.definition.type?[o,void 0]:[o?o.objectiveActivity:void 0,o];var c;return this.sendCmi5DefinedStatement({verb:n.PASSED,result:{...i?{score:i}:{},success:!0,duration:t.calculateISO8601Duration(this.initialisedDate,new Date)},context:{contextActivities:{category:[r.MOVE_ON],...a?{parent:[a]}:{}},...this.launchData.masteryScore?{extensions:{"https://w3id.org/xapi/cmi5/context/extensions/masteryscore":this.launchData.masteryScore}}:{}}},s)}fail(e,o){if("Normal"!==this.launchData.launchMode)return Promise.reject(new Error("Can only send FAILED when launchMode is 'Normal'"));const i=Ye(e);return this.sendCmi5DefinedStatement({verb:n.FAILED,result:{...i?{score:i}:{},success:!1,duration:t.calculateISO8601Duration(this.initialisedDate,new Date)},context:{contextActivities:{category:[r.MOVE_ON]},...this.launchData.masteryScore?{extensions:{"https://w3id.org/xapi/cmi5/context/extensions/masteryscore":this.launchData.masteryScore}}:{}}},o)}terminate(){return this.sendCmi5DefinedStatement({verb:n.TERMINATED,result:{duration:t.calculateISO8601Duration(this.initialisedDate,new Date)}})}progress(e){return this.sendCmi5AllowedStatement({verb:t.Verbs.PROGRESSED,object:{objectType:"Activity",id:this.launchParameters.activityId},result:{extensions:{"https://w3id.org/xapi/cmi5/result/extensions/progress":e}}})}interactionTrueFalse(e,t,r,n,o,i,a,s,c){return this.interaction(e,t,r.toString(),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"true-false",...void 0!==n?{correctResponsesPattern:n?["true"]:["false"]}:{},...o?{name:o}:{},...i?{description:i}:{}},a,s,c)}interactionChoice(e,t,r,n,o,i,a,s,c,u){return this.interaction(e,t,r.join("[,]"),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"choice",...n?{correctResponsesPattern:[n.join("[,]")]}:{},...o?{choices:o}:{},...i?{name:i}:{},...a?{description:a}:{}},s,c,u)}interactionFillIn(e,t,r,n,o,i,a,s,c){return this.interaction(e,t,r.join("[,]"),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"fill-in",...n?{correctResponsesPattern:[n.join("[,]")]}:{},...o?{name:o}:{},...i?{description:i}:{}},a,s,c)}interactionLongFillIn(e,t,r,n,o,i,a,s,c){return this.interaction(e,t,r.join("[,]"),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"long-fill-in",...n?{correctResponsesPattern:[n.join("[,]")]}:{},...o?{name:o}:{},...i?{description:i}:{}},a,s,c)}interactionLikert(e,t,r,n,o,i,a,s,c,u){return this.interaction(e,t,r,{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"likert",...n?{correctResponsesPattern:[n]}:{},...o?{scale:o}:{},...i?{name:i}:{},...a?{description:a}:{}},s,c,u)}interactionMatching(e,t,r,n,o,i,a,s,c,u,l){return this.interaction(e,t,Object.keys(r).map((e=>`${e}[.]${r[e]}`)).join("[,]"),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"matching",...n?{correctResponsesPattern:[Object.keys(n).map((e=>`${e}[.]${n[e]}`)).join("[,]")]}:{},...o?{source:o}:{},...i?{target:i}:{},...a?{name:a}:{},...s?{description:s}:{}},c,u,l)}interactionPerformance(e,t,r,n,o,i,a,s,c,u){return this.interaction(e,t,Object.keys(r).map((e=>`${e}[.]${r[e]}`)).join("[,]"),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"performance",...n?{correctResponsesPattern:[Object.keys(n).map((e=>{const t=n[e].exact?n[e].exact.toString():"",r=n[e].min?n[e].min.toString():"",o=n[e].max?n[e].max.toString():"";return`${e}[.]${t||r+":"+o}`})).join("[,]")]}:{},...o?{steps:o}:{},...i?{name:i}:{},...a?{description:a}:{}},s,c,u)}interactionSequencing(e,t,r,n,o,i,a,s,c,u){return this.interaction(e,t,r.join("[,]"),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"sequencing",...n?{correctResponsesPattern:[n.join("[,]")]}:{},...o?{choices:o}:{},...i?{name:i}:{},...a?{description:a}:{}},s,c,u)}interactionNumeric(e,t,r,n,o,i,a,s,c){return this.interaction(e,t,r.toString(),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"numeric",...n?{correctResponsesPattern:[""+(n.exact?n.exact:n.min+":"+n.max)]}:{},...o?{name:o}:{},...i?{description:i}:{}},a,s,c)}interactionOther(e,t,r,n,o,i,a,s,c){return this.interaction(e,t,r,{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"other",...n?{correctResponsesPattern:[n]}:{},...o?{name:o}:{},...i?{description:i}:{}},a,s,c)}interaction(e,r,n,o,i,a,s){return this.sendCmi5AllowedStatement({verb:t.Verbs.ANSWERED,result:{response:n,...a?{duration:t.calculateISO8601Duration(a.start,a.end)}:{},..."boolean"==typeof i?{success:i}:{}},object:{objectType:"Activity",id:`${this.launchParameters.activityId}/test/${e}/question/${r}`,definition:o},...s?{context:{contextActivities:{parent:[s]}}}:{}})}setResultScore(e,t){return{...t,result:{...t.result||{},score:e}}}async moveOn(e){var t;let r=e;if("Normal"!==this.launchData.launchMode)return Promise.reject(new Error("Can only send FAILED when launchMode is 'Normal'"));const n=[];if(null!==(t=r)&&void 0!==t&&t.score){var o;const e=Ye(null===(o=r)||void 0===o?void 0:o.score);if(this.launchData.masteryScore)e.scaled>=this.launchData.masteryScore?this.appendStatementIds(await this.pass(e,r),n):this.appendStatementIds(await this.fail(e,r),n);else{var i;const t=t=>this.setResultScore(e,t),n=null===(i=r)||void 0===i?void 0:i.transform;r={...r||{},transform:"function"==typeof n?e=>n(t(e)):e=>t(e)}}}return this.appendStatementIds(await this.complete(r),n),null!=e&&e.disableSendTerminated||this.appendStatementIds(await this.terminate(),n),n}appendStatementIds(e,t){t.push.apply(t,e.data)}getLaunchParametersFromLMS(){return t.getSearchQueryParamsAsObject(window.location.href)}getAuthTokenFromLMS(e){return Ve.post(e)}getLaunchDataFromLMS(){return Ze._xapi.getState(this.launchParameters.actor,this.launchParameters.activityId,"LMS.LaunchData",this.launchParameters.registration)}getLearnerPreferencesFromLMS(){return Ze._xapi.getAgentProfile(this.launchParameters.actor,"cmi5LearnerPreferences").then((e=>e.data),(()=>({})))}sendCmi5DefinedStatement(e,t){const n={object:{objectType:"Activity",id:this.launchParameters.activityId},context:{contextActivities:{category:[r.CMI5]}}},o=f.all([n,e]);return this.sendCmi5AllowedStatement(o,t)}sendCmi5AllowedStatement(e,t){const r=We(),n=this.launchParameters.actor,o=(new Date).toISOString(),i=Object.assign({},this.launchData.contextTemplate);i.registration=this.launchParameters.registration;const a={id:r,actor:n,timestamp:o,context:i},s=f.all([a,e]),c=t&&"function"==typeof t.transform?t.transform(s):s;return Ze._xapi.sendStatement(c)}}Ze._instance=null,Ze._xapi=null;export{Ze as default};

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Cmi5=t()}(this,(function(){"use strict";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var e={exports:{}};!function(e,t){e.exports=function(){let e,t;!function(e){e.SIGNATURE="http://adlnet.gov/expapi/attachments/signature",e.CERTIFICATE_OF_COMPLETION="http://id.tincanapi.com/attachment/certificate-of-completion",e.CONTRACT="http://id.tincanapi.com/attachment/contract",e.SUPPORTING_MEDIA="http://id.tincanapi.com/attachment/supporting_media"}(e||(e={})),function(e){e.ABOUT="about",e.AGENTS="agents",e.ACTIVITIES="activities",e.ACTIVITY_PROFILE="activities/profile",e.STATE="activities/state",e.AGENT_PROFILE="agents/profile",e.STATEMENT="statements"}(t||(t={}));class n{}n.INITIALIZED={id:"http://adlnet.gov/expapi/verbs/initialized",display:{"en-US":"initialized"}},n.TERMINATED={id:"http://adlnet.gov/expapi/verbs/terminated",display:{"en-US":"terminated"}},n.SUSPENDED={id:"http://adlnet.gov/expapi/verbs/suspended",display:{"en-US":"suspended"}},n.RESUMED={id:"http://adlnet.gov/expapi/verbs/resumed",display:{"en-US":"resumed"}},n.PASSED={id:"http://adlnet.gov/expapi/verbs/passed",display:{"en-US":"passed"}},n.FAILED={id:"http://adlnet.gov/expapi/verbs/failed",display:{"en-US":"failed"}},n.SCORED={id:"http://adlnet.gov/expapi/verbs/scored",display:{"en-US":"scored"}},n.COMPLETED={id:"http://adlnet.gov/expapi/verbs/completed",display:{"en-US":"completed"}},n.RESPONDED={id:"http://adlnet.gov/expapi/verbs/responded",display:{"en-US":"responded"}},n.COMMENTED={id:"http://adlnet.gov/expapi/verbs/commented",display:{"en-US":"commented"}},n.VOIDED={id:"http://adlnet.gov/expapi/verbs/voided",display:{"en-US":"voided"}},n.PROGRESSED={id:"http://adlnet.gov/expapi/verbs/progressed",display:{"en-US":"progressed"}},n.ANSWERED={id:"http://adlnet.gov/expapi/verbs/answered",display:{"en-US":"answered"}};const r="\r\n";function o(e,t){const n=[],o=(Math.random()+" ").substring(2,10)+(Math.random()+" ").substring(2,10),i={"Content-Type":"multipart/mixed; boundary="+o};n.push(function(e,t){return["--"+t,"Content-Type: application/json",'Content-Disposition: form-data; name="statement"',"",JSON.stringify(e)].join(r)+r}(e,o));const a=Array.isArray(e)?e.reduce(((e,t)=>e.concat(t.attachments)),[]):e.attachments;return t.forEach(((e,t)=>{const i=a[t];n.push(function(e,t){return["--"+t,"Content-Type: "+e.contentType,"Content-Transfer-Encoding: binary","X-Experience-API-Hash: "+e.sha2].join(r)+r+r}(i,o)),n.push(e)})),n.push(`\r\n--${o}--\r\n`),{header:i,blob:new Blob(n)}}function i(e){const t={},n=e.split("?")[1]||null;return n?(new URLSearchParams(n).forEach(((e,n)=>{try{t[n]=JSON.parse(e)}catch{t[n]=e}var r;"actor"===n&&(t.actor=(r=t.actor,["name","mbox","account"].forEach((e=>{if(Array.isArray(r[e]))switch(e){case"account":r[e]={...r.account[0].accountServiceHomePage?{homePage:r.account[0].accountServiceHomePage}:null,...r.account[0].accountName?{name:r.account[0].accountName}:null};break;default:r[e]=r[e][0]}})),r))})),t):t}const a=3600;var s=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}},c=Object.prototype.toString;function u(e){return"[object Array]"===c.call(e)}function f(e){return void 0===e}function d(e){return null!==e&&"object"==typeof e}function p(e){if("[object Object]"!==c.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function l(e){return"[object Function]"===c.call(e)}function h(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),u(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}var m={isArray:u,isArrayBuffer:function(e){return"[object ArrayBuffer]"===c.call(e)},isBuffer:function(e){return null!==e&&!f(e)&&null!==e.constructor&&!f(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:d,isPlainObject:p,isUndefined:f,isDate:function(e){return"[object Date]"===c.call(e)},isFile:function(e){return"[object File]"===c.call(e)},isBlob:function(e){return"[object Blob]"===c.call(e)},isFunction:l,isStream:function(e){return d(e)&&l(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:h,merge:function e(){var t={};function n(n,r){p(t[r])&&p(n)?t[r]=e(t[r],n):p(n)?t[r]=e({},n):u(n)?t[r]=n.slice():t[r]=n}for(var r=0,o=arguments.length;r<o;r++)h(arguments[r],n);return t},extend:function(e,t,n){return h(t,(function(t,r){e[r]=n&&"function"==typeof t?s(t,n):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}};function g(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var y=function(e,t,n){if(!t)return e;var r;if(n)r=n(t);else if(m.isURLSearchParams(t))r=t.toString();else{var o=[];m.forEach(t,(function(e,t){null!=e&&(m.isArray(e)?t+="[]":e=[e],m.forEach(e,(function(e){m.isDate(e)?e=e.toISOString():m.isObject(e)&&(e=JSON.stringify(e)),o.push(g(t)+"="+g(e))})))})),r=o.join("&")}if(r){var i=e.indexOf("#");-1!==i&&(e=e.slice(0,i)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e};function v(){this.handlers=[]}v.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},v.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},v.prototype.forEach=function(e){m.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var E=v,S=function(e,t,n){return m.forEach(n,(function(n){e=n(e,t)})),e},b=function(e){return!(!e||!e.__CANCEL__)},T=function(e,t){m.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))},w=function(e,t,n,r,o){return function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}(new Error(e),t,n,r,o)},A=m.isStandardBrowserEnv()?{write:function(e,t,n,r,o,i){var a=[];a.push(e+"="+encodeURIComponent(t)),m.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),m.isString(r)&&a.push("path="+r),m.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},x=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],R=m.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=r(window.location.href),function(t){var n=m.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0},P=function(e){return new Promise((function(t,n){var r=e.data,o=e.headers;m.isFormData(r)&&delete o["Content-Type"];var i=new XMLHttpRequest;if(e.auth){var a=e.auth.username||"",s=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.Authorization="Basic "+btoa(a+":"+s)}var c,u,f=(c=e.baseURL,u=e.url,c&&!/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(u)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(c,u):u);if(i.open(e.method.toUpperCase(),y(f,e.params,e.paramsSerializer),!0),i.timeout=e.timeout,i.onreadystatechange=function(){if(i&&4===i.readyState&&(0!==i.status||i.responseURL&&0===i.responseURL.indexOf("file:"))){var r,o,a,s,c,u="getAllResponseHeaders"in i?(r=i.getAllResponseHeaders(),c={},r?(m.forEach(r.split("\n"),(function(e){if(s=e.indexOf(":"),o=m.trim(e.substr(0,s)).toLowerCase(),a=m.trim(e.substr(s+1)),o){if(c[o]&&x.indexOf(o)>=0)return;c[o]="set-cookie"===o?(c[o]?c[o]:[]).concat([a]):c[o]?c[o]+", "+a:a}})),c):c):null,f={data:e.responseType&&"text"!==e.responseType?i.response:i.responseText,status:i.status,statusText:i.statusText,headers:u,config:e,request:i};!function(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(w("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}(t,n,f),i=null}},i.onabort=function(){i&&(n(w("Request aborted",e,"ECONNABORTED",i)),i=null)},i.onerror=function(){n(w("Network Error",e,null,i)),i=null},i.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(w(t,e,"ECONNABORTED",i)),i=null},m.isStandardBrowserEnv()){var d=(e.withCredentials||R(f))&&e.xsrfCookieName?A.read(e.xsrfCookieName):void 0;d&&(o[e.xsrfHeaderName]=d)}if("setRequestHeader"in i&&m.forEach(o,(function(e,t){void 0===r&&"content-type"===t.toLowerCase()?delete o[t]:i.setRequestHeader(t,e)})),m.isUndefined(e.withCredentials)||(i.withCredentials=!!e.withCredentials),e.responseType)try{i.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&i.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&i.upload&&i.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){i&&(i.abort(),n(e),i=null)})),r||(r=null),i.send(r)}))},O={"Content-Type":"application/x-www-form-urlencoded"};function I(e,t){!m.isUndefined(e)&&m.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var j,C={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(j=P),j),transformRequest:[function(e,t){return T(t,"Accept"),T(t,"Content-Type"),m.isFormData(e)||m.isArrayBuffer(e)||m.isBuffer(e)||m.isStream(e)||m.isFile(e)||m.isBlob(e)?e:m.isArrayBufferView(e)?e.buffer:m.isURLSearchParams(e)?(I(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):m.isObject(e)?(I(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};m.forEach(["delete","get","head"],(function(e){C.headers[e]={}})),m.forEach(["post","put","patch"],(function(e){C.headers[e]=m.merge(O)}));var D=C;function L(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var N=function(e){return L(e),e.headers=e.headers||{},e.data=S(e.data,e.headers,e.transformRequest),e.headers=m.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),m.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||D.adapter)(e).then((function(t){return L(e),t.data=S(t.data,t.headers,e.transformResponse),t}),(function(t){return b(t)||(L(e),t&&t.response&&(t.response.data=S(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},U=function(e,t){t=t||{};var n={},r=["url","method","data"],o=["headers","auth","proxy","params"],i=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function s(e,t){return m.isPlainObject(e)&&m.isPlainObject(t)?m.merge(e,t):m.isPlainObject(t)?m.merge({},t):m.isArray(t)?t.slice():t}function c(r){m.isUndefined(t[r])?m.isUndefined(e[r])||(n[r]=s(void 0,e[r])):n[r]=s(e[r],t[r])}m.forEach(r,(function(e){m.isUndefined(t[e])||(n[e]=s(void 0,t[e]))})),m.forEach(o,c),m.forEach(i,(function(r){m.isUndefined(t[r])?m.isUndefined(e[r])||(n[r]=s(void 0,e[r])):n[r]=s(void 0,t[r])})),m.forEach(a,(function(r){r in t?n[r]=s(e[r],t[r]):r in e&&(n[r]=s(void 0,e[r]))}));var u=r.concat(o).concat(i).concat(a),f=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===u.indexOf(e)}));return m.forEach(f,c),n};function M(e){this.defaults=e,this.interceptors={request:new E,response:new E}}M.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=U(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[N,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)n=n.then(t.shift(),t.shift());return n},M.prototype.getUri=function(e){return e=U(this.defaults,e),y(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},m.forEach(["delete","get","head","options"],(function(e){M.prototype[e]=function(t,n){return this.request(U(n||{},{method:e,url:t,data:(n||{}).data}))}})),m.forEach(["post","put","patch"],(function(e){M.prototype[e]=function(t,n,r){return this.request(U(r||{},{method:e,url:t,data:n}))}}));var q=M;function B(e){this.message=e}B.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},B.prototype.__CANCEL__=!0;var F=B;function k(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new F(e),t(n.reason))}))}k.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},k.source=function(){var e;return{token:new k((function(t){e=t})),cancel:e}};var _=k;function V(e){var t=new q(e),n=s(q.prototype.request,t);return m.extend(n,q.prototype,t),m.extend(n,t),n}var $=V(D);$.Axios=q,$.create=function(e){return V(U($.defaults,e))},$.Cancel=F,$.CancelToken=_,$.isCancel=b,$.all=function(e){return Promise.all(e)},$.spread=function(e){return function(t){return e.apply(null,t)}},$.isAxiosError=function(e){return"object"==typeof e&&!0===e.isAxiosError};var H=$,z=$;H.default=z;var G=H;function X(e,t){const n=`${e}:${t}`;if("undefined"!=typeof window&&window.btoa)return"Basic "+btoa(n);if("undefined"!=typeof Buffer)return"Basic "+Buffer.from(n,"binary").toString("base64");throw new Error("Environment does not support base64 conversion.")}class J{constructor(e,t,n="1.0.3"){this.endpoint=e.endsWith("/")?e:e+"/",this.headers={"X-Experience-API-Version":n,"Content-Type":"application/json",Authorization:t||X("","")}}getAbout(){return this.requestResource(t.ABOUT)}getAgent(e){return this.requestResource(t.AGENTS,{agent:e})}getStatement(e){return this.requestResource(t.STATEMENT,e)}getVoidedStatement(e){return this.requestResource(t.STATEMENT,e)}getStatements(e){return this.requestResource(t.STATEMENT,e)}getMoreStatements(e){const t=new URL(this.endpoint),n=`${t.protocol}//${t.host}${e}`;return this.requestURL(n)}sendStatement(e,n){if(null==n?void 0:n.length){const r=o(e,n);return this.requestResource(t.STATEMENT,{},{method:"POST",headers:r.header,data:r.blob})}return this.requestResource(t.STATEMENT,{},{method:"POST",data:e})}sendStatements(e,n){if(null==n?void 0:n.length){const r=o(e,n);return this.requestResource(t.STATEMENT,{},{method:"POST",headers:r.header,data:r.blob})}return this.requestResource(t.STATEMENT,{},{method:"POST",data:e})}voidStatement(e,t){const r={actor:e,verb:n.VOIDED,object:{objectType:"StatementRef",id:t}};return this.sendStatement(r)}voidStatements(e,t){const r=t.map((t=>({actor:e,verb:n.VOIDED,object:{objectType:"StatementRef",id:t}})));return this.sendStatements(r)}createState(e,n,r,o,i,a,s){const c={};return a&&(c[s]=a),this.requestResource(t.STATE,{agent:e,activityId:n,stateId:r,...i?{registration:i}:{}},{method:"POST",data:o,headers:c})}setState(e,n,r,o,i,a,s,c){const u={};return a&&(u[s]=a),c&&(u["Content-Type"]=c),this.requestResource(t.STATE,{agent:e,activityId:n,stateId:r,...i?{registration:i}:{}},{method:"PUT",data:o,headers:u})}getStates(e,n,r,o){return this.requestResource(t.STATE,{agent:e,activityId:n,...r?{registration:r}:{},...o?{since:o}:{}})}getState(e,n,r,o){return this.requestResource(t.STATE,{agent:e,activityId:n,stateId:r,...o?{registration:o}:{}})}deleteState(e,n,r,o,i){const a={};return i&&(a["If-Match"]=i),this.requestResource(t.STATE,{agent:e,activityId:n,stateId:r,...o?{registration:o}:{}},{method:"DELETE",headers:a})}deleteStates(e,n,r,o){const i={};return o&&(i["If-Match"]=o),this.requestResource(t.STATE,{agent:e,activityId:n,...r?{registration:r}:{}},{method:"DELETE",headers:i})}getActivity(e){return this.requestResource(t.ACTIVITIES,{activityId:e})}createActivityProfile(e,n,r,o,i){const a={};return o&&(a[i]=o),this.requestResource(t.ACTIVITY_PROFILE,{activityId:e,profileId:n},{method:"POST",data:r,headers:a})}setActivityProfile(e,n,r,o,i,a){const s={};return s[i]=o,a&&(s["Content-Type"]=a),this.requestResource(t.ACTIVITY_PROFILE,{activityId:e,profileId:n},{method:"PUT",data:r,headers:s})}getActivityProfiles(e,n){return this.requestResource(t.ACTIVITY_PROFILE,{activityId:e,...n?{since:n}:{}})}getActivityProfile(e,n){return this.requestResource(t.ACTIVITY_PROFILE,{activityId:e,profileId:n})}deleteActivityProfile(e,n,r){const o={};return r&&(o["If-Match"]=r),this.requestResource(t.ACTIVITY_PROFILE,{activityId:e,profileId:n},{method:"DELETE",headers:o})}createAgentProfile(e,n,r,o,i){const a={};return o&&(a[i]=o),this.requestResource(t.AGENT_PROFILE,{agent:e,profileId:n},{method:"POST",data:r,headers:a})}setAgentProfile(e,n,r,o,i,a){const s={};return s[i]=o,a&&(s["Content-Type"]=a),this.requestResource(t.AGENT_PROFILE,{agent:e,profileId:n},{method:"PUT",data:r,headers:s})}getAgentProfiles(e,n){return this.requestResource(t.AGENT_PROFILE,{agent:e,...n?{since:n}:{}})}getAgentProfile(e,n){return this.requestResource(t.AGENT_PROFILE,{agent:e,profileId:n})}deleteAgentProfile(e,n,r){const o={};return r&&(o["If-Match"]=r),this.requestResource(t.AGENT_PROFILE,{agent:e,profileId:n},{method:"DELETE",headers:o})}requestResource(e,t={},n){const r=this.generateURL(e,t);return this.requestURL(r,n)}requestURL(e,t){return G.request({method:(null==t?void 0:t.method)||"GET",url:e,headers:{...this.headers,...null==t?void 0:t.headers},data:null==t?void 0:t.data}).then((e=>{const t=e.headers["content-type"];return e.data&&t&&-1!==t.indexOf("multipart/mixed")&&(e.data=function(e){const t=e.trim().split(r)[0].trim(),n=e.split(t).map((e=>e.trim())).filter((e=>""!==e&&"--"!==e)),o=[];for(let e=0;e<n.length;e++){const t={},i=n[e].split(r);for(let e=0;e<i.length-2;e++){const n=i[e].split(":");t[n[0]]=n[1]}let a=i[i.length-1];t["Content-Type"].indexOf("application/json")>-1&&(a=JSON.parse(a)),o.push(a)}return o}(e.data)),e}))}generateURL(e,t){const n=Object.keys(t).map((e=>{let n="agent"===e?JSON.stringify(t[e]):t[e];return n=encodeURIComponent(n),`${e}=${n}`})).join("&");return`${this.endpoint}${e}${n?"?"+n:""}`}}return J.default=J,J.AttachmentUsages=e,J.Verbs=n,J.calculateISO8601Duration=function(e,t){const n=(t.getTime()-e.getTime())/1e3,r=Math.floor(n/86400),o=n%86400,i=Math.floor(o/a),s=o%a,c=Math.floor(s/60),u=s%60,f=Math.ceil(u);return`P${r?r+"D":""}T${i?i+"H":""}${c?c+"M":""}${f?f+"S":""}`},J.getSearchQueryParamsAsObject=i,J.getXAPILaunchData=function(){const e=i(location.search);if(!e.xAPILaunchService)return Promise.reject(new Error("xAPILaunchService parameter not found in URL."));const t=new URL(e.xAPILaunchService);return t.pathname+="launch/"+e.xAPILaunchKey,G({method:"POST",url:t.toString()}).then((e=>e.data))},J.getTinCanLaunchData=function(){return i(location.search)},J.toBasicAuth=X,J}()}(e);var t=e.exports;class n{}n.MOVE_ON={id:"https://w3id.org/xapi/cmi5/context/categories/moveon"},n.CMI5={id:"https://w3id.org/xapi/cmi5/context/categories/cmi5"};class r{}r.INITIALIZED=t.Verbs.INITIALIZED,r.COMPLETED=t.Verbs.COMPLETED,r.PASSED=t.Verbs.PASSED,r.FAILED=t.Verbs.FAILED,r.TERMINATED=t.Verbs.TERMINATED;var o=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===i}(e)}(e)};var i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function a(e,t){return!1!==t.clone&&t.isMergeableObject(e)?d((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function s(e,t,n){return e.concat(t).map((function(e){return a(e,n)}))}function c(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function u(e,t){try{return t in e}catch(e){return!1}}function f(e,t,n){var r={};return n.isMergeableObject(e)&&c(e).forEach((function(t){r[t]=a(e[t],n)})),c(t).forEach((function(o){(function(e,t){return u(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(u(e,o)&&n.isMergeableObject(t[o])?r[o]=function(e,t){if(!t.customMerge)return d;var n=t.customMerge(e);return"function"==typeof n?n:d}(o,n)(e[o],t[o],n):r[o]=a(t[o],n))})),r}function d(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||s,n.isMergeableObject=n.isMergeableObject||o,n.cloneUnlessOtherwiseSpecified=a;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):f(e,t,n):a(t,n)}d.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return d(e,n,t)}),{})};var p=d,l={exports:{}},h=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}},m=h,g=Object.prototype.toString;function y(e){return"[object Array]"===g.call(e)}function v(e){return void 0===e}function E(e){return null!==e&&"object"==typeof e}function S(e){if("[object Object]"!==g.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function b(e){return"[object Function]"===g.call(e)}function T(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),y(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}var w={isArray:y,isArrayBuffer:function(e){return"[object ArrayBuffer]"===g.call(e)},isBuffer:function(e){return null!==e&&!v(e)&&null!==e.constructor&&!v(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:E,isPlainObject:S,isUndefined:v,isDate:function(e){return"[object Date]"===g.call(e)},isFile:function(e){return"[object File]"===g.call(e)},isBlob:function(e){return"[object Blob]"===g.call(e)},isFunction:b,isStream:function(e){return E(e)&&b(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:T,merge:function e(){var t={};function n(n,r){S(t[r])&&S(n)?t[r]=e(t[r],n):S(n)?t[r]=e({},n):y(n)?t[r]=n.slice():t[r]=n}for(var r=0,o=arguments.length;r<o;r++)T(arguments[r],n);return t},extend:function(e,t,n){return T(t,(function(t,r){e[r]=n&&"function"==typeof t?m(t,n):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}},A=w;function x(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var R=function(e,t,n){if(!t)return e;var r;if(n)r=n(t);else if(A.isURLSearchParams(t))r=t.toString();else{var o=[];A.forEach(t,(function(e,t){null!=e&&(A.isArray(e)?t+="[]":e=[e],A.forEach(e,(function(e){A.isDate(e)?e=e.toISOString():A.isObject(e)&&(e=JSON.stringify(e)),o.push(x(t)+"="+x(e))})))})),r=o.join("&")}if(r){var i=e.indexOf("#");-1!==i&&(e=e.slice(0,i)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e},P=w;function O(){this.handlers=[]}O.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},O.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},O.prototype.forEach=function(e){P.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var I=O,j=w,C=function(e){return!(!e||!e.__CANCEL__)},D=w,L=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e},N=function(e,t,n,r,o){var i=new Error(e);return L(i,t,n,r,o)},U=N,M=w,q=M.isStandardBrowserEnv()?{write:function(e,t,n,r,o,i){var a=[];a.push(e+"="+encodeURIComponent(t)),M.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),M.isString(r)&&a.push("path="+r),M.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},B=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)},F=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},k=w,_=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],V=w,$=V.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=r(window.location.href),function(t){var n=V.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0},H=w,z=function(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(U("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)},G=q,X=R,J=function(e,t){return e&&!B(t)?F(e,t):t},Y=function(e){var t,n,r,o={};return e?(k.forEach(e.split("\n"),(function(e){if(r=e.indexOf(":"),t=k.trim(e.substr(0,r)).toLowerCase(),n=k.trim(e.substr(r+1)),t){if(o[t]&&_.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([n]):o[t]?o[t]+", "+n:n}})),o):o},K=$,Z=N,W=function(e){return new Promise((function(t,n){var r=e.data,o=e.headers;H.isFormData(r)&&delete o["Content-Type"];var i=new XMLHttpRequest;if(e.auth){var a=e.auth.username||"",s=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.Authorization="Basic "+btoa(a+":"+s)}var c=J(e.baseURL,e.url);if(i.open(e.method.toUpperCase(),X(c,e.params,e.paramsSerializer),!0),i.timeout=e.timeout,i.onreadystatechange=function(){if(i&&4===i.readyState&&(0!==i.status||i.responseURL&&0===i.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in i?Y(i.getAllResponseHeaders()):null,o={data:e.responseType&&"text"!==e.responseType?i.response:i.responseText,status:i.status,statusText:i.statusText,headers:r,config:e,request:i};z(t,n,o),i=null}},i.onabort=function(){i&&(n(Z("Request aborted",e,"ECONNABORTED",i)),i=null)},i.onerror=function(){n(Z("Network Error",e,null,i)),i=null},i.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(Z(t,e,"ECONNABORTED",i)),i=null},H.isStandardBrowserEnv()){var u=(e.withCredentials||K(c))&&e.xsrfCookieName?G.read(e.xsrfCookieName):void 0;u&&(o[e.xsrfHeaderName]=u)}if("setRequestHeader"in i&&H.forEach(o,(function(e,t){void 0===r&&"content-type"===t.toLowerCase()?delete o[t]:i.setRequestHeader(t,e)})),H.isUndefined(e.withCredentials)||(i.withCredentials=!!e.withCredentials),e.responseType)try{i.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&i.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&i.upload&&i.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){i&&(i.abort(),n(e),i=null)})),r||(r=null),i.send(r)}))},Q=w,ee=function(e,t){D.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))},te={"Content-Type":"application/x-www-form-urlencoded"};function ne(e,t){!Q.isUndefined(e)&&Q.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var re,oe={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(re=W),re),transformRequest:[function(e,t){return ee(t,"Accept"),ee(t,"Content-Type"),Q.isFormData(e)||Q.isArrayBuffer(e)||Q.isBuffer(e)||Q.isStream(e)||Q.isFile(e)||Q.isBlob(e)?e:Q.isArrayBufferView(e)?e.buffer:Q.isURLSearchParams(e)?(ne(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):Q.isObject(e)?(ne(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};oe.headers={common:{Accept:"application/json, text/plain, */*"}},Q.forEach(["delete","get","head"],(function(e){oe.headers[e]={}})),Q.forEach(["post","put","patch"],(function(e){oe.headers[e]=Q.merge(te)}));var ie=oe,ae=w,se=function(e,t,n){return j.forEach(n,(function(n){e=n(e,t)})),e},ce=C,ue=ie;function fe(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var de=w,pe=function(e,t){t=t||{};var n={},r=["url","method","data"],o=["headers","auth","proxy","params"],i=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function s(e,t){return de.isPlainObject(e)&&de.isPlainObject(t)?de.merge(e,t):de.isPlainObject(t)?de.merge({},t):de.isArray(t)?t.slice():t}function c(r){de.isUndefined(t[r])?de.isUndefined(e[r])||(n[r]=s(void 0,e[r])):n[r]=s(e[r],t[r])}de.forEach(r,(function(e){de.isUndefined(t[e])||(n[e]=s(void 0,t[e]))})),de.forEach(o,c),de.forEach(i,(function(r){de.isUndefined(t[r])?de.isUndefined(e[r])||(n[r]=s(void 0,e[r])):n[r]=s(void 0,t[r])})),de.forEach(a,(function(r){r in t?n[r]=s(e[r],t[r]):r in e&&(n[r]=s(void 0,e[r]))}));var u=r.concat(o).concat(i).concat(a),f=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===u.indexOf(e)}));return de.forEach(f,c),n},le=w,he=R,me=I,ge=function(e){return fe(e),e.headers=e.headers||{},e.data=se(e.data,e.headers,e.transformRequest),e.headers=ae.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),ae.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||ue.adapter)(e).then((function(t){return fe(e),t.data=se(t.data,t.headers,e.transformResponse),t}),(function(t){return ce(t)||(fe(e),t&&t.response&&(t.response.data=se(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},ye=pe;function ve(e){this.defaults=e,this.interceptors={request:new me,response:new me}}ve.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=ye(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[ge,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)n=n.then(t.shift(),t.shift());return n},ve.prototype.getUri=function(e){return e=ye(this.defaults,e),he(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},le.forEach(["delete","get","head","options"],(function(e){ve.prototype[e]=function(t,n){return this.request(ye(n||{},{method:e,url:t,data:(n||{}).data}))}})),le.forEach(["post","put","patch"],(function(e){ve.prototype[e]=function(t,n,r){return this.request(ye(r||{},{method:e,url:t,data:n}))}}));var Ee=ve;function Se(e){this.message=e}Se.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},Se.prototype.__CANCEL__=!0;var be=Se,Te=be;function we(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new Te(e),t(n.reason))}))}we.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},we.source=function(){var e;return{token:new we((function(t){e=t})),cancel:e}};var Ae=we,xe=w,Re=h,Pe=Ee,Oe=pe;function Ie(e){var t=new Pe(e),n=Re(Pe.prototype.request,t);return xe.extend(n,Pe.prototype,t),xe.extend(n,t),n}var je=Ie(ie);je.Axios=Pe,je.create=function(e){return Ie(Oe(je.defaults,e))},je.Cancel=be,je.CancelToken=Ae,je.isCancel=C,je.all=function(e){return Promise.all(e)},je.spread=function(e){return function(t){return e.apply(null,t)}},je.isAxiosError=function(e){return"object"==typeof e&&!0===e.isAxiosError},l.exports=je,l.exports.default=je;var Ce,De=l.exports,Le=new Uint8Array(16);function Ne(){if(!Ce&&!(Ce="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ce(Le)}var Ue=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Me(e){return"string"==typeof e&&Ue.test(e)}for(var qe=[],Be=0;Be<256;++Be)qe.push((Be+256).toString(16).substr(1));function Fe(e,t,n){var r=(e=e||{}).random||(e.rng||Ne)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(qe[e[t+0]]+qe[e[t+1]]+qe[e[t+2]]+qe[e[t+3]]+"-"+qe[e[t+4]]+qe[e[t+5]]+"-"+qe[e[t+6]]+qe[e[t+7]]+"-"+qe[e[t+8]]+qe[e[t+9]]+"-"+qe[e[t+10]]+qe[e[t+11]]+qe[e[t+12]]+qe[e[t+13]]+qe[e[t+14]]+qe[e[t+15]]).toLowerCase();if(!Me(n))throw TypeError("Stringified UUID is invalid");return n}(r)}function ke(e){return isNaN(Number(e))?e:{scaled:Number(e)}}class _e{static get instance(){return _e._instance||(_e._instance=new _e),_e._instance}static clearInstance(){_e._instance=null}static get xapi(){return _e._xapi}constructor(){if(this.launchParameters=this.getLaunchParametersFromLMS(),!this.launchParameters.fetch)throw Error("Unable to construct, no `fetch` parameter found in URL.");if(!this.launchParameters.endpoint)throw Error("Unable to construct, no `endpoint` parameter found in URL");if(!this.launchParameters.actor)throw Error("Unable to construct, no `actor` parameter found in URL.");if(!this.launchParameters.activityId)throw Error("Unable to construct, no `activityId` parameter found in URL.");if(!this.launchParameters.registration)throw Error("Unable to construct, no `registration` parameter found in URL.")}static get isCmiAvailable(){if(!window||"object"!=typeof window)return!1;if(!window.location||"string"!=typeof window.location.search)return!1;const e=new URLSearchParams(window.location.search);return Boolean(e.get("fetch")&&e.get("endpoint")&&e.get("actor")&&e.get("registration")&&e.get("activityId"))}get isAuthenticated(){return Boolean(_e._xapi)}getLaunchParameters(){return this.launchParameters}getLaunchData(){return this.launchData}getLearnerPreferences(){return this.learnerPreferences}initialize(){return this.getAuthTokenFromLMS(this.launchParameters.fetch).then((e=>{const n=e.data["auth-token"];return _e._xapi=new t(this.launchParameters.endpoint,"Basic "+n),this.getLaunchDataFromLMS()})).then((e=>{this.launchData=e.data})).then((()=>this.getLearnerPreferencesFromLMS())).then((e=>{this.learnerPreferences=e.data||{}})).then((()=>(this.initialisedDate=new Date,this.sendCmi5DefinedStatement({verb:r.INITIALIZED}))))}complete(e){return"Normal"!==this.launchData.launchMode?Promise.reject(new Error("Can only send COMPLETED when launchMode is 'Normal'")):this.sendCmi5DefinedStatement({verb:r.COMPLETED,result:{completion:!0,duration:t.calculateISO8601Duration(this.initialisedDate,new Date)},context:{contextActivities:{category:[n.MOVE_ON]}}},e)}pass(e,o){if("Normal"!==this.launchData.launchMode)return Promise.reject(new Error("Can only send PASSED when launchMode is 'Normal'"));const i=ke(e);if(this.launchData.masteryScore&&(!i||isNaN(Number(i.scaled))||i.scaled<this.launchData.masteryScore))return Promise.reject(new Error("Learner has not met Mastery Score"));const[a,s]=(c=o)&&"Activity"===c.objectType&&"string"==typeof c.id&&c.definition&&"object"==typeof c.definition&&"http://adlnet.gov/expapi/activities/objective"===c.definition.type?[o,void 0]:[o?o.objectiveActivity:void 0,o];var c;return this.sendCmi5DefinedStatement({verb:r.PASSED,result:{...i?{score:i}:{},success:!0,duration:t.calculateISO8601Duration(this.initialisedDate,new Date)},context:{contextActivities:{category:[n.MOVE_ON],...a?{parent:[a]}:{}},...this.launchData.masteryScore?{extensions:{"https://w3id.org/xapi/cmi5/context/extensions/masteryscore":this.launchData.masteryScore}}:{}}},s)}fail(e,o){if("Normal"!==this.launchData.launchMode)return Promise.reject(new Error("Can only send FAILED when launchMode is 'Normal'"));const i=ke(e);return this.sendCmi5DefinedStatement({verb:r.FAILED,result:{...i?{score:i}:{},success:!1,duration:t.calculateISO8601Duration(this.initialisedDate,new Date)},context:{contextActivities:{category:[n.MOVE_ON]},...this.launchData.masteryScore?{extensions:{"https://w3id.org/xapi/cmi5/context/extensions/masteryscore":this.launchData.masteryScore}}:{}}},o)}terminate(){return this.sendCmi5DefinedStatement({verb:r.TERMINATED,result:{duration:t.calculateISO8601Duration(this.initialisedDate,new Date)}})}progress(e){return this.sendCmi5AllowedStatement({verb:t.Verbs.PROGRESSED,object:{objectType:"Activity",id:this.launchParameters.activityId},result:{extensions:{"https://w3id.org/xapi/cmi5/result/extensions/progress":e}}})}interactionTrueFalse(e,t,n,r,o,i,a,s,c){return this.interaction(e,t,n.toString(),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"true-false",...void 0!==r?{correctResponsesPattern:r?["true"]:["false"]}:{},...o?{name:o}:{},...i?{description:i}:{}},a,s,c)}interactionChoice(e,t,n,r,o,i,a,s,c,u){return this.interaction(e,t,n.join("[,]"),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"choice",...r?{correctResponsesPattern:[r.join("[,]")]}:{},...o?{choices:o}:{},...i?{name:i}:{},...a?{description:a}:{}},s,c,u)}interactionFillIn(e,t,n,r,o,i,a,s,c){return this.interaction(e,t,n.join("[,]"),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"fill-in",...r?{correctResponsesPattern:[r.join("[,]")]}:{},...o?{name:o}:{},...i?{description:i}:{}},a,s,c)}interactionLongFillIn(e,t,n,r,o,i,a,s,c){return this.interaction(e,t,n.join("[,]"),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"long-fill-in",...r?{correctResponsesPattern:[r.join("[,]")]}:{},...o?{name:o}:{},...i?{description:i}:{}},a,s,c)}interactionLikert(e,t,n,r,o,i,a,s,c,u){return this.interaction(e,t,n,{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"likert",...r?{correctResponsesPattern:[r]}:{},...o?{scale:o}:{},...i?{name:i}:{},...a?{description:a}:{}},s,c,u)}interactionMatching(e,t,n,r,o,i,a,s,c,u,f){return this.interaction(e,t,Object.keys(n).map((e=>`${e}[.]${n[e]}`)).join("[,]"),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"matching",...r?{correctResponsesPattern:[Object.keys(r).map((e=>`${e}[.]${r[e]}`)).join("[,]")]}:{},...o?{source:o}:{},...i?{target:i}:{},...a?{name:a}:{},...s?{description:s}:{}},c,u,f)}interactionPerformance(e,t,n,r,o,i,a,s,c,u){return this.interaction(e,t,Object.keys(n).map((e=>`${e}[.]${n[e]}`)).join("[,]"),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"performance",...r?{correctResponsesPattern:[Object.keys(r).map((e=>{const t=r[e].exact?r[e].exact.toString():"",n=r[e].min?r[e].min.toString():"",o=r[e].max?r[e].max.toString():"";return`${e}[.]${t||n+":"+o}`})).join("[,]")]}:{},...o?{steps:o}:{},...i?{name:i}:{},...a?{description:a}:{}},s,c,u)}interactionSequencing(e,t,n,r,o,i,a,s,c,u){return this.interaction(e,t,n.join("[,]"),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"sequencing",...r?{correctResponsesPattern:[r.join("[,]")]}:{},...o?{choices:o}:{},...i?{name:i}:{},...a?{description:a}:{}},s,c,u)}interactionNumeric(e,t,n,r,o,i,a,s,c){return this.interaction(e,t,n.toString(),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"numeric",...r?{correctResponsesPattern:[""+(r.exact?r.exact:r.min+":"+r.max)]}:{},...o?{name:o}:{},...i?{description:i}:{}},a,s,c)}interactionOther(e,t,n,r,o,i,a,s,c){return this.interaction(e,t,n,{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"other",...r?{correctResponsesPattern:[r]}:{},...o?{name:o}:{},...i?{description:i}:{}},a,s,c)}interaction(e,n,r,o,i,a,s){return this.sendCmi5AllowedStatement({verb:t.Verbs.ANSWERED,result:{response:r,...a?{duration:t.calculateISO8601Duration(a.start,a.end)}:{},..."boolean"==typeof i?{success:i}:{}},object:{objectType:"Activity",id:`${this.launchParameters.activityId}/test/${e}/question/${n}`,definition:o},...s?{context:{contextActivities:{parent:[s]}}}:{}})}setResultScore(e,t){return{...t,result:{...t.result||{},score:e}}}async moveOn(e){var t;let n=e;if("Normal"!==this.launchData.launchMode)return Promise.reject(new Error("Can only send FAILED when launchMode is 'Normal'"));const r=[];if(null!==(t=n)&&void 0!==t&&t.score){var o;const e=ke(null===(o=n)||void 0===o?void 0:o.score);if(this.launchData.masteryScore)e.scaled>=this.launchData.masteryScore?this.appendStatementIds(await this.pass(e,n),r):this.appendStatementIds(await this.fail(e,n),r);else{var i;const t=t=>this.setResultScore(e,t),r=null===(i=n)||void 0===i?void 0:i.transform;n={...n||{},transform:"function"==typeof r?e=>r(t(e)):e=>t(e)}}}return this.appendStatementIds(await this.complete(n),r),null!=e&&e.disableSendTerminated||this.appendStatementIds(await this.terminate(),r),r}appendStatementIds(e,t){t.push.apply(t,e.data)}getLaunchParametersFromLMS(){return t.getSearchQueryParamsAsObject(window.location.href)}getAuthTokenFromLMS(e){return De.post(e)}getLaunchDataFromLMS(){return _e._xapi.getState(this.launchParameters.actor,this.launchParameters.activityId,"LMS.LaunchData",this.launchParameters.registration)}getLearnerPreferencesFromLMS(){return _e._xapi.getAgentProfile(this.launchParameters.actor,"cmi5LearnerPreferences").then((e=>e.data),(()=>({})))}sendCmi5DefinedStatement(e,t){const r={object:{objectType:"Activity",id:this.launchParameters.activityId},context:{contextActivities:{category:[n.CMI5]}}},o=p.all([r,e]);return this.sendCmi5AllowedStatement(o,t)}sendCmi5AllowedStatement(e,t){const n=Fe(),r=this.launchParameters.actor,o=(new Date).toISOString(),i=Object.assign({},this.launchData.contextTemplate);i.registration=this.launchParameters.registration;const a={id:n,actor:r,timestamp:o,context:i},s=p.all([a,e]),c=t&&"function"==typeof t.transform?t.transform(s):s;return _e._xapi.sendStatement(c)}}return _e._instance=null,_e._xapi=null,_e}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Cmi5=t()}(this,(function(){"use strict";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var e={exports:{}};!function(e,t){e.exports=function(){let e,t;!function(e){e.SIGNATURE="http://adlnet.gov/expapi/attachments/signature",e.CERTIFICATE_OF_COMPLETION="http://id.tincanapi.com/attachment/certificate-of-completion",e.CONTRACT="http://id.tincanapi.com/attachment/contract",e.SUPPORTING_MEDIA="http://id.tincanapi.com/attachment/supporting_media"}(e||(e={})),function(e){e.ABOUT="about",e.AGENTS="agents",e.ACTIVITIES="activities",e.ACTIVITY_PROFILE="activities/profile",e.STATE="activities/state",e.AGENT_PROFILE="agents/profile",e.STATEMENT="statements"}(t||(t={}));class n{}n.INITIALIZED={id:"http://adlnet.gov/expapi/verbs/initialized",display:{"en-US":"initialized"}},n.TERMINATED={id:"http://adlnet.gov/expapi/verbs/terminated",display:{"en-US":"terminated"}},n.SUSPENDED={id:"http://adlnet.gov/expapi/verbs/suspended",display:{"en-US":"suspended"}},n.RESUMED={id:"http://adlnet.gov/expapi/verbs/resumed",display:{"en-US":"resumed"}},n.PASSED={id:"http://adlnet.gov/expapi/verbs/passed",display:{"en-US":"passed"}},n.FAILED={id:"http://adlnet.gov/expapi/verbs/failed",display:{"en-US":"failed"}},n.SCORED={id:"http://adlnet.gov/expapi/verbs/scored",display:{"en-US":"scored"}},n.COMPLETED={id:"http://adlnet.gov/expapi/verbs/completed",display:{"en-US":"completed"}},n.RESPONDED={id:"http://adlnet.gov/expapi/verbs/responded",display:{"en-US":"responded"}},n.COMMENTED={id:"http://adlnet.gov/expapi/verbs/commented",display:{"en-US":"commented"}},n.VOIDED={id:"http://adlnet.gov/expapi/verbs/voided",display:{"en-US":"voided"}},n.PROGRESSED={id:"http://adlnet.gov/expapi/verbs/progressed",display:{"en-US":"progressed"}},n.ANSWERED={id:"http://adlnet.gov/expapi/verbs/answered",display:{"en-US":"answered"}};const r="\r\n";function o(e,t){const n=[],o=(Math.random()+" ").substring(2,10)+(Math.random()+" ").substring(2,10),i={"Content-Type":"multipart/mixed; boundary="+o};n.push(function(e,t){return["--"+t,"Content-Type: application/json",'Content-Disposition: form-data; name="statement"',"",JSON.stringify(e)].join(r)+r}(e,o));const a=Array.isArray(e)?e.reduce(((e,t)=>e.concat(t.attachments)),[]):e.attachments;return t.forEach(((e,t)=>{const i=a[t];n.push(function(e,t){return["--"+t,"Content-Type: "+e.contentType,"Content-Transfer-Encoding: binary","X-Experience-API-Hash: "+e.sha2].join(r)+r+r}(i,o)),n.push(e)})),n.push(`\r\n--${o}--\r\n`),{header:i,blob:new Blob(n)}}function i(e){const t={},n=e.split("?")[1]||null;return n?(new URLSearchParams(n).forEach(((e,n)=>{try{t[n]=JSON.parse(e)}catch{t[n]=e}var r;"actor"===n&&(t.actor=(r=t.actor,["name","mbox","account"].forEach((e=>{if(Array.isArray(r[e]))switch(e){case"account":r[e]={...r.account[0].accountServiceHomePage?{homePage:r.account[0].accountServiceHomePage}:null,...r.account[0].accountName?{name:r.account[0].accountName}:null};break;default:r[e]=r[e][0]}})),r))})),t):t}const a=3600;var s={exports:{}},c=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}},u=c,d=Object.prototype.toString;function l(e){return"[object Array]"===d.call(e)}function f(e){return void 0===e}function p(e){return null!==e&&"object"==typeof e}function h(e){if("[object Object]"!==d.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function m(e){return"[object Function]"===d.call(e)}function g(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),l(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}var y={isArray:l,isArrayBuffer:function(e){return"[object ArrayBuffer]"===d.call(e)},isBuffer:function(e){return null!==e&&!f(e)&&null!==e.constructor&&!f(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:p,isPlainObject:h,isUndefined:f,isDate:function(e){return"[object Date]"===d.call(e)},isFile:function(e){return"[object File]"===d.call(e)},isBlob:function(e){return"[object Blob]"===d.call(e)},isFunction:m,isStream:function(e){return p(e)&&m(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:g,merge:function e(){var t={};function n(n,r){h(t[r])&&h(n)?t[r]=e(t[r],n):h(n)?t[r]=e({},n):l(n)?t[r]=n.slice():t[r]=n}for(var r=0,o=arguments.length;r<o;r++)g(arguments[r],n);return t},extend:function(e,t,n){return g(t,(function(t,r){e[r]=n&&"function"==typeof t?u(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}},v=y;function b(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var E=function(e,t,n){if(!t)return e;var r;if(n)r=n(t);else if(v.isURLSearchParams(t))r=t.toString();else{var o=[];v.forEach(t,(function(e,t){null!=e&&(v.isArray(e)?t+="[]":e=[e],v.forEach(e,(function(e){v.isDate(e)?e=e.toISOString():v.isObject(e)&&(e=JSON.stringify(e)),o.push(b(t)+"="+b(e))})))})),r=o.join("&")}if(r){var i=e.indexOf("#");-1!==i&&(e=e.slice(0,i)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e},S=y;function w(){this.handlers=[]}w.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},w.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},w.prototype.forEach=function(e){S.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var T=w,x=y,A=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e},j=A,O=function(e,t,n,r,o){var i=new Error(e);return j(i,t,n,r,o)},P=O,R=y,I=R.isStandardBrowserEnv()?{write:function(e,t,n,r,o,i){var a=[];a.push(e+"="+encodeURIComponent(t)),R.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),R.isString(r)&&a.push("path="+r),R.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},N=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)},C=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},D=y,L=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],U=y,k=U.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=r(window.location.href),function(t){var n=U.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0},M=y,q=function(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(P("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)},B=I,_=E,F=function(e,t){return e&&!N(t)?C(e,t):t},V=function(e){var t,n,r,o={};return e?(D.forEach(e.split("\n"),(function(e){if(r=e.indexOf(":"),t=D.trim(e.substr(0,r)).toLowerCase(),n=D.trim(e.substr(r+1)),t){if(o[t]&&L.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([n]):o[t]?o[t]+", "+n:n}})),o):o},$=k,J=O,H=function(e){return new Promise((function(t,n){var r=e.data,o=e.headers,i=e.responseType;M.isFormData(r)&&delete o["Content-Type"];var a=new XMLHttpRequest;if(e.auth){var s=e.auth.username||"",c=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.Authorization="Basic "+btoa(s+":"+c)}var u=F(e.baseURL,e.url);function d(){if(a){var r="getAllResponseHeaders"in a?V(a.getAllResponseHeaders()):null,o={data:i&&"text"!==i&&"json"!==i?a.response:a.responseText,status:a.status,statusText:a.statusText,headers:r,config:e,request:a};q(t,n,o),a=null}}if(a.open(e.method.toUpperCase(),_(u,e.params,e.paramsSerializer),!0),a.timeout=e.timeout,"onloadend"in a?a.onloadend=d:a.onreadystatechange=function(){a&&4===a.readyState&&(0!==a.status||a.responseURL&&0===a.responseURL.indexOf("file:"))&&setTimeout(d)},a.onabort=function(){a&&(n(J("Request aborted",e,"ECONNABORTED",a)),a=null)},a.onerror=function(){n(J("Network Error",e,null,a)),a=null},a.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(J(t,e,e.transitional&&e.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",a)),a=null},M.isStandardBrowserEnv()){var l=(e.withCredentials||$(u))&&e.xsrfCookieName?B.read(e.xsrfCookieName):void 0;l&&(o[e.xsrfHeaderName]=l)}"setRequestHeader"in a&&M.forEach(o,(function(e,t){void 0===r&&"content-type"===t.toLowerCase()?delete o[t]:a.setRequestHeader(t,e)})),M.isUndefined(e.withCredentials)||(a.withCredentials=!!e.withCredentials),i&&"json"!==i&&(a.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&a.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&a.upload&&a.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){a&&(a.abort(),n(e),a=null)})),r||(r=null),a.send(r)}))},z=y,G=function(e,t){x.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))},X=A,W={"Content-Type":"application/x-www-form-urlencoded"};function Y(e,t){!z.isUndefined(e)&&z.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var Z,K={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(Z=H),Z),transformRequest:[function(e,t){return G(t,"Accept"),G(t,"Content-Type"),z.isFormData(e)||z.isArrayBuffer(e)||z.isBuffer(e)||z.isStream(e)||z.isFile(e)||z.isBlob(e)?e:z.isArrayBufferView(e)?e.buffer:z.isURLSearchParams(e)?(Y(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):z.isObject(e)||t&&"application/json"===t["Content-Type"]?(Y(t,"application/json"),function(e,t,n){if(z.isString(e))try{return(t||JSON.parse)(e),z.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional,n=t&&t.silentJSONParsing,r=t&&t.forcedJSONParsing,o=!n&&"json"===this.responseType;if(o||r&&z.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw X(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};z.forEach(["delete","get","head"],(function(e){K.headers[e]={}})),z.forEach(["post","put","patch"],(function(e){K.headers[e]=z.merge(W)}));var Q=K,ee=y,te=Q,ne=function(e){return!(!e||!e.__CANCEL__)},re=y,oe=function(e,t,n){var r=this||te;return ee.forEach(n,(function(n){e=n.call(r,e,t)})),e},ie=ne,ae=Q;function se(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var ce=y,ue=function(e,t){t=t||{};var n={},r=["url","method","data"],o=["headers","auth","proxy","params"],i=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function s(e,t){return ce.isPlainObject(e)&&ce.isPlainObject(t)?ce.merge(e,t):ce.isPlainObject(t)?ce.merge({},t):ce.isArray(t)?t.slice():t}function c(r){ce.isUndefined(t[r])?ce.isUndefined(e[r])||(n[r]=s(void 0,e[r])):n[r]=s(e[r],t[r])}ce.forEach(r,(function(e){ce.isUndefined(t[e])||(n[e]=s(void 0,t[e]))})),ce.forEach(o,c),ce.forEach(i,(function(r){ce.isUndefined(t[r])?ce.isUndefined(e[r])||(n[r]=s(void 0,e[r])):n[r]=s(void 0,t[r])})),ce.forEach(a,(function(r){r in t?n[r]=s(e[r],t[r]):r in e&&(n[r]=s(void 0,e[r]))}));var u=r.concat(o).concat(i).concat(a),d=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===u.indexOf(e)}));return ce.forEach(d,c),n},de={name:"axios",version:"0.21.4",description:"Promise based HTTP client for the browser and node.js",main:"index.js",scripts:{test:"grunt test",start:"node ./sandbox/server.js",build:"NODE_ENV=production grunt build",preversion:"npm test",version:"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",postversion:"git push && git push --tags",examples:"node ./examples/server.js",coveralls:"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",fix:"eslint --fix lib/**/*.js"},repository:{type:"git",url:"https://github.com/axios/axios.git"},keywords:["xhr","http","ajax","promise","node"],author:"Matt Zabriskie",license:"MIT",bugs:{url:"https://github.com/axios/axios/issues"},homepage:"https://axios-http.com",devDependencies:{coveralls:"^3.0.0","es6-promise":"^4.2.4",grunt:"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1",karma:"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2",minimist:"^1.2.0",mocha:"^8.2.1",sinon:"^4.5.0","terser-webpack-plugin":"^4.2.3",typescript:"^4.0.5","url-search-params":"^0.10.0",webpack:"^4.44.2","webpack-dev-server":"^3.11.0"},browser:{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},jsdelivr:"dist/axios.min.js",unpkg:"dist/axios.min.js",typings:"./index.d.ts",dependencies:{"follow-redirects":"^1.14.0"},bundlesize:[{path:"./dist/axios.min.js",threshold:"5kB"}]},le={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){le[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var fe={},pe=de.version.split(".");function he(e,t){for(var n=t?t.split("."):pe,r=e.split("."),o=0;o<3;o++){if(n[o]>r[o])return!0;if(n[o]<r[o])return!1}return!1}le.transitional=function(e,t,n){var r=t&&he(t);function o(e,t){return"[Axios v"+de.version+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,i,a){if(!1===e)throw new Error(o(i," has been removed in "+t));return r&&!fe[i]&&(fe[i]=!0,console.warn(o(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,a)}};var me=y,ge=E,ye=T,ve=function(e){return se(e),e.headers=e.headers||{},e.data=oe.call(e,e.data,e.headers,e.transformRequest),e.headers=re.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),re.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||ae.adapter)(e).then((function(t){return se(e),t.data=oe.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return ie(t)||(se(e),t&&t.response&&(t.response.data=oe.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},be=ue,Ee={isOlderVersion:he,assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),o=r.length;o-- >0;){var i=r[o],a=t[i];if(a){var s=e[i],c=void 0===s||a(s,i,e);if(!0!==c)throw new TypeError("option "+i+" must be "+c)}else if(!0!==n)throw Error("Unknown option "+i)}},validators:le},Se=Ee.validators;function we(e){this.defaults=e,this.interceptors={request:new ye,response:new ye}}we.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=be(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&Ee.assertOptions(t,{silentJSONParsing:Se.transitional(Se.boolean,"1.0.0"),forcedJSONParsing:Se.transitional(Se.boolean,"1.0.0"),clarifyTimeoutError:Se.transitional(Se.boolean,"1.0.0")},!1);var n=[],r=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(r=r&&t.synchronous,n.unshift(t.fulfilled,t.rejected))}));var o,i=[];if(this.interceptors.response.forEach((function(e){i.push(e.fulfilled,e.rejected)})),!r){var a=[ve,void 0];for(Array.prototype.unshift.apply(a,n),a=a.concat(i),o=Promise.resolve(e);a.length;)o=o.then(a.shift(),a.shift());return o}for(var s=e;n.length;){var c=n.shift(),u=n.shift();try{s=c(s)}catch(e){u(e);break}}try{o=ve(s)}catch(e){return Promise.reject(e)}for(;i.length;)o=o.then(i.shift(),i.shift());return o},we.prototype.getUri=function(e){return e=be(this.defaults,e),ge(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},me.forEach(["delete","get","head","options"],(function(e){we.prototype[e]=function(t,n){return this.request(be(n||{},{method:e,url:t,data:(n||{}).data}))}})),me.forEach(["post","put","patch"],(function(e){we.prototype[e]=function(t,n,r){return this.request(be(r||{},{method:e,url:t,data:n}))}}));var Te=we;function xe(e){this.message=e}xe.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},xe.prototype.__CANCEL__=!0;var Ae=xe,je=Ae;function Oe(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new je(e),t(n.reason))}))}Oe.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Oe.source=function(){var e;return{token:new Oe((function(t){e=t})),cancel:e}};var Pe=Oe,Re=y,Ie=c,Ne=Te,Ce=ue;function De(e){var t=new Ne(e),n=Ie(Ne.prototype.request,t);return Re.extend(n,Ne.prototype,t),Re.extend(n,t),n}var Le=De(Q);Le.Axios=Ne,Le.create=function(e){return De(Ce(Le.defaults,e))},Le.Cancel=Ae,Le.CancelToken=Pe,Le.isCancel=ne,Le.all=function(e){return Promise.all(e)},Le.spread=function(e){return function(t){return e.apply(null,t)}},Le.isAxiosError=function(e){return"object"==typeof e&&!0===e.isAxiosError},s.exports=Le,s.exports.default=Le;var Ue=s.exports;function ke(e,t){const n=`${e}:${t}`;if("undefined"!=typeof window&&window.btoa)return"Basic "+btoa(n);if("undefined"!=typeof Buffer)return"Basic "+Buffer.from(n,"binary").toString("base64");throw new Error("Environment does not support base64 conversion.")}class Me{constructor(e,t,n="1.0.3"){this.endpoint=e.endsWith("/")?e:e+"/",this.headers={"X-Experience-API-Version":n,"Content-Type":"application/json",Authorization:t||ke("","")}}getAbout(){return this.requestResource(t.ABOUT)}getAgent(e){return this.requestResource(t.AGENTS,{agent:e})}getStatement(e){return this.requestResource(t.STATEMENT,e)}getVoidedStatement(e){return this.requestResource(t.STATEMENT,e)}getStatements(e){return this.requestResource(t.STATEMENT,e)}getMoreStatements(e){const t=new URL(this.endpoint),n=`${t.protocol}//${t.host}${e}`;return this.requestURL(n)}sendStatement(e,n){if(null==n?void 0:n.length){const r=o(e,n);return this.requestResource(t.STATEMENT,{},{method:"POST",headers:r.header,data:r.blob})}return this.requestResource(t.STATEMENT,{},{method:"POST",data:e})}sendStatements(e,n){if(null==n?void 0:n.length){const r=o(e,n);return this.requestResource(t.STATEMENT,{},{method:"POST",headers:r.header,data:r.blob})}return this.requestResource(t.STATEMENT,{},{method:"POST",data:e})}voidStatement(e,t){const r={actor:e,verb:n.VOIDED,object:{objectType:"StatementRef",id:t}};return this.sendStatement(r)}voidStatements(e,t){const r=t.map((t=>({actor:e,verb:n.VOIDED,object:{objectType:"StatementRef",id:t}})));return this.sendStatements(r)}createState(e,n,r,o,i,a,s){const c={};return a&&(c[s]=a),this.requestResource(t.STATE,{agent:e,activityId:n,stateId:r,...i?{registration:i}:{}},{method:"POST",data:o,headers:c})}setState(e,n,r,o,i,a,s,c){const u={};return a&&(u[s]=a),c&&(u["Content-Type"]=c),this.requestResource(t.STATE,{agent:e,activityId:n,stateId:r,...i?{registration:i}:{}},{method:"PUT",data:o,headers:u})}getStates(e,n,r,o){return this.requestResource(t.STATE,{agent:e,activityId:n,...r?{registration:r}:{},...o?{since:o}:{}})}getState(e,n,r,o){return this.requestResource(t.STATE,{agent:e,activityId:n,stateId:r,...o?{registration:o}:{}})}deleteState(e,n,r,o,i){const a={};return i&&(a["If-Match"]=i),this.requestResource(t.STATE,{agent:e,activityId:n,stateId:r,...o?{registration:o}:{}},{method:"DELETE",headers:a})}deleteStates(e,n,r,o){const i={};return o&&(i["If-Match"]=o),this.requestResource(t.STATE,{agent:e,activityId:n,...r?{registration:r}:{}},{method:"DELETE",headers:i})}getActivity(e){return this.requestResource(t.ACTIVITIES,{activityId:e})}createActivityProfile(e,n,r,o,i){const a={};return o&&(a[i]=o),this.requestResource(t.ACTIVITY_PROFILE,{activityId:e,profileId:n},{method:"POST",data:r,headers:a})}setActivityProfile(e,n,r,o,i,a){const s={};return s[i]=o,a&&(s["Content-Type"]=a),this.requestResource(t.ACTIVITY_PROFILE,{activityId:e,profileId:n},{method:"PUT",data:r,headers:s})}getActivityProfiles(e,n){return this.requestResource(t.ACTIVITY_PROFILE,{activityId:e,...n?{since:n}:{}})}getActivityProfile(e,n){return this.requestResource(t.ACTIVITY_PROFILE,{activityId:e,profileId:n})}deleteActivityProfile(e,n,r){const o={};return r&&(o["If-Match"]=r),this.requestResource(t.ACTIVITY_PROFILE,{activityId:e,profileId:n},{method:"DELETE",headers:o})}createAgentProfile(e,n,r,o,i){const a={};return o&&(a[i]=o),this.requestResource(t.AGENT_PROFILE,{agent:e,profileId:n},{method:"POST",data:r,headers:a})}setAgentProfile(e,n,r,o,i,a){const s={};return s[i]=o,a&&(s["Content-Type"]=a),this.requestResource(t.AGENT_PROFILE,{agent:e,profileId:n},{method:"PUT",data:r,headers:s})}getAgentProfiles(e,n){return this.requestResource(t.AGENT_PROFILE,{agent:e,...n?{since:n}:{}})}getAgentProfile(e,n){return this.requestResource(t.AGENT_PROFILE,{agent:e,profileId:n})}deleteAgentProfile(e,n,r){const o={};return r&&(o["If-Match"]=r),this.requestResource(t.AGENT_PROFILE,{agent:e,profileId:n},{method:"DELETE",headers:o})}requestResource(e,t={},n){const r=this.generateURL(e,t);return this.requestURL(r,n)}requestURL(e,t){return Ue.request({method:(null==t?void 0:t.method)||"GET",url:e,headers:{...this.headers,...null==t?void 0:t.headers},data:null==t?void 0:t.data}).then((e=>{const t=e.headers["content-type"];return e.data&&t&&-1!==t.indexOf("multipart/mixed")&&(e.data=function(e){const t=e.trim().split(r)[0].trim(),n=e.split(t).map((e=>e.trim())).filter((e=>""!==e&&"--"!==e)),o=[];for(let e=0;e<n.length;e++){const t={},i=n[e].split(r);for(let e=0;e<i.length-2;e++){const n=i[e].split(":");t[n[0]]=n[1]}let a=i[i.length-1];t["Content-Type"].indexOf("application/json")>-1&&(a=JSON.parse(a)),o.push(a)}return o}(e.data)),e}))}generateURL(e,t){const n=Object.keys(t).map((e=>{let n="agent"===e?JSON.stringify(t[e]):t[e];return n=encodeURIComponent(n),`${e}=${n}`})).join("&");return`${this.endpoint}${e}${n?"?"+n:""}`}}return Me.default=Me,Me.AttachmentUsages=e,Me.Verbs=n,Me.calculateISO8601Duration=function(e,t){const n=(t.getTime()-e.getTime())/1e3,r=Math.floor(n/86400),o=n%86400,i=Math.floor(o/a),s=o%a,c=Math.floor(s/60),u=s%60,d=Math.ceil(u);return`P${r?r+"D":""}T${i?i+"H":""}${c?c+"M":""}${d?d+"S":""}`},Me.getSearchQueryParamsAsObject=i,Me.getXAPILaunchData=function(){const e=i(location.search);if(!e.xAPILaunchService)return Promise.reject(new Error("xAPILaunchService parameter not found in URL."));const t=new URL(e.xAPILaunchService);return t.pathname+="launch/"+e.xAPILaunchKey,Ue({method:"POST",url:t.toString()}).then((e=>e.data))},Me.getTinCanLaunchData=function(){return i(location.search)},Me.toBasicAuth=ke,Me}()}(e);var t=e.exports;class n{}n.MOVE_ON={id:"https://w3id.org/xapi/cmi5/context/categories/moveon"},n.CMI5={id:"https://w3id.org/xapi/cmi5/context/categories/cmi5"};class r{}r.INITIALIZED=t.Verbs.INITIALIZED,r.COMPLETED=t.Verbs.COMPLETED,r.PASSED=t.Verbs.PASSED,r.FAILED=t.Verbs.FAILED,r.TERMINATED=t.Verbs.TERMINATED;var o=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===i}(e)}(e)};var i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function a(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function s(e,t,n){return e.concat(t).map((function(e){return a(e,n)}))}function c(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function u(e,t){try{return t in e}catch(e){return!1}}function d(e,t,n){var r={};return n.isMergeableObject(e)&&c(e).forEach((function(t){r[t]=a(e[t],n)})),c(t).forEach((function(o){(function(e,t){return u(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(u(e,o)&&n.isMergeableObject(t[o])?r[o]=function(e,t){if(!t.customMerge)return l;var n=t.customMerge(e);return"function"==typeof n?n:l}(o,n)(e[o],t[o],n):r[o]=a(t[o],n))})),r}function l(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||s,n.isMergeableObject=n.isMergeableObject||o,n.cloneUnlessOtherwiseSpecified=a;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):d(e,t,n):a(t,n)}l.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return l(e,n,t)}),{})};var f=l,p={exports:{}},h=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}},m=h,g=Object.prototype.toString;function y(e){return"[object Array]"===g.call(e)}function v(e){return void 0===e}function b(e){return null!==e&&"object"==typeof e}function E(e){if("[object Object]"!==g.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function S(e){return"[object Function]"===g.call(e)}function w(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),y(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}var T={isArray:y,isArrayBuffer:function(e){return"[object ArrayBuffer]"===g.call(e)},isBuffer:function(e){return null!==e&&!v(e)&&null!==e.constructor&&!v(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:b,isPlainObject:E,isUndefined:v,isDate:function(e){return"[object Date]"===g.call(e)},isFile:function(e){return"[object File]"===g.call(e)},isBlob:function(e){return"[object Blob]"===g.call(e)},isFunction:S,isStream:function(e){return b(e)&&S(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:w,merge:function e(){var t={};function n(n,r){E(t[r])&&E(n)?t[r]=e(t[r],n):E(n)?t[r]=e({},n):y(n)?t[r]=n.slice():t[r]=n}for(var r=0,o=arguments.length;r<o;r++)w(arguments[r],n);return t},extend:function(e,t,n){return w(t,(function(t,r){e[r]=n&&"function"==typeof t?m(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}},x=T;function A(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var j=function(e,t,n){if(!t)return e;var r;if(n)r=n(t);else if(x.isURLSearchParams(t))r=t.toString();else{var o=[];x.forEach(t,(function(e,t){null!=e&&(x.isArray(e)?t+="[]":e=[e],x.forEach(e,(function(e){x.isDate(e)?e=e.toISOString():x.isObject(e)&&(e=JSON.stringify(e)),o.push(A(t)+"="+A(e))})))})),r=o.join("&")}if(r){var i=e.indexOf("#");-1!==i&&(e=e.slice(0,i)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e},O=T;function P(){this.handlers=[]}P.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},P.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},P.prototype.forEach=function(e){O.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var R=P,I=T,N=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e},C=N,D=function(e,t,n,r,o){var i=new Error(e);return C(i,t,n,r,o)},L=D,U=T,k=U.isStandardBrowserEnv()?{write:function(e,t,n,r,o,i){var a=[];a.push(e+"="+encodeURIComponent(t)),U.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),U.isString(r)&&a.push("path="+r),U.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},M=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)},q=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},B=T,_=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],F=T,V=F.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=r(window.location.href),function(t){var n=F.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0},$=T,J=function(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(L("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)},H=k,z=j,G=function(e,t){return e&&!M(t)?q(e,t):t},X=function(e){var t,n,r,o={};return e?(B.forEach(e.split("\n"),(function(e){if(r=e.indexOf(":"),t=B.trim(e.substr(0,r)).toLowerCase(),n=B.trim(e.substr(r+1)),t){if(o[t]&&_.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([n]):o[t]?o[t]+", "+n:n}})),o):o},W=V,Y=D,Z=function(e){return new Promise((function(t,n){var r=e.data,o=e.headers,i=e.responseType;$.isFormData(r)&&delete o["Content-Type"];var a=new XMLHttpRequest;if(e.auth){var s=e.auth.username||"",c=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.Authorization="Basic "+btoa(s+":"+c)}var u=G(e.baseURL,e.url);function d(){if(a){var r="getAllResponseHeaders"in a?X(a.getAllResponseHeaders()):null,o={data:i&&"text"!==i&&"json"!==i?a.response:a.responseText,status:a.status,statusText:a.statusText,headers:r,config:e,request:a};J(t,n,o),a=null}}if(a.open(e.method.toUpperCase(),z(u,e.params,e.paramsSerializer),!0),a.timeout=e.timeout,"onloadend"in a?a.onloadend=d:a.onreadystatechange=function(){a&&4===a.readyState&&(0!==a.status||a.responseURL&&0===a.responseURL.indexOf("file:"))&&setTimeout(d)},a.onabort=function(){a&&(n(Y("Request aborted",e,"ECONNABORTED",a)),a=null)},a.onerror=function(){n(Y("Network Error",e,null,a)),a=null},a.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(Y(t,e,e.transitional&&e.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",a)),a=null},$.isStandardBrowserEnv()){var l=(e.withCredentials||W(u))&&e.xsrfCookieName?H.read(e.xsrfCookieName):void 0;l&&(o[e.xsrfHeaderName]=l)}"setRequestHeader"in a&&$.forEach(o,(function(e,t){void 0===r&&"content-type"===t.toLowerCase()?delete o[t]:a.setRequestHeader(t,e)})),$.isUndefined(e.withCredentials)||(a.withCredentials=!!e.withCredentials),i&&"json"!==i&&(a.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&a.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&a.upload&&a.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){a&&(a.abort(),n(e),a=null)})),r||(r=null),a.send(r)}))},K=T,Q=function(e,t){I.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))},ee=N,te={"Content-Type":"application/x-www-form-urlencoded"};function ne(e,t){!K.isUndefined(e)&&K.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var re,oe={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(re=Z),re),transformRequest:[function(e,t){return Q(t,"Accept"),Q(t,"Content-Type"),K.isFormData(e)||K.isArrayBuffer(e)||K.isBuffer(e)||K.isStream(e)||K.isFile(e)||K.isBlob(e)?e:K.isArrayBufferView(e)?e.buffer:K.isURLSearchParams(e)?(ne(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):K.isObject(e)||t&&"application/json"===t["Content-Type"]?(ne(t,"application/json"),function(e,t,n){if(K.isString(e))try{return(t||JSON.parse)(e),K.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional,n=t&&t.silentJSONParsing,r=t&&t.forcedJSONParsing,o=!n&&"json"===this.responseType;if(o||r&&K.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw ee(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};oe.headers={common:{Accept:"application/json, text/plain, */*"}},K.forEach(["delete","get","head"],(function(e){oe.headers[e]={}})),K.forEach(["post","put","patch"],(function(e){oe.headers[e]=K.merge(te)}));var ie=oe,ae=T,se=ie,ce=function(e){return!(!e||!e.__CANCEL__)},ue=T,de=function(e,t,n){var r=this||se;return ae.forEach(n,(function(n){e=n.call(r,e,t)})),e},le=ce,fe=ie;function pe(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var he=T,me=function(e,t){t=t||{};var n={},r=["url","method","data"],o=["headers","auth","proxy","params"],i=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function s(e,t){return he.isPlainObject(e)&&he.isPlainObject(t)?he.merge(e,t):he.isPlainObject(t)?he.merge({},t):he.isArray(t)?t.slice():t}function c(r){he.isUndefined(t[r])?he.isUndefined(e[r])||(n[r]=s(void 0,e[r])):n[r]=s(e[r],t[r])}he.forEach(r,(function(e){he.isUndefined(t[e])||(n[e]=s(void 0,t[e]))})),he.forEach(o,c),he.forEach(i,(function(r){he.isUndefined(t[r])?he.isUndefined(e[r])||(n[r]=s(void 0,e[r])):n[r]=s(void 0,t[r])})),he.forEach(a,(function(r){r in t?n[r]=s(e[r],t[r]):r in e&&(n[r]=s(void 0,e[r]))}));var u=r.concat(o).concat(i).concat(a),d=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===u.indexOf(e)}));return he.forEach(d,c),n},ge={name:"axios",version:"0.21.4",description:"Promise based HTTP client for the browser and node.js",main:"index.js",scripts:{test:"grunt test",start:"node ./sandbox/server.js",build:"NODE_ENV=production grunt build",preversion:"npm test",version:"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",postversion:"git push && git push --tags",examples:"node ./examples/server.js",coveralls:"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",fix:"eslint --fix lib/**/*.js"},repository:{type:"git",url:"https://github.com/axios/axios.git"},keywords:["xhr","http","ajax","promise","node"],author:"Matt Zabriskie",license:"MIT",bugs:{url:"https://github.com/axios/axios/issues"},homepage:"https://axios-http.com",devDependencies:{coveralls:"^3.0.0","es6-promise":"^4.2.4",grunt:"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1",karma:"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2",minimist:"^1.2.0",mocha:"^8.2.1",sinon:"^4.5.0","terser-webpack-plugin":"^4.2.3",typescript:"^4.0.5","url-search-params":"^0.10.0",webpack:"^4.44.2","webpack-dev-server":"^3.11.0"},browser:{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},jsdelivr:"dist/axios.min.js",unpkg:"dist/axios.min.js",typings:"./index.d.ts",dependencies:{"follow-redirects":"^1.14.0"},bundlesize:[{path:"./dist/axios.min.js",threshold:"5kB"}]},ye={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){ye[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var ve={},be=ge.version.split(".");function Ee(e,t){for(var n=t?t.split("."):be,r=e.split("."),o=0;o<3;o++){if(n[o]>r[o])return!0;if(n[o]<r[o])return!1}return!1}ye.transitional=function(e,t,n){var r=t&&Ee(t);function o(e,t){return"[Axios v"+ge.version+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,i,a){if(!1===e)throw new Error(o(i," has been removed in "+t));return r&&!ve[i]&&(ve[i]=!0,console.warn(o(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,a)}};var Se=T,we=j,Te=R,xe=function(e){return pe(e),e.headers=e.headers||{},e.data=de.call(e,e.data,e.headers,e.transformRequest),e.headers=ue.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),ue.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||fe.adapter)(e).then((function(t){return pe(e),t.data=de.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return le(t)||(pe(e),t&&t.response&&(t.response.data=de.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},Ae=me,je={isOlderVersion:Ee,assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),o=r.length;o-- >0;){var i=r[o],a=t[i];if(a){var s=e[i],c=void 0===s||a(s,i,e);if(!0!==c)throw new TypeError("option "+i+" must be "+c)}else if(!0!==n)throw Error("Unknown option "+i)}},validators:ye},Oe=je.validators;function Pe(e){this.defaults=e,this.interceptors={request:new Te,response:new Te}}Pe.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=Ae(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&je.assertOptions(t,{silentJSONParsing:Oe.transitional(Oe.boolean,"1.0.0"),forcedJSONParsing:Oe.transitional(Oe.boolean,"1.0.0"),clarifyTimeoutError:Oe.transitional(Oe.boolean,"1.0.0")},!1);var n=[],r=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(r=r&&t.synchronous,n.unshift(t.fulfilled,t.rejected))}));var o,i=[];if(this.interceptors.response.forEach((function(e){i.push(e.fulfilled,e.rejected)})),!r){var a=[xe,void 0];for(Array.prototype.unshift.apply(a,n),a=a.concat(i),o=Promise.resolve(e);a.length;)o=o.then(a.shift(),a.shift());return o}for(var s=e;n.length;){var c=n.shift(),u=n.shift();try{s=c(s)}catch(e){u(e);break}}try{o=xe(s)}catch(e){return Promise.reject(e)}for(;i.length;)o=o.then(i.shift(),i.shift());return o},Pe.prototype.getUri=function(e){return e=Ae(this.defaults,e),we(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},Se.forEach(["delete","get","head","options"],(function(e){Pe.prototype[e]=function(t,n){return this.request(Ae(n||{},{method:e,url:t,data:(n||{}).data}))}})),Se.forEach(["post","put","patch"],(function(e){Pe.prototype[e]=function(t,n,r){return this.request(Ae(r||{},{method:e,url:t,data:n}))}}));var Re=Pe;function Ie(e){this.message=e}Ie.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},Ie.prototype.__CANCEL__=!0;var Ne=Ie,Ce=Ne;function De(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new Ce(e),t(n.reason))}))}De.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},De.source=function(){var e;return{token:new De((function(t){e=t})),cancel:e}};var Le=De,Ue=T,ke=h,Me=Re,qe=me;function Be(e){var t=new Me(e),n=ke(Me.prototype.request,t);return Ue.extend(n,Me.prototype,t),Ue.extend(n,t),n}var _e=Be(ie);_e.Axios=Me,_e.create=function(e){return Be(qe(_e.defaults,e))},_e.Cancel=Ne,_e.CancelToken=Le,_e.isCancel=ce,_e.all=function(e){return Promise.all(e)},_e.spread=function(e){return function(t){return e.apply(null,t)}},_e.isAxiosError=function(e){return"object"==typeof e&&!0===e.isAxiosError},p.exports=_e,p.exports.default=_e;var Fe,Ve=p.exports,$e=new Uint8Array(16);function Je(){if(!Fe&&!(Fe="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Fe($e)}var He=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function ze(e){return"string"==typeof e&&He.test(e)}for(var Ge=[],Xe=0;Xe<256;++Xe)Ge.push((Xe+256).toString(16).substr(1));function We(e,t,n){var r=(e=e||{}).random||(e.rng||Je)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(Ge[e[t+0]]+Ge[e[t+1]]+Ge[e[t+2]]+Ge[e[t+3]]+"-"+Ge[e[t+4]]+Ge[e[t+5]]+"-"+Ge[e[t+6]]+Ge[e[t+7]]+"-"+Ge[e[t+8]]+Ge[e[t+9]]+"-"+Ge[e[t+10]]+Ge[e[t+11]]+Ge[e[t+12]]+Ge[e[t+13]]+Ge[e[t+14]]+Ge[e[t+15]]).toLowerCase();if(!ze(n))throw TypeError("Stringified UUID is invalid");return n}(r)}function Ye(e){return isNaN(Number(e))?e:{scaled:Number(e)}}class Ze{static get instance(){return Ze._instance||(Ze._instance=new Ze),Ze._instance}static clearInstance(){Ze._instance=null}static get xapi(){return Ze._xapi}constructor(){if(this.launchParameters=this.getLaunchParametersFromLMS(),!this.launchParameters.fetch)throw Error("Unable to construct, no `fetch` parameter found in URL.");if(!this.launchParameters.endpoint)throw Error("Unable to construct, no `endpoint` parameter found in URL");if(!this.launchParameters.actor)throw Error("Unable to construct, no `actor` parameter found in URL.");if(!this.launchParameters.activityId)throw Error("Unable to construct, no `activityId` parameter found in URL.");if(!this.launchParameters.registration)throw Error("Unable to construct, no `registration` parameter found in URL.")}static get isCmiAvailable(){if(!window||"object"!=typeof window)return!1;if(!window.location||"string"!=typeof window.location.search)return!1;const e=new URLSearchParams(window.location.search);return Boolean(e.get("fetch")&&e.get("endpoint")&&e.get("actor")&&e.get("registration")&&e.get("activityId"))}get isAuthenticated(){return Boolean(Ze._xapi)}getLaunchParameters(){return this.launchParameters}getLaunchData(){return this.launchData}getLearnerPreferences(){return this.learnerPreferences}initialize(){return this.getAuthTokenFromLMS(this.launchParameters.fetch).then((e=>{const n=e.data["auth-token"];return Ze._xapi=new t(this.launchParameters.endpoint,"Basic "+n),this.getLaunchDataFromLMS()})).then((e=>{this.launchData=e.data})).then((()=>this.getLearnerPreferencesFromLMS())).then((e=>{this.learnerPreferences=e.data||{}})).then((()=>(this.initialisedDate=new Date,this.sendCmi5DefinedStatement({verb:r.INITIALIZED}))))}complete(e){return"Normal"!==this.launchData.launchMode?Promise.reject(new Error("Can only send COMPLETED when launchMode is 'Normal'")):this.sendCmi5DefinedStatement({verb:r.COMPLETED,result:{completion:!0,duration:t.calculateISO8601Duration(this.initialisedDate,new Date)},context:{contextActivities:{category:[n.MOVE_ON]}}},e)}pass(e,o){if("Normal"!==this.launchData.launchMode)return Promise.reject(new Error("Can only send PASSED when launchMode is 'Normal'"));const i=Ye(e);if(this.launchData.masteryScore&&(!i||isNaN(Number(i.scaled))||i.scaled<this.launchData.masteryScore))return Promise.reject(new Error("Learner has not met Mastery Score"));const[a,s]=(c=o)&&"Activity"===c.objectType&&"string"==typeof c.id&&c.definition&&"object"==typeof c.definition&&"http://adlnet.gov/expapi/activities/objective"===c.definition.type?[o,void 0]:[o?o.objectiveActivity:void 0,o];var c;return this.sendCmi5DefinedStatement({verb:r.PASSED,result:{...i?{score:i}:{},success:!0,duration:t.calculateISO8601Duration(this.initialisedDate,new Date)},context:{contextActivities:{category:[n.MOVE_ON],...a?{parent:[a]}:{}},...this.launchData.masteryScore?{extensions:{"https://w3id.org/xapi/cmi5/context/extensions/masteryscore":this.launchData.masteryScore}}:{}}},s)}fail(e,o){if("Normal"!==this.launchData.launchMode)return Promise.reject(new Error("Can only send FAILED when launchMode is 'Normal'"));const i=Ye(e);return this.sendCmi5DefinedStatement({verb:r.FAILED,result:{...i?{score:i}:{},success:!1,duration:t.calculateISO8601Duration(this.initialisedDate,new Date)},context:{contextActivities:{category:[n.MOVE_ON]},...this.launchData.masteryScore?{extensions:{"https://w3id.org/xapi/cmi5/context/extensions/masteryscore":this.launchData.masteryScore}}:{}}},o)}terminate(){return this.sendCmi5DefinedStatement({verb:r.TERMINATED,result:{duration:t.calculateISO8601Duration(this.initialisedDate,new Date)}})}progress(e){return this.sendCmi5AllowedStatement({verb:t.Verbs.PROGRESSED,object:{objectType:"Activity",id:this.launchParameters.activityId},result:{extensions:{"https://w3id.org/xapi/cmi5/result/extensions/progress":e}}})}interactionTrueFalse(e,t,n,r,o,i,a,s,c){return this.interaction(e,t,n.toString(),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"true-false",...void 0!==r?{correctResponsesPattern:r?["true"]:["false"]}:{},...o?{name:o}:{},...i?{description:i}:{}},a,s,c)}interactionChoice(e,t,n,r,o,i,a,s,c,u){return this.interaction(e,t,n.join("[,]"),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"choice",...r?{correctResponsesPattern:[r.join("[,]")]}:{},...o?{choices:o}:{},...i?{name:i}:{},...a?{description:a}:{}},s,c,u)}interactionFillIn(e,t,n,r,o,i,a,s,c){return this.interaction(e,t,n.join("[,]"),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"fill-in",...r?{correctResponsesPattern:[r.join("[,]")]}:{},...o?{name:o}:{},...i?{description:i}:{}},a,s,c)}interactionLongFillIn(e,t,n,r,o,i,a,s,c){return this.interaction(e,t,n.join("[,]"),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"long-fill-in",...r?{correctResponsesPattern:[r.join("[,]")]}:{},...o?{name:o}:{},...i?{description:i}:{}},a,s,c)}interactionLikert(e,t,n,r,o,i,a,s,c,u){return this.interaction(e,t,n,{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"likert",...r?{correctResponsesPattern:[r]}:{},...o?{scale:o}:{},...i?{name:i}:{},...a?{description:a}:{}},s,c,u)}interactionMatching(e,t,n,r,o,i,a,s,c,u,d){return this.interaction(e,t,Object.keys(n).map((e=>`${e}[.]${n[e]}`)).join("[,]"),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"matching",...r?{correctResponsesPattern:[Object.keys(r).map((e=>`${e}[.]${r[e]}`)).join("[,]")]}:{},...o?{source:o}:{},...i?{target:i}:{},...a?{name:a}:{},...s?{description:s}:{}},c,u,d)}interactionPerformance(e,t,n,r,o,i,a,s,c,u){return this.interaction(e,t,Object.keys(n).map((e=>`${e}[.]${n[e]}`)).join("[,]"),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"performance",...r?{correctResponsesPattern:[Object.keys(r).map((e=>{const t=r[e].exact?r[e].exact.toString():"",n=r[e].min?r[e].min.toString():"",o=r[e].max?r[e].max.toString():"";return`${e}[.]${t||n+":"+o}`})).join("[,]")]}:{},...o?{steps:o}:{},...i?{name:i}:{},...a?{description:a}:{}},s,c,u)}interactionSequencing(e,t,n,r,o,i,a,s,c,u){return this.interaction(e,t,n.join("[,]"),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"sequencing",...r?{correctResponsesPattern:[r.join("[,]")]}:{},...o?{choices:o}:{},...i?{name:i}:{},...a?{description:a}:{}},s,c,u)}interactionNumeric(e,t,n,r,o,i,a,s,c){return this.interaction(e,t,n.toString(),{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"numeric",...r?{correctResponsesPattern:[""+(r.exact?r.exact:r.min+":"+r.max)]}:{},...o?{name:o}:{},...i?{description:i}:{}},a,s,c)}interactionOther(e,t,n,r,o,i,a,s,c){return this.interaction(e,t,n,{type:"http://adlnet.gov/expapi/activities/cmi.interaction",interactionType:"other",...r?{correctResponsesPattern:[r]}:{},...o?{name:o}:{},...i?{description:i}:{}},a,s,c)}interaction(e,n,r,o,i,a,s){return this.sendCmi5AllowedStatement({verb:t.Verbs.ANSWERED,result:{response:r,...a?{duration:t.calculateISO8601Duration(a.start,a.end)}:{},..."boolean"==typeof i?{success:i}:{}},object:{objectType:"Activity",id:`${this.launchParameters.activityId}/test/${e}/question/${n}`,definition:o},...s?{context:{contextActivities:{parent:[s]}}}:{}})}setResultScore(e,t){return{...t,result:{...t.result||{},score:e}}}async moveOn(e){var t;let n=e;if("Normal"!==this.launchData.launchMode)return Promise.reject(new Error("Can only send FAILED when launchMode is 'Normal'"));const r=[];if(null!==(t=n)&&void 0!==t&&t.score){var o;const e=Ye(null===(o=n)||void 0===o?void 0:o.score);if(this.launchData.masteryScore)e.scaled>=this.launchData.masteryScore?this.appendStatementIds(await this.pass(e,n),r):this.appendStatementIds(await this.fail(e,n),r);else{var i;const t=t=>this.setResultScore(e,t),r=null===(i=n)||void 0===i?void 0:i.transform;n={...n||{},transform:"function"==typeof r?e=>r(t(e)):e=>t(e)}}}return this.appendStatementIds(await this.complete(n),r),null!=e&&e.disableSendTerminated||this.appendStatementIds(await this.terminate(),r),r}appendStatementIds(e,t){t.push.apply(t,e.data)}getLaunchParametersFromLMS(){return t.getSearchQueryParamsAsObject(window.location.href)}getAuthTokenFromLMS(e){return Ve.post(e)}getLaunchDataFromLMS(){return Ze._xapi.getState(this.launchParameters.actor,this.launchParameters.activityId,"LMS.LaunchData",this.launchParameters.registration)}getLearnerPreferencesFromLMS(){return Ze._xapi.getAgentProfile(this.launchParameters.actor,"cmi5LearnerPreferences").then((e=>e.data),(()=>({})))}sendCmi5DefinedStatement(e,t){const r={object:{objectType:"Activity",id:this.launchParameters.activityId},context:{contextActivities:{category:[n.CMI5]}}},o=f.all([r,e]);return this.sendCmi5AllowedStatement(o,t)}sendCmi5AllowedStatement(e,t){const n=We(),r=this.launchParameters.actor,o=(new Date).toISOString(),i=Object.assign({},this.launchData.contextTemplate);i.registration=this.launchParameters.registration;const a={id:n,actor:r,timestamp:o,context:i},s=f.all([a,e]),c=t&&"function"==typeof t.transform?t.transform(s):s;return Ze._xapi.sendStatement(c)}}return Ze._instance=null,Ze._xapi=null,Ze}));
{
"name": "@xapi/cmi5",
"version": "1.1.2",
"version": "1.1.3",
"description": "Communicate over the xAPI cmi5 profile using JavaScript.",

@@ -47,5 +47,6 @@ "module": "dist/Cmi5.esm.js",

"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^19.0.0",
"@rollup/plugin-commonjs": "^20.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.0.0",
"@types/jest": "^26.0.24",
"@types/jest": "^27.0.1",
"@types/node": "^16.3.2",

@@ -59,3 +60,3 @@ "@typescript-eslint/eslint-plugin": "^4.17.0",

"eslint-plugin-jest": "^24.2.1",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-prettier": "^4.0.0",
"jest": "^27.0.6",

@@ -71,4 +72,4 @@ "mockdate": "^3.0.2",

"dependencies": {
"@xapi/xapi": "^1.2.1",
"axios": "^0.21.1",
"@xapi/xapi": "^1.2.2",
"axios": "^0.21.4",
"deepmerge": "^4.2.2",

@@ -75,0 +76,0 @@ "uuid": "^8.3.2"

@@ -1,2 +0,2 @@

![Test](https://github.com/xapijs/cmi5/workflows/Test/badge.svg)
[![npm version](https://img.shields.io/npm/v/@xapi/cmi5.svg)](https://www.npmjs.com/package/@xapi/cmi5) ![Test](https://github.com/xapijs/cmi5/workflows/Test/badge.svg)

@@ -3,0 +3,0 @@ [<img width="100" src="https://avatars3.githubusercontent.com/u/65084607?s=200&v=4" alt="xAPI.js logo">](https://www.xapijs.dev)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc