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AA,EAAON,OAAAA,CAAO,GAEnE,GAAI,CACA,IAAMyK,EAAS,MAAMC,EAAAA,CAAYA,CAACI,IAAI,CAAU,GAAW7J,MAAA,CAlEnD,aAkEmD,cAAa,CAAEX,MAAAA,EAAON,OAAAA,CAAO,GAGxF,OADAe,EAAAA,CAAMA,CAACC,KAAK,CAAC,GAAcC,MAAA,CAAXrB,EAAW,uBAAsB,CAAE6K,OAAAA,CAAO,GACnDA,CACX,CAAE,MAAO9J,EAAO,CAEZ,MADAI,EAAAA,CAAMA,CAACJ,KAAK,CAAC,GAAcM,MAAA,CAAXrB,EAAW,yBAAwB,CAAEe,MAAAA,CAAM,GACrDA,CACV,CACJ","sources":["webpack://_N_E/./src/layers/presentation/components/ui/SubscriptionForm.tsx","webpack://_N_E/./src/layers/presentation/components/ui/SubscriptionPrompt.tsx","webpack://_N_E/./src/layers/presentation/context/IntercomContext.tsx","webpack://_N_E/./src/layers/presentation/context/NotificationContext.tsx","webpack://_N_E/./src/layers/presentation/hooks/useThrowNotification.ts","webpack://_N_E/./src/layers/presentation/services/providers.ts","webpack://_N_E/./src/layers/presentation/services/sponsors.ts","webpack://_N_E/./src/layers/presentation/services/users.ts"],"sourcesContent":["import { useIntercom } from '@/layers/presentation/context/IntercomContext';\nimport { useTranslation } from '@/layers/presentation/i18n/client';\nimport { subscribeUser } from '@/layers/presentation/services/users';\nimport logger from '@/layers/support/monitoring/logger';\nimport { SubscriptionParams, SubscriptionText } from '@/types/users';\nimport { Button, Checkbox, Input, Link } from '@nextui-org/react';\nimport { useState } from 'react';\n\nconst LOG_MODULE = 'FE [Presentation / Components / SubscriptionForm]';\n\ninterface SubscriptionFormProps {\n text: SubscriptionText;\n params: SubscriptionParams;\n onSubscribeSuccess: () => void;\n}\n\nexport function SubscriptionForm({ text, params, onSubscribeSuccess }: SubscriptionFormProps) {\n const { t } = useTranslation();\n const { getVisitorId } = useIntercom();\n const [email, setEmail] = useState('');\n const [termsAccepted, setTermsAccepted] = useState(false);\n const [error, setError] = useState('');\n const [isSubscribing, setIsSubscribing] = useState(false);\n\n logger.debug(`${LOG_MODULE}`, { params, email, termsAccepted, error, isSubscribing });\n\n const handleSubmit = async (e: React.FormEvent) => {\n const visitorId = await getVisitorId();\n logger.debug(`${LOG_MODULE} handleSubmit`, { e, email, termsAccepted, params, visitorId });\n\n e.preventDefault();\n setError('');\n\n if (!email || !termsAccepted) {\n setError(t('components:subscriptionForm.fillEmailAndAcceptTerms'));\n return;\n }\n\n try {\n setIsSubscribing(true);\n const success = await subscribeUser(email, { ...params, visitorId });\n if (success) {\n onSubscribeSuccess();\n } else {\n setError(t('components:subscriptionForm.subscriptionFailed'));\n }\n } catch (error) {\n logger.error(`${LOG_MODULE} handleSubmit`, { error });\n setError(t('components:subscriptionForm.errorOccurred'));\n } finally {\n setIsSubscribing(false);\n }\n };\n\n return (\n
\n

{text.title}

\n

{text.text}

