Free javascript Hosting


learnosity.js

Uploaded on Apr 11 2022 16:20 by saloni.parekh

/*************************************************************
* Learnosity Items API version v1.108.7
*
* Documentation available at: https://reference.learnosity.com
*
* Copyright 2011 - 2022 Learnosity - https://www.learnosity.com
*/
var console=window.console||{log:function(){},error:function(){}},LearnosityItems=window.LearnosityItems||function(){var o={},r=["primeOffline","needsPushing","push","offline"];function e(r){return"1"===(r=r.slice(0))||"true"===r}o.version="v1.108.7",o.versions={requested:"v2021.2.LTS",mapped:"v1.108",concrete:"v1.108.7",server:"v2021.2.LTS",assets:"v1.108.7"},o.errors=[],o._internal={},o._internal.instanceCachedMethodCalls=[],o._internal.instanceMethodsToCache=["on","off","once","reset"],o._internal.getDirectionProperty=function(){var r=document.querySelector("script[data-lrn-dir]"),e=r?r.dataset.lrnDir:null;return e&&-1!==["ltr","rtl","ltr-rtl","rtl-ltr"].indexOf(e)?e:null},o._internal.config={apiHost:"https://items.learnosity.com/"+o.versions.server,assetsHost:"https://items.learnosity.com/"+o.versions.assets,assessApiPath:"https://assess.learnosity.com/",questionsApiPath:"https://api-va.learnosity.com/",questionsApiV2Path:"https://questions.learnosity.com/",eventsApiPath:"https://events.learnosity.com",eventsPublicTopicName:"items_public",annotationsApiPath:"https://annotations.learnosity.com/",devEnvironment:e("false"),itemsRequestedVersion:o.versions.requested,assessApiVersion:0!=="v2021.2.LTS".indexOf("{:")?"v2021.2.LTS":null,questionsApiVersion:0!=="v2021.2.LTS".indexOf("{:")?"v2021.2.LTS":null,eventsApiVersion:0!=="v2021.2.LTS".indexOf("{:")?"v2021.2.LTS":null,annotationsApiVersion:0!=="v2021.2.LTS".indexOf("{:")?"v2021.2.LTS":null,sharedLibUrl:"https://shared.learnosity.com",appContext:"Items API",gtmContainerID:"GTM-5ZVXFJ",gtmDataLayer:"lrnDataLayer",disableGTM:e("1"),textDirection:o._internal.getDirectionProperty(),rollbarEnabled:e("1"),rollbarJsUrl:"https://shared.learnosity.com/vendor/rollbar.min.js"},o._internal.addScriptToDom=function(r){var e=document.createElement("script"),n=document.getElementsByTagName("head")[0];o._internal.config.devEnvironment&&-1===r.indexOf("?")&&(r+="?bust="+(new Date).getTime()),e.src=r,e.onerror=function(){o._internal.apiLoadingFailed={code:50014,msg:"Failed loading Items API, can't load required modules",detail:"Couldn't load "+r},o._internal._cachedInitCalls&&o._internal.onScriptLoadError()},n.appendChild(e)},o._internal.onScriptLoadError=function(){var r,e,n=o._internal._cachedInitCalls&&o._internal._cachedInitCalls[0]&&o._internal._cachedInitCalls[0].args;if(n)for(var t=n.length-1;0<=t&&!r;t--)"[object Function]"===Object.prototype.toString.call(n[t].errorListener)&&(r=n[t].errorListener);e=o._internal.apiLoadingFailed,o.errors=[e],console.error(e.code+": "+e.msg+". View this error on LearnosityItems.errors[0]"),r?r(e):window.alert(e.msg+"\n\nPlease contact your administrator if you require further assistance.")},o.init=function(){this._internal._cachedInitCalls||(this._internal._cachedInitCalls=[]);var r={},e=Array.prototype.slice.call(arguments);return e.push({appStub:r}),this._internal._cachedInitCalls.push({args:e}),function(e){for(var r=o._internal.instanceMethodsToCache,n=0;n<r.length;n++)e[r[n]]=function(r){return function(){o._internal.instanceCachedMethodCalls.push({method:r,appStub:e,args:Array.prototype.slice.call(arguments)})}}(r[n])}(r),o._internal.apiLoadingFailed&&o._internal.onScriptLoadError(),r};for(var n=0;n<r.length;n++)!function(r){o[r]=function(){o._internal._cachedMethodCalls||(o._internal._cachedMethodCalls=[]),o._internal._cachedMethodCalls.push({method:r,args:Array.prototype.slice.call(arguments)})}}(r[n]);var s,t,a,l,i,c,d=o._internal.config;function p(r){if(c[r])return c[r].exports;var e=c[r]={exports:{},id:r,loaded:!1};return i[r].call(e.exports,e,e.exports,p),e.loaded=!0,e.exports}return d.rollbarEnabled&&(o._internal.rollbarInstance=(s=d,t=o.version,a="ffdf30e083164f7584ba5ca58c8cc3b8",window.rollbar||(l={enabled:!1,rollbarJsUrl:s.rollbarJsUrl},c={},p.m=i=[function(r,e,n){"use strict";var t=n(1),o=n(4);(l=l||{}).rollbarJsUrl=l.rollbarJsUrl||"https://cdnjs.cloudflare.com/ajax/libs/rollbar.js/2.4.6/rollbar.min.js",l.async=void 0===l.async||l.async;var a=t.setupShim(window,l),i=o(l);window.rollbar=t.Rollbar,a.loadFull(window,document,!l.async,l,i)},function(r,e,n){"use strict";function c(r){return function(){try{return r.apply(this,arguments)}catch(r){try{console.error("[Rollbar]: Internal error",r)}catch(r){}}}}function t(r,e){this.options=r,this._rollbarOldOnError=null;var n=l++;this.shimId=function(){return n},"undefined"!=typeof window&&window._rollbarShims&&(window._rollbarShims[n]={handler:e,messages:[]})}function o(r,e){return new t(r,e)}function a(r){return new s(o,r)}var i=n(2),l=0,s=n(3);t.prototype.loadFull=function(i,r,e,n,l){var t=!1,o=r.createElement("script"),a=r.getElementsByTagName("script")[0],s=a.parentNode;o.crossOrigin="",o.src=n.rollbarJsUrl,e||(o.async=!0),o.onload=o.onreadystatechange=c(function(){if(!(t||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState)){o.onload=o.onreadystatechange=null;try{s.removeChild(o)}catch(r){}t=!0,function(){var r;if(void 0===i._rollbarDidLoad){r=new Error("rollbar.js did not load");for(var e,n,t,o,a=0;e=i._rollbarShims[a++];)for(e=e.messages||[];n=e.shift();)for(t=n.args||[],a=0;a<t.length;++a)if("function"==typeof(o=t[a])){o(r);break}}"function"==typeof l&&l(r)}()}}),s.insertBefore(o,a)},t.prototype.wrap=function(n,r,t){try{var o="function"==typeof r?r:function(){return r||{}};if("function"!=typeof n)return n;if(n._isWrap)return n;if(!n._rollbar_wrapped&&(n._rollbar_wrapped=function(){t&&"function"==typeof t&&t.apply(this,arguments);try{return n.apply(this,arguments)}catch(r){var e=r;throw e&&("string"==typeof e&&(e=new String(e)),e._rollbarContext=o()||{},e._rollbarContext._wrappedSource=n.toString(),window._rollbarWrappedError=e),e}},n._rollbar_wrapped._isWrap=!0,n.hasOwnProperty))for(var e in n)n.hasOwnProperty(e)&&(n._rollbar_wrapped[e]=n[e]);return n._rollbar_wrapped}catch(r){return n}};for(var d="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleUnhandledRejection,captureEvent,captureDomContentLoaded,captureLoad".split(","),p=0;p<d.length;++p)t.prototype[d[p]]=function(n){return c(function(){var r=Array.prototype.slice.call(arguments,0),e={shim:this,method:n,args:r,ts:new Date};window._rollbarShims[this.shimId()].messages.push(e)})}(d[p]);r.exports={setupShim:function(e,n){if(e){var t=n.globalAlias||"Rollbar";if("object"==typeof e[t])return e[t];e._rollbarShims={},e._rollbarWrappedError=null;var o=new a(n);return c(function(){n.captureUncaught&&(o._rollbarOldOnError=e.onerror,i.captureUncaughtExceptions(e,o,!0),i.wrapGlobals(e,o,!0)),n.captureUnhandledRejections&&i.captureUnhandledRejections(e,o,!0);var r=n.autoInstrument;return!1!==n.enabled&&(void 0===r||!0===r||"object"==typeof r&&r.network)&&e.addEventListener&&(e.addEventListener("load",o.captureLoad.bind(o)),e.addEventListener("DOMContentLoaded",o.captureDomContentLoaded.bind(o))),e[t]=o})()}},Rollbar:a}},function(r,e){"use strict";r.exports={captureUncaughtExceptions:function(a,i,r){if(a){var l;if("function"==typeof i._rollbarOldOnError)l=i._rollbarOldOnError;else if(a.onerror){for(l=a.onerror;l._rollbarOldOnError;)l=l._rollbarOldOnError;i._rollbarOldOnError=l}var e=function(){var r,e,n,t,o=Array.prototype.slice.call(arguments,0);e=i,n=l,t=o,(r=a)._rollbarWrappedError&&(t[4]||(t[4]=r._rollbarWrappedError),t[5]||(t[5]=r._rollbarWrappedError._rollbarContext),r._rollbarWrappedError=null),e.handleUncaughtException.apply(e,t),n&&n.apply(r,t)};r&&(e._rollbarOldOnError=l),a.onerror=e}},captureUnhandledRejections:function(r,o,e){var n;r&&("function"==typeof r._rollbarURH&&r._rollbarURH.belongsToShim&&r.removeEventListener("unhandledrejection",r._rollbarURH),(n=function(r){var e,n,t;try{e=r.reason}catch(r){e=void 0}try{n=r.promise}catch(r){n="[unhandledrejection] error getting `promise` from event"}try{t=r.detail,!e&&t&&(e=t.reason,n=t.promise)}catch(r){t="[unhandledrejection] error getting `detail` from event"}e=e||"[unhandledrejection] error getting `reason` from event",o&&o.handleUnhandledRejection&&o.handleUnhandledRejection(e,n)}).belongsToShim=e,r._rollbarURH=n,r.addEventListener("unhandledrejection",n))},wrapGlobals:function(r,e,n){if(r)for(var t,o="EventTarget,Window,Node,ApplicationCache,AudioTrackList,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(","),a=0;a<o.length;++a)r[t=o[a]]&&r[t].prototype&&function(t,r,e){if(r.hasOwnProperty&&r.hasOwnProperty("addEventListener")){for(var o=r.addEventListener;o._rollbarOldAdd&&o.belongsToShim;)o=o._rollbarOldAdd;var n=function(r,e,n){o.call(this,r,t.wrap(e),n)};n._rollbarOldAdd=o,n.belongsToShim=e,r.addEventListener=n;for(var a=r.removeEventListener;a._rollbarOldRemove&&a.belongsToShim;)a=a._rollbarOldRemove;var i=function(r,e,n){a.call(this,r,e&&e._rollbar_wrapped||e,n)};i._rollbarOldRemove=a,i.belongsToShim=e,r.removeEventListener=i}}(e,r[t].prototype,n)}}},function(r,e){"use strict";function n(r,e){this.impl=r(e,this),this.options=e,function(r){for(var e="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleUnhandledRejection,_createItem,wrap,loadFull,shimId,captureEvent,captureDomContentLoaded,captureLoad".split(","),n=0;n<e.length;n++)r[e[n]]=function(e){return function(){var r=Array.prototype.slice.call(arguments,0);if(this.impl[e])return this.impl[e].apply(this.impl,r)}}(e[n])}(n.prototype)}n.prototype._swapAndProcessMessages=function(r,e){this.impl=r(this.options);for(var n,t,o;n=e.shift();)t=n.method,o=n.args,this[t]&&"function"==typeof this[t]&&("captureDomContentLoaded"===t||"captureLoad"===t?this[t].apply(this,[o[0],n.ts]):this[t].apply(this,o));return this},r.exports=n},function(r,e){"use strict";r.exports=function(l){return function(r){if(!r&&!window._rollbarInitialized){for(var e,n,t=(l=l||{}).globalAlias||"Rollbar",o=window.rollbar,a=function(r){return new o(r)},i=0;e=window._rollbarShims[i++];)n=n||e.handler,e.handler._swapAndProcessMessages(a,e.messages);window[t]=n,window._rollbarInitialized=!0}}}}],p.c=c,p.p="",p(0)),new window.rollbar({accessToken:a,autoInstrument:!1,captureIp:!1,captureUncaught:!0,captureUnhandledRejections:!0,checkIgnore:function(r,e,n){var t,o=n&&(n.body||n.data),a=o&&o.trace,i=a&&a.frames,l=i&&0<i.length&&i[i.length-1];return!("string"==typeof(t=l&&l.filename)&&0<=t.indexOf(s.apiHost))},enabled:!0,payload:{client:{code_version:t,source_map_enabled:!0},environment:s.devEnvironment||0<=s.apiHost.indexOf(".vg.learnosity.com/")?"development":0<=s.apiHost.indexOf(".staging.learnosity.com/")?"staging":"production"},reportLevel:"error",scrubTelemetryInputs:!0,transform:function(r){var e,n=r&&(r.body||r.data),t=n&&n.trace,o=t&&t.frames;if(o)for(var a={filename:"<anonymous>",lineno:0},i=0;i<o.length;i++){var l=o[i];!l||"string"==typeof(e=l.filename)&&0<=e.indexOf(".learnosity.com/")||o.splice(i,1,a)}}}))),o._internal.addScriptToDom(d.assetsHost+"/dist/api.js"),o}();

Back to list