{"version":3,"sources":["notifyMe.js","index.js"],"names":["spawnNotification","theBody","theTitle","Notification","body","icon","module","exports","window","permission","requestPermission","alert","notifyMe","require","then","result","console","log"],"mappings":";AA4BA,SAASA,EAAkBC,EAAQC,GAM1B,IAAIC,aAAaD,EALX,CACbE,KAAMH,EAENI,KAAM,kEAhCRC,OAAOC,QAAU,WAEV,iBAAkBC,OAKa,YAA5BL,aAAaM,WAErBT,EAAkB,YACjB,iCAKmC,WAA5BG,aAAaM,YACrBN,aAAaO,kBAAkB,SAAUD,GAErB,YAAfA,GACHT,EAAkB,YACjB,mCAjBHW,MAAM;;ACHR,IAAMC,EAAWC,QAAQ,cAEzBV,aAAaO,oBAAoBI,KAAK,SAASC,GAC9CC,QAAQC,IAAIF,GACZH","file":"44662e80.ad7ceebd.map","sourceRoot":"..","sourcesContent":["module.exports = function notifyMe() {\n\t// Let's check if the browser supports notifications\n\tif (!(\"Notification\" in window)) {\n\t\talert(\"This browser does not support system notifications\");\n\t}\n\n\t// Let's check whether notification permissions have already been granted\n\telse if (Notification.permission === \"granted\") {\n\t\t// If it's okay let's create a notification\n\t\tspawnNotification(\"Hi there!\",\n\t\t\t\"Calling you from Buenos Aires\",\n\t\t);\n\t}\n\n\t// Otherwise, we need to ask the user for permission\n\telse if (Notification.permission !== 'denied') {\n\t\tNotification.requestPermission(function (permission) {\n\t\t\t// If the user accepts, let's create a notification\n\t\t\tif (permission === \"granted\") {\n\t\t\t\tspawnNotification(\"Hi there!\",\n\t\t\t\t\t\"Calling you from Buenos Aires\",\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\t}\n\t// Finally, if the user has denied notifications and you\n\t// want to be respectful there is no need to bother them any more.\n}\nfunction spawnNotification(theBody,theTitle) {\n\tvar options = {\n\t\tbody: theBody,\n\t\t// stack overflow icon\n\t\ticon: 'http://cdn.sstatic.net/stackexchange/img/logos/so/so-icon.png',\n\t}\n\tvar n = new Notification(theTitle, options);\n}","const notifyMe = require(\"./notifyMe\");\n\nNotification.requestPermission().then(function(result) {\n\tconsole.log(result);\n\tnotifyMe();\n});"]}