);\n\t\t}\n\t},\n\n} );\n\n\n\n/** WEBPACK FOOTER **\n ** ./client/components/page/index.jsx\n **/","/*\n * Store which manages and persists setup wizard progress\n */\n\nvar AppDispatcher = require('../dispatcher/app-dispatcher'),\n EventEmitter = require('events').EventEmitter,\n JPSConstants = require('../constants/jetpack-onboarding-constants');\n\nvar CHANGE_EVENT = 'change';\n\nvar _steps, _started = JPS.started; \n\nfunction setSteps(steps) {\n\n // set the completion status of each step to the saved values\n steps.forEach( function(step) {\n // default values for skipped, completed and static\n if ( typeof( step.completed ) === 'undefined' ) {\n step.completed = (JPS.step_status[step.slug] && JPS.step_status[step.slug].completed) || false; \n }\n\n if ( typeof( step.skipped ) === 'undefined' ) {\n step.skipped = (JPS.step_status[step.slug] && JPS.step_status[step.slug].skipped) || false; \n }\n\n if ( typeof( step.static ) === 'undefined' ) {\n step.static = false;\n }\n\n // set to 'true' if you want the wizard to move to this step even if it's been completed\n // by default completed steps are skipped\n if ( typeof( step.neverSkip ) === 'undefined' ) {\n step.neverSkip = false;\n }\n\n // default value for includeInProgress\n if ( typeof( step.includeInProgress ) === 'undefined') {\n step.includeInProgress = true;\n }\n }); \n \n _steps = steps;\n \n // set location to first pending step, if not set\n ensureValidStepSlug(); \n}\n\nfunction setStarted() {\n _started = true;\n selectNextPendingStep();\n}\n\nfunction complete(stepSlug) {\n var step = getStepFromSlug(stepSlug);\n step.completed = true;\n step.skipped = false;\n}\n\nfunction skip() {\n var stepSlug = currentStepSlug();\n var step = getStepFromSlug(stepSlug);\n step.skipped = true;\n selectNextPendingStep();\n}\n\nfunction getStepFromSlug( stepSlug ) {\n var currentStep = null;\n _.each( _steps, function( step ) {\n if( step.slug === stepSlug ) {\n currentStep = step;\n }\n });\n return currentStep;\n}\n\nfunction ensureValidStepSlug() {\n var stepSlug = currentStepSlug();\n if ( ! ( stepSlug && getStepFromSlug( stepSlug ) ) ) {\n\n var pendingStep = getNextPendingStep();\n if ( pendingStep !== null ) {\n var hash = 'welcome/steps/'+pendingStep.slug;\n window.history.pushState(null, document.title, window.location.pathname + '#' + hash);\n } \n }\n}\n\nfunction selectNextPendingStep() {\n var pendingStep = getNextPendingStep();\n if ( pendingStep !== null ) {\n select(pendingStep.slug); // also sets the window location hash\n }\n}\n\nfunction getNextPendingStep() {\n // if the _next_ step is neverSkip, we proceed to it\n var stepIndex = currentStepIndex();\n if ( stepIndex !== false ) {\n if ( _steps[stepIndex+1] && _steps[stepIndex+1].neverSkip === true ) {\n return _steps[stepIndex+1];\n }\n }\n\n // otherwise find the next uncompleted, unskipped step\n var nextPendingStep = _.findWhere( _steps, { completed: false, skipped: false } );\n return nextPendingStep;\n}\n\nfunction getPendingStepAfter( fromStep ) {\n\n}\n\nfunction currentStepSlug() {\n if ( window.location.hash.indexOf('#welcome/steps') === 0 ) {\n var parts = window.location.hash.split('/');\n var stepSlug = parts[parts.length-1];\n return stepSlug;\n } else {\n return null;\n }\n}\n\nfunction currentStepIndex() {\n var slug = currentStepSlug();\n return getStepIndex(slug);\n}\n\nfunction getStepIndex(slug) {\n for ( var i=0; i<_steps.length; i++ ) {\n if ( _steps[i].slug === slug ) {\n return i;\n }\n }\n return false;\n}\n\nfunction select(stepSlug) {\n var hash = 'welcome/steps/'+stepSlug;\n window.history.pushState(null, document.title, window.location.pathname + '#' + hash);\n}\n\n//reset everything back to defaults\nfunction reset() {\n JPS.step_status = {};\n _.where( _steps, { static: false} ).forEach( function ( step ) { \n step.completed = false;\n step.skipped = false;\n } );\n _started = false;\n}\n\nvar SetupProgressStore = _.extend({}, EventEmitter.prototype, {\n\n init: function(steps) {\n setSteps(steps);\n },\n\n getAllSteps: function() {\n return _steps;\n },\n\n isNewUser: function() {\n return !_started;\n },\n\n emitChange: function() {\n this.emit( CHANGE_EVENT );\n },\n\n getCurrentStep: function() {\n return getStepFromSlug( currentStepSlug() );\n },\n\n getNextPendingStep: function() {\n return getNextPendingStep(); // delegate\n },\n\n getStepFromSlug: function(slug) {\n return getStepFromSlug( slug ); // delegate\n },\n\n getProgressPercent: function() {\n \tvar numSteps = _.where( _steps, { includeInProgress: true } ).length;\n var completedSteps = _.where( _steps, { includeInProgress: true, completed: true } ).length;\n var percentComplete = (completedSteps / numSteps) * 90 + 10;\n var output = Math.round(percentComplete / 10) * 10;\n return output;\n },\n\n addChangeListener: function(callback) {\n this.on( CHANGE_EVENT, callback );\n },\n\n removeChangeListener: function(callback) {\n this.removeListener( CHANGE_EVENT, callback );\n }\n});\n\n// force a navigation refresh when the URL changes\nwindow.addEventListener(\"popstate\", function(){\n SetupProgressStore.emitChange();\n});\n\n// Register callback to handle all updates\nAppDispatcher.register(function(action) {\n \n switch(action.actionType) {\n case JPSConstants.STEP_GET_STARTED:\n setStarted();\n SetupProgressStore.emitChange();\n break;\n\n case JPSConstants.STEP_SELECT:\n select(action.slug);\n SetupProgressStore.emitChange();\n break;\n\n case JPSConstants.STEP_NEXT:\n selectNextPendingStep();\n SetupProgressStore.emitChange();\n break;\n\n case JPSConstants.STEP_COMPLETE:\n complete(action.slug);\n SetupProgressStore.emitChange();\n break;\n\n case JPSConstants.RESET_DATA:\n reset();\n SetupProgressStore.emitChange();\n break;\n\n case JPSConstants.STEP_SKIP:\n skip();\n SetupProgressStore.emitChange();\n break;\n\n default:\n // no op\n }\n});\n\nmodule.exports = SetupProgressStore;\n\n\n/** WEBPACK FOOTER **\n ** ./client/stores/setup-progress-store.js\n **/","/*\n * Copyright (c) 2014-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * AppDispatcher\n *\n * A singleton that operates as the central hub for application updates.\n */\n\nvar Dispatcher = require('flux').Dispatcher;\n\nmodule.exports = new Dispatcher();\n\n\n/** WEBPACK FOOTER **\n ** ./client/dispatcher/app-dispatcher.js\n **/","/**\n * Copyright (c) 2014-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\nmodule.exports.Dispatcher = require('./lib/Dispatcher');\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/flux/index.js\n ** module id = 160\n ** module chunks = 1\n **/","/**\n * Copyright (c) 2014-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Dispatcher\n * \n * @preventMunge\n */\n\n'use strict';\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\nvar invariant = require('fbjs/lib/invariant');\n\nvar _prefix = 'ID_';\n\n/**\n * Dispatcher is used to broadcast payloads to registered callbacks. This is\n * different from generic pub-sub systems in two ways:\n *\n * 1) Callbacks are not subscribed to particular events. Every payload is\n * dispatched to every registered callback.\n * 2) Callbacks can be deferred in whole or part until other callbacks have\n * been executed.\n *\n * For example, consider this hypothetical flight destination form, which\n * selects a default city when a country is selected:\n *\n * var flightDispatcher = new Dispatcher();\n *\n * // Keeps track of which country is selected\n * var CountryStore = {country: null};\n *\n * // Keeps track of which city is selected\n * var CityStore = {city: null};\n *\n * // Keeps track of the base flight price of the selected city\n * var FlightPriceStore = {price: null}\n *\n * When a user changes the selected city, we dispatch the payload:\n *\n * flightDispatcher.dispatch({\n * actionType: 'city-update',\n * selectedCity: 'paris'\n * });\n *\n * This payload is digested by `CityStore`:\n *\n * flightDispatcher.register(function(payload) {\n * if (payload.actionType === 'city-update') {\n * CityStore.city = payload.selectedCity;\n * }\n * });\n *\n * When the user selects a country, we dispatch the payload:\n *\n * flightDispatcher.dispatch({\n * actionType: 'country-update',\n * selectedCountry: 'australia'\n * });\n *\n * This payload is digested by both stores:\n *\n * CountryStore.dispatchToken = flightDispatcher.register(function(payload) {\n * if (payload.actionType === 'country-update') {\n * CountryStore.country = payload.selectedCountry;\n * }\n * });\n *\n * When the callback to update `CountryStore` is registered, we save a reference\n * to the returned token. Using this token with `waitFor()`, we can guarantee\n * that `CountryStore` is updated before the callback that updates `CityStore`\n * needs to query its data.\n *\n * CityStore.dispatchToken = flightDispatcher.register(function(payload) {\n * if (payload.actionType === 'country-update') {\n * // `CountryStore.country` may not be updated.\n * flightDispatcher.waitFor([CountryStore.dispatchToken]);\n * // `CountryStore.country` is now guaranteed to be updated.\n *\n * // Select the default city for the new country\n * CityStore.city = getDefaultCityForCountry(CountryStore.country);\n * }\n * });\n *\n * The usage of `waitFor()` can be chained, for example:\n *\n * FlightPriceStore.dispatchToken =\n * flightDispatcher.register(function(payload) {\n * switch (payload.actionType) {\n * case 'country-update':\n * case 'city-update':\n * flightDispatcher.waitFor([CityStore.dispatchToken]);\n * FlightPriceStore.price =\n * getFlightPriceStore(CountryStore.country, CityStore.city);\n * break;\n * }\n * });\n *\n * The `country-update` payload will be guaranteed to invoke the stores'\n * registered callbacks in order: `CountryStore`, `CityStore`, then\n * `FlightPriceStore`.\n */\n\nvar Dispatcher = (function () {\n function Dispatcher() {\n _classCallCheck(this, Dispatcher);\n\n this._callbacks = {};\n this._isDispatching = false;\n this._isHandled = {};\n this._isPending = {};\n this._lastID = 1;\n }\n\n /**\n * Registers a callback to be invoked with every dispatched payload. Returns\n * a token that can be used with `waitFor()`.\n */\n\n Dispatcher.prototype.register = function register(callback) {\n var id = _prefix + this._lastID++;\n this._callbacks[id] = callback;\n return id;\n };\n\n /**\n * Removes a callback based on its token.\n */\n\n Dispatcher.prototype.unregister = function unregister(id) {\n !this._callbacks[id] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Dispatcher.unregister(...): `%s` does not map to a registered callback.', id) : invariant(false) : undefined;\n delete this._callbacks[id];\n };\n\n /**\n * Waits for the callbacks specified to be invoked before continuing execution\n * of the current callback. This method should only be used by a callback in\n * response to a dispatched payload.\n */\n\n Dispatcher.prototype.waitFor = function waitFor(ids) {\n !this._isDispatching ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Dispatcher.waitFor(...): Must be invoked while dispatching.') : invariant(false) : undefined;\n for (var ii = 0; ii < ids.length; ii++) {\n var id = ids[ii];\n if (this._isPending[id]) {\n !this._isHandled[id] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Dispatcher.waitFor(...): Circular dependency detected while ' + 'waiting for `%s`.', id) : invariant(false) : undefined;\n continue;\n }\n !this._callbacks[id] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Dispatcher.waitFor(...): `%s` does not map to a registered callback.', id) : invariant(false) : undefined;\n this._invokeCallback(id);\n }\n };\n\n /**\n * Dispatches a payload to all registered callbacks.\n */\n\n Dispatcher.prototype.dispatch = function dispatch(payload) {\n !!this._isDispatching ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch.') : invariant(false) : undefined;\n this._startDispatching(payload);\n try {\n for (var id in this._callbacks) {\n if (this._isPending[id]) {\n continue;\n }\n this._invokeCallback(id);\n }\n } finally {\n this._stopDispatching();\n }\n };\n\n /**\n * Is this Dispatcher currently dispatching.\n */\n\n Dispatcher.prototype.isDispatching = function isDispatching() {\n return this._isDispatching;\n };\n\n /**\n * Call the callback stored with the given id. Also do some internal\n * bookkeeping.\n *\n * @internal\n */\n\n Dispatcher.prototype._invokeCallback = function _invokeCallback(id) {\n this._isPending[id] = true;\n this._callbacks[id](this._pendingPayload);\n this._isHandled[id] = true;\n };\n\n /**\n * Set up bookkeeping needed when dispatching.\n *\n * @internal\n */\n\n Dispatcher.prototype._startDispatching = function _startDispatching(payload) {\n for (var id in this._callbacks) {\n this._isPending[id] = false;\n this._isHandled[id] = false;\n }\n this._pendingPayload = payload;\n this._isDispatching = true;\n };\n\n /**\n * Clear bookkeeping used for dispatching.\n *\n * @internal\n */\n\n Dispatcher.prototype._stopDispatching = function _stopDispatching() {\n delete this._pendingPayload;\n this._isDispatching = false;\n };\n\n return Dispatcher;\n})();\n\nmodule.exports = Dispatcher;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/flux/lib/Dispatcher.js\n ** module id = 161\n ** module chunks = 1\n **/","/**\n * Copyright 2013-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule invariant\n */\n\n\"use strict\";\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar invariant = function (condition, format, a, b, c, d, e, f) {\n if (process.env.NODE_ENV !== 'production') {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n }\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error('Invariant Violation: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n};\n\nmodule.exports = invariant;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/flux/~/fbjs/lib/invariant.js\n ** module id = 162\n ** module chunks = 1\n **/","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nfunction EventEmitter() {\n this._events = this._events || {};\n this._maxListeners = this._maxListeners || undefined;\n}\nmodule.exports = EventEmitter;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nEventEmitter.defaultMaxListeners = 10;\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function(n) {\n if (!isNumber(n) || n < 0 || isNaN(n))\n throw TypeError('n must be a positive number');\n this._maxListeners = n;\n return this;\n};\n\nEventEmitter.prototype.emit = function(type) {\n var er, handler, len, args, i, listeners;\n\n if (!this._events)\n this._events = {};\n\n // If there is no 'error' event listener then throw.\n if (type === 'error') {\n if (!this._events.error ||\n (isObject(this._events.error) && !this._events.error.length)) {\n er = arguments[1];\n if (er instanceof Error) {\n throw er; // Unhandled 'error' event\n } else {\n // At least give some kind of context to the user\n var err = new Error('Uncaught, unspecified \"error\" event. (' + er + ')');\n err.context = er;\n throw err;\n }\n }\n }\n\n handler = this._events[type];\n\n if (isUndefined(handler))\n return false;\n\n if (isFunction(handler)) {\n switch (arguments.length) {\n // fast cases\n case 1:\n handler.call(this);\n break;\n case 2:\n handler.call(this, arguments[1]);\n break;\n case 3:\n handler.call(this, arguments[1], arguments[2]);\n break;\n // slower\n default:\n args = Array.prototype.slice.call(arguments, 1);\n handler.apply(this, args);\n }\n } else if (isObject(handler)) {\n args = Array.prototype.slice.call(arguments, 1);\n listeners = handler.slice();\n len = listeners.length;\n for (i = 0; i < len; i++)\n listeners[i].apply(this, args);\n }\n\n return true;\n};\n\nEventEmitter.prototype.addListener = function(type, listener) {\n var m;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events)\n this._events = {};\n\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (this._events.newListener)\n this.emit('newListener', type,\n isFunction(listener.listener) ?\n listener.listener : listener);\n\n if (!this._events[type])\n // Optimize the case of one listener. Don't need the extra array object.\n this._events[type] = listener;\n else if (isObject(this._events[type]))\n // If we've already got an array, just append.\n this._events[type].push(listener);\n else\n // Adding the second element, need to change to array.\n this._events[type] = [this._events[type], listener];\n\n // Check for listener leak\n if (isObject(this._events[type]) && !this._events[type].warned) {\n if (!isUndefined(this._maxListeners)) {\n m = this._maxListeners;\n } else {\n m = EventEmitter.defaultMaxListeners;\n }\n\n if (m && m > 0 && this._events[type].length > m) {\n this._events[type].warned = true;\n console.error('(node) warning: possible EventEmitter memory ' +\n 'leak detected. %d listeners added. ' +\n 'Use emitter.setMaxListeners() to increase limit.',\n this._events[type].length);\n if (typeof console.trace === 'function') {\n // not supported in IE 10\n console.trace();\n }\n }\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n var fired = false;\n\n function g() {\n this.removeListener(type, g);\n\n if (!fired) {\n fired = true;\n listener.apply(this, arguments);\n }\n }\n\n g.listener = listener;\n this.on(type, g);\n\n return this;\n};\n\n// emits a 'removeListener' event iff the listener was removed\nEventEmitter.prototype.removeListener = function(type, listener) {\n var list, position, length, i;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events || !this._events[type])\n return this;\n\n list = this._events[type];\n length = list.length;\n position = -1;\n\n if (list === listener ||\n (isFunction(list.listener) && list.listener === listener)) {\n delete this._events[type];\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n\n } else if (isObject(list)) {\n for (i = length; i-- > 0;) {\n if (list[i] === listener ||\n (list[i].listener && list[i].listener === listener)) {\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (list.length === 1) {\n list.length = 0;\n delete this._events[type];\n } else {\n list.splice(position, 1);\n }\n\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n var key, listeners;\n\n if (!this._events)\n return this;\n\n // not listening for removeListener, no need to emit\n if (!this._events.removeListener) {\n if (arguments.length === 0)\n this._events = {};\n else if (this._events[type])\n delete this._events[type];\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n for (key in this._events) {\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = {};\n return this;\n }\n\n listeners = this._events[type];\n\n if (isFunction(listeners)) {\n this.removeListener(type, listeners);\n } else if (listeners) {\n // LIFO order\n while (listeners.length)\n this.removeListener(type, listeners[listeners.length - 1]);\n }\n delete this._events[type];\n\n return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n var ret;\n if (!this._events || !this._events[type])\n ret = [];\n else if (isFunction(this._events[type]))\n ret = [this._events[type]];\n else\n ret = this._events[type].slice();\n return ret;\n};\n\nEventEmitter.prototype.listenerCount = function(type) {\n if (this._events) {\n var evlistener = this._events[type];\n\n if (isFunction(evlistener))\n return 1;\n else if (evlistener)\n return evlistener.length;\n }\n return 0;\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n};\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/events/events.js\n ** module id = 163\n ** module chunks = 1\n **/","var keyMirror = require('keymirror');\n\nmodule.exports = keyMirror({\n\tSTEP_COMPLETE: null,\n\tSTEP_GET_STARTED: null,\n\tSTEP_SELECT: null,\n\tSTEP_NEXT: null,\n\tSTEP_SKIP: null,\n\tSITE_SET_TITLE: null,\n\tSITE_SET_TYPE: null,\n\tSITE_SET_DESCRIPTION: null,\n\tSITE_ADD_BUSINESS_ADDRESS: null,\n\tSITE_SAVE_TITLE_AND_DESCRIPTION: null,\n\tSITE_CONTACT_PAGE_ID: null,\n\tSITE_SET_THEME: null,\n\tSITE_INSTALL_THEME: null,\n\tSITE_JETPACK_CONFIGURED: null,\n\tSITE_JETPACK_MODULE_ENABLED: null,\n\tSITE_JETPACK_MODULE_DISABLED: null,\n\tSITE_JETPACK_JUMPSTART_ENABLED: null,\n\tSITE_JETPACK_ADD_MODULES: null,\n\tSITE_SET_LAYOUT: null,\n\n\tSITE_CREATE_CONTACT_US_PAGE: null,\n\tSITE_CREATE_LAYOUT_PAGES: null,\n\n\tSAVE_STARTED: null,\n\tSAVE_FINISHED: null,\n\n\tSET_FLASH: null,\n\tUNSET_FLASH: null,\n\tFLASH_SEVERITY_NOTICE: null,\n\tFLASH_SEVERITY_ERROR: null,\n\n\tRESET_DATA: null,\n\n\tSHOW_SPINNER: null,\n\tHIDE_SPINNER: null\n});\n\n\n\n/** WEBPACK FOOTER **\n ** ./client/constants/jetpack-onboarding-constants.js\n **/","/**\n * Copyright 2013-2014 Facebook, Inc.\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\"use strict\";\n\n/**\n * Constructs an enumeration with keys equal to their value.\n *\n * For example:\n *\n * var COLORS = keyMirror({blue: null, red: null});\n * var myColor = COLORS.blue;\n * var isColorValid = !!COLORS[myColor];\n *\n * The last line could not be performed if the values of the generated enum were\n * not equal to their keys.\n *\n * Input: {key1: val1, key2: val2}\n * Output: {key1: key1, key2: key2}\n *\n * @param {object} obj\n * @return {object}\n */\nvar keyMirror = function(obj) {\n var ret = {};\n var key;\n if (!(obj instanceof Object && !Array.isArray(obj))) {\n throw new Error('keyMirror(...): Argument must be an object.');\n }\n for (key in obj) {\n if (!obj.hasOwnProperty(key)) {\n continue;\n }\n ret[key] = key;\n }\n return ret;\n};\n\nmodule.exports = keyMirror;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/keymirror/index.js\n ** module id = 165\n ** module chunks = 1\n **/","var AppDispatcher = require('../dispatcher/app-dispatcher'),\n\tJPSConstants = require('../constants/jetpack-onboarding-constants'),\n\tPaths = require('../constants/jetpack-onboarding-paths'),\n\tFlashActions = require('./flash-actions'),\n\tSiteActions = require('./site-actions'),\n\tWPAjax = require('../utils/wp-ajax'),\n\tSpinnerActions = require('./spinner-actions'),\n\tSetupProgressStore = require('stores/setup-progress-store'),\n\tSiteStore = require('stores/site-store');\n\nvar SetupProgressActions = {\n\tresetData: function() {\n\t\tWPAjax.\n\t\t\tpost(JPS.site_actions.reset_data).\n\t\t\tfail(function(msg) {\n\t\t\t\tFlashActions.error(\"Failed to save data: \" + msg);\n\t\t\t});\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.RESET_DATA\n\t\t});\n\t},\n\n\tcompleteStep: function(slug, meta) {\n\t\tvar step = SetupProgressStore.getStepFromSlug(slug);\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.STEP_COMPLETE,\n\t\t\tslug: slug\n\t\t});\n\n\t\t// NOTE: this needs to come after the dispatch, so that the completion %\n\t\t// is already updated and can be included in the metadata\n\t\treturn this._recordStepComplete(step, meta);\n\t},\n\n\tcompleteAndNextStep: function(slug, meta) {\n\t\tthis.completeStep(slug, meta).always(function() {\n\t\t\t// getCurrentStep _should_ return the correct step slug for the 'next' step here...\n\t\t\t// this needs to be in the callback because otherwise there's a chance\n\t\t\t// that COMPLETE could be registered in analytics after VIEWED\n\t\t\tthis._recordStepViewed( SetupProgressStore.getCurrentStep() );\n\t\t}.bind(this));\n\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.STEP_NEXT\n\t\t});\n\t},\n\n\t// mark current step as skipped and move on\n\tskipStep: function() {\n\t\tFlashActions.unset();\n\n\t\tvar step = SetupProgressStore.getCurrentStep();\n\n\t\tif (!step.skipped) {\n\t\t\tthis._recordStepSkipped( step );\n\t\t}\n\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.STEP_SKIP\n\t\t});\n\t},\n\n\tsetCurrentStep: function( stepSlug ) {\n\t\tFlashActions.unset();\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.STEP_SELECT,\n\t\t\tslug: stepSlug\n\t\t});\n\t\tthis._recordStepViewed( { slug: stepSlug } );\n\t},\n\n\tgetStarted: function( siteType ) {\n\t\tWPAjax.\n\t\t\tpost(JPS.step_actions.start, { siteType: siteType }).\n\t\t\tfail(function(msg) {\n\t\t\t\tFlashActions.error(msg);\n\t\t\t});\n\n\n\t\tSiteActions.setType( siteType );\n\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.STEP_GET_STARTED\n\t\t});\n\t},\n\n\tcloseJPO: function() {\n\t\tSpinnerActions.show(\"\");\n\t\tWPAjax.\n\t\t\tpost(JPS.step_actions.close).\n\t\t\tfail(function(msg) {\n\t\t\t\tSpinnerActions.hide();\n\t\t\t\tFlashActions.error(msg);\n\t\t\t}).\n\t\t\talways(function() {\n\t\t\t\twindow.location.reload();\n\t\t\t});\n\t},\n\n\tdisableJPO: function() {\n\t\tSpinnerActions.show(\"\");\n\t\tWPAjax.\n\t\t\tpost(JPS.step_actions.disable).\n\t\t\tfail(function(msg) {\n\t\t\t\tSpinnerActions.hide();\n\t\t\t\tFlashActions.error(msg);\n\t\t\t}).\n\t\t\talways(function() {\n\t\t\t\twindow.location.reload();\n\t\t\t});\n\t},\n\n\t// moves on to the next step, but doesn't mark it as \"skipped\"\n\tselectNextStep: function() {\n\t\tFlashActions.unset();\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.STEP_NEXT\n\t\t});\n\t\tthis._recordStepViewed( SetupProgressStore.getCurrentStep() );\n\t},\n\n\tsubmitTitleStep: function( title, description ) {\n\t\tSiteActions.saveTitleAndDescription( title, description );\n\t\tthis.completeAndNextStep(Paths.SITE_TITLE_STEP_SLUG);\n\t},\n\n\tsubmitBusinessAddress: function( businessAddress ) {\n\t\tSiteActions.saveBusinessAddress( businessAddress );\n\t\tthis.completeStep(Paths.BUSINESS_ADDRESS_SLUG);\n\t\tthis.setCurrentStep( Paths.REVIEW_STEP_SLUG );\n\t},\n\n\tsubmitLayoutStep: function( layout ) {\n\t\tSiteActions.setLayout( layout ).done( function() {\n\t\t\tvar step = SetupProgressStore.getStepFromSlug( Paths.IS_BLOG_STEP_SLUG );\n\t\t\tif ( ! step.completed ) {\n\t\t\t\tthis.completeStep( Paths.IS_BLOG_STEP_SLUG );\n\t\t\t}\n\t\t\tthis.completeAndNextStep( Paths.HOMEPAGE_STEP_SLUG );\n\t\t}.bind( this ) );\n\t},\n\n\tconfirmHomepageStep: function( layout ) {\n\t\tthis.completeStep( Paths.IS_BLOG_STEP_SLUG );\n\t\tthis.setCurrentStep( Paths.HOMEPAGE_STEP_SLUG );\n\t},\n\n\tcreateContactPage: function(contactPage) {\n\t\tSiteActions.createContactUsPage(contactPage);\n\t\tthis.completeStep(Paths.CONTACT_PAGE_STEP_SLUG);\n\t\tthis.selectNextStep();\n\t},\n\n\tskipContactPageBuild: function() {\n\t\tthis.completeAndNextStep(Paths.CONTACT_PAGE_STEP_SLUG);\n\t},\n\n\tsubmitJetpackJumpstart: function() {\n\t\tSiteActions.enableJumpstart().done(function() {\n\t\t\tthis.completeStep(Paths.JETPACK_MODULES_STEP_SLUG);\n\t\t}.bind(this));\n\t},\n\n\tsetActiveTheme: function(theme) {\n\t\tSiteActions.setActiveTheme(theme).done(function() {\n\t\t\tthis.completeStep(Paths.DESIGN_STEP_SLUG, {\n\t\t\t\tthemeId: theme.id\n\t\t\t});\n\t\t}.bind(this));\n\t},\n\n\tsaveDesignStep: function() {\n\t\tthis.completeAndNextStep(Paths.DESIGN_STEP_SLUG, {\n\t\t\tthemeId: SiteStore.getActiveThemeId()\n\t\t});\n\t},\n\n\t_recordStepViewed: function( step ) {\n\t\t// record analytics to say we viewed the next step\n \t\treturn WPAjax.\n \t\t\tpost(JPS.step_actions.view, {\n \t\t\t\tstep: step.slug\n \t\t\t}, {\n \t\t\t\tquiet: true\n \t\t\t});\n\t},\n\n\t_recordStepComplete: function( step, meta ) {\n\t\tif (typeof(meta) === 'undefined') {\n\t\t\tmeta = {};\n\t\t}\n\n\t\tmeta.completion = SetupProgressStore.getProgressPercent();\n\n\t\treturn WPAjax.\n\t\t\tpost(JPS.step_actions.complete, {\n\t\t\t\tstep: step.slug,\n\t\t\t\tdata: meta\n\t\t\t}).\n\t\t\tfail(function(msg) {\n\t\t\t\tFlashActions.error(msg);\n\t\t\t});\n\t},\n\n\t_recordStepSkipped: function( step ) {\n\t\treturn WPAjax.\n\t\t\tpost(JPS.step_actions.skip, {\n\t\t\t\tstep: step.slug\n\t\t\t}).\n\t\t\tfail(function(msg) {\n\t\t\t\tFlashActions.error(msg);\n\t\t\t});\n\t}\n};\n\nmodule.exports = SetupProgressActions;\n\n\n/** WEBPACK FOOTER **\n ** ./client/actions/setup-progress-actions.js\n **/","module.exports = {\n\t// steps\n\tSITE_TITLE_STEP_SLUG: 'title',\n\tIS_BLOG_STEP_SLUG: 'is-blog',\n\tHOMEPAGE_STEP_SLUG: 'homepage',\n\tTRAFFIC_STEP_SLUG: 'traffic',\n\tSTATS_MONITORING_STEP_SLUG: 'stats-monitoring',\n\tDESIGN_STEP_SLUG: 'design',\n\tADVANCED_STEP_SLUG: 'advanced',\n\tREVIEW_STEP_SLUG: 'review',\n\tJETPACK_MODULES_STEP_SLUG: 'jetpack',\n\tCONTACT_PAGE_STEP_SLUG: 'contact-page',\n\tBUSINESS_ADDRESS_SLUG: 'business-address'\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./client/constants/jetpack-onboarding-paths.js\n **/","var AppDispatcher = require('../dispatcher/app-dispatcher'),\n\tJPSConstants = require('../constants/jetpack-onboarding-constants');\n\nvar FlashActions = {\n\tnotice: function(msg) {\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SET_FLASH,\n\t\t\tmessage: msg,\n\t\t\tseverity: JPSConstants.FLASH_SEVERITY_NOTICE\n\t\t});\n\t},\n\n\terror: function(msg) {\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SET_FLASH,\n\t\t\tmessage: msg,\n\t\t\tseverity: JPSConstants.FLASH_SEVERITY_ERROR\n\t\t});\n\t},\n\n\tunset: function() {\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.UNSET_FLASH\n\t\t});\n\t}\n};\n\nmodule.exports = FlashActions;\n\n\n/** WEBPACK FOOTER **\n ** ./client/actions/flash-actions.js\n **/","var AppDispatcher = require('../dispatcher/app-dispatcher'),\n\tJPSConstants = require('../constants/jetpack-onboarding-constants'),\n\tSiteStore = require('stores/site-store'),\n\tFlashActions = require('./flash-actions.js'),\n\tSpinnerActions = require('./spinner-actions.js'),\n\tWPAjax = require('../utils/wp-ajax');\n\nvar SiteActions = {\n\tsetTitle: function(title) {\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SITE_SET_TITLE,\n\t\t\ttitle: title\n\t });\n\t},\n\n\tsetType: function(type) {\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SITE_SET_TYPE,\n\t\t\ttype: type\n\t });\n\t},\n\n\tsetDescription: function(description) {\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SITE_SET_DESCRIPTION,\n\t\t\tdescription: description\n\t });\n\t},\n\n\tsaveTitleAndDescription: function( title, description ) {\n\n\t\tWPAjax.\n\t\t\tpost( JPS.site_actions.set_title, { title: title, description: description } ).\n\t\t\tfail( function ( msg ) {\n\t\t\t\tFlashActions.error(\"Error setting title: \"+msg);\n\t\t\t});\n\n\t\tjQuery('#wp-admin-bar-site-name .ab-item').html(title);\n\n\t\t// FlashActions.notice( \"Set title to '\"+title+\"' and description to '\"+description+\"'\" );\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SITE_SAVE_TITLE_AND_DESCRIPTION,\n\t\t\ttitle: title,\n\t\t\tdescription: description\n\t });\n\n\t\treturn jQuery.Deferred().resolve(); // XXX HACK\n\t},\n\n\tsaveBusinessAddress: function( businessAddress ) {\n\t\tWPAjax.\n\t\t\tpost( JPS.site_actions.add_business_address, businessAddress ).\n\t\t\tfail( function ( msg ) {\n\t\t\t\tFlashActions.error(\"Error setting title: \"+msg);\n\t\t\t});\n\n\t\tconst { business_address_1, business_address_2, business_city, business_name, business_state, business_zip } = businessAddress;\n\n\t\tJPS.bloginfo = Object.assign( {}, JPS.bloginfo, { business_address_1, business_address_2, business_city, business_name, business_state, business_zip } );\n\n\t\t// FlashActions.notice( \"Set title to '\"+title+\"' and description to '\"+description+\"'\" );\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SITE_ADD_BUSINESS_ADDRESS,\n\t\t\taddress: businessAddress\n\t });\n\n\t\treturn jQuery.Deferred().resolve(); // XXX HACK\n\t},\n\n\tsetContactPageId: function(contactPageID) {\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SITE_CONTACT_PAGE_ID,\n\t\t\tcontactPageID: contactPageID\n\t\t});\n\t},\n\n\t_installTheme: function ( theme ) {\n\t\tif ( ! theme.installed ) {\n\t\t\tSpinnerActions.show(\"Installing '\"+theme.name+\"'\");\n\t\t\treturn WPAjax.\n\t\t\t\tpost( JPS.site_actions.install_theme, { themeId: theme.id } ).\n\t\t\t\tdone( function ( ) {\n\t\t\t\t\ttheme.installed = true;\n\t\t\t\t\tAppDispatcher.dispatch({\n\t\t\t\t\t\tactionType: JPSConstants.SITE_INSTALL_THEME,\n\t\t\t\t\t\ttheme: theme\n\t\t\t\t });\n\t\t\t\t}).\n\t\t\t\tfail( function ( msg ) {\n\t\t\t\t\tFlashActions.error(\"Server error installing theme: \"+msg);\n\t\t\t\t}).\n\t\t\t\talways( function() {\n\t\t\t\t\tSpinnerActions.hide();\n\t\t\t\t});\n\t\t} else {\n\t\t\treturn jQuery.Deferred().resolve();\n\t\t}\n\t},\n\n\t_activateTheme: function ( theme ) {\n\t\tWPAjax.\n\t\t\tpost( JPS.site_actions.set_theme, { themeId: theme.id } ).\n\t\t\tfail( function ( msg ) {\n\t\t\t\tFlashActions.error(\"Server error setting theme: \"+msg);\n\t\t\t});\n\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SITE_SET_THEME,\n\t\t\tthemeId: theme.id\n\t });\n\t},\n\n\tsetActiveTheme: function( theme ) {\n\n\t\tthis._installTheme(theme).\n\t\t\tdone( function() {\n\t\t\t\tthis._activateTheme(theme);\n\t\t\t}.bind(this));\n\n\t\treturn jQuery.Deferred().resolve(); // XXX HACK\n\t},\n\n\tsetLayout: function( layoutName ) {\n\n\t\tWPAjax.\n\t\t\tpost( JPS.site_actions.set_layout, { layout: layoutName } ).\n\t\t\tdone( function ( page_info ){\n\t\t\t\tAppDispatcher.dispatch( {\n\t\t\t\t\tactionType: JPSConstants.SITE_CREATE_LAYOUT_PAGES,\n\t\t\t\t\tdata: page_info\n\t\t\t\t} );\n\t\t\t} ).\n\t\t\tfail( function (msg ){\n\t\t\t\tFlashActions.error(\"Error setting layout: \"+msg);\n\t\t\t} );\n\n\t\t// FlashActions.notice(\"Set layout to \"+layoutName);\n\t\tAppDispatcher.dispatch( {\n\t\t\tactionType: JPSConstants.SITE_SET_LAYOUT,\n\t\t\tlayout: layoutName\n\t\t} );\n\n\t\treturn jQuery.Deferred().resolve(); // XXX HACK\n\t},\n\n\tcreateContactUsPage: function( contactPage ) {\n\n\t\treturn WPAjax.\n\t\t\tpost( JPS.site_actions.build_contact_page, { buildContactPage: contactPage } ).\n\t\t\tdone( function( page_info ) {\n\t\t\t\tAppDispatcher.dispatch({\n\t\t\t\t\tactionType: JPSConstants.SITE_CREATE_CONTACT_US_PAGE,\n\t\t\t\t\tdata: page_info\n\t\t\t\t});\n\t\t\t}).\n\t\t\tfail( function( msg ) {\n\t\t\t\tFlashActions.error(\"Error creating contact us page: \"+msg);\n\t\t\t});\n\t},\n\n\tskipContactPageBuild: function() {\n\t\t// FlashActions.notice( \"Build the contact us page\" );\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SITE_CREATE_CONTACT_US_PAGE\n\t\t});\n\n\t\treturn jQuery.Deferred().resolve(); // XXX HACK\n\t},\n\n\tconfigureJetpack: function(return_to_step) {\n\n\n/****************\n\ncomplete step\n\n*********************/\n\n\t\treturn WPAjax.\n\t\t\tpost( JPS.site_actions.configure_jetpack, { return_to_step: return_to_step } ).\n\t\t\tdone( function ( data ) {\n\t\t\t\tAppDispatcher.dispatch({\n\t\t\t\t\tactionType: JPSConstants.SITE_JETPACK_CONFIGURED\n\t\t\t });\n\n\t\t\t\tif ( data.next ) {\n\t\t\t\t\twindow.location.replace(data.next);\n\t\t\t\t}\n\t\t\t}).\n\t\t\tfail( function ( msg ) {\n\t\t\t\tFlashActions.error(\"Error enabling Jetpack: \"+msg);\n\t\t\t});\n\t},\n\n\tactivateJetpackModule: function(module_slug) {\n\n\t\tWPAjax.\n\t\t\tpost( JPS.site_actions.activate_jetpack_modules, { modules: [module_slug] }).\n\t\t\tfail( function ( msg ) {\n\t\t\t\tFlashActions.error(\"Error activating Jetpack module: \"+msg);\n\t\t\t});\n\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SITE_JETPACK_MODULE_ENABLED,\n\t\t\tslug: module_slug\n\t });\n\n\t\treturn jQuery.Deferred().resolve(); // XXX HACK\n\t},\n\n\tdeactivateJetpackModule: function(module_slug) {\n\n\t\tWPAjax.\n\t\t\tpost( JPS.site_actions.deactivate_jetpack_modules, { modules: [module_slug] }).\n\t\t\tfail( function ( msg ) {\n\t\t\t\tFlashActions.error(\"Error deactivating Jetpack module: \"+msg);\n\t\t\t});\n\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SITE_JETPACK_MODULE_DISABLED,\n\t\t\tslug: module_slug\n\t });\n\n\t\treturn jQuery.Deferred().resolve(); // XXX HACK\n\t},\n\n\tloadAllJetpackModules: function() {\n\t\tif ( SiteStore.getJetpackAdditionalModules().length === 0 ) {\n\t\t\treturn WPAjax.\n\t\t\t\tpost( JPS.site_actions.list_jetpack_modules ).\n\t\t\t\tdone( function ( all_modules ) {\n\t\t\t\t\tAppDispatcher.dispatch({\n\t\t\t\t\t\tactionType: JPSConstants.SITE_JETPACK_ADD_MODULES,\n\t\t\t\t\t\tmodules: all_modules\n\t\t\t\t });\n\t\t\t\t}).\n\t\t\t\tfail( function ( msg ) {\n\t\t\t\t\tFlashActions.error(\"Error fetching all Jetpack modules: \"+msg);\n\t\t\t\t});\n\t\t} else {\n\t\t\treturn jQuery.Deferred().resolve(); // XXX HACK\n\t\t}\n\t},\n\n\tenableJumpstart: function() {\n\t\tWPAjax.\n\t\t\tpost( JPS.site_actions.activate_jetpack_modules, { modules: SiteStore.getJumpstartModuleSlugs() }).\n\t\t\tfail( function ( msg ) {\n\t\t\t\tFlashActions.error(\"Error activating Jetpack modules: \"+msg);\n\t\t\t});\n\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SITE_JETPACK_JUMPSTART_ENABLED\n\t });\n\n\t\treturn jQuery.Deferred().resolve(); // XXX HACK\n\t}\n};\n\nmodule.exports = SiteActions;\n\n\n/** WEBPACK FOOTER **\n ** ./client/actions/site-actions.js\n **/","/*\n * Store which manages and persists site information\n */\n\nvar AppDispatcher = require('../dispatcher/app-dispatcher'),\n EventEmitter = require('events').EventEmitter,\n JPSConstants = require('../constants/jetpack-onboarding-constants'),\n WPAjax = require('../utils/wp-ajax');\n\nvar CHANGE_EVENT = 'change';\n\nvar layout = JPS.steps.layout.current;\n\nfunction setType(newType) {\n JPS.bloginfo.type = newType;\n}\n\nfunction setTitle(newTitle) {\n JPS.bloginfo.name = newTitle;\n}\n\nfunction setDescription(newDescription) {\n JPS.bloginfo.description = newDescription;\n}\n\nfunction setActiveTheme(activeThemeId) {\n JPS.themes.forEach( function( theme ) {\n if ( theme.id === activeThemeId ) {\n theme.active = true;\n } else {\n theme.active = false;\n }\n } );\n}\n\nfunction installedTheme(theme) {\n JPS.themes.unshift(theme);\n JPS.themes = JPS.themes.slice(0, 3);\n}\n\nfunction setJetpackModuleActivated(slug) {\n if ( _.indexOf( JPS.jetpack.active_modules, slug ) === -1 ) {\n JPS.jetpack.active_modules.push(slug);\n }\n}\n\nfunction setJetpackModuleDectivated(slug) {\n var index = _.indexOf( JPS.jetpack.active_modules, slug );\n if ( index >= 0) {\n JPS.jetpack.active_modules.splice(index, 1);\n }\n}\n\nfunction setJetpackAdditionalModules(modules) {\n JPS.jetpack.additional_modules = _.filter(modules, function(module) {\n return _.indexOf(JPS.jetpack.jumpstart_modules.map(function(mod){return mod.slug;}), module.slug) === -1;\n });\n}\n\nfunction setLayout(layoutName) {\n layout = layoutName; // XXX TODO: get this value dynamically from the server!\n}\n\nfunction setJetpackConfigured() {\n JPS.jetpack.configured = true;\n}\n\nfunction setJetpackJumpstartActivated() {\n JPS.jetpack.jumpstart_modules.forEach( function( module ) {\n setJetpackModuleActivated( module.slug );\n });\n}\n\nfunction setContactUsPage( pageInfo ) {\n JPS.steps.contact_page = pageInfo;\n}\n\nfunction setLayoutPages( pageInfo ) {\n JPS.steps.layout.welcomeEditUrl = pageInfo.welcome;\n JPS.steps.layout.postsEditUrl = pageInfo.posts;\n}\n\nvar SiteStore = _.extend({}, EventEmitter.prototype, {\n\n getTitle: function() {\n return JPS.bloginfo.name;\n },\n\n getType: function() {\n return JPS.bloginfo.type;\n },\n\n getDescription: function() {\n return JPS.bloginfo.description;\n },\n\n getContactPageURL: function() {\n return JPS.steps.contact_page && JPS.steps.contact_page.url;\n },\n\n getContactPageEditURL: function() {\n if ( JPS.steps.contact_page && JPS.steps.contact_page.editUrl ) {\n return JPS.steps.contact_page.editUrl.replace('&','&');\n }\n },\n\n getWelcomePageEditURL: function() {\n if ( JPS.steps.layout && JPS.steps.layout.welcomeEditUrl ) {\n return JPS.steps.layout.welcomeEditUrl.replace('&','&');\n }\n },\n\n getNewsPageEditURL: function() {\n if ( JPS.steps.layout && JPS.steps.layout.postsEditUrl ) {\n return JPS.steps.layout.postsEditUrl.replace('&','&');\n }\n },\n\n getThemes: function() {\n return JPS.themes;\n },\n\n getActiveThemeId: function() {\n for(var i=0; i < JPS.themes.length; i++) {\n var theme = JPS.themes[i];\n if ( theme.active ) {\n return theme.id;\n }\n }\n return null;\n },\n\n getJetpackConfigured: function() {\n return JPS.jetpack.configured;\n },\n\n getActiveModuleSlugs: function() {\n return JPS.jetpack.active_modules;\n },\n\n isJetpackModuleEnabled: function(slug) {\n return ( _.indexOf( JPS.jetpack.active_modules, slug ) >= 0 );\n },\n\n getJetpackAdditionalModules: function() {\n return JPS.jetpack.additional_modules;\n },\n\n getJumpstartModuleSlugs: function() {\n return JPS.jetpack.jumpstart_modules.map(function(module) { return module.slug; });\n },\n\n getJumpstartModules: function() {\n return JPS.jetpack.jumpstart_modules;\n },\n\n getJetpackSettingsUrl: function() {\n return JPS.steps.advanced_settings && JPS.steps.advanced_settings.jetpack_modules_url;\n },\n\n getPopularThemes: function() {\n return WPAjax.post(JPS.site_actions.get_popular_themes, {}, {quiet: true});\n },\n\n getJetpackJumpstartEnabled: function() {\n for(var i=0; i < JPS.jetpack.jumpstart_modules.length; i++) {\n var module = JPS.jetpack.jumpstart_modules[i];\n if ( ! this.isJetpackModuleEnabled( module.slug ) ) {\n return false;\n }\n }\n return true;\n },\n\n getLayout: function() {\n return layout;\n },\n\n emitChange: function() {\n this.emit(CHANGE_EVENT);\n },\n\n addChangeListener: function(callback) {\n this.on(CHANGE_EVENT, callback);\n },\n\n removeChangeListener: function(callback) {\n this.removeListener(CHANGE_EVENT, callback);\n }\n});\n\n// Register callback to handle all updates\nAppDispatcher.register(function(action) {\n\n switch(action.actionType) {\n case JPSConstants.SITE_SET_TYPE:\n setType(action.type);\n SiteStore.emitChange();\n break;\n\n case JPSConstants.SITE_SET_TITLE:\n setTitle(action.title);\n SiteStore.emitChange();\n break;\n\n case JPSConstants.SITE_SET_DESCRIPTION:\n setDescription(action.description);\n SiteStore.emitChange();\n break;\n\n case JPSConstants.SITE_SAVE_TITLE_AND_DESCRIPTION:\n setTitle(action.title);\n setDescription(action.description);\n SiteStore.emitChange();\n break;\n\n case JPSConstants.SITE_SET_THEME:\n setActiveTheme(action.themeId);\n SiteStore.emitChange();\n break;\n\n case JPSConstants.SITE_INSTALL_THEME:\n installedTheme(action.theme);\n SiteStore.emitChange();\n break;\n\n case JPSConstants.SITE_JETPACK_CONFIGURED:\n setJetpackConfigured();\n SiteStore.emitChange();\n break;\n\n case JPSConstants.SITE_JETPACK_ADD_MODULES:\n setJetpackAdditionalModules(action.modules);\n SiteStore.emitChange();\n break;\n\n case JPSConstants.SITE_JETPACK_MODULE_ENABLED:\n setJetpackModuleActivated(action.slug);\n SiteStore.emitChange();\n break;\n\n case JPSConstants.SITE_JETPACK_MODULE_DISABLED:\n setJetpackModuleDectivated(action.slug);\n SiteStore.emitChange();\n break;\n\n case JPSConstants.SITE_JETPACK_JUMPSTART_ENABLED:\n setJetpackJumpstartActivated();\n SiteStore.emitChange();\n break;\n\n case JPSConstants.SITE_SET_LAYOUT:\n setLayout(action.layout);\n SiteStore.emitChange();\n break;\n\n case JPSConstants.SITE_CREATE_CONTACT_US_PAGE:\n setContactUsPage(action.data);\n SiteStore.emitChange();\n break;\n\n case JPSConstants.SITE_CREATE_LAYOUT_PAGES:\n setLayoutPages( action.data );\n SiteStore.emitChange();\n break;\n\n default:\n // no op\n }\n});\n\nmodule.exports = SiteStore;\n\n\n\n/** WEBPACK FOOTER **\n ** ./client/stores/site-store.js\n **/","/*\n * A simple wrapper for calls to WP's \"ajaxurl\".\n *\n * This exists because WP's wp_send_json_error doesn't actually send an error code, but rather\n * a 200 OK response with a structure like this:\n * {success: false, data: \"something went wrong\"}\n *\n * So this class smoothes the difference between 50x errors and WP's error object.\n *\n * For convenience, this returns a jQuery.Deferred object which can have .done() \n * and .fail() methods chained onto it, similar to jQuery.post's \"success\" and \"fail\"\n *\n * Also, it accepts an \"action\" param instead of a URL, since all WP ajax requests\n * actually go via the same URL with different parameters, and it invokes callbacks with\n * just the \"data\" portion of WP's ajax payload, rather than the whole structure.\n * \n **/\n\nvar DataActions = require('actions/data-actions');\n\nvar WPAjax = (function() {\n\n\treturn {\n\t\tpost: function(action, payload, options) {\n\t\t\toptions = typeof options !== 'undefined' ? options : {};\n\t\t\tpayload = typeof payload !== 'undefined' ? payload : {};\n\t\t\tvar data = _.extend(payload, {action: action, nonce: JPS.nonce});\n\t\t\t\n\t\t\tvar deferred = jQuery.Deferred();\n\n\t\t\t// passing quiet: true allows page navigation before this request has finished.\n\t\t\t// this is also handy when you're calling from within a Dispatch cycle, as it \n\t\t\t// no longer triggers an additional Dispatch (which would cause an error)\n\t\t\tif ( !options.quiet ) {\n\t\t\t\tDataActions.requestStarted();\n\t\t\t}\n\n\t\t\tjQuery.post( ajaxurl, data )\n\t\t\t\t.success( function( response ) {\n\t\t\t\t\tif ( ! response.success ) {\n\t\t\t\t\t\tdeferred.reject(response.data);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdeferred.resolve(response.data);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.fail( function() {\n\t\t\t\t\tdeferred.reject(\"Server error\");\n\t\t\t\t})\n\t\t\t\t.always( function () {\n\t\t\t\t\tif ( !options.quiet ) {\n\t\t\t\t\t\tDataActions.requestFinished();\n\t\t\t\t\t}\n\t\t\t\t});\t\n\n\t\t\treturn deferred;\n\t\t}\n\t};\n\n})();\n\nmodule.exports = WPAjax;\n\n\n/** WEBPACK FOOTER **\n ** ./client/utils/wp-ajax.js\n **/","var AppDispatcher = require('../dispatcher/app-dispatcher'),\n\tJPSConstants = require('../constants/jetpack-onboarding-constants');\n\nvar DataActions = {\n\trequestStarted: function() {\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SAVE_STARTED\n\t\t});\n\t},\n\n\trequestFinished: function() {\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SAVE_FINISHED\n\t\t});\n\t}\n};\n\nmodule.exports = DataActions;\n\n\n/** WEBPACK FOOTER **\n ** ./client/actions/data-actions.js\n **/","var AppDispatcher = require('../dispatcher/app-dispatcher'),\n\tJPSConstants = require('../constants/jetpack-onboarding-constants');\n\nvar SpinnerActions = {\n\tshow: function(msg) {\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SHOW_SPINNER,\n\t\t\tmessage: msg\n\t\t});\n\t},\n\n\thide: function() {\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.HIDE_SPINNER,\n\t\t});\t\n\t},\n\n\tshowAsync: function(msg) {\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SHOW_ASYNC_SPINNER,\n\t\t\tmessage: msg\n\t\t});\t\t\n\t},\n\n\thideAsync: function() {\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.HIDE_ASYNC_SPINNER\n\t\t});\t\t\t\n\t}\n};\n\nmodule.exports = SpinnerActions;\n\n\n/** WEBPACK FOOTER **\n ** ./client/actions/spinner-actions.js\n **/","var AppDispatcher = require('../dispatcher/app-dispatcher'),\n\tEventEmitter = require('events').EventEmitter,\n\tJPSConstants = require('../constants/jetpack-onboarding-constants');\n\nvar CHANGE_EVENT = 'change';\n\nvar spinnerEnabled = false,\n\tspinnerMessage = null;\n\nfunction show(message) {\n\tspinnerEnabled = true;\n\tspinnerMessage = message;\n}\n\nfunction hide() {\n\tspinnerEnabled = false;\n\tspinnerMessage = null;\n}\n\nvar SpinnerStore = _.extend({}, EventEmitter.prototype, {\n\tshowing: function() {\n\t\treturn spinnerEnabled;\n\t},\n\n\tgetMessage: function() {\n\t\treturn spinnerMessage;\n\t},\n\n\taddChangeListener: function(callback) {\n\t\tthis.on( CHANGE_EVENT, callback );\n\t},\n\n\tremoveChangeListener: function(callback) {\n\t\tthis.removeListener( CHANGE_EVENT, callback );\n\t},\n\n\temitChange: function() {\n\t this.emit( CHANGE_EVENT );\n\t},\n});\n\nAppDispatcher.register(function(action) {\n\n switch(action.actionType) {\n case JPSConstants.SHOW_SPINNER:\n\t\tshow(action.message);\n\t\tSpinnerStore.emitChange();\n\t\tbreak;\n\n case JPSConstants.HIDE_SPINNER:\n \thide();\n \tSpinnerStore.emitChange();\n \tbreak;\n\n default:\n // no op\n }\n});\n\nmodule.exports = SpinnerStore;\n\n\n/** WEBPACK FOOTER **\n ** ./client/stores/spinner-store.js\n **/","var AppDispatcher = require('../dispatcher/app-dispatcher'),\n\tEventEmitter = require('events').EventEmitter,\n\tJPSConstants = require('../constants/jetpack-onboarding-constants');\n\n/*\n * This is a refcounted save monitor which warns if you try to leave the page while the data is still saving\n */\n\nvar _currentSaves = 0, jpoTimeout, CHANGE_EVENT = 'change';\n\nfunction incrementSaveCounter() {\n\t_currentSaves = _currentSaves + 1;\n}\n\nfunction decrementSaveCounter() {\n\t_currentSaves = _currentSaves - 1;\n}\n\nvar DataStore = _.extend({}, EventEmitter.prototype, {\n\tisSaving: function() {\n\t\treturn _currentSaves > 0;\n\t},\n\n\taddChangeListener: function(callback) {\n\t\tthis.on(CHANGE_EVENT, callback);\n\t},\n\n\tremoveChangeListener: function(callback) {\n\t\tthis.removeListener(CHANGE_EVENT, callback);\n\t},\n\n\temitChange: function() {\n\t this.emit(CHANGE_EVENT);\n\t},\n});\n\njQuery(window).on('beforeunload', function() {\n\tif(DataStore.isSaving()) {\n\t\tjpoTimeout = setTimeout(function() {\n\t // alert('You stayed');\n\t // noop\n\t }, 1000);\n\t return \"Your site changes are still saving.\";\n\t}\n});\n\njQuery(window).on('unload', function() {\n\tclearTimeout(jpoTimeout);\n});\n\nAppDispatcher.register(function(action) {\n\n switch(action.actionType) {\n case JPSConstants.SAVE_STARTED:\n \tincrementSaveCounter();\n\t\tDataStore.emitChange();\n\t\tbreak;\n\n case JPSConstants.SAVE_FINISHED:\n \tdecrementSaveCounter();\n \tDataStore.emitChange();\n \tbreak;\n\n default:\n // no op\n }\n});\n\nmodule.exports = DataStore;\n\n\n/** WEBPACK FOOTER **\n ** ./client/stores/data-store.js\n **/","/**\n * Displays a flash message, if set.\n * JSON structure:\n * { severity: 'notice', message: 'My message' }\n *\n * Valid severities:\n * - error, notice\n */\n\nvar React = require('react'),\n\tFlashStore = require('stores/flash-store');\n\nfunction getFlashState() {\n\treturn FlashStore.getFlash();\n}\n\nvar Flash = React.createClass( {\n\tcomponentDidMount: function() {\n\t\tFlashStore.addChangeListener( this._onChange );\n\t},\n\n\tcomponentWillUnmount: function() {\n\t\tFlashStore.removeChangeListener( this._onChange );\n\t},\n\n\t_onChange: function() {\n\t\tthis.setState( getFlashState() );\n\t},\n\n\tgetInitialState: function() {\n\t\treturn getFlashState();\n\t},\n\n\trender: function() {\n\t\tif ( this.state.message ) {\n\t\t\treturn (
Jetpack provides Stats, insights and visitor information.
\n\t\t\t\t\t
Use Jetpack tools like Publicize, Sharing, Subscribing and Related Posts to increase traffic, and onsite engagement.
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
Increase Security and Site Speed
\n\t\t\t\t\t\n\t\t\t\t\t
Gain peace of mind with Protect, the tool that has blocked billions of login attacks on millions of sites.
\n\t\t\t\t\t
Photon utilizes the state-of-the-art WordPress.com content delivery network to load your gorgeous images super fast optimized for any device, and it’s completely free.
);\n\t\t}\n\t},\n\n} );\n\n\n\n/** WEBPACK FOOTER **\n ** ./client/components/page/index.jsx\n **/","/*\n * Store which manages and persists setup wizard progress\n */\n\nvar AppDispatcher = require('../dispatcher/app-dispatcher'),\n EventEmitter = require('events').EventEmitter,\n JPSConstants = require('../constants/jetpack-onboarding-constants');\n\nvar CHANGE_EVENT = 'change';\n\nvar _steps, _started = JPS.started; \n\nfunction setSteps(steps) {\n\n // set the completion status of each step to the saved values\n steps.forEach( function(step) {\n // default values for skipped, completed and static\n if ( typeof( step.completed ) === 'undefined' ) {\n step.completed = (JPS.step_status[step.slug] && JPS.step_status[step.slug].completed) || false; \n }\n\n if ( typeof( step.skipped ) === 'undefined' ) {\n step.skipped = (JPS.step_status[step.slug] && JPS.step_status[step.slug].skipped) || false; \n }\n\n if ( typeof( step.static ) === 'undefined' ) {\n step.static = false;\n }\n\n // set to 'true' if you want the wizard to move to this step even if it's been completed\n // by default completed steps are skipped\n if ( typeof( step.neverSkip ) === 'undefined' ) {\n step.neverSkip = false;\n }\n\n // default value for includeInProgress\n if ( typeof( step.includeInProgress ) === 'undefined') {\n step.includeInProgress = true;\n }\n }); \n \n _steps = steps;\n \n // set location to first pending step, if not set\n ensureValidStepSlug(); \n}\n\nfunction setStarted() {\n _started = true;\n selectNextPendingStep();\n}\n\nfunction complete(stepSlug) {\n var step = getStepFromSlug(stepSlug);\n step.completed = true;\n step.skipped = false;\n}\n\nfunction skip() {\n var stepSlug = currentStepSlug();\n var step = getStepFromSlug(stepSlug);\n step.skipped = true;\n selectNextPendingStep();\n}\n\nfunction getStepFromSlug( stepSlug ) {\n var currentStep = null;\n _.each( _steps, function( step ) {\n if( step.slug === stepSlug ) {\n currentStep = step;\n }\n });\n return currentStep;\n}\n\nfunction ensureValidStepSlug() {\n var stepSlug = currentStepSlug();\n if ( ! ( stepSlug && getStepFromSlug( stepSlug ) ) ) {\n\n var pendingStep = getNextPendingStep();\n if ( pendingStep !== null ) {\n var hash = 'welcome/steps/'+pendingStep.slug;\n window.history.pushState(null, document.title, window.location.pathname + '#' + hash);\n } \n }\n}\n\nfunction selectNextPendingStep() {\n var pendingStep = getNextPendingStep();\n if ( pendingStep !== null ) {\n select(pendingStep.slug); // also sets the window location hash\n }\n}\n\nfunction getNextPendingStep() {\n // if the _next_ step is neverSkip, we proceed to it\n var stepIndex = currentStepIndex();\n if ( stepIndex !== false ) {\n if ( _steps[stepIndex+1] && _steps[stepIndex+1].neverSkip === true ) {\n return _steps[stepIndex+1];\n }\n }\n\n // otherwise find the next uncompleted, unskipped step\n var nextPendingStep = _.findWhere( _steps, { completed: false, skipped: false } );\n return nextPendingStep;\n}\n\nfunction getPendingStepAfter( fromStep ) {\n\n}\n\nfunction currentStepSlug() {\n if ( window.location.hash.indexOf('#welcome/steps') === 0 ) {\n var parts = window.location.hash.split('/');\n var stepSlug = parts[parts.length-1];\n return stepSlug;\n } else {\n return null;\n }\n}\n\nfunction currentStepIndex() {\n var slug = currentStepSlug();\n return getStepIndex(slug);\n}\n\nfunction getStepIndex(slug) {\n for ( var i=0; i<_steps.length; i++ ) {\n if ( _steps[i].slug === slug ) {\n return i;\n }\n }\n return false;\n}\n\nfunction select(stepSlug) {\n var hash = 'welcome/steps/'+stepSlug;\n window.history.pushState(null, document.title, window.location.pathname + '#' + hash);\n}\n\n//reset everything back to defaults\nfunction reset() {\n JPS.step_status = {};\n _.where( _steps, { static: false} ).forEach( function ( step ) { \n step.completed = false;\n step.skipped = false;\n } );\n _started = false;\n}\n\nvar SetupProgressStore = _.extend({}, EventEmitter.prototype, {\n\n init: function(steps) {\n setSteps(steps);\n },\n\n getAllSteps: function() {\n return _steps;\n },\n\n isNewUser: function() {\n return !_started;\n },\n\n emitChange: function() {\n this.emit( CHANGE_EVENT );\n },\n\n getCurrentStep: function() {\n return getStepFromSlug( currentStepSlug() );\n },\n\n getNextPendingStep: function() {\n return getNextPendingStep(); // delegate\n },\n\n getStepFromSlug: function(slug) {\n return getStepFromSlug( slug ); // delegate\n },\n\n getProgressPercent: function() {\n \tvar numSteps = _.where( _steps, { includeInProgress: true } ).length;\n var completedSteps = _.where( _steps, { includeInProgress: true, completed: true } ).length;\n var percentComplete = (completedSteps / numSteps) * 90 + 10;\n var output = Math.round(percentComplete / 10) * 10;\n return output;\n },\n\n addChangeListener: function(callback) {\n this.on( CHANGE_EVENT, callback );\n },\n\n removeChangeListener: function(callback) {\n this.removeListener( CHANGE_EVENT, callback );\n }\n});\n\n// force a navigation refresh when the URL changes\nwindow.addEventListener(\"popstate\", function(){\n SetupProgressStore.emitChange();\n});\n\n// Register callback to handle all updates\nAppDispatcher.register(function(action) {\n \n switch(action.actionType) {\n case JPSConstants.STEP_GET_STARTED:\n setStarted();\n SetupProgressStore.emitChange();\n break;\n\n case JPSConstants.STEP_SELECT:\n select(action.slug);\n SetupProgressStore.emitChange();\n break;\n\n case JPSConstants.STEP_NEXT:\n selectNextPendingStep();\n SetupProgressStore.emitChange();\n break;\n\n case JPSConstants.STEP_COMPLETE:\n complete(action.slug);\n SetupProgressStore.emitChange();\n break;\n\n case JPSConstants.RESET_DATA:\n reset();\n SetupProgressStore.emitChange();\n break;\n\n case JPSConstants.STEP_SKIP:\n skip();\n SetupProgressStore.emitChange();\n break;\n\n default:\n // no op\n }\n});\n\nmodule.exports = SetupProgressStore;\n\n\n/** WEBPACK FOOTER **\n ** ./client/stores/setup-progress-store.js\n **/","/*\n * Copyright (c) 2014-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * AppDispatcher\n *\n * A singleton that operates as the central hub for application updates.\n */\n\nvar Dispatcher = require('flux').Dispatcher;\n\nmodule.exports = new Dispatcher();\n\n\n/** WEBPACK FOOTER **\n ** ./client/dispatcher/app-dispatcher.js\n **/","/**\n * Copyright (c) 2014-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\nmodule.exports.Dispatcher = require('./lib/Dispatcher');\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/flux/index.js\n ** module id = 160\n ** module chunks = 1\n **/","/**\n * Copyright (c) 2014-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Dispatcher\n * \n * @preventMunge\n */\n\n'use strict';\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\nvar invariant = require('fbjs/lib/invariant');\n\nvar _prefix = 'ID_';\n\n/**\n * Dispatcher is used to broadcast payloads to registered callbacks. This is\n * different from generic pub-sub systems in two ways:\n *\n * 1) Callbacks are not subscribed to particular events. Every payload is\n * dispatched to every registered callback.\n * 2) Callbacks can be deferred in whole or part until other callbacks have\n * been executed.\n *\n * For example, consider this hypothetical flight destination form, which\n * selects a default city when a country is selected:\n *\n * var flightDispatcher = new Dispatcher();\n *\n * // Keeps track of which country is selected\n * var CountryStore = {country: null};\n *\n * // Keeps track of which city is selected\n * var CityStore = {city: null};\n *\n * // Keeps track of the base flight price of the selected city\n * var FlightPriceStore = {price: null}\n *\n * When a user changes the selected city, we dispatch the payload:\n *\n * flightDispatcher.dispatch({\n * actionType: 'city-update',\n * selectedCity: 'paris'\n * });\n *\n * This payload is digested by `CityStore`:\n *\n * flightDispatcher.register(function(payload) {\n * if (payload.actionType === 'city-update') {\n * CityStore.city = payload.selectedCity;\n * }\n * });\n *\n * When the user selects a country, we dispatch the payload:\n *\n * flightDispatcher.dispatch({\n * actionType: 'country-update',\n * selectedCountry: 'australia'\n * });\n *\n * This payload is digested by both stores:\n *\n * CountryStore.dispatchToken = flightDispatcher.register(function(payload) {\n * if (payload.actionType === 'country-update') {\n * CountryStore.country = payload.selectedCountry;\n * }\n * });\n *\n * When the callback to update `CountryStore` is registered, we save a reference\n * to the returned token. Using this token with `waitFor()`, we can guarantee\n * that `CountryStore` is updated before the callback that updates `CityStore`\n * needs to query its data.\n *\n * CityStore.dispatchToken = flightDispatcher.register(function(payload) {\n * if (payload.actionType === 'country-update') {\n * // `CountryStore.country` may not be updated.\n * flightDispatcher.waitFor([CountryStore.dispatchToken]);\n * // `CountryStore.country` is now guaranteed to be updated.\n *\n * // Select the default city for the new country\n * CityStore.city = getDefaultCityForCountry(CountryStore.country);\n * }\n * });\n *\n * The usage of `waitFor()` can be chained, for example:\n *\n * FlightPriceStore.dispatchToken =\n * flightDispatcher.register(function(payload) {\n * switch (payload.actionType) {\n * case 'country-update':\n * case 'city-update':\n * flightDispatcher.waitFor([CityStore.dispatchToken]);\n * FlightPriceStore.price =\n * getFlightPriceStore(CountryStore.country, CityStore.city);\n * break;\n * }\n * });\n *\n * The `country-update` payload will be guaranteed to invoke the stores'\n * registered callbacks in order: `CountryStore`, `CityStore`, then\n * `FlightPriceStore`.\n */\n\nvar Dispatcher = (function () {\n function Dispatcher() {\n _classCallCheck(this, Dispatcher);\n\n this._callbacks = {};\n this._isDispatching = false;\n this._isHandled = {};\n this._isPending = {};\n this._lastID = 1;\n }\n\n /**\n * Registers a callback to be invoked with every dispatched payload. Returns\n * a token that can be used with `waitFor()`.\n */\n\n Dispatcher.prototype.register = function register(callback) {\n var id = _prefix + this._lastID++;\n this._callbacks[id] = callback;\n return id;\n };\n\n /**\n * Removes a callback based on its token.\n */\n\n Dispatcher.prototype.unregister = function unregister(id) {\n !this._callbacks[id] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Dispatcher.unregister(...): `%s` does not map to a registered callback.', id) : invariant(false) : undefined;\n delete this._callbacks[id];\n };\n\n /**\n * Waits for the callbacks specified to be invoked before continuing execution\n * of the current callback. This method should only be used by a callback in\n * response to a dispatched payload.\n */\n\n Dispatcher.prototype.waitFor = function waitFor(ids) {\n !this._isDispatching ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Dispatcher.waitFor(...): Must be invoked while dispatching.') : invariant(false) : undefined;\n for (var ii = 0; ii < ids.length; ii++) {\n var id = ids[ii];\n if (this._isPending[id]) {\n !this._isHandled[id] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Dispatcher.waitFor(...): Circular dependency detected while ' + 'waiting for `%s`.', id) : invariant(false) : undefined;\n continue;\n }\n !this._callbacks[id] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Dispatcher.waitFor(...): `%s` does not map to a registered callback.', id) : invariant(false) : undefined;\n this._invokeCallback(id);\n }\n };\n\n /**\n * Dispatches a payload to all registered callbacks.\n */\n\n Dispatcher.prototype.dispatch = function dispatch(payload) {\n !!this._isDispatching ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch.') : invariant(false) : undefined;\n this._startDispatching(payload);\n try {\n for (var id in this._callbacks) {\n if (this._isPending[id]) {\n continue;\n }\n this._invokeCallback(id);\n }\n } finally {\n this._stopDispatching();\n }\n };\n\n /**\n * Is this Dispatcher currently dispatching.\n */\n\n Dispatcher.prototype.isDispatching = function isDispatching() {\n return this._isDispatching;\n };\n\n /**\n * Call the callback stored with the given id. Also do some internal\n * bookkeeping.\n *\n * @internal\n */\n\n Dispatcher.prototype._invokeCallback = function _invokeCallback(id) {\n this._isPending[id] = true;\n this._callbacks[id](this._pendingPayload);\n this._isHandled[id] = true;\n };\n\n /**\n * Set up bookkeeping needed when dispatching.\n *\n * @internal\n */\n\n Dispatcher.prototype._startDispatching = function _startDispatching(payload) {\n for (var id in this._callbacks) {\n this._isPending[id] = false;\n this._isHandled[id] = false;\n }\n this._pendingPayload = payload;\n this._isDispatching = true;\n };\n\n /**\n * Clear bookkeeping used for dispatching.\n *\n * @internal\n */\n\n Dispatcher.prototype._stopDispatching = function _stopDispatching() {\n delete this._pendingPayload;\n this._isDispatching = false;\n };\n\n return Dispatcher;\n})();\n\nmodule.exports = Dispatcher;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/flux/lib/Dispatcher.js\n ** module id = 161\n ** module chunks = 1\n **/","/**\n * Copyright 2013-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule invariant\n */\n\n\"use strict\";\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar invariant = function (condition, format, a, b, c, d, e, f) {\n if (process.env.NODE_ENV !== 'production') {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n }\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error('Invariant Violation: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n};\n\nmodule.exports = invariant;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/flux/~/fbjs/lib/invariant.js\n ** module id = 162\n ** module chunks = 1\n **/","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nfunction EventEmitter() {\n this._events = this._events || {};\n this._maxListeners = this._maxListeners || undefined;\n}\nmodule.exports = EventEmitter;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nEventEmitter.defaultMaxListeners = 10;\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function(n) {\n if (!isNumber(n) || n < 0 || isNaN(n))\n throw TypeError('n must be a positive number');\n this._maxListeners = n;\n return this;\n};\n\nEventEmitter.prototype.emit = function(type) {\n var er, handler, len, args, i, listeners;\n\n if (!this._events)\n this._events = {};\n\n // If there is no 'error' event listener then throw.\n if (type === 'error') {\n if (!this._events.error ||\n (isObject(this._events.error) && !this._events.error.length)) {\n er = arguments[1];\n if (er instanceof Error) {\n throw er; // Unhandled 'error' event\n } else {\n // At least give some kind of context to the user\n var err = new Error('Uncaught, unspecified \"error\" event. (' + er + ')');\n err.context = er;\n throw err;\n }\n }\n }\n\n handler = this._events[type];\n\n if (isUndefined(handler))\n return false;\n\n if (isFunction(handler)) {\n switch (arguments.length) {\n // fast cases\n case 1:\n handler.call(this);\n break;\n case 2:\n handler.call(this, arguments[1]);\n break;\n case 3:\n handler.call(this, arguments[1], arguments[2]);\n break;\n // slower\n default:\n args = Array.prototype.slice.call(arguments, 1);\n handler.apply(this, args);\n }\n } else if (isObject(handler)) {\n args = Array.prototype.slice.call(arguments, 1);\n listeners = handler.slice();\n len = listeners.length;\n for (i = 0; i < len; i++)\n listeners[i].apply(this, args);\n }\n\n return true;\n};\n\nEventEmitter.prototype.addListener = function(type, listener) {\n var m;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events)\n this._events = {};\n\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (this._events.newListener)\n this.emit('newListener', type,\n isFunction(listener.listener) ?\n listener.listener : listener);\n\n if (!this._events[type])\n // Optimize the case of one listener. Don't need the extra array object.\n this._events[type] = listener;\n else if (isObject(this._events[type]))\n // If we've already got an array, just append.\n this._events[type].push(listener);\n else\n // Adding the second element, need to change to array.\n this._events[type] = [this._events[type], listener];\n\n // Check for listener leak\n if (isObject(this._events[type]) && !this._events[type].warned) {\n if (!isUndefined(this._maxListeners)) {\n m = this._maxListeners;\n } else {\n m = EventEmitter.defaultMaxListeners;\n }\n\n if (m && m > 0 && this._events[type].length > m) {\n this._events[type].warned = true;\n console.error('(node) warning: possible EventEmitter memory ' +\n 'leak detected. %d listeners added. ' +\n 'Use emitter.setMaxListeners() to increase limit.',\n this._events[type].length);\n if (typeof console.trace === 'function') {\n // not supported in IE 10\n console.trace();\n }\n }\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n var fired = false;\n\n function g() {\n this.removeListener(type, g);\n\n if (!fired) {\n fired = true;\n listener.apply(this, arguments);\n }\n }\n\n g.listener = listener;\n this.on(type, g);\n\n return this;\n};\n\n// emits a 'removeListener' event iff the listener was removed\nEventEmitter.prototype.removeListener = function(type, listener) {\n var list, position, length, i;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events || !this._events[type])\n return this;\n\n list = this._events[type];\n length = list.length;\n position = -1;\n\n if (list === listener ||\n (isFunction(list.listener) && list.listener === listener)) {\n delete this._events[type];\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n\n } else if (isObject(list)) {\n for (i = length; i-- > 0;) {\n if (list[i] === listener ||\n (list[i].listener && list[i].listener === listener)) {\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (list.length === 1) {\n list.length = 0;\n delete this._events[type];\n } else {\n list.splice(position, 1);\n }\n\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n var key, listeners;\n\n if (!this._events)\n return this;\n\n // not listening for removeListener, no need to emit\n if (!this._events.removeListener) {\n if (arguments.length === 0)\n this._events = {};\n else if (this._events[type])\n delete this._events[type];\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n for (key in this._events) {\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = {};\n return this;\n }\n\n listeners = this._events[type];\n\n if (isFunction(listeners)) {\n this.removeListener(type, listeners);\n } else if (listeners) {\n // LIFO order\n while (listeners.length)\n this.removeListener(type, listeners[listeners.length - 1]);\n }\n delete this._events[type];\n\n return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n var ret;\n if (!this._events || !this._events[type])\n ret = [];\n else if (isFunction(this._events[type]))\n ret = [this._events[type]];\n else\n ret = this._events[type].slice();\n return ret;\n};\n\nEventEmitter.prototype.listenerCount = function(type) {\n if (this._events) {\n var evlistener = this._events[type];\n\n if (isFunction(evlistener))\n return 1;\n else if (evlistener)\n return evlistener.length;\n }\n return 0;\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n};\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/events/events.js\n ** module id = 163\n ** module chunks = 1\n **/","var keyMirror = require('keymirror');\n\nmodule.exports = keyMirror({\n\tSTEP_COMPLETE: null,\n\tSTEP_GET_STARTED: null,\n\tSTEP_SELECT: null,\n\tSTEP_NEXT: null,\n\tSTEP_SKIP: null,\n\tSITE_SET_TITLE: null,\n\tSITE_SET_TYPE: null,\n\tSITE_SET_DESCRIPTION: null,\n\tSITE_ADD_BUSINESS_ADDRESS: null,\n\tSITE_SAVE_TITLE_AND_DESCRIPTION: null,\n\tSITE_CONTACT_PAGE_ID: null,\n\tSITE_SET_THEME: null,\n\tSITE_INSTALL_THEME: null,\n\tSITE_JETPACK_CONFIGURED: null,\n\tSITE_JETPACK_MODULE_ENABLED: null,\n\tSITE_JETPACK_MODULE_DISABLED: null,\n\tSITE_JETPACK_JUMPSTART_ENABLED: null,\n\tSITE_JETPACK_ADD_MODULES: null,\n\tSITE_SET_LAYOUT: null,\n\n\tSITE_CREATE_CONTACT_US_PAGE: null,\n\tSITE_CREATE_LAYOUT_PAGES: null,\n\n\tSAVE_STARTED: null,\n\tSAVE_FINISHED: null,\n\n\tSET_FLASH: null,\n\tUNSET_FLASH: null,\n\tFLASH_SEVERITY_NOTICE: null,\n\tFLASH_SEVERITY_ERROR: null,\n\n\tRESET_DATA: null,\n\n\tSHOW_SPINNER: null,\n\tHIDE_SPINNER: null\n});\n\n\n\n/** WEBPACK FOOTER **\n ** ./client/constants/jetpack-onboarding-constants.js\n **/","/**\n * Copyright 2013-2014 Facebook, Inc.\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\"use strict\";\n\n/**\n * Constructs an enumeration with keys equal to their value.\n *\n * For example:\n *\n * var COLORS = keyMirror({blue: null, red: null});\n * var myColor = COLORS.blue;\n * var isColorValid = !!COLORS[myColor];\n *\n * The last line could not be performed if the values of the generated enum were\n * not equal to their keys.\n *\n * Input: {key1: val1, key2: val2}\n * Output: {key1: key1, key2: key2}\n *\n * @param {object} obj\n * @return {object}\n */\nvar keyMirror = function(obj) {\n var ret = {};\n var key;\n if (!(obj instanceof Object && !Array.isArray(obj))) {\n throw new Error('keyMirror(...): Argument must be an object.');\n }\n for (key in obj) {\n if (!obj.hasOwnProperty(key)) {\n continue;\n }\n ret[key] = key;\n }\n return ret;\n};\n\nmodule.exports = keyMirror;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/keymirror/index.js\n ** module id = 165\n ** module chunks = 1\n **/","var AppDispatcher = require('../dispatcher/app-dispatcher'),\n\tJPSConstants = require('../constants/jetpack-onboarding-constants'),\n\tPaths = require('../constants/jetpack-onboarding-paths'),\n\tFlashActions = require('./flash-actions'),\n\tSiteActions = require('./site-actions'),\n\tWPAjax = require('../utils/wp-ajax'),\n\tSpinnerActions = require('./spinner-actions'),\n\tSetupProgressStore = require('stores/setup-progress-store'),\n\tSiteStore = require('stores/site-store');\n\nvar SetupProgressActions = {\n\tresetData: function() {\n\t\tWPAjax.\n\t\t\tpost(JPS.site_actions.reset_data).\n\t\t\tfail(function(msg) {\n\t\t\t\tFlashActions.error(\"Failed to save data: \" + msg);\n\t\t\t});\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.RESET_DATA\n\t\t});\n\t},\n\n\tcompleteStep: function(slug, meta) {\n\t\tvar step = SetupProgressStore.getStepFromSlug(slug);\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.STEP_COMPLETE,\n\t\t\tslug: slug\n\t\t});\n\n\t\t// NOTE: this needs to come after the dispatch, so that the completion %\n\t\t// is already updated and can be included in the metadata\n\t\treturn this._recordStepComplete(step, meta);\n\t},\n\n\tcompleteAndNextStep: function(slug, meta) {\n\t\tthis.completeStep(slug, meta).always(function() {\n\t\t\t// getCurrentStep _should_ return the correct step slug for the 'next' step here...\n\t\t\t// this needs to be in the callback because otherwise there's a chance\n\t\t\t// that COMPLETE could be registered in analytics after VIEWED\n\t\t\tthis._recordStepViewed( SetupProgressStore.getCurrentStep() );\n\t\t}.bind(this));\n\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.STEP_NEXT\n\t\t});\n\t},\n\n\t// mark current step as skipped and move on\n\tskipStep: function() {\n\t\tFlashActions.unset();\n\n\t\tvar step = SetupProgressStore.getCurrentStep();\n\n\t\tif (!step.skipped) {\n\t\t\tthis._recordStepSkipped( step );\n\t\t}\n\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.STEP_SKIP\n\t\t});\n\t},\n\n\tsetCurrentStep: function( stepSlug ) {\n\t\tFlashActions.unset();\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.STEP_SELECT,\n\t\t\tslug: stepSlug\n\t\t});\n\t\tthis._recordStepViewed( { slug: stepSlug } );\n\t},\n\n\tgetStarted: function( siteType ) {\n\t\tWPAjax.\n\t\t\tpost(JPS.step_actions.start, { siteType: siteType }).\n\t\t\tfail(function(msg) {\n\t\t\t\tFlashActions.error(msg);\n\t\t\t});\n\n\n\t\tSiteActions.setType( siteType );\n\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.STEP_GET_STARTED\n\t\t});\n\t},\n\n\tcloseJPO: function() {\n\t\tSpinnerActions.show(\"\");\n\t\tWPAjax.\n\t\t\tpost(JPS.step_actions.close).\n\t\t\tfail(function(msg) {\n\t\t\t\tSpinnerActions.hide();\n\t\t\t\tFlashActions.error(msg);\n\t\t\t}).\n\t\t\talways(function() {\n\t\t\t\twindow.location.reload();\n\t\t\t});\n\t},\n\n\tdisableJPO: function() {\n\t\tSpinnerActions.show(\"\");\n\t\tWPAjax.\n\t\t\tpost(JPS.step_actions.disable).\n\t\t\tfail(function(msg) {\n\t\t\t\tSpinnerActions.hide();\n\t\t\t\tFlashActions.error(msg);\n\t\t\t}).\n\t\t\talways(function() {\n\t\t\t\twindow.location.reload();\n\t\t\t});\n\t},\n\n\t// moves on to the next step, but doesn't mark it as \"skipped\"\n\tselectNextStep: function() {\n\t\tFlashActions.unset();\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.STEP_NEXT\n\t\t});\n\t\tthis._recordStepViewed( SetupProgressStore.getCurrentStep() );\n\t},\n\n\tsubmitTitleStep: function( title, description ) {\n\t\tSiteActions.saveTitleAndDescription( title, description );\n\t\tthis.completeAndNextStep(Paths.SITE_TITLE_STEP_SLUG);\n\t},\n\n\tsubmitBusinessAddress: function( businessAddress ) {\n\t\tSiteActions.saveBusinessAddress( businessAddress );\n\t\tthis.completeStep(Paths.BUSINESS_ADDRESS_SLUG);\n\t\tthis.setCurrentStep( Paths.REVIEW_STEP_SLUG );\n\t},\n\n\tsubmitLayoutStep: function( layout ) {\n\t\tSiteActions.setLayout( layout ).done( function() {\n\t\t\tvar step = SetupProgressStore.getStepFromSlug( Paths.IS_BLOG_STEP_SLUG );\n\t\t\tif ( ! step.completed ) {\n\t\t\t\tthis.completeStep( Paths.IS_BLOG_STEP_SLUG );\n\t\t\t}\n\t\t\tthis.completeAndNextStep( Paths.HOMEPAGE_STEP_SLUG );\n\t\t}.bind( this ) );\n\t},\n\n\tconfirmHomepageStep: function( layout ) {\n\t\tthis.completeStep( Paths.IS_BLOG_STEP_SLUG );\n\t\tthis.setCurrentStep( Paths.HOMEPAGE_STEP_SLUG );\n\t},\n\n\tcreateContactPage: function(contactPage) {\n\t\tSiteActions.createContactUsPage(contactPage);\n\t\tthis.completeStep(Paths.CONTACT_PAGE_STEP_SLUG);\n\t\tthis.selectNextStep();\n\t},\n\n\tskipContactPageBuild: function() {\n\t\tthis.completeAndNextStep(Paths.CONTACT_PAGE_STEP_SLUG);\n\t},\n\n\tsubmitJetpackJumpstart: function() {\n\t\tSiteActions.enableJumpstart().done(function() {\n\t\t\tthis.completeStep(Paths.JETPACK_MODULES_STEP_SLUG);\n\t\t}.bind(this));\n\t},\n\n\tsetActiveTheme: function(theme) {\n\t\tSiteActions.setActiveTheme(theme).done(function() {\n\t\t\tthis.completeStep(Paths.DESIGN_STEP_SLUG, {\n\t\t\t\tthemeId: theme.id\n\t\t\t});\n\t\t}.bind(this));\n\t},\n\n\tsaveDesignStep: function() {\n\t\tthis.completeAndNextStep(Paths.DESIGN_STEP_SLUG, {\n\t\t\tthemeId: SiteStore.getActiveThemeId()\n\t\t});\n\t},\n\n\t_recordStepViewed: function( step ) {\n\t\t// record analytics to say we viewed the next step\n \t\treturn WPAjax.\n \t\t\tpost(JPS.step_actions.view, {\n \t\t\t\tstep: step.slug\n \t\t\t}, {\n \t\t\t\tquiet: true\n \t\t\t});\n\t},\n\n\t_recordStepComplete: function( step, meta ) {\n\t\tif (typeof(meta) === 'undefined') {\n\t\t\tmeta = {};\n\t\t}\n\n\t\tmeta.completion = SetupProgressStore.getProgressPercent();\n\n\t\treturn WPAjax.\n\t\t\tpost(JPS.step_actions.complete, {\n\t\t\t\tstep: step.slug,\n\t\t\t\tdata: meta\n\t\t\t}).\n\t\t\tfail(function(msg) {\n\t\t\t\tFlashActions.error(msg);\n\t\t\t});\n\t},\n\n\t_recordStepSkipped: function( step ) {\n\t\treturn WPAjax.\n\t\t\tpost(JPS.step_actions.skip, {\n\t\t\t\tstep: step.slug\n\t\t\t}).\n\t\t\tfail(function(msg) {\n\t\t\t\tFlashActions.error(msg);\n\t\t\t});\n\t}\n};\n\nmodule.exports = SetupProgressActions;\n\n\n/** WEBPACK FOOTER **\n ** ./client/actions/setup-progress-actions.js\n **/","module.exports = {\n\t// steps\n\tSITE_TITLE_STEP_SLUG: 'title',\n\tIS_BLOG_STEP_SLUG: 'is-blog',\n\tHOMEPAGE_STEP_SLUG: 'homepage',\n\tTRAFFIC_STEP_SLUG: 'traffic',\n\tSTATS_MONITORING_STEP_SLUG: 'stats-monitoring',\n\tDESIGN_STEP_SLUG: 'design',\n\tADVANCED_STEP_SLUG: 'advanced',\n\tREVIEW_STEP_SLUG: 'review',\n\tJETPACK_MODULES_STEP_SLUG: 'jetpack',\n\tCONTACT_PAGE_STEP_SLUG: 'contact-page',\n\tBUSINESS_ADDRESS_SLUG: 'business-address'\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./client/constants/jetpack-onboarding-paths.js\n **/","var AppDispatcher = require('../dispatcher/app-dispatcher'),\n\tJPSConstants = require('../constants/jetpack-onboarding-constants');\n\nvar FlashActions = {\n\tnotice: function(msg) {\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SET_FLASH,\n\t\t\tmessage: msg,\n\t\t\tseverity: JPSConstants.FLASH_SEVERITY_NOTICE\n\t\t});\n\t},\n\n\terror: function(msg) {\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SET_FLASH,\n\t\t\tmessage: msg,\n\t\t\tseverity: JPSConstants.FLASH_SEVERITY_ERROR\n\t\t});\n\t},\n\n\tunset: function() {\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.UNSET_FLASH\n\t\t});\n\t}\n};\n\nmodule.exports = FlashActions;\n\n\n/** WEBPACK FOOTER **\n ** ./client/actions/flash-actions.js\n **/","var AppDispatcher = require('../dispatcher/app-dispatcher'),\n\tJPSConstants = require('../constants/jetpack-onboarding-constants'),\n\tSiteStore = require('stores/site-store'),\n\tFlashActions = require('./flash-actions.js'),\n\tSpinnerActions = require('./spinner-actions.js'),\n\tWPAjax = require('../utils/wp-ajax');\n\nvar SiteActions = {\n\tsetTitle: function(title) {\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SITE_SET_TITLE,\n\t\t\ttitle: title\n\t });\n\t},\n\n\tsetType: function(type) {\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SITE_SET_TYPE,\n\t\t\ttype: type\n\t });\n\t},\n\n\tsetDescription: function(description) {\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SITE_SET_DESCRIPTION,\n\t\t\tdescription: description\n\t });\n\t},\n\n\tsaveTitleAndDescription: function( title, description ) {\n\n\t\tWPAjax.\n\t\t\tpost( JPS.site_actions.set_title, { title: title, description: description } ).\n\t\t\tfail( function ( msg ) {\n\t\t\t\tFlashActions.error(\"Error setting title: \"+msg);\n\t\t\t});\n\n\t\tjQuery('#wp-admin-bar-site-name .ab-item').html(title);\n\n\t\t// FlashActions.notice( \"Set title to '\"+title+\"' and description to '\"+description+\"'\" );\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SITE_SAVE_TITLE_AND_DESCRIPTION,\n\t\t\ttitle: title,\n\t\t\tdescription: description\n\t });\n\n\t\treturn jQuery.Deferred().resolve(); // XXX HACK\n\t},\n\n\tsaveBusinessAddress: function( businessAddress ) {\n\t\tWPAjax.\n\t\t\tpost( JPS.site_actions.add_business_address, businessAddress ).\n\t\t\tfail( function ( msg ) {\n\t\t\t\tFlashActions.error(\"Error setting title: \"+msg);\n\t\t\t});\n\n\t\tconst { business_address_1, business_address_2, business_city, business_name, business_state, business_zip } = businessAddress;\n\n\t\tJPS.bloginfo = Object.assign( {}, JPS.bloginfo, { business_address_1, business_address_2, business_city, business_name, business_state, business_zip } );\n\n\t\t// FlashActions.notice( \"Set title to '\"+title+\"' and description to '\"+description+\"'\" );\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SITE_ADD_BUSINESS_ADDRESS,\n\t\t\taddress: businessAddress\n\t });\n\n\t\treturn jQuery.Deferred().resolve(); // XXX HACK\n\t},\n\n\tsetContactPageId: function(contactPageID) {\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SITE_CONTACT_PAGE_ID,\n\t\t\tcontactPageID: contactPageID\n\t\t});\n\t},\n\n\t_installTheme: function ( theme ) {\n\t\tif ( ! theme.installed ) {\n\t\t\tSpinnerActions.show(\"Installing '\"+theme.name+\"'\");\n\t\t\treturn WPAjax.\n\t\t\t\tpost( JPS.site_actions.install_theme, { themeId: theme.id } ).\n\t\t\t\tdone( function ( ) {\n\t\t\t\t\ttheme.installed = true;\n\t\t\t\t\tAppDispatcher.dispatch({\n\t\t\t\t\t\tactionType: JPSConstants.SITE_INSTALL_THEME,\n\t\t\t\t\t\ttheme: theme\n\t\t\t\t });\n\t\t\t\t}).\n\t\t\t\tfail( function ( msg ) {\n\t\t\t\t\tFlashActions.error(\"Server error installing theme: \"+msg);\n\t\t\t\t}).\n\t\t\t\talways( function() {\n\t\t\t\t\tSpinnerActions.hide();\n\t\t\t\t});\n\t\t} else {\n\t\t\treturn jQuery.Deferred().resolve();\n\t\t}\n\t},\n\n\t_activateTheme: function ( theme ) {\n\t\tWPAjax.\n\t\t\tpost( JPS.site_actions.set_theme, { themeId: theme.id } ).\n\t\t\tfail( function ( msg ) {\n\t\t\t\tFlashActions.error(\"Server error setting theme: \"+msg);\n\t\t\t});\n\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SITE_SET_THEME,\n\t\t\tthemeId: theme.id\n\t });\n\t},\n\n\tsetActiveTheme: function( theme ) {\n\n\t\tthis._installTheme(theme).\n\t\t\tdone( function() {\n\t\t\t\tthis._activateTheme(theme);\n\t\t\t}.bind(this));\n\n\t\treturn jQuery.Deferred().resolve(); // XXX HACK\n\t},\n\n\tsetLayout: function( layoutName ) {\n\n\t\tWPAjax.\n\t\t\tpost( JPS.site_actions.set_layout, { layout: layoutName } ).\n\t\t\tdone( function ( page_info ){\n\t\t\t\tAppDispatcher.dispatch( {\n\t\t\t\t\tactionType: JPSConstants.SITE_CREATE_LAYOUT_PAGES,\n\t\t\t\t\tdata: page_info\n\t\t\t\t} );\n\t\t\t} ).\n\t\t\tfail( function (msg ){\n\t\t\t\tFlashActions.error(\"Error setting layout: \"+msg);\n\t\t\t} );\n\n\t\t// FlashActions.notice(\"Set layout to \"+layoutName);\n\t\tAppDispatcher.dispatch( {\n\t\t\tactionType: JPSConstants.SITE_SET_LAYOUT,\n\t\t\tlayout: layoutName\n\t\t} );\n\n\t\treturn jQuery.Deferred().resolve(); // XXX HACK\n\t},\n\n\tcreateContactUsPage: function( contactPage ) {\n\n\t\treturn WPAjax.\n\t\t\tpost( JPS.site_actions.build_contact_page, { buildContactPage: contactPage } ).\n\t\t\tdone( function( page_info ) {\n\t\t\t\tAppDispatcher.dispatch({\n\t\t\t\t\tactionType: JPSConstants.SITE_CREATE_CONTACT_US_PAGE,\n\t\t\t\t\tdata: page_info\n\t\t\t\t});\n\t\t\t}).\n\t\t\tfail( function( msg ) {\n\t\t\t\tFlashActions.error(\"Error creating contact us page: \"+msg);\n\t\t\t});\n\t},\n\n\tskipContactPageBuild: function() {\n\t\t// FlashActions.notice( \"Build the contact us page\" );\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SITE_CREATE_CONTACT_US_PAGE\n\t\t});\n\n\t\treturn jQuery.Deferred().resolve(); // XXX HACK\n\t},\n\n\tconfigureJetpack: function(return_to_step) {\n\n\n/****************\n\ncomplete step\n\n*********************/\n\n\t\treturn WPAjax.\n\t\t\tpost( JPS.site_actions.configure_jetpack, { return_to_step: return_to_step } ).\n\t\t\tdone( function ( data ) {\n\t\t\t\tAppDispatcher.dispatch({\n\t\t\t\t\tactionType: JPSConstants.SITE_JETPACK_CONFIGURED\n\t\t\t });\n\n\t\t\t\tif ( data.next ) {\n\t\t\t\t\twindow.location.replace(data.next);\n\t\t\t\t}\n\t\t\t}).\n\t\t\tfail( function ( msg ) {\n\t\t\t\tFlashActions.error(\"Error enabling Jetpack: \"+msg);\n\t\t\t});\n\t},\n\n\tactivateJetpackModule: function(module_slug) {\n\n\t\tWPAjax.\n\t\t\tpost( JPS.site_actions.activate_jetpack_modules, { modules: [module_slug] }).\n\t\t\tfail( function ( msg ) {\n\t\t\t\tFlashActions.error(\"Error activating Jetpack module: \"+msg);\n\t\t\t});\n\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SITE_JETPACK_MODULE_ENABLED,\n\t\t\tslug: module_slug\n\t });\n\n\t\treturn jQuery.Deferred().resolve(); // XXX HACK\n\t},\n\n\tdeactivateJetpackModule: function(module_slug) {\n\n\t\tWPAjax.\n\t\t\tpost( JPS.site_actions.deactivate_jetpack_modules, { modules: [module_slug] }).\n\t\t\tfail( function ( msg ) {\n\t\t\t\tFlashActions.error(\"Error deactivating Jetpack module: \"+msg);\n\t\t\t});\n\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SITE_JETPACK_MODULE_DISABLED,\n\t\t\tslug: module_slug\n\t });\n\n\t\treturn jQuery.Deferred().resolve(); // XXX HACK\n\t},\n\n\tloadAllJetpackModules: function() {\n\t\tif ( SiteStore.getJetpackAdditionalModules().length === 0 ) {\n\t\t\treturn WPAjax.\n\t\t\t\tpost( JPS.site_actions.list_jetpack_modules ).\n\t\t\t\tdone( function ( all_modules ) {\n\t\t\t\t\tAppDispatcher.dispatch({\n\t\t\t\t\t\tactionType: JPSConstants.SITE_JETPACK_ADD_MODULES,\n\t\t\t\t\t\tmodules: all_modules\n\t\t\t\t });\n\t\t\t\t}).\n\t\t\t\tfail( function ( msg ) {\n\t\t\t\t\tFlashActions.error(\"Error fetching all Jetpack modules: \"+msg);\n\t\t\t\t});\n\t\t} else {\n\t\t\treturn jQuery.Deferred().resolve(); // XXX HACK\n\t\t}\n\t},\n\n\tenableJumpstart: function() {\n\t\tWPAjax.\n\t\t\tpost( JPS.site_actions.activate_jetpack_modules, { modules: SiteStore.getJumpstartModuleSlugs() }).\n\t\t\tfail( function ( msg ) {\n\t\t\t\tFlashActions.error(\"Error activating Jetpack modules: \"+msg);\n\t\t\t});\n\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SITE_JETPACK_JUMPSTART_ENABLED\n\t });\n\n\t\treturn jQuery.Deferred().resolve(); // XXX HACK\n\t}\n};\n\nmodule.exports = SiteActions;\n\n\n/** WEBPACK FOOTER **\n ** ./client/actions/site-actions.js\n **/","/*\n * Store which manages and persists site information\n */\n\nvar AppDispatcher = require('../dispatcher/app-dispatcher'),\n EventEmitter = require('events').EventEmitter,\n JPSConstants = require('../constants/jetpack-onboarding-constants'),\n WPAjax = require('../utils/wp-ajax');\n\nvar CHANGE_EVENT = 'change';\n\nvar layout = JPS.steps.layout.current;\n\nfunction setType(newType) {\n JPS.bloginfo.type = newType;\n}\n\nfunction setTitle(newTitle) {\n JPS.bloginfo.name = newTitle;\n}\n\nfunction setDescription(newDescription) {\n JPS.bloginfo.description = newDescription;\n}\n\nfunction setActiveTheme(activeThemeId) {\n JPS.themes.forEach( function( theme ) {\n if ( theme.id === activeThemeId ) {\n theme.active = true;\n } else {\n theme.active = false;\n }\n } );\n}\n\nfunction installedTheme(theme) {\n JPS.themes.unshift(theme);\n JPS.themes = JPS.themes.slice(0, 3);\n}\n\nfunction setJetpackModuleActivated(slug) {\n if ( _.indexOf( JPS.jetpack.active_modules, slug ) === -1 ) {\n JPS.jetpack.active_modules.push(slug);\n }\n}\n\nfunction setJetpackModuleDectivated(slug) {\n var index = _.indexOf( JPS.jetpack.active_modules, slug );\n if ( index >= 0) {\n JPS.jetpack.active_modules.splice(index, 1);\n }\n}\n\nfunction setJetpackAdditionalModules(modules) {\n JPS.jetpack.additional_modules = _.filter(modules, function(module) {\n return _.indexOf(JPS.jetpack.jumpstart_modules.map(function(mod){return mod.slug;}), module.slug) === -1;\n });\n}\n\nfunction setLayout(layoutName) {\n layout = layoutName; // XXX TODO: get this value dynamically from the server!\n}\n\nfunction setJetpackConfigured() {\n JPS.jetpack.configured = true;\n}\n\nfunction setJetpackJumpstartActivated() {\n JPS.jetpack.jumpstart_modules.forEach( function( module ) {\n setJetpackModuleActivated( module.slug );\n });\n}\n\nfunction setContactUsPage( pageInfo ) {\n JPS.steps.contact_page = pageInfo;\n}\n\nfunction setLayoutPages( pageInfo ) {\n JPS.steps.layout.welcomeEditUrl = pageInfo.welcome;\n JPS.steps.layout.postsEditUrl = pageInfo.posts;\n}\n\nvar SiteStore = _.extend({}, EventEmitter.prototype, {\n\n getTitle: function() {\n return JPS.bloginfo.name;\n },\n\n getType: function() {\n return JPS.bloginfo.type;\n },\n\n getDescription: function() {\n return JPS.bloginfo.description;\n },\n\n getContactPageURL: function() {\n return JPS.steps.contact_page && JPS.steps.contact_page.url;\n },\n\n getContactPageEditURL: function() {\n if ( JPS.steps.contact_page && JPS.steps.contact_page.editUrl ) {\n return JPS.steps.contact_page.editUrl.replace('&','&');\n }\n },\n\n getWelcomePageEditURL: function() {\n if ( JPS.steps.layout && JPS.steps.layout.welcomeEditUrl ) {\n return JPS.steps.layout.welcomeEditUrl.replace('&','&');\n }\n },\n\n getNewsPageEditURL: function() {\n if ( JPS.steps.layout && JPS.steps.layout.postsEditUrl ) {\n return JPS.steps.layout.postsEditUrl.replace('&','&');\n }\n },\n\n getThemes: function() {\n return JPS.themes;\n },\n\n getActiveThemeId: function() {\n for(var i=0; i < JPS.themes.length; i++) {\n var theme = JPS.themes[i];\n if ( theme.active ) {\n return theme.id;\n }\n }\n return null;\n },\n\n getJetpackConfigured: function() {\n return JPS.jetpack.configured;\n },\n\n getActiveModuleSlugs: function() {\n return JPS.jetpack.active_modules;\n },\n\n isJetpackModuleEnabled: function(slug) {\n return ( _.indexOf( JPS.jetpack.active_modules, slug ) >= 0 );\n },\n\n getJetpackAdditionalModules: function() {\n return JPS.jetpack.additional_modules;\n },\n\n getJumpstartModuleSlugs: function() {\n return JPS.jetpack.jumpstart_modules.map(function(module) { return module.slug; });\n },\n\n getJumpstartModules: function() {\n return JPS.jetpack.jumpstart_modules;\n },\n\n getJetpackSettingsUrl: function() {\n return JPS.steps.advanced_settings && JPS.steps.advanced_settings.jetpack_modules_url;\n },\n\n getPopularThemes: function() {\n return WPAjax.post(JPS.site_actions.get_popular_themes, {}, {quiet: true});\n },\n\n getJetpackJumpstartEnabled: function() {\n for(var i=0; i < JPS.jetpack.jumpstart_modules.length; i++) {\n var module = JPS.jetpack.jumpstart_modules[i];\n if ( ! this.isJetpackModuleEnabled( module.slug ) ) {\n return false;\n }\n }\n return true;\n },\n\n getLayout: function() {\n return layout;\n },\n\n emitChange: function() {\n this.emit(CHANGE_EVENT);\n },\n\n addChangeListener: function(callback) {\n this.on(CHANGE_EVENT, callback);\n },\n\n removeChangeListener: function(callback) {\n this.removeListener(CHANGE_EVENT, callback);\n }\n});\n\n// Register callback to handle all updates\nAppDispatcher.register(function(action) {\n\n switch(action.actionType) {\n case JPSConstants.SITE_SET_TYPE:\n setType(action.type);\n SiteStore.emitChange();\n break;\n\n case JPSConstants.SITE_SET_TITLE:\n setTitle(action.title);\n SiteStore.emitChange();\n break;\n\n case JPSConstants.SITE_SET_DESCRIPTION:\n setDescription(action.description);\n SiteStore.emitChange();\n break;\n\n case JPSConstants.SITE_SAVE_TITLE_AND_DESCRIPTION:\n setTitle(action.title);\n setDescription(action.description);\n SiteStore.emitChange();\n break;\n\n case JPSConstants.SITE_SET_THEME:\n setActiveTheme(action.themeId);\n SiteStore.emitChange();\n break;\n\n case JPSConstants.SITE_INSTALL_THEME:\n installedTheme(action.theme);\n SiteStore.emitChange();\n break;\n\n case JPSConstants.SITE_JETPACK_CONFIGURED:\n setJetpackConfigured();\n SiteStore.emitChange();\n break;\n\n case JPSConstants.SITE_JETPACK_ADD_MODULES:\n setJetpackAdditionalModules(action.modules);\n SiteStore.emitChange();\n break;\n\n case JPSConstants.SITE_JETPACK_MODULE_ENABLED:\n setJetpackModuleActivated(action.slug);\n SiteStore.emitChange();\n break;\n\n case JPSConstants.SITE_JETPACK_MODULE_DISABLED:\n setJetpackModuleDectivated(action.slug);\n SiteStore.emitChange();\n break;\n\n case JPSConstants.SITE_JETPACK_JUMPSTART_ENABLED:\n setJetpackJumpstartActivated();\n SiteStore.emitChange();\n break;\n\n case JPSConstants.SITE_SET_LAYOUT:\n setLayout(action.layout);\n SiteStore.emitChange();\n break;\n\n case JPSConstants.SITE_CREATE_CONTACT_US_PAGE:\n setContactUsPage(action.data);\n SiteStore.emitChange();\n break;\n\n case JPSConstants.SITE_CREATE_LAYOUT_PAGES:\n setLayoutPages( action.data );\n SiteStore.emitChange();\n break;\n\n default:\n // no op\n }\n});\n\nmodule.exports = SiteStore;\n\n\n\n/** WEBPACK FOOTER **\n ** ./client/stores/site-store.js\n **/","/*\n * A simple wrapper for calls to WP's \"ajaxurl\".\n *\n * This exists because WP's wp_send_json_error doesn't actually send an error code, but rather\n * a 200 OK response with a structure like this:\n * {success: false, data: \"something went wrong\"}\n *\n * So this class smoothes the difference between 50x errors and WP's error object.\n *\n * For convenience, this returns a jQuery.Deferred object which can have .done() \n * and .fail() methods chained onto it, similar to jQuery.post's \"success\" and \"fail\"\n *\n * Also, it accepts an \"action\" param instead of a URL, since all WP ajax requests\n * actually go via the same URL with different parameters, and it invokes callbacks with\n * just the \"data\" portion of WP's ajax payload, rather than the whole structure.\n * \n **/\n\nvar DataActions = require('actions/data-actions');\n\nvar WPAjax = (function() {\n\n\treturn {\n\t\tpost: function(action, payload, options) {\n\t\t\toptions = typeof options !== 'undefined' ? options : {};\n\t\t\tpayload = typeof payload !== 'undefined' ? payload : {};\n\t\t\tvar data = _.extend(payload, {action: action, nonce: JPS.nonce});\n\t\t\t\n\t\t\tvar deferred = jQuery.Deferred();\n\n\t\t\t// passing quiet: true allows page navigation before this request has finished.\n\t\t\t// this is also handy when you're calling from within a Dispatch cycle, as it \n\t\t\t// no longer triggers an additional Dispatch (which would cause an error)\n\t\t\tif ( !options.quiet ) {\n\t\t\t\tDataActions.requestStarted();\n\t\t\t}\n\n\t\t\tjQuery.post( ajaxurl, data )\n\t\t\t\t.success( function( response ) {\n\t\t\t\t\tif ( ! response.success ) {\n\t\t\t\t\t\tdeferred.reject(response.data);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdeferred.resolve(response.data);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.fail( function() {\n\t\t\t\t\tdeferred.reject(\"Server error\");\n\t\t\t\t})\n\t\t\t\t.always( function () {\n\t\t\t\t\tif ( !options.quiet ) {\n\t\t\t\t\t\tDataActions.requestFinished();\n\t\t\t\t\t}\n\t\t\t\t});\t\n\n\t\t\treturn deferred;\n\t\t}\n\t};\n\n})();\n\nmodule.exports = WPAjax;\n\n\n/** WEBPACK FOOTER **\n ** ./client/utils/wp-ajax.js\n **/","var AppDispatcher = require('../dispatcher/app-dispatcher'),\n\tJPSConstants = require('../constants/jetpack-onboarding-constants');\n\nvar DataActions = {\n\trequestStarted: function() {\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SAVE_STARTED\n\t\t});\n\t},\n\n\trequestFinished: function() {\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SAVE_FINISHED\n\t\t});\n\t}\n};\n\nmodule.exports = DataActions;\n\n\n/** WEBPACK FOOTER **\n ** ./client/actions/data-actions.js\n **/","var AppDispatcher = require('../dispatcher/app-dispatcher'),\n\tJPSConstants = require('../constants/jetpack-onboarding-constants');\n\nvar SpinnerActions = {\n\tshow: function(msg) {\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SHOW_SPINNER,\n\t\t\tmessage: msg\n\t\t});\n\t},\n\n\thide: function() {\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.HIDE_SPINNER,\n\t\t});\t\n\t},\n\n\tshowAsync: function(msg) {\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.SHOW_ASYNC_SPINNER,\n\t\t\tmessage: msg\n\t\t});\t\t\n\t},\n\n\thideAsync: function() {\n\t\tAppDispatcher.dispatch({\n\t\t\tactionType: JPSConstants.HIDE_ASYNC_SPINNER\n\t\t});\t\t\t\n\t}\n};\n\nmodule.exports = SpinnerActions;\n\n\n/** WEBPACK FOOTER **\n ** ./client/actions/spinner-actions.js\n **/","var AppDispatcher = require('../dispatcher/app-dispatcher'),\n\tEventEmitter = require('events').EventEmitter,\n\tJPSConstants = require('../constants/jetpack-onboarding-constants');\n\nvar CHANGE_EVENT = 'change';\n\nvar spinnerEnabled = false,\n\tspinnerMessage = null;\n\nfunction show(message) {\n\tspinnerEnabled = true;\n\tspinnerMessage = message;\n}\n\nfunction hide() {\n\tspinnerEnabled = false;\n\tspinnerMessage = null;\n}\n\nvar SpinnerStore = _.extend({}, EventEmitter.prototype, {\n\tshowing: function() {\n\t\treturn spinnerEnabled;\n\t},\n\n\tgetMessage: function() {\n\t\treturn spinnerMessage;\n\t},\n\n\taddChangeListener: function(callback) {\n\t\tthis.on( CHANGE_EVENT, callback );\n\t},\n\n\tremoveChangeListener: function(callback) {\n\t\tthis.removeListener( CHANGE_EVENT, callback );\n\t},\n\n\temitChange: function() {\n\t this.emit( CHANGE_EVENT );\n\t},\n});\n\nAppDispatcher.register(function(action) {\n\n switch(action.actionType) {\n case JPSConstants.SHOW_SPINNER:\n\t\tshow(action.message);\n\t\tSpinnerStore.emitChange();\n\t\tbreak;\n\n case JPSConstants.HIDE_SPINNER:\n \thide();\n \tSpinnerStore.emitChange();\n \tbreak;\n\n default:\n // no op\n }\n});\n\nmodule.exports = SpinnerStore;\n\n\n/** WEBPACK FOOTER **\n ** ./client/stores/spinner-store.js\n **/","var AppDispatcher = require('../dispatcher/app-dispatcher'),\n\tEventEmitter = require('events').EventEmitter,\n\tJPSConstants = require('../constants/jetpack-onboarding-constants');\n\n/*\n * This is a refcounted save monitor which warns if you try to leave the page while the data is still saving\n */\n\nvar _currentSaves = 0, jpoTimeout, CHANGE_EVENT = 'change';\n\nfunction incrementSaveCounter() {\n\t_currentSaves = _currentSaves + 1;\n}\n\nfunction decrementSaveCounter() {\n\t_currentSaves = _currentSaves - 1;\n}\n\nvar DataStore = _.extend({}, EventEmitter.prototype, {\n\tisSaving: function() {\n\t\treturn _currentSaves > 0;\n\t},\n\n\taddChangeListener: function(callback) {\n\t\tthis.on(CHANGE_EVENT, callback);\n\t},\n\n\tremoveChangeListener: function(callback) {\n\t\tthis.removeListener(CHANGE_EVENT, callback);\n\t},\n\n\temitChange: function() {\n\t this.emit(CHANGE_EVENT);\n\t},\n});\n\njQuery(window).on('beforeunload', function() {\n\tif(DataStore.isSaving()) {\n\t\tjpoTimeout = setTimeout(function() {\n\t // alert('You stayed');\n\t // noop\n\t }, 1000);\n\t return \"Your site changes are still saving.\";\n\t}\n});\n\njQuery(window).on('unload', function() {\n\tclearTimeout(jpoTimeout);\n});\n\nAppDispatcher.register(function(action) {\n\n switch(action.actionType) {\n case JPSConstants.SAVE_STARTED:\n \tincrementSaveCounter();\n\t\tDataStore.emitChange();\n\t\tbreak;\n\n case JPSConstants.SAVE_FINISHED:\n \tdecrementSaveCounter();\n \tDataStore.emitChange();\n \tbreak;\n\n default:\n // no op\n }\n});\n\nmodule.exports = DataStore;\n\n\n/** WEBPACK FOOTER **\n ** ./client/stores/data-store.js\n **/","/**\n * Displays a flash message, if set.\n * JSON structure:\n * { severity: 'notice', message: 'My message' }\n *\n * Valid severities:\n * - error, notice\n */\n\nvar React = require('react'),\n\tFlashStore = require('stores/flash-store');\n\nfunction getFlashState() {\n\treturn FlashStore.getFlash();\n}\n\nvar Flash = React.createClass( {\n\tcomponentDidMount: function() {\n\t\tFlashStore.addChangeListener( this._onChange );\n\t},\n\n\tcomponentWillUnmount: function() {\n\t\tFlashStore.removeChangeListener( this._onChange );\n\t},\n\n\t_onChange: function() {\n\t\tthis.setState( getFlashState() );\n\t},\n\n\tgetInitialState: function() {\n\t\treturn getFlashState();\n\t},\n\n\trender: function() {\n\t\tif ( this.state.message ) {\n\t\t\treturn (
Jetpack provides Stats, insights and visitor information.
\n\t\t\t\t\t
Use Jetpack tools like Publicize, Sharing, Subscribing and Related Posts to increase traffic, and onsite engagement.
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
Increase Security and Site Speed
\n\t\t\t\t\t\n\t\t\t\t\t
Gain peace of mind with Protect, the tool that has blocked billions of login attacks on millions of sites.
\n\t\t\t\t\t
Photon utilizes the state-of-the-art WordPress.com content delivery network to load your gorgeous images super fast optimized for any device, and it’s completely free.