(function () { String.prototype.trimLeft = function (charlist) {if (charlist === undefined) charlist = "\\s";return this.replace(new RegExp("^[" + charlist + "]+"), "");}; String.prototype.trimRight = function (charlist) {if (charlist === undefined) charlist = "\\s";return this.replace(new RegExp("[" + charlist + "]+$"), "");}; String.prototype.trim = function (charlist) {return this.trimLeft(charlist).trimRight(charlist);}; // Fix iOS private mode localStorage issues. if ('localStorage' in window) { try { localStorage.setItem('___test', 'test'); } catch (ex) { localStorage.setItem = function () {}; } } window.appComponents = { debug: '0' === '1', env: 'prod', images: { marker: '/assets/94f0dcb6/images/marker.png', markersCluster: '/assets/94f0dcb6/images/markers_cluster.png', empty: '/assets/94f0dcb6/images/no_image.jpg' }, user: { isGuest: '1' == '1', birthday: '', calorie_group_id: parseInt(''), missing_general_info: '0' === '1' }, site: { country: '', language: 'en-US', is_master: '1' === '1', id: parseInt('1'), code: 'us', name: 'USA', routes: JSON.parse('{"start":["\/start"],"fitness_franchise_thankyou":["\/fitness\/thankyou"],"start_success":["\/start\/\/success"],"privacy":["\/privacy","\/privacy_policy","\/privacy-policy"],"contact":["\/contact_us","\/contact-us"],"application_thankyou":["\/thank-you-franchise-sales"],"contact_us_thankyou":["\/contact_us\/thank-you"],"no_locations_thankyou":["\/thank-you-no-locations"],"career_thankyou":["\/thank-you-career"],"blog":["\/blog","\/articles"],"blog_search":["\/blog\/search"],"author_blog_search":["\/blog\/authorSearch"],"franchise_blog_search":["\/fitness-franchises\/search"],"blog_authors":["\/blog\/authors"],"blog_author":["\/blog\/author\/"],"blog_post":["\/blog\/post\/"],"blog_category":["\/blog\/category\/"],"blog_identity_page":["\/blog\/"],"find_club":["\/kickboxing-classes","\/kickboxing_classes","\/kickboxing-classes\/index","\/kickboxing_classes\/index"],"search_by_directory":["\/kickboxing-classes\/directory"],"search_by_directory_region_cities":["\/kickboxing-classes\/\/"],"search_by_directory_city_locations":["\/kickboxing-classes\/\/\/"],"get_clubs":["\/kickboxing-classes\/locations"],"kickboxing_get_club_coordinates":["\/kickboxing-classes\/get-club-coordinates"],"search_by_directory_country_regions":["\/kickboxing-classes\/"],"club":["fitness\/"],"club_comingsoon":["fitness\/"],"club_presell":["fitness\/"],"club_green_presell":["fitness\/"],"mp_calendar":["fitness\/"],"franchise_blog_posts":["\/fitness\/\/news"],"franchise_blogpost_search":["\/fitness\/\/news"],"franchise_blog_post":["\/fitness\/\/news\/post\/"],"franchise_thankyou":["\/fitness\/\/thankyou"],"social_coupon_form":["\/forms\/social-coupon-form"],"invite_friend_form":["\/forms\/invite-friends-form"],"careers":["\/careers","\/careers\/apply"],"franchise":["\/fitness-franchises","\/fitness-franchises\/overview","\/fitness-franchises\/owning","\/fitness-franchises\/financing","\/fitness-franchises\/application","\/fitness_franchises\/application"],"clubindustry":["\/clubindustry"],"idea":["\/idea"],"entrepreneur":["\/entrepreneur"],"oxygen":["\/oxygen"],"club_solutions":["\/club-solutions","\/clubsolutions"],"fitness_load_news":["fitness-franchises\/loadnews"],"fitness_news":["\/fitness-franchises\/news"],"fitness_team":["\/fitness-franchises\/leader","\/fitness-franchises\/leaders","\/fitness-franchises\/our-team"],"fitness_team_details":["\/fitness-franchises\/leader\/"],"fitness_identity_page":["\/fitness-franchises\/blog\/"],"fitness_identity_page_blog":["\/fitness-franchises\/blog"],"fitness_blog_category":["fitness-franchises\/blog\/category\/"],"fitness_post":["fitness-franchises\/blog\/post\/"],"home":["\/"],"nutrition":["\/nutrition"],"heart_rate_training":["\/heart-rate-training"],"tour":["\/workout"],"get_regions":["\/site\/getregions"],"get_locations":["\/site\/getlocations"],"social_get_schedule_day":["\/social\/schedule-day"],"social_get_schedule_time":["\/social\/schedule-time"],"schedule_get_working_days":["\/schedule\/get-working-days"],"schedule_get_working_hours":["\/schedule\/get-working-hours"],"application_form":["\/forms\/application"],"tech_support":["\/forms\/tech-support"],"js_common":["\/service\/common-js-white"],"corporate_contact_form":["\/forms\/send-corporate-form"],"club_contact_form":["\/forms\/send-club-form"],"nolocations_form":["\/nolocations"],"zee_landing":["\/"],"unsubscribe_from_author_blog":["unsubscribe\/blog-follower"],"subscribe_to_author_blog":["subscribe\/blog-follower"],"load_reviews":["fitness\/\/reviews"],"clubready_schedule_classes":["\/clubready\/schedule\/get-classes"]}'), getParams: JSON.parse('{"v":"1512697920"}'), measurement: "imperial", baseUrl: '', basePath: '\x2Fvar\x2Fwww\x2Fvhosts\x2F9round.com\x2Fhttpdocs', buildUrl: function (name, params) { return location.hostname + this.buildRoute(name, params); }, buildRoute: function (name, params) { var hash = ''; var baseUrl = window.appComponents.site.baseUrl; name = name.split('#'); if (name.length === 1) { name = name[0]; hash = ''; } else if (name.length === 2) { name = name[0]; hash = '#' + name[1]; } else { throw new Error('Invalid route: ' + name); } var routes = window.appComponents.site.routes; if (routes.hasOwnProperty(name)) { var isPassedParams = params instanceof Object; if (isPassedParams) { var countParams = Object.keys(params).length; } var regHasParams = new RegExp('<[a-zA-Z0-9_-]+>'); for (var i = 0; i < routes[name].length; i++) { var url = routes[name][i]; var ok = false; if (isPassedParams) { if (url.match(regHasParams)) { var replacedCounter = 0; for (property in params) { if (params.hasOwnProperty(property)) { var regExp = new RegExp('<' + property + '>'); if (url.match(regExp)) { url = url.replace('<' + property + '>', params[property]); replacedCounter++; } } } if (replacedCounter === countParams && !url.match(regHasParams)) { ok = true; } } } else if (!url.match(regHasParams)) { ok = true; } if (ok) { return baseUrl + '/' + url.trim('/') + hash; } } } return baseUrl + '/' + name.trim('/') + hash; }, prettyUrl: function (url, data) { var data_as_str = ''; _.forEach(data, function (element, index) { if (element) { data_as_str += '/' + index + '/' + element; } }); return url + data; } }, initAll: function () { var components = window.appComponents; components.airbrakeConfig.init(); components.csrf.initHeader(); components.csrf.initRequest(); }, airbrake: null, airbrakeConfig: { enabled: !!'1', projectId: '115570', projectKey: 'd6e62e8126522a43f17b7b545fff27e7', init: function () { var components = window.appComponents; var airBrake = components.airbrakeConfig; if (!components.airbrake) { components.airbrake = new airbrakeJs.Client({ projectId: airBrake.projectId, projectKey: airBrake.projectKey }); } } }, google: { api_key: '' }, csrf: { param: '_csrf', header: 'X-CSRF-Token', value: 'Mm95NXQwQWJdPw1fLFUqLUU2DmoceXBRBiAmREdVMABjBz1ZEUolAw==', initRequest: function () { var csrf = window.appComponents.csrf; $.ajaxSetup({ cache: false, complete: function (jqXHR, textStatus) { var csrf_from_response = jqXHR.getResponseHeader(csrf.header); if (csrf_from_response) { csrf.value = csrf_from_response; csrf.initHeader(); } } }); }, initHeader: function () { var csrf = window.appComponents.csrf; var headers = []; headers[csrf.header] = csrf.value; //console.log(csrf.value); $.ajaxSetup({ headers: headers }); } } }; })();