var environmentSettingsConfig = this.environmentSettingsConfig || {}; environmentSettingsConfig.Partner = 'ti'; environmentSettingsConfig.FacebookAppID = '483636159744369'; environmentSettingsConfig.StripeKey = 'pk_live_N3Cu88jt4Y8nPuIhkvGJpzzO'; environmentSettingsConfig.GlobalDomain = 'ti.clubspark.com'; environmentSettingsConfig.Genders = [{"Text":"Male","Value":0},{"Text":"Female","Value":1}]; environmentSettingsConfig.SubCategorySessions = [{"sessionId":2010,"name":"Adult"},{"sessionId":2020,"name":"Junior"},{"sessionId":2030,"name":"Mini"},{"sessionId":2040,"name":"Individual"},{"sessionId":2050,"name":"Disability"},{"sessionId":2060,"name":"Holiday Camps"},{"sessionId":2990,"name":"Other"},{"sessionId":3010,"name":"Sanctioned Tournament"},{"sessionId":3020,"name":"Event"},{"sessionId":3030,"name":"League Fixture"},{"sessionId":3040,"name":"Fun Tournament"},{"sessionId":3990,"name":"Other"},{"sessionId":4010,"name":"Team Practice"},{"sessionId":4020,"name":"Club Night"},{"sessionId":4990,"name":"Other"},{"sessionId":5030,"name":"Non-venue Event/Tournament"},{"sessionId":5990,"name":"Other"}]; environmentSettingsConfig.VenueMode = window.location.hostname == environmentSettingsConfig.GlobalDomain ? 'subdirectory' : 'domain'; environmentSettingsConfig.GlobalFeatures = { "Version": 637939874477360490, "DefaultModules": { "Venues": true, "CoachingOrganisations": true, "Regions": false, "Authorities": true }, "Account": { "UserPhoneNumberIsRequired": false }, "Booking": { "AdminOnlyBookingSheetColours": false, "AppPromo": true, "CheckInContacts": false, "NewDayBookingAvailabilityTime": true, "NoShowCharges": false, "ResourceFormat": false, "ResponsibilityCategory": false, "SessionMaxBookingSlots": false, "CourtProperties": true, "CalendarEntry": false, "MembershipRequired": false, "ResourceCategories": true, "BookingEngineV2": false, "EnableGroupBooking": true }, "Membership": { "DisableInstallments": true, "DirectDebitPayment": false, "CreditCardPayment": true, "DisableGiftAidOption": false, "GuardianMandatory": true, "AutoPaymentDateOfPurchasePackages": false, "AutoPaymentFixedDatePackages": false, "NewMembershipRegistrationProcess": false }, "Coaching": { "OptimisedSearch": true, "RunningFields": false, "CoachingTeam": true, "CoursePaymentRequests": true, "CoachingReports": true, "SessionPaymentRequests": false, "TennisForKidsLive": false, "DelayParticipantOrders": false, "DelayCoachOrders": false, "RecurringSessions": true, "MembershipRequired": false, "EnqueueBookings": false, "EnableSchemeSearchFilter": false, "EnableThemeSearchFilter": false, "EnableBookingOpeningTimeRestrictedSchemeFeature": false, "OfflineCoachingPayments": false, "JuniorSafePlay": false, "AdultSafePlay": false, "Lessons": false, "EnableBookingCourtInProgramming": false, "DisableHolidayCamps": false, "DisableAddCategory": false, "EnableResources": false, "OneOffCourseFeatures": { "BulkDiscountsEnabled": false, "MultipleSessionsEnabled": false, "CreateSessionsAutomatically": true }, "SeriesFeatures": { "BulkDiscountsEnabled": true, "MultipleSessionsEnabled": true, "CreateSessionsAutomatically": true }, "EnableThemeForCustomCourses": false, "EnableCancellationWindowForCourses": false }, "Competition": { "SocialLeagues": false }, "Contacts": { "Bios": false, "Photos": false, "Social": false, "Mentors": false, "Delete": true, "Unsubscribe": true, "RestrictUnregistered": false, "EmailAttachments": true, "VenueContactRelationships": true, "BulkDeleteContacts": true, "ContactLookupsV2": true, "ContactForm": true, "LockPersonalDetailsWhenUserConnected": false }, "Venue": { "DeliveryAddress": false, "PrivacyPolicy": true, "SocialAccountsDisabled": false, "CanEditJuniorAge": true, "SubDomainCreation": false, "Facilities": true, "AddTraditionalLocation": false, "AddNonTraditionalLocation": false, "LinkedLocations": false, "Waiver": false, "StripeExpress": false }, "Website": { "Multilingual": false, "NoCoachingCourseSearch": false, "NoSubPages": false, "SectionHeros": true, "ConsentsOptOutByDefault": true, "VenueConsentsOptOutByDefault": true, "GuardianMandatory": true, "Activation": false, "NationalCourtBookingLive": false, "EnableClassificationLogoImages": false, "PasswordConfirmation": false, "AcceptPrivacyPolicyOnRegister": true, "NewLocationsLookup": false, "Appcues": true, "FooterNavigation": false, "Affiliations": false, "DisableVenues": false, "ActivityVideosWebpage": false }, "Events": { "GBTWAccess": false, "CustomEventName": false } }; environmentSettingsConfig.CurrentVenueUrlSegment = ''; environmentSettingsConfig.ErrorsVerboseConsole = false; environmentSettingsConfig.ErrorsVerboseHtml = false; environmentSettingsConfig.CurrencySymbol = '£'; environmentSettingsConfig.ResourceItems = { Booking : { CourtLower : "court", CourtUpper : "Court", CourtsLower : "courts", CourtsUpper : "Courts", BookingLower : "booking", BookingUpper : "Booking", BookingsLower : "bookings", BookingsUpper : "Bookings", BookedLower : "booked", BookedUpper : "Booked", BookLower : "book", BookUpper : "Book", CourtBookingsLower : "court bookings", CourtBookingsUpper : "Court bookings" }, Classification : { Level1 : "National administrator", Level2 : "Regional", Level3 : "County" }, Coaching : { ClassesLower : "classes", ClassesUpper : "Classes", ClassLower : "class", ClassUpper : "Class", CoachLower : "coach", CoachUpper : "Coach", CoachesUpper : "Coaching team", CoachingLower : "coaching", CoachingUpper : "Coaching", CostUnit : "", CourseCodeShort : "code", CourseCodeLong : "Code", CourseLower : "course", CoursesLower : "courses", CoursesUpper : "Courses", CourseUpper : "Course", HolidayCamp : "Holiday camp", HolidayCamps : "Holiday camps", Interval : "Interval", PlayerLower : "player", PlayersLower : "players", PlayersUpper : "Players", PlayerUpper : "Player", SessionsLower : "sessions", ProgrammeLower : "programme", ProgrammesLower : "programmes", ProgrammesUpper : "Programmes", ProgrammeUpper : "Programme", SessionName : "course", SessionVenue : "Venue", TeamName : "Coaching team", TitleRoot : "Coaching / Programmes / ", PageDefaultView : "List", UtrRatingMin : "1", UtrRatingMax : "16.5", BasketCourseName : "course", BasketSessionName : "session", AddNewBooking : "Add new booking", AddNewCampBooking : "Add new camp booking", ThemeUpper : "Theme", SchemeContactSourceOrganiser : "Organiser site", LeadCoach : "Lead coach", StartDate : "Start date", SessionThemeUpper : "Theme", SkillLevelUpper : "Skill level", CapacityUpper : "Capacity", CostUpper : "Cost", NameUpper : "Name", EndDate : "End date", DefaultSessionTags : "Default session tags", PublicCourseDescriptionHeader : "Notes from the coach", ValidateAgeMinMaxErrorMessage : "[MinimumAge]-[MaximumAge] year olds only", ValidateAgeMinErrorMessage : "[MinimumAge] year olds and over only", ValidateAgeMaxErrorMessage : "[MaximumAge] year olds and under only", CourseDateLabelUpper : "When", DefaultDescriptionLabel : "Additional Information", DefaultConfirmationLabel : "Additional Confirmation", DescriptionLabel : "", ConfirmationLabel : "Additional Confirmation", PriceSuffix : "", DefaultThemesLabel : "Default Theme" }, Common : { ChequeLabel : "Cheque", ColourLabel : "Colour", DocumentRegion : "uk", PlatformName : "ClubSpark", PlatformLat : "53.5500", PlatformLng : "-2.36967", PlatformZoom : "5", PlatformCountryRestriction : "uk", TownLabel : "Town", PostcodeLabel : "Postcode", DistanceUnit : "kilometres", CurrencySymbol : "£", CurrencyCode : "GBP", PublicJavaScriptShortDateFormat : "dd/mm/yy", AdminJavaScriptShortDateFormat : "dd/mm/yyyy", MomentJsLongDateFormat : "llll", JavaScriptTimeFormat : "HH:mm:ss", SmsName : "SMS", MembershipName : "Membership", MemberName : "Member", PartnerLocale : "en-GB", CountyLabel : "County", CountryLabel : "Country", GDPRGuardianConsentLabel : "I confirm I am the Parent or Guardian of this player, or have the permission of the Parent or Guardian to book on behalf of this player.", GDPRGuardianConsentToolTip : "In order to make a booking you must be ?0? years old; be the parent or guardian of the player under ?0? years old, or have permission from the parent or guardian of the player.", GDPRGuardianConsentValidation : "Consent required - edit details", ProgrammeLower : "programme", ProgrammeUpper : "Programme", ProgrammesLower : "programmes", ProgrammesUpper : "Programmes", FloodlitLabel : "Floodlit", StripeCosts : "Stripe will deduct 25p per transaction + 2.8% for UK cards and 4.3% for international cards or American Express. This covers support costs, transactional costs, as well as Stripe's additional fees.", GoCardlessCosts : "We have a special arrangement with GoCardless who will only charge 1.0% and capped to a maximum of £2.00 per transaction (minimum of 20p). In addition Sportlabs charge 0.8% (uncapped) per transaction in order to provide and support this service. A maximum of 1.8% is deducted automatically when a user makes a payment.", GoCardlessIntro : "It only takes a few minutes to complete the form on the GoCardless site. Once registered you'll be asked to connect your account to ClubSpark and as soon as you've done this we'll be able to help you to automatically keep track of payments made via GoCardless (for one-off payments and monthly Direct Debits).", OperatorNameLong : "Sportlabs Technology Ltd", OperatorName : "ClubSpark", OperatorLogoDark : "~/Content/Public/ClubSpark/Common/Shared/img/core/CS_logo@1x.png", OperatorWebsite : "http://www.clubspark.com", OperatorWebsiteText : "ClubSpark.com", OperatorPoweredText : "Site powered by", RegisterLinkText : "Register", OptimisationLower : "optimisation", AdminDateFormat : "dd/MM/yyyy", CancelledLower : "cancelled", CancelledUpper : "Cancelled", CancellingLower : "canceling", SchemeCategoryThemeValidation : "Theme preference required", TermsAndConditionsPrefix : "Please tick this box to confirm you agree to the" }, Contacts : { CoachingRole : "Coaching administrator", GoverningBodyNumber : "", ResponsibleLower : "contact", ResponsibleUpper : "Contact", ResponsiblesLower : "contacts", ResponsiblesUpper : "Contacts", RolesDescription : "Organisation", MentalHealthChampionUpper : "" }, Emails : { Salutation : "Hi" }, Home : { Heading : "Where would you like to go?" }, RegularExpressions : { PersonName : "^[a-zA-Z\\-\\'\\&\\ \\.]+$", Postcode : "^(?:(?:[AC-FHKNPRTV-Y][0-9]{2}|D6W)[ -]?[0-9AC-FHKNPRTV-Y]{4}|(GIR[ ]?0AA|((AB|AL|B|BA|BB|BD|BH|BL|BN|BR|BS|BT|CA|CB|CF|CH|CM|CO|CR|CT|CV|CW|DA|DD|DE|DG|DH|DL|DN|DT|DY|E|EC|EH|EN|EX|FK|FY|G|GL|GY|GU|HA|HD|HG|HP|HR|HS|HU|HX|IG|IM|IP|IV|JE|KA|KT|KW|KY|L|LA|LD|LE|LL|LN|LS|LU|M|ME|MK|ML|N|NE|NG|NN|NP|NR|NW|OL|OX|PA|PE|PH|PL|PO|PR|RG|RH|RM|S|SA|SE|SG|SK|SL|SM|SN|SO|SP|SR|SS|ST|SW|SY|TA|TD|TF|TN|TQ|TR|TS|TW|UB|W|WA|WC|WD|WF|WN|WR|WS|WV|YO|ZEab|al|b|ba|bb|bd|bh|bl|bn|br|bs|bt|ca|cb|cf|ch|cm|co|cr|ct|cv|cw|da|dd|de|dg|dh|dl|dn|dt|dy|e|ec|eh|en|ex|fk|fy|g|gl|gy|gu|ha|hd|hg|hp|hr|hs|hu|hx|ig|im|ip|iv|je|ka|kt|kw|ky|l|la|ld|le|ll|ln|ls|lu|m|me|mk|ml|n|ne|ng|nn|np|nr|nw|ol|ox|pa|pe|ph|pl|po|pr|rg|rh|rm|s|sa|se|sg|sk|sl|sm|sn|so|sp|sr|ss|st|sw|sy|ta|td|tf|tn|tq|tr|ts|tw|ub|w|wa|wc|wd|wf|wn|wr|ws|wv|yo|ze)(\\d[\\dA-Za-z]?[ ]?\\d[ABD-HJLN-UW-Zabd-hjln-uw-z]{2}))|BFPO[ ]?\\d{1,4}))$", PhoneNumber : "^(?:(((\\+44)? ?(\\(0\\))? ?)|(0))(( ?\\d){9}|( ?\\d){10})|((\\+353)?\\(?\\s*\\d{1,4}\\s*\\)?\\s?\\d?\\s?\\d{3}\\s?\\d{4}))$" }, Terms : { MinimumUserAge : "13", AssociationScope : "Tennis Ireland", InvolvementScope : "Tennis Ireland tennis", UseOfPersonalInformationScope : "Sportlabs Technology Ltd" }, Venue : { CoachingOrganisationLower : "coaching organisation", CoachingOrganisationUpper : "Coaching organisation", CoachingOrganisationModuleStatusName : "coaching organisation", OrganisationUpper : "Organisation", OrganisationLower : "organisation", OrganisationsLower : "organisations", OrganisationsUpper : "Organisations", VenueLower : "venue", VenueUpper : "Venue", VenuesLower : "venues", VenuesUpper : "Venues", VenueClassification : "Classification", VenueEventDefaltName : "Course details", AcceptInvitationAgreeTermsAndConditionsPrefix : "Please tick this box to confirm you agree to the", PrivacyPolicyConsentPrefix : "Please tick this box to confirm you have read and accepted" }, Region : { RegionLower : "region", RegionUpper : "Region", RegionsLower : "regions", RegionsUpper : "Regions" }, Events : { EventLower : "event", EventUpper : "Event", EventsLower : "events", EventsUpper : "Events", ChangeLabel : "Change" }, MembershipEmails : { LoginTextForAccount : "You will need to login with your existing ClubSpark account" }, AdminWebsite : { HeroPhotoGuidance : "For best viewing of this photo we recommend uploading a photo with dimensions of 1400px x 650px", GalleryGuidance : "For best viewing of this photo we recommend uploading a photo with dimensions of 600px by 400px", NewsArticleGuidance : "For best viewing of this photo we recommend uploading a photo with dimensions of 1180px by 600px", SubSectionPhotoGuidance : "For best viewing of this photo we recommend uploading a photo with dimensions of 1400px x 450px", NewsArticleTextGuidance : "For best viewing please upload images that are 1180px wide. Height can be variable" }, SchemesEmails : { SchemeSessionsBookingUserSubject : "[#scheme#] / Booking Confirmation", SchemeSessionsBookingAdminSubject : "[#scheme#] / Booking Confirmation", SchemeSessionFullNotificationSubject : "[#scheme#] / [#course-type#] Full" } }; var AuthHandler = function(config) { var cache; var redirectUrl = config.zoneRoot + 'oauth2-redirect.html'; var authorizeUrl = config.authRoot + 'issue/oauth2/authorize'; this.withToken = function (args) { args = args || {}; if (typeof args === "function") args = { success: args }; args.success = args.success || function() {}; args.error = args.error || function() {}; args.scope = args.scope || "token"; /* Attempt to load the current oauth token from localStorage */ /* var tokenCache = localStorage.getItem('oauth2.token'); */ var tokenCache = cache; var adminToken = null; if (tokenCache != null) adminToken = JSON.parse(tokenCache); var now = Math.floor(Date.now() / 1000); /* If token expires within next 60 seconds, we'll request a new one anyways */ if (adminToken != null && adminToken.expires_after < now + 60) adminToken = null; if (adminToken == null) { window.addEventListener('message', function (event) { if (event.data.action == 'oauth2.callback') { if (event.data.isValid) { var token = { expires_after: now + event.data.expires_in, access_token: event.data.access_token }; /* Store the token in cache */ /* localStorage.setItem('oauth2.token', JSON.stringify(token)); */ cache = JSON.stringify(token); args.success(token.access_token); } else { args.error(event.data); } } }, { once: true, capture: false }); var nonce = btoa(Date.now()); var authorizePayload = { tokenType: 'csa', response_type: 'token', client_id: 'clubspark-ui', redirect_uri: redirectUrl, scope: config.scopeRoot + args.scope, state: nonce, realm: config.webRoot, }; var implicitUrl = authorizeUrl + '?' + $.param(authorizePayload); /* Get iframe for sso */ var iframe = $('iframe[name="oauth2"]'); if (iframe.length == 0) { iframe = $('