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,WAAW,mBAEX,GAAAJ,EAAAlG,GAAA,EAACuG,EAAAA,CAAIA,CAAAA,CAACC,MAAM,WAAWC,QAAS,KAChC,GAAAP,EAAAlG,GAAA,EAAC0G,EAAAA,CAAmBA,CAAAA,CAElBC,eAAgBlB,SAChBmB,cAAelG,GAFVY,KAMb","sources":["webpack://_N_E/?7fba","webpack://_N_E/./src/lib/analytics/handlers/eventLogHandler.ts","webpack://_N_E/./src/lib/analytics/handlers/klaviyoEventHandler.ts","webpack://_N_E/./src/lib/analytics/commonEmitter.ts","webpack://_N_E/./src/lib/analytics/eventEmitter.ts","webpack://_N_E/./src/lib/analytics/handlers/abstractAnalyticsHandler.ts","webpack://_N_E/./src/lib/analytics/handlers/googleTagManagerHandler.ts","webpack://_N_E/./src/lib/constants/constants/articles.ts","webpack://_N_E/./src/lib/constants/constants/search.ts","webpack://_N_E/./src/lib/dataSource/lostApi/common.ts","webpack://_N_E/./src/lib/constants/constants/storage.ts","webpack://_N_E/./src/lib/storageClasses/analyticsEventStorage.ts","webpack://_N_E/./src/lib/hooks/analytics/useEventContext.tsx","webpack://_N_E/./src/lib/hooks/multiPageForm/useInitialFormStep.ts","webpack://_N_E/./src/lib/hooks/searchParameters/useSearchParameters.ts","webpack://_N_E/./src/lib/utils/analytics/startPetSearch.ts","webpack://_N_E/./src/lib/utils/helpers/dateHelpers/dates.ts","webpack://_N_E/./src/lib/utils/storage/local-storage.ts","webpack://_N_E/./src/lib/utils/helpers/ObjectsHelpers/getExpirationDate.ts","webpack://_N_E/./src/lib/utils/helpers/stringHelpers/parseToJSONSafe.ts","webpack://_N_E/./src/lib/utils/storage/session-storage.ts","webpack://_N_E/./src/pages/all-pets/index.tsx","webpack://_N_E/<anon>"],"sourcesContent":["\n    (window.__NEXT_P = window.__NEXT_P || []).push([\n      \"/all-pets\",\n      function () {\n        return require(\"private-next-pages/all-pets/index.tsx\");\n      }\n    ]);\n    if(module.hot) {\n      module.hot.dispose(function () {\n        window.__NEXT_P.push([\"/all-pets\"])\n      });\n    }\n  ","import AbstractAnalyticsHandler, { IEvent } from './abstractAnalyticsHandler';\n/**\n * EventLogHandler\n *\n * This will console log all the event data\n *\n * YOU WILL NEED TO UPDATE THE next.config.js TO ALLOW CONSOLE LOGS\n *\n * @augments AbstractAnalyticsHandler\n * @class\n */\nexport default class EventLogHandler extends AbstractAnalyticsHandler {\n  /**\n   * @memberof EventLogHandler\n   * @param {IEvent} data - The data to be sent with the event\n   */\n  send(data: IEvent) {\n    const analyticFeature = this.getAnalyticsFeature();\n\n    /**\n     * The data object to be sent to the console\n     *\n     * @memberof EventLogHandler\n     * @member {object} dataObject\n     */\n    const dataObject: {\n      /** The data associated with the event */\n      data: object;\n      /** The feature flags that are enabled */\n      feature: string;\n    } = {\n      data: data.data,\n      feature: analyticFeature,\n    };\n\n    console.log('EventLogHandler:', dataObject);\n  }\n}\n","import getBasePath from '@/lib/utils/getBasePath/getBasePath';\nimport axios from 'axios';\nimport AbstractAnalyticsHandler, { IEvent } from './abstractAnalyticsHandler';\n\n/**\n * KlaviyoEventHandler\n *\n * @augments AbstractAnalyticsHandler\n */\nexport default class KlaviyoEventHandler extends AbstractAnalyticsHandler {\n  /** @param {IEvent} data - The data to be sent with the event */\n  async send(data: IEvent) {\n    const eventData = {\n      data: {\n        type: 'event',\n        attributes: {\n          properties: data.data.attributes,\n          time: new Date(),\n          metric: {\n            data: {\n              type: 'metric',\n              attributes: {\n                name: data.name,\n              },\n            },\n          },\n          profile: {\n            data: {\n              type: 'profile',\n              attributes: data.data.profile,\n            },\n          },\n        },\n      },\n    };\n    axios.post(`${getBasePath()}/api/klaviyo/events`, eventData);\n  }\n}\n","import { googleTagManagerBrand } from '../constants/constants/analytics';\nimport EventEmitter from './eventEmitter';\nimport EventLogHandler from './handlers/eventLogHandler';\nimport GoogleTagManagerHandler from './handlers/googleTagManagerHandler';\nimport KlaviyoEventHandler from './handlers/klaviyoEventHandler';\n\n/** Instances of each handler class */\nconst logEventHandler = new EventLogHandler(googleTagManagerBrand);\nconst gtmEventHandler = new GoogleTagManagerHandler(googleTagManagerBrand);\nconst klaviyoEventHandler = new KlaviyoEventHandler(googleTagManagerBrand);\n\n/** Instances of each emitter */\nexport const logEventEmitter = new EventEmitter([logEventHandler]);\nexport const gtmEventEmitter = new EventEmitter([gtmEventHandler]);\n\n/** DefaultEventEmitter to contain all handlers */\nexport const defaultEventEmitter = new EventEmitter([\n  logEventHandler,\n  gtmEventHandler,\n]);\n\n/** KlaviyoEventEmitter to contain Klaviyo related handlers */\nexport const klaviyoEventEmitter = new EventEmitter([\n  logEventHandler,\n  klaviyoEventHandler,\n]);\n","import AbstractAnalyticsHandler, {\n  IEvent,\n} from './handlers/abstractAnalyticsHandler';\n\n/**\n * EventEmitter\n *\n * This will be used to dispatch each event to the appropriate handler\n *\n * @class\n */\nexport default class EventEmitter {\n  /**\n   * The handlers to be used for each event\n   *\n   * @memberof EventEmitter\n   * @member {AbstractAnalyticsHandler[]} handlers\n   */\n  private handlers: AbstractAnalyticsHandler[];\n\n  /** @param {AbstractAnalyticsHandler[]} handlers - Instances of handlerClasses */\n  constructor(handlers: AbstractAnalyticsHandler[]) {\n    this.handlers = handlers;\n  }\n\n  /**\n   * The event handler\n   *\n   * @param {IEvent} data - Information about the event\n   */\n  handleEvent(data: IEvent) {\n    this.handlers.forEach((handler) => {\n      handler.send(data);\n    });\n  }\n}\n","import { notApplicableString } from '@/lib/constants/constants/analytics';\nimport { analyticsFeatureKey } from '@/lib/utils/featureFlags/optimizely/featureFlagOverride';\nimport CookieStorage from '@/lib/utils/storage/cookie-storage';\n\n/** @typedef validTypes - Valid types for event data */\ntype ValidTypes = string | number | boolean | object | null | undefined;\n\n/** @typedef eventData - How to pass the data within the event */\ntype EventData = { [key: string]: ValidTypes };\n\n/**\n * Describes the base event structure\n *\n * @interface IEvent\n */\nexport interface IEvent {\n  /**\n   * The name of the event\n   *\n   * @memberof IEvent\n   * @member {string} name\n   */\n  name: string;\n  /**\n   * The data associated with the event\n   *\n   * @memberof IEvent\n   * @member {EventData} data - The data associated with the event\n   */\n  data: EventData;\n}\n\n/**\n * Provides an abstract class for analytics handlers\n *\n * @abstract\n * @class\n * @name analyticsHandler\n */\nexport default abstract class AbstractAnalyticsHandler {\n  /**\n   * The source platform of the event data\n   *\n   * @memberof AbstractAnalyticsHandler\n   * @member {string} brand\n   */\n  brand: string;\n\n  /**\n   * @memberof AbstractAnalyticsHandler\n   * @param {string} brand - The source platform of the event data\n   */\n  constructor(brand: string) {\n    this.brand = brand;\n  }\n\n  /**\n   * @memberof AbstractAnalyticsHandler\n   * @returns {string} - The analytic feature that is enabled\n   * @protected\n   */\n  protected getAnalyticsFeature(): string {\n    const cookies = new CookieStorage();\n    const optimizelyDecision = cookies.get(analyticsFeatureKey) as {\n      /** The analytic feature that is enabled */\n      analytic: string;\n    };\n    let feature: string = notApplicableString;\n    if (optimizelyDecision && optimizelyDecision.analytic) {\n      // Split the string into an array\n      feature = optimizelyDecision.analytic;\n    }\n    return feature;\n  }\n\n  /**\n   * @memberof AbstractAnalyticsHandler\n   * @abstract\n   * @param {IEvent} data - The data to be sent with the event\n   */\n  abstract send(data: IEvent): void;\n}\n","import AbstractAnalyticsHandler, { IEvent } from './abstractAnalyticsHandler';\n\n/**\n * GoogleTagManagerHandler\n *\n * @augments AbstractAnalyticsHandler\n */\nexport default class GoogleTagManagerHandler extends AbstractAnalyticsHandler {\n  /** @param {IEvent} data - The data to be sent with the event */\n  send(data: IEvent) {\n    const feature = this.getAnalyticsFeature();\n    /** The data object to be sent to Google Tag Manager */\n    const dataObject: { [key: string]: string | string[] } = {\n      brand: this.brand,\n      ...data.data,\n      feature,\n    };\n    gtag('event', data.name, dataObject);\n  }\n}\n","/**\n * Array of the article slug names to display in the shelter details page\n *\n * @constant {string[]}\n */\nexport const shelterDetailsArticlesSlugNames = [\n  'lost-dog-reunites-with-best-friend',\n  'how-to-care-for-your-lost-cat-after-they-come-home',\n  'how-to-help-lost-and-found-pets-near-me',\n];\n\n/**\n * The article slug names for the found search; If the user is searching for\n * FOUND pets, that means the user LOST a pet\n *\n * @constant {string[]} foundSearchArticleSlugNames\n */\nexport const foundSearchArticleSlugNames = [\n  'how-to-find-a-lost-dog',\n  'do-lost-pets-find-their-way-home',\n  'how-to-find-a-lost-cat',\n];\n\n/**\n * The article slug names for the lost search; If the user is searching for LOST\n * pets, that means the user FOUND a pet\n *\n * @constant {string[]} lostSearchArticleSlugNames\n */\nexport const lostSearchArticleSlugNames = [\n  'what-to-do-if-you-find-a-lost-cat-or-dog',\n  'how-to-catch-a-shy-lost-dog',\n  'are-stray-cats-and-dogs-potentially-lost-pets',\n];\n\n/**\n * The article slug names for the microchip search page\n *\n * @constant {string[]} microchipSearchArticlesSlugNames\n */\nexport const microchipSearchArticlesSlugNames = [\n  'what-is-a-pet-microchip-and-how-does-it-work',\n  'do-lost-pets-find-their-way-home',\n  'how-to-find-a-lost-cat',\n];\n","/** The default search radius */\nexport const defaultSearchRadius = 50;\n\n/** The default search radius index (should point to defaultSearchRadius) */\nexport const defaultSearchRadiusIndex = 2;\n\n/**\n * The coordinates of Petco Love HQ. Used as a fallback location if no\n * coordinates are provided.\n */\nexport const petcoLoveHQCoordinates = {\n  latitude: 29.44241,\n  longitude: -98.655,\n};\n","import { PetcoLoveSDK } from '@petcolove/lost--client--api-sdk';\n\n/**\n * Initialize the SDK\n *\n * @returns {PetcoLoveSDK} The SDK instance\n */\nexport function initSDK(): PetcoLoveSDK {\n  /**\n   * The PLL API base URL\n   *\n   * @constant {string | undefined} pllApiBaseUrl\n   */\n  const pllApiBaseUrl =\n    process.env.NEXT_PUBLIC_PLL_API_BASE_URL ??\n    process.env.STORYBOOK_PLL_API_BASE_URL;\n  /**\n   * The PLL Websocket base URL\n   *\n   * @constant {string | undefined} pllWebsocketBaseUrl\n   */\n  const pllWebsocketBaseUrl =\n    process.env.NEXT_PUBLIC_PLL_WEBSOCKET_BASE_URL ??\n    process.env.STORYBOOK_PLL_WEBSOCKET_BASE_URL;\n\n  if (!pllApiBaseUrl) {\n    throw new Error('NEXT_PUBLIC_PLL_API_BASE_URL is not defined');\n  }\n\n  if (!pllWebsocketBaseUrl) {\n    throw new Error('NEXT_PUBLIC_PLL_WEBSOCKET_BASE_URL is not defined');\n  }\n\n  const sdk = new PetcoLoveSDK(pllApiBaseUrl, pllWebsocketBaseUrl);\n\n  return sdk;\n}\n\nexport const sdk: PetcoLoveSDK = initSDK();\n","import { tomorrow } from '@/lib/utils/helpers/dateHelpers/dates';\n\n/**\n * The default expiration date\n *\n * @constant {Date}\n */\nexport const defaultExpirationDate: Date = tomorrow;\n","import { notApplicableString } from '@/lib/constants/constants/analytics';\nimport { defaultExpirationDate } from '@/lib/constants/constants/storage';\nimport { EventData } from '@/lib/hooks/analytics/useEventContext';\nimport { tomorrow } from '@/lib/utils/helpers/dateHelpers/dates';\nimport LocalStorage from '@/lib/utils/storage/local-storage';\n\n/**\n * The valid type for the initiating component param\n *\n * @type {AnalyticsInitiatingComponent}\n */\nexport type AnalyticsInitiatingComponent =\n  | 'I Lost A Pet Button / Homepage'\n  | 'I Found A Pet Button / Homepage'\n  | 'I Lost A Pet Footer Link / All Pages'\n  | 'I Found A Pet Footer Link / All Pages'\n  | 'Search All Pets Link / Homepage'\n  | 'Search All Pets Link / How To Help Page'\n  | 'Search All Pets Button / How To Help Page'\n  | 'Sign Up Button / All Pages'\n  | 'Search Persistent Banner / All Pages'\n  | 'I Found A Pet Button / Shelter Dashboard'\n  | 'I Found A Pet Button / Shelter Homepage'\n  | 'Search Button / User Dashboard'\n  | 'Photo Search Chip / Search Results Page'\n  | 'Microchip Search Chip / Search Results Page'\n  | 'Distance Search Chip / Search Results Page'\n  | 'Photo Search Button / Search Results Page'\n  | 'Microchip Search Button / Search Results Page'\n  | 'Distance Search Button / Search Results Page'\n  | 'Photo Search Link / Search Results Page'\n  | 'Microchip Search Link / Search Results Page'\n  | 'Distance Search Link / Search Results Page'\n  | 'Search By Microchip Link / Lost and Found Tips Page'\n  | 'Contact Pet Finder Button'\n  | 'Contact Pet Parent Button'\n  | 'View Reported Pets Near Me / Alert Matches Page'\n  | 'View Matches Button / Shelter Pets Page'\n  | 'View Matches Button / Shelter Pet Profile'\n  | 'Card Header Link / Photo Search Results Page / Lost'\n  | 'Card Header Link / Photo Search Results Page / Found'\n  | 'Card Header Link / Distance Search Results Page / Lost'\n  | 'Card Header Link / Distance Search Results Page / Found'\n  | 'Card Header Link / Microchip Search Results Page / Lost'\n  | 'Card Header Link / Microchip Search Results Page / Found'\n  | 'Card Header Link / Distance Search Results Page / All'\n  | 'Card Header Link / Distance Search Results Map / Lost'\n  | 'Card Header Link / Distance Search Results Map / Found'\n  | 'Card Header Link / Distance Search Results Map / All'\n  | 'Add Pet Button / User Dashboard / Lost'\n  | 'Add Pet Button / User Dashboard / Found'\n  | 'Report as Lost Button / User Dashboard / Lost'\n  | 'Map View Icon'\n  | 'List View Icon'\n  | typeof notApplicableString;\n\n/**\n * The initiating component data\n *\n * @interface IAnalyticsInitiatingComponentData\n */\ninterface IAnalyticsInitiatingComponentData {\n  /** The initiating component */\n  component: AnalyticsInitiatingComponent;\n  /** The data expiration date */\n  expiration: Date;\n}\n\n/**\n * AnalyticsEventStorage class, this is used to store the analytics event\n * information that is not present in the context of certain pages\n *\n * @class AnalyticsEventStorage\n */\nexport class AnalyticsEventStorage {\n  /** The session storage instance */\n  private readonly analyticsEventStorage = new LocalStorage();\n\n  /** The key to store the analytics event data under */\n  private readonly analyticsEventStorageKey = 'analyticsEvent';\n\n  private readonly initiatingComponentKey = 'initiatingAnalyticsComponent';\n\n  /**\n   * Set data in session storage\n   *\n   * @param {EventData} analyticsEvent - The analytics event object to store\n   */\n  public set = (analyticsEvent: EventData) => {\n    this.analyticsEventStorage.set(\n      this.analyticsEventStorageKey,\n      analyticsEvent,\n      { expires: tomorrow }\n    );\n  };\n\n  /**\n   * Get data from session storage\n   *\n   * @returns {EventData | null} The analytics event object\n   */\n  public get = (): EventData | null => {\n    return this.analyticsEventStorage.get(\n      this.analyticsEventStorageKey\n    ) as EventData;\n  };\n\n  /** Delete data from session storage */\n  public delete = () => {\n    this.analyticsEventStorage.delete(this.analyticsEventStorageKey);\n  };\n\n  /**\n   * Set the initiating component\n   *\n   * @param {string} component - The initiating component\n   */\n  public setInitiatingComponent = (component: AnalyticsInitiatingComponent) => {\n    this.analyticsEventStorage.set(\n      this.initiatingComponentKey,\n      { component },\n      { expires: defaultExpirationDate }\n    );\n  };\n\n  /**\n   * Retrieve the initiating component\n   *\n   * @constant {AnalyticsInitiatingComponent} initiatingComponent\n   * @returns {AnalyticsInitiatingComponent} The initiating component\n   */\n  public getInitiatingComponent = (): AnalyticsInitiatingComponent => {\n    /**\n     * The analytics initiating component data\n     *\n     * @constant {IAnalyticsInitiatingComponentData} data\n     */\n    const data = this.analyticsEventStorage.get(\n      this.initiatingComponentKey\n    ) as IAnalyticsInitiatingComponentData;\n    /**\n     * The initiating component\n     *\n     * @constant {AnalyticsInitiatingComponent} component\n     */\n    const component = data?.component;\n\n    if (component) {\n      return component;\n    }\n\n    return 'NA';\n  };\n}\n","import { notApplicableString } from '@/lib/constants/constants/analytics';\nimport { PetStatus } from '@/lib/constants/types/analytics';\nimport {\n  AnalyticsEventStorage,\n  AnalyticsInitiatingComponent,\n} from '@/lib/storageClasses/analyticsEventStorage';\nimport { PetFlowType } from '@/lib/utils/analytics/petSearch';\nimport {\n  createContext,\n  ReactNode,\n  useCallback,\n  useContext,\n  useMemo,\n} from 'react';\n\n/**\n * The data structure for the event data, we can add more properties as needed\n *\n * @interface EventData\n */\nexport interface EventData {\n  /**\n   * The method behind the operation\n   *\n   * @memberof EventData\n   * @member {string} [method]\n   */\n  method?: string;\n  /**\n   * The status of the pet (Lost, Found, Safe at Home)\n   *\n   * @memberof EventData\n   * @member {PetStatus} [petStatus]\n   */\n  petStatus?: PetStatus;\n  /**\n   * The text on the button that was clicked to get to this event\n   *\n   * @memberof EventData\n   * @member {string} [clickText]\n   */\n  clickText?: string;\n  /**\n   * The id of the pet entity\n   *\n   * @memberof EventData\n   * @member {number} [petId]\n   */\n  petId?: number;\n  /**\n   * The name of the pet\n   *\n   * @memberof EventData\n   * @member {string} [petName]\n   */\n  petName?: string;\n  /**\n   * The zip code associated with the pet\n   *\n   * @memberof EventData\n   * @member {string} [locationId]\n   */\n  locationId?: string;\n  /**\n   * The latitude of the pet\n   *\n   * @memberof EventData\n   * @member {string} [latitude]\n   */\n  latitude?: string;\n  /**\n   * The longitude of the pet\n   *\n   * @memberof EventData\n   * @member {string} [longitude]\n   */\n  longitude?: string;\n  /**\n   * The species of the pet\n   *\n   * @memberof EventData\n   * @member {string} [species]\n   */\n  species?: string;\n  /**\n   * The start date of the search\n   *\n   * @memberof EventData\n   * @member {string | null} [start]\n   */\n  start?: string | null;\n  /**\n   * The flow type\n   *\n   * @memberof EventData\n   * @member {PetFlowType} [flowType]\n   */\n  flowType?: PetFlowType;\n}\n\n/** This is the data structure that can be returned from the provider */\nexport interface IEventContext {\n  /** This is the method for updating the data */\n  updateData: (newData: EventData) => void;\n  /** This is the method for clearing the data */\n  clearData: () => void;\n  /** Get data */\n  getData: () => EventData | undefined;\n  /** Set the initiating component state */\n  setInitiatingComponent: (component: AnalyticsInitiatingComponent) => void;\n  /** The initiating component */\n  getInitiatingComponent: () => AnalyticsInitiatingComponent;\n  /** Get the pet id */\n  getPetId: () => number | undefined;\n}\n\n/**\n * The default event context\n *\n * @constant {IEventContext} defaultEventContext\n */\nexport const defaultEventContext: IEventContext = {\n  /** This method is used to update the data */\n  // eslint-disable-next-line @typescript-eslint/no-empty-function\n  updateData: () => {},\n  /**\n   * This method is used to get the data\n   *\n   * @returns {undefined} - The data\n   */\n  getData: () => undefined,\n  /** This method is used to clear the data */\n  // eslint-disable-next-line @typescript-eslint/no-empty-function\n  clearData: () => {},\n  /** Set the initiating component state */\n  // eslint-disable-next-line @typescript-eslint/no-empty-function\n  setInitiatingComponent: () => {},\n  /**\n   * The default initiating component\n   *\n   * @returns {string} - The initiating component\n   */\n  getInitiatingComponent: (): AnalyticsInitiatingComponent =>\n    notApplicableString,\n  /**\n   * The default pet id\n   *\n   * @returns {number | undefined} - The pet id\n   */\n  getPetId: () => undefined,\n};\n\n/** This is the context */\nconst EventContext = createContext<IEventContext>(defaultEventContext);\n\n/**\n * The interface for the EventContextProvider props\n *\n * @interface\n */\ninterface IEventContextProvider {\n  /** The children wrapped by the provider */\n  children: ReactNode;\n}\n\n/**\n * The EventContextProvider component.\n *\n * @param {IEventContextProvider} props - The props for the\n *   EventContextProvider.\n * @returns {Element} - The EventContextProvider.\n */\nexport function EventContextProvider({\n  children,\n}: IEventContextProvider): JSX.Element {\n  // Make instance of AnalyticsEventStorage referentially stable so context methods can be passed to the dependency array\n  const analyticsEventStorage = useMemo(() => new AnalyticsEventStorage(), []);\n\n  /**\n   * Update the state of data\n   *\n   * @param {EventData} newData - The new data\n   * @returns {void}\n   */\n  const updateData = useCallback(\n    (newData: EventData) => {\n      const storedData = analyticsEventStorage.get();\n      const currentData = storedData || {};\n      if (currentData && newData) {\n        newData = { ...currentData, ...newData };\n      }\n      analyticsEventStorage.set(newData);\n    },\n    [analyticsEventStorage]\n  );\n\n  /**\n   * Clear the state of data\n   *\n   * @returns {void}\n   */\n  const clearData = useCallback(() => {\n    analyticsEventStorage.delete();\n  }, [analyticsEventStorage]);\n\n  /**\n   * Return the state of data, if it is not there then check the storage\n   *\n   * @returns {EventData | undefined} - The data\n   */\n  const getData = useCallback(() => {\n    return analyticsEventStorage.get() || undefined;\n  }, [analyticsEventStorage]);\n\n  /**\n   * Return the pet id from the storage if available\n   *\n   * @returns {number | undefined} - The pet id\n   */\n  const getPetId = useCallback(() => {\n    const data = analyticsEventStorage.get();\n    return data?.petId;\n  }, [analyticsEventStorage]);\n\n  /**\n   * Set the initiating component\n   *\n   * @param {AnalyticsInitiatingComponent} component - The initiating component\n   */\n  const setInitiatingComponent = useCallback(\n    (component: AnalyticsInitiatingComponent) => {\n      analyticsEventStorage.setInitiatingComponent(component);\n    },\n    [analyticsEventStorage]\n  );\n\n  /**\n   * Retrieve the initiating component\n   *\n   * @returns {AnalyticsInitiatingComponent} - The initiating component\n   */\n  const getInitiatingComponent = useCallback(() => {\n    return analyticsEventStorage.getInitiatingComponent();\n  }, [analyticsEventStorage]);\n\n  return (\n    <EventContext.Provider\n      value={{\n        clearData,\n        getPetId,\n        getData,\n        getInitiatingComponent,\n        setInitiatingComponent,\n        updateData,\n      }}\n    >\n      {children}\n    </EventContext.Provider>\n  );\n}\n\n/**\n * This is the hook for the event context\n *\n * @returns {IEventContext} - The context\n */\nexport const useEventContext = (): IEventContext => useContext(EventContext);\n","import { useRouter } from 'next/router';\nimport { useEffect, useState } from 'react';\nimport configurations, { FormTypes, PageTypes } from './configs/Configuration';\nimport { ParsedUrlQuery } from 'querystring';\n\n/**\n * Sets the initial form step based on the query param. Used for client-side\n * implementation of forms.\n *\n * @param {FormTypes} formId - The form id\n * @param {ParsedUrlQuery} originalQueryParams - The original query params\n * @returns {{ isLoading: boolean; pageId: PageTypes }} The hook results\n */\nexport function useInitialFormStep(\n  formId: FormTypes,\n  originalQueryParams?: ParsedUrlQuery\n) {\n  const router = useRouter();\n  const [isLoading, setIsLoading] = useState(true);\n\n  const firstPage = configurations[formId].order[0];\n  const stepId = (router.query.step || firstPage) as PageTypes;\n\n  useEffect(() => {\n    if (router.isReady) {\n      if (!router.query.step) {\n        router.replace({\n          query: { step: firstPage, ...originalQueryParams },\n        });\n      }\n\n      setIsLoading(false);\n    }\n    /** Only router.isReady and router.query.step should be enough. */\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [router.isReady, router.query.step]);\n\n  return {\n    isLoading,\n    pageId: stepId,\n  };\n}\n","import { ISearchParameters } from '@/components/templates/SearchResultsTemplate/interfaces';\nimport {\n  foundSearchArticleSlugNames,\n  lostSearchArticleSlugNames,\n} from '@/lib/constants/constants/articles';\nimport { SearchType } from '@/lib/constants/types/pets';\nimport { getReverseGeocode } from '@/lib/dataSource/lostApi/utilities/geolocation/reverseGeocode';\nimport ReverseGeocode from '@/lib/dataSource/utilities/geolocation/reverseGeocode';\nimport LocalStorage from '@/lib/utils/storage/local-storage';\nimport { useCallback, useEffect, useState } from 'react';\n\n/**\n * The search parameters storage key\n *\n * @constant {string} searchParametersStorageKey - The search parameters storage\n *   key\n */\nexport const searchParametersStorageKey = 'search-params';\n\n/**\n * The local storage instance to store the search parameters\n *\n * @constant {LocalStorage} storage - The local storage instance\n */\nexport const searchParametersStorage = new LocalStorage();\n\n/**\n * IUseSearchParameters\n *\n * @interface\n */\nexport interface IUseSearchParameters {\n  /**\n   * Function to get the articles slug names\n   *\n   * @returns {void}\n   */\n  getArticlesSlugNames: (searchType?: SearchType) => void;\n  /**\n   * Function to get the reverse geocode from the search parameters\n   *\n   * @returns {Promise<ReverseGeocode | undefined>} The reverse geocode\n   */\n  getSearchParamsReverseGeocode: () => Promise<ReverseGeocode>;\n  /**\n   * Function to clear the search parameters from the storage\n   *\n   * @returns {void}\n   */\n  clearSearchParameters: () => void;\n  /** The articles slug names to display in the no results page */\n  articleSlugNames?: string[];\n  /** The search parameters */\n  searchParameters?: ISearchParameters;\n}\n\n/**\n * Hook to get the search parameters from storage\n *\n * @returns {IUseSearchParameters} The useSearchParameters hook return\n */\nconst useSearchParameters = (): IUseSearchParameters => {\n  const [searchParameters, _setSearchParameters] =\n    useState<ISearchParameters>();\n\n  /**\n   * The articles slug names to display in the no results page\n   *\n   * @constant {string[]} articleSlugNames - The articles slug names to display\n   */\n  const [articleSlugNames, setArticlesSlugNames] = useState<string[]>([]);\n\n  /** Set search parameters from storage */\n  const setSearchParameters = useCallback(() => {\n    /**\n     * The search parameters from local storage\n     *\n     * @constant {ISearchParameters} searchParametersFromStorage - The search\n     */\n    const searchParametersFromStorage =\n      searchParametersStorage.get(searchParametersStorageKey) ?? {};\n\n    _setSearchParameters(searchParametersFromStorage as ISearchParameters);\n  }, []);\n\n  /** Hook to update the distanceSearchResults options with local storage values */\n  useEffect(() => {\n    setSearchParameters();\n  }, [setSearchParameters]);\n\n  /**\n   * Function to get the articles slug names\n   *\n   * @param {SearchType} searchType - The search type to get the articles slug\n   *   names\n   */\n  const getArticlesSlugNames = useCallback(\n    (searchType?: SearchType) => {\n      /** Fallback to lost search if no searchType is provided */\n      const storedSearchType = searchType || searchParameters?.searchType;\n\n      if (storedSearchType) {\n        const slugNames =\n          storedSearchType === 'lost'\n            ? lostSearchArticleSlugNames\n            : foundSearchArticleSlugNames;\n        setArticlesSlugNames(slugNames);\n      }\n    },\n    [searchParameters]\n  );\n\n  /**\n   * Function to get the reverse geocode from the search parameters\n   *\n   * @returns {Promise<ReverseGeocode>} The reverse geocode\n   */\n  const getSearchParamsReverseGeocode = useCallback(async () => {\n    const latitude = searchParameters?.latitude as number;\n    const longitude = searchParameters?.longitude as number;\n    const reverseGeocodeData = await getReverseGeocode({ latitude, longitude });\n    const reverseGeocode = new ReverseGeocode(reverseGeocodeData, {\n      latitude,\n      longitude,\n    });\n\n    return reverseGeocode;\n  }, [searchParameters]);\n\n  /**\n   * Clear the search parameters from the storage\n   *\n   * @returns {void}\n   */\n  const clearSearchParameters = useCallback((): void => {\n    searchParametersStorage.delete(searchParametersStorageKey);\n    setSearchParameters();\n  }, [setSearchParameters]);\n\n  /** Hook to fetch articles slug names */\n  useEffect(() => {\n    getArticlesSlugNames();\n  }, [getArticlesSlugNames, searchParameters?.searchType]);\n\n  return {\n    getArticlesSlugNames,\n    getSearchParamsReverseGeocode,\n    clearSearchParameters,\n    articleSlugNames,\n    searchParameters,\n  };\n};\n\nexport default useSearchParameters;\n","import { defaultEventEmitter } from '@/lib/analytics/commonEmitter';\nimport { IEvent } from '@/lib/analytics/handlers/abstractAnalyticsHandler';\nimport { AnalyticsInitiatingComponent } from '@/lib/storageClasses/analyticsEventStorage';\n\n/**\n * The flow type\n *\n * @type {Flow}\n */\ntype Flow = 'Lost' | 'Found' | 'All';\n\n/**\n * The event name\n *\n * @constant {string}\n */\nconst eventName = 'start_pet_search';\n\n/**\n * The interface for the user sign up event\n *\n * @interface IUserSignUpEvent\n */\nexport interface IStartPetSearchEvent {\n  /** The clicked text */\n  clickText: string;\n  /** The search flow */\n  flow: Flow;\n  /** The component used to start event */\n  component: AnalyticsInitiatingComponent;\n}\n\n/**\n * Handle the user sign up event\n *\n * @param {IStartPetSearchEvent} params - The event params\n */\nexport const startPetSearchEventHandler = ({\n  clickText,\n  flow,\n  component,\n}: IStartPetSearchEvent) => {\n  const eventData: IEvent = {\n    name: eventName,\n    data: {\n      click_text: clickText,\n      flow_type: flow,\n      component,\n    },\n  };\n  defaultEventEmitter.handleEvent(eventData);\n};\n","// Today's date\nexport const today = new Date();\n// Tomorrow's Date\nexport const tomorrow = new Date(today.getTime() + 86400000);\n\n/**\n * Get a date object that is X minutes from now\n *\n * @param {number} minutes - Time in minutes\n * @returns {Date} A date object that is X minutes from now\n */\nexport const getDateXMinutesFromNow = (minutes: number) => {\n  return new Date(new Date().getTime() + minutes * 60 * 1000);\n};\n\n/**\n * Check if a date is valid\n *\n * @param {string} date - The date to check\n * @returns {boolean} - True if the date is valid, false otherwise\n */\nexport const isDateValid = (date: string) => {\n  return !isNaN(new Date(date).getTime());\n};\n","import AbstractStorage, { IStorageConfig } from './abstract-storage';\n\n/**\n * LocalStorage Local Storage is available across all browser tabs. It is not\n * cleared when the tab is closed.\n *\n * @augments AbstractStorage\n * @class\n */\nexport default class LocalStorage extends AbstractStorage {\n  /**\n   * Get Get the data from the local storage.\n   *\n   * @param {string} id - The id of the data to get.\n   * @returns {object | null} - The data or null if not found.\n   */\n  get(id: string): object | string | null {\n    if (typeof window === 'undefined') {\n      return null;\n    }\n    const data = localStorage.getItem(id);\n\n    if (!data) return null;\n    // Parse the data and check if the expiration date is passed\n    let parsedData = null;\n\n    parsedData = JSON.parse(data);\n    if (parsedData.expiration && new Date(parsedData.expiration) < new Date()) {\n      this.delete(id);\n      return null;\n    }\n    return parsedData;\n  }\n\n  /**\n   * Set Set the data in the local storage.\n   *\n   * @param {string} id - The id of the data to set.\n   * @param {object | string} data - The data to set.\n   * @param {IStorageConfig} [config] - The configuration for the local storage.\n   */\n  set(id: string, data: object | string, config?: IStorageConfig): void {\n    if (config?.expires) {\n      if (typeof data === 'string') {\n        data = { data, expiration: config.expires };\n      } else {\n        data = { ...data, expiration: config.expires };\n      }\n    }\n    localStorage.setItem(id, JSON.stringify(data));\n  }\n\n  /**\n   * Delete Delete the data from the local storage.\n   *\n   * @param {string} id - The id of the data to delete.\n   */\n  delete(id: string): void {\n    localStorage.removeItem(id);\n  }\n}\n","/**\n * Get the expiration date from the data.\n *\n * @param {object | null} data - The data.\n * @returns {Date | null} - The expiration date or null if not found.\n */\nfunction getExpirationDate(\n  data: { [key: string]: unknown } | null\n): Date | null {\n  if (\n    data !== null &&\n    'expiration' in data &&\n    data?.expiration &&\n    typeof data.expiration === 'string'\n  ) {\n    /**\n     * The expiration date from the data.\n     *\n     * @constant {Date} expirationDate\n     */\n    const expirationDate = new Date(data.expiration);\n\n    if (!isNaN(expirationDate.getTime())) {\n      return expirationDate;\n    }\n    console.error('Invalid expiration date: ', data.expiration);\n  }\n\n  return null;\n}\n\nexport default getExpirationDate;\n","/**\n * A helper function to parse a JSON string safely\n *\n * @param {string} str - The string to parse\n * @returns {string | object} - The parsed JSON object or the string\n */\nfunction parseToJSONSafe(str: string): string | { [key: string]: unknown } {\n  try {\n    return JSON.parse(str);\n  } catch (error) {\n    console.error('Unable to parse string to JSON: ', str);\n  }\n  return str;\n}\n\nexport default parseToJSONSafe;\n","import getExpirationDate from '../helpers/ObjectsHelpers/getExpirationDate';\nimport parseToJSONSafe from '../helpers/stringHelpers/parseToJSONSafe';\nimport AbstractStorage, { IStorageConfig } from './abstract-storage';\n\n/**\n * SessionStorage Session Storage is a storage that is available only in the\n * current browser tab. It is cleared when the tab is closed. It is not shared\n * between tabs.\n *\n * @augments AbstractStorage\n * @class\n */\nexport default class SessionStorage extends AbstractStorage {\n  /**\n   * Whether the session storage is available.\n   *\n   * @returns {boolean} - Whether the session storage is available.\n   */\n  private isAvailable(): boolean {\n    return typeof window !== 'undefined';\n  }\n\n  /**\n   * Get Get the data from the session storage.\n   *\n   * @param {string} id - The id of the data to get.\n   * @returns {object | null} - The data or null if not found.\n   */\n  get(id: string): object | string | null {\n    if (!this.isAvailable()) {\n      return null;\n    }\n    const data = sessionStorage.getItem(id);\n\n    if (!data) {\n      return null;\n    }\n\n    // Parse the data and check if the expiration date is passed\n    const parsedData = parseToJSONSafe(data);\n\n    if (typeof parsedData === 'string') {\n      return parsedData;\n    }\n    /**\n     * The data expiration date.\n     *\n     * @constant {Date | null} expirationDate\n     */\n    const expirationDate = getExpirationDate(parsedData);\n\n    if (expirationDate && expirationDate < new Date()) {\n      this.delete(id);\n      return null;\n    }\n    return parsedData;\n  }\n\n  /**\n   * Set Set the data in the session storage.\n   *\n   * @param {string} id - The id of the data to set.\n   * @param {object | string} data - The data to set.\n   * @param {IStorageConfig} [config] - The session configuration.\n   */\n  set(id: string, data: object | string, config?: IStorageConfig): void {\n    if (!this.isAvailable()) {\n      return;\n    }\n    if (config?.expires) {\n      if (typeof data === 'string') {\n        data = { data, expiration: config.expires };\n      } else {\n        data = { ...data, expiration: config.expires };\n      }\n    }\n    sessionStorage.setItem(id, JSON.stringify(data));\n  }\n\n  /**\n   * Delete Delete the data from the session storage.\n   *\n   * @param {string} id - The id of the data to delete.\n   */\n  delete(id: string): void {\n    sessionStorage.removeItem(id);\n  }\n}\n","import { ILocationDto } from '@/components/molecules/InputPlacesFieldGoogle/InputPlacesFieldGoogle';\nimport Head from '@/components/templates/Head/Head';\nimport StepperFormTemplate from '@/components/templates/StepperFormTemplate/StepperFormTemplate';\nimport { defaultSearchRadius } from '@/lib/constants/constants/search';\nimport {\n  EventData,\n  useEventContext,\n} from '@/lib/hooks/analytics/useEventContext';\nimport {\n  FormTypeData,\n  MultiPageFormProvider,\n} from '@/lib/hooks/multiPageForm/MultiPageForm';\nimport {\n  allPetsPage,\n  storage as allPetsStorage,\n} from '@/lib/hooks/multiPageForm/configs/AllPets';\nimport { FormTypes } from '@/lib/hooks/multiPageForm/configs/Configuration';\nimport { useInitialFormStep } from '@/lib/hooks/multiPageForm/useInitialFormStep';\nimport {\n  searchParametersStorage,\n  searchParametersStorageKey,\n} from '@/lib/hooks/searchParameters/useSearchParameters';\nimport { AnalyticsInitiatingComponent } from '@/lib/storageClasses/analyticsEventStorage';\nimport { startPetSearchEventHandler } from '@/lib/utils/analytics/startPetSearch';\nimport { tomorrow } from '@/lib/utils/helpers/dateHelpers/dates';\nimport {\n  GetServerSidePropsContext,\n  GetServerSidePropsResult,\n  NextPage,\n} from 'next';\nimport { useRouter } from 'next/router';\nimport { ParsedUrlQueryInput } from 'querystring';\nimport { useEffect } from 'react';\n\n/**\n * The form Id is used to identify the form in the MultiPageFormProvider.\n *\n * @constant\n * @type {FormTypes}\n */\nexport const formId: FormTypes = 'all-pets';\n\n/**\n * The storage key for the persistent data from the All pets Form.\n *\n * @constant\n * @type {FormTypeData}\n */\nexport const allPetsStorageKey: FormTypeData = `${formId}-data`;\n\n/**\n * IAllPetsFormFields All Pets Form Fields Interface\n *\n * @interface\n */\nexport interface IAllPetsFormFields {\n  /** The address of the pet */\n  address: ILocationDto;\n}\n\n/**\n * Get the search params from the form data and store it in local storage.\n *\n * @param {IAllPetsFormFields} data - The submitted form data\n * @returns {ParsedUrlQueryInput} - The search params\n */\nexport const getSearchParams = (\n  data: IAllPetsFormFields\n): ParsedUrlQueryInput => {\n  allPetsStorage.delete(allPetsStorageKey);\n  const address = data.address;\n  const { latitude, longitude } = address.coordinates;\n\n  let searchData = {};\n\n  allPetsStorage.set(\n    allPetsStorageKey,\n    {\n      place: address,\n      geolocation: { latitude, longitude },\n    },\n    { expires: tomorrow }\n  );\n  /** Set the updated form data so it can be used by other workflows */\n  searchData = {\n    latitude,\n    longitude,\n    searchRadius: defaultSearchRadius,\n    address: address.label,\n  };\n  return searchData;\n};\n\n/**\n * IAllPetsProps All Pets Props Interface\n *\n * @interface\n */\nexport interface IAllPetsProps {\n  /** The component from the query param */\n  component: string;\n}\n\n/**\n * All Pets Form Page\n *\n * @param {IAllPetsProps} props - The props\n * @returns {NextPage} - The All Pets Form Page\n */\nconst AllPets: NextPage<IAllPetsProps> = ({ component }: IAllPetsProps) => {\n  const router = useRouter();\n  const { pageId, isLoading } = useInitialFormStep(formId);\n  const { clearData, updateData } = useEventContext();\n  const { setInitiatingComponent } = useEventContext();\n\n  /**\n   * Using the component from the query param determine what the click text\n   * property value will be for the GA event\n   *\n   * @param {string} component - The component\n   * @returns {string} - The click text\n   */\n  const determineClickText = (component: string) => {\n    switch (component) {\n      case 'homelink':\n        return 'Search All Lost and Found Pets';\n      case 'helplink':\n        return 'view lost and found pets near you';\n      case 'helpbutton':\n        return 'Search All Pets';\n      default:\n        return 'NA';\n    }\n  };\n\n  /**\n   * Using the component from the query param determine what the component\n   * property value will be for the GA event\n   *\n   * @param {string} component - The component\n   * @returns {AnalyticsInitiatingComponent} - The component\n   */\n  const determineComponent = (\n    component: string\n  ): AnalyticsInitiatingComponent => {\n    let componentName: AnalyticsInitiatingComponent = 'NA';\n\n    if (component === 'homelink') {\n      componentName = 'Search All Pets Link / Homepage';\n    }\n    if (component === 'helplink') {\n      componentName = 'Search All Pets Link / How To Help Page';\n    }\n    if (component === 'helpbutton') {\n      componentName = 'Search All Pets Button / How To Help Page';\n    }\n    setInitiatingComponent(componentName);\n    return componentName;\n  };\n\n  useEffect(\n    () => {\n      clearData();\n      startPetSearchEventHandler({\n        clickText: determineClickText(component),\n        component: determineComponent(component),\n        flow: 'All',\n      });\n    },\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    []\n  );\n\n  /**\n   * On Submit\n   *\n   * @param {IAllPetsFormFields} data - The data from the form\n   * @returns {Promise<void>}\n   */\n  const onSubmit = async (data: IAllPetsFormFields) => {\n    const searchParams = await getSearchParams(data);\n    searchParametersStorage.delete(searchParametersStorageKey);\n    const petSearchData: EventData = {\n      clickText: 'Search All Pets',\n      flowType: 'All',\n      method: 'Distance',\n      locationId: data.address.postalCode,\n    };\n    updateData(petSearchData);\n    router.push({\n      pathname: '/search-all',\n      query: {\n        ...searchParams,\n        searchType: encodeURIComponent('lost-or-found'),\n      },\n    });\n  };\n\n  return (\n    <MultiPageFormProvider\n      formId={formId}\n      pageId={pageId}\n      featureFlags={null}\n      renderMode=\"client\"\n    >\n      <Head title=\"All Pets\" noIndex={true} />\n      <StepperFormTemplate\n        key={pageId}\n        submitFunction={onSubmit}\n        isLoadingForm={isLoading}\n      />\n    </MultiPageFormProvider>\n  );\n};\n\n/**\n * Redirect if the step is not found.\n *\n * @param {GetServerSidePropsContext} context - The context object\n * @returns {GetServerSidePropsResult} - The server side props\n */\nexport const getServerSideProps = async (\n  context: GetServerSidePropsContext\n): GetServerSidePropsResult => {\n  if (allPetsPage.indexOf(context.query.step) > -1 || !context.query.step) {\n    const component = context.query.component || '';\n\n    return {\n      props: {\n        component,\n      },\n    };\n  }\n  return {\n    notFound: true,\n  };\n};\n\nexport default AllPets;\n"],"names":["window","__NEXT_P","push","__webpack_require__","EventLogHandler","AbstractAnalyticsHandler","send","data","getAnalyticsFeature","KlaviyoEventHandler","eventData","type","attributes","properties","time","Date","metric","name","profile","axios","concat","getBasePath","logEventHandler","googleTagManagerBrand","gtmEventHandler","GoogleTagManagerHandler","klaviyoEventHandler","EventEmitter","defaultEventEmitter","handleEvent","handlers","forEach","handler","constructor","cookies","CookieStorage","optimizelyDecision","get","analyticsFeatureKey","feature","notApplicableString","analytic","brand","dataObject","gtag","shelterDetailsArticlesSlugNames","foundSearchArticleSlugNames","lostSearchArticleSlugNames","microchipSearchArticlesSlugNames","defaultSearchRadius","defaultSearchRadiusIndex","petcoLoveHQCoordinates","latitude","longitude","sdk","initSDK","pllApiBaseUrl","process","pllWebsocketBaseUrl","PetcoLoveSDK","defaultExpirationDate","tomorrow","AnalyticsEventStorage","analyticsEventStorage","LocalStorage","analyticsEventStorageKey","initiatingComponentKey","set","analyticsEvent","expires","delete","setInitiatingComponent","component","getInitiatingComponent","EventContext","createContext","updateData","getData","undefined","clearData","getPetId","EventContextProvider","param","children","useMemo","useCallback","storedData","currentData","newData","petId","jsx_runtime","jsx","Provider","value","useEventContext","useContext","useInitialFormStep","formId","originalQueryParams","router","useRouter","isLoading","setIsLoading","useState","firstPage","configurations","order","stepId","query","step","useEffect","isReady","replace","pageId","searchParametersStorageKey","searchParametersStorage","__webpack_exports__","ZP","searchParameters","_setSearchParameters","articleSlugNames","setArticlesSlugNames","setSearchParameters","searchParametersFromStorage","getArticlesSlugNames","storedSearchType","searchType","slugNames","getSearchParamsReverseGeocode","reverseGeocodeData","getReverseGeocode","reverseGeocode","ReverseGeocode","clearSearchParameters","startPetSearchEventHandler","clickText","flow","click_text","flow_type","today","getTime","getDateXMinutesFromNow","minutes","isDateValid","isNaN","date","AbstractStorage","id","localStorage","getItem","parsedData","JSON","parse","expiration","config","setItem","stringify","removeItem","ObjectsHelpers_getExpirationDate","expirationDate","stringHelpers_parseToJSONSafe","str","error","SessionStorage","isAvailable","sessionStorage","parseToJSONSafe","getExpirationDate","allPetsStorageKey","getSearchParams","allPetsStorage","address","coordinates","place","geolocation","searchRadius","label","determineClickText","determineComponent","componentName","onSubmit","searchParams","petSearchData","flowType","method","locationId","postalCode","pathname","encodeURIComponent","react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__","jsxs","MultiPageFormProvider","featureFlags","renderMode","Head","title","noIndex","StepperFormTemplate","submitFunction","isLoadingForm"],"sourceRoot":""}