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+B,GAAiBtC,GAAamC,UAAYL,GAAcrB,UAAaA,EAE3E,OACE,UAAC8B,EAAc,YACb,gCACE,mBAAQC,OAAQN,EAAKnI,KAAK,gBAC1B,SAAC0I,EAAG,CAAClC,IAAK8B,EAAS5B,SAAU6B,EAAcI,IAAKN,OAEjDP,IAEJ,EAGGU,EAAiB,UAAO3J,IAAG;;;EAK3B6J,EAAM,UAAOE,IAAG;;qBAEAC,GAAwC,GAAGA,EAAMnC;;;oGClDhE,MAAMoC,EAA+BC,IAC1C,GAAIA,EACF,MAAMA,C,qFCWH,MAAMC,EAAiC,CAC5CC,OAAQ,CACNC,cAAe,QAEjBH,MAAO,CACLI,2BAA4B,aAC5BtD,cAAe,oDACfE,UAAW,wEAEbH,QAAS,CACPC,cAAe,qCACfE,UACE,6GAEJqD,gBAAiB,CACfC,kBAAmB,wBACnBxD,cAAe,4CACfE,UACE,wKAEJuD,cAAe,CACbzD,cAAe,6CACfE,UAAW,oFAEbwD,SAAU,CACRC,KAAM,CACJ,CACEC,QACE,mKACF5D,cAAe,yBAEjB,CACE4D,QACE,0KACF5D,cAAe,gCAEjB,CACE4D,QACE,kJACF5D,cAAe,+BAEjB,CACE4D,QACE,wJACF5D,cAAe,gCAEjB,CACE4D,QACE,4GACF5D,cAAe,kDAIrB6D,MAAO,CACLC,WACE,qQAEJC,QAAS,CACPP,kBAAmB,4BACnBxD,cAAe,4BACfgE,gBAAiB,0C","sources":["webpack://aurora-new-frontend/./packages/lead-capture/src/shared-components/drawer.tsx","webpack://aurora-new-frontend/./packages/lead-capture/src/pages/landing/landing.generated.tsx","webpack://aurora-new-frontend/./packages/lead-capture/src/pages/landing/landing-page.tsx","webpack://aurora-new-frontend/./packages/lead-capture/src/utils/image-matcher.tsx","webpack://aurora-new-frontend/./packages/lead-capture/src/shared-components/image.tsx","webpack://aurora-new-frontend/./packages/lead-capture/src/utils/apollo-query-error-propagation.ts","webpack://aurora-new-frontend/./packages/lead-capture/src/utils/text-constants.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { Flex } from 'reflexbox/styled-components';\nimport styled from 'styled-components';\n\nimport { Colors } from '@aurorasolar/common-core/src/colors';\nimport { AuroraIcon, AuroraIconType } from '@aurorasolar/common-core/src/icon';\nimport { Collapse } from '@blueprintjs/core';\n\nimport { LCAIButton, LCAIButtonIntent } from '../typography/lcai-button/lcai-button';\nimport { LCAIText } from '../typography/lcai-text/lcai-text';\nimport { Z_ORDER } from '../utils/constants';\n\nconst DrawerContainer = styled.div`\n position: absolute;\n z-index: ${Z_ORDER.DEFAULT};\n bottom: 0;\n left: 0;\n right: 0;\n max-height: 100%;\n overflow: auto;\n background: ${Colors.GRAY_800};\n opacity: 0.85;\n backdrop-filter: blur(3px);\n border-radius: 8px 8px 0 0;\n`;\n\nconst DrawerHeader = styled(Flex)`\n align-items: center;\n justify-content: space-between;\n`;\n\nconst DrawerButton = styled(LCAIButton)`\n && {\n width: 100%;\n padding: 0 32px;\n display: flex;\n justify-content: space-between;\n border-radius: 8px 8px 0 0;\n height: 64px;\n outline: none;\n }\n`;\n\nconst DrawerPanel = styled.div`\n overflow: hidden;\n padding: 0 32px 32px;\n\n @media screen and (max-width: 767px) {\n padding-bottom: 16px;\n }\n`;\n\nconst DrawerValue = ({ icon, text }: { icon: AuroraIconType; text: string }) => {\n return (\n \n \n \n {text}\n \n \n );\n};\n\nexport interface DrawerValueProps {\n icon: AuroraIconType;\n text: string;\n}\n\nexport interface DrawerProps {\n headerText: string;\n items: DrawerValueProps[];\n}\n\nexport const Drawer = ({ headerText, items }: DrawerProps) => {\n const [isDrawerOpen, setIsDrawerOpen] = useState(false);\n const toggleDrawer = () => {\n setIsDrawerOpen(!isDrawerOpen);\n };\n\n const panelItems = items.map((item, i) => {\n return ;\n });\n\n return (\n \n \n \n \n {headerText}\n \n \n \n \n \n {panelItems}\n \n \n );\n};\n","// @ts-ignore: Ignore unused { * as Types } import\nimport * as Types from '@aurorasolar/graphql-client-schema';\n\nimport { gql } from '@apollo/client';\nimport * as Apollo from '@apollo/client';\nconst defaultOptions = {} as const;\nexport type GetLeadCaptureProjectTemplateInfoQueryVariables = Types.Exact<{\n id: Types.Scalars['ID'];\n}>;\n\n\nexport type GetLeadCaptureProjectTemplateInfoQuery = { __typename: 'Query', projectTemplate: { __typename: 'LeadCaptureProjectTemplate', id: string, companyName: string, hasServiceRegionRestrictions: boolean } };\n\nexport type CreateLeadCaptureRunMutationVariables = Types.Exact<{\n id: Types.Scalars['ID'];\n referrerParams: Types.LeadCaptureReferrerParamsInput;\n}>;\n\n\nexport type CreateLeadCaptureRunMutation = { __typename: 'Mutation', run: { __typename: 'LeadCaptureProject', id: string } };\n\n\nexport const GetLeadCaptureProjectTemplateInfoDocument = gql`\n query GetLeadCaptureProjectTemplateInfo($id: ID!) @trace_info(traceInfo: {pod: leads}) {\n projectTemplate: getLeadCaptureProjectTemplateData(id: $id) {\n id\n companyName\n hasServiceRegionRestrictions\n }\n}\n `;\n\n/**\n * __useGetLeadCaptureProjectTemplateInfoQuery__\n *\n * To run a query within a React component, call `useGetLeadCaptureProjectTemplateInfoQuery` and pass it any options that fit your needs.\n * When your component renders, `useGetLeadCaptureProjectTemplateInfoQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useGetLeadCaptureProjectTemplateInfoQuery({\n * variables: {\n * id: // value for 'id'\n * },\n * });\n */\nexport function useGetLeadCaptureProjectTemplateInfoQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(GetLeadCaptureProjectTemplateInfoDocument, options);\n }\nexport function useGetLeadCaptureProjectTemplateInfoLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(GetLeadCaptureProjectTemplateInfoDocument, options);\n }\nexport type GetLeadCaptureProjectTemplateInfoQueryHookResult = ReturnType;\nexport type GetLeadCaptureProjectTemplateInfoLazyQueryHookResult = ReturnType;\nexport type GetLeadCaptureProjectTemplateInfoQueryResult = Apollo.QueryResult;\nexport const CreateLeadCaptureRunDocument = gql`\n mutation createLeadCaptureRun($id: ID!, $referrerParams: LeadCaptureReferrerParamsInput!) @trace_info(traceInfo: {pod: leads}) {\n run: createLeadCaptureRun(id: $id, referrerParams: $referrerParams) {\n id\n }\n}\n `;\nexport type CreateLeadCaptureRunMutationFn = Apollo.MutationFunction;\n\n/**\n * __useCreateLeadCaptureRunMutation__\n *\n * To run a mutation, you first call `useCreateLeadCaptureRunMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useCreateLeadCaptureRunMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [createLeadCaptureRunMutation, { data, loading, error }] = useCreateLeadCaptureRunMutation({\n * variables: {\n * id: // value for 'id'\n * referrerParams: // value for 'referrerParams'\n * },\n * });\n */\nexport function useCreateLeadCaptureRunMutation(baseOptions?: Apollo.MutationHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useMutation(CreateLeadCaptureRunDocument, options);\n }\nexport type CreateLeadCaptureRunMutationHookResult = ReturnType;\nexport type CreateLeadCaptureRunMutationResult = Apollo.MutationResult;\nexport type CreateLeadCaptureRunMutationOptions = Apollo.BaseMutationOptions;","import { useCallback, useEffect, useRef } from 'react';\n\nimport { useDebouncedCallback } from '@aurorasolar/common-core/src/hooks';\nimport { AuroraIconType } from '@aurorasolar/common-core/src/icon';\nimport {\n Analytics,\n AnalyticsEventTypes,\n AppRouterNavigation,\n useAppModule,\n} from '@aurorasolar/common-module-loader';\n\nimport { useRouteData } from '../../hooks';\nimport {\n AnimateView,\n BoxWithMargin,\n Drawer,\n Image,\n SplitView,\n TopRail,\n} from '../../shared-components';\nimport { LCAIButton, LCAIButtonIntent, LCAIText } from '../../typography';\nimport { apolloQueryErrorPropagation } from '../../utils/apollo-query-error-propagation';\nimport { DEBOUNCE_TIME, HEADER_COLOR, PARAGRAPH_COLOR } from '../../utils/constants';\nimport { LeadCaptureReferrerParams } from '../../utils/referrer-params';\nimport { SourcePage } from '../../utils/source-page';\nimport { TEXT } from '../../utils/text-constants';\nimport {\n useCreateLeadCaptureRunMutation,\n useGetLeadCaptureProjectTemplateInfoQuery,\n} from './landing.generated';\n\nexport interface LandingPageProps {\n isSDK: string;\n projectTemplateId: string;\n referrerParams: LeadCaptureReferrerParams;\n sourcePage: SourcePage;\n}\n\nexport const LandingPage = ({\n isSDK,\n projectTemplateId,\n referrerParams,\n sourcePage,\n}: LandingPageProps) => {\n const navigation = useAppModule(AppRouterNavigation);\n const analytics = useAppModule(Analytics);\n\n const { firstDisqualifyingQuestionId, formBeforeResults, customSettings, hasUtilityBillCapture } =\n useRouteData();\n\n const analyticsTracker = useRef({\n sent: false,\n });\n\n const [createRun] = useCreateLeadCaptureRunMutation();\n\n const { data, loading } = useGetLeadCaptureProjectTemplateInfoQuery({\n onError: apolloQueryErrorPropagation,\n variables: { id: projectTemplateId },\n });\n\n const hasServiceRegionRestrictions = data?.projectTemplate?.hasServiceRegionRestrictions;\n\n useEffect(() => {\n async function sendAnalytics() {\n // Don't send analytics until we have projectTemplateData back\n if (!loading && formBeforeResults != null && hasUtilityBillCapture != null) {\n await analytics?.identify(undefined, {\n company_name: data?.projectTemplate?.companyName,\n form_before_results: formBeforeResults,\n organization_id: projectTemplateId,\n screen_height: window.outerHeight,\n screen_width: window.outerWidth,\n service_region_restrictions: hasServiceRegionRestrictions,\n utility_bill_upload: hasUtilityBillCapture,\n });\n // Ensure that identify happens before anything else\n if (isSDK === 'true') {\n setTimeout(async () => {\n await analytics?.track(AnalyticsEventTypes.LeadCaptureSDKLoaded);\n analyticsTracker.current.sent = true;\n }, 500);\n }\n }\n }\n sendAnalytics();\n }, [\n analytics,\n data,\n loading,\n projectTemplateId,\n isSDK,\n formBeforeResults,\n hasUtilityBillCapture,\n hasServiceRegionRestrictions,\n ]);\n\n const sendOpenedWidgetAnalytic = useCallback(\n async (event) => {\n await analytics?.track(AnalyticsEventTypes.LeadCaptureOpenedWidget, {\n reason: event.data.reason,\n });\n },\n [analytics],\n );\n\n const onMessageReceivedFromIframe = useCallback(\n async (event) => {\n if (event.data.type === 'openLCAI') {\n if (analyticsTracker.current.sent) {\n sendOpenedWidgetAnalytic(event);\n } else {\n const timerId = setInterval(() => {\n if (analyticsTracker.current.sent) {\n clearInterval(timerId);\n sendOpenedWidgetAnalytic(event);\n }\n }, 500);\n }\n }\n },\n [sendOpenedWidgetAnalytic],\n );\n\n useEffect(() => {\n window.addEventListener('message', onMessageReceivedFromIframe);\n return () => window.removeEventListener('message', onMessageReceivedFromIframe);\n }, [onMessageReceivedFromIframe]);\n\n const handleNext = useDebouncedCallback(\n async () => {\n if (projectTemplateId == null) return;\n const { data: createRunData } = await createRun({\n variables: {\n id: projectTemplateId,\n referrerParams,\n },\n });\n const projectId = createRunData?.run.id as string;\n await analytics?.track(AnalyticsEventTypes.LeadCaptureContinuedFromLandingPage, {\n project_id: projectId,\n });\n navigation?.navigate(\n !firstDisqualifyingQuestionId\n ? `/projects/${projectId}/address`\n : `/projects/${projectId}/qualification/${firstDisqualifyingQuestionId}`,\n { replace: true },\n );\n },\n [\n analytics,\n createRun,\n firstDisqualifyingQuestionId,\n navigation,\n projectTemplateId,\n referrerParams,\n ],\n DEBOUNCE_TIME,\n );\n\n return (\n <>\n \n \n \n Get started\n \n }\n leftContent={\n <>\n \n {customSettings?.landingPageHeader || TEXT.landing.primaryHeader}\n \n \n \n {customSettings?.landingPageSubHeader || TEXT.landing.subheader}\n \n \n \n \n {!formBeforeResults && 'No sign up or email required.'}\n \n \n >\n }\n rightContent={\n \n \n \n }\n />\n \n >\n );\n};\n\nexport default LandingPage;\n","import { SourcePage } from './source-page';\n\nexport interface LCAIImage {\n alt: string;\n name: string;\n position?: string;\n}\n\nexport const IMAGES = {\n AddressImage: { alt: 'View of earth from space', name: 'location' },\n BillUploadImage: {\n alt: 'Bungalow with solar panels with lots of shrubs and two trees in the foreground',\n name: 'bill-upload',\n position: '0% 90%',\n },\n ComingSoonImage: {\n alt: 'Women in kitchen with wood shelves containing dishes',\n name: 'coming-soon',\n },\n DropOffImage: {\n alt: \"Bird's-eye view of a neighborhood at sunrise showing roofs with and without solar\",\n name: 'drop-off',\n },\n LandingImage: {\n alt: 'Patio scene with solar home in background',\n name: 'how-it-works',\n position: 'center 30%',\n },\n ProfileReviewImage: {\n alt: 'An older couple reviewing their solar needs with a solar expert',\n name: 'profile-review',\n position: '60% 10%',\n },\n QuoteImage: {\n alt: 'Yellow brick house with solar panels with greenery in foreground',\n name: 'get-in-touch',\n },\n ThankYouImage: {\n alt: 'Open french doors to balcony containing potted plants with trees in the distance',\n name: 'thank-you',\n },\n UtilityImage: {\n alt: 'String of electric lights hanging between trees',\n name: 'savings',\n position: 'center 75%',\n },\n};\n\nconst MAPPED_IMAGES = {\n [SourcePage.ADDRESS]: IMAGES.AddressImage,\n [SourcePage.ADDRESS_DROP]: IMAGES.DropOffImage,\n [SourcePage.BILL_UPLOAD]: IMAGES.BillUploadImage,\n [SourcePage.ERROR]: IMAGES.ComingSoonImage,\n [SourcePage.GENERIC_DROP]: IMAGES.DropOffImage,\n [SourcePage.LANDING]: IMAGES.LandingImage,\n [SourcePage.OWNERSHIP_DROP]: IMAGES.ComingSoonImage,\n [SourcePage.QUOTE]: IMAGES.QuoteImage,\n [SourcePage.THANK_YOU]: IMAGES.ThankYouImage,\n [SourcePage.UTILITY]: IMAGES.UtilityImage,\n};\n\nexport function ImageMatcher(sourcePage: SourcePage): LCAIImage {\n return MAPPED_IMAGES[sourcePage];\n}\n","import styled from 'styled-components';\n\nimport { CustomImageFragment } from '../lead-capture.generated';\nimport { S3_IMAGE_LOCATION } from '../utils/constants';\nimport { ImageMatcher } from '../utils/image-matcher';\nimport { SourcePage } from '../utils/source-page';\n\nconst DEFAULT_POSITION = 'center';\n\nexport interface ImageProps {\n customImage?: CustomImageFragment | null;\n alt?: string;\n children?: JSX.Element;\n name?: string;\n position?: string;\n sourcePage?: SourcePage;\n}\n\nexport const Image = ({\n alt,\n children,\n customImage,\n name,\n position = DEFAULT_POSITION,\n sourcePage,\n}: ImageProps) => {\n const matchedImage = sourcePage && ImageMatcher(sourcePage);\n\n const webpSrc = `${S3_IMAGE_LOCATION + (matchedImage?.name || name)}.webp`;\n const jpgSrc = `${S3_IMAGE_LOCATION + (matchedImage?.name || name)}.jpg`;\n\n const url = (customImage?.isActive && customImage?.url) || webpSrc;\n const fallbackUrl = (customImage?.isActive && customImage?.fallbackUrl) || jpgSrc;\n const altText = (customImage?.isActive && customImage?.altText) || matchedImage?.alt || alt;\n const positionAttr = (!customImage?.isActive && matchedImage?.position) || position;\n\n return (\n \n \n \n \n \n {children}\n \n );\n};\n\nconst ImageContainer = styled.div`\n position: relative;\n height: 100%;\n`;\n\nconst Img = styled.img`\n object-fit: cover;\n object-position: ${(props: Pick) => `${props.position}`};\n height: 100%;\n width: 100%;\n`;\n","// In order for the ErrorBoundary to be able to catch Graphql errors\n// we need to re-throw the error in the context of the component\n// from the onError callback provided by the Apollo Client.\n\nexport const apolloQueryErrorPropagation = (error: Error): void => {\n if (error) {\n throw error;\n }\n};\n","export interface Tip {\n message: string;\n primaryHeader: string;\n}\n\nexport interface LCAIText {\n alternatePrimaryButtonText?: string;\n endFlowButton?: string;\n primaryHeader?: string;\n placeholder?: string;\n secondaryHeader?: string;\n subheader?: string;\n disclaimer?: string;\n primaryButtonText?: string;\n tips?: Tip[];\n}\n\nexport const TEXT: Record = {\n common: {\n endFlowButton: 'Done',\n },\n error: {\n alternatePrimaryButtonText: 'Contact us',\n primaryHeader: 'Automated estimates are coming soon to your area.',\n subheader: \"Our solar experts will design a system that's perfect for your home.\",\n },\n landing: {\n primaryHeader: 'See solar on your home in minutes.',\n subheader:\n 'Bring solar to life on your home and learn how much you could save with solar in just a few simple steps.',\n },\n profileComplete: {\n primaryButtonText: 'Estimate your savings',\n primaryHeader: \"Thanks, now let's add solar to your home!\",\n subheader:\n 'Our advanced simulation engine is ready to build your home in 3D, automatically place solar panels, and estimate how much energy your house can generate every year.',\n },\n profileReview: {\n primaryHeader: 'Thank you, your profile is being reviewed.',\n subheader: 'If your home is a good fit for solar, a solar expert will reach out to you soon.',\n },\n progress: {\n tips: [\n {\n message:\n \"Solar panels save you money while you own the home, then add value when you're ready to sell. Homes with solar sell for 4.1% more on average than homes without.\",\n primaryHeader: 'Invest in your future',\n },\n {\n message:\n \"Solar is a clean, renewable source of energy that reduces your home's carbon footprint. A typical solar installation can reduce a home's CO2 impact by 6 tons per year.\",\n primaryHeader: 'Help build a better tomorrow',\n },\n {\n message:\n 'Pairing battery storage with solar panels helps ensure your home stays running even during outages, keeping your lights on and your food fresh.',\n primaryHeader: 'Power when you need it most',\n },\n {\n message:\n \"Air conditioning is the largest single contributor to most home's electricity bills. Going solar can help reduce high bills during hot summer months.\",\n primaryHeader: 'Take control over high bills',\n },\n {\n message:\n 'While electricity prices have increased 15% in the last decade, the cost of solar has decreased over 60%.',\n primaryHeader: \"There's never been a better time to go solar\",\n },\n ],\n },\n quote: {\n disclaimer:\n 'By checking the box, I am providing my electronic signature authorizing the company to contact me by email, text, or phone, including an automated technology, at the phone number or email provided above. This consent is not a required condition of purchase.',\n },\n results: {\n primaryButtonText: 'Get a more accurate quote',\n primaryHeader: 'With solar you could save',\n secondaryHeader: \"Here's how solar adds up for your home\",\n },\n};\n"],"names":["DrawerContainer","div","DEFAULT","GRAY_800","DrawerHeader","DrawerButton","DrawerPanel","DrawerValue","icon","text","alignItems","flexDirection","justifyContent","paddingY","fillColor","WHITE","name","size","color","marginLeft","type","Drawer","headerText","items","isDrawerOpen","setIsDrawerOpen","useState","panelItems","map","item","i","intent","DRAWER","onClick","fontWeight","flip","undefined","CARROT","weight","isOpen","defaultOptions","GetLeadCaptureProjectTemplateInfoDocument","CreateLeadCaptureRunDocument","LandingPage","isSDK","projectTemplateId","referrerParams","sourcePage","navigation","analytics","firstDisqualifyingQuestionId","formBeforeResults","customSettings","hasUtilityBillCapture","analyticsTracker","useRef","sent","createRun","baseOptions","options","useCreateLeadCaptureRunMutation","data","loading","useGetLeadCaptureProjectTemplateInfoQuery","onError","variables","id","hasServiceRegionRestrictions","projectTemplate","useEffect","async","identify","company_name","companyName","form_before_results","organization_id","screen_height","window","outerHeight","screen_width","outerWidth","service_region_restrictions","utility_bill_upload","setTimeout","track","LeadCaptureSDKLoaded","current","sendAnalytics","sendOpenedWidgetAnalytic","useCallback","event","LeadCaptureOpenedWidget","reason","onMessageReceivedFromIframe","timerId","setInterval","clearInterval","addEventListener","removeEventListener","handleNext","createRunData","projectId","run","LeadCaptureContinuedFromLandingPage","project_id","navigate","replace","templateId","buttons","PRIMARY_LIGHT","leftContent","landingPageHeader","landing","primaryHeader","landingPageSubHeader","subheader","rightContent","customImage","landingPageImage","LOCATION_PIN","RESIDENTIAL_PROJECT","SYSTEM_DESIGN_FILL","IMAGES","AddressImage","alt","BillUploadImage","position","ComingSoonImage","DropOffImage","LandingImage","ProfileReviewImage","QuoteImage","ThankYouImage","UtilityImage","MAPPED_IMAGES","ADDRESS","ADDRESS_DROP","BILL_UPLOAD","ERROR","GENERIC_DROP","LANDING","OWNERSHIP_DROP","QUOTE","THANK_YOU","UTILITY","Image","children","matchedImage","ImageMatcher","webpSrc","jpgSrc","url","isActive","fallbackUrl","altText","positionAttr","ImageContainer","srcSet","Img","src","img","props","apolloQueryErrorPropagation","error","TEXT","common","endFlowButton","alternatePrimaryButtonText","profileComplete","primaryButtonText","profileReview","progress","tips","message","quote","disclaimer","results","secondaryHeader"],"sourceRoot":""}