{"version":3,"sources":["header-scripts.js"],"names":["root","factory","define","amd","exports","module","returnExports","this","_eventListener","window","_DOMReady","document","readyState","addEventListener","loaded","removeEventListener","_instance","_reSmartURL","_reQueryString","ath","options","Class","lang","intl","de_de","ios","android","da_dk","en_us","es_es","fi_fi","fr_fr","he_il","it_it","ja_jp","ko_kr","nb_no","pt_br","pt_pt","nl_nl","ru_ru","sv_se","zh_cn","zh_tw","substr","defaults","appID","fontSize","debug","logging","modal","mandatory","autostart","skipFirstVisit","startDelay","lifespan","displayPace","maxDisplayCount","icon","message","validLocation","onInit","onShow","onRemove","onAdd","onPrivate","privateModeOverride","detectHomescreen","_ua","navigator","userAgent","_nav","_extend","hasToken","location","hash","test","href","search","isRetina","devicePixelRatio","isIDevice","isMobileChrome","indexOf","isMobileIE","language","toLowerCase","replace","isMobileSafari","OS","OSVersion","match","isStandalone","standalone","isTablet","isCompatible","_defaultSession","lastDisplayTime","returningVisitor","displayCount","optedout","added","target","obj","i","_removeToken","history","replaceState","title","split","removeSession","localStorage","Error","removeItem","e","doLog","logStr","console","log","container","documentElement","session","getItem","JSON","parse","undefined","setItem","stringify","hasLocalStorage","call","isValidLocation","length","optOut","updateSession","ready","show","prototype","events","load","error","orientationchange","resize","scroll","click","touchmove","transitionend","webkitTransitionEnd","MSTransitionEnd","handleEvent","type","force","shown","now","Date","applicationIcon","querySelector","viewport","createElement","className","style","position","element","cssText","webkitTransform","innerHeight","transform","img","src","appendChild","innerHTML","left","_delayedShow","setTimeout","bind","_show","that","updateViewport","webkitTransitionDuration","transitionDuration","removeTimer","remove","clearTimeout","opacity","_removeElements","removeChild","width","innerWidth","height","scrollX","top","scrollY","clientWidth","orientation","clientHeight","screenWidth","screen","scale","resizeTimer","clearSession","item","optIn","clearDisplayCount","_preventDefault","preventDefault","stopPropagation","addToHomescreen"],"mappings":"CAAC,SAAUA,EAAMC,GACS,mBAAXC,QAAyBA,OAAOC,IAE7CD,OAAO,GAAID,GACqB,iBAAZG,QAIpBC,OAA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L,KAAKqJ,SAASG,MAAM8B,IAAMpL,OAAOqL,QAAU,KAE3C,IAAIC,EAAcpL,SAAS6G,gBAAgBuE,YAE3CxL,KAAKyL,YAAcD,EAAcpL,SAAS6G,gBAAgByE,aAAe,YAAc,WAEvF,IAAIC,EAAwB,OAAV/K,EAAIsE,GAAkC,YAApBlF,KAAKyL,YAA4BG,OAAOV,MAAQU,OAAOR,OAASQ,OAAOV,MAC3GlL,KAAK6L,MAAQD,OAAOV,MAAQM,EAAc,EAAIG,EAAczL,OAAOiL,WAEnEnL,KAAK0J,QAAQF,MAAMhH,SAAWxC,KAAKa,QAAQ2B,SAAWxC,KAAK6L,MAAQ,OAGpEvD,OAAQ,WACPwC,aAAa9K,KAAK8L,aAClB9L,KAAK8L,YAAczB,WAAWrK,KAAKyK,eAAeH,KAAKtK,MAAO,MAG/D8H,cAAe,YACe,IAAxBlH,EAAI6G,iBAICjB,cACAA,aAAae,QAAQvH,KAAKa,QAAQ0B,MAAO6E,KAAKI,UAAUxH,KAAKkH,WAIxE6E,aAAc,WACb/L,KAAKkH,QAAUzB,EACfzF,KAAK8H,iBAGNX,QAAS,SAAS6E,GACjB,IACC,IAAKxF,aACJ,MAAM,IAAIC,MAAM,+BAGjB,OAAOD,aAAaW,QAAQ6E,GAC3B,MAAMrF,GAEP/F,EAAI6G,iBAAkB,IAIxBI,OAAQ,WACP7H,KAAKkH,QAAQrB,UAAW,EACxB7F,KAAK8H,iBAGNmE,MAAO,WACNjM,KAAKkH,QAAQrB,UAAW,EACxB7F,KAAK8H,iBAGNoE,kBAAmB,WAClBlM,KAAKkH,QAAQtB,aAAe,EAC5B5F,KAAK8H,iBAGNqE,gBAAiB,SAAUxF,GAC1BA,EAAEyF,iBACFzF,EAAE0F,oBA4BJnM,OAAOoM,gBAAkB1L","file":"header-scripts.js","sourcesContent":["(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n\t\tdefine([], factory);\n } else if (typeof exports === 'object') {\n // Node. Does not work with strict CommonJS, but\n // only CommonJS-like enviroments that support module.exports,\n // like Node.\n\t\tmodule.exports = factory();\n } else {\n // Browser globals (root is window)\n\t\troot.returnExports = factory();\n }\n}(this, function () {\n\t/* Add to Homescreen v3.2.2 ~ (c) 2015 Matteo Spinelli ~ @license: http://cubiq.org/license */\n\t/*\n\t _ _ _____ _____\n\t ___ _| |_| |_ _|___| | |___ _____ ___ ___ ___ ___ ___ ___ ___\n\t| .'| . | . | | | | . | | . | | -_|_ -| _| _| -_| -_| |\n\t|__,|___|___| |_| |___|__|__|___|_|_|_|___|___|___|_| |___|___|_|_|\n\t by Matteo Spinelli ~ http://cubiq.org\n\t*/\n\n\t// Check for addEventListener browser support (prevent errors in IE<9)\n\tvar _eventListener = 'addEventListener' in window;\n\n\t// Check if document is loaded, needed by autostart\n\tvar _DOMReady = false;\n\tif ( document.readyState === 'complete' ) {\n\t\t_DOMReady = true;\n\t} else if ( _eventListener ) {\n\t\twindow.addEventListener('load', loaded, false);\n\t}\n\n\tfunction loaded () {\n\t\twindow.removeEventListener('load', loaded, false);\n\t\t_DOMReady = true;\n\t}\n\n\t// regex used to detect if app has been added to the homescreen\n\tvar _reSmartURL = /\\/ath(\\/)?$/;\n\tvar _reQueryString = /([\\?&]ath=[^&]*$|&ath=[^&]*(&))/;\n\n\t// singleton\n\tvar _instance;\n\tfunction ath (options) {\n\t\t_instance = _instance || new ath.Class(options);\n\n\t\treturn _instance;\n\t}\n\n\t// message in all supported languages\n\tath.intl = {\n\t\tde_de: {\n\t\t\tios: 'Um diese Web-App zum Home-Bildschirm hinzuzufügen, tippen Sie auf %icon und dann Zum Home-Bildschirm.',\n\t\t\tandroid: 'Um diese Web-App zum Home-Bildschirm hinzuzufügen, öffnen Sie das Menü und tippen dann auf Zum Startbildschirm hinzufügen. Wenn Ihr Gerät eine Menütaste hat, lässt sich das Browsermenü über diese öffnen. Ansonsten tippen Sie auf icon.',\n\t\t},\n\n\t\tda_dk: {\n\t\t\tios: 'For at tilføje denne web app til hjemmeskærmen: Tryk %icon og derefter Føj til hjemmeskærm.',\n\t\t\tandroid: 'For at tilføje denne web app til hjemmeskærmen, åbn browser egenskaber menuen og tryk på Føj til hjemmeskærm. Denne menu kan tilgås ved at trykke på menu knappen, hvis din enhed har en, eller ved at trykke på det øverste højre menu ikon icon.',\n\t\t},\n\n\t\ten_us: {\n\t\t\tios: 'To add this web app to the home screen: tap %icon and then Add to Home Screen.',\n\t\t\tandroid: 'To add this web app to the home screen open the browser option menu and tap on Add to homescreen. The menu can be accessed by pressing the menu hardware button if your device has one, or by tapping the top right menu icon icon.',\n\t\t},\n\n\t\tes_es: {\n\t\t\tios: 'Para añadir esta aplicación web a la pantalla de inicio: pulsa %icon y selecciona Añadir a pantalla de inicio.',\n\t\t\tandroid: 'Para añadir esta aplicación web a la pantalla de inicio, abre las opciones y pulsa Añadir a pantalla inicio. El menú se puede acceder pulsando el botón táctil en caso de tenerlo, o bien el icono de la parte superior derecha de la pantalla icon.',\n\t\t},\n\n\t\tfi_fi: {\n\t\t\tios: 'Liitä tämä sovellus kotivalikkoon: klikkaa %icon ja tämän jälkeen Lisää kotivalikkoon.',\n\t\t\tandroid: 'Lisätäksesi tämän sovelluksen aloitusnäytölle, avaa selaimen valikko ja klikkaa tähti -ikonia tai Lisää aloitusnäytölle tekstiä. Valikkoon pääsee myös painamalla menuvalikkoa, jos laitteessasi on sellainen tai koskettamalla oikealla yläkulmassa menu ikonia icon.',\n\t\t},\n\n\t\tfr_fr: {\n\t\t\tios: 'Pour ajouter cette application web sur l\\'écran d\\'accueil : Appuyez %icon et sélectionnez Ajouter sur l\\'écran d\\'accueil.',\n\t\t\tandroid: 'Pour ajouter cette application web sur l\\'écran d\\'accueil : Appuyez sur le bouton \"menu\", puis sur Ajouter sur l\\'écran d\\'accueil. Le menu peut-être accessible en appyant sur le bouton \"menu\" du téléphone s\\'il en possède un . Sinon, il se trouve probablement dans la coin supérieur droit du navigateur %icon.',\n\t\t},\n\n\t\the_il: {\n\t\t\tios: 'להוספת האפליקציה למסך הבית: ללחוץ על %icon ואז הוסף למסך הבית.',\n\t\t\tandroid: 'To add this web app to the home screen open the browser option menu and tap on Add to homescreen. The menu can be accessed by pressing the menu hardware button if your device has one, or by tapping the top right menu icon icon.',\n\t\t},\n\n\t\tit_it: {\n\t\t\tios: 'Per aggiungere questa web app alla schermata iniziale: premi %icon e poi Aggiungi a Home.',\n\t\t\tandroid: 'Per aggiungere questa web app alla schermata iniziale, apri il menu opzioni del browser e premi su Aggiungi alla homescreen. Puoi accedere al menu premendo il pulsante hardware delle opzioni se la tua device ne ha uno, oppure premendo l\\'icona icon in alto a destra.',\n\t\t},\n\n\t\tja_jp: {\n\t\t\tios: 'このウェプアプリをホーム画面に追加するために%iconを押してホーム画面に追加。',\n\t\t\tandroid: 'To add this web app to the home screen open the browser option menu and tap on Add to homescreen. The menu can be accessed by pressing the menu hardware button if your device has one, or by tapping the top right menu icon icon.',\n\t \t},\n\n\t\tko_kr: {\n\t\t\tios: '홈 화면에 바로가기 생성: %icon 을 클릭한 후 홈 화면에 추가.',\n\t\t\tandroid: '브라우저 옵션 메뉴의 홈 화면에 추가를 클릭하여 홈화면에 바로가기를 생성할 수 있습니다. 옵션 메뉴는 장치의 메뉴 버튼을 누르거나 오른쪽 상단의 메뉴 아이콘 icon을 클릭하여 접근할 수 있습니다.'\n\t\t},\n\n\t\tnb_no: {\n\t\t\tios: 'For å installere denne appen på hjem-skjermen: trykk på %icon og deretter Legg til på Hjem-skjerm.',\n\t\t\tandroid: 'For å legge til denne webappen på startsiden åpner en nettlesermenyen og velger Legg til på startsiden. Menyen åpnes ved å trykke på den fysiske menyknappen hvis enheten har det, eller ved å trykke på menyikonet øverst til høyre icon.',\n\t\t},\n\n\t\tpt_br: {\n\t\t\tios: 'Para adicionar este app à tela de início: clique %icon e então Tela de início.',\n\t\t\tandroid: 'To add this web app to the home screen open the browser option menu and tap on Add to homescreen. The menu can be accessed by pressing the menu hardware button if your device has one, or by tapping the top right menu icon icon.',\n\t\t},\n\n\t\tpt_pt: {\n\t\t\tios: 'Para adicionar esta app ao ecrã principal: clique %icon e depois Ecrã principal.',\n\t\t\tandroid: 'To add this web app to the home screen open the browser option menu and tap on Add to homescreen. The menu can be accessed by pressing the menu hardware button if your device has one, or by tapping the top right menu icon icon.',\n\t\t},\n\n\t\tnl_nl: {\n\t\t\tios: 'Om deze webapp op je telefoon te installeren, klik op %icon en dan Zet in beginscherm.',\n\t\t\tandroid: 'To add this web app to the home screen open the browser option menu and tap on Add to homescreen. The menu can be accessed by pressing the menu hardware button if your device has one, or by tapping the top right menu icon icon.',\n\t\t},\n\n\t\tru_ru: {\n\t\t\tios: 'Чтобы добавить этот сайт на свой домашний экран, нажмите на иконку %icon и затем На экран \"Домой\".',\n\t\t\tandroid: 'Чтобы добавить сайт на свой домашний экран, откройте меню браузера и нажмите на Добавить на главный экран. Меню можно вызвать, нажав на кнопку меню вашего телефона, если она есть. Или найдите иконку сверху справа иконка.',\n\t\t},\n\n\t\tsv_se: {\n\t\t\tios: 'För att lägga till denna webbapplikation på hemskärmen: tryck på %icon och därefter Lägg till på hemskärmen.',\n\t\t\tandroid: 'För att lägga till den här webbappen på hemskärmen öppnar du webbläsarens alternativ-meny och väljer Lägg till på startskärmen. Man hittar menyn genom att trycka på hårdvaruknappen om din enhet har en sådan, eller genom att trycka på menyikonen högst upp till höger icon.',\n\t\t},\n\n\t\tzh_cn: {\n\t\t\tios: '如要把应用程序加至主屏幕,请点击%icon, 然后添加到主屏幕',\n\t\t\tandroid: 'To add this web app to the home screen open the browser option menu and tap on Add to homescreen. The menu can be accessed by pressing the menu hardware button if your device has one, or by tapping the top right menu icon icon.',\n\t\t},\n\n\t\tzh_tw: {\n\t\t\tios: '如要把應用程式加至主屏幕, 請點擊%icon, 然後加至主屏幕.',\n\t\t\tandroid: 'To add this web app to the home screen open the browser option menu and tap on Add to homescreen. The menu can be accessed by pressing the menu hardware button if your device has one, or by tapping the top right menu icon icon.',\n\t\t},\n\n\t};\n\n\t// Add 2 characters language support (Android mostly)\n\tfor ( var lang in ath.intl ) {\n\t\tath.intl[lang.substr(0, 2)] = ath.intl[lang];\n\t}\n\n\t// default options\n\tath.defaults = {\n\t\tappID: 'org.cubiq.addtohome',\t\t// local storage name (no need to change)\n\t\tfontSize: 15,\t\t\t\t// base font size, used to properly resize the popup based on viewport scale factor\n\t\tdebug: false,\t\t\t\t// override browser checks\n\t\tlogging: false,\t\t\t\t// log reasons for showing or not showing to js console; defaults to true when debug is true\n\t\tmodal: false,\t\t\t\t// prevent further actions until the message is closed\n\t\tmandatory: false,\t\t\t// you can't proceed if you don't add the app to the homescreen\n\t\tautostart: true,\t\t\t// show the message automatically\n\t\tskipFirstVisit: false,\t\t// show only to returning visitors (ie: skip the first time you visit)\n\t\tstartDelay: 1,\t\t\t\t// display the message after that many seconds from page load\n\t\tlifespan: 15,\t\t\t\t// life of the message in seconds\n\t\tdisplayPace: 1440,\t\t\t// minutes before the message is shown again (0: display every time, default 24 hours)\n\t\tmaxDisplayCount: 0,\t\t\t// absolute maximum number of times the message will be shown to the user (0: no limit)\n\t\ticon: true,\t\t\t\t\t// add touch icon to the message\n\t\tmessage: '',\t\t\t\t// the message can be customized\n\t\tvalidLocation: [],\t\t\t// list of pages where the message will be shown (array of regexes)\n\t\tonInit: null,\t\t\t\t// executed on instance creation\n\t\tonShow: null,\t\t\t\t// executed when the message is shown\n\t\tonRemove: null,\t\t\t\t// executed when the message is removed\n\t\tonAdd: null,\t\t\t\t// when the application is launched the first time from the homescreen (guesstimate)\n\t\tonPrivate: null,\t\t\t// executed if user is in private mode\n\t\tprivateModeOverride: false,\t// show the message even in private mode (very rude)\n\t\tdetectHomescreen: false\t\t// try to detect if the site has been added to the homescreen (false | true | 'hash' | 'queryString' | 'smartURL')\n\t};\n\n\t// browser info and capability\n\tvar _ua = window.navigator.userAgent;\n\n\tvar _nav = window.navigator;\n\t_extend(ath, {\n\t\thasToken: document.location.hash == '#ath' || _reSmartURL.test(document.location.href) || _reQueryString.test(document.location.search),\n\t\tisRetina: window.devicePixelRatio && window.devicePixelRatio > 1,\n\t\tisIDevice: (/iphone|ipod|ipad/i).test(_ua),\n\t\tisMobileChrome: _ua.indexOf('Android') > -1 && (/Chrome\\/[.0-9]*/).test(_ua) && _ua.indexOf(\"Version\") == -1,\n\t\tisMobileIE: _ua.indexOf('Windows Phone') > -1,\n\t\tlanguage: _nav.language && _nav.language.toLowerCase().replace('-', '_') || ''\n\t});\n\n\t// falls back to en_us if language is unsupported\n\tath.language = ath.language && ath.language in ath.intl ? ath.language : 'en_us';\n\n\tath.isMobileSafari = ath.isIDevice && _ua.indexOf('Safari') > -1 && _ua.indexOf('CriOS') < 0;\n\tath.OS = ath.isIDevice ? 'ios' : ath.isMobileChrome ? 'android' : ath.isMobileIE ? 'windows' : 'unsupported';\n\n\tath.OSVersion = _ua.match(/(OS|Android) (\\d+[_\\.]\\d+)/);\n\tath.OSVersion = ath.OSVersion && ath.OSVersion[2] ? +ath.OSVersion[2].replace('_', '.') : 0;\n\n\tath.isStandalone = 'standalone' in window.navigator && window.navigator.standalone;\n\tath.isTablet = (ath.isMobileSafari && _ua.indexOf('iPad') > -1) || (ath.isMobileChrome && _ua.indexOf('Mobile') < 0);\n\n\tath.isCompatible = (ath.isMobileSafari && ath.OSVersion >= 6) || ath.isMobileChrome;\t// TODO: add winphone\n\n\tvar _defaultSession = {\n\t\tlastDisplayTime: 0,\t\t\t// last time we displayed the message\n\t\treturningVisitor: false,\t// is this the first time you visit\n\t\tdisplayCount: 0,\t\t\t// number of times the message has been shown\n\t\toptedout: false,\t\t\t// has the user opted out\n\t\tadded: false\t\t\t\t// has been actually added to the homescreen\n\t};\n\n\tath.removeSession = function (appID) {\n\t\ttry {\n\t\t\tif (!localStorage) {\n\t\t\t\tthrow new Error('localStorage is not defined');\n\t\t\t}\n\n\t\t\tlocalStorage.removeItem(appID || ath.defaults.appID);\n\t\t} catch (e) {\n\t\t\t// we are most likely in private mode\n\t\t}\n\t};\n\n\tath.doLog = function (logStr) {\n\t\tif ( this.options.logging ) {\n\t\t\tconsole.log(logStr);\n\t\t}\n\t};\n\n\tath.Class = function (options) {\n\t\t// class methods\n\t\tthis.doLog = ath.doLog;\n\n\t\t// merge default options with user config\n\t\tthis.options = _extend({}, ath.defaults);\n\t\t_extend(this.options, options);\n\t\t// override defaults that are dependent on each other\n\t\tif ( options && options.debug && (typeof options.logging === \"undefined\") ) {\n\t\t\tthis.options.logging = true;\n\t\t}\n\n\t\t// IE<9 so exit (I hate you, really)\n\t\tif ( !_eventListener ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// normalize some options\n\t\tthis.options.mandatory = this.options.mandatory && ( 'standalone' in window.navigator || this.options.debug );\n\t\tthis.options.modal = this.options.modal || this.options.mandatory;\n\t\tif ( this.options.mandatory ) {\n\t\t\tthis.options.startDelay = -0.5;\t\t// make the popup hasty\n\t\t}\n\t\tthis.options.detectHomescreen = this.options.detectHomescreen === true ? 'hash' : this.options.detectHomescreen;\n\n\t\t// setup the debug environment\n\t\tif ( this.options.debug ) {\n\t\t\tath.isCompatible = true;\n\t\t\tath.OS = typeof this.options.debug == 'string' ? this.options.debug : ath.OS == 'unsupported' ? 'android' : ath.OS;\n\t\t\tath.OSVersion = ath.OS == 'ios' ? '8' : '4';\n\t\t}\n\n\t\t// the element the message will be appended to\n\t\tthis.container = document.documentElement;\n\n\t\t// load session\n\t\tthis.session = this.getItem(this.options.appID);\n\t\tthis.session = this.session ? JSON.parse(this.session) : undefined;\n\n\t\t// user most likely came from a direct link containing our token, we don't need it and we remove it\n\t\tif ( ath.hasToken && ( !ath.isCompatible || !this.session ) ) {\n\t\t\tath.hasToken = false;\n\t\t\t_removeToken();\n\t\t}\n\n\t\t// the device is not supported\n\t\tif ( !ath.isCompatible ) {\n\t \t\tthis.doLog(\"Add to homescreen: not displaying callout because device not supported\");\n\t\t\treturn;\n\t\t}\n\n\t\tthis.session = this.session || _defaultSession;\n\n\t\t// check if we can use the local storage\n\t\ttry {\n\t\t\tif (!localStorage) {\n\t\t\t\tthrow new Error('localStorage is not defined');\n\t\t\t}\n\n\t\t\tlocalStorage.setItem(this.options.appID, JSON.stringify(this.session));\n\t\t\tath.hasLocalStorage = true;\n\t\t} catch (e) {\n\t\t\t// we are most likely in private mode\n\t\t\tath.hasLocalStorage = false;\n\n\t\t\tif ( this.options.onPrivate ) {\n\t\t\t\tthis.options.onPrivate.call(this);\n\t\t\t}\n\t\t}\n\n\t\t// check if this is a valid location\n\t\tvar isValidLocation = !this.options.validLocation.length;\n\t\tfor ( var i = this.options.validLocation.length; i--; ) {\n\t\t\tif ( this.options.validLocation[i].test(document.location.href) ) {\n\t\t\t\tisValidLocation = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// check compatibility with old versions of add to homescreen. Opt-out if an old session is found\n\t\tif ( this.getItem('addToHome') ) {\n\t\t\tthis.optOut();\n\t\t}\n\n\t\t// critical errors:\n\t\tif ( this.session.optedout ) {\n\t\t\tthis.doLog(\"Add to homescreen: not displaying callout because user opted out\");\n\t\t\treturn;\n\t\t}\n\t\tif ( this.session.added ) {\n\t\t\tthis.doLog(\"Add to homescreen: not displaying callout because already added to the homescreen\");\n\t\t\treturn;\n\t\t}\n\t\tif ( !isValidLocation ) {\n\t\t\tthis.doLog(\"Add to homescreen: not displaying callout because not a valid location\");\n\t\t\treturn;\n\t\t}\n\n\t\t// check if the app is in stand alone mode\n\t\tif ( ath.isStandalone ) {\n\t\t\t// execute the onAdd event if we haven't already\n\t\t\tif ( !this.session.added ) {\n\t\t\t\tthis.session.added = true;\n\t\t\t\tthis.updateSession();\n\n\t\t\t\tif ( this.options.onAdd && ath.hasLocalStorage ) {\t// double check on localstorage to avoid multiple calls to the custom event\n\t\t\t\t\tthis.options.onAdd.call(this);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.doLog(\"Add to homescreen: not displaying callout because in standalone mode\");\n\t\t\treturn;\n\t\t}\n\n\t\t// (try to) check if the page has been added to the homescreen\n\t\tif ( this.options.detectHomescreen ) {\n\t\t\t// the URL has the token, we are likely coming from the homescreen\n\t\t\tif ( ath.hasToken ) {\n\t\t\t\t_removeToken();\t\t// we don't actually need the token anymore, we remove it to prevent redistribution\n\n\t\t\t\t// this is called the first time the user opens the app from the homescreen\n\t\t\t\tif ( !this.session.added ) {\n\t\t\t\t\tthis.session.added = true;\n\t\t\t\t\tthis.updateSession();\n\n\t\t\t\t\tif ( this.options.onAdd && ath.hasLocalStorage ) {\t// double check on localstorage to avoid multiple calls to the custom event\n\t\t\t\t\t\tthis.options.onAdd.call(this);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.doLog(\"Add to homescreen: not displaying callout because URL has token, so we are likely coming from homescreen\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// URL doesn't have the token, so add it\n\t\t\tif ( this.options.detectHomescreen == 'hash' ) {\n\t\t\t\thistory.replaceState('', window.document.title, document.location.href + '#ath');\n\t\t\t} else if ( this.options.detectHomescreen == 'smartURL' ) {\n\t\t\t\thistory.replaceState('', window.document.title, document.location.href.replace(/(\\/)?$/, '/ath$1'));\n\t\t\t} else {\n\t\t\t\thistory.replaceState('', window.document.title, document.location.href + (document.location.search ? '&' : '?' ) + 'ath=');\n\t\t\t}\n\t\t}\n\n\t\t// check if this is a returning visitor\n\t\tif ( !this.session.returningVisitor ) {\n\t\t\tthis.session.returningVisitor = true;\n\t\t\tthis.updateSession();\n\n\t\t\t// we do not show the message if this is your first visit\n\t\t\tif ( this.options.skipFirstVisit ) {\n\t\t\t\tthis.doLog(\"Add to homescreen: not displaying callout because skipping first visit\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// we do no show the message in private mode\n\t\tif ( !this.options.privateModeOverride && !ath.hasLocalStorage ) {\n\t\t\tthis.doLog(\"Add to homescreen: not displaying callout because browser is in private mode\");\n\t\t\treturn;\n\t\t}\n\n\t\t// all checks passed, ready to display\n\t\tthis.ready = true;\n\n\t\tif ( this.options.onInit ) {\n\t\t\tthis.options.onInit.call(this);\n\t\t}\n\n\t\tif ( this.options.autostart ) {\n\t\t\tthis.doLog(\"Add to homescreen: autostart displaying callout\");\n\t\t\tthis.show();\n\t\t}\n\t};\n\n\tath.Class.prototype = {\n\t\t// event type to method conversion\n\t\tevents: {\n\t\t\tload: '_delayedShow',\n\t\t\terror: '_delayedShow',\n\t\t\torientationchange: 'resize',\n\t\t\tresize: 'resize',\n\t\t\tscroll: 'resize',\n\t\t\tclick: 'remove',\n\t\t\ttouchmove: '_preventDefault',\n\t\t\ttransitionend: '_removeElements',\n\t\t\twebkitTransitionEnd: '_removeElements',\n\t\t\tMSTransitionEnd: '_removeElements'\n\t\t},\n\n\t\thandleEvent: function (e) {\n\t\t\tvar type = this.events[e.type];\n\t\t\tif ( type ) {\n\t\t\t\tthis[type](e);\n\t\t\t}\n\t\t},\n\n\t\tshow: function (force) {\n\t\t\t// in autostart mode wait for the document to be ready\n\t\t\tif ( this.options.autostart && !_DOMReady ) {\n\t\t\t\tsetTimeout(this.show.bind(this), 50);\n\t\t\t\t// we are not displaying callout because DOM not ready, but don't log that because\n\t\t\t\t// it would log too frequently\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// message already on screen\n\t\t\tif ( this.shown ) {\n\t\t\t\tthis.doLog(\"Add to homescreen: not displaying callout because already shown on screen\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar now = Date.now();\n\t\t\tvar lastDisplayTime = this.session.lastDisplayTime;\n\n\t\t\tif ( force !== true ) {\n\t\t\t\t// this is needed if autostart is disabled and you programmatically call the show() method\n\t\t\t\tif ( !this.ready ) {\n\t\t\t\t\tthis.doLog(\"Add to homescreen: not displaying callout because not ready\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// we obey the display pace (prevent the message to popup too often)\n\t\t\t\tif ( now - lastDisplayTime < this.options.displayPace * 60000 ) {\n\t\t\t\t\tthis.doLog(\"Add to homescreen: not displaying callout because displayed recently\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// obey the maximum number of display count\n\t\t\t\tif ( this.options.maxDisplayCount && this.session.displayCount >= this.options.maxDisplayCount ) {\n\t\t\t\t\tthis.doLog(\"Add to homescreen: not displaying callout because displayed too many times already\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.shown = true;\n\n\t\t\t// increment the display count\n\t\t\tthis.session.lastDisplayTime = now;\n\t\t\tthis.session.displayCount++;\n\t\t\tthis.updateSession();\n\n\t\t\t// try to get the highest resolution application icon\n\t\t\tif ( !this.applicationIcon ) {\n\t\t\t\tif ( ath.OS == 'ios' ) {\n\t\t\t\t\tthis.applicationIcon = document.querySelector('head link[rel^=apple-touch-icon][sizes=\"152x152\"],head link[rel^=apple-touch-icon][sizes=\"144x144\"],head link[rel^=apple-touch-icon][sizes=\"120x120\"],head link[rel^=apple-touch-icon][sizes=\"114x114\"],head link[rel^=apple-touch-icon]');\n\t\t\t\t} else {\n\t\t\t\t\tthis.applicationIcon = document.querySelector('head link[rel^=\"shortcut icon\"][sizes=\"196x196\"],head link[rel^=apple-touch-icon]');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar message = '';\n\n\t\t\tif ( typeof this.options.message == 'object' && ath.language in this.options.message ) {\t\t// use custom language message\n\t\t\t\tmessage = this.options.message[ath.language][ath.OS];\n\t\t\t} else if ( typeof this.options.message == 'object' && ath.OS in this.options.message ) {\t\t// use custom os message\n\t\t\t\tmessage = this.options.message[ath.OS];\n\t\t\t} else if ( this.options.message in ath.intl ) {\t\t\t\t// you can force the locale\n\t\t\t\tmessage = ath.intl[this.options.message][ath.OS];\n\t\t\t} else if ( this.options.message !== '' ) {\t\t\t\t\t\t// use a custom message\n\t\t\t\tmessage = this.options.message;\n\t\t\t} else if ( ath.OS in ath.intl[ath.language] ) {\t\t\t\t// otherwise we use our message\n\t\t\t\tmessage = ath.intl[ath.language][ath.OS];\n\t\t\t}\n\n\t\t\t// add the action icon\n\t\t\tmessage = '

' + message.replace('%icon', 'icon') + '

';\n\n\t\t\t// create the message container\n\t\t\tthis.viewport = document.createElement('div');\n\t\t\tthis.viewport.className = 'ath-viewport';\n\t\t\tif ( this.options.modal ) {\n\t\t\t\tthis.viewport.className += ' ath-modal';\n\t\t\t}\n\t\t\tif ( this.options.mandatory ) {\n\t\t\t\tthis.viewport.className += ' ath-mandatory';\n\t\t\t}\n\t\t\tthis.viewport.style.position = 'absolute';\n\n\t\t\t// create the actual message element\n\t\t\tthis.element = document.createElement('div');\n\t\t\tthis.element.className = 'ath-container ath-' + ath.OS + ' ath-' + ath.OS + (ath.OSVersion + '').substr(0,1) + ' ath-' + (ath.isTablet ? 'tablet' : 'phone');\n\t\t\tthis.element.style.cssText = '-webkit-transition-property:-webkit-transform,opacity;-webkit-transition-duration:0s;-webkit-transition-timing-function:ease-out;transition-property:transform,opacity;transition-duration:0s;transition-timing-function:ease-out;';\n\t\t\tthis.element.style.webkitTransform = 'translate3d(0,-' + window.innerHeight + 'px,0)';\n\t\t\tthis.element.style.transform = 'translate3d(0,-' + window.innerHeight + 'px,0)';\n\n\t\t\t// add the application icon\n\t\t\tif ( this.options.icon && this.applicationIcon ) {\n\t\t\t\tthis.element.className += ' ath-icon';\n\t\t\t\tthis.img = document.createElement('img');\n\t\t\t\tthis.img.className = 'ath-application-icon';\n\t\t\t\tthis.img.addEventListener('load', this, false);\n\t\t\t\tthis.img.addEventListener('error', this, false);\n\n\t\t\t\tthis.img.src = this.applicationIcon.href;\n\t\t\t\tthis.element.appendChild(this.img);\n\t\t\t}\n\n\t\t\tthis.element.innerHTML += message;\n\n\t\t\t// we are not ready to show, place the message out of sight\n\t\t\tthis.viewport.style.left = '-99999em';\n\n\t\t\t// attach all elements to the DOM\n\t\t\tthis.viewport.appendChild(this.element);\n\t\t\tthis.container.appendChild(this.viewport);\n\n\t\t\t// if we don't have to wait for an image to load, show the message right away\n\t\t\tif ( this.img ) {\n\t\t\t\tthis.doLog(\"Add to homescreen: not displaying callout because waiting for img to load\");\n\t\t\t} else {\n\t\t\t\tthis._delayedShow();\n\t\t\t}\n\t\t},\n\n\t\t_delayedShow: function (e) {\n\t\t\tsetTimeout(this._show.bind(this), this.options.startDelay * 1000 + 500);\n\t\t},\n\n\t\t_show: function () {\n\t\t\tvar that = this;\n\n\t\t\t// update the viewport size and orientation\n\t\t\tthis.updateViewport();\n\n\t\t\t// reposition/resize the message on orientation change\n\t\t\twindow.addEventListener('resize', this, false);\n\t\t\twindow.addEventListener('scroll', this, false);\n\t\t\twindow.addEventListener('orientationchange', this, false);\n\n\t\t\tif ( this.options.modal ) {\n\t\t\t\t// lock any other interaction\n\t\t\t\tdocument.addEventListener('touchmove', this, true);\n\t\t\t}\n\n\t\t\t// Enable closing after 1 second\n\t\t\tif ( !this.options.mandatory ) {\n\t\t\t\tsetTimeout(function () {\n\t\t\t\t\tthat.element.addEventListener('click', that, true);\n\t\t\t\t}, 1000);\n\t\t\t}\n\n\t\t\t// kick the animation\n\t\t\tsetTimeout(function () {\n\t\t\t\tthat.element.style.webkitTransitionDuration = '0.5s ease-in';\n\t\t\t\tthat.element.style.transitionDuration = '0.5s ease-in';\n\t\t\t\tthat.element.style.webkitTransform = 'translate3d(0,0,0)';\n\t\t\t\tthat.element.style.transform = 'translate3d(0,0,0)';\n\t\t\t}, 0);\n\n\t\t\t// set the destroy timer\n\t\t\tif ( this.options.lifespan ) {\n\t\t\t\tthis.removeTimer = setTimeout(this.remove.bind(this), this.options.lifespan * 1000);\n\t\t\t}\n\n\t\t\t// fire the custom onShow event\n\t\t\tif ( this.options.onShow ) {\n\t\t\t\tthis.options.onShow.call(this);\n\t\t\t}\n\t\t},\n\n\t\tremove: function () {\n\t\t\tclearTimeout(this.removeTimer);\n\n\t\t\t// clear up the event listeners\n\t\t\tif ( this.img ) {\n\t\t\t\tthis.img.removeEventListener('load', this, false);\n\t\t\t\tthis.img.removeEventListener('error', this, false);\n\t\t\t}\n\n\t\t\twindow.removeEventListener('resize', this, false);\n\t\t\twindow.removeEventListener('scroll', this, false);\n\t\t\twindow.removeEventListener('orientationchange', this, false);\n\t\t\tdocument.removeEventListener('touchmove', this, true);\n\t\t\tthis.element.removeEventListener('click', this, true);\n\n\t\t\t// remove the message element on transition end\n\t\t\tthis.element.addEventListener('transitionend', this, false);\n\t\t\tthis.element.addEventListener('webkitTransitionEnd', this, false);\n\t\t\tthis.element.addEventListener('MSTransitionEnd', this, false);\n\n\t\t\t// start the fade out animation\n\t\t\tthis.element.style.webkitTransitionDuration = '0.3s';\n\t\t\tthis.element.style.opacity = '0';\n\t\t},\n\n\t\t_removeElements: function () {\n\t\t\tthis.element.removeEventListener('transitionend', this, false);\n\t\t\tthis.element.removeEventListener('webkitTransitionEnd', this, false);\n\t\t\tthis.element.removeEventListener('MSTransitionEnd', this, false);\n\n\t\t\t// remove the message from the DOM\n\t\t\tthis.container.removeChild(this.viewport);\n\n\t\t\tthis.shown = false;\n\n\t\t\t// fire the custom onRemove event\n\t\t\tif ( this.options.onRemove ) {\n\t\t\t\tthis.options.onRemove.call(this);\n\t\t\t}\n\t\t},\n\n\t\tupdateViewport: function () {\n\t\t\tif ( !this.shown ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.viewport.style.width = window.innerWidth + 'px';\n\t\t\tthis.viewport.style.height = window.innerHeight + 'px';\n\t\t\tthis.viewport.style.left = window.scrollX + 'px';\n\t\t\tthis.viewport.style.top = window.scrollY + 'px';\n\n\t\t\tvar clientWidth = document.documentElement.clientWidth;\n\n\t\t\tthis.orientation = clientWidth > document.documentElement.clientHeight ? 'landscape' : 'portrait';\n\n\t\t\tvar screenWidth = ath.OS == 'ios' ? this.orientation == 'portrait' ? screen.width : screen.height : screen.width;\n\t\t\tthis.scale = screen.width > clientWidth ? 1 : screenWidth / window.innerWidth;\n\n\t\t\tthis.element.style.fontSize = this.options.fontSize / this.scale + 'px';\n\t\t},\n\n\t\tresize: function () {\n\t\t\tclearTimeout(this.resizeTimer);\n\t\t\tthis.resizeTimer = setTimeout(this.updateViewport.bind(this), 100);\n\t\t},\n\n\t\tupdateSession: function () {\n\t\t\tif ( ath.hasLocalStorage === false ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t if (localStorage) {\n\t localStorage.setItem(this.options.appID, JSON.stringify(this.session));\n\t }\n\t\t},\n\n\t\tclearSession: function () {\n\t\t\tthis.session = _defaultSession;\n\t\t\tthis.updateSession();\n\t\t},\n\n\t\tgetItem: function(item) {\n\t\t\ttry {\n\t\t\t\tif (!localStorage) {\n\t\t\t\t\tthrow new Error('localStorage is not defined');\n\t\t\t\t}\n\n\t\t\t\treturn localStorage.getItem(item);\n\t\t\t} catch(e) {\n\t\t\t\t// Preventing exception for some browsers when fetching localStorage key\n\t\t\t\tath.hasLocalStorage = false;\n\t\t\t}\n\t\t},\n\n\t\toptOut: function () {\n\t\t\tthis.session.optedout = true;\n\t\t\tthis.updateSession();\n\t\t},\n\n\t\toptIn: function () {\n\t\t\tthis.session.optedout = false;\n\t\t\tthis.updateSession();\n\t\t},\n\n\t\tclearDisplayCount: function () {\n\t\t\tthis.session.displayCount = 0;\n\t\t\tthis.updateSession();\n\t\t},\n\n\t\t_preventDefault: function (e) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t}\n\t};\n\n\t// utility\n\tfunction _extend (target, obj) {\n\t\tfor ( var i in obj ) {\n\t\t\ttarget[i] = obj[i];\n\t\t}\n\n\t\treturn target;\n\t}\n\n\tfunction _removeToken () {\n\t\tif ( document.location.hash == '#ath' ) {\n\t\t\thistory.replaceState('', window.document.title, document.location.href.split('#')[0]);\n\t\t}\n\n\t\tif ( _reSmartURL.test(document.location.href) ) {\n\t\t\thistory.replaceState('', window.document.title, document.location.href.replace(_reSmartURL, '$1'));\n\t\t}\n\n\t\tif ( _reQueryString.test(document.location.search) ) {\n\t\t\thistory.replaceState('', window.document.title, document.location.href.replace(_reQueryString, '$2'));\n\t\t}\n\t}\n\n\t// expose to the world\n\twindow.addToHomescreen = ath;\n}));\n"]}