@fayz-ai/plugin-conversations 0.42.1 → 0.43.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CampaignsSurface-X2LPJEKF.js → CampaignsSurface-F4JE2VF4.js} +43 -78
- package/dist/CampaignsSurface-F4JE2VF4.js.map +1 -0
- package/dist/ConversationThreadSurface-O6MQVLOO.js +111 -0
- package/dist/ConversationThreadSurface-O6MQVLOO.js.map +1 -0
- package/dist/ConversationsPage-ZYMNPRSI.js +621 -0
- package/dist/ConversationsPage-ZYMNPRSI.js.map +1 -0
- package/dist/{ConversationsSettings-GORCWUHD.js → ConversationsSettings-4UUJD6IC.js} +6 -5
- package/dist/ConversationsSettings-4UUJD6IC.js.map +1 -0
- package/dist/chunk-27Z3U4CN.js +290 -0
- package/dist/chunk-27Z3U4CN.js.map +1 -0
- package/dist/{chunk-GYEAIN3O.js → chunk-B6ACT265.js} +49 -36
- package/dist/chunk-B6ACT265.js.map +1 -0
- package/dist/chunk-IH7XSR4A.js +13 -0
- package/dist/chunk-IH7XSR4A.js.map +1 -0
- package/dist/chunk-KCGMJBZY.js +47 -0
- package/dist/chunk-KCGMJBZY.js.map +1 -0
- package/dist/{ConversationsPage-Z3YKLAOJ.js → chunk-KTYFNZ2V.js} +289 -701
- package/dist/chunk-KTYFNZ2V.js.map +1 -0
- package/dist/{chunk-W5VV6G35.js → chunk-R65GJLBC.js} +4 -16
- package/dist/chunk-R65GJLBC.js.map +1 -0
- package/dist/components/Composer.d.ts +3 -1
- package/dist/components/Composer.d.ts.map +1 -1
- package/dist/context.d.ts +3 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/data/accents.d.ts.map +1 -1
- package/dist/data/mock.d.ts.map +1 -1
- package/dist/data/supabase.d.ts.map +1 -1
- package/dist/data/types.d.ts +6 -0
- package/dist/data/types.d.ts.map +1 -1
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -285
- package/dist/index.js.map +1 -1
- package/dist/integrations/tyxter/connectorDef.d.ts.map +1 -1
- package/dist/lib/ao-vivo.d.ts +32 -0
- package/dist/lib/ao-vivo.d.ts.map +1 -0
- package/dist/lib/onboarding.d.ts +3 -4
- package/dist/lib/onboarding.d.ts.map +1 -1
- package/dist/lib/runtime.d.ts +10 -0
- package/dist/lib/runtime.d.ts.map +1 -0
- package/dist/locales/en.d.ts.map +1 -1
- package/dist/locales/pt-BR.d.ts.map +1 -1
- package/dist/migrations/index.d.ts +2 -0
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/main.browser.js +3 -1
- package/dist/migrations/main.browser.js.map +1 -1
- package/dist/migrations/main.js +191 -2
- package/dist/migrations/main.js.map +1 -1
- package/dist/settings/ConversationsSettings.d.ts.map +1 -1
- package/dist/settings/WhatsAppProviders.d.ts.map +1 -1
- package/dist/store.d.ts +6 -0
- package/dist/store.d.ts.map +1 -1
- package/dist/types.d.ts +6 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/views/CampaignsView.d.ts.map +1 -1
- package/dist/views/ContactPanel.d.ts +3 -1
- package/dist/views/ContactPanel.d.ts.map +1 -1
- package/dist/views/ConversationList.d.ts.map +1 -1
- package/dist/views/ConversationThreadSurface.d.ts +12 -0
- package/dist/views/ConversationThreadSurface.d.ts.map +1 -0
- package/dist/views/ConversationsPage.d.ts +6 -1
- package/dist/views/ConversationsPage.d.ts.map +1 -1
- package/dist/views/MessageInspector.d.ts.map +1 -1
- package/dist/views/MessageThread.d.ts +7 -1
- package/dist/views/MessageThread.d.ts.map +1 -1
- package/dist/views/NewConversationPanel.d.ts.map +1 -1
- package/dist/views/RecordLinks.d.ts +53 -0
- package/dist/views/RecordLinks.d.ts.map +1 -0
- package/dist/views/SendWindow.d.ts +2 -1
- package/dist/views/SendWindow.d.ts.map +1 -1
- package/dist/views/TemplatesView.d.ts.map +1 -1
- package/dist/views/campaigns/OfficialBalance.d.ts +2 -1
- package/dist/views/campaigns/OfficialBalance.d.ts.map +1 -1
- package/dist/views/useConversaAoVivo.d.ts +17 -0
- package/dist/views/useConversaAoVivo.d.ts.map +1 -0
- package/package.json +4 -4
- package/dist/CampaignsSurface-X2LPJEKF.js.map +0 -1
- package/dist/ConversationsPage-Z3YKLAOJ.js.map +0 -1
- package/dist/ConversationsSettings-GORCWUHD.js.map +0 -1
- package/dist/chunk-GYEAIN3O.js.map +0 -1
- package/dist/chunk-W5VV6G35.js.map +0 -1
package/dist/context.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { type StoreApi } from 'zustand';
|
|
|
3
3
|
import type { EntityLookup } from '@fayz-ai/admin';
|
|
4
4
|
import type { EntityDef } from '@fayz-ai/core';
|
|
5
5
|
import type { ConversationsUIState } from './store';
|
|
6
|
+
import type { ConversationRecordLinkSource } from './views/RecordLinks';
|
|
6
7
|
/**
|
|
7
8
|
* App-tunable knobs the inbox UI reads. Kept tiny on purpose: everything here
|
|
8
9
|
* describes the APP's data shape (which people are "contacts" in this vertical),
|
|
@@ -15,6 +16,8 @@ export interface ResolvedConversationsConfig {
|
|
|
15
16
|
contactLookup?: EntityLookup;
|
|
16
17
|
/** The app's own contact entity — "Create" opens ITS form. Agenda's twin is `clientEntityDef`. */
|
|
17
18
|
contactEntityDef?: EntityDef;
|
|
19
|
+
/** What other modules tie to a thread ("Chamado #N"), handed in by the app. */
|
|
20
|
+
recordLinks?: ConversationRecordLinkSource[];
|
|
18
21
|
}
|
|
19
22
|
export declare const DEFAULT_CONVERSATIONS_CONFIG: ResolvedConversationsConfig;
|
|
20
23
|
export declare function ConversationsContextProvider({ store, config, children, }: {
|
package/dist/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAY,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAA;AACjD,OAAO,KAAK,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EpE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accents.d.ts","sourceRoot":"","sources":["../../src/data/accents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAKvC,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"accents.d.ts","sourceRoot":"","sources":["../../src/data/accents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAKvC,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAQtD,CAAA"}
|
package/dist/data/mock.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../src/data/mock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AA8FpD,MAAM,WAAW,uBAAuB;IACtC,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,CAAA;IAC9C,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAaD,wBAAgB,+BAA+B,CAC7C,MAAM,CAAC,EAAE,uBAAuB,GAC/B,qBAAqB,
|
|
1
|
+
{"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../src/data/mock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AA8FpD,MAAM,WAAW,uBAAuB;IACtC,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,CAAA;IAC9C,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAaD,wBAAgB,+BAA+B,CAC7C,MAAM,CAAC,EAAE,uBAAuB,GAC/B,qBAAqB,CAwKvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supabase.d.ts","sourceRoot":"","sources":["../../src/data/supabase.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAwBpD,MAAM,WAAW,2BAA2B;IAC1C,+EAA+E;IAC/E,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,CAAA;IAC9C,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAsDD,wBAAgB,mCAAmC,CACjD,MAAM,CAAC,EAAE,2BAA2B,GACnC,qBAAqB,
|
|
1
|
+
{"version":3,"file":"supabase.d.ts","sourceRoot":"","sources":["../../src/data/supabase.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAwBpD,MAAM,WAAW,2BAA2B;IAC1C,+EAA+E;IAC/E,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,CAAA;IAC9C,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAsDD,wBAAgB,mCAAmC,CACjD,MAAM,CAAC,EAAE,2BAA2B,GACnC,qBAAqB,CA6SvB"}
|
package/dist/data/types.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type { Conversation, Message, ListConversationsQuery, SendMessageInput, CreateConversationInput, ConversationStatus } from '../types';
|
|
2
2
|
export interface ConversationsProvider {
|
|
3
3
|
listConversations(query?: ListConversationsQuery): Promise<Conversation[]>;
|
|
4
|
+
/**
|
|
5
|
+
* One thread by id, whatever the list's filters say — how a surface outside
|
|
6
|
+
* the inbox (a support ticket) opens ITS conversation. Optional so a custom
|
|
7
|
+
* provider keeps compiling; the store falls back to the unfiltered list.
|
|
8
|
+
*/
|
|
9
|
+
getConversation?(conversationId: string): Promise<Conversation | null>;
|
|
4
10
|
getMessages(conversationId: string): Promise<Message[]>;
|
|
5
11
|
createConversation(input: CreateConversationInput): Promise<Conversation>;
|
|
6
12
|
sendMessage(input: SendMessageInput): Promise<Message>;
|
package/dist/data/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/data/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,OAAO,EACP,sBAAsB,EACtB,gBAAgB,EAChB,uBAAuB,EACvB,kBAAkB,EACnB,MAAM,UAAU,CAAA;AAEjB,MAAM,WAAW,qBAAqB;IACpC,iBAAiB,CAAC,KAAK,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAA;IAC1E,WAAW,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAA;IACvD,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA;IACzE,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IACtD,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC/C,6EAA6E;IAC7E,UAAU,CAAC,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAClD,SAAS,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA;CACrF"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/data/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,OAAO,EACP,sBAAsB,EACtB,gBAAgB,EAChB,uBAAuB,EACvB,kBAAkB,EACnB,MAAM,UAAU,CAAA;AAEjB,MAAM,WAAW,qBAAqB;IACpC,iBAAiB,CAAC,KAAK,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAA;IAC1E;;;;OAIG;IACH,eAAe,CAAC,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAA;IACtE,WAAW,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAA;IACvD,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA;IACzE,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IACtD,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC/C,6EAA6E;IAC7E,UAAU,CAAC,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAClD,SAAS,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA;CACrF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { EntityDef, PluginManifest, PluginScope, VerticalId } from '@fayz-ai/core';
|
|
3
3
|
import type { EntityLookup } from '@fayz-ai/admin';
|
|
4
4
|
import type { ConversationsProvider } from './data/types';
|
|
5
|
+
import type { ConversationRecordLinkSource } from './views/RecordLinks';
|
|
5
6
|
export interface ConversationsPluginOptions {
|
|
6
7
|
navPosition?: number;
|
|
7
8
|
navSection?: 'main' | 'secondary' | 'settings';
|
|
@@ -22,6 +23,13 @@ export interface ConversationsPluginOptions {
|
|
|
22
23
|
* in the picker opens THAT form. Without it the picker searches only.
|
|
23
24
|
*/
|
|
24
25
|
contactEntityDef?: EntityDef;
|
|
26
|
+
/**
|
|
27
|
+
* What other modules tie to a thread, as chips in the thread header and in
|
|
28
|
+
* "Registros vinculados" — e.g. plugin-support's `supportConversationLinks`
|
|
29
|
+
* ("Chamado #N" + "Abrir chamado"). Handed in by the app so this plugin
|
|
30
|
+
* imports none of them.
|
|
31
|
+
*/
|
|
32
|
+
recordLinks?: ConversationRecordLinkSource[];
|
|
25
33
|
}
|
|
26
34
|
export declare function createConversationsPlugin(options?: ConversationsPluginOptions): PluginManifest;
|
|
27
35
|
export type { ConversationsProvider } from './data/types';
|
|
@@ -37,6 +45,9 @@ export type { CampaignProgress, CampaignTemplate, DispatchResult } from './data/
|
|
|
37
45
|
export { providersApi } from './data/providers';
|
|
38
46
|
export type { ProviderId, ProviderRow, ProviderNumber, ProviderTemplate, ProviderCapabilities } from './data/providers';
|
|
39
47
|
export { WhatsAppProviders } from './settings/WhatsAppProviders';
|
|
48
|
+
export declare const ConversationThreadSurface: React.ComponentType<import(".").ConversationThreadSurfaceProps>;
|
|
49
|
+
export type { ConversationThreadSurfaceProps } from './views/ConversationThreadSurface';
|
|
50
|
+
export type { ConversationRef, ConversationRecordLink, ConversationRecordLinkSource, } from './views/RecordLinks';
|
|
40
51
|
export declare const CampaignsSurface: React.LazyExoticComponent<typeof import("./views/campaigns/CampaignsSurface").CampaignsSurface>;
|
|
41
52
|
export declare const SendHistorySurface: React.LazyExoticComponent<typeof import("./views/campaigns/CampaignsSurface").SendHistorySurface>;
|
|
42
53
|
export declare const TemplatesSurface: React.LazyExoticComponent<typeof import("./views/campaigns/TemplatesSurface").TemplatesSurface>;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,SAA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gB,iGAAgH,CAAA;AAC7I,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAC5E,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
1
|
+
import { listMessagingChannels, findDedicatedChannel, findFallbackChannel, isPendingChannelStatus, canClaimDedicated, CHANNEL_CLAIM_TIMELINE } from './chunk-R65GJLBC.js';
|
|
2
|
+
export { listMessagingChannels } from './chunk-R65GJLBC.js';
|
|
3
|
+
import { CHANNEL_ACCENT_HEX, setConversationsRuntime, createSupabaseConversationsProvider } from './chunk-27Z3U4CN.js';
|
|
4
|
+
export { createSupabaseConversationsProvider } from './chunk-27Z3U4CN.js';
|
|
5
|
+
import { createConversationsStore, isWaitingOnUs, assinarChegada, ConversationsContextProvider, MessagePreview, useConversationsStore } from './chunk-B6ACT265.js';
|
|
6
|
+
export { isWaitingOnUs } from './chunk-B6ACT265.js';
|
|
7
|
+
import { T } from './chunk-IH7XSR4A.js';
|
|
8
|
+
import { OfficialBalance } from './chunk-KCGMJBZY.js';
|
|
9
|
+
export { journeysApi, previewBody, templateWarnings } from './chunk-HAIIYFKK.js';
|
|
5
10
|
import { providersApi } from './chunk-HMWUU5O7.js';
|
|
6
11
|
export { providersApi } from './chunk-HMWUU5O7.js';
|
|
7
|
-
export { journeysApi, previewBody, templateWarnings } from './chunk-HAIIYFKK.js';
|
|
8
12
|
import * as React from 'react';
|
|
9
13
|
import React__default, { useState, useRef, useEffect, useCallback, useMemo } from 'react';
|
|
10
|
-
import {
|
|
14
|
+
import { Check, ShieldCheck, ShieldAlert, Loader2, RefreshCw, QrCode, Zap, ExternalLink } from 'lucide-react';
|
|
11
15
|
import { defineSettingsTab, SettingsGroup, useNavContribution, playChime, notifySystem, requestNotificationPermission } from '@fayz-ai/admin';
|
|
12
|
-
import { Input, Button, toast, defineKpiWidget, defineTableWidget, KpiCard, TableWidget } from '@fayz-ai/ui';
|
|
16
|
+
import { Skeleton, Input, Button, toast, defineKpiWidget, defineTableWidget, KpiCard, TableWidget } from '@fayz-ai/ui';
|
|
13
17
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
14
|
-
import { createConnectionStore, connectionRuns, connectionStatus, tl, lazyComponent, useActiveTenantId, registerTranslations,
|
|
18
|
+
import { createConnectionStore, connectionRuns, connectionStatus, tl, lazyComponent, useActiveTenantId, registerTranslations, describeError, getSupabaseClientOptional, getActiveTenantId, countByTenant, CONNECTOR_RUNTIME_TOKEN_HEADER, connectorRuntimeToken, useTranslation, navigateApp } from '@fayz-ai/core';
|
|
15
19
|
import { MIGRATIONS } from '#migrations/main';
|
|
16
20
|
|
|
17
21
|
var COPY = {
|
|
@@ -154,10 +158,11 @@ function WhatsAppProviders({ only, onChanged } = {}) {
|
|
|
154
158
|
if (!d.qr && !d.code) toast.error("A inst\xE2ncia n\xE3o devolveu QR \u2014 j\xE1 est\xE1 pareada?");
|
|
155
159
|
});
|
|
156
160
|
const body = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
157
|
-
rows === null && /* @__PURE__ */
|
|
158
|
-
/* @__PURE__ */ jsx(
|
|
159
|
-
"
|
|
160
|
-
|
|
161
|
+
rows === null && /* @__PURE__ */ jsx("div", { className: "space-y-2 py-2", "aria-busy": "true", children: (only ? [only] : ALL).map((p) => /* @__PURE__ */ jsxs("div", { className: "space-y-2 rounded-card border bg-card p-4", children: [
|
|
162
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-40" }),
|
|
163
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-64 max-w-full" }),
|
|
164
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-full" })
|
|
165
|
+
] }, p)) }),
|
|
161
166
|
rows !== null && (only ? [only] : ALL).map((p) => {
|
|
162
167
|
const row = byId[p];
|
|
163
168
|
const copy = COPY[p];
|
|
@@ -381,16 +386,6 @@ function InboxWatcher({ label, route = "/conversations", section = "main", posit
|
|
|
381
386
|
return null;
|
|
382
387
|
}
|
|
383
388
|
|
|
384
|
-
// src/data/accents.ts
|
|
385
|
-
var CHANNEL_ACCENT_HEX = {
|
|
386
|
-
whatsapp: "#22c55e",
|
|
387
|
-
sms: "#6366f1",
|
|
388
|
-
instagram: "#ec4899",
|
|
389
|
-
email: "#0ea5e9",
|
|
390
|
-
webchat: "#f59e0b",
|
|
391
|
-
support: "#64748b"
|
|
392
|
-
};
|
|
393
|
-
|
|
394
389
|
// src/data/mock.ts
|
|
395
390
|
function minutesAgo(base, mins) {
|
|
396
391
|
return new Date(base - mins * 6e4).toISOString();
|
|
@@ -571,6 +566,9 @@ function createMockConversationsProvider(config) {
|
|
|
571
566
|
}
|
|
572
567
|
return list.sort((a, b) => b.lastMessageAt.localeCompare(a.lastMessageAt));
|
|
573
568
|
},
|
|
569
|
+
async getConversation(conversationId) {
|
|
570
|
+
return state.conversations.find((c) => c.id === conversationId) ?? null;
|
|
571
|
+
},
|
|
574
572
|
async getMessages(conversationId) {
|
|
575
573
|
return state.messages.filter((m) => m.conversationId === conversationId).sort((a, b) => a.at.localeCompare(b.at));
|
|
576
574
|
},
|
|
@@ -658,261 +656,6 @@ function createMockConversationsProvider(config) {
|
|
|
658
656
|
}
|
|
659
657
|
};
|
|
660
658
|
}
|
|
661
|
-
function mapConversation(r) {
|
|
662
|
-
return {
|
|
663
|
-
id: String(r.id),
|
|
664
|
-
contactName: r.contact_name ?? "",
|
|
665
|
-
contactPersonId: r.contact_person_id ?? void 0,
|
|
666
|
-
provider: r.provider ?? void 0,
|
|
667
|
-
contactHandle: r.contact_handle ?? "",
|
|
668
|
-
channel: r.channel ?? "sms",
|
|
669
|
-
lastMessagePreview: r.last_message_preview ?? "",
|
|
670
|
-
lastMessageAt: r.last_message_at ?? "",
|
|
671
|
-
// Kept current by the trigger in migration 001, never written from here:
|
|
672
|
-
// the column has one writer on purpose (last_message_preview/at have five,
|
|
673
|
-
// which is the mistake this one was not going to repeat).
|
|
674
|
-
lastMessageDirection: r.last_message_direction ?? void 0,
|
|
675
|
-
unreadCount: Number(r.unread_count ?? 0),
|
|
676
|
-
acknowledgedAt: r.acknowledged_at ?? null,
|
|
677
|
-
status: r.status ?? "open",
|
|
678
|
-
assignedTo: r.assigned_to ?? void 0,
|
|
679
|
-
// Presentes só quando a leitura veio da view. Na escrita (que volta da
|
|
680
|
-
// tabela) ficam nulos, e a lista recarrega logo a seguir.
|
|
681
|
-
leadOwnerId: r.lead_owner_id ?? void 0,
|
|
682
|
-
leadOwnerName: r.lead_owner_name ?? void 0,
|
|
683
|
-
inbox: r.inbox === "support" ? "support" : "commercial",
|
|
684
|
-
accent: r.accent ?? "#6366f1",
|
|
685
|
-
tags: r.tags ?? [],
|
|
686
|
-
location: r.location ?? void 0,
|
|
687
|
-
note: r.note ?? void 0
|
|
688
|
-
};
|
|
689
|
-
}
|
|
690
|
-
function mapMessage(r) {
|
|
691
|
-
return {
|
|
692
|
-
id: String(r.id),
|
|
693
|
-
conversationId: String(r.conversation_id),
|
|
694
|
-
channel: r.channel ?? "sms",
|
|
695
|
-
direction: r.direction ?? "inbound",
|
|
696
|
-
body: r.body ?? "",
|
|
697
|
-
at: r.at ?? "",
|
|
698
|
-
author: r.author ?? "",
|
|
699
|
-
deliveryStatus: r.delivery_status ?? null,
|
|
700
|
-
providerMessageId: r.provider_message_id ?? null,
|
|
701
|
-
// NULL stays null rather than defaulting to 'text'. A row written before
|
|
702
|
-
// migration 012 genuinely does not know what it was, and the rows that most
|
|
703
|
-
// need saying so are the empty ones that a 'text' default would call fine.
|
|
704
|
-
messageType: r.message_type ?? null,
|
|
705
|
-
payload: r.payload ?? null,
|
|
706
|
-
mediaPath: r.media_path ?? null
|
|
707
|
-
};
|
|
708
|
-
}
|
|
709
|
-
function createSupabaseConversationsProvider(config) {
|
|
710
|
-
const DELIVERY = /* @__PURE__ */ new Set(["queued", "sent", "delivered", "read", "failed", "expired", "delivery_timeout", "cancelled", "opted_out"]);
|
|
711
|
-
function mapDeliveryStatus(raw) {
|
|
712
|
-
const v = String(raw ?? "").toLowerCase();
|
|
713
|
-
if (v === "accepted" || v === "received") return "sent";
|
|
714
|
-
return DELIVERY.has(v) ? v : "sent";
|
|
715
|
-
}
|
|
716
|
-
const selfAuthor = config?.selfAuthor ?? "You";
|
|
717
|
-
function resolveTenantId() {
|
|
718
|
-
if (!config?.tenantId) return void 0;
|
|
719
|
-
return typeof config.tenantId === "function" ? config.tenantId() : config.tenantId;
|
|
720
|
-
}
|
|
721
|
-
function client3() {
|
|
722
|
-
const supabase = config?.supabaseClient ?? getSupabaseClientOptional();
|
|
723
|
-
if (!supabase) {
|
|
724
|
-
throw new Error(
|
|
725
|
-
"[plugin-conversations] Supabase client not available. Pass supabaseClient or register the global client via createFayzApp."
|
|
726
|
-
);
|
|
727
|
-
}
|
|
728
|
-
return supabase;
|
|
729
|
-
}
|
|
730
|
-
return {
|
|
731
|
-
async listConversations(query) {
|
|
732
|
-
let q = client3().from(T.conversationsView).select("*");
|
|
733
|
-
const tenantId = resolveTenantId();
|
|
734
|
-
if (tenantId) q = q.eq("tenant_id", tenantId);
|
|
735
|
-
if (query?.channel && query.channel !== "all") {
|
|
736
|
-
q = q.eq("channel", query.channel);
|
|
737
|
-
}
|
|
738
|
-
if (query?.status && query.status !== "all") {
|
|
739
|
-
q = q.eq("status", query.status);
|
|
740
|
-
}
|
|
741
|
-
if (query?.leadOwnerId === "none") {
|
|
742
|
-
q = q.is("lead_owner_id", null);
|
|
743
|
-
} else if (query?.leadOwnerId) {
|
|
744
|
-
q = q.eq("lead_owner_id", query.leadOwnerId);
|
|
745
|
-
}
|
|
746
|
-
if (query?.search) {
|
|
747
|
-
const term = `%${query.search}%`;
|
|
748
|
-
q = q.or(
|
|
749
|
-
`contact_name.ilike.${term},last_message_preview.ilike.${term}`
|
|
750
|
-
);
|
|
751
|
-
}
|
|
752
|
-
q = q.order("last_message_at", {
|
|
753
|
-
ascending: false
|
|
754
|
-
});
|
|
755
|
-
const { data, error } = await q;
|
|
756
|
-
if (error) throw error;
|
|
757
|
-
return (data ?? []).map(mapConversation);
|
|
758
|
-
},
|
|
759
|
-
async getMessages(conversationId) {
|
|
760
|
-
const selected = client3().from(T.messages).select("*");
|
|
761
|
-
const filtered = selected.eq(
|
|
762
|
-
"conversation_id",
|
|
763
|
-
conversationId
|
|
764
|
-
);
|
|
765
|
-
const ordered = filtered.order("at", {
|
|
766
|
-
ascending: true
|
|
767
|
-
});
|
|
768
|
-
const { data, error } = await ordered;
|
|
769
|
-
if (error) throw error;
|
|
770
|
-
return (data ?? []).map(mapMessage);
|
|
771
|
-
},
|
|
772
|
-
async createConversation(input) {
|
|
773
|
-
const tenantId = resolveTenantId();
|
|
774
|
-
if (!tenantId) {
|
|
775
|
-
throw new Error("[plugin-conversations] Active tenant not resolved \u2014 cannot create conversation. Try again in a moment.");
|
|
776
|
-
}
|
|
777
|
-
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
778
|
-
const firstMessage = input.firstMessage?.trim();
|
|
779
|
-
const convRow = {
|
|
780
|
-
contact_name: input.contactName.trim(),
|
|
781
|
-
// Only written when the picker resolved a real person — an app that
|
|
782
|
-
// hasn't run migration 002 yet would reject an unknown column, and
|
|
783
|
-
// omitting it keeps the free-text path working there.
|
|
784
|
-
...input.contactPersonId ? { contact_person_id: input.contactPersonId } : {},
|
|
785
|
-
contact_handle: input.contactHandle?.trim() || null,
|
|
786
|
-
channel: input.channel,
|
|
787
|
-
last_message_preview: firstMessage || null,
|
|
788
|
-
last_message_at: now,
|
|
789
|
-
unread_count: 0,
|
|
790
|
-
status: "open",
|
|
791
|
-
assigned_to: selfAuthor,
|
|
792
|
-
accent: CHANNEL_ACCENT_HEX[input.channel] ?? "#64748b",
|
|
793
|
-
tags: [],
|
|
794
|
-
note: input.note?.trim() || null
|
|
795
|
-
};
|
|
796
|
-
if (tenantId) convRow.tenant_id = tenantId;
|
|
797
|
-
const { data: created, error } = await client3().from(T.conversations).insert(convRow).select().single();
|
|
798
|
-
if (error) throw error;
|
|
799
|
-
if (!created) throw new Error("Conversation not created");
|
|
800
|
-
if (firstMessage) {
|
|
801
|
-
const msgRow = {
|
|
802
|
-
conversation_id: String(created.id),
|
|
803
|
-
channel: input.channel,
|
|
804
|
-
direction: "outbound",
|
|
805
|
-
body: firstMessage,
|
|
806
|
-
author: selfAuthor,
|
|
807
|
-
at: now
|
|
808
|
-
};
|
|
809
|
-
if (tenantId) msgRow.tenant_id = tenantId;
|
|
810
|
-
await client3().from(T.messages).insert(msgRow);
|
|
811
|
-
}
|
|
812
|
-
return mapConversation(created);
|
|
813
|
-
},
|
|
814
|
-
async sendMessage(input) {
|
|
815
|
-
const tenantId = resolveTenantId();
|
|
816
|
-
const convSelected = client3().from(T.conversations).select(
|
|
817
|
-
"channel, contact_handle"
|
|
818
|
-
);
|
|
819
|
-
const convFiltered = convSelected.eq(
|
|
820
|
-
"id",
|
|
821
|
-
input.conversationId
|
|
822
|
-
);
|
|
823
|
-
const { data: conv } = await convFiltered.maybeSingle();
|
|
824
|
-
const channel = conv?.channel ?? "sms";
|
|
825
|
-
const at = (/* @__PURE__ */ new Date()).toISOString();
|
|
826
|
-
const row = {
|
|
827
|
-
conversation_id: input.conversationId,
|
|
828
|
-
channel,
|
|
829
|
-
direction: "outbound",
|
|
830
|
-
body: input.body,
|
|
831
|
-
author: selfAuthor,
|
|
832
|
-
at
|
|
833
|
-
};
|
|
834
|
-
if (tenantId) row.tenant_id = tenantId;
|
|
835
|
-
const { data: created, error } = await client3().from(T.messages).insert(row).select().single();
|
|
836
|
-
if (error) throw error;
|
|
837
|
-
let sentId = null;
|
|
838
|
-
let sentStatus = null;
|
|
839
|
-
if (channel === "whatsapp") {
|
|
840
|
-
const handle = String(conv?.contact_handle ?? "");
|
|
841
|
-
try {
|
|
842
|
-
const { data: out, error: sendErr } = await client3().functions.invoke(
|
|
843
|
-
"conversations-provider",
|
|
844
|
-
{ body: { tenantId, action: "send", to: handle, text: input.body } }
|
|
845
|
-
);
|
|
846
|
-
if (sendErr) {
|
|
847
|
-
const detail = await sendErr.context?.json?.().catch(() => null);
|
|
848
|
-
throw new Error(detail?.message ?? sendErr.message);
|
|
849
|
-
}
|
|
850
|
-
if (out?.error) throw new Error(out.message ?? out.error);
|
|
851
|
-
sentId = out?.providerMessageId ?? null;
|
|
852
|
-
sentStatus = out?.queued ? "queued" : mapDeliveryStatus(out?.status);
|
|
853
|
-
if (created?.id) {
|
|
854
|
-
await client3().from(T.messages).update({
|
|
855
|
-
provider_message_id: sentId,
|
|
856
|
-
// O provedor fala o dialeto dele. A Tyxter devolve `accepted`,
|
|
857
|
-
// que NÃO existe no CHECK desta coluna — o update explodia, caía
|
|
858
|
-
// no catch, e a mensagem era marcada como falha mesmo tendo
|
|
859
|
-
// saído. Foi assim que "opa" apareceu verde e contou como erro.
|
|
860
|
-
delivery_status: sentStatus
|
|
861
|
-
}).eq("id", String(created.id));
|
|
862
|
-
}
|
|
863
|
-
} catch (err) {
|
|
864
|
-
if (created?.id) {
|
|
865
|
-
await client3().from(T.messages).update({
|
|
866
|
-
delivery_status: "failed"
|
|
867
|
-
}).eq("id", String(created.id));
|
|
868
|
-
}
|
|
869
|
-
throw err;
|
|
870
|
-
}
|
|
871
|
-
}
|
|
872
|
-
await client3().from(T.conversations).update({
|
|
873
|
-
last_message_preview: input.body,
|
|
874
|
-
last_message_at: at,
|
|
875
|
-
unread_count: 0,
|
|
876
|
-
status: "open"
|
|
877
|
-
}).eq("id", input.conversationId);
|
|
878
|
-
return {
|
|
879
|
-
...mapMessage(created ?? row),
|
|
880
|
-
providerMessageId: sentId,
|
|
881
|
-
deliveryStatus: sentStatus
|
|
882
|
-
};
|
|
883
|
-
},
|
|
884
|
-
async markRead(conversationId) {
|
|
885
|
-
const { error } = await client3().from(T.conversations).update({
|
|
886
|
-
unread_count: 0,
|
|
887
|
-
// O instante é o que tira a bolinha. `unread_count` sozinho não
|
|
888
|
-
// tirava — a fila olha a DIREÇÃO da última mensagem, e ela continua
|
|
889
|
-
// sendo de entrada por mais que alguém leia.
|
|
890
|
-
acknowledged_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
891
|
-
}).eq("id", conversationId);
|
|
892
|
-
if (error) throw error;
|
|
893
|
-
},
|
|
894
|
-
async markUnread(conversationId) {
|
|
895
|
-
const { error } = await client3().from(T.conversations).update({
|
|
896
|
-
// Unread = no acknowledgement and something to read: `isWaitingOnUs`
|
|
897
|
-
// then puts it back on top, red, whoever spoke last.
|
|
898
|
-
unread_count: 1,
|
|
899
|
-
acknowledged_at: null
|
|
900
|
-
}).eq("id", conversationId);
|
|
901
|
-
if (error) throw error;
|
|
902
|
-
},
|
|
903
|
-
async setStatus(conversationId, status) {
|
|
904
|
-
const updated = client3().from(T.conversations).update({
|
|
905
|
-
status
|
|
906
|
-
});
|
|
907
|
-
const filtered = updated.eq("id", conversationId);
|
|
908
|
-
const selected = filtered.select();
|
|
909
|
-
const { data, error } = await selected.single();
|
|
910
|
-
if (error) throw error;
|
|
911
|
-
if (!data) throw new Error("Conversation not found");
|
|
912
|
-
return mapConversation(data);
|
|
913
|
-
}
|
|
914
|
-
};
|
|
915
|
-
}
|
|
916
659
|
|
|
917
660
|
// src/locales/en.ts
|
|
918
661
|
var en = {
|
|
@@ -955,6 +698,7 @@ var en = {
|
|
|
955
698
|
"conversations.filter.instagram": "Instagram",
|
|
956
699
|
"conversations.filter.email": "Email",
|
|
957
700
|
"conversations.filter.webchat": "Web",
|
|
701
|
+
"conversations.filter.support": "Support",
|
|
958
702
|
// Status labels
|
|
959
703
|
"conversations.status.open": "Open",
|
|
960
704
|
"conversations.status.snoozed": "Snoozed",
|
|
@@ -1156,6 +900,7 @@ var ptBR = {
|
|
|
1156
900
|
"conversations.filter.instagram": "Instagram",
|
|
1157
901
|
"conversations.filter.email": "E-mail",
|
|
1158
902
|
"conversations.filter.webchat": "Web",
|
|
903
|
+
"conversations.filter.support": "Suporte",
|
|
1159
904
|
// Rótulos de status
|
|
1160
905
|
"conversations.status.open": "Aberta",
|
|
1161
906
|
"conversations.status.snoozed": "Adiada",
|
|
@@ -1461,7 +1206,7 @@ function buildConversationsOnboarding() {
|
|
|
1461
1206
|
return {
|
|
1462
1207
|
id: "conversations",
|
|
1463
1208
|
title: "Quem fala com voc\xEA",
|
|
1464
|
-
order:
|
|
1209
|
+
order: 70,
|
|
1465
1210
|
role: "frontdesk",
|
|
1466
1211
|
instructions: `Voc\xEA est\xE1 ligando a caixa de entrada. O risco aqui n\xE3o \xE9 a pessoa n\xE3o achar a tela \u2014 \xE9 ela achar a tela, ver que est\xE1 vazia e concluir que o produto n\xE3o funciona.
|
|
1467
1212
|
|
|
@@ -1477,6 +1222,8 @@ function buildConversationsOnboarding() {
|
|
|
1477
1222
|
icon: "MessageCircle",
|
|
1478
1223
|
route: "/settings/conversations/_integrations",
|
|
1479
1224
|
priority: "urgent",
|
|
1225
|
+
// In the store-live journey as a "quando quiser" step: the channel waits for no one.
|
|
1226
|
+
journey: { group: "later" },
|
|
1480
1227
|
// O passo É a tela: um app que monte o inbox sem a rota de configurações
|
|
1481
1228
|
// não tem onde ligar canal nenhum, e a linha ficaria aberta para sempre.
|
|
1482
1229
|
requiresRoute: true,
|
|
@@ -1499,6 +1246,9 @@ function buildConversationsOnboarding() {
|
|
|
1499
1246
|
icon: "Send",
|
|
1500
1247
|
route: "/conversations",
|
|
1501
1248
|
priority: "high",
|
|
1249
|
+
dueInDays: 7,
|
|
1250
|
+
// Outside the journey's count: the proof, not a setup step.
|
|
1251
|
+
journey: { group: "extra" },
|
|
1502
1252
|
agentHint: "N\xE3o \xE9 passo de cadastro. Pe\xE7a para a pessoa mandar uma mensagem do pr\xF3prio celular para o n\xFAmero ligado e responder aqui de dentro \u2014 e fique com ela at\xE9 a resposta chegar do outro lado.",
|
|
1503
1253
|
howTo: "Pegue o seu celular, mande uma mensagem qualquer para o n\xFAmero que voc\xEA acabou de ligar e volte aqui: a conversa aparece em Conversas. Responda por aqui e confira que chegou no celular. \xC9 o teste que prova que a caixa de entrada est\xE1 no ar \u2014 e \xE9 tamb\xE9m como a equipe vai trabalhar todo dia, com a conversa num lugar que todo mundo v\xEA em vez de num aparelho s\xF3.",
|
|
1504
1254
|
celebrate: "Ida e volta funcionando \u{1F4AC}",
|
|
@@ -1818,6 +1568,7 @@ function TyxterExtraPanel() {
|
|
|
1818
1568
|
] }),
|
|
1819
1569
|
/* @__PURE__ */ jsx("p", { className: "text-[11px] text-muted-foreground", children: "O n\xFAmero \xE9 alugado no m\xEAs e, depois que chegar, ainda precisa de um cadastro r\xE1pido na Meta para come\xE7ar a enviar." })
|
|
1820
1570
|
] }),
|
|
1571
|
+
/* @__PURE__ */ jsx(OfficialBalance, {}),
|
|
1821
1572
|
/* @__PURE__ */ jsx(TyxterPaymentsPanel, {})
|
|
1822
1573
|
] });
|
|
1823
1574
|
}
|
|
@@ -2072,6 +1823,7 @@ function createSafeProvider() {
|
|
|
2072
1823
|
};
|
|
2073
1824
|
return {
|
|
2074
1825
|
listConversations: (...a) => resolve().listConversations(...a),
|
|
1826
|
+
getConversation: async (id) => await resolve().getConversation?.(id) ?? null,
|
|
2075
1827
|
getMessages: (...a) => resolve().getMessages(...a),
|
|
2076
1828
|
sendMessage: (...a) => resolve().sendMessage(...a),
|
|
2077
1829
|
markRead: (...a) => resolve().markRead(...a),
|
|
@@ -2087,8 +1839,10 @@ function createConversationsPlugin(options) {
|
|
|
2087
1839
|
const config = {
|
|
2088
1840
|
contactKind: options?.contactKind ?? "contact",
|
|
2089
1841
|
contactLookup: options?.contactLookup,
|
|
2090
|
-
contactEntityDef: options?.contactEntityDef
|
|
1842
|
+
contactEntityDef: options?.contactEntityDef,
|
|
1843
|
+
recordLinks: options?.recordLinks
|
|
2091
1844
|
};
|
|
1845
|
+
setConversationsRuntime({ store: store2, config });
|
|
2092
1846
|
const dashboardWidgets = createConversationsDashboardWidgets({ store: store2, config });
|
|
2093
1847
|
const PageComponent = () => React__default.createElement(ConversationsPage, { store: store2, config });
|
|
2094
1848
|
PageComponent.displayName = "ConversationsPage";
|
|
@@ -2210,7 +1964,7 @@ function createConversationsPlugin(options) {
|
|
|
2210
1964
|
properties: {
|
|
2211
1965
|
channel: {
|
|
2212
1966
|
type: "string",
|
|
2213
|
-
enum: ["all", "sms", "whatsapp", "instagram", "email", "webchat"]
|
|
1967
|
+
enum: ["all", "sms", "whatsapp", "instagram", "email", "webchat", "support"]
|
|
2214
1968
|
}
|
|
2215
1969
|
}
|
|
2216
1970
|
},
|
|
@@ -2330,13 +2084,16 @@ function createConversationsPlugin(options) {
|
|
|
2330
2084
|
locales: conversationsLocales
|
|
2331
2085
|
};
|
|
2332
2086
|
}
|
|
2333
|
-
var ConversationsPage = React__default.lazy(() => import('./ConversationsPage-
|
|
2087
|
+
var ConversationsPage = React__default.lazy(() => import('./ConversationsPage-ZYMNPRSI.js').then((m) => ({ default: m.ConversationsPage })));
|
|
2334
2088
|
var AtendeAIPage = React__default.lazy(() => import('./AtendeAIPage-PBBMWIDW.js').then((m) => ({ default: m.AtendeAIPage })));
|
|
2335
|
-
var ConversationsSettingsTab = lazyComponent(() => import('./ConversationsSettings-
|
|
2336
|
-
var
|
|
2337
|
-
|
|
2089
|
+
var ConversationsSettingsTab = lazyComponent(() => import('./ConversationsSettings-4UUJD6IC.js').then((m) => m.ConversationsSettingsTab));
|
|
2090
|
+
var ConversationThreadSurface = lazyComponent(
|
|
2091
|
+
() => import('./ConversationThreadSurface-O6MQVLOO.js').then((m) => m.ConversationThreadSurface)
|
|
2092
|
+
);
|
|
2093
|
+
var CampaignsSurface = React__default.lazy(() => import('./CampaignsSurface-F4JE2VF4.js').then((m) => ({ default: m.CampaignsSurface })));
|
|
2094
|
+
var SendHistorySurface = React__default.lazy(() => import('./CampaignsSurface-F4JE2VF4.js').then((m) => ({ default: m.SendHistorySurface })));
|
|
2338
2095
|
var TemplatesSurface = React__default.lazy(() => import('./TemplatesSurface-D6UMF5XE.js').then((m) => ({ default: m.TemplatesSurface })));
|
|
2339
2096
|
|
|
2340
|
-
export { CampaignsSurface, PAYMENT_PREFLIGHT_FUNCTION, SendHistorySurface, TYXTER_CONNECTOR_ID, TYXTER_LATENCY_BUDGET_MS, TemplatesSurface, WhatsAppProviders, campaignsApi, canOfferPayment, createConversationsPlugin, createMockConversationsProvider,
|
|
2097
|
+
export { CampaignsSurface, ConversationThreadSurface, PAYMENT_PREFLIGHT_FUNCTION, SendHistorySurface, TYXTER_CONNECTOR_ID, TYXTER_LATENCY_BUDGET_MS, TemplatesSurface, WhatsAppProviders, campaignsApi, canOfferPayment, createConversationsPlugin, createMockConversationsProvider, openPaymentSetupSession, readPaymentReadiness, tyxterConnectorDef };
|
|
2341
2098
|
//# sourceMappingURL=index.js.map
|
|
2342
2099
|
//# sourceMappingURL=index.js.map
|