{"version":3,"sources":["node_modules/browser-pack/_prelude.js","lib/constants.js","autotrack.js","lib/plugins/event-tracker.js","lib/plugins/media-query-tracker.js","lib/plugins/outbound-form-tracker.js","lib/plugins/outbound-link-tracker.js","lib/plugins/social-tracker.js","lib/plugins/url-change-tracker.js","lib/provide.js","lib/utilities.js","node_modules/closest/index.js","node_modules/date-now/index.js","node_modules/debounce/index.js","node_modules/delegate/src/delegate.js","node_modules/matches-selector/index.js"],"names":["e","t","n","r","s","o","u","a","require","i","f","Error","code","l","exports","call","length",1,"module","DEV_ID",2,"EventTracker","tracker","opts","window","addEventListener","this","defaults","attributePrefix","prefix","selector","delegate","document","handleEventClicks","bind","provide","prototype","event","link","delegateTarget","send","eventCategory","getAttribute","eventAction","eventLabel","eventValue","remove","destroy","../provide","../utilities",3,"MediaQueryTracker","matchMedia","mediaQueryDefinitions","mediaQueryChangeTemplate","changeTemplate","mediaQueryChangeTimeout","isObject","toArray","changeListeners","processMediaQueries","getMediaListener","media","mediaMap","debounce","NULL_DIMENSION","forEach","definition","name","dimensionIndex","mediaName","getMatchName","set","addChangeListeners","match","items","item","matches","mql","fn","handleChanges","addListener","push","newValue","oldValue","get","listener","removeListener",4,"OutboundFormTracker","shouldTrackOutboundForm","handleFormSubmits","utilities","form","action","fieldsObj","transport","navigator","sendBeacon","preventDefault","hitCallback","withTimeout","submit","indexOf","location","hostname",5,"OutboundLinkTracker","shouldTrackOutboundLink","handleLinkClicks","target","href","protocol",6,"SocialTracker","handleSocialClicks","addWidgetListeners","addTwitterEventHandlers","handleTweetEvents","handleFollowEvents","handleLikeEvents","handleUnlikeEvents","readyState","FB","addFacebookEventHandlers","twttr","socialNetwork","socialAction","socialTarget","ready","events","err","removeTwitterEventHandlers","unbind","Event","subscribe","removeFacebookEventHandlers","unsubscribe","region","url","data","screenName","screen_name","removeEventListener",7,"UrlChangeTracker","history","pushState","shouldTrackUrlChange","path","getPath","updateTrackerData","originalPushState","state","title","apply","arguments","originalReplaceState","replaceState","pathname","search","shouldSendPageview","setTimeout","oldPath","newPath","page",8,"constants","gaDevIds","pluginName","pluginConstructor","gaAlias","gaplugins","capitalize","./constants","./utilities",9,"callback","wait","called","overrides","result","key","hasOwnProperty","str","charAt","toUpperCase","slice","value","isArray","Array","Object","toString",10,"element","checkYoSelf","parent","parentNode","matches-selector",11,"now","Date","getTime",12,"func","immediate","later","last","timestamp","timeout","context","args","callNow","date-now",13,"type","useCapture","listenerFn","closest",14,"el","vendor","nodes","querySelectorAll","proto","Element","matchesSelector","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector",15,"Autotrack","ga","GoogleAnalyticsObject","./event-tracker","./media-query-tracker","./outbound-form-tracker","./outbound-link-tracker","./social-tracker","./url-change-tracker"],"mappings":";;;;;;;;;;;;;;;;;;CAAA,QAAAA,GAAAC,EAAAC,EAAAC,GAAA,QAAAC,GAAAC,EAAAC,GAAA,IAAAJ,EAAAG,GAAA,CAAA,IAAAJ,EAAAI,GAAA,CAAA,GAAAE,GAAA,kBAAAC,UAAAA,OAAA,KAAAF,GAAAC,EAAA,MAAAA,GAAAF,GAAA,EAAA,IAAAI,EAAA,MAAAA,GAAAJ,GAAA,EAAA,IAAAK,GAAA,GAAAC,OAAA,uBAAAN,EAAA,IAAA,MAAAK,GAAAE,KAAA,mBAAAF,EAAA,GAAAG,GAAAX,EAAAG,IAAAS,WAAAb,GAAAI,GAAA,GAAAU,KAAAF,EAAAC,QAAA,SAAAd,GAAA,GAAAE,GAAAD,EAAAI,GAAA,GAAAL,EAAA,OAAAI,GAAAF,EAAAA,EAAAF,IAAAa,EAAAA,EAAAC,QAAAd,EAAAC,EAAAC,EAAAC,GAAA,MAAAD,GAAAG,GAAAS,QAAA,IAAA,GAAAL,GAAA,kBAAAD,UAAAA,QAAAH,EAAA,EAAAA,EAAAF,EAAAa,OAAAX,IAAAD,EAAAD,EAAAE,GAAA,OAAAD,KAAAa,GAAA,SAAAT,EAAAU,EAAAJ,GCiBAI,EAAAJ,SACA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5Cf,EAAQ,mBACRA,EAAQ,yBACRA,EAAQ,2BACRA,EAAQ,2BACRA,EAAQ,oBACRA,EAAQ,uBAIR,IAAI2B,GAAU3B,EAAQ,aAuBtB2B,GAAQ,YAAaqM,KAElBxL,aAAa,EAAE2L,kBAAkB,EAAEC,wBAAwB,EAAEC,0BAA0B,EAAEC,0BAA0B,EAAEC,mBAAmB,EAAEC,uBAAuB,SAAS","file":"autotrack.js","sourcesContent":["(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 ' + newValue;\n};\n\n\n/**\n * Accepts a media query and returns a MediaQueryListener object.\n * Caches the values to avoid multiple unnecessary instances.\n * @param {string} media A media query value.\n * @return {MediaQueryListener} The matched media.\n */\nfunction getMediaListener(media) {\n // Returns early if the media is cached.\n if (mediaMap[media]) return mediaMap[media];\n\n mediaMap[media] = window.matchMedia(media);\n return mediaMap[media];\n}\n\n\nprovide('mediaQueryTracker', MediaQueryTracker);\n\n},{\"../provide\":8,\"../utilities\":9,\"debounce\":12}],4:[function(require,module,exports){\n/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nvar defaults = require('../utilities').defaults;\nvar delegate = require('delegate');\nvar provide = require('../provide');\nvar utilities = require('../utilities');\n\n\n/**\n * Registers outbound form tracking.\n * @constructor\n * @param {Object} tracker Passed internally by analytics.js\n * @param {?Object} opts Passed by the require command.\n */\nfunction OutboundFormTracker(tracker, opts) {\n\n // Feature detects to prevent errors in unsupporting browsers.\n if (!window.addEventListener) return;\n\n this.opts = defaults(opts, {\n shouldTrackOutboundForm: this.shouldTrackOutboundForm\n });\n\n this.tracker = tracker;\n\n this.delegate = delegate(document, 'form',\n 'submit', this.handleFormSubmits.bind(this));\n}\n\n\n/**\n * Handles all submits on form elements. A form submit is considered outbound\n * if its action attribute starts with http and does not contain\n * location.hostname.\n * When the beacon transport method is not available, the event's default\n * action is prevented and re-emitted after the hit is sent.\n * @param {Event} event The DOM submit event.\n */\nOutboundFormTracker.prototype.handleFormSubmits = function(event) {\n\n var form = event.delegateTarget;\n var action = form.getAttribute('action');\n var fieldsObj = {transport: 'beacon'};\n\n if (this.opts.shouldTrackOutboundForm(form)) {\n\n if (!navigator.sendBeacon) {\n // Stops the submit and waits until the hit is complete (with timeout)\n // for browsers that don't support beacon.\n event.preventDefault();\n fieldsObj.hitCallback = utilities.withTimeout(function() {\n form.submit();\n });\n }\n\n this.tracker.send('event', 'Outbound Form', 'submit', action, fieldsObj);\n }\n};\n\n\n/**\n * Determines whether or not the tracker should send a hit when a form is\n * submitted. By default, forms with an action attribute that starts with\n * \"http\" and doesn't contain the current hostname are tracked.\n * @param {Element} form The form that was submitted.\n * @return {boolean} Whether or not the form should be tracked.\n */\nOutboundFormTracker.prototype.shouldTrackOutboundForm = function(form) {\n var action = form.getAttribute('action');\n return action &&\n action.indexOf('http') === 0 &&\n action.indexOf(location.hostname) < 0;\n};\n\n\n/**\n * Removes all event listeners and instance properties.\n */\n OutboundFormTracker.prototype.remove = function() {\n this.delegate.destroy();\n this.delegate = null;\n this.tracker = null;\n this.opts = null;\n};\n\n\nprovide('outboundFormTracker', OutboundFormTracker);\n\n},{\"../provide\":8,\"../utilities\":9,\"delegate\":13}],5:[function(require,module,exports){\n/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nvar defaults = require('../utilities').defaults;\nvar delegate = require('delegate');\nvar provide = require('../provide');\n\n\n/**\n * Registers outbound link tracking on a tracker object.\n * @constructor\n * @param {Object} tracker Passed internally by analytics.js\n * @param {?Object} opts Passed by the require command.\n */\nfunction OutboundLinkTracker(tracker, opts) {\n\n // Feature detects to prevent errors in unsupporting browsers.\n if (!window.addEventListener) return;\n\n this.opts = defaults(opts, {\n shouldTrackOutboundLink: this.shouldTrackOutboundLink\n });\n\n this.tracker = tracker;\n\n this.delegate = delegate(document, 'a',\n 'click', this.handleLinkClicks.bind(this));\n}\n\n\n/**\n * Handles all clicks on link elements. A link is considered an outbound link\n * its hostname property does not match location.hostname. When the beacon\n * transport method is not available, the links target is set to \"_blank\" to\n * ensure the hit can be sent.\n * @param {Event} event The DOM click event.\n */\nOutboundLinkTracker.prototype.handleLinkClicks = function(event) {\n var link = event.delegateTarget;\n if (this.opts.shouldTrackOutboundLink(link)) {\n // Opens outbound links in a new tab if the browser doesn't support\n // the beacon transport method.\n if (!navigator.sendBeacon) {\n link.target = '_blank';\n }\n this.tracker.send('event', 'Outbound Link', 'click', link.href, {\n transport: 'beacon'\n });\n }\n};\n\n\n/**\n * Determines whether or not the tracker should send a hit when a link is\n * clicked. By default links with a hostname property not equal to the current\n * hostname are tracked.\n * @param {Element} link The link that was clicked on.\n * @return {boolean} Whether or not the link should be tracked.\n */\nOutboundLinkTracker.prototype.shouldTrackOutboundLink = function(link) {\n return link.hostname != location.hostname &&\n link.protocol.indexOf('http') === 0;\n};\n\n\n/**\n * Removes all event listeners and instance properties.\n */\nOutboundLinkTracker.prototype.remove = function() {\n this.delegate.destroy();\n this.delegate = null;\n this.tracker = null;\n this.opts = null;\n};\n\n\nprovide('outboundLinkTracker', OutboundLinkTracker);\n\n},{\"../provide\":8,\"../utilities\":9,\"delegate\":13}],6:[function(require,module,exports){\n/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/* global FB, twttr */\n\n\nvar defaults = require('../utilities').defaults;\nvar delegate = require('delegate');\nvar provide = require('../provide');\n\n\n/**\n * Registers social tracking on tracker object.\n * Supports both declarative social tracking via HTML attributes as well as\n * tracking for social events when using official Twitter or Facebook widgets.\n * @constructor\n * @param {Object} tracker Passed internally by analytics.js\n * @param {?Object} opts Passed by the require command.\n */\nfunction SocialTracker(tracker, opts) {\n\n // Feature detects to prevent errors in unsupporting browsers.\n if (!window.addEventListener) return;\n\n this.opts = defaults(opts, {\n attributePrefix: 'data-'\n });\n\n this.tracker = tracker;\n\n var prefix = this.opts.attributePrefix;\n var selector = '[' + prefix + 'social-network]' +\n '[' + prefix + 'social-action]' +\n '[' + prefix + 'social-target]';\n\n // Binds methods to `this`.\n this.handleSocialClicks = this.handleSocialClicks.bind(this);\n this.addWidgetListeners = this.addWidgetListeners.bind(this);\n this.addTwitterEventHandlers = this.addTwitterEventHandlers.bind(this);\n this.handleTweetEvents = this.handleTweetEvents.bind(this);\n this.handleFollowEvents = this.handleFollowEvents.bind(this);\n this.handleLikeEvents = this.handleLikeEvents.bind(this);\n this.handleUnlikeEvents = this.handleUnlikeEvents.bind(this);\n\n this.delegate = delegate(document, selector,\n 'click', this.handleSocialClicks);\n\n if (document.readyState != 'complete') {\n // Adds the widget listeners after the window's `load` event fires.\n // If loading widgets using the officially recommended snippets, they\n // will be available at `window.load`. If not users can call the\n // `addWidgetListeners` method manually.\n window.addEventListener('load', this.addWidgetListeners);\n }\n else {\n this.addWidgetListeners();\n }\n}\n\n\n/**\n * Invokes the methods to add Facebook and Twitter widget event listeners.\n * Ensures the respective global namespaces are present before adding.\n */\nSocialTracker.prototype.addWidgetListeners = function() {\n if (window.FB) this.addFacebookEventHandlers();\n if (window.twttr) this.addTwitterEventHandlers();\n};\n\n\n/**\n * Handles all clicks on elements with social tracking attributes.\n * @param {Event} event The DOM click event.\n */\nSocialTracker.prototype.handleSocialClicks = function(event) {\n\n var link = event.delegateTarget;\n var prefix = this.opts.attributePrefix;\n\n this.tracker.send('social', {\n socialNetwork: link.getAttribute(prefix + 'social-network'),\n socialAction: link.getAttribute(prefix + 'social-action'),\n socialTarget: link.getAttribute(prefix + 'social-target')\n });\n};\n\n\n/**\n * Adds event handlers for the \"tweet\" and \"follow\" events emitted by the\n * official tweet and follow buttons. Note: this does not capture tweet or\n * follow events emitted by other Twitter widgets (tweet, timeline, etc.).\n */\nSocialTracker.prototype.addTwitterEventHandlers = function() {\n try {\n twttr.ready(function() {\n twttr.events.bind('tweet', this.handleTweetEvents);\n twttr.events.bind('follow', this.handleFollowEvents);\n }.bind(this));\n } catch(err) {}\n};\n\n\n/**\n * Removes event handlers for the \"tweet\" and \"follow\" events emitted by the\n * official tweet and follow buttons.\n */\nSocialTracker.prototype.removeTwitterEventHandlers = function() {\n try {\n twttr.ready(function() {\n twttr.events.unbind('tweet', this.handleTweetEvents);\n twttr.events.unbind('follow', this.handleFollowEvents);\n }.bind(this));\n } catch(err) {}\n};\n\n\n/**\n * Adds event handlers for the \"like\" and \"unlike\" events emitted by the\n * official Facebook like button.\n */\nSocialTracker.prototype.addFacebookEventHandlers = function() {\n try {\n FB.Event.subscribe('edge.create', this.handleLikeEvents);\n FB.Event.subscribe('edge.remove', this.handleUnlikeEvents);\n } catch(err) {}\n};\n\n\n/**\n * Removes event handlers for the \"like\" and \"unlike\" events emitted by the\n * official Facebook like button.\n */\nSocialTracker.prototype.removeFacebookEventHandlers = function() {\n try {\n FB.Event.unsubscribe('edge.create', this.handleLikeEvents);\n FB.Event.unsubscribe('edge.remove', this.handleUnlikeEvents);\n } catch(err) {}\n};\n\n\n/**\n * Handles `tweet` events emitted by the Twitter JS SDK.\n * @param {Object} event The Twitter event object passed to the handler.\n */\nSocialTracker.prototype.handleTweetEvents = function(event) {\n // Ignores tweets from widgets that aren't the tweet button.\n if (event.region != 'tweet') return;\n\n var url = event.data.url || event.target.getAttribute('data-url') ||\n location.href;\n\n this.tracker.send('social', 'Twitter', 'tweet', url);\n};\n\n\n/**\n * Handles `follow` events emitted by the Twitter JS SDK.\n * @param {Object} event The Twitter event object passed to the handler.\n */\nSocialTracker.prototype.handleFollowEvents = function(event) {\n // Ignore follows from widgets that aren't the follow button.\n if (event.region != 'follow') return;\n\n var screenName = event.data.screen_name ||\n event.target.getAttribute('data-screen-name');\n\n this.tracker.send('social', 'Twitter', 'follow', screenName);\n};\n\n\n/**\n * Handles `like` events emitted by the Facebook JS SDK.\n * @param {string} url The URL corresponding to the like event.\n */\nSocialTracker.prototype.handleLikeEvents = function(url) {\n this.tracker.send('social', 'Facebook', 'like', url);\n};\n\n\n/**\n * Handles `unlike` events emitted by the Facebook JS SDK.\n * @param {string} url The URL corresponding to the unlike event.\n */\nSocialTracker.prototype.handleUnlikeEvents = function(url) {\n this.tracker.send('social', 'Facebook', 'unlike', url);\n};\n\n\n/**\n * Removes all event listeners and instance properties.\n */\nSocialTracker.prototype.remove = function() {\n window.removeEventListener('load', this.addWidgetListeners);\n this.removeFacebookEventHandlers();\n this.removeTwitterEventHandlers();\n\n this.delegate.destroy();\n this.delegate = null;\n this.tracker = null;\n this.opts = null;\n\n this.handleSocialClicks = null;\n this.addWidgetListeners = null;\n this.addTwitterEventHandlers = null;\n this.handleTweetEvents = null;\n this.handleFollowEvents = null;\n this.handleLikeEvents = null;\n this.handleUnlikeEvents = null;\n};\n\n\nprovide('socialTracker', SocialTracker);\n\n},{\"../provide\":8,\"../utilities\":9,\"delegate\":13}],7:[function(require,module,exports){\n/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nvar defaults = require('../utilities').defaults;\nvar isObject = require('../utilities').isObject;\nvar provide = require('../provide');\n\n\n/**\n * Adds handler for the history API methods\n * @constructor\n * @param {Object} tracker Passed internally by analytics.js\n * @param {?Object} opts Passed by the require command.\n */\nfunction UrlChangeTracker(tracker, opts) {\n\n // Feature detects to prevent errors in unsupporting browsers.\n if (!history.pushState || !window.addEventListener) return;\n\n this.opts = defaults(opts, {\n shouldTrackUrlChange: this.shouldTrackUrlChange\n });\n\n this.tracker = tracker;\n\n // Sets the initial page field.\n // Don't set this on the tracker yet so campaign data can be retreived\n // from the location field.\n this.path = getPath();\n\n this.updateTrackerData = this.updateTrackerData.bind(this);\n\n // Overrides history.pushState.\n this.originalPushState = history.pushState;\n history.pushState = function(state, title) {\n // Sets the document title for reference later.\n // TODO(philipwalton): consider using WeakMap for this to not conflict\n // with any user-defined property also called \"title\".\n if (isObject(state) && title) state.title = title;\n\n this.originalPushState.apply(history, arguments);\n this.updateTrackerData();\n }.bind(this);\n\n // Overrides history.repaceState.\n this.originalReplaceState = history.replaceState;\n history.replaceState = function(state, title) {\n // Sets the document title for reference later.\n // TODO(philipwalton): consider using WeakMap for this to not conflict\n // with any user-defined property also called \"title\".\n if (isObject(state) && title) state.title = title;\n\n this.originalReplaceState.apply(history, arguments);\n this.updateTrackerData(false);\n }.bind(this);\n\n // Handles URL changes via user interaction.\n window.addEventListener('popstate', this.updateTrackerData);\n}\n\n\n/**\n * Updates the page and title fields on the tracker if necessary and\n * optionally sends a pageview.\n * @param {boolean} shouldSendPageview Indicates whether the tracker should\n * send a pageview after updating the URL.\n */\nUrlChangeTracker.prototype.updateTrackerData = function(shouldSendPageview) {\n\n // Sets the default.\n shouldSendPageview = shouldSendPageview === false ? false : true;\n\n // Calls the update logic asychronously to help ensure user callbacks\n // happen first.\n setTimeout(function() {\n\n var oldPath = this.path;\n var newPath = getPath();\n\n if (oldPath != newPath &&\n this.opts.shouldTrackUrlChange.call(this, newPath, oldPath)) {\n\n this.path = newPath;\n this.tracker.set({\n page: newPath,\n title: isObject(history.state) && history.state.title || document.title\n });\n\n if (shouldSendPageview) this.tracker.send('pageview');\n }\n }.bind(this), 0);\n};\n\n\n/**\n * Determines whether or not the tracker should send a hit with the new page\n * data. This default implementation can be overrided in the config options.\n * @param {string} newPath The path prior to the URL change.\n * @param {string} oldPath The path after the URL change.\n * @return {boolean} Whether or not the URL change should be tracked.\n */\nUrlChangeTracker.prototype.shouldTrackUrlChange = function(newPath, oldPath) {\n return newPath && oldPath;\n};\n\n\n/**\n * Removes all event listeners and instance properties.\n */\nUrlChangeTracker.prototype.remove = function() {\n window.removeEventListener('popstate', this.updateTrackerData);\n history.replaceState = this.originalReplaceState;\n history.pushState = this.originalPushState;\n\n this.tracker = null;\n this.opts = null;\n this.path = null;\n\n this.updateTrackerData = null;\n this.originalReplaceState = null;\n this.originalPushState = null;\n};\n\n\n/**\n * @return {string} The path value of the current URL.\n */\nfunction getPath() {\n return location.pathname + location.search;\n}\n\n\nprovide('urlChangeTracker', UrlChangeTracker);\n\n},{\"../provide\":8,\"../utilities\":9}],8:[function(require,module,exports){\n/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nvar constants = require('./constants');\nvar utilities = require('./utilities');\n\n\n// Adds the dev ID to the list of dev IDs if any plugin is used.\n(window.gaDevIds = window.gaDevIds || []).push(constants.DEV_ID);\n\n\n/**\n * Provides a plugin for use with analytics.js, accounting for the possibility\n * that the global command queue has been renamed or not yet defined.\n * @param {string} pluginName The plugin name identifier.\n * @param {Function} pluginConstructor The plugin constructor function.\n */\nmodule.exports = function providePlugin(pluginName, pluginConstructor) {\n var gaAlias = window['GoogleAnalyticsObject'] || 'ga';\n window[gaAlias] = window[gaAlias] || function() {\n (window[gaAlias]['q'] = window[gaAlias]['q'] || []).push(arguments);\n };\n\n // Formally provides the plugin for use with analytics.js.\n window[gaAlias]('provide', pluginName, pluginConstructor);\n\n // Registers the plugin on the global gaplugins object.\n window.gaplugins = window.gaplugins || {};\n window.gaplugins[utilities.capitalize(pluginName)] = pluginConstructor;\n};\n\n},{\"./constants\":1,\"./utilities\":9}],9:[function(require,module,exports){\n/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nvar utilities = {\n\n /**\n * Accepts a function and returns a wrapped version of the function that is\n * expected to be called elsewhere in the system. If it's not called\n * elsewhere after the timeout period, it's called regardless. The wrapper\n * function also prevents the callback from being called more than once.\n * @param {Function} callback The function to call.\n * @param {number} wait How many milliseconds to wait before invoking\n * the callback.\n * @returns {Function} The wrapped version of the passed function.\n */\n withTimeout: function(callback, wait) {\n var called = false;\n setTimeout(callback, wait || 2000);\n return function() {\n if (!called) {\n called = true;\n callback();\n }\n };\n },\n\n\n /**\n * Accepts an object of overrides and defaults and returns a new object\n * with the values merged. For each key in defaults, if there's a\n * corresponding value in overrides, it gets used.\n * @param {Object} overrides The object with properties to override.\n * @param {?Object} defaults The object with properties to use as defaults.\n * @return {Object} The final, merged object.\n */\n defaults: function(overrides, defaults) {\n var result = {};\n\n if (typeof overrides != 'object') {\n overrides = {};\n }\n\n if (typeof defaults != 'object') {\n defaults = {};\n }\n\n for (var key in defaults) {\n if (defaults.hasOwnProperty(key)) {\n result[key] = overrides.hasOwnProperty(key) ?\n overrides[key] : defaults[key];\n }\n }\n return result;\n },\n\n\n /**\n * Capitalizes the first letter of a string.\n * @param {string} str The input string.\n * @return {string} The capitalized string\n */\n capitalize: function(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n },\n\n\n /**\n * Indicates whether the passed variable is a JavaScript object.\n * @param {*} value The input variable to test.\n * @return {boolean} Whether or not the test is an object.\n */\n isObject: function(value) {\n return typeof value == 'object' && value !== null;\n },\n\n\n /**\n * Indicates whether the passed variable is a JavaScript array.\n * @param {*} value The input variable to test.\n * @return {boolean} Whether or not the value is an array.\n */\n isArray: Array.isArray || function(value) {\n return Object.prototype.toString.call(value) === '[object Array]';\n },\n\n\n /**\n * Accepts a value that may or may not be an array. If it is not an array,\n * it is returned as the first item in a single-item array.\n * @param {*} value The value to convert to an array if it is not.\n * @return {Array} The array-ified value.\n */\n toArray: function(value) {\n return utilities.isArray(value) ? value : [value];\n }\n};\n\nmodule.exports = utilities;\n\n},{}],10:[function(require,module,exports){\nvar matches = require('matches-selector')\r\n\r\nmodule.exports = function (element, selector, checkYoSelf) {\r\n var parent = checkYoSelf ? element : element.parentNode\r\n\r\n while (parent && parent !== document) {\r\n if (matches(parent, selector)) return parent;\r\n parent = parent.parentNode\r\n }\r\n}\r\n\n},{\"matches-selector\":14}],11:[function(require,module,exports){\nmodule.exports = Date.now || now\n\nfunction now() {\n return new Date().getTime()\n}\n\n},{}],12:[function(require,module,exports){\n\n/**\n * Module dependencies.\n */\n\nvar now = require('date-now');\n\n/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * N milliseconds. If `immediate` is passed, trigger the function on the\n * leading edge, instead of the trailing.\n *\n * @source underscore.js\n * @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/\n * @param {Function} function to wrap\n * @param {Number} timeout in ms (`100`)\n * @param {Boolean} whether to execute at the beginning (`false`)\n * @api public\n */\n\nmodule.exports = function debounce(func, wait, immediate){\n var timeout, args, context, timestamp, result;\n if (null == wait) wait = 100;\n\n function later() {\n var last = now() - timestamp;\n\n if (last < wait && last > 0) {\n timeout = setTimeout(later, wait - last);\n } else {\n timeout = null;\n if (!immediate) {\n result = func.apply(context, args);\n if (!timeout) context = args = null;\n }\n }\n };\n\n return function debounced() {\n context = this;\n args = arguments;\n timestamp = now();\n var callNow = immediate && !timeout;\n if (!timeout) timeout = setTimeout(later, wait);\n if (callNow) {\n result = func.apply(context, args);\n context = args = null;\n }\n\n return result;\n };\n};\n\n},{\"date-now\":11}],13:[function(require,module,exports){\nvar closest = require('closest');\n\n/**\n * Delegates event to a selector.\n *\n * @param {Element} element\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @param {Boolean} useCapture\n * @return {Object}\n */\nfunction delegate(element, selector, type, callback, useCapture) {\n var listenerFn = listener.apply(this, arguments);\n\n element.addEventListener(type, listenerFn, useCapture);\n\n return {\n destroy: function() {\n element.removeEventListener(type, listenerFn, useCapture);\n }\n }\n}\n\n/**\n * Finds closest match and invokes callback.\n *\n * @param {Element} element\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @return {Function}\n */\nfunction listener(element, selector, type, callback) {\n return function(e) {\n e.delegateTarget = closest(e.target, selector, true);\n\n if (e.delegateTarget) {\n callback.call(element, e);\n }\n }\n}\n\nmodule.exports = delegate;\n\n},{\"closest\":10}],14:[function(require,module,exports){\n\r\n/**\r\n * Element prototype.\r\n */\r\n\r\nvar proto = Element.prototype;\r\n\r\n/**\r\n * Vendor function.\r\n */\r\n\r\nvar vendor = proto.matchesSelector\r\n || proto.webkitMatchesSelector\r\n || proto.mozMatchesSelector\r\n || proto.msMatchesSelector\r\n || proto.oMatchesSelector;\r\n\r\n/**\r\n * Expose `match()`.\r\n */\r\n\r\nmodule.exports = match;\r\n\r\n/**\r\n * Match `el` to `selector`.\r\n *\r\n * @param {Element} el\r\n * @param {String} selector\r\n * @return {Boolean}\r\n * @api public\r\n */\r\n\r\nfunction match(el, selector) {\r\n if (vendor) return vendor.call(el, selector);\r\n var nodes = el.parentNode.querySelectorAll(selector);\r\n for (var i = 0; i < nodes.length; ++i) {\r\n if (nodes[i] == el) return true;\r\n }\r\n return false;\r\n}\n},{}],15:[function(require,module,exports){\n/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n// Imports sub-plugins.\nrequire('./event-tracker');\nrequire('./media-query-tracker');\nrequire('./outbound-form-tracker');\nrequire('./outbound-link-tracker');\nrequire('./social-tracker');\nrequire('./url-change-tracker');\n\n\n// Imports dependencies.\nvar provide = require('../provide');\n\n\n/**\n *\n * Requires all sub-plugins via a single plugin.\n * @constructor\n * @param {Object} tracker Passed internally by analytics.js\n * @param {?Object} opts Passed by the require command.\n */\nfunction Autotrack(tracker, opts) {\n var ga = window[window.GoogleAnalyticsObject || 'ga'];\n var name = tracker.get('name');\n\n ga(name + '.require', 'eventTracker', opts);\n ga(name + '.require', 'mediaQueryTracker', opts);\n ga(name + '.require', 'outboundFormTracker', opts);\n ga(name + '.require', 'outboundLinkTracker', opts);\n ga(name + '.require', 'socialTracker', opts);\n ga(name + '.require', 'urlChangeTracker', opts);\n}\n\n\nprovide('autotrack', Autotrack);\n\n},{\"../provide\":8,\"./event-tracker\":2,\"./media-query-tracker\":3,\"./outbound-form-tracker\":4,\"./outbound-link-tracker\":5,\"./social-tracker\":6,\"./url-change-tracker\":7}]},{},[15])\n\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nvar delegate = require('delegate');\nvar defaults = require('../utilities').defaults;\nvar provide = require('../provide');\n\n\n/**\n * Registers declarative event tracking.\n * @constructor\n * @param {Object} tracker Passed internally by analytics.js\n * @param {?Object} opts Passed by the require command.\n */\nfunction EventTracker(tracker, opts) {\n\n // Feature detects to prevent errors in unsupporting browsers.\n if (!window.addEventListener) return;\n\n this.opts = defaults(opts, {\n attributePrefix: 'data-'\n });\n\n this.tracker = tracker;\n\n var prefix = this.opts.attributePrefix;\n var selector = '[' + prefix + 'event-category][' + prefix + 'event-action]';\n\n this.delegate = delegate(document, selector,\n 'click', this.handleEventClicks.bind(this));\n}\n\n\n/**\n * Handles all clicks on elements with event attributes.\n * @param {Event} event The DOM click event.\n */\nEventTracker.prototype.handleEventClicks = function(event) {\n\n var link = event.delegateTarget;\n var prefix = this.opts.attributePrefix;\n\n this.tracker.send('event', {\n eventCategory: link.getAttribute(prefix + 'event-category'),\n eventAction: link.getAttribute(prefix + 'event-action'),\n eventLabel: link.getAttribute(prefix + 'event-label'),\n eventValue: link.getAttribute(prefix + 'event-value')\n });\n};\n\n\n/**\n * Removes all event listeners and instance properties.\n */\nEventTracker.prototype.remove = function() {\n this.delegate.destroy();\n this.delegate = null;\n this.tracker = null;\n this.opts = null;\n};\n\n\nprovide('eventTracker', EventTracker);\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nvar debounce = require('debounce');\nvar defaults = require('../utilities').defaults;\nvar isObject = require('../utilities').isObject;\nvar toArray = require('../utilities').toArray;\nvar provide = require('../provide');\n\n\n/**\n * Sets the string to use when no custom dimension value is available.\n */\nvar NULL_DIMENSION = '(not set)';\n\n\n/**\n * Declares the MediaQueryListener instance cache.\n */\nvar mediaMap = {};\n\n\n/**\n * Registers media query tracking.\n * @constructor\n * @param {Object} tracker Passed internally by analytics.js\n * @param {?Object} opts Passed by the require command.\n */\nfunction MediaQueryTracker(tracker, opts) {\n\n // Feature detects to prevent errors in unsupporting browsers.\n if (!window.matchMedia) return;\n\n this.opts = defaults(opts, {\n mediaQueryDefinitions: false,\n mediaQueryChangeTemplate: this.changeTemplate,\n mediaQueryChangeTimeout: 1000\n });\n\n // Exits early if media query data doesn't exist.\n if (!isObject(this.opts.mediaQueryDefinitions)) return;\n\n this.opts.mediaQueryDefinitions = toArray(this.opts.mediaQueryDefinitions);\n this.tracker = tracker;\n this.changeListeners = [];\n\n this.processMediaQueries();\n}\n\n\n/**\n * Loops through each media query definition, sets the custom dimenion data,\n * and adds the change listeners.\n */\nMediaQueryTracker.prototype.processMediaQueries = function() {\n this.opts.mediaQueryDefinitions.forEach(function(definition) {\n // Only processes definitions with a name and index.\n if (definition.name && definition.dimensionIndex) {\n var mediaName = this.getMatchName(definition);\n this.tracker.set('dimension' + definition.dimensionIndex, mediaName);\n\n this.addChangeListeners(definition);\n }\n }.bind(this));\n};\n\n\n/**\n * Takes a definition object and return the name of the matching media item.\n * If no match is found, the NULL_DIMENSION value is returned.\n * @param {Object} definition A set of named media queries associated\n * with a single custom dimension.\n * @return {string} The name of the matched media or NULL_DIMENSION.\n */\nMediaQueryTracker.prototype.getMatchName = function(definition) {\n var match;\n\n definition.items.forEach(function(item) {\n if (getMediaListener(item.media).matches) {\n match = item;\n }\n });\n return match ? match.name : NULL_DIMENSION;\n};\n\n\n/**\n * Adds change listeners to each media query in the definition list.\n * Debounces the changes to prevent unnecessary hits from being sent.\n * @param {Object} definition A set of named media queries associated\n * with a single custom dimension\n */\nMediaQueryTracker.prototype.addChangeListeners = function(definition) {\n definition.items.forEach(function(item) {\n var mql = getMediaListener(item.media);\n var fn = debounce(function() {\n this.handleChanges(definition);\n }.bind(this), this.opts.mediaQueryChangeTimeout);\n\n mql.addListener(fn);\n this.changeListeners.push({mql: mql, fn: fn});\n }.bind(this));\n};\n\n\n/**\n * Handles changes to the matched media. When the new value differs from\n * the old value, a change event is sent.\n * @param {Object} definition A set of named media queries associated\n * with a single custom dimension\n */\nMediaQueryTracker.prototype.handleChanges = function(definition) {\n var newValue = this.getMatchName(definition);\n var oldValue = this.tracker.get('dimension' + definition.dimensionIndex);\n\n if (newValue !== oldValue) {\n this.tracker.set('dimension' + definition.dimensionIndex, newValue);\n this.tracker.send('event', definition.name, 'change',\n this.opts.mediaQueryChangeTemplate(oldValue, newValue));\n }\n};\n\n\n/**\n * Removes all event listeners and instance properties.\n */\nMediaQueryTracker.prototype.remove = function() {\n for (var i = 0, listener; listener = this.changeListeners[i]; i++) {\n listener.mql.removeListener(listener.fn);\n }\n this.changeListeners = null;\n this.tracker = null;\n this.opts = null;\n};\n\n\n/**\n * Sets the default formatting of the change event label.\n * This can be overridden by setting the `mediaQueryChangeTemplate` option.\n * @param {string} oldValue The value of the media query prior to the change.\n * @param {string} newValue The value of the media query after the change.\n * @return {string} The formatted event label.\n */\nMediaQueryTracker.prototype.changeTemplate = function(oldValue, newValue) {\n return oldValue + ' => ' + newValue;\n};\n\n\n/**\n * Accepts a media query and returns a MediaQueryListener object.\n * Caches the values to avoid multiple unnecessary instances.\n * @param {string} media A media query value.\n * @return {MediaQueryListener} The matched media.\n */\nfunction getMediaListener(media) {\n // Returns early if the media is cached.\n if (mediaMap[media]) return mediaMap[media];\n\n mediaMap[media] = window.matchMedia(media);\n return mediaMap[media];\n}\n\n\nprovide('mediaQueryTracker', MediaQueryTracker);\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nvar defaults = require('../utilities').defaults;\nvar delegate = require('delegate');\nvar provide = require('../provide');\nvar utilities = require('../utilities');\n\n\n/**\n * Registers outbound form tracking.\n * @constructor\n * @param {Object} tracker Passed internally by analytics.js\n * @param {?Object} opts Passed by the require command.\n */\nfunction OutboundFormTracker(tracker, opts) {\n\n // Feature detects to prevent errors in unsupporting browsers.\n if (!window.addEventListener) return;\n\n this.opts = defaults(opts, {\n shouldTrackOutboundForm: this.shouldTrackOutboundForm\n });\n\n this.tracker = tracker;\n\n this.delegate = delegate(document, 'form',\n 'submit', this.handleFormSubmits.bind(this));\n}\n\n\n/**\n * Handles all submits on form elements. A form submit is considered outbound\n * if its action attribute starts with http and does not contain\n * location.hostname.\n * When the beacon transport method is not available, the event's default\n * action is prevented and re-emitted after the hit is sent.\n * @param {Event} event The DOM submit event.\n */\nOutboundFormTracker.prototype.handleFormSubmits = function(event) {\n\n var form = event.delegateTarget;\n var action = form.getAttribute('action');\n var fieldsObj = {transport: 'beacon'};\n\n if (this.opts.shouldTrackOutboundForm(form)) {\n\n if (!navigator.sendBeacon) {\n // Stops the submit and waits until the hit is complete (with timeout)\n // for browsers that don't support beacon.\n event.preventDefault();\n fieldsObj.hitCallback = utilities.withTimeout(function() {\n form.submit();\n });\n }\n\n this.tracker.send('event', 'Outbound Form', 'submit', action, fieldsObj);\n }\n};\n\n\n/**\n * Determines whether or not the tracker should send a hit when a form is\n * submitted. By default, forms with an action attribute that starts with\n * \"http\" and doesn't contain the current hostname are tracked.\n * @param {Element} form The form that was submitted.\n * @return {boolean} Whether or not the form should be tracked.\n */\nOutboundFormTracker.prototype.shouldTrackOutboundForm = function(form) {\n var action = form.getAttribute('action');\n return action &&\n action.indexOf('http') === 0 &&\n action.indexOf(location.hostname) < 0;\n};\n\n\n/**\n * Removes all event listeners and instance properties.\n */\n OutboundFormTracker.prototype.remove = function() {\n this.delegate.destroy();\n this.delegate = null;\n this.tracker = null;\n this.opts = null;\n};\n\n\nprovide('outboundFormTracker', OutboundFormTracker);\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nvar defaults = require('../utilities').defaults;\nvar delegate = require('delegate');\nvar provide = require('../provide');\n\n\n/**\n * Registers outbound link tracking on a tracker object.\n * @constructor\n * @param {Object} tracker Passed internally by analytics.js\n * @param {?Object} opts Passed by the require command.\n */\nfunction OutboundLinkTracker(tracker, opts) {\n\n // Feature detects to prevent errors in unsupporting browsers.\n if (!window.addEventListener) return;\n\n this.opts = defaults(opts, {\n shouldTrackOutboundLink: this.shouldTrackOutboundLink\n });\n\n this.tracker = tracker;\n\n this.delegate = delegate(document, 'a',\n 'click', this.handleLinkClicks.bind(this));\n}\n\n\n/**\n * Handles all clicks on link elements. A link is considered an outbound link\n * its hostname property does not match location.hostname. When the beacon\n * transport method is not available, the links target is set to \"_blank\" to\n * ensure the hit can be sent.\n * @param {Event} event The DOM click event.\n */\nOutboundLinkTracker.prototype.handleLinkClicks = function(event) {\n var link = event.delegateTarget;\n if (this.opts.shouldTrackOutboundLink(link)) {\n // Opens outbound links in a new tab if the browser doesn't support\n // the beacon transport method.\n if (!navigator.sendBeacon) {\n link.target = '_blank';\n }\n this.tracker.send('event', 'Outbound Link', 'click', link.href, {\n transport: 'beacon'\n });\n }\n};\n\n\n/**\n * Determines whether or not the tracker should send a hit when a link is\n * clicked. By default links with a hostname property not equal to the current\n * hostname are tracked.\n * @param {Element} link The link that was clicked on.\n * @return {boolean} Whether or not the link should be tracked.\n */\nOutboundLinkTracker.prototype.shouldTrackOutboundLink = function(link) {\n return link.hostname != location.hostname &&\n link.protocol.indexOf('http') === 0;\n};\n\n\n/**\n * Removes all event listeners and instance properties.\n */\nOutboundLinkTracker.prototype.remove = function() {\n this.delegate.destroy();\n this.delegate = null;\n this.tracker = null;\n this.opts = null;\n};\n\n\nprovide('outboundLinkTracker', OutboundLinkTracker);\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/* global FB, twttr */\n\n\nvar defaults = require('../utilities').defaults;\nvar delegate = require('delegate');\nvar provide = require('../provide');\n\n\n/**\n * Registers social tracking on tracker object.\n * Supports both declarative social tracking via HTML attributes as well as\n * tracking for social events when using official Twitter or Facebook widgets.\n * @constructor\n * @param {Object} tracker Passed internally by analytics.js\n * @param {?Object} opts Passed by the require command.\n */\nfunction SocialTracker(tracker, opts) {\n\n // Feature detects to prevent errors in unsupporting browsers.\n if (!window.addEventListener) return;\n\n this.opts = defaults(opts, {\n attributePrefix: 'data-'\n });\n\n this.tracker = tracker;\n\n var prefix = this.opts.attributePrefix;\n var selector = '[' + prefix + 'social-network]' +\n '[' + prefix + 'social-action]' +\n '[' + prefix + 'social-target]';\n\n // Binds methods to `this`.\n this.handleSocialClicks = this.handleSocialClicks.bind(this);\n this.addWidgetListeners = this.addWidgetListeners.bind(this);\n this.addTwitterEventHandlers = this.addTwitterEventHandlers.bind(this);\n this.handleTweetEvents = this.handleTweetEvents.bind(this);\n this.handleFollowEvents = this.handleFollowEvents.bind(this);\n this.handleLikeEvents = this.handleLikeEvents.bind(this);\n this.handleUnlikeEvents = this.handleUnlikeEvents.bind(this);\n\n this.delegate = delegate(document, selector,\n 'click', this.handleSocialClicks);\n\n if (document.readyState != 'complete') {\n // Adds the widget listeners after the window's `load` event fires.\n // If loading widgets using the officially recommended snippets, they\n // will be available at `window.load`. If not users can call the\n // `addWidgetListeners` method manually.\n window.addEventListener('load', this.addWidgetListeners);\n }\n else {\n this.addWidgetListeners();\n }\n}\n\n\n/**\n * Invokes the methods to add Facebook and Twitter widget event listeners.\n * Ensures the respective global namespaces are present before adding.\n */\nSocialTracker.prototype.addWidgetListeners = function() {\n if (window.FB) this.addFacebookEventHandlers();\n if (window.twttr) this.addTwitterEventHandlers();\n};\n\n\n/**\n * Handles all clicks on elements with social tracking attributes.\n * @param {Event} event The DOM click event.\n */\nSocialTracker.prototype.handleSocialClicks = function(event) {\n\n var link = event.delegateTarget;\n var prefix = this.opts.attributePrefix;\n\n this.tracker.send('social', {\n socialNetwork: link.getAttribute(prefix + 'social-network'),\n socialAction: link.getAttribute(prefix + 'social-action'),\n socialTarget: link.getAttribute(prefix + 'social-target')\n });\n};\n\n\n/**\n * Adds event handlers for the \"tweet\" and \"follow\" events emitted by the\n * official tweet and follow buttons. Note: this does not capture tweet or\n * follow events emitted by other Twitter widgets (tweet, timeline, etc.).\n */\nSocialTracker.prototype.addTwitterEventHandlers = function() {\n try {\n twttr.ready(function() {\n twttr.events.bind('tweet', this.handleTweetEvents);\n twttr.events.bind('follow', this.handleFollowEvents);\n }.bind(this));\n } catch(err) {}\n};\n\n\n/**\n * Removes event handlers for the \"tweet\" and \"follow\" events emitted by the\n * official tweet and follow buttons.\n */\nSocialTracker.prototype.removeTwitterEventHandlers = function() {\n try {\n twttr.ready(function() {\n twttr.events.unbind('tweet', this.handleTweetEvents);\n twttr.events.unbind('follow', this.handleFollowEvents);\n }.bind(this));\n } catch(err) {}\n};\n\n\n/**\n * Adds event handlers for the \"like\" and \"unlike\" events emitted by the\n * official Facebook like button.\n */\nSocialTracker.prototype.addFacebookEventHandlers = function() {\n try {\n FB.Event.subscribe('edge.create', this.handleLikeEvents);\n FB.Event.subscribe('edge.remove', this.handleUnlikeEvents);\n } catch(err) {}\n};\n\n\n/**\n * Removes event handlers for the \"like\" and \"unlike\" events emitted by the\n * official Facebook like button.\n */\nSocialTracker.prototype.removeFacebookEventHandlers = function() {\n try {\n FB.Event.unsubscribe('edge.create', this.handleLikeEvents);\n FB.Event.unsubscribe('edge.remove', this.handleUnlikeEvents);\n } catch(err) {}\n};\n\n\n/**\n * Handles `tweet` events emitted by the Twitter JS SDK.\n * @param {Object} event The Twitter event object passed to the handler.\n */\nSocialTracker.prototype.handleTweetEvents = function(event) {\n // Ignores tweets from widgets that aren't the tweet button.\n if (event.region != 'tweet') return;\n\n var url = event.data.url || event.target.getAttribute('data-url') ||\n location.href;\n\n this.tracker.send('social', 'Twitter', 'tweet', url);\n};\n\n\n/**\n * Handles `follow` events emitted by the Twitter JS SDK.\n * @param {Object} event The Twitter event object passed to the handler.\n */\nSocialTracker.prototype.handleFollowEvents = function(event) {\n // Ignore follows from widgets that aren't the follow button.\n if (event.region != 'follow') return;\n\n var screenName = event.data.screen_name ||\n event.target.getAttribute('data-screen-name');\n\n this.tracker.send('social', 'Twitter', 'follow', screenName);\n};\n\n\n/**\n * Handles `like` events emitted by the Facebook JS SDK.\n * @param {string} url The URL corresponding to the like event.\n */\nSocialTracker.prototype.handleLikeEvents = function(url) {\n this.tracker.send('social', 'Facebook', 'like', url);\n};\n\n\n/**\n * Handles `unlike` events emitted by the Facebook JS SDK.\n * @param {string} url The URL corresponding to the unlike event.\n */\nSocialTracker.prototype.handleUnlikeEvents = function(url) {\n this.tracker.send('social', 'Facebook', 'unlike', url);\n};\n\n\n/**\n * Removes all event listeners and instance properties.\n */\nSocialTracker.prototype.remove = function() {\n window.removeEventListener('load', this.addWidgetListeners);\n this.removeFacebookEventHandlers();\n this.removeTwitterEventHandlers();\n\n this.delegate.destroy();\n this.delegate = null;\n this.tracker = null;\n this.opts = null;\n\n this.handleSocialClicks = null;\n this.addWidgetListeners = null;\n this.addTwitterEventHandlers = null;\n this.handleTweetEvents = null;\n this.handleFollowEvents = null;\n this.handleLikeEvents = null;\n this.handleUnlikeEvents = null;\n};\n\n\nprovide('socialTracker', SocialTracker);\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nvar defaults = require('../utilities').defaults;\nvar isObject = require('../utilities').isObject;\nvar provide = require('../provide');\n\n\n/**\n * Adds handler for the history API methods\n * @constructor\n * @param {Object} tracker Passed internally by analytics.js\n * @param {?Object} opts Passed by the require command.\n */\nfunction UrlChangeTracker(tracker, opts) {\n\n // Feature detects to prevent errors in unsupporting browsers.\n if (!history.pushState || !window.addEventListener) return;\n\n this.opts = defaults(opts, {\n shouldTrackUrlChange: this.shouldTrackUrlChange\n });\n\n this.tracker = tracker;\n\n // Sets the initial page field.\n // Don't set this on the tracker yet so campaign data can be retreived\n // from the location field.\n this.path = getPath();\n\n this.updateTrackerData = this.updateTrackerData.bind(this);\n\n // Overrides history.pushState.\n this.originalPushState = history.pushState;\n history.pushState = function(state, title) {\n // Sets the document title for reference later.\n // TODO(philipwalton): consider using WeakMap for this to not conflict\n // with any user-defined property also called \"title\".\n if (isObject(state) && title) state.title = title;\n\n this.originalPushState.apply(history, arguments);\n this.updateTrackerData();\n }.bind(this);\n\n // Overrides history.repaceState.\n this.originalReplaceState = history.replaceState;\n history.replaceState = function(state, title) {\n // Sets the document title for reference later.\n // TODO(philipwalton): consider using WeakMap for this to not conflict\n // with any user-defined property also called \"title\".\n if (isObject(state) && title) state.title = title;\n\n this.originalReplaceState.apply(history, arguments);\n this.updateTrackerData(false);\n }.bind(this);\n\n // Handles URL changes via user interaction.\n window.addEventListener('popstate', this.updateTrackerData);\n}\n\n\n/**\n * Updates the page and title fields on the tracker if necessary and\n * optionally sends a pageview.\n * @param {boolean} shouldSendPageview Indicates whether the tracker should\n * send a pageview after updating the URL.\n */\nUrlChangeTracker.prototype.updateTrackerData = function(shouldSendPageview) {\n\n // Sets the default.\n shouldSendPageview = shouldSendPageview === false ? false : true;\n\n // Calls the update logic asychronously to help ensure user callbacks\n // happen first.\n setTimeout(function() {\n\n var oldPath = this.path;\n var newPath = getPath();\n\n if (oldPath != newPath &&\n this.opts.shouldTrackUrlChange.call(this, newPath, oldPath)) {\n\n this.path = newPath;\n this.tracker.set({\n page: newPath,\n title: isObject(history.state) && history.state.title || document.title\n });\n\n if (shouldSendPageview) this.tracker.send('pageview');\n }\n }.bind(this), 0);\n};\n\n\n/**\n * Determines whether or not the tracker should send a hit with the new page\n * data. This default implementation can be overrided in the config options.\n * @param {string} newPath The path prior to the URL change.\n * @param {string} oldPath The path after the URL change.\n * @return {boolean} Whether or not the URL change should be tracked.\n */\nUrlChangeTracker.prototype.shouldTrackUrlChange = function(newPath, oldPath) {\n return newPath && oldPath;\n};\n\n\n/**\n * Removes all event listeners and instance properties.\n */\nUrlChangeTracker.prototype.remove = function() {\n window.removeEventListener('popstate', this.updateTrackerData);\n history.replaceState = this.originalReplaceState;\n history.pushState = this.originalPushState;\n\n this.tracker = null;\n this.opts = null;\n this.path = null;\n\n this.updateTrackerData = null;\n this.originalReplaceState = null;\n this.originalPushState = null;\n};\n\n\n/**\n * @return {string} The path value of the current URL.\n */\nfunction getPath() {\n return location.pathname + location.search;\n}\n\n\nprovide('urlChangeTracker', UrlChangeTracker);\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nvar constants = require('./constants');\nvar utilities = require('./utilities');\n\n\n// Adds the dev ID to the list of dev IDs if any plugin is used.\n(window.gaDevIds = window.gaDevIds || []).push(constants.DEV_ID);\n\n\n/**\n * Provides a plugin for use with analytics.js, accounting for the possibility\n * that the global command queue has been renamed or not yet defined.\n * @param {string} pluginName The plugin name identifier.\n * @param {Function} pluginConstructor The plugin constructor function.\n */\nmodule.exports = function providePlugin(pluginName, pluginConstructor) {\n var gaAlias = window['GoogleAnalyticsObject'] || 'ga';\n window[gaAlias] = window[gaAlias] || function() {\n (window[gaAlias]['q'] = window[gaAlias]['q'] || []).push(arguments);\n };\n\n // Formally provides the plugin for use with analytics.js.\n window[gaAlias]('provide', pluginName, pluginConstructor);\n\n // Registers the plugin on the global gaplugins object.\n window.gaplugins = window.gaplugins || {};\n window.gaplugins[utilities.capitalize(pluginName)] = pluginConstructor;\n};\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nvar utilities = {\n\n /**\n * Accepts a function and returns a wrapped version of the function that is\n * expected to be called elsewhere in the system. If it's not called\n * elsewhere after the timeout period, it's called regardless. The wrapper\n * function also prevents the callback from being called more than once.\n * @param {Function} callback The function to call.\n * @param {number} wait How many milliseconds to wait before invoking\n * the callback.\n * @returns {Function} The wrapped version of the passed function.\n */\n withTimeout: function(callback, wait) {\n var called = false;\n setTimeout(callback, wait || 2000);\n return function() {\n if (!called) {\n called = true;\n callback();\n }\n };\n },\n\n\n /**\n * Accepts an object of overrides and defaults and returns a new object\n * with the values merged. For each key in defaults, if there's a\n * corresponding value in overrides, it gets used.\n * @param {Object} overrides The object with properties to override.\n * @param {?Object} defaults The object with properties to use as defaults.\n * @return {Object} The final, merged object.\n */\n defaults: function(overrides, defaults) {\n var result = {};\n\n if (typeof overrides != 'object') {\n overrides = {};\n }\n\n if (typeof defaults != 'object') {\n defaults = {};\n }\n\n for (var key in defaults) {\n if (defaults.hasOwnProperty(key)) {\n result[key] = overrides.hasOwnProperty(key) ?\n overrides[key] : defaults[key];\n }\n }\n return result;\n },\n\n\n /**\n * Capitalizes the first letter of a string.\n * @param {string} str The input string.\n * @return {string} The capitalized string\n */\n capitalize: function(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n },\n\n\n /**\n * Indicates whether the passed variable is a JavaScript object.\n * @param {*} value The input variable to test.\n * @return {boolean} Whether or not the test is an object.\n */\n isObject: function(value) {\n return typeof value == 'object' && value !== null;\n },\n\n\n /**\n * Indicates whether the passed variable is a JavaScript array.\n * @param {*} value The input variable to test.\n * @return {boolean} Whether or not the value is an array.\n */\n isArray: Array.isArray || function(value) {\n return Object.prototype.toString.call(value) === '[object Array]';\n },\n\n\n /**\n * Accepts a value that may or may not be an array. If it is not an array,\n * it is returned as the first item in a single-item array.\n * @param {*} value The value to convert to an array if it is not.\n * @return {Array} The array-ified value.\n */\n toArray: function(value) {\n return utilities.isArray(value) ? value : [value];\n }\n};\n\nmodule.exports = utilities;\n","var matches = require('matches-selector')\r\n\r\nmodule.exports = function (element, selector, checkYoSelf) {\r\n var parent = checkYoSelf ? element : element.parentNode\r\n\r\n while (parent && parent !== document) {\r\n if (matches(parent, selector)) return parent;\r\n parent = parent.parentNode\r\n }\r\n}\r\n","module.exports = Date.now || now\n\nfunction now() {\n return new Date().getTime()\n}\n","\n/**\n * Module dependencies.\n */\n\nvar now = require('date-now');\n\n/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * N milliseconds. If `immediate` is passed, trigger the function on the\n * leading edge, instead of the trailing.\n *\n * @source underscore.js\n * @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/\n * @param {Function} function to wrap\n * @param {Number} timeout in ms (`100`)\n * @param {Boolean} whether to execute at the beginning (`false`)\n * @api public\n */\n\nmodule.exports = function debounce(func, wait, immediate){\n var timeout, args, context, timestamp, result;\n if (null == wait) wait = 100;\n\n function later() {\n var last = now() - timestamp;\n\n if (last < wait && last > 0) {\n timeout = setTimeout(later, wait - last);\n } else {\n timeout = null;\n if (!immediate) {\n result = func.apply(context, args);\n if (!timeout) context = args = null;\n }\n }\n };\n\n return function debounced() {\n context = this;\n args = arguments;\n timestamp = now();\n var callNow = immediate && !timeout;\n if (!timeout) timeout = setTimeout(later, wait);\n if (callNow) {\n result = func.apply(context, args);\n context = args = null;\n }\n\n return result;\n };\n};\n","var closest = require('closest');\n\n/**\n * Delegates event to a selector.\n *\n * @param {Element} element\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @param {Boolean} useCapture\n * @return {Object}\n */\nfunction delegate(element, selector, type, callback, useCapture) {\n var listenerFn = listener.apply(this, arguments);\n\n element.addEventListener(type, listenerFn, useCapture);\n\n return {\n destroy: function() {\n element.removeEventListener(type, listenerFn, useCapture);\n }\n }\n}\n\n/**\n * Finds closest match and invokes callback.\n *\n * @param {Element} element\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @return {Function}\n */\nfunction listener(element, selector, type, callback) {\n return function(e) {\n e.delegateTarget = closest(e.target, selector, true);\n\n if (e.delegateTarget) {\n callback.call(element, e);\n }\n }\n}\n\nmodule.exports = delegate;\n","\r\n/**\r\n * Element prototype.\r\n */\r\n\r\nvar proto = Element.prototype;\r\n\r\n/**\r\n * Vendor function.\r\n */\r\n\r\nvar vendor = proto.matchesSelector\r\n || proto.webkitMatchesSelector\r\n || proto.mozMatchesSelector\r\n || proto.msMatchesSelector\r\n || proto.oMatchesSelector;\r\n\r\n/**\r\n * Expose `match()`.\r\n */\r\n\r\nmodule.exports = match;\r\n\r\n/**\r\n * Match `el` to `selector`.\r\n *\r\n * @param {Element} el\r\n * @param {String} selector\r\n * @return {Boolean}\r\n * @api public\r\n */\r\n\r\nfunction match(el, selector) {\r\n if (vendor) return vendor.call(el, selector);\r\n var nodes = el.parentNode.querySelectorAll(selector);\r\n for (var i = 0; i < nodes.length; ++i) {\r\n if (nodes[i] == el) return true;\r\n }\r\n return false;\r\n}"],"sourceRoot":"/source/"}