{"version":3,"sources":["https:\/\/moosa-el.medad.com\/blocks\/learnerscript\/amd\/src\/timeme.js"],"names":["root","factory","module","exports","define","amd","TimeMe","startStopTimes","idleTimeoutMs","currentIdleTimeMs","checkStateRateMs","active","idle","currentPageName","timeElapsedCallbacks","userLeftCallbacks","userReturnCallbacks","trackTimeOnElement","elementId","element","document","getElementById","addEventListener","startTimer","stopTimer","getTimeOnElementInSeconds","time","getTimeOnPageInSeconds","pageName","startTime","arrayOfTimes","latestStartStopEntry","length","stopTime","push","Date","stopAllTimers","pageNames","Object","keys","i","getTimeOnCurrentPageInSeconds","timeInMs","getTimeOnPageInMilliseconds","getTimeOnCurrentPageInMilliseconds","totalTimeOnPage","timeSpentOnPageInSeconds","difference","getTimeOnAllPagesInSeconds","allTimes","timeOnPage","setIdleDurationInSeconds","duration","durationFloat","parseFloat","isNaN","name","message","setCurrentPageName","resetRecordedPageTime","resetAllRecordedPageTimes","resetIdleCountdown","triggerUserHasReturned","callWhenUserLeaves","callback","numberOfTimesToInvoke","callWhenUserReturns","userReturnedCallback","numberTimes","triggerUserHasLeftPage","userHasLeftCallback","callAfterTimeElapsedInSeconds","timeInSeconds","pending","checkState","visibilityChangeEventName","hiddenPropName","listenForVisibilityEvents","hidden","mozHidden","msHidden","webkitHidden","window","setInterval","websocket","websocketHost","setUpWebsocket","websocketOptions","WebSocket","onbeforeunload","sendCurrentTime","appId","onopen","sendInitWsRequest","onerror","error","console","log","onmessage","event","data","websocketSend","send","JSON","stringify","timeSpentOnPage","type","timeOnPageMs","initialize","options","idleTimeoutInSeconds","initialStartTime","call"],"mappings":"AAmBA,CAAC,UAAY,CACZ,CAAC,SAAUA,CAAV,CAAgBC,CAAhB,CAAyB,CACzB,GAAsB,WAAlB,QAAOC,CAAAA,MAAP,EAAiCA,MAAM,CAACC,OAA5C,CAAqD,CAEpD,MAAOD,CAAAA,MAAM,CAACC,OAAP,CAAiBF,CAAO,EAC\/B,CAHD,IAGO,IAAsB,UAAlB,QAAOG,CA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VK,IAAI,CAAE,MADI,CAEVf,KAAK,CAAEA,CAFG,CAIX,CACA,CA\/VW,CAiWZiB,UAAU,CAAE,oBAAUC,CAAV,CAAmB,IAE1BC,CAAAA,CAAoB,CAAGxG,CAAM,CAACE,aAAP,EAAwB,EAFrB,CAG1BK,CAAe,CAAGP,CAAM,CAACO,eAAP,EAA0B,mBAHlB,CAI1B0E,CAAgB,OAJU,CAK1BwB,CAAgB,OALU,CAO9B,GAAIF,CAAJ,CAAa,CACZC,CAAoB,CAAGD,CAAO,CAACC,oBAAR,EAAgCA,CAAvD,CACAjG,CAAe,CAAGgG,CAAO,CAAChG,eAAR,EAA2BA,CAA7C,CACA0E,CAAgB,CAAGsB,CAAO,CAACtB,gBAA3B,CACAwB,CAAgB,CAAGF,CAAO,CAACE,gBAC3B,CAEDzG,CAAM,CAAC6C,wBAAP,CAAgC2D,CAAhC,EACEpD,kBADF,CACqB7C,CADrB,EAEEyE,cAFF,CAEiBC,CAFjB,EAGEV,yBAHF,GAOAvE,CAAM,CAACiB,UAAP,QAA6BwF,CAA7B,CACA,CAvXW,CAAb,CAyXA,MAAOzG,CAAAA,CACP,CAzYD,CA0YA,CA3YD,EA2YG0G,IA3YH,CA2YQ,IA3YR","sourcesContent":["\/*Copyright (c) 2017 Jason Zissman\r\nPermission is hereby granted, free of charge, to any person obtaining a copy of\r\nthis software and associated documentation files (the \"Software\"), to deal in\r\nthe Software without restriction, including without limitation the rights to\r\nuse, copy, modify, merge, publish, distribute, sublicense, and\/or sell copies of\r\nthe Software, and to permit persons to whom the Software is furnished to do so,\r\nsubject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all\r\ncopies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*\/\r\n\r\n(function () {\r\n\t(function (root, factory) {\r\n\t\tif (typeof module !== 'undefined' && module.exports) {\r\n\t\t\t\/\/ CommonJS\r\n\t\t\treturn module.exports = factory();\r\n\t\t} else if (typeof define === 'function' && define.amd) {\r\n\t\t\t\/\/ AMD\r\n\t\t\tdefine([], function () {\r\n\t\t\t\treturn (root.TimeMe = factory());\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\t\/\/ Global Variables\r\n\t\t\treturn root.TimeMe = factory();\r\n\t\t}\r\n\t})(this, function () {\r\n\r\n\t\tvar TimeMe = {\r\n\r\n\t\t\tstartStopTimes: {},\r\n\t\t\tidleTimeoutMs: 30 * 1000,\r\n\t\t\tcurrentIdleTimeMs: 0,\r\n\t\t\tcheckStateRateMs: 250,\r\n\t\t\tactive: false,\r\n\t\t\tidle: false,\r\n\t\t\tcurrentPageName: \"default-page-name\",\r\n\t\t\ttimeElapsedCallbacks: [],\r\n\t\t\tuserLeftCallbacks: [],\r\n\t\t\tuserReturnCallbacks: [],\r\n\r\n\t\t\ttrackTimeOnElement: function (elementId) {\r\n\t\t\t\tvar element = document.getElementById(elementId);\r\n\t\t\t\tif (element) {\r\n\t\t\t\t\telement.addEventListener(\"mouseover\", function () {\r\n\t\t\t\t\t\tTimeMe.startTimer(elementId);\r\n\t\t\t\t\t});\r\n\t\t\t\t\telement.addEventListener(\"mousemove\", function () {\r\n\t\t\t\t\t\tTimeMe.startTimer(elementId);\r\n\t\t\t\t\t});\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mouseleave\", function () {\r\n\t\t\t\t\t\tTimeMe.stopTimer(elementId);\r\n\t\t\t\t\t});\r\n\t\t\t\t\telement.addEventListener(\"keypress\", function () {\r\n\t\t\t\t\t\tTimeMe.startTimer(elementId);\r\n\t\t\t\t\t});\r\n\t\t\t\t\telement.addEventListener(\"focus\", function () {\r\n\t\t\t\t\t\tTimeMe.startTimer(elementId);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\tgetTimeOnElementInSeconds: function (elementId) {\r\n\t\t\t\tvar time = TimeMe.getTimeOnPageInSeconds(elementId);\r\n\t\t\t\tif (time) {\r\n\t\t\t\t\treturn time;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn 0;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\/\/ startTime is optional. If provided, must be of type Date(). By providing\r\n\t\t\t\/\/ startTime, you are overriding the internal timing mechanism and manually\r\n\t\t\t\/\/ indicating the start time.\r\n\t\t\tstartTimer: function (pageName, startTime) {\r\n\t\t\t\tif (!pageName) {\r\n\t\t\t\t\tpageName = TimeMe.currentPageName;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (TimeMe.startStopTimes[pageName] === undefined) {\r\n\t\t\t\t\tTimeMe.startStopTimes[pageName] = [];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar arrayOfTimes = TimeMe.startStopTimes[pageName];\r\n\t\t\t\t\tvar latestStartStopEntry = arrayOfTimes[arrayOfTimes.length - 1];\r\n\t\t\t\t\tif (latestStartStopEntry !== undefined && latestStartStopEntry.stopTime === undefined) {\r\n\t\t\t\t\t\t\/\/ Can't start new timer until previous finishes.\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tTimeMe.startStopTimes[pageName].push({\r\n\t\t\t\t\t\"startTime\": startTime || new Date(),\r\n\t\t\t\t\t\"stopTime\": undefined\r\n\t\t\t\t});\r\n\t\t\t\tTimeMe.active = true;\r\n\t\t\t},\r\n\r\n\t\t\tstopAllTimers: function () {\r\n\t\t\t\tvar pageNames = Object.keys(TimeMe.startStopTimes);\r\n\t\t\t\tfor (var i = 0; i < pageNames.length; i++) {\r\n\t\t\t\t\tTimeMe.stopTimer(pageNames[i]);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\/\/ stopTime is optional. If provided, must be of type Date(). By providing\r\n\t\t\t\/\/ stopTime, you are overriding the internal timing mechanism and manually\r\n\t\t\t\/\/ indicating the stop time.\r\n\t\t\tstopTimer: function (pageName, stopTime) {\r\n\t\t\t\tif (!pageName) {\r\n\t\t\t\t\tpageName = TimeMe.currentPageName;\r\n\t\t\t\t}\r\n\t\t\t\tvar arrayOfTimes = TimeMe.startStopTimes[pageName];\r\n\t\t\t\tif (arrayOfTimes === undefined || arrayOfTimes.length === 0) {\r\n\t\t\t\t\t\/\/ Can't stop timer before you've started it.\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tif (arrayOfTimes[arrayOfTimes.length - 1].stopTime === undefined) {\r\n\t\t\t\t\tarrayOfTimes[arrayOfTimes.length - 1].stopTime = stopTime || new Date();\r\n\t\t\t\t}\r\n\t\t\t\tTimeMe.active = false;\r\n\t\t\t},\r\n\r\n\t\t\tgetTimeOnCurrentPageInSeconds: function () {\r\n\t\t\t\treturn TimeMe.getTimeOnPageInSeconds(TimeMe.currentPageName);\r\n\t\t\t},\r\n\r\n\t\t\tgetTimeOnPageInSeconds: function (pageName) {\r\n\t\t\t\tvar timeInMs = TimeMe.getTimeOnPageInMilliseconds(pageName);\r\n\t\t\t\tif (timeInMs === undefined) {\r\n\t\t\t\t\treturn undefined;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn timeInMs \/ 1000;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\tgetTimeOnCurrentPageInMilliseconds: function () {\r\n\t\t\t\treturn TimeMe.getTimeOnPageInMilliseconds(TimeMe.currentPageName);\r\n\t\t\t},\r\n\r\n\t\t\tgetTimeOnPageInMilliseconds: function (pageName) {\r\n\r\n\t\t\t\tvar totalTimeOnPage = 0;\r\n\r\n\t\t\t\tvar arrayOfTimes = TimeMe.startStopTimes[pageName];\r\n\t\t\t\tif (arrayOfTimes === undefined) {\r\n\t\t\t\t\t\/\/ Can't get time on page before you've started the timer.\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar timeSpentOnPageInSeconds = 0;\r\n\t\t\t\tfor (var i = 0; i < arrayOfTimes.length; i++) {\r\n\t\t\t\t\tvar startTime = arrayOfTimes[i].startTime;\r\n\t\t\t\t\tvar stopTime = arrayOfTimes[i].stopTime;\r\n\t\t\t\t\tif (stopTime === undefined) {\r\n\t\t\t\t\t\tstopTime = new Date();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar difference = stopTime - startTime;\r\n\t\t\t\t\ttimeSpentOnPageInSeconds += (difference);\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttotalTimeOnPage = Number(timeSpentOnPageInSeconds);\r\n\t\t\t\treturn totalTimeOnPage;\r\n\t\t\t},\r\n\r\n\t\t\tgetTimeOnAllPagesInSeconds: function () {\r\n\t\t\t\tvar allTimes = [];\r\n\t\t\t\tvar pageNames = Object.keys(TimeMe.startStopTimes);\r\n\t\t\t\tfor (var i = 0; i < pageNames.length; i++) {\r\n\t\t\t\t\tvar pageName = pageNames[i];\r\n\t\t\t\t\tvar timeOnPage = TimeMe.getTimeOnPageInSeconds(pageName);\r\n\t\t\t\t\tallTimes.push({\r\n\t\t\t\t\t\t\"pageName\": pageName,\r\n\t\t\t\t\t\t\"timeOnPage\": timeOnPage\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\treturn allTimes;\r\n\t\t\t},\r\n\r\n\t\t\tsetIdleDurationInSeconds: function (duration) {\r\n\t\t\t\tvar durationFloat = parseFloat(duration);\r\n\t\t\t\tif (isNaN(durationFloat) === false) {\r\n\t\t\t\t\tTimeMe.idleTimeoutMs = duration * 1000;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthrow {\r\n\t\t\t\t\t\tname: \"InvalidDurationException\",\r\n\t\t\t\t\t\tmessage: \"An invalid duration time (\" + duration + \") was provided.\"\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t\treturn this;\r\n\t\t\t},\r\n\r\n\t\t\tsetCurrentPageName: function (pageName) {\r\n\t\t\t\tTimeMe.currentPageName = pageName;\r\n\t\t\t\treturn this;\r\n\t\t\t},\r\n\r\n\t\t\tresetRecordedPageTime: function (pageName) {\r\n\t\t\t\tdelete TimeMe.startStopTimes[pageName];\r\n\t\t\t},\r\n\r\n\t\t\tresetAllRecordedPageTimes: function () {\r\n\t\t\t\tvar pageNames = Object.keys(TimeMe.startStopTimes);\r\n\t\t\t\tfor (var i = 0; i < pageNames.length; i++) {\r\n\t\t\t\t\tTimeMe.resetRecordedPageTime(pageNames[i]);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\tresetIdleCountdown: function () {\r\n\t\t\t\tif (TimeMe.idle) {\r\n\t\t\t\t\tTimeMe.triggerUserHasReturned();\r\n\t\t\t\t}\r\n\t\t\t\tTimeMe.idle = false;\r\n\t\t\t\tTimeMe.currentIdleTimeMs = 0;\r\n\t\t\t},\r\n\r\n\t\t\tcallWhenUserLeaves: function (callback, numberOfTimesToInvoke) {\r\n\t\t\t\tthis.userLeftCallbacks.push({\r\n\t\t\t\t\tcallback: callback,\r\n\t\t\t\t\tnumberOfTimesToInvoke: numberOfTimesToInvoke\r\n\t\t\t\t})\r\n\t\t\t},\r\n\r\n\t\t\tcallWhenUserReturns: function (callback, numberOfTimesToInvoke) {\r\n\t\t\t\tthis.userReturnCallbacks.push({\r\n\t\t\t\t\tcallback: callback,\r\n\t\t\t\t\tnumberOfTimesToInvoke: numberOfTimesToInvoke\r\n\t\t\t\t})\r\n\t\t\t},\r\n\r\n\t\t\ttriggerUserHasReturned: function () {\r\n\t\t\t\tif (!TimeMe.active) {\r\n\t\t\t\t\tfor (var i = 0; i < this.userReturnCallbacks.length; i++) {\r\n\t\t\t\t\t\tvar userReturnedCallback = this.userReturnCallbacks[i];\r\n\t\t\t\t\t\tvar numberTimes = userReturnedCallback.numberOfTimesToInvoke;\r\n\t\t\t\t\t\tif (isNaN(numberTimes) || (numberTimes === undefined) || numberTimes > 0) {\r\n\t\t\t\t\t\t\tuserReturnedCallback.numberOfTimesToInvoke -= 1;\r\n\t\t\t\t\t\t\tuserReturnedCallback.callback();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tTimeMe.startTimer();\r\n\t\t\t},\r\n\r\n\t\t\ttriggerUserHasLeftPage: function () {\r\n\t\t\t\tif (TimeMe.active) {\r\n\t\t\t\t\tfor (var i = 0; i < this.userLeftCallbacks.length; i++) {\r\n\t\t\t\t\t\tvar userHasLeftCallback = this.userLeftCallbacks[i];\r\n\t\t\t\t\t\tvar numberTimes = userHasLeftCallback.numberOfTimesToInvoke;\r\n\t\t\t\t\t\tif (isNaN(numberTimes) || (numberTimes === undefined) || numberTimes > 0) {\r\n\t\t\t\t\t\t\tuserHasLeftCallback.numberOfTimesToInvoke -= 1;\r\n\t\t\t\t\t\t\tuserHasLeftCallback.callback();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tTimeMe.stopAllTimers();\r\n\t\t\t},\r\n\r\n\t\t\tcallAfterTimeElapsedInSeconds: function (timeInSeconds, callback) {\r\n\t\t\t\tTimeMe.timeElapsedCallbacks.push({\r\n\t\t\t\t\ttimeInSeconds: timeInSeconds,\r\n\t\t\t\t\tcallback: callback,\r\n\t\t\t\t\tpending: true\r\n\t\t\t\t});\r\n\t\t\t},\r\n\r\n\t\t\tcheckState: function () {\r\n\t\t\t\tfor (var i = 0; i < TimeMe.timeElapsedCallbacks.length; i++) {\r\n\t\t\t\t\tif (TimeMe.timeElapsedCallbacks[i].pending && TimeMe.getTimeOnCurrentPageInSeconds() > TimeMe.timeElapsedCallbacks[i].timeInSeconds) {\r\n\t\t\t\t\t\tTimeMe.timeElapsedCallbacks[i].callback();\r\n\t\t\t\t\t\tTimeMe.timeElapsedCallbacks[i].pending = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (TimeMe.idle === false && TimeMe.currentIdleTimeMs > TimeMe.idleTimeoutMs) {\r\n\t\t\t\t\tTimeMe.idle = true;\r\n\t\t\t\t\tTimeMe.triggerUserHasLeftPage();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tTimeMe.currentIdleTimeMs += TimeMe.checkStateRateMs;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\tvisibilityChangeEventName: undefined,\r\n\t\t\thiddenPropName: undefined,\r\n\r\n\t\t\tlistenForVisibilityEvents: function () {\r\n\r\n\t\t\t\tif (typeof document.hidden !== \"undefined\") {\r\n\t\t\t\t\tTimeMe.hiddenPropName = \"hidden\";\r\n\t\t\t\t\tTimeMe.visibilityChangeEventName = \"visibilitychange\";\r\n\t\t\t\t} else if (typeof document.mozHidden !== \"undefined\") {\r\n\t\t\t\t\tTimeMe.hiddenPropName = \"mozHidden\";\r\n\t\t\t\t\tTimeMe.visibilityChangeEventName = \"mozvisibilitychange\";\r\n\t\t\t\t} else if (typeof document.msHidden !== \"undefined\") {\r\n\t\t\t\t\tTimeMe.hiddenPropName = \"msHidden\";\r\n\t\t\t\t\tTimeMe.visibilityChangeEventName = \"msvisibilitychange\";\r\n\t\t\t\t} else if (typeof document.webkitHidden !== \"undefined\") {\r\n\t\t\t\t\tTimeMe.hiddenPropName = \"webkitHidden\";\r\n\t\t\t\t\tTimeMe.visibilityChangeEventName = \"webkitvisibilitychange\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdocument.addEventListener(TimeMe.visibilityChangeEventName, function () {\r\n\t\t\t\t\tif (document[TimeMe.hiddenPropName]) {\r\n\t\t\t\t\t\tTimeMe.triggerUserHasLeftPage();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tTimeMe.triggerUserHasReturned();\r\n\t\t\t\t\t}\r\n\t\t\t\t}, false);\r\n\r\n\t\t\t\twindow.addEventListener('blur', function () {\r\n\t\t\t\t\tTimeMe.triggerUserHasLeftPage();\r\n\t\t\t\t});\r\n\r\n\t\t\t\twindow.addEventListener('focus', function () {\r\n\t\t\t\t\tTimeMe.triggerUserHasReturned();\r\n\t\t\t\t});\r\n\r\n\t\t\t\tdocument.addEventListener(\"mousemove\", function () { TimeMe.resetIdleCountdown(); });\r\n\t\t\t\tdocument.addEventListener(\"keyup\", function () { TimeMe.resetIdleCountdown(); });\r\n\t\t\t\tdocument.addEventListener(\"touchstart\", function () { TimeMe.resetIdleCountdown(); });\r\n\t\t\t\twindow.addEventListener(\"scroll\", function () { TimeMe.resetIdleCountdown(); });\r\n\r\n\t\t\t\tsetInterval(function () {\r\n\t\t\t\t\tTimeMe.checkState();\r\n\t\t\t\t}, TimeMe.checkStateRateMs);\r\n\t\t\t},\r\n\r\n\t\t\twebsocket: undefined,\r\n\r\n\t\t\twebsocketHost: undefined,\r\n\r\n\t\t\tsetUpWebsocket: function (websocketOptions) {\r\n\t\t\t\tif (window.WebSocket && websocketOptions) {\r\n\t\t\t\t\tvar websocketHost = websocketOptions.websocketHost; \/\/ \"ws:\/\/hostname:port\"\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tTimeMe.websocket = new WebSocket(websocketHost);\r\n\t\t\t\t\t\twindow.onbeforeunload = function (event) {\r\n\t\t\t\t\t\t\tTimeMe.sendCurrentTime(websocketOptions.appId);\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t\tTimeMe.websocket.onopen = function () {\r\n\t\t\t\t\t\t\tTimeMe.sendInitWsRequest(websocketOptions.appId);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tTimeMe.websocket.onerror = function (error) {\r\n\t\t\t\t\t\t\tif (console) {\r\n\t\t\t\t\t\t\t\tconsole.log(\"Error occurred in websocket connection: \" + error);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tTimeMe.websocket.onmessage = function (event) {\r\n\t\t\t\t\t\t\tif (console) {\r\n\t\t\t\t\t\t\t\tconsole.log(event.data);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} catch (error) {\r\n\t\t\t\t\t\tif (console) {\r\n\t\t\t\t\t\t\tconsole.error(\"Failed to connect to websocket host. Error:\" + error);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn this;\r\n\t\t\t},\r\n\r\n\t\t\twebsocketSend: function (data) {\r\n\t\t\t\tTimeMe.websocket.send(JSON.stringify(data));\r\n\t\t\t},\r\n\r\n\t\t\tsendCurrentTime: function (appId) {\r\n\t\t\t\tvar timeSpentOnPage = TimeMe.getTimeOnCurrentPageInMilliseconds();\r\n\t\t\t\tvar data = {\r\n\t\t\t\t\ttype: \"INSERT_TIME\",\r\n\t\t\t\t\tappId: appId,\r\n\t\t\t\t\ttimeOnPageMs: timeSpentOnPage,\r\n\t\t\t\t\tpageName: TimeMe.currentPageName\r\n\t\t\t\t};\r\n\t\t\t\tTimeMe.websocketSend(data);\r\n\t\t\t},\r\n\t\t\tsendInitWsRequest: function (appId) {\r\n\t\t\t\tvar data = {\r\n\t\t\t\t\ttype: \"INIT\",\r\n\t\t\t\t\tappId: appId\r\n\t\t\t\t};\r\n\t\t\t\tTimeMe.websocketSend(data);\r\n\t\t\t},\r\n\r\n\t\t\tinitialize: function (options) {\r\n\r\n\t\t\t\tvar idleTimeoutInSeconds = TimeMe.idleTimeoutMs || 30;\r\n\t\t\t\tvar currentPageName = TimeMe.currentPageName || \"default-page-name\";\r\n\t\t\t\tvar websocketOptions = undefined;\r\n\t\t\t\tvar initialStartTime = undefined;\r\n\r\n\t\t\t\tif (options) {\r\n\t\t\t\t\tidleTimeoutInSeconds = options.idleTimeoutInSeconds || idleTimeoutInSeconds;\r\n\t\t\t\t\tcurrentPageName = options.currentPageName || currentPageName;\r\n\t\t\t\t\twebsocketOptions = options.websocketOptions;\r\n\t\t\t\t\tinitialStartTime = options.initialStartTime;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tTimeMe.setIdleDurationInSeconds(idleTimeoutInSeconds)\r\n\t\t\t\t\t.setCurrentPageName(currentPageName)\r\n\t\t\t\t\t.setUpWebsocket(websocketOptions)\r\n\t\t\t\t\t.listenForVisibilityEvents();\r\n\r\n\t\t\t\t\/\/ TODO - only do this if page currently visible.\r\n\r\n\t\t\t\tTimeMe.startTimer(undefined, initialStartTime);\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn TimeMe;\r\n\t});\r\n}).call(this);"],"file":"timeme.min.js"}