\n setEmail(e.target.value)}\n required\n />\n \n {t('components:subscriptionForm.agreeTerms')}{' '}\n \n {t('components:subscriptionForm.termsAndConditions')}\n \n \n {error &&

{error}

}\n \n {isSubscribing ? t('components:subscriptionForm.working') : text.button}\n \n \n );\n}\n","import { SubscriptionForm } from '@/layers/presentation/components/ui/SubscriptionForm';\nimport { useGlobalState } from '@/layers/presentation/context/GlobalStateContext';\nimport { useThrowNotification } from '@/layers/presentation/hooks/useThrowNotification';\nimport logger from '@/layers/support/monitoring/logger';\nimport { NotificationType } from '@/types/modelEnums';\nimport { SubscriptionParams, SubscriptionText } from '@/types/users';\nimport { Button, Modal, ModalBody, ModalContent, useDisclosure } from '@nextui-org/react';\nimport React, { createContext, useContext, useState } from 'react';\n\nconst LOG_MODULE = 'FE [Presentation / Components / SubscriptionPrompt]';\n\n// Create context for the subscription modal\ntype SubscriptionModalContextType = {\n openModal: (modal: SubscriptionText, params: SubscriptionParams) => void;\n closeModal: () => void;\n};\n\nconst SubscriptionModalContext = createContext(null);\n\n// Provider component\nexport const SubscriptionModalProvider: React.FC<{ children: React.ReactNode }> = ({\n children,\n}) => {\n const { isOpen, onOpen, onClose } = useDisclosure();\n const throwNotification = useThrowNotification();\n const [modalState, setModalState] = useState<{\n modal: SubscriptionText;\n params: SubscriptionParams;\n } | null>(null);\n\n const openModal = React.useCallback(\n (modal: SubscriptionText, params: SubscriptionParams) => {\n setModalState({ modal, params });\n onOpen();\n },\n [onOpen],\n );\n\n const closeModal = React.useCallback(() => {\n onClose();\n }, [onClose]);\n\n const handleSubscribeSuccess = React.useCallback(() => {\n throwNotification(NotificationType.Success, 'Done! Please check your email inbox.');\n setTimeout(() => {\n onClose();\n }, 1000);\n logger.debug(`${LOG_MODULE} onSubscribeSuccess`);\n }, [throwNotification, onClose]);\n\n // This component will never re-render based on parent components\n const ModalComponent = (\n \n {modalState && (\n \n \n \n \n \n )}\n \n );\n\n return (\n \n {children}\n {ModalComponent}\n \n );\n};\n\n// Hook to use the subscription modal\nexport const useSubscriptionModal = () => {\n const context = useContext(SubscriptionModalContext);\n if (!context) {\n throw new Error('useSubscriptionModal must be used within a SubscriptionModalProvider');\n }\n return context;\n};\n\n// Original component for backwards compatibility\ninterface SubscriptionPromptProps {\n prompt: SubscriptionText;\n modal: SubscriptionText;\n params: SubscriptionParams;\n background?: string;\n}\n\nconst SubscriptionPrompt: React.FC = ({\n prompt,\n modal,\n params,\n background = 'bg-secondary',\n}) => {\n const { user } = useGlobalState();\n const { openModal } = useSubscriptionModal();\n\n if (user) {\n return null;\n }\n\n return (\n
\n
\n
\n

\n {prompt.title}\n

\n

{prompt.text}

\n openModal(modal, params)}\n >\n {prompt.button}\n \n
\n
\n
\n );\n};\n\nexport default SubscriptionPrompt;\n","// context/IntercomContext.tsx\n'use client';\n\nimport logger from '@/layers/support/monitoring/logger';\nimport { IntercomInstance, IntercomSettings } from '@intercom/messenger-js-sdk/dist/types';\nimport React, { createContext, useContext, useEffect } from 'react';\nimport { useGlobalState } from './GlobalStateContext';\n\nconst LOG_MODULE = '[Presentation / Context / Intercom]';\n\ninterface Window {\n intercomSettings?: IntercomSettings;\n Intercom: IntercomInstance | undefined;\n attachEvent: Function;\n}\n\ninterface IntercomContextProps {\n showIntercom: () => void;\n hideIntercom: () => void;\n updateIntercom: (data: Record) => void;\n getVisitorId: () => Promise;\n triggerFeedback: (data: Record) => void;\n}\n\nconst IntercomContext = createContext(undefined);\n\nconst INTERCOM_APP_ID = process.env.NEXT_PUBLIC_INTERCOM_APP_ID;\n\nexport const IntercomProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {\n const { user, profile } = useGlobalState();\n\n useEffect(() => {\n logger.debug(`${LOG_MODULE} IntercomProvider`, { INTERCOM_APP_ID, user, profile });\n\n if (!INTERCOM_APP_ID) {\n console.error('Intercom App ID is not defined');\n return;\n }\n\n loadIntercomScript();\n\n return () => {\n if (typeof window !== 'undefined' && window.Intercom) {\n window.Intercom('shutdown');\n }\n };\n }, [user, profile]);\n\n useEffect(() => {\n if (typeof window === 'undefined' || !window.Intercom) return;\n\n if (user && profile && profile.id) {\n logger.debug(`${LOG_MODULE} updateIntercom`, { user, profile });\n updateIntercom({\n app_id: INTERCOM_APP_ID,\n user_id: profile.id,\n name: profile.id,\n email: user.personal_info?.email,\n created_at: profile.created_at\n ? Math.floor(new Date(profile.created_at).getTime() / 1000)\n : undefined,\n 'User Type': user.type,\n });\n } else {\n updateIntercom({ app_id: INTERCOM_APP_ID });\n }\n }, [user, profile]);\n\n const loadIntercomScript = () => {\n if (document.getElementById('intercom-script')) return;\n\n (function () {\n const w = window as any;\n const ic = w.Intercom;\n if (typeof ic === 'function') {\n ic('reattach_activator');\n ic('update', w.intercomSettings);\n } else {\n const d = document;\n const i = function () {\n i.c(arguments);\n } as any;\n i.q = [];\n i.c = function (args: any) {\n i.q.push(args);\n };\n w.Intercom = i;\n const l = function () {\n const s = d.createElement('script');\n s.type = 'text/javascript';\n s.id = 'intercom-script';\n s.async = true;\n s.src = 'https://widget.intercom.io/widget/' + INTERCOM_APP_ID;\n const x = d.getElementsByTagName('script')[0];\n x.parentNode?.insertBefore(s, x);\n };\n l();\n }\n })();\n };\n\n const getVisitorId = async (): Promise => {\n logger.debug(`${LOG_MODULE} getVisitorId`, { Intercom: window.Intercom });\n if (window.Intercom) {\n const visitorId = window.Intercom('getVisitorId');\n logger.debug(`${LOG_MODULE} Visitor ID`, { visitorId });\n return visitorId;\n } else {\n logger.warn(`${LOG_MODULE} Intercom is not initialized.`);\n return undefined;\n }\n };\n\n const showIntercom = () => {\n if (window.Intercom) {\n window.Intercom('show');\n }\n };\n\n const hideIntercom = () => {\n if (window.Intercom) {\n window.Intercom('hide');\n }\n };\n\n const updateIntercom = (data: Record) => {\n if (window.Intercom) {\n window.Intercom('update', data);\n }\n };\n\n const triggerFeedback = (data: Record) => {\n logger.debug(`${LOG_MODULE} triggerFeedback`, { data });\n\n if (window.Intercom && typeof window.Intercom === 'function') {\n if (!data.elementInfo) {\n logger.error(`${LOG_MODULE} Missing 'elementInfo' in feedback data.`);\n return;\n }\n\n // Construct the message as plain text\n const message =\n `Your comment here: ...\\n\\n` +\n `📄 Text Content:\\n${data.elementInfo.text}\\n\\n` +\n `🛠 Reported Element:\\n` +\n `${data.elementInfo.tag}${data.elementInfo.id ? `#${data.elementInfo.id}` : ''}${data.elementInfo.classes ? `.${data.elementInfo.classes.split(' ').join('.')}` : ''}`;\n\n // Open Intercom messenger with pre-filled message\n showIntercom();\n window.Intercom('showNewMessage', message);\n } else {\n logger.warn(`${LOG_MODULE} Intercom is not initialized.`);\n }\n };\n\n return (\n \n {children}\n \n );\n};\n\nexport const useIntercom = (): IntercomContextProps => {\n const context = useContext(IntercomContext);\n if (context === undefined) {\n throw new Error('useIntercom must be used within an IntercomProvider');\n }\n return context;\n};\n","import React, { createContext, useContext, ReactNode } from 'react';\nimport { ToastContainer, toast, ToastOptions } from 'react-toastify';\nimport logger from '@/layers/support/monitoring/logger';\nimport { NotificationType } from '@/types/modelEnums';\ninterface NotificationContextProps {\n handleNotification: (\n type: NotificationType,\n message: string,\n context?: Record,\n options?: ToastOptions,\n ) => void;\n}\n\nconst NotificationContext = createContext(undefined);\n\nexport const NotificationProvider: React.FC<{ children: ReactNode }> = ({ children }) => {\n const handleNotification = (\n type: NotificationType,\n message: string,\n context: Record = {},\n options?: ToastOptions,\n ) => {\n // Log the notification with context\n logger.info('Global Notification Handler', { type, message, ...context });\n\n // Determine default options if not provided\n const toastOptions: ToastOptions = {\n position: 'bottom-left',\n autoClose: 5000,\n hideProgressBar: false,\n closeOnClick: true,\n pauseOnHover: true,\n draggable: true,\n theme: 'colored',\n ...options,\n };\n\n // Display standard errors\n if (context.error) {\n if (context.error.name === 'ValidationError') {\n toast.warn(context.error.message || 'A validation error occurred.', toastOptions);\n } else if (context.error.name === 'AuthenticationError') {\n toast.error(context.error.message || 'Authentication failed.', toastOptions);\n } else {\n toast.error(context.error.message || 'An unexpected error occurred.', toastOptions);\n }\n\n // Display custom notifications\n } else {\n switch (type) {\n case NotificationType.Info:\n toast.info(message || 'Information.', toastOptions);\n break;\n case NotificationType.Warning:\n toast.warn(message || 'Warning.', toastOptions);\n break;\n case NotificationType.Error:\n toast.error(message || 'An error occurred.', toastOptions);\n break;\n case NotificationType.Success:\n toast.success(message || 'Success!', toastOptions);\n break;\n default:\n toast(message, toastOptions);\n }\n }\n };\n\n return (\n \n {children}\n \n \n );\n};\n\nexport const useNotification = (): NotificationContextProps => {\n const context = useContext(NotificationContext);\n if (!context) {\n throw new Error('useNotification must be used within a NotificationProvider');\n }\n return context;\n};\n","import { useNotification } from '@/layers/presentation/context/NotificationContext';\nimport { ToastOptions } from 'react-toastify';\nimport { NotificationType } from '@/types/modelEnums';\n\nexport const useThrowNotification = () => {\n const { handleNotification } = useNotification();\n\n const throwNotification = (\n type: NotificationType,\n message: string,\n context: Record = {},\n options?: ToastOptions,\n ) => {\n try {\n handleNotification(type, message, context, options);\n } catch (notification) {\n console.error('Error in throwNotification:', notification);\n }\n };\n\n return throwNotification;\n};\n","import logger from '@/layers/support/monitoring/logger';\nimport { NewProviderRequest } from '@/types/providers';\nimport { ProviderProfile } from '@/types/models';\nimport { fetchWrapper } from '../utils/fetchWrapper';\n\nconst LOG_MODULE = 'FE [Presentation / Services / Health Providers]';\n\nconst API_URL = '/api/users/providers';\n\nexport const fetchProviderById = async (id: string): Promise => {\n logger.debug(`${LOG_MODULE} fetchProviderById: begin`, { id });\n\n try {\n const result = await fetchWrapper.get(`${API_URL}/${id}`);\n\n logger.debug(`${LOG_MODULE} fetchProviderById: end`, { result });\n return result;\n } catch (error) {\n logger.error(`${LOG_MODULE} fetchProviderById`, { error });\n throw error;\n }\n};\n\nexport const fetchProviderByUserId = async (id: string): Promise => {\n logger.debug(`${LOG_MODULE} fetchProviderByUserId: begin`, { id });\n\n try {\n const result = await fetchWrapper.get(`${API_URL}/user/${id}`);\n\n logger.debug(`${LOG_MODULE} fetchProviderByUserId: end`, { result });\n return result;\n } catch (error) {\n logger.error(`${LOG_MODULE} fetchProviderByUserId`, { error });\n throw error;\n }\n};\n\nexport const createProvider = async (provider: NewProviderRequest): Promise => {\n logger.debug(`${LOG_MODULE} createProvider: begin`, { provider });\n\n try {\n const result = await fetchWrapper.post(API_URL, provider);\n\n logger.debug(`${LOG_MODULE} createProvider: end`, { result });\n return result;\n } catch (error) {\n logger.error(`${LOG_MODULE} createProvider`, { error });\n throw error;\n }\n};\n\nexport const submitProviderVerification = async (\n providerId: string,\n npi: string,\n): Promise => {\n logger.debug(`${LOG_MODULE} submitProviderVerification: begin`, {\n providerId,\n npi,\n });\n\n try {\n await fetchWrapper.put(`${API_URL}/${providerId}/verify`, { npi });\n } catch (error) {\n logger.error(`${LOG_MODULE} submitProviderVerification`, { error });\n throw error;\n }\n};\n\nexport const updateProviderProfile = async (\n providerId: string,\n data: {\n npi?: string;\n medical_institution?: string;\n personal_info?: {\n first_name?: string;\n last_name?: string;\n };\n meta?: {\n npi?: string;\n medical_institution?: string;\n given_name?: string;\n family_name?: string;\n [key: string]: any;\n };\n },\n): Promise => {\n logger.debug(`${LOG_MODULE} updateProviderProfile: begin`, { providerId, data });\n\n try {\n const result = await fetchWrapper.put(`${API_URL}/${providerId}`, data);\n\n logger.debug(`${LOG_MODULE} updateProviderProfile: end`, { result });\n return result;\n } catch (error) {\n logger.error(`${LOG_MODULE} updateProviderProfile`, { error });\n throw error;\n }\n};\n","import { SponsorProfile } from '@/types/models';\nimport { fetchWrapper } from '../utils/fetchWrapper';\nimport { NewSponsorRequest } from '@/types/sponsors';\nimport logger from '@/layers/support/monitoring/logger';\n\nconst LOG_MODULE = 'FE [Presentation / Services / Sponsors]';\n\nconst API_URL = '/api/users/sponsors';\n\nexport const fetchSponsorByUserId = async (id: string): Promise => {\n logger.debug(`${LOG_MODULE} fetchSponsorByUserId: begin`, { id });\n\n try {\n const result = await fetchWrapper.get(`${API_URL}/user/${id}`);\n\n logger.debug(`${LOG_MODULE} fetchSponsorByUserId: end`, { result });\n return result;\n } catch (error) {\n logger.error(`${LOG_MODULE} fetchSponsorByUserId`, { error });\n throw error;\n }\n};\n\nexport const createSponsor = async (sponsor: NewSponsorRequest): Promise => {\n logger.debug(`${LOG_MODULE} createSponsor: begin`, { sponsor });\n\n try {\n const result = await fetchWrapper.post(API_URL, sponsor);\n\n logger.debug(`${LOG_MODULE} createSponsor: end`, { result });\n return result;\n } catch (error) {\n logger.error(`${LOG_MODULE} createSponsor`, { error });\n throw error;\n }\n};\n","import { ValidProfiles } from '@/types/models';\nimport logger from '@/layers/support/monitoring/logger';\nimport { UserType } from '@/types/modelEnums';\nimport { fetchProviderByUserId, createProvider } from './providers';\nimport { createSponsor, fetchSponsorByUserId } from './sponsors';\nimport { fetchWrapper } from '../utils/fetchWrapper';\nimport { SubscriptionParams } from '@/types/users';\nimport { createPatientByUserId } from './patients';\nimport { fetchPatientByUserId } from './patients';\n\nconst API_URL = '/api/users';\nconst LOG_MODULE = 'FE [Presentation / Services / users]';\n\nexport const getProfile = async (\n userId: string,\n userType: UserType,\n): Promise => {\n logger.debug(`${LOG_MODULE} getProfile: begin`, { userId, userType });\n\n try {\n let profile: ValidProfiles | null = null;\n\n switch (userType) {\n case UserType.PROVIDER:\n profile = await fetchProviderByUserId(userId);\n if (!profile) {\n profile = await createProvider({ user_id: userId });\n }\n break;\n\n case UserType.PATIENT:\n profile = await fetchPatientByUserId(userId);\n if (!profile) {\n profile = await createPatientByUserId({ user_id: userId });\n }\n break;\n\n case UserType.SPONSOR:\n profile = await fetchSponsorByUserId(userId);\n if (!profile) {\n profile = await createSponsor({ user_id: userId });\n }\n break;\n\n // Add cases for other profile types as needed\n default:\n throw new Error(`Unsupported user type: ${userType}`);\n }\n\n profile = enhanceProfileWithType(profile, userType);\n\n logger.debug(`${LOG_MODULE} getProfile: end`, { profile });\n return profile;\n } catch (error) {\n logger.error(`${LOG_MODULE} getProfile`, { error });\n throw error;\n }\n};\n\n/**\n * Enhances a raw profile object with the specified UserType.\n * @param profile - The raw profile object fetched from the backend.\n * @param type - The UserType to assign to the profile.\n * @returns The profile object augmented with the type property.\n */\nconst enhanceProfileWithType = (profile: T, type: UserType): T & { type: UserType } => {\n return { ...profile, type };\n};\n\nexport const subscribeUser = async (\n email: string,\n params: SubscriptionParams,\n): Promise => {\n logger.debug(`${LOG_MODULE} subscribeUser: begin`, { email, params });\n\n try {\n const result = await fetchWrapper.post(`${API_URL}/subscribe`, { email, params });\n\n logger.debug(`${LOG_MODULE} subscribeUser: end`, { result });\n return result;\n } catch (error) {\n logger.error(`${LOG_MODULE} subscribeUser: error`, { error });\n throw error;\n }\n};\n"],"names":["LOG_MODULE","SubscriptionForm","param","text","params","onSubscribeSuccess","t","useTranslation","getVisitorId","useIntercom","email","setEmail","useState","termsAccepted","setTermsAccepted","error","setError","isSubscribing","setIsSubscribing","logger","debug","concat","handleSubmit","e","visitorId","preventDefault","subscribeUser","react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__","jsxs","form","onSubmit","className","jsx","h2","title","p","Input","type","label","value","onChange","target","required","Checkbox","isSelected","onValueChange","Link","href","Button","size","color","isDisabled","isLoading","button","SubscriptionModalContext","createContext","SubscriptionModalProvider","children","isOpen","onOpen","onClose","useDisclosure","throwNotification","useThrowNotification","modalState","setModalState","openModal","React","modal","closeModal","handleSubscribeSuccess","NotificationType","Success","setTimeout","ModalComponent","Modal","classNames","base","body","ModalContent","ModalBody","Provider","useSubscriptionModal","context","useContext","__webpack_exports__","ZP","prompt","background","user","useGlobalState","section","div","h3","radius","onPress","IntercomContext","undefined","INTERCOM_APP_ID","process","IntercomProvider","profile","useEffect","console","loadIntercomScript","window","Intercom","id","updateIntercom","app_id","user_id","name","personal_info","created_at","Math","floor","Date","getTime","document","getElementById","w","ic","intercomSettings","d","i","c","arguments","q","args","push","l","x","s","createElement","async","src","getElementsByTagName","parentNode","insertBefore","warn","showIntercom","data","hideIntercom","triggerFeedback","elementInfo","message","tag","classes","split","join","NotificationContext","NotificationProvider","handleNotification","options","info","toastOptions","position","autoClose","hideProgressBar","closeOnClick","pauseOnHover","draggable","theme","toast","Info","Warning","Error","success","ToastContainer","useNotification","notification","API_URL","fetchProviderByUserId","result","fetchWrapper","get","createProvider","provider","post","submitProviderVerification","providerId","npi","put","updateProviderProfile","fetchSponsorByUserId","createSponsor","sponsor","getProfile","userId","userType","UserType","PROVIDER","PATIENT","fetchPatientByUserId","createPatientByUserId","SPONSOR","enhanceProfileWithType"],"sourceRoot":""}