{"version":3,"sources":["webpack://device/webpack/universalModuleDefinition","webpack://device/webpack/bootstrap","webpack://device/./src/index.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","previousDevice","device","changeOrientationList","documentElement","document","userAgent","navigator","toLowerCase","television","find","needle","indexOf","hasClass","className","match","RegExp","addClass","currentClassNames","replace","removeClass","handleOrientation","landscape","walkOnChangeOrientationList","setOrientationCache","newOrientation","index","macos","ios","iphone","ipod","ipad","windows","android","androidPhone","androidTablet","blackberry","blackberryPhone","blackberryTablet","windowsPhone","windowsTablet","fxos","fxosPhone","fxosTablet","meego","cordova","location","protocol","nodeWebkit","_typeof","process","mobile","tablet","desktop","length","portrait","screen","orientation","type","includes","innerHeight","innerWidth","noConflict","this","onChangeOrientation","cb","push","orientationEvent","findMatch","arr","addEventListener","attachEvent","os"],"mappings":";;;;CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,UAAAH,GACA,iBAAAC,QACAA,QAAA,OAAAD,IAEAD,EAAA,OAAAC,IARA,CASCK,OAAA,WACD,mBCTA,IAAAC,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAP,QAGA,IAAAC,EAAAI,EAAAE,IACAC,EAAAD,EACAE,GAAA,EACAT,YAUA,OANAU,EAAAH,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAQ,GAAA,EAGAR,EAAAD,QA0DA,OArDAM,EAAAM,EAAAF,EAGAJ,EAAAO,EAAAR,EAGAC,EAAAQ,EAAA,SAAAd,EAAAe,EAAAC,GACAV,EAAAW,EAAAjB,EAAAe,IACAG,OAAAC,eAAAnB,EAAAe,GAA0CK,YAAA,E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Td,EAAS,mBACAf,EAAO2B,SAChBZ,EAAS,qBACAf,EAAO4B,QAChBb,EAAS,mBAEFf,EAAOyB,QAChBV,EAAS,iBACAf,EAAO+B,UACZ/B,EAAOiC,gBACTlB,EAAS,kBAETA,EAAS,kBAEFf,EAAOkC,aACZlC,EAAOoC,mBACTrB,EAAS,qBAETA,EAAS,qBAEFf,EAAO8B,UACZ9B,EAAOsC,gBACTvB,EAAS,kBACAf,EAAOqC,eAChBtB,EAAS,kBAETA,EAAS,mBAEFf,EAAOuC,OACZvC,EAAOyC,aACT1B,EAAS,eAETA,EAAS,eAEFf,EAAO0C,QAChB3B,EAAS,gBACAf,EAAO8C,aAChB/B,EAAS,eACAf,EAAOO,aAChBQ,EAAS,cACAf,EAAOmD,WAChBpC,EAAS,WAGPf,EAAO2C,WACT5B,EAAS,WA0BXf,EAAO8D,oBAAsB,SAASC,GACnB,mBAANA,GACT9D,EAAsB+D,KAAKD,IAM/B,IAAIE,EAAmB,SAmBvB,SAASC,EAAUC,GACjB,IAAK,IAAIpG,EAAI,EAAGA,EAAIoG,EAAIf,OAAQrF,IAC9B,GAAIiC,EAAOmE,EAAIpG,MACb,OAAOoG,EAAIpG,GAGf,MAAO,UAiBT,SAASuD,IACPtB,EAAOuD,YAAcW,GAAW,WAAY,cA1C1CzF,OAAOkB,UAAUC,eAAe1B,KAAKP,OAAQ,yBAC/CsG,EAAmB,qBAIjBtG,OAAOyG,iBACTzG,OAAOyG,iBAAiBH,EAAkB9C,GAAmB,GACpDxD,OAAO0G,YAChB1G,OAAO0G,YAAYJ,EAAkB9C,GAErCxD,OAAOsG,GAAoB9C,EAG7BA,IAcAnB,EAAOwD,KAAOU,GAAW,SAAU,SAAU,YAC7ClE,EAAOsE,GAAKJ,GACV,MACA,SACA,OACA,OACA,UACA,aACA,UACA,OACA,QACA,eAOF5C,IAEetB","file":"current-device.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"device\"] = factory();\n\telse\n\t\troot[\"device\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","// Save the previous value of the device variable.\nconst previousDevice = window.device\n\nconst device = {}\n\nconst changeOrientationList = []\n\n// Add device as a global object.\nwindow.device = device\n\n// The element.\nconst documentElement = window.document.documentElement\n\n// The client user agent string.\n// Lowercase, so we can use the more efficient indexOf(), instead of Regex\nconst userAgent = window.navigator.userAgent.toLowerCase()\n\n// Detectable television devices.\nconst television = [\n 'googletv',\n 'viera',\n 'smarttv',\n 'internet.tv',\n 'netcast',\n 'nettv',\n 'appletv',\n 'boxee',\n 'kylo',\n 'roku',\n 'dlnadoc',\n 'pov_tv',\n 'hbbtv',\n 'ce-html'\n]\n\n// Main functions\n// --------------\n\ndevice.macos = function() {\n return find('mac')\n}\n\ndevice.ios = function() {\n return device.iphone() || device.ipod() || device.ipad()\n}\n\ndevice.iphone = function() {\n return !device.windows() && find('iphone')\n}\n\ndevice.ipod = function() {\n return find('ipod')\n}\n\ndevice.ipad = function() {\n return find('ipad')\n}\n\ndevice.android = function() {\n return !device.windows() && find('android')\n}\n\ndevice.androidPhone = function() {\n return device.android() && find('mobile')\n}\n\ndevice.androidTablet = function() {\n return device.android() && !find('mobile')\n}\n\ndevice.blackberry = function() {\n return find('blackberry') || find('bb10') || find('rim')\n}\n\ndevice.blackberryPhone = function() {\n return device.blackberry() && !find('tablet')\n}\n\ndevice.blackberryTablet = function() {\n return device.blackberry() && find('tablet')\n}\n\ndevice.windows = function() {\n return find('windows')\n}\n\ndevice.windowsPhone = function() {\n return device.windows() && find('phone')\n}\n\ndevice.windowsTablet = function() {\n return device.windows() && (find('touch') && !device.windowsPhone())\n}\n\ndevice.fxos = function() {\n return (find('(mobile') || find('(tablet')) && find(' rv:')\n}\n\ndevice.fxosPhone = function() {\n return device.fxos() && find('mobile')\n}\n\ndevice.fxosTablet = function() {\n return device.fxos() && find('tablet')\n}\n\ndevice.meego = function() {\n return find('meego')\n}\n\ndevice.cordova = function() {\n return window.cordova && location.protocol === 'file:'\n}\n\ndevice.nodeWebkit = function() {\n return typeof window.process === 'object'\n}\n\ndevice.mobile = function() {\n return (\n device.androidPhone() ||\n device.iphone() ||\n device.ipod() ||\n device.windowsPhone() ||\n device.blackberryPhone() ||\n device.fxosPhone() ||\n device.meego()\n )\n}\n\ndevice.tablet = function() {\n return (\n device.ipad() ||\n device.androidTablet() ||\n device.blackberryTablet() ||\n device.windowsTablet() ||\n device.fxosTablet()\n )\n}\n\ndevice.desktop = function() {\n return !device.tablet() && !device.mobile()\n}\n\ndevice.television = function() {\n let i = 0\n while (i < television.length) {\n if (find(television[i])) {\n return true\n }\n i++\n }\n return false\n}\n\ndevice.portrait = function() {\n if (\n screen.orientation &&\n Object.prototype.hasOwnProperty.call(window, 'onorientationchange')\n ) {\n return screen.orientation.type.includes('portrait')\n }\n return window.innerHeight / window.innerWidth > 1\n}\n\ndevice.landscape = function() {\n if (\n screen.orientation &&\n Object.prototype.hasOwnProperty.call(window, 'onorientationchange')\n ) {\n return screen.orientation.type.includes('landscape')\n }\n return window.innerHeight / window.innerWidth < 1\n}\n\n// Public Utility Functions\n// ------------------------\n\n// Run device.js in noConflict mode,\n// returning the device variable to its previous owner.\ndevice.noConflict = function() {\n window.device = previousDevice\n return this\n}\n\n// Private Utility Functions\n// -------------------------\n\n// Simple UA string search\nfunction find(needle) {\n return userAgent.indexOf(needle) !== -1\n}\n\n// Check if documentElement already has a given class.\nfunction hasClass(className) {\n return documentElement.className.match(new RegExp(className, 'i'))\n}\n\n// Add one or more CSS classes to the element.\nfunction addClass(className) {\n let currentClassNames = null\n if (!hasClass(className)) {\n currentClassNames = documentElement.className.replace(/^\\s+|\\s+$/g, '')\n documentElement.className = `${currentClassNames} ${className}`\n }\n}\n\n// Remove single CSS class from the element.\nfunction removeClass(className) {\n if (hasClass(className)) {\n documentElement.className = documentElement.className.replace(\n ` ${className}`,\n ''\n )\n }\n}\n\n// HTML Element Handling\n// ---------------------\n\n// Insert the appropriate CSS class based on the _user_agent.\n\nif (device.ios()) {\n if (device.ipad()) {\n addClass('ios ipad tablet')\n } else if (device.iphone()) {\n addClass('ios iphone mobile')\n } else if (device.ipod()) {\n addClass('ios ipod mobile')\n }\n} else if (device.macos()) {\n addClass('macos desktop')\n} else if (device.android()) {\n if (device.androidTablet()) {\n addClass('android tablet')\n } else {\n addClass('android mobile')\n }\n} else if (device.blackberry()) {\n if (device.blackberryTablet()) {\n addClass('blackberry tablet')\n } else {\n addClass('blackberry mobile')\n }\n} else if (device.windows()) {\n if (device.windowsTablet()) {\n addClass('windows tablet')\n } else if (device.windowsPhone()) {\n addClass('windows mobile')\n } else {\n addClass('windows desktop')\n }\n} else if (device.fxos()) {\n if (device.fxosTablet()) {\n addClass('fxos tablet')\n } else {\n addClass('fxos mobile')\n }\n} else if (device.meego()) {\n addClass('meego mobile')\n} else if (device.nodeWebkit()) {\n addClass('node-webkit')\n} else if (device.television()) {\n addClass('television')\n} else if (device.desktop()) {\n addClass('desktop')\n}\n\nif (device.cordova()) {\n addClass('cordova')\n}\n\n// Orientation Handling\n// --------------------\n\n// Handle device orientation changes.\nfunction handleOrientation() {\n if (device.landscape()) {\n removeClass('portrait')\n addClass('landscape')\n walkOnChangeOrientationList('landscape')\n } else {\n removeClass('landscape')\n addClass('portrait')\n walkOnChangeOrientationList('portrait')\n }\n setOrientationCache()\n}\n\nfunction walkOnChangeOrientationList(newOrientation) {\n for (const index in changeOrientationList) {\n changeOrientationList[index](newOrientation)\n }\n}\n\ndevice.onChangeOrientation = function(cb) {\n if (typeof cb == 'function') {\n changeOrientationList.push(cb)\n }\n}\n\n// Detect whether device supports orientationchange event,\n// otherwise fall back to the resize event.\nlet orientationEvent = 'resize'\nif (Object.prototype.hasOwnProperty.call(window, 'onorientationchange')) {\n orientationEvent = 'orientationchange'\n}\n\n// Listen for changes in orientation.\nif (window.addEventListener) {\n window.addEventListener(orientationEvent, handleOrientation, false)\n} else if (window.attachEvent) {\n window.attachEvent(orientationEvent, handleOrientation)\n} else {\n window[orientationEvent] = handleOrientation\n}\n\nhandleOrientation()\n\n// Public functions to get the current value of type, os, or orientation\n// ---------------------------------------------------------------------\n\nfunction findMatch(arr) {\n for (let i = 0; i < arr.length; i++) {\n if (device[arr[i]]()) {\n return arr[i]\n }\n }\n return 'unknown'\n}\n\ndevice.type = findMatch(['mobile', 'tablet', 'desktop'])\ndevice.os = findMatch([\n 'ios',\n 'iphone',\n 'ipad',\n 'ipod',\n 'android',\n 'blackberry',\n 'windows',\n 'fxos',\n 'meego',\n 'television'\n])\n\nfunction setOrientationCache() {\n device.orientation = findMatch(['portrait', 'landscape'])\n}\n\nsetOrientationCache()\n\nexport default device\n"],"sourceRoot":""}