{"version":3,"sources":["libs/conversation/core/src/lib/conversation.constants.ts","libs/conversation/core/src/lib/inbox-utils.ts","libs/conversation/core/src/lib/inbox.constants.ts","libs/conversation/core/src/lib/participant-utils.ts","libs/conversation/core/src/lib/participant.service.ts","libs/conversation/core/src/lib/inbox.service.ts","libs/conversation/core/src/lib/channels/conversation-channel.abstract.ts","libs/conversation/core/src/lib/channels/conversation-facebook.service.ts","node_modules/@vendasta/google-my-business/fesm2020/vendasta-google-my-business.mjs","libs/conversation/core/src/lib/channels/conversation-google.service.ts","libs/conversation/core/src/lib/channels/conversation-sms.service.ts","libs/conversation/core/src/lib/channels/conversation-webchat.service.ts","libs/conversation/core/src/lib/conversation-utils.ts","libs/conversation/core/src/lib/firestore.service.ts","libs/conversation/core/src/lib/interface/conversation.interface.ts","libs/conversation/core/src/lib/message-utils.ts","libs/conversation/core/src/lib/conversation.service.ts","libs/conversation/core/src/lib/firebase.config.ts","libs/conversation/core/src/lib/view-mode.service.ts","libs/conversation/core/src/lib/inbox-navigation.service.ts","libs/conversation/core/src/lib/inbox-notification.service.ts","node_modules/@vendasta/customer-voice-service/fesm2020/vendasta-customer-voice-service.mjs","libs/conversation/core/src/lib/listing.service.ts","libs/conversation/core/src/lib/view.service.ts","libs/conversation/core/src/lib/conversation-core.module.ts","libs/conversation/core/src/lib/conversation-list.service.ts","libs/conversation/core/src/lib/inbox-terms-of-service.service.ts","libs/conversation/core/src/lib/interface/config.interface.ts","libs/conversation/core/src/lib/interface/host-app.interface.ts","libs/conversation/core/src/lib/interface/inbox.interface.ts","libs/conversation/core/src/lib/interface/routes.interface.ts","libs/conversation/core/src/lib/types.ts","libs/conversation/core/src/index.ts"],"sourcesContent":["import { Timestamp } from 'firebase/firestore';\nimport { ConversationChannel } from '@vendasta/conversation';\n\nexport const PAGE_SIZE = 20;\nexport const FIRESTORE_MESSAGE_LIMIT = 20;\nexport const FIRESTORE_CONVERSATION_LIMIT = 20;\nexport const INBOX = 'Inbox';\nexport const DELETED_TIMESTAMP_FIRESTORE = new Timestamp(10800, 0);\n// List of United States territories that are excluded from SMS feature\n// [Armed Forces Americas, Armed Forces Europe, Armed Forces Pacific, American Samoa, Micronesia, Guam, Marshall Islands, Northern Mariana Islands, Puerto Rico, Palau, U.S. Virgin Islands]\nexport const MARKETING_SERVICES_PIDS = ['VMKS', 'VMKA', 'VMKW', 'VMKV'];\nexport const SUPPORT_PID = 'VMF';\n\nexport const MAX_FILES = 1;\nexport const MAX_RECORDING_TIME = 60000;\n\nexport const POSTHOG_CHANNEL_NAME = new Map([\n [ConversationChannel.CONVERSATION_CHANNEL_UNDEFINED, 'undefined'],\n [ConversationChannel.CONVERSATION_CHANNEL_INTERNAL, 'platform'],\n [ConversationChannel.CONVERSATION_CHANNEL_SMS, 'sms'],\n [ConversationChannel.CONVERSATION_CHANNEL_FACEBOOK, 'facebook'],\n [ConversationChannel.CONVERSATION_CHANNEL_GOOGLE_MESSAGES, 'google_messages'],\n [ConversationChannel.CONVERSATION_CHANNEL_OPENAI, 'openai'],\n [ConversationChannel.CONVERSATION_CHANNEL_EMAIL, 'email'],\n [ConversationChannel.CONVERSATION_CHANNEL_GOOGLE_BUSINESS_COMMUNICATIONS, 'google_business_communications'],\n [ConversationChannel.CONVERSATION_CHANNEL_WEB_CHAT, 'webchat'],\n]);\n","/**\n * check if the window view port reach out the max width query\n * @return {boolean}\n */\nexport function isMobile(): boolean {\n return window.matchMedia('(max-width:600px)').matches;\n}\n\n/**\n * check if the window view port reach out the max width query\n * @return {boolean}\n */\nexport function isWideScreen(): boolean {\n return window.matchMedia('(max-width:1440px)').matches;\n}\n","import { Environment } from '@galaxy/core';\nexport const IAMUserPrefix = 'U-'; // Unified User ID\nexport const AccountGroupPrefix = 'AG-';\n\nexport const CustomerPrefix = 'CUSTOMER-';\nexport const ContactPrefix = 'CONTACT-';\n\nexport const PCLearnMoreUrl = 'https://support.vendasta.com/hc/en-us/articles/6926511028887/';\n\nexport const GOOGLE_SOURCE_ID = '10010';\nexport const FACEBOOK_SOURCE_ID = '10050';\n\nexport const LOCAL_STORAGE_ID = 'inbox-last-channel-id';\n\nexport const EXCLUDED_GEOGRAPHICAL_US_STATES = ['AA', 'AE', 'AP', 'AS', 'FM', 'GU', 'MH', 'MP', 'PR', 'PW', 'VI'];\n\nexport const DEFAULT_CV_ICON = 'https://vstatic-prod.apigateway.co/business-center-client.9223372035143138814.prod/assets/cv-logo.png';\nexport const DEFAULT_CV_NAME = 'Customer Voice';\nexport const CustomerVoiceAppIDs = {\n [Environment.LOCAL]: 'MP-fba21121b71148c9bb33e11fcd92d520',\n [Environment.TEST]: 'MP-fba21121b71148c9bb33e11fcd92d520',\n [Environment.DEMO]: 'MP-fba21121b71148c9bb33e11fcd92d520',\n [Environment.PROD]: 'MP-c4974d390a044c28aec31e421aa662b2',\n};\n\nexport const REPLACE_NAME_WITH_PHONE_PLACEHOLDER = '-';\n\nexport const INVALID_CONTACT_NAMES = [undefined, null, REPLACE_NAME_WITH_PHONE_PLACEHOLDER, '- -', ''];\n\n// Used as a placeholder / fallback name\nexport const DEFAULT_OPENAI_BOT_NAME = 'Automated Assistant';\nexport const DEFAULT_WEBCHAT_BOT_NAME = DEFAULT_OPENAI_BOT_NAME;\n\nexport const CONTACTS_PAGE_SIZE = 5;\nexport const TEMPLATES_PAGE_SIZE = 20;\n\n// default view id for follow DefaultViewID\nexport const FOLLOWING_VIEW_ID = 'following';\nexport const ALL_VIEW_ID = 'all';\n\n// feature flag ids\nexport const SMB_MESSAGE_PARTNER_FEATURE = 'inbox_smb_message_partner';\nexport const INBOX_OPEN_DEFAULT = 'inbox_open_default';\nexport const INBOX_SMS_A2P = 'inbox_sms_a2p';\nexport const WEBCHAT_SETTING_CARD = 'web_chat_setting_card';\nexport const WEB_CHAT_FOR_PARTNER_INBOX = 'web_chat_for_partner_inbox';\nexport const MESSAGE_TEMPLATE_CARD = 'inbox_template_card';\nexport const INBOX_EMAIL = 'inbox_email';\nexport const CONVERSATION_SUMMARY = 'conversation_summary';\n\nexport const NEW_INBOX_TAB = 'new_inbox';\n\n// TODO: Use CRM SDK provided constants when available (CRMAAS-355 + MEGA-221)\nexport const STANDARD_CRM_FIELD_EXTERNAL_IDS = {\n firstName: 'standard__first_name',\n lastName: 'standard__last_name',\n phoneNumber: 'standard__phone_number',\n email: 'standard__email',\n updated: 'system__contact_updated',\n created: 'system__contact_created',\n tags: 'standard__tags',\n source: 'standard__contact_source_name',\n};\n\nexport type AppOptionsKeys = 'is_multilocation';\n\nexport const INBOX_CRM_SOURCE_NAME = 'Inbox';\n","import { GlobalParticipantType, NamespaceDetail, Participant, ParticipantType } from '@vendasta/conversation';\nimport { CrmObject, FieldValue } from '@vendasta/crm';\nimport { INBOX_CRM_SOURCE_NAME, STANDARD_CRM_FIELD_EXTERNAL_IDS } from './inbox.constants';\nimport { ConversationAvailableChannels, ConversationDetail } from './interface/conversation.interface';\nimport { InboxContact } from './interface/inbox.interface';\n\nexport function getSubjectParticipantByType(participants: Participant[], type: ParticipantType): Participant | null {\n return (\n participants?.find((participant) => participant?.isSubjectParticipant && participant?.participantType === type) ??\n null\n );\n}\n\n/**\n * isSameParticipant returns true if the target participant is the same based on the fields that makes a participant unique\n * @param userId\n * @param partnerId\n * @param accountGroupId\n * @param {Participant} targetParticipant\n * @returns {boolean}\n */\nexport function isSameParticipant(\n userId: string,\n partnerId: string,\n accountGroupId: string,\n targetParticipant: Participant,\n): boolean {\n return (\n targetParticipant?.internalParticipantId === userId &&\n targetParticipant?.partnerId === partnerId &&\n targetParticipant?.accountGroupId === accountGroupId\n );\n}\n\n/** Create a map of contact fields, using fieldID as key\n * @param {CrmObject} customerFields - contactFields\n * @return {Map} - Map of contact fields\n */\nexport function createContactFieldMap(contactFields: CrmObject): Map {\n const contactFieldMap = new Map();\n contactFields.fields.forEach((field) => {\n if (field?.fieldId) contactFieldMap.set(field.externalId, field);\n });\n return contactFieldMap;\n}\n\n/** Return an InboxContact object from CrmObject\n * @param {string} accountGroupId - accountGroupId\n * @param {CrmObject} contactFields - accountGroupId\n * @return {InboxContact} - Inbox Contact object\n */\nexport function getInboxContactFromCrm(accountGroupId: string, contactFields: CrmObject): InboxContact {\n const contactFieldMap = createContactFieldMap(contactFields);\n const inboxContact: InboxContact = {\n contactId: contactFields.crmObjectId,\n firstName: contactFieldMap.get(STANDARD_CRM_FIELD_EXTERNAL_IDS.firstName)?.stringValue ?? '',\n lastName: contactFieldMap.get(STANDARD_CRM_FIELD_EXTERNAL_IDS.lastName)?.stringValue ?? '',\n email: contactFieldMap.get(STANDARD_CRM_FIELD_EXTERNAL_IDS.email)?.stringValue ?? '',\n phone: contactFieldMap.get(STANDARD_CRM_FIELD_EXTERNAL_IDS.phoneNumber)?.stringValue ?? '',\n permissionToContact: true, //TODO (MEGA-221): hydrate this field when CRM service support it or delete it if not needed\n accountGroupId: accountGroupId,\n };\n return inboxContact;\n}\n\nexport function createCrmField(fieldName: string, stringValue: string): FieldValue | null {\n if (!fieldName || !stringValue) return null;\n return {\n externalId: fieldName,\n stringValue: stringValue,\n } as FieldValue;\n}\n\nexport function buildCrmFieldsForCreateContact(inboxContact: InboxContact): FieldValue[] {\n const object = [\n createCrmField(STANDARD_CRM_FIELD_EXTERNAL_IDS.firstName, inboxContact?.firstName),\n createCrmField(STANDARD_CRM_FIELD_EXTERNAL_IDS.lastName, inboxContact?.lastName),\n createCrmField(STANDARD_CRM_FIELD_EXTERNAL_IDS.phoneNumber, inboxContact?.phone),\n createCrmField(STANDARD_CRM_FIELD_EXTERNAL_IDS.email, inboxContact?.email),\n createCrmField(STANDARD_CRM_FIELD_EXTERNAL_IDS.source, INBOX_CRM_SOURCE_NAME),\n ].filter((field) => !!field);\n return object;\n}\n\n/**\n * Checks if the contact information is missing\n * @param {ConversationDetail} conversationDetail - Conversation Detail information\n * @param {ConversationAvailableChannels} availableChannels - Conversation Available Channels\n * @return {boolean}\n */\nexport function isContactInformationMissing(\n conversationDetail: ConversationDetail,\n availableChannels: ConversationAvailableChannels,\n): boolean {\n if (!conversationDetail?.conversation) return false;\n\n const recipients = conversationDetail?.participants\n ?.filter((p) => p.isSubjectParticipant && p.internalParticipantId)\n .filter((participant) => participant.participantType === ParticipantType.PARTICIPANT_TYPE_CUSTOMER);\n\n if (recipients?.length === 0) return false;\n\n const contactParticipant = conversationDetail?.participants?.find(\n (participant) => participant?.internalParticipantId === recipients[0].internalParticipantId,\n );\n\n return (\n !contactParticipant?.phoneNumber && !contactParticipant?.email && !availableChannels?.availableChannels?.length\n );\n}\n\n/**\n * Checks if the NamespaceDetail information used for describe participant hierarchy contains a participantType\n * @param {NamespaceDetail[]} hierarchy - Participant Hierarchy\n * @param {GlobalParticipantType} participantType - Participant Type\n * @return {boolean}\n */\nexport function isSubjectParticipantInHierarchy(\n hierarchy: NamespaceDetail[],\n participantType: GlobalParticipantType,\n): boolean {\n if (!hierarchy || !hierarchy.length) return false;\n return hierarchy.some((namespace) => namespace.participantType === participantType);\n}\n","import { Inject, Injectable, OnDestroy } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { PAGE_ROUTES } from '@galaxy/crm/static';\nimport {\n ConversationApiService,\n ConversationChannel,\n GetMultiParticipantsRequest,\n GetMultiParticipantsResponse,\n GetParticipantsByKeyRequest,\n GetParticipantsByKeyResponse,\n GlobalParticipantType,\n Participant,\n ParticipantKey,\n ParticipantType,\n NamespaceDetail,\n} from '@vendasta/conversation';\nimport {\n CRMApiService,\n CreateCrmObjectRequest,\n CreateCrmObjectResponse,\n CrmObject,\n CrmObjectSearch,\n ListCrmObjectsRequest,\n} from '@vendasta/crm';\nimport { SnackbarService } from '@vendasta/galaxy/snackbar-service';\nimport {\n BehaviorSubject,\n EMPTY,\n Observable,\n Subject,\n catchError,\n combineLatest,\n defaultIfEmpty,\n firstValueFrom,\n map,\n of,\n shareReplay,\n switchMap,\n take,\n} from 'rxjs';\nimport { CONTACTS_PAGE_SIZE } from './inbox.constants';\nimport { InboxContact } from './interface/inbox.interface';\nimport { buildCrmFieldsForCreateContact, getInboxContactFromCrm } from './participant-utils';\nimport { ACCOUNT_GROUP_ID_TOKEN, GROUP_ID_TOKEN, PARTNER_ID_TOKEN, USER_ID_TOKEN } from './tokens';\n\nexport class ParticipantBuilder {\n private readonly participant: Participant;\n constructor() {\n this.participant = new Participant();\n }\n\n partnerId(partnerId: string): ParticipantBuilder {\n this.participant.partnerId = partnerId;\n return this;\n }\n\n accountGroupId(accountGroupId: string): ParticipantBuilder {\n this.participant.accountGroupId = accountGroupId;\n return this;\n }\n\n channel(channel: ConversationChannel): ParticipantBuilder {\n this.participant.channel = channel;\n return this;\n }\n\n participantType(participantType: ParticipantType): ParticipantBuilder {\n this.participant.participantType = participantType;\n return this;\n }\n\n internalParticipantId(internalParticipantId: string): ParticipantBuilder {\n this.participant.internalParticipantId = internalParticipantId;\n return this;\n }\n\n isSubjectParticipant(isSubjectParticipant: boolean): ParticipantBuilder {\n this.participant.isSubjectParticipant = isSubjectParticipant;\n return this;\n }\n\n build(): Participant {\n return this.participant;\n }\n}\n\n@Injectable()\nexport class ParticipantService implements OnDestroy {\n constructor(\n @Inject(USER_ID_TOKEN) readonly userId$: Observable,\n @Inject(PARTNER_ID_TOKEN) readonly partnerId$: Observable,\n @Inject(ACCOUNT_GROUP_ID_TOKEN) readonly accountGroupId$: Observable,\n @Inject(GROUP_ID_TOKEN) readonly groupId$: Observable,\n private conversationApiService: ConversationApiService,\n private crmService: CRMApiService,\n private readonly snackbarService: SnackbarService,\n private readonly router: Router,\n ) {}\n private unsubscribe$ = new Subject();\n private contacts$$: BehaviorSubject> = new BehaviorSubject([]);\n\n readonly participantDetails$ = combineLatest([\n this.partnerId$,\n this.accountGroupId$,\n this.userId$,\n this.groupId$,\n ]).pipe(\n map(([partnerId, accountGroupId, userId, groupId]) => {\n return {\n partnerId: partnerId ?? '',\n accountGroupId: accountGroupId ?? '',\n userId: userId ?? '',\n groupId: groupId ?? '',\n };\n }),\n );\n\n readonly currentParticipant$: Observable = this.participantDetails$.pipe(\n switchMap((details) => this.getParticipant(details)),\n shareReplay({ bufferSize: 1, refCount: true }),\n );\n\n public contacts$ = this.contacts$$.asObservable();\n ngOnDestroy(): void {\n this.unsubscribe$.next();\n this.unsubscribe$.complete();\n }\n\n getParticipant(participantDetails: {\n userId: string;\n partnerId: string;\n accountGroupId: string;\n groupId?: string;\n }): Observable {\n const participantKey = {\n internalParticipantId: participantDetails.userId,\n partnerId: participantDetails.partnerId ?? '',\n accountGroupId: participantDetails.accountGroupId ?? '',\n participantType: GlobalParticipantType.GLOBAL_PARTICIPANT_TYPE_IAM_USER,\n namespaceHierarchy: this.buildNamespaceHierarchy(\n participantDetails.partnerId,\n participantDetails.accountGroupId,\n participantDetails.groupId,\n ),\n } as ParticipantKey;\n return this.getParticipantsByKey(participantKey).pipe(\n catchError((err) => {\n console.error(err);\n return EMPTY;\n }),\n map((resp) => {\n return resp?.participant;\n }),\n defaultIfEmpty({} as Participant),\n shareReplay({ bufferSize: 1, refCount: true }),\n );\n }\n\n // buildNamespaceHierarchy is a helper function to build the namespace hierarchy for a participant\n buildNamespaceHierarchy(partnerId: string, accountGroupId: string, groupId?: string): NamespaceDetail[] {\n const namespaceHierarchy = [\n new NamespaceDetail({\n participantType: GlobalParticipantType.GLOBAL_PARTICIPANT_TYPE_PARTNER,\n internalParticipantId: partnerId,\n }),\n ];\n\n // either group or account group will be set.\n if (groupId) {\n namespaceHierarchy.push(\n new NamespaceDetail({\n participantType: GlobalParticipantType.GLOBAL_PARTICIPANT_TYPE_GROUP,\n internalParticipantId: groupId,\n }),\n );\n } else if (accountGroupId) {\n namespaceHierarchy.push(\n new NamespaceDetail({\n participantType: GlobalParticipantType.GLOBAL_PARTICIPANT_TYPE_ACCOUNT_GROUP,\n internalParticipantId: accountGroupId,\n }),\n );\n }\n return namespaceHierarchy;\n }\n\n buildIAMUserParticipant(channel: ConversationChannel, isSubjectParticipant?: boolean): Observable {\n return combineLatest([this.partnerId$, this.accountGroupId$, this.userId$]).pipe(\n map(([partnerId, accountGroupId, userId]) => {\n return this.buildIamUser(partnerId, accountGroupId, userId, channel, isSubjectParticipant);\n }),\n );\n }\n\n public buildIamUser(\n partnerId: string,\n accountGroupId: string,\n userId: string,\n channel: ConversationChannel,\n isSubjectParticipant?: boolean,\n ): Participant {\n return accountGroupId\n ? new ParticipantBuilder()\n .partnerId(partnerId)\n .accountGroupId(accountGroupId)\n .channel(channel)\n .participantType(ParticipantType.PARTICIPANT_TYPE_IAM_USER)\n .internalParticipantId(userId)\n .isSubjectParticipant(isSubjectParticipant ?? false)\n .build()\n : new ParticipantBuilder()\n .partnerId(partnerId)\n .channel(channel)\n .participantType(ParticipantType.PARTICIPANT_TYPE_IAM_USER)\n .internalParticipantId(userId)\n .isSubjectParticipant(isSubjectParticipant ?? false)\n .build();\n }\n\n public buildAccountGroup(partnerId: string, accountGroupId: string, channel: ConversationChannel): Participant {\n return new ParticipantBuilder()\n .partnerId(partnerId)\n .accountGroupId(accountGroupId)\n .channel(channel)\n .participantType(ParticipantType.PARTICIPANT_TYPE_ACCOUNT_GROUP)\n .internalParticipantId('')\n .isSubjectParticipant(true)\n .build();\n }\n\n public buildPartner(partnerId: string, channel: ConversationChannel): Participant {\n return new ParticipantBuilder()\n .partnerId(partnerId)\n .channel(channel)\n .participantType(ParticipantType.PARTICIPANT_TYPE_PARTNER)\n .internalParticipantId('')\n .isSubjectParticipant(true)\n .build();\n }\n\n public buildVendor(vendorId: string, channel: ConversationChannel): Participant {\n return new ParticipantBuilder()\n .partnerId(vendorId)\n .channel(channel)\n .participantType(ParticipantType.PARTICIPANT_TYPE_VENDOR)\n .internalParticipantId('')\n .isSubjectParticipant(true)\n .build();\n }\n\n public addContact(contact: InboxContact): Observable {\n if (!contact) return of({} as InboxContact);\n return this.createCrmContact(contact);\n }\n\n private createCrmContact(contact: InboxContact): Observable {\n return this.crmService\n .createContact({\n namespace: contact.accountGroupId,\n crmObject: {\n fields: buildCrmFieldsForCreateContact(contact),\n },\n } as CreateCrmObjectRequest)\n .pipe(\n map((crmObjectResponse: CreateCrmObjectResponse) => {\n contact.contactId = crmObjectResponse?.crmObjectId;\n return contact;\n }),\n );\n }\n\n public searchContacts(term: string, accountGroupId: string): void {\n if (term?.length <= 2) {\n this.contacts$$.next([] as Array);\n return;\n }\n\n this.getContactsFromCrmService(accountGroupId, term)\n .pipe(take(1))\n .subscribe((contactList) => {\n this.contacts$$.next(contactList);\n });\n }\n\n /**\n * Get contact list from CRM Service\n * @param {string} accountGroupId - accountGroupId\n * @param {string} term - search term\n * @return {Observable>} - Inbox Contact list observable\n */\n private getContactsFromCrmService(accountGroupId: string, term: string): Observable> {\n return this.crmService\n .listContacts({\n namespace: accountGroupId,\n search: { searchTerm: term } as CrmObjectSearch,\n pagingOptions: {\n pageSize: CONTACTS_PAGE_SIZE,\n },\n } as ListCrmObjectsRequest)\n .pipe(\n map((response) =>\n response?.crmObjects\n ?.filter((contact) => !!contact)\n .map((contact: CrmObject) => getInboxContactFromCrm(accountGroupId, contact)),\n ),\n catchError(() => of([] as Array)),\n );\n }\n\n /**\n * get multi participants from the Conversation µs\n * @param {string[]} participantIds - the participant IDs\n * @return {Observable}\n */\n public getMultiParticipants(\n participantIds: string[],\n conversationId: string,\n ): Observable {\n if (!participantIds || participantIds.length === 0) {\n console.error('the participantIds is not valid');\n return of({ participants: [] as Participant[] } as GetMultiParticipantsResponse);\n }\n\n const req = {\n conversationId: conversationId,\n participantIds: participantIds,\n } as GetMultiParticipantsRequest;\n return this.conversationApiService.getMultiParticipants(req).pipe(\n catchError((err) => {\n console.error('getMultiParticipants error:', err?.message);\n return of({} as GetMultiParticipantsResponse);\n }),\n );\n }\n\n /**\n * get participants by key from the Conversation µs\n */\n public getParticipantsByKey(participantKeyInfo: ParticipantKey): Observable {\n const req = {\n participantKey: participantKeyInfo,\n } as GetParticipantsByKeyRequest;\n\n return this.conversationApiService.getParticipantsByKey(req);\n }\n\n organizationId$ = combineLatest([this.partnerId$, this.accountGroupId$]).pipe(\n map(([partnerId, accountGroupId]) => {\n return accountGroupId || partnerId;\n }),\n );\n\n //TODO: (MEGA-433) Improve inbox logic to get hydrated participant information from getMultiConversationDetail participants\n // instead of subjectParticipants. This will allow us to remove unnecessary conversation Id argument.\n /**\n * View recipient contact information\n * @param contactId - contact ID\n * @param participantType - Firestore Participant Type\n * @param conversationId - Conversation ID\n */\n async viewContact(\n contactId: string,\n participantType: ParticipantType,\n conversationId: string,\n firestoreDocId?: string,\n ): Promise {\n if (!contactId || !participantType) {\n this.snackbarService.openErrorSnack('INBOX.TOPBAR.ERROR_LOADING_RECIPIENT');\n return;\n }\n\n const accountGroupId = await firstValueFrom(this.accountGroupId$);\n\n const returnUrl = `/account/location/${accountGroupId}/inbox/channel/${firestoreDocId}`;\n const routeTemplate = `/account/location/${accountGroupId}/crm/${PAGE_ROUTES.CONTACT.ROOT}/${PAGE_ROUTES.CONTACT.SUBROUTES.PROFILE}`;\n this.router.navigate([routeTemplate.replace(':crmObjectId', contactId)], {\n queryParams: { returnUrl: returnUrl },\n });\n }\n}\n","import { Inject, inject, Injectable, OnDestroy } from '@angular/core';\nimport { FeatureFlagService } from '@galaxy/partner';\nimport { AddressAPIService } from '@vendasta/address';\nimport { GlobalParticipantType, InboxApiService, PlatformLocation } from '@vendasta/conversation';\nimport { IAMService, Role, UserIdentifier } from '@vendasta/iamv2';\nimport {\n catchError,\n combineLatest,\n distinctUntilChanged,\n firstValueFrom,\n map,\n Observable,\n of,\n shareReplay,\n Subject,\n switchMap,\n take,\n} from 'rxjs';\nimport { MARKETING_SERVICES_PIDS } from './conversation.constants';\nimport { isWideScreen } from './inbox-utils';\nimport {\n CONVERSATION_SUMMARY,\n EXCLUDED_GEOGRAPHICAL_US_STATES,\n INBOX_EMAIL,\n INBOX_OPEN_DEFAULT,\n INBOX_SMS_A2P,\n MESSAGE_TEMPLATE_CARD,\n WEB_CHAT_FOR_PARTNER_INBOX,\n WEBCHAT_SETTING_CARD,\n} from './inbox.constants';\nimport {\n ACCOUNT_GROUP_ID_TOKEN,\n CONVERSATION_CONFIG_TOKEN,\n CONVERSATION_COUNTRY_TOKEN,\n CONVERSATION_GEOGRAPHICAL_STATE_TOKEN,\n CONVERSATION_GOOGLE_BUSINESS_MESSAGES_AVAILABLE_TOKEN,\n CONVERSATION_PLATFORM_LOCATION_TOKEN,\n CONVERSATION_SMS_ENABLED_TOKEN,\n CONVERSATION_WEB_CHAT_ENABLED_TOKEN,\n FEATURE_FLAG_TOKEN,\n PARTNER_ID_TOKEN,\n USER_ID_TOKEN,\n GROUP_ID_TOKEN,\n} from './tokens';\nimport { GetAccountInfoResponse, ParticipantType, SmsService } from '@vendasta/smsv2';\nimport { HttpErrorResponse } from '@angular/common/http';\nimport { ParticipantService } from './participant.service';\n\nconst isSuperAdminFn = (partner: Role): boolean => !!partner?.attributes.attributes['is_super_admin']?.boolAttribute;\n\n@Injectable()\nexport class InboxService implements OnDestroy {\n private readonly unsubscribe$$ = new Subject();\n private readonly smsService = this.isBusinessApp ? inject(SmsService) : null;\n\n readonly iamUser$ = this.userId$.pipe(\n switchMap((userId) => this.iamService.getUser({ userId: userId } as UserIdentifier)),\n );\n\n readonly canAccessEmbeddedSettings$ = combineLatest([this.iamUser$, this.partnerId$]).pipe(\n map(([user, currentPartnerId]) => {\n if (!this.isPartnerCenter) return false;\n const { partnerId: userPartnerID, roles: { partner } = {} } = user;\n const isSuperAdmin = isSuperAdminFn(partner);\n return (currentPartnerId === userPartnerID && !!partner) || isSuperAdmin;\n }),\n shareReplay(1),\n );\n\n readonly showAvailabilityMessageSettings$ = combineLatest([this.iamUser$, this.partnerId$]).pipe(\n map(([user, currentPartnerId]) => {\n const { partnerId: userPartnerID, roles: { partner } = {} } = user;\n const isSuperAdmin = isSuperAdminFn(partner);\n return (\n ((currentPartnerId === userPartnerID && !!partner) || isSuperAdmin) &&\n MARKETING_SERVICES_PIDS.includes(currentPartnerId)\n );\n }),\n shareReplay(1),\n );\n\n private readonly featureFlags$ = this.partnerId$.pipe(\n switchMap((partnerId) => {\n return this.featureFlagService\n .batchGetStatus(partnerId, '', [\n INBOX_OPEN_DEFAULT,\n INBOX_SMS_A2P,\n WEBCHAT_SETTING_CARD,\n MESSAGE_TEMPLATE_CARD,\n WEB_CHAT_FOR_PARTNER_INBOX,\n INBOX_EMAIL,\n CONVERSATION_SUMMARY,\n ])\n .pipe(take(1), shareReplay(1));\n }),\n );\n\n readonly isConversationSummaryEnabled$ = this.featureFlags$.pipe(\n map((res) => res[CONVERSATION_SUMMARY]),\n distinctUntilChanged(),\n shareReplay(1),\n );\n\n readonly partnerHasA2PAccess$ = this.featureFlags$.pipe(\n map((res) => res[INBOX_SMS_A2P]),\n distinctUntilChanged(),\n shareReplay(1),\n );\n\n readonly SMSNumber$ = this.accountGroupId$.pipe(\n switchMap((accountGroupId) => {\n if (!this.smsService || !accountGroupId) return of(null);\n return this.smsService.getAccountInfo({\n internalId: accountGroupId,\n type: ParticipantType.PARTICIPANT_TYPE_ACCOUNT_GROUP,\n });\n }),\n catchError((error: HttpErrorResponse) => {\n console.error('error to get account info:', error.message);\n return of({} as GetAccountInfoResponse);\n }),\n map((accountInfo) => accountInfo?.phoneNumber),\n distinctUntilChanged(),\n shareReplay(1),\n );\n\n constructor(\n private readonly featureFlagService: FeatureFlagService,\n private readonly participantService: ParticipantService,\n @Inject(ACCOUNT_GROUP_ID_TOKEN) private readonly accountGroupId$: Observable,\n @Inject(CONVERSATION_COUNTRY_TOKEN) readonly country$: Observable,\n @Inject(CONVERSATION_GEOGRAPHICAL_STATE_TOKEN) private readonly geographicalState$: Observable,\n @Inject(PARTNER_ID_TOKEN) private readonly partnerId$: Observable,\n @Inject(FEATURE_FLAG_TOKEN)\n @Inject(CONVERSATION_PLATFORM_LOCATION_TOKEN)\n readonly platformLocation: PlatformLocation,\n private readonly addressService: AddressAPIService,\n @Inject(CONVERSATION_SMS_ENABLED_TOKEN) private smsEnabled$: Observable,\n @Inject(CONVERSATION_WEB_CHAT_ENABLED_TOKEN) private webChatEnabled$: Observable,\n @Inject(CONVERSATION_GOOGLE_BUSINESS_MESSAGES_AVAILABLE_TOKEN)\n private googleBusinessMessagesAvailable$: Observable,\n @Inject(USER_ID_TOKEN) private readonly userId$: Observable,\n private iamService: IAMService,\n private readonly inboxApiService: InboxApiService,\n @Inject(GROUP_ID_TOKEN) private readonly groupId$: Observable,\n ) {}\n\n hasAccessToInboxPage$ =\n inject(CONVERSATION_CONFIG_TOKEN)?.hasAccessToInboxPage$?.pipe(map((result) => !!result)) || of(true);\n allowSmbChatWithPartner$ =\n inject(CONVERSATION_CONFIG_TOKEN)?.allowSmbChatWithPartner$?.pipe(map((result) => !!result)) || of(false);\n\n /**\n * Check if account can access SMS feature.\n * SMS is only accessible for US/CA accounts.\n */\n get canAccessSMS$(): Observable {\n const hasAccessByCountry$ = this.geographicalState$.pipe(\n switchMap((geographicalState) => this.hasAccessByCountry(geographicalState)),\n );\n return combineLatest([this.hasAccessToInboxPage$, hasAccessByCountry$, this.smsEnabled$]).pipe(\n map(([hasAccessToInboxPage, hasAccessByCountry, smsEnabled]) => {\n return hasAccessToInboxPage && hasAccessByCountry && smsEnabled;\n }),\n distinctUntilChanged(),\n shareReplay(1),\n );\n }\n\n reauthorizeGoogleAccount() {\n // TODO: (BREW-316) - Reauthorize Google Account\n }\n\n get canAccess$(): Observable {\n return combineLatest([this.hasAccessToInboxPage$, this.hasAccessByCountry()]).pipe(\n map(([hasAccess, hasAccessByCountry]) => hasAccess && hasAccessByCountry),\n take(1),\n shareReplay(1),\n );\n }\n\n private hasAccessByCountry(accountGroupGeographicalState?: string): Observable {\n // https://address-demo.apigateway.co/address.v1.Address/ListAllCountryOptions\n // Australia - AU / United Kingdom - GB\n const availableCountries = ['ca', 'us'];\n return this.country$.pipe(\n switchMap((accountGroupCountry) => {\n const country = accountGroupCountry?.toLowerCase() || '';\n if (!availableCountries?.includes(country)) {\n return of(false);\n }\n if (country === 'us' && accountGroupGeographicalState) {\n return this.hasAccessByUSState(accountGroupGeographicalState).pipe(\n take(1),\n map((hasAccessByUSState) => hasAccessByUSState),\n );\n }\n return of(true);\n }),\n );\n }\n\n /**\n * Check if account is a US account\n * If the Country is US and the state doesn't belong to a valid US state the validation would be false.\n */\n private isUsAccountWithSmsAccess$(accountGroupGeographicalState?: string): Observable {\n return this.country$.pipe(\n switchMap((accountGroupCountry) => {\n const country = accountGroupCountry?.toLowerCase() || '';\n if (country === 'us' && accountGroupGeographicalState) {\n return this.hasAccessByUSState(accountGroupGeographicalState);\n }\n return of(false);\n }),\n );\n }\n\n private hasAccessByUSState(accountGroupState: string): Observable {\n const state = accountGroupState?.toLowerCase() || '';\n return this.addressService.getCountryConfiguration('US', undefined).pipe(\n take(1),\n map((countryInfo) => {\n const filteredStateList = countryInfo?.zones?.reduce((accumulator, currentValue) => {\n if (!EXCLUDED_GEOGRAPHICAL_US_STATES.includes(currentValue?.code)) {\n return [...accumulator, currentValue?.code?.toLocaleLowerCase()];\n }\n return accumulator;\n }, []);\n return filteredStateList?.includes(state);\n }),\n catchError((error) => {\n console.error('Error getting country configuration:', error.message);\n return of(false);\n }),\n );\n }\n\n readonly showInboxViews$ = of(!this.isBusinessApp);\n\n readonly canAccessInboxGetStartedCard$ = combineLatest([\n this.smsEnabled$,\n this.googleBusinessMessagesAvailable$,\n ]).pipe(\n map(([smsEnable, googleBusinessMessagesEnable]) => {\n return smsEnable && googleBusinessMessagesEnable;\n }),\n distinctUntilChanged(),\n );\n\n readonly openInboxDefault$ = this.featureFlags$.pipe(\n map((featureFlags) => {\n return featureFlags[INBOX_OPEN_DEFAULT] && this.isPartnerCenter && !isWideScreen();\n }),\n shareReplay(1),\n );\n\n readonly canAccessWebChatSettings$ = combineLatest([this.featureFlags$, this.webChatEnabled$]).pipe(\n map(([featureFlags, webchatEnabled]) => {\n const canAccessBA = featureFlags[WEBCHAT_SETTING_CARD] && this.isBusinessApp && webchatEnabled;\n const canAccessPCC = featureFlags[WEB_CHAT_FOR_PARTNER_INBOX] && this.isPartnerCenter;\n return canAccessBA || canAccessPCC;\n }),\n shareReplay(1),\n );\n\n readonly canAccessEmailChannel$ = this.featureFlags$.pipe(\n map((featureFlags) => {\n return featureFlags[INBOX_EMAIL] && this.isBusinessApp;\n }),\n );\n\n readonly canAccessMessageTemplateSettingsCard$ = this.featureFlags$.pipe(\n map((featureFlags) => featureFlags[MESSAGE_TEMPLATE_CARD]),\n shareReplay(1),\n );\n\n readonly multiLocationEnabled$ = this.groupId$.pipe(\n switchMap((groupId) => {\n if (!groupId || !this.isBusinessApp) {\n return of({ configuration: { multiLocationEnabled: false } });\n }\n return this.inboxApiService\n .getConfiguration({\n subjectParticipant: {\n participantType: GlobalParticipantType.GLOBAL_PARTICIPANT_TYPE_GROUP,\n internalParticipantId: groupId,\n },\n })\n .pipe(catchError(() => of({ configuration: { multiLocationEnabled: false } })));\n }),\n map((config) => {\n return config.configuration.multiLocationEnabled ?? false;\n }),\n catchError(() => of(false)),\n shareReplay(1),\n );\n\n /**\n * check if the current platform location is the business app\n * @return {boolean}\n */\n get isBusinessApp(): boolean {\n return this.platformLocation === PlatformLocation.PLATFORM_LOCATION_BUSINESS_APP;\n }\n\n /**\n * check if the current platform location is the partner center\n * @return {boolean}\n */\n get isPartnerCenter(): boolean {\n return this.platformLocation === PlatformLocation.PLATFORM_LOCATION_PARTNER_CENTER;\n }\n\n /**\n * check if the current platform location is the sales center\n * @return {boolean}\n */\n get isSalesCenter(): boolean {\n return this.platformLocation === PlatformLocation.PLATFORM_LOCATION_SALES_CENTER;\n }\n\n /**\n * check if displaying the A2P card in business app inbox setting page\n * @return {Promise}\n */\n async displayA2pCard$(): Promise {\n const hasAccessByCountry$ = this.geographicalState$.pipe(\n switchMap((geographicalState) => this.hasAccessByCountry(geographicalState)),\n );\n\n return await firstValueFrom(\n combineLatest([\n this.hasAccessToInboxPage$,\n hasAccessByCountry$,\n this.partnerHasA2PAccess$,\n this.smsEnabled$,\n ]).pipe(\n map(([hasAccessToInboxPage, hasAccessByCountry, partnerHasA2PAccess, smsEnable]): boolean => {\n return this.isBusinessApp && hasAccessToInboxPage && hasAccessByCountry && partnerHasA2PAccess && smsEnable;\n }),\n ),\n );\n }\n\n async buildTemplateTrackProperties() {\n return {\n accountGroupId: await firstValueFrom(this.accountGroupId$),\n participantName: (await firstValueFrom(this.participantService.currentParticipant$)).name || '',\n partnerId: await firstValueFrom(this.partnerId$),\n location: PlatformLocation[this.platformLocation],\n };\n }\n\n async buildAiKnowledgeAppConfigurationUrl(widgetId: string): Promise {\n const accountGroupId = await firstValueFrom(this.accountGroupId$);\n if (accountGroupId) {\n return `/account/location/${accountGroupId}/settings/widgets/${widgetId}/edit`;\n }\n return `/(inbox:inbox/widgets/${widgetId}/edit)`;\n }\n\n buildAppId(widgetId: string): string {\n return `APP-WEBCHAT-${widgetId}`;\n }\n\n ngOnDestroy(): void {\n this.unsubscribe$$.next();\n this.unsubscribe$$.complete();\n }\n}\n","import { ConversationChannel } from '@vendasta/conversation';\nimport { Observable } from 'rxjs';\nimport { ConversationDetail } from '../../index';\n\nexport interface AlertOptions {\n title: string;\n description?: string;\n action?: AlertAction;\n}\n\ninterface AlertAction {\n title: string;\n callback: () => void;\n}\n\nexport abstract class ConversationChannelService {\n abstract getChatComposerAlert(\n partnerId: string,\n accountGroupId: string,\n conversationDetail?: ConversationDetail,\n availableChannels?: ConversationChannel[],\n ): Observable;\n}\n","import { Injectable } from '@angular/core';\nimport { ConversationChannel } from '@vendasta/conversation';\nimport { Observable, of } from 'rxjs';\nimport { ConversationDetail } from '../interface/conversation.interface';\nimport { AlertOptions, ConversationChannelService } from './conversation-channel.abstract';\n\n@Injectable()\nexport class ConversationFacebookService extends ConversationChannelService {\n getChatComposerAlert(\n _partnerId: string,\n _accountGroupId: string,\n conversationDetail?: ConversationDetail,\n channels?: ConversationChannel[],\n ): Observable {\n if (\n conversationDetail?.conversation.channel === ConversationChannel.CONVERSATION_CHANNEL_FACEBOOK &&\n channels?.length === 0\n ) {\n return of({\n title: 'INBOX.SETTINGS.FACEBOOK_MESSENGER.ERRORS.CANNOT_SEND_MESSAGE',\n description: 'INBOX.SETTINGS.FACEBOOK_MESSENGER.ERRORS.CANNOT_SEND_MESSAGE_DESCRIPTION',\n });\n }\n return of(null);\n }\n}\n","import * as i0 from '@angular/core';\nimport { Injectable } from '@angular/core';\nimport * as i1 from '@angular/common/http';\nimport { HttpHeaders } from '@angular/common/http';\nimport { map } from 'rxjs/operators';\n\n// *********************************\n// Code generated by sdkgen\n// DO NOT EDIT!.\n//\n// Enums.\n// *********************************\nvar EventType = /*#__PURE__*/function (EventType) {\n EventType[EventType[\"EVENT_TYPE_UNSPECIFIED\"] = 0] = \"EVENT_TYPE_UNSPECIFIED\";\n EventType[EventType[\"EVENT_TYPE_TYPING_STARTED\"] = 1] = \"EVENT_TYPE_TYPING_STARTED\";\n EventType[EventType[\"EVENT_TYPE_TYPING_STOPPED\"] = 2] = \"EVENT_TYPE_TYPING_STOPPED\";\n EventType[EventType[\"EVENT_TYPE_REPRESENTATIVE_JOINED\"] = 3] = \"EVENT_TYPE_REPRESENTATIVE_JOINED\";\n EventType[EventType[\"EVENT_TYPE_REPRESENTATIVE_LEFT\"] = 4] = \"EVENT_TYPE_REPRESENTATIVE_LEFT\";\n return EventType;\n}(EventType || {});\nvar MessageType = /*#__PURE__*/function (MessageType) {\n MessageType[MessageType[\"MESSAGE_TYPE_UNSPECIFIED\"] = 0] = \"MESSAGE_TYPE_UNSPECIFIED\";\n MessageType[MessageType[\"MESSAGE_TYPE_TEXT\"] = 1] = \"MESSAGE_TYPE_TEXT\";\n MessageType[MessageType[\"MESSAGE_TYPE_IMAGE\"] = 2] = \"MESSAGE_TYPE_IMAGE\";\n return MessageType;\n}(MessageType || {});\nvar UserType = /*#__PURE__*/function (UserType) {\n UserType[UserType[\"USER_TYPE_UNSPECIFIED\"] = 0] = \"USER_TYPE_UNSPECIFIED\";\n UserType[UserType[\"USER_TYPE_BOT\"] = 1] = \"USER_TYPE_BOT\";\n UserType[UserType[\"USER_TYPE_HUMAN\"] = 2] = \"USER_TYPE_HUMAN\";\n return UserType;\n}(UserType || {});\n// *********************************\n// Code generated by sdkgen\n// DO NOT EDIT!.\n//\n// Enums.\n// *********************************\nvar MetricType = /*#__PURE__*/function (MetricType) {\n MetricType[MetricType[\"NONE\"] = 0] = \"NONE\";\n MetricType[MetricType[\"QUERIES_DIRECT\"] = 1] = \"QUERIES_DIRECT\";\n MetricType[MetricType[\"QUERIES_INDIRECT\"] = 2] = \"QUERIES_INDIRECT\";\n MetricType[MetricType[\"VIEWS_MAPS\"] = 3] = \"VIEWS_MAPS\";\n MetricType[MetricType[\"VIEWS_SEARCH\"] = 4] = \"VIEWS_SEARCH\";\n MetricType[MetricType[\"ACTIONS_WEBSITE\"] = 5] = \"ACTIONS_WEBSITE\";\n MetricType[MetricType[\"ACTIONS_PHONE\"] = 6] = \"ACTIONS_PHONE\";\n MetricType[MetricType[\"ACTIONS_DRIVING_DIRECTIONS\"] = 7] = \"ACTIONS_DRIVING_DIRECTIONS\";\n MetricType[MetricType[\"QUERIES_CHAIN\"] = 8] = \"QUERIES_CHAIN\";\n MetricType[MetricType[\"PHOTOS_VIEWS_MERCHANT\"] = 9] = \"PHOTOS_VIEWS_MERCHANT\";\n MetricType[MetricType[\"PHOTOS_VIEWS_CUSTOMERS\"] = 10] = \"PHOTOS_VIEWS_CUSTOMERS\";\n MetricType[MetricType[\"PHOTOS_COUNT_MERCHANT\"] = 11] = \"PHOTOS_COUNT_MERCHANT\";\n MetricType[MetricType[\"PHOTOS_COUNT_CUSTOMERS\"] = 12] = \"PHOTOS_COUNT_CUSTOMERS\";\n MetricType[MetricType[\"LOCAL_POST_VIEWS_SEARCH\"] = 13] = \"LOCAL_POST_VIEWS_SEARCH\";\n MetricType[MetricType[\"LOCAL_POST_ACTIONS_CALL_TO_ACTION\"] = 14] = \"LOCAL_POST_ACTIONS_CALL_TO_ACTION\";\n return MetricType;\n}(MetricType || {});\nvar Period = /*#__PURE__*/function (Period) {\n Period[Period[\"DAY\"] = 0] = \"DAY\";\n Period[Period[\"WEEK\"] = 1] = \"WEEK\";\n Period[Period[\"MONTH\"] = 2] = \"MONTH\";\n return Period;\n}(Period || {});\n// *********************************\n// Code generated by sdkgen\n// DO NOT EDIT!.\n//\n// Enums Index.\n// *********************************\n\nfunction enumStringToValue$8(enumRef, value) {\n if (typeof value === 'number') {\n return value;\n }\n return enumRef[value];\n}\nclass FieldMask {\n static fromProto(proto) {\n let m = new FieldMask();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.paths !== 'undefined') {\n toReturn['paths'] = this.paths;\n }\n return toReturn;\n }\n}\nfunction enumStringToValue$7(enumRef, value) {\n if (typeof value === 'number') {\n return value;\n }\n return enumRef[value];\n}\nclass GoogleDate {\n static fromProto(proto) {\n let m = new GoogleDate();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.year !== 'undefined') {\n toReturn['year'] = this.year;\n }\n if (typeof this.month !== 'undefined') {\n toReturn['month'] = this.month;\n }\n if (typeof this.day !== 'undefined') {\n toReturn['day'] = this.day;\n }\n return toReturn;\n }\n}\nfunction enumStringToValue$6(enumRef, value) {\n if (typeof value === 'number') {\n return value;\n }\n return enumRef[value];\n}\nclass PostInsightsHistory {\n static fromProto(proto) {\n let m = new PostInsightsHistory();\n m = Object.assign(m, proto);\n if (proto.views) {\n m.views = parseInt(proto.views, 10);\n }\n if (proto.callToActionClicks) {\n m.callToActionClicks = parseInt(proto.callToActionClicks, 10);\n }\n if (proto.postedDateTime) {\n m.postedDateTime = new Date(proto.postedDateTime);\n }\n if (proto.statsDateTime) {\n m.statsDateTime = new Date(proto.statsDateTime);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.socialProfileId !== 'undefined') {\n toReturn['socialProfileId'] = this.socialProfileId;\n }\n if (typeof this.internalPostId !== 'undefined') {\n toReturn['internalPostId'] = this.internalPostId;\n }\n if (typeof this.views !== 'undefined') {\n toReturn['views'] = this.views;\n }\n if (typeof this.callToActionClicks !== 'undefined') {\n toReturn['callToActionClicks'] = this.callToActionClicks;\n }\n if (typeof this.postedDateTime !== 'undefined' && this.postedDateTime !== null) {\n toReturn['postedDateTime'] = 'toApiJson' in this.postedDateTime ? this.postedDateTime.toApiJson() : this.postedDateTime;\n }\n if (typeof this.statsDateTime !== 'undefined' && this.statsDateTime !== null) {\n toReturn['statsDateTime'] = 'toApiJson' in this.statsDateTime ? this.statsDateTime.toApiJson() : this.statsDateTime;\n }\n if (typeof this.partnerId !== 'undefined') {\n toReturn['partnerId'] = this.partnerId;\n }\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n return toReturn;\n }\n}\nfunction enumStringToValue$5(enumRef, value) {\n if (typeof value === 'number') {\n return value;\n }\n return enumRef[value];\n}\nclass Answer {\n static fromProto(proto) {\n let m = new Answer();\n m = Object.assign(m, proto);\n if (proto.upVoteCount) {\n m.upVoteCount = parseInt(proto.upVoteCount, 10);\n }\n if (proto.published) {\n m.published = new Date(proto.published);\n }\n if (proto.created) {\n m.created = new Date(proto.created);\n }\n if (proto.modified) {\n m.modified = new Date(proto.modified);\n }\n if (proto.previousVersions) {\n m.previousVersions = proto.previousVersions.map(Answer.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.partnerId !== 'undefined') {\n toReturn['partnerId'] = this.partnerId;\n }\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n if (typeof this.locationId !== 'undefined') {\n toReturn['locationId'] = this.locationId;\n }\n if (typeof this.questionId !== 'undefined') {\n toReturn['questionId'] = this.questionId;\n }\n if (typeof this.version !== 'undefined') {\n toReturn['version'] = this.version;\n }\n if (typeof this.locationPathName !== 'undefined') {\n toReturn['locationPathName'] = this.locationPathName;\n }\n if (typeof this.text !== 'undefined') {\n toReturn['text'] = this.text;\n }\n if (typeof this.author !== 'undefined') {\n toReturn['author'] = this.author;\n }\n if (typeof this.authorPhotoUrl !== 'undefined') {\n toReturn['authorPhotoUrl'] = this.authorPhotoUrl;\n }\n if (typeof this.authorType !== 'undefined') {\n toReturn['authorType'] = this.authorType;\n }\n if (typeof this.answerId !== 'undefined') {\n toReturn['answerId'] = this.answerId;\n }\n if (typeof this.upVoteCount !== 'undefined') {\n toReturn['upVoteCount'] = this.upVoteCount;\n }\n if (typeof this.published !== 'undefined' && this.published !== null) {\n toReturn['published'] = 'toApiJson' in this.published ? this.published.toApiJson() : this.published;\n }\n if (typeof this.created !== 'undefined' && this.created !== null) {\n toReturn['created'] = 'toApiJson' in this.created ? this.created.toApiJson() : this.created;\n }\n if (typeof this.modified !== 'undefined' && this.modified !== null) {\n toReturn['modified'] = 'toApiJson' in this.modified ? this.modified.toApiJson() : this.modified;\n }\n if (typeof this.previousVersions !== 'undefined' && this.previousVersions !== null) {\n toReturn['previousVersions'] = 'toApiJson' in this.previousVersions ? this.previousVersions.toApiJson() : this.previousVersions;\n }\n return toReturn;\n }\n}\nfunction enumStringToValue$4(enumRef, value) {\n if (typeof value === 'number') {\n return value;\n }\n return enumRef[value];\n}\nclass Question {\n static fromProto(proto) {\n let m = new Question();\n m = Object.assign(m, proto);\n if (proto.totalAnswerCount) {\n m.totalAnswerCount = parseInt(proto.totalAnswerCount, 10);\n }\n if (proto.upVoteCount) {\n m.upVoteCount = parseInt(proto.upVoteCount, 10);\n }\n if (proto.published) {\n m.published = new Date(proto.published);\n }\n if (proto.created) {\n m.created = new Date(proto.created);\n }\n if (proto.modified) {\n m.modified = new Date(proto.modified);\n }\n if (proto.answers) {\n m.answers = proto.answers.map(Answer.fromProto);\n }\n if (proto.previousVersions) {\n m.previousVersions = proto.previousVersions.map(Question.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.partnerId !== 'undefined') {\n toReturn['partnerId'] = this.partnerId;\n }\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n if (typeof this.locationId !== 'undefined') {\n toReturn['locationId'] = this.locationId;\n }\n if (typeof this.questionId !== 'undefined') {\n toReturn['questionId'] = this.questionId;\n }\n if (typeof this.version !== 'undefined') {\n toReturn['version'] = this.version;\n }\n if (typeof this.locationPathName !== 'undefined') {\n toReturn['locationPathName'] = this.locationPathName;\n }\n if (typeof this.text !== 'undefined') {\n toReturn['text'] = this.text;\n }\n if (typeof this.author !== 'undefined') {\n toReturn['author'] = this.author;\n }\n if (typeof this.authorPhotoUrl !== 'undefined') {\n toReturn['authorPhotoUrl'] = this.authorPhotoUrl;\n }\n if (typeof this.authorType !== 'undefined') {\n toReturn['authorType'] = this.authorType;\n }\n if (typeof this.totalAnswerCount !== 'undefined') {\n toReturn['totalAnswerCount'] = this.totalAnswerCount;\n }\n if (typeof this.upVoteCount !== 'undefined') {\n toReturn['upVoteCount'] = this.upVoteCount;\n }\n if (typeof this.published !== 'undefined' && this.published !== null) {\n toReturn['published'] = 'toApiJson' in this.published ? this.published.toApiJson() : this.published;\n }\n if (typeof this.created !== 'undefined' && this.created !== null) {\n toReturn['created'] = 'toApiJson' in this.created ? this.created.toApiJson() : this.created;\n }\n if (typeof this.modified !== 'undefined' && this.modified !== null) {\n toReturn['modified'] = 'toApiJson' in this.modified ? this.modified.toApiJson() : this.modified;\n }\n if (typeof this.answers !== 'undefined' && this.answers !== null) {\n toReturn['answers'] = 'toApiJson' in this.answers ? this.answers.toApiJson() : this.answers;\n }\n if (typeof this.previousVersions !== 'undefined' && this.previousVersions !== null) {\n toReturn['previousVersions'] = 'toApiJson' in this.previousVersions ? this.previousVersions.toApiJson() : this.previousVersions;\n }\n return toReturn;\n }\n}\nfunction enumStringToValue$3(enumRef, value) {\n if (typeof value === 'number') {\n return value;\n }\n return enumRef[value];\n}\nclass CreateEventRequest {\n static fromProto(proto) {\n let m = new CreateEventRequest();\n m = Object.assign(m, proto);\n if (proto.eventType) {\n m.eventType = enumStringToValue$3(EventType, proto.eventType);\n }\n if (proto.user) {\n m.user = User.fromProto(proto.user);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.eventType !== 'undefined') {\n toReturn['eventType'] = this.eventType;\n }\n if (typeof this.user !== 'undefined' && this.user !== null) {\n toReturn['user'] = 'toApiJson' in this.user ? this.user.toApiJson() : this.user;\n }\n if (typeof this.gmbConversationId !== 'undefined') {\n toReturn['gmbConversationId'] = this.gmbConversationId;\n }\n return toReturn;\n }\n}\nclass CreateEventResponse {\n static fromProto(proto) {\n let m = new CreateEventResponse();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.eventId !== 'undefined') {\n toReturn['eventId'] = this.eventId;\n }\n return toReturn;\n }\n}\nclass Image {\n static fromProto(proto) {\n let m = new Image();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.fileUrl !== 'undefined') {\n toReturn['fileUrl'] = this.fileUrl;\n }\n return toReturn;\n }\n}\nclass SendMessageRequest {\n static fromProto(proto) {\n let m = new SendMessageRequest();\n m = Object.assign(m, proto);\n if (proto.sender) {\n m.sender = User.fromProto(proto.sender);\n }\n if (proto.image) {\n m.image = Image.fromProto(proto.image);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.gmbConversationId !== 'undefined') {\n toReturn['gmbConversationId'] = this.gmbConversationId;\n }\n if (typeof this.sender !== 'undefined' && this.sender !== null) {\n toReturn['sender'] = 'toApiJson' in this.sender ? this.sender.toApiJson() : this.sender;\n }\n if (typeof this.image !== 'undefined' && this.image !== null) {\n toReturn['image'] = 'toApiJson' in this.image ? this.image.toApiJson() : this.image;\n }\n if (typeof this.text !== 'undefined') {\n toReturn['text'] = this.text;\n }\n return toReturn;\n }\n}\nclass SendMessageResponse {\n static fromProto(proto) {\n let m = new SendMessageResponse();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.messageId !== 'undefined') {\n toReturn['messageId'] = this.messageId;\n }\n return toReturn;\n }\n}\nclass User {\n static fromProto(proto) {\n let m = new User();\n m = Object.assign(m, proto);\n if (proto.userType) {\n m.userType = enumStringToValue$3(UserType, proto.userType);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.userName !== 'undefined') {\n toReturn['userName'] = this.userName;\n }\n if (typeof this.userAvatarUrl !== 'undefined') {\n toReturn['userAvatarUrl'] = this.userAvatarUrl;\n }\n if (typeof this.userType !== 'undefined') {\n toReturn['userType'] = this.userType;\n }\n return toReturn;\n }\n}\nfunction enumStringToValue$2(enumRef, value) {\n if (typeof value === 'number') {\n return value;\n }\n return enumRef[value];\n}\nclass CanEnableBusinessCommunicationsRequest {\n static fromProto(proto) {\n let m = new CanEnableBusinessCommunicationsRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.socialProfileId !== 'undefined') {\n toReturn['socialProfileId'] = this.socialProfileId;\n }\n return toReturn;\n }\n}\nclass CanEnableBusinessCommunicationsResponse {\n static fromProto(proto) {\n let m = new CanEnableBusinessCommunicationsResponse();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.hasRequiredAccessScopes !== 'undefined') {\n toReturn['hasRequiredAccessScopes'] = this.hasRequiredAccessScopes;\n }\n return toReturn;\n }\n}\nclass ConnectBusinessCommunicationsRequest {\n static fromProto(proto) {\n let m = new ConnectBusinessCommunicationsRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n if (typeof this.socialProfileId !== 'undefined') {\n toReturn['socialProfileId'] = this.socialProfileId;\n }\n if (typeof this.partnerId !== 'undefined') {\n toReturn['partnerId'] = this.partnerId;\n }\n return toReturn;\n }\n}\nclass GetBusinessLaunchStatusRequest {\n static fromProto(proto) {\n let m = new GetBusinessLaunchStatusRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n if (typeof this.partnerId !== 'undefined') {\n toReturn['partnerId'] = this.partnerId;\n }\n return toReturn;\n }\n}\nclass GetBusinessLaunchStatusResponse {\n static fromProto(proto) {\n let m = new GetBusinessLaunchStatusResponse();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.isLaunched !== 'undefined') {\n toReturn['isLaunched'] = this.isLaunched;\n }\n return toReturn;\n }\n}\nclass UnlaunchBusinessCommunicationsAgentRequest {\n static fromProto(proto) {\n let m = new UnlaunchBusinessCommunicationsAgentRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n if (typeof this.partnerId !== 'undefined') {\n toReturn['partnerId'] = this.partnerId;\n }\n return toReturn;\n }\n}\nfunction enumStringToValue$1(enumRef, value) {\n if (typeof value === 'number') {\n return value;\n }\n return enumRef[value];\n}\nclass CalculateInsightsByTimePeriodRequest {\n static fromProto(proto) {\n let m = new CalculateInsightsByTimePeriodRequest();\n m = Object.assign(m, proto);\n if (proto.startDate) {\n m.startDate = new Date(proto.startDate);\n }\n if (proto.endDate) {\n m.endDate = new Date(proto.endDate);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n if (typeof this.startDate !== 'undefined' && this.startDate !== null) {\n toReturn['startDate'] = 'toApiJson' in this.startDate ? this.startDate.toApiJson() : this.startDate;\n }\n if (typeof this.endDate !== 'undefined' && this.endDate !== null) {\n toReturn['endDate'] = 'toApiJson' in this.endDate ? this.endDate.toApiJson() : this.endDate;\n }\n return toReturn;\n }\n}\nclass CalculateInsightsByTimePeriodResponse {\n static fromProto(proto) {\n let m = new CalculateInsightsByTimePeriodResponse();\n m = Object.assign(m, proto);\n if (proto.stats) {\n m.stats = proto.stats.map(InsightsStat.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.stats !== 'undefined' && this.stats !== null) {\n toReturn['stats'] = 'toApiJson' in this.stats ? this.stats.toApiJson() : this.stats;\n }\n return toReturn;\n }\n}\nclass CanRespondToReviewRequest {\n static fromProto(proto) {\n let m = new CanRespondToReviewRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.reviewId !== 'undefined') {\n toReturn['reviewId'] = this.reviewId;\n }\n return toReturn;\n }\n}\nclass CanRespondToReviewResponse {\n static fromProto(proto) {\n let m = new CanRespondToReviewResponse();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.canPublish !== 'undefined') {\n toReturn['canPublish'] = this.canPublish;\n }\n if (typeof this.addLink !== 'undefined') {\n toReturn['addLink'] = this.addLink;\n }\n if (typeof this.message !== 'undefined') {\n toReturn['message'] = this.message;\n }\n return toReturn;\n }\n}\nclass ConnectRequest {\n static fromProto(proto) {\n let m = new ConnectRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.googleUserId !== 'undefined') {\n toReturn['googleUserId'] = this.googleUserId;\n }\n if (typeof this.locationPathName !== 'undefined') {\n toReturn['locationPathName'] = this.locationPathName;\n }\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n return toReturn;\n }\n}\nclass ConnectResponse {\n static fromProto(proto) {\n let m = new ConnectResponse();\n m = Object.assign(m, proto);\n if (proto.location) {\n m.location = Location.fromProto(proto.location);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.location !== 'undefined' && this.location !== null) {\n toReturn['location'] = 'toApiJson' in this.location ? this.location.toApiJson() : this.location;\n }\n return toReturn;\n }\n}\nclass DisconnectRequest {\n static fromProto(proto) {\n let m = new DisconnectRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.googleUserId !== 'undefined') {\n toReturn['googleUserId'] = this.googleUserId;\n }\n if (typeof this.locationPathName !== 'undefined') {\n toReturn['locationPathName'] = this.locationPathName;\n }\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n return toReturn;\n }\n}\nclass EnableDisableSyncRequest {\n static fromProto(proto) {\n let m = new EnableDisableSyncRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.googleUserId !== 'undefined') {\n toReturn['googleUserId'] = this.googleUserId;\n }\n if (typeof this.locationPathName !== 'undefined') {\n toReturn['locationPathName'] = this.locationPathName;\n }\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n if (typeof this.syncSettingFlag !== 'undefined') {\n toReturn['syncSettingFlag'] = this.syncSettingFlag;\n }\n return toReturn;\n }\n}\nclass EnableDisableSyncResponse {\n static fromProto(proto) {\n let m = new EnableDisableSyncResponse();\n m = Object.assign(m, proto);\n if (proto.location) {\n m.location = Location.fromProto(proto.location);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.location !== 'undefined' && this.location !== null) {\n toReturn['location'] = 'toApiJson' in this.location ? this.location.toApiJson() : this.location;\n }\n return toReturn;\n }\n}\nclass GetAsSocialServiceRequest {\n static fromProto(proto) {\n let m = new GetAsSocialServiceRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n return toReturn;\n }\n}\nclass GetAsSocialServiceResponse {\n static fromProto(proto) {\n let m = new GetAsSocialServiceResponse();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.serviceType !== 'undefined') {\n toReturn['serviceType'] = this.serviceType;\n }\n if (typeof this.ssid !== 'undefined') {\n toReturn['ssid'] = this.ssid;\n }\n if (typeof this.googleUserId !== 'undefined') {\n toReturn['googleUserId'] = this.googleUserId;\n }\n if (typeof this.agid !== 'undefined') {\n toReturn['agid'] = this.agid;\n }\n if (typeof this.profileUrl !== 'undefined') {\n toReturn['profileUrl'] = this.profileUrl;\n }\n if (typeof this.socialSyncFlag !== 'undefined') {\n toReturn['socialSyncFlag'] = this.socialSyncFlag;\n }\n if (typeof this.spid !== 'undefined') {\n toReturn['spid'] = this.spid;\n }\n if (typeof this.isAuthenticated !== 'undefined') {\n toReturn['isAuthenticated'] = this.isAuthenticated;\n }\n if (typeof this.name !== 'undefined') {\n toReturn['name'] = this.name;\n }\n return toReturn;\n }\n}\nclass GetConnectionRequest {\n static fromProto(proto) {\n let m = new GetConnectionRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n if (typeof this.googleUserId !== 'undefined') {\n toReturn['googleUserId'] = this.googleUserId;\n }\n if (typeof this.locationPathName !== 'undefined') {\n toReturn['locationPathName'] = this.locationPathName;\n }\n if (typeof this.refreshFromGoogleFlag !== 'undefined') {\n toReturn['refreshFromGoogleFlag'] = this.refreshFromGoogleFlag;\n }\n return toReturn;\n }\n}\nclass GetConnectionResponse {\n static fromProto(proto) {\n let m = new GetConnectionResponse();\n m = Object.assign(m, proto);\n if (proto.location) {\n m.location = Location.fromProto(proto.location);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.location !== 'undefined' && this.location !== null) {\n toReturn['location'] = 'toApiJson' in this.location ? this.location.toApiJson() : this.location;\n }\n return toReturn;\n }\n}\nclass GetConnectionsRequest {\n static fromProto(proto) {\n let m = new GetConnectionsRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n if (typeof this.googleUserId !== 'undefined') {\n toReturn['googleUserId'] = this.googleUserId;\n }\n if (typeof this.locationPathName !== 'undefined') {\n toReturn['locationPathName'] = this.locationPathName;\n }\n if (typeof this.refreshFromGoogleFlag !== 'undefined') {\n toReturn['refreshFromGoogleFlag'] = this.refreshFromGoogleFlag;\n }\n return toReturn;\n }\n}\nclass GetConnectionsResponse {\n static fromProto(proto) {\n let m = new GetConnectionsResponse();\n m = Object.assign(m, proto);\n if (proto.locations) {\n m.locations = proto.locations.map(Location.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.locations !== 'undefined' && this.locations !== null) {\n toReturn['locations'] = 'toApiJson' in this.locations ? this.locations.toApiJson() : this.locations;\n }\n return toReturn;\n }\n}\nclass GetGoogleUserRequest {\n static fromProto(proto) {\n let m = new GetGoogleUserRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n if (typeof this.googleUserId !== 'undefined') {\n toReturn['googleUserId'] = this.googleUserId;\n }\n return toReturn;\n }\n}\nclass GetGoogleUserResponse {\n static fromProto(proto) {\n let m = new GetGoogleUserResponse();\n m = Object.assign(m, proto);\n if (proto.user) {\n m.user = GoogleUser.fromProto(proto.user);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.user !== 'undefined' && this.user !== null) {\n toReturn['user'] = 'toApiJson' in this.user ? this.user.toApiJson() : this.user;\n }\n return toReturn;\n }\n}\nclass GoogleUser {\n static fromProto(proto) {\n let m = new GoogleUser();\n m = Object.assign(m, proto);\n if (proto.expiryDateTime) {\n m.expiryDateTime = new Date(proto.expiryDateTime);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.socialProfileId !== 'undefined') {\n toReturn['socialProfileId'] = this.socialProfileId;\n }\n if (typeof this.userId !== 'undefined') {\n toReturn['userId'] = this.userId;\n }\n if (typeof this.socialServiceId !== 'undefined') {\n toReturn['socialServiceId'] = this.socialServiceId;\n }\n if (typeof this.name !== 'undefined') {\n toReturn['name'] = this.name;\n }\n if (typeof this.accessToken !== 'undefined') {\n toReturn['accessToken'] = this.accessToken;\n }\n if (typeof this.refreshToken !== 'undefined') {\n toReturn['refreshToken'] = this.refreshToken;\n }\n if (typeof this.isTokenBroken !== 'undefined') {\n toReturn['isTokenBroken'] = this.isTokenBroken;\n }\n if (typeof this.expiryDateTime !== 'undefined' && this.expiryDateTime !== null) {\n toReturn['expiryDateTime'] = 'toApiJson' in this.expiryDateTime ? this.expiryDateTime.toApiJson() : this.expiryDateTime;\n }\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n return toReturn;\n }\n}\nclass InsightsStat {\n static fromProto(proto) {\n let m = new InsightsStat();\n m = Object.assign(m, proto);\n if (proto.currentValue) {\n m.currentValue = parseInt(proto.currentValue, 10);\n }\n if (proto.change) {\n m.change = parseInt(proto.change, 10);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.currentValue !== 'undefined') {\n toReturn['currentValue'] = this.currentValue;\n }\n if (typeof this.change !== 'undefined') {\n toReturn['change'] = this.change;\n }\n if (typeof this.name !== 'undefined') {\n toReturn['name'] = this.name;\n }\n return toReturn;\n }\n}\nclass Location {\n static fromProto(proto) {\n let m = new Location();\n m = Object.assign(m, proto);\n if (proto.locationSyncSucceededOn) {\n m.locationSyncSucceededOn = new Date(proto.locationSyncSucceededOn);\n }\n if (proto.openStatusSyncSucceededOn) {\n m.openStatusSyncSucceededOn = new Date(proto.openStatusSyncSucceededOn);\n }\n if (proto.syncLastAttemptedOn) {\n m.syncLastAttemptedOn = new Date(proto.syncLastAttemptedOn);\n }\n if (proto.created) {\n m.created = new Date(proto.created);\n }\n if (proto.modified) {\n m.modified = new Date(proto.modified);\n }\n if (proto.deleted) {\n m.deleted = new Date(proto.deleted);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n if (typeof this.socialProfileId !== 'undefined') {\n toReturn['socialProfileId'] = this.socialProfileId;\n }\n if (typeof this.address !== 'undefined') {\n toReturn['address'] = this.address;\n }\n if (typeof this.displayName !== 'undefined') {\n toReturn['displayName'] = this.displayName;\n }\n if (typeof this.googleReverify !== 'undefined') {\n toReturn['googleReverify'] = this.googleReverify;\n }\n if (typeof this.googleVerified !== 'undefined') {\n toReturn['googleVerified'] = this.googleVerified;\n }\n if (typeof this.isLocalPostApiDisabled !== 'undefined') {\n toReturn['isLocalPostApiDisabled'] = this.isLocalPostApiDisabled;\n }\n if (typeof this.isMissing !== 'undefined') {\n toReturn['isMissing'] = this.isMissing;\n }\n if (typeof this.isTokenBroken !== 'undefined') {\n toReturn['isTokenBroken'] = this.isTokenBroken;\n }\n if (typeof this.isVerified !== 'undefined') {\n toReturn['isVerified'] = this.isVerified;\n }\n if (typeof this.locationPathName !== 'undefined') {\n toReturn['locationPathName'] = this.locationPathName;\n }\n if (typeof this.logoImageId !== 'undefined') {\n toReturn['logoImageId'] = this.logoImageId;\n }\n if (typeof this.mapsPlaceId !== 'undefined') {\n toReturn['mapsPlaceId'] = this.mapsPlaceId;\n }\n if (typeof this.primaryImageId !== 'undefined') {\n toReturn['primaryImageId'] = this.primaryImageId;\n }\n if (typeof this.syncSettingFlag !== 'undefined') {\n toReturn['syncSettingFlag'] = this.syncSettingFlag;\n }\n if (typeof this.cannotSyncReasons !== 'undefined') {\n toReturn['cannotSyncReasons'] = this.cannotSyncReasons;\n }\n if (typeof this.serviceAreaPlaceId !== 'undefined') {\n toReturn['serviceAreaPlaceId'] = this.serviceAreaPlaceId;\n }\n if (typeof this.locationSyncSucceededOn !== 'undefined' && this.locationSyncSucceededOn !== null) {\n toReturn['locationSyncSucceededOn'] = 'toApiJson' in this.locationSyncSucceededOn ? this.locationSyncSucceededOn.toApiJson() : this.locationSyncSucceededOn;\n }\n if (typeof this.openStatusSyncSucceededOn !== 'undefined' && this.openStatusSyncSucceededOn !== null) {\n toReturn['openStatusSyncSucceededOn'] = 'toApiJson' in this.openStatusSyncSucceededOn ? this.openStatusSyncSucceededOn.toApiJson() : this.openStatusSyncSucceededOn;\n }\n if (typeof this.syncLastAttemptedOn !== 'undefined' && this.syncLastAttemptedOn !== null) {\n toReturn['syncLastAttemptedOn'] = 'toApiJson' in this.syncLastAttemptedOn ? this.syncLastAttemptedOn.toApiJson() : this.syncLastAttemptedOn;\n }\n if (typeof this.created !== 'undefined' && this.created !== null) {\n toReturn['created'] = 'toApiJson' in this.created ? this.created.toApiJson() : this.created;\n }\n if (typeof this.modified !== 'undefined' && this.modified !== null) {\n toReturn['modified'] = 'toApiJson' in this.modified ? this.modified.toApiJson() : this.modified;\n }\n if (typeof this.deleted !== 'undefined' && this.deleted !== null) {\n toReturn['deleted'] = 'toApiJson' in this.deleted ? this.deleted.toApiJson() : this.deleted;\n }\n return toReturn;\n }\n}\nclass QAndAAccountData {\n static fromProto(proto) {\n let m = new QAndAAccountData();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n if (typeof this.partnerId !== 'undefined') {\n toReturn['partnerId'] = this.partnerId;\n }\n if (typeof this.socialProfileId !== 'undefined') {\n toReturn['socialProfileId'] = this.socialProfileId;\n }\n return toReturn;\n }\n}\nfunction enumStringToValue(enumRef, value) {\n if (typeof value === 'number') {\n return value;\n }\n return enumRef[value];\n}\nclass AccountLocation {\n static fromProto(proto) {\n let m = new AccountLocation();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n if (typeof this.googleAccountId !== 'undefined') {\n toReturn['googleAccountId'] = this.googleAccountId;\n }\n if (typeof this.googleLocationId !== 'undefined') {\n toReturn['googleLocationId'] = this.googleLocationId;\n }\n return toReturn;\n }\n}\nclass CreateAnswerRequest {\n static fromProto(proto) {\n let m = new CreateAnswerRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n if (typeof this.socialProfileId !== 'undefined') {\n toReturn['socialProfileId'] = this.socialProfileId;\n }\n if (typeof this.locationPathName !== 'undefined') {\n toReturn['locationPathName'] = this.locationPathName;\n }\n if (typeof this.questionId !== 'undefined') {\n toReturn['questionId'] = this.questionId;\n }\n if (typeof this.text !== 'undefined') {\n toReturn['text'] = this.text;\n }\n return toReturn;\n }\n}\nclass CreateAnswerResponse {\n static fromProto(proto) {\n let m = new CreateAnswerResponse();\n m = Object.assign(m, proto);\n if (proto.answer) {\n m.answer = Answer.fromProto(proto.answer);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.answer !== 'undefined' && this.answer !== null) {\n toReturn['answer'] = 'toApiJson' in this.answer ? this.answer.toApiJson() : this.answer;\n }\n return toReturn;\n }\n}\nclass CreateQuestionRequest {\n static fromProto(proto) {\n let m = new CreateQuestionRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n if (typeof this.socialProfileId !== 'undefined') {\n toReturn['socialProfileId'] = this.socialProfileId;\n }\n if (typeof this.locationPathName !== 'undefined') {\n toReturn['locationPathName'] = this.locationPathName;\n }\n if (typeof this.text !== 'undefined') {\n toReturn['text'] = this.text;\n }\n if (typeof this.partnerId !== 'undefined') {\n toReturn['partnerId'] = this.partnerId;\n }\n return toReturn;\n }\n}\nclass CreateQuestionResponse {\n static fromProto(proto) {\n let m = new CreateQuestionResponse();\n m = Object.assign(m, proto);\n if (proto.question) {\n m.question = Question.fromProto(proto.question);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.question !== 'undefined' && this.question !== null) {\n toReturn['question'] = 'toApiJson' in this.question ? this.question.toApiJson() : this.question;\n }\n return toReturn;\n }\n}\nclass DeleteAccountLocationRequest {\n static fromProto(proto) {\n let m = new DeleteAccountLocationRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n return toReturn;\n }\n}\nclass DeletePostRequest {\n static fromProto(proto) {\n let m = new DeletePostRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.accessToken !== 'undefined') {\n toReturn['accessToken'] = this.accessToken;\n }\n if (typeof this.postId !== 'undefined') {\n toReturn['postId'] = this.postId;\n }\n return toReturn;\n }\n}\nclass GetMultiAccountLocationRequest {\n static fromProto(proto) {\n let m = new GetMultiAccountLocationRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.accountGroupIds !== 'undefined') {\n toReturn['accountGroupIds'] = this.accountGroupIds;\n }\n return toReturn;\n }\n}\nclass GetMultiAccountLocationResponse {\n static fromProto(proto) {\n let m = new GetMultiAccountLocationResponse();\n m = Object.assign(m, proto);\n if (proto.accountLocations) {\n m.accountLocations = proto.accountLocations.map(AccountLocation.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.accountLocations !== 'undefined' && this.accountLocations !== null) {\n toReturn['accountLocations'] = 'toApiJson' in this.accountLocations ? this.accountLocations.toApiJson() : this.accountLocations;\n }\n return toReturn;\n }\n}\nclass GetMultiQuestionsRequest {\n static fromProto(proto) {\n let m = new GetMultiQuestionsRequest();\n m = Object.assign(m, proto);\n if (proto.questionIds) {\n m.questionIds = proto.questionIds.map(QuestionIdentifier.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.questionIds !== 'undefined' && this.questionIds !== null) {\n toReturn['questionIds'] = 'toApiJson' in this.questionIds ? this.questionIds.toApiJson() : this.questionIds;\n }\n if (typeof this.includeAnswers !== 'undefined') {\n toReturn['includeAnswers'] = this.includeAnswers;\n }\n return toReturn;\n }\n}\nclass GetMultiQuestionsResponse {\n static fromProto(proto) {\n let m = new GetMultiQuestionsResponse();\n m = Object.assign(m, proto);\n if (proto.questions) {\n m.questions = proto.questions.map(Question.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.questions !== 'undefined' && this.questions !== null) {\n toReturn['questions'] = 'toApiJson' in this.questions ? this.questions.toApiJson() : this.questions;\n }\n return toReturn;\n }\n}\nclass GetMultiTimeRangeRequest {\n static fromProto(proto) {\n let m = new GetMultiTimeRangeRequest();\n m = Object.assign(m, proto);\n if (proto.resourceIds) {\n m.resourceIds = proto.resourceIds.map(ResourceId.fromProto);\n }\n if (proto.startTime) {\n m.startTime = new Date(proto.startTime);\n }\n if (proto.endTime) {\n m.endTime = new Date(proto.endTime);\n }\n if (proto.metricTypes) {\n m.metricTypes = proto.metricTypes.map(v => enumStringToValue(MetricType, v));\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.resourceIds !== 'undefined' && this.resourceIds !== null) {\n toReturn['resourceIds'] = 'toApiJson' in this.resourceIds ? this.resourceIds.toApiJson() : this.resourceIds;\n }\n if (typeof this.partnerId !== 'undefined') {\n toReturn['partnerId'] = this.partnerId;\n }\n if (typeof this.startTime !== 'undefined' && this.startTime !== null) {\n toReturn['startTime'] = 'toApiJson' in this.startTime ? this.startTime.toApiJson() : this.startTime;\n }\n if (typeof this.endTime !== 'undefined' && this.endTime !== null) {\n toReturn['endTime'] = 'toApiJson' in this.endTime ? this.endTime.toApiJson() : this.endTime;\n }\n if (typeof this.metricTypes !== 'undefined') {\n toReturn['metricTypes'] = this.metricTypes;\n }\n if (typeof this.delta !== 'undefined') {\n toReturn['delta'] = this.delta;\n }\n if (typeof this.total !== 'undefined') {\n toReturn['total'] = this.total;\n }\n if (typeof this.overTime !== 'undefined') {\n toReturn['overTime'] = this.overTime;\n }\n return toReturn;\n }\n}\nclass GetMultiTimeRangeResponse {\n static fromProto(proto) {\n let m = new GetMultiTimeRangeResponse();\n m = Object.assign(m, proto);\n if (proto.resourceInsights) {\n m.resourceInsights = proto.resourceInsights.map(GetMultiTimeRangeResponseInsightsContainer.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.resourceInsights !== 'undefined' && this.resourceInsights !== null) {\n toReturn['resourceInsights'] = 'toApiJson' in this.resourceInsights ? this.resourceInsights.toApiJson() : this.resourceInsights;\n }\n return toReturn;\n }\n}\nclass GetQuestionAnswerStatsRequest {\n static fromProto(proto) {\n let m = new GetQuestionAnswerStatsRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n if (typeof this.locationId !== 'undefined') {\n toReturn['locationId'] = this.locationId;\n }\n return toReturn;\n }\n}\nclass GetQuestionAnswerStatsResponse {\n static fromProto(proto) {\n let m = new GetQuestionAnswerStatsResponse();\n m = Object.assign(m, proto);\n if (proto.unanswered) {\n m.unanswered = parseInt(proto.unanswered, 10);\n }\n if (proto.answeredByOwner) {\n m.answeredByOwner = parseInt(proto.answeredByOwner, 10);\n }\n if (proto.totalQuestions) {\n m.totalQuestions = parseInt(proto.totalQuestions, 10);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.unanswered !== 'undefined') {\n toReturn['unanswered'] = this.unanswered;\n }\n if (typeof this.answeredByOwner !== 'undefined') {\n toReturn['answeredByOwner'] = this.answeredByOwner;\n }\n if (typeof this.totalQuestions !== 'undefined') {\n toReturn['totalQuestions'] = this.totalQuestions;\n }\n return toReturn;\n }\n}\nclass GetQuestionRequest {\n static fromProto(proto) {\n let m = new GetQuestionRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n if (typeof this.locationId !== 'undefined') {\n toReturn['locationId'] = this.locationId;\n }\n if (typeof this.questionId !== 'undefined') {\n toReturn['questionId'] = this.questionId;\n }\n if (typeof this.includeAnswers !== 'undefined') {\n toReturn['includeAnswers'] = this.includeAnswers;\n }\n if (typeof this.onlyLatestVersion !== 'undefined') {\n toReturn['onlyLatestVersion'] = this.onlyLatestVersion;\n }\n return toReturn;\n }\n}\nclass GetQuestionResponse {\n static fromProto(proto) {\n let m = new GetQuestionResponse();\n m = Object.assign(m, proto);\n if (proto.question) {\n m.question = Question.fromProto(proto.question);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.question !== 'undefined' && this.question !== null) {\n toReturn['question'] = 'toApiJson' in this.question ? this.question.toApiJson() : this.question;\n }\n return toReturn;\n }\n}\nclass GetTimeRangeRequest {\n static fromProto(proto) {\n let m = new GetTimeRangeRequest();\n m = Object.assign(m, proto);\n if (proto.startTime) {\n m.startTime = new Date(proto.startTime);\n }\n if (proto.endTime) {\n m.endTime = new Date(proto.endTime);\n }\n if (proto.metricTypes) {\n m.metricTypes = proto.metricTypes.map(v => enumStringToValue(MetricType, v));\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.groupPathNodes !== 'undefined') {\n toReturn['groupPathNodes'] = this.groupPathNodes;\n }\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n if (typeof this.startTime !== 'undefined' && this.startTime !== null) {\n toReturn['startTime'] = 'toApiJson' in this.startTime ? this.startTime.toApiJson() : this.startTime;\n }\n if (typeof this.endTime !== 'undefined' && this.endTime !== null) {\n toReturn['endTime'] = 'toApiJson' in this.endTime ? this.endTime.toApiJson() : this.endTime;\n }\n if (typeof this.metricTypes !== 'undefined') {\n toReturn['metricTypes'] = this.metricTypes;\n }\n return toReturn;\n }\n}\nclass Insight {\n static fromProto(proto) {\n let m = new Insight();\n m = Object.assign(m, proto);\n if (proto.metricType) {\n m.metricType = enumStringToValue(MetricType, proto.metricType);\n }\n if (proto.totalValue) {\n m.totalValue = Metric.fromProto(proto.totalValue);\n }\n if (proto.deltaValue) {\n m.deltaValue = Metric.fromProto(proto.deltaValue);\n }\n if (proto.metrics) {\n m.metrics = proto.metrics.map(Metric.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.metricType !== 'undefined') {\n toReturn['metricType'] = this.metricType;\n }\n if (typeof this.totalValue !== 'undefined' && this.totalValue !== null) {\n toReturn['totalValue'] = 'toApiJson' in this.totalValue ? this.totalValue.toApiJson() : this.totalValue;\n }\n if (typeof this.deltaValue !== 'undefined' && this.deltaValue !== null) {\n toReturn['deltaValue'] = 'toApiJson' in this.deltaValue ? this.deltaValue.toApiJson() : this.deltaValue;\n }\n if (typeof this.metrics !== 'undefined' && this.metrics !== null) {\n toReturn['metrics'] = 'toApiJson' in this.metrics ? this.metrics.toApiJson() : this.metrics;\n }\n return toReturn;\n }\n}\nclass GetMultiTimeRangeResponseInsightsContainer {\n static fromProto(proto) {\n let m = new GetMultiTimeRangeResponseInsightsContainer();\n m = Object.assign(m, proto);\n if (proto.insights) {\n m.insights = InsightsResponse.fromProto(proto.insights);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.insights !== 'undefined' && this.insights !== null) {\n toReturn['insights'] = 'toApiJson' in this.insights ? this.insights.toApiJson() : this.insights;\n }\n return toReturn;\n }\n}\nclass InsightsResponse {\n static fromProto(proto) {\n let m = new InsightsResponse();\n m = Object.assign(m, proto);\n if (proto.insights) {\n m.insights = proto.insights.map(Insight.fromProto);\n }\n if (proto.locationCount) {\n m.locationCount = parseInt(proto.locationCount, 10);\n }\n if (proto.connectedLocationCount) {\n m.connectedLocationCount = parseInt(proto.connectedLocationCount, 10);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.insights !== 'undefined' && this.insights !== null) {\n toReturn['insights'] = 'toApiJson' in this.insights ? this.insights.toApiJson() : this.insights;\n }\n if (typeof this.locationCount !== 'undefined') {\n toReturn['locationCount'] = this.locationCount;\n }\n if (typeof this.connectedLocationCount !== 'undefined') {\n toReturn['connectedLocationCount'] = this.connectedLocationCount;\n }\n return toReturn;\n }\n}\nclass ListQuestionsRequest {\n static fromProto(proto) {\n let m = new ListQuestionsRequest();\n m = Object.assign(m, proto);\n if (proto.limit) {\n m.limit = parseInt(proto.limit, 10);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n if (typeof this.locationId !== 'undefined') {\n toReturn['locationId'] = this.locationId;\n }\n if (typeof this.includeAnswers !== 'undefined') {\n toReturn['includeAnswers'] = this.includeAnswers;\n }\n if (typeof this.onlyLatestVersion !== 'undefined') {\n toReturn['onlyLatestVersion'] = this.onlyLatestVersion;\n }\n if (typeof this.limit !== 'undefined') {\n toReturn['limit'] = this.limit;\n }\n if (typeof this.cursor !== 'undefined') {\n toReturn['cursor'] = this.cursor;\n }\n return toReturn;\n }\n}\nclass ListQuestionsResponse {\n static fromProto(proto) {\n let m = new ListQuestionsResponse();\n m = Object.assign(m, proto);\n if (proto.questions) {\n m.questions = proto.questions.map(Question.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.questions !== 'undefined' && this.questions !== null) {\n toReturn['questions'] = 'toApiJson' in this.questions ? this.questions.toApiJson() : this.questions;\n }\n if (typeof this.more !== 'undefined') {\n toReturn['more'] = this.more;\n }\n if (typeof this.cursor !== 'undefined') {\n toReturn['cursor'] = this.cursor;\n }\n return toReturn;\n }\n}\nclass Metric {\n static fromProto(proto) {\n let m = new Metric();\n m = Object.assign(m, proto);\n if (proto.value) {\n m.value = parseInt(proto.value, 10);\n }\n if (proto.timeDimension) {\n m.timeDimension = TimeDimension.fromProto(proto.timeDimension);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.value !== 'undefined') {\n toReturn['value'] = this.value;\n }\n if (typeof this.timeDimension !== 'undefined' && this.timeDimension !== null) {\n toReturn['timeDimension'] = 'toApiJson' in this.timeDimension ? this.timeDimension.toApiJson() : this.timeDimension;\n }\n return toReturn;\n }\n}\nclass PopulateGoogleBusinessProfilePerformanceMetricsRequest {\n static fromProto(proto) {\n let m = new PopulateGoogleBusinessProfilePerformanceMetricsRequest();\n m = Object.assign(m, proto);\n if (proto.startDate) {\n m.startDate = GoogleDate.fromProto(proto.startDate);\n }\n if (proto.endDate) {\n m.endDate = GoogleDate.fromProto(proto.endDate);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n if (typeof this.startDate !== 'undefined' && this.startDate !== null) {\n toReturn['startDate'] = 'toApiJson' in this.startDate ? this.startDate.toApiJson() : this.startDate;\n }\n if (typeof this.endDate !== 'undefined' && this.endDate !== null) {\n toReturn['endDate'] = 'toApiJson' in this.endDate ? this.endDate.toApiJson() : this.endDate;\n }\n return toReturn;\n }\n}\nclass PopulateGoogleBusinessProfileSearchKeywordsRequest {\n static fromProto(proto) {\n let m = new PopulateGoogleBusinessProfileSearchKeywordsRequest();\n m = Object.assign(m, proto);\n if (proto.startDate) {\n m.startDate = GoogleDate.fromProto(proto.startDate);\n }\n if (proto.endDate) {\n m.endDate = GoogleDate.fromProto(proto.endDate);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n if (typeof this.googleLocationId !== 'undefined') {\n toReturn['googleLocationId'] = this.googleLocationId;\n }\n if (typeof this.startDate !== 'undefined' && this.startDate !== null) {\n toReturn['startDate'] = 'toApiJson' in this.startDate ? this.startDate.toApiJson() : this.startDate;\n }\n if (typeof this.endDate !== 'undefined' && this.endDate !== null) {\n toReturn['endDate'] = 'toApiJson' in this.endDate ? this.endDate.toApiJson() : this.endDate;\n }\n return toReturn;\n }\n}\nclass QuestionIdentifier {\n static fromProto(proto) {\n let m = new QuestionIdentifier();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n if (typeof this.locationId !== 'undefined') {\n toReturn['locationId'] = this.locationId;\n }\n if (typeof this.questionId !== 'undefined') {\n toReturn['questionId'] = this.questionId;\n }\n if (typeof this.version !== 'undefined') {\n toReturn['version'] = this.version;\n }\n return toReturn;\n }\n}\nclass ReplaceAccountLocationRequest {\n static fromProto(proto) {\n let m = new ReplaceAccountLocationRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n if (typeof this.googleAccountId !== 'undefined') {\n toReturn['googleAccountId'] = this.googleAccountId;\n }\n if (typeof this.googleLocationId !== 'undefined') {\n toReturn['googleLocationId'] = this.googleLocationId;\n }\n return toReturn;\n }\n}\nclass ReplacePostInsightsHistoryRequest {\n static fromProto(proto) {\n let m = new ReplacePostInsightsHistoryRequest();\n m = Object.assign(m, proto);\n if (proto.postInsightsHistory) {\n m.postInsightsHistory = PostInsightsHistory.fromProto(proto.postInsightsHistory);\n }\n if (proto.fieldMask) {\n m.fieldMask = FieldMask.fromProto(proto.fieldMask);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.postInsightsHistory !== 'undefined' && this.postInsightsHistory !== null) {\n toReturn['postInsightsHistory'] = 'toApiJson' in this.postInsightsHistory ? this.postInsightsHistory.toApiJson() : this.postInsightsHistory;\n }\n if (typeof this.fieldMask !== 'undefined' && this.fieldMask !== null) {\n toReturn['fieldMask'] = 'toApiJson' in this.fieldMask ? this.fieldMask.toApiJson() : this.fieldMask;\n }\n return toReturn;\n }\n}\nclass ResourceId {\n static fromProto(proto) {\n let m = new ResourceId();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.groupPathNodes !== 'undefined') {\n toReturn['groupPathNodes'] = this.groupPathNodes;\n }\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n return toReturn;\n }\n}\nclass SyncDataRequest {\n static fromProto(proto) {\n let m = new SyncDataRequest();\n m = Object.assign(m, proto);\n if (proto.requestedAt) {\n m.requestedAt = new Date(proto.requestedAt);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.gmbInsightsJson !== 'undefined') {\n toReturn['gmbInsightsJson'] = this.gmbInsightsJson;\n }\n if (typeof this.requestedAt !== 'undefined' && this.requestedAt !== null) {\n toReturn['requestedAt'] = 'toApiJson' in this.requestedAt ? this.requestedAt.toApiJson() : this.requestedAt;\n }\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n return toReturn;\n }\n}\nclass TimeDimension {\n static fromProto(proto) {\n let m = new TimeDimension();\n m = Object.assign(m, proto);\n if (proto.timeRange) {\n m.timeRange = TimePeriod.fromProto(proto.timeRange);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.timeRange !== 'undefined' && this.timeRange !== null) {\n toReturn['timeRange'] = 'toApiJson' in this.timeRange ? this.timeRange.toApiJson() : this.timeRange;\n }\n return toReturn;\n }\n}\nclass TimePeriod {\n static fromProto(proto) {\n let m = new TimePeriod();\n m = Object.assign(m, proto);\n if (proto.startTime) {\n m.startTime = new Date(proto.startTime);\n }\n if (proto.period) {\n m.period = enumStringToValue(Period, proto.period);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.startTime !== 'undefined' && this.startTime !== null) {\n toReturn['startTime'] = 'toApiJson' in this.startTime ? this.startTime.toApiJson() : this.startTime;\n }\n if (typeof this.period !== 'undefined') {\n toReturn['period'] = this.period;\n }\n return toReturn;\n }\n}\n\n// *********************************\n// Code generated by sdkgen\n// DO NOT EDIT!.\n//\n// Objects Index.\n// *********************************\n\nconst environment = (window ? window['environment'] : 'prod') ?? 'prod';\nconst hostMap = {\n 'local': 'google-my-business-api.vendasta-local.com',\n 'test': '',\n 'demo': 'google-my-business-api-demo.apigateway.co',\n 'prod': 'google-my-business-api-prod.apigateway.co',\n 'production': 'google-my-business-api-prod.apigateway.co'\n};\nlet HostService = /*#__PURE__*/(() => {\n class HostService {\n get host() {\n return hostMap[environment.toLowerCase()];\n }\n get hostWithScheme() {\n return 'https://' + this.host;\n }\n }\n HostService.ɵfac = function HostService_Factory(t) {\n return new (t || HostService)();\n };\n HostService.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: HostService,\n factory: HostService.ɵfac,\n providedIn: 'root'\n });\n return HostService;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n// *********************************\n// Code generated by sdkgen\n// DO NOT EDIT!.\n//\n// API Service.\n// *********************************\nlet AccountApiService = /*#__PURE__*/(() => {\n class AccountApiService {\n constructor(http, hostService) {\n this.http = http;\n this.hostService = hostService;\n this._host = this.hostService.hostWithScheme;\n }\n apiOptions() {\n return {\n headers: new HttpHeaders({\n 'Content-Type': 'application/json'\n }),\n withCredentials: true\n };\n }\n getMultiAccountLocation(r) {\n const request = r.toApiJson ? r : new GetMultiAccountLocationRequest(r);\n return this.http.post(this._host + \"/gmb.v1.Account/GetMultiAccountLocation\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetMultiAccountLocationResponse.fromProto(resp)));\n }\n replaceAccountLocation(r) {\n const request = r.toApiJson ? r : new ReplaceAccountLocationRequest(r);\n return this.http.post(this._host + \"/gmb.v1.Account/ReplaceAccountLocation\", request.toApiJson(), {\n ...this.apiOptions(),\n observe: 'response'\n });\n }\n deleteAccountLocation(r) {\n const request = r.toApiJson ? r : new DeleteAccountLocationRequest(r);\n return this.http.post(this._host + \"/gmb.v1.Account/DeleteAccountLocation\", request.toApiJson(), {\n ...this.apiOptions(),\n observe: 'response'\n });\n }\n deletePost(r) {\n const request = r.toApiJson ? r : new DeletePostRequest(r);\n return this.http.post(this._host + \"/gmb.v1.Account/DeletePost\", request.toApiJson(), {\n ...this.apiOptions(),\n observe: 'response'\n });\n }\n }\n AccountApiService.ɵfac = function AccountApiService_Factory(t) {\n return new (t || AccountApiService)(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(HostService));\n };\n AccountApiService.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: AccountApiService,\n factory: AccountApiService.ɵfac,\n providedIn: 'root'\n });\n return AccountApiService;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n// *********************************\n// Code generated by sdkgen\n// DO NOT EDIT!.\n//\n// API Service.\n// *********************************\nlet BusinessCommunicationsApiService = /*#__PURE__*/(() => {\n class BusinessCommunicationsApiService {\n constructor(http, hostService) {\n this.http = http;\n this.hostService = hostService;\n this._host = this.hostService.hostWithScheme;\n }\n apiOptions() {\n return {\n headers: new HttpHeaders({\n 'Content-Type': 'application/json'\n }),\n withCredentials: true\n };\n }\n connectBusinessCommunications(r) {\n const request = r.toApiJson ? r : new ConnectBusinessCommunicationsRequest(r);\n return this.http.post(this._host + \"/gmb.v1.BusinessCommunications/ConnectBusinessCommunications\", request.toApiJson(), {\n ...this.apiOptions(),\n observe: 'response'\n });\n }\n unlaunchBusinessCommunicationsAgent(r) {\n const request = r.toApiJson ? r : new UnlaunchBusinessCommunicationsAgentRequest(r);\n return this.http.post(this._host + \"/gmb.v1.BusinessCommunications/UnlaunchBusinessCommunicationsAgent\", request.toApiJson(), {\n ...this.apiOptions(),\n observe: 'response'\n });\n }\n getBusinessLaunchStatus(r) {\n const request = r.toApiJson ? r : new GetBusinessLaunchStatusRequest(r);\n return this.http.post(this._host + \"/gmb.v1.BusinessCommunications/GetBusinessLaunchStatus\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetBusinessLaunchStatusResponse.fromProto(resp)));\n }\n canEnableBusinessCommunications(r) {\n const request = r.toApiJson ? r : new CanEnableBusinessCommunicationsRequest(r);\n return this.http.post(this._host + \"/gmb.v1.BusinessCommunications/CanEnableBusinessCommunications\", request.toApiJson(), this.apiOptions()).pipe(map(resp => CanEnableBusinessCommunicationsResponse.fromProto(resp)));\n }\n }\n BusinessCommunicationsApiService.ɵfac = function BusinessCommunicationsApiService_Factory(t) {\n return new (t || BusinessCommunicationsApiService)(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(HostService));\n };\n BusinessCommunicationsApiService.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: BusinessCommunicationsApiService,\n factory: BusinessCommunicationsApiService.ɵfac,\n providedIn: 'root'\n });\n return BusinessCommunicationsApiService;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n// *********************************\n// Code generated by sdkgen\n// DO NOT EDIT!.\n//\n// API Service.\n// *********************************\nlet BusinessMessagesApiService = /*#__PURE__*/(() => {\n class BusinessMessagesApiService {\n constructor(http, hostService) {\n this.http = http;\n this.hostService = hostService;\n this._host = this.hostService.hostWithScheme;\n }\n apiOptions() {\n return {\n headers: new HttpHeaders({\n 'Content-Type': 'application/json'\n }),\n withCredentials: true\n };\n }\n sendMessage(r) {\n const request = r.toApiJson ? r : new SendMessageRequest(r);\n return this.http.post(this._host + \"/gmb.v1.BusinessMessages/SendMessage\", request.toApiJson(), this.apiOptions()).pipe(map(resp => SendMessageResponse.fromProto(resp)));\n }\n createEvent(r) {\n const request = r.toApiJson ? r : new CreateEventRequest(r);\n return this.http.post(this._host + \"/gmb.v1.BusinessMessages/CreateEvent\", request.toApiJson(), this.apiOptions()).pipe(map(resp => CreateEventResponse.fromProto(resp)));\n }\n }\n BusinessMessagesApiService.ɵfac = function BusinessMessagesApiService_Factory(t) {\n return new (t || BusinessMessagesApiService)(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(HostService));\n };\n BusinessMessagesApiService.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: BusinessMessagesApiService,\n factory: BusinessMessagesApiService.ɵfac,\n providedIn: 'root'\n });\n return BusinessMessagesApiService;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n// *********************************\n// Code generated by sdkgen\n// DO NOT EDIT!.\n//\n// API Service.\n// *********************************\nlet GoogleMyBusinessClientLegacyAPIApiService = /*#__PURE__*/(() => {\n class GoogleMyBusinessClientLegacyAPIApiService {\n constructor(http, hostService) {\n this.http = http;\n this.hostService = hostService;\n this._host = this.hostService.hostWithScheme;\n }\n apiOptions() {\n return {\n headers: new HttpHeaders({\n 'Content-Type': 'application/json'\n }),\n withCredentials: true\n };\n }\n calculateInsightsByTimePeriod(r) {\n const request = r.toApiJson ? r : new CalculateInsightsByTimePeriodRequest(r);\n return this.http.post(this._host + \"/gmb.v1.GoogleMyBusinessClientLegacyAPI/CalculateInsightsByTimePeriod\", request.toApiJson(), this.apiOptions()).pipe(map(resp => CalculateInsightsByTimePeriodResponse.fromProto(resp)));\n }\n canRespondToReview(r) {\n const request = r.toApiJson ? r : new CanRespondToReviewRequest(r);\n return this.http.post(this._host + \"/gmb.v1.GoogleMyBusinessClientLegacyAPI/CanRespondToReview\", request.toApiJson(), this.apiOptions()).pipe(map(resp => CanRespondToReviewResponse.fromProto(resp)));\n }\n connect(r) {\n const request = r.toApiJson ? r : new ConnectRequest(r);\n return this.http.post(this._host + \"/gmb.v1.GoogleMyBusinessClientLegacyAPI/Connect\", request.toApiJson(), this.apiOptions()).pipe(map(resp => ConnectResponse.fromProto(resp)));\n }\n disconnect(r) {\n const request = r.toApiJson ? r : new DisconnectRequest(r);\n return this.http.post(this._host + \"/gmb.v1.GoogleMyBusinessClientLegacyAPI/Disconnect\", request.toApiJson(), {\n ...this.apiOptions(),\n observe: 'response'\n });\n }\n enableDisableSync(r) {\n const request = r.toApiJson ? r : new EnableDisableSyncRequest(r);\n return this.http.post(this._host + \"/gmb.v1.GoogleMyBusinessClientLegacyAPI/EnableDisableSync\", request.toApiJson(), this.apiOptions()).pipe(map(resp => EnableDisableSyncResponse.fromProto(resp)));\n }\n getAsSocialService(r) {\n const request = r.toApiJson ? r : new GetAsSocialServiceRequest(r);\n return this.http.post(this._host + \"/gmb.v1.GoogleMyBusinessClientLegacyAPI/GetAsSocialService\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetAsSocialServiceResponse.fromProto(resp)));\n }\n getConnections(r) {\n const request = r.toApiJson ? r : new GetConnectionsRequest(r);\n return this.http.post(this._host + \"/gmb.v1.GoogleMyBusinessClientLegacyAPI/GetConnections\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetConnectionsResponse.fromProto(resp)));\n }\n getConnection(r) {\n const request = r.toApiJson ? r : new GetConnectionRequest(r);\n return this.http.post(this._host + \"/gmb.v1.GoogleMyBusinessClientLegacyAPI/GetConnection\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetConnectionsResponse.fromProto(resp)));\n }\n getGoogleUser(r) {\n const request = r.toApiJson ? r : new GetGoogleUserRequest(r);\n return this.http.post(this._host + \"/gmb.v1.GoogleMyBusinessClientLegacyAPI/GetGoogleUser\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetGoogleUserResponse.fromProto(resp)));\n }\n }\n GoogleMyBusinessClientLegacyAPIApiService.ɵfac = function GoogleMyBusinessClientLegacyAPIApiService_Factory(t) {\n return new (t || GoogleMyBusinessClientLegacyAPIApiService)(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(HostService));\n };\n GoogleMyBusinessClientLegacyAPIApiService.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: GoogleMyBusinessClientLegacyAPIApiService,\n factory: GoogleMyBusinessClientLegacyAPIApiService.ɵfac,\n providedIn: 'root'\n });\n return GoogleMyBusinessClientLegacyAPIApiService;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n// *********************************\n// Code generated by sdkgen\n// DO NOT EDIT!.\n//\n// API Service.\n// *********************************\nlet InsightsApiService = /*#__PURE__*/(() => {\n class InsightsApiService {\n constructor(http, hostService) {\n this.http = http;\n this.hostService = hostService;\n this._host = this.hostService.hostWithScheme;\n }\n apiOptions() {\n return {\n headers: new HttpHeaders({\n 'Content-Type': 'application/json'\n }),\n withCredentials: true\n };\n }\n getTimeRange(r) {\n const request = r.toApiJson ? r : new GetTimeRangeRequest(r);\n return this.http.post(this._host + \"/gmb.v1.Insights/GetTimeRange\", request.toApiJson(), this.apiOptions()).pipe(map(resp => InsightsResponse.fromProto(resp)));\n }\n getMultiTimeRange(r) {\n const request = r.toApiJson ? r : new GetMultiTimeRangeRequest(r);\n return this.http.post(this._host + \"/gmb.v1.Insights/GetMultiTimeRange\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetMultiTimeRangeResponse.fromProto(resp)));\n }\n replacePostInsightsHistory(r) {\n const request = r.toApiJson ? r : new ReplacePostInsightsHistoryRequest(r);\n return this.http.post(this._host + \"/gmb.v1.Insights/ReplacePostInsightsHistory\", request.toApiJson(), {\n ...this.apiOptions(),\n observe: 'response'\n });\n }\n }\n InsightsApiService.ɵfac = function InsightsApiService_Factory(t) {\n return new (t || InsightsApiService)(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(HostService));\n };\n InsightsApiService.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: InsightsApiService,\n factory: InsightsApiService.ɵfac,\n providedIn: 'root'\n });\n return InsightsApiService;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n// *********************************\n// Code generated by sdkgen\n// DO NOT EDIT!.\n//\n// API Service.\n// *********************************\nlet InsightsSyncApiService = /*#__PURE__*/(() => {\n class InsightsSyncApiService {\n constructor(http, hostService) {\n this.http = http;\n this.hostService = hostService;\n this._host = this.hostService.hostWithScheme;\n }\n apiOptions() {\n return {\n headers: new HttpHeaders({\n 'Content-Type': 'application/json'\n }),\n withCredentials: true\n };\n }\n syncData(r) {\n const request = r.toApiJson ? r : new SyncDataRequest(r);\n return this.http.post(this._host + \"/gmb.v1.InsightsSync/SyncData\", request.toApiJson(), {\n ...this.apiOptions(),\n observe: 'response'\n });\n }\n populateGoogleBusinessProfilePerformanceMetrics(r) {\n const request = r.toApiJson ? r : new PopulateGoogleBusinessProfilePerformanceMetricsRequest(r);\n return this.http.post(this._host + \"/gmb.v1.InsightsSync/PopulateGoogleBusinessProfilePerformanceMetrics\", request.toApiJson(), {\n ...this.apiOptions(),\n observe: 'response'\n });\n }\n populateGoogleBusinessProfileSearchKeywords(r) {\n const request = r.toApiJson ? r : new PopulateGoogleBusinessProfileSearchKeywordsRequest(r);\n return this.http.post(this._host + \"/gmb.v1.InsightsSync/PopulateGoogleBusinessProfileSearchKeywords\", request.toApiJson(), {\n ...this.apiOptions(),\n observe: 'response'\n });\n }\n }\n InsightsSyncApiService.ɵfac = function InsightsSyncApiService_Factory(t) {\n return new (t || InsightsSyncApiService)(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(HostService));\n };\n InsightsSyncApiService.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: InsightsSyncApiService,\n factory: InsightsSyncApiService.ɵfac,\n providedIn: 'root'\n });\n return InsightsSyncApiService;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n// *********************************\n// Code generated by sdkgen\n// DO NOT EDIT!.\n//\n// API Service.\n// *********************************\nlet QuestionAnswerApiService = /*#__PURE__*/(() => {\n class QuestionAnswerApiService {\n constructor(http, hostService) {\n this.http = http;\n this.hostService = hostService;\n this._host = this.hostService.hostWithScheme;\n }\n apiOptions() {\n return {\n headers: new HttpHeaders({\n 'Content-Type': 'application/json'\n }),\n withCredentials: true\n };\n }\n listQuestions(r) {\n const request = r.toApiJson ? r : new ListQuestionsRequest(r);\n return this.http.post(this._host + \"/gmb.v1.QuestionAnswer/ListQuestions\", request.toApiJson(), this.apiOptions()).pipe(map(resp => ListQuestionsResponse.fromProto(resp)));\n }\n getQuestion(r) {\n const request = r.toApiJson ? r : new GetQuestionRequest(r);\n return this.http.post(this._host + \"/gmb.v1.QuestionAnswer/GetQuestion\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetQuestionResponse.fromProto(resp)));\n }\n getMultiQuestions(r) {\n const request = r.toApiJson ? r : new GetMultiQuestionsRequest(r);\n return this.http.post(this._host + \"/gmb.v1.QuestionAnswer/GetMultiQuestions\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetMultiQuestionsResponse.fromProto(resp)));\n }\n createAnswer(r) {\n const request = r.toApiJson ? r : new CreateAnswerRequest(r);\n return this.http.post(this._host + \"/gmb.v1.QuestionAnswer/CreateAnswer\", request.toApiJson(), this.apiOptions()).pipe(map(resp => CreateAnswerResponse.fromProto(resp)));\n }\n createQuestion(r) {\n const request = r.toApiJson ? r : new CreateQuestionRequest(r);\n return this.http.post(this._host + \"/gmb.v1.QuestionAnswer/CreateQuestion\", request.toApiJson(), this.apiOptions()).pipe(map(resp => CreateQuestionResponse.fromProto(resp)));\n }\n getQuestionAnswerStats(r) {\n const request = r.toApiJson ? r : new GetQuestionAnswerStatsRequest(r);\n return this.http.post(this._host + \"/gmb.v1.QuestionAnswer/GetQuestionAnswerStats\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetQuestionAnswerStatsResponse.fromProto(resp)));\n }\n }\n QuestionAnswerApiService.ɵfac = function QuestionAnswerApiService_Factory(t) {\n return new (t || QuestionAnswerApiService)(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(HostService));\n };\n QuestionAnswerApiService.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: QuestionAnswerApiService,\n factory: QuestionAnswerApiService.ɵfac,\n providedIn: 'root'\n });\n return QuestionAnswerApiService;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n// *********************************\n// Code generated by sdkgen\n// DO NOT EDIT!.\n//\n// Index.\n// *********************************\nlet QuestionAndAnswerService = /*#__PURE__*/(() => {\n class QuestionAndAnswerService {\n constructor(_api) {\n this._api = _api;\n }\n listQuestions(accountGroupId, cursor, includeAnswers, limit, locationId, onlyLatestVersion) {\n const request = {\n accountGroupId: accountGroupId,\n cursor: cursor,\n includeAnswers: includeAnswers,\n limit: limit,\n locationId: locationId,\n onlyLatestVersion: onlyLatestVersion\n };\n return this._api.listQuestions(request);\n }\n createAnswer(accountGroupId, socialProfileId, locationPathName, questionId, text) {\n const request = {\n accountGroupId: accountGroupId,\n socialProfileId: socialProfileId,\n locationPathName: locationPathName,\n questionId: questionId,\n text: text\n };\n return this._api.createAnswer(request);\n }\n createQuestion(partnerId, accountGroupId, socialProfileId, locationPathName, text) {\n const request = {\n accountGroupId: accountGroupId,\n socialProfileId: socialProfileId,\n locationPathName: locationPathName,\n partnerId: partnerId,\n text: text\n };\n return this._api.createQuestion(request);\n }\n getMultiQuestions(questionIds, includeAnswers) {\n const request = {\n questionIds: questionIds,\n includeAnswers: includeAnswers\n };\n return this._api.getMultiQuestions(request);\n }\n getQuestion(accountGroupId, locationId, questionId, includeAnswers, onlyLatestVersion) {\n const request = {\n accountGroupId: accountGroupId,\n locationId: locationId,\n questionId: questionId,\n includeAnswers: includeAnswers,\n onlyLatestVersion: onlyLatestVersion\n };\n return this._api.getQuestion(request);\n }\n getQuestionAnswerStats(accountGroupId, locationId) {\n const request = {\n accountGroupId: accountGroupId,\n locationId: locationId\n };\n return this._api.getQuestionAnswerStats(request);\n }\n }\n QuestionAndAnswerService.ɵfac = function QuestionAndAnswerService_Factory(t) {\n return new (t || QuestionAndAnswerService)(i0.ɵɵinject(QuestionAnswerApiService));\n };\n QuestionAndAnswerService.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: QuestionAndAnswerService,\n factory: QuestionAndAnswerService.ɵfac,\n providedIn: 'root'\n });\n return QuestionAndAnswerService;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { Answer, BusinessCommunicationsApiService, GetMultiQuestionsResponse, GetQuestionResponse, Question, QuestionAndAnswerService, QuestionAnswerApiService, QuestionIdentifier };\n","import { HttpErrorResponse, HttpStatusCode } from '@angular/common/http';\nimport { inject, Injectable } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { BusinessCommunicationsApiService } from '@vendasta/google-my-business';\nimport { addDays, isBefore } from 'date-fns';\nimport { combineLatest, Observable, of, catchError, map, switchMap } from 'rxjs';\nimport { ConversationDetail } from '../interface/conversation.interface';\nimport {\n ACCOUNT_GROUP_ID_TOKEN,\n CONVERSATION_GOOGLE_BUSINESS_MESSAGES_AVAILABLE_TOKEN,\n PARTNER_ID_TOKEN,\n} from '../tokens';\nimport { AlertOptions, ConversationChannelService } from './conversation-channel.abstract';\n\nexport enum BusinessMessagesEnabledState {\n IS_ENABLED = 'IS_ENABLED',\n INVALID_TOKEN = 'INVALID_TOKEN',\n NOT_ENABLED = 'NOT_ENABLED',\n NOT_LAUNCHED = 'NOT_LAUNCHED',\n CONVERSATION_EXPIRED = 'CONVERSATION_EXPIRED',\n UNKNOWN_ERROR = 'UNKNOWN_ERROR',\n}\n\n@Injectable()\nexport class ConversationGoogleService extends ConversationChannelService {\n private readonly partnerId$: Observable = inject(PARTNER_ID_TOKEN);\n readonly accountGroupId$: Observable = inject(ACCOUNT_GROUP_ID_TOKEN);\n\n private router = inject(Router);\n private readonly googleMyBusinessService = inject(BusinessCommunicationsApiService);\n private readonly googleBusinessMessagesAvailable$ = inject(CONVERSATION_GOOGLE_BUSINESS_MESSAGES_AVAILABLE_TOKEN);\n\n getChatComposerAlert(\n partnerId: string,\n accountGroupId: string,\n conversationDetail: ConversationDetail,\n ): Observable {\n return this.canSendGoogleBusinessMessage(partnerId, accountGroupId, conversationDetail).pipe(\n map((canSend) => {\n if (canSend === BusinessMessagesEnabledState.IS_ENABLED) {\n return null;\n }\n\n return this.getGoogleBusinessMessagesError(canSend, accountGroupId);\n }),\n );\n }\n\n private getGoogleBusinessMessagesError(\n enabledState: BusinessMessagesEnabledState,\n accountGroup: string,\n ): AlertOptions {\n let alert: AlertOptions;\n\n switch (enabledState) {\n case BusinessMessagesEnabledState.NOT_ENABLED:\n alert = {\n title: 'INBOX.SETTINGS.GOOGLE_BUSINESS_MESSAGES.STATUS.NOT_ENABLED.TITLE',\n description: 'INBOX.SETTINGS.GOOGLE_BUSINESS_MESSAGES.STATUS.NOT_ENABLED.DESCRIPTION',\n };\n break;\n case BusinessMessagesEnabledState.INVALID_TOKEN:\n alert = {\n title: 'INBOX.SETTINGS.GOOGLE_BUSINESS_MESSAGES.GOOGLE_BUSINESS_PROFILE',\n description: 'INBOX.SETTINGS.GOOGLE_BUSINESS_MESSAGES.PROFILE_DISCONNECTED',\n action: {\n title: 'INBOX.SETTINGS.GOOGLE_BUSINESS_MESSAGES.ACTIONS.GO_TO_SETTINGS',\n callback: () => this.router.navigate([`/account/location/${accountGroup}/settings/inbox`]),\n },\n };\n break;\n case BusinessMessagesEnabledState.CONVERSATION_EXPIRED:\n alert = {\n title: 'INBOX.SETTINGS.GOOGLE_BUSINESS_MESSAGES.STATUS.EXPIRED_CONVERSATION.TITLE',\n description: 'INBOX.SETTINGS.GOOGLE_BUSINESS_MESSAGES.STATUS.EXPIRED_CONVERSATION.DESCRIPTION',\n };\n break;\n case BusinessMessagesEnabledState.NOT_LAUNCHED:\n alert = {\n title: 'INBOX.SETTINGS.GOOGLE_BUSINESS_MESSAGES.STATUS.NOT_LAUNCHED.TITLE',\n description: 'INBOX.SETTINGS.GOOGLE_BUSINESS_MESSAGES.STATUS.NOT_LAUNCHED.DESCRIPTION',\n action: {\n title: 'INBOX.SETTINGS.GOOGLE_BUSINESS_MESSAGES.ACTIONS.GO_TO_SETTINGS',\n callback: () => this.router.navigate([`/account/location/${accountGroup}/settings/inbox`]),\n },\n };\n break;\n case BusinessMessagesEnabledState.UNKNOWN_ERROR:\n default:\n alert = {\n title: 'INBOX.SETTINGS.GOOGLE_BUSINESS_MESSAGES.STATUS.UNKNOWN_ERROR.TITLE',\n description: 'INBOX.SETTINGS.GOOGLE_BUSINESS_MESSAGES.STATUS.UNKNOWN_ERROR.DESCRIPTION',\n };\n }\n\n return alert;\n }\n\n private canSendGoogleBusinessMessage(\n partnerId: string,\n accountGroupId: string,\n conversationDetail?: ConversationDetail,\n ): Observable {\n const expirationDate = addDays(conversationDetail.latestMessage?.updated, 30);\n const currentDate = new Date();\n\n const launchStatus$: Observable = this.googleMyBusinessService\n .getBusinessLaunchStatus({\n partnerId: partnerId,\n accountGroupId: accountGroupId,\n })\n .pipe(\n map((res) =>\n res.isLaunched ? BusinessMessagesEnabledState.IS_ENABLED : BusinessMessagesEnabledState.NOT_LAUNCHED,\n ),\n catchError((error) => {\n if (error instanceof HttpErrorResponse && error.status === HttpStatusCode.PreconditionFailed) {\n return of(BusinessMessagesEnabledState.INVALID_TOKEN);\n }\n return of(BusinessMessagesEnabledState.UNKNOWN_ERROR);\n }),\n );\n\n return combineLatest([this.googleBusinessMessagesAvailable$, launchStatus$]).pipe(\n map(([googleBusinessMessagesAvailable, launched]) => {\n if (isBefore(expirationDate, currentDate)) {\n return BusinessMessagesEnabledState.CONVERSATION_EXPIRED;\n }\n if (!googleBusinessMessagesAvailable) return BusinessMessagesEnabledState.NOT_ENABLED;\n return launched;\n }),\n );\n }\n\n readonly isGoogleBusinessMessagesEnabled$: Observable = combineLatest([\n this.partnerId$,\n this.accountGroupId$,\n ]).pipe(\n switchMap(([partnerId, accountGroupId]) =>\n this.googleMyBusinessService.getBusinessLaunchStatus({ partnerId, accountGroupId }),\n ),\n map((res) => res.isLaunched),\n catchError(() => of(false)),\n );\n}\n","import { inject, Injectable } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { RegistrationStage, SmsRegistrationService } from '@galaxy/sms';\nimport { combineLatest, map, Observable } from 'rxjs';\nimport { InboxService } from '../inbox.service';\nimport { ConversationDetail } from '../interface/conversation.interface';\nimport { CONVERSATION_COUNTRY_TOKEN, CONVERSATION_SMS_ENABLED_TOKEN } from '../tokens';\nimport { AlertOptions, ConversationChannelService } from './conversation-channel.abstract';\n\n@Injectable()\nexport class ConversationSMSService extends ConversationChannelService {\n private router = inject(Router);\n private readonly smsRegistrationService = inject(SmsRegistrationService);\n private readonly inboxService = inject(InboxService);\n private readonly country$ = inject(CONVERSATION_COUNTRY_TOKEN);\n private readonly smsEnabled$ = inject(CONVERSATION_SMS_ENABLED_TOKEN);\n\n getChatComposerAlert(\n partnerId: string,\n accountGroupId: string,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n conversationDetail?: ConversationDetail,\n ): Observable {\n const stage$ = this.smsRegistrationService.registrationStage$;\n const SMSNumber$ = this.inboxService.SMSNumber$;\n return combineLatest([this.country$, this.smsEnabled$, stage$, SMSNumber$]).pipe(\n map(([accountGroupCountry, smsEnabled, stage, smsNumber]) => {\n const country = accountGroupCountry?.toLowerCase() || '';\n if (!smsEnabled) {\n return this.getSMSMessageEnabledError();\n }\n if (!smsNumber) {\n return this.getSMSMPhoneNumberError();\n }\n if (country != 'us' && smsNumber) {\n return null;\n }\n return stage !== RegistrationStage.RegistrationComplete ? this.getSMSRegistrationError(accountGroupId) : null;\n }),\n );\n }\n\n private getSMSRegistrationError(accountGroupId: string): AlertOptions {\n return {\n title: 'INBOX.SETTINGS.SMS_MESSAGES.COMPOSER_A2P_REGISTRATION_REQUIRED.TITLE',\n description: 'INBOX.SETTINGS.SMS_MESSAGES.COMPOSER_A2P_REGISTRATION_REQUIRED.DESCRIPTION',\n action: {\n title: 'INBOX.SETTINGS.SMS_MESSAGES.COMPOSER_A2P_REGISTRATION_REQUIRED.ACTION_TITLE',\n callback: () => this.router.navigate([`/account/location/${accountGroupId}/settings/inbox/sms-registration`]),\n },\n };\n }\n\n private getSMSMessageEnabledError(): AlertOptions {\n return {\n title: 'INBOX.SETTINGS.SMS_MESSAGES.NOT_ENABLED.TITLE',\n description: 'INBOX.SETTINGS.SMS_MESSAGES.NOT_ENABLED.DESCRIPTION',\n };\n }\n\n private getSMSMPhoneNumberError(): AlertOptions {\n return {\n title: 'INBOX.SETTINGS.SMS_MESSAGES.NO_PHONE_NUMBER.TITLE',\n description: 'INBOX.SETTINGS.SMS_MESSAGES.NO_PHONE_NUMBER.DESCRIPTION',\n };\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { RegistrationStage, SmsRegistrationService } from '@galaxy/sms';\nimport { TranslateService } from '@ngx-translate/core';\nimport { ConversationApiService, ConversationChannel, ParticipantType, Widget } from '@vendasta/conversation';\nimport { CountryCode, NumberFormat, formatNumber } from 'libphonenumber-js';\nimport { Observable, catchError, combineLatest, map, of, shareReplay, switchMap } from 'rxjs';\nimport { InboxService } from '../inbox.service';\nimport { ConversationDetail } from '../interface/conversation.interface';\nimport { ACCOUNT_GROUP_ID_TOKEN, CONVERSATION_COUNTRY_TOKEN } from '../tokens';\nimport { AlertOptions, ConversationChannelService } from './conversation-channel.abstract';\n\n@Injectable()\nexport class ConversationWebchatService extends ConversationChannelService {\n private readonly translationService = inject(TranslateService);\n private readonly inboxService = inject(InboxService);\n private readonly country$ = inject(CONVERSATION_COUNTRY_TOKEN);\n private readonly smsRegistrationService = this.inboxService.isBusinessApp ? inject(SmsRegistrationService) : null;\n\n getChatComposerAlert(\n partnerId: string,\n accountGroupId: string,\n conversationDetail: ConversationDetail,\n ): Observable {\n if (conversationDetail.conversation.channel !== ConversationChannel.CONVERSATION_CHANNEL_WEB_CHAT) return of(null);\n\n const anonymousParticipant = conversationDetail?.participants?.find(\n (participant) => participant.participantType === ParticipantType.PARTICIPANT_TYPE_ANONYMOUS,\n );\n if (anonymousParticipant) return of(this.contactInfoMissingError());\n\n // should only one customer in one specific webchat conversation\n const customerParticipant = conversationDetail?.participants?.find(\n (participant) => participant.participantType === ParticipantType.PARTICIPANT_TYPE_CUSTOMER,\n );\n if (!customerParticipant || (!customerParticipant.phoneNumber && !customerParticipant.email))\n return of(this.contactInfoMissingError());\n\n return this.country$.pipe(\n switchMap((country) => {\n if (!this.smsRegistrationService || !customerParticipant.phoneNumber) {\n return of(this.smsNotAvailableError(customerParticipant.phoneNumber, customerParticipant.email, country));\n }\n\n return combineLatest([this.inboxService.SMSNumber$, this.smsRegistrationService.registrationStage$]).pipe(\n map(([smsNumber, registrationStage]) => {\n if (!smsNumber && registrationStage != RegistrationStage.RegistrationComplete) {\n return this.smsNotAvailableError(customerParticipant.phoneNumber, customerParticipant.email, country);\n }\n return null;\n }),\n );\n }),\n );\n }\n\n private contactInfoMissingError(): AlertOptions {\n return {\n title: 'INBOX.WEBCHAT.SETTINGS.WEBCHAT_DISABLED_MISSING_CONTACT_INFO',\n };\n }\n\n private smsNotAvailableError(phoneNumber: string, email: string, country: string): AlertOptions {\n if (!phoneNumber) {\n return {\n title: this.translationService.instant('INBOX.WEBCHAT.SETTINGS.WEBCHAT_DISABLED_NO_SMS_EMAIL', {\n email: email,\n }),\n };\n }\n const countryCode = country.toUpperCase() as CountryCode;\n let phone = '';\n try {\n phone = formatNumber(phoneNumber, countryCode, 'NATIONAL' as NumberFormat);\n } catch (error) {\n // fallback to US if country code is not valid\n phone = formatNumber(phoneNumber, 'US' as CountryCode, 'NATIONAL' as NumberFormat);\n }\n if (email) {\n return {\n title: this.translationService.instant('INBOX.WEBCHAT.SETTINGS.WEBCHAT_DISABLED_NO_SMS_EMAIL_PHONE', {\n phone: phone,\n email: email,\n }),\n };\n }\n return {\n title: this.translationService.instant('INBOX.WEBCHAT.SETTINGS.WEBCHAT_DISABLED_NO_SMS_PHONE', {\n phone: phone,\n }),\n };\n }\n\n private readonly conversationApiService = inject(ConversationApiService);\n private accountGroupId$ = inject(ACCOUNT_GROUP_ID_TOKEN);\n\n readonly webchats$: Observable = this.accountGroupId$.pipe(\n switchMap((accountGroupId) => this.conversationApiService.listWidgets({ namespace: accountGroupId })),\n map((listWidgets) => listWidgets?.widgets),\n shareReplay({ bufferSize: 1, refCount: true }),\n catchError(async () => {\n return [];\n }),\n );\n\n readonly isAnyWebchatEnabled$ = this.webchats$.pipe(\n map((webchats) => {\n if (webchats) {\n return webchats.some((webchat) => webchat.isEnabled);\n }\n return false;\n }),\n );\n}\n","import { NgZone, inject } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { Router } from '@angular/router';\nimport { Conversation, ConversationChannel, PlatformLocation } from '@vendasta/conversation';\nimport { FIRESTORE_CONVERSATION_LIMIT, POSTHOG_CHANNEL_NAME } from './conversation.constants';\nimport { PlatformLocationToSKey } from './inbox-terms-of-service.service';\nimport { FOLLOWING_VIEW_ID } from './inbox.constants';\nimport { ConversationDetail } from './interface/conversation.interface';\nimport { CONVERSATION_ROUTES_TOKEN } from './tokens';\n\n/**\n * conversation was not seen if the participant isn't in the `lastSeenTimeByParticipantField` or `lastSeenTime` of the participant is less than `latestMsgSentTime`\n * @param {FirestoreConversation} conversation - the conversation\n */\nexport function conversationUnseen(conversation: Conversation, participantId: string): boolean {\n if (!conversation?.latestMsgSentTime) {\n return false;\n }\n\n if (!participantId) {\n return true;\n } else {\n const lastSeenTimeByParticipant = conversation?.lastSeenByParticipant?.find(\n (lastSeenByParticipant) => lastSeenByParticipant?.participantId === participantId,\n );\n return !lastSeenTimeByParticipant || lastSeenTimeByParticipant?.lastSeenTime < conversation?.latestMsgSentTime;\n }\n}\n\nexport function hasAccessByCountry(accountGroupCountry: string): boolean {\n // https://address-demo.apigateway.co/address.v1.Address/ListAllCountryOptions\n // Australia - AU / United Kingdom - GB\n const availableCountries = ['CA', 'US'];\n\n if (accountGroupCountry !== '' && availableCountries.includes(accountGroupCountry)) {\n return true;\n }\n\n return false;\n}\n\nexport function getConversationByContactID(contactID: string, conversations: ConversationDetail[]): ConversationDetail {\n let contactHasConversation: ConversationDetail = null;\n\n conversationsLoop: for (let i = 0; i < conversations.length; i++) {\n const conversation = conversations[i];\n for (let j = 0; j < conversation.participants.length; j++) {\n const participant = conversation.participants[j];\n if (participant?.internalParticipantId === contactID) {\n contactHasConversation = conversation;\n break conversationsLoop;\n }\n }\n }\n\n return contactHasConversation;\n}\n\nexport function getPlatformLocationToSKey(platformLocation: PlatformLocation): PlatformLocationToSKey {\n switch (platformLocation) {\n case PlatformLocation.PLATFORM_LOCATION_VENDOR_CENTER:\n case PlatformLocation.PLATFORM_LOCATION_PARTNER_CENTER:\n case PlatformLocation.PLATFORM_LOCATION_TASK_MANAGER:\n case PlatformLocation.PLATFORM_LOCATION_SALES_CENTER:\n return { partnerId: 'ALL', feature: 'inbox-platform' };\n case PlatformLocation.PLATFORM_LOCATION_BUSINESS_APP:\n return { partnerId: 'ALL', feature: 'inbox-conversation' };\n }\n}\n\n/**\n * Concat two URLs to generate an unique URL with both strings\n * @param {string} entryUrl - entry Url\n * @param {string} nextUrl - next Url\n * @return {string} - composed URL\n */\nexport function addNextUrl(entryUrl: string, nextUrl: string): string {\n if (!('URL' in window)) {\n return entryUrl + `?nextUrl=${encodeURIComponent(nextUrl)}`;\n }\n const urlObj = new URL(entryUrl);\n const params = new URLSearchParams(urlObj.search);\n params.append('nextUrl', nextUrl);\n urlObj.search = params.toString();\n return urlObj.toString();\n}\n\n/**\n * Create a following view id from a participant\n */\nexport function getFollowViewID(participantID: string): string {\n return participantID + ':' + FOLLOWING_VIEW_ID;\n}\n\nexport function extractCurrentLocation(platformLocationsEnabled: PlatformLocation[]): PlatformLocation {\n const currentLocation = platformLocationsEnabled?.length > 0 ? platformLocationsEnabled[0] : null;\n if (!currentLocation) {\n throw new Error(\n 'You need to set up the platformLocationsEnabled in the ConversationConfig. To fix see documentation in the README of @galaxy/conversation/core',\n );\n }\n return currentLocation;\n}\n\n/**\n * Format the number of unread conversations by view to display\n */\nexport function formatUnreadConversationsCount(count: number, limit = FIRESTORE_CONVERSATION_LIMIT): string {\n if (!count || count === 0) {\n return '';\n }\n return count < limit ? count.toString() : `${limit}+`;\n}\n\nconst ID_PREFIX = 'CONVERSATION-';\n\nexport function toFirestoreId(id: string): string {\n return id.replace(ID_PREFIX, '');\n}\n\nexport function fromFirestoreId(id: string): string {\n if (id && id.startsWith(ID_PREFIX)) {\n return id;\n }\n return ID_PREFIX + id;\n}\n\nexport const redirectToConversationFactory = () => {\n const zone = inject(NgZone);\n const router = inject(Router);\n const routes = toSignal(inject(CONVERSATION_ROUTES_TOKEN));\n\n return (conversationId: string) => {\n zone.run(() => {\n router.navigate([routes().root + '/inbox/channel', toFirestoreId(conversationId)]);\n });\n };\n};\n\nexport function getPosthogChannelName(channel: ConversationChannel): string {\n return POSTHOG_CHANNEL_NAME.get(channel);\n}\n","import { Injectable, inject } from '@angular/core';\nimport {\n FirestoreInstances,\n Query,\n Timestamp,\n collection,\n collectionData,\n doc,\n docData,\n orderBy,\n query,\n where,\n} from '@angular/fire/firestore';\nimport { EnvironmentService } from '@galaxy/core';\nimport { Observable } from 'rxjs';\nimport { ConversationFilters } from './conversation-filters';\nimport { DELETED_TIMESTAMP_FIRESTORE } from './conversation.constants';\nimport { ConversationEvent, ConversationMessage, FirestoreConversation } from './interface/conversation.interface';\n\nconst validOriginAppLocations = ['business_app', 'partner_center', 'sales_center', 'vendor_center', 'task_manager'];\n\nconst getFirestore = (name: string) => {\n const fsi = inject(FirestoreInstances);\n return fsi.find((fs) => fs.app.name === name);\n};\n\n@Injectable()\nexport class FirestoreService {\n private firestore = getFirestore('inbox');\n private firestoreRootPath = `conversation/env/${this.environmentService.getEnvironmentString()}`;\n\n constructor(private readonly environmentService: EnvironmentService) {}\n\n private getFirestoreMessagesRootPath(conversationDocId: string): string {\n return `${this.firestoreRootPath}/${conversationDocId}/messages`;\n }\n\n private getFirestoreEventsRootPath(conversationDocId: string): string {\n return `${this.firestoreRootPath}/${conversationDocId}/events`;\n }\n\n conversation$(conversationDocId: string) {\n return docData(doc(this.firestore, `${this.firestoreRootPath}/${conversationDocId}`));\n }\n\n setupBaseConversationsQuery(\n organizationId: string,\n filters?: ConversationFilters | null,\n groupId?: string | null,\n skipIsOpenInQuery = false,\n skipIsAnonymousInQuery = false,\n ): Query {\n let q = query(\n collection(this.firestore, this.firestoreRootPath),\n where('deleted', '==', DELETED_TIMESTAMP_FIRESTORE),\n );\n\n if (groupId) {\n q = query(q, where('subjectParticipantIds', 'array-contains', groupId));\n } else {\n q = query(q, where('subjectParticipantKeyIds', 'array-contains', organizationId));\n }\n\n // Anonymous should show all anonymous conversations regardless of if they've been closed\n if (!skipIsOpenInQuery && !filters?.isAnonymous) {\n q = query(q, where('isOpen', '==', filters?.isOpen ?? true));\n }\n\n if (!skipIsAnonymousInQuery) {\n q = query(q, where('isAnonymous', '==', filters?.isAnonymous ?? false));\n }\n\n return query(\n q,\n where('originApp', 'in', validOriginAppLocations),\n where('hasMessage', '==', true),\n where('originAppExternalID', '==', ''),\n orderBy('latestMsgSentTime', 'desc'),\n );\n }\n\n loadOrgRelatedConversationsQuery(organizationId: string): Query {\n const q = this.setupBaseConversationsQuery(organizationId);\n return query(q, where('channel', '==', 'platform'));\n }\n\n messages$(docId: string) {\n return collectionData(\n query(\n collection(this.firestore, this.getFirestoreMessagesRootPath(docId)),\n where('deleted', '==', DELETED_TIMESTAMP_FIRESTORE),\n orderBy('created', 'desc'),\n ),\n { idField: 'id' },\n ) as Observable;\n }\n\n webchatMessages$(docId: string) {\n return collectionData(\n query(\n collection(this.firestore, this.getFirestoreMessagesRootPath(docId)),\n where('deleted', '==', DELETED_TIMESTAMP_FIRESTORE),\n where('channel', '==', 'WebChat'),\n where('type', '==', 'message'),\n orderBy('created', 'desc'),\n ),\n { idField: 'id' },\n ) as Observable;\n }\n\n events$(docId: string) {\n return collectionData(\n query(collection(this.firestore, this.getFirestoreEventsRootPath(docId)), orderBy('happenedAt', 'desc')),\n ) as Observable;\n }\n\n getViewsConversationsQuery(\n participantId: string,\n viewId: string,\n latestMsgSentTime?: Timestamp,\n ): Query {\n let q = query(\n collection(this.firestore, this.firestoreRootPath),\n where('deleted', '==', DELETED_TIMESTAMP_FIRESTORE),\n where('conversationViewIds', 'array-contains', participantId + ':' + viewId),\n where('originApp', 'in', validOriginAppLocations),\n );\n if (latestMsgSentTime) {\n q = query(q, where('latestMsgSentTime', '<=', latestMsgSentTime));\n }\n return query(\n q,\n where('hasMessage', '==', true),\n where('originAppExternalID', '==', ''),\n orderBy('latestMsgSentTime', 'desc'),\n );\n }\n\n getUnreadConversationsByView(participantId: string, viewId: string): Query {\n return query(\n collection(this.firestore, this.firestoreRootPath),\n where('deleted', '==', DELETED_TIMESTAMP_FIRESTORE),\n where('unreadConversationViewIds', 'array-contains', participantId + ':' + viewId),\n where('originApp', 'in', validOriginAppLocations),\n where('hasMessage', '==', true),\n where('originAppExternalID', '==', ''),\n );\n }\n}\n","import {\n ConversationChannel,\n GetMultiConversationDetailsResponseDetailedConversation,\n MediaInterface,\n MessageType,\n Participant,\n ParticipantType,\n PlatformLocation,\n SendStatusInterface,\n} from '@vendasta/conversation';\nimport { BadgeColor } from '@vendasta/galaxy/badge/src/badge.component';\nimport { Timestamp } from 'firebase/firestore';\nexport { SubjectParticipant } from '@vendasta/conversation';\n\nexport interface FirestoreConversation {\n id?: string;\n conversationId?: string;\n externalConversationId?: string;\n previewContent?: string;\n channel?: ConversationChannel;\n /**\n * @deprecated This property exists for historical compatibility. Use subjectParticipantsKey instead.\n */\n accountGroupId?: string;\n /**\n * @deprecated This property exists for historical compatibility. Use subjectParticipantsKey instead.\n */\n partnerId?: string;\n /**\n * @deprecated This property exists for historical compatibility. Use subjectParticipantsKey instead.\n */\n vendorPartnerId?: string;\n latestMsgSentTime?: Timestamp;\n created?: Timestamp;\n deleted?: Timestamp;\n updated?: Timestamp;\n /**\n * @deprecated This property exists for historical compatibility\n */\n lastSeen?: Timestamp | null;\n lastSeenByParticipants?: Array;\n conversationViewIds?: Array;\n}\n\nexport interface ConversationMessage {\n id?: string;\n conversationId?: string;\n messageId?: string;\n externalMessageId?: string;\n sender?: Participant;\n type: MessageType;\n channel: ConversationChannel;\n body?: string;\n media?: Media[];\n sendStatus?: SendStatusInterface;\n created?: Date;\n deleted?: Date;\n updated?: Date;\n}\n\nexport interface ConversationEvent {\n conversationId: string;\n eventId: string;\n happenedAt: Timestamp;\n labelKey: string;\n initiator?: string;\n created: Timestamp;\n updated: Timestamp;\n deleted: Timestamp;\n}\n\nexport interface ConversationUnseen {\n conversationId?: string;\n read: boolean;\n}\n\nexport interface FirestoreLastSeenByParticipant {\n participantId?: string;\n lastSeenTime?: Timestamp;\n}\n\nexport interface ConversationBadge {\n participantType: string;\n badgeColor: BadgeColor;\n}\nexport type ConversationDetail = GetMultiConversationDetailsResponseDetailedConversation;\n\nexport interface ConversationDetailCache {\n [conversationId: string]: ConversationDetail;\n}\n\nexport interface SendMessage {\n participants?: Array;\n location: PlatformLocation;\n channel: ConversationChannel;\n}\n\nexport interface ConversationTitleInfo {\n title: string;\n subtitle?: string;\n secondarySubtitle?: string;\n}\n\nexport interface ConversationRecipientInfo {\n id: string;\n type: ParticipantType;\n}\n\nexport interface KabobDynamicButton {\n title: string;\n action: () => void;\n posthogLabel: string;\n}\n\nexport interface TermsOfServiceResult {\n termsOfServiceTextMessage: string;\n termsOfServiceAccepted: boolean;\n}\n\nexport interface Media {\n mediaUrl: string;\n mediaContentType: string;\n mediaFileName: string;\n mediaLocationPath: string;\n fileSize?: number;\n}\n\nexport function convertMediaJSONIntoMedia(media: string): Media | null {\n if (!media) {\n return null;\n }\n const data = JSON.parse(media);\n return {\n mediaUrl: data.MediaUrl,\n mediaContentType: data.MediaContentType,\n mediaFileName: data.MediaFileName,\n mediaLocationPath: data.MediaLocationPath,\n fileSize: data.FileSize,\n };\n}\n\nexport interface MessageInfo {\n text: string;\n channel: ConversationChannel;\n attachments: MediaInterface[];\n}\n\nexport interface ConversationAvailableChannels {\n availableChannels: ConversationChannel[];\n preferredChannel: ConversationChannel;\n}\n","import { Message, MessageStatus, MessageType, Participant } from '@vendasta/conversation';\nimport { ChatMessageStatus } from '@vendasta/galaxy/chat';\nimport { ConversationMessage, Media, convertMediaJSONIntoMedia } from './interface/conversation.interface';\n\nconst ID_PREFIX = 'MESSAGE-';\n\nexport function toFirestoreId(id: string): string {\n return id.replace(ID_PREFIX, '');\n}\n\nexport function fromFirestoreId(id: string): string {\n if (id && id.startsWith(ID_PREFIX)) {\n return id;\n }\n return ID_PREFIX + id;\n}\n\n/**\n * convert API message to ConversationMessage\n * @param {Message} msg - the message coming from the API\n * @param {Participant} sender - the participant that sent msg\n * @return {ConversationMessage} - the converted ConversationMessage object\n */\nexport function convertMessageIntoConversationMessage(\n msg: Message,\n sender: Participant | undefined,\n): ConversationMessage | null {\n if (msg == null) {\n return null;\n }\n\n return {\n id: toFirestoreId(msg.messageId),\n messageId: msg.messageId,\n conversationId: msg.conversationId,\n channel: msg.channel,\n body: msg.body,\n media:\n msg.media?.map((media) => convertMediaJSONIntoMedia(media))?.filter((media): media is Media => !!media) ?? [],\n type: msg.type ?? MessageType.MESSAGE_TYPE_MESSAGE,\n created: msg.created,\n updated: msg.updated,\n deleted: msg.deleted,\n sender: msg.type !== MessageType.MESSAGE_TYPE_SYSTEM ? sender : undefined,\n sendStatus: msg.sendStatus,\n };\n}\n\nexport function mapMessageStatus(message: ConversationMessage): ChatMessageStatus {\n switch (message.sendStatus?.status) {\n case MessageStatus.MESSAGE_STATUS_DELIVERED:\n case MessageStatus.MESSAGE_STATUS_NOT_READ:\n case MessageStatus.MESSAGE_STATUS_READ:\n return 'delivered';\n case MessageStatus.MESSAGE_STATUS_FAILED:\n case MessageStatus.MESSAGE_STATUS_UNDELIVERED:\n return 'failed';\n case MessageStatus.MESSAGE_STATUS_SENT:\n return 'sent';\n case MessageStatus.MESSAGE_STATUS_SENDING:\n return 'sending';\n default:\n return undefined;\n }\n}\n","import { HttpErrorResponse } from '@angular/common/http';\nimport { Inject, Injectable, inject } from '@angular/core';\nimport { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';\nimport { Query, collectionData } from '@angular/fire/firestore';\nimport { RegistrationStage, SmsRegistrationService } from '@galaxy/sms';\nimport { TranslateService } from '@ngx-translate/core';\nimport {\n Conversation,\n ConversationApiService,\n ConversationChannel,\n CreateConversationRequest,\n CreateConversationResponse,\n EvaluateResponseRequest,\n EvaluationSentiment,\n GetAvailableChannelsForConversationResponse,\n GetMessageRequest,\n GetMultiMessagesRequest,\n GetMultiMessagesResponse,\n GlobalParticipantType,\n LookupConversationsRequestInterface,\n LookupConversationsResponse,\n MediaInterface,\n Message,\n MessageStatus,\n MessageType,\n Participant,\n PlatformLocation,\n SendMessageResponse,\n SetLastSeenRequestStatus,\n GetMultiConversationDetailsRequest,\n} from '@vendasta/conversation';\nimport { SnackbarService } from '@vendasta/galaxy/snackbar-service';\nimport { ProductAnalyticsService } from '@vendasta/product-analytics';\nimport { GetAccountInfoResponse, ParticipantType, SmsService } from '@vendasta/smsv2';\nimport {\n BehaviorSubject,\n EMPTY,\n Observable,\n asyncScheduler,\n catchError,\n combineLatest,\n defaultIfEmpty,\n distinctUntilChanged,\n filter,\n firstValueFrom,\n map,\n merge,\n observeOn,\n of,\n shareReplay,\n skip,\n skipWhile,\n startWith,\n switchMap,\n} from 'rxjs';\nimport { AlertOptions, ConversationChannelService } from './channels/conversation-channel.abstract';\nimport { conversationUnseen, fromFirestoreId, getPosthogChannelName, toFirestoreId } from './conversation-utils';\nimport { FirestoreService } from './firestore.service';\nimport { LOCAL_STORAGE_ID } from './inbox.constants';\nimport { InboxService } from './inbox.service';\nimport {\n ConversationAvailableChannels,\n ConversationDetail,\n ConversationEvent,\n ConversationMessage,\n FirestoreConversation,\n Media,\n MessageInfo,\n} from './interface/conversation.interface';\nimport { HostAppInterface } from './interface/host-app.interface';\nimport { convertMessageIntoConversationMessage, mapMessageStatus } from './message-utils';\nimport { ParticipantService } from './participant.service';\nimport {\n ACCOUNT_GROUP_ID_TOKEN,\n CONVERSATION_CHANNEL_SERVICE_TOKEN,\n CONVERSATION_CONFIG_TOKEN,\n CONVERSATION_CONVERSATION_CHANNELS_ENABLED_TOKEN,\n CONVERSATION_COUNTRY_TOKEN,\n CONVERSATION_HOST_APP_INTERFACE_TOKEN,\n MARKET_ID_TOKEN,\n PARTNER_ID_TOKEN,\n USER_ID_TOKEN,\n} from './tokens';\nimport { ChatMessageStatus } from '@vendasta/galaxy/chat';\nimport { FieldMask } from '@galaxy/marketplace-apps';\n\n@Injectable()\nexport class ConversationService {\n private currentConversationChannel = ConversationChannel.CONVERSATION_CHANNEL_UNDEFINED;\n // TODO: MEGA-791 - Remove this once SMS registration state check is implemented on backend\n private readonly smsRegistrationService = this.inboxService.isBusinessApp ? inject(SmsRegistrationService) : null;\n\n private readonly conversationSelected$$ = new BehaviorSubject(false);\n readonly conversationSelected$ = this.conversationSelected$$.asObservable();\n\n readonly currentParticipant$ = this.participantService.currentParticipant$;\n private readonly currentFirestoreConversationId$$: BehaviorSubject = new BehaviorSubject('');\n readonly currentFirestoreConversationId$ = this.currentFirestoreConversationId$$.pipe(\n map(toFirestoreId),\n distinctUntilChanged(),\n );\n\n readonly currentConversationDetail$ = this.currentFirestoreConversationId$.pipe(\n switchMap((id) => {\n if (!id) return of(null);\n return merge(\n this.getConversationDetail(fromFirestoreId(id)),\n this.firestoreService.conversation$(id).pipe(\n skip(1),\n switchMap(() => this.getConversationDetail(fromFirestoreId(id))),\n ),\n ).pipe(startWith(null));\n }),\n shareReplay({ bufferSize: 1, refCount: true }),\n skipWhile((v) => v === null),\n );\n\n private readonly sendSMSNumber$$ = new BehaviorSubject(null);\n readonly sendSMSNumber$ = this.sendSMSNumber$$.asObservable();\n\n readonly currentConvoSMSNumber$ = this.currentConversationDetail$.pipe(\n switchMap((convoDetail) => {\n if (\n !this.inboxService.isBusinessApp ||\n !convoDetail?.conversation.subjectParticipants.find(\n (p) => p.participantType === GlobalParticipantType.GLOBAL_PARTICIPANT_TYPE_CUSTOMER,\n )\n ) {\n return of({} as GetAccountInfoResponse);\n }\n const accountGroupId = convoDetail?.conversation.subjectParticipants.find(\n (p) => p.participantType === GlobalParticipantType.GLOBAL_PARTICIPANT_TYPE_ACCOUNT_GROUP,\n )?.internalParticipantId;\n if (!accountGroupId) {\n return of({} as GetAccountInfoResponse);\n }\n return this.smsService\n .getAccountInfo({\n internalId: accountGroupId,\n type: ParticipantType.PARTICIPANT_TYPE_ACCOUNT_GROUP,\n })\n .pipe(\n catchError((error: HttpErrorResponse) => {\n console.error('error to get account info:', error.message);\n return of({} as GetAccountInfoResponse);\n }),\n );\n }),\n shareReplay(1),\n );\n\n draftMessages: MessageInfo = {};\n\n readonly displayBadge$ = of(!this.inboxService.isBusinessApp);\n\n readonly showInboxViews$ = this.inboxService.showInboxViews$;\n\n private readonly accountGroupId = toSignal(this.accountGroupId$);\n private readonly partnerId = toSignal(this.partnerId$);\n\n constructor(\n private readonly conversationApiService: ConversationApiService,\n private readonly snackbarService: SnackbarService,\n private readonly analyticsService: ProductAnalyticsService,\n @Inject(USER_ID_TOKEN) readonly userId$: Observable,\n @Inject(ACCOUNT_GROUP_ID_TOKEN) private readonly accountGroupId$: Observable,\n @Inject(PARTNER_ID_TOKEN) private readonly partnerId$: Observable,\n @Inject(CONVERSATION_CONVERSATION_CHANNELS_ENABLED_TOKEN)\n private readonly conversationChannelsEnabled$: Observable,\n @Inject(MARKET_ID_TOKEN) readonly marketId$: Observable,\n private readonly participantService: ParticipantService,\n private readonly inboxService: InboxService,\n private readonly translateService: TranslateService,\n private readonly firestoreService: FirestoreService,\n @Inject(CONVERSATION_CHANNEL_SERVICE_TOKEN)\n private readonly conversationChannelService: Map,\n private readonly smsService: SmsService,\n @Inject(CONVERSATION_HOST_APP_INTERFACE_TOKEN) private readonly hostAppInterface: HostAppInterface,\n @Inject(CONVERSATION_COUNTRY_TOKEN) readonly country$: Observable,\n ) {\n this.conversationChannelsEnabled$.pipe(takeUntilDestroyed()).subscribe((conversationChannelsEnabled) => {\n if (!conversationChannelsEnabled || conversationChannelsEnabled.length === 0) {\n console.warn(\n 'You need to set up the conversationChannelsEnabled in the ConversationConfig. To fix see documentation in the README of @galaxy/conversation/core',\n );\n }\n\n if (conversationChannelsEnabled && conversationChannelsEnabled.length > 0) {\n this.setConversationChannel(conversationChannelsEnabled[0]);\n }\n });\n\n this.messages$.pipe(takeUntilDestroyed()).subscribe((messages) => {\n const multipleParticipantsHaveMessages = (messages || []).some(\n (message) => !!message.sender && message.sender.participantId !== messages[0].sender?.participantId,\n );\n if (multipleParticipantsHaveMessages) {\n this.analyticsService.trackEvent('inbox', 'biDirectionConversation', 'view');\n }\n });\n }\n\n private setConversationChannel(conversationChannel: ConversationChannel): void {\n this.currentConversationChannel = conversationChannel;\n }\n\n getConversationChannel(): ConversationChannel {\n return this.currentConversationChannel;\n }\n\n /**\n * create a conversation using the Conversation SDK/API\n * @param {Participant[]} participants - A list of participants\n * @param {ConversationChannel} conversationChannel - A conversation channel\n * @return {Observable} - An observable that contains a CreateConversationResponse\n */\n createConversation(\n participants: Participant[],\n conversationChannel: ConversationChannel,\n originLocation: PlatformLocation,\n ): Observable {\n if (participants.length === 0) {\n console.error(\n 'The participants are empty. It`s necessary send at least two participants to create a conversation',\n );\n return of({} as CreateConversationResponse);\n }\n\n if (conversationChannel === ConversationChannel.CONVERSATION_CHANNEL_UNDEFINED) {\n console.error('The conversationChannel is undefined. It`s necessary send a valid ConversationChannel');\n return of({} as CreateConversationResponse);\n }\n\n const req = {\n participants: participants,\n channel: conversationChannel,\n originLocation: originLocation,\n } as CreateConversationRequest;\n return this.conversationApiService.createConversation(req).pipe(\n catchError((err) => {\n console.warn('error to createConversation', err);\n return EMPTY;\n }),\n defaultIfEmpty({} as CreateConversationResponse),\n );\n }\n\n async sendMessage(\n conversationId: string,\n type: MessageType,\n body: string,\n channel: ConversationChannel,\n originLocation: PlatformLocation,\n media: MediaInterface[] = [],\n recipient?: Participant,\n sender?: Participant,\n ): Promise {\n if (!conversationId) {\n throw new Error('The conversationId is empty. It`s necessary send a valid conversationId');\n }\n\n if (!body && media.length === 0) {\n throw new Error('The body is empty. It`s necessary send a valid body');\n }\n\n if (channel === ConversationChannel.CONVERSATION_CHANNEL_UNDEFINED || channel === null) {\n throw new Error('The channel is invalid. It`s necessary send a valid channel');\n }\n\n if (!originLocation) {\n throw new Error('The originLocation is invalid. It`s necessary send a valid originLocation');\n }\n\n if (!sender) {\n sender = await firstValueFrom(this.participantService.currentParticipant$);\n }\n\n const trackingProps = this.buildSendMessageTrackProperties(conversationId, sender, channel, media.length);\n\n try {\n const result = await firstValueFrom(\n this.conversationApiService.sendMessage({\n sender,\n recipient,\n conversationId,\n type,\n body,\n originLocation,\n media,\n channel,\n }),\n );\n if (!result) {\n console.warn('ConversationService sendMessage value', result);\n return result;\n }\n\n this.analyticsService.trackEvent('inbox', 'conversation', 'send-message-success', 0, trackingProps);\n\n const now = new Date();\n const newMessage: ConversationMessage = {\n id: result.messageId.replace('MESSAGE-', ''),\n messageId: result.messageId,\n conversationId: conversationId,\n sender,\n type: MessageType.MESSAGE_TYPE_MESSAGE,\n channel,\n body,\n media: media as Media[],\n created: now,\n sendStatus: {\n created: now,\n status: MessageStatus.MESSAGE_STATUS_SENDING,\n },\n };\n this.addUnsavedMessage(toFirestoreId(conversationId), newMessage);\n\n return result;\n } catch (httpErrorResponse) {\n this.analyticsService.trackEvent('inbox', 'conversation', 'send-message-error', 0, trackingProps);\n\n console.error('ConversationService sendSMS error', httpErrorResponse);\n const message = (httpErrorResponse as HttpErrorResponse)?.error?.message;\n if (message) {\n this.snackbarService.openErrorSnack(message);\n }\n throw httpErrorResponse;\n }\n }\n\n getMultiConversationDetails(conversationIds: string[], getSummary = false) {\n if (conversationIds.length === 0) {\n return of([]);\n }\n\n const req = new GetMultiConversationDetailsRequest();\n req.conversationIds = conversationIds;\n if (getSummary) {\n req.options = new FieldMask({ paths: ['conversation_summary'] });\n }\n\n return this.conversationApiService.getMultiConversationDetails(req).pipe(\n map((response) => response.conversations),\n catchError((error) => {\n console.warn('error to getMultiConversationDetails collections', error);\n if (error?.status === 403) {\n this.snackbarService.openErrorSnack('INBOX.ERROR.PERMISSION_DENY');\n }\n return of([]);\n }),\n );\n }\n\n /**\n * set current firestore conversation ID\n * @param {string} conversationId - An conversation ID\n */\n setCurrentFirestoreConversationId(conversationId: string): void {\n this.currentFirestoreConversationId$$.next(conversationId ?? '');\n }\n\n getConversationDetail(conversationId: string): Observable {\n conversationId = fromFirestoreId(conversationId);\n\n return this.getMultiConversationDetails([conversationId]).pipe(\n map((conversationsDetails) => {\n return conversationsDetails[0];\n }),\n );\n }\n\n /**\n * set the current smsNumber\n * @param {string} smsNumber - The current smsNumber\n */\n setSMSNumber(smsNumber: string): void {\n this.sendSMSNumber$$.next(smsNumber);\n }\n\n /**\n * get the preview content of the conversation with message sender name\n * @param {ConversationDetail} conversationDetail - conversationDetail\n * @return {string} - the preview content with message sender name\n */\n getPreviewContent(conversationDetail: ConversationDetail): Observable {\n return combineLatest([this.userId$, this.inboxService.isConversationSummaryEnabled$]).pipe(\n map(([userId, showConversationSummary]) => {\n if (showConversationSummary) {\n return conversationDetail.summary;\n }\n const previewContent = this.getPreviewContentText(conversationDetail);\n const latestMessageParticipant = conversationDetail?.participants?.find(\n (participant) => participant?.participantId === conversationDetail.latestMessage?.participantId,\n );\n if (latestMessageParticipant?.isParticipantInternalInfoDeleted) {\n return `${this.translateService.instant('INBOX.PREVIEW_PANE.DELETED_USER')}: ${previewContent}`;\n }\n const otherUserPreviewContent = !latestMessageParticipant?.name\n ? `${previewContent}`\n : `${latestMessageParticipant?.name}: ${previewContent}`;\n return latestMessageParticipant?.internalParticipantId === userId\n ? `${this.translateService.instant('INBOX.PREVIEW_PANE.CURRENT_USER')}: ${previewContent}`\n : otherUserPreviewContent;\n }),\n );\n }\n\n /**\n * get the preview text of the conversation according to the message body text and media info\n * @param {ConversationDetail} conversationDetail - conversationDetail\n * @return {string} - the preview text without message sender name\n */\n getPreviewContentText(conversationDetail: ConversationDetail): string {\n // If message only has media without text\n if (!conversationDetail?.latestMessage?.body && conversationDetail?.latestMessage?.media.length > 0) {\n return this.translateService.instant('INBOX.PREVIEW_PANE.SHARED_A_FILE');\n }\n\n return conversationDetail?.latestMessage?.body;\n }\n\n /**\n * get multi messages from the Conversation µs\n * @param {string[]} messageIds - the message IDs\n * @param {string} conversationId - the conversation ID\n * @return {Observable}\n */\n getMultiMessages(messageIds: string[], conversationId: string): Observable {\n if (!messageIds || messageIds.length === 0) {\n console.error('the messageIds is not valid');\n return of({ messages: [] as Message[] } as GetMultiMessagesResponse);\n }\n\n const req = {\n conversationId: conversationId,\n messageIds: messageIds,\n } as GetMultiMessagesRequest;\n return this.conversationApiService.getMultiMessages(req).pipe(\n catchError((err) => {\n console.error('getMultiMessages error:', err?.message);\n return of({} as GetMultiMessagesResponse);\n }),\n );\n }\n\n /**\n * get a message from the Conversation µs\n * @param {string} messageId - the message ID\n * @return {Observable}\n */\n getMessage(messageId: string): Observable {\n if (!messageId || messageId === '') {\n console.error('the messageId is not valid');\n return of({} as Message);\n }\n\n const req = {\n messageId,\n } as GetMessageRequest;\n\n return this.conversationApiService.getMessage(req).pipe(\n catchError((err) => {\n console.error('getMessage error:', err?.message);\n return of({} as Message);\n }),\n );\n }\n\n /**\n * set conversation lastSeenTime by Participant\n * @param {string} conversationId - the conversation ID\n * @param {SetLastSeenRequestStatus} status - the timestamp\n */\n async setConversationLastSeen(conversationId: string, status: SetLastSeenRequestStatus): Promise {\n const participant = await firstValueFrom(this.currentParticipant$);\n await firstValueFrom(\n this.conversationApiService.setLastSeen({\n conversationId: conversationId,\n participant,\n status: status,\n }),\n );\n }\n\n async setConversationOpenStatus(conversationId: string, isOpen: boolean): Promise {\n const resp = await firstValueFrom(\n this.conversationApiService.updateConversation({\n conversation: {\n conversationId: conversationId,\n isOpen: isOpen,\n },\n fieldMask: {\n paths: ['is_open'],\n },\n }),\n );\n\n this.snackbarService.openSuccessSnack(\n isOpen ? 'INBOX.INFO.CONVERSATION_STATUS_OPENED' : 'INBOX.INFO.CONVERSATION_STATUS_CLOSED',\n );\n\n return resp.conversation;\n }\n\n conversationUnseen(conversation: Conversation): Observable {\n return this.currentParticipant$.pipe(\n map((participant) => {\n return conversationUnseen(conversation, participant?.participantId);\n }),\n );\n }\n\n lookupConversation(req: LookupConversationsRequestInterface): Observable {\n return this.conversationApiService.lookupConversations(req).pipe(\n catchError((err) => {\n if (err?.status === 403) {\n this.snackbarService.openErrorSnack('INBOX.ERROR.PERMISSION_DENY');\n }\n return of({} as LookupConversationsResponse);\n }),\n );\n }\n\n isUserImpersonated$ = inject(CONVERSATION_CONFIG_TOKEN)?.isImpersonating$ || of(false);\n\n private buildSendMessageTrackProperties(\n conversationId: string,\n sender: Participant,\n channel: ConversationChannel,\n numberOfFiles: number,\n ) {\n return {\n id: conversationId,\n accountGroupId: this.accountGroupId(),\n participantName: sender?.name || '',\n partnerId: this.partnerId(),\n PID_AGID: this.accountGroupId() ? this.partnerId() + '_' + this.accountGroupId() : this.partnerId(),\n location: this.inboxService.platformLocation,\n channel: getPosthogChannelName(channel) || getPosthogChannelName(this.getConversationChannel()),\n type: sender?.participantType,\n numberOfFiles: numberOfFiles,\n };\n }\n\n getConversationEvents(conversationId: string): Observable {\n return this.firestoreService.events$(conversationId);\n }\n\n getUnreadConversationsCount(viewId: string): Observable {\n return this.currentParticipant$.pipe(\n switchMap((participant) =>\n this.countUnreadConversations(\n this.firestoreService.getUnreadConversationsByView(participant?.participantId, viewId),\n ),\n ),\n );\n }\n\n countUnreadConversations(conversationsCollection: Query): Observable {\n return collectionData(conversationsCollection, { idField: 'id' }).pipe(\n map((cs) => cs.map((c) => c.conversationId).filter((id): id is string => !!id)),\n switchMap((ids) => of(ids.length)),\n );\n }\n\n setLastConversationId(id: string): void {\n localStorage.setItem(LOCAL_STORAGE_ID, id);\n }\n\n getLastConversationId(): string | undefined {\n return localStorage.getItem(LOCAL_STORAGE_ID) ?? undefined;\n }\n\n removeLastConversationId(): void {\n localStorage.removeItem(LOCAL_STORAGE_ID);\n this.currentFirestoreConversationId$$.next('');\n }\n\n conversationSelected(selected: boolean): void {\n this.conversationSelected$$.next(selected);\n }\n\n mapStatusForMessage(message: ConversationMessage): ChatMessageStatus {\n return mapMessageStatus(message);\n }\n\n // TODO: MEGA-791 - Remove this once SMS registration state check is implemented on backend\n readonly isSMSChannelAvailableForOrg$: Observable = this.inboxService.canAccessSMS$.pipe(\n switchMap((canAccessSMS) => {\n if (!canAccessSMS) {\n return of(false);\n }\n if (!this.smsRegistrationService) {\n return of(canAccessSMS);\n }\n\n return combineLatest([\n this.country$,\n this.smsRegistrationService.registrationStage$,\n this.inboxService.SMSNumber$,\n ]).pipe(\n map(([accountGroupCountry, stage, smsNumber]) => {\n const country = accountGroupCountry?.toLowerCase() || '';\n // Canadian account case\n if (country != 'us' && smsNumber) {\n return true;\n }\n // US account case\n return stage === RegistrationStage.RegistrationComplete;\n }),\n );\n }),\n );\n\n private readonly availableChannelsForConversation$: Observable =\n this.currentFirestoreConversationId$.pipe(\n filter((conversationID) => !!conversationID),\n switchMap((conversationID) => {\n return this.conversationApiService\n .getAvailableChannelsForConversation({\n conversationId: fromFirestoreId(conversationID),\n })\n .pipe(catchError(() => of(null)));\n }),\n shareReplay({ bufferSize: 1, refCount: true }),\n distinctUntilChanged(),\n );\n\n //TODO: MEGA-791 We wont need to do filtering in the frontend once we migrate the access control logic to the backend.\n private readonly filteredChannels$: Observable = this.availableChannelsForConversation$.pipe(\n switchMap((availableChannelsForConversation) => {\n if (!availableChannelsForConversation) {\n return of(\n new GetAvailableChannelsForConversationResponse({\n channels: new Array(),\n preferredChannel: ConversationChannel.CONVERSATION_CHANNEL_UNDEFINED,\n }),\n );\n }\n return of(availableChannelsForConversation);\n }),\n map((res) => res?.channels ?? new Array()),\n switchMap((channels) => {\n if (this.hostAppInterface.getAppOptions().is_multilocation) {\n return this.currentConvoSMSNumber$.pipe(\n map((convoSMSNumber) => {\n if (convoSMSNumber) {\n return channels;\n } else {\n return channels.filter((channel) => channel !== ConversationChannel.CONVERSATION_CHANNEL_SMS);\n }\n }),\n );\n }\n // TODO: MEGA-791 - Remove this once SMS registration state check is implemented on backend\n return this.isSMSChannelAvailableForOrg$.pipe(\n map((isSMSChannelAvailable) => {\n return isSMSChannelAvailable\n ? channels\n : channels.filter((channel) => channel !== ConversationChannel.CONVERSATION_CHANNEL_SMS);\n }),\n );\n }),\n catchError(() => of(new Array())),\n distinctUntilChanged((prev, curr) => {\n if (prev.length === 0 && curr.length === 0) {\n return true;\n }\n return curr === prev;\n }),\n shareReplay({ bufferSize: 1, refCount: true }),\n );\n\n //TODO: MEGA-791 Remove the filteredChannels dependency once we migrate the access control logic to the backend.\n //The entire channel availability will be in the backend.\n readonly availableChannels$: Observable = combineLatest([\n this.availableChannelsForConversation$,\n this.filteredChannels$,\n ]).pipe(\n map(([availableChannelsForConversation, filteredAvailableChannels]) => {\n const availableChannels = {\n availableChannels: filteredAvailableChannels,\n } as ConversationAvailableChannels;\n\n if (\n !availableChannelsForConversation ||\n !filteredAvailableChannels?.length ||\n availableChannelsForConversation?.preferredChannel === ConversationChannel.CONVERSATION_CHANNEL_UNDEFINED\n ) {\n availableChannels.preferredChannel = ConversationChannel.CONVERSATION_CHANNEL_UNDEFINED;\n return availableChannels;\n }\n if (filteredAvailableChannels.includes(availableChannelsForConversation?.preferredChannel)) {\n availableChannels.preferredChannel = availableChannelsForConversation.preferredChannel;\n return availableChannels;\n }\n\n availableChannels.preferredChannel = filteredAvailableChannels[0];\n return availableChannels;\n }),\n startWith({\n availableChannels: new Array(),\n preferredChannel: ConversationChannel.CONVERSATION_CHANNEL_UNDEFINED,\n }),\n distinctUntilChanged(),\n );\n\n displayAlertIfExists(\n conversationDetail: ConversationDetail | null,\n conversationChannel: ConversationChannel,\n ): Observable {\n const service = this.conversationChannelService.get(conversationChannel);\n if (!service) return of(null);\n\n return combineLatest([this.partnerId$, this.accountGroupId$, this.availableChannels$]).pipe(\n switchMap(([partnerId, accountGroupId, channels]) => {\n if (channels.availableChannels.length > 0) return of(null);\n return service.getChatComposerAlert(\n partnerId,\n accountGroupId,\n conversationDetail ?? undefined,\n channels.availableChannels,\n );\n }),\n );\n }\n\n private readonly unsavedMessages$$ = new BehaviorSubject<{ [docId: string]: ConversationMessage[] }>({});\n\n private readonly messagesScrollable$: Observable<{\n messages: ConversationMessage[];\n events: ConversationEvent[];\n loading: boolean;\n }> = this.currentFirestoreConversationId$.pipe(\n observeOn(asyncScheduler),\n switchMap((docId) => {\n if (!docId) {\n return of({\n messages: [],\n events: [],\n loading: false,\n });\n }\n\n const conversationId = fromFirestoreId(docId);\n const conversationMessages$ = combineLatest([\n combineLatest([this.currentConversationDetail$, this.firestoreService.messages$(docId)]).pipe(\n switchMap(([conversationDetail, messages]) => {\n if (conversationDetail?.conversation?.conversationId !== conversationId) {\n return EMPTY;\n }\n\n const messageIds: string[] = messages.map((m) => m.messageId).filter((id): id is string => !!id);\n return this.conversationApiService.getMultiMessages({ messageIds, conversationId }).pipe(\n map((res) =>\n (res.messages || new Array())\n .map((msg) =>\n convertMessageIntoConversationMessage(\n msg,\n conversationDetail.participants.find((p) => p.participantId === msg.participantId),\n ),\n )\n .filter((msg): msg is ConversationMessage => {\n return Boolean(msg && (msg.sender || msg.type === MessageType.MESSAGE_TYPE_SYSTEM));\n }),\n ),\n );\n }),\n ),\n this.unsavedMessages$$,\n ]).pipe(\n map(([messages, unsavedMessages]) => {\n const unsavedMessagesForDocId = unsavedMessages[docId] || [];\n const filterSavedMessages = unsavedMessagesForDocId.filter(\n (msg) => !messages.find((m) => m.messageId === msg.messageId),\n );\n return [...filterSavedMessages, ...messages];\n }),\n );\n\n return combineLatest([conversationMessages$, this.getConversationEvents(docId)]).pipe(\n map(([messages, events]) => ({\n messages,\n events,\n loading: false,\n })),\n startWith({ messages: [], events: [], loading: true }),\n );\n }),\n shareReplay({ bufferSize: 1, refCount: true }),\n );\n\n public readonly messages$ = this.messagesScrollable$.pipe(map((res) => res.messages));\n public readonly events$ = this.messagesScrollable$.pipe(map((res) => res.events));\n public readonly loadingMessages$ = this.messagesScrollable$.pipe(map((res) => res.loading));\n\n private addUnsavedMessage(docId: string, message: ConversationMessage) {\n const unsavedMessages = this.unsavedMessages$$.getValue();\n const unsavedMessagesForDocId = unsavedMessages[docId] || [];\n this.unsavedMessages$$.next({\n ...unsavedMessages,\n [docId]: [message, ...unsavedMessagesForDocId],\n });\n }\n\n /**\n * evaluate the helpfulness of a response\n * @param {string} messageId - the id of the message response to evaluate\n * @param {string} comment - a comment about the helpfulness of the response\n * @param {EvaluationSentiment} sentiment - the sentiment of the evaluation\n */\n async evaluateResponse(messageId: string, comment: string, sentiment: EvaluationSentiment): Promise {\n const req = {\n messageId: messageId,\n comment: comment,\n sentiment: sentiment,\n } as EvaluateResponseRequest;\n await firstValueFrom(this.conversationApiService.evaluateResponse(req));\n }\n}\n","export const firebaseConfig = {\n apiKey: 'AIzaSyAmrv372h8otvJv6mBdHZzywPn5d6h6oPc',\n authDomain: 'inbox-291119.firebaseapp.com',\n databaseURL: 'https://inbox-291119.firebaseio.com',\n projectId: 'inbox-291119',\n storageBucket: 'inbox-291119.appspot.com',\n messagingSenderId: '133184929067',\n appId: '1:133184929067:web:aa3e2d0c6ccf993462596e',\n measurementId: 'G-MQLC4B4Q53',\n};\n","import { inject, Injectable, Injector } from '@angular/core';\nimport { ViewMode } from './types';\nimport {\n combineLatest,\n firstValueFrom,\n Observable,\n ReplaySubject,\n distinctUntilChanged,\n filter,\n map,\n shareReplay,\n startWith,\n tap,\n} from 'rxjs';\nimport { NavigationEnd, Router, UrlTree } from '@angular/router';\nimport { ProductAnalyticsService } from '@vendasta/product-analytics';\nimport { ConversationService } from './conversation.service';\nimport { toFirestoreId } from './conversation-utils';\n\nconst localStorageId = 'conversation-view-mode';\nconst AI_ROUTE = 'ai';\nconst INBOX_ROUTE = 'inbox';\n\n@Injectable({ providedIn: 'root' })\nexport class ViewModeService {\n private readonly router = inject(Router);\n private readonly analyticsService = inject(ProductAnalyticsService);\n private readonly injector = inject(Injector);\n\n private readonly viewMode$$ = new ReplaySubject(1);\n public readonly viewMode$ = this.viewMode$$.pipe(\n startWith(this.getUserViewMode || 'sidebar'),\n distinctUntilChanged(),\n tap((mode) => localStorage.setItem(localStorageId, mode)),\n tap((mode) =>\n this.analyticsService.trackEvent(INBOX_ROUTE, 'inbox-view-mode', 'state', 0, {\n viewMode: mode,\n }),\n ),\n shareReplay(1),\n );\n\n public readonly isOpen$ = this.router.events.pipe(\n filter((event) => event instanceof NavigationEnd),\n map((event: NavigationEnd) => this.router.parseUrl(event.url)),\n map((urlTree) => this.checkSegment(urlTree, 0, INBOX_ROUTE)),\n startWith(window.location.pathname.includes('(inbox:inbox')),\n distinctUntilChanged(),\n shareReplay(1),\n );\n\n public readonly isAIOpen$ = this.router.events.pipe(\n filter((event) => event instanceof NavigationEnd),\n map((event: NavigationEnd) => this.router.parseUrl(event.url)),\n map((urlTree) => this.checkSegment(urlTree, 1, AI_ROUTE)),\n startWith(window.location.pathname.includes('(inbox:inbox/ai')),\n distinctUntilChanged(),\n shareReplay(1),\n );\n\n public readonly isInboxOpen$: Observable = combineLatest([this.isOpen$, this.isAIOpen$]).pipe(\n map(([isOpen, isAIOpen]) => isOpen && !isAIOpen),\n distinctUntilChanged(),\n shareReplay(1),\n );\n\n public readonly isDrawerOpen$ = combineLatest([this.viewMode$, this.isOpen$]).pipe(\n map(([mode, isOpen]) => mode === 'sidebar' && isOpen),\n );\n\n public readonly isModalOpen$ = combineLatest([this.viewMode$, this.isOpen$]).pipe(\n map(([mode, isOpen]) => mode === 'modal' && isOpen),\n );\n\n public async toggleViewMode(): Promise {\n const currentMode = await firstValueFrom(this.viewMode$);\n this.viewMode$$.next(currentMode === 'modal' ? 'sidebar' : 'modal');\n }\n\n private conversationService?: ConversationService;\n\n public async toggleInboxOpen(): Promise {\n if (this.getCurrentRoute(0) === INBOX_ROUTE && this.getCurrentRoute(1) !== AI_ROUTE) {\n this.close();\n } else {\n if (!this.conversationService) {\n this.conversationService = this.injector.get(ConversationService);\n }\n const conversationId = await firstValueFrom(this.conversationService.currentFirestoreConversationId$);\n this.open(conversationId);\n }\n }\n\n public async open(conversationId?: string, prefilledMessage?: string): Promise {\n const viewMode = await firstValueFrom(this.viewMode$);\n this.router.navigate(this.routerCommands(viewMode, conversationId), {\n queryParamsHandling: 'merge',\n queryParams: { inboxPrefilledMessage: prefilledMessage || null },\n });\n }\n\n public openSettings(): void {\n this.router\n .navigate(['', { outlets: { inbox: 'inbox/settings' } }], {\n queryParamsHandling: 'merge',\n queryParams: { inboxPrefilledMessage: null },\n })\n .then(() => this.analyticsService.trackEvent('inbox', 'platform-settings', 'open'));\n }\n\n // the type any[] is the type used by router.navigate\n public routerCommands(mode: ViewMode, conversationId?: string): unknown[] {\n const path = conversationId ? `inbox/conversations/${toFirestoreId(conversationId)}` : INBOX_ROUTE;\n return [\n '',\n {\n outlets: {\n inbox: path,\n },\n },\n ];\n }\n\n close(): void {\n this.router.navigate(['', { outlets: { inbox: null } }], {\n queryParamsHandling: 'merge',\n queryParams: { inboxPrefilledMessage: null },\n });\n }\n\n private getCurrentRoute(index: number): string {\n const currentUrlTree = this.router.parseUrl(this.router.url);\n return currentUrlTree.root.children?.inbox?.segments[index]?.path;\n }\n\n private get getUserViewMode(): ViewMode {\n return localStorage.getItem(localStorageId) as ViewMode;\n }\n\n public toggleInboxAIOpen(): void {\n const currentUrlTree = this.router.parseUrl(this.router.url);\n const path = currentUrlTree.root.children?.inbox?.segments[1]?.path;\n if (path === AI_ROUTE) {\n this.closeInboxAI();\n } else {\n this.viewMode$$.next('sidebar');\n this.openInboxAI();\n }\n }\n public async openInboxAI(): Promise {\n this.router.navigate([{ outlets: { inbox: 'inbox/ai' } }]);\n }\n public async closeInboxAI(): Promise {\n this.router.navigate([{ outlets: { inbox: null } }], {\n queryParamsHandling: 'merge',\n });\n }\n\n private checkSegment(urlTree: UrlTree, segmentIndex: number, segmentPath: string): boolean {\n return urlTree.root.children?.inbox?.segments[segmentIndex]?.path === segmentPath;\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { ConversationChannel, Participant } from '@vendasta/conversation';\nimport { ProductAnalyticsService } from '@vendasta/product-analytics';\nimport { Observable, catchError, firstValueFrom, switchMap, tap } from 'rxjs';\nimport { toFirestoreId } from './conversation-utils';\nimport { ConversationService } from './conversation.service';\nimport { InboxService } from './inbox.service';\nimport { ConversationDetail, SendMessage, SubjectParticipant } from './interface/conversation.interface';\nimport {\n ACCOUNT_GROUP_ID_TOKEN,\n CONVERSATION_HOST_APP_INTERFACE_TOKEN,\n CONVERSATION_ROUTES_TOKEN,\n PARTNER_ID_TOKEN,\n} from './tokens';\nimport { ViewModeService } from './view-mode.service';\nimport { ParticipantService } from './participant.service';\n\n@Injectable()\nexport class InboxNavigationService {\n private readonly conversationService = inject(ConversationService);\n private readonly inboxService = inject(InboxService);\n private readonly analyticsService = inject(ProductAnalyticsService);\n private readonly hostAppInterface = inject(CONVERSATION_HOST_APP_INTERFACE_TOKEN);\n private readonly routes = toSignal(inject(CONVERSATION_ROUTES_TOKEN));\n private readonly accountGroupId = toSignal(inject(ACCOUNT_GROUP_ID_TOKEN));\n private readonly partnerId = toSignal(inject(PARTNER_ID_TOKEN));\n private readonly viewModeService = inject(ViewModeService);\n private readonly participantService = inject(ParticipantService);\n\n private createOrGetConversation(\n subjectParticipants: SubjectParticipant[],\n currentParticipant: Participant,\n ): Observable {\n const channel = currentParticipant.channel;\n\n return this.hostAppInterface.buildSendMessageParams(currentParticipant, subjectParticipants).pipe(\n switchMap((sendMessage: SendMessage) =>\n this.conversationService.createConversation(\n sendMessage.participants ?? [],\n sendMessage.channel,\n sendMessage.location,\n ),\n ),\n tap((conversationResp) => {\n if (conversationResp?.conversation) {\n this.analyticsService.trackEvent('inbox', 'send-message', 'create-conversation-success', 0, {\n accountGroupId: this.accountGroupId(),\n partnerId: this.partnerId(),\n location: this.inboxService.platformLocation,\n channel,\n });\n }\n }),\n catchError((error) => {\n this.analyticsService.trackEvent('inbox', 'send-message', 'create-conversation-error', 0, {\n accountGroupId: this.accountGroupId(),\n partnerId: this.partnerId(),\n location: this.inboxService.platformLocation,\n channel,\n message: error?.error?.message,\n });\n\n throw new Error('Error creating a conversation');\n }),\n switchMap((conversationResp) =>\n this.conversationService.getConversationDetail(conversationResp.conversation.conversationId),\n ),\n );\n }\n\n /**\n * Go to or create a conversation between a current participant, and a list of Subject Participants\n * @param {SubjectParticipant[]} subjectParticipants - A list of subject participants\n * @param {Participant} currentParticipant - The current user that is going to the conversation\n * @param {string} prefilledMessage - A prefilled message in Inbox, this only works with the modal\n */\n gotoConversation(\n subjectParticipants: SubjectParticipant[],\n currentParticipant: Participant,\n prefilledMessage?: string,\n ): void {\n if (!this.routes()?.useModal) {\n this.hostAppInterface.redirectToInternalConversation(currentParticipant, subjectParticipants);\n return;\n }\n\n this.createOrGetConversation(subjectParticipants, currentParticipant).subscribe((conversationDetails) =>\n this.gotoConversationID(toFirestoreId(conversationDetails.conversation.conversationId), prefilledMessage),\n );\n }\n\n /**\n * Go to or create a conversation between a current participant, and a list of Subject Participants for a given\n * channel. This method will resolve the current IAM user for the caller.\n * @param {SubjectParticipant[]} subjectParticipants - A list of subject participants\n * @param {ConversationChannel} channel - The channel that the conversation exists in.\n * @param {string} prefilledMessage - A prefilled message in Inbox, this only works with the modal\n */\n async gotoConversationChannel(\n subjectParticipants: SubjectParticipant[],\n channel: ConversationChannel,\n prefilledMessage?: string,\n ): Promise {\n const currentParticipant = await firstValueFrom(this.participantService.buildIAMUserParticipant(channel));\n if (!this.routes()?.useModal) {\n // get first value from currentParticipant$ and redirect to internal conversation\n this.hostAppInterface.redirectToInternalConversation(currentParticipant, subjectParticipants);\n return;\n }\n\n const conversationDetails = await firstValueFrom(\n this.createOrGetConversation(subjectParticipants, currentParticipant),\n );\n if (!conversationDetails?.conversation) {\n // TODO(warped-tour): better handle if we fail to get the conversation\n console.error('error to get firestore conversation by conversation id; unable to go to conversation');\n return;\n }\n this.gotoConversationID(toFirestoreId(conversationDetails?.conversation?.conversationId), prefilledMessage);\n }\n\n /**\n * Go to a conversation via a conversation ID\n * @param {string} conversationId - A firestore conversation ID\n */\n gotoConversationID(conversationId: string, prefilledMessage?: string): void {\n this.viewModeService.open(conversationId, prefilledMessage);\n }\n}\n","import { Inject, Injectable } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { NotificationsService } from '@galaxy/atlas';\nimport { NotificationMedium, NotificationSetting } from '@vendasta/notifications-sdk';\nimport { NotificationContext } from '@vendasta/notifications-sdk/lib/_internal/objects/api';\nimport { CookieService } from 'ngx-cookie-service';\nimport { BehaviorSubject, Observable, combineLatest, switchMap } from 'rxjs';\nimport { PARTNER_ID_TOKEN, USER_ID_TOKEN } from './tokens';\n\nconst INBOX_NOTIFICATION_TYPE_ID = 'inbox-messages';\nconst TURN_ON_NOTIFICATION_COOKIE = 'inbox-turn-on-notification';\n\n@Injectable()\nexport class InboxNotificationService {\n readonly inboxNotificationStatus$ = combineLatest([this.partnerId$, this.userId$]).pipe(\n switchMap(([partnerId, userId]) => {\n return this.notificationsService.getNotificationSettingStatus$(\n partnerId,\n { user: { userId: userId } },\n INBOX_NOTIFICATION_TYPE_ID,\n );\n }),\n );\n\n private userCookiesValue$$ = new BehaviorSubject('');\n\n constructor(\n private readonly notificationsService: NotificationsService,\n private readonly cookieService: CookieService,\n @Inject(USER_ID_TOKEN) readonly userId$: Observable,\n @Inject(PARTNER_ID_TOKEN) readonly partnerId$: Observable,\n ) {\n combineLatest([this.partnerId$, this.userId$])\n .pipe(takeUntilDestroyed())\n .subscribe(([partnerId, userId]) =>\n this.userCookiesValue$$.next(`${partnerId}-${userId}-${TURN_ON_NOTIFICATION_COOKIE}`),\n );\n }\n\n private getCookie(): string {\n return this.cookieService.get(TURN_ON_NOTIFICATION_COOKIE);\n }\n\n public getCookieStatus(): boolean {\n return this.getCookie() === this.userCookiesValue$$.getValue();\n }\n\n public setCookie(): void {\n const expiry = new Date();\n // we would like to make the warning banner disappear for 7 days after close\n expiry.setDate(expiry.getDate() + 6);\n this.cookieService.set(TURN_ON_NOTIFICATION_COOKIE, this.userCookiesValue$$.getValue(), expiry);\n }\n\n public turnOnOnlyMyEventsNotification$() {\n return combineLatest([this.userId$, this.partnerId$]).pipe(\n switchMap(([userId, partnerId]) => {\n const context = {\n user: {\n userId: userId,\n },\n } as NotificationContext;\n\n const emailSetting = {\n context: context,\n notificationTypeId: INBOX_NOTIFICATION_TYPE_ID,\n notificationMedium: NotificationMedium.NOTIFICATION_MEDIUM_EMAIL,\n } as NotificationSetting;\n\n const webSetting = {\n context: context,\n notificationTypeId: INBOX_NOTIFICATION_TYPE_ID,\n notificationMedium: NotificationMedium.NOTIFICATION_MEDIUM_WEB,\n } as NotificationSetting;\n\n return this.notificationsService.saveSettingMulti$(partnerId, [emailSetting, webSetting]);\n }),\n );\n }\n}\n","import * as i0 from '@angular/core';\nimport { Injectable } from '@angular/core';\nimport * as i1 from '@angular/common/http';\nimport { HttpHeaders } from '@angular/common/http';\nimport { map } from 'rxjs/operators';\n\n// *********************************\n// Code generated by sdkgen\n// DO NOT EDIT!.\n//\n// Enums.\n// *********************************\nvar ReviewRequestStatus = /*#__PURE__*/function (ReviewRequestStatus) {\n ReviewRequestStatus[ReviewRequestStatus[\"REVIEW_REQUEST_STATUS_NOT_SENT\"] = 0] = \"REVIEW_REQUEST_STATUS_NOT_SENT\";\n ReviewRequestStatus[ReviewRequestStatus[\"REVIEW_REQUEST_STATUS_LEFT_REVIEW\"] = 1] = \"REVIEW_REQUEST_STATUS_LEFT_REVIEW\";\n ReviewRequestStatus[ReviewRequestStatus[\"REVIEW_REQUEST_STATUS_DELIVERED\"] = 2] = \"REVIEW_REQUEST_STATUS_DELIVERED\";\n ReviewRequestStatus[ReviewRequestStatus[\"REVIEW_REQUEST_STATUS_BOUNCED\"] = 3] = \"REVIEW_REQUEST_STATUS_BOUNCED\";\n ReviewRequestStatus[ReviewRequestStatus[\"REVIEW_REQUEST_STATUS_OPENED\"] = 4] = \"REVIEW_REQUEST_STATUS_OPENED\";\n ReviewRequestStatus[ReviewRequestStatus[\"REVIEW_REQUEST_STATUS_CLICKED\"] = 5] = \"REVIEW_REQUEST_STATUS_CLICKED\";\n ReviewRequestStatus[ReviewRequestStatus[\"REVIEW_REQUEST_STATUS_CLICKED_POSITIVE\"] = 6] = \"REVIEW_REQUEST_STATUS_CLICKED_POSITIVE\";\n ReviewRequestStatus[ReviewRequestStatus[\"REVIEW_REQUEST_STATUS_CLICKED_NEGATIVE\"] = 7] = \"REVIEW_REQUEST_STATUS_CLICKED_NEGATIVE\";\n ReviewRequestStatus[ReviewRequestStatus[\"REVIEW_REQUEST_STATUS_UNSUBSCRIBE\"] = 8] = \"REVIEW_REQUEST_STATUS_UNSUBSCRIBE\";\n ReviewRequestStatus[ReviewRequestStatus[\"REVIEW_REQUEST_STATUS_SPAM_REPORT\"] = 9] = \"REVIEW_REQUEST_STATUS_SPAM_REPORT\";\n ReviewRequestStatus[ReviewRequestStatus[\"REVIEW_REQUEST_STATUS_SENDING\"] = 10] = \"REVIEW_REQUEST_STATUS_SENDING\";\n ReviewRequestStatus[ReviewRequestStatus[\"REVIEW_REQUEST_STATUS_DROPPED\"] = 11] = \"REVIEW_REQUEST_STATUS_DROPPED\";\n return ReviewRequestStatus;\n}(ReviewRequestStatus || {});\nvar SmsStatusCode = /*#__PURE__*/function (SmsStatusCode) {\n SmsStatusCode[SmsStatusCode[\"SMS_STATUS_CODE_SUCCESS\"] = 0] = \"SMS_STATUS_CODE_SUCCESS\";\n SmsStatusCode[SmsStatusCode[\"SMS_STATUS_CODE_QUEUE_FULL\"] = 1] = \"SMS_STATUS_CODE_QUEUE_FULL\";\n SmsStatusCode[SmsStatusCode[\"SMS_STATUS_CODE_ACCOUNT_SUSPENDED\"] = 2] = \"SMS_STATUS_CODE_ACCOUNT_SUSPENDED\";\n SmsStatusCode[SmsStatusCode[\"SMS_STATUS_CODE_UNREACHABLE_DESTINATION\"] = 3] = \"SMS_STATUS_CODE_UNREACHABLE_DESTINATION\";\n SmsStatusCode[SmsStatusCode[\"SMS_STATUS_CODE_MESSAGE_BLOCKED\"] = 4] = \"SMS_STATUS_CODE_MESSAGE_BLOCKED\";\n SmsStatusCode[SmsStatusCode[\"SMS_STATUS_CODE_UNKNOWN_DESTINATION\"] = 5] = \"SMS_STATUS_CODE_UNKNOWN_DESTINATION\";\n SmsStatusCode[SmsStatusCode[\"SMS_STATUS_CODE_LANDLINE_NUMBER\"] = 6] = \"SMS_STATUS_CODE_LANDLINE_NUMBER\";\n SmsStatusCode[SmsStatusCode[\"SMS_STATUS_CODE_CARRIER_VIOLATION\"] = 7] = \"SMS_STATUS_CODE_CARRIER_VIOLATION\";\n SmsStatusCode[SmsStatusCode[\"SMS_STATUS_CODE_UNKNOWN_ERROR\"] = 8] = \"SMS_STATUS_CODE_UNKNOWN_ERROR\";\n SmsStatusCode[SmsStatusCode[\"SMS_STATUS_CODE_UNSUBSCRIBED\"] = 9] = \"SMS_STATUS_CODE_UNSUBSCRIBED\";\n return SmsStatusCode;\n}(SmsStatusCode || {});\n// *********************************\n// Code generated by sdkgen\n// DO NOT EDIT!.\n//\n// Enums.\n// *********************************\nvar AutomationType = /*#__PURE__*/function (AutomationType) {\n AutomationType[AutomationType[\"AUTOMATION_TYPE_NONE\"] = 0] = \"AUTOMATION_TYPE_NONE\";\n AutomationType[AutomationType[\"AUTOMATION_TYPE_REVIEW_REMINDER\"] = 1] = \"AUTOMATION_TYPE_REVIEW_REMINDER\";\n return AutomationType;\n}(AutomationType || {});\n// *********************************\n// Code generated by sdkgen\n// DO NOT EDIT!.\n//\n// Enums.\n// *********************************\nvar RequestEventType = /*#__PURE__*/function (RequestEventType) {\n RequestEventType[RequestEventType[\"REQUEST_EVENT_TYPE_UNKNOWN\"] = 0] = \"REQUEST_EVENT_TYPE_UNKNOWN\";\n RequestEventType[RequestEventType[\"REQUEST_EVENT_TYPE_EMAIL\"] = 1] = \"REQUEST_EVENT_TYPE_EMAIL\";\n RequestEventType[RequestEventType[\"REQUEST_EVENT_TYPE_SMS\"] = 2] = \"REQUEST_EVENT_TYPE_SMS\";\n return RequestEventType;\n}(RequestEventType || {});\n// *********************************\n// Code generated by sdkgen\n// DO NOT EDIT!.\n//\n// Enums.\n// *********************************\nvar CreateError = /*#__PURE__*/function (CreateError) {\n CreateError[CreateError[\"CREATE_ERROR_NO_ERRORS\"] = 0] = \"CREATE_ERROR_NO_ERRORS\";\n CreateError[CreateError[\"CREATE_ERROR_EMAIL_OR_PHONE_REQUIRED\"] = 1] = \"CREATE_ERROR_EMAIL_OR_PHONE_REQUIRED\";\n CreateError[CreateError[\"CREATE_ERROR_INVALID_EMAIL\"] = 2] = \"CREATE_ERROR_INVALID_EMAIL\";\n CreateError[CreateError[\"CREATE_ERROR_INVALID_PHONE\"] = 3] = \"CREATE_ERROR_INVALID_PHONE\";\n CreateError[CreateError[\"CREATE_ERROR_INVALID_FIRST_NAME\"] = 4] = \"CREATE_ERROR_INVALID_FIRST_NAME\";\n CreateError[CreateError[\"CREATE_ERROR_INVALID_LAST_NAME\"] = 5] = \"CREATE_ERROR_INVALID_LAST_NAME\";\n CreateError[CreateError[\"CREATE_ERROR_INVALID_COUNTRY\"] = 6] = \"CREATE_ERROR_INVALID_COUNTRY\";\n CreateError[CreateError[\"CREATE_ERROR_INVALID_STATE\"] = 7] = \"CREATE_ERROR_INVALID_STATE\";\n return CreateError;\n}(CreateError || {});\nvar SortDirection = /*#__PURE__*/function (SortDirection) {\n SortDirection[SortDirection[\"SORT_DIRECTION_NONE\"] = 0] = \"SORT_DIRECTION_NONE\";\n SortDirection[SortDirection[\"SORT_DIRECTION_ASCENDING\"] = 1] = \"SORT_DIRECTION_ASCENDING\";\n SortDirection[SortDirection[\"SORT_DIRECTION_DESCENDING\"] = 2] = \"SORT_DIRECTION_DESCENDING\";\n return SortDirection;\n}(SortDirection || {});\n// *********************************\n\nfunction enumStringToValue$5(enumRef, value) {\n if (typeof value === 'number') {\n return value;\n }\n return enumRef[value];\n}\nclass Customer {\n static fromProto(proto) {\n let m = new Customer();\n m = Object.assign(m, proto);\n if (proto.created) {\n m.created = new Date(proto.created);\n }\n if (proto.emailRequestLastDateSent) {\n m.emailRequestLastDateSent = new Date(proto.emailRequestLastDateSent);\n }\n if (proto.smsRequestLastDateSent) {\n m.smsRequestLastDateSent = new Date(proto.smsRequestLastDateSent);\n }\n if (proto.emailReviewRequestStatus) {\n m.emailReviewRequestStatus = enumStringToValue$5(ReviewRequestStatus, proto.emailReviewRequestStatus);\n }\n if (proto.smsReviewRequestStatus) {\n m.smsReviewRequestStatus = enumStringToValue$5(ReviewRequestStatus, proto.smsReviewRequestStatus);\n }\n if (proto.emailLastClickedSource) {\n m.emailLastClickedSource = parseInt(proto.emailLastClickedSource, 10);\n }\n if (proto.review) {\n m.review = CustomerReview.fromProto(proto.review);\n }\n if (proto.smsStatusCode) {\n m.smsStatusCode = enumStringToValue$5(SmsStatusCode, proto.smsStatusCode);\n }\n if (proto.smsLastClickedSource) {\n m.smsLastClickedSource = parseInt(proto.smsLastClickedSource, 10);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.customerId !== 'undefined') {\n toReturn['customerId'] = this.customerId;\n }\n if (typeof this.businessId !== 'undefined') {\n toReturn['businessId'] = this.businessId;\n }\n if (typeof this.firstName !== 'undefined') {\n toReturn['firstName'] = this.firstName;\n }\n if (typeof this.lastName !== 'undefined') {\n toReturn['lastName'] = this.lastName;\n }\n if (typeof this.phone !== 'undefined') {\n toReturn['phone'] = this.phone;\n }\n if (typeof this.email !== 'undefined') {\n toReturn['email'] = this.email;\n }\n if (typeof this.created !== 'undefined' && this.created !== null) {\n toReturn['created'] = 'toApiJson' in this.created ? this.created.toApiJson() : this.created;\n }\n if (typeof this.emailRequestLastDateSent !== 'undefined' && this.emailRequestLastDateSent !== null) {\n toReturn['emailRequestLastDateSent'] = 'toApiJson' in this.emailRequestLastDateSent ? this.emailRequestLastDateSent.toApiJson() : this.emailRequestLastDateSent;\n }\n if (typeof this.smsRequestLastDateSent !== 'undefined' && this.smsRequestLastDateSent !== null) {\n toReturn['smsRequestLastDateSent'] = 'toApiJson' in this.smsRequestLastDateSent ? this.smsRequestLastDateSent.toApiJson() : this.smsRequestLastDateSent;\n }\n if (typeof this.emailReviewRequestStatus !== 'undefined') {\n toReturn['emailReviewRequestStatus'] = this.emailReviewRequestStatus;\n }\n if (typeof this.smsReviewRequestStatus !== 'undefined') {\n toReturn['smsReviewRequestStatus'] = this.smsReviewRequestStatus;\n }\n if (typeof this.emailLastClickedSource !== 'undefined') {\n toReturn['emailLastClickedSource'] = this.emailLastClickedSource;\n }\n if (typeof this.employeeFirstName !== 'undefined') {\n toReturn['employeeFirstName'] = this.employeeFirstName;\n }\n if (typeof this.employeeLastName !== 'undefined') {\n toReturn['employeeLastName'] = this.employeeLastName;\n }\n if (typeof this.tag !== 'undefined') {\n toReturn['tag'] = this.tag;\n }\n if (typeof this.review !== 'undefined' && this.review !== null) {\n toReturn['review'] = 'toApiJson' in this.review ? this.review.toApiJson() : this.review;\n }\n if (typeof this.smsStatusCode !== 'undefined') {\n toReturn['smsStatusCode'] = this.smsStatusCode;\n }\n if (typeof this.address !== 'undefined') {\n toReturn['address'] = this.address;\n }\n if (typeof this.city !== 'undefined') {\n toReturn['city'] = this.city;\n }\n if (typeof this.state !== 'undefined') {\n toReturn['state'] = this.state;\n }\n if (typeof this.country !== 'undefined') {\n toReturn['country'] = this.country;\n }\n if (typeof this.smsLastClickedSource !== 'undefined') {\n toReturn['smsLastClickedSource'] = this.smsLastClickedSource;\n }\n if (typeof this.origin !== 'undefined') {\n toReturn['origin'] = this.origin;\n }\n return toReturn;\n }\n}\nclass CustomerReview {\n static fromProto(proto) {\n let m = new CustomerReview();\n m = Object.assign(m, proto);\n if (proto.starRating) {\n m.starRating = parseInt(proto.starRating, 10);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.starRating !== 'undefined') {\n toReturn['starRating'] = this.starRating;\n }\n if (typeof this.reviewUrl !== 'undefined') {\n toReturn['reviewUrl'] = this.reviewUrl;\n }\n return toReturn;\n }\n}\nfunction enumStringToValue$4(enumRef, value) {\n if (typeof value === 'number') {\n return value;\n }\n return enumRef[value];\n}\nclass CustomerRequestEvent {\n static fromProto(proto) {\n let m = new CustomerRequestEvent();\n m = Object.assign(m, proto);\n if (proto.requestEventType) {\n m.requestEventType = enumStringToValue$4(RequestEventType, proto.requestEventType);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.customerId !== 'undefined') {\n toReturn['customerId'] = this.customerId;\n }\n if (typeof this.requestEventType !== 'undefined') {\n toReturn['requestEventType'] = this.requestEventType;\n }\n return toReturn;\n }\n}\nclass ReviewRequestEvent {\n static fromProto(proto) {\n let m = new ReviewRequestEvent();\n m = Object.assign(m, proto);\n if (proto.customerRequestEvents) {\n m.customerRequestEvents = proto.customerRequestEvents.map(CustomerRequestEvent.fromProto);\n }\n if (proto.created) {\n m.created = new Date(proto.created);\n }\n if (proto.automationType) {\n m.automationType = enumStringToValue$4(AutomationType, proto.automationType);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.requestEventId !== 'undefined') {\n toReturn['requestEventId'] = this.requestEventId;\n }\n if (typeof this.businessId !== 'undefined') {\n toReturn['businessId'] = this.businessId;\n }\n if (typeof this.customerRequestEvents !== 'undefined' && this.customerRequestEvents !== null) {\n toReturn['customerRequestEvents'] = 'toApiJson' in this.customerRequestEvents ? this.customerRequestEvents.toApiJson() : this.customerRequestEvents;\n }\n if (typeof this.created !== 'undefined' && this.created !== null) {\n toReturn['created'] = 'toApiJson' in this.created ? this.created.toApiJson() : this.created;\n }\n if (typeof this.automationType !== 'undefined') {\n toReturn['automationType'] = this.automationType;\n }\n return toReturn;\n }\n}\nfunction enumStringToValue$3(enumRef, value) {\n if (typeof value === 'number') {\n return value;\n }\n return enumRef[value];\n}\nclass FieldMask {\n static fromProto(proto) {\n let m = new FieldMask();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.paths !== 'undefined') {\n toReturn['paths'] = this.paths;\n }\n return toReturn;\n }\n}\nfunction enumStringToValue$2(enumRef, value) {\n if (typeof value === 'number') {\n return value;\n }\n return enumRef[value];\n}\nclass Attribute {\n static fromProto(proto) {\n let m = new Attribute();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.key !== 'undefined') {\n toReturn['key'] = this.key;\n }\n if (typeof this.value !== 'undefined') {\n toReturn['value'] = this.value;\n }\n return toReturn;\n }\n}\nclass CreateCustomerAndSendDefaultReviewRequestRequest {\n static fromProto(proto) {\n let m = new CreateCustomerAndSendDefaultReviewRequestRequest();\n m = Object.assign(m, proto);\n if (proto.customer) {\n m.customer = Customer.fromProto(proto.customer);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.customer !== 'undefined' && this.customer !== null) {\n toReturn['customer'] = 'toApiJson' in this.customer ? this.customer.toApiJson() : this.customer;\n }\n if (typeof this.responseToken !== 'undefined') {\n toReturn['responseToken'] = this.responseToken;\n }\n return toReturn;\n }\n}\nclass CreateCustomerAndSendDefaultReviewRequestResponse {\n static fromProto(proto) {\n let m = new CreateCustomerAndSendDefaultReviewRequestResponse();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.customerId !== 'undefined') {\n toReturn['customerId'] = this.customerId;\n }\n return toReturn;\n }\n}\nclass CreateCustomerRequest {\n static fromProto(proto) {\n let m = new CreateCustomerRequest();\n m = Object.assign(m, proto);\n if (proto.customer) {\n m.customer = Customer.fromProto(proto.customer);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.businessId !== 'undefined') {\n toReturn['businessId'] = this.businessId;\n }\n if (typeof this.firstName !== 'undefined') {\n toReturn['firstName'] = this.firstName;\n }\n if (typeof this.lastName !== 'undefined') {\n toReturn['lastName'] = this.lastName;\n }\n if (typeof this.phone !== 'undefined') {\n toReturn['phone'] = this.phone;\n }\n if (typeof this.email !== 'undefined') {\n toReturn['email'] = this.email;\n }\n if (typeof this.employeeFirstName !== 'undefined') {\n toReturn['employeeFirstName'] = this.employeeFirstName;\n }\n if (typeof this.employeeLastName !== 'undefined') {\n toReturn['employeeLastName'] = this.employeeLastName;\n }\n if (typeof this.tag !== 'undefined') {\n toReturn['tag'] = this.tag;\n }\n if (typeof this.customer !== 'undefined' && this.customer !== null) {\n toReturn['customer'] = 'toApiJson' in this.customer ? this.customer.toApiJson() : this.customer;\n }\n return toReturn;\n }\n}\nclass CreateCustomerResponse {\n static fromProto(proto) {\n let m = new CreateCustomerResponse();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.customerId !== 'undefined') {\n toReturn['customerId'] = this.customerId;\n }\n return toReturn;\n }\n}\nclass CreateMultiCustomerError {\n static fromProto(proto) {\n let m = new CreateMultiCustomerError();\n m = Object.assign(m, proto);\n if (proto.index) {\n m.index = parseInt(proto.index, 10);\n }\n if (proto.errors) {\n m.errors = proto.errors.map(v => enumStringToValue$2(CreateError, v));\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.index !== 'undefined') {\n toReturn['index'] = this.index;\n }\n if (typeof this.errors !== 'undefined') {\n toReturn['errors'] = this.errors;\n }\n return toReturn;\n }\n}\nclass CreateMultiCustomerRequest {\n static fromProto(proto) {\n let m = new CreateMultiCustomerRequest();\n m = Object.assign(m, proto);\n if (proto.customers) {\n m.customers = proto.customers.map(Customer.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.customers !== 'undefined' && this.customers !== null) {\n toReturn['customers'] = 'toApiJson' in this.customers ? this.customers.toApiJson() : this.customers;\n }\n if (typeof this.businessId !== 'undefined') {\n toReturn['businessId'] = this.businessId;\n }\n return toReturn;\n }\n}\nclass CreateMultiCustomerResponse {\n static fromProto(proto) {\n let m = new CreateMultiCustomerResponse();\n m = Object.assign(m, proto);\n if (proto.customers) {\n m.customers = proto.customers.map(Customer.fromProto);\n }\n if (proto.errors) {\n m.errors = proto.errors.map(CreateMultiCustomerError.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.customers !== 'undefined' && this.customers !== null) {\n toReturn['customers'] = 'toApiJson' in this.customers ? this.customers.toApiJson() : this.customers;\n }\n if (typeof this.errors !== 'undefined' && this.errors !== null) {\n toReturn['errors'] = 'toApiJson' in this.errors ? this.errors.toApiJson() : this.errors;\n }\n return toReturn;\n }\n}\nclass CreateReviewRequestEventRequest {\n static fromProto(proto) {\n let m = new CreateReviewRequestEventRequest();\n m = Object.assign(m, proto);\n if (proto.customerRequestEvents) {\n m.customerRequestEvents = proto.customerRequestEvents.map(CustomerRequestEvent.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.businessId !== 'undefined') {\n toReturn['businessId'] = this.businessId;\n }\n if (typeof this.customerRequestEvents !== 'undefined' && this.customerRequestEvents !== null) {\n toReturn['customerRequestEvents'] = 'toApiJson' in this.customerRequestEvents ? this.customerRequestEvents.toApiJson() : this.customerRequestEvents;\n }\n return toReturn;\n }\n}\nclass CreateReviewRequestEventResponse {\n static fromProto(proto) {\n let m = new CreateReviewRequestEventResponse();\n m = Object.assign(m, proto);\n if (proto.reviewRequestEvent) {\n m.reviewRequestEvent = ReviewRequestEvent.fromProto(proto.reviewRequestEvent);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.reviewRequestEvent !== 'undefined' && this.reviewRequestEvent !== null) {\n toReturn['reviewRequestEvent'] = 'toApiJson' in this.reviewRequestEvent ? this.reviewRequestEvent.toApiJson() : this.reviewRequestEvent;\n }\n return toReturn;\n }\n}\nclass CustomerExistsRequest {\n static fromProto(proto) {\n let m = new CustomerExistsRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.businessId !== 'undefined') {\n toReturn['businessId'] = this.businessId;\n }\n if (typeof this.email !== 'undefined') {\n toReturn['email'] = this.email;\n }\n if (typeof this.phone !== 'undefined') {\n toReturn['phone'] = this.phone;\n }\n return toReturn;\n }\n}\nclass CustomerExistsResponse {\n static fromProto(proto) {\n let m = new CustomerExistsResponse();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.customerExists !== 'undefined') {\n toReturn['customerExists'] = this.customerExists;\n }\n return toReturn;\n }\n}\nclass CustomerFilters {\n static fromProto(proto) {\n let m = new CustomerFilters();\n m = Object.assign(m, proto);\n if (proto.emailStatus) {\n m.emailStatus = proto.emailStatus.map(v => enumStringToValue$2(ReviewRequestStatus, v));\n }\n if (proto.smsStatus) {\n m.smsStatus = proto.smsStatus.map(v => enumStringToValue$2(ReviewRequestStatus, v));\n }\n if (proto.created) {\n m.created = DateRangeFilter.fromProto(proto.created);\n }\n if (proto.lastRequested) {\n m.lastRequested = DateRangeFilter.fromProto(proto.lastRequested);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.emailStatus !== 'undefined') {\n toReturn['emailStatus'] = this.emailStatus;\n }\n if (typeof this.smsStatus !== 'undefined') {\n toReturn['smsStatus'] = this.smsStatus;\n }\n if (typeof this.tag !== 'undefined') {\n toReturn['tag'] = this.tag;\n }\n if (typeof this.created !== 'undefined' && this.created !== null) {\n toReturn['created'] = 'toApiJson' in this.created ? this.created.toApiJson() : this.created;\n }\n if (typeof this.lastRequested !== 'undefined' && this.lastRequested !== null) {\n toReturn['lastRequested'] = 'toApiJson' in this.lastRequested ? this.lastRequested.toApiJson() : this.lastRequested;\n }\n if (typeof this.origin !== 'undefined') {\n toReturn['origin'] = this.origin;\n }\n if (typeof this.negateTags !== 'undefined') {\n toReturn['negateTags'] = this.negateTags;\n }\n if (typeof this.customerIds !== 'undefined') {\n toReturn['customerIds'] = this.customerIds;\n }\n return toReturn;\n }\n}\nclass DateRangeFilter {\n static fromProto(proto) {\n let m = new DateRangeFilter();\n m = Object.assign(m, proto);\n if (proto.beginRange) {\n m.beginRange = new Date(proto.beginRange);\n }\n if (proto.endRange) {\n m.endRange = new Date(proto.endRange);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.beginRange !== 'undefined' && this.beginRange !== null) {\n toReturn['beginRange'] = 'toApiJson' in this.beginRange ? this.beginRange.toApiJson() : this.beginRange;\n }\n if (typeof this.endRange !== 'undefined' && this.endRange !== null) {\n toReturn['endRange'] = 'toApiJson' in this.endRange ? this.endRange.toApiJson() : this.endRange;\n }\n return toReturn;\n }\n}\nclass DeleteCustomerRequest {\n static fromProto(proto) {\n let m = new DeleteCustomerRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.customerId !== 'undefined') {\n toReturn['customerId'] = this.customerId;\n }\n if (typeof this.businessId !== 'undefined') {\n toReturn['businessId'] = this.businessId;\n }\n return toReturn;\n }\n}\nclass GetCustomerRequest {\n static fromProto(proto) {\n let m = new GetCustomerRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.customerId !== 'undefined') {\n toReturn['customerId'] = this.customerId;\n }\n if (typeof this.businessId !== 'undefined') {\n toReturn['businessId'] = this.businessId;\n }\n return toReturn;\n }\n}\nclass GetCustomerResponse {\n static fromProto(proto) {\n let m = new GetCustomerResponse();\n m = Object.assign(m, proto);\n if (proto.customer) {\n m.customer = Customer.fromProto(proto.customer);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.customer !== 'undefined' && this.customer !== null) {\n toReturn['customer'] = 'toApiJson' in this.customer ? this.customer.toApiJson() : this.customer;\n }\n return toReturn;\n }\n}\nclass GetMultiCustomerForBusinessRequest {\n static fromProto(proto) {\n let m = new GetMultiCustomerForBusinessRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.customerIds !== 'undefined') {\n toReturn['customerIds'] = this.customerIds;\n }\n if (typeof this.businessId !== 'undefined') {\n toReturn['businessId'] = this.businessId;\n }\n return toReturn;\n }\n}\nclass GetMultiCustomerForBusinessResponse {\n static fromProto(proto) {\n let m = new GetMultiCustomerForBusinessResponse();\n m = Object.assign(m, proto);\n if (proto.customers) {\n m.customers = proto.customers.map(Customer.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.customers !== 'undefined' && this.customers !== null) {\n toReturn['customers'] = 'toApiJson' in this.customers ? this.customers.toApiJson() : this.customers;\n }\n return toReturn;\n }\n}\nclass GetQRCodeForURLRequest {\n static fromProto(proto) {\n let m = new GetQRCodeForURLRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.url !== 'undefined') {\n toReturn['url'] = this.url;\n }\n return toReturn;\n }\n}\nclass GetQRCodeForURLResponse {\n static fromProto(proto) {\n let m = new GetQRCodeForURLResponse();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.qrCode !== 'undefined') {\n toReturn['qrCode'] = this.qrCode;\n }\n return toReturn;\n }\n}\nclass HeaderMapping {\n static fromProto(proto) {\n let m = new HeaderMapping();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.businessId !== 'undefined') {\n toReturn['businessId'] = this.businessId;\n }\n if (typeof this.email !== 'undefined') {\n toReturn['email'] = this.email;\n }\n if (typeof this.phone !== 'undefined') {\n toReturn['phone'] = this.phone;\n }\n if (typeof this.firstName !== 'undefined') {\n toReturn['firstName'] = this.firstName;\n }\n if (typeof this.lastName !== 'undefined') {\n toReturn['lastName'] = this.lastName;\n }\n if (typeof this.employeeFirstName !== 'undefined') {\n toReturn['employeeFirstName'] = this.employeeFirstName;\n }\n if (typeof this.employeeLastName !== 'undefined') {\n toReturn['employeeLastName'] = this.employeeLastName;\n }\n if (typeof this.tag !== 'undefined') {\n toReturn['tag'] = this.tag;\n }\n return toReturn;\n }\n}\nclass ListBusinessTagsRequest {\n static fromProto(proto) {\n let m = new ListBusinessTagsRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.businessId !== 'undefined') {\n toReturn['businessId'] = this.businessId;\n }\n return toReturn;\n }\n}\nclass ListBusinessTagsResponse {\n static fromProto(proto) {\n let m = new ListBusinessTagsResponse();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.tag !== 'undefined') {\n toReturn['tag'] = this.tag;\n }\n return toReturn;\n }\n}\nclass ListCustomersRequest {\n static fromProto(proto) {\n let m = new ListCustomersRequest();\n m = Object.assign(m, proto);\n if (proto.pagingOptions) {\n m.pagingOptions = PagedRequestOptions.fromProto(proto.pagingOptions);\n }\n if (proto.filters) {\n m.filters = CustomerFilters.fromProto(proto.filters);\n }\n if (proto.sortingOptions) {\n m.sortingOptions = proto.sortingOptions.map(SortingOption.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.businessId !== 'undefined') {\n toReturn['businessId'] = this.businessId;\n }\n if (typeof this.pagingOptions !== 'undefined' && this.pagingOptions !== null) {\n toReturn['pagingOptions'] = 'toApiJson' in this.pagingOptions ? this.pagingOptions.toApiJson() : this.pagingOptions;\n }\n if (typeof this.searchTerm !== 'undefined') {\n toReturn['searchTerm'] = this.searchTerm;\n }\n if (typeof this.filters !== 'undefined' && this.filters !== null) {\n toReturn['filters'] = 'toApiJson' in this.filters ? this.filters.toApiJson() : this.filters;\n }\n if (typeof this.sortingOptions !== 'undefined' && this.sortingOptions !== null) {\n toReturn['sortingOptions'] = 'toApiJson' in this.sortingOptions ? this.sortingOptions.toApiJson() : this.sortingOptions;\n }\n return toReturn;\n }\n}\nclass ListCustomersResponse {\n static fromProto(proto) {\n let m = new ListCustomersResponse();\n m = Object.assign(m, proto);\n if (proto.customers) {\n m.customers = proto.customers.map(Customer.fromProto);\n }\n if (proto.pagingMetadata) {\n m.pagingMetadata = PagedResponseMetadata.fromProto(proto.pagingMetadata);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.customers !== 'undefined' && this.customers !== null) {\n toReturn['customers'] = 'toApiJson' in this.customers ? this.customers.toApiJson() : this.customers;\n }\n if (typeof this.pagingMetadata !== 'undefined' && this.pagingMetadata !== null) {\n toReturn['pagingMetadata'] = 'toApiJson' in this.pagingMetadata ? this.pagingMetadata.toApiJson() : this.pagingMetadata;\n }\n return toReturn;\n }\n}\nclass ListOriginsRequest {\n static fromProto(proto) {\n let m = new ListOriginsRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.businessId !== 'undefined') {\n toReturn['businessId'] = this.businessId;\n }\n return toReturn;\n }\n}\nclass ListOriginsResponse {\n static fromProto(proto) {\n let m = new ListOriginsResponse();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.origins !== 'undefined') {\n toReturn['origins'] = this.origins;\n }\n return toReturn;\n }\n}\nclass ListReviewRequestEventRequest {\n static fromProto(proto) {\n let m = new ListReviewRequestEventRequest();\n m = Object.assign(m, proto);\n if (proto.pagingOptions) {\n m.pagingOptions = PagedRequestOptions.fromProto(proto.pagingOptions);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.businessId !== 'undefined') {\n toReturn['businessId'] = this.businessId;\n }\n if (typeof this.pagingOptions !== 'undefined' && this.pagingOptions !== null) {\n toReturn['pagingOptions'] = 'toApiJson' in this.pagingOptions ? this.pagingOptions.toApiJson() : this.pagingOptions;\n }\n return toReturn;\n }\n}\nclass ListReviewRequestEventResponse {\n static fromProto(proto) {\n let m = new ListReviewRequestEventResponse();\n m = Object.assign(m, proto);\n if (proto.reviewRequestEvents) {\n m.reviewRequestEvents = proto.reviewRequestEvents.map(ReviewRequestEvent.fromProto);\n }\n if (proto.pagingMetadata) {\n m.pagingMetadata = PagedResponseMetadata.fromProto(proto.pagingMetadata);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.reviewRequestEvents !== 'undefined' && this.reviewRequestEvents !== null) {\n toReturn['reviewRequestEvents'] = 'toApiJson' in this.reviewRequestEvents ? this.reviewRequestEvents.toApiJson() : this.reviewRequestEvents;\n }\n if (typeof this.pagingMetadata !== 'undefined' && this.pagingMetadata !== null) {\n toReturn['pagingMetadata'] = 'toApiJson' in this.pagingMetadata ? this.pagingMetadata.toApiJson() : this.pagingMetadata;\n }\n return toReturn;\n }\n}\nclass MultilocationSendReviewRequestsCSVRequest {\n static fromProto(proto) {\n let m = new MultilocationSendReviewRequestsCSVRequest();\n m = Object.assign(m, proto);\n if (proto.mapping) {\n m.mapping = HeaderMapping.fromProto(proto.mapping);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.partnerId !== 'undefined') {\n toReturn['partnerId'] = this.partnerId;\n }\n if (typeof this.filePath !== 'undefined') {\n toReturn['filePath'] = this.filePath;\n }\n if (typeof this.mapping !== 'undefined' && this.mapping !== null) {\n toReturn['mapping'] = 'toApiJson' in this.mapping ? this.mapping.toApiJson() : this.mapping;\n }\n return toReturn;\n }\n}\nclass PagedRequestOptions {\n static fromProto(proto) {\n let m = new PagedRequestOptions();\n m = Object.assign(m, proto);\n if (proto.pageSize) {\n m.pageSize = parseInt(proto.pageSize, 10);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.cursor !== 'undefined') {\n toReturn['cursor'] = this.cursor;\n }\n if (typeof this.pageSize !== 'undefined') {\n toReturn['pageSize'] = this.pageSize;\n }\n return toReturn;\n }\n}\nclass PagedResponseMetadata {\n static fromProto(proto) {\n let m = new PagedResponseMetadata();\n m = Object.assign(m, proto);\n if (proto.totalResults) {\n m.totalResults = parseInt(proto.totalResults, 10);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.nextCursor !== 'undefined') {\n toReturn['nextCursor'] = this.nextCursor;\n }\n if (typeof this.hasMore !== 'undefined') {\n toReturn['hasMore'] = this.hasMore;\n }\n if (typeof this.totalResults !== 'undefined') {\n toReturn['totalResults'] = this.totalResults;\n }\n return toReturn;\n }\n}\nclass SendReviewRequestEmailRequest {\n static fromProto(proto) {\n let m = new SendReviewRequestEmailRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.businessId !== 'undefined') {\n toReturn['businessId'] = this.businessId;\n }\n if (typeof this.customerId !== 'undefined') {\n toReturn['customerId'] = this.customerId;\n }\n return toReturn;\n }\n}\nclass SendReviewRequestSmsRequest {\n static fromProto(proto) {\n let m = new SendReviewRequestSmsRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.businessId !== 'undefined') {\n toReturn['businessId'] = this.businessId;\n }\n if (typeof this.customerId !== 'undefined') {\n toReturn['customerId'] = this.customerId;\n }\n return toReturn;\n }\n}\nclass SendReviewRequestToDefaultTemplateRequest {\n static fromProto(proto) {\n let m = new SendReviewRequestToDefaultTemplateRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.businessId !== 'undefined') {\n toReturn['businessId'] = this.businessId;\n }\n if (typeof this.customerId !== 'undefined') {\n toReturn['customerId'] = this.customerId;\n }\n return toReturn;\n }\n}\nclass SendSMSRequest {\n static fromProto(proto) {\n let m = new SendSMSRequest();\n m = Object.assign(m, proto);\n if (proto.attributes) {\n m.attributes = proto.attributes.map(Attribute.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n if (typeof this.customerId !== 'undefined') {\n toReturn['customerId'] = this.customerId;\n }\n if (typeof this.customerPhoneNumber !== 'undefined') {\n toReturn['customerPhoneNumber'] = this.customerPhoneNumber;\n }\n if (typeof this.messageToSend !== 'undefined') {\n toReturn['messageToSend'] = this.messageToSend;\n }\n if (typeof this.attributes !== 'undefined' && this.attributes !== null) {\n toReturn['attributes'] = 'toApiJson' in this.attributes ? this.attributes.toApiJson() : this.attributes;\n }\n return toReturn;\n }\n}\nclass SortingOption {\n static fromProto(proto) {\n let m = new SortingOption();\n m = Object.assign(m, proto);\n if (proto.sortDirection) {\n m.sortDirection = enumStringToValue$2(SortDirection, proto.sortDirection);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.columnName !== 'undefined') {\n toReturn['columnName'] = this.columnName;\n }\n if (typeof this.sortDirection !== 'undefined') {\n toReturn['sortDirection'] = this.sortDirection;\n }\n return toReturn;\n }\n}\nclass UpdateCustomerRequest {\n static fromProto(proto) {\n let m = new UpdateCustomerRequest();\n m = Object.assign(m, proto);\n if (proto.customer) {\n m.customer = Customer.fromProto(proto.customer);\n }\n if (proto.fieldMask) {\n m.fieldMask = FieldMask.fromProto(proto.fieldMask);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.customer !== 'undefined' && this.customer !== null) {\n toReturn['customer'] = 'toApiJson' in this.customer ? this.customer.toApiJson() : this.customer;\n }\n if (typeof this.fieldMask !== 'undefined' && this.fieldMask !== null) {\n toReturn['fieldMask'] = 'toApiJson' in this.fieldMask ? this.fieldMask.toApiJson() : this.fieldMask;\n }\n return toReturn;\n }\n}\nfunction enumStringToValue$1(enumRef, value) {\n if (typeof value === 'number') {\n return value;\n }\n return enumRef[value];\n}\nclass StartTrustHubRegistrationRequest {\n static fromProto(proto) {\n let m = new StartTrustHubRegistrationRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n return toReturn;\n }\n}\nfunction enumStringToValue(enumRef, value) {\n if (typeof value === 'number') {\n return value;\n }\n return enumRef[value];\n}\nclass GetReviewSourceSettingsRequest {\n static fromProto(proto) {\n let m = new GetReviewSourceSettingsRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.accountGroupId !== 'undefined') {\n toReturn['accountGroupId'] = this.accountGroupId;\n }\n return toReturn;\n }\n}\nclass GetReviewSourceSettingsResponse {\n static fromProto(proto) {\n let m = new GetReviewSourceSettingsResponse();\n m = Object.assign(m, proto);\n if (proto.reviewSources) {\n m.reviewSources = proto.reviewSources.map(ReviewSources.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.reviewSources !== 'undefined' && this.reviewSources !== null) {\n toReturn['reviewSources'] = 'toApiJson' in this.reviewSources ? this.reviewSources.toApiJson() : this.reviewSources;\n }\n if (typeof this.selectedSourceIds !== 'undefined') {\n toReturn['selectedSourceIds'] = this.selectedSourceIds;\n }\n return toReturn;\n }\n}\nclass ReviewSources {\n static fromProto(proto) {\n let m = new ReviewSources();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.sourceId !== 'undefined') {\n toReturn['sourceId'] = this.sourceId;\n }\n if (typeof this.displayName !== 'undefined') {\n toReturn['displayName'] = this.displayName;\n }\n if (typeof this.iconClass !== 'undefined') {\n toReturn['iconClass'] = this.iconClass;\n }\n if (typeof this.hasListings !== 'undefined') {\n toReturn['hasListings'] = this.hasListings;\n }\n if (typeof this.hasWarning !== 'undefined') {\n toReturn['hasWarning'] = this.hasWarning;\n }\n if (typeof this.url !== 'undefined') {\n toReturn['url'] = this.url;\n }\n if (typeof this.overriddenUrl !== 'undefined') {\n toReturn['overriddenUrl'] = this.overriddenUrl;\n }\n return toReturn;\n }\n}\n\n// *********************************\n\nconst environment = (window ? window['environment'] : 'prod') ?? 'prod';\nconst hostMap = {\n 'local': 'customer-voice-service-api.vendasta-local.com',\n 'test': '',\n 'demo': 'customer-voice-service-api-demo.apigateway.co',\n 'prod': 'customer-voice-service-api-prod.apigateway.co',\n 'production': 'customer-voice-service-api-prod.apigateway.co'\n};\nlet HostService = /*#__PURE__*/(() => {\n class HostService {\n get host() {\n return hostMap[environment.toLowerCase()];\n }\n get hostWithScheme() {\n return 'https://' + this.host;\n }\n }\n HostService.ɵfac = function HostService_Factory(t) {\n return new (t || HostService)();\n };\n HostService.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: HostService,\n factory: HostService.ɵfac,\n providedIn: 'root'\n });\n return HostService;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n// *********************************\nlet CustomerVoiceApiService = /*#__PURE__*/(() => {\n class CustomerVoiceApiService {\n constructor(http, hostService) {\n this.http = http;\n this.hostService = hostService;\n this._host = this.hostService.hostWithScheme;\n }\n apiOptions() {\n return {\n headers: new HttpHeaders({\n 'Content-Type': 'application/json'\n }),\n withCredentials: true\n };\n }\n listCustomers(r) {\n const request = r.toApiJson ? r : new ListCustomersRequest(r);\n return this.http.post(this._host + \"/customervoice.v1.CustomerVoice/ListCustomers\", request.toApiJson(), this.apiOptions()).pipe(map(resp => ListCustomersResponse.fromProto(resp)));\n }\n createCustomer(r) {\n const request = r.toApiJson ? r : new CreateCustomerRequest(r);\n return this.http.post(this._host + \"/customervoice.v1.CustomerVoice/CreateCustomer\", request.toApiJson(), this.apiOptions()).pipe(map(resp => CreateCustomerResponse.fromProto(resp)));\n }\n createMultiCustomers(r) {\n const request = r.toApiJson ? r : new CreateMultiCustomerRequest(r);\n return this.http.post(this._host + \"/customervoice.v1.CustomerVoice/CreateMultiCustomers\", request.toApiJson(), this.apiOptions()).pipe(map(resp => CreateMultiCustomerResponse.fromProto(resp)));\n }\n sendReviewRequestToDefaultTemplate(r) {\n const request = r.toApiJson ? r : new SendReviewRequestToDefaultTemplateRequest(r);\n return this.http.post(this._host + \"/customervoice.v1.CustomerVoice/SendReviewRequestToDefaultTemplate\", request.toApiJson(), {\n ...this.apiOptions(),\n observe: 'response'\n });\n }\n sendReviewRequestEmail(r) {\n const request = r.toApiJson ? r : new SendReviewRequestEmailRequest(r);\n return this.http.post(this._host + \"/customervoice.v1.CustomerVoice/SendReviewRequestEmail\", request.toApiJson(), {\n ...this.apiOptions(),\n observe: 'response'\n });\n }\n sendReviewRequestSms(r) {\n const request = r.toApiJson ? r : new SendReviewRequestSmsRequest(r);\n return this.http.post(this._host + \"/customervoice.v1.CustomerVoice/SendReviewRequestSms\", request.toApiJson(), {\n ...this.apiOptions(),\n observe: 'response'\n });\n }\n updateCustomer(r) {\n const request = r.toApiJson ? r : new UpdateCustomerRequest(r);\n return this.http.post(this._host + \"/customervoice.v1.CustomerVoice/UpdateCustomer\", request.toApiJson(), {\n ...this.apiOptions(),\n observe: 'response'\n });\n }\n deleteCustomer(r) {\n const request = r.toApiJson ? r : new DeleteCustomerRequest(r);\n return this.http.post(this._host + \"/customervoice.v1.CustomerVoice/DeleteCustomer\", request.toApiJson(), {\n ...this.apiOptions(),\n observe: 'response'\n });\n }\n getCustomer(r) {\n const request = r.toApiJson ? r : new GetCustomerRequest(r);\n return this.http.post(this._host + \"/customervoice.v1.CustomerVoice/GetCustomer\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetCustomerResponse.fromProto(resp)));\n }\n getMultiCustomerForBusiness(r) {\n const request = r.toApiJson ? r : new GetMultiCustomerForBusinessRequest(r);\n return this.http.post(this._host + \"/customervoice.v1.CustomerVoice/GetMultiCustomerForBusiness\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetMultiCustomerForBusinessResponse.fromProto(resp)));\n }\n listBusinessTags(r) {\n const request = r.toApiJson ? r : new ListBusinessTagsRequest(r);\n return this.http.post(this._host + \"/customervoice.v1.CustomerVoice/ListBusinessTags\", request.toApiJson(), this.apiOptions()).pipe(map(resp => ListBusinessTagsResponse.fromProto(resp)));\n }\n customerExists(r) {\n const request = r.toApiJson ? r : new CustomerExistsRequest(r);\n return this.http.post(this._host + \"/customervoice.v1.CustomerVoice/CustomerExists\", request.toApiJson(), this.apiOptions()).pipe(map(resp => CustomerExistsResponse.fromProto(resp)));\n }\n multilocationSendReviewRequestsCsv(r) {\n const request = r.toApiJson ? r : new MultilocationSendReviewRequestsCSVRequest(r);\n return this.http.post(this._host + \"/customervoice.v1.CustomerVoice/MultilocationSendReviewRequestsCSV\", request.toApiJson(), {\n ...this.apiOptions(),\n observe: 'response'\n });\n }\n createReviewRequestEvent(r) {\n const request = r.toApiJson ? r : new CreateReviewRequestEventRequest(r);\n return this.http.post(this._host + \"/customervoice.v1.CustomerVoice/CreateReviewRequestEvent\", request.toApiJson(), this.apiOptions()).pipe(map(resp => CreateReviewRequestEventResponse.fromProto(resp)));\n }\n listReviewRequestEvents(r) {\n const request = r.toApiJson ? r : new ListReviewRequestEventRequest(r);\n return this.http.post(this._host + \"/customervoice.v1.CustomerVoice/ListReviewRequestEvents\", request.toApiJson(), this.apiOptions()).pipe(map(resp => ListReviewRequestEventResponse.fromProto(resp)));\n }\n listOrigins(r) {\n const request = r.toApiJson ? r : new ListOriginsRequest(r);\n return this.http.post(this._host + \"/customervoice.v1.CustomerVoice/ListOrigins\", request.toApiJson(), this.apiOptions()).pipe(map(resp => ListOriginsResponse.fromProto(resp)));\n }\n createCustomerAndSendDefaultReviewRequest(r) {\n const request = r.toApiJson ? r : new CreateCustomerAndSendDefaultReviewRequestRequest(r);\n return this.http.post(this._host + \"/customervoice.v1.CustomerVoice/CreateCustomerAndSendDefaultReviewRequest\", request.toApiJson(), this.apiOptions()).pipe(map(resp => CreateCustomerAndSendDefaultReviewRequestResponse.fromProto(resp)));\n }\n sendSms(r) {\n const request = r.toApiJson ? r : new SendSMSRequest(r);\n return this.http.post(this._host + \"/customervoice.v1.CustomerVoice/SendSMS\", request.toApiJson(), {\n ...this.apiOptions(),\n observe: 'response'\n });\n }\n getQrCodeForUrl(r) {\n const request = r.toApiJson ? r : new GetQRCodeForURLRequest(r);\n return this.http.post(this._host + \"/customervoice.v1.CustomerVoice/GetQRCodeForURL\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetQRCodeForURLResponse.fromProto(resp)));\n }\n }\n CustomerVoiceApiService.ɵfac = function CustomerVoiceApiService_Factory(t) {\n return new (t || CustomerVoiceApiService)(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(HostService));\n };\n CustomerVoiceApiService.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: CustomerVoiceApiService,\n factory: CustomerVoiceApiService.ɵfac,\n providedIn: 'root'\n });\n return CustomerVoiceApiService;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n// *********************************\nlet ListingsApiService = /*#__PURE__*/(() => {\n class ListingsApiService {\n constructor(http, hostService) {\n this.http = http;\n this.hostService = hostService;\n this._host = this.hostService.hostWithScheme;\n }\n apiOptions() {\n return {\n headers: new HttpHeaders({\n 'Content-Type': 'application/json'\n }),\n withCredentials: true\n };\n }\n getReviewSourceSettings(r) {\n const request = r.toApiJson ? r : new GetReviewSourceSettingsRequest(r);\n return this.http.post(this._host + \"/customervoice.v1.ListingsService/GetReviewSourceSettings\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetReviewSourceSettingsResponse.fromProto(resp)));\n }\n }\n ListingsApiService.ɵfac = function ListingsApiService_Factory(t) {\n return new (t || ListingsApiService)(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(HostService));\n };\n ListingsApiService.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: ListingsApiService,\n factory: ListingsApiService.ɵfac,\n providedIn: 'root'\n });\n return ListingsApiService;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n// *********************************\nlet TwilioApiService = /*#__PURE__*/(() => {\n class TwilioApiService {\n constructor(http, hostService) {\n this.http = http;\n this.hostService = hostService;\n this._host = this.hostService.hostWithScheme;\n }\n apiOptions() {\n return {\n headers: new HttpHeaders({\n 'Content-Type': 'application/json'\n }),\n withCredentials: true\n };\n }\n startTrustHubRegistration(r) {\n const request = r.toApiJson ? r : new StartTrustHubRegistrationRequest(r);\n return this.http.post(this._host + \"/customervoice.v1.Twilio/StartTrustHubRegistration\", request.toApiJson(), {\n ...this.apiOptions(),\n observe: 'response'\n });\n }\n }\n TwilioApiService.ɵfac = function TwilioApiService_Factory(t) {\n return new (t || TwilioApiService)(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(HostService));\n };\n TwilioApiService.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: TwilioApiService,\n factory: TwilioApiService.ɵfac,\n providedIn: 'root'\n });\n return TwilioApiService;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n// *********************************\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { Attribute, AutomationType, CreateCustomerAndSendDefaultReviewRequestRequest, CreateCustomerAndSendDefaultReviewRequestResponse, CreateCustomerRequest, CreateCustomerResponse, CreateError, CreateMultiCustomerError, CreateMultiCustomerRequest, CreateMultiCustomerResponse, CreateReviewRequestEventRequest, CreateReviewRequestEventResponse, Customer, CustomerExistsRequest, CustomerExistsResponse, CustomerFilters, CustomerRequestEvent, CustomerReview, CustomerVoiceApiService, DateRangeFilter, DeleteCustomerRequest, FieldMask, GetCustomerRequest, GetCustomerResponse, GetMultiCustomerForBusinessRequest, GetMultiCustomerForBusinessResponse, GetQRCodeForURLRequest, GetQRCodeForURLResponse, GetReviewSourceSettingsRequest, GetReviewSourceSettingsResponse, HeaderMapping, HostService, ListBusinessTagsRequest, ListBusinessTagsResponse, ListCustomersRequest, ListCustomersResponse, ListOriginsRequest, ListOriginsResponse, ListReviewRequestEventRequest, ListReviewRequestEventResponse, ListingsApiService, MultilocationSendReviewRequestsCSVRequest, PagedRequestOptions, PagedResponseMetadata, RequestEventType, ReviewRequestEvent, ReviewRequestStatus, ReviewSources, SendReviewRequestEmailRequest, SendReviewRequestSmsRequest, SendReviewRequestToDefaultTemplateRequest, SendSMSRequest, SmsStatusCode, SortDirection, SortingOption, StartTrustHubRegistrationRequest, TwilioApiService, UpdateCustomerRequest };\n","import { Inject, Injectable } from '@angular/core';\nimport { ListingsApiService } from '@vendasta/customer-voice-service';\n\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { FACEBOOK_SOURCE_ID, GOOGLE_SOURCE_ID } from './inbox.constants';\nimport { ACCOUNT_GROUP_ID_TOKEN } from './tokens';\n\nexport interface ReviewLink {\n sourceName: string;\n reviewUrl: string;\n}\n\n@Injectable()\nexport class ListingService {\n private currentAccountGroupId: string;\n\n constructor(\n private listingsApiService: ListingsApiService,\n @Inject(ACCOUNT_GROUP_ID_TOKEN) readonly accountGroupId$: Observable,\n ) {\n this.accountGroupId$.pipe(takeUntilDestroyed()).subscribe((accountGroupId) => {\n this.currentAccountGroupId = accountGroupId;\n });\n }\n\n public get reviewLinks$(): Observable {\n return this.listingsApiService.getReviewSourceSettings({ accountGroupId: this.currentAccountGroupId }).pipe(\n map((response) => {\n return response.reviewSources\n .filter((result) => result.url != null || result.overriddenUrl != null)\n .sort((a, b) => {\n if (\n a.sourceId == GOOGLE_SOURCE_ID ||\n a.sourceId == FACEBOOK_SOURCE_ID ||\n (a.sourceId == GOOGLE_SOURCE_ID && b.sourceId == FACEBOOK_SOURCE_ID)\n ) {\n return -1;\n }\n return 1;\n })\n .map((result) => {\n if (result.overriddenUrl) {\n return {\n sourceName: result.displayName,\n reviewUrl: result.overriddenUrl,\n } as ReviewLink;\n }\n return {\n sourceName: result.displayName,\n reviewUrl: result.url,\n } as ReviewLink;\n });\n }),\n );\n }\n}\n","import { HttpResponse } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { ConversationApiService } from '@vendasta/conversation';\nimport { View } from '@vendasta/conversation/lib/_internal/objects/conversation-view';\nimport { ProductAnalyticsService } from '@vendasta/product-analytics';\nimport { BehaviorSubject, Observable, combineLatest, switchMap } from 'rxjs';\nimport { distinctUntilChanged, filter, map, tap } from 'rxjs/operators';\nimport { ALL_VIEW_ID, FOLLOWING_VIEW_ID } from './inbox.constants';\nimport { ParticipantService } from './participant.service';\n\nconst localStorageKey = 'inbox-selected-view-id';\n\nexport const getDefaultViewId = (): string => localStorage.getItem(localStorageKey) || ALL_VIEW_ID;\n\n/**\n * Service that interacts with Inbox Views in conversation µservice\n */\n@Injectable()\nexport class ViewService {\n private readonly selectedViewId$$ = new BehaviorSubject(getDefaultViewId());\n readonly selectedViewId$ = this.selectedViewId$$.pipe(\n distinctUntilChanged(),\n tap((selectedViewId) => {\n this.analyticsService.trackEvent('inbox', 'views-tab', 'click', 0, {\n viewId: selectedViewId,\n });\n localStorage.setItem(localStorageKey, selectedViewId);\n }),\n );\n\n constructor(\n private analyticsService: ProductAnalyticsService,\n private conversationApiService: ConversationApiService,\n private participantService: ParticipantService,\n ) {}\n\n setViewId(viewId: string): void {\n this.selectedViewId$$.next(viewId);\n }\n\n // TODO MEGA-248: move view logic from conversationService to viewService\n loadViews(): Observable {\n return this.participantService.currentParticipant$.pipe(\n filter((participant) => !!participant),\n switchMap((participant) =>\n this.conversationApiService.getConversationViews({\n participantId: participant.participantId,\n }),\n ),\n map((res) => res.views),\n );\n }\n\n addConversationToConversationView(conversationId: string): Observable> {\n return combineLatest([this.participantService.currentParticipant$, this.loadViews()]).pipe(\n switchMap(([currentUserParticipant]) => {\n const value = {\n viewId: FOLLOWING_VIEW_ID,\n conversationId: conversationId,\n participantId: currentUserParticipant.participantId,\n };\n return this.conversationApiService.addConversationToConversationView(value);\n }),\n );\n }\n\n removeConversationFromConversationView(conversationId: string): Observable> {\n return this.participantService.currentParticipant$.pipe(\n switchMap((currentUserParticipant) => {\n const value = {\n viewId: FOLLOWING_VIEW_ID,\n conversationId: conversationId,\n participantId: currentUserParticipant.participantId,\n };\n return this.conversationApiService.removeConversationFromConversationView(value);\n }),\n );\n }\n}\n","import { inject, InjectionToken, ModuleWithProviders, NgModule } from '@angular/core';\nimport { getApp, initializeApp, provideFirebaseApp } from '@angular/fire/app';\nimport { getFirestore, provideFirestore } from '@angular/fire/firestore';\nimport { Environment, EnvironmentService } from '@galaxy/core';\nimport { ConversationChannel, GlobalParticipantType, InboxApiService, PlatformLocation } from '@vendasta/conversation';\nimport { combineLatest, isObservable, map, Observable, of, switchMap } from 'rxjs';\nimport { catchError, shareReplay } from 'rxjs/operators';\nimport { ConversationChannelService } from './channels/conversation-channel.abstract';\nimport { ConversationFacebookService } from './channels/conversation-facebook.service';\nimport { ConversationGoogleService } from './channels/conversation-google.service';\nimport { ConversationSMSService } from './channels/conversation-sms.service';\nimport { ConversationWebchatService } from './channels/conversation-webchat.service';\nimport { ConversationService } from './conversation.service';\nimport { firebaseConfig } from './firebase.config';\nimport { FirestoreService } from './firestore.service';\nimport { InboxNavigationService } from './inbox-navigation.service';\nimport { InboxNotificationService } from './inbox-notification.service';\nimport { InboxService } from './inbox.service';\nimport { ConversationConfig } from './interface/config.interface';\nimport { RouteConfig } from './interface/routes.interface';\nimport { ListingService } from './listing.service';\nimport { ParticipantService } from './participant.service';\nimport { TemplateService } from './template.service';\nimport {\n ACCOUNT_GROUP_ID_TOKEN,\n COMPANY_NAME_TOKEN,\n CONVERSATION_CHANNEL_SERVICE_TOKEN,\n CONVERSATION_CONFIG_TOKEN,\n CONVERSATION_CONVERSATION_CHANNELS_ENABLED_TOKEN,\n CONVERSATION_COUNTRY_TOKEN,\n CONVERSATION_FACEBOOK_MESSENGER_AVAILABLE_TOKEN,\n CONVERSATION_GEOGRAPHICAL_STATE_TOKEN,\n CONVERSATION_GOOGLE_BUSINESS_MESSAGES_AVAILABLE_TOKEN,\n CONVERSATION_IMAGE_SERVICE_TOKEN,\n CONVERSATION_PLATFORM_LOCATION_TOKEN,\n CONVERSATION_ROUTES_TOKEN,\n CONVERSATION_SMS_ENABLED_TOKEN,\n CONVERSATION_WEB_CHAT_ENABLED_TOKEN,\n FEATURE_FLAG_TOKEN,\n GROUP_ID_TOKEN,\n InboxImageService,\n MARKET_ID_TOKEN,\n PARTNER_BRAND_NAME_TOKEN,\n PARTNER_ID_TOKEN,\n StubInboxImageService,\n USER_ID_TOKEN,\n} from './tokens';\nimport { ViewService } from './view.service';\n\nconst SERVICE_PROVIDERS = [\n ViewService,\n ParticipantService,\n ConversationService,\n FirestoreService,\n InboxService,\n InboxNavigationService,\n ListingService,\n InboxNotificationService,\n ConversationGoogleService,\n ConversationFacebookService,\n ConversationSMSService,\n ConversationWebchatService,\n TemplateService,\n];\n\n@NgModule({\n imports: [\n provideFirebaseApp(() => initializeApp(firebaseConfig, 'inbox')),\n provideFirestore(() => getFirestore(getApp('inbox'))),\n ],\n})\nexport class ConversationCoreModule {\n static forRoot(c: { config: InjectionToken }): ModuleWithProviders {\n const result = {\n ngModule: ConversationCoreModule,\n providers: [\n ...SERVICE_PROVIDERS,\n { provide: USER_ID_TOKEN, deps: [CONVERSATION_CONFIG_TOKEN], useFactory: userIdFactory },\n { provide: ACCOUNT_GROUP_ID_TOKEN, deps: [CONVERSATION_CONFIG_TOKEN], useFactory: accountGroupIdFactory },\n {\n provide: CONVERSATION_COUNTRY_TOKEN,\n deps: [CONVERSATION_CONFIG_TOKEN],\n useFactory: countryFactory,\n },\n {\n provide: CONVERSATION_GEOGRAPHICAL_STATE_TOKEN,\n deps: [CONVERSATION_CONFIG_TOKEN],\n useFactory: geographicalState,\n },\n { provide: PARTNER_ID_TOKEN, deps: [CONVERSATION_CONFIG_TOKEN], useFactory: partnerIdFactory },\n { provide: PARTNER_BRAND_NAME_TOKEN, deps: [CONVERSATION_CONFIG_TOKEN], useFactory: partnerBrandNameFactory },\n { provide: MARKET_ID_TOKEN, deps: [CONVERSATION_CONFIG_TOKEN], useFactory: marketIdFactory },\n { provide: COMPANY_NAME_TOKEN, deps: [CONVERSATION_CONFIG_TOKEN], useFactory: companyNameFactory },\n {\n provide: CONVERSATION_PLATFORM_LOCATION_TOKEN,\n deps: [CONVERSATION_CONFIG_TOKEN],\n useFactory: platformLocationFactory,\n },\n {\n provide: CONVERSATION_CONVERSATION_CHANNELS_ENABLED_TOKEN,\n deps: [CONVERSATION_CONFIG_TOKEN],\n useFactory: conversationChannelsEnabledFactory,\n },\n {\n provide: FEATURE_FLAG_TOKEN,\n deps: [CONVERSATION_CONFIG_TOKEN],\n useFactory: featureFlagFactory,\n },\n {\n provide: CONVERSATION_IMAGE_SERVICE_TOKEN,\n deps: [CONVERSATION_CONFIG_TOKEN],\n useFactory: inboxImageServiceFactory,\n },\n { provide: CONVERSATION_ROUTES_TOKEN, deps: [CONVERSATION_CONFIG_TOKEN], useFactory: routesFactory },\n {\n provide: CONVERSATION_GOOGLE_BUSINESS_MESSAGES_AVAILABLE_TOKEN,\n deps: [CONVERSATION_CONFIG_TOKEN],\n useFactory: googleBusinessMessagesAvailableFactory,\n },\n {\n provide: CONVERSATION_FACEBOOK_MESSENGER_AVAILABLE_TOKEN,\n deps: [CONVERSATION_CONFIG_TOKEN],\n useFactory: facebookMessengerEnabledFactory,\n },\n {\n provide: CONVERSATION_SMS_ENABLED_TOKEN,\n deps: [CONVERSATION_CONFIG_TOKEN],\n useFactory: smsEnabledFactory,\n },\n {\n provide: CONVERSATION_WEB_CHAT_ENABLED_TOKEN,\n deps: [CONVERSATION_CONFIG_TOKEN],\n useFactory: webchatEnabledFactory,\n },\n { provide: CONVERSATION_CONFIG_TOKEN, useExisting: c.config },\n { provide: CONVERSATION_CHANNEL_SERVICE_TOKEN, useFactory: abstractConversationChannelServiceFactory },\n {\n provide: GROUP_ID_TOKEN,\n deps: [CONVERSATION_CONFIG_TOKEN],\n useFactory: groupIdFactory,\n },\n ],\n };\n return result;\n }\n}\n\nfunction userIdFactory(config: ConversationConfig): Observable {\n return isObservable(config.userId$) ? config.userId$ : of(config.userId$);\n}\n\nfunction accountGroupIdFactory(config: ConversationConfig): Observable {\n return isObservable(config.accountGroupId$) ? config.accountGroupId$ : of(config.accountGroupId$);\n}\n\nfunction countryFactory(config: ConversationConfig): Observable {\n return isObservable(config.country$) ? config.country$ : of(config.country$);\n}\n\nfunction geographicalState(config: ConversationConfig): Observable {\n return isObservable(config.geographicalState$) ? config.geographicalState$ : of(config.geographicalState$);\n}\n\nfunction partnerIdFactory(config: ConversationConfig): Observable {\n return isObservable(config.partnerId$) ? config.partnerId$ : of(config.partnerId$);\n}\n\nfunction partnerBrandNameFactory(config: ConversationConfig): Observable {\n return isObservable(config.partnerBrandName$) ? config.partnerBrandName$ : of(config.partnerBrandName$);\n}\n\nfunction companyNameFactory(config: ConversationConfig): Observable {\n return isObservable(config.companyName$) ? config.companyName$ : of(config.companyName$);\n}\n\nfunction platformLocationFactory(config: ConversationConfig): PlatformLocation {\n return config.platformLocation;\n}\n\nfunction conversationChannelsEnabledFactory(\n config: ConversationConfig,\n): Observable {\n return isObservable(config.conversationChannelsEnabled$)\n ? config.conversationChannelsEnabled$\n : of(config.conversationChannelsEnabled$);\n}\n\nfunction routesFactory(config: ConversationConfig): Observable {\n return isObservable(config.routes$) ? config.routes$ : of(config.routes$);\n}\n\nfunction featureFlagFactory(config: ConversationConfig): Observable {\n if (!config.featureFlag$) {\n return of(false);\n }\n return config.featureFlag$;\n}\n\nfunction inboxImageServiceFactory(config: ConversationConfig): InboxImageService {\n return config.inboxImageService || inject(StubInboxImageService);\n}\n\nfunction marketIdFactory(config: ConversationConfig): Observable {\n return isObservable(config.marketId$) ? config.marketId$ : of(config.marketId$);\n}\n\nfunction smsEnabledFactory(config: ConversationConfig): Observable {\n const inboxApiService = inject(InboxApiService);\n const isEnabled$ = isObservable(config.smsEnabled$) ? config.smsEnabled$ : of(config.smsEnabled$);\n return combineLatest([config.accountGroupId$, isEnabled$]).pipe(\n switchMap(([agid, isEnabled]) => {\n if (!isEnabled || !agid) {\n return of({ configuration: { smsEnabled: false } });\n }\n return inboxApiService.getConfiguration({\n subjectParticipant: {\n participantType: GlobalParticipantType.GLOBAL_PARTICIPANT_TYPE_ACCOUNT_GROUP,\n internalParticipantId: agid,\n },\n });\n }),\n map((config): boolean => config.configuration.smsEnabled),\n shareReplay({ refCount: true, bufferSize: 1 }),\n catchError(() => of(false)),\n );\n}\n\nfunction webchatEnabledFactory(config: ConversationConfig): Observable {\n const isEnabled$ = isObservable(config.webChatEnabled$) ? config.webChatEnabled$ : of(false);\n\n return isEnabled$.pipe(\n shareReplay({ refCount: true, bufferSize: 1 }),\n catchError(() => of(false)),\n );\n}\n\nfunction facebookMessengerEnabledFactory(config: ConversationConfig): Observable {\n const inboxApiService = inject(InboxApiService);\n const enableable$ = isObservable(config.facebookMessengerSupported$)\n ? config.facebookMessengerSupported$\n : of(config.facebookMessengerSupported$);\n\n return combineLatest([config.accountGroupId$, enableable$]).pipe(\n switchMap(([agid, enableable]) => {\n if (!enableable || !agid) {\n return of({ configuration: { facebookMessengerEnabled: false } });\n }\n return inboxApiService.getConfiguration({\n subjectParticipant: {\n participantType: GlobalParticipantType.GLOBAL_PARTICIPANT_TYPE_ACCOUNT_GROUP,\n internalParticipantId: agid,\n },\n });\n }),\n map((config): boolean => config.configuration.facebookMessengerEnabled),\n shareReplay({ refCount: true, bufferSize: 1 }),\n catchError(() => of(false)),\n );\n}\n\nfunction googleBusinessMessagesAvailableFactory(config: ConversationConfig): Observable {\n const inboxService = inject(InboxApiService);\n const environmentService = inject(EnvironmentService);\n const enableable$ = isObservable(config.googleBusinessMessagesSupported$)\n ? config.googleBusinessMessagesSupported$\n : of(config.googleBusinessMessagesSupported$);\n\n return combineLatest([config.accountGroupId$, enableable$]).pipe(\n switchMap(([agid, enableable]) => {\n if (!enableable || environmentService.getEnvironment() !== Environment.PROD || !agid) {\n return of({ configuration: { googleBusinessMessagesEnabled: false } });\n }\n return inboxService.getConfiguration({\n subjectParticipant: {\n participantType: GlobalParticipantType.GLOBAL_PARTICIPANT_TYPE_ACCOUNT_GROUP,\n internalParticipantId: agid,\n },\n });\n }),\n map((config): boolean => config.configuration.googleBusinessMessagesEnabled),\n shareReplay({ refCount: true, bufferSize: 1 }),\n catchError(() => of(false)),\n );\n}\n\nfunction abstractConversationChannelServiceFactory(): Map {\n const conversationGoogleService = inject(ConversationGoogleService);\n const conversationWebChatService = inject(ConversationWebchatService);\n const conversationFacebookService = inject(ConversationFacebookService);\n let conversationSMSService: ConversationSMSService;\n\n const channelMap = new Map([\n [ConversationChannel.CONVERSATION_CHANNEL_GOOGLE_BUSINESS_COMMUNICATIONS, conversationGoogleService],\n [ConversationChannel.CONVERSATION_CHANNEL_WEB_CHAT, conversationWebChatService],\n [ConversationChannel.CONVERSATION_CHANNEL_FACEBOOK, conversationFacebookService],\n ]);\n\n try {\n conversationSMSService = inject(ConversationSMSService);\n channelMap.set(ConversationChannel.CONVERSATION_CHANNEL_SMS, conversationSMSService);\n } catch (e) {\n channelMap.set(ConversationChannel.CONVERSATION_CHANNEL_SMS, undefined);\n console.debug('ConversationSMSService could not be injected.', e);\n }\n\n return channelMap;\n}\n\nfunction groupIdFactory(config: ConversationConfig): Observable {\n return isObservable(config.groupId$) ? config.groupId$ : of(config.groupId$);\n}\n","import { Injectable, inject } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { Query, collectionData, limit, query } from '@angular/fire/firestore';\nimport {\n BehaviorSubject,\n Observable,\n Subject,\n asyncScheduler,\n combineLatest,\n distinctUntilChanged,\n map,\n observeOn,\n of,\n shareReplay,\n startWith,\n switchMap,\n} from 'rxjs';\nimport { ConversationFilters } from './conversation-filters';\nimport { ConversationService } from './conversation.service';\nimport { FirestoreService } from './firestore.service';\nimport { FOLLOWING_VIEW_ID } from './inbox.constants';\nimport { InboxService } from './inbox.service';\nimport { ConversationDetail, FirestoreConversation } from './interface/conversation.interface';\nimport { ParticipantService } from './participant.service';\nimport { GROUP_ID_TOKEN } from './tokens';\nimport { ViewService } from './view.service';\n\n@Injectable({ providedIn: 'any' })\nexport class ConversationListService {\n private readonly participantService = inject(ParticipantService);\n private readonly inboxService = inject(InboxService);\n private readonly firestoreService = inject(FirestoreService);\n private readonly conversationService = inject(ConversationService);\n private readonly groupId$ = inject(GROUP_ID_TOKEN);\n\n readonly currentParticipant$ = this.participantService.currentParticipant$;\n\n private readonly filters$$ = new BehaviorSubject(null);\n private readonly loadMoreConversations$$ = new Subject();\n private readonly filterTerm$$ = new BehaviorSubject('');\n\n private readonly conversationsScrollable$ = combineLatest([\n this.currentParticipant$,\n this.participantService.organizationId$,\n inject(ViewService).selectedViewId$,\n this.inboxService.showInboxViews$,\n this.filterTerm$$,\n this.filters$$,\n this.groupId$,\n this.inboxService.isConversationSummaryEnabled$,\n ]).pipe(\n observeOn(asyncScheduler),\n switchMap(\n ([\n currentParticipant,\n organizationId,\n viewId,\n showViews,\n filterTerm,\n filters,\n groupId,\n showConversationSummary,\n ]) => {\n let pageSize = !filterTerm ? 20 : 200; // Get 200 results for a better chance of getting search results\n let conversations: ConversationDetail[] | null = [];\n if (!currentParticipant) {\n return of({\n conversations,\n loading: false,\n empty: true,\n });\n }\n\n return this.loadMoreConversations$$.pipe(\n startWith(null),\n switchMap(() => {\n let q =\n viewId === FOLLOWING_VIEW_ID && showViews\n ? this.firestoreService.getViewsConversationsQuery(currentParticipant.participantId, viewId)\n : this.firestoreService.setupBaseConversationsQuery(organizationId, filters, groupId);\n q = query(q, limit(pageSize));\n pageSize += 40;\n return this.fetchConversations(q, showConversationSummary).pipe(\n map((newConversations) => {\n conversations = newConversations;\n return {\n conversations: this.filterConversations(conversations, filterTerm),\n loading: false,\n empty: conversations.length === 0,\n };\n }),\n startWith({ conversations, loading: true, empty: null }),\n );\n }),\n );\n },\n ),\n takeUntilDestroyed(),\n shareReplay(1),\n );\n readonly conversations$: Observable = this.conversationsScrollable$.pipe(\n map((scrollable) => scrollable.conversations),\n distinctUntilChanged(),\n );\n readonly loadingConversations$: Observable = this.conversationsScrollable$.pipe(\n map((scrollable) => scrollable.loading),\n distinctUntilChanged(),\n );\n readonly emptyConversations$: Observable = this.conversationsScrollable$.pipe(\n map((scrollable) => scrollable.empty),\n distinctUntilChanged(),\n );\n\n // We use a realtime query for this instead of a count so that when the first message for an organization is sent, the\n // conversation list appears.\n readonly organizationHasConversations$ = this.participantService.organizationId$.pipe(\n switchMap((id) => {\n let q = this.firestoreService.setupBaseConversationsQuery(id, null, null, true, true);\n q = query(q, limit(1));\n return collectionData(q);\n }),\n map((res) => res.length > 0),\n takeUntilDestroyed(),\n shareReplay(1),\n );\n\n readonly organizationHasClosedConversations$ = this.participantService.organizationId$.pipe(\n switchMap((id) => {\n const filters: ConversationFilters = { isOpen: false, isAnonymous: false };\n let q = this.firestoreService.setupBaseConversationsQuery(id, filters, null, true, true);\n q = query(q, limit(1));\n return collectionData(q);\n }),\n map((res) => res.length > 0),\n takeUntilDestroyed(),\n shareReplay(1),\n );\n\n loadMoreConversations(): void {\n this.loadMoreConversations$$.next();\n }\n\n fetchConversations(\n conversationsCollection: Query,\n getSummary = false,\n ): Observable {\n return collectionData(conversationsCollection, { idField: 'id' }).pipe(\n map((cs) => cs.map((c) => c.conversationId).filter((id): id is string => !!id)),\n switchMap((ids) => this.conversationService.getMultiConversationDetails(ids, getSummary)),\n );\n }\n\n setFilterTerm(term: string): void {\n this.filterTerm$$.next(term);\n }\n\n private filterConversations(options: ConversationDetail[], term: string): ConversationDetail[] {\n term = term?.toUpperCase();\n if (!options) {\n return [];\n }\n\n if (!term) {\n return options;\n }\n\n return options.filter((conversationDetail) => {\n const participantsFiltered = conversationDetail?.participants?.filter(\n (participant) =>\n participant?.name?.toLocaleUpperCase().includes(term) ||\n participant?.phoneNumber?.toUpperCase().includes(term),\n );\n if (participantsFiltered && participantsFiltered.length > 0) {\n return conversationDetail;\n }\n });\n }\n\n updateFilters(filters: ConversationFilters | null): void {\n this.filters$$.next(filters);\n }\n}\n","import { Inject, Injectable } from '@angular/core';\nimport { MatSnackBar } from '@angular/material/snack-bar';\nimport {\n GetTermsOfServiceResponse,\n GetUserAgreementTermsOfServiceResponse,\n PartnerTermsOfApiService,\n PartnerUserAgreementTermsOfApiService,\n TermsOfService,\n UserAgreementTermsOfService,\n} from '@galaxy/partner';\nimport {\n EMPTY,\n Observable,\n ReplaySubject,\n catchError,\n combineLatest,\n defaultIfEmpty,\n map,\n of,\n shareReplay,\n switchMap,\n} from 'rxjs';\nimport { getPlatformLocationToSKey } from './conversation-utils';\nimport { ConversationService } from './conversation.service';\nimport { InboxService } from './inbox.service';\nimport { PARTNER_ID_TOKEN, USER_ID_TOKEN } from './tokens';\n\nexport interface PlatformLocationToSKey {\n partnerId: string;\n feature: string;\n}\n\n@Injectable()\nexport class InboxTermsOfService {\n readonly termsOfServiceAccepted$$: ReplaySubject = new ReplaySubject(1);\n public termsOfServiceAccepted$: Observable = this.termsOfServiceAccepted$$.asObservable();\n\n platformLocationToSKey$ = of(getPlatformLocationToSKey(this.inboxService.platformLocation));\n\n readonly userAgreementTerms$: Observable = this.platformLocationToSKey$.pipe(\n switchMap((platformLocationToSKey) =>\n this.getUserAgreement({\n feature: platformLocationToSKey.feature,\n }),\n ),\n );\n\n readonly termsOfService$: Observable = this.platformLocationToSKey$.pipe(\n switchMap((platformLocationToSKey) =>\n this.getTermsOfService({\n partnerId: platformLocationToSKey.partnerId,\n feature: platformLocationToSKey.feature,\n }).pipe(map((tos) => tos?.termsOfService)),\n ),\n );\n\n readonly getTermsOfServiceText$: Observable = combineLatest([\n this.userAgreementTerms$,\n this.termsOfService$,\n ]).pipe(\n map(([userAgreementResponse, tos]) => {\n const needToAcceptTermsOfService = tos\n ? (this.isNewTermsOfService({\n userAgreement: userAgreementResponse?.userAgreementTermsOfService,\n terms: tos,\n }) ||\n !this.userAgreementIsAccepted({\n userAgreement: userAgreementResponse?.userAgreementTermsOfService,\n })) &&\n this.hasTermsOfService({\n terms: tos,\n })\n : false;\n if (needToAcceptTermsOfService) {\n this.termsOfServiceAccepted$$.next(false);\n return tos?.termsOfService;\n } else {\n this.termsOfServiceAccepted$$.next(true);\n return '';\n }\n }),\n shareReplay(1),\n );\n\n constructor(\n private partnerTermsOfApiService: PartnerTermsOfApiService,\n private partnerUserAgreementTermsOfApiService: PartnerUserAgreementTermsOfApiService,\n private conversationService: ConversationService,\n private snackBar: MatSnackBar,\n @Inject(PARTNER_ID_TOKEN) private partnerId$: Observable,\n @Inject(USER_ID_TOKEN) private userId$: Observable,\n private inboxService: InboxService,\n ) {}\n\n getTermsOfService(termsOfService: {\n partnerId?: string;\n marketId?: string;\n feature?: string;\n }): Observable {\n return this.partnerId$.pipe(\n map((partnerId) => ({\n partnerId,\n ...termsOfService,\n marketId: termsOfService?.marketId || 'NULL',\n })),\n switchMap((termsOfService) => this.partnerTermsOfApiService.getTermsOfService(termsOfService)),\n );\n }\n\n getUserAgreement(userAgreement: {\n partnerId?: string;\n userId?: string;\n feature: string;\n }): Observable {\n return combineLatest([this.partnerId$, this.userId$]).pipe(\n map(([partnerId, userId]) => ({\n partnerId,\n userId,\n ...userAgreement,\n })),\n switchMap((userAgreement) =>\n this.partnerUserAgreementTermsOfApiService.getUserAgreementTermsOfService(userAgreement).pipe(\n catchError((e) => {\n console.warn('Error getting term of service', e);\n return EMPTY;\n }),\n defaultIfEmpty({} as GetUserAgreementTermsOfServiceResponse),\n ),\n ),\n );\n }\n\n hasTermsOfService(check: { terms: TermsOfService }): boolean {\n return !!check.terms?.termsOfService;\n }\n\n userAgreementIsAccepted(check: { userAgreement: UserAgreementTermsOfService }): boolean {\n return check.userAgreement?.accepted;\n }\n\n isNewTermsOfService(check: { userAgreement: UserAgreementTermsOfService; terms: TermsOfService }): boolean {\n return check.userAgreement && check.userAgreement.acceptedAt < check.terms.createdOn;\n }\n\n acceptTermsOfService$(): Observable {\n return combineLatest([this.partnerId$, this.userId$, this.platformLocationToSKey$]).pipe(\n switchMap(([partnerId, userId, platformLocationToSKey]) =>\n this.partnerUserAgreementTermsOfApiService.setUserAgreementTermsOfService({\n userAgreementTermsOfService: {\n partnerId,\n userId,\n accepted: true,\n acceptedAt: new Date(),\n feature: platformLocationToSKey.feature,\n },\n }),\n ),\n catchError((err) => {\n console.warn('setUserAgreementTermsOfService warn', err);\n return of(false);\n }),\n map(() => {\n this.snackBar.open('Terms of Service was accepted', 'OK', {\n duration: 2000,\n });\n return true;\n }),\n );\n }\n}\n","export {};\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiY29uZmlnLmludGVyZmFjZS50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBDb252ZXJzYXRpb25DaGFubmVsLCBQbGF0Zm9ybUxvY2F0aW9uIH0gZnJvbSAnQHZlbmRhc3RhL2NvbnZlcnNhdGlvbic7XG5pbXBvcnQgeyBPYnNlcnZhYmxlIH0gZnJvbSAncnhqcyc7XG5pbX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gICAqIEBwYXJhbSBjb252ZXJzYXRpb25EZXRhaWxcbiAgICovXG4gIGdldEthYm9iQXZhaWxhYmxlQWN0aW9ucyhjb252ZXJzYXRpb25EZXRhaWw6IENvbnZlcnNhdGlvbkRldGFpbCk6IE9ic2VydmFibGU8S2Fib2JEeW5hbWljQnV0dG9uW10+O1xuXG4gIC8vIFRPRE86IElOQi03NjYgQWRkIGEgU2VuZE1lc3NhZ2UgbWV0aG9kIGFzIGRlc2NyaWJlZCBpblxuICAvLyBodHRwczovL2dpdGh1Yi5jb20vdmVuZGFzdGEvZ2FsYXh5L3B1bGwvMTAzOTUgdG8gcHJldmVudFxuICAvLyBjcmVhdGluZyBhIHNlbmRlciBwYXJ0aWNpcGFudCB3aXRoIGFjY291bnRHcm91cElkXG4gIC8vIGZvciBwYXJ0bmVyIG1lc3NhZ2VzLlxuXG4gIC8qKlxuICAgKiBHZXQgdGhlIGFwcCBvcHRpb25zIGZvciBpbmJveFxuICAgKi9cbiAgZ2V0QXBwT3B0aW9ucygpOiB7IFtrZXkgaW4gQXBwT3B0aW9uc0tleXNdPzogYm9vbGVhbiB9O1xufVxuIl0sIm1hcHBpbmdzIjoiIiwiaWdub3JlTGlzdCI6W119","export {};\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5ib3guaW50ZXJmYWNlLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IENvbnZlcnNhdGlvbkRldGFpbCB9IGZyb20gJy4vY29udmVyc2F0aW9uLmludGVyZmFjZSc7XG5cbi8qKlxuICogSW5ib3hDb250YWN0IGlzIHRoZSBJbmJveCBDb250YWN0LiBUaGlzIG9iamVjdCBpcyB1c2VkIGZvciBwYXJzaW5nIHRoZSBlbmRwb2ludCBjYWxsXG4gKiBmcm9tIENvbnRhY3QgwrVzIChmdXR1cmUgQ1JNKS5cbiAqL1xuZXhwb3J0IGludGVyZmFjZSBJbmJveENvbnRhY3Qge1xuICBjb250YWN0SWQ/OiBzdHJpbmc7XG4gIGZpcnN0TmFtZT86IHN0cmluZztcbiAgbGFzdE5hbWU/OiBzdHJpbmc7XG4gIG5hbWU/OiBzdHJpbmc7XG4gIHBob25lPzogc3RyaW5nO1xuICBlbWFpbD86IHN0cmluZztcbiAgY29udmVyc2F0aW9uPzogQ29udmVyc2F0aW9uRGV0YWlsO1xuICBwZXJtaXNzaW9uVG9Db250YWN0PzogYm9vbGVhbjtcbiAgZXJyb3JDb2RlPzogbnVtYmVyO1xuICBhY2NvdW50R3JvdXBJZD86IHN0cmluZztcbiAgcGFydG5lcklkPzogc3RyaW5nO1xufVxuXG5leHBvcnQgaW50ZXJmYWNlIEluYm94Q29udGFjdEluZm8ge1xuICBuYW1lOiBzdHJpbmc7XG4gIHBob25lQW5kRW1haWw6IHN0cmluZztcbn1cblxuZXhwb3J0IGludGVyZmFjZSBJbmJveFN0YXR1c01lc3NhZ2Uge1xuICBzdGF0dXM6ICdsb2FkaW5nJyB8ICdzdWNjZXNzJyB8ICdlcnJvcic7XG4gIG1lc3NhZ2U/OiBzdHJpbmc7XG59XG5cbmV4cG9ydCBpbnRlcmZhY2UgSW5ib3hCYW5uZXJBbGVydEluZm8ge1xuICB0aXRsZTogc3RyaW5nO1xuICBkZXNjcmlwdGlvbjogc3RyaW5nO1xuICBhY3Rpb25UZXh0OiBzdHJpbmc7XG59XG5cbmV4cG9ydCB0eXBlIEluYm94QXRsYXNSb3V0ZSA9IFtzdHJpbmcsIHsgb3V0bGV0czogeyBba2V5OiBzdHJpbmddOiBzdHJpbmdbXSB9IH1dO1xuIl0sIm1hcHBpbmdzIjoiIiwiaWdub3JlTGlzdCI6W119","export {};\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsicm91dGVzLmludGVyZmFjZS50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgaW50ZXJmYWNlIFJvdXRlQ29uZmlnIHtcbiAgcm9vdDogc3RyaW5nO1xuICBzZW5kTmV3TWVzc2FnZTogc3RyaW5nO1xuICBhMnBGb3JtOiBzdHJpbmc7XG4gIC8vIHVzZU1vZGFsIHdpbGwgZW5zdXJlIHJvdXRpbmcgaXMgZG9uZSB3aXRoaW4gdGhlIG1vZGFsLCByYXRoZXIgdGhhbiB0aGUgYXBwIGl0c2VsZlxuICB1c2VNb2RhbD86IGJvb2xlYW47XG59XG4iXSwibWFwcGluZ3MiOiIiLCJpZ25vcmVMaXN0IjpbXX0=","import { ConversationChannel, MessageType, Participant } from '@vendasta/conversation';\nimport { ConversationEvent, ConversationMessage } from './interface/conversation.interface';\n\nexport type ViewMode = 'modal' | 'sidebar';\n\nexport type MessageGroupable = ConversationEvent | ConversationMessage | MessageGroup;\n\nexport class MessageGroup {\n readonly id: string;\n readonly type: MessageType;\n readonly channel: ConversationChannel;\n messages: ConversationMessage[];\n readonly sender?: Participant;\n createdAt: Date;\n\n constructor(\n messageId: string,\n sender?: Participant,\n messageType?: MessageType,\n channel?: ConversationChannel,\n createdAt?: Date,\n ) {\n this.id = `message-group-${messageId}`;\n this.messages = [];\n this.sender = sender;\n this.type = messageType;\n this.channel = channel;\n this.createdAt = createdAt;\n }\n\n addMessage(message: ConversationMessage): void {\n this.messages.push(message);\n }\n\n get lastMessage(): ConversationMessage {\n return this.messages?.[this.messages?.length - 1];\n }\n}\n","export * from './lib/channels/conversation-google.service';\nexport * from './lib/conversation-core.module';\nexport * from './lib/conversation-list.service';\nexport * from './lib/conversation-utils';\nexport * from './lib/conversation.constants';\nexport * from './lib/conversation.service';\nexport * from './lib/firebase.config';\nexport * from './lib/firestore.service';\nexport * from './lib/inbox-navigation.service';\nexport * from './lib/inbox-notification.service';\nexport * from './lib/inbox-terms-of-service.service';\nexport * from './lib/inbox-utils';\nexport * from './lib/inbox.constants';\nexport * from './lib/inbox.service';\nexport * from './lib/interface/config.interface';\nexport * from './lib/interface/conversation.interface';\nexport * from './lib/interface/host-app.interface';\nexport * from './lib/interface/inbox.interface';\nexport * from './lib/interface/routes.interface';\nexport * from './lib/listing.service';\nexport * from './lib/participant-utils';\nexport * from './lib/participant.service';\nexport * from './lib/tokens';\nexport * from './lib/types';\nexport * from './lib/view-mode.service';\nexport * from './lib/view.service';\n"],"mappings":"01DAAA,IAKaA,GAEAC,GAGAC,GACAC,GAEAC,GACAC,GAEAC,GAhBbC,GAAAC,EAAA,KAAAC,KACAC,IAIaV,GAA+B,GAE/BC,GAA8B,IAAIU,GAAU,MAAO,CAAC,EAGpDT,GAA0B,CAAC,OAAQ,OAAQ,OAAQ,MAAM,EACzDC,GAAc,MAEdC,GAAY,EACZC,GAAqB,IAErBC,GAAuB,IAAIM,IAAiC,CACvE,CAACC,EAAoBC,+BAAgC,WAAW,EAChE,CAACD,EAAoBE,8BAA+B,UAAU,EAC9D,CAACF,EAAoBG,yBAA0B,KAAK,EACpD,CAACH,EAAoBI,8BAA+B,UAAU,EAC9D,CAACJ,EAAoBK,qCAAsC,iBAAiB,EAC5E,CAACL,EAAoBM,4BAA6B,QAAQ,EAC1D,CAACN,EAAoBO,2BAA4B,OAAO,EACxD,CAACP,EAAoBQ,oDAAqD,gCAAgC,EAC1G,CAACR,EAAoBS,8BAA+B,SAAS,CAAC,CAC/D,ICtBK,SAAUC,IAAQ,CACtB,OAAOC,OAAOC,WAAW,mBAAmB,EAAEC,OAChD,CAMM,SAAUC,IAAY,CAC1B,OAAOH,OAAOC,WAAW,oBAAoB,EAAEC,OACjD,CAdA,IAAAE,GAAAC,EAAA,QCAA,IASaC,GACAC,GAEAC,GAEAC,GAEAC,GACAC,GACAC,GAOAC,GAEAC,GAGAC,GACAC,GAEAC,GACAC,GAGAC,GACAC,GAGAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GAKAC,GAaAC,GAlEbC,GAAAC,EAAA,KAAAC,KASa3B,GAAmB,QACnBC,GAAqB,QAErBC,GAAmB,wBA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CAQvBG,YACEC,EACAC,EACAC,EACAC,EACAC,EAAgB,CAEhB,KAAKC,GAAK,iBAAiBL,CAAS,GACpC,KAAKM,SAAW,CAAA,EAChB,KAAKL,OAASA,EACd,KAAKM,KAAOL,EACZ,KAAKC,QAAUA,EACf,KAAKC,UAAYA,CACnB,CAEAI,WAAWC,EAA4B,CACrC,KAAKH,SAASI,KAAKD,CAAO,CAC5B,CAEA,IAAIE,aAAW,CACb,OAAO,KAAKL,WAAW,KAAKA,UAAUM,OAAS,CAAC,CAClD,KCpCF,IAAAC,GAAAC,EAAA,KAAAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,IACAC,KACAC,KACAC","names":["FIRESTORE_CONVERSATION_LIMIT","DELETED_TIMESTAMP_FIRESTORE","MARKETING_SERVICES_PIDS","SUPPORT_PID","MAX_FILES","MAX_RECORDING_TIME","POSTHOG_CHANNEL_NAME","init_conversation_constants","__esmMin","init_index_esm","init_vendasta_conversation","Timestamp","Map","ConversationChannel","CONVERSATION_CHANNEL_UNDEFINED","CONVERSATION_CHANNEL_INTERNAL","CONVERSATION_CHANNEL_SMS","CONVERSATION_CHANNEL_FACEBOOK","CONVERSATION_CHANNEL_GOOGLE_MESSAGES","CONVERSATION_CHANNEL_OPENAI","CONVERSATION_CHANNEL_EMAIL","CONVERSATION_CHANNEL_GOOGLE_BUSINESS_COMMUNICATIONS","CONVERSATION_CHANNEL_WEB_CHAT","isMobile","window","matchMedia","matches","isWideScreen","init_inbox_utils","__esmMin","GOOGLE_SOURCE_ID","FACEBOOK_SOURCE_ID","LOCAL_STORAGE_ID","EXCLUDED_GEOGRAPHICAL_US_STATES","DEFAULT_CV_ICON","DEFAULT_CV_NAME","CustomerVoiceAppIDs","REPLACE_NAME_WITH_PHONE_PLACEHOLDER","INVALID_CONTACT_NAMES","DEFAULT_OPENAI_BOT_NAME","DEFAULT_WEBCHAT_BOT_NAME","CONTACTS_PAGE_SIZE","TEMPLATES_PAGE_SIZE","FOLLOWING_VIEW_ID","ALL_VIEW_ID","SMB_MESSAGE_PARTNER_FEATURE","INBOX_OPEN_DEFAULT","INBOX_SMS_A2P","WEBCHAT_SETTING_CARD","WEB_CHAT_FOR_PARTNER_INBOX","MESSAGE_TEMPLATE_CARD","INBOX_EMAIL","CONVERSATION_SUMMARY","STANDARD_CRM_FIELD_EXTERNAL_IDS","INBOX_CRM_SOURCE_NAME","init_inbox_constants","__esmMin","init_src","Environment","LOCAL","TEST","DEMO","PROD","undefined","firstName","lastName","phoneNumber","email","updated","created","tags","source","createContactFieldMap","contactFields","contactFieldMap","Map","fields","forEach","field","fieldId","set","externalId","getInboxContactFromCrm","accountGroupId","contactId","crmObjectId","firstName","get","STANDARD_CRM_FIELD_EXTERNAL_IDS","stringValue","lastName","email","phone","phoneNumber","permissionToContact","createCrmField","fieldName","buildCrmFieldsForCreateContact","inboxContact","source","INBOX_CRM_SOURCE_NAME","filter","isContactInformationMissing","conversationDetail","availableChannels","conversation","recipients","participants","p","isSubjectParticipant","internalParticipantId","participant","participantType","ParticipantType","PARTICIPANT_TYPE_CUSTOMER","length","contactParticipant","find","isSubjectParticipantInHierarchy","hierarchy","some","namespace","init_participant_utils","__esmMin","init_vendasta_conversation","init_inbox_constants","ParticipantBuilder","ParticipantService","init_participant_service","__esmMin","init_src","init_vendasta_conversation","init_esm","init_inbox_constants","init_participant_utils","init_tokens","constructor","participant","Participant","partnerId","accountGroupId","channel","participantType","internalParticipantId","isSubjectParticipant","build","userId$","partnerId$","accountGroupId$","groupId$","conversationApiService","crmService","snackbarService","router","unsubscribe$","Subject","contacts$$","BehaviorSubject","participantDetails$","combineLatest","pipe","map","userId","groupId","currentParticipant$","switchMap","details","getParticipant","shareReplay","bufferSize","refCount","contacts$","asObservable","organizationId$","ngOnDestroy","next","complete","participantDetails","participantKey","GlobalParticipantType","GLOBAL_PARTICIPANT_TYPE_IAM_USER","namespaceHierarchy","buildNamespaceHierarchy","getParticipantsByKey","catchError","err","console","error","EMPTY","resp","defaultIfEmpty","NamespaceDetail","GLOBAL_PARTICIPANT_TYPE_PARTNER","push","GLOBAL_PARTICIPANT_TYPE_GROUP","GLOBAL_PARTICIPANT_TYPE_ACCOUNT_GROUP","buildIAMUserParticipant","buildIamUser","ParticipantType","PARTICIPANT_TYPE_IAM_USER","buildAccountGroup","PARTICIPANT_TYPE_ACCOUNT_GROUP","buildPartner","PARTICIPANT_TYPE_PARTNER","buildVendor","vendorId","PARTICIPANT_TYPE_VENDOR","addContact","contact","createCrmContact","of","createContact","namespace","crmObject","fields","buildCrmFieldsForCreateContact","crmObjectResponse","contactId","crmObjectId","searchContacts","term","length","getContactsFromCrmService","take","subscribe","contactList","listContacts","search","searchTerm","pagingOptions","pageSize","CONTACTS_PAGE_SIZE","response","crmObjects","filter","getInboxContactFromCrm","getMultiParticipants","participantIds","conversationId","participants","req","message","participantKeyInfo","viewContact","firestoreDocId","__async","openErrorSnack","firstValueFrom","returnUrl","routeTemplate","PAGE_ROUTES","CONTACT","ROOT","SUBROUTES","PROFILE","navigate","replace","queryParams","ɵɵinject","USER_ID_TOKEN","PARTNER_ID_TOKEN","ACCOUNT_GROUP_ID_TOKEN","GROUP_ID_TOKEN","ConversationApiService","CRMApiService","SnackbarService","Router","factory","ɵfac","_ParticipantService","isSuperAdminFn","InboxService","init_inbox_service","__esmMin","init_core","init_vendasta_conversation","init_esm","init_conversation_constants","init_inbox_utils","init_inbox_constants","init_tokens","init_vendasta_smsv2","partner","attributes","boolAttribute","constructor","featureFlagService","participantService","accountGroupId$","country$","geographicalState$","partnerId$","platformLocation","addressService","smsEnabled$","webChatEnabled$","googleBusinessMessagesAvailable$","userId$","iamService","inboxApiService","groupId$","unsubscribe$$","Subject","smsService","isBusinessApp","inject","SmsService","iamUser$","pipe","switchMap","userId","getUser","canAccessEmbeddedSettings$","combineLatest","map","user","currentPartnerId","isPartnerCenter","partnerId","userPartnerID","roles","isSuperAdmin","shareReplay","showAvailabilityMessageSettings$","MARKETING_SERVICES_PIDS","includes","featureFlags$","batchGetStatus","INBOX_OPEN_DEFAULT","INBOX_SMS_A2P","WEBCHAT_SETTING_CARD","MESSAGE_TEMPLATE_CARD","WEB_CHAT_FOR_PARTNER_INBOX","INBOX_EMAIL","CONVERSATION_SUMMARY","take","isConversationSummaryEnabled$","res","distinctUntilChanged","partnerHasA2PAccess$","SMSNumber$","accountGroupId","of","getAccountInfo","internalId","type","ParticipantType","PARTICIPANT_TYPE_ACCOUNT_GROUP","catchError","error","console","message","accountInfo","phoneNumber","hasAccessToInboxPage$","CONVERSATION_CONFIG_TOKEN","result","allowSmbChatWithPartner$","showInboxViews$","canAccessInboxGetStartedCard$","smsEnable","googleBusinessMessagesEnable","openInboxDefault$","featureFlags","isWideScreen","canAccessWebChatSettings$","webchatEnabled","canAccessBA","canAccessPCC","canAccessEmailChannel$","canAccessMessageTemplateSettingsCard$","multiLocationEnabled$","groupId","configuration","multiLocationEnabled","getConfiguration","subjectParticipant","participantType","GlobalParticipantType","GLOBAL_PARTICIPANT_TYPE_GROUP","internalParticipantId","config","canAccessSMS$","hasAccessByCountry$","geographicalState","hasAccessByCountry","hasAccessToInboxPage","smsEnabled","reauthorizeGoogleAccount","canAccess$","hasAccess","accountGroupGeographicalState","availableCountries","accountGroupCountry","country","toLowerCase","hasAccessByUSState","isUsAccountWithSmsAccess$","accountGroupState","state","getCountryConfiguration","undefined","countryInfo","zones","reduce","accumulator","currentValue","EXCLUDED_GEOGRAPHICAL_US_STATES","code","toLocaleLowerCase","PlatformLocation","PLATFORM_LOCATION_BUSINESS_APP","PLATFORM_LOCATION_PARTNER_CENTER","isSalesCenter","PLATFORM_LOCATION_SALES_CENTER","displayA2pCard$","__async","firstValueFrom","partnerHasA2PAccess","buildTemplateTrackProperties","participantName","currentParticipant$","name","location","buildAiKnowledgeAppConfigurationUrl","widgetId","buildAppId","ngOnDestroy","next","complete","ɵɵinject","FeatureFlagService","ParticipantService","ACCOUNT_GROUP_ID_TOKEN","CONVERSATION_COUNTRY_TOKEN","CONVERSATION_GEOGRAPHICAL_STATE_TOKEN","PARTNER_ID_TOKEN","CONVERSATION_PLATFORM_LOCATION_TOKEN","AddressAPIService","CONVERSATION_SMS_ENABLED_TOKEN","CONVERSATION_WEB_CHAT_ENABLED_TOKEN","CONVERSATION_GOOGLE_BUSINESS_MESSAGES_AVAILABLE_TOKEN","USER_ID_TOKEN","IAMService","InboxApiService","GROUP_ID_TOKEN","factory","ɵfac","_InboxService","ConversationChannelService","init_conversation_channel_abstract","__esmMin","ConversationFacebookService","init_conversation_facebook_service","__esmMin","init_vendasta_conversation","init_esm","init_conversation_channel_abstract","ConversationChannelService","getChatComposerAlert","_partnerId","_accountGroupId","conversationDetail","channels","conversation","channel","ConversationChannel","CONVERSATION_CHANNEL_FACEBOOK","length","of","title","description","t","factory","ɵfac","_ConversationFacebookService","Answer","Question","CanEnableBusinessCommunicationsRequest","CanEnableBusinessCommunicationsResponse","ConnectBusinessCommunicationsRequest","GetBusinessLaunchStatusRequest","GetBusinessLaunchStatusResponse","UnlaunchBusinessCommunicationsAgentRequest","CreateAnswerRequest","CreateAnswerResponse","CreateQuestionRequest","CreateQuestionResponse","GetMultiQuestionsRequest","GetMultiQuestionsResponse","GetQuestionAnswerStatsRequest","GetQuestionAnswerStatsResponse","GetQuestionRequest","GetQuestionResponse","ListQuestionsRequest","ListQuestionsResponse","QuestionIdentifier","environment","hostMap","HostService","BusinessCommunicationsApiService","QuestionAnswerApiService","QuestionAndAnswerService","init_vendasta_google_my_business","__esmMin","init_core","init_http","init_operators","_Answer","proto","m","kwargs","toReturn","_Question","_CanEnableBusinessCommunicationsRequest","_CanEnableBusinessCommunicationsResponse","_ConnectBusinessCommunicationsRequest","_GetBusinessLaunchStatusRequest","_GetBusinessLaunchStatusResponse","_UnlaunchBusinessCommunicationsAgentRequest","_CreateAnswerRequest","_CreateAnswerResponse","_CreateQuestionRequest","_CreateQuestionResponse","_GetMultiQuestionsRequest","_GetMultiQuestionsResponse","_GetQuestionAnswerStatsRequest","_GetQuestionAnswerStatsResponse","_GetQuestionRequest","_GetQuestionResponse","_ListQuestionsRequest","_ListQuestionsResponse","_QuestionIdentifier","t","ɵɵdefineInjectable","http","hostService","HttpHeaders","r","request","__spreadProps","__spreadValues","map","resp","ɵɵinject","HttpClient","_api","accountGroupId","cursor","includeAnswers","limit","locationId","onlyLatestVersion","socialProfileId","locationPathName","questionId","text","partnerId","questionIds","BusinessMessagesEnabledState","ConversationGoogleService","init_conversation_google_service","__esmMin","init_http","init_core","init_router","init_vendasta_google_my_business","init_esm","init_tokens","init_conversation_channel_abstract","ConversationChannelService","constructor","partnerId$","inject","PARTNER_ID_TOKEN","accountGroupId$","ACCOUNT_GROUP_ID_TOKEN","router","Router","googleMyBusinessService","BusinessCommunicationsApiService","googleBusinessMessagesAvailable$","CONVERSATION_GOOGLE_BUSINESS_MESSAGES_AVAILABLE_TOKEN","isGoogleBusinessMessagesEnabled$","combineLatest","pipe","switchMap","partnerId","accountGroupId","getBusinessLaunchStatus","map","res","isLaunched","catchError","of","getChatComposerAlert","conversationDetail","canSendGoogleBusinessMessage","canSend","IS_ENABLED","getGoogleBusinessMessagesError","enabledState","accountGroup","alert","NOT_ENABLED","title","description","INVALID_TOKEN","action","callback","navigate","CONVERSATION_EXPIRED","NOT_LAUNCHED","UNKNOWN_ERROR","expirationDate","addDays","latestMessage","updated","currentDate","Date","launchStatus$","error","HttpErrorResponse","status","HttpStatusCode","PreconditionFailed","googleBusinessMessagesAvailable","launched","isBefore","t","factory","ɵfac","_ConversationGoogleService","ConversationSMSService","init_conversation_sms_service","__esmMin","init_core","init_router","init_src","init_esm","init_inbox_service","init_tokens","init_conversation_channel_abstract","ConversationChannelService","constructor","router","inject","Router","smsRegistrationService","SmsRegistrationService","inboxService","InboxService","country$","CONVERSATION_COUNTRY_TOKEN","smsEnabled$","CONVERSATION_SMS_ENABLED_TOKEN","getChatComposerAlert","partnerId","accountGroupId","conversationDetail","stage$","registrationStage$","SMSNumber$","combineLatest","pipe","map","accountGroupCountry","smsEnabled","stage","smsNumber","country","toLowerCase","RegistrationStage","RegistrationComplete","getSMSRegistrationError","getSMSMPhoneNumberError","getSMSMessageEnabledError","title","description","action","callback","navigate","t","factory","ɵfac","_ConversationSMSService","ConversationWebchatService","init_conversation_webchat_service","__esmMin","init_core","init_src","init_ngx_translate_core","init_vendasta_conversation","init_libphonenumber_js","init_esm","init_inbox_service","init_tokens","init_conversation_channel_abstract","ConversationChannelService","constructor","translationService","inject","TranslateService","inboxService","InboxService","country$","CONVERSATION_COUNTRY_TOKEN","smsRegistrationService","isBusinessApp","SmsRegistrationService","conversationApiService","ConversationApiService","accountGroupId$","ACCOUNT_GROUP_ID_TOKEN","webchats$","pipe","switchMap","accountGroupId","listWidgets","namespace","map","widgets","shareReplay","bufferSize","refCount","catchError","__async","isAnyWebchatEnabled$","webchats","some","webchat","isEnabled","getChatComposerAlert","partnerId","conversationDetail","conversation","channel","ConversationChannel","CONVERSATION_CHANNEL_WEB_CHAT","of","participants","find","participant","participantType","ParticipantType","PARTICIPANT_TYPE_ANONYMOUS","contactInfoMissingError","customerParticipant","PARTICIPANT_TYPE_CUSTOMER","phoneNumber","email","country","smsNotAvailableError","combineLatest","SMSNumber$","registrationStage$","smsNumber","registrationStage","RegistrationStage","RegistrationComplete","title","instant","countryCode","toUpperCase","phone","formatNumber","t","factory","ɵfac","_ConversationWebchatService","conversationUnseen","conversation","participantId","latestMsgSentTime","lastSeenTimeByParticipant","lastSeenByParticipant","find","lastSeenTime","getPlatformLocationToSKey","platformLocation","PlatformLocation","PLATFORM_LOCATION_VENDOR_CENTER","PLATFORM_LOCATION_PARTNER_CENTER","PLATFORM_LOCATION_TASK_MANAGER","PLATFORM_LOCATION_SALES_CENTER","partnerId","feature","PLATFORM_LOCATION_BUSINESS_APP","getFollowViewID","participantID","FOLLOWING_VIEW_ID","formatUnreadConversationsCount","count","limit","FIRESTORE_CONVERSATION_LIMIT","toString","toFirestoreId","id","replace","ID_PREFIX","fromFirestoreId","startsWith","getPosthogChannelName","channel","POSTHOG_CHANNEL_NAME","get","redirectToConversationFactory","init_conversation_utils","__esmMin","init_core","init_rxjs_interop","init_router","init_vendasta_conversation","init_conversation_constants","init_inbox_constants","init_tokens","zone","inject","NgZone","router","Router","routes","toSignal","CONVERSATION_ROUTES_TOKEN","conversationId","run","navigate","root","validOriginAppLocations","getFirestore","FirestoreService","init_firestore_service","__esmMin","init_core","init_angular_fire_firestore","init_conversation_constants","name","inject","FirestoreInstances","find","fs","app","constructor","environmentService","firestore","firestoreRootPath","getEnvironmentString","getFirestoreMessagesRootPath","conversationDocId","getFirestoreEventsRootPath","conversation$","docData","doc","setupBaseConversationsQuery","organizationId","filters","groupId","skipIsOpenInQuery","skipIsAnonymousInQuery","q","query","collection","where","DELETED_TIMESTAMP_FIRESTORE","isAnonymous","isOpen","orderBy","loadOrgRelatedConversationsQuery","messages$","docId","collectionData","idField","webchatMessages$","events$","getViewsConversationsQuery","participantId","viewId","latestMsgSentTime","getUnreadConversationsByView","ɵɵinject","EnvironmentService","factory","ɵfac","_FirestoreService","convertMediaJSONIntoMedia","media","data","JSON","parse","mediaUrl","MediaUrl","mediaContentType","MediaContentType","mediaFileName","MediaFileName","mediaLocationPath","MediaLocationPath","fileSize","FileSize","init_conversation_interface","__esmMin","init_vendasta_conversation","toFirestoreId","id","replace","ID_PREFIX","convertMessageIntoConversationMessage","msg","sender","messageId","conversationId","channel","body","media","map","convertMediaJSONIntoMedia","filter","type","MessageType","MESSAGE_TYPE_MESSAGE","created","updated","deleted","MESSAGE_TYPE_SYSTEM","undefined","sendStatus","mapMessageStatus","message","status","MessageStatus","MESSAGE_STATUS_DELIVERED","MESSAGE_STATUS_NOT_READ","MESSAGE_STATUS_READ","MESSAGE_STATUS_FAILED","MESSAGE_STATUS_UNDELIVERED","MESSAGE_STATUS_SENT","MESSAGE_STATUS_SENDING","init_message_utils","__esmMin","init_vendasta_conversation","init_conversation_interface","ConversationService","init_conversation_service","__esmMin","init_core","init_rxjs_interop","init_angular_fire_firestore","init_src","init_vendasta_conversation","init_vendasta_smsv2","init_esm","init_conversation_utils","init_inbox_constants","init_message_utils","init_tokens","constructor","conversationApiService","snackbarService","analyticsService","userId$","accountGroupId$","partnerId$","conversationChannelsEnabled$","marketId$","participantService","inboxService","translateService","firestoreService","conversationChannelService","smsService","hostAppInterface","country$","currentConversationChannel","ConversationChannel","CONVERSATION_CHANNEL_UNDEFINED","smsRegistrationService","isBusinessApp","inject","SmsRegistrationService","conversationSelected$$","BehaviorSubject","conversationSelected$","asObservable","currentParticipant$","currentFirestoreConversationId$$","currentFirestoreConversationId$","pipe","map","toFirestoreId","distinctUntilChanged","currentConversationDetail$","switchMap","id","merge","getConversationDetail","fromFirestoreId","conversation$","skip","startWith","of","shareReplay","bufferSize","refCount","skipWhile","v","sendSMSNumber$$","sendSMSNumber$","currentConvoSMSNumber$","convoDetail","conversation","subjectParticipants","find","p","participantType","GlobalParticipantType","GLOBAL_PARTICIPANT_TYPE_CUSTOMER","accountGroupId","GLOBAL_PARTICIPANT_TYPE_ACCOUNT_GROUP","internalParticipantId","getAccountInfo","internalId","type","ParticipantType","PARTICIPANT_TYPE_ACCOUNT_GROUP","catchError","error","console","message","draftMessages","displayBadge$","showInboxViews$","toSignal","partnerId","isUserImpersonated$","CONVERSATION_CONFIG_TOKEN","isImpersonating$","isSMSChannelAvailableForOrg$","canAccessSMS$","canAccessSMS","combineLatest","registrationStage$","SMSNumber$","accountGroupCountry","stage","smsNumber","toLowerCase","RegistrationStage","RegistrationComplete","availableChannelsForConversation$","filter","conversationID","getAvailableChannelsForConversation","conversationId","filteredChannels$","availableChannelsForConversation","GetAvailableChannelsForConversationResponse","channels","Array","preferredChannel","res","getAppOptions","is_multilocation","convoSMSNumber","channel","CONVERSATION_CHANNEL_SMS","isSMSChannelAvailable","prev","curr","length","availableChannels$","filteredAvailableChannels","availableChannels","includes","unsavedMessages$$","messagesScrollable$","observeOn","asyncScheduler","docId","messages","events","loading","conversationMessages$","messages$","conversationDetail","EMPTY","messageIds","m","messageId","getMultiMessages","msg","convertMessageIntoConversationMessage","participants","participantId","Boolean","sender","MessageType","MESSAGE_TYPE_SYSTEM","unsavedMessages","getConversationEvents","events$","loadingMessages$","takeUntilDestroyed","subscribe","conversationChannelsEnabled","warn","setConversationChannel","some","trackEvent","conversationChannel","getConversationChannel","createConversation","originLocation","req","err","defaultIfEmpty","sendMessage","body","__async","media","recipient","Error","firstValueFrom","trackingProps","buildSendMessageTrackProperties","result","now","Date","newMessage","replace","MESSAGE_TYPE_MESSAGE","created","sendStatus","status","MessageStatus","MESSAGE_STATUS_SENDING","addUnsavedMessage","httpErrorResponse","openErrorSnack","getMultiConversationDetails","conversationIds","getSummary","GetMultiConversationDetailsRequest","options","FieldMask","paths","response","conversations","setCurrentFirestoreConversationId","next","conversationsDetails","setSMSNumber","getPreviewContent","isConversationSummaryEnabled$","userId","showConversationSummary","summary","previewContent","getPreviewContentText","latestMessageParticipant","participant","latestMessage","isParticipantInternalInfoDeleted","instant","otherUserPreviewContent","name","getMessage","setConversationLastSeen","setLastSeen","setConversationOpenStatus","isOpen","resp","updateConversation","fieldMask","openSuccessSnack","conversationUnseen","lookupConversation","lookupConversations","numberOfFiles","participantName","PID_AGID","location","platformLocation","getPosthogChannelName","getUnreadConversationsCount","viewId","countUnreadConversations","getUnreadConversationsByView","conversationsCollection","collectionData","idField","cs","c","ids","setLastConversationId","localStorage","setItem","LOCAL_STORAGE_ID","getLastConversationId","getItem","undefined","removeLastConversationId","removeItem","conversationSelected","selected","mapStatusForMessage","mapMessageStatus","displayAlertIfExists","service","get","getChatComposerAlert","getValue","unsavedMessagesForDocId","__spreadProps","__spreadValues","evaluateResponse","comment","sentiment","ɵɵinject","ConversationApiService","SnackbarService","ProductAnalyticsService","USER_ID_TOKEN","ACCOUNT_GROUP_ID_TOKEN","PARTNER_ID_TOKEN","CONVERSATION_CONVERSATION_CHANNELS_ENABLED_TOKEN","MARKET_ID_TOKEN","ParticipantService","InboxService","TranslateService","FirestoreService","CONVERSATION_CHANNEL_SERVICE_TOKEN","SmsService","CONVERSATION_HOST_APP_INTERFACE_TOKEN","CONVERSATION_COUNTRY_TOKEN","factory","ɵfac","_ConversationService","firebaseConfig","init_firebase_config","__esmMin","apiKey","authDomain","databaseURL","projectId","storageBucket","messagingSenderId","appId","measurementId","localStorageId","AI_ROUTE","INBOX_ROUTE","ViewModeService","init_view_mode_service","__esmMin","init_core","init_esm","init_router","init_src","init_conversation_service","init_conversation_utils","constructor","router","inject","Router","analyticsService","ProductAnalyticsService","injector","Injector","viewMode$$","ReplaySubject","viewMode$","pipe","startWith","getUserViewMode","distinctUntilChanged","tap","mode","localStorage","setItem","trackEvent","viewMode","shareReplay","isOpen$","events","filter","event","NavigationEnd","map","parseUrl","url","urlTree","checkSegment","window","location","pathname","includes","isAIOpen$","isInboxOpen$","combineLatest","isOpen","isAIOpen","isDrawerOpen$","isModalOpen$","toggleViewMode","__async","currentMode","firstValueFrom","next","toggleInboxOpen","getCurrentRoute","close","conversationService","get","ConversationService","conversationId","currentFirestoreConversationId$","open","prefilledMessage","navigate","routerCommands","queryParamsHandling","queryParams","inboxPrefilledMessage","openSettings","outlets","inbox","then","toFirestoreId","index","root","children","segments","path","getItem","toggleInboxAIOpen","closeInboxAI","openInboxAI","segmentIndex","segmentPath","factory","ɵfac","providedIn","_ViewModeService","InboxNavigationService","init_inbox_navigation_service","__esmMin","init_core","init_rxjs_interop","init_src","init_esm","init_conversation_utils","init_conversation_service","init_inbox_service","init_tokens","init_view_mode_service","init_participant_service","constructor","conversationService","inject","ConversationService","inboxService","InboxService","analyticsService","ProductAnalyticsService","hostAppInterface","CONVERSATION_HOST_APP_INTERFACE_TOKEN","routes","toSignal","CONVERSATION_ROUTES_TOKEN","accountGroupId","ACCOUNT_GROUP_ID_TOKEN","partnerId","PARTNER_ID_TOKEN","viewModeService","ViewModeService","participantService","ParticipantService","createOrGetConversation","subjectParticipants","currentParticipant","channel","buildSendMessageParams","pipe","switchMap","sendMessage","createConversation","participants","location","tap","conversationResp","conversation","trackEvent","platformLocation","catchError","error","message","Error","getConversationDetail","conversationId","gotoConversation","prefilledMessage","useModal","redirectToInternalConversation","subscribe","conversationDetails","gotoConversationID","toFirestoreId","gotoConversationChannel","__async","firstValueFrom","buildIAMUserParticipant","console","open","factory","ɵfac","_InboxNavigationService","INBOX_NOTIFICATION_TYPE_ID","TURN_ON_NOTIFICATION_COOKIE","InboxNotificationService","init_inbox_notification_service","__esmMin","init_rxjs_interop","init_vendasta_notifications_sdk","init_esm","init_tokens","constructor","notificationsService","cookieService","userId$","partnerId$","inboxNotificationStatus$","combineLatest","pipe","switchMap","partnerId","userId","getNotificationSettingStatus$","user","userCookiesValue$$","BehaviorSubject","takeUntilDestroyed","subscribe","next","getCookie","get","getCookieStatus","getValue","setCookie","expiry","Date","setDate","getDate","set","turnOnOnlyMyEventsNotification$","context","emailSetting","notificationTypeId","notificationMedium","NotificationMedium","NOTIFICATION_MEDIUM_EMAIL","webSetting","NOTIFICATION_MEDIUM_WEB","saveSettingMulti$","ɵɵinject","NotificationsService","CookieService","USER_ID_TOKEN","PARTNER_ID_TOKEN","factory","ɵfac","_InboxNotificationService","enumStringToValue$5","enumRef","value","enumStringToValue$4","enumStringToValue$2","ReviewRequestStatus","SmsStatusCode","AutomationType","RequestEventType","CreateError","SortDirection","Customer","CustomerReview","CustomerRequestEvent","ReviewRequestEvent","FieldMask","Attribute","CreateCustomerAndSendDefaultReviewRequestRequest","CreateCustomerAndSendDefaultReviewRequestResponse","CreateCustomerRequest","CreateCustomerResponse","CreateMultiCustomerError","CreateMultiCustomerRequest","CreateMultiCustomerResponse","CreateReviewRequestEventRequest","CreateReviewRequestEventResponse","CustomerExistsRequest","CustomerExistsResponse","CustomerFilters","DateRangeFilter","DeleteCustomerRequest","GetCustomerRequest","GetCustomerResponse","GetMultiCustomerForBusinessRequest","GetMultiCustomerForBusinessResponse","GetQRCodeForURLRequest","GetQRCodeForURLResponse","HeaderMapping","ListBusinessTagsRequest","ListBusinessTagsResponse","ListCustomersRequest","ListCustomersResponse","ListOriginsRequest","ListOriginsResponse","ListReviewRequestEventRequest","ListReviewRequestEventResponse","MultilocationSendReviewRequestsCSVRequest","PagedRequestOptions","PagedResponseMetadata","SendReviewRequestEmailRequest","SendReviewRequestSmsRequest","SendReviewRequestToDefaultTemplateRequest","SendSMSRequest","SortingOption","UpdateCustomerRequest","GetReviewSourceSettingsRequest","GetReviewSourceSettingsResponse","ReviewSources","environment","hostMap","HostService","CustomerVoiceApiService","ListingsApiService","init_vendasta_customer_voice_service","__esmMin","init_core","init_http","init_operators","_Customer","proto","m","kwargs","toReturn","_CustomerReview","_CustomerRequestEvent","_ReviewRequestEvent","_FieldMask","_Attribute","_CreateCustomerAndSendDefaultReviewRequestRequest","_CreateCustomerAndSendDefaultReviewRequestResponse","_CreateCustomerRequest","_CreateCustomerResponse","_CreateMultiCustomerError","v","_CreateMultiCustomerRequest","_CreateMultiCustomerResponse","_CreateReviewRequestEventRequest","_CreateReviewRequestEventResponse","_CustomerExistsRequest","_CustomerExistsResponse","_CustomerFilters","_DateRangeFilter","_DeleteCustomerRequest","_GetCustomerRequest","_GetCustomerResponse","_GetMultiCustomerForBusinessRequest","_GetMultiCustomerForBusinessResponse","_GetQRCodeForURLRequest","_GetQRCodeForURLResponse","_HeaderMapping","_ListBusinessTagsRequest","_ListBusinessTagsResponse","_ListCustomersRequest","_ListCustomersResponse","_ListOriginsRequest","_ListOriginsResponse","_ListReviewRequestEventRequest","_ListReviewRequestEventResponse","_MultilocationSendReviewRequestsCSVRequest","_PagedRequestOptions","_PagedResponseMetadata","_SendReviewRequestEmailRequest","_SendReviewRequestSmsRequest","_SendReviewRequestToDefaultTemplateRequest","_SendSMSRequest","_SortingOption","_UpdateCustomerRequest","_GetReviewSourceSettingsRequest","_GetReviewSourceSettingsResponse","_ReviewSources","t","ɵɵdefineInjectable","http","hostService","HttpHeaders","r","request","map","resp","__spreadProps","__spreadValues","ɵɵinject","HttpClient","ListingService","init_listing_service","__esmMin","init_rxjs_interop","init_operators","init_inbox_constants","init_tokens","constructor","listingsApiService","accountGroupId$","pipe","takeUntilDestroyed","subscribe","accountGroupId","currentAccountGroupId","reviewLinks$","getReviewSourceSettings","map","response","reviewSources","filter","result","url","overriddenUrl","sort","a","b","sourceId","GOOGLE_SOURCE_ID","FACEBOOK_SOURCE_ID","sourceName","displayName","reviewUrl","ɵɵinject","ListingsApiService","ACCOUNT_GROUP_ID_TOKEN","factory","ɵfac","_ListingService","localStorageKey","getDefaultViewId","ViewService","init_view_service","__esmMin","init_esm","init_operators","init_inbox_constants","localStorage","getItem","ALL_VIEW_ID","constructor","analyticsService","conversationApiService","participantService","selectedViewId$$","BehaviorSubject","selectedViewId$","pipe","distinctUntilChanged","tap","selectedViewId","trackEvent","viewId","setItem","setViewId","next","loadViews","currentParticipant$","filter","participant","switchMap","getConversationViews","participantId","map","res","views","addConversationToConversationView","conversationId","combineLatest","currentUserParticipant","value","FOLLOWING_VIEW_ID","removeConversationFromConversationView","ɵɵinject","ProductAnalyticsService","ConversationApiService","ParticipantService","factory","ɵfac","_ViewService","userIdFactory","config","isObservable","userId$","of","accountGroupIdFactory","accountGroupId$","countryFactory","country$","geographicalState","geographicalState$","partnerIdFactory","partnerId$","partnerBrandNameFactory","partnerBrandName$","companyNameFactory","companyName$","platformLocationFactory","platformLocation","conversationChannelsEnabledFactory","conversationChannelsEnabled$","routesFactory","routes$","featureFlagFactory","featureFlag$","inboxImageServiceFactory","inboxImageService","inject","StubInboxImageService","marketIdFactory","marketId$","smsEnabledFactory","inboxApiService","InboxApiService","isEnabled$","smsEnabled$","combineLatest","pipe","switchMap","agid","isEnabled","configuration","smsEnabled","getConfiguration","subjectParticipant","participantType","GlobalParticipantType","GLOBAL_PARTICIPANT_TYPE_ACCOUNT_GROUP","internalParticipantId","map","shareReplay","refCount","bufferSize","catchError","webchatEnabledFactory","webChatEnabled$","facebookMessengerEnabledFactory","enableable$","facebookMessengerSupported$","enableable","facebookMessengerEnabled","googleBusinessMessagesAvailableFactory","inboxService","environmentService","EnvironmentService","googleBusinessMessagesSupported$","getEnvironment","Environment","PROD","googleBusinessMessagesEnabled","abstractConversationChannelServiceFactory","conversationGoogleService","ConversationGoogleService","conversationWebChatService","ConversationWebchatService","conversationFacebookService","ConversationFacebookService","conversationSMSService","channelMap","Map","ConversationChannel","CONVERSATION_CHANNEL_GOOGLE_BUSINESS_COMMUNICATIONS","CONVERSATION_CHANNEL_WEB_CHAT","CONVERSATION_CHANNEL_FACEBOOK","ConversationSMSService","set","CONVERSATION_CHANNEL_SMS","e","undefined","console","debug","groupIdFactory","groupId$","SERVICE_PROVIDERS","ConversationCoreModule","init_conversation_core_module","__esmMin","init_core","init_angular_fire_app","init_angular_fire_firestore","init_src","init_vendasta_conversation","init_esm","init_operators","init_conversation_facebook_service","init_conversation_google_service","init_conversation_sms_service","init_conversation_webchat_service","init_conversation_service","init_firebase_config","init_firestore_service","init_inbox_navigation_service","init_inbox_notification_service","init_inbox_service","init_listing_service","init_participant_service","init_template_service","init_tokens","init_view_service","ViewService","ParticipantService","ConversationService","FirestoreService","InboxService","InboxNavigationService","ListingService","InboxNotificationService","TemplateService","forRoot","c","ngModule","providers","provide","USER_ID_TOKEN","deps","CONVERSATION_CONFIG_TOKEN","useFactory","ACCOUNT_GROUP_ID_TOKEN","CONVERSATION_COUNTRY_TOKEN","CONVERSATION_GEOGRAPHICAL_STATE_TOKEN","PARTNER_ID_TOKEN","PARTNER_BRAND_NAME_TOKEN","MARKET_ID_TOKEN","COMPANY_NAME_TOKEN","CONVERSATION_PLATFORM_LOCATION_TOKEN","CONVERSATION_CONVERSATION_CHANNELS_ENABLED_TOKEN","FEATURE_FLAG_TOKEN","CONVERSATION_IMAGE_SERVICE_TOKEN","CONVERSATION_ROUTES_TOKEN","CONVERSATION_GOOGLE_BUSINESS_MESSAGES_AVAILABLE_TOKEN","CONVERSATION_FACEBOOK_MESSENGER_AVAILABLE_TOKEN","CONVERSATION_SMS_ENABLED_TOKEN","CONVERSATION_WEB_CHAT_ENABLED_TOKEN","useExisting","CONVERSATION_CHANNEL_SERVICE_TOKEN","GROUP_ID_TOKEN","provideFirebaseApp","initializeApp","firebaseConfig","provideFirestore","getFirestore","getApp","_ConversationCoreModule","ConversationListService","init_conversation_list_service","__esmMin","init_core","init_rxjs_interop","init_angular_fire_firestore","init_esm","init_conversation_service","init_firestore_service","init_inbox_constants","init_inbox_service","init_participant_service","init_tokens","init_view_service","constructor","participantService","inject","ParticipantService","inboxService","InboxService","firestoreService","FirestoreService","conversationService","ConversationService","groupId$","GROUP_ID_TOKEN","currentParticipant$","filters$$","BehaviorSubject","loadMoreConversations$$","Subject","filterTerm$$","conversationsScrollable$","combineLatest","organizationId$","ViewService","selectedViewId$","showInboxViews$","isConversationSummaryEnabled$","pipe","observeOn","asyncScheduler","switchMap","currentParticipant","organizationId","viewId","showViews","filterTerm","filters","groupId","showConversationSummary","pageSize","conversations","startWith","q","FOLLOWING_VIEW_ID","getViewsConversationsQuery","participantId","setupBaseConversationsQuery","query","limit","fetchConversations","map","newConversations","filterConversations","loading","empty","length","of","takeUntilDestroyed","shareReplay","conversations$","scrollable","distinctUntilChanged","loadingConversations$","emptyConversations$","organizationHasConversations$","id","collectionData","res","organizationHasClosedConversations$","isOpen","isAnonymous","loadMoreConversations","next","conversationsCollection","getSummary","idField","cs","c","conversationId","filter","ids","getMultiConversationDetails","setFilterTerm","term","options","toUpperCase","conversationDetail","participantsFiltered","participants","participant","name","toLocaleUpperCase","includes","phoneNumber","updateFilters","factory","ɵfac","providedIn","_ConversationListService","InboxTermsOfService","init_inbox_terms_of_service_service","__esmMin","init_esm","init_conversation_utils","init_tokens","constructor","partnerTermsOfApiService","partnerUserAgreementTermsOfApiService","conversationService","snackBar","partnerId$","userId$","inboxService","termsOfServiceAccepted$$","ReplaySubject","termsOfServiceAccepted$","asObservable","platformLocationToSKey$","of","getPlatformLocationToSKey","platformLocation","userAgreementTerms$","pipe","switchMap","platformLocationToSKey","getUserAgreement","feature","termsOfService$","getTermsOfService","partnerId","map","tos","termsOfService","getTermsOfServiceText$","combineLatest","userAgreementResponse","isNewTermsOfService","userAgreement","userAgreementTermsOfService","terms","userAgreementIsAccepted","hasTermsOfService","next","shareReplay","__spreadProps","__spreadValues","marketId","userId","getUserAgreementTermsOfService","catchError","e","console","warn","EMPTY","defaultIfEmpty","check","accepted","acceptedAt","createdOn","acceptTermsOfService$","setUserAgreementTermsOfService","Date","err","open","duration","ɵɵinject","PartnerTermsOfApiService","PartnerUserAgreementTermsOfApiService","ConversationService","MatSnackBar","PARTNER_ID_TOKEN","USER_ID_TOKEN","InboxService","factory","ɵfac","_InboxTermsOfService","init_config_interface","__esmMin","init_host_app_interface","__esmMin","init_inbox_interface","__esmMin","init_routes_interface","__esmMin","MessageGroup","init_types","__esmMin","constructor","messageId","sender","messageType","channel","createdAt","id","messages","type","addMessage","message","push","lastMessage","length","init_src","__esmMin","init_conversation_google_service","init_conversation_core_module","init_conversation_list_service","init_conversation_utils","init_conversation_constants","init_conversation_service","init_firebase_config","init_firestore_service","init_inbox_navigation_service","init_inbox_notification_service","init_inbox_terms_of_service_service","init_inbox_utils","init_inbox_constants","init_inbox_service","init_config_interface","init_conversation_interface","init_host_app_interface","init_inbox_interface","init_routes_interface","init_listing_service","init_participant_utils","init_participant_service","init_tokens","init_types","init_view_mode_service","init_view_service"],"x_google_ignoreList":[8,21]}