From 1fcc7ed63eb9d0179cfc644db936ab2700884929 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 18 Apr 2016 14:50:29 -0400 Subject: [PATCH] reconcile apphost --- .../fingerprintjs2/.bower.json | 37 + .../fingerprintjs2/CONTRIBUTING.md | 35 + .../bower_components/fingerprintjs2/FAQ.md | 18 + .../fingerprintjs2/bower.json | 25 + .../fingerprintjs2/dist/fingerprint2.min.js | 2 + .../fingerprintjs2/fingerprint2.js | 1209 ++++++ .../fingerprintjs2/flash/FontList.as | 31 + .../fingerprintjs2/flash/Makefile | 7 + .../flash/compiled/FontList.swf | Bin 0 -> 916 bytes .../fingerprintjs2/gulpfile.js | 29 + .../fingerprintjs2/index.html | 98 + .../fingerprintjs2/package.json | 33 + .../specs/lib/jasmine-2.3.4/boot.js | 121 + .../specs/lib/jasmine-2.3.4/jasmine-html.js | 446 +++ .../lib/jasmine-2.3.4/jasmine-matchers.js | 1757 +++++++++ .../specs/lib/jasmine-2.3.4/jasmine.css | 58 + .../specs/lib/jasmine-2.3.4/jasmine.js | 3298 +++++++++++++++++ .../lib/jasmine-2.3.4/jasmine_favicon.png | Bin 0 -> 1486 bytes .../specs/lib/jasmine-2.3.4/terminal.js | 261 ++ .../specs/phantomjs-testrunner.js | 230 ++ .../fingerprintjs2/specs/phantomjs.runner.sh | 40 + .../fingerprintjs2/specs/spec_runner.html | 35 + .../fingerprintjs2/specs/specs.js | 170 + dashboard-ui/components/apphost.js | 107 +- dashboard-ui/scripts/mediaplayer.js | 2 +- dashboard-ui/scripts/site.js | 192 +- dashboard-ui/scripts/sync.js | 11 +- 27 files changed, 8058 insertions(+), 194 deletions(-) create mode 100644 dashboard-ui/bower_components/fingerprintjs2/.bower.json create mode 100644 dashboard-ui/bower_components/fingerprintjs2/CONTRIBUTING.md create mode 100644 dashboard-ui/bower_components/fingerprintjs2/FAQ.md create mode 100644 dashboard-ui/bower_components/fingerprintjs2/bower.json create mode 100644 dashboard-ui/bower_components/fingerprintjs2/dist/fingerprint2.min.js create mode 100644 dashboard-ui/bower_components/fingerprintjs2/fingerprint2.js create mode 100644 dashboard-ui/bower_components/fingerprintjs2/flash/FontList.as create mode 100644 dashboard-ui/bower_components/fingerprintjs2/flash/Makefile create mode 100644 dashboard-ui/bower_components/fingerprintjs2/flash/compiled/FontList.swf create mode 100644 dashboard-ui/bower_components/fingerprintjs2/gulpfile.js create mode 100644 dashboard-ui/bower_components/fingerprintjs2/index.html create mode 100644 dashboard-ui/bower_components/fingerprintjs2/package.json create mode 100644 dashboard-ui/bower_components/fingerprintjs2/specs/lib/jasmine-2.3.4/boot.js create mode 100644 dashboard-ui/bower_components/fingerprintjs2/specs/lib/jasmine-2.3.4/jasmine-html.js create mode 100644 dashboard-ui/bower_components/fingerprintjs2/specs/lib/jasmine-2.3.4/jasmine-matchers.js create mode 100644 dashboard-ui/bower_components/fingerprintjs2/specs/lib/jasmine-2.3.4/jasmine.css create mode 100644 dashboard-ui/bower_components/fingerprintjs2/specs/lib/jasmine-2.3.4/jasmine.js create mode 100644 dashboard-ui/bower_components/fingerprintjs2/specs/lib/jasmine-2.3.4/jasmine_favicon.png create mode 100644 dashboard-ui/bower_components/fingerprintjs2/specs/lib/jasmine-2.3.4/terminal.js create mode 100644 dashboard-ui/bower_components/fingerprintjs2/specs/phantomjs-testrunner.js create mode 100644 dashboard-ui/bower_components/fingerprintjs2/specs/phantomjs.runner.sh create mode 100644 dashboard-ui/bower_components/fingerprintjs2/specs/spec_runner.html create mode 100644 dashboard-ui/bower_components/fingerprintjs2/specs/specs.js diff --git a/dashboard-ui/bower_components/fingerprintjs2/.bower.json b/dashboard-ui/bower_components/fingerprintjs2/.bower.json new file mode 100644 index 000000000..27ed05f07 --- /dev/null +++ b/dashboard-ui/bower_components/fingerprintjs2/.bower.json @@ -0,0 +1,37 @@ +{ + "name": "fingerprintjs2", + "description": "Modern & flexible browser fingerprinting library", + "main": "dist/fingerprint2.min.js", + "moduleType": [ + "es6" + ], + "keywords": [ + "browser", + "fingerprint", + "fingerprinting", + "security", + "privacy" + ], + "authors": [ + "Valentin Vasilev" + ], + "license": "MIT", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "spec" + ], + "homepage": "https://github.com/Valve/fingerprintjs2", + "version": "1.1.3", + "_release": "1.1.3", + "_resolution": { + "type": "version", + "tag": "1.1.3", + "commit": "49e2c11cf08c13e12bf38185cec9ae159025e526" + }, + "_source": "https://github.com/Valve/fingerprintjs2.git", + "_target": "^1.1.3", + "_originalSource": "fingerprintjs2", + "_direct": true +} \ No newline at end of file diff --git a/dashboard-ui/bower_components/fingerprintjs2/CONTRIBUTING.md b/dashboard-ui/bower_components/fingerprintjs2/CONTRIBUTING.md new file mode 100644 index 000000000..33049a165 --- /dev/null +++ b/dashboard-ui/bower_components/fingerprintjs2/CONTRIBUTING.md @@ -0,0 +1,35 @@ +Contributing to FingerprintJS2 +============================== + +## Found a bug? + +Please submit an issue. +Include in the issue: + +* List of components you received in the `get` call (make sure values are not truncated) +* If FP is different every time you call the library, include 2 versions of components +* Include your OS version +* Include steps to reproduce +* Include library call code (I need all options you used when calling the library function) + +## Want to add a feature / contribute? + +* Fork the project and make the required changes in it (don't forget to add specs) +* PRs w/out specs will not be accepted +* Run `gulp` to catch stylistic errors and produce the minified version. +* Run specs by opening the `specs/spec_runner.html` or typing `npm test` (requires phantomjs for console running). +* Make a PR. +* Make sure you only make one commit per feature you want to add +* Make sure your commit message is descriptive and tells what you changed (`Updated the library` - that's a bad commit message) + +If your code changes the list of fingerprinting sources, please update +the README. + +If you're unsure about the feature you want to add, submit an issue with +a `question` tag. + +## Want to ask? +* Please read FAQ first +* If you have not found the answer you were looking for - use gitter.im to ask your question (link is in the readme) + +Happy Coding! diff --git a/dashboard-ui/bower_components/fingerprintjs2/FAQ.md b/dashboard-ui/bower_components/fingerprintjs2/FAQ.md new file mode 100644 index 000000000..6cfa3281e --- /dev/null +++ b/dashboard-ui/bower_components/fingerprintjs2/FAQ.md @@ -0,0 +1,18 @@ +#### Can I use this library to uniquely identify users? +##### No, you cannot. This library is built to be able to associate string identifiers with devices. Since there are a lot of identical devices, you will get a lot of identical identifiers. + +#### OK, I get it, I cannot _uniquely_ identify users, but can I identify users at all? +##### No, you cannot. This library is strictly for non-deterministic device identification. + + +#### How good is your library? Can you guarantee that different devices will have different identifiers? +##### This library is not good. It has an error margin of 10-20% + +#### Can you improve the library to be 100% accurate for device identification? +##### I don't think it is possible now and don't think it will be possible in the future. + +#### Can you improve the library to be more accurate (since you cannot make it 100% accurate)? +##### I can, but it takes a lot of time. I need a lot of devices, enviroments and more importantly - time. Since this is my hobby project, I spend very little time on it. + +#### How can I build a complete identification solution? +##### You should either use commercial services, such as https://augur.io, or develop such service yourself. If you don't know how to do it, please use StackOverflow. diff --git a/dashboard-ui/bower_components/fingerprintjs2/bower.json b/dashboard-ui/bower_components/fingerprintjs2/bower.json new file mode 100644 index 000000000..785147ee4 --- /dev/null +++ b/dashboard-ui/bower_components/fingerprintjs2/bower.json @@ -0,0 +1,25 @@ +{ + "name": "fingerprintjs2", + "description": "Modern & flexible browser fingerprinting library", + "main": "dist/fingerprint2.min.js", + "moduleType": [ + "es6" + ], + "keywords": [ + "browser", + "fingerprint", + "fingerprinting", + "security", + "privacy" + ], + "authors": [ + "Valentin Vasilev" + ], + "license": "MIT", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "spec" + ] +} diff --git a/dashboard-ui/bower_components/fingerprintjs2/dist/fingerprint2.min.js b/dashboard-ui/bower_components/fingerprintjs2/dist/fingerprint2.min.js new file mode 100644 index 000000000..a011c60e5 --- /dev/null +++ b/dashboard-ui/bower_components/fingerprintjs2/dist/fingerprint2.min.js @@ -0,0 +1,2 @@ +!function(e,t,i){"use strict";"undefined"!=typeof module&&module.exports?module.exports=i():"function"==typeof define&&define.amd?define(i):t[e]=i()}("Fingerprint2",this,function(){"use strict";Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){var i;if(null==this)throw new TypeError("'this' is null or undefined");var a=Object(this),r=a.length>>>0;if(0===r)return-1;var n=+t||0;if(Math.abs(n)===1/0&&(n=0),n>=r)return-1;for(i=Math.max(n>=0?n:r-Math.abs(n),0);r>i;){if(i in a&&a[i]===e)return i;i++}return-1});var e=function(e){var t={swfContainerId:"fingerprintjs2",swfPath:"flash/compiled/FontList.swf",detectScreenOrientation:!0,sortPluginsFor:[/palemoon/i]};this.options=this.extend(e,t),this.nativeForEach=Array.prototype.forEach,this.nativeMap=Array.prototype.map};return e.prototype={extend:function(e,t){if(null==e)return t;for(var i in e)null!=e[i]&&t[i]!==e[i]&&(t[i]=e[i]);return t},log:function(e){window.console&&console.log(e)},get:function(e){var t=[];t=this.userAgentKey(t),t=this.languageKey(t),t=this.colorDepthKey(t),t=this.screenResolutionKey(t),t=this.availableScreenResolutionKey(t),t=this.timezoneOffsetKey(t),t=this.sessionStorageKey(t),t=this.localStorageKey(t),t=this.indexedDbKey(t),t=this.addBehaviorKey(t),t=this.openDatabaseKey(t),t=this.cpuClassKey(t),t=this.platformKey(t),t=this.doNotTrackKey(t),t=this.pluginsKey(t),t=this.canvasKey(t),t=this.webglKey(t),t=this.adBlockKey(t),t=this.hasLiedLanguagesKey(t),t=this.hasLiedResolutionKey(t),t=this.hasLiedOsKey(t),t=this.hasLiedBrowserKey(t),t=this.touchSupportKey(t);var i=this;this.fontsKey(t,function(t){var a=[];i.each(t,function(e){var t=e.value;"undefined"!=typeof e.value.join&&(t=e.value.join(";")),a.push(t)});var r=i.x64hash128(a.join("~~~"),31);return e(r,t)})},userAgentKey:function(e){return this.options.excludeUserAgent||e.push({key:"user_agent",value:this.getUserAgent()}),e},getUserAgent:function(){return navigator.userAgent},languageKey:function(e){return this.options.excludeLanguage||e.push({key:"language",value:navigator.language||navigator.userLanguage||navigator.browserLanguage||navigator.systemLanguage||""}),e},colorDepthKey:function(e){return this.options.excludeColorDepth||e.push({key:"color_depth",value:screen.colorDepth}),e},screenResolutionKey:function(e){return this.options.excludeScreenResolution?e:this.getScreenResolution(e)},getScreenResolution:function(e){var t;return t=this.options.detectScreenOrientation&&screen.height>screen.width?[screen.height,screen.width]:[screen.width,screen.height],"undefined"!=typeof t&&e.push({key:"resolution",value:t}),e},availableScreenResolutionKey:function(e){return this.options.excludeAvailableScreenResolution?e:this.getAvailableScreenResolution(e)},getAvailableScreenResolution:function(e){var t;return screen.availWidth&&screen.availHeight&&(t=this.options.detectScreenOrientation?screen.availHeight>screen.availWidth?[screen.availHeight,screen.availWidth]:[screen.availWidth,screen.availHeight]:[screen.availHeight,screen.availWidth]),"undefined"!=typeof t&&e.push({key:"available_resolution",value:t}),e},timezoneOffsetKey:function(e){return this.options.excludeTimezoneOffset||e.push({key:"timezone_offset",value:(new Date).getTimezoneOffset()}),e},sessionStorageKey:function(e){return!this.options.excludeSessionStorage&&this.hasSessionStorage()&&e.push({key:"session_storage",value:1}),e},localStorageKey:function(e){return!this.options.excludeSessionStorage&&this.hasLocalStorage()&&e.push({key:"local_storage",value:1}),e},indexedDbKey:function(e){return!this.options.excludeIndexedDB&&this.hasIndexedDB()&&e.push({key:"indexed_db",value:1}),e},addBehaviorKey:function(e){return document.body&&!this.options.excludeAddBehavior&&document.body.addBehavior&&e.push({key:"add_behavior",value:1}),e},openDatabaseKey:function(e){return!this.options.excludeOpenDatabase&&window.openDatabase&&e.push({key:"open_database",value:1}),e},cpuClassKey:function(e){return this.options.excludeCpuClass||e.push({key:"cpu_class",value:this.getNavigatorCpuClass()}),e},platformKey:function(e){return this.options.excludePlatform||e.push({key:"navigator_platform",value:this.getNavigatorPlatform()}),e},doNotTrackKey:function(e){return this.options.excludeDoNotTrack||e.push({key:"do_not_track",value:this.getDoNotTrack()}),e},canvasKey:function(e){return!this.options.excludeCanvas&&this.isCanvasSupported()&&e.push({key:"canvas",value:this.getCanvasFp()}),e},webglKey:function(e){return this.options.excludeWebGL?e:this.isWebGlSupported()?(e.push({key:"webgl",value:this.getWebglFp()}),e):e},adBlockKey:function(e){return this.options.excludeAdBlock||e.push({key:"adblock",value:this.getAdBlock()}),e},hasLiedLanguagesKey:function(e){return this.options.excludeHasLiedLanguages||e.push({key:"has_lied_languages",value:this.getHasLiedLanguages()}),e},hasLiedResolutionKey:function(e){return this.options.excludeHasLiedResolution||e.push({key:"has_lied_resolution",value:this.getHasLiedResolution()}),e},hasLiedOsKey:function(e){return this.options.excludeHasLiedOs||e.push({key:"has_lied_os",value:this.getHasLiedOs()}),e},hasLiedBrowserKey:function(e){return this.options.excludeHasLiedBrowser||e.push({key:"has_lied_browser",value:this.getHasLiedBrowser()}),e},fontsKey:function(e,t){return this.options.excludeJsFonts?this.flashFontsKey(e,t):this.jsFontsKey(e,t)},flashFontsKey:function(e,t){return this.options.excludeFlashFonts?t(e):this.hasSwfObjectLoaded()&&this.hasMinFlashInstalled()?"undefined"==typeof this.options.swfPath?t(e):void this.loadSwfAndDetectFonts(function(i){e.push({key:"swf_fonts",value:i.join(";")}),t(e)}):t(e)},jsFontsKey:function(e,t){var i=this;return setTimeout(function(){var a=["monospace","sans-serif","serif"],r="mmmmmmmmmmlli",n="72px",o=document.getElementsByTagName("body")[0],s=document.createElement("span");s.style.position="absolute",s.style.left="-9999px",s.style.fontSize=n,s.innerHTML=r;for(var l={},h={},u=0,d=a.length;d>u;u++)s.style.fontFamily=a[u],o.appendChild(s),l[a[u]]=s.offsetWidth,h[a[u]]=s.offsetHeight,o.removeChild(s);var c=function(e){for(var t=!1,i=0,r=a.length;r>i;i++){s.style.fontFamily=e+","+a[i],o.appendChild(s);var n=s.offsetWidth!==l[a[i]]||s.offsetHeight!==h[a[i]];o.removeChild(s),t=t||n}return t},g=["Andale Mono","Arial","Arial Black","Arial Hebrew","Arial MT","Arial Narrow","Arial Rounded MT Bold","Arial Unicode MS","Bitstream Vera Sans Mono","Book Antiqua","Bookman Old Style","Calibri","Cambria","Cambria Math","Century","Century Gothic","Century Schoolbook","Comic Sans","Comic Sans MS","Consolas","Courier","Courier New","Garamond","Geneva","Georgia","Helvetica","Helvetica Neue","Impact","Lucida Bright","Lucida Calligraphy","Lucida Console","Lucida Fax","LUCIDA GRANDE","Lucida Handwriting","Lucida Sans","Lucida Sans Typewriter","Lucida Sans Unicode","Microsoft Sans Serif","Monaco","Monotype Corsiva","MS Gothic","MS Outlook","MS PGothic","MS Reference Sans Serif","MS Sans Serif","MS Serif","MYRIAD","MYRIAD PRO","Palatino","Palatino Linotype","Segoe Print","Segoe Script","Segoe UI","Segoe UI Light","Segoe UI Semibold","Segoe UI Symbol","Tahoma","Times","Times New Roman","Times New Roman PS","Trebuchet MS","Verdana","Wingdings","Wingdings 2","Wingdings 3"],p=["Abadi MT Condensed Light","Academy Engraved LET","ADOBE CASLON PRO","Adobe Garamond","ADOBE GARAMOND PRO","Agency FB","Aharoni","Albertus Extra Bold","Albertus Medium","Algerian","Amazone BT","American Typewriter","American Typewriter Condensed","AmerType Md BT","Andalus","Angsana New","AngsanaUPC","Antique Olive","Aparajita","Apple Chancery","Apple Color Emoji","Apple SD Gothic Neo","Arabic Typesetting","ARCHER","ARNO PRO","Arrus BT","Aurora Cn BT","AvantGarde Bk BT","AvantGarde Md BT","AVENIR","Ayuthaya","Bandy","Bangla Sangam MN","Bank Gothic","BankGothic Md BT","Baskerville","Baskerville Old Face","Batang","BatangChe","Bauer Bodoni","Bauhaus 93","Bazooka","Bell MT","Bembo","Benguiat Bk BT","Berlin Sans FB","Berlin Sans FB Demi","Bernard MT Condensed","BernhardFashion BT","BernhardMod BT","Big Caslon","BinnerD","Blackadder ITC","BlairMdITC TT","Bodoni 72","Bodoni 72 Oldstyle","Bodoni 72 Smallcaps","Bodoni MT","Bodoni MT Black","Bodoni MT Condensed","Bodoni MT Poster Compressed","Bookshelf Symbol 7","Boulder","Bradley Hand","Bradley Hand ITC","Bremen Bd BT","Britannic Bold","Broadway","Browallia New","BrowalliaUPC","Brush Script MT","Californian FB","Calisto MT","Calligrapher","Candara","CaslonOpnface BT","Castellar","Centaur","Cezanne","CG Omega","CG Times","Chalkboard","Chalkboard SE","Chalkduster","Charlesworth","Charter Bd BT","Charter BT","Chaucer","ChelthmITC Bk BT","Chiller","Clarendon","Clarendon Condensed","CloisterBlack BT","Cochin","Colonna MT","Constantia","Cooper Black","Copperplate","Copperplate Gothic","Copperplate Gothic Bold","Copperplate Gothic Light","CopperplGoth Bd BT","Corbel","Cordia New","CordiaUPC","Cornerstone","Coronet","Cuckoo","Curlz MT","DaunPenh","Dauphin","David","DB LCD Temp","DELICIOUS","Denmark","DFKai-SB","Didot","DilleniaUPC","DIN","DokChampa","Dotum","DotumChe","Ebrima","Edwardian Script ITC","Elephant","English 111 Vivace BT","Engravers MT","EngraversGothic BT","Eras Bold ITC","Eras Demi ITC","Eras Light ITC","Eras Medium ITC","EucrosiaUPC","Euphemia","Euphemia UCAS","EUROSTILE","Exotc350 Bd BT","FangSong","Felix Titling","Fixedsys","FONTIN","Footlight MT Light","Forte","FrankRuehl","Fransiscan","Freefrm721 Blk BT","FreesiaUPC","Freestyle Script","French Script MT","FrnkGothITC Bk BT","Fruitger","FRUTIGER","Futura","Futura Bk BT","Futura Lt BT","Futura Md BT","Futura ZBlk BT","FuturaBlack BT","Gabriola","Galliard BT","Gautami","Geeza Pro","Geometr231 BT","Geometr231 Hv BT","Geometr231 Lt BT","GeoSlab 703 Lt BT","GeoSlab 703 XBd BT","Gigi","Gill Sans","Gill Sans MT","Gill Sans MT Condensed","Gill Sans MT Ext Condensed Bold","Gill Sans Ultra Bold","Gill Sans Ultra Bold Condensed","Gisha","Gloucester MT Extra Condensed","GOTHAM","GOTHAM BOLD","Goudy Old Style","Goudy Stout","GoudyHandtooled BT","GoudyOLSt BT","Gujarati Sangam MN","Gulim","GulimChe","Gungsuh","GungsuhChe","Gurmukhi MN","Haettenschweiler","Harlow Solid Italic","Harrington","Heather","Heiti SC","Heiti TC","HELV","Herald","High Tower Text","Hiragino Kaku Gothic ProN","Hiragino Mincho ProN","Hoefler Text","Humanst 521 Cn BT","Humanst521 BT","Humanst521 Lt BT","Imprint MT Shadow","Incised901 Bd BT","Incised901 BT","Incised901 Lt BT","INCONSOLATA","Informal Roman","Informal011 BT","INTERSTATE","IrisUPC","Iskoola Pota","JasmineUPC","Jazz LET","Jenson","Jester","Jokerman","Juice ITC","Kabel Bk BT","Kabel Ult BT","Kailasa","KaiTi","Kalinga","Kannada Sangam MN","Kartika","Kaufmann Bd BT","Kaufmann BT","Khmer UI","KodchiangUPC","Kokila","Korinna BT","Kristen ITC","Krungthep","Kunstler Script","Lao UI","Latha","Leelawadee","Letter Gothic","Levenim MT","LilyUPC","Lithograph","Lithograph Light","Long Island","Lydian BT","Magneto","Maiandra GD","Malayalam Sangam MN","Malgun Gothic","Mangal","Marigold","Marion","Marker Felt","Market","Marlett","Matisse ITC","Matura MT Script Capitals","Meiryo","Meiryo UI","Microsoft Himalaya","Microsoft JhengHei","Microsoft New Tai Lue","Microsoft PhagsPa","Microsoft Tai Le","Microsoft Uighur","Microsoft YaHei","Microsoft Yi Baiti","MingLiU","MingLiU_HKSCS","MingLiU_HKSCS-ExtB","MingLiU-ExtB","Minion","Minion Pro","Miriam","Miriam Fixed","Mistral","Modern","Modern No. 20","Mona Lisa Solid ITC TT","Mongolian Baiti","MONO","MoolBoran","Mrs Eaves","MS LineDraw","MS Mincho","MS PMincho","MS Reference Specialty","MS UI Gothic","MT Extra","MUSEO","MV Boli","Nadeem","Narkisim","NEVIS","News Gothic","News GothicMT","NewsGoth BT","Niagara Engraved","Niagara Solid","Noteworthy","NSimSun","Nyala","OCR A Extended","Old Century","Old English Text MT","Onyx","Onyx BT","OPTIMA","Oriya Sangam MN","OSAKA","OzHandicraft BT","Palace Script MT","Papyrus","Parchment","Party LET","Pegasus","Perpetua","Perpetua Titling MT","PetitaBold","Pickwick","Plantagenet Cherokee","Playbill","PMingLiU","PMingLiU-ExtB","Poor Richard","Poster","PosterBodoni BT","PRINCETOWN LET","Pristina","PTBarnum BT","Pythagoras","Raavi","Rage Italic","Ravie","Ribbon131 Bd BT","Rockwell","Rockwell Condensed","Rockwell Extra Bold","Rod","Roman","Sakkal Majalla","Santa Fe LET","Savoye LET","Sceptre","Script","Script MT Bold","SCRIPTINA","Serifa","Serifa BT","Serifa Th BT","ShelleyVolante BT","Sherwood","Shonar Bangla","Showcard Gothic","Shruti","Signboard","SILKSCREEN","SimHei","Simplified Arabic","Simplified Arabic Fixed","SimSun","SimSun-ExtB","Sinhala Sangam MN","Sketch Rockwell","Skia","Small Fonts","Snap ITC","Snell Roundhand","Socket","Souvenir Lt BT","Staccato222 BT","Steamer","Stencil","Storybook","Styllo","Subway","Swis721 BlkEx BT","Swiss911 XCm BT","Sylfaen","Synchro LET","System","Tamil Sangam MN","Technical","Teletype","Telugu Sangam MN","Tempus Sans ITC","Terminal","Thonburi","Traditional Arabic","Trajan","TRAJAN PRO","Tristan","Tubular","Tunga","Tw Cen MT","Tw Cen MT Condensed","Tw Cen MT Condensed Extra Bold","TypoUpright BT","Unicorn","Univers","Univers CE 55 Medium","Univers Condensed","Utsaah","Vagabond","Vani","Vijaya","Viner Hand ITC","VisualUI","Vivaldi","Vladimir Script","Vrinda","Westminster","WHITNEY","Wide Latin","ZapfEllipt BT","ZapfHumnst BT","ZapfHumnst Dm BT","Zapfino","Zurich BlkEx BT","Zurich Ex BT","ZWAdobeF"];i.options.extendedJsFonts&&(g=g.concat(p));for(var f=[],m=0,S=g.length;S>m;m++)c(g[m])&&f.push(g[m]);e.push({key:"js_fonts",value:f}),t(e)},1)},pluginsKey:function(e){return this.options.excludePlugins||(this.isIE()?e.push({key:"ie_plugins",value:this.getIEPlugins()}):e.push({key:"regular_plugins",value:this.getRegularPlugins()})),e},getRegularPlugins:function(){for(var e=[],t=0,i=navigator.plugins.length;i>t;t++)e.push(navigator.plugins[t]);return this.pluginsShouldBeSorted()&&(e=e.sort(function(e,t){return e.name>t.name?1:e.namet;t++){var a=this.options.sortPluginsFor[t];if(navigator.userAgent.match(a)){e=!0;break}}return e},touchSupportKey:function(e){return this.options.excludeTouchSupport||e.push({key:"touch_support",value:this.getTouchSupport()}),e},hasSessionStorage:function(){try{return!!window.sessionStorage}catch(e){return!0}},hasLocalStorage:function(){try{return!!window.localStorage}catch(e){return!0}},hasIndexedDB:function(){return!!window.indexedDB},getNavigatorCpuClass:function(){return navigator.cpuClass?navigator.cpuClass:"unknown"},getNavigatorPlatform:function(){return navigator.platform?navigator.platform:"unknown"},getDoNotTrack:function(){return navigator.doNotTrack?navigator.doNotTrack:"unknown"},getTouchSupport:function(){var e=0,t=!1;"undefined"!=typeof navigator.maxTouchPoints?e=navigator.maxTouchPoints:"undefined"!=typeof navigator.msMaxTouchPoints&&(e=navigator.msMaxTouchPoints);try{document.createEvent("TouchEvent"),t=!0}catch(i){}var a="ontouchstart"in window;return[e,t,a]},getCanvasFp:function(){var e=[],t=document.createElement("canvas");t.width=2e3,t.height=200,t.style.display="inline";var i=t.getContext("2d");return i.rect(0,0,10,10),i.rect(2,2,6,6),e.push("canvas winding:"+(i.isPointInPath(5,5,"evenodd")===!1?"yes":"no")),i.textBaseline="alphabetic",i.fillStyle="#f60",i.fillRect(125,1,62,20),i.fillStyle="#069",this.options.dontUseFakeFontInCanvas?i.font="11pt Arial":i.font="11pt no-real-font-123",i.fillText("Cwm fjordbank glyphs vext quiz, 😃",2,15),i.fillStyle="rgba(102, 204, 0, 0.7)",i.font="18pt Arial",i.fillText("Cwm fjordbank glyphs vext quiz, 😃",4,45),i.globalCompositeOperation="multiply",i.fillStyle="rgb(255,0,255)",i.beginPath(),i.arc(50,50,50,0,2*Math.PI,!0),i.closePath(),i.fill(),i.fillStyle="rgb(0,255,255)",i.beginPath(),i.arc(100,50,50,0,2*Math.PI,!0),i.closePath(),i.fill(),i.fillStyle="rgb(255,255,0)",i.beginPath(),i.arc(75,100,50,0,2*Math.PI,!0),i.closePath(),i.fill(),i.fillStyle="rgb(255,0,255)",i.arc(75,75,75,0,2*Math.PI,!0),i.arc(75,75,25,0,2*Math.PI,!0),i.fill("evenodd"),e.push("canvas fp:"+t.toDataURL()),e.join("~")},getWebglFp:function(){var e,t=function(t){return e.clearColor(0,0,0,1),e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT),"["+t[0]+", "+t[1]+"]"},i=function(e){var t,i=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic");return i?(t=e.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT),0===t&&(t=2),t):null};if(e=this.getWebglCanvas(),!e)return null;var a=[],r="attribute vec2 attrVertex;varying vec2 varyinTexCoordinate;uniform vec2 uniformOffset;void main(){varyinTexCoordinate=attrVertex+uniformOffset;gl_Position=vec4(attrVertex,0,1);}",n="precision mediump float;varying vec2 varyinTexCoordinate;void main() {gl_FragColor=vec4(varyinTexCoordinate,0,1);}",o=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,o);var s=new Float32Array([-.2,-.9,0,.4,-.26,0,0,.732134444,0]);e.bufferData(e.ARRAY_BUFFER,s,e.STATIC_DRAW),o.itemSize=3,o.numItems=3;var l=e.createProgram(),h=e.createShader(e.VERTEX_SHADER);e.shaderSource(h,r),e.compileShader(h);var u=e.createShader(e.FRAGMENT_SHADER);return e.shaderSource(u,n),e.compileShader(u),e.attachShader(l,h),e.attachShader(l,u),e.linkProgram(l),e.useProgram(l),l.vertexPosAttrib=e.getAttribLocation(l,"attrVertex"),l.offsetUniform=e.getUniformLocation(l,"uniformOffset"),e.enableVertexAttribArray(l.vertexPosArray),e.vertexAttribPointer(l.vertexPosAttrib,o.itemSize,e.FLOAT,!1,0,0),e.uniform2f(l.offsetUniform,1,1),e.drawArrays(e.TRIANGLE_STRIP,0,o.numItems),null!=e.canvas&&a.push(e.canvas.toDataURL()),a.push("extensions:"+e.getSupportedExtensions().join(";")),a.push("webgl aliased line width range:"+t(e.getParameter(e.ALIASED_LINE_WIDTH_RANGE))),a.push("webgl aliased point size range:"+t(e.getParameter(e.ALIASED_POINT_SIZE_RANGE))),a.push("webgl alpha bits:"+e.getParameter(e.ALPHA_BITS)),a.push("webgl antialiasing:"+(e.getContextAttributes().antialias?"yes":"no")),a.push("webgl blue bits:"+e.getParameter(e.BLUE_BITS)),a.push("webgl depth bits:"+e.getParameter(e.DEPTH_BITS)),a.push("webgl green bits:"+e.getParameter(e.GREEN_BITS)),a.push("webgl max anisotropy:"+i(e)),a.push("webgl max combined texture image units:"+e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS)),a.push("webgl max cube map texture size:"+e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE)),a.push("webgl max fragment uniform vectors:"+e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS)),a.push("webgl max render buffer size:"+e.getParameter(e.MAX_RENDERBUFFER_SIZE)),a.push("webgl max texture image units:"+e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),a.push("webgl max texture size:"+e.getParameter(e.MAX_TEXTURE_SIZE)),a.push("webgl max varying vectors:"+e.getParameter(e.MAX_VARYING_VECTORS)),a.push("webgl max vertex attribs:"+e.getParameter(e.MAX_VERTEX_ATTRIBS)),a.push("webgl max vertex texture image units:"+e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS)),a.push("webgl max vertex uniform vectors:"+e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS)),a.push("webgl max viewport dims:"+t(e.getParameter(e.MAX_VIEWPORT_DIMS))),a.push("webgl red bits:"+e.getParameter(e.RED_BITS)),a.push("webgl renderer:"+e.getParameter(e.RENDERER)),a.push("webgl shading language version:"+e.getParameter(e.SHADING_LANGUAGE_VERSION)),a.push("webgl stencil bits:"+e.getParameter(e.STENCIL_BITS)),a.push("webgl vendor:"+e.getParameter(e.VENDOR)),a.push("webgl version:"+e.getParameter(e.VERSION)),e.getShaderPrecisionFormat?(a.push("webgl vertex shader high float precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision),a.push("webgl vertex shader high float precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).rangeMin),a.push("webgl vertex shader high float precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).rangeMax),a.push("webgl vertex shader medium float precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision),a.push("webgl vertex shader medium float precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).rangeMin),a.push("webgl vertex shader medium float precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).rangeMax),a.push("webgl vertex shader low float precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_FLOAT).precision),a.push("webgl vertex shader low float precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_FLOAT).rangeMin),a.push("webgl vertex shader low float precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_FLOAT).rangeMax),a.push("webgl fragment shader high float precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision),a.push("webgl fragment shader high float precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).rangeMin),a.push("webgl fragment shader high float precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).rangeMax),a.push("webgl fragment shader medium float precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision),a.push("webgl fragment shader medium float precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).rangeMin),a.push("webgl fragment shader medium float precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).rangeMax),a.push("webgl fragment shader low float precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_FLOAT).precision),a.push("webgl fragment shader low float precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_FLOAT).rangeMin),a.push("webgl fragment shader low float precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_FLOAT).rangeMax),a.push("webgl vertex shader high int precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_INT).precision),a.push("webgl vertex shader high int precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_INT).rangeMin),a.push("webgl vertex shader high int precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_INT).rangeMax),a.push("webgl vertex shader medium int precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_INT).precision),a.push("webgl vertex shader medium int precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_INT).rangeMin),a.push("webgl vertex shader medium int precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_INT).rangeMax),a.push("webgl vertex shader low int precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_INT).precision),a.push("webgl vertex shader low int precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_INT).rangeMin),a.push("webgl vertex shader low int precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_INT).rangeMax),a.push("webgl fragment shader high int precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_INT).precision),a.push("webgl fragment shader high int precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_INT).rangeMin),a.push("webgl fragment shader high int precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_INT).rangeMax),a.push("webgl fragment shader medium int precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_INT).precision),a.push("webgl fragment shader medium int precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_INT).rangeMin),a.push("webgl fragment shader medium int precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_INT).rangeMax),a.push("webgl fragment shader low int precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_INT).precision),a.push("webgl fragment shader low int precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_INT).rangeMin),a.push("webgl fragment shader low int precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_INT).rangeMax),a.join("~")):a.join("~")},getAdBlock:function(){var e=document.createElement("div");e.setAttribute("id","ads");try{return document.body.appendChild(e),!document.getElementById("ads")}catch(t){return!1}},getHasLiedLanguages:function(){if("undefined"!=typeof navigator.languages)try{var e=navigator.languages[0].substr(0,2);if(e!==navigator.language.substr(0,2))return!0}catch(t){return!0}return!1},getHasLiedResolution:function(){return screen.width=0?"Windows Phone":t.indexOf("win")>=0?"Windows":t.indexOf("android")>=0?"Android":t.indexOf("linux")>=0?"Linux":t.indexOf("iphone")>=0||t.indexOf("ipad")>=0?"iOS":t.indexOf("mac")>=0?"Mac":"Other";var r;if(r="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,r&&"Windows Phone"!==e&&"Android"!==e&&"iOS"!==e&&"Other"!==e)return!0;if("undefined"!=typeof i){if(i=i.toLowerCase(),i.indexOf("win")>=0&&"Windows"!==e&&"Windows Phone"!==e)return!0;if(i.indexOf("linux")>=0&&"Linux"!==e&&"Android"!==e)return!0;if(i.indexOf("mac")>=0&&"Mac"!==e&&"iOS"!==e)return!0;if(0===i.indexOf("win")&&0===i.indexOf("linux")&&i.indexOf("mac")>=0&&"other"!==e)return!0}return a.indexOf("win")>=0&&"Windows"!==e&&"Windows Phone"!==e?!0:(a.indexOf("linux")>=0||a.indexOf("android")>=0||a.indexOf("pike")>=0)&&"Linux"!==e&&"Android"!==e?!0:(a.indexOf("mac")>=0||a.indexOf("ipad")>=0||a.indexOf("ipod")>=0||a.indexOf("iphone")>=0)&&"Mac"!==e&&"iOS"!==e?!0:0===a.indexOf("win")&&0===a.indexOf("linux")&&a.indexOf("mac")>=0&&"other"!==e?!0:"undefined"==typeof navigator.plugins&&"Windows"!==e&&"Windows Phone"!==e},getHasLiedBrowser:function(){var e,t=navigator.userAgent.toLowerCase(),i=navigator.productSub;if(e=t.indexOf("firefox")>=0?"Firefox":t.indexOf("opera")>=0||t.indexOf("opr")>=0?"Opera":t.indexOf("chrome")>=0?"Chrome":t.indexOf("safari")>=0?"Safari":t.indexOf("trident")>=0?"Internet Explorer":"Other",("Chrome"===e||"Safari"===e||"Opera"===e)&&"20030107"!==i)return!0;var a=eval.toString().length;if(37===a&&"Safari"!==e&&"Firefox"!==e&&"Other"!==e)return!0;if(39===a&&"Internet Explorer"!==e&&"Other"!==e)return!0;if(33===a&&"Chrome"!==e&&"Opera"!==e&&"Other"!==e)return!0;var r;try{throw"a"}catch(n){try{n.toSource(),r=!0}catch(o){r=!1}}return!(!r||"Firefox"===e||"Other"===e)},isCanvasSupported:function(){var e=document.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))},isWebGlSupported:function(){if(!this.isCanvasSupported())return!1;var e,t=document.createElement("canvas");try{e=t.getContext&&(t.getContext("webgl")||t.getContext("experimental-webgl"))}catch(i){e=!1}return!!window.WebGLRenderingContext&&!!e},isIE:function(){return"Microsoft Internet Explorer"===navigator.appName?!0:!("Netscape"!==navigator.appName||!/Trident/.test(navigator.userAgent))},hasSwfObjectLoaded:function(){return"undefined"!=typeof window.swfobject},hasMinFlashInstalled:function(){return swfobject.hasFlashPlayerVersion("9.0.0")},addFlashDivNode:function(){var e=document.createElement("div");e.setAttribute("id",this.options.swfContainerId),document.body.appendChild(e)},loadSwfAndDetectFonts:function(e){var t="___fp_swf_loaded";window[t]=function(t){e(t)};var i=this.options.swfContainerId;this.addFlashDivNode();var a={onReady:t},r={allowScriptAccess:"always",menu:"false"};swfobject.embedSWF(this.options.swfPath,i,"1","1","9.0.0",!1,a,r,{})},getWebglCanvas:function(){var e=document.createElement("canvas"),t=null;try{t=e.getContext("webgl")||e.getContext("experimental-webgl")}catch(i){}return t||(t=null),t},each:function(e,t,i){if(null!==e)if(this.nativeForEach&&e.forEach===this.nativeForEach)e.forEach(t,i);else if(e.length===+e.length){for(var a=0,r=e.length;r>a;a++)if(t.call(i,e[a],a,e)==={})return}else for(var n in e)if(e.hasOwnProperty(n)&&t.call(i,e[n],n,e)==={})return},map:function(e,t,i){var a=[];return null==e?a:this.nativeMap&&e.map===this.nativeMap?e.map(t,i):(this.each(e,function(e,r,n){a[a.length]=t.call(i,e,r,n)}),a)},x64Add:function(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var i=[0,0,0,0];return i[3]+=e[3]+t[3],i[2]+=i[3]>>>16,i[3]&=65535,i[2]+=e[2]+t[2],i[1]+=i[2]>>>16,i[2]&=65535,i[1]+=e[1]+t[1],i[0]+=i[1]>>>16,i[1]&=65535,i[0]+=e[0]+t[0],i[0]&=65535,[i[0]<<16|i[1],i[2]<<16|i[3]]},x64Multiply:function(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var i=[0,0,0,0];return i[3]+=e[3]*t[3],i[2]+=i[3]>>>16,i[3]&=65535,i[2]+=e[2]*t[3],i[1]+=i[2]>>>16,i[2]&=65535,i[2]+=e[3]*t[2],i[1]+=i[2]>>>16,i[2]&=65535,i[1]+=e[1]*t[3],i[0]+=i[1]>>>16,i[1]&=65535,i[1]+=e[2]*t[2],i[0]+=i[1]>>>16,i[1]&=65535,i[1]+=e[3]*t[1],i[0]+=i[1]>>>16,i[1]&=65535,i[0]+=e[0]*t[3]+e[1]*t[2]+e[2]*t[1]+e[3]*t[0],i[0]&=65535,[i[0]<<16|i[1],i[2]<<16|i[3]]},x64Rotl:function(e,t){return t%=64,32===t?[e[1],e[0]]:32>t?[e[0]<>>32-t,e[1]<>>32-t]:(t-=32,[e[1]<>>32-t,e[0]<>>32-t])},x64LeftShift:function(e,t){return t%=64,0===t?e:32>t?[e[0]<>>32-t,e[1]<>>1]),e=this.x64Multiply(e,[4283543511,3981806797]),e=this.x64Xor(e,[0,e[0]>>>1]),e=this.x64Multiply(e,[3301882366,444984403]),e=this.x64Xor(e,[0,e[0]>>>1])},x64hash128:function(e,t){e=e||"",t=t||0;for(var i=e.length%16,a=e.length-i,r=[0,t],n=[0,t],o=[0,0],s=[0,0],l=[2277735313,289559509],h=[1291169091,658871167],u=0;a>u;u+=16)o=[255&e.charCodeAt(u+4)|(255&e.charCodeAt(u+5))<<8|(255&e.charCodeAt(u+6))<<16|(255&e.charCodeAt(u+7))<<24,255&e.charCodeAt(u)|(255&e.charCodeAt(u+1))<<8|(255&e.charCodeAt(u+2))<<16|(255&e.charCodeAt(u+3))<<24],s=[255&e.charCodeAt(u+12)|(255&e.charCodeAt(u+13))<<8|(255&e.charCodeAt(u+14))<<16|(255&e.charCodeAt(u+15))<<24,255&e.charCodeAt(u+8)|(255&e.charCodeAt(u+9))<<8|(255&e.charCodeAt(u+10))<<16|(255&e.charCodeAt(u+11))<<24],o=this.x64Multiply(o,l),o=this.x64Rotl(o,31),o=this.x64Multiply(o,h),r=this.x64Xor(r,o),r=this.x64Rotl(r,27),r=this.x64Add(r,n),r=this.x64Add(this.x64Multiply(r,[0,5]),[0,1390208809]),s=this.x64Multiply(s,h),s=this.x64Rotl(s,33),s=this.x64Multiply(s,l),n=this.x64Xor(n,s),n=this.x64Rotl(n,31),n=this.x64Add(n,r),n=this.x64Add(this.x64Multiply(n,[0,5]),[0,944331445]);switch(o=[0,0],s=[0,0],i){case 15:s=this.x64Xor(s,this.x64LeftShift([0,e.charCodeAt(u+14)],48));case 14:s=this.x64Xor(s,this.x64LeftShift([0,e.charCodeAt(u+13)],40));case 13:s=this.x64Xor(s,this.x64LeftShift([0,e.charCodeAt(u+12)],32));case 12:s=this.x64Xor(s,this.x64LeftShift([0,e.charCodeAt(u+11)],24));case 11:s=this.x64Xor(s,this.x64LeftShift([0,e.charCodeAt(u+10)],16));case 10:s=this.x64Xor(s,this.x64LeftShift([0,e.charCodeAt(u+9)],8));case 9:s=this.x64Xor(s,[0,e.charCodeAt(u+8)]),s=this.x64Multiply(s,h),s=this.x64Rotl(s,33), +s=this.x64Multiply(s,l),n=this.x64Xor(n,s);case 8:o=this.x64Xor(o,this.x64LeftShift([0,e.charCodeAt(u+7)],56));case 7:o=this.x64Xor(o,this.x64LeftShift([0,e.charCodeAt(u+6)],48));case 6:o=this.x64Xor(o,this.x64LeftShift([0,e.charCodeAt(u+5)],40));case 5:o=this.x64Xor(o,this.x64LeftShift([0,e.charCodeAt(u+4)],32));case 4:o=this.x64Xor(o,this.x64LeftShift([0,e.charCodeAt(u+3)],24));case 3:o=this.x64Xor(o,this.x64LeftShift([0,e.charCodeAt(u+2)],16));case 2:o=this.x64Xor(o,this.x64LeftShift([0,e.charCodeAt(u+1)],8));case 1:o=this.x64Xor(o,[0,e.charCodeAt(u)]),o=this.x64Multiply(o,l),o=this.x64Rotl(o,31),o=this.x64Multiply(o,h),r=this.x64Xor(r,o)}return r=this.x64Xor(r,[0,e.length]),n=this.x64Xor(n,[0,e.length]),r=this.x64Add(r,n),n=this.x64Add(n,r),r=this.x64Fmix(r),n=this.x64Fmix(n),r=this.x64Add(r,n),n=this.x64Add(n,r),("00000000"+(r[0]>>>0).toString(16)).slice(-8)+("00000000"+(r[1]>>>0).toString(16)).slice(-8)+("00000000"+(n[0]>>>0).toString(16)).slice(-8)+("00000000"+(n[1]>>>0).toString(16)).slice(-8)}},e.VERSION="1.1.3",e}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/fingerprintjs2/fingerprint2.js b/dashboard-ui/bower_components/fingerprintjs2/fingerprint2.js new file mode 100644 index 000000000..e272440c0 --- /dev/null +++ b/dashboard-ui/bower_components/fingerprintjs2/fingerprint2.js @@ -0,0 +1,1209 @@ +/* +* Fingerprintjs2 1.1.3 - Modern & flexible browser fingerprint library v2 +* https://github.com/Valve/fingerprintjs2 +* Copyright (c) 2015 Valentin Vasilyev (valentin.vasilyev@outlook.com) +* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +* ARE DISCLAIMED. IN NO EVENT SHALL VALENTIN VASILYEV BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +(function (name, context, definition) { + "use strict"; + if (typeof module !== "undefined" && module.exports) { module.exports = definition(); } + else if (typeof define === "function" && define.amd) { define(definition); } + else { context[name] = definition(); } +})("Fingerprint2", this, function() { + "use strict"; + // This will only be polyfilled for IE8 and older + // Taken from Mozilla MDC + if (!Array.prototype.indexOf) { + Array.prototype.indexOf = function(searchElement, fromIndex) { + var k; + if (this == null) { + throw new TypeError("'this' is null or undefined"); + } + var O = Object(this); + var len = O.length >>> 0; + if (len === 0) { + return -1; + } + var n = +fromIndex || 0; + if (Math.abs(n) === Infinity) { + n = 0; + } + if (n >= len) { + return -1; + } + k = Math.max(n >= 0 ? n : len - Math.abs(n), 0); + while (k < len) { + if (k in O && O[k] === searchElement) { + return k; + } + k++; + } + return -1; + }; + } + var Fingerprint2 = function(options) { + var defaultOptions = { + swfContainerId: "fingerprintjs2", + swfPath: "flash/compiled/FontList.swf", + detectScreenOrientation: true, + sortPluginsFor: [/palemoon/i] + }; + this.options = this.extend(options, defaultOptions); + this.nativeForEach = Array.prototype.forEach; + this.nativeMap = Array.prototype.map; + }; + Fingerprint2.prototype = { + extend: function(source, target) { + if (source == null) { return target; } + for (var k in source) { + if(source[k] != null && target[k] !== source[k]) { + target[k] = source[k]; + } + } + return target; + }, + log: function(msg){ + if(window.console){ + console.log(msg); + } + }, + get: function(done){ + var keys = []; + keys = this.userAgentKey(keys); + keys = this.languageKey(keys); + keys = this.colorDepthKey(keys); + keys = this.screenResolutionKey(keys); + keys = this.availableScreenResolutionKey(keys); + keys = this.timezoneOffsetKey(keys); + keys = this.sessionStorageKey(keys); + keys = this.localStorageKey(keys); + keys = this.indexedDbKey(keys); + keys = this.addBehaviorKey(keys); + keys = this.openDatabaseKey(keys); + keys = this.cpuClassKey(keys); + keys = this.platformKey(keys); + keys = this.doNotTrackKey(keys); + keys = this.pluginsKey(keys); + keys = this.canvasKey(keys); + keys = this.webglKey(keys); + keys = this.adBlockKey(keys); + keys = this.hasLiedLanguagesKey(keys); + keys = this.hasLiedResolutionKey(keys); + keys = this.hasLiedOsKey(keys); + keys = this.hasLiedBrowserKey(keys); + keys = this.touchSupportKey(keys); + var that = this; + this.fontsKey(keys, function(newKeys){ + var values = []; + that.each(newKeys, function(pair) { + var value = pair.value; + if (typeof pair.value.join !== "undefined") { + value = pair.value.join(";"); + } + values.push(value); + }); + var murmur = that.x64hash128(values.join("~~~"), 31); + return done(murmur, newKeys); + }); + }, + userAgentKey: function(keys) { + if(!this.options.excludeUserAgent) { + keys.push({key: "user_agent", value: this.getUserAgent()}); + } + return keys; + }, + // for tests + getUserAgent: function(){ + return navigator.userAgent; + }, + languageKey: function(keys) { + if(!this.options.excludeLanguage) { + // IE 9,10 on Windows 10 does not have the `navigator.language` property any longer + keys.push({ key: "language", value: navigator.language || navigator.userLanguage || navigator.browserLanguage || navigator.systemLanguage || "" }); + } + return keys; + }, + colorDepthKey: function(keys) { + if(!this.options.excludeColorDepth) { + keys.push({key: "color_depth", value: screen.colorDepth}); + } + return keys; + }, + screenResolutionKey: function(keys) { + if(!this.options.excludeScreenResolution) { + return this.getScreenResolution(keys); + } + return keys; + }, + getScreenResolution: function(keys) { + var resolution; + if(this.options.detectScreenOrientation) { + resolution = (screen.height > screen.width) ? [screen.height, screen.width] : [screen.width, screen.height]; + } else { + resolution = [screen.width, screen.height]; + } + if(typeof resolution !== "undefined") { // headless browsers + keys.push({key: "resolution", value: resolution}); + } + return keys; + }, + availableScreenResolutionKey: function(keys) { + if (!this.options.excludeAvailableScreenResolution) { + return this.getAvailableScreenResolution(keys); + } + return keys; + }, + getAvailableScreenResolution: function(keys) { + var available; + if(screen.availWidth && screen.availHeight) { + if(this.options.detectScreenOrientation) { + available = (screen.availHeight > screen.availWidth) ? [screen.availHeight, screen.availWidth] : [screen.availWidth, screen.availHeight]; + } else { + available = [screen.availHeight, screen.availWidth]; + } + } + if(typeof available !== "undefined") { // headless browsers + keys.push({key: "available_resolution", value: available}); + } + return keys; + }, + timezoneOffsetKey: function(keys) { + if(!this.options.excludeTimezoneOffset) { + keys.push({key: "timezone_offset", value: new Date().getTimezoneOffset()}); + } + return keys; + }, + sessionStorageKey: function(keys) { + if(!this.options.excludeSessionStorage && this.hasSessionStorage()) { + keys.push({key: "session_storage", value: 1}); + } + return keys; + }, + localStorageKey: function(keys) { + if(!this.options.excludeSessionStorage && this.hasLocalStorage()) { + keys.push({key: "local_storage", value: 1}); + } + return keys; + }, + indexedDbKey: function(keys) { + if(!this.options.excludeIndexedDB && this.hasIndexedDB()) { + keys.push({key: "indexed_db", value: 1}); + } + return keys; + }, + addBehaviorKey: function(keys) { + //body might not be defined at this point or removed programmatically + if(document.body && !this.options.excludeAddBehavior && document.body.addBehavior) { + keys.push({key: "add_behavior", value: 1}); + } + return keys; + }, + openDatabaseKey: function(keys) { + if(!this.options.excludeOpenDatabase && window.openDatabase) { + keys.push({key: "open_database", value: 1}); + } + return keys; + }, + cpuClassKey: function(keys) { + if(!this.options.excludeCpuClass) { + keys.push({key: "cpu_class", value: this.getNavigatorCpuClass()}); + } + return keys; + }, + platformKey: function(keys) { + if(!this.options.excludePlatform) { + keys.push({key: "navigator_platform", value: this.getNavigatorPlatform()}); + } + return keys; + }, + doNotTrackKey: function(keys) { + if(!this.options.excludeDoNotTrack) { + keys.push({key: "do_not_track", value: this.getDoNotTrack()}); + } + return keys; + }, + canvasKey: function(keys) { + if(!this.options.excludeCanvas && this.isCanvasSupported()) { + keys.push({key: "canvas", value: this.getCanvasFp()}); + } + return keys; + }, + webglKey: function(keys) { + if(this.options.excludeWebGL) { + if(typeof NODEBUG === "undefined"){ + this.log("Skipping WebGL fingerprinting per excludeWebGL configuration option"); + } + return keys; + } + if(!this.isWebGlSupported()) { + if(typeof NODEBUG === "undefined"){ + this.log("Skipping WebGL fingerprinting because it is not supported in this browser"); + } + return keys; + } + keys.push({key: "webgl", value: this.getWebglFp()}); + return keys; + }, + adBlockKey: function(keys){ + if(!this.options.excludeAdBlock) { + keys.push({key: "adblock", value: this.getAdBlock()}); + } + return keys; + }, + hasLiedLanguagesKey: function(keys){ + if(!this.options.excludeHasLiedLanguages){ + keys.push({key: "has_lied_languages", value: this.getHasLiedLanguages()}); + } + return keys; + }, + hasLiedResolutionKey: function(keys){ + if(!this.options.excludeHasLiedResolution){ + keys.push({key: "has_lied_resolution", value: this.getHasLiedResolution()}); + } + return keys; + }, + hasLiedOsKey: function(keys){ + if(!this.options.excludeHasLiedOs){ + keys.push({key: "has_lied_os", value: this.getHasLiedOs()}); + } + return keys; + }, + hasLiedBrowserKey: function(keys){ + if(!this.options.excludeHasLiedBrowser){ + keys.push({key: "has_lied_browser", value: this.getHasLiedBrowser()}); + } + return keys; + }, + fontsKey: function(keys, done) { + if (this.options.excludeJsFonts) { + return this.flashFontsKey(keys, done); + } + return this.jsFontsKey(keys, done); + }, + // flash fonts (will increase fingerprinting time 20X to ~ 130-150ms) + flashFontsKey: function(keys, done) { + if(this.options.excludeFlashFonts) { + if(typeof NODEBUG === "undefined"){ + this.log("Skipping flash fonts detection per excludeFlashFonts configuration option"); + } + return done(keys); + } + // we do flash if swfobject is loaded + if(!this.hasSwfObjectLoaded()){ + if(typeof NODEBUG === "undefined"){ + this.log("Swfobject is not detected, Flash fonts enumeration is skipped"); + } + return done(keys); + } + if(!this.hasMinFlashInstalled()){ + if(typeof NODEBUG === "undefined"){ + this.log("Flash is not installed, skipping Flash fonts enumeration"); + } + return done(keys); + } + if(typeof this.options.swfPath === "undefined"){ + if(typeof NODEBUG === "undefined"){ + this.log("To use Flash fonts detection, you must pass a valid swfPath option, skipping Flash fonts enumeration"); + } + return done(keys); + } + this.loadSwfAndDetectFonts(function(fonts){ + keys.push({key: "swf_fonts", value: fonts.join(";")}); + done(keys); + }); + }, + // kudos to http://www.lalit.org/lab/javascript-css-font-detect/ + jsFontsKey: function(keys, done) { + var that = this; + // doing js fonts detection in a pseudo-async fashion + return setTimeout(function(){ + + // a font will be compared against all the three default fonts. + // and if it doesn't match all 3 then that font is not available. + var baseFonts = ["monospace", "sans-serif", "serif"]; + + //we use m or w because these two characters take up the maximum width. + // And we use a LLi so that the same matching fonts can get separated + var testString = "mmmmmmmmmmlli"; + + //we test using 72px font size, we may use any size. I guess larger the better. + var testSize = "72px"; + + var h = document.getElementsByTagName("body")[0]; + + // create a SPAN in the document to get the width of the text we use to test + var s = document.createElement("span"); + /* + * We need this css as in some weird browser this + * span elements shows up for a microSec which creates a + * bad user experience + */ + s.style.position = "absolute"; + s.style.left = "-9999px"; + s.style.fontSize = testSize; + s.innerHTML = testString; + var defaultWidth = {}; + var defaultHeight = {}; + for (var index = 0, length = baseFonts.length; index < length; index++) { + //get the default width for the three base fonts + s.style.fontFamily = baseFonts[index]; + h.appendChild(s); + defaultWidth[baseFonts[index]] = s.offsetWidth; //width for the default font + defaultHeight[baseFonts[index]] = s.offsetHeight; //height for the defualt font + h.removeChild(s); + } + var detect = function (font) { + var detected = false; + for (var index = 0, l = baseFonts.length; index < l; index++) { + s.style.fontFamily = font + "," + baseFonts[index]; // name of the font along with the base font for fallback. + h.appendChild(s); + var matched = (s.offsetWidth !== defaultWidth[baseFonts[index]] || s.offsetHeight !== defaultHeight[baseFonts[index]]); + h.removeChild(s); + detected = detected || matched; + } + return detected; + }; + var fontList = [ + "Andale Mono", "Arial", "Arial Black", "Arial Hebrew", "Arial MT", "Arial Narrow", "Arial Rounded MT Bold", "Arial Unicode MS", + "Bitstream Vera Sans Mono", "Book Antiqua", "Bookman Old Style", + "Calibri", "Cambria", "Cambria Math", "Century", "Century Gothic", "Century Schoolbook", "Comic Sans", "Comic Sans MS", "Consolas", "Courier", "Courier New", + "Garamond", "Geneva", "Georgia", + "Helvetica", "Helvetica Neue", + "Impact", + "Lucida Bright", "Lucida Calligraphy", "Lucida Console", "Lucida Fax", "LUCIDA GRANDE", "Lucida Handwriting", "Lucida Sans", "Lucida Sans Typewriter", "Lucida Sans Unicode", + "Microsoft Sans Serif", "Monaco", "Monotype Corsiva", "MS Gothic", "MS Outlook", "MS PGothic", "MS Reference Sans Serif", "MS Sans Serif", "MS Serif", "MYRIAD", "MYRIAD PRO", + "Palatino", "Palatino Linotype", + "Segoe Print", "Segoe Script", "Segoe UI", "Segoe UI Light", "Segoe UI Semibold", "Segoe UI Symbol", + "Tahoma", "Times", "Times New Roman", "Times New Roman PS", "Trebuchet MS", + "Verdana", "Wingdings", "Wingdings 2", "Wingdings 3" + ]; + var extendedFontList = [ + "Abadi MT Condensed Light", "Academy Engraved LET", "ADOBE CASLON PRO", "Adobe Garamond", "ADOBE GARAMOND PRO", "Agency FB", "Aharoni", "Albertus Extra Bold", "Albertus Medium", "Algerian", "Amazone BT", "American Typewriter", + "American Typewriter Condensed", "AmerType Md BT", "Andalus", "Angsana New", "AngsanaUPC", "Antique Olive", "Aparajita", "Apple Chancery", "Apple Color Emoji", "Apple SD Gothic Neo", "Arabic Typesetting", "ARCHER", + "ARNO PRO", "Arrus BT", "Aurora Cn BT", "AvantGarde Bk BT", "AvantGarde Md BT", "AVENIR", "Ayuthaya", "Bandy", "Bangla Sangam MN", "Bank Gothic", "BankGothic Md BT", "Baskerville", + "Baskerville Old Face", "Batang", "BatangChe", "Bauer Bodoni", "Bauhaus 93", "Bazooka", "Bell MT", "Bembo", "Benguiat Bk BT", "Berlin Sans FB", "Berlin Sans FB Demi", "Bernard MT Condensed", "BernhardFashion BT", "BernhardMod BT", "Big Caslon", "BinnerD", + "Blackadder ITC", "BlairMdITC TT", "Bodoni 72", "Bodoni 72 Oldstyle", "Bodoni 72 Smallcaps", "Bodoni MT", "Bodoni MT Black", "Bodoni MT Condensed", "Bodoni MT Poster Compressed", + "Bookshelf Symbol 7", "Boulder", "Bradley Hand", "Bradley Hand ITC", "Bremen Bd BT", "Britannic Bold", "Broadway", "Browallia New", "BrowalliaUPC", "Brush Script MT", "Californian FB", "Calisto MT", "Calligrapher", "Candara", + "CaslonOpnface BT", "Castellar", "Centaur", "Cezanne", "CG Omega", "CG Times", "Chalkboard", "Chalkboard SE", "Chalkduster", "Charlesworth", "Charter Bd BT", "Charter BT", "Chaucer", + "ChelthmITC Bk BT", "Chiller", "Clarendon", "Clarendon Condensed", "CloisterBlack BT", "Cochin", "Colonna MT", "Constantia", "Cooper Black", "Copperplate", "Copperplate Gothic", "Copperplate Gothic Bold", + "Copperplate Gothic Light", "CopperplGoth Bd BT", "Corbel", "Cordia New", "CordiaUPC", "Cornerstone", "Coronet", "Cuckoo", "Curlz MT", "DaunPenh", "Dauphin", "David", "DB LCD Temp", "DELICIOUS", "Denmark", + "DFKai-SB", "Didot", "DilleniaUPC", "DIN", "DokChampa", "Dotum", "DotumChe", "Ebrima", "Edwardian Script ITC", "Elephant", "English 111 Vivace BT", "Engravers MT", "EngraversGothic BT", "Eras Bold ITC", "Eras Demi ITC", "Eras Light ITC", "Eras Medium ITC", + "EucrosiaUPC", "Euphemia", "Euphemia UCAS", "EUROSTILE", "Exotc350 Bd BT", "FangSong", "Felix Titling", "Fixedsys", "FONTIN", "Footlight MT Light", "Forte", + "FrankRuehl", "Fransiscan", "Freefrm721 Blk BT", "FreesiaUPC", "Freestyle Script", "French Script MT", "FrnkGothITC Bk BT", "Fruitger", "FRUTIGER", + "Futura", "Futura Bk BT", "Futura Lt BT", "Futura Md BT", "Futura ZBlk BT", "FuturaBlack BT", "Gabriola", "Galliard BT", "Gautami", "Geeza Pro", "Geometr231 BT", "Geometr231 Hv BT", "Geometr231 Lt BT", "GeoSlab 703 Lt BT", + "GeoSlab 703 XBd BT", "Gigi", "Gill Sans", "Gill Sans MT", "Gill Sans MT Condensed", "Gill Sans MT Ext Condensed Bold", "Gill Sans Ultra Bold", "Gill Sans Ultra Bold Condensed", "Gisha", "Gloucester MT Extra Condensed", "GOTHAM", "GOTHAM BOLD", + "Goudy Old Style", "Goudy Stout", "GoudyHandtooled BT", "GoudyOLSt BT", "Gujarati Sangam MN", "Gulim", "GulimChe", "Gungsuh", "GungsuhChe", "Gurmukhi MN", "Haettenschweiler", "Harlow Solid Italic", "Harrington", "Heather", "Heiti SC", "Heiti TC", "HELV", + "Herald", "High Tower Text", "Hiragino Kaku Gothic ProN", "Hiragino Mincho ProN", "Hoefler Text", "Humanst 521 Cn BT", "Humanst521 BT", "Humanst521 Lt BT", "Imprint MT Shadow", "Incised901 Bd BT", "Incised901 BT", + "Incised901 Lt BT", "INCONSOLATA", "Informal Roman", "Informal011 BT", "INTERSTATE", "IrisUPC", "Iskoola Pota", "JasmineUPC", "Jazz LET", "Jenson", "Jester", "Jokerman", "Juice ITC", "Kabel Bk BT", "Kabel Ult BT", "Kailasa", "KaiTi", "Kalinga", "Kannada Sangam MN", + "Kartika", "Kaufmann Bd BT", "Kaufmann BT", "Khmer UI", "KodchiangUPC", "Kokila", "Korinna BT", "Kristen ITC", "Krungthep", "Kunstler Script", "Lao UI", "Latha", "Leelawadee", "Letter Gothic", "Levenim MT", "LilyUPC", "Lithograph", "Lithograph Light", "Long Island", + "Lydian BT", "Magneto", "Maiandra GD", "Malayalam Sangam MN", "Malgun Gothic", + "Mangal", "Marigold", "Marion", "Marker Felt", "Market", "Marlett", "Matisse ITC", "Matura MT Script Capitals", "Meiryo", "Meiryo UI", "Microsoft Himalaya", "Microsoft JhengHei", "Microsoft New Tai Lue", "Microsoft PhagsPa", "Microsoft Tai Le", + "Microsoft Uighur", "Microsoft YaHei", "Microsoft Yi Baiti", "MingLiU", "MingLiU_HKSCS", "MingLiU_HKSCS-ExtB", "MingLiU-ExtB", "Minion", "Minion Pro", "Miriam", "Miriam Fixed", "Mistral", "Modern", "Modern No. 20", "Mona Lisa Solid ITC TT", "Mongolian Baiti", + "MONO", "MoolBoran", "Mrs Eaves", "MS LineDraw", "MS Mincho", "MS PMincho", "MS Reference Specialty", "MS UI Gothic", "MT Extra", "MUSEO", "MV Boli", + "Nadeem", "Narkisim", "NEVIS", "News Gothic", "News GothicMT", "NewsGoth BT", "Niagara Engraved", "Niagara Solid", "Noteworthy", "NSimSun", "Nyala", "OCR A Extended", "Old Century", "Old English Text MT", "Onyx", "Onyx BT", "OPTIMA", "Oriya Sangam MN", + "OSAKA", "OzHandicraft BT", "Palace Script MT", "Papyrus", "Parchment", "Party LET", "Pegasus", "Perpetua", "Perpetua Titling MT", "PetitaBold", "Pickwick", "Plantagenet Cherokee", "Playbill", "PMingLiU", "PMingLiU-ExtB", + "Poor Richard", "Poster", "PosterBodoni BT", "PRINCETOWN LET", "Pristina", "PTBarnum BT", "Pythagoras", "Raavi", "Rage Italic", "Ravie", "Ribbon131 Bd BT", "Rockwell", "Rockwell Condensed", "Rockwell Extra Bold", "Rod", "Roman", "Sakkal Majalla", + "Santa Fe LET", "Savoye LET", "Sceptre", "Script", "Script MT Bold", "SCRIPTINA", "Serifa", "Serifa BT", "Serifa Th BT", "ShelleyVolante BT", "Sherwood", + "Shonar Bangla", "Showcard Gothic", "Shruti", "Signboard", "SILKSCREEN", "SimHei", "Simplified Arabic", "Simplified Arabic Fixed", "SimSun", "SimSun-ExtB", "Sinhala Sangam MN", "Sketch Rockwell", "Skia", "Small Fonts", "Snap ITC", "Snell Roundhand", "Socket", + "Souvenir Lt BT", "Staccato222 BT", "Steamer", "Stencil", "Storybook", "Styllo", "Subway", "Swis721 BlkEx BT", "Swiss911 XCm BT", "Sylfaen", "Synchro LET", "System", "Tamil Sangam MN", "Technical", "Teletype", "Telugu Sangam MN", "Tempus Sans ITC", + "Terminal", "Thonburi", "Traditional Arabic", "Trajan", "TRAJAN PRO", "Tristan", "Tubular", "Tunga", "Tw Cen MT", "Tw Cen MT Condensed", "Tw Cen MT Condensed Extra Bold", + "TypoUpright BT", "Unicorn", "Univers", "Univers CE 55 Medium", "Univers Condensed", "Utsaah", "Vagabond", "Vani", "Vijaya", "Viner Hand ITC", "VisualUI", "Vivaldi", "Vladimir Script", "Vrinda", "Westminster", "WHITNEY", "Wide Latin", + "ZapfEllipt BT", "ZapfHumnst BT", "ZapfHumnst Dm BT", "Zapfino", "Zurich BlkEx BT", "Zurich Ex BT", "ZWAdobeF"]; + + if(that.options.extendedJsFonts) { + fontList = fontList.concat(extendedFontList); + } + var available = []; + for (var i = 0, l = fontList.length; i < l; i++) { + if(detect(fontList[i])) { + available.push(fontList[i]); + } + } + keys.push({key: "js_fonts", value: available}); + done(keys); + }, 1); + }, + pluginsKey: function(keys) { + if(!this.options.excludePlugins){ + if(this.isIE()){ + keys.push({key: "ie_plugins", value: this.getIEPlugins()}); + } else { + keys.push({key: "regular_plugins", value: this.getRegularPlugins()}); + } + } + return keys; + }, + getRegularPlugins: function () { + var plugins = []; + for(var i = 0, l = navigator.plugins.length; i < l; i++) { + plugins.push(navigator.plugins[i]); + } + // sorting plugins only for those user agents, that we know randomize the plugins + // every time we try to enumerate them + if(this.pluginsShouldBeSorted()) { + plugins = plugins.sort(function(a, b) { + if(a.name > b.name){ return 1; } + if(a.name < b.name){ return -1; } + return 0; + }); + } + return this.map(plugins, function (p) { + var mimeTypes = this.map(p, function(mt){ + return [mt.type, mt.suffixes].join("~"); + }).join(","); + return [p.name, p.description, mimeTypes].join("::"); + }, this); + }, + getIEPlugins: function () { + var result = []; + if((Object.getOwnPropertyDescriptor && Object.getOwnPropertyDescriptor(window, "ActiveXObject")) || ("ActiveXObject" in window)) { + var names = [ + "AcroPDF.PDF", // Adobe PDF reader 7+ + "Adodb.Stream", + "AgControl.AgControl", // Silverlight + "DevalVRXCtrl.DevalVRXCtrl.1", + "MacromediaFlashPaper.MacromediaFlashPaper", + "Msxml2.DOMDocument", + "Msxml2.XMLHTTP", + "PDF.PdfCtrl", // Adobe PDF reader 6 and earlier, brrr + "QuickTime.QuickTime", // QuickTime + "QuickTimeCheckObject.QuickTimeCheck.1", + "RealPlayer", + "RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)", + "RealVideo.RealVideo(tm) ActiveX Control (32-bit)", + "Scripting.Dictionary", + "SWCtl.SWCtl", // ShockWave player + "Shell.UIHelper", + "ShockwaveFlash.ShockwaveFlash", //flash plugin + "Skype.Detection", + "TDCCtl.TDCCtl", + "WMPlayer.OCX", // Windows media player + "rmocx.RealPlayer G2 Control", + "rmocx.RealPlayer G2 Control.1" + ]; + // starting to detect plugins in IE + result = this.map(names, function(name) { + try { + new ActiveXObject(name); // eslint-disable-no-new + return name; + } catch(e) { + return null; + } + }); + } + if(navigator.plugins) { + result = result.concat(this.getRegularPlugins()); + } + return result; + }, + pluginsShouldBeSorted: function () { + var should = false; + for(var i = 0, l = this.options.sortPluginsFor.length; i < l; i++) { + var re = this.options.sortPluginsFor[i]; + if(navigator.userAgent.match(re)) { + should = true; + break; + } + } + return should; + }, + touchSupportKey: function (keys) { + if(!this.options.excludeTouchSupport){ + keys.push({key: "touch_support", value: this.getTouchSupport()}); + } + return keys; + }, + hasSessionStorage: function () { + try { + return !!window.sessionStorage; + } catch(e) { + return true; // SecurityError when referencing it means it exists + } + }, + // https://bugzilla.mozilla.org/show_bug.cgi?id=781447 + hasLocalStorage: function () { + try { + return !!window.localStorage; + } catch(e) { + return true; // SecurityError when referencing it means it exists + } + }, + hasIndexedDB: function (){ + return !!window.indexedDB; + }, + getNavigatorCpuClass: function () { + if(navigator.cpuClass){ + return navigator.cpuClass; + } else { + return "unknown"; + } + }, + getNavigatorPlatform: function () { + if(navigator.platform) { + return navigator.platform; + } else { + return "unknown"; + } + }, + getDoNotTrack: function () { + if(navigator.doNotTrack) { + return navigator.doNotTrack; + } else { + return "unknown"; + } + }, + // This is a crude and primitive touch screen detection. + // It's not possible to currently reliably detect the availability of a touch screen + // with a JS, without actually subscribing to a touch event. + // http://www.stucox.com/blog/you-cant-detect-a-touchscreen/ + // https://github.com/Modernizr/Modernizr/issues/548 + // method returns an array of 3 values: + // maxTouchPoints, the success or failure of creating a TouchEvent, + // and the availability of the 'ontouchstart' property + getTouchSupport: function () { + var maxTouchPoints = 0; + var touchEvent = false; + if(typeof navigator.maxTouchPoints !== "undefined") { + maxTouchPoints = navigator.maxTouchPoints; + } else if (typeof navigator.msMaxTouchPoints !== "undefined") { + maxTouchPoints = navigator.msMaxTouchPoints; + } + try { + document.createEvent("TouchEvent"); + touchEvent = true; + } catch(_) { /* squelch */ } + var touchStart = "ontouchstart" in window; + return [maxTouchPoints, touchEvent, touchStart]; + }, + // https://www.browserleaks.com/canvas#how-does-it-work + getCanvasFp: function() { + var result = []; + // Very simple now, need to make it more complex (geo shapes etc) + var canvas = document.createElement("canvas"); + canvas.width = 2000; + canvas.height = 200; + canvas.style.display = "inline"; + var ctx = canvas.getContext("2d"); + // detect browser support of canvas winding + // http://blogs.adobe.com/webplatform/2013/01/30/winding-rules-in-canvas/ + // https://github.com/Modernizr/Modernizr/blob/master/feature-detects/canvas/winding.js + ctx.rect(0, 0, 10, 10); + ctx.rect(2, 2, 6, 6); + result.push("canvas winding:" + ((ctx.isPointInPath(5, 5, "evenodd") === false) ? "yes" : "no")); + + ctx.textBaseline = "alphabetic"; + ctx.fillStyle = "#f60"; + ctx.fillRect(125, 1, 62, 20); + ctx.fillStyle = "#069"; + // https://github.com/Valve/fingerprintjs2/issues/66 + if(this.options.dontUseFakeFontInCanvas) { + ctx.font = "11pt Arial"; + } else { + ctx.font = "11pt no-real-font-123"; + } + ctx.fillText("Cwm fjordbank glyphs vext quiz, \ud83d\ude03", 2, 15); + ctx.fillStyle = "rgba(102, 204, 0, 0.7)"; + ctx.font = "18pt Arial"; + ctx.fillText("Cwm fjordbank glyphs vext quiz, \ud83d\ude03", 4, 45); + + // canvas blending + // http://blogs.adobe.com/webplatform/2013/01/28/blending-features-in-canvas/ + // http://jsfiddle.net/NDYV8/16/ + ctx.globalCompositeOperation = "multiply"; + ctx.fillStyle = "rgb(255,0,255)"; + ctx.beginPath(); + ctx.arc(50, 50, 50, 0, Math.PI * 2, true); + ctx.closePath(); + ctx.fill(); + ctx.fillStyle = "rgb(0,255,255)"; + ctx.beginPath(); + ctx.arc(100, 50, 50, 0, Math.PI * 2, true); + ctx.closePath(); + ctx.fill(); + ctx.fillStyle = "rgb(255,255,0)"; + ctx.beginPath(); + ctx.arc(75, 100, 50, 0, Math.PI * 2, true); + ctx.closePath(); + ctx.fill(); + ctx.fillStyle = "rgb(255,0,255)"; + // canvas winding + // http://blogs.adobe.com/webplatform/2013/01/30/winding-rules-in-canvas/ + // http://jsfiddle.net/NDYV8/19/ + ctx.arc(75, 75, 75, 0, Math.PI * 2, true); + ctx.arc(75, 75, 25, 0, Math.PI * 2, true); + ctx.fill("evenodd"); + + result.push("canvas fp:" + canvas.toDataURL()); + return result.join("~"); + }, + + getWebglFp: function() { + var gl; + var fa2s = function(fa) { + gl.clearColor(0.0, 0.0, 0.0, 1.0); + gl.enable(gl.DEPTH_TEST); + gl.depthFunc(gl.LEQUAL); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); + return "[" + fa[0] + ", " + fa[1] + "]"; + }; + var maxAnisotropy = function(gl) { + var anisotropy, ext = gl.getExtension("EXT_texture_filter_anisotropic") || gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic") || gl.getExtension("MOZ_EXT_texture_filter_anisotropic"); + return ext ? (anisotropy = gl.getParameter(ext.MAX_TEXTURE_MAX_ANISOTROPY_EXT), 0 === anisotropy && (anisotropy = 2), anisotropy) : null; + }; + gl = this.getWebglCanvas(); + if(!gl) { return null; } + // WebGL fingerprinting is a combination of techniques, found in MaxMind antifraud script & Augur fingerprinting. + // First it draws a gradient object with shaders and convers the image to the Base64 string. + // Then it enumerates all WebGL extensions & capabilities and appends them to the Base64 string, resulting in a huge WebGL string, potentially very unique on each device + // Since iOS supports webgl starting from version 8.1 and 8.1 runs on several graphics chips, the results may be different across ios devices, but we need to verify it. + var result = []; + var vShaderTemplate = "attribute vec2 attrVertex;varying vec2 varyinTexCoordinate;uniform vec2 uniformOffset;void main(){varyinTexCoordinate=attrVertex+uniformOffset;gl_Position=vec4(attrVertex,0,1);}"; + var fShaderTemplate = "precision mediump float;varying vec2 varyinTexCoordinate;void main() {gl_FragColor=vec4(varyinTexCoordinate,0,1);}"; + var vertexPosBuffer = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, vertexPosBuffer); + var vertices = new Float32Array([-.2, -.9, 0, .4, -.26, 0, 0, .732134444, 0]); + gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW); + vertexPosBuffer.itemSize = 3; + vertexPosBuffer.numItems = 3; + var program = gl.createProgram(), vshader = gl.createShader(gl.VERTEX_SHADER); + gl.shaderSource(vshader, vShaderTemplate); + gl.compileShader(vshader); + var fshader = gl.createShader(gl.FRAGMENT_SHADER); + gl.shaderSource(fshader, fShaderTemplate); + gl.compileShader(fshader); + gl.attachShader(program, vshader); + gl.attachShader(program, fshader); + gl.linkProgram(program); + gl.useProgram(program); + program.vertexPosAttrib = gl.getAttribLocation(program, "attrVertex"); + program.offsetUniform = gl.getUniformLocation(program, "uniformOffset"); + gl.enableVertexAttribArray(program.vertexPosArray); + gl.vertexAttribPointer(program.vertexPosAttrib, vertexPosBuffer.itemSize, gl.FLOAT, !1, 0, 0); + gl.uniform2f(program.offsetUniform, 1, 1); + gl.drawArrays(gl.TRIANGLE_STRIP, 0, vertexPosBuffer.numItems); + if (gl.canvas != null) { result.push(gl.canvas.toDataURL()); } + result.push("extensions:" + gl.getSupportedExtensions().join(";")); + result.push("webgl aliased line width range:" + fa2s(gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE))); + result.push("webgl aliased point size range:" + fa2s(gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE))); + result.push("webgl alpha bits:" + gl.getParameter(gl.ALPHA_BITS)); + result.push("webgl antialiasing:" + (gl.getContextAttributes().antialias ? "yes" : "no")); + result.push("webgl blue bits:" + gl.getParameter(gl.BLUE_BITS)); + result.push("webgl depth bits:" + gl.getParameter(gl.DEPTH_BITS)); + result.push("webgl green bits:" + gl.getParameter(gl.GREEN_BITS)); + result.push("webgl max anisotropy:" + maxAnisotropy(gl)); + result.push("webgl max combined texture image units:" + gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS)); + result.push("webgl max cube map texture size:" + gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE)); + result.push("webgl max fragment uniform vectors:" + gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_VECTORS)); + result.push("webgl max render buffer size:" + gl.getParameter(gl.MAX_RENDERBUFFER_SIZE)); + result.push("webgl max texture image units:" + gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS)); + result.push("webgl max texture size:" + gl.getParameter(gl.MAX_TEXTURE_SIZE)); + result.push("webgl max varying vectors:" + gl.getParameter(gl.MAX_VARYING_VECTORS)); + result.push("webgl max vertex attribs:" + gl.getParameter(gl.MAX_VERTEX_ATTRIBS)); + result.push("webgl max vertex texture image units:" + gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS)); + result.push("webgl max vertex uniform vectors:" + gl.getParameter(gl.MAX_VERTEX_UNIFORM_VECTORS)); + result.push("webgl max viewport dims:" + fa2s(gl.getParameter(gl.MAX_VIEWPORT_DIMS))); + result.push("webgl red bits:" + gl.getParameter(gl.RED_BITS)); + result.push("webgl renderer:" + gl.getParameter(gl.RENDERER)); + result.push("webgl shading language version:" + gl.getParameter(gl.SHADING_LANGUAGE_VERSION)); + result.push("webgl stencil bits:" + gl.getParameter(gl.STENCIL_BITS)); + result.push("webgl vendor:" + gl.getParameter(gl.VENDOR)); + result.push("webgl version:" + gl.getParameter(gl.VERSION)); + + if (!gl.getShaderPrecisionFormat) { + if (typeof NODEBUG === "undefined") { + this.log("WebGL fingerprinting is incomplete, because your browser does not support getShaderPrecisionFormat"); + } + return result.join("~"); + } + + result.push("webgl vertex shader high float precision:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_FLOAT ).precision); + result.push("webgl vertex shader high float precision rangeMin:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_FLOAT ).rangeMin); + result.push("webgl vertex shader high float precision rangeMax:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_FLOAT ).rangeMax); + result.push("webgl vertex shader medium float precision:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT ).precision); + result.push("webgl vertex shader medium float precision rangeMin:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT ).rangeMin); + result.push("webgl vertex shader medium float precision rangeMax:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT ).rangeMax); + result.push("webgl vertex shader low float precision:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_FLOAT ).precision); + result.push("webgl vertex shader low float precision rangeMin:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_FLOAT ).rangeMin); + result.push("webgl vertex shader low float precision rangeMax:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_FLOAT ).rangeMax); + result.push("webgl fragment shader high float precision:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT ).precision); + result.push("webgl fragment shader high float precision rangeMin:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT ).rangeMin); + result.push("webgl fragment shader high float precision rangeMax:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT ).rangeMax); + result.push("webgl fragment shader medium float precision:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT ).precision); + result.push("webgl fragment shader medium float precision rangeMin:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT ).rangeMin); + result.push("webgl fragment shader medium float precision rangeMax:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT ).rangeMax); + result.push("webgl fragment shader low float precision:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_FLOAT ).precision); + result.push("webgl fragment shader low float precision rangeMin:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_FLOAT ).rangeMin); + result.push("webgl fragment shader low float precision rangeMax:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_FLOAT ).rangeMax); + result.push("webgl vertex shader high int precision:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_INT ).precision); + result.push("webgl vertex shader high int precision rangeMin:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_INT ).rangeMin); + result.push("webgl vertex shader high int precision rangeMax:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_INT ).rangeMax); + result.push("webgl vertex shader medium int precision:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_INT ).precision); + result.push("webgl vertex shader medium int precision rangeMin:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_INT ).rangeMin); + result.push("webgl vertex shader medium int precision rangeMax:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_INT ).rangeMax); + result.push("webgl vertex shader low int precision:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_INT ).precision); + result.push("webgl vertex shader low int precision rangeMin:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_INT ).rangeMin); + result.push("webgl vertex shader low int precision rangeMax:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_INT ).rangeMax); + result.push("webgl fragment shader high int precision:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_INT ).precision); + result.push("webgl fragment shader high int precision rangeMin:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_INT ).rangeMin); + result.push("webgl fragment shader high int precision rangeMax:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_INT ).rangeMax); + result.push("webgl fragment shader medium int precision:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_INT ).precision); + result.push("webgl fragment shader medium int precision rangeMin:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_INT ).rangeMin); + result.push("webgl fragment shader medium int precision rangeMax:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_INT ).rangeMax); + result.push("webgl fragment shader low int precision:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_INT ).precision); + result.push("webgl fragment shader low int precision rangeMin:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_INT ).rangeMin); + result.push("webgl fragment shader low int precision rangeMax:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_INT ).rangeMax); + return result.join("~"); + }, + getAdBlock: function(){ + var ads = document.createElement("div"); + ads.setAttribute("id", "ads"); + try { + // body may not exist, that's why we need try/catch + document.body.appendChild(ads); + return document.getElementById("ads") ? false : true; + } catch (e) { + return false; + } + }, + getHasLiedLanguages: function(){ + //We check if navigator.language is equal to the first language of navigator.languages + if(typeof navigator.languages !== "undefined"){ + try { + var firstLanguages = navigator.languages[0].substr(0, 2); + if(firstLanguages !== navigator.language.substr(0, 2)){ + return true; + } + } catch(err){ + return true; + } + } + return false; + }, + getHasLiedResolution: function(){ + if(screen.width < screen.availWidth){ + return true; + } + if(screen.height < screen.availHeight){ + return true; + } + return false; + }, + getHasLiedOs: function(){ + var userAgent = navigator.userAgent.toLowerCase(); + var oscpu = navigator.oscpu; + var platform = navigator.platform.toLowerCase(); + var os; + //We extract the OS from the user agent (respect the order of the if else if statement) + if(userAgent.indexOf("windows phone") >= 0){ + os = "Windows Phone"; + } else if(userAgent.indexOf("win") >= 0){ + os = "Windows"; + } else if(userAgent.indexOf("android") >= 0){ + os = "Android"; + } else if(userAgent.indexOf("linux") >= 0){ + os = "Linux"; + } else if(userAgent.indexOf("iphone") >= 0 || userAgent.indexOf("ipad") >= 0 ){ + os = "iOS"; + } else if(userAgent.indexOf("mac") >= 0){ + os = "Mac"; + } else{ + os = "Other"; + } + // We detect if the person uses a mobile device + var mobileDevice; + if (("ontouchstart" in window) || + (navigator.maxTouchPoints > 0) || + (navigator.msMaxTouchPoints > 0)) { + mobileDevice = true; + } else{ + mobileDevice = false; + } + + if(mobileDevice && os !== "Windows Phone" && os !== "Android" && os !== "iOS" && os !== "Other"){ + return true; + } + + // We compare oscpu with the OS extracted from the UA + if(typeof oscpu !== "undefined"){ + oscpu = oscpu.toLowerCase(); + if(oscpu.indexOf("win") >= 0 && os !== "Windows" && os !== "Windows Phone"){ + return true; + } else if(oscpu.indexOf("linux") >= 0 && os !== "Linux" && os !== "Android"){ + return true; + } else if(oscpu.indexOf("mac") >= 0 && os !== "Mac" && os !== "iOS"){ + return true; + } else if(oscpu.indexOf("win") === 0 && oscpu.indexOf("linux") === 0 && oscpu.indexOf("mac") >= 0 && os !== "other"){ + return true; + } + } + + //We compare platform with the OS extracted from the UA + if(platform.indexOf("win") >= 0 && os !== "Windows" && os !== "Windows Phone"){ + return true; + } else if((platform.indexOf("linux") >= 0 || platform.indexOf("android") >= 0 || platform.indexOf("pike") >= 0) && os !== "Linux" && os !== "Android"){ + return true; + } else if((platform.indexOf("mac") >= 0 || platform.indexOf("ipad") >= 0 || platform.indexOf("ipod") >= 0 || platform.indexOf("iphone") >= 0) && os !== "Mac" && os !== "iOS"){ + return true; + } else if(platform.indexOf("win") === 0 && platform.indexOf("linux") === 0 && platform.indexOf("mac") >= 0 && os !== "other"){ + return true; + } + + if(typeof navigator.plugins === "undefined" && os !== "Windows" && os !== "Windows Phone"){ + //We are are in the case where the person uses ie, therefore we can infer that it's windows + return true; + } + + return false; + }, + getHasLiedBrowser: function () { + var userAgent = navigator.userAgent.toLowerCase(); + var productSub = navigator.productSub; + + //we extract the browser from the user agent (respect the order of the tests) + var browser; + if(userAgent.indexOf("firefox") >= 0){ + browser = "Firefox"; + } else if(userAgent.indexOf("opera") >= 0 || userAgent.indexOf("opr") >= 0){ + browser = "Opera"; + } else if(userAgent.indexOf("chrome") >= 0){ + browser = "Chrome"; + } else if(userAgent.indexOf("safari") >= 0){ + browser = "Safari"; + } else if(userAgent.indexOf("trident") >= 0){ + browser = "Internet Explorer"; + } else{ + browser = "Other"; + } + + if((browser === "Chrome" || browser === "Safari" || browser === "Opera") && productSub !== "20030107"){ + return true; + } + + var tempRes = eval.toString().length; + if(tempRes === 37 && browser !== "Safari" && browser !== "Firefox" && browser !== "Other"){ + return true; + } else if(tempRes === 39 && browser !== "Internet Explorer" && browser !== "Other"){ + return true; + } else if(tempRes === 33 && browser !== "Chrome" && browser !== "Opera" && browser !== "Other"){ + return true; + } + + //We create an error to see how it is handled + var errFirefox; + try { + throw "a"; + } catch(err){ + try{ + err.toSource(); + errFirefox = true; + } catch(errOfErr){ + errFirefox = false; + } + } + if(errFirefox && browser !== "Firefox" && browser !== "Other"){ + return true; + } + return false; + }, + isCanvasSupported: function () { + var elem = document.createElement("canvas"); + return !!(elem.getContext && elem.getContext("2d")); + }, + isWebGlSupported: function() { + // code taken from Modernizr + if (!this.isCanvasSupported()) { + return false; + } + + var canvas = document.createElement("canvas"), + glContext; + + try { + glContext = canvas.getContext && (canvas.getContext("webgl") || canvas.getContext("experimental-webgl")); + } catch(e) { + glContext = false; + } + + return !!window.WebGLRenderingContext && !!glContext; + }, + isIE: function () { + if(navigator.appName === "Microsoft Internet Explorer") { + return true; + } else if(navigator.appName === "Netscape" && /Trident/.test(navigator.userAgent)) { // IE 11 + return true; + } + return false; + }, + hasSwfObjectLoaded: function(){ + return typeof window.swfobject !== "undefined"; + }, + hasMinFlashInstalled: function () { + return swfobject.hasFlashPlayerVersion("9.0.0"); + }, + addFlashDivNode: function() { + var node = document.createElement("div"); + node.setAttribute("id", this.options.swfContainerId); + document.body.appendChild(node); + }, + loadSwfAndDetectFonts: function(done) { + var hiddenCallback = "___fp_swf_loaded"; + window[hiddenCallback] = function(fonts) { + done(fonts); + }; + var id = this.options.swfContainerId; + this.addFlashDivNode(); + var flashvars = { onReady: hiddenCallback}; + var flashparams = { allowScriptAccess: "always", menu: "false" }; + swfobject.embedSWF(this.options.swfPath, id, "1", "1", "9.0.0", false, flashvars, flashparams, {}); + }, + getWebglCanvas: function() { + var canvas = document.createElement("canvas"); + var gl = null; + try { + gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl"); + } catch(e) { /* squelch */ } + if (!gl) { gl = null; } + return gl; + }, + each: function (obj, iterator, context) { + if (obj === null) { + return; + } + if (this.nativeForEach && obj.forEach === this.nativeForEach) { + obj.forEach(iterator, context); + } else if (obj.length === +obj.length) { + for (var i = 0, l = obj.length; i < l; i++) { + if (iterator.call(context, obj[i], i, obj) === {}) { return; } + } + } else { + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + if (iterator.call(context, obj[key], key, obj) === {}) { return; } + } + } + } + }, + + map: function(obj, iterator, context) { + var results = []; + // Not using strict equality so that this acts as a + // shortcut to checking for `null` and `undefined`. + if (obj == null) { return results; } + if (this.nativeMap && obj.map === this.nativeMap) { return obj.map(iterator, context); } + this.each(obj, function(value, index, list) { + results[results.length] = iterator.call(context, value, index, list); + }); + return results; + }, + + /// MurmurHash3 related functions + + // + // Given two 64bit ints (as an array of two 32bit ints) returns the two + // added together as a 64bit int (as an array of two 32bit ints). + // + x64Add: function(m, n) { + m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff]; + n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff]; + var o = [0, 0, 0, 0]; + o[3] += m[3] + n[3]; + o[2] += o[3] >>> 16; + o[3] &= 0xffff; + o[2] += m[2] + n[2]; + o[1] += o[2] >>> 16; + o[2] &= 0xffff; + o[1] += m[1] + n[1]; + o[0] += o[1] >>> 16; + o[1] &= 0xffff; + o[0] += m[0] + n[0]; + o[0] &= 0xffff; + return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]]; + }, + + // + // Given two 64bit ints (as an array of two 32bit ints) returns the two + // multiplied together as a 64bit int (as an array of two 32bit ints). + // + x64Multiply: function(m, n) { + m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff]; + n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff]; + var o = [0, 0, 0, 0]; + o[3] += m[3] * n[3]; + o[2] += o[3] >>> 16; + o[3] &= 0xffff; + o[2] += m[2] * n[3]; + o[1] += o[2] >>> 16; + o[2] &= 0xffff; + o[2] += m[3] * n[2]; + o[1] += o[2] >>> 16; + o[2] &= 0xffff; + o[1] += m[1] * n[3]; + o[0] += o[1] >>> 16; + o[1] &= 0xffff; + o[1] += m[2] * n[2]; + o[0] += o[1] >>> 16; + o[1] &= 0xffff; + o[1] += m[3] * n[1]; + o[0] += o[1] >>> 16; + o[1] &= 0xffff; + o[0] += (m[0] * n[3]) + (m[1] * n[2]) + (m[2] * n[1]) + (m[3] * n[0]); + o[0] &= 0xffff; + return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]]; + }, + // + // Given a 64bit int (as an array of two 32bit ints) and an int + // representing a number of bit positions, returns the 64bit int (as an + // array of two 32bit ints) rotated left by that number of positions. + // + x64Rotl: function(m, n) { + n %= 64; + if (n === 32) { + return [m[1], m[0]]; + } + else if (n < 32) { + return [(m[0] << n) | (m[1] >>> (32 - n)), (m[1] << n) | (m[0] >>> (32 - n))]; + } + else { + n -= 32; + return [(m[1] << n) | (m[0] >>> (32 - n)), (m[0] << n) | (m[1] >>> (32 - n))]; + } + }, + // + // Given a 64bit int (as an array of two 32bit ints) and an int + // representing a number of bit positions, returns the 64bit int (as an + // array of two 32bit ints) shifted left by that number of positions. + // + x64LeftShift: function(m, n) { + n %= 64; + if (n === 0) { + return m; + } + else if (n < 32) { + return [(m[0] << n) | (m[1] >>> (32 - n)), m[1] << n]; + } + else { + return [m[1] << (n - 32), 0]; + } + }, + // + // Given two 64bit ints (as an array of two 32bit ints) returns the two + // xored together as a 64bit int (as an array of two 32bit ints). + // + x64Xor: function(m, n) { + return [m[0] ^ n[0], m[1] ^ n[1]]; + }, + // + // Given a block, returns murmurHash3's final x64 mix of that block. + // (`[0, h[0] >>> 1]` is a 33 bit unsigned right shift. This is the + // only place where we need to right shift 64bit ints.) + // + x64Fmix: function(h) { + h = this.x64Xor(h, [0, h[0] >>> 1]); + h = this.x64Multiply(h, [0xff51afd7, 0xed558ccd]); + h = this.x64Xor(h, [0, h[0] >>> 1]); + h = this.x64Multiply(h, [0xc4ceb9fe, 0x1a85ec53]); + h = this.x64Xor(h, [0, h[0] >>> 1]); + return h; + }, + + // + // Given a string and an optional seed as an int, returns a 128 bit + // hash using the x64 flavor of MurmurHash3, as an unsigned hex. + // + x64hash128: function (key, seed) { + key = key || ""; + seed = seed || 0; + var remainder = key.length % 16; + var bytes = key.length - remainder; + var h1 = [0, seed]; + var h2 = [0, seed]; + var k1 = [0, 0]; + var k2 = [0, 0]; + var c1 = [0x87c37b91, 0x114253d5]; + var c2 = [0x4cf5ad43, 0x2745937f]; + for (var i = 0; i < bytes; i = i + 16) { + k1 = [((key.charCodeAt(i + 4) & 0xff)) | ((key.charCodeAt(i + 5) & 0xff) << 8) | ((key.charCodeAt(i + 6) & 0xff) << 16) | ((key.charCodeAt(i + 7) & 0xff) << 24), ((key.charCodeAt(i) & 0xff)) | ((key.charCodeAt(i + 1) & 0xff) << 8) | ((key.charCodeAt(i + 2) & 0xff) << 16) | ((key.charCodeAt(i + 3) & 0xff) << 24)]; + k2 = [((key.charCodeAt(i + 12) & 0xff)) | ((key.charCodeAt(i + 13) & 0xff) << 8) | ((key.charCodeAt(i + 14) & 0xff) << 16) | ((key.charCodeAt(i + 15) & 0xff) << 24), ((key.charCodeAt(i + 8) & 0xff)) | ((key.charCodeAt(i + 9) & 0xff) << 8) | ((key.charCodeAt(i + 10) & 0xff) << 16) | ((key.charCodeAt(i + 11) & 0xff) << 24)]; + k1 = this.x64Multiply(k1, c1); + k1 = this.x64Rotl(k1, 31); + k1 = this.x64Multiply(k1, c2); + h1 = this.x64Xor(h1, k1); + h1 = this.x64Rotl(h1, 27); + h1 = this.x64Add(h1, h2); + h1 = this.x64Add(this.x64Multiply(h1, [0, 5]), [0, 0x52dce729]); + k2 = this.x64Multiply(k2, c2); + k2 = this.x64Rotl(k2, 33); + k2 = this.x64Multiply(k2, c1); + h2 = this.x64Xor(h2, k2); + h2 = this.x64Rotl(h2, 31); + h2 = this.x64Add(h2, h1); + h2 = this.x64Add(this.x64Multiply(h2, [0, 5]), [0, 0x38495ab5]); + } + k1 = [0, 0]; + k2 = [0, 0]; + switch(remainder) { + case 15: + k2 = this.x64Xor(k2, this.x64LeftShift([0, key.charCodeAt(i + 14)], 48)); + case 14: + k2 = this.x64Xor(k2, this.x64LeftShift([0, key.charCodeAt(i + 13)], 40)); + case 13: + k2 = this.x64Xor(k2, this.x64LeftShift([0, key.charCodeAt(i + 12)], 32)); + case 12: + k2 = this.x64Xor(k2, this.x64LeftShift([0, key.charCodeAt(i + 11)], 24)); + case 11: + k2 = this.x64Xor(k2, this.x64LeftShift([0, key.charCodeAt(i + 10)], 16)); + case 10: + k2 = this.x64Xor(k2, this.x64LeftShift([0, key.charCodeAt(i + 9)], 8)); + case 9: + k2 = this.x64Xor(k2, [0, key.charCodeAt(i + 8)]); + k2 = this.x64Multiply(k2, c2); + k2 = this.x64Rotl(k2, 33); + k2 = this.x64Multiply(k2, c1); + h2 = this.x64Xor(h2, k2); + case 8: + k1 = this.x64Xor(k1, this.x64LeftShift([0, key.charCodeAt(i + 7)], 56)); + case 7: + k1 = this.x64Xor(k1, this.x64LeftShift([0, key.charCodeAt(i + 6)], 48)); + case 6: + k1 = this.x64Xor(k1, this.x64LeftShift([0, key.charCodeAt(i + 5)], 40)); + case 5: + k1 = this.x64Xor(k1, this.x64LeftShift([0, key.charCodeAt(i + 4)], 32)); + case 4: + k1 = this.x64Xor(k1, this.x64LeftShift([0, key.charCodeAt(i + 3)], 24)); + case 3: + k1 = this.x64Xor(k1, this.x64LeftShift([0, key.charCodeAt(i + 2)], 16)); + case 2: + k1 = this.x64Xor(k1, this.x64LeftShift([0, key.charCodeAt(i + 1)], 8)); + case 1: + k1 = this.x64Xor(k1, [0, key.charCodeAt(i)]); + k1 = this.x64Multiply(k1, c1); + k1 = this.x64Rotl(k1, 31); + k1 = this.x64Multiply(k1, c2); + h1 = this.x64Xor(h1, k1); + } + h1 = this.x64Xor(h1, [0, key.length]); + h2 = this.x64Xor(h2, [0, key.length]); + h1 = this.x64Add(h1, h2); + h2 = this.x64Add(h2, h1); + h1 = this.x64Fmix(h1); + h2 = this.x64Fmix(h2); + h1 = this.x64Add(h1, h2); + h2 = this.x64Add(h2, h1); + return ("00000000" + (h1[0] >>> 0).toString(16)).slice(-8) + ("00000000" + (h1[1] >>> 0).toString(16)).slice(-8) + ("00000000" + (h2[0] >>> 0).toString(16)).slice(-8) + ("00000000" + (h2[1] >>> 0).toString(16)).slice(-8); + } + }; + Fingerprint2.VERSION = "1.1.3"; + return Fingerprint2; +}); diff --git a/dashboard-ui/bower_components/fingerprintjs2/flash/FontList.as b/dashboard-ui/bower_components/fingerprintjs2/flash/FontList.as new file mode 100644 index 000000000..030ab3cee --- /dev/null +++ b/dashboard-ui/bower_components/fingerprintjs2/flash/FontList.as @@ -0,0 +1,31 @@ +package { + import flash.display.Sprite; + import flash.display.LoaderInfo; + import flash.text.Font; + import flash.external.ExternalInterface; + + public class FontList extends Sprite { + + public function FontList() { + var params:Object = loadParams(); + loadExternalInterface(params); + } + + private function loadParams():Object { + return LoaderInfo(this.root.loaderInfo).parameters; + } + + private function loadExternalInterface(params:Object):void { + ExternalInterface.call(params.onReady, fonts()); + } + + private function fonts():Array { + var fontNames:Array = []; + for each (var font:Font in Font.enumerateFonts(true) ) + { + fontNames.push(font.fontName); + } + return fontNames; + } + } +} diff --git a/dashboard-ui/bower_components/fingerprintjs2/flash/Makefile b/dashboard-ui/bower_components/fingerprintjs2/flash/Makefile new file mode 100644 index 000000000..cb6e1cc33 --- /dev/null +++ b/dashboard-ui/bower_components/fingerprintjs2/flash/Makefile @@ -0,0 +1,7 @@ +all: FontList.swf + +FontList.swf: clean + mxmlc -static-link-runtime-shared-libraries FontList.as + +clean: + rm -f FontList.swf diff --git a/dashboard-ui/bower_components/fingerprintjs2/flash/compiled/FontList.swf b/dashboard-ui/bower_components/fingerprintjs2/flash/compiled/FontList.swf new file mode 100644 index 0000000000000000000000000000000000000000..a7481e86bc1b7ad444dc16428782eacad7b54fbd GIT binary patch literal 916 zcmV;F18e+4S5q6b1poke+J#e1Z`(!?-6fY=lGdj`WJgIFB@XIKB~mh)!h$2zh@#d= zPzNzu6a|WEMJ_Ei6iJXPOFq@;kLlm&sfXU^7HRK21^pB1E-6`YQnU*a%bj`e&CJel z2GCys6n_F>2ZCPZ769OfjW-a0!^n0zFMIv^Z0z}Qho2trjTj3%hB2K^o74Sf5Sl;= zuM?3mZGkdq3gj-xoeaOH7DMNOYb!@lL@v}NtB|&+X}fXgk&E1E7`cqvCnshSX6O1J=ULdAB~QECqPjUu#}da^-!=WhsVV%0$pfS-V?)t|B@2> z;{Kw+#14kEX$52B=ycy`o8}{9IB`AZ`kObB?PSS5ylL!Zdsguio+fd98r{1IN@Ej? zx#u(k-u@4fJBtF&#prjQicRxzamwg&UD8@8wzj_wp)LSk3Jy3aFM8unpDqno`@SZPvDG)!KITR`mlZk6;d~ zvZk-)3&kA_B@AT@5rztuFh(jy8b&&n)-cRtSirD|m9kcW81CRw4a3_Q-off!T)u~; zI+pHZ=|K)G7oRyOiNTYX2Bc^*fN~B39tg-P1c+M|h!Et1456yYiTRnJNt(W%n8`6n z`Z;h3Unf^57;=v!K}|0u=C@kn=+0VSgHHZ)9zm8;^Pq6$6qCLRPD&C-BT3QpPZG0! zS^ncIa4Elj2>u+DKkQfFj}|JI`0p}AzwdJA)o;%F$p&mAx$^gXt|C>w;;M?oQ`${T q3I@;|Y?^~Db5J!0+vY&w&)48?x<-gcDr|^CuYbBv`QaZ=S*3|xHMyn$ literal 0 HcmV?d00001 diff --git a/dashboard-ui/bower_components/fingerprintjs2/gulpfile.js b/dashboard-ui/bower_components/fingerprintjs2/gulpfile.js new file mode 100644 index 000000000..a1360ca16 --- /dev/null +++ b/dashboard-ui/bower_components/fingerprintjs2/gulpfile.js @@ -0,0 +1,29 @@ +var gulp = require("gulp"), + eslint = require("gulp-eslint"), + rename = require("gulp-rename"), + uglify = require("gulp-uglify"); + +gulp.task("lint", function() { + return gulp + .src("fingerprint2.js") + .pipe(eslint()) + .pipe(eslint.format()) + .pipe(eslint.failOnError()); +}); + +gulp.task("minify", function() { + return gulp + .src("fingerprint2.js") + .pipe(rename({suffix: ".min"})) + .pipe(uglify({ + compress: { + global_defs: { + NODEBUG: true + } + } + })) + .pipe(gulp.dest("dist/")); +}); + + +gulp.task("default", ["lint", "minify"], function() {}); diff --git a/dashboard-ui/bower_components/fingerprintjs2/index.html b/dashboard-ui/bower_components/fingerprintjs2/index.html new file mode 100644 index 000000000..b8b573b46 --- /dev/null +++ b/dashboard-ui/bower_components/fingerprintjs2/index.html @@ -0,0 +1,98 @@ + + + + Fingerprintjs2 test + + + + + + +
+ + +

Fingerprintjs2

+ +

Your browser fingerprint:

+

+ + + + Fork me on GitHub + + + + + diff --git a/dashboard-ui/bower_components/fingerprintjs2/package.json b/dashboard-ui/bower_components/fingerprintjs2/package.json new file mode 100644 index 000000000..510e13b9d --- /dev/null +++ b/dashboard-ui/bower_components/fingerprintjs2/package.json @@ -0,0 +1,33 @@ +{ + "name": "fingerprintjs2", + "version": "1.1.3", + "description": "Modern & flexible browser fingerprinting library", + "main": "dist/fingerprint2.min.js", + "devDependencies": { + "gulp": "^3.8.11", + "eslint": "^0.14.1", + "gulp-eslint": "^0.4.2", + "gulp-rename": "^1.2.2", + "gulp-uglify": "^1.1.0" + }, + "scripts": { + "test": "specs/phantomjs.runner.sh specs/spec_runner.html" + }, + "repository": { + "type": "git", + "url": "https://github.com/Valve/fingerprintjs2.git" + }, + "keywords": [ + "browser", + "identification", + "fingerprint", + "fingerprinting", + "privacy" + ], + "author": "Valentin Vasilyev", + "license": "MIT", + "bugs": { + "url": "https://github.com/Valve/fingerprintjs2/issues" + }, + "homepage": "https://github.com/Valve/fingerprintjs2" +} diff --git a/dashboard-ui/bower_components/fingerprintjs2/specs/lib/jasmine-2.3.4/boot.js b/dashboard-ui/bower_components/fingerprintjs2/specs/lib/jasmine-2.3.4/boot.js new file mode 100644 index 000000000..04ed64c1c --- /dev/null +++ b/dashboard-ui/bower_components/fingerprintjs2/specs/lib/jasmine-2.3.4/boot.js @@ -0,0 +1,121 @@ +/** + Starting with version 2.0, this file "boots" Jasmine, performing all of the necessary initialization before executing the loaded environment and all of a project's specs. This file should be loaded after `jasmine.js` and `jasmine_html.js`, but before any project source files or spec files are loaded. Thus this file can also be used to customize Jasmine for a project. + + If a project is using Jasmine via the standalone distribution, this file can be customized directly. If a project is using Jasmine via the [Ruby gem][jasmine-gem], this file can be copied into the support directory via `jasmine copy_boot_js`. Other environments (e.g., Python) will have different mechanisms. + + The location of `boot.js` can be specified and/or overridden in `jasmine.yml`. + + [jasmine-gem]: http://github.com/pivotal/jasmine-gem + */ + +(function() { + + /** + * ## Require & Instantiate + * + * Require Jasmine's core files. Specifically, this requires and attaches all of Jasmine's code to the `jasmine` reference. + */ + window.jasmine = jasmineRequire.core(jasmineRequire); + + /** + * Since this is being run in a browser and the results should populate to an HTML page, require the HTML-specific Jasmine code, injecting the same reference. + */ + jasmineRequire.html(jasmine); + + /** + * Create the Jasmine environment. This is used to run all specs in a project. + */ + var env = jasmine.getEnv(); + + /** + * ## The Global Interface + * + * Build up the functions that will be exposed as the Jasmine public interface. A project can customize, rename or alias any of these functions as desired, provided the implementation remains unchanged. + */ + var jasmineInterface = jasmineRequire.interface(jasmine, env); + + /** + * Add all of the Jasmine global/public interface to the global scope, so a project can use the public interface directly. For example, calling `describe` in specs instead of `jasmine.getEnv().describe`. + */ + extend(window, jasmineInterface); + + /** + * ## Runner Parameters + * + * More browser specific code - wrap the query string in an object and to allow for getting/setting parameters from the runner user interface. + */ + + var queryString = new jasmine.QueryString({ + getWindowLocation: function() { return window.location; } + }); + + var catchingExceptions = queryString.getParam("catch"); + env.catchExceptions(typeof catchingExceptions === "undefined" ? true : catchingExceptions); + + var throwingExpectationFailures = queryString.getParam("throwFailures"); + env.throwOnExpectationFailure(throwingExpectationFailures); + + /** + * ## Reporters + * The `HtmlReporter` builds all of the HTML UI for the runner page. This reporter paints the dots, stars, and x's for specs, as well as all spec names and all failures (if any). + */ + var htmlReporter = new jasmine.HtmlReporter({ + env: env, + onRaiseExceptionsClick: function() { queryString.navigateWithNewParam("catch", !env.catchingExceptions()); }, + onThrowExpectationsClick: function() { queryString.navigateWithNewParam("throwFailures", !env.throwingExpectationFailures()); }, + addToExistingQueryString: function(key, value) { return queryString.fullStringWithNewParam(key, value); }, + getContainer: function() { return document.body; }, + createElement: function() { return document.createElement.apply(document, arguments); }, + createTextNode: function() { return document.createTextNode.apply(document, arguments); }, + timer: new jasmine.Timer() + }); + + /** + * The `jsApiReporter` also receives spec results, and is used by any environment that needs to extract the results from JavaScript. + */ + env.addReporter(jasmineInterface.jsApiReporter); + env.addReporter(htmlReporter); + + /** + * Filter which specs will be run by matching the start of the full name against the `spec` query param. + */ + var specFilter = new jasmine.HtmlSpecFilter({ + filterString: function() { return queryString.getParam("spec"); } + }); + + env.specFilter = function(spec) { + return specFilter.matches(spec.getFullName()); + }; + + /** + * Setting up timing functions to be able to be overridden. Certain browsers (Safari, IE 8, phantomjs) require this hack. + */ + window.setTimeout = window.setTimeout; + window.setInterval = window.setInterval; + window.clearTimeout = window.clearTimeout; + window.clearInterval = window.clearInterval; + + /** + * ## Execution + * + * Replace the browser window's `onload`, ensure it's called, and then run all of the loaded specs. This includes initializing the `HtmlReporter` instance and then executing the loaded Jasmine environment. All of this will happen after all of the specs are loaded. + */ + var currentWindowOnload = window.onload; + + window.onload = function() { + if (currentWindowOnload) { + currentWindowOnload(); + } + htmlReporter.initialize(); + env.execute(); + }; + + /** + * Helper function for readability above. + */ + function extend(destination, source) { + for (var property in source) destination[property] = source[property]; + return destination; + } + +}()); diff --git a/dashboard-ui/bower_components/fingerprintjs2/specs/lib/jasmine-2.3.4/jasmine-html.js b/dashboard-ui/bower_components/fingerprintjs2/specs/lib/jasmine-2.3.4/jasmine-html.js new file mode 100644 index 000000000..259f45ce2 --- /dev/null +++ b/dashboard-ui/bower_components/fingerprintjs2/specs/lib/jasmine-2.3.4/jasmine-html.js @@ -0,0 +1,446 @@ +/* +Copyright (c) 2008-2015 Pivotal Labs + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ +jasmineRequire.html = function(j$) { + j$.ResultsNode = jasmineRequire.ResultsNode(); + j$.HtmlReporter = jasmineRequire.HtmlReporter(j$); + j$.QueryString = jasmineRequire.QueryString(); + j$.HtmlSpecFilter = jasmineRequire.HtmlSpecFilter(); +}; + +jasmineRequire.HtmlReporter = function(j$) { + + var noopTimer = { + start: function() {}, + elapsed: function() { return 0; } + }; + + function HtmlReporter(options) { + var env = options.env || {}, + getContainer = options.getContainer, + createElement = options.createElement, + createTextNode = options.createTextNode, + onRaiseExceptionsClick = options.onRaiseExceptionsClick || function() {}, + onThrowExpectationsClick = options.onThrowExpectationsClick || function() {}, + addToExistingQueryString = options.addToExistingQueryString || defaultQueryString, + timer = options.timer || noopTimer, + results = [], + specsExecuted = 0, + failureCount = 0, + pendingSpecCount = 0, + htmlReporterMain, + symbols, + failedSuites = []; + + this.initialize = function() { + clearPrior(); + htmlReporterMain = createDom('div', {className: 'jasmine_html-reporter'}, + createDom('div', {className: 'banner'}, + createDom('a', {className: 'title', href: 'http://jasmine.github.io/', target: '_blank'}), + createDom('span', {className: 'version'}, j$.version) + ), + createDom('ul', {className: 'symbol-summary'}), + createDom('div', {className: 'alert'}), + createDom('div', {className: 'results'}, + createDom('div', {className: 'failures'}) + ) + ); + getContainer().appendChild(htmlReporterMain); + + symbols = find('.symbol-summary'); + }; + + var totalSpecsDefined; + this.jasmineStarted = function(options) { + totalSpecsDefined = options.totalSpecsDefined || 0; + timer.start(); + }; + + var summary = createDom('div', {className: 'summary'}); + + var topResults = new j$.ResultsNode({}, '', null), + currentParent = topResults; + + this.suiteStarted = function(result) { + currentParent.addChild(result, 'suite'); + currentParent = currentParent.last(); + }; + + this.suiteDone = function(result) { + if (result.status == 'failed') { + failedSuites.push(result); + } + + if (currentParent == topResults) { + return; + } + + currentParent = currentParent.parent; + }; + + this.specStarted = function(result) { + currentParent.addChild(result, 'spec'); + }; + + var failures = []; + this.specDone = function(result) { + if(noExpectations(result) && typeof console !== 'undefined' && typeof console.error !== 'undefined') { + console.error('Spec \'' + result.fullName + '\' has no expectations.'); + } + + if (result.status != 'disabled') { + specsExecuted++; + } + + symbols.appendChild(createDom('li', { + className: noExpectations(result) ? 'empty' : result.status, + id: 'spec_' + result.id, + title: result.fullName + } + )); + + if (result.status == 'failed') { + failureCount++; + + var failure = + createDom('div', {className: 'spec-detail failed'}, + createDom('div', {className: 'description'}, + createDom('a', {title: result.fullName, href: specHref(result)}, result.fullName) + ), + createDom('div', {className: 'messages'}) + ); + var messages = failure.childNodes[1]; + + for (var i = 0; i < result.failedExpectations.length; i++) { + var expectation = result.failedExpectations[i]; + messages.appendChild(createDom('div', {className: 'result-message'}, expectation.message)); + messages.appendChild(createDom('div', {className: 'stack-trace'}, expectation.stack)); + } + + failures.push(failure); + } + + if (result.status == 'pending') { + pendingSpecCount++; + } + }; + + this.jasmineDone = function() { + var banner = find('.banner'); + var alert = find('.alert'); + alert.appendChild(createDom('span', {className: 'duration'}, 'finished in ' + timer.elapsed() / 1000 + 's')); + + banner.appendChild( + createDom('div', { className: 'run-options' }, + createDom('span', { className: 'trigger' }, 'Options'), + createDom('div', { className: 'payload' }, + createDom('div', { className: 'exceptions' }, + createDom('input', { + className: 'raise', + id: 'raise-exceptions', + type: 'checkbox' + }), + createDom('label', { className: 'label', 'for': 'raise-exceptions' }, 'raise exceptions')), + createDom('div', { className: 'throw-failures' }, + createDom('input', { + className: 'throw', + id: 'throw-failures', + type: 'checkbox' + }), + createDom('label', { className: 'label', 'for': 'throw-failures' }, 'stop spec on expectation failure')) + ) + )); + + var raiseCheckbox = find('#raise-exceptions'); + + raiseCheckbox.checked = !env.catchingExceptions(); + raiseCheckbox.onclick = onRaiseExceptionsClick; + + var throwCheckbox = find('#throw-failures'); + throwCheckbox.checked = env.throwingExpectationFailures(); + throwCheckbox.onclick = onThrowExpectationsClick; + + var optionsMenu = find('.run-options'), + optionsTrigger = optionsMenu.querySelector('.trigger'), + optionsPayload = optionsMenu.querySelector('.payload'), + isOpen = /\bopen\b/; + + optionsTrigger.onclick = function() { + if (isOpen.test(optionsPayload.className)) { + optionsPayload.className = optionsPayload.className.replace(isOpen, ''); + } else { + optionsPayload.className += ' open'; + } + }; + + if (specsExecuted < totalSpecsDefined) { + var skippedMessage = 'Ran ' + specsExecuted + ' of ' + totalSpecsDefined + ' specs - run all'; + alert.appendChild( + createDom('span', {className: 'bar skipped'}, + createDom('a', {href: '?', title: 'Run all specs'}, skippedMessage) + ) + ); + } + var statusBarMessage = ''; + var statusBarClassName = 'bar '; + + if (totalSpecsDefined > 0) { + statusBarMessage += pluralize('spec', specsExecuted) + ', ' + pluralize('failure', failureCount); + if (pendingSpecCount) { statusBarMessage += ', ' + pluralize('pending spec', pendingSpecCount); } + statusBarClassName += (failureCount > 0) ? 'failed' : 'passed'; + } else { + statusBarClassName += 'skipped'; + statusBarMessage += 'No specs found'; + } + + alert.appendChild(createDom('span', {className: statusBarClassName}, statusBarMessage)); + + for(i = 0; i < failedSuites.length; i++) { + var failedSuite = failedSuites[i]; + for(var j = 0; j < failedSuite.failedExpectations.length; j++) { + var errorBarMessage = 'AfterAll ' + failedSuite.failedExpectations[j].message; + var errorBarClassName = 'bar errored'; + alert.appendChild(createDom('span', {className: errorBarClassName}, errorBarMessage)); + } + } + + var results = find('.results'); + results.appendChild(summary); + + summaryList(topResults, summary); + + function summaryList(resultsTree, domParent) { + var specListNode; + for (var i = 0; i < resultsTree.children.length; i++) { + var resultNode = resultsTree.children[i]; + if (resultNode.type == 'suite') { + var suiteListNode = createDom('ul', {className: 'suite', id: 'suite-' + resultNode.result.id}, + createDom('li', {className: 'suite-detail'}, + createDom('a', {href: specHref(resultNode.result)}, resultNode.result.description) + ) + ); + + summaryList(resultNode, suiteListNode); + domParent.appendChild(suiteListNode); + } + if (resultNode.type == 'spec') { + if (domParent.getAttribute('class') != 'specs') { + specListNode = createDom('ul', {className: 'specs'}); + domParent.appendChild(specListNode); + } + var specDescription = resultNode.result.description; + if(noExpectations(resultNode.result)) { + specDescription = 'SPEC HAS NO EXPECTATIONS ' + specDescription; + } + if(resultNode.result.status === 'pending' && resultNode.result.pendingReason !== '') { + specDescription = specDescription + ' PENDING WITH MESSAGE: ' + resultNode.result.pendingReason; + } + specListNode.appendChild( + createDom('li', { + className: resultNode.result.status, + id: 'spec-' + resultNode.result.id + }, + createDom('a', {href: specHref(resultNode.result)}, specDescription) + ) + ); + } + } + } + + if (failures.length) { + alert.appendChild( + createDom('span', {className: 'menu bar spec-list'}, + createDom('span', {}, 'Spec List | '), + createDom('a', {className: 'failures-menu', href: '#'}, 'Failures'))); + alert.appendChild( + createDom('span', {className: 'menu bar failure-list'}, + createDom('a', {className: 'spec-list-menu', href: '#'}, 'Spec List'), + createDom('span', {}, ' | Failures '))); + + find('.failures-menu').onclick = function() { + setMenuModeTo('failure-list'); + }; + find('.spec-list-menu').onclick = function() { + setMenuModeTo('spec-list'); + }; + + setMenuModeTo('failure-list'); + + var failureNode = find('.failures'); + for (var i = 0; i < failures.length; i++) { + failureNode.appendChild(failures[i]); + } + } + }; + + return this; + + function find(selector) { + return getContainer().querySelector('.jasmine_html-reporter ' + selector); + } + + function clearPrior() { + // return the reporter + var oldReporter = find(''); + + if(oldReporter) { + getContainer().removeChild(oldReporter); + } + } + + function createDom(type, attrs, childrenVarArgs) { + var el = createElement(type); + + for (var i = 2; i < arguments.length; i++) { + var child = arguments[i]; + + if (typeof child === 'string') { + el.appendChild(createTextNode(child)); + } else { + if (child) { + el.appendChild(child); + } + } + } + + for (var attr in attrs) { + if (attr == 'className') { + el[attr] = attrs[attr]; + } else { + el.setAttribute(attr, attrs[attr]); + } + } + + return el; + } + + function pluralize(singular, count) { + var word = (count == 1 ? singular : singular + 's'); + + return '' + count + ' ' + word; + } + + function specHref(result) { + return addToExistingQueryString('spec', result.fullName); + } + + function defaultQueryString(key, value) { + return '?' + key + '=' + value; + } + + function setMenuModeTo(mode) { + htmlReporterMain.setAttribute('class', 'jasmine_html-reporter ' + mode); + } + + function noExpectations(result) { + return (result.failedExpectations.length + result.passedExpectations.length) === 0 && + result.status === 'passed'; + } + } + + return HtmlReporter; +}; + +jasmineRequire.HtmlSpecFilter = function() { + function HtmlSpecFilter(options) { + var filterString = options && options.filterString() && options.filterString().replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); + var filterPattern = new RegExp(filterString); + + this.matches = function(specName) { + return filterPattern.test(specName); + }; + } + + return HtmlSpecFilter; +}; + +jasmineRequire.ResultsNode = function() { + function ResultsNode(result, type, parent) { + this.result = result; + this.type = type; + this.parent = parent; + + this.children = []; + + this.addChild = function(result, type) { + this.children.push(new ResultsNode(result, type, this)); + }; + + this.last = function() { + return this.children[this.children.length - 1]; + }; + } + + return ResultsNode; +}; + +jasmineRequire.QueryString = function() { + function QueryString(options) { + + this.navigateWithNewParam = function(key, value) { + options.getWindowLocation().search = this.fullStringWithNewParam(key, value); + }; + + this.fullStringWithNewParam = function(key, value) { + var paramMap = queryStringToParamMap(); + paramMap[key] = value; + return toQueryString(paramMap); + }; + + this.getParam = function(key) { + return queryStringToParamMap()[key]; + }; + + return this; + + function toQueryString(paramMap) { + var qStrPairs = []; + for (var prop in paramMap) { + qStrPairs.push(encodeURIComponent(prop) + '=' + encodeURIComponent(paramMap[prop])); + } + return '?' + qStrPairs.join('&'); + } + + function queryStringToParamMap() { + var paramStr = options.getWindowLocation().search.substring(1), + params = [], + paramMap = {}; + + if (paramStr.length > 0) { + params = paramStr.split('&'); + for (var i = 0; i < params.length; i++) { + var p = params[i].split('='); + var value = decodeURIComponent(p[1]); + if (value === 'true' || value === 'false') { + value = JSON.parse(value); + } + paramMap[decodeURIComponent(p[0])] = value; + } + } + + return paramMap; + } + + } + + return QueryString; +}; diff --git a/dashboard-ui/bower_components/fingerprintjs2/specs/lib/jasmine-2.3.4/jasmine-matchers.js b/dashboard-ui/bower_components/fingerprintjs2/specs/lib/jasmine-2.3.4/jasmine-matchers.js new file mode 100644 index 000000000..fff2033f0 --- /dev/null +++ b/dashboard-ui/bower_components/fingerprintjs2/specs/lib/jasmine-2.3.4/jasmine-matchers.js @@ -0,0 +1,1757 @@ +(function e(t, n, r) { + function s(o, u) { + if (!n[o]) { + if (!t[o]) { + var a = typeof require == 'function' && require; + if (!u && a) { + return a(o, !0); + } + if (i) { + return i(o, !0); + } + var f = new Error('Cannot find module \'' + o + '\''); + throw f.code = 'MODULE_NOT_FOUND', f + } + var l = n[o] = { + exports: {} + }; + t[o][0].call(l.exports, function(e) { + var n = t[o][1][e]; + return s(n ? n : e); + }, l, l.exports, e, t, n, r); + } + return n[o].exports; + } + var i = typeof require == 'function' && require; + for (var o = 0; o < r.length; o++) { + s(r[o]); + } + return s; +})({ + 1: [function(require, module, exports) { + 'use strict'; + + /* + * Copyright © Jamie Mason, @fold_left, + * https://github.com/JamieMason + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files + * (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + + var factory = require('./lib/factory'); + + var matchers = { + toBeAfter: require('./toBeAfter'), + toBeArray: require('./toBeArray'), + toBeArrayOfBooleans: require('./toBeArrayOfBooleans'), + toBeArrayOfNumbers: require('./toBeArrayOfNumbers'), + toBeArrayOfObjects: require('./toBeArrayOfObjects'), + toBeArrayOfSize: require('./toBeArrayOfSize'), + toBeArrayOfStrings: require('./toBeArrayOfStrings'), + toBeBefore: require('./toBeBefore'), + toBeBoolean: require('./toBeBoolean'), + toBeCalculable: require('./toBeCalculable'), + toBeDate: require('./toBeDate'), + toBeEmptyArray: require('./toBeEmptyArray'), + toBeEmptyObject: require('./toBeEmptyObject'), + toBeEmptyString: require('./toBeEmptyString'), + toBeEvenNumber: require('./toBeEvenNumber'), + toBeFalse: require('./toBeFalse'), + toBeFunction: require('./toBeFunction'), + toBeHtmlString: require('./toBeHtmlString'), + toBeIso8601: require('./toBeIso8601'), + toBeJsonString: require('./toBeJsonString'), + toBeLongerThan: require('./toBeLongerThan'), + toBeNonEmptyArray: require('./toBeNonEmptyArray'), + toBeNonEmptyObject: require('./toBeNonEmptyObject'), + toBeNonEmptyString: require('./toBeNonEmptyString'), + toBeNumber: require('./toBeNumber'), + toBeObject: require('./toBeObject'), + toBeOddNumber: require('./toBeOddNumber'), + toBeSameLengthAs: require('./toBeSameLengthAs'), + toBeShorterThan: require('./toBeShorterThan'), + toBeString: require('./toBeString'), + toBeTrue: require('./toBeTrue'), + toBeWhitespace: require('./toBeWhitespace'), + toBeWholeNumber: require('./toBeWholeNumber'), + toBeWithinRange: require('./toBeWithinRange'), + toEndWith: require('./toEndWith'), + toImplement: require('./toImplement'), + toStartWith: require('./toStartWith'), + toThrowAnyError: require('./toThrowAnyError'), + toThrowErrorOfType: require('./toThrowErrorOfType'), + toHaveArray: require('./toHaveArray'), + toHaveArrayOfBooleans: require('./toHaveArrayOfBooleans'), + toHaveArrayOfNumbers: require('./toHaveArrayOfNumbers'), + toHaveArrayOfObjects: require('./toHaveArrayOfObjects'), + toHaveArrayOfSize: require('./toHaveArrayOfSize'), + toHaveArrayOfStrings: require('./toHaveArrayOfStrings'), + toHaveBoolean: require('./toHaveBoolean'), + toHaveCalculable: require('./toHaveCalculable'), + toHaveDate: require('./toHaveDate'), + toHaveDateAfter: require('./toHaveDateAfter'), + toHaveDateBefore: require('./toHaveDateBefore'), + toHaveEmptyArray: require('./toHaveEmptyArray'), + toHaveEmptyObject: require('./toHaveEmptyObject'), + toHaveEmptyString: require('./toHaveEmptyString'), + toHaveEvenNumber: require('./toHaveEvenNumber'), + toHaveFalse: require('./toHaveFalse'), + toHaveHtmlString: require('./toHaveHtmlString'), + toHaveIso8601: require('./toHaveIso8601'), + toHaveJsonString: require('./toHaveJsonString'), + toHaveMember: require('./toHaveMember'), + toHaveMethod: require('./toHaveMethod'), + toHaveNonEmptyArray: require('./toHaveNonEmptyArray'), + toHaveNonEmptyObject: require('./toHaveNonEmptyObject'), + toHaveNonEmptyString: require('./toHaveNonEmptyString'), + toHaveNumber: require('./toHaveNumber'), + toHaveNumberWithinRange: require('./toHaveNumberWithinRange'), + toHaveObject: require('./toHaveObject'), + toHaveOddNumber: require('./toHaveOddNumber'), + toHaveString: require('./toHaveString'), + toHaveStringLongerThan: require('./toHaveStringLongerThan'), + toHaveStringSameLengthAs: require('./toHaveStringSameLengthAs'), + toHaveStringShorterThan: require('./toHaveStringShorterThan'), + toHaveTrue: require('./toHaveTrue'), + toHaveWhitespaceString: require('./toHaveWhitespaceString'), + toHaveWholeNumber: require('./toHaveWholeNumber') + }; + + for (var matcherName in matchers) { + factory(matcherName, matchers[matcherName]); + } + + module.exports = matchers; + + }, { + './lib/factory': 3, + './toBeAfter': 10, + './toBeArray': 11, + './toBeArrayOfBooleans': 12, + './toBeArrayOfNumbers': 13, + './toBeArrayOfObjects': 14, + './toBeArrayOfSize': 15, + './toBeArrayOfStrings': 16, + './toBeBefore': 17, + './toBeBoolean': 18, + './toBeCalculable': 19, + './toBeDate': 20, + './toBeEmptyArray': 21, + './toBeEmptyObject': 22, + './toBeEmptyString': 23, + './toBeEvenNumber': 24, + './toBeFalse': 25, + './toBeFunction': 26, + './toBeHtmlString': 27, + './toBeIso8601': 28, + './toBeJsonString': 29, + './toBeLongerThan': 30, + './toBeNonEmptyArray': 31, + './toBeNonEmptyObject': 32, + './toBeNonEmptyString': 33, + './toBeNumber': 34, + './toBeObject': 35, + './toBeOddNumber': 36, + './toBeSameLengthAs': 37, + './toBeShorterThan': 38, + './toBeString': 39, + './toBeTrue': 40, + './toBeWhitespace': 41, + './toBeWholeNumber': 42, + './toBeWithinRange': 43, + './toEndWith': 44, + './toHaveArray': 45, + './toHaveArrayOfBooleans': 46, + './toHaveArrayOfNumbers': 47, + './toHaveArrayOfObjects': 48, + './toHaveArrayOfSize': 49, + './toHaveArrayOfStrings': 50, + './toHaveBoolean': 51, + './toHaveCalculable': 52, + './toHaveDate': 53, + './toHaveDateAfter': 54, + './toHaveDateBefore': 55, + './toHaveEmptyArray': 56, + './toHaveEmptyObject': 57, + './toHaveEmptyString': 58, + './toHaveEvenNumber': 59, + './toHaveFalse': 60, + './toHaveHtmlString': 61, + './toHaveIso8601': 62, + './toHaveJsonString': 63, + './toHaveMember': 64, + './toHaveMethod': 65, + './toHaveNonEmptyArray': 66, + './toHaveNonEmptyObject': 67, + './toHaveNonEmptyString': 68, + './toHaveNumber': 69, + './toHaveNumberWithinRange': 70, + './toHaveObject': 71, + './toHaveOddNumber': 72, + './toHaveString': 73, + './toHaveStringLongerThan': 74, + './toHaveStringSameLengthAs': 75, + './toHaveStringShorterThan': 76, + './toHaveTrue': 77, + './toHaveWhitespaceString': 78, + './toHaveWholeNumber': 79, + './toImplement': 80, + './toStartWith': 81, + './toThrowAnyError': 82, + './toThrowErrorOfType': 83 + }], + 2: [function(require, module, exports) { + 'use strict'; + + module.exports = every; + + function every(array, truthTest) { + for (var i = 0, len = array.length; i < len; i++) { + if (!truthTest(array[i])) { + return false; + } + } + return true; + } + + }, {}], + 3: [function(require, module, exports) { + 'use strict'; + + var adapters = typeof jasmine.addMatchers === 'function' ? + require('./jasmine-v2') : + require('./jasmine-v1'); + + module.exports = function(name, matcher) { + var adapter = adapters[matcher.length]; + return adapter(name, matcher); + }; + + }, { + './jasmine-v1': 4, + './jasmine-v2': 5 + }], + 4: [function(require, module, exports) { + 'use strict'; + + module.exports = { + 1: createFactory(forActual), + 2: createFactory(forActualAndExpected), + 3: createFactory(forActualAndTwoExpected), + 4: createFactory(forKeyAndActualAndTwoExpected) + }; + + function createFactory(adapter) { + return function jasmineV1MatcherFactory(name, matcher) { + var matcherByName = new JasmineV1Matcher(name, adapter, matcher); + beforeEach(function() { + this.addMatchers(matcherByName); + }); + return matcherByName; + }; + } + + function JasmineV1Matcher(name, adapter, matcher) { + this[name] = adapter(name, matcher); + } + + function forActual(name, matcher) { + return function(optionalMessage) { + return matcher(this.actual, optionalMessage); + }; + } + + function forActualAndExpected(name, matcher) { + return function(expected, optionalMessage) { + return matcher(expected, this.actual, optionalMessage); + }; + } + + function forActualAndTwoExpected(name, matcher) { + return function(expected1, expected2, optionalMessage) { + return matcher(expected1, expected2, this.actual, optionalMessage); + }; + } + + function forKeyAndActualAndTwoExpected(name, matcher) { + return function(key, expected1, expected2, optionalMessage) { + return matcher(key, expected1, expected2, this.actual, optionalMessage); + }; + } + + }, {}], + 5: [function(require, module, exports) { + 'use strict'; + + var matcherFactory = require('./matcherFactory'); + var memberMatcherFactory = require('./memberMatcherFactory'); + + module.exports = { + 1: createFactory(getAdapter(1)), + 2: createFactory(getAdapter(2)), + 3: createFactory(getAdapter(3)), + 4: createFactory(getAdapter(4)) + }; + + function createFactory(adapter) { + return function jasmineV2MatcherFactory(name, matcher) { + var matcherByName = new JasmineV2Matcher(name, adapter, matcher); + beforeEach(function() { + jasmine.addMatchers(matcherByName); + }); + return matcherByName; + }; + } + + function JasmineV2Matcher(name, adapter, matcher) { + this[name] = adapter(name, matcher); + } + + function getAdapter(argsCount) { + return function adapter(name, matcher) { + var factory = isMemberMatcher(name) ? memberMatcherFactory : matcherFactory; + return factory[argsCount](name, matcher); + }; + } + + function isMemberMatcher(name) { + return name.search(/^toHave/) !== -1; + } + + }, { + './matcherFactory': 6, + './memberMatcherFactory': 7 + }], + 6: [function(require, module, exports) { + 'use strict'; + + module.exports = { + 1: forActual, + 2: forActualAndExpected, + 3: forActualAndTwoExpected + }; + + function forActual(name, matcher) { + return function(util) { + return { + compare: function(actual, optionalMessage) { + var passes = matcher(actual); + return { + pass: passes, + message: ( + optionalMessage ? + util.buildFailureMessage(name, passes, actual, optionalMessage) : + util.buildFailureMessage(name, passes, actual) + ) + }; + } + }; + }; + } + + function forActualAndExpected(name, matcher) { + return function(util) { + return { + compare: function(actual, expected, optionalMessage) { + var passes = matcher(expected, actual); + return { + pass: passes, + message: ( + optionalMessage ? + util.buildFailureMessage(name, passes, actual, expected, optionalMessage) : + util.buildFailureMessage(name, passes, actual, expected) + ) + }; + } + }; + }; + } + + function forActualAndTwoExpected(name, matcher) { + return function(util) { + return { + compare: function(actual, expected1, expected2, optionalMessage) { + var passes = matcher(expected1, expected2, actual); + return { + pass: passes, + message: ( + optionalMessage ? + util.buildFailureMessage(name, passes, actual, expected1, expected2, optionalMessage) : + util.buildFailureMessage(name, passes, actual, expected1, expected2) + ) + }; + } + }; + }; + } + + }, {}], + 7: [function(require, module, exports) { + 'use strict'; + + module.exports = { + 2: forKeyAndActual, + 3: forKeyAndActualAndExpected, + 4: forKeyAndActualAndTwoExpected + }; + + function forKeyAndActual(name, matcher) { + return function(util) { + return { + compare: function(actual, key, optionalMessage) { + var passes = matcher(key, actual); + return { + pass: passes, + message: ( + optionalMessage ? + util.buildFailureMessage(name, passes, actual, optionalMessage) : + util.buildFailureMessage(name, passes, actual) + ) + }; + } + }; + }; + } + + function forKeyAndActualAndExpected(name, matcher) { + return function(util) { + return { + compare: function(actual, key, expected, optionalMessage) { + var passes = matcher(key, expected, actual); + return { + pass: passes, + message: ( + optionalMessage ? + util.buildFailureMessage(name, passes, actual, expected, optionalMessage) : + util.buildFailureMessage(name, passes, actual, expected) + ) + }; + } + }; + }; + } + + function forKeyAndActualAndTwoExpected(name, matcher) { + return function(util) { + return { + compare: function(actual, key, expected1, expected2, optionalMessage) { + var passes = matcher(key, expected1, expected2, actual); + return { + pass: passes, + message: ( + optionalMessage ? + util.buildFailureMessage(name, passes, actual, expected1, expected2, optionalMessage) : + util.buildFailureMessage(name, passes, actual, expected1, expected2) + ) + }; + } + }; + }; + } + + }, {}], + 8: [function(require, module, exports) { + 'use strict'; + + module.exports = is; + + function is(value, type) { + return Object.prototype.toString.call(value) === '[object ' + type + ']'; + } + + }, {}], + 9: [function(require, module, exports) { + 'use strict'; + + module.exports = keys; + + function keys(object) { + var list = []; + for (var key in object) { + if (object.hasOwnProperty(key)) { + list.push(key); + } + } + return list; + } + + }, {}], + 10: [function(require, module, exports) { + 'use strict'; + + var toBeBefore = require('./toBeBefore'); + + module.exports = toBeAfter; + + function toBeAfter(otherDate, actual) { + return toBeBefore(actual, otherDate); + } + + }, { + './toBeBefore': 17 + }], + 11: [function(require, module, exports) { + 'use strict'; + + var is = require('./lib/is'); + + module.exports = toBeArray; + + function toBeArray(actual) { + return is(actual, 'Array'); + } + + }, { + './lib/is': 8 + }], + 12: [function(require, module, exports) { + 'use strict'; + + var every = require('./lib/every'); + var toBeArray = require('./toBeArray'); + var toBeBoolean = require('./toBeBoolean'); + + module.exports = toBeArrayOfBooleans; + + function toBeArrayOfBooleans(actual) { + return toBeArray(actual) && + every(actual, toBeBoolean); + } + + }, { + './lib/every': 2, + './toBeArray': 11, + './toBeBoolean': 18 + }], + 13: [function(require, module, exports) { + 'use strict'; + + var every = require('./lib/every'); + var toBeArray = require('./toBeArray'); + var toBeNumber = require('./toBeNumber'); + + module.exports = toBeArrayOfBooleans; + + function toBeArrayOfBooleans(actual) { + return toBeArray(actual) && + every(actual, toBeNumber); + } + + }, { + './lib/every': 2, + './toBeArray': 11, + './toBeNumber': 34 + }], + 14: [function(require, module, exports) { + 'use strict'; + + var every = require('./lib/every'); + var toBeArray = require('./toBeArray'); + var toBeObject = require('./toBeObject'); + + module.exports = toBeArrayOfBooleans; + + function toBeArrayOfBooleans(actual) { + return toBeArray(actual) && + every(actual, toBeObject); + } + + }, { + './lib/every': 2, + './toBeArray': 11, + './toBeObject': 35 + }], + 15: [function(require, module, exports) { + 'use strict'; + + var toBeArray = require('./toBeArray'); + + module.exports = toBeArrayOfSize; + + function toBeArrayOfSize(size, actual) { + return toBeArray(actual) && + actual.length === size; + } + + }, { + './toBeArray': 11 + }], + 16: [function(require, module, exports) { + 'use strict'; + + var every = require('./lib/every'); + var toBeArray = require('./toBeArray'); + var toBeString = require('./toBeString'); + + module.exports = toBeArrayOfStrings; + + function toBeArrayOfStrings(actual) { + return toBeArray(actual) && + every(actual, toBeString); + } + + }, { + './lib/every': 2, + './toBeArray': 11, + './toBeString': 39 + }], + 17: [function(require, module, exports) { + 'use strict'; + + var toBeDate = require('./toBeDate'); + + module.exports = toBeBefore; + + function toBeBefore(otherDate, actual) { + return toBeDate(actual) && + toBeDate(otherDate) && + actual.getTime() < otherDate.getTime(); + } + + }, { + './toBeDate': 20 + }], + 18: [function(require, module, exports) { + 'use strict'; + + var is = require('./lib/is'); + + module.exports = toBeBoolean; + + function toBeBoolean(actual) { + return is(actual, 'Boolean'); + } + + }, { + './lib/is': 8 + }], + 19: [function(require, module, exports) { + 'use strict'; + + module.exports = toBeCalculable; + + // Assert subject can be used in Mathemetic + // calculations despite not being a Number, + // for example `"1" * "2" === 2` whereas + // `"wut?" * 2 === NaN`. + function toBeCalculable(actual) { + return !isNaN(actual * 2); + } + + }, {}], + 20: [function(require, module, exports) { + 'use strict'; + + var is = require('./lib/is'); + + module.exports = toBeDate; + + function toBeDate(actual) { + return is(actual, 'Date'); + } + + }, { + './lib/is': 8 + }], + 21: [function(require, module, exports) { + 'use strict'; + + var toBeArrayOfSize = require('./toBeArrayOfSize'); + + module.exports = toBeEmptyArray; + + function toBeEmptyArray(actual) { + return toBeArrayOfSize(0, actual); + } + + }, { + './toBeArrayOfSize': 15 + }], + 22: [function(require, module, exports) { + 'use strict'; + + var keys = require('./lib/keys'); + var is = require('./lib/is'); + + module.exports = toBeEmptyObject; + + function toBeEmptyObject(actual) { + return is(actual, 'Object') && + keys(actual).length === 0; + } + + }, { + './lib/is': 8, + './lib/keys': 9 + }], + 23: [function(require, module, exports) { + 'use strict'; + + module.exports = toBeEmptyString; + + function toBeEmptyString(actual) { + return actual === ''; + } + + }, {}], + 24: [function(require, module, exports) { + 'use strict'; + + var toBeNumber = require('./toBeNumber'); + + module.exports = toBeEvenNumber; + + function toBeEvenNumber(actual) { + return toBeNumber(actual) && + actual % 2 === 0; + } + + }, { + './toBeNumber': 34 + }], + 25: [function(require, module, exports) { + 'use strict'; + + var is = require('./lib/is'); + + module.exports = toBeFalse; + + function toBeFalse(actual) { + return actual === false || + is(actual, 'Boolean') && + !actual.valueOf(); + } + + }, { + './lib/is': 8 + }], + 26: [function(require, module, exports) { + 'use strict'; + + module.exports = toBeFunction; + + function toBeFunction(actual) { + return typeof actual === 'function'; + } + + }, {}], + 27: [function(require, module, exports) { + 'use strict'; + + var toBeString = require('./toBeString'); + + module.exports = toBeHtmlString; + + function toBeHtmlString(actual) { + // < start with opening tag "<" + // ( start group 1 + // "[^"]*" allow string in "double quotes" + // | OR + // '[^']*' allow string in "single quotes" + // | OR + // [^'">] cant contains one single quotes, double quotes and ">" + // ) end group 1 + // * 0 or more + // > end with closing tag ">" + return toBeString(actual) && + actual.search(/<("[^"]*"|'[^']*'|[^'">])*>/) !== -1; + } + + }, { + './toBeString': 39 + }], + 28: [function(require, module, exports) { + 'use strict'; + + var toBeString = require('./toBeString'); + + module.exports = toBeIso8601; + + function toBeIso8601(actual) { + + if (!toBeString(actual)) { + return false; + } + + if ( + isIso8601(actual, [ + // 2013-07-08 + 4, '-', 2, '-', 2 + ]) || isIso8601(actual, [ + // 2013-07-08T07:29 + 4, '-', 2, '-', 2, 'T', 2, ':', 2 + ]) || isIso8601(actual, [ + // 2013-07-08T07:29:15 + 4, '-', 2, '-', 2, 'T', 2, ':', 2, ':', 2 + ]) || isIso8601(actual, [ + // 2013-07-08T07:29:15.863 + 4, '-', 2, '-', 2, 'T', 2, ':', 2, ':', 2, '.', 3 + ]) || isIso8601(actual, [ + // 2013-07-08T07:29:15.863Z + 4, '-', 2, '-', 2, 'T', 2, ':', 2, ':', 2, '.', 3, 'Z' + ]) + ) { + return new Date(actual).toString() !== 'Invalid Date'; + } + + return false; + + } + + function isIso8601(string, pattern) { + var returnValue = string.search( + new RegExp('^' + pattern.map(function(term) { + if (term === '-') { + return '\\-'; + } else if (typeof term === 'string') { + return term; + } else { + return '([0-9]{' + term + '})'; + } + }).join('') + '$') + ) !== -1; + return returnValue; + } + + }, { + './toBeString': 39 + }], + 29: [function(require, module, exports) { + 'use strict'; + + module.exports = toBeJsonString; + + function toBeJsonString(actual) { + var isParseable; + var json; + try { + json = JSON.parse(actual); + } catch (e) { + isParseable = false; + } + return isParseable !== false && + json !== null; + } + + }, {}], + 30: [function(require, module, exports) { + 'use strict'; + + var toBeString = require('./toBeString'); + + module.exports = toBeLongerThan; + + function toBeLongerThan(otherString, actual) { + return toBeString(actual) && + toBeString(otherString) && + actual.length > otherString.length; + } + + }, { + './toBeString': 39 + }], + 31: [function(require, module, exports) { + 'use strict'; + + var is = require('./lib/is'); + + module.exports = toBeNonEmptyArray; + + function toBeNonEmptyArray(actual) { + return is(actual, 'Array') && + actual.length > 0; + } + + }, { + './lib/is': 8 + }], + 32: [function(require, module, exports) { + 'use strict'; + + var keys = require('./lib/keys'); + var is = require('./lib/is'); + + module.exports = toBeNonEmptyObject; + + function toBeNonEmptyObject(actual) { + return is(actual, 'Object') && + keys(actual).length > 0; + } + + }, { + './lib/is': 8, + './lib/keys': 9 + }], + 33: [function(require, module, exports) { + 'use strict'; + + var toBeString = require('./toBeString'); + + module.exports = toBeNonEmptyString; + + function toBeNonEmptyString(actual) { + return toBeString(actual) && + actual.length > 0; + } + + }, { + './toBeString': 39 + }], + 34: [function(require, module, exports) { + 'use strict'; + + var is = require('./lib/is'); + + module.exports = toBeNumber; + + function toBeNumber(actual) { + return !isNaN(parseFloat(actual)) && + !is(actual, 'String'); + } + + }, { + './lib/is': 8 + }], + 35: [function(require, module, exports) { + 'use strict'; + + var is = require('./lib/is'); + + module.exports = toBeObject; + + function toBeObject(actual) { + return is(actual, 'Object'); + } + + }, { + './lib/is': 8 + }], + 36: [function(require, module, exports) { + 'use strict'; + + var toBeNumber = require('./toBeNumber'); + + module.exports = toBeOddNumber; + + function toBeOddNumber(actual) { + return toBeNumber(actual) && + actual % 2 !== 0; + } + + }, { + './toBeNumber': 34 + }], + 37: [function(require, module, exports) { + 'use strict'; + + var toBeString = require('./toBeString'); + + module.exports = toBeSameLengthAs; + + function toBeSameLengthAs(otherString, actual) { + return toBeString(actual) && + toBeString(otherString) && + actual.length === otherString.length; + } + + }, { + './toBeString': 39 + }], + 38: [function(require, module, exports) { + 'use strict'; + + var toBeString = require('./toBeString'); + + module.exports = toBeShorterThan; + + function toBeShorterThan(otherString, actual) { + return toBeString(actual) && + toBeString(otherString) && + actual.length < otherString.length; + } + + }, { + './toBeString': 39 + }], + 39: [function(require, module, exports) { + 'use strict'; + + var is = require('./lib/is'); + + module.exports = toBeString; + + function toBeString(actual) { + return is(actual, 'String'); + } + + }, { + './lib/is': 8 + }], + 40: [function(require, module, exports) { + 'use strict'; + + var is = require('./lib/is'); + + module.exports = toBeTrue; + + function toBeTrue(actual) { + return actual === true || + is(actual, 'Boolean') && + actual.valueOf(); + } + + }, { + './lib/is': 8 + }], + 41: [function(require, module, exports) { + 'use strict'; + + var toBeString = require('./toBeString'); + + module.exports = toBeWhitespace; + + function toBeWhitespace(actual) { + return toBeString(actual) && + actual.search(/\S/) === -1; + } + + }, { + './toBeString': 39 + }], + 42: [function(require, module, exports) { + 'use strict'; + + var toBeNumber = require('./toBeNumber'); + + module.exports = toBeWholeNumber; + + function toBeWholeNumber(actual) { + return toBeNumber(actual) && ( + actual === 0 || actual % 1 === 0 + ); + } + + }, { + './toBeNumber': 34 + }], + 43: [function(require, module, exports) { + 'use strict'; + + var toBeNumber = require('./toBeNumber'); + + module.exports = toBeWithinRange; + + function toBeWithinRange(floor, ceiling, actual) { + return toBeNumber(actual) && + actual >= floor && + actual <= ceiling; + } + + }, { + './toBeNumber': 34 + }], + 44: [function(require, module, exports) { + 'use strict'; + + var toBeNonEmptyString = require('./toBeNonEmptyString'); + + module.exports = toEndWith; + + function toEndWith(subString, actual) { + if (!toBeNonEmptyString(actual) || !toBeNonEmptyString(subString)) { + return false; + } + return actual.slice(actual.length - subString.length, actual.length) === subString; + } + + }, { + './toBeNonEmptyString': 33 + }], + 45: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeArray = require('./toBeArray'); + + module.exports = toHaveArray; + + function toHaveArray(key, actual) { + return toBeObject(actual) && + toBeArray(actual[key]); + } + + }, { + './toBeArray': 11, + './toBeObject': 35 + }], + 46: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeArrayOfBooleans = require('./toBeArrayOfBooleans'); + + module.exports = toHaveArrayOfBooleans; + + function toHaveArrayOfBooleans(key, actual) { + return toBeObject(actual) && + toBeArrayOfBooleans(actual[key]); + } + + }, { + './toBeArrayOfBooleans': 12, + './toBeObject': 35 + }], + 47: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeArrayOfNumbers = require('./toBeArrayOfNumbers'); + + module.exports = toHaveArrayOfNumbers; + + function toHaveArrayOfNumbers(key, actual) { + return toBeObject(actual) && + toBeArrayOfNumbers(actual[key]); + } + + }, { + './toBeArrayOfNumbers': 13, + './toBeObject': 35 + }], + 48: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeArrayOfObjects = require('./toBeArrayOfObjects'); + + module.exports = toHaveArrayOfObjects; + + function toHaveArrayOfObjects(key, actual) { + return toBeObject(actual) && + toBeArrayOfObjects(actual[key]); + } + + }, { + './toBeArrayOfObjects': 14, + './toBeObject': 35 + }], + 49: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeArrayOfSize = require('./toBeArrayOfSize'); + + module.exports = toHaveArrayOfSize; + + function toHaveArrayOfSize(key, size, actual) { + return toBeObject(actual) && + toBeArrayOfSize(size, actual[key]); + } + + }, { + './toBeArrayOfSize': 15, + './toBeObject': 35 + }], + 50: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeArrayOfStrings = require('./toBeArrayOfStrings'); + + module.exports = toHaveArrayOfStrings; + + function toHaveArrayOfStrings(key, actual) { + return toBeObject(actual) && + toBeArrayOfStrings(actual[key]); + } + + }, { + './toBeArrayOfStrings': 16, + './toBeObject': 35 + }], + 51: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeBoolean = require('./toBeBoolean'); + + module.exports = toHaveBoolean; + + function toHaveBoolean(key, actual) { + return toBeObject(actual) && + toBeBoolean(actual[key]); + } + + }, { + './toBeBoolean': 18, + './toBeObject': 35 + }], + 52: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeCalculable = require('./toBeCalculable'); + + module.exports = toHaveCalculable; + + function toHaveCalculable(key, actual) { + return toBeObject(actual) && + toBeCalculable(actual[key]); + } + + }, { + './toBeCalculable': 19, + './toBeObject': 35 + }], + 53: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeDate = require('./toBeDate'); + + module.exports = toHaveDate; + + function toHaveDate(key, actual) { + return toBeObject(actual) && + toBeDate(actual[key]); + } + + }, { + './toBeDate': 20, + './toBeObject': 35 + }], + 54: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeAfter = require('./toBeAfter'); + + module.exports = toHaveDateAfter; + + function toHaveDateAfter(key, date, actual) { + return toBeObject(actual) && + toBeAfter(date, actual[key]); + } + + }, { + './toBeAfter': 10, + './toBeObject': 35 + }], + 55: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeBefore = require('./toBeBefore'); + + module.exports = toHaveDateBefore; + + function toHaveDateBefore(key, date, actual) { + return toBeObject(actual) && + toBeBefore(date, actual[key]); + } + + }, { + './toBeBefore': 17, + './toBeObject': 35 + }], + 56: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeEmptyArray = require('./toBeEmptyArray'); + + module.exports = toHaveEmptyArray; + + function toHaveEmptyArray(key, actual) { + return toBeObject(actual) && + toBeEmptyArray(actual[key]); + } + + }, { + './toBeEmptyArray': 21, + './toBeObject': 35 + }], + 57: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeEmptyObject = require('./toBeEmptyObject'); + + module.exports = toHaveEmptyObject; + + function toHaveEmptyObject(key, actual) { + return toBeObject(actual) && + toBeEmptyObject(actual[key]); + } + + }, { + './toBeEmptyObject': 22, + './toBeObject': 35 + }], + 58: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeEmptyString = require('./toBeEmptyString'); + + module.exports = toHaveEmptyString; + + function toHaveEmptyString(key, actual) { + return toBeObject(actual) && + toBeEmptyString(actual[key]); + } + + }, { + './toBeEmptyString': 23, + './toBeObject': 35 + }], + 59: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeEvenNumber = require('./toBeEvenNumber'); + + module.exports = toHaveEvenNumber; + + function toHaveEvenNumber(key, actual) { + return toBeObject(actual) && + toBeEvenNumber(actual[key]); + } + + }, { + './toBeEvenNumber': 24, + './toBeObject': 35 + }], + 60: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeFalse = require('./toBeFalse'); + + module.exports = toHaveFalse; + + function toHaveFalse(key, actual) { + return toBeObject(actual) && + toBeFalse(actual[key]); + } + + }, { + './toBeFalse': 25, + './toBeObject': 35 + }], + 61: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeHtmlString = require('./toBeHtmlString'); + + module.exports = toHaveHtmlString; + + function toHaveHtmlString(key, actual) { + return toBeObject(actual) && + toBeHtmlString(actual[key]); + } + + }, { + './toBeHtmlString': 27, + './toBeObject': 35 + }], + 62: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeIso8601 = require('./toBeIso8601'); + + module.exports = toHaveIso8601; + + function toHaveIso8601(key, actual) { + return toBeObject(actual) && + toBeIso8601(actual[key]); + } + + }, { + './toBeIso8601': 28, + './toBeObject': 35 + }], + 63: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeJsonString = require('./toBeJsonString'); + + module.exports = toHaveJsonString; + + function toHaveJsonString(key, actual) { + return toBeObject(actual) && + toBeJsonString(actual[key]); + } + + }, { + './toBeJsonString': 29, + './toBeObject': 35 + }], + 64: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeString = require('./toBeString'); + + module.exports = toHaveMember; + + function toHaveMember(key, actual) { + return toBeString(key) && + toBeObject(actual) && + key in actual; + } + + }, { + './toBeObject': 35, + './toBeString': 39 + }], + 65: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeFunction = require('./toBeFunction'); + + module.exports = toHaveMethod; + + function toHaveMethod(key, actual) { + return toBeObject(actual) && + toBeFunction(actual[key]); + } + + }, { + './toBeFunction': 26, + './toBeObject': 35 + }], + 66: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeNonEmptyArray = require('./toBeNonEmptyArray'); + + module.exports = toHaveNonEmptyArray; + + function toHaveNonEmptyArray(key, actual) { + return toBeObject(actual) && + toBeNonEmptyArray(actual[key]); + } + + }, { + './toBeNonEmptyArray': 31, + './toBeObject': 35 + }], + 67: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeNonEmptyObject = require('./toBeNonEmptyObject'); + + module.exports = toHaveNonEmptyObject; + + function toHaveNonEmptyObject(key, actual) { + return toBeObject(actual) && + toBeNonEmptyObject(actual[key]); + } + + }, { + './toBeNonEmptyObject': 32, + './toBeObject': 35 + }], + 68: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeNonEmptyString = require('./toBeNonEmptyString'); + + module.exports = toHaveNonEmptyString; + + function toHaveNonEmptyString(key, actual) { + return toBeObject(actual) && + toBeNonEmptyString(actual[key]); + } + + }, { + './toBeNonEmptyString': 33, + './toBeObject': 35 + }], + 69: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeNumber = require('./toBeNumber'); + + module.exports = toHaveNumber; + + function toHaveNumber(key, actual) { + return toBeObject(actual) && + toBeNumber(actual[key]); + } + + }, { + './toBeNumber': 34, + './toBeObject': 35 + }], + 70: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeWithinRange = require('./toBeWithinRange'); + + module.exports = toHaveNumberWithinRange; + + function toHaveNumberWithinRange(key, floor, ceiling, actual) { + return toBeObject(actual) && + toBeWithinRange(floor, ceiling, actual[key]); + } + + }, { + './toBeObject': 35, + './toBeWithinRange': 43 + }], + 71: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + + module.exports = toHaveObject; + + function toHaveObject(key, actual) { + return toBeObject(actual) && + toBeObject(actual[key]); + } + + }, { + './toBeObject': 35 + }], + 72: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeOddNumber = require('./toBeOddNumber'); + + module.exports = toHaveOddNumber; + + function toHaveOddNumber(key, actual) { + return toBeObject(actual) && + toBeOddNumber(actual[key]); + } + + }, { + './toBeObject': 35, + './toBeOddNumber': 36 + }], + 73: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeString = require('./toBeString'); + + module.exports = toHaveString; + + function toHaveString(key, actual) { + return toBeObject(actual) && + toBeString(actual[key]); + } + + }, { + './toBeObject': 35, + './toBeString': 39 + }], + 74: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeLongerThan = require('./toBeLongerThan'); + + module.exports = toHaveStringLongerThan; + + function toHaveStringLongerThan(key, other, actual) { + return toBeObject(actual) && + toBeLongerThan(other, actual[key]); + } + + }, { + './toBeLongerThan': 30, + './toBeObject': 35 + }], + 75: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeSameLengthAs = require('./toBeSameLengthAs'); + + module.exports = toHaveStringSameLengthAs; + + function toHaveStringSameLengthAs(key, other, actual) { + return toBeObject(actual) && + toBeSameLengthAs(other, actual[key]); + } + + }, { + './toBeObject': 35, + './toBeSameLengthAs': 37 + }], + 76: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeShorterThan = require('./toBeShorterThan'); + + module.exports = toHaveStringShorterThan; + + function toHaveStringShorterThan(key, other, actual) { + return toBeObject(actual) && + toBeShorterThan(other, actual[key]); + } + + }, { + './toBeObject': 35, + './toBeShorterThan': 38 + }], + 77: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeTrue = require('./toBeTrue'); + + module.exports = toHaveTrue; + + function toHaveTrue(key, actual) { + return toBeObject(actual) && + toBeTrue(actual[key]); + } + + }, { + './toBeObject': 35, + './toBeTrue': 40 + }], + 78: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeWhitespace = require('./toBeWhitespace'); + + module.exports = toHaveWhitespaceString; + + function toHaveWhitespaceString(key, actual) { + return toBeObject(actual) && + toBeWhitespace(actual[key]); + } + + }, { + './toBeObject': 35, + './toBeWhitespace': 41 + }], + 79: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + var toBeWholeNumber = require('./toBeWholeNumber'); + + module.exports = toHaveWholeNumber; + + function toHaveWholeNumber(key, actual) { + return toBeObject(actual) && + toBeWholeNumber(actual[key]); + } + + }, { + './toBeObject': 35, + './toBeWholeNumber': 42 + }], + 80: [function(require, module, exports) { + 'use strict'; + + var toBeObject = require('./toBeObject'); + + module.exports = toImplement; + + function toImplement(api, actual) { + return toBeObject(api) && + toBeObject(actual) && + featuresAll(api, actual); + } + + function featuresAll(api, actual) { + for (var key in api) { + if (api.hasOwnProperty(key) && + key in actual === false) { + return false; + } + } + return true; + } + + }, { + './toBeObject': 35 + }], + 81: [function(require, module, exports) { + 'use strict'; + + var toBeNonEmptyString = require('./toBeNonEmptyString'); + + module.exports = toStartWith; + + function toStartWith(subString, actual) { + if (!toBeNonEmptyString(actual) || !toBeNonEmptyString(subString)) { + return false; + } + return actual.slice(0, subString.length) === subString; + } + + }, { + './toBeNonEmptyString': 33 + }], + 82: [function(require, module, exports) { + 'use strict'; + + module.exports = toThrowAnyError; + + function toThrowAnyError(actual) { + var threwError = false; + try { + actual(); + } catch (e) { + threwError = true; + } + return threwError; + } + + }, {}], + 83: [function(require, module, exports) { + 'use strict'; + + module.exports = toThrowErrorOfType; + + function toThrowErrorOfType(type, actual) { + var threwErrorOfType = false; + try { + actual(); + } catch (e) { + threwErrorOfType = (e.name === type); + } + return threwErrorOfType; + } + + }, {}] +}, {}, [1]); diff --git a/dashboard-ui/bower_components/fingerprintjs2/specs/lib/jasmine-2.3.4/jasmine.css b/dashboard-ui/bower_components/fingerprintjs2/specs/lib/jasmine-2.3.4/jasmine.css new file mode 100644 index 000000000..f9f4ae901 --- /dev/null +++ b/dashboard-ui/bower_components/fingerprintjs2/specs/lib/jasmine-2.3.4/jasmine.css @@ -0,0 +1,58 @@ +body { overflow-y: scroll; } + +.jasmine_html-reporter { background-color: #eee; padding: 5px; margin: -8px; font-size: 11px; font-family: Monaco, "Lucida Console", monospace; line-height: 14px; color: #333; } +.jasmine_html-reporter a { text-decoration: none; } +.jasmine_html-reporter a:hover { text-decoration: underline; } +.jasmine_html-reporter p, .jasmine_html-reporter h1, .jasmine_html-reporter h2, .jasmine_html-reporter h3, .jasmine_html-reporter h4, .jasmine_html-reporter h5, .jasmine_html-reporter h6 { margin: 0; line-height: 14px; } +.jasmine_html-reporter .banner, .jasmine_html-reporter .symbol-summary, .jasmine_html-reporter .summary, .jasmine_html-reporter .result-message, .jasmine_html-reporter .spec .description, .jasmine_html-reporter .spec-detail .description, .jasmine_html-reporter .alert .bar, .jasmine_html-reporter .stack-trace { padding-left: 9px; padding-right: 9px; } +.jasmine_html-reporter .banner { position: relative; } +.jasmine_html-reporter .banner .title { background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAAAZCAMAAACGusnyAAACdlBMVEX/////AP+AgICqVaqAQICZM5mAVYCSSZKAQICOOY6ATYCLRouAQICJO4mSSYCIRIiPQICHPIeOR4CGQ4aMQICGPYaLRoCFQ4WKQICPPYWJRYCOQoSJQICNPoSIRICMQoSHQICHRICKQoOHQICKPoOJO4OJQYOMQICMQ4CIQYKLQICIPoKLQ4CKQICNPoKJQISMQ4KJQoSLQYKJQISLQ4KIQoSKQYKIQICIQISMQoSKQYKLQIOLQoOJQYGLQIOKQIOMQoGKQYOLQYGKQIOLQoGJQYOJQIOKQYGJQIOKQoGKQIGLQIKLQ4KKQoGLQYKJQIGKQYKJQIGKQIKJQoGKQYKLQIGKQYKLQIOJQoKKQoOJQYKKQIOJQoKKQoOKQIOLQoKKQYOLQYKJQIOKQoKKQYKKQoKJQYOKQYKLQIOKQoKLQYOKQYKLQIOJQoGKQYKJQYGJQoGKQYKLQoGLQYGKQoGJQYKKQYGJQIKKQoGJQYKLQIKKQYGLQYKKQYGKQYGKQYKJQYOKQoKJQYOKQYKLQYOLQYOKQYKLQYOKQoKKQYKKQYOKQYOJQYKKQYKLQYKKQIKKQoKKQYKKQYKKQoKJQIKKQYKLQYKKQYKKQIKKQYKKQYKKQYKKQIKKQYKJQYGLQYGKQYKKQYKKQYGKQIKKQYGKQYOJQoKKQYOLQYKKQYOKQoKKQYKKQoKKQYKKQYKJQYKLQYKKQYKKQYKKQYKKQYKKQYKKQYKKQYKKQYKJQYKKQYKKQYKKQYKKQYKKQYKKQYKKQYKKQYKKQYKKQYKKQYKLQYKKQYKKQYKKQYKKQYKKQYKKQYKKQYKKQYKKQYKKQYKKQYKKQYKmIDpEAAAA0XRSTlMAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAiIyQlJycoKissLS4wMTQ1Njc4OTo7PDw+P0BCQ0RISUpLTE1OUFNUVVdYWFlaW15fYGFiY2ZnaGlqa2xtb3BxcnN0dnh5ent8fX5/gIGChIWIioyNjo+QkZOUlZaYmZqbnJ2eoKGio6WmqKmsra6vsLGztre4ubq7vL2+wMHDxMjJysvNzs/Q0dLU1tfY2dvc3t/g4eLj5ebn6Onq6+zt7u/w8vP09fb3+Pn6+/z9/vkVQXAAAAMaSURBVHhe5dXxV1N1GMfxz2ABbDgIAm5VDJOyVDIJLUMaVpBWUZUaGbmqoGpZRSiGiRWp6KoZ5AB0ZY50RImZQIlahKkMYXv/R90dBvET/rJfOr3Ouc8v99zPec59zvf56j+vYKlViSf7250X4Mr3O29Tgq08BdGB4DhcekEJ5YkQKFsgWZdtj9JpV+I8xPjLFqkrsEIqO8PHSpis36jWazcqjEsfJjkvRssVU37SdIOu4XCf5vEJPsnwJpnRNU9JmxhMk8l1gehIrq7hTFjzOD+Vf88629qKMJVNltInFeRexRQyJlNeqd1iGDlSzrIUIyXbyFfm3RYprcQRe7lqtWyGYbfc6dT0R2vmdOOkX3u55C1rP37ftiH+tDby4r/RBT0w8TyEkr+epB9XgPDmSYYWbrhCuFYaIyw3fDQAXTnSkh+ANofiHmWf9l+FY1I90FdQTetstO00o23novzVsJ7uB3/C5TkbjRwZ5JerwV4iRWq9HFbFMaK/d0TYqayRiQPuIxxS3Bu8JWU90/60tKi7vkhaznez0a/TbVOKj5CaOZh6fWG6/Lyv9B/ZLR1gw/S/fpbeVD3MCW1li6SvWDOn65tr99/uvWtBS0XDm4s1t+sOHpG0kpBKx/l77wOSnxLpcx6TXmXLTPQOKYOf9Q1dfr8/SJ2mFdCvl1Yl93DiHUZvXeLJbGSzYu5gVJ2slbSakOR8dxCq5adQ2oFLqsE9Ex3L4qQO0eOPeU5x56bypXp4onSEb5OkICX6lDat55TeoztNKQcJaakrz9KCb95oD69IKq+yKW4XPjknaS52V0TZqE2cTtXjcHSCRmUO88e+85hj3EP74i9p8pylw7lxgMDyyl6OV7ZejnjNMfatu87LxRbH0IS35gt2a4ZjmGpVBdKK3Wr6INk8jWWSGqbA55CKgjBRC6E9w78ydTg3ABS3AFV1QN0Y4Aa2pgEjWnQURj9L0ayK6R2ysEqxHUKzYnLvvyU+i9KM2JHJzE4vyZOyDcOwOsySajeLPc8sNvPJkFlyJd20wpqAzZeAfZ3oWybxd+P/3j+SG3uSBdf2VQAAAABJRU5ErkJggg==') no-repeat; background: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgoKPHN2ZwogICB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iCiAgIHhtbG5zOmNjPSJodHRwOi8vY3JlYXRpdmVjb21tb25zLm9yZy9ucyMiCiAgIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyIKICAgeG1sbnM6c3ZnPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogICB4bWxuczppbmtzY2FwZT0iaHR0cDovL3d3dy5pbmtzY2FwZS5vcmcvbmFtZXNwYWNlcy9pbmtzY2FwZSIKICAgdmVyc2lvbj0iMS4xIgogICB3aWR0aD0iNjgxLjk2MjUyIgogICBoZWlnaHQ9IjE4Ny41IgogICBpZD0ic3ZnMiIKICAgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PG1ldGFkYXRhCiAgICAgaWQ9Im1ldGFkYXRhOCI+PHJkZjpSREY+PGNjOldvcmsKICAgICAgICAgcmRmOmFib3V0PSIiPjxkYzpmb3JtYXQ+aW1hZ2Uvc3ZnK3htbDwvZGM6Zm9ybWF0PjxkYzp0eXBlCiAgICAgICAgICAgcmRmOnJlc291cmNlPSJodHRwOi8vcHVybC5vcmcvZGMvZGNtaXR5cGUvU3RpbGxJbWFnZSIgLz48L2NjOldvcms+PC9yZGY6UkRGPjwvbWV0YWRhdGE+PGRlZnMKICAgICBpZD0iZGVmczYiPjxjbGlwUGF0aAogICAgICAgaWQ9ImNsaXBQYXRoMTgiPjxwYXRoCiAgICAgICAgIGQ9Ik0gMCwxNTAwIDAsMCBsIDU0NTUuNzQsMCAwLDE1MDAgTCAwLDE1MDAgeiIKICAgICAgICAgaW5rc2NhcGU6Y29ubmVjdG9yLWN1cnZhdHVyZT0iMCIKICAgICAgICAgaWQ9InBhdGgyMCIgLz48L2NsaXBQYXRoPjwvZGVmcz48ZwogICAgIHRyYW5zZm9ybT0ibWF0cml4KDEuMjUsMCwwLC0xLjI1LDAsMTg3LjUpIgogICAgIGlkPSJnMTAiPjxnCiAgICAgICB0cmFuc2Zvcm09InNjYWxlKDAuMSwwLjEpIgogICAgICAgaWQ9ImcxMiI+PGcKICAgICAgICAgaWQ9ImcxNCI+PGcKICAgICAgICAgICBjbGlwLXBhdGg9InVybCgjY2xpcFBhdGgxOCkiCiAgICAgICAgICAgaWQ9ImcxNiI+PHBhdGgKICAgICAgICAgICAgIGQ9Im0gMTU0NCw1OTkuNDM0IGMgMC45MiwtNDAuMzUyIDI1LjY4LC04MS42MDIgNzEuNTMsLTgxLjYwMiAyNy41MSwwIDQ3LjY4LDEyLjgzMiA2MS40NCwzNS43NTQgMTIuODMsMjIuOTMgMTIuODMsNTYuODUyIDEyLjgzLDgyLjUyNyBsIDAsMzI5LjE4NCAtNzEuNTIsMCAwLDEwNC41NDMgMjY2LjgzLDAgMCwtMTA0LjU0MyAtNzAuNiwwIDAsLTM0NC43NyBjIDAsLTU4LjY5MSAtMy42OCwtMTA0LjUzMSAtNDQuOTMsLTE1Mi4yMTggLTM2LjY4LC00Mi4xOCAtOTYuMjgsLTY2LjAyIC0xNTMuMTQsLTY2LjAyIC0xMTcuMzcsMCAtMjA3LjI0LDc3Ljk0MSAtMjAyLjY0LDE5Ny4xNDUgbCAxMzAuMiwwIgogICAgICAgICAgICAgaW5rc2NhcGU6Y29ubmVjdG9yLWN1cnZhdHVyZT0iMCIKICAgICAgICAgICAgIGlkPSJwYXRoMjIiCiAgICAgICAgICAgICBzdHlsZT0iZmlsbDojOGE0MTgyO2ZpbGwtb3BhY2l0eToxO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTpub25lIiAvPjxwYXRoCiAgICAgICAgICAgICBkPSJtIDIzMDEuNCw2NjIuNjk1IGMgMCw4MC43MDMgLTY2Ljk0LDE0NS44MTMgLTE0Ny42MywxNDUuODEzIC04My40NCwwIC0xNDcuNjMsLTY4Ljc4MSAtMTQ3LjYzLC0xNTEuMzAxIDAsLTc5Ljc4NSA2Ni45NCwtMTQ1LjgwMSAxNDUuOCwtMTQ1LjgwMSA4NC4zNSwwIDE0OS40Niw2Ny44NTIgMTQ5LjQ2LDE1MS4yODkgeiBtIC0xLjgzLC0xODEuNTQ3IGMgLTM1Ljc3LC01NC4wOTcgLTkzLjUzLC03OC44NTkgLTE1Ny43MiwtNzguODU5IC0xNDAuMywwIC0yNTEuMjQsMTE2LjQ0OSAtMjUxLjI0LDI1NC45MTggMCwxNDIuMTI5IDExMy43LDI2MC40MSAyNTYuNzQsMjYwLjQxIDYzLjI3LDAgMTE4LjI5LC0yOS4zMzYgMTUyLjIyLC04Mi41MjMgbCAwLDY5LjY4NyAxNzUuMTQsMCAwLC0xMDQuNTI3IC02MS40NCwwIDAsLTI4MC41OTggNjEuNDQsMCAwLC0xMDQuNTI3IC0xNzUuMTQsMCAwLDY2LjAxOSIKICAgICAgICAgICAgIGlua3NjYXBlOmNvbm5lY3Rvci1jdXJ2YXR1cmU9IjAiCiAgICAgICAgICAgICBpZD0icGF0aDI0IgogICAgICAgICAgICAgc3R5bGU9ImZpbGw6IzhhNDE4MjtmaWxsLW9wYWNpdHk6MTtmaWxsLXJ1bGU6bm9uemVybztzdHJva2U6bm9uZSIgLz48cGF0aAogICAgICAgICAgICAgZD0ibSAyNjIyLjMzLDU1Ny4yNTggYyAzLjY3LC00NC4wMTYgMzMuMDEsLTczLjM0OCA3OC44NiwtNzMuMzQ4IDMzLjkzLDAgNjYuOTMsMjMuODI0IDY2LjkzLDYwLjUwNCAwLDQ4LjYwNiAtNDUuODQsNTYuODU2IC04My40NCw2Ni45NDEgLTg1LjI4LDIyLjAwNCAtMTc4LjgxLDQ4LjYwNiAtMTc4LjgxLDE1NS44NzkgMCw5My41MzYgNzguODYsMTQ3LjYzMyAxNjUuOTgsMTQ3LjYzMyA0NCwwIDgzLjQzLC05LjE3NiAxMTAuOTQsLTQ0LjAwOCBsIDAsMzMuOTIyIDgyLjUzLDAgMCwtMTMyLjk2NSAtMTA4LjIxLDAgYyAtMS44MywzNC44NTYgLTI4LjQyLDU3Ljc3NCAtNjMuMjYsNTcuNzc0IC0zMC4yNiwwIC02Mi4zNSwtMTcuNDIyIC02Mi4zNSwtNTEuMzQ4IDAsLTQ1Ljg0NyA0NC45MywtNTUuOTMgODAuNjksLTY0LjE4IDg4LjAyLC0yMC4xNzUgMTgyLjQ3LC00Ny42OTUgMTgyLjQ3LC0xNTcuNzM0IDAsLTk5LjAyNyAtODMuNDQsLTE1NC4wMzkgLTE3NS4xMywtMTU0LjAzOSAtNDkuNTMsMCAtOTQuNDYsMTUuNTgyIC0xMjYuNTUsNTMuMTggbCAwLC00MC4zNCAtODUuMjcsMCAwLDE0Mi4xMjkgMTE0LjYyLDAiCiAgICAgICAgICAgICBpbmtzY2FwZTpjb25uZWN0b3ItY3VydmF0dXJlPSIwIgogICAgICAgICAgICAgaWQ9InBhdGgyNiIKICAgICAgICAgICAgIHN0eWxlPSJmaWxsOiM4YTQxODI7ZmlsbC1vcGFjaXR5OjE7ZmlsbC1ydWxlOm5vbnplcm87c3Ryb2tlOm5vbmUiIC8+PHBhdGgKICAgICAgICAgICAgIGQ9Im0gMjk4OC4xOCw4MDAuMjU0IC02My4yNiwwIDAsMTA0LjUyNyAxNjUuMDUsMCAwLC03My4zNTUgYyAzMS4xOCw1MS4zNDcgNzguODYsODUuMjc3IDE0MS4yMSw4NS4yNzcgNjcuODUsMCAxMjQuNzEsLTQxLjI1OCAxNTIuMjEsLTEwMi42OTkgMjYuNiw2Mi4zNTEgOTIuNjIsMTAyLjY5OSAxNjAuNDcsMTAyLjY5OSA1My4xOSwwIDEwNS40NiwtMjIgMTQxLjIxLC02Mi4zNTEgMzguNTIsLTQ0LjkzOCAzOC41MiwtOTMuNTMyIDM4LjUyLC0xNDkuNDU3IGwgMCwtMTg1LjIzOSA2My4yNywwIDAsLTEwNC41MjcgLTIzOC40MiwwIDAsMTA0LjUyNyA2My4yOCwwIDAsMTU3LjcxNSBjIDAsMzIuMTAyIDAsNjAuNTI3IC0xNC42Nyw4OC45NTcgLTE4LjM0LDI2LjU4MiAtNDguNjEsNDAuMzQ0IC03OS43Nyw0MC4zNDQgLTMwLjI2LDAgLTYzLjI4LC0xMi44NDQgLTgyLjUzLC0zNi42NzIgLTIyLjkzLC0yOS4zNTUgLTIyLjkzLC01Ni44NjMgLTIyLjkzLC05Mi42MjkgbCAwLC0xNTcuNzE1IDYzLjI3LDAgMCwtMTA0LjUyNyAtMjM4LjQxLDAgMCwxMDQuNTI3IDYzLjI4LDAgMCwxNTAuMzgzIGMgMCwyOS4zNDggMCw2Ni4wMjMgLTE0LjY3LDkxLjY5OSAtMTUuNTksMjkuMzM2IC00Ny42OSw0NC45MzQgLTgwLjcsNDQuOTM0IC0zMS4xOCwwIC01Ny43NywtMTEuMDA4IC03Ny45NCwtMzUuNzc0IC0yNC43NywtMzAuMjUzIC0yNi42LC02Mi4zNDMgLTI2LjYsLTk5Ljk0MSBsIDAsLTE1MS4zMDEgNjMuMjcsMCAwLC0xMDQuNTI3IC0yMzguNCwwIDAsMTA0LjUyNyA2My4yNiwwIDAsMjgwLjU5OCIKICAgICAgICAgICAgIGlua3NjYXBlOmNvbm5lY3Rvci1jdXJ2YXR1cmU9IjAiCiAgICAgICAgICAgICBpZD0icGF0aDI4IgogICAgICAgICAgICAgc3R5bGU9ImZpbGw6IzhhNDE4MjtmaWxsLW9wYWNpdHk6MTtmaWxsLXJ1bGU6bm9uemVybztzdHJva2U6bm9uZSIgLz48cGF0aAogICAgICAgICAgICAgZD0ibSAzOTk4LjY2LDk1MS41NDcgLTExMS44NywwIDAsMTE4LjI5MyAxMTEuODcsMCAwLC0xMTguMjkzIHogbSAwLC00MzEuODkxIDYzLjI3LDAgMCwtMTA0LjUyNyAtMjM5LjMzLDAgMCwxMDQuNTI3IDY0LjE5LDAgMCwyODAuNTk4IC02My4yNywwIDAsMTA0LjUyNyAxNzUuMTQsMCAwLC0zODUuMTI1IgogICAgICAgICAgICAgaW5rc2NhcGU6Y29ubmVjdG9yLWN1cnZhdHVyZT0iMCIKICAgICAgICAgICAgIGlkPSJwYXRoMzAiCiAgICAgICAgICAgICBzdHlsZT0iZmlsbDojOGE0MTgyO2ZpbGwtb3BhY2l0eToxO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTpub25lIiAvPjxwYXRoCiAgICAgICAgICAgICBkPSJtIDQxNTkuMTIsODAwLjI1NCAtNjMuMjcsMCAwLDEwNC41MjcgMTc1LjE0LDAgMCwtNjkuNjg3IGMgMjkuMzUsNTQuMTAxIDg0LjM2LDgwLjY5OSAxNDQuODcsODAuNjk5IDUzLjE5LDAgMTA1LjQ1LC0yMi4wMTYgMTQxLjIyLC02MC41MjcgNDAuMzQsLTQ0LjkzNCA0MS4yNiwtODguMDMyIDQxLjI2LC0xNDMuOTU3IGwgMCwtMTkxLjY1MyA2My4yNywwIDAsLTEwNC41MjcgLTIzOC40LDAgMCwxMDQuNTI3IDYzLjI2LDAgMCwxNTguNjM3IGMgMCwzMC4yNjIgMCw2MS40MzQgLTE5LjI2LDg4LjAzNSAtMjAuMTcsMjYuNTgyIC01My4xOCwzOS40MTQgLTg2LjE5LDM5LjQxNCAtMzMuOTMsMCAtNjguNzcsLTEzLjc1IC04OC45NCwtNDEuMjUgLTIxLjA5LC0yNy41IC0yMS4wOSwtNjkuNjg3IC0yMS4wOSwtMTAyLjcwNyBsIDAsLTE0Mi4xMjkgNjMuMjYsMCAwLC0xMDQuNTI3IC0yMzguNCwwIDAsMTA0LjUyNyA2My4yNywwIDAsMjgwLjU5OCIKICAgICAgICAgICAgIGlua3NjYXBlOmNvbm5lY3Rvci1jdXJ2YXR1cmU9IjAiCiAgICAgICAgICAgICBpZD0icGF0aDMyIgogICAgICAgICAgICAgc3R5bGU9ImZpbGw6IzhhNDE4MjtmaWxsLW9wYWNpdHk6MTtmaWxsLXJ1bGU6bm9uemVybztzdHJva2U6bm9uZSIgLz48cGF0aAogICAgICAgICAgICAgZD0ibSA1MDgyLjQ4LDcwMy45NjUgYyAtMTkuMjQsNzAuNjA1IC04MS42LDExNS41NDcgLTE1NC4wNCwxMTUuNTQ3IC02Ni4wNCwwIC0xMjkuMywtNTEuMzQ4IC0xNDMuMDUsLTExNS41NDcgbCAyOTcuMDksMCB6IG0gODUuMjcsLTE0NC44ODMgYyAtMzguNTEsLTkzLjUyMyAtMTI5LjI3LC0xNTYuNzkzIC0yMzEuMDUsLTE1Ni43OTMgLTE0My4wNywwIC0yNTcuNjgsMTExLjg3MSAtMjU3LjY4LDI1NS44MzYgMCwxNDQuODgzIDEwOS4xMiwyNjEuMzI4IDI1NC45MSwyNjEuMzI4IDY3Ljg3LDAgMTM1LjcyLC0zMC4yNTggMTgzLjM5LC03OC44NjMgNDguNjIsLTUxLjM0NCA2OC43OSwtMTEzLjY5NSA2OC43OSwtMTgzLjM4MyBsIC0zLjY3LC0zOS40MzQgLTM5Ni4xMywwIGMgMTQuNjcsLTY3Ljg2MyA3Ny4wMywtMTE3LjM2MyAxNDYuNzIsLTExNy4zNjMgNDguNTksMCA5MC43NiwxOC4zMjggMTE4LjI4LDU4LjY3MiBsIDExNi40NCwwIgogICAgICAgICAgICAgaW5rc2NhcGU6Y29ubmVjdG9yLWN1cnZhdHVyZT0iMCIKICAgICAgICAgICAgIGlkPSJwYXRoMzQiCiAgICAgICAgICAgICBzdHlsZT0iZmlsbDojOGE0MTgyO2ZpbGwtb3BhY2l0eToxO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTpub25lIiAvPjxwYXRoCiAgICAgICAgICAgICBkPSJtIDY5MC44OTUsODUwLjcwMyA5MC43NSwwIDIyLjU0MywzMS4wMzUgMCwyNDMuMTIyIC0xMzUuODI5LDAgMCwtMjQzLjE0MSAyMi41MzYsLTMxLjAxNiIKICAgICAgICAgICAgIGlua3NjYXBlOmNvbm5lY3Rvci1jdXJ2YXR1cmU9IjAiCiAgICAgICAgICAgICBpZD0icGF0aDM2IgogICAgICAgICAgICAgc3R5bGU9ImZpbGw6IzhhNDE4MjtmaWxsLW9wYWNpdHk6MTtmaWxsLXJ1bGU6bm9uemVybztzdHJva2U6bm9uZSIgLz48cGF0aAogICAgICAgICAgICAgZD0ibSA2MzIuMzk1LDc0Mi4yNTggMjguMDM5LDg2LjMwNCAtMjIuNTUxLDMxLjA0IC0yMzEuMjIzLDc1LjEyOCAtNDEuOTc2LC0xMjkuMTgzIDIzMS4yNTcsLTc1LjEzNyAzNi40NTQsMTEuODQ4IgogICAgICAgICAgICAgaW5rc2NhcGU6Y29ubmVjdG9yLWN1cnZhdHVyZT0iMCIKICAgICAgICAgICAgIGlkPSJwYXRoMzgiCiAgICAgICAgICAgICBzdHlsZT0iZmlsbDojOGE0MTgyO2ZpbGwtb3BhY2l0eToxO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTpub25lIiAvPjxwYXRoCiAgICAgICAgICAgICBkPSJtIDcxNy40NDksNjUzLjEwNSAtNzMuNDEsNTMuMzYgLTM2LjQ4OCwtMTEuODc1IC0xNDIuOTAzLC0xOTYuNjkyIDEwOS44ODMsLTc5LjgyOCAxNDIuOTE4LDE5Ni43MDMgMCwzOC4zMzIiCiAgICAgICAgICAgICBpbmtzY2FwZTpjb25uZWN0b3ItY3VydmF0dXJlPSIwIgogICAgICAgICAgICAgaWQ9InBhdGg0MCIKICAgICAgICAgICAgIHN0eWxlPSJmaWxsOiM4YTQxODI7ZmlsbC1vcGFjaXR5OjE7ZmlsbC1ydWxlOm5vbnplcm87c3Ryb2tlOm5vbmUiIC8+PHBhdGgKICAgICAgICAgICAgIGQ9Im0gODI4LjUyLDcwNi40NjUgLTczLjQyNiwtNTMuMzQgMC4wMTEsLTM4LjM1OSBMIDg5OC4wMDQsNDE4LjA3IDEwMDcuOSw0OTcuODk4IDg2NC45NzMsNjk0LjYwOSA4MjguNTIsNzA2LjQ2NSIKICAgICAgICAgICAgIGlua3NjYXBlOmNvbm5lY3Rvci1jdXJ2YXR1cmU9IjAiCiAgICAgICAgICAgICBpZD0icGF0aDQyIgogICAgICAgICAgICAgc3R5bGU9ImZpbGw6IzhhNDE4MjtmaWxsLW9wYWNpdHk6MTtmaWxsLXJ1bGU6bm9uemVybztzdHJva2U6bm9uZSIgLz48cGF0aAogICAgICAgICAgICAgZD0ibSA4MTIuMDg2LDgyOC41ODYgMjguMDU1LC04Ni4zMiAzNi40ODQsLTExLjgzNiAyMzEuMjI1LDc1LjExNyAtNDEuOTcsMTI5LjE4MyAtMjMxLjIzOSwtNzUuMTQgLTIyLjU1NSwtMzEuMDA0IgogICAgICAgICAgICAgaW5rc2NhcGU6Y29ubmVjdG9yLWN1cnZhdHVyZT0iMCIKICAgICAgICAgICAgIGlkPSJwYXRoNDQiCiAgICAgICAgICAgICBzdHlsZT0iZmlsbDojOGE0MTgyO2ZpbGwtb3BhY2l0eToxO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTpub25lIiAvPjxwYXRoCiAgICAgICAgICAgICBkPSJtIDczNi4zMDEsMTMzNS44OCBjIC0zMjMuMDQ3LDAgLTU4NS44NzUsLTI2Mi43OCAtNTg1Ljg3NSwtNTg1Ljc4MiAwLC0zMjMuMTE4IDI2Mi44MjgsLTU4NS45NzcgNTg1Ljg3NSwtNTg1Ljk3NyAzMjMuMDE5LDAgNTg1LjgwOSwyNjIuODU5IDU4NS44MDksNTg1Ljk3NyAwLDMyMy4wMDIgLTI2Mi43OSw1ODUuNzgyIC01ODUuODA5LDU4NS43ODIgbCAwLDAgeiBtIDAsLTExOC42MSBjIDI1Ny45NzIsMCA0NjcuMTg5LC0yMDkuMTMgNDY3LjE4OSwtNDY3LjE3MiAwLC0yNTguMTI5IC0yMDkuMjE3LC00NjcuMzQ4IC00NjcuMTg5LC00NjcuMzQ4IC0yNTguMDc0LDAgLTQ2Ny4yNTQsMjA5LjIxOSAtNDY3LjI1NCw0NjcuMzQ4IDAsMjU4LjA0MiAyMDkuMTgsNDY3LjE3MiA0NjcuMjU0LDQ2Ny4xNzIiCiAgICAgICAgICAgICBpbmtzY2FwZTpjb25uZWN0b3ItY3VydmF0dXJlPSIwIgogICAgICAgICAgICAgaWQ9InBhdGg0NiIKICAgICAgICAgICAgIHN0eWxlPSJmaWxsOiM4YTQxODI7ZmlsbC1vcGFjaXR5OjE7ZmlsbC1ydWxlOm5vbnplcm87c3Ryb2tlOm5vbmUiIC8+PHBhdGgKICAgICAgICAgICAgIGQ9Im0gMTA5MS4xMyw2MTkuODgzIC0xNzUuNzcxLDU3LjEyMSAxMS42MjksMzUuODA4IDE3NS43NjIsLTU3LjEyMSAtMTEuNjIsLTM1LjgwOCIKICAgICAgICAgICAgIGlua3NjYXBlOmNvbm5lY3Rvci1jdXJ2YXR1cmU9IjAiCiAgICAgICAgICAgICBpZD0icGF0aDQ4IgogICAgICAgICAgICAgc3R5bGU9ImZpbGw6IzhhNDE4MjtmaWxsLW9wYWNpdHk6MTtmaWxsLXJ1bGU6bm9uemVybztzdHJva2U6bm9uZSIgLz48cGF0aAogICAgICAgICAgICAgZD0iTSA4NjYuOTU3LDkwMi4wNzQgODM2LjUsOTI0LjE5OSA5NDUuMTIxLDEwNzMuNzMgOTc1LjU4NiwxMDUxLjYxIDg2Ni45NTcsOTAyLjA3NCIKICAgICAgICAgICAgIGlua3NjYXBlOmNvbm5lY3Rvci1jdXJ2YXR1cmU9IjAiCiAgICAgICAgICAgICBpZD0icGF0aDUwIgogICAgICAgICAgICAgc3R5bGU9ImZpbGw6IzhhNDE4MjtmaWxsLW9wYWNpdHk6MTtmaWxsLXJ1bGU6bm9uemVybztzdHJva2U6bm9uZSIgLz48cGF0aAogICAgICAgICAgICAgZD0iTSA2MDcuNDY1LDkwMy40NDUgNDk4Ljg1NSwxMDUyLjk3IDUyOS4zMiwxMDc1LjEgNjM3LjkzLDkyNS41NjYgNjA3LjQ2NSw5MDMuNDQ1IgogICAgICAgICAgICAgaW5rc2NhcGU6Y29ubmVjdG9yLWN1cnZhdHVyZT0iMCIKICAgICAgICAgICAgIGlkPSJwYXRoNTIiCiAgICAgICAgICAgICBzdHlsZT0iZmlsbDojOGE0MTgyO2ZpbGwtb3BhY2l0eToxO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTpub25lIiAvPjxwYXRoCiAgICAgICAgICAgICBkPSJtIDM4MC42ODgsNjIyLjEyOSAtMTEuNjI2LDM1LjgwMSAxNzUuNzU4LDU3LjA5IDExLjYyMSwtMzUuODAxIC0xNzUuNzUzLC01Ny4wOSIKICAgICAgICAgICAgIGlua3NjYXBlOmNvbm5lY3Rvci1jdXJ2YXR1cmU9IjAiCiAgICAgICAgICAgICBpZD0icGF0aDU0IgogICAgICAgICAgICAgc3R5bGU9ImZpbGw6IzhhNDE4MjtmaWxsLW9wYWNpdHk6MTtmaWxsLXJ1bGU6bm9uemVybztzdHJva2U6bm9uZSIgLz48cGF0aAogICAgICAgICAgICAgZD0ibSA3MTYuMjg5LDM3Ni41OSAzNy42NDA2LDAgMCwxODQuODE2IC0zNy42NDA2LDAgMCwtMTg0LjgxNiB6IgogICAgICAgICAgICAgaW5rc2NhcGU6Y29ubmVjdG9yLWN1cnZhdHVyZT0iMCIKICAgICAgICAgICAgIGlkPSJwYXRoNTYiCiAgICAgICAgICAgICBzdHlsZT0iZmlsbDojOGE0MTgyO2ZpbGwtb3BhY2l0eToxO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTpub25lIiAvPjwvZz48L2c+PC9nPjwvZz48L3N2Zz4=') no-repeat, none; -moz-background-size: 100%; -o-background-size: 100%; -webkit-background-size: 100%; background-size: 100%; display: block; float: left; width: 90px; height: 25px; } +.jasmine_html-reporter .banner .version { margin-left: 14px; position: relative; top: 6px; } +.jasmine_html-reporter #jasmine_content { position: fixed; right: 100%; } +.jasmine_html-reporter .version { color: #aaa; } +.jasmine_html-reporter .banner { margin-top: 14px; } +.jasmine_html-reporter .duration { color: #fff; float: right; line-height: 28px; padding-right: 9px; } +.jasmine_html-reporter .symbol-summary { overflow: hidden; *zoom: 1; margin: 14px 0; } +.jasmine_html-reporter .symbol-summary li { display: inline-block; height: 8px; width: 14px; font-size: 16px; } +.jasmine_html-reporter .symbol-summary li.passed { font-size: 14px; } +.jasmine_html-reporter .symbol-summary li.passed:before { color: #007069; content: "\02022"; } +.jasmine_html-reporter .symbol-summary li.failed { line-height: 9px; } +.jasmine_html-reporter .symbol-summary li.failed:before { color: #ca3a11; content: "\d7"; font-weight: bold; margin-left: -1px; } +.jasmine_html-reporter .symbol-summary li.disabled { font-size: 14px; } +.jasmine_html-reporter .symbol-summary li.disabled:before { color: #bababa; content: "\02022"; } +.jasmine_html-reporter .symbol-summary li.pending { line-height: 17px; } +.jasmine_html-reporter .symbol-summary li.pending:before { color: #ba9d37; content: "*"; } +.jasmine_html-reporter .symbol-summary li.empty { font-size: 14px; } +.jasmine_html-reporter .symbol-summary li.empty:before { color: #ba9d37; content: "\02022"; } +.jasmine_html-reporter .run-options { float: right; margin-right: 5px; border: 1px solid #8a4182; color: #8a4182; position: relative; line-height: 20px; } +.jasmine_html-reporter .run-options .trigger { cursor: pointer; padding: 8px 16px; } +.jasmine_html-reporter .run-options .payload { position: absolute; display: none; right: -1px; border: 1px solid #8a4182; background-color: #eee; white-space: nowrap; padding: 4px 8px; } +.jasmine_html-reporter .run-options .payload.open { display: block; } +.jasmine_html-reporter .bar { line-height: 28px; font-size: 14px; display: block; color: #eee; } +.jasmine_html-reporter .bar.failed { background-color: #ca3a11; } +.jasmine_html-reporter .bar.passed { background-color: #007069; } +.jasmine_html-reporter .bar.skipped { background-color: #bababa; } +.jasmine_html-reporter .bar.errored { background-color: #ca3a11; } +.jasmine_html-reporter .bar.menu { background-color: #fff; color: #aaa; } +.jasmine_html-reporter .bar.menu a { color: #333; } +.jasmine_html-reporter .bar a { color: white; } +.jasmine_html-reporter.spec-list .bar.menu.failure-list, .jasmine_html-reporter.spec-list .results .failures { display: none; } +.jasmine_html-reporter.failure-list .bar.menu.spec-list, .jasmine_html-reporter.failure-list .summary { display: none; } +.jasmine_html-reporter .results { margin-top: 14px; } +.jasmine_html-reporter .summary { margin-top: 14px; } +.jasmine_html-reporter .summary ul { list-style-type: none; margin-left: 14px; padding-top: 0; padding-left: 0; } +.jasmine_html-reporter .summary ul.suite { margin-top: 7px; margin-bottom: 7px; } +.jasmine_html-reporter .summary li.passed a { color: #007069; } +.jasmine_html-reporter .summary li.failed a { color: #ca3a11; } +.jasmine_html-reporter .summary li.empty a { color: #ba9d37; } +.jasmine_html-reporter .summary li.pending a { color: #ba9d37; } +.jasmine_html-reporter .summary li.disabled a { color: #bababa; } +.jasmine_html-reporter .description + .suite { margin-top: 0; } +.jasmine_html-reporter .suite { margin-top: 14px; } +.jasmine_html-reporter .suite a { color: #333; } +.jasmine_html-reporter .failures .spec-detail { margin-bottom: 28px; } +.jasmine_html-reporter .failures .spec-detail .description { background-color: #ca3a11; } +.jasmine_html-reporter .failures .spec-detail .description a { color: white; } +.jasmine_html-reporter .result-message { padding-top: 14px; color: #333; white-space: pre; } +.jasmine_html-reporter .result-message span.result { display: block; } +.jasmine_html-reporter .stack-trace { margin: 5px 0 0 0; max-height: 224px; overflow: auto; line-height: 18px; color: #666; border: 1px solid #ddd; background: white; white-space: pre; } diff --git a/dashboard-ui/bower_components/fingerprintjs2/specs/lib/jasmine-2.3.4/jasmine.js b/dashboard-ui/bower_components/fingerprintjs2/specs/lib/jasmine-2.3.4/jasmine.js new file mode 100644 index 000000000..312d591e1 --- /dev/null +++ b/dashboard-ui/bower_components/fingerprintjs2/specs/lib/jasmine-2.3.4/jasmine.js @@ -0,0 +1,3298 @@ +/* +Copyright (c) 2008-2015 Pivotal Labs + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ +var getJasmineRequireObj = (function (jasmineGlobal) { + var jasmineRequire; + + if (typeof module !== 'undefined' && module.exports) { + jasmineGlobal = global; + jasmineRequire = exports; + } else { + if (typeof window !== 'undefined' && typeof window.toString === 'function' && window.toString() === '[object GjsGlobal]') { + jasmineGlobal = window; + } + jasmineRequire = jasmineGlobal.jasmineRequire = jasmineGlobal.jasmineRequire || {}; + } + + function getJasmineRequire() { + return jasmineRequire; + } + + getJasmineRequire().core = function(jRequire) { + var j$ = {}; + + jRequire.base(j$, jasmineGlobal); + j$.util = jRequire.util(); + j$.errors = jRequire.errors(); + j$.Any = jRequire.Any(j$); + j$.Anything = jRequire.Anything(j$); + j$.CallTracker = jRequire.CallTracker(); + j$.MockDate = jRequire.MockDate(); + j$.Clock = jRequire.Clock(); + j$.DelayedFunctionScheduler = jRequire.DelayedFunctionScheduler(); + j$.Env = jRequire.Env(j$); + j$.ExceptionFormatter = jRequire.ExceptionFormatter(); + j$.Expectation = jRequire.Expectation(); + j$.buildExpectationResult = jRequire.buildExpectationResult(); + j$.JsApiReporter = jRequire.JsApiReporter(); + j$.matchersUtil = jRequire.matchersUtil(j$); + j$.ObjectContaining = jRequire.ObjectContaining(j$); + j$.ArrayContaining = jRequire.ArrayContaining(j$); + j$.pp = jRequire.pp(j$); + j$.QueueRunner = jRequire.QueueRunner(j$); + j$.ReportDispatcher = jRequire.ReportDispatcher(); + j$.Spec = jRequire.Spec(j$); + j$.SpyRegistry = jRequire.SpyRegistry(j$); + j$.SpyStrategy = jRequire.SpyStrategy(); + j$.StringMatching = jRequire.StringMatching(j$); + j$.Suite = jRequire.Suite(j$); + j$.Timer = jRequire.Timer(); + j$.TreeProcessor = jRequire.TreeProcessor(); + j$.version = jRequire.version(); + + j$.matchers = jRequire.requireMatchers(jRequire, j$); + + return j$; + }; + + return getJasmineRequire; +})(this); + +getJasmineRequireObj().requireMatchers = function(jRequire, j$) { + var availableMatchers = [ + 'toBe', + 'toBeCloseTo', + 'toBeDefined', + 'toBeFalsy', + 'toBeGreaterThan', + 'toBeLessThan', + 'toBeNaN', + 'toBeNull', + 'toBeTruthy', + 'toBeUndefined', + 'toContain', + 'toEqual', + 'toHaveBeenCalled', + 'toHaveBeenCalledWith', + 'toMatch', + 'toThrow', + 'toThrowError' + ], + matchers = {}; + + for (var i = 0; i < availableMatchers.length; i++) { + var name = availableMatchers[i]; + matchers[name] = jRequire[name](j$); + } + + return matchers; +}; + +getJasmineRequireObj().base = function(j$, jasmineGlobal) { + j$.unimplementedMethod_ = function() { + throw new Error('unimplemented method'); + }; + + j$.MAX_PRETTY_PRINT_DEPTH = 40; + j$.MAX_PRETTY_PRINT_ARRAY_LENGTH = 100; + j$.DEFAULT_TIMEOUT_INTERVAL = 5000; + + j$.getGlobal = function() { + return jasmineGlobal; + }; + + j$.getEnv = function(options) { + var env = j$.currentEnv_ = j$.currentEnv_ || new j$.Env(options); + //jasmine. singletons in here (setTimeout blah blah). + return env; + }; + + j$.isArray_ = function(value) { + return j$.isA_('Array', value); + }; + + j$.isString_ = function(value) { + return j$.isA_('String', value); + }; + + j$.isNumber_ = function(value) { + return j$.isA_('Number', value); + }; + + j$.isA_ = function(typeName, value) { + return Object.prototype.toString.apply(value) === '[object ' + typeName + ']'; + }; + + j$.isDomNode = function(obj) { + return obj.nodeType > 0; + }; + + j$.fnNameFor = function(func) { + return func.name || func.toString().match(/^\s*function\s*(\w*)\s*\(/)[1]; + }; + + j$.any = function(clazz) { + return new j$.Any(clazz); + }; + + j$.anything = function() { + return new j$.Anything(); + }; + + j$.objectContaining = function(sample) { + return new j$.ObjectContaining(sample); + }; + + j$.stringMatching = function(expected) { + return new j$.StringMatching(expected); + }; + + j$.arrayContaining = function(sample) { + return new j$.ArrayContaining(sample); + }; + + j$.createSpy = function(name, originalFn) { + + var spyStrategy = new j$.SpyStrategy({ + name: name, + fn: originalFn, + getSpy: function() { return spy; } + }), + callTracker = new j$.CallTracker(), + spy = function() { + var callData = { + object: this, + args: Array.prototype.slice.apply(arguments) + }; + + callTracker.track(callData); + var returnValue = spyStrategy.exec.apply(this, arguments); + callData.returnValue = returnValue; + + return returnValue; + }; + + for (var prop in originalFn) { + if (prop === 'and' || prop === 'calls') { + throw new Error('Jasmine spies would overwrite the \'and\' and \'calls\' properties on the object being spied upon'); + } + + spy[prop] = originalFn[prop]; + } + + spy.and = spyStrategy; + spy.calls = callTracker; + + return spy; + }; + + j$.isSpy = function(putativeSpy) { + if (!putativeSpy) { + return false; + } + return putativeSpy.and instanceof j$.SpyStrategy && + putativeSpy.calls instanceof j$.CallTracker; + }; + + j$.createSpyObj = function(baseName, methodNames) { + if (j$.isArray_(baseName) && j$.util.isUndefined(methodNames)) { + methodNames = baseName; + baseName = 'unknown'; + } + + if (!j$.isArray_(methodNames) || methodNames.length === 0) { + throw 'createSpyObj requires a non-empty array of method names to create spies for'; + } + var obj = {}; + for (var i = 0; i < methodNames.length; i++) { + obj[methodNames[i]] = j$.createSpy(baseName + '.' + methodNames[i]); + } + return obj; + }; +}; + +getJasmineRequireObj().util = function() { + + var util = {}; + + util.inherit = function(childClass, parentClass) { + var Subclass = function() { + }; + Subclass.prototype = parentClass.prototype; + childClass.prototype = new Subclass(); + }; + + util.htmlEscape = function(str) { + if (!str) { + return str; + } + return str.replace(/&/g, '&') + .replace(//g, '>'); + }; + + util.argsToArray = function(args) { + var arrayOfArgs = []; + for (var i = 0; i < args.length; i++) { + arrayOfArgs.push(args[i]); + } + return arrayOfArgs; + }; + + util.isUndefined = function(obj) { + return obj === void 0; + }; + + util.arrayContains = function(array, search) { + var i = array.length; + while (i--) { + if (array[i] === search) { + return true; + } + } + return false; + }; + + util.clone = function(obj) { + if (Object.prototype.toString.apply(obj) === '[object Array]') { + return obj.slice(); + } + + var cloned = {}; + for (var prop in obj) { + if (obj.hasOwnProperty(prop)) { + cloned[prop] = obj[prop]; + } + } + + return cloned; + }; + + return util; +}; + +getJasmineRequireObj().Spec = function(j$) { + function Spec(attrs) { + this.expectationFactory = attrs.expectationFactory; + this.resultCallback = attrs.resultCallback || function() {}; + this.id = attrs.id; + this.description = attrs.description || ''; + this.queueableFn = attrs.queueableFn; + this.beforeAndAfterFns = attrs.beforeAndAfterFns || function() { return {befores: [], afters: []}; }; + this.userContext = attrs.userContext || function() { return {}; }; + this.onStart = attrs.onStart || function() {}; + this.getSpecName = attrs.getSpecName || function() { return ''; }; + this.expectationResultFactory = attrs.expectationResultFactory || function() { }; + this.queueRunnerFactory = attrs.queueRunnerFactory || function() {}; + this.catchingExceptions = attrs.catchingExceptions || function() { return true; }; + this.throwOnExpectationFailure = !!attrs.throwOnExpectationFailure; + + if (!this.queueableFn.fn) { + this.pend(); + } + + this.result = { + id: this.id, + description: this.description, + fullName: this.getFullName(), + failedExpectations: [], + passedExpectations: [], + pendingReason: '' + }; + } + + Spec.prototype.addExpectationResult = function(passed, data, isError) { + var expectationResult = this.expectationResultFactory(data); + if (passed) { + this.result.passedExpectations.push(expectationResult); + } else { + this.result.failedExpectations.push(expectationResult); + + if (this.throwOnExpectationFailure && !isError) { + throw new j$.errors.ExpectationFailed(); + } + } + }; + + Spec.prototype.expect = function(actual) { + return this.expectationFactory(actual, this); + }; + + Spec.prototype.execute = function(onComplete, enabled) { + var self = this; + + this.onStart(this); + + if (!this.isExecutable() || this.markedPending || enabled === false) { + complete(enabled); + return; + } + + var fns = this.beforeAndAfterFns(); + var allFns = fns.befores.concat(this.queueableFn).concat(fns.afters); + + this.queueRunnerFactory({ + queueableFns: allFns, + onException: function() { self.onException.apply(self, arguments); }, + onComplete: complete, + userContext: this.userContext() + }); + + function complete(enabledAgain) { + self.result.status = self.status(enabledAgain); + self.resultCallback(self.result); + + if (onComplete) { + onComplete(); + } + } + }; + + Spec.prototype.onException = function onException(e) { + if (Spec.isPendingSpecException(e)) { + this.pend(extractCustomPendingMessage(e)); + return; + } + + if (e instanceof j$.errors.ExpectationFailed) { + return; + } + + this.addExpectationResult(false, { + matcherName: '', + passed: false, + expected: '', + actual: '', + error: e + }, true); + }; + + Spec.prototype.disable = function() { + this.disabled = true; + }; + + Spec.prototype.pend = function(message) { + this.markedPending = true; + if (message) { + this.result.pendingReason = message; + } + }; + + Spec.prototype.getResult = function() { + this.result.status = this.status(); + return this.result; + }; + + Spec.prototype.status = function(enabled) { + if (this.disabled || enabled === false) { + return 'disabled'; + } + + if (this.markedPending) { + return 'pending'; + } + + if (this.result.failedExpectations.length > 0) { + return 'failed'; + } else { + return 'passed'; + } + }; + + Spec.prototype.isExecutable = function() { + return !this.disabled; + }; + + Spec.prototype.getFullName = function() { + return this.getSpecName(this); + }; + + var extractCustomPendingMessage = function(e) { + var fullMessage = e.toString(), + boilerplateStart = fullMessage.indexOf(Spec.pendingSpecExceptionMessage), + boilerplateEnd = boilerplateStart + Spec.pendingSpecExceptionMessage.length; + + return fullMessage.substr(boilerplateEnd); + }; + + Spec.pendingSpecExceptionMessage = '=> marked Pending'; + + Spec.isPendingSpecException = function(e) { + return !!(e && e.toString && e.toString().indexOf(Spec.pendingSpecExceptionMessage) !== -1); + }; + + return Spec; +}; + +if (typeof window == void 0 && typeof exports == 'object') { + exports.Spec = jasmineRequire.Spec; +} + +getJasmineRequireObj().Env = function(j$) { + function Env(options) { + options = options || {}; + + var self = this; + var global = options.global || j$.getGlobal(); + + var totalSpecsDefined = 0; + + var catchExceptions = true; + + var realSetTimeout = j$.getGlobal().setTimeout; + var realClearTimeout = j$.getGlobal().clearTimeout; + this.clock = new j$.Clock(global, function () { return new j$.DelayedFunctionScheduler(); }, new j$.MockDate(global)); + + var runnableLookupTable = {}; + var runnableResources = {}; + + var currentSpec = null; + var currentlyExecutingSuites = []; + var currentDeclarationSuite = null; + var throwOnExpectationFailure = false; + + var currentSuite = function() { + return currentlyExecutingSuites[currentlyExecutingSuites.length - 1]; + }; + + var currentRunnable = function() { + return currentSpec || currentSuite(); + }; + + var reporter = new j$.ReportDispatcher([ + 'jasmineStarted', + 'jasmineDone', + 'suiteStarted', + 'suiteDone', + 'specStarted', + 'specDone' + ]); + + this.specFilter = function() { + return true; + }; + + this.addCustomEqualityTester = function(tester) { + if(!currentRunnable()) { + throw new Error('Custom Equalities must be added in a before function or a spec'); + } + runnableResources[currentRunnable().id].customEqualityTesters.push(tester); + }; + + this.addMatchers = function(matchersToAdd) { + if(!currentRunnable()) { + throw new Error('Matchers must be added in a before function or a spec'); + } + var customMatchers = runnableResources[currentRunnable().id].customMatchers; + for (var matcherName in matchersToAdd) { + customMatchers[matcherName] = matchersToAdd[matcherName]; + } + }; + + j$.Expectation.addCoreMatchers(j$.matchers); + + var nextSpecId = 0; + var getNextSpecId = function() { + return 'spec' + nextSpecId++; + }; + + var nextSuiteId = 0; + var getNextSuiteId = function() { + return 'suite' + nextSuiteId++; + }; + + var expectationFactory = function(actual, spec) { + return j$.Expectation.Factory({ + util: j$.matchersUtil, + customEqualityTesters: runnableResources[spec.id].customEqualityTesters, + customMatchers: runnableResources[spec.id].customMatchers, + actual: actual, + addExpectationResult: addExpectationResult + }); + + function addExpectationResult(passed, result) { + return spec.addExpectationResult(passed, result); + } + }; + + var defaultResourcesForRunnable = function(id, parentRunnableId) { + var resources = {spies: [], customEqualityTesters: [], customMatchers: {}}; + + if(runnableResources[parentRunnableId]){ + resources.customEqualityTesters = j$.util.clone(runnableResources[parentRunnableId].customEqualityTesters); + resources.customMatchers = j$.util.clone(runnableResources[parentRunnableId].customMatchers); + } + + runnableResources[id] = resources; + }; + + var clearResourcesForRunnable = function(id) { + spyRegistry.clearSpies(); + delete runnableResources[id]; + }; + + var beforeAndAfterFns = function(suite) { + return function() { + var befores = [], + afters = []; + + while(suite) { + befores = befores.concat(suite.beforeFns); + afters = afters.concat(suite.afterFns); + + suite = suite.parentSuite; + } + + return { + befores: befores.reverse(), + afters: afters + }; + }; + }; + + var getSpecName = function(spec, suite) { + return suite.getFullName() + ' ' + spec.description; + }; + + // TODO: we may just be able to pass in the fn instead of wrapping here + var buildExpectationResult = j$.buildExpectationResult, + exceptionFormatter = new j$.ExceptionFormatter(), + expectationResultFactory = function(attrs) { + attrs.messageFormatter = exceptionFormatter.message; + attrs.stackFormatter = exceptionFormatter.stack; + + return buildExpectationResult(attrs); + }; + + // TODO: fix this naming, and here's where the value comes in + this.catchExceptions = function(value) { + catchExceptions = !!value; + return catchExceptions; + }; + + this.catchingExceptions = function() { + return catchExceptions; + }; + + var maximumSpecCallbackDepth = 20; + var currentSpecCallbackDepth = 0; + + function clearStack(fn) { + currentSpecCallbackDepth++; + if (currentSpecCallbackDepth >= maximumSpecCallbackDepth) { + currentSpecCallbackDepth = 0; + realSetTimeout(fn, 0); + } else { + fn(); + } + } + + var catchException = function(e) { + return j$.Spec.isPendingSpecException(e) || catchExceptions; + }; + + this.throwOnExpectationFailure = function(value) { + throwOnExpectationFailure = !!value; + }; + + this.throwingExpectationFailures = function() { + return throwOnExpectationFailure; + }; + + var queueRunnerFactory = function(options) { + options.catchException = catchException; + options.clearStack = options.clearStack || clearStack; + options.timeout = {setTimeout: realSetTimeout, clearTimeout: realClearTimeout}; + options.fail = self.fail; + + new j$.QueueRunner(options).execute(); + }; + + var topSuite = new j$.Suite({ + env: this, + id: getNextSuiteId(), + description: 'Jasmine__TopLevel__Suite', + queueRunner: queueRunnerFactory + }); + runnableLookupTable[topSuite.id] = topSuite; + defaultResourcesForRunnable(topSuite.id); + currentDeclarationSuite = topSuite; + + this.topSuite = function() { + return topSuite; + }; + + this.execute = function(runnablesToRun) { + if(!runnablesToRun) { + if (focusedRunnables.length) { + runnablesToRun = focusedRunnables; + } else { + runnablesToRun = [topSuite.id]; + } + } + var processor = new j$.TreeProcessor({ + tree: topSuite, + runnableIds: runnablesToRun, + queueRunnerFactory: queueRunnerFactory, + nodeStart: function(suite) { + currentlyExecutingSuites.push(suite); + defaultResourcesForRunnable(suite.id, suite.parentSuite.id); + reporter.suiteStarted(suite.result); + }, + nodeComplete: function(suite, result) { + if (!suite.disabled) { + clearResourcesForRunnable(suite.id); + } + currentlyExecutingSuites.pop(); + reporter.suiteDone(result); + } + }); + + if(!processor.processTree().valid) { + throw new Error('Invalid order: would cause a beforeAll or afterAll to be run multiple times'); + } + + reporter.jasmineStarted({ + totalSpecsDefined: totalSpecsDefined + }); + + processor.execute(reporter.jasmineDone); + }; + + this.addReporter = function(reporterToAdd) { + reporter.addReporter(reporterToAdd); + }; + + var spyRegistry = new j$.SpyRegistry({currentSpies: function() { + if(!currentRunnable()) { + throw new Error('Spies must be created in a before function or a spec'); + } + return runnableResources[currentRunnable().id].spies; + }}); + + this.spyOn = function() { + return spyRegistry.spyOn.apply(spyRegistry, arguments); + }; + + var suiteFactory = function(description) { + var suite = new j$.Suite({ + env: self, + id: getNextSuiteId(), + description: description, + parentSuite: currentDeclarationSuite, + expectationFactory: expectationFactory, + expectationResultFactory: expectationResultFactory, + throwOnExpectationFailure: throwOnExpectationFailure + }); + + runnableLookupTable[suite.id] = suite; + return suite; + }; + + this.describe = function(description, specDefinitions) { + var suite = suiteFactory(description); + addSpecsToSuite(suite, specDefinitions); + return suite; + }; + + this.xdescribe = function(description, specDefinitions) { + var suite = this.describe(description, specDefinitions); + suite.disable(); + return suite; + }; + + var focusedRunnables = []; + + this.fdescribe = function(description, specDefinitions) { + var suite = suiteFactory(description); + suite.isFocused = true; + + focusedRunnables.push(suite.id); + unfocusAncestor(); + addSpecsToSuite(suite, specDefinitions); + + return suite; + }; + + function addSpecsToSuite(suite, specDefinitions) { + var parentSuite = currentDeclarationSuite; + parentSuite.addChild(suite); + currentDeclarationSuite = suite; + + var declarationError = null; + try { + specDefinitions.call(suite); + } catch (e) { + declarationError = e; + } + + if (declarationError) { + self.it('encountered a declaration exception', function() { + throw declarationError; + }); + } + + currentDeclarationSuite = parentSuite; + } + + function findFocusedAncestor(suite) { + while (suite) { + if (suite.isFocused) { + return suite.id; + } + suite = suite.parentSuite; + } + + return null; + } + + function unfocusAncestor() { + var focusedAncestor = findFocusedAncestor(currentDeclarationSuite); + if (focusedAncestor) { + for (var i = 0; i < focusedRunnables.length; i++) { + if (focusedRunnables[i] === focusedAncestor) { + focusedRunnables.splice(i, 1); + break; + } + } + } + } + + var specFactory = function(description, fn, suite, timeout) { + totalSpecsDefined++; + var spec = new j$.Spec({ + id: getNextSpecId(), + beforeAndAfterFns: beforeAndAfterFns(suite), + expectationFactory: expectationFactory, + resultCallback: specResultCallback, + getSpecName: function(spec) { + return getSpecName(spec, suite); + }, + onStart: specStarted, + description: description, + expectationResultFactory: expectationResultFactory, + queueRunnerFactory: queueRunnerFactory, + userContext: function() { return suite.clonedSharedUserContext(); }, + queueableFn: { + fn: fn, + timeout: function() { return timeout || j$.DEFAULT_TIMEOUT_INTERVAL; } + }, + throwOnExpectationFailure: throwOnExpectationFailure + }); + + runnableLookupTable[spec.id] = spec; + + if (!self.specFilter(spec)) { + spec.disable(); + } + + return spec; + + function specResultCallback(result) { + clearResourcesForRunnable(spec.id); + currentSpec = null; + reporter.specDone(result); + } + + function specStarted(spec) { + currentSpec = spec; + defaultResourcesForRunnable(spec.id, suite.id); + reporter.specStarted(spec.result); + } + }; + + this.it = function(description, fn, timeout) { + var spec = specFactory(description, fn, currentDeclarationSuite, timeout); + currentDeclarationSuite.addChild(spec); + return spec; + }; + + this.xit = function() { + var spec = this.it.apply(this, arguments); + spec.pend(); + return spec; + }; + + this.fit = function(){ + var spec = this.it.apply(this, arguments); + + focusedRunnables.push(spec.id); + unfocusAncestor(); + return spec; + }; + + this.expect = function(actual) { + if (!currentRunnable()) { + throw new Error('\'expect\' was used when there was no current spec, this could be because an asynchronous test timed out'); + } + + return currentRunnable().expect(actual); + }; + + this.beforeEach = function(beforeEachFunction, timeout) { + currentDeclarationSuite.beforeEach({ + fn: beforeEachFunction, + timeout: function() { return timeout || j$.DEFAULT_TIMEOUT_INTERVAL; } + }); + }; + + this.beforeAll = function(beforeAllFunction, timeout) { + currentDeclarationSuite.beforeAll({ + fn: beforeAllFunction, + timeout: function() { return timeout || j$.DEFAULT_TIMEOUT_INTERVAL; } + }); + }; + + this.afterEach = function(afterEachFunction, timeout) { + currentDeclarationSuite.afterEach({ + fn: afterEachFunction, + timeout: function() { return timeout || j$.DEFAULT_TIMEOUT_INTERVAL; } + }); + }; + + this.afterAll = function(afterAllFunction, timeout) { + currentDeclarationSuite.afterAll({ + fn: afterAllFunction, + timeout: function() { return timeout || j$.DEFAULT_TIMEOUT_INTERVAL; } + }); + }; + + this.pending = function(message) { + var fullMessage = j$.Spec.pendingSpecExceptionMessage; + if(message) { + fullMessage += message; + } + throw fullMessage; + }; + + this.fail = function(error) { + var message = 'Failed'; + if (error) { + message += ': '; + message += error.message || error; + } + + currentRunnable().addExpectationResult(false, { + matcherName: '', + passed: false, + expected: '', + actual: '', + message: message, + error: error && error.message ? error : null + }); + }; + } + + return Env; +}; + +getJasmineRequireObj().JsApiReporter = function() { + + var noopTimer = { + start: function(){}, + elapsed: function(){ return 0; } + }; + + function JsApiReporter(options) { + var timer = options.timer || noopTimer, + status = 'loaded'; + + this.started = false; + this.finished = false; + + this.jasmineStarted = function() { + this.started = true; + status = 'started'; + timer.start(); + }; + + var executionTime; + + this.jasmineDone = function() { + this.finished = true; + executionTime = timer.elapsed(); + status = 'done'; + }; + + this.status = function() { + return status; + }; + + var suites = [], + suites_hash = {}; + + this.suiteStarted = function(result) { + suites_hash[result.id] = result; + }; + + this.suiteDone = function(result) { + storeSuite(result); + }; + + this.suiteResults = function(index, length) { + return suites.slice(index, index + length); + }; + + function storeSuite(result) { + suites.push(result); + suites_hash[result.id] = result; + } + + this.suites = function() { + return suites_hash; + }; + + var specs = []; + + this.specDone = function(result) { + specs.push(result); + }; + + this.specResults = function(index, length) { + return specs.slice(index, index + length); + }; + + this.specs = function() { + return specs; + }; + + this.executionTime = function() { + return executionTime; + }; + + } + + return JsApiReporter; +}; + +getJasmineRequireObj().CallTracker = function() { + + function CallTracker() { + var calls = []; + + this.track = function(context) { + calls.push(context); + }; + + this.any = function() { + return !!calls.length; + }; + + this.count = function() { + return calls.length; + }; + + this.argsFor = function(index) { + var call = calls[index]; + return call ? call.args : []; + }; + + this.all = function() { + return calls; + }; + + this.allArgs = function() { + var callArgs = []; + for(var i = 0; i < calls.length; i++){ + callArgs.push(calls[i].args); + } + + return callArgs; + }; + + this.first = function() { + return calls[0]; + }; + + this.mostRecent = function() { + return calls[calls.length - 1]; + }; + + this.reset = function() { + calls = []; + }; + } + + return CallTracker; +}; + +getJasmineRequireObj().Clock = function() { + function Clock(global, delayedFunctionSchedulerFactory, mockDate) { + var self = this, + realTimingFunctions = { + setTimeout: global.setTimeout, + clearTimeout: global.clearTimeout, + setInterval: global.setInterval, + clearInterval: global.clearInterval + }, + fakeTimingFunctions = { + setTimeout: setTimeout, + clearTimeout: clearTimeout, + setInterval: setInterval, + clearInterval: clearInterval + }, + installed = false, + delayedFunctionScheduler, + timer; + + + self.install = function() { + if(!originalTimingFunctionsIntact()) { + throw new Error('Jasmine Clock was unable to install over custom global timer functions. Is the clock already installed?'); + } + replace(global, fakeTimingFunctions); + timer = fakeTimingFunctions; + delayedFunctionScheduler = delayedFunctionSchedulerFactory(); + installed = true; + + return self; + }; + + self.uninstall = function() { + delayedFunctionScheduler = null; + mockDate.uninstall(); + replace(global, realTimingFunctions); + + timer = realTimingFunctions; + installed = false; + }; + + self.withMock = function(closure) { + this.install(); + try { + closure(); + } finally { + this.uninstall(); + } + }; + + self.mockDate = function(initialDate) { + mockDate.install(initialDate); + }; + + self.setTimeout = function(fn, delay, params) { + if (legacyIE()) { + if (arguments.length > 2) { + throw new Error('IE < 9 cannot support extra params to setTimeout without a polyfill'); + } + return timer.setTimeout(fn, delay); + } + return Function.prototype.apply.apply(timer.setTimeout, [global, arguments]); + }; + + self.setInterval = function(fn, delay, params) { + if (legacyIE()) { + if (arguments.length > 2) { + throw new Error('IE < 9 cannot support extra params to setInterval without a polyfill'); + } + return timer.setInterval(fn, delay); + } + return Function.prototype.apply.apply(timer.setInterval, [global, arguments]); + }; + + self.clearTimeout = function(id) { + return Function.prototype.call.apply(timer.clearTimeout, [global, id]); + }; + + self.clearInterval = function(id) { + return Function.prototype.call.apply(timer.clearInterval, [global, id]); + }; + + self.tick = function(millis) { + if (installed) { + mockDate.tick(millis); + delayedFunctionScheduler.tick(millis); + } else { + throw new Error('Mock clock is not installed, use jasmine.clock().install()'); + } + }; + + return self; + + function originalTimingFunctionsIntact() { + return global.setTimeout === realTimingFunctions.setTimeout && + global.clearTimeout === realTimingFunctions.clearTimeout && + global.setInterval === realTimingFunctions.setInterval && + global.clearInterval === realTimingFunctions.clearInterval; + } + + function legacyIE() { + //if these methods are polyfilled, apply will be present + return !(realTimingFunctions.setTimeout || realTimingFunctions.setInterval).apply; + } + + function replace(dest, source) { + for (var prop in source) { + dest[prop] = source[prop]; + } + } + + function setTimeout(fn, delay) { + return delayedFunctionScheduler.scheduleFunction(fn, delay, argSlice(arguments, 2)); + } + + function clearTimeout(id) { + return delayedFunctionScheduler.removeFunctionWithId(id); + } + + function setInterval(fn, interval) { + return delayedFunctionScheduler.scheduleFunction(fn, interval, argSlice(arguments, 2), true); + } + + function clearInterval(id) { + return delayedFunctionScheduler.removeFunctionWithId(id); + } + + function argSlice(argsObj, n) { + return Array.prototype.slice.call(argsObj, n); + } + } + + return Clock; +}; + +getJasmineRequireObj().DelayedFunctionScheduler = function() { + function DelayedFunctionScheduler() { + var self = this; + var scheduledLookup = []; + var scheduledFunctions = {}; + var currentTime = 0; + var delayedFnCount = 0; + + self.tick = function(millis) { + millis = millis || 0; + var endTime = currentTime + millis; + + runScheduledFunctions(endTime); + currentTime = endTime; + }; + + self.scheduleFunction = function(funcToCall, millis, params, recurring, timeoutKey, runAtMillis) { + var f; + if (typeof(funcToCall) === 'string') { + /* jshint evil: true */ + f = function() { return eval(funcToCall); }; + /* jshint evil: false */ + } else { + f = funcToCall; + } + + millis = millis || 0; + timeoutKey = timeoutKey || ++delayedFnCount; + runAtMillis = runAtMillis || (currentTime + millis); + + var funcToSchedule = { + runAtMillis: runAtMillis, + funcToCall: f, + recurring: recurring, + params: params, + timeoutKey: timeoutKey, + millis: millis + }; + + if (runAtMillis in scheduledFunctions) { + scheduledFunctions[runAtMillis].push(funcToSchedule); + } else { + scheduledFunctions[runAtMillis] = [funcToSchedule]; + scheduledLookup.push(runAtMillis); + scheduledLookup.sort(function (a, b) { + return a - b; + }); + } + + return timeoutKey; + }; + + self.removeFunctionWithId = function(timeoutKey) { + for (var runAtMillis in scheduledFunctions) { + var funcs = scheduledFunctions[runAtMillis]; + var i = indexOfFirstToPass(funcs, function (func) { + return func.timeoutKey === timeoutKey; + }); + + if (i > -1) { + if (funcs.length === 1) { + delete scheduledFunctions[runAtMillis]; + deleteFromLookup(runAtMillis); + } else { + funcs.splice(i, 1); + } + + // intervals get rescheduled when executed, so there's never more + // than a single scheduled function with a given timeoutKey + break; + } + } + }; + + return self; + + function indexOfFirstToPass(array, testFn) { + var index = -1; + + for (var i = 0; i < array.length; ++i) { + if (testFn(array[i])) { + index = i; + break; + } + } + + return index; + } + + function deleteFromLookup(key) { + var value = Number(key); + var i = indexOfFirstToPass(scheduledLookup, function (millis) { + return millis === value; + }); + + if (i > -1) { + scheduledLookup.splice(i, 1); + } + } + + function reschedule(scheduledFn) { + self.scheduleFunction(scheduledFn.funcToCall, + scheduledFn.millis, + scheduledFn.params, + true, + scheduledFn.timeoutKey, + scheduledFn.runAtMillis + scheduledFn.millis); + } + + function forEachFunction(funcsToRun, callback) { + for (var i = 0; i < funcsToRun.length; ++i) { + callback(funcsToRun[i]); + } + } + + function runScheduledFunctions(endTime) { + if (scheduledLookup.length === 0 || scheduledLookup[0] > endTime) { + return; + } + + do { + currentTime = scheduledLookup.shift(); + + var funcsToRun = scheduledFunctions[currentTime]; + delete scheduledFunctions[currentTime]; + + forEachFunction(funcsToRun, function(funcToRun) { + if (funcToRun.recurring) { + reschedule(funcToRun); + } + }); + + forEachFunction(funcsToRun, function(funcToRun) { + funcToRun.funcToCall.apply(null, funcToRun.params || []); + }); + } while (scheduledLookup.length > 0 && + // checking first if we're out of time prevents setTimeout(0) + // scheduled in a funcToRun from forcing an extra iteration + currentTime !== endTime && + scheduledLookup[0] <= endTime); + } + } + + return DelayedFunctionScheduler; +}; + +getJasmineRequireObj().ExceptionFormatter = function() { + function ExceptionFormatter() { + this.message = function(error) { + var message = ''; + + if (error.name && error.message) { + message += error.name + ': ' + error.message; + } else { + message += error.toString() + ' thrown'; + } + + if (error.fileName || error.sourceURL) { + message += ' in ' + (error.fileName || error.sourceURL); + } + + if (error.line || error.lineNumber) { + message += ' (line ' + (error.line || error.lineNumber) + ')'; + } + + return message; + }; + + this.stack = function(error) { + return error ? error.stack : null; + }; + } + + return ExceptionFormatter; +}; + +getJasmineRequireObj().Expectation = function() { + + function Expectation(options) { + this.util = options.util || { buildFailureMessage: function() {} }; + this.customEqualityTesters = options.customEqualityTesters || []; + this.actual = options.actual; + this.addExpectationResult = options.addExpectationResult || function(){}; + this.isNot = options.isNot; + + var customMatchers = options.customMatchers || {}; + for (var matcherName in customMatchers) { + this[matcherName] = Expectation.prototype.wrapCompare(matcherName, customMatchers[matcherName]); + } + } + + Expectation.prototype.wrapCompare = function(name, matcherFactory) { + return function() { + var args = Array.prototype.slice.call(arguments, 0), + expected = args.slice(0), + message = ''; + + args.unshift(this.actual); + + var matcher = matcherFactory(this.util, this.customEqualityTesters), + matcherCompare = matcher.compare; + + function defaultNegativeCompare() { + var result = matcher.compare.apply(null, args); + result.pass = !result.pass; + return result; + } + + if (this.isNot) { + matcherCompare = matcher.negativeCompare || defaultNegativeCompare; + } + + var result = matcherCompare.apply(null, args); + + if (!result.pass) { + if (!result.message) { + args.unshift(this.isNot); + args.unshift(name); + message = this.util.buildFailureMessage.apply(null, args); + } else { + if (Object.prototype.toString.apply(result.message) === '[object Function]') { + message = result.message(); + } else { + message = result.message; + } + } + } + + if (expected.length == 1) { + expected = expected[0]; + } + + // TODO: how many of these params are needed? + this.addExpectationResult( + result.pass, + { + matcherName: name, + passed: result.pass, + message: message, + actual: this.actual, + expected: expected // TODO: this may need to be arrayified/sliced + } + ); + }; + }; + + Expectation.addCoreMatchers = function(matchers) { + var prototype = Expectation.prototype; + for (var matcherName in matchers) { + var matcher = matchers[matcherName]; + prototype[matcherName] = prototype.wrapCompare(matcherName, matcher); + } + }; + + Expectation.Factory = function(options) { + options = options || {}; + + var expect = new Expectation(options); + + // TODO: this would be nice as its own Object - NegativeExpectation + // TODO: copy instead of mutate options + options.isNot = true; + expect.not = new Expectation(options); + + return expect; + }; + + return Expectation; +}; + +//TODO: expectation result may make more sense as a presentation of an expectation. +getJasmineRequireObj().buildExpectationResult = function() { + function buildExpectationResult(options) { + var messageFormatter = options.messageFormatter || function() {}, + stackFormatter = options.stackFormatter || function() {}; + + var result = { + matcherName: options.matcherName, + message: message(), + stack: stack(), + passed: options.passed + }; + + if(!result.passed) { + result.expected = options.expected; + result.actual = options.actual; + } + + return result; + + function message() { + if (options.passed) { + return 'Passed.'; + } else if (options.message) { + return options.message; + } else if (options.error) { + return messageFormatter(options.error); + } + return ''; + } + + function stack() { + if (options.passed) { + return ''; + } + + var error = options.error; + if (!error) { + try { + throw new Error(message()); + } catch (e) { + error = e; + } + } + return stackFormatter(error); + } + } + + return buildExpectationResult; +}; + +getJasmineRequireObj().MockDate = function() { + function MockDate(global) { + var self = this; + var currentTime = 0; + + if (!global || !global.Date) { + self.install = function() {}; + self.tick = function() {}; + self.uninstall = function() {}; + return self; + } + + var GlobalDate = global.Date; + + self.install = function(mockDate) { + if (mockDate instanceof GlobalDate) { + currentTime = mockDate.getTime(); + } else { + currentTime = new GlobalDate().getTime(); + } + + global.Date = FakeDate; + }; + + self.tick = function(millis) { + millis = millis || 0; + currentTime = currentTime + millis; + }; + + self.uninstall = function() { + currentTime = 0; + global.Date = GlobalDate; + }; + + createDateProperties(); + + return self; + + function FakeDate() { + switch(arguments.length) { + case 0: + return new GlobalDate(currentTime); + case 1: + return new GlobalDate(arguments[0]); + case 2: + return new GlobalDate(arguments[0], arguments[1]); + case 3: + return new GlobalDate(arguments[0], arguments[1], arguments[2]); + case 4: + return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3]); + case 5: + return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3], + arguments[4]); + case 6: + return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3], + arguments[4], arguments[5]); + default: + return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3], + arguments[4], arguments[5], arguments[6]); + } + } + + function createDateProperties() { + FakeDate.prototype = GlobalDate.prototype; + + FakeDate.now = function() { + if (GlobalDate.now) { + return currentTime; + } else { + throw new Error('Browser does not support Date.now()'); + } + }; + + FakeDate.toSource = GlobalDate.toSource; + FakeDate.toString = GlobalDate.toString; + FakeDate.parse = GlobalDate.parse; + FakeDate.UTC = GlobalDate.UTC; + } + } + + return MockDate; +}; + +getJasmineRequireObj().pp = function(j$) { + + function PrettyPrinter() { + this.ppNestLevel_ = 0; + this.seen = []; + } + + PrettyPrinter.prototype.format = function(value) { + this.ppNestLevel_++; + try { + if (j$.util.isUndefined(value)) { + this.emitScalar('undefined'); + } else if (value === null) { + this.emitScalar('null'); + } else if (value === 0 && 1/value === -Infinity) { + this.emitScalar('-0'); + } else if (value === j$.getGlobal()) { + this.emitScalar(''); + } else if (value.jasmineToString) { + this.emitScalar(value.jasmineToString()); + } else if (typeof value === 'string') { + this.emitString(value); + } else if (j$.isSpy(value)) { + this.emitScalar('spy on ' + value.and.identity()); + } else if (value instanceof RegExp) { + this.emitScalar(value.toString()); + } else if (typeof value === 'function') { + this.emitScalar('Function'); + } else if (typeof value.nodeType === 'number') { + this.emitScalar('HTMLNode'); + } else if (value instanceof Date) { + this.emitScalar('Date(' + value + ')'); + } else if (j$.util.arrayContains(this.seen, value)) { + this.emitScalar(''); + } else if (j$.isArray_(value) || j$.isA_('Object', value)) { + this.seen.push(value); + if (j$.isArray_(value)) { + this.emitArray(value); + } else { + this.emitObject(value); + } + this.seen.pop(); + } else { + this.emitScalar(value.toString()); + } + } finally { + this.ppNestLevel_--; + } + }; + + PrettyPrinter.prototype.iterateObject = function(obj, fn) { + for (var property in obj) { + if (!Object.prototype.hasOwnProperty.call(obj, property)) { continue; } + fn(property, obj.__lookupGetter__ ? (!j$.util.isUndefined(obj.__lookupGetter__(property)) && + obj.__lookupGetter__(property) !== null) : false); + } + }; + + PrettyPrinter.prototype.emitArray = j$.unimplementedMethod_; + PrettyPrinter.prototype.emitObject = j$.unimplementedMethod_; + PrettyPrinter.prototype.emitScalar = j$.unimplementedMethod_; + PrettyPrinter.prototype.emitString = j$.unimplementedMethod_; + + function StringPrettyPrinter() { + PrettyPrinter.call(this); + + this.string = ''; + } + + j$.util.inherit(StringPrettyPrinter, PrettyPrinter); + + StringPrettyPrinter.prototype.emitScalar = function(value) { + this.append(value); + }; + + StringPrettyPrinter.prototype.emitString = function(value) { + this.append('\'' + value + '\''); + }; + + StringPrettyPrinter.prototype.emitArray = function(array) { + if (this.ppNestLevel_ > j$.MAX_PRETTY_PRINT_DEPTH) { + this.append('Array'); + return; + } + var length = Math.min(array.length, j$.MAX_PRETTY_PRINT_ARRAY_LENGTH); + this.append('[ '); + for (var i = 0; i < length; i++) { + if (i > 0) { + this.append(', '); + } + this.format(array[i]); + } + if(array.length > length){ + this.append(', ...'); + } + + var self = this; + var first = array.length === 0; + this.iterateObject(array, function(property, isGetter) { + if (property.match(/^\d+$/)) { + return; + } + + if (first) { + first = false; + } else { + self.append(', '); + } + + self.formatProperty(array, property, isGetter); + }); + + this.append(' ]'); + }; + + StringPrettyPrinter.prototype.emitObject = function(obj) { + var constructorName = obj.constructor ? j$.fnNameFor(obj.constructor) : 'null'; + this.append(constructorName); + + if (this.ppNestLevel_ > j$.MAX_PRETTY_PRINT_DEPTH) { + return; + } + + var self = this; + this.append('({ '); + var first = true; + + this.iterateObject(obj, function(property, isGetter) { + if (first) { + first = false; + } else { + self.append(', '); + } + + self.formatProperty(obj, property, isGetter); + }); + + this.append(' })'); + }; + + StringPrettyPrinter.prototype.formatProperty = function(obj, property, isGetter) { + this.append(property); + this.append(': '); + if (isGetter) { + this.append(''); + } else { + this.format(obj[property]); + } + }; + + StringPrettyPrinter.prototype.append = function(value) { + this.string += value; + }; + + return function(value) { + var stringPrettyPrinter = new StringPrettyPrinter(); + stringPrettyPrinter.format(value); + return stringPrettyPrinter.string; + }; +}; + +getJasmineRequireObj().QueueRunner = function(j$) { + + function once(fn) { + var called = false; + return function() { + if (!called) { + called = true; + fn(); + } + }; + } + + function QueueRunner(attrs) { + this.queueableFns = attrs.queueableFns || []; + this.onComplete = attrs.onComplete || function() {}; + this.clearStack = attrs.clearStack || function(fn) {fn();}; + this.onException = attrs.onException || function() {}; + this.catchException = attrs.catchException || function() { return true; }; + this.userContext = attrs.userContext || {}; + this.timeout = attrs.timeout || {setTimeout: setTimeout, clearTimeout: clearTimeout}; + this.fail = attrs.fail || function() {}; + } + + QueueRunner.prototype.execute = function() { + this.run(this.queueableFns, 0); + }; + + QueueRunner.prototype.run = function(queueableFns, recursiveIndex) { + var length = queueableFns.length, + self = this, + iterativeIndex; + + + for(iterativeIndex = recursiveIndex; iterativeIndex < length; iterativeIndex++) { + var queueableFn = queueableFns[iterativeIndex]; + if (queueableFn.fn.length > 0) { + attemptAsync(queueableFn); + return; + } else { + attemptSync(queueableFn); + } + } + + var runnerDone = iterativeIndex >= length; + + if (runnerDone) { + this.clearStack(this.onComplete); + } + + function attemptSync(queueableFn) { + try { + queueableFn.fn.call(self.userContext); + } catch (e) { + handleException(e, queueableFn); + } + } + + function attemptAsync(queueableFn) { + var clearTimeout = function () { + Function.prototype.apply.apply(self.timeout.clearTimeout, [j$.getGlobal(), [timeoutId]]); + }, + next = once(function () { + clearTimeout(timeoutId); + self.run(queueableFns, iterativeIndex + 1); + }), + timeoutId; + + next.fail = function() { + self.fail.apply(null, arguments); + next(); + }; + + if (queueableFn.timeout) { + timeoutId = Function.prototype.apply.apply(self.timeout.setTimeout, [j$.getGlobal(), [function() { + var error = new Error('Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.'); + onException(error, queueableFn); + next(); + }, queueableFn.timeout()]]); + } + + try { + queueableFn.fn.call(self.userContext, next); + } catch (e) { + handleException(e, queueableFn); + next(); + } + } + + function onException(e, queueableFn) { + self.onException(e); + } + + function handleException(e, queueableFn) { + onException(e, queueableFn); + if (!self.catchException(e)) { + //TODO: set a var when we catch an exception and + //use a finally block to close the loop in a nice way.. + throw e; + } + } + }; + + return QueueRunner; +}; + +getJasmineRequireObj().ReportDispatcher = function() { + function ReportDispatcher(methods) { + + var dispatchedMethods = methods || []; + + for (var i = 0; i < dispatchedMethods.length; i++) { + var method = dispatchedMethods[i]; + this[method] = (function(m) { + return function() { + dispatch(m, arguments); + }; + }(method)); + } + + var reporters = []; + + this.addReporter = function(reporter) { + reporters.push(reporter); + }; + + return this; + + function dispatch(method, args) { + for (var i = 0; i < reporters.length; i++) { + var reporter = reporters[i]; + if (reporter[method]) { + reporter[method].apply(reporter, args); + } + } + } + } + + return ReportDispatcher; +}; + + +getJasmineRequireObj().SpyRegistry = function(j$) { + + function SpyRegistry(options) { + options = options || {}; + var currentSpies = options.currentSpies || function() { return []; }; + + this.spyOn = function(obj, methodName) { + if (j$.util.isUndefined(obj)) { + throw new Error('spyOn could not find an object to spy upon for ' + methodName + '()'); + } + + if (j$.util.isUndefined(methodName)) { + throw new Error('No method name supplied'); + } + + if (j$.util.isUndefined(obj[methodName])) { + throw new Error(methodName + '() method does not exist'); + } + + if (obj[methodName] && j$.isSpy(obj[methodName])) { + //TODO?: should this return the current spy? Downside: may cause user confusion about spy state + throw new Error(methodName + ' has already been spied upon'); + } + + var spy = j$.createSpy(methodName, obj[methodName]); + + currentSpies().push({ + spy: spy, + baseObj: obj, + methodName: methodName, + originalValue: obj[methodName] + }); + + obj[methodName] = spy; + + return spy; + }; + + this.clearSpies = function() { + var spies = currentSpies(); + for (var i = 0; i < spies.length; i++) { + var spyEntry = spies[i]; + spyEntry.baseObj[spyEntry.methodName] = spyEntry.originalValue; + } + }; + } + + return SpyRegistry; +}; + +getJasmineRequireObj().SpyStrategy = function() { + + function SpyStrategy(options) { + options = options || {}; + + var identity = options.name || 'unknown', + originalFn = options.fn || function() {}, + getSpy = options.getSpy || function() {}, + plan = function() {}; + + this.identity = function() { + return identity; + }; + + this.exec = function() { + return plan.apply(this, arguments); + }; + + this.callThrough = function() { + plan = originalFn; + return getSpy(); + }; + + this.returnValue = function(value) { + plan = function() { + return value; + }; + return getSpy(); + }; + + this.returnValues = function() { + var values = Array.prototype.slice.call(arguments); + plan = function () { + return values.shift(); + }; + return getSpy(); + }; + + this.throwError = function(something) { + var error = (something instanceof Error) ? something : new Error(something); + plan = function() { + throw error; + }; + return getSpy(); + }; + + this.callFake = function(fn) { + plan = fn; + return getSpy(); + }; + + this.stub = function(fn) { + plan = function() {}; + return getSpy(); + }; + } + + return SpyStrategy; +}; + +getJasmineRequireObj().Suite = function(j$) { + function Suite(attrs) { + this.env = attrs.env; + this.id = attrs.id; + this.parentSuite = attrs.parentSuite; + this.description = attrs.description; + this.expectationFactory = attrs.expectationFactory; + this.expectationResultFactory = attrs.expectationResultFactory; + this.throwOnExpectationFailure = !!attrs.throwOnExpectationFailure; + + this.beforeFns = []; + this.afterFns = []; + this.beforeAllFns = []; + this.afterAllFns = []; + this.disabled = false; + + this.children = []; + + this.result = { + id: this.id, + description: this.description, + fullName: this.getFullName(), + failedExpectations: [] + }; + } + + Suite.prototype.expect = function(actual) { + return this.expectationFactory(actual, this); + }; + + Suite.prototype.getFullName = function() { + var fullName = this.description; + for (var parentSuite = this.parentSuite; parentSuite; parentSuite = parentSuite.parentSuite) { + if (parentSuite.parentSuite) { + fullName = parentSuite.description + ' ' + fullName; + } + } + return fullName; + }; + + Suite.prototype.disable = function() { + this.disabled = true; + }; + + Suite.prototype.beforeEach = function(fn) { + this.beforeFns.unshift(fn); + }; + + Suite.prototype.beforeAll = function(fn) { + this.beforeAllFns.push(fn); + }; + + Suite.prototype.afterEach = function(fn) { + this.afterFns.unshift(fn); + }; + + Suite.prototype.afterAll = function(fn) { + this.afterAllFns.push(fn); + }; + + Suite.prototype.addChild = function(child) { + this.children.push(child); + }; + + Suite.prototype.status = function() { + if (this.disabled) { + return 'disabled'; + } + + if (this.result.failedExpectations.length > 0) { + return 'failed'; + } else { + return 'finished'; + } + }; + + Suite.prototype.isExecutable = function() { + return !this.disabled; + }; + + Suite.prototype.canBeReentered = function() { + return this.beforeAllFns.length === 0 && this.afterAllFns.length === 0; + }; + + Suite.prototype.getResult = function() { + this.result.status = this.status(); + return this.result; + }; + + Suite.prototype.sharedUserContext = function() { + if (!this.sharedContext) { + this.sharedContext = this.parentSuite ? clone(this.parentSuite.sharedUserContext()) : {}; + } + + return this.sharedContext; + }; + + Suite.prototype.clonedSharedUserContext = function() { + return clone(this.sharedUserContext()); + }; + + Suite.prototype.onException = function() { + if (arguments[0] instanceof j$.errors.ExpectationFailed) { + return; + } + + if(isAfterAll(this.children)) { + var data = { + matcherName: '', + passed: false, + expected: '', + actual: '', + error: arguments[0] + }; + this.result.failedExpectations.push(this.expectationResultFactory(data)); + } else { + for (var i = 0; i < this.children.length; i++) { + var child = this.children[i]; + child.onException.apply(child, arguments); + } + } + }; + + Suite.prototype.addExpectationResult = function () { + if(isAfterAll(this.children) && isFailure(arguments)){ + var data = arguments[1]; + this.result.failedExpectations.push(this.expectationResultFactory(data)); + if(this.throwOnExpectationFailure) { + throw new j$.errors.ExpectationFailed(); + } + } else { + for (var i = 0; i < this.children.length; i++) { + var child = this.children[i]; + try { + child.addExpectationResult.apply(child, arguments); + } catch(e) { + // keep going + } + } + } + }; + + function isAfterAll(children) { + return children && children[0].result.status; + } + + function isFailure(args) { + return !args[0]; + } + + function clone(obj) { + var clonedObj = {}; + for (var prop in obj) { + if (obj.hasOwnProperty(prop)) { + clonedObj[prop] = obj[prop]; + } + } + + return clonedObj; + } + + return Suite; +}; + +if (typeof window == void 0 && typeof exports == 'object') { + exports.Suite = jasmineRequire.Suite; +} + +getJasmineRequireObj().Timer = function() { + var defaultNow = (function(Date) { + return function() { return new Date().getTime(); }; + })(Date); + + function Timer(options) { + options = options || {}; + + var now = options.now || defaultNow, + startTime; + + this.start = function() { + startTime = now(); + }; + + this.elapsed = function() { + return now() - startTime; + }; + } + + return Timer; +}; + +getJasmineRequireObj().TreeProcessor = function() { + function TreeProcessor(attrs) { + var tree = attrs.tree, + runnableIds = attrs.runnableIds, + queueRunnerFactory = attrs.queueRunnerFactory, + nodeStart = attrs.nodeStart || function() {}, + nodeComplete = attrs.nodeComplete || function() {}, + stats = { valid: true }, + processed = false, + defaultMin = Infinity, + defaultMax = 1 - Infinity; + + this.processTree = function() { + processNode(tree, false); + processed = true; + return stats; + }; + + this.execute = function(done) { + if (!processed) { + this.processTree(); + } + + if (!stats.valid) { + throw 'invalid order'; + } + + var childFns = wrapChildren(tree, 0); + + queueRunnerFactory({ + queueableFns: childFns, + userContext: tree.sharedUserContext(), + onException: function() { + tree.onException.apply(tree, arguments); + }, + onComplete: done + }); + }; + + function runnableIndex(id) { + for (var i = 0; i < runnableIds.length; i++) { + if (runnableIds[i] === id) { + return i; + } + } + } + + function processNode(node, parentEnabled) { + var executableIndex = runnableIndex(node.id); + + if (executableIndex !== undefined) { + parentEnabled = true; + } + + parentEnabled = parentEnabled && node.isExecutable(); + + if (!node.children) { + stats[node.id] = { + executable: parentEnabled && node.isExecutable(), + segments: [{ + index: 0, + owner: node, + nodes: [node], + min: startingMin(executableIndex), + max: startingMax(executableIndex) + }] + }; + } else { + var hasExecutableChild = false; + + for (var i = 0; i < node.children.length; i++) { + var child = node.children[i]; + + processNode(child, parentEnabled); + + if (!stats.valid) { + return; + } + + var childStats = stats[child.id]; + + hasExecutableChild = hasExecutableChild || childStats.executable; + } + + stats[node.id] = { + executable: hasExecutableChild + }; + + segmentChildren(node, stats[node.id], executableIndex); + + if (!node.canBeReentered() && stats[node.id].segments.length > 1) { + stats = { valid: false }; + } + } + } + + function startingMin(executableIndex) { + return executableIndex === undefined ? defaultMin : executableIndex; + } + + function startingMax(executableIndex) { + return executableIndex === undefined ? defaultMax : executableIndex; + } + + function segmentChildren(node, nodeStats, executableIndex) { + var currentSegment = { index: 0, owner: node, nodes: [], min: startingMin(executableIndex), max: startingMax(executableIndex) }, + result = [currentSegment], + lastMax = defaultMax, + orderedChildSegments = orderChildSegments(node.children); + + function isSegmentBoundary(minIndex) { + return lastMax !== defaultMax && minIndex !== defaultMin && lastMax < minIndex - 1; + } + + for (var i = 0; i < orderedChildSegments.length; i++) { + var childSegment = orderedChildSegments[i], + maxIndex = childSegment.max, + minIndex = childSegment.min; + + if (isSegmentBoundary(minIndex)) { + currentSegment = {index: result.length, owner: node, nodes: [], min: defaultMin, max: defaultMax}; + result.push(currentSegment); + } + + currentSegment.nodes.push(childSegment); + currentSegment.min = Math.min(currentSegment.min, minIndex); + currentSegment.max = Math.max(currentSegment.max, maxIndex); + lastMax = maxIndex; + } + + nodeStats.segments = result; + } + + function orderChildSegments(children) { + var specifiedOrder = [], + unspecifiedOrder = []; + + for (var i = 0; i < children.length; i++) { + var child = children[i], + segments = stats[child.id].segments; + + for (var j = 0; j < segments.length; j++) { + var seg = segments[j]; + + if (seg.min === defaultMin) { + unspecifiedOrder.push(seg); + } else { + specifiedOrder.push(seg); + } + } + } + + specifiedOrder.sort(function(a, b) { + return a.min - b.min; + }); + + return specifiedOrder.concat(unspecifiedOrder); + } + + function executeNode(node, segmentNumber) { + if (node.children) { + return { + fn: function(done) { + nodeStart(node); + + queueRunnerFactory({ + onComplete: function() { + nodeComplete(node, node.getResult()); + done(); + }, + queueableFns: wrapChildren(node, segmentNumber), + userContext: node.sharedUserContext(), + onException: function() { + node.onException.apply(node, arguments); + } + }); + } + }; + } else { + return { + fn: function(done) { node.execute(done, stats[node.id].executable); } + }; + } + } + + function wrapChildren(node, segmentNumber) { + var result = [], + segmentChildren = stats[node.id].segments[segmentNumber].nodes; + + for (var i = 0; i < segmentChildren.length; i++) { + result.push(executeNode(segmentChildren[i].owner, segmentChildren[i].index)); + } + + if (!stats[node.id].executable) { + return result; + } + + return node.beforeAllFns.concat(result).concat(node.afterAllFns); + } + } + + return TreeProcessor; +}; + +getJasmineRequireObj().Any = function(j$) { + + function Any(expectedObject) { + this.expectedObject = expectedObject; + } + + Any.prototype.asymmetricMatch = function(other) { + if (this.expectedObject == String) { + return typeof other == 'string' || other instanceof String; + } + + if (this.expectedObject == Number) { + return typeof other == 'number' || other instanceof Number; + } + + if (this.expectedObject == Function) { + return typeof other == 'function' || other instanceof Function; + } + + if (this.expectedObject == Object) { + return typeof other == 'object'; + } + + if (this.expectedObject == Boolean) { + return typeof other == 'boolean'; + } + + return other instanceof this.expectedObject; + }; + + Any.prototype.jasmineToString = function() { + return ''; + }; + + return Any; +}; + +getJasmineRequireObj().Anything = function(j$) { + + function Anything() {} + + Anything.prototype.asymmetricMatch = function(other) { + return !j$.util.isUndefined(other) && other !== null; + }; + + Anything.prototype.jasmineToString = function() { + return ''; + }; + + return Anything; +}; + +getJasmineRequireObj().ArrayContaining = function(j$) { + function ArrayContaining(sample) { + this.sample = sample; + } + + ArrayContaining.prototype.asymmetricMatch = function(other) { + var className = Object.prototype.toString.call(this.sample); + if (className !== '[object Array]') { throw new Error('You must provide an array to arrayContaining, not \'' + this.sample + '\'.'); } + + for (var i = 0; i < this.sample.length; i++) { + var item = this.sample[i]; + if (!j$.matchersUtil.contains(other, item)) { + return false; + } + } + + return true; + }; + + ArrayContaining.prototype.jasmineToString = function () { + return ''; + }; + + return ArrayContaining; +}; + +getJasmineRequireObj().ObjectContaining = function(j$) { + + function ObjectContaining(sample) { + this.sample = sample; + } + + function getPrototype(obj) { + if (Object.getPrototypeOf) { + return Object.getPrototypeOf(obj); + } + + if (obj.constructor.prototype == obj) { + return null; + } + + return obj.constructor.prototype; + } + + function hasProperty(obj, property) { + if (!obj) { + return false; + } + + if (Object.prototype.hasOwnProperty.call(obj, property)) { + return true; + } + + return hasProperty(getPrototype(obj), property); + } + + ObjectContaining.prototype.asymmetricMatch = function(other) { + if (typeof(this.sample) !== 'object') { throw new Error('You must provide an object to objectContaining, not \''+this.sample+'\'.'); } + + for (var property in this.sample) { + if (!hasProperty(other, property) || + !j$.matchersUtil.equals(this.sample[property], other[property])) { + return false; + } + } + + return true; + }; + + ObjectContaining.prototype.jasmineToString = function() { + return ''; + }; + + return ObjectContaining; +}; + +getJasmineRequireObj().StringMatching = function(j$) { + + function StringMatching(expected) { + if (!j$.isString_(expected) && !j$.isA_('RegExp', expected)) { + throw new Error('Expected is not a String or a RegExp'); + } + + this.regexp = new RegExp(expected); + } + + StringMatching.prototype.asymmetricMatch = function(other) { + return this.regexp.test(other); + }; + + StringMatching.prototype.jasmineToString = function() { + return ''; + }; + + return StringMatching; +}; + +getJasmineRequireObj().errors = function() { + function ExpectationFailed() {} + + ExpectationFailed.prototype = new Error(); + ExpectationFailed.prototype.constructor = ExpectationFailed; + + return { + ExpectationFailed: ExpectationFailed + }; +}; +getJasmineRequireObj().matchersUtil = function(j$) { + // TODO: what to do about jasmine.pp not being inject? move to JSON.stringify? gut PrettyPrinter? + + return { + equals: function(a, b, customTesters) { + customTesters = customTesters || []; + + return eq(a, b, [], [], customTesters); + }, + + contains: function(haystack, needle, customTesters) { + customTesters = customTesters || []; + + if ((Object.prototype.toString.apply(haystack) === '[object Array]') || + (!!haystack && !haystack.indexOf)) + { + for (var i = 0; i < haystack.length; i++) { + if (eq(haystack[i], needle, [], [], customTesters)) { + return true; + } + } + return false; + } + + return !!haystack && haystack.indexOf(needle) >= 0; + }, + + buildFailureMessage: function() { + var args = Array.prototype.slice.call(arguments, 0), + matcherName = args[0], + isNot = args[1], + actual = args[2], + expected = args.slice(3), + englishyPredicate = matcherName.replace(/[A-Z]/g, function(s) { return ' ' + s.toLowerCase(); }); + + var message = 'Expected ' + + j$.pp(actual) + + (isNot ? ' not ' : ' ') + + englishyPredicate; + + if (expected.length > 0) { + for (var i = 0; i < expected.length; i++) { + if (i > 0) { + message += ','; + } + message += ' ' + j$.pp(expected[i]); + } + } + + return message + '.'; + } + }; + + function isAsymmetric(obj) { + return obj && j$.isA_('Function', obj.asymmetricMatch); + } + + function asymmetricMatch(a, b) { + var asymmetricA = isAsymmetric(a), + asymmetricB = isAsymmetric(b); + + if (asymmetricA && asymmetricB) { + return undefined; + } + + if (asymmetricA) { + return a.asymmetricMatch(b); + } + + if (asymmetricB) { + return b.asymmetricMatch(a); + } + } + + // Equality function lovingly adapted from isEqual in + // [Underscore](http://underscorejs.org) + function eq(a, b, aStack, bStack, customTesters) { + var result = true; + + var asymmetricResult = asymmetricMatch(a, b); + if (!j$.util.isUndefined(asymmetricResult)) { + return asymmetricResult; + } + + for (var i = 0; i < customTesters.length; i++) { + var customTesterResult = customTesters[i](a, b); + if (!j$.util.isUndefined(customTesterResult)) { + return customTesterResult; + } + } + + if (a instanceof Error && b instanceof Error) { + return a.message == b.message; + } + + // Identical objects are equal. `0 === -0`, but they aren't identical. + // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). + if (a === b) { return a !== 0 || 1 / a == 1 / b; } + // A strict comparison is necessary because `null == undefined`. + if (a === null || b === null) { return a === b; } + var className = Object.prototype.toString.call(a); + if (className != Object.prototype.toString.call(b)) { return false; } + switch (className) { + // Strings, numbers, dates, and booleans are compared by value. + case '[object String]': + // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is + // equivalent to `new String("5")`. + return a == String(b); + case '[object Number]': + // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for + // other numeric values. + return a != +a ? b != +b : (a === 0 ? 1 / a == 1 / b : a == +b); + case '[object Date]': + case '[object Boolean]': + // Coerce dates and booleans to numeric primitive values. Dates are compared by their + // millisecond representations. Note that invalid dates with millisecond representations + // of `NaN` are not equivalent. + return +a == +b; + // RegExps are compared by their source patterns and flags. + case '[object RegExp]': + return a.source == b.source && + a.global == b.global && + a.multiline == b.multiline && + a.ignoreCase == b.ignoreCase; + } + if (typeof a != 'object' || typeof b != 'object') { return false; } + + var aIsDomNode = j$.isDomNode(a); + var bIsDomNode = j$.isDomNode(b); + if (aIsDomNode && bIsDomNode) { + // At first try to use DOM3 method isEqualNode + if (a.isEqualNode) { + return a.isEqualNode(b); + } + // IE8 doesn't support isEqualNode, try to use outerHTML && innerText + var aIsElement = a instanceof Element; + var bIsElement = b instanceof Element; + if (aIsElement && bIsElement) { + return a.outerHTML == b.outerHTML; + } + if (aIsElement || bIsElement) { + return false; + } + return a.innerText == b.innerText && a.textContent == b.textContent; + } + if (aIsDomNode || bIsDomNode) { + return false; + } + + // Assume equality for cyclic structures. The algorithm for detecting cyclic + // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. + var length = aStack.length; + while (length--) { + // Linear search. Performance is inversely proportional to the number of + // unique nested structures. + if (aStack[length] == a) { return bStack[length] == b; } + } + // Add the first object to the stack of traversed objects. + aStack.push(a); + bStack.push(b); + var size = 0; + // Recursively compare objects and arrays. + // Compare array lengths to determine if a deep comparison is necessary. + if (className == '[object Array]' && a.length !== b.length) { + result = false; + } + + if (result) { + // Objects with different constructors are not equivalent, but `Object`s + // or `Array`s from different frames are. + if (className !== '[object Array]') { + var aCtor = a.constructor, bCtor = b.constructor; + if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor && + isFunction(bCtor) && bCtor instanceof bCtor)) { + return false; + } + } + // Deep compare objects. + for (var key in a) { + if (has(a, key)) { + // Count the expected number of properties. + size++; + // Deep compare each member. + if (!(result = has(b, key) && eq(a[key], b[key], aStack, bStack, customTesters))) { break; } + } + } + // Ensure that both objects contain the same number of properties. + if (result) { + for (key in b) { + if (has(b, key) && !(size--)) { break; } + } + result = !size; + } + } + // Remove the first object from the stack of traversed objects. + aStack.pop(); + bStack.pop(); + + return result; + + function has(obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); + } + + function isFunction(obj) { + return typeof obj === 'function'; + } + } +}; + +getJasmineRequireObj().toBe = function() { + function toBe() { + return { + compare: function(actual, expected) { + return { + pass: actual === expected + }; + } + }; + } + + return toBe; +}; + +getJasmineRequireObj().toBeCloseTo = function() { + + function toBeCloseTo() { + return { + compare: function(actual, expected, precision) { + if (precision !== 0) { + precision = precision || 2; + } + + return { + pass: Math.abs(expected - actual) < (Math.pow(10, -precision) / 2) + }; + } + }; + } + + return toBeCloseTo; +}; + +getJasmineRequireObj().toBeDefined = function() { + function toBeDefined() { + return { + compare: function(actual) { + return { + pass: (void 0 !== actual) + }; + } + }; + } + + return toBeDefined; +}; + +getJasmineRequireObj().toBeFalsy = function() { + function toBeFalsy() { + return { + compare: function(actual) { + return { + pass: !!!actual + }; + } + }; + } + + return toBeFalsy; +}; + +getJasmineRequireObj().toBeGreaterThan = function() { + + function toBeGreaterThan() { + return { + compare: function(actual, expected) { + return { + pass: actual > expected + }; + } + }; + } + + return toBeGreaterThan; +}; + + +getJasmineRequireObj().toBeLessThan = function() { + function toBeLessThan() { + return { + + compare: function(actual, expected) { + return { + pass: actual < expected + }; + } + }; + } + + return toBeLessThan; +}; +getJasmineRequireObj().toBeNaN = function(j$) { + + function toBeNaN() { + return { + compare: function(actual) { + var result = { + pass: (actual !== actual) + }; + + if (result.pass) { + result.message = 'Expected actual not to be NaN.'; + } else { + result.message = function() { return 'Expected ' + j$.pp(actual) + ' to be NaN.'; }; + } + + return result; + } + }; + } + + return toBeNaN; +}; + +getJasmineRequireObj().toBeNull = function() { + + function toBeNull() { + return { + compare: function(actual) { + return { + pass: actual === null + }; + } + }; + } + + return toBeNull; +}; + +getJasmineRequireObj().toBeTruthy = function() { + + function toBeTruthy() { + return { + compare: function(actual) { + return { + pass: !!actual + }; + } + }; + } + + return toBeTruthy; +}; + +getJasmineRequireObj().toBeUndefined = function() { + + function toBeUndefined() { + return { + compare: function(actual) { + return { + pass: void 0 === actual + }; + } + }; + } + + return toBeUndefined; +}; + +getJasmineRequireObj().toContain = function() { + function toContain(util, customEqualityTesters) { + customEqualityTesters = customEqualityTesters || []; + + return { + compare: function(actual, expected) { + + return { + pass: util.contains(actual, expected, customEqualityTesters) + }; + } + }; + } + + return toContain; +}; + +getJasmineRequireObj().toEqual = function() { + + function toEqual(util, customEqualityTesters) { + customEqualityTesters = customEqualityTesters || []; + + return { + compare: function(actual, expected) { + var result = { + pass: false + }; + + result.pass = util.equals(actual, expected, customEqualityTesters); + + return result; + } + }; + } + + return toEqual; +}; + +getJasmineRequireObj().toHaveBeenCalled = function(j$) { + + function toHaveBeenCalled() { + return { + compare: function(actual) { + var result = {}; + + if (!j$.isSpy(actual)) { + throw new Error('Expected a spy, but got ' + j$.pp(actual) + '.'); + } + + if (arguments.length > 1) { + throw new Error('toHaveBeenCalled does not take arguments, use toHaveBeenCalledWith'); + } + + result.pass = actual.calls.any(); + + result.message = result.pass ? + 'Expected spy ' + actual.and.identity() + ' not to have been called.' : + 'Expected spy ' + actual.and.identity() + ' to have been called.'; + + return result; + } + }; + } + + return toHaveBeenCalled; +}; + +getJasmineRequireObj().toHaveBeenCalledWith = function(j$) { + + function toHaveBeenCalledWith(util, customEqualityTesters) { + return { + compare: function() { + var args = Array.prototype.slice.call(arguments, 0), + actual = args[0], + expectedArgs = args.slice(1), + result = { pass: false }; + + if (!j$.isSpy(actual)) { + throw new Error('Expected a spy, but got ' + j$.pp(actual) + '.'); + } + + if (!actual.calls.any()) { + result.message = function() { return 'Expected spy ' + actual.and.identity() + ' to have been called with ' + j$.pp(expectedArgs) + ' but it was never called.'; }; + return result; + } + + if (util.contains(actual.calls.allArgs(), expectedArgs, customEqualityTesters)) { + result.pass = true; + result.message = function() { return 'Expected spy ' + actual.and.identity() + ' not to have been called with ' + j$.pp(expectedArgs) + ' but it was.'; }; + } else { + result.message = function() { return 'Expected spy ' + actual.and.identity() + ' to have been called with ' + j$.pp(expectedArgs) + ' but actual calls were ' + j$.pp(actual.calls.allArgs()).replace(/^\[ | \]$/g, '') + '.'; }; + } + + return result; + } + }; + } + + return toHaveBeenCalledWith; +}; + +getJasmineRequireObj().toMatch = function(j$) { + + function toMatch() { + return { + compare: function(actual, expected) { + if (!j$.isString_(expected) && !j$.isA_('RegExp', expected)) { + throw new Error('Expected is not a String or a RegExp'); + } + + var regexp = new RegExp(expected); + + return { + pass: regexp.test(actual) + }; + } + }; + } + + return toMatch; +}; + +getJasmineRequireObj().toThrow = function(j$) { + + function toThrow(util) { + return { + compare: function(actual, expected) { + var result = { pass: false }, + threw = false, + thrown; + + if (typeof actual != 'function') { + throw new Error('Actual is not a Function'); + } + + try { + actual(); + } catch (e) { + threw = true; + thrown = e; + } + + if (!threw) { + result.message = 'Expected function to throw an exception.'; + return result; + } + + if (arguments.length == 1) { + result.pass = true; + result.message = function() { return 'Expected function not to throw, but it threw ' + j$.pp(thrown) + '.'; }; + + return result; + } + + if (util.equals(thrown, expected)) { + result.pass = true; + result.message = function() { return 'Expected function not to throw ' + j$.pp(expected) + '.'; }; + } else { + result.message = function() { return 'Expected function to throw ' + j$.pp(expected) + ', but it threw ' + j$.pp(thrown) + '.'; }; + } + + return result; + } + }; + } + + return toThrow; +}; + +getJasmineRequireObj().toThrowError = function(j$) { + function toThrowError (util) { + return { + compare: function(actual) { + var threw = false, + pass = {pass: true}, + fail = {pass: false}, + thrown; + + if (typeof actual != 'function') { + throw new Error('Actual is not a Function'); + } + + var errorMatcher = getMatcher.apply(null, arguments); + + try { + actual(); + } catch (e) { + threw = true; + thrown = e; + } + + if (!threw) { + fail.message = 'Expected function to throw an Error.'; + return fail; + } + + if (!(thrown instanceof Error)) { + fail.message = function() { return 'Expected function to throw an Error, but it threw ' + j$.pp(thrown) + '.'; }; + return fail; + } + + if (errorMatcher.hasNoSpecifics()) { + pass.message = 'Expected function not to throw an Error, but it threw ' + j$.fnNameFor(thrown) + '.'; + return pass; + } + + if (errorMatcher.matches(thrown)) { + pass.message = function() { + return 'Expected function not to throw ' + errorMatcher.errorTypeDescription + errorMatcher.messageDescription() + '.'; + }; + return pass; + } else { + fail.message = function() { + return 'Expected function to throw ' + errorMatcher.errorTypeDescription + errorMatcher.messageDescription() + + ', but it threw ' + errorMatcher.thrownDescription(thrown) + '.'; + }; + return fail; + } + } + }; + + function getMatcher() { + var expected = null, + errorType = null; + + if (arguments.length == 2) { + expected = arguments[1]; + if (isAnErrorType(expected)) { + errorType = expected; + expected = null; + } + } else if (arguments.length > 2) { + errorType = arguments[1]; + expected = arguments[2]; + if (!isAnErrorType(errorType)) { + throw new Error('Expected error type is not an Error.'); + } + } + + if (expected && !isStringOrRegExp(expected)) { + if (errorType) { + throw new Error('Expected error message is not a string or RegExp.'); + } else { + throw new Error('Expected is not an Error, string, or RegExp.'); + } + } + + function messageMatch(message) { + if (typeof expected == 'string') { + return expected == message; + } else { + return expected.test(message); + } + } + + return { + errorTypeDescription: errorType ? j$.fnNameFor(errorType) : 'an exception', + thrownDescription: function(thrown) { + var thrownName = errorType ? j$.fnNameFor(thrown.constructor) : 'an exception', + thrownMessage = ''; + + if (expected) { + thrownMessage = ' with message ' + j$.pp(thrown.message); + } + + return thrownName + thrownMessage; + }, + messageDescription: function() { + if (expected === null) { + return ''; + } else if (expected instanceof RegExp) { + return ' with a message matching ' + j$.pp(expected); + } else { + return ' with message ' + j$.pp(expected); + } + }, + hasNoSpecifics: function() { + return expected === null && errorType === null; + }, + matches: function(error) { + return (errorType === null || error instanceof errorType) && + (expected === null || messageMatch(error.message)); + } + }; + } + + function isStringOrRegExp(potential) { + return potential instanceof RegExp || (typeof potential == 'string'); + } + + function isAnErrorType(type) { + if (typeof type !== 'function') { + return false; + } + + var Surrogate = function() {}; + Surrogate.prototype = type.prototype; + return (new Surrogate()) instanceof Error; + } + } + + return toThrowError; +}; + +getJasmineRequireObj().interface = function(jasmine, env) { + var jasmineInterface = { + describe: function(description, specDefinitions) { + return env.describe(description, specDefinitions); + }, + + xdescribe: function(description, specDefinitions) { + return env.xdescribe(description, specDefinitions); + }, + + fdescribe: function(description, specDefinitions) { + return env.fdescribe(description, specDefinitions); + }, + + it: function() { + return env.it.apply(env, arguments); + }, + + xit: function() { + return env.xit.apply(env, arguments); + }, + + fit: function() { + return env.fit.apply(env, arguments); + }, + + beforeEach: function() { + return env.beforeEach.apply(env, arguments); + }, + + afterEach: function() { + return env.afterEach.apply(env, arguments); + }, + + beforeAll: function() { + return env.beforeAll.apply(env, arguments); + }, + + afterAll: function() { + return env.afterAll.apply(env, arguments); + }, + + expect: function(actual) { + return env.expect(actual); + }, + + pending: function() { + return env.pending.apply(env, arguments); + }, + + fail: function() { + return env.fail.apply(env, arguments); + }, + + spyOn: function(obj, methodName) { + return env.spyOn(obj, methodName); + }, + + jsApiReporter: new jasmine.JsApiReporter({ + timer: new jasmine.Timer() + }), + + jasmine: jasmine + }; + + jasmine.addCustomEqualityTester = function(tester) { + env.addCustomEqualityTester(tester); + }; + + jasmine.addMatchers = function(matchers) { + return env.addMatchers(matchers); + }; + + jasmine.clock = function() { + return env.clock; + }; + + return jasmineInterface; +}; + +getJasmineRequireObj().version = function() { + return '2.3.4'; +}; diff --git a/dashboard-ui/bower_components/fingerprintjs2/specs/lib/jasmine-2.3.4/jasmine_favicon.png b/dashboard-ui/bower_components/fingerprintjs2/specs/lib/jasmine-2.3.4/jasmine_favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..3b84583be4b9d5ae9cd5cae07b2dbaa5ebb0ad1c GIT binary patch literal 1486 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabRA=0VDb;}332@o1PuQh8X8uGu4-^- zn3*=SA+%wV=cI;&hMB$%-Lc(MLmN8%IwwUpbcA;F2Q;)twND9bn-tpC9oR4-vb8I; zp+Bg#FSKP+P(yD-%f!%zo}iZgh=%Ua=KkP@iNVbiLYsSn8~VeW`+}P$1~&ACHcbd_ z=nZb_32o{NZkZ6&1k^hrxT!a&r8lIdAIJ@9nh?|iRMsET+#A%`AKKg-(%2K)*cZ|~ zA-J&*$PEUH08MM`4Q=iVY3vVfhN$TUscGs5sR8P31X|G_+SnTcv<0XVC=Rr!u|K4# zHyCJU6UYRR;%2BtKv^I=q#2|DECn_k@wXU|=@ zeD&J(8#iy=zH|5fgNKiwJbm`!<*V0k-oF3v@zdvTKYsrD^Y>rGdNDU(R>|^oaSW-5 z%f0Y2x+hSk{p0&HA;E60Oq1S3r7U;(X3MH#?W9nxXzk)srlC4P;cZYe&v*G}mgi%< ze(bTl{@&_)cX8b-kvX%ff9D22e*M~7edm|;|Jb8m2JBzkzKiSBKR0n*?XSyM6fxZY zJ4bb;vGKRiKP(ztq3sJx9iq$Re`-EEQU0KE$sdyqayzp6H-7x+oGKZ_6;hQ_Y|p&y z7o`N7g@ z8Yl1HKL;mFo4BdxljF1}KbfMR6nNdLyPnEap1MqBdI?{g$L58$P8+wftLX5R70)7n`#pwItnbma$w{%`M(`wpsu2rJ60rdGCc> z+~lm)viMYM`=uXwK_$`#_UtRZMO=2-IV)l2vc~)doyPvg-RmxtACQ#v{7}5$&isV+ zPws~n?@yNGy#H1=vTI?;CAl9~9#VgqJ+7`4y~R+Wyj0U+){?lm9r6mtf0gl_VmUW^ z%eje%?jM%^eLuUg#ybXaQM{yQy&8UgiQ`HQ+=iTpjfd0iJ@ ssyFi&dF4%9dEry;pNN)Q>$jg_dr3r;PHA*CFc&d+y85}Sb4q9e0J812W&i*H literal 0 HcmV?d00001 diff --git a/dashboard-ui/bower_components/fingerprintjs2/specs/lib/jasmine-2.3.4/terminal.js b/dashboard-ui/bower_components/fingerprintjs2/specs/lib/jasmine-2.3.4/terminal.js new file mode 100644 index 000000000..b9cf1a5e7 --- /dev/null +++ b/dashboard-ui/bower_components/fingerprintjs2/specs/lib/jasmine-2.3.4/terminal.js @@ -0,0 +1,261 @@ +(function(global) { + var UNDEFINED, + exportObject; + + if (typeof module !== "undefined" && module.exports) { + exportObject = exports; + } else { + exportObject = global.jasmineReporters = global.jasmineReporters || {}; + } + + function elapsed(start, end) { return (end - start)/1000; } + function isFailed(obj) { return obj.status === "failed"; } + function isSkipped(obj) { return obj.status === "pending"; } + function isDisabled(obj) { return obj.status === "disabled"; } + function extend(dupe, obj) { // performs a shallow copy of all props of `obj` onto `dupe` + for (var prop in obj) { + if (obj.hasOwnProperty(prop)) { + dupe[prop] = obj[prop]; + } + } + return dupe; + } + function log(str) { + var con = global.console || console; + if (con && con.log && str && str.length) { + con.log(str); + } + } + + + /** + * Basic reporter that outputs spec results to the terminal. + * Use this reporter in your build pipeline. + * + * Usage: + * + * jasmine.getEnv().addReporter(new jasmineReporters.TerminalReporter(options); + * + * @param {object} [options] + * @param {number} [options.verbosity] meaningful values are 0 through 3; anything + * greater than 3 is treated as 3 (default: 2) + * @param {boolean} [options.color] print in color or not (default: true) + * @param {boolean} [opts.showStack] show stack trace for failed specs (default: false) + */ + var DEFAULT_VERBOSITY = 2, + ATTRIBUTES_TO_ANSI = { + "off": 0, + "bold": 1, + "red": 31, + "green": 32, + "yellow": 33, + "blue": 34, + "magenta": 35, + "cyan": 36 + }; + + exportObject.TerminalReporter = function(options) { + var self = this; + self.started = false; + self.finished = false; + + // sanitize arguments + options = options || {}; + self.verbosity = typeof options.verbosity === "number" ? options.verbosity : DEFAULT_VERBOSITY; + self.color = options.color; + self.showStack = options.showStack; + + var indent_string = ' ', + startTime, + currentSuite = null, + totalSpecsExecuted = 0, + totalSpecsSkipped = 0, + totalSpecsDisabled = 0, + totalSpecsFailed = 0, + totalSpecsDefined, + // when use use fit, jasmine never calls suiteStarted / suiteDone, so make a fake one to use + fakeFocusedSuite = { + id: 'focused', + description: 'focused specs', + fullName: 'focused specs' + }; + + var __suites = {}, __specs = {}; + function getSuite(suite) { + __suites[suite.id] = extend(__suites[suite.id] || {}, suite); + return __suites[suite.id]; + } + function getSpec(spec) { + __specs[spec.id] = extend(__specs[spec.id] || {}, spec); + return __specs[spec.id]; + } + + self.jasmineStarted = function(summary) { + totalSpecsDefined = summary && summary.totalSpecsDefined || NaN; + startTime = exportObject.startTime = new Date(); + self.started = true; + }; + self.suiteStarted = function(suite) { + suite = getSuite(suite); + suite._specs = 0; + suite._nestedSpecs = 0; + suite._failures = 0; + suite._nestedFailures = 0; + suite._skipped = 0; + suite._nestedSkipped = 0; + suite._disabled = 0; + suite._nestedDisabled = 0; + suite._depth = currentSuite ? currentSuite._depth+1 : 1; + suite._parent = currentSuite; + currentSuite = suite; + if (self.verbosity > 2) { + log(indentWithLevel(suite._depth, inColor(suite.description, "bold"))); + } + }; + self.specStarted = function(spec) { + if (!currentSuite) { + // focused spec (fit) -- suiteStarted was never called + self.suiteStarted(fakeFocusedSuite); + } + spec = getSpec(spec); + spec._suite = currentSuite; + spec._depth = currentSuite._depth+1; + currentSuite._specs++; + if (self.verbosity > 2) { + log(indentWithLevel(spec._depth, spec.description + ' ...')); + } + }; + self.specDone = function(spec) { + spec = getSpec(spec); + var failed = false, + skipped = false, + disabled = false, + color = 'green', + resultText = ''; + if (isSkipped(spec)) { + skipped = true; + color = ''; + spec._suite._skipped++; + totalSpecsSkipped++; + } + if (isFailed(spec)) { + failed = true; + color = 'red'; + spec._suite._failures++; + totalSpecsFailed++; + } + if (isDisabled(spec)) { + disabled = true; + color = 'yellow'; + spec._suite._disabled++; + totalSpecsDisabled++; + } + totalSpecsExecuted++; + + if (self.verbosity === 2) { + resultText = failed ? 'F' : skipped ? 'S' : disabled ? 'D' : '.'; + } else if (self.verbosity > 2) { + resultText = ' ' + (failed ? 'Failed' : skipped ? 'Skipped' : disabled ? 'Disabled' : 'Passed'); + } + log(inColor(resultText, color)); + + if (failed) { + if (self.verbosity === 1) { + log(spec.fullName); + } else if (self.verbosity === 2) { + log(' '); + log(indentWithLevel(spec._depth, spec.fullName)); + } + + for (var i = 0; i < spec.failedExpectations.length; i++) { + log(inColor(indentWithLevel(spec._depth, indent_string + spec.failedExpectations[i].message), color)); + if (self.showStack){ + logStackLines(spec._depth, spec.failedExpectations[i].stack.split('\n')); + } + } + } + }; + self.suiteDone = function(suite) { + suite = getSuite(suite); + if (suite._parent === UNDEFINED) { + // disabled suite (xdescribe) -- suiteStarted was never called + self.suiteStarted(suite); + } + if (suite._parent) { + suite._parent._specs += suite._specs + suite._nestedSpecs; + suite._parent._failures += suite._failures + suite._nestedFailures; + suite._parent._skipped += suite._skipped + suite._nestedSkipped; + suite._parent._disabled += suite._disabled + suite._nestedDisabled; + + } + currentSuite = suite._parent; + if (self.verbosity < 3) { + return; + } + + var total = suite._specs + suite._nestedSpecs, + failed = suite._failures + suite._nestedFailures, + skipped = suite._skipped + suite._nestedSkipped, + disabled = suite._disabled + suite._nestedDisabled, + passed = total - failed - skipped, + color = failed ? 'red+bold' : 'green+bold', + str = passed + ' of ' + total + ' passed (' + skipped + ' skipped, ' + disabled + ' disabled)'; + log(indentWithLevel(suite._depth, inColor(str+'.', color))); + }; + self.jasmineDone = function() { + if (currentSuite) { + // focused spec (fit) -- suiteDone was never called + self.suiteDone(fakeFocusedSuite); + } + var now = new Date(), + dur = elapsed(startTime, now), + total = totalSpecsDefined || totalSpecsExecuted, + disabled = total - totalSpecsExecuted + totalSpecsDisabled, + skipped = totalSpecsSkipped, + spec_str = total + (total === 1 ? " spec, " : " specs, "), + fail_str = totalSpecsFailed + (totalSpecsFailed === 1 ? " failure, " : " failures, "), + skip_str = skipped + " skipped, ", + disabled_str = disabled + " disabled in ", + summary_str = spec_str + fail_str + skip_str + disabled_str + dur + "s.", + result_str = (totalSpecsFailed && "FAILURE: " || "SUCCESS: ") + summary_str, + result_color = totalSpecsFailed && "red+bold" || "green+bold"; + + if (self.verbosity === 2) { + log(''); + } + + if (self.verbosity > 0) { + log(inColor(result_str, result_color)); + } + //log("Specs skipped but not reported (entire suite skipped or targeted to specific specs)", totalSpecsDefined - totalSpecsExecuted + totalSpecsDisabled); + + self.finished = true; + // this is so phantomjs-testrunner.js can tell if we're done executing + exportObject.endTime = now; + }; + function indentWithLevel(level, string) { + return new Array(level).join(indent_string) + string; + } + function logStackLines(depth, lines) { + lines.forEach(function(line){ + log(inColor(indentWithLevel(depth, indent_string + line), 'magenta')); + }); + } + function inColor(string, color) { + var color_attributes = color && color.split("+"), + ansi_string = "", + i; + + if (!self.color || !color_attributes) { + return string; + } + + for(i = 0; i < color_attributes.length; i++) { + ansi_string += "\033[" + ATTRIBUTES_TO_ANSI[color_attributes[i]] + "m"; + } + ansi_string += string + "\033[" + ATTRIBUTES_TO_ANSI["off"] + "m"; + + return ansi_string; + } + }; +})(this); diff --git a/dashboard-ui/bower_components/fingerprintjs2/specs/phantomjs-testrunner.js b/dashboard-ui/bower_components/fingerprintjs2/specs/phantomjs-testrunner.js new file mode 100644 index 000000000..c0f4c6a46 --- /dev/null +++ b/dashboard-ui/bower_components/fingerprintjs2/specs/phantomjs-testrunner.js @@ -0,0 +1,230 @@ +/* globals jasmineRequire, phantom */ +// Verify arguments +var system = require('system'); +var args; + +if(phantom.args) { + args = phantom.args; +} else { + args = system.args.slice(1);//use system args for phantom 2.0+ +} + +if (args.length === 0) { + console.log("Simple JasmineBDD test runner for phantom.js"); + console.log("Usage: phantomjs-testrunner.js url_to_runner.html"); + console.log("Accepts http:// and file:// urls"); + console.log(""); + console.log("NOTE: This script depends on jasmine.HtmlReporter being used\non the page, for the DOM elements it creates.\n"); + phantom.exit(2); +} +else { + var fs = require("fs"), + pages = [], + page, address, resultsKey, i, l; + + + var setupPageFn = function(p, k) { + return function() { + overloadPageEvaluate(p); + setupWriteFileFunction(p, k, fs.separator); + }; + }; + + for (i = 0, l = args.length; i < l; i++) { + address = args[i]; + console.log("Loading " + address); + + // if provided a url without a protocol, try to use file:// + address = address.indexOf("://") === -1 ? "file://" + address : address; + + // create a WebPage object to work with + page = require("webpage").create(); + page.url = address; + + // When initialized, inject the reporting functions before the page is loaded + // (and thus before it will try to utilize the functions) + resultsKey = "__jr" + Math.ceil(Math.random() * 1000000); + page.onInitialized = setupPageFn(page, resultsKey); + page.open(address, processPage(null, page, resultsKey)); + pages.push(page); + + page.onConsoleMessage = logAndWorkAroundDefaultLineBreaking; + } + + // bail when all pages have been processed + setInterval(function(){ + var exit_code = 0; + for (i = 0, l = pages.length; i < l; i++) { + page = pages[i]; + if (page.__exit_code === null) { + // wait until later + return; + } + exit_code |= page.__exit_code; + } + phantom.exit(exit_code); + }, 100); +} + +// Thanks to hoisting, these helpers are still available when needed above +/** + * Logs a message. Does not add a line-break for single characters '.' and 'F' or lines ending in ' ...' + * + * @param msg + */ +function logAndWorkAroundDefaultLineBreaking(msg) { + var interpretAsWithoutNewline = /(^(\033\[\d+m)*[\.F](\033\[\d+m)*$)|( \.\.\.$)/; + if (navigator.userAgent.indexOf("Windows") < 0 && interpretAsWithoutNewline.test(msg)) { + try { + system.stdout.write(msg); + } catch (e) { + var fs = require('fs'); + fs.write('/dev/stdout', msg, 'w'); + } + } else { + console.log(msg); + } +} + +/** + * Stringifies the function, replacing any %placeholders% with mapped values. + * + * @param {function} fn The function to replace occurrences within. + * @param {object} replacements Key => Value object of string replacements. + */ +function replaceFunctionPlaceholders(fn, replacements) { + if (replacements && typeof replacements === "object") { + fn = fn.toString(); + for (var p in replacements) { + if (replacements.hasOwnProperty(p)) { + var match = new RegExp("%" + p + "%", "g"); + do { + fn = fn.replace(match, replacements[p]); + } while(fn.indexOf(match) !== -1); + } + } + } + return fn; +} + +/** + * Replaces the "evaluate" method with one we can easily do substitution with. + * + * @param {phantomjs.WebPage} page The WebPage object to overload + */ +function overloadPageEvaluate(page) { + page._evaluate = page.evaluate; + page.evaluate = function(fn, replacements) { return page._evaluate(replaceFunctionPlaceholders(fn, replacements)); }; + return page; +} + +/** Stubs a fake writeFile function into the test runner. + * + * @param {phantomjs.WebPage} page The WebPage object to inject functions into. + * @param {string} key The name of the global object in which file data should + * be stored for later retrieval. + */ +// TODO: not bothering with error checking for now (closed environment) +function setupWriteFileFunction(page, key, path_separator) { + page.evaluate(function(){ + window["%resultsObj%"] = {}; + window.fs_path_separator = "%fs_path_separator%"; + window.__phantom_writeFile = function(filename, text) { + window["%resultsObj%"][filename] = text; + }; + }, {resultsObj: key, fs_path_separator: path_separator.replace("\\", "\\\\")}); +} + +/** + * Returns the loaded page's filename => output object. + * + * @param {phantomjs.WebPage} page The WebPage object to retrieve data from. + * @param {string} key The name of the global object to be returned. Should + * be the same key provided to setupWriteFileFunction. + */ +function getXmlResults(page, key) { + return page.evaluate(function(){ + return window["%resultsObj%"] || {}; + }, {resultsObj: key}); +} + +/** + * Processes a page. + * + * @param {string} status The status from opening the page via WebPage#open. + * @param {phantomjs.WebPage} page The WebPage to be processed. + */ +function processPage(status, page, resultsKey) { + if (status === null && page) { + page.__exit_code = null; + return function(stat){ + processPage(stat, page, resultsKey); + }; + } + if (status !== "success") { + console.error("Unable to load resource: " + address); + page.__exit_code = 2; + } + else { + var isFinished = function() { + return page.evaluate(function(){ + // if there's a JUnitXmlReporter, return a boolean indicating if it is finished + if (window.jasmineReporters && window.jasmineReporters.startTime) { + return !!window.jasmineReporters.endTime; + } + // otherwise, scrape the DOM for the HtmlReporter "finished in ..." output + var durElem = document.querySelector(".html-reporter .duration"); + if (!durElem) { + durElem = document.querySelector(".jasmine_html-reporter .duration"); + } + return durElem && durElem.textContent && durElem.textContent.toLowerCase().indexOf("finished in") === 0; + }); + }; + var getResultsFromHtmlRunner = function() { + return page.evaluate(function(){ + var resultElem = document.querySelector(".html-reporter .alert .bar"); + if (!resultElem) { + resultElem = document.querySelector(".jasmine_html-reporter .alert .bar"); + } + return resultElem && resultElem.textContent && + resultElem.textContent.match(/(\d+) spec.* (\d+) failure.*/) || + ["Unable to determine success or failure."]; + }); + }; + var timeout = 60000; + var loopInterval = 100; + var ival = setInterval(function(){ + if (isFinished()) { + // get the results that need to be written to disk + var fs = require("fs"), + xml_results = getXmlResults(page, resultsKey), + output; + for (var filename in xml_results) { + if (xml_results.hasOwnProperty(filename) && (output = xml_results[filename]) && typeof(output) === "string") { + fs.write(filename, output, "w"); + } + } + + // print out a success / failure message of the results + var results = getResultsFromHtmlRunner(); + var failures = Number(results[2]); + if (failures > 0) { + page.__exit_code = 1; + clearInterval(ival); + } + else { + page.__exit_code = 0; + clearInterval(ival); + } + } + else { + timeout -= loopInterval; + if (timeout <= 0) { + console.log('Page has timed out; aborting.'); + page.__exit_code = 2; + clearInterval(ival); + } + } + }, loopInterval); + } +} diff --git a/dashboard-ui/bower_components/fingerprintjs2/specs/phantomjs.runner.sh b/dashboard-ui/bower_components/fingerprintjs2/specs/phantomjs.runner.sh new file mode 100644 index 000000000..22b61d995 --- /dev/null +++ b/dashboard-ui/bower_components/fingerprintjs2/specs/phantomjs.runner.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +# sanity check to make sure phantomjs exists in the PATH +hash /usr/bin/env phantomjs &> /dev/null +if [ $? -eq 1 ]; then + echo "ERROR: phantomjs is not installed" + echo "Please visit http://www.phantomjs.org/" + exit 1 +fi + +# sanity check number of args +if [ $# -lt 1 ] +then + echo "Usage: `basename $0` path_to_runner.html" + echo + exit 1 +fi + +SCRIPTDIR=$(dirname `perl -e 'use Cwd "abs_path";print abs_path(shift)' $0`) +TESTFILE="" +while (( "$#" )); do + if [ ${1:0:7} == "http://" -o ${1:0:8} == "https://" ]; then + TESTFILE="$TESTFILE $1" + else + TESTFILE="$TESTFILE `perl -e 'use Cwd "abs_path";print abs_path(shift)' $1`" + fi + shift +done + +# cleanup previous test runs +cd $SCRIPTDIR +rm -f *.xml + +# make sure phantomjs submodule is initialized +cd .. +git submodule update --init + +# fire up the phantomjs environment and run the test +cd $SCRIPTDIR +/usr/bin/env phantomjs $SCRIPTDIR/phantomjs-testrunner.js $TESTFILE diff --git a/dashboard-ui/bower_components/fingerprintjs2/specs/spec_runner.html b/dashboard-ui/bower_components/fingerprintjs2/specs/spec_runner.html new file mode 100644 index 000000000..6125ec1e1 --- /dev/null +++ b/dashboard-ui/bower_components/fingerprintjs2/specs/spec_runner.html @@ -0,0 +1,35 @@ + + + + + Fingerprint2 spec runner + + + + + + + + + + + + + + + + + + + + + + diff --git a/dashboard-ui/bower_components/fingerprintjs2/specs/specs.js b/dashboard-ui/bower_components/fingerprintjs2/specs/specs.js new file mode 100644 index 000000000..8d00c96a1 --- /dev/null +++ b/dashboard-ui/bower_components/fingerprintjs2/specs/specs.js @@ -0,0 +1,170 @@ +"use strict"; +describe("Fingerprint2", function () { + describe("new", function () { + it("creates a new instance of FP2", function () { + expect(new Fingerprint2()).not.toBeNull(); + }); + + it("accepts an empty options object", function () { + expect(new Fingerprint2({})).not.toBeNull(); + }); + + it("uses default options", function () { + var fp2 = new Fingerprint2(); + expect(fp2.options.swfContainerId).toEqual("fingerprintjs2"); + expect(fp2.options.swfPath).toEqual("flash/compiled/FontList.swf"); + }); + + it("allows to override default options", function () { + var fp2 = new Fingerprint2({swfPath: "newpath"}); + expect(fp2.options.swfContainerId).toEqual("fingerprintjs2"); + expect(fp2.options.swfPath).toEqual("newpath"); + }); + + it("allows to add new options", function () { + var fp2 = new Fingerprint2({excludeUserAgent: true}); + expect(fp2.options.swfContainerId).toEqual("fingerprintjs2"); + expect(fp2.options.swfPath).toEqual("flash/compiled/FontList.swf"); + expect(fp2.options.excludeUserAgent).toBe(true); + }); + + describe("sortPluginsFor", function () { + it("has default value", function (){ + var fp2 = new Fingerprint2(); + expect(fp2.options.sortPluginsFor).toEqual([/palemoon/i]); + }); + + it("allows to set new array of regexes", function () { + var fp2 = new Fingerprint2({sortPluginsFor: [/firefox/i, /chrome/i]}); + expect(fp2.options.sortPluginsFor).toEqual([/firefox/i, /chrome/i]); + }); + }); + }); + + describe("get", function () { + describe("default options", function () { + it("calculates fingerprint", function (done) { + var fp2 = new Fingerprint2(); + fp2.get(function(result){ + expect(result).toMatch(/^[0-9a-f]{32}$/i); + done(); + }); + }); + + it("does not try calling flash font detection", function (done) { + var fp2 = new Fingerprint2(); + spyOn(fp2, "flashFontsKey"); + fp2.get(function(result) { + expect(fp2.flashFontsKey).not.toHaveBeenCalled(); + done(); + }); + }); + }); + + describe("non-default options", function () { + it("does not use userAgent when excluded", function (done) { + var fp2 = new Fingerprint2({excludeUserAgent: true}); + spyOn(fp2, "getUserAgent"); + fp2.get(function(result) { + expect(fp2.getUserAgent).not.toHaveBeenCalled(); + done(); + }); + }); + + it("does not use screen resolution when excluded", function (done) { + var fp2 = new Fingerprint2({excludeScreenResolution: true}); + spyOn(fp2, "getScreenResolution"); + fp2.get(function(result) { + expect(fp2.getScreenResolution).not.toHaveBeenCalled(); + done(); + }); + }); + + it("does not use available screen resolution when excluded", function (done) { + var fp2 = new Fingerprint2({excludeAvailableScreenResolution: true}); + spyOn(fp2, "getAvailableScreenResolution"); + fp2.get(function(result) { + expect(fp2.getAvailableScreenResolution).not.toHaveBeenCalled(); + done(); + }); + }); + + it("does not use plugins info when excluded", function (done) { + var fp2 = new Fingerprint2({excludePlugins: true}); + spyOn(fp2, "getRegularPlugins"); + fp2.get(function(result) { + expect(fp2.getRegularPlugins).not.toHaveBeenCalled(); + done(); + }); + }); + }); + + describe("returns components", function () { + it("does it return components as a second argument to callback", function (done) { + var fp2 = new Fingerprint2(); + fp2.get(function(result, components) { + expect(components).not.toBeNull(); + done(); + }); + }); + + it("checks if returned components is array", function (done) { + var fp2 = new Fingerprint2(); + fp2.get(function(result, components) { + expect(components).toBeArrayOfObjects(); + done(); + }); + }); + + it("checks if js_fonts component is array", function (done) { + var fp2 = new Fingerprint2(); + fp2.get(function(result, components) { + for(var x = 0; x < components.length; x++) { + if(components[x].key == "js_fonts") { + expect(components[x].value).toBeArray(); + } + } + done(); + }); + }); + + it("returns user_agent as the first element", function (done) { + var fp2 = new Fingerprint2(); + fp2.get(function(result, components) { + expect(components[0].key).toEqual("user_agent"); + done(); + }); + }); + }); + + describe("baseFontArray iteration", function () { + it("only iterates specified items", function (done) { + var baseFonts = ["monospace", "sans-serif", "serif"]; + var ctr = 0; + for (var x in baseFonts) { + ctr++; + } + + expect(baseFonts.length).toEqual(3); + expect(ctr).toEqual(baseFonts.length); + + // Somewhere deep in your JavaScript library... + Array.prototype.foo = 1; + Array.prototype.bar = 2; + ctr = 0; + for (var x in baseFonts) { + console.log(x); + ctr++; + // Now foo & bar is a part of EVERY array and + // will show up here as a value of 'x'. + } + + expect(baseFonts.length).toEqual(3); + // sadface + expect(ctr).not.toEqual(baseFonts.length); + expect(ctr).toEqual(5); + done(); + }); + }); + }); +}); diff --git a/dashboard-ui/components/apphost.js b/dashboard-ui/components/apphost.js index 7118ba4fe..ccbd686dd 100644 --- a/dashboard-ui/components/apphost.js +++ b/dashboard-ui/components/apphost.js @@ -31,6 +31,53 @@ define(['appStorage', 'browser'], function (appStorage, browser) { }); } + function getDeviceId() { + var key = '_deviceId2'; + var deviceId = appStorage.getItem(key); + + if (deviceId) { + return Promise.resolve(deviceId); + } else { + return generateDeviceId().then(function (deviceId) { + appStorage.setItem(key, deviceId); + return deviceId; + }); + } + } + + function getDeviceName() { + var deviceName; + + if (browser.chrome) { + deviceName = "Chrome"; + } else if (browser.edge) { + deviceName = "Edge"; + } else if (browser.firefox) { + deviceName = "Firefox"; + } else if (browser.msie) { + deviceName = "Internet Explorer"; + } else { + deviceName = "Web Browser"; + } + + if (browser.version) { + deviceName += " " + browser.version; + } + + if (browser.ipad) { + deviceName += " Ipad"; + } else if (browser.iphone) { + deviceName += " Iphone"; + } else if (browser.android) { + deviceName += " Android"; + } + + return deviceName; + } + + var appInfo; + var version = window.dashboardVersion || '3.0'; + return { getWindowState: function () { return document.windowState || 'Normal'; @@ -49,54 +96,36 @@ define(['appStorage', 'browser'], function (appStorage, browser) { return features.indexOf(command.toLowerCase()) != -1; }, + appInfo: function () { + + if (appInfo) { + return Promise.resolve(appInfo); + } + + return getDeviceId().then(function (deviceId) { + + appInfo = { + deviceId: deviceId, + deviceName: getDeviceName(), + appName: 'Emby Mobile', + appVersion: version + }; + + return appInfo; + }); + }, appName: function () { return 'Emby Mobile'; }, appVersion: function () { - return '2.0.1'; + return version; }, deviceName: function () { - var deviceName; - - if (browser.chrome) { - deviceName = "Chrome"; - } else if (browser.edge) { - deviceName = "Edge"; - } else if (browser.firefox) { - deviceName = "Firefox"; - } else if (browser.msie) { - deviceName = "Internet Explorer"; - } else { - deviceName = "Web Browser"; - } - - if (browser.version) { - deviceName += " " + browser.version; - } - - if (browser.ipad) { - deviceName += " Ipad"; - } else if (browser.iphone) { - deviceName += " Iphone"; - } else if (browser.android) { - deviceName += " Android"; - } - - return deviceName; + return getDeviceName(); }, deviceId: function () { - var key = '_deviceId2'; - var deviceId = appStorage.getItem(key); - - if (deviceId) { - return Promise.resolve(deviceId); - } else { - return generateDeviceId().then(function (deviceId) { - appStorage.setItem(key, deviceId); - return deviceId; - }); - } + return getDeviceId(); }, capabilities: getCapabilities }; diff --git a/dashboard-ui/scripts/mediaplayer.js b/dashboard-ui/scripts/mediaplayer.js index 1a2e9ff27..bbc6ccd22 100644 --- a/dashboard-ui/scripts/mediaplayer.js +++ b/dashboard-ui/scripts/mediaplayer.js @@ -34,7 +34,7 @@ define(['appSettings', 'userSettings', 'appStorage'], function (appSettings, use var targets = [{ name: Globalize.translate('MyDevice'), - id: AppInfo.deviceId, + id: ConnectionManager.deviceId(), playerName: self.name, playableMediaTypes: ['Audio', 'Video'], isLocalPlayer: true, diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index 3e1e84bf9..f6a4a81f9 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -1401,6 +1401,9 @@ var AppInfo = {}; } function defineConnectionManager(connectionManager) { + + window.ConnectionManager = connectionManager; + define('connectionManager', [], function () { return connectionManager; }); @@ -1409,6 +1412,8 @@ var AppInfo = {}; var localApiClient; function bindConnectionManagerEvents(connectionManager, events) { + Events.on(ConnectionManager, 'apiclientcreated', onApiClientCreated); + connectionManager.currentApiClient = function () { if (!localApiClient) { @@ -1435,42 +1440,51 @@ var AppInfo = {}; //localStorage.clear(); function createConnectionManager(credentialProviderFactory, capabilities) { - var credentialKey = Dashboard.isConnectMode() ? null : 'servercredentials4'; - var credentialProvider = new credentialProviderFactory(credentialKey); - return getSyncProfile().then(function (deviceProfile) { - capabilities.DeviceProfile = deviceProfile; + return new Promise(function (resolve, reject) { - window.ConnectionManager = new MediaBrowser.ConnectionManager(credentialProvider, AppInfo.appName, AppInfo.appVersion, AppInfo.deviceName, AppInfo.deviceId, capabilities, window.devicePixelRatio); + require(['connectionManagerFactory', 'apphost', 'credentialprovider', 'events'], function (connectionManagerExports, apphost, credentialProvider, events) { - defineConnectionManager(window.ConnectionManager); - bindConnectionManagerEvents(window.ConnectionManager, Events); + window.MediaBrowser = Object.assign(window.MediaBrowser || {}, connectionManagerExports); - console.log('binding to apiclientcreated'); - Events.on(ConnectionManager, 'apiclientcreated', onApiClientCreated); + var credentialProviderInstance = new credentialProvider(); - if (Dashboard.isConnectMode()) { + apphost.appInfo().then(function (appInfo) { - return Promise.resolve(); + var capabilities = Dashboard.capabilities(); + capabilities.DeviceProfile = deviceProfile; - } else { + connectionManager = new MediaBrowser.ConnectionManager(credentialProviderInstance, appInfo.appName, appInfo.appVersion, appInfo.deviceName, appInfo.deviceId, capabilities, window.devicePixelRatio); - console.log('loading ApiClient singleton'); + defineConnectionManager(connectionManager); + bindConnectionManagerEvents(connectionManager, events); - return getRequirePromise(['apiclient']).then(function (apiClientFactory) { + if (Dashboard.isConnectMode()) { - console.log('creating ApiClient singleton'); + resolve(); - var apiClient = new apiClientFactory(Dashboard.serverAddress(), AppInfo.appName, AppInfo.appVersion, AppInfo.deviceName, AppInfo.deviceId, window.devicePixelRatio); - apiClient.enableAutomaticNetworking = false; - ConnectionManager.addApiClient(apiClient); - require(['css!' + apiClient.getUrl('Branding/Css')]); - window.ApiClient = apiClient; - localApiClient = apiClient; - console.log('loaded ApiClient singleton'); + } else { + + console.log('loading ApiClient singleton'); + + return getRequirePromise(['apiclient']).then(function (apiClientFactory) { + + console.log('creating ApiClient singleton'); + + var apiClient = new apiClientFactory(Dashboard.serverAddress(), appInfo.appName, appInfo.appVersion, appInfo.deviceName, appInfo.deviceId, window.devicePixelRatio); + apiClient.enableAutomaticNetworking = false; + connectionManager.addApiClient(apiClient); + require(['css!' + apiClient.getUrl('Branding/Css')]); + window.ApiClient = apiClient; + localApiClient = apiClient; + console.log('loaded ApiClient singleton'); + resolve(); + }); + } + }); }); - } + }); }); } @@ -1609,7 +1623,7 @@ var AppInfo = {}; events: apiClientBowerPath + '/events', credentialprovider: apiClientBowerPath + '/credentials', apiclient: apiClientBowerPath + '/apiclient', - connectionmanagerfactory: apiClientBowerPath + '/connectionmanager', + connectionManagerFactory: bowerPath + '/emby-apiclient/connectionmanager', visibleinviewport: embyWebComponentsBowerPath + "/visibleinviewport", browserdeviceprofile: embyWebComponentsBowerPath + "/browserdeviceprofile", browser: embyWebComponentsBowerPath + "/browser", @@ -1766,6 +1780,7 @@ var AppInfo = {}; define('objectassign', [embyWebComponentsBowerPath + '/objectassign']); define('webcomponentsjs', [bowerPath + '/webcomponentsjs/webcomponents-lite.min.js']); define('native-promise-only', [bowerPath + '/native-promise-only/lib/npo.src']); + define("fingerprintjs2", [bowerPath + '/fingerprintjs2/fingerprint2'], returnFirstDependency); if (Dashboard.isRunningInCordova()) { define('registrationservices', ['cordova/registrationservices']); @@ -2005,10 +2020,6 @@ var AppInfo = {}; window.Events = events; - for (var i in hostingAppInfo) { - AppInfo[i] = hostingAppInfo[i]; - } - initAfterDependencies(); }); } @@ -2040,9 +2051,6 @@ var AppInfo = {}; } var deps = []; - deps.push('connectionmanagerfactory'); - deps.push('credentialprovider'); - deps.push('scripts/extensions'); if (!window.fetch) { @@ -2053,14 +2061,9 @@ var AppInfo = {}; deps.push('objectassign'); } - require(deps, function (connectionManagerExports, credentialProviderFactory) { + require(deps, function () { - window.MediaBrowser = window.MediaBrowser || {}; - for (var i in connectionManagerExports) { - MediaBrowser[i] = connectionManagerExports[i]; - } - - createConnectionManager(credentialProviderFactory, Dashboard.capabilities()).then(function () { + createConnectionManager().then(function () { console.log('initAfterDependencies promises resolved'); MediaController.init(); @@ -2982,117 +2985,6 @@ var AppInfo = {}; }); } - function getCordovaHostingAppInfo() { - - return new Promise(function (resolve, reject) { - - document.addEventListener("deviceready", function () { - - cordova.getAppVersion.getVersionNumber(function (appVersion) { - - require(['appStorage'], function (appStorage) { - - var name = browserInfo.android ? "Emby for Android Mobile" : (browserInfo.safari ? "Emby for iOS" : "Emby Mobile"); - - // Remove special characters - var cleanDeviceName = device.model.replace(/[^\w\s]/gi, ''); - - var deviceId = null; - - if (window.MainActivity) { - - deviceId = appStorage.getItem('legacyDeviceId'); - - if (!deviceId) { - deviceId = MainActivity.getLegacyDeviceId(); - appStorage.setItem('legacyDeviceId', deviceId); - } - } - - resolve({ - deviceId: deviceId || device.uuid, - deviceName: cleanDeviceName, - appName: name, - appVersion: appVersion - }); - }); - - }); - - }, false); - }); - } - - function getWebHostingAppInfo() { - - return new Promise(function (resolve, reject) { - - require(['appStorage'], function (appStorage) { - var deviceName; - - if (browserInfo.chrome) { - deviceName = "Chrome"; - } else if (browserInfo.edge) { - deviceName = "Edge"; - } else if (browserInfo.firefox) { - deviceName = "Firefox"; - } else if (browserInfo.msie) { - deviceName = "Internet Explorer"; - } else { - deviceName = "Web Browser"; - } - - if (browserInfo.version) { - deviceName += " " + browserInfo.version; - } - - if (browserInfo.ipad) { - deviceName += " Ipad"; - } else if (browserInfo.iphone) { - deviceName += " Iphone"; - } else if (browserInfo.android) { - deviceName += " Android"; - } - - function onDeviceAdAcquired(id) { - - resolve({ - deviceId: id, - deviceName: deviceName, - appName: "Emby Web Client", - appVersion: window.dashboardVersion - }); - } - - var deviceIdKey = '_deviceId1'; - var deviceId = appStorage.getItem(deviceIdKey); - - if (deviceId) { - onDeviceAdAcquired(deviceId); - } else { - require(['cryptojs-sha1'], function () { - var keys = []; - keys.push(navigator.userAgent); - keys.push((navigator.cpuClass || "")); - keys.push(new Date().getTime()); - var randomId = CryptoJS.SHA1(keys.join('|')).toString(); - appStorage.setItem(deviceIdKey, randomId); - onDeviceAdAcquired(randomId); - }); - } - }); - }); - } - - function getHostingAppInfo() { - - if (Dashboard.isRunningInCordova()) { - return getCordovaHostingAppInfo(); - } - - return getWebHostingAppInfo(); - } - initRequire(); function onWebComponentsReady() { @@ -3114,7 +3006,7 @@ var AppInfo = {}; setAppInfo(); setDocumentClasses(browser); - getHostingAppInfo().then(init); + init(); }); } diff --git a/dashboard-ui/scripts/sync.js b/dashboard-ui/scripts/sync.js index 09eca0de0..57918e4d0 100644 --- a/dashboard-ui/scripts/sync.js +++ b/dashboard-ui/scripts/sync.js @@ -1,4 +1,4 @@ -define(['jQuery'], function ($) { +define(['apphost', 'jQuery'], function (appHost, $) { var currentDialogOptions; @@ -82,12 +82,15 @@ return new Promise(function (resolve, reject) { require(['paper-checkbox', 'paper-input', 'emby-collapsible'], function () { - renderFormInternal(options, resolve); + + appHost.appInfo().then(function (appInfo) { + renderFormInternal(options, appInfo, resolve); + }); }); }); } - function renderFormInternal(options, resolve) { + function renderFormInternal(options, appInfo, resolve) { var elem = options.elem; var dialogOptions = options.dialogOptions; @@ -113,7 +116,7 @@ html += targets.map(function (t) { - var isSelected = t.Id == AppInfo.deviceId; + var isSelected = t.Id == appInfo.deviceId; var selectedHtml = isSelected ? ' selected="selected"' : ''; return '' + t.Name + '';