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UAAY,CAAC,CAC7C,EAEAqH,aAAAA,CAAcvL,GACZ,OAAIA,EAAMqC,OAAO6B,SACRlE,EAAMqC,OAAO6B,SAASsH,MAExB,IACT,EAEAC,4BAAAA,CAA6BzL,GAC3B,IAAKA,EAAMqC,OAAO6B,SAChB,OAAO,KAET,MAAM,oBAAEmH,EAAmB,MAAEG,KAAUtH,GAAYlE,EAAMqC,OAAO6B,SAChE,OAAOA,CACT,EAEAwH,gBAAAA,CAAiB1L,GACf,MAAM2L,EAAsB3L,EAAMqC,OAAOyD,SAAgD,UAArC9F,EAAMqC,OAAO0D,oBAC3D6F,GAAY5L,EAAMqC,OAAOyD,QAEzB+F,EAAc7L,EAAMqC,OAAO6B,SAMjC,OAAQyH,GAAuBC,MAAeC,GAAeA,EAAYC,YAAcD,EAAYpD,SACrG,EAEAsD,4BAAAA,CAA6B/L,GAC3B,OAAIA,EAAMqC,OAAOwD,oBACRoF,EAEAD,CAEX,E,sBCtDF,KACE3K,iBAAkB,CAAC,EAEnB2L,eAAgB,GAChBC,gBAAiB,KACjBC,eAAe,EACfC,kBAAkB,EAClBC,gBAAiB,GAGjBxD,sBAAuBC,QAAQC,SAAQ,G","sources":["webpack://agra/./app/javascript/campaign-form-shared/store/mutations.js","webpack://agra/./app/javascript/events/form/store/build-state.js","webpack://agra/./app/javascript/events/form/store/actions.js","webpack://agra/./app/javascript/events/form/store/mutations.js","webpack://agra/./app/javascript/events/form/store/getters.js","webpack://agra/./app/javascript/events/form/store/state.js","webpack://agra/./app/javascript/events/form/store/index.js","webpack://agra/./app/javascript/campaign-form-shared/store/state.js","webpack://agra/./app/javascript/events/form/store/common-actions.js","webpack://agra/./app/javascript/campaign-form-shared/store/actions.js","webpack://agra/./app/javascript/events/form/store/common-mutations.js","webpack://agra/./app/javascript/events/form/store/location-allowed-address-types.js","webpack://agra/./app/javascript/events/form/store/common-getters.js","webpack://agra/./app/javascript/events/form/store/common-state.js"],"sourcesContent":["export default {\n setPublishUrl(state, publishUrl) {\n state.publishUrl = publishUrl\n },\n\n setLinkUserUrl(state, linkUserUrl) {\n state.linkUserUrl = linkUserUrl\n },\n\n setValidationErrors(state, validationErrors) {\n state.validationErrors = validationErrors\n },\n\n setAuthenticationModalData(state, authenticationModalData) {\n state.authenticationModalData = Object.assign(state.authenticationModalData, authenticationModalData)\n },\n\n setDisplayMissingInfoModal(state, { value, requiredFields }) {\n state.displayMissingInfoModal = value\n state.missingInfoRequiredFields = requiredFields\n },\n\n setDisplayUserAccountCreationAwaitingEmailConfirmation(state, { value, userEmail }) {\n state.displayUserAccountCreationAwaitingEmailConfirmation = value\n state.userEmailAddressAwaitingConfirmation = userEmail\n },\n\n setDisplayVerifyMfaTokenModal(state, { value, mfaParameters }) {\n state.displayVerifyMfaTokenModal = value\n state.mfaParameters = mfaParameters\n },\n\n setDisplayAuthenticationModal(state, displayAuthenticationModal) {\n state.displayAuthenticationModal = displayAuthenticationModal\n },\n\n setDisplayAwaitingApprovalModal(state, displayAwaitingApprovalModal) {\n state.displayAwaitingApprovalModal = displayAwaitingApprovalModal\n }\n}\n","import { DateTime } from 'luxon'\n\nexport default function buildState(componentName, defaultState) {\n const el = document.querySelector(`.vue-component-loader[data-component-name=${componentName}]`)\n const { ...initialState } = JSON.parse(el.dataset.storeData)\n\n const state = {...defaultState, ...initialState}\n\n state.values = {\n ...state.values,\n startAt: state.values.startAt ? DateTime.fromISO(state.values.startAt, { zone: state.values.timeZone }) : null,\n endAt: state.values.endAt ? DateTime.fromISO(state.values.endAt, { zone: state.values.timeZone }) : null\n }\n\n return state\n}\n","import ajax from '@/helpers/ajax'\nimport commonEventFormActions from './common-actions'\nimport memberFacingCampaignFormActions from '@/campaign-form-shared/store/actions'\n\nexport default {\n ...memberFacingCampaignFormActions,\n ...commonEventFormActions,\n\n async createEvent({ state, commit, getters }, requestPayload) {\n // Depending on whether an associated calendar has been set or not, we need to\n // submit to different endpoints\n let eventCreationUrl = null\n if (getters.associateWithCalendar) {\n eventCreationUrl = state.formUrlForCalendarEventCreation\n } else {\n eventCreationUrl = state.formUrl\n }\n\n let success = null\n await ajax.post({\n url: eventCreationUrl,\n data: requestPayload,\n successHandler: ({ data }) => {\n success = data.success\n const { redirectUrl,\n requiresApproval,\n requiresAuthentication,\n forceSingleSignOn,\n singleSignOnRedirect,\n authenticationModalData,\n publishUrl,\n linkUserUrl,\n validationErrors } = data\n if (success) {\n if (requiresAuthentication) {\n if (forceSingleSignOn) {\n window.location = singleSignOnRedirect.url\n } else {\n commit('setAuthenticationModalData', authenticationModalData)\n commit('setDisplayAuthenticationModal', true)\n commit('setPublishUrl', publishUrl)\n commit('setLinkUserUrl', linkUserUrl)\n }\n } else if (requiresApproval) {\n commit('setDisplayAwaitingApprovalModal', true)\n } else if (redirectUrl) {\n window.location = redirectUrl\n }\n\n // Clear validation errors\n commit('setValidationErrors', {})\n }\n else {\n commit('setValidationErrors', validationErrors)\n }\n }\n })\n\n return success\n },\n\n async updateEvent({state, commit}, requestPayload) {\n let success = null\n await ajax.put({\n url: state.formUrl,\n data: requestPayload,\n successHandler: ({ data }) => {\n success = data.success\n const { redirectUrl, validationErrors } = data\n\n if (success) {\n // Clear validation errors\n commit('setValidationErrors', {})\n } else {\n commit('setValidationErrors', validationErrors)\n }\n\n if (redirectUrl) {\n window.location = redirectUrl\n }\n }\n })\n\n return success\n },\n\n publish({ state, commit }) {\n ajax.put({\n url: state.publishUrl,\n successHandler: ({ data }) => {\n if (data.success) {\n if (data.requiresApproval) {\n commit('setDisplayAwaitingApprovalModal', true)\n } else {\n window.location = data.redirectUrl\n }\n }\n }\n })\n }\n}\n","import commonEventFormMutations from './common-mutations'\nimport memberFacingCampaignFormMutations from '@/campaign-form-shared/store/mutations'\n\nexport default {\n ...memberFacingCampaignFormMutations,\n ...commonEventFormMutations,\n\n setStaffLedCampaign: (state, newStaffLedCampaign) => {\n state.values.staffLedCampaign = newStaffLedCampaign\n\n // If the partnership selection field is present, clear its value since a staff-led\n // campaign can't belong to a partnership\n if (state.fields.includes('partnershipId')) {\n state.values.partnershipId = null\n }\n }\n}\n","import commonEventFormGetters from './common-getters'\n\nexport default {\n ...commonEventFormGetters,\n\n ...getGetters(['associateWithCalendar', 'eventTypeId', 'hostAddress', 'maxAttendeesCount', 'partnershipId',\n 'richDescription', 'staffLedCampaign', 'title', 'webConferenceUrl']),\n\n fieldHasError: (state) => (field) => {\n switch (field) {\n case 'dateTimes':\n return (state.validationErrors.startAt && state.validationErrors.startAt.length > 0) ||\n (state.validationErrors.endAt && state.validationErrors.endAt.length > 0)\n case 'virtual':\n return state.validationErrors.location && Object.keys(state.validationErrors.location).length > 0\n default:\n return state.validationErrors[field] && state.validationErrors[field].length > 0\n }\n }\n}\n\nfunction getGetters(keys) {\n const getters = {}\n keys.forEach(key => {\n getters[key] = function(state) {\n return state.values[key]\n }\n })\n return getters\n}\n","import commonEventFormState from './common-state'\nimport memberCampaignFormState from '../../../campaign-form-shared/store/state'\n\nexport default {\n ...memberCampaignFormState,\n ...commonEventFormState,\n\n // The list of all fields on the form\n fields: [],\n\n formUrl: null,\n formUrlForCalendarEventCreation: null,\n\n // When the form has been submitted, submitted values and validation errors by field\n values: {\n associateWithCalendar: false,\n richDescription: '',\n endAt: null,\n hiddenAddress: null,\n hostAddress: null,\n location: null,\n maxAttendeesCount: null,\n partnershipId: null,\n startAt: null,\n title: '',\n unconfirmedLocation: false,\n virtual: true,\n virtualLocationKind: null,\n webConferenceUrl: null\n },\n\n userHasOverriddenDefaultTimes: false,\n defaultTimeIsNonLocal: false,\n\n eventTypeOptions: [],\n externalImageAttributionUnsplashUrl: null,\n externalImageAttributionUtmParams: null,\n externalImagePhotoRetrievalUrlWithPlaceholder: null,\n externalImageSearchUrl: null,\n imageEdit: null\n}\n","import { createStore } from 'vuex'\n\nimport actions from './actions'\nimport mutations from './mutations'\nimport getters from './getters'\nimport defaultState from './state'\n\nimport buildState from './build-state'\n\nexport default function buildStore(componentName) {\n const state = buildState(componentName, defaultState)\n\n return createStore({\n state,\n getters,\n mutations,\n actions\n })\n}\n","export default {\n // Where to submit to publish after user authenticates\n publishUrl: null,\n\n // Where to submit to link user to new campaign\n linkUserUrl: null,\n\n // Text to display on the form, organised by field\n content: {},\n\n // Extra parameters we should submit with the form\n extraParameters: {},\n\n // If the user can choose to associate the event with a partnership, the list of options\n partnershipOptions: [],\n\n // Flag indicating if the \"campaign awaiting approval\" modal should be displayed\n displayAwaitingApprovalModal: false,\n\n //// Sign in / sign up properties\n authenticationModalData: {\n // SSO options\n enableFacebookLogin: false,\n facebookLoginUrl: null,\n enableGoogleLogin: false,\n googleLoginUrl: null,\n\n askForCountry: null,\n countryData: null,\n askForPostcode: null,\n phoneNumberMandatory: null,\n\n emailOptInTypeData: null,\n\n newAccountDisclaimer: null,\n\n // EU Data processing consent\n showEuDataProcessingConsent: false,\n euDataProcessingConsentData: null,\n\n termsOfServiceData: null,\n\n organisationId: null,\n additionalFieldConfigs: []\n },\n\n // Flag indicating if the user authentication modal should be displayed\n displayAuthenticationModal: false,\n\n // Flag indicating if the modal notifying user that account creation is pending\n // email confirmation should be displayed\n displayUserAccountCreationAwaitingEmailConfirmation: false,\n\n // Flag indicating if the MFA token verification modal should be displayed\n displayVerifyMfaTokenModal: false,\n\n // Flag indicating if the modal to collect missing user account info should be displayed\n displayMissingInfoModal: false,\n\n // Error message for non recoverable error during sign up (e.g.: member is banned)\n nonRecoverableErrorOnSignup: null,\n\n // Email address of the user that's awaiting to be confirmed\n userEmailAddressAwaitingConfirmation: null,\n\n // Setup information for the MFA token verification modal\n mfaParameters: {\n userId: null,\n statusCheckPath: null,\n supportsSms: false,\n tokenHelpText: null,\n verifyTokenPath: null\n },\n\n // Setup information for the Missing Info modal\n missingInfoRequiredFields: []\n}\n","import ajax from '@/helpers/ajax'\n\nexport default {\n async updateLocationAndTimezone({state, commit}, location) {\n commit('setValue', { field: 'location', value: location })\n\n // only set timeZone if a specific location has been selected and it's different from the specific location we already set the timezone for\n if (shouldUpdateTimeZone(state.location, location)) {\n // We use the timeZoneUpdatePromise to ensure that if two calls to updateLocationAndTimezone\n // happen in short succession, the first one gets to finish before the second one makes its network call.\n // This avoids a situation where the first network call takes longer and finishes after the second one,\n // leading to the first time zone being erroneously set when we should set the second one.\n await state.timeZoneUpdatePromise\n\n state.timeZoneUpdatePromise = new Promise((resolve) => {\n // If there is an error looking up the time zone we set it to null so that it's set server side\n ajax.get({\n url: '/api/time_zones/lookup',\n params: {lat: location.latitude, lng: location.longitude},\n throwOnFailure: true,\n successHandler: ({ normalizedName } ) => {\n commit('setTimeZone', normalizedName)\n resolve(true)\n },\n errorHandler: () => {\n commit('setTimeZone', null)\n resolve(true)\n }\n }).catch(() => {\n commit('setTimeZone', null)\n resolve(true)\n })\n })\n }\n }\n}\n\nfunction shouldUpdateTimeZone(oldLocation, newLocation) {\n const oldSpecificLocation = !!oldLocation && oldLocation.latitude !== null && oldLocation.longitude !== null\n const newSpecificLocation = !!newLocation && newLocation.latitude !== null && newLocation.longitude !== null\n\n if (!newSpecificLocation) {\n return false\n }\n if (!oldSpecificLocation) {\n return true\n }\n if (oldLocation.latitude !== newLocation.latitude || oldLocation.longitude !== newLocation.longitude) {\n return true\n }\n}\n","import ajax from '../../helpers/ajax'\n\nexport default {\n linkCampaignWithUnconfirmedUser({ state }, userToken) {\n ajax.put({\n url: state.linkUserUrl,\n data: {\n user_token: userToken\n },\n errorHandler: (response) => {\n window.errorLogger.error(`Error linking campaign with user: ${response}`)\n }\n })\n }\n}\n","export default {\n initializeEndAt: (state) => {\n setValue(state, {field: 'endAt', value: state.values.startAt.plus({ hours: 2 })}) // set the end time to two hours after the current start.\n },\n\n removeEndAt: (state) => {\n setValue(state, {field: 'endAt', value: null} )\n },\n\n setEndAt: (state, newEndAt) => {\n setValue(state, {field: 'endAt', value: newEndAt})\n },\n\n setStartAt: (state, newStartAt) => {\n setValue(state, {field: 'startAt', value: newStartAt})\n },\n\n setTimesOverridden: (state) => {\n state.userHasOverriddenDefaultTimes = true\n },\n\n setTimeZone: (state, newTimeZone) => {\n setValue(state, {field: 'timeZone', value: newTimeZone})\n\n // The new time zone may be null if there was a problem looking it up.\n // In that case, we don't update the start and end times since they'll be updated server-side when we perform\n // another time zone lookup.\n if (newTimeZone) {\n // The time zone has changed. What should that do to the start/end times?\n // e.g. if the start was set to 11:00 AM in the old time zone, should it be at 11:00 AM\n // in the new time zone, or should it be the same UTC time equivalent?\n // Our policy here is: by default, go with the same time of day in the new time zone,\n // _unless_ we're in a calendar with a \"simultaneous\" default event time.\n // And if the user has already set the time, keep the same time of day regardless of calendar settings.\n const keepLocalTime = !state.defaultTimeIsNonLocal || state.userHasOverriddenDefaultTimes\n\n // Don't attempt to update the start and end times if they're null\n if (state.values.startAt) {\n setValue(state, {field: 'startAt', value: state.values.startAt.setZone(newTimeZone, { keepLocalTime })})\n }\n if (state.values.endAt) {\n setValue(state, {field: 'endAt', value: state.values.endAt.setZone(newTimeZone, { keepLocalTime })})\n }\n }\n },\n\n setVirtual: (state, newVirtual) => {\n setValue(state, {field: 'virtual', value: newVirtual})\n\n if (state.values.virtual) {\n if (!state.values.location || !state.values.location.query) {\n setValue(state, { field: 'location', value: null })\n }\n\n // Virtual events don't have unconfirmed locations, so we clear that flag\n setValue(state, {field: 'unconfirmedLocation', value: false})\n }\n },\n\n setVirtualLocationKind: (state, newVirtualLocationKind) => {\n setValue(state, {field: 'virtualLocationKind', value: newVirtualLocationKind})\n },\n\n setValue: (state, {field, value}) => {\n // Calling non-mutation function `setValue`\n setValue(state, {field, value})\n }\n}\n\nfunction setValue(state, {field, value}) {\n state.values[field] = value\n}\n","// Place types from Google Maps API (https://developers.google.com/maps/documentation/places/web-service/supported_types#table2)\nexport const CONFIRMED_LOCATION_ALLOWED_ADDRESS_TYPES = ['street_address', 'point_of_interest']\nexport const UNCONFIRMED_LOCATION_ALLOWED_ADDRESS_TYPES = CONFIRMED_LOCATION_ALLOWED_ADDRESS_TYPES.concat(['political']) // political is a catch-all for administrative areas\n","import { CONFIRMED_LOCATION_ALLOWED_ADDRESS_TYPES, UNCONFIRMED_LOCATION_ALLOWED_ADDRESS_TYPES } from './location-allowed-address-types'\n\nexport default {\n ...getGetters(['endAt', 'hiddenAddress', 'location', 'startAt', 'timeZone', 'unconfirmedLocation', 'virtual']),\n\n dateValidationErrors(state) {\n return (state.validationErrors.startAt || []).concat(state.validationErrors.endAt || [])\n },\n\n extraLocationInfo(state) {\n if (state.values.location) {\n return state.values.location.extra_location_info\n }\n return null\n },\n\n locationValidationErrors(state) {\n return state.validationErrors.location || {}\n },\n\n locationVenue(state) {\n if (state.values.location) {\n return state.values.location.venue\n }\n return null\n },\n\n locationWithoutExtraAndVenue(state) {\n if (!state.values.location) {\n return null\n }\n const { extra_location_info, venue, ...location} = state.values.location\n return location\n },\n\n pendingGeocoding(state) {\n const virtualWithLocation = state.values.virtual && state.values.virtualLocationKind === 'local'\n const physical = !state.values.virtual\n\n const locationObj = state.values.location\n\n // Return true if we **should have a location** and **have not finished geocoding yet**.\n // We should have a location if the event is either in-person or virtual-with-location.\n // We have not finished geocoding yet if we're missing location coordinates, _or_\n // if the .geocoding flag indicates that we're in the midst of re-geocoding after updating an address field.\n return (virtualWithLocation || physical) && (!locationObj || locationObj.geocoding || !locationObj.latitude)\n },\n\n validAddressTypesForLocation(state) {\n if (state.values.unconfirmedLocation) {\n return UNCONFIRMED_LOCATION_ALLOWED_ADDRESS_TYPES\n } else {\n return CONFIRMED_LOCATION_ALLOWED_ADDRESS_TYPES\n }\n }\n}\n\nfunction getGetters(keys) {\n const getters = {}\n keys.forEach(key => {\n getters[key] = function(state) {\n return state.values[key]\n }\n })\n return getters\n}\n","export default {\n validationErrors: {},\n\n countryOptions: [],\n defaultTimeZone: null,\n displayRegion: false,\n showTimeMeridian: true,\n timeZoneOptions: [],\n\n // Used for serialization when calls to update the time zone from a location happen in short succession\n timeZoneUpdatePromise: Promise.resolve(true)\n}\n"],"names":["setPublishUrl","state","publishUrl","setLinkUserUrl","linkUserUrl","setValidationErrors","validationErrors","setAuthenticationModalData","authenticationModalData","Object","assign","setDisplayMissingInfoModal","value","requiredFields","displayMissingInfoModal","missingInfoRequiredFields","setDisplayUserAccountCreationAwaitingEmailConfirmation","userEmail","displayUserAccountCreationAwaitingEmailConfirmation","userEmailAddressAwaitingConfirmation","setDisplayVerifyMfaTokenModal","mfaParameters","displayVerifyMfaTokenModal","setDisplayAuthenticationModal","displayAuthenticationModal","setDisplayAwaitingApprovalModal","displayAwaitingApprovalModal","buildState","componentName","defaultState","el","document","querySelector","initialState","JSON","parse","dataset","storeData","values","startAt","DateTime","fromISO","zone","timeZone","endAt","memberFacingCampaignFormActions","commonEventFormActions","createEvent","commit","getters","requestPayload","eventCreationUrl","associateWithCalendar","formUrlForCalendarEventCreation","formUrl","success","ajax","post","url","data","successHandler","redirectUrl","requiresApproval","requiresAuthentication","forceSingleSignOn","singleSignOnRedirect","window","location","updateEvent","put","publish","memberFacingCampaignFormMutations","commonEventFormMutations","setStaffLedCampaign","newStaffLedCampaign","staffLedCampaign","fields","includes","partnershipId","commonEventFormGetters","keys","forEach","key","getGetters","fieldHasError","field","length","memberCampaignFormState","commonEventFormState","richDescription","hiddenAddress","hostAddress","maxAttendeesCount","title","unconfirmedLocation","virtual","virtualLocationKind","webConferenceUrl","userHasOverriddenDefaultTimes","defaultTimeIsNonLocal","eventTypeOptions","externalImageAttributionUnsplashUrl","externalImageAttributionUtmParams","externalImagePhotoRetrievalUrlWithPlaceholder","externalImageSearchUrl","imageEdit","buildStore","createStore","mutations","actions","content","extraParameters","partnershipOptions","enableFacebookLogin","facebookLoginUrl","enableGoogleLogin","googleLoginUrl","askForCountry","countryData","askForPostcode","phoneNumberMandatory","emailOptInTypeData","newAccountDisclaimer","showEuDataProcessingConsent","euDataProcessingConsentData","termsOfServiceData","organisationId","additionalFieldConfigs","nonRecoverableErrorOnSignup","userId","statusCheckPath","supportsSms","tokenHelpText","verifyTokenPath","updateLocationAndTimezone","oldLocation","newLocation","oldSpecificLocation","latitude","longitude","shouldUpdateTimeZone","timeZoneUpdatePromise","Promise","resolve","get","params","lat","lng","throwOnFailure","normalizedName","errorHandler","catch","linkCampaignWithUnconfirmedUser","userToken","user_token","response","errorLogger","error","setValue","initializeEndAt","plus","hours","removeEndAt","setEndAt","newEndAt","setStartAt","newStartAt","setTimesOverridden","setTimeZone","newTimeZone","keepLocalTime","setZone","setVirtual","newVirtual","query","setVirtualLocationKind","newVirtualLocationKind","CONFIRMED_LOCATION_ALLOWED_ADDRESS_TYPES","UNCONFIRMED_LOCATION_ALLOWED_ADDRESS_TYPES","concat","dateValidationErrors","extraLocationInfo","extra_location_info","locationValidationErrors","locationVenue","venue","locationWithoutExtraAndVenue","pendingGeocoding","virtualWithLocation","physical","locationObj","geocoding","validAddressTypesForLocation","countryOptions","defaultTimeZone","displayRegion","showTimeMeridian","timeZoneOptions"],"sourceRoot":""}