@fayz-ai/admin 0.30.1 → 0.30.3
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/ImportWizard-7UFB2PPF.js +3 -0
- package/dist/{ImportWizard-CISHGNQC.js.map → ImportWizard-7UFB2PPF.js.map} +1 -1
- package/dist/ScheduleEditor-YE42HL7P.js +7 -0
- package/dist/{ScheduleEditor-QC6OYBUE.js.map → ScheduleEditor-YE42HL7P.js.map} +1 -1
- package/dist/{chunk-UMRN6427.js → chunk-46UABOOC.js} +12 -37
- package/dist/chunk-46UABOOC.js.map +1 -0
- package/dist/{chunk-3SREEFHN.js → chunk-XDYY5PLH.js} +24 -3
- package/dist/chunk-XDYY5PLH.js.map +1 -0
- package/dist/components/plugins/PluginSettingsPanel.d.ts.map +1 -1
- package/dist/crud/ImportWizard.d.ts.map +1 -1
- package/dist/crud/archetype-lookup.d.ts +4 -0
- package/dist/crud/archetype-lookup.d.ts.map +1 -1
- package/dist/crud/archetypes/OrderDetailView.d.ts +1 -1
- package/dist/crud/archetypes/OrderDetailView.d.ts.map +1 -1
- package/dist/crud/archetypes/OrderFormView.d.ts +9 -2
- package/dist/crud/archetypes/OrderFormView.d.ts.map +1 -1
- package/dist/crud/archetypes/PersonDetailTabs.d.ts +10 -0
- package/dist/crud/archetypes/PersonDetailTabs.d.ts.map +1 -1
- package/dist/crud/useLookupCreate.d.ts +3 -0
- package/dist/crud/useLookupCreate.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +960 -710
- package/dist/index.js.map +1 -1
- package/dist/onboarding/index.d.ts +2 -0
- package/dist/onboarding/index.d.ts.map +1 -1
- package/dist/onboarding/usePluginOnboardingGate.d.ts +14 -0
- package/dist/onboarding/usePluginOnboardingGate.d.ts.map +1 -0
- package/dist/types/plugins.d.ts +2 -0
- package/dist/types/plugins.d.ts.map +1 -1
- package/dist/units/PersonAvailabilityTab.d.ts +13 -0
- package/dist/units/PersonAvailabilityTab.d.ts.map +1 -0
- package/package.json +4 -4
- package/dist/ImportWizard-CISHGNQC.js +0 -3
- package/dist/ScheduleEditor-QC6OYBUE.js +0 -7
- package/dist/chunk-3SREEFHN.js.map +0 -1
- package/dist/chunk-UMRN6427.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -8,9 +8,9 @@ import { resolveEntityRoute, openEntity, entityRouteHasDetail, resolveEntityAnch
|
|
|
8
8
|
export { openEntity, resolveEntityAnchor, resolveEntityHref, resolveEntityRoute } from './chunk-P5UIGQFY.js';
|
|
9
9
|
import { useAdminPath, navigateTo, normalizeAdminPath, routeScore, matchRoute } from './chunk-VX3WJLKK.js';
|
|
10
10
|
export { navigateTo as adminNavigateTo, useAdminPath } from './chunk-VX3WJLKK.js';
|
|
11
|
-
export { ImportWizard } from './chunk-
|
|
12
|
-
import { createArchetypeLookup, getPersonLookup } from './chunk-
|
|
13
|
-
export { ScheduleDateExceptions, ScheduleEditor, ScheduleGridPanel, createArchetypeLookup, deleteSchedule, getPersonBookable, getPersonLookup, getScheduleBlockConfig, getSchedules, mergeBlockSettings, parseBlockSettings, registerPersonLookup, replaceWeeklySchedules, saveSchedule, setPersonBookable, setScheduleBlockConfig, subscribeScheduleBlockConfig } from './chunk-
|
|
11
|
+
export { ImportWizard } from './chunk-46UABOOC.js';
|
|
12
|
+
import { createArchetypeLookup, getPersonLookup } from './chunk-XDYY5PLH.js';
|
|
13
|
+
export { ScheduleDateExceptions, ScheduleEditor, ScheduleGridPanel, createArchetypeLookup, deleteSchedule, getPersonBookable, getPersonLookup, getScheduleBlockConfig, getSchedules, mergeBlockSettings, parseBlockSettings, registerPersonLookup, replaceWeeklySchedules, saveSchedule, setPersonBookable, setScheduleBlockConfig, subscribeScheduleBlockConfig } from './chunk-XDYY5PLH.js';
|
|
14
14
|
import { getFayzSupabaseClientOptional, getSupabaseClientOptional as getSupabaseClientOptional$1, useAppConfigStore, activePluginIds, hasPlugin, WorkspaceChooserGate, WorkspaceSwitchingHost, createFayzSupabaseClient, resolveAppId, createSupabaseOrgAdapter, createMockOrgAdapter, OrgMark, useWorkspaceSwitchingStore, searchWorkspaces, getFayzSupabaseClient } from './chunk-ZUM3Y7VB.js';
|
|
15
15
|
export { OrgMark, activePluginIds, createFayzSupabaseClient, createMockOrgAdapter, createSupabaseOrgAdapter, getFayzSupabaseClient, getFayzSupabaseClientOptional, hasPlugin, orgInitials, useAppConfigStore } from './chunk-ZUM3Y7VB.js';
|
|
16
16
|
import { readOrgSnapshot, useTenantOptional, useOrgAdapter, useTenant, OrgProvider, useOrgAdapterOptional } from './chunk-KSUIF56I.js';
|
|
@@ -19,19 +19,19 @@ import { usePermissionOptional, usePermissionsStore, PermissionsProvider } from
|
|
|
19
19
|
export { PermissionsProvider, useHasPermission, usePermission, usePermissionOptional, usePermissions, usePermissionsStore } from './chunk-UQ2NTFQC.js';
|
|
20
20
|
import { cn, useOrganizationStore } from './chunk-W5IBKM3K.js';
|
|
21
21
|
export { getPersistedOrgId, useOrganizationStore } from './chunk-W5IBKM3K.js';
|
|
22
|
-
import * as
|
|
23
|
-
import
|
|
22
|
+
import * as React122 from 'react';
|
|
23
|
+
import React122__default, { createContext, useMemo, useState, useRef, useCallback, useEffect, useLayoutEffect, createElement, useContext } from 'react';
|
|
24
24
|
import { createDebug, resetActiveUnit, setUnitMode, setActiveUnitId, setScopedResources, tl, fetchAppConfig, getSupabaseClientOptional, createSafeDataProvider, isKnownMissing, rememberIfMissing, deriveEntityKey, registerEntity, getActiveTenantId, resolveDataProvider, bulkRemove, emitDomainEvent, entityEventKey, errorMessage, useTranslation, useDataChanged, emitDataChanged, exportCSV, formatDateTime as formatDateTime$1, formatDate as formatDate$1, formatCurrency as formatCurrency$1, bulkCreate, matchesRange, isConnectorCategory, usePluginRuntimeOptional, useDataVersion, reportAppError, getWidgetsForZone, resolvePluginComponent, invalidateAppConfig, toTenantPluginBindings, setCurrentLocale, resolveLocale, resolvePluginRuntime, PluginRuntimeProvider, I18nProvider, getAllEntities, resolveIntegrationSurface, defineApp, registerScaffold, useActiveTenantId, useConnectorsForPlugin, renderApp as renderApp$1, parseRangeFilter, isFilterObject, connectionKey, useManifest, registerEventSink, usePluginRuntime, installGlobalErrorHandlers, registerErrorReporter, applyNavComposition, mergeTranslations, coreTranslations, attachPersistentCache, getPersistentCache, createMockProvider, listConnections, connectorPlanes, connectorPermissions, connectorEntities, preferredPlane, connectorDirection, countByTenant, getCurrentLocale, searchEverything, getComponent, getPluginFactory, connectorSettings, groupedPermissions, invocationPlane, missingRequiredSettings, isSettingSet, getEntityByKey, connectorSubscribesTo, eventKeyMatches, formatPostalCode, isValidPostalCode, lookupPostalCode } from '@fayz-ai/core';
|
|
25
25
|
export { ConnectorRuntimeTokenUnavailableError, createSafeDataProvider, formatDate, formatDateTime, getActiveLocale, getActiveTenantId, getConnectorRuntimeTokenSource, getCurrentLocale, getSupabaseClientOptional, preloadLocale, resolveBackendEnv, setConnectorRuntimeTokenSource, setCurrentLocale, tl, useActiveTenantId } from '@fayz-ai/core';
|
|
26
26
|
import { usePasswordSetupGate, SetPasswordPage, AuthGate, AuthProvider, createAuthRuntime } from '@fayz-ai/plugin-auth';
|
|
27
27
|
export { LoginPage } from '@fayz-ai/plugin-auth';
|
|
28
|
-
import { toast, usePageTrailParent, navigateToCrumb, Button, PageHeader, ConfirmDialog, useRowSelection, getLucideIcon, ListFilterBar, Dropdown, DropdownTrigger, Hint, cn as cn$1, DropdownContent, DropdownLabel, DropdownItem, DropdownSeparator, RefreshButton, PageHeaderActions, PageTabs, StatTiles, Card, BulkActionBar, DataTable, Modal, ModalContent, ModalHeader, ModalTitle, ModalDescription, ModalFooter, Badge, PageActionBar, ICON_MAP, Sheet, SheetContent, SheetBody, useIsWide, TooltipProvider, Tooltip, TooltipTrigger, TooltipContent, Checkbox, useTourStore, setTourNavigator, TourSpotlight, PracticeOverlay, Input, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, Wizard, SidebarOnboarding, OnboardingWidget,
|
|
28
|
+
import { toast, usePageTrailParent, navigateToCrumb, Button, PageHeader, ConfirmDialog, useRowSelection, getLucideIcon, ListFilterBar, Dropdown, DropdownTrigger, Hint, cn as cn$1, DropdownContent, DropdownLabel, DropdownItem, DropdownSeparator, RefreshButton, PageHeaderActions, PageTabs, StatTiles, Card, BulkActionBar, DataTable, Modal, ModalContent, ModalHeader, ModalTitle, ModalDescription, ModalFooter, Badge, PageActionBar, ICON_MAP, Sheet, SheetContent, SheetBody, useIsWide, TooltipProvider, Tooltip, TooltipTrigger, TooltipContent, Checkbox, useTourStore, setTourNavigator, TourSpotlight, PracticeOverlay, Input, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, Wizard, SidebarOnboarding, OnboardingWidget, Skeleton, useLayoutStore, useSaveBar, useBackHandler, SubpageHeader, Separator, Tabs, TabsList, TabsTrigger, TabsContent, CardContent, ModalBody, ToastProvider, NavTransitionProvider, ListView, Thumbnail, ModalPortal, ModalOverlay, SearchSelect, CurrencyInput, SearchField, ChevronPager, Popover, PopoverTrigger, PopoverContent, useModuleLayout, PhoneLink, normalizePhone, SearchCombobox, HeaderTabs, usePageTrail, AppShellSkeleton, usePracticeStore, Switch, ModuleLayoutProvider, AppShell, PageTransition, PickerDialog, MarkdownEditor, PhoneField, isCreateRoute, PageRail, RailNavItem, createFayzTheme, Avatar, AvatarImage, AvatarFallback, Markdown, PageTrail, RowActions, CardTitle, CardDescription, DropdownSub, DropdownSubTrigger, DropdownSubContent, DropdownRadioGroup, DropdownRadioItem, BottomSheet, CardHeader, CardFooter, SegmentedControl, SheetCard, SheetRow, useSheetClose, ModalTask } from '@fayz-ai/ui';
|
|
29
29
|
export { createFayzTheme, fayzThemePresets } from '@fayz-ai/ui';
|
|
30
30
|
import { useAuthStore, useAuth, buildAppHandoffUrl } from '@fayz-ai/auth';
|
|
31
31
|
export { useAuth } from '@fayz-ai/auth';
|
|
32
32
|
import { create, useStore as useStore$1 } from 'zustand';
|
|
33
33
|
import * as LucideIcons3 from 'lucide-react';
|
|
34
|
-
import { Trash2, Upload, Search, ArrowDown, ArrowUp, ArrowUpDown, Check, Download, ChevronLeft, ChevronRight, AlertTriangle, Pencil, Inbox, Package, Sparkles, Plug, DollarSign, Clock, X, WandSparkles, Loader2, ArrowDownToLine, ArrowUpFromLine, CheckCircle2, Crown, ArrowRight, History, SquarePen, Settings2, Mic, User, Plus, Minus, ListChecks, ChevronDown, ArrowLeft, Calendar, ClipboardList, CheckSquare, BookOpen, Lock, PinOff, Pin, Eye, Users, StickyNote, CheckSquare2, Square, Building2, RotateCcw, Copy, Globe, LayoutTemplate, Store, ChevronsUpDown, ExternalLink, PenSquare, RefreshCw, XCircle, Camera, Edit, Star, Link2Off, Layers, ShoppingBag, MoreHorizontal, ChevronUp, List, LayoutGrid, CircleDollarSign, Receipt, Settings, Mail, MessageCircle, Cake, HelpCircle, Wrench, TableProperties, ShieldCheck, MessageSquare, Paperclip, Infinity, CheckCheck, PartyPopper, Compass, Play, ArrowUpCircle, MapPin, ArrowUpRight, Pause, CalendarDays, CircleCheckBig, UserX, Ban, CircleAlert, CircleEllipsis, FileText, CircleDashed, Power, ArrowRightLeft, File as File$1, FileImage, FileSpreadsheet, AlertCircle, CreditCard, SlidersHorizontal, Puzzle, Shield, Palette, Blocks, ShieldAlert, UserCog, LogOut, Bell, ImagePlus, Database, Radio, Zap, Save, UserPlus, Contact, UserMinus, Send, Sun, Moon, Monitor, Languages, Info, LocateFixed, Link2, KeyRound, Bug, Heart, Briefcase, BarChart3, Tag, Truck } from 'lucide-react';
|
|
34
|
+
import { Trash2, Upload, Search, ArrowDown, ArrowUp, ArrowUpDown, Check, Download, ChevronLeft, ChevronRight, AlertTriangle, Pencil, Inbox, Package, Sparkles, Plug, DollarSign, Clock, X, WandSparkles, Loader2, ArrowDownToLine, ArrowUpFromLine, CheckCircle2, Crown, ArrowRight, History, SquarePen, Settings2, Mic, User, Plus, Minus, ListChecks, ChevronDown, ArrowLeft, Calendar, ClipboardList, CheckSquare, BookOpen, Lock, PinOff, Pin, Eye, Users, StickyNote, CheckSquare2, Square, Building2, RotateCcw, Copy, Globe, LayoutTemplate, Store, ChevronsUpDown, ExternalLink, PenSquare, RefreshCw, XCircle, Camera, Edit, Star, Link2Off, Layers, ShoppingBag, MoreHorizontal, ChevronUp, List, LayoutGrid, CircleDollarSign, Receipt, Settings, Mail, MessageCircle, Cake, HelpCircle, Wrench, TableProperties, ShieldCheck, MessageSquare, Paperclip, Infinity, CheckCheck, PartyPopper, Compass, Play, ArrowUpCircle, MapPin, ArrowUpRight, Pause, CalendarDays, CircleCheckBig, UserX, Ban, CircleAlert, CircleEllipsis, FileText, CircleDashed, Power, ArrowRightLeft, File as File$1, FileImage, FileSpreadsheet, AlertCircle, CreditCard, SlidersHorizontal, Puzzle, Shield, Palette, Blocks, ShieldAlert, UserCog, LogOut, Bell, ImagePlus, Database, Radio, Zap, Save, UserPlus, Contact, UserMinus, Send, Sun, Moon, Monitor, Languages, Info, LocateFixed, Link2, KeyRound, Bug, Heart, Briefcase, BarChart3, Tag, Truck, Globe2 } from 'lucide-react';
|
|
35
35
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
36
36
|
import { createPortal } from 'react-dom';
|
|
37
37
|
import { profileHasSystemPermission, mergeLimitDeclarations } from '@fayz-ai/core/access';
|
|
@@ -76,7 +76,7 @@ function useWorkspaceSetupGate(enabled) {
|
|
|
76
76
|
const close = useWorkspaceSetupStore((s) => s.close);
|
|
77
77
|
const path = useAdminPath();
|
|
78
78
|
const onRoute = path === WORKSPACE_SETUP_ROUTE;
|
|
79
|
-
const exitDeliberate =
|
|
79
|
+
const exitDeliberate = React122.useCallback(() => {
|
|
80
80
|
close();
|
|
81
81
|
if (onRoute) navigateTo("/");
|
|
82
82
|
}, [close, onRoute]);
|
|
@@ -185,10 +185,10 @@ function brandInstructions(brand) {
|
|
|
185
185
|
var UPDATE_EVENT = "fayz:update-ready";
|
|
186
186
|
function UpdateReady() {
|
|
187
187
|
const { t } = useTranslation$1();
|
|
188
|
-
const [pronta, setPronta] =
|
|
189
|
-
const [dispensada, setDispensada] =
|
|
190
|
-
const [aplicando, setAplicando] =
|
|
191
|
-
|
|
188
|
+
const [pronta, setPronta] = React122__default.useState(false);
|
|
189
|
+
const [dispensada, setDispensada] = React122__default.useState(false);
|
|
190
|
+
const [aplicando, setAplicando] = React122__default.useState(false);
|
|
191
|
+
React122__default.useEffect(() => {
|
|
192
192
|
const aviso = () => setPronta(true);
|
|
193
193
|
window.addEventListener(UPDATE_EVENT, aviso);
|
|
194
194
|
return () => window.removeEventListener(UPDATE_EVENT, aviso);
|
|
@@ -1939,7 +1939,7 @@ function getServerVersion() {
|
|
|
1939
1939
|
return 0;
|
|
1940
1940
|
}
|
|
1941
1941
|
function useAssistantActivity() {
|
|
1942
|
-
|
|
1942
|
+
React122.useSyncExternalStore(subscribe, getVersion, getServerVersion);
|
|
1943
1943
|
return pickActivity(activities);
|
|
1944
1944
|
}
|
|
1945
1945
|
var STATE_RANK = {
|
|
@@ -1955,22 +1955,22 @@ function pickActivity(list) {
|
|
|
1955
1955
|
return pool.find((a) => a.kind === "recording") ?? pool[0];
|
|
1956
1956
|
}
|
|
1957
1957
|
function useAssistantLaunchers() {
|
|
1958
|
-
|
|
1958
|
+
React122.useSyncExternalStore(subscribe, getVersion, getServerVersion);
|
|
1959
1959
|
return launchers;
|
|
1960
1960
|
}
|
|
1961
1961
|
function useLaunchersForRole(role) {
|
|
1962
1962
|
const all = useAssistantLaunchers();
|
|
1963
|
-
return
|
|
1963
|
+
return React122.useMemo(() => all.filter((l) => !l.role || l.role === role), [all, role]);
|
|
1964
1964
|
}
|
|
1965
1965
|
function usePublishAssistantActivity(activity) {
|
|
1966
1966
|
const id = activity?.id;
|
|
1967
1967
|
const key = activity ? `${activity.id}|${activity.kind}|${activity.label}|${activity.state}|${activity.elapsedMs ?? ""}|${(activity.actions ?? []).map((a) => a.intent).join(",")}|${activity.confirm?.acknowledge ?? ""}` : null;
|
|
1968
|
-
const ref =
|
|
1968
|
+
const ref = React122.useRef(activity);
|
|
1969
1969
|
ref.current = activity;
|
|
1970
|
-
|
|
1970
|
+
React122.useEffect(() => {
|
|
1971
1971
|
if (ref.current) publishAssistantActivity(ref.current);
|
|
1972
1972
|
}, [key]);
|
|
1973
|
-
|
|
1973
|
+
React122.useEffect(() => {
|
|
1974
1974
|
if (!id) return;
|
|
1975
1975
|
return () => withdrawAssistantActivity(id);
|
|
1976
1976
|
}, [id]);
|
|
@@ -1978,12 +1978,12 @@ function usePublishAssistantActivity(activity) {
|
|
|
1978
1978
|
function useRegisterAssistantLauncher(launcher) {
|
|
1979
1979
|
const id = launcher?.id;
|
|
1980
1980
|
const key = launcher ? `${launcher.id}|${launcher.label}|${launcher.disabled ? "1" : "0"}|${launcher.role ?? ""}` : null;
|
|
1981
|
-
const ref =
|
|
1981
|
+
const ref = React122.useRef(launcher);
|
|
1982
1982
|
ref.current = launcher;
|
|
1983
|
-
|
|
1983
|
+
React122.useEffect(() => {
|
|
1984
1984
|
if (ref.current) registerAssistantLauncher(ref.current);
|
|
1985
1985
|
}, [key]);
|
|
1986
|
-
|
|
1986
|
+
React122.useEffect(() => {
|
|
1987
1987
|
if (!id) return;
|
|
1988
1988
|
return () => unregisterAssistantLauncher(id);
|
|
1989
1989
|
}, [id]);
|
|
@@ -2081,42 +2081,42 @@ function useRightRailPanel(panel) {
|
|
|
2081
2081
|
const sublabel = panel?.sublabel;
|
|
2082
2082
|
const badgeCount = panel?.badge?.count;
|
|
2083
2083
|
const badgeTone = panel?.badge?.tone;
|
|
2084
|
-
const initial =
|
|
2085
|
-
|
|
2084
|
+
const initial = React122.useRef({ label: label2, icon });
|
|
2085
|
+
React122.useEffect(() => {
|
|
2086
2086
|
if (!id || !Component2) return;
|
|
2087
2087
|
register({ id, label: initial.current.label ?? id, order, Component: Component2, icon: initial.current.icon });
|
|
2088
2088
|
return () => unregister(id);
|
|
2089
2089
|
}, [id, order, Component2, register, unregister]);
|
|
2090
|
-
|
|
2090
|
+
React122.useEffect(() => {
|
|
2091
2091
|
if (!id) return;
|
|
2092
2092
|
updateMeta(id, { label: label2, icon, iconBare, trailing, sublabel });
|
|
2093
2093
|
}, [id, label2, icon, iconBare, trailing, sublabel, updateMeta]);
|
|
2094
|
-
|
|
2094
|
+
React122.useEffect(() => {
|
|
2095
2095
|
if (!id) return;
|
|
2096
2096
|
updateBadge(id, badgeCount !== void 0 ? { count: badgeCount, tone: badgeTone } : void 0);
|
|
2097
2097
|
}, [id, badgeCount, badgeTone, updateBadge]);
|
|
2098
2098
|
}
|
|
2099
|
-
var RightRailActionsSlotContext =
|
|
2099
|
+
var RightRailActionsSlotContext = React122.createContext(null);
|
|
2100
2100
|
var RightRailActionsSlotProvider = RightRailActionsSlotContext.Provider;
|
|
2101
2101
|
function RightRailActions({ children }) {
|
|
2102
|
-
const slot =
|
|
2102
|
+
const slot = React122.useContext(RightRailActionsSlotContext);
|
|
2103
2103
|
if (slot) return createPortal(children, slot);
|
|
2104
2104
|
return /* @__PURE__ */ jsx("div", { className: "flex items-center justify-end gap-0.5 px-2 pt-1.5", children });
|
|
2105
2105
|
}
|
|
2106
|
-
var RightRailLeadingSlotContext =
|
|
2106
|
+
var RightRailLeadingSlotContext = React122.createContext(null);
|
|
2107
2107
|
var RightRailLeadingSlotProvider = RightRailLeadingSlotContext.Provider;
|
|
2108
2108
|
function RightRailLeading({ children }) {
|
|
2109
|
-
const slot =
|
|
2109
|
+
const slot = React122.useContext(RightRailLeadingSlotContext);
|
|
2110
2110
|
if (slot) return createPortal(children, slot);
|
|
2111
2111
|
return /* @__PURE__ */ jsx("div", { className: "flex items-center gap-0.5 px-2 pt-1.5", children });
|
|
2112
2112
|
}
|
|
2113
2113
|
function useRightRailReselect(id, handler) {
|
|
2114
2114
|
const reselects = useRightRailStore((s) => s.reselects);
|
|
2115
2115
|
const reselectId = useRightRailStore((s) => s.reselectId);
|
|
2116
|
-
const ref =
|
|
2116
|
+
const ref = React122.useRef(handler);
|
|
2117
2117
|
ref.current = handler;
|
|
2118
|
-
const seen =
|
|
2119
|
-
|
|
2118
|
+
const seen = React122.useRef(reselects);
|
|
2119
|
+
React122.useEffect(() => {
|
|
2120
2120
|
if (reselects === seen.current) return;
|
|
2121
2121
|
seen.current = reselects;
|
|
2122
2122
|
if (reselectId === id) ref.current();
|
|
@@ -2133,9 +2133,9 @@ function useRightRailDrill(drill) {
|
|
|
2133
2133
|
const avatarName = drill?.avatar?.name;
|
|
2134
2134
|
const avatarSrc = drill?.avatar?.src;
|
|
2135
2135
|
const avatarFace = drill?.avatar?.Face;
|
|
2136
|
-
const backRef =
|
|
2136
|
+
const backRef = React122.useRef(drill?.back);
|
|
2137
2137
|
backRef.current = drill?.back;
|
|
2138
|
-
|
|
2138
|
+
React122.useEffect(() => {
|
|
2139
2139
|
if (!title) return;
|
|
2140
2140
|
setDrill({
|
|
2141
2141
|
title,
|
|
@@ -2250,7 +2250,7 @@ function buildPersonaGuidance() {
|
|
|
2250
2250
|
}
|
|
2251
2251
|
function useRegisterStaff(staff) {
|
|
2252
2252
|
const setAgent = useAgentStore((s) => s.setAgent);
|
|
2253
|
-
|
|
2253
|
+
React122__default.useEffect(() => {
|
|
2254
2254
|
if (staff && staff.length > 1) {
|
|
2255
2255
|
console.warn(
|
|
2256
2256
|
`[fayz] chat.staff lists ${staff.length} agents; an app has one. Using "${soleAgent(staff)?.name}" and ignoring the rest \u2014 see chat.agent.`
|
|
@@ -2283,7 +2283,7 @@ function AssistantInvite({ className, ...def }) {
|
|
|
2283
2283
|
const { id, persona, headline, pitch, description, placeholder, auto } = def;
|
|
2284
2284
|
const suggestions = def.suggestions;
|
|
2285
2285
|
const suggestionKey = JSON.stringify(suggestions ?? []);
|
|
2286
|
-
|
|
2286
|
+
React122.useEffect(() => {
|
|
2287
2287
|
if (!hasAssistant) return;
|
|
2288
2288
|
setInvite({
|
|
2289
2289
|
id,
|
|
@@ -2297,11 +2297,11 @@ function AssistantInvite({ className, ...def }) {
|
|
|
2297
2297
|
});
|
|
2298
2298
|
return () => setInvite(null, id);
|
|
2299
2299
|
}, [hasAssistant, id, persona, headline, pitch, description, placeholder, auto, suggestionKey, setInvite]);
|
|
2300
|
-
const anchorRef =
|
|
2301
|
-
const [box, setBox] =
|
|
2300
|
+
const anchorRef = React122.useRef(null);
|
|
2301
|
+
const [box, setBox] = React122.useState(null);
|
|
2302
2302
|
const docked = stage === "dock" && !railOpen && hasAssistant;
|
|
2303
2303
|
const showing = hasAssistant && (stage === "hero" || docked);
|
|
2304
|
-
|
|
2304
|
+
React122.useEffect(() => {
|
|
2305
2305
|
if (!showing) return;
|
|
2306
2306
|
const el = anchorRef.current;
|
|
2307
2307
|
if (!el) return;
|
|
@@ -2322,7 +2322,7 @@ function AssistantInvite({ className, ...def }) {
|
|
|
2322
2322
|
}, [showing]);
|
|
2323
2323
|
const setDockBox = useAssistantInviteStore((s) => s.setDockBox);
|
|
2324
2324
|
const wide = useWideViewport();
|
|
2325
|
-
|
|
2325
|
+
React122.useEffect(() => {
|
|
2326
2326
|
if (!docked || !wide || !box) {
|
|
2327
2327
|
setDockBox(null);
|
|
2328
2328
|
return;
|
|
@@ -2336,7 +2336,7 @@ function AssistantInvite({ className, ...def }) {
|
|
|
2336
2336
|
function useAsk() {
|
|
2337
2337
|
const queuePrompt = useChatStore((s) => s.queuePrompt);
|
|
2338
2338
|
const dismiss = useAssistantInviteStore((s) => s.dismiss);
|
|
2339
|
-
return
|
|
2339
|
+
return React122.useCallback(
|
|
2340
2340
|
(text2) => {
|
|
2341
2341
|
const trimmed = text2.trim();
|
|
2342
2342
|
if (!trimmed) return;
|
|
@@ -2354,9 +2354,9 @@ function InviteHero({
|
|
|
2354
2354
|
const { t } = useTranslation$1();
|
|
2355
2355
|
const user = useAuthStore((s) => s.user);
|
|
2356
2356
|
const ask = useAsk();
|
|
2357
|
-
const [draft, setDraft] =
|
|
2357
|
+
const [draft, setDraft] = React122.useState("");
|
|
2358
2358
|
const name = (user?.fullName || user?.email || "").split(/[\s@]/)[0];
|
|
2359
|
-
|
|
2359
|
+
React122.useEffect(() => {
|
|
2360
2360
|
const onKey = (event) => {
|
|
2361
2361
|
if (event.key === "Escape") onDismiss();
|
|
2362
2362
|
};
|
|
@@ -2418,8 +2418,8 @@ function InviteHero({
|
|
|
2418
2418
|
);
|
|
2419
2419
|
}
|
|
2420
2420
|
function useMorphIn(skip = false) {
|
|
2421
|
-
const [entered, setEntered] =
|
|
2422
|
-
|
|
2421
|
+
const [entered, setEntered] = React122.useState(() => skip || prefersReducedMotion());
|
|
2422
|
+
React122.useEffect(() => {
|
|
2423
2423
|
if (entered) return;
|
|
2424
2424
|
let second = 0;
|
|
2425
2425
|
const first = requestAnimationFrame(() => {
|
|
@@ -2438,10 +2438,10 @@ function prefersReducedMotion() {
|
|
|
2438
2438
|
var lastDockExit = null;
|
|
2439
2439
|
var RESUME_WINDOW_MS = 700;
|
|
2440
2440
|
function useWideViewport() {
|
|
2441
|
-
const [wide, setWide] =
|
|
2441
|
+
const [wide, setWide] = React122.useState(
|
|
2442
2442
|
() => typeof window !== "undefined" && !!window.matchMedia?.("(min-width: 768px)").matches
|
|
2443
2443
|
);
|
|
2444
|
-
|
|
2444
|
+
React122.useEffect(() => {
|
|
2445
2445
|
const query = window.matchMedia?.("(min-width: 768px)");
|
|
2446
2446
|
if (!query) return;
|
|
2447
2447
|
const sync = () => setWide(query.matches);
|
|
@@ -2472,21 +2472,21 @@ function InviteDock({ def, left, maxWidth }) {
|
|
|
2472
2472
|
const setOpen = useChatStore((s) => s.setOpen);
|
|
2473
2473
|
const railOpen = useRightRailStore((s) => s.open);
|
|
2474
2474
|
const railWidth = useRightRailStore((s) => s.width);
|
|
2475
|
-
const [draft, setDraft] =
|
|
2476
|
-
const resumed =
|
|
2475
|
+
const [draft, setDraft] = React122.useState("");
|
|
2476
|
+
const resumed = React122.useRef(
|
|
2477
2477
|
!!lastDockExit && lastDockExit.id === def.id && Date.now() - lastDockExit.at < RESUME_WINDOW_MS
|
|
2478
2478
|
).current;
|
|
2479
|
-
|
|
2479
|
+
React122.useEffect(() => () => {
|
|
2480
2480
|
lastDockExit = { id: def.id, at: Date.now() };
|
|
2481
2481
|
}, [def.id]);
|
|
2482
2482
|
const entered = useMorphIn(resumed);
|
|
2483
2483
|
const width = Math.min(maxWidth, DOCK_MAX_WIDTH);
|
|
2484
|
-
const mountGeo =
|
|
2484
|
+
const mountGeo = React122.useRef({ left, width }).current;
|
|
2485
2485
|
const morph = morphStyles({ left: mountGeo.left, width: mountGeo.width }, railOpen, railWidth);
|
|
2486
|
-
const [settled, setSettled] =
|
|
2486
|
+
const [settled, setSettled] = React122.useState(resumed);
|
|
2487
2487
|
const geoLeft = settled ? left : mountGeo.left;
|
|
2488
2488
|
const geoWidth = settled ? width : mountGeo.width;
|
|
2489
|
-
|
|
2489
|
+
React122.useEffect(() => {
|
|
2490
2490
|
if (!entered || settled) return;
|
|
2491
2491
|
const id = setTimeout(() => setSettled(true), MORPH_MS + 60);
|
|
2492
2492
|
return () => clearTimeout(id);
|
|
@@ -2632,7 +2632,7 @@ function MorphBackPill() {
|
|
|
2632
2632
|
const railWidth = useRightRailStore((s) => s.width);
|
|
2633
2633
|
const { t } = useTranslation$1();
|
|
2634
2634
|
const collapsed = useMorphIn();
|
|
2635
|
-
|
|
2635
|
+
React122.useEffect(() => {
|
|
2636
2636
|
if (prefersReducedMotion()) {
|
|
2637
2637
|
endLeave();
|
|
2638
2638
|
return;
|
|
@@ -4546,12 +4546,12 @@ function detectActivePluginId(runtime) {
|
|
|
4546
4546
|
function useAITools() {
|
|
4547
4547
|
const runtime = usePluginRuntimeOptional();
|
|
4548
4548
|
const access = useAccessOptional();
|
|
4549
|
-
const surfaceVersion =
|
|
4549
|
+
const surfaceVersion = React122.useSyncExternalStore(subscribeSurfaces, getSurfaceVersion, getSurfaceVersion);
|
|
4550
4550
|
const features = usePermissionsStore((s) => s.features);
|
|
4551
4551
|
const profiles = usePermissionsStore((s) => s.profiles);
|
|
4552
4552
|
const hasSystem = useSystemPermission();
|
|
4553
4553
|
const canManagePermissions = hasSystem("manage_permissions");
|
|
4554
|
-
return
|
|
4554
|
+
return React122.useMemo(() => {
|
|
4555
4555
|
const hasPermission = runtime?.context.hasPermission;
|
|
4556
4556
|
const can = access.can;
|
|
4557
4557
|
const verticalId = runtime?.context.tenant?.verticalId;
|
|
@@ -5559,8 +5559,8 @@ function loadCatalog() {
|
|
|
5559
5559
|
return catalogPromise;
|
|
5560
5560
|
}
|
|
5561
5561
|
function useConnectorCatalog() {
|
|
5562
|
-
const [catalog, setCatalog] =
|
|
5563
|
-
|
|
5562
|
+
const [catalog, setCatalog] = React122__default.useState(null);
|
|
5563
|
+
React122__default.useEffect(() => {
|
|
5564
5564
|
let cancelled = false;
|
|
5565
5565
|
void loadCatalog().then((list) => {
|
|
5566
5566
|
if (!cancelled) setCatalog(list);
|
|
@@ -5584,7 +5584,7 @@ function refreshConnectors() {
|
|
|
5584
5584
|
_revisionListeners.forEach((listener) => listener());
|
|
5585
5585
|
}
|
|
5586
5586
|
function useConnectorsRevision() {
|
|
5587
|
-
return
|
|
5587
|
+
return React122__default.useSyncExternalStore(
|
|
5588
5588
|
(listener) => {
|
|
5589
5589
|
_revisionListeners.add(listener);
|
|
5590
5590
|
return () => _revisionListeners.delete(listener);
|
|
@@ -5603,11 +5603,11 @@ function loadGrants(key, fetcher) {
|
|
|
5603
5603
|
}
|
|
5604
5604
|
function useInstalledModuleIds() {
|
|
5605
5605
|
const runtime = usePluginRuntimeOptional();
|
|
5606
|
-
return
|
|
5606
|
+
return React122__default.useMemo(() => (runtime?.plugins ?? []).map((p) => p.id), [runtime]);
|
|
5607
5607
|
}
|
|
5608
5608
|
function useInstalledDefinitions(hostPluginId) {
|
|
5609
5609
|
const runtime = usePluginRuntimeOptional();
|
|
5610
|
-
return
|
|
5610
|
+
return React122__default.useMemo(() => {
|
|
5611
5611
|
const byHost = runtime?.connectorsByHost;
|
|
5612
5612
|
if (!byHost) return [];
|
|
5613
5613
|
if (hostPluginId) return byHost.get(hostPluginId) ?? [];
|
|
@@ -5620,12 +5620,12 @@ function useConnectors(options = {}) {
|
|
|
5620
5620
|
const catalog = useConnectorCatalog();
|
|
5621
5621
|
const tenant = useTenantOptional();
|
|
5622
5622
|
const tenantId2 = tenant?.org?.id;
|
|
5623
|
-
const connection =
|
|
5624
|
-
const [installed, setInstalled] =
|
|
5625
|
-
const [grants, setGrants] =
|
|
5626
|
-
const [error, setError] =
|
|
5623
|
+
const connection = React122__default.useMemo(() => resolveFayzAgentConnection(), []);
|
|
5624
|
+
const [installed, setInstalled] = React122__default.useState(null);
|
|
5625
|
+
const [grants, setGrants] = React122__default.useState(null);
|
|
5626
|
+
const [error, setError] = React122__default.useState(null);
|
|
5627
5627
|
const nonce = useConnectorsRevision();
|
|
5628
|
-
const call2 =
|
|
5628
|
+
const call2 = React122__default.useCallback(
|
|
5629
5629
|
async (path, init) => {
|
|
5630
5630
|
if (!connection) throw new Error("Este app n\xE3o est\xE1 ligado a um projeto Fayz.");
|
|
5631
5631
|
const supabase = getFayzSupabaseClientOptional();
|
|
@@ -5645,7 +5645,7 @@ function useConnectors(options = {}) {
|
|
|
5645
5645
|
},
|
|
5646
5646
|
[connection]
|
|
5647
5647
|
);
|
|
5648
|
-
|
|
5648
|
+
React122__default.useEffect(() => {
|
|
5649
5649
|
let cancelled = false;
|
|
5650
5650
|
void loadConnectorStatuses(definitions, tenantId2).then((list) => {
|
|
5651
5651
|
if (!cancelled) setInstalled(list);
|
|
@@ -5654,7 +5654,7 @@ function useConnectors(options = {}) {
|
|
|
5654
5654
|
cancelled = true;
|
|
5655
5655
|
};
|
|
5656
5656
|
}, [definitions, tenantId2, nonce]);
|
|
5657
|
-
|
|
5657
|
+
React122__default.useEffect(() => {
|
|
5658
5658
|
if (!includeGrants || !connection || !tenantId2) {
|
|
5659
5659
|
setGrants(includeGrants ? null : []);
|
|
5660
5660
|
return;
|
|
@@ -5678,7 +5678,7 @@ function useConnectors(options = {}) {
|
|
|
5678
5678
|
cancelled = true;
|
|
5679
5679
|
};
|
|
5680
5680
|
}, [call2, tenantId2, includeGrants, connection, nonce]);
|
|
5681
|
-
const revokeGrant =
|
|
5681
|
+
const revokeGrant = React122__default.useCallback(
|
|
5682
5682
|
async (connector) => {
|
|
5683
5683
|
const response = await call2(`/${connector.id}`, { method: "DELETE" });
|
|
5684
5684
|
if (!response.ok) {
|
|
@@ -5691,7 +5691,7 @@ function useConnectors(options = {}) {
|
|
|
5691
5691
|
[call2]
|
|
5692
5692
|
);
|
|
5693
5693
|
const waitingGrants = includeGrants && !!connection && !!tenantId2 && grants === null;
|
|
5694
|
-
const connectors =
|
|
5694
|
+
const connectors = React122__default.useMemo(() => {
|
|
5695
5695
|
if (installed === null || waitingGrants) return null;
|
|
5696
5696
|
return buildConnectorList({
|
|
5697
5697
|
installed,
|
|
@@ -5932,9 +5932,9 @@ function ConnectorMark({
|
|
|
5932
5932
|
connector,
|
|
5933
5933
|
size = "md"
|
|
5934
5934
|
}) {
|
|
5935
|
-
const candidates =
|
|
5936
|
-
const [attempt, setAttempt] =
|
|
5937
|
-
|
|
5935
|
+
const candidates = React122__default.useMemo(() => markCandidates(connector), [connector.logoUrl, connector.name]);
|
|
5936
|
+
const [attempt, setAttempt] = React122__default.useState(0);
|
|
5937
|
+
React122__default.useEffect(() => setAttempt(0), [connector.id]);
|
|
5938
5938
|
const box = size === "sm" ? "h-9 w-9" : "h-10 w-10";
|
|
5939
5939
|
const glyph = size === "sm" ? "h-4 w-4" : "h-5 w-5";
|
|
5940
5940
|
if (connector.builtIn) {
|
|
@@ -7563,9 +7563,9 @@ function prefersReducedMotion2() {
|
|
|
7563
7563
|
return typeof window !== "undefined" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
|
|
7564
7564
|
}
|
|
7565
7565
|
function TypewriterText({ text: text2, speed = 26, onDone }) {
|
|
7566
|
-
const [displayed, setDisplayed] =
|
|
7567
|
-
const indexRef =
|
|
7568
|
-
|
|
7566
|
+
const [displayed, setDisplayed] = React122.useState("");
|
|
7567
|
+
const indexRef = React122.useRef(0);
|
|
7568
|
+
React122.useEffect(() => {
|
|
7569
7569
|
if (prefersReducedMotion2()) {
|
|
7570
7570
|
setDisplayed(text2);
|
|
7571
7571
|
onDone?.();
|
|
@@ -7642,15 +7642,15 @@ function ChatFab({ className, apiEndpoint, systemPrompt, agent, voice }) {
|
|
|
7642
7642
|
const { contextualSuggestions } = useAITools();
|
|
7643
7643
|
const { sendMessage } = useChat({ apiEndpoint, systemPrompt, agent });
|
|
7644
7644
|
const { t } = useTranslation$1();
|
|
7645
|
-
const [phase, setPhase] =
|
|
7646
|
-
const [activeSuggestion, setActiveSuggestion] =
|
|
7647
|
-
const timersRef =
|
|
7648
|
-
const prevSuggestionRef =
|
|
7649
|
-
const [greeting, setGreeting] =
|
|
7650
|
-
const greetTimerRef =
|
|
7651
|
-
|
|
7645
|
+
const [phase, setPhase] = React122.useState("idle");
|
|
7646
|
+
const [activeSuggestion, setActiveSuggestion] = React122.useState(null);
|
|
7647
|
+
const timersRef = React122.useRef([]);
|
|
7648
|
+
const prevSuggestionRef = React122.useRef(null);
|
|
7649
|
+
const [greeting, setGreeting] = React122.useState(false);
|
|
7650
|
+
const greetTimerRef = React122.useRef(0);
|
|
7651
|
+
React122.useEffect(() => () => window.clearTimeout(greetTimerRef.current), []);
|
|
7652
7652
|
const hasFace = !!host?.AvatarComponent;
|
|
7653
|
-
|
|
7653
|
+
React122.useEffect(ensureStyles, []);
|
|
7654
7654
|
const clearTimers = () => {
|
|
7655
7655
|
timersRef.current.forEach(clearTimeout);
|
|
7656
7656
|
timersRef.current = [];
|
|
@@ -7663,10 +7663,10 @@ function ChatFab({ className, apiEndpoint, systemPrompt, agent, voice }) {
|
|
|
7663
7663
|
const invited = useAssistantInviteStore((s) => !!s.invite && s.stage === "dock");
|
|
7664
7664
|
const dockOnScreen = useAssistantInviteStore((s) => !!s.dockBox);
|
|
7665
7665
|
const morphingBack = useAssistantInviteStore((s) => !!s.leaving);
|
|
7666
|
-
const [wide, setWide] =
|
|
7666
|
+
const [wide, setWide] = React122.useState(
|
|
7667
7667
|
() => typeof window !== "undefined" && !!window.matchMedia?.("(min-width: 768px)").matches
|
|
7668
7668
|
);
|
|
7669
|
-
|
|
7669
|
+
React122.useEffect(() => {
|
|
7670
7670
|
const query = window.matchMedia?.("(min-width: 768px)");
|
|
7671
7671
|
if (!query) return;
|
|
7672
7672
|
const sync = () => setWide(query.matches);
|
|
@@ -7675,7 +7675,7 @@ function ChatFab({ className, apiEndpoint, systemPrompt, agent, voice }) {
|
|
|
7675
7675
|
return () => query.removeEventListener("change", sync);
|
|
7676
7676
|
}, []);
|
|
7677
7677
|
const teaserAllowed = !hasMessages && !activity && !invited && !teaserDismissed() && teaserShownCount() < TEASER_MAX_PER_SESSION;
|
|
7678
|
-
|
|
7678
|
+
React122.useEffect(() => {
|
|
7679
7679
|
if (expanded || !topSuggestion || !topLabel || !teaserAllowed || teaserSeen().includes(topLabel)) {
|
|
7680
7680
|
if (phase !== "idle") {
|
|
7681
7681
|
clearTimers();
|
|
@@ -7706,14 +7706,14 @@ function ChatFab({ className, apiEndpoint, systemPrompt, agent, voice }) {
|
|
|
7706
7706
|
}, 9e3);
|
|
7707
7707
|
return clearTimers;
|
|
7708
7708
|
}, [topLabel, expanded, teaserAllowed]);
|
|
7709
|
-
|
|
7709
|
+
React122.useEffect(() => {
|
|
7710
7710
|
if (expanded && phase !== "idle") {
|
|
7711
7711
|
clearTimers();
|
|
7712
7712
|
setPhase("idle");
|
|
7713
7713
|
}
|
|
7714
7714
|
}, [expanded]);
|
|
7715
|
-
const [entrance, setEntrance] =
|
|
7716
|
-
|
|
7715
|
+
const [entrance, setEntrance] = React122.useState("pending");
|
|
7716
|
+
React122.useEffect(() => {
|
|
7717
7717
|
if (!currentOrg || entrance !== "pending") return;
|
|
7718
7718
|
if (prefersReducedMotion2()) {
|
|
7719
7719
|
setEntrance("done");
|
|
@@ -7723,9 +7723,9 @@ function ChatFab({ className, apiEndpoint, systemPrompt, agent, voice }) {
|
|
|
7723
7723
|
const timer = setTimeout(() => setEntrance("done"), 1600);
|
|
7724
7724
|
return () => clearTimeout(timer);
|
|
7725
7725
|
}, [currentOrg, entrance]);
|
|
7726
|
-
const [poppingBack, setPoppingBack] =
|
|
7727
|
-
const wasMorphing =
|
|
7728
|
-
|
|
7726
|
+
const [poppingBack, setPoppingBack] = React122.useState(false);
|
|
7727
|
+
const wasMorphing = React122.useRef(false);
|
|
7728
|
+
React122.useEffect(() => {
|
|
7729
7729
|
const was = wasMorphing.current;
|
|
7730
7730
|
wasMorphing.current = morphingBack;
|
|
7731
7731
|
if (!was || morphingBack || prefersReducedMotion2()) return;
|
|
@@ -8023,7 +8023,7 @@ function ChatFab({ className, apiEndpoint, systemPrompt, agent, voice }) {
|
|
|
8023
8023
|
var MAX_SUGGESTIONS = 5;
|
|
8024
8024
|
function ChatSuggestions({ suggestions, onSelect, onDismiss, compact }) {
|
|
8025
8025
|
const { t } = useTranslation$1();
|
|
8026
|
-
const [open, setOpen] =
|
|
8026
|
+
const [open, setOpen] = React122.useState(true);
|
|
8027
8027
|
const visible = suggestions.slice(0, compact ? 3 : MAX_SUGGESTIONS);
|
|
8028
8028
|
if (!visible.length) return null;
|
|
8029
8029
|
return /* @__PURE__ */ jsxs(
|
|
@@ -8102,8 +8102,8 @@ function SuggestionRow({
|
|
|
8102
8102
|
detail,
|
|
8103
8103
|
onSelect
|
|
8104
8104
|
}) {
|
|
8105
|
-
const labelRef =
|
|
8106
|
-
const [showDetail, setShowDetail] =
|
|
8105
|
+
const labelRef = React122.useRef(null);
|
|
8106
|
+
const [showDetail, setShowDetail] = React122.useState(false);
|
|
8107
8107
|
const evaluate = () => {
|
|
8108
8108
|
const el = labelRef.current;
|
|
8109
8109
|
const clipped = !!el && el.scrollWidth > el.clientWidth + 1;
|
|
@@ -8197,8 +8197,8 @@ function ChatToolsPanel({ toolGroups, onClose }) {
|
|
|
8197
8197
|
}
|
|
8198
8198
|
function AutoApprovalsSection() {
|
|
8199
8199
|
const { t } = useTranslation$1();
|
|
8200
|
-
const [rules, setRules] =
|
|
8201
|
-
|
|
8200
|
+
const [rules, setRules] = React122.useState(() => listAutoApprovals());
|
|
8201
|
+
React122.useEffect(() => subscribeAutoApprovals(() => setRules(listAutoApprovals())), []);
|
|
8202
8202
|
if (!rules.length) return null;
|
|
8203
8203
|
return /* @__PURE__ */ jsxs("div", { className: "border-b border-border/40 px-3 py-2.5", children: [
|
|
8204
8204
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 px-1 pb-1.5", children: [
|
|
@@ -8251,14 +8251,14 @@ function bucketOf(iso) {
|
|
|
8251
8251
|
var ORDER = ["today", "yesterday", "week", "older"];
|
|
8252
8252
|
function ChatHistory({ conversations, activeId, onSelect }) {
|
|
8253
8253
|
const { t } = useTranslation$1();
|
|
8254
|
-
const [query, setQuery] =
|
|
8254
|
+
const [query, setQuery] = React122.useState("");
|
|
8255
8255
|
const mine = conversations;
|
|
8256
|
-
const filtered =
|
|
8256
|
+
const filtered = React122.useMemo(() => {
|
|
8257
8257
|
const needle = query.trim().toLowerCase();
|
|
8258
8258
|
if (!needle) return mine;
|
|
8259
8259
|
return mine.filter((c) => (c.title ?? "").toLowerCase().includes(needle));
|
|
8260
8260
|
}, [mine, query]);
|
|
8261
|
-
const groups =
|
|
8261
|
+
const groups = React122.useMemo(() => {
|
|
8262
8262
|
const map = /* @__PURE__ */ new Map();
|
|
8263
8263
|
for (const conversation of filtered) {
|
|
8264
8264
|
const bucket = bucketOf(conversation.updatedAt);
|
|
@@ -8385,7 +8385,7 @@ function TourCoachCard() {
|
|
|
8385
8385
|
const lastOutcome = useTourStore((s) => s.lastOutcome);
|
|
8386
8386
|
const stop = useTourStore((s) => s.stop);
|
|
8387
8387
|
const restart = useTourStore((s) => s.restart);
|
|
8388
|
-
const [dismissedId, setDismissedId] =
|
|
8388
|
+
const [dismissedId, setDismissedId] = React122.useState(null);
|
|
8389
8389
|
const pTitle = usePracticeStore((s) => s.title);
|
|
8390
8390
|
const pSteps = usePracticeStore((s) => s.steps);
|
|
8391
8391
|
const pDone = usePracticeStore((s) => s.done);
|
|
@@ -8456,8 +8456,8 @@ function AssistantRecordingView({ activity }) {
|
|
|
8456
8456
|
const live = activity.state === "running" || activity.state === "paused";
|
|
8457
8457
|
const running = activity.state === "running";
|
|
8458
8458
|
const actions = activity.actions ?? [];
|
|
8459
|
-
const [acknowledged, setAcknowledged] =
|
|
8460
|
-
|
|
8459
|
+
const [acknowledged, setAcknowledged] = React122.useState(false);
|
|
8460
|
+
React122.useEffect(() => setAcknowledged(false), [activity.id, activity.state]);
|
|
8461
8461
|
const withheld = pending2 && !!activity.confirm && !acknowledged;
|
|
8462
8462
|
const primary = actions.filter((a) => a.intent !== "discard");
|
|
8463
8463
|
const discard = actions.find((a) => a.intent === "discard");
|
|
@@ -8673,10 +8673,10 @@ function RightRailPage({
|
|
|
8673
8673
|
const closePage = useRightRailStore((s) => s.closePage);
|
|
8674
8674
|
const active2 = hosted && open;
|
|
8675
8675
|
const pageOpen = useRightRailStore((s) => s.pageOpen);
|
|
8676
|
-
const onCloseRef =
|
|
8676
|
+
const onCloseRef = React122.useRef(onClose);
|
|
8677
8677
|
onCloseRef.current = onClose;
|
|
8678
|
-
const claimed =
|
|
8679
|
-
|
|
8678
|
+
const claimed = React122.useRef(false);
|
|
8679
|
+
React122.useEffect(() => {
|
|
8680
8680
|
if (!active2) return;
|
|
8681
8681
|
showPage();
|
|
8682
8682
|
claimed.current = true;
|
|
@@ -8685,7 +8685,7 @@ function RightRailPage({
|
|
|
8685
8685
|
closePage();
|
|
8686
8686
|
};
|
|
8687
8687
|
}, [active2, showPage, closePage]);
|
|
8688
|
-
|
|
8688
|
+
React122.useEffect(() => {
|
|
8689
8689
|
if (!claimed.current) return;
|
|
8690
8690
|
if (!useRightRailStore.getState().pageOpen) onCloseRef.current();
|
|
8691
8691
|
}, [pageOpen]);
|
|
@@ -8888,15 +8888,15 @@ function ConnectorSyncActions({
|
|
|
8888
8888
|
actions,
|
|
8889
8889
|
onRan
|
|
8890
8890
|
}) {
|
|
8891
|
-
const [running, setRunning] =
|
|
8892
|
-
const [open, setOpen] =
|
|
8893
|
-
const [pending2, setPending] =
|
|
8894
|
-
const [hidden, setHidden] =
|
|
8895
|
-
const [queued, setQueued] =
|
|
8896
|
-
const [nonce, setNonce] =
|
|
8897
|
-
const [expanded, setExpanded] =
|
|
8898
|
-
const [resolved, setResolved] =
|
|
8899
|
-
|
|
8891
|
+
const [running, setRunning] = React122__default.useState(null);
|
|
8892
|
+
const [open, setOpen] = React122__default.useState(null);
|
|
8893
|
+
const [pending2, setPending] = React122__default.useState(null);
|
|
8894
|
+
const [hidden, setHidden] = React122__default.useState(() => /* @__PURE__ */ new Set());
|
|
8895
|
+
const [queued, setQueued] = React122__default.useState({});
|
|
8896
|
+
const [nonce, setNonce] = React122__default.useState(0);
|
|
8897
|
+
const [expanded, setExpanded] = React122__default.useState(false);
|
|
8898
|
+
const [resolved, setResolved] = React122__default.useState(false);
|
|
8899
|
+
React122__default.useEffect(() => {
|
|
8900
8900
|
let cancelled = false;
|
|
8901
8901
|
setResolved(false);
|
|
8902
8902
|
void Promise.all(
|
|
@@ -9081,10 +9081,10 @@ function formatRelative(iso, t) {
|
|
|
9081
9081
|
}
|
|
9082
9082
|
function useConnectorRuns(connector) {
|
|
9083
9083
|
const listRuns = connector.definition?.listRuns;
|
|
9084
|
-
const [runs, setRuns] =
|
|
9085
|
-
const [loading, setLoading] =
|
|
9086
|
-
const [nonce, setNonce] =
|
|
9087
|
-
|
|
9084
|
+
const [runs, setRuns] = React122__default.useState([]);
|
|
9085
|
+
const [loading, setLoading] = React122__default.useState(!!listRuns);
|
|
9086
|
+
const [nonce, setNonce] = React122__default.useState(0);
|
|
9087
|
+
React122__default.useEffect(() => {
|
|
9088
9088
|
if (!listRuns) {
|
|
9089
9089
|
setRuns([]);
|
|
9090
9090
|
setLoading(false);
|
|
@@ -9106,7 +9106,7 @@ function useConnectorRuns(connector) {
|
|
|
9106
9106
|
return {
|
|
9107
9107
|
runs,
|
|
9108
9108
|
loading,
|
|
9109
|
-
reload:
|
|
9109
|
+
reload: React122__default.useCallback(() => setNonce((n) => n + 1), []),
|
|
9110
9110
|
failing: isFailing(runs)
|
|
9111
9111
|
};
|
|
9112
9112
|
}
|
|
@@ -9206,7 +9206,7 @@ function RunFailure({ run }) {
|
|
|
9206
9206
|
),
|
|
9207
9207
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: t("connectors.runs.seeDetails") })
|
|
9208
9208
|
] }),
|
|
9209
|
-
facts.length > 0 && /* @__PURE__ */ jsx("dl", { className: "grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 border-t border-border px-2 py-2 text-[11px] leading-relaxed", children: facts.map(([label2, value]) => /* @__PURE__ */ jsxs(
|
|
9209
|
+
facts.length > 0 && /* @__PURE__ */ jsx("dl", { className: "grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 border-t border-border px-2 py-2 text-[11px] leading-relaxed", children: facts.map(([label2, value]) => /* @__PURE__ */ jsxs(React122__default.Fragment, { children: [
|
|
9210
9210
|
/* @__PURE__ */ jsx("dt", { className: "text-muted-foreground", children: label2 }),
|
|
9211
9211
|
/* @__PURE__ */ jsx("dd", { className: "min-w-0 break-words font-mono text-foreground/80", children: value })
|
|
9212
9212
|
] }, label2)) }),
|
|
@@ -9375,13 +9375,13 @@ function ConnectorSettingsPanel({
|
|
|
9375
9375
|
const { t } = useTranslation$1();
|
|
9376
9376
|
const def = connector.definition;
|
|
9377
9377
|
const settings = def ? connectorSettings(def) : [];
|
|
9378
|
-
const [values, setValues] =
|
|
9378
|
+
const [values, setValues] = React122__default.useState(
|
|
9379
9379
|
() => initialValues(settings, {})
|
|
9380
9380
|
);
|
|
9381
|
-
const [loaded2, setLoaded] =
|
|
9382
|
-
const [saving, setSaving] =
|
|
9383
|
-
const [dirty, setDirty] =
|
|
9384
|
-
|
|
9381
|
+
const [loaded2, setLoaded] = React122__default.useState(false);
|
|
9382
|
+
const [saving, setSaving] = React122__default.useState(false);
|
|
9383
|
+
const [dirty, setDirty] = React122__default.useState(false);
|
|
9384
|
+
React122__default.useEffect(() => {
|
|
9385
9385
|
if (settings.length === 0 || !def?.getSettings) return;
|
|
9386
9386
|
let cancelled = false;
|
|
9387
9387
|
setLoaded(false);
|
|
@@ -9632,13 +9632,13 @@ function ConnectorInstall({
|
|
|
9632
9632
|
}) {
|
|
9633
9633
|
const { t } = useTranslation$1();
|
|
9634
9634
|
const def = connector.definition;
|
|
9635
|
-
const [plane, setPlane] =
|
|
9635
|
+
const [plane, setPlane] = React122__default.useState(
|
|
9636
9636
|
connector.planes.includes("agentic") ? "agentic" : connector.planes[0]
|
|
9637
9637
|
);
|
|
9638
|
-
const [values, setValues] =
|
|
9639
|
-
const secrets =
|
|
9640
|
-
const [busy, setBusy] =
|
|
9641
|
-
|
|
9638
|
+
const [values, setValues] = React122__default.useState({});
|
|
9639
|
+
const secrets = React122__default.useRef({});
|
|
9640
|
+
const [busy, setBusy] = React122__default.useState(null);
|
|
9641
|
+
React122__default.useEffect(() => {
|
|
9642
9642
|
setValues({});
|
|
9643
9643
|
secrets.current = {};
|
|
9644
9644
|
setBusy(null);
|
|
@@ -9679,15 +9679,15 @@ function ConnectorHome({
|
|
|
9679
9679
|
const needsSetup = connector.state === "needs_setup";
|
|
9680
9680
|
const settingsAvailable = hasOperatingSettings(connector);
|
|
9681
9681
|
const runsAvailable = hasRunHistory(connector);
|
|
9682
|
-
const [tab, setTab] =
|
|
9682
|
+
const [tab, setTab] = React122__default.useState(
|
|
9683
9683
|
needsSetup && settingsAvailable ? "settings" : "overview"
|
|
9684
9684
|
);
|
|
9685
|
-
const [busy, setBusy] =
|
|
9685
|
+
const [busy, setBusy] = React122__default.useState(null);
|
|
9686
9686
|
const run = useRunner(setBusy, onChanged);
|
|
9687
|
-
const [values, setValues] =
|
|
9688
|
-
const secrets =
|
|
9687
|
+
const [values, setValues] = React122__default.useState({});
|
|
9688
|
+
const secrets = React122__default.useRef({});
|
|
9689
9689
|
const runs = useConnectorRuns(connector);
|
|
9690
|
-
|
|
9690
|
+
React122__default.useEffect(() => {
|
|
9691
9691
|
setTab(needsSetup && settingsAvailable ? "settings" : "overview");
|
|
9692
9692
|
setBusy(null);
|
|
9693
9693
|
setValues({});
|
|
@@ -9777,7 +9777,7 @@ function ConnectorHome({
|
|
|
9777
9777
|
}
|
|
9778
9778
|
function useRunner(setBusy, onChanged) {
|
|
9779
9779
|
const { t } = useTranslation$1();
|
|
9780
|
-
return
|
|
9780
|
+
return React122__default.useCallback(
|
|
9781
9781
|
async (kind, fn, okMessage) => {
|
|
9782
9782
|
setBusy(kind);
|
|
9783
9783
|
try {
|
|
@@ -9893,7 +9893,7 @@ function ConnectPanel({
|
|
|
9893
9893
|
const sinkMissing = needsSink && !getConnectorCredentialSink();
|
|
9894
9894
|
const secretFieldCount = (def.fields ?? []).filter(isSecretField).length;
|
|
9895
9895
|
const hasStoredCredential = connector.state === "connected" || connector.state === "needs_setup";
|
|
9896
|
-
const [formKey, setFormKey] =
|
|
9896
|
+
const [formKey, setFormKey] = React122__default.useState(0);
|
|
9897
9897
|
if (def.authKind === "oauth") {
|
|
9898
9898
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
9899
9899
|
/* @__PURE__ */ jsx(Note, { children: t("connectors.authorize.oauthOnly") }),
|
|
@@ -10026,7 +10026,7 @@ function GrantRevoke({
|
|
|
10026
10026
|
onRevoke
|
|
10027
10027
|
}) {
|
|
10028
10028
|
const { t } = useTranslation$1();
|
|
10029
|
-
const [revoking, setRevoking] =
|
|
10029
|
+
const [revoking, setRevoking] = React122__default.useState(false);
|
|
10030
10030
|
if (connector.revocable === false) {
|
|
10031
10031
|
return /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t("connectors.partOfApp") });
|
|
10032
10032
|
}
|
|
@@ -10065,14 +10065,14 @@ function ConnectorsPanel({ onClose }) {
|
|
|
10065
10065
|
const { connectors, reload, revokeGrant, agentAvailable, tenantReady } = useConnectors();
|
|
10066
10066
|
const selectedId = useConnectorsSurface((s) => s.selected);
|
|
10067
10067
|
const select = useConnectorsSurface((s) => s.select);
|
|
10068
|
-
const [query, setQuery] =
|
|
10069
|
-
const [failure, setFailure] =
|
|
10070
|
-
const [revoking, setRevoking] =
|
|
10071
|
-
const selected =
|
|
10068
|
+
const [query, setQuery] = React122__default.useState("");
|
|
10069
|
+
const [failure, setFailure] = React122__default.useState(null);
|
|
10070
|
+
const [revoking, setRevoking] = React122__default.useState(null);
|
|
10071
|
+
const selected = React122__default.useMemo(
|
|
10072
10072
|
() => (connectors ?? []).find((c) => c.id === selectedId) ?? null,
|
|
10073
10073
|
[connectors, selectedId]
|
|
10074
10074
|
);
|
|
10075
|
-
const filtered =
|
|
10075
|
+
const filtered = React122__default.useMemo(
|
|
10076
10076
|
() => filterConnectors(connectors ?? [], "outbound", query),
|
|
10077
10077
|
[connectors, query]
|
|
10078
10078
|
);
|
|
@@ -10083,9 +10083,9 @@ function ConnectorsPanel({ onClose }) {
|
|
|
10083
10083
|
back: onClose
|
|
10084
10084
|
} : null
|
|
10085
10085
|
);
|
|
10086
|
-
const closeRef =
|
|
10086
|
+
const closeRef = React122__default.useRef(onClose);
|
|
10087
10087
|
closeRef.current = onClose;
|
|
10088
|
-
|
|
10088
|
+
React122__default.useEffect(() => {
|
|
10089
10089
|
if (hosted && !selectedId) closeRef.current();
|
|
10090
10090
|
}, [hosted, selectedId]);
|
|
10091
10091
|
return /* @__PURE__ */ jsxs("div", { className: "min-h-0 flex-1 overflow-y-auto", children: [
|
|
@@ -10213,20 +10213,20 @@ function useDictation({
|
|
|
10213
10213
|
onInterim
|
|
10214
10214
|
}) {
|
|
10215
10215
|
const resolvedLocale = locale ?? (typeof navigator !== "undefined" ? navigator.language || "pt-BR" : "pt-BR");
|
|
10216
|
-
const [state, setState] =
|
|
10217
|
-
const [error, setError] =
|
|
10218
|
-
const sessionRef =
|
|
10219
|
-
const callbacks =
|
|
10216
|
+
const [state, setState] = React122.useState("idle");
|
|
10217
|
+
const [error, setError] = React122.useState(null);
|
|
10218
|
+
const sessionRef = React122.useRef(null);
|
|
10219
|
+
const callbacks = React122.useRef({ onTranscript, onInterim });
|
|
10220
10220
|
callbacks.current = { onTranscript, onInterim };
|
|
10221
|
-
const supported =
|
|
10221
|
+
const supported = React122.useMemo(
|
|
10222
10222
|
() => isDictationSupported(!!transcribeEndpoint),
|
|
10223
10223
|
[transcribeEndpoint]
|
|
10224
10224
|
);
|
|
10225
|
-
const finish =
|
|
10225
|
+
const finish = React122.useCallback(() => {
|
|
10226
10226
|
sessionRef.current = null;
|
|
10227
10227
|
setState("idle");
|
|
10228
10228
|
}, []);
|
|
10229
|
-
const start =
|
|
10229
|
+
const start = React122.useCallback(() => {
|
|
10230
10230
|
if (sessionRef.current || !supported) return;
|
|
10231
10231
|
stopSpeaking();
|
|
10232
10232
|
setError(null);
|
|
@@ -10247,28 +10247,28 @@ function useDictation({
|
|
|
10247
10247
|
}
|
|
10248
10248
|
);
|
|
10249
10249
|
}, [finish, resolvedLocale, supported, transcribeEndpoint]);
|
|
10250
|
-
const stop =
|
|
10250
|
+
const stop = React122.useCallback(() => {
|
|
10251
10251
|
if (!sessionRef.current) return;
|
|
10252
10252
|
if (transcribeEndpoint) setState("transcribing");
|
|
10253
10253
|
sessionRef.current.stop();
|
|
10254
10254
|
}, [transcribeEndpoint]);
|
|
10255
|
-
const cancel =
|
|
10255
|
+
const cancel = React122.useCallback(() => {
|
|
10256
10256
|
sessionRef.current?.cancel();
|
|
10257
10257
|
sessionRef.current = null;
|
|
10258
10258
|
setState("idle");
|
|
10259
10259
|
setError(null);
|
|
10260
10260
|
}, []);
|
|
10261
|
-
const toggle =
|
|
10261
|
+
const toggle = React122.useCallback(() => {
|
|
10262
10262
|
if (state === "listening" || state === "transcribing") stop();
|
|
10263
10263
|
else start();
|
|
10264
10264
|
}, [state, start, stop]);
|
|
10265
|
-
|
|
10265
|
+
React122.useEffect(() => () => sessionRef.current?.cancel(), []);
|
|
10266
10266
|
return { supported, state, error, start, stop, cancel, toggle, clearError: () => setError(null) };
|
|
10267
10267
|
}
|
|
10268
10268
|
function useMicLevels(active2, bandCount = 28, externalStream) {
|
|
10269
|
-
const levelsRef =
|
|
10270
|
-
const [available, setAvailable] =
|
|
10271
|
-
|
|
10269
|
+
const levelsRef = React122.useRef(new Float32Array(bandCount));
|
|
10270
|
+
const [available, setAvailable] = React122.useState(false);
|
|
10271
|
+
React122.useEffect(() => {
|
|
10272
10272
|
if (!active2) {
|
|
10273
10273
|
levelsRef.current.fill(0);
|
|
10274
10274
|
setAvailable(false);
|
|
@@ -10337,8 +10337,8 @@ var KIND_ICON = {
|
|
|
10337
10337
|
binary: File$1
|
|
10338
10338
|
};
|
|
10339
10339
|
function useFileDrop(enabled, onFiles) {
|
|
10340
|
-
const [dragging, setDragging] =
|
|
10341
|
-
const depth =
|
|
10340
|
+
const [dragging, setDragging] = React122.useState(false);
|
|
10341
|
+
const depth = React122.useRef(0);
|
|
10342
10342
|
const carriesFiles = (event) => Array.from(event.dataTransfer?.types ?? []).includes("Files");
|
|
10343
10343
|
const reset = () => {
|
|
10344
10344
|
depth.current = 0;
|
|
@@ -10398,7 +10398,7 @@ function AttachmentChips({
|
|
|
10398
10398
|
onRemove
|
|
10399
10399
|
}) {
|
|
10400
10400
|
const { t } = useTranslation$1();
|
|
10401
|
-
const [openId, setOpenId] =
|
|
10401
|
+
const [openId, setOpenId] = React122.useState(null);
|
|
10402
10402
|
if (!attachments.length) return null;
|
|
10403
10403
|
const opened = attachments.find((a) => a.id === openId);
|
|
10404
10404
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -10539,8 +10539,8 @@ function ChatComposer({
|
|
|
10539
10539
|
autoFocus
|
|
10540
10540
|
}) {
|
|
10541
10541
|
const { t } = useTranslation$1();
|
|
10542
|
-
const [input, setInput] =
|
|
10543
|
-
const textareaRef =
|
|
10542
|
+
const [input, setInput] = React122.useState("");
|
|
10543
|
+
const textareaRef = React122.useRef(null);
|
|
10544
10544
|
const voiceStartRequested = useChatStore((s) => s.voiceStartRequested);
|
|
10545
10545
|
const consumeVoiceStart = useChatStore((s) => s.consumeVoiceStart);
|
|
10546
10546
|
const draft = useChatStore((s) => s.draft);
|
|
@@ -10553,13 +10553,13 @@ function ChatComposer({
|
|
|
10553
10553
|
const removeAttachment = useChatStore((s) => s.removeAttachment);
|
|
10554
10554
|
const composerMedia = useChatStore((s) => s.composerMedia);
|
|
10555
10555
|
const clearComposerMedia = useChatStore((s) => s.clearComposerMedia);
|
|
10556
|
-
const fileInputRef =
|
|
10556
|
+
const fileInputRef = React122.useRef(null);
|
|
10557
10557
|
const autoSend = voice?.autoSend === true;
|
|
10558
10558
|
const micEnabled = voice?.input !== false;
|
|
10559
10559
|
const canAttach = isConfigured && !blocked && !isStreaming;
|
|
10560
10560
|
const parsing = attachments.some((a) => a.status === "parsing");
|
|
10561
10561
|
const readyAttachments = attachments.filter((a) => a.status === "ready").length;
|
|
10562
|
-
const submit =
|
|
10562
|
+
const submit = React122.useCallback(
|
|
10563
10563
|
(text2) => {
|
|
10564
10564
|
const trimmed = text2.trim();
|
|
10565
10565
|
const media = useChatStore.getState().composerMedia;
|
|
@@ -10589,7 +10589,7 @@ function ChatComposer({
|
|
|
10589
10589
|
}
|
|
10590
10590
|
}
|
|
10591
10591
|
});
|
|
10592
|
-
|
|
10592
|
+
React122.useEffect(() => {
|
|
10593
10593
|
if (!autoFocus) return;
|
|
10594
10594
|
const id = requestAnimationFrame(() => textareaRef.current?.focus());
|
|
10595
10595
|
return () => cancelAnimationFrame(id);
|
|
@@ -10601,7 +10601,7 @@ function ChatComposer({
|
|
|
10601
10601
|
const WAVEFORM_BANDS = 56;
|
|
10602
10602
|
const activity = useAssistantActivity();
|
|
10603
10603
|
const sessionRecording = activity?.kind === "recording" && activity.state === "running";
|
|
10604
|
-
const sessionStream =
|
|
10604
|
+
const sessionStream = React122.useMemo(
|
|
10605
10605
|
() => sessionRecording ? activity?.stream?.() ?? null : null,
|
|
10606
10606
|
[sessionRecording, activity]
|
|
10607
10607
|
);
|
|
@@ -10613,12 +10613,12 @@ function ChatComposer({
|
|
|
10613
10613
|
);
|
|
10614
10614
|
const sessionPause = activity?.actions?.find((a) => a.intent === "pause" || a.intent === "resume");
|
|
10615
10615
|
const sessionOwnsMic = activity?.kind === "recording" && (activity.state === "running" || activity.state === "paused");
|
|
10616
|
-
|
|
10616
|
+
React122.useEffect(() => {
|
|
10617
10617
|
if (!voiceStartRequested) return;
|
|
10618
10618
|
consumeVoiceStart();
|
|
10619
10619
|
if (showMic) dictation.start();
|
|
10620
10620
|
}, [voiceStartRequested, showMic]);
|
|
10621
|
-
|
|
10621
|
+
React122.useEffect(() => {
|
|
10622
10622
|
if (!focusRequested) return;
|
|
10623
10623
|
let frames = 0;
|
|
10624
10624
|
let raf = 0;
|
|
@@ -10635,7 +10635,7 @@ function ChatComposer({
|
|
|
10635
10635
|
raf = requestAnimationFrame(tick);
|
|
10636
10636
|
return () => cancelAnimationFrame(raf);
|
|
10637
10637
|
}, [focusRequested, consumeComposerFocus]);
|
|
10638
|
-
|
|
10638
|
+
React122.useEffect(() => {
|
|
10639
10639
|
if (!draft) return;
|
|
10640
10640
|
setInput(draft);
|
|
10641
10641
|
setDraft("");
|
|
@@ -10645,7 +10645,7 @@ function ChatComposer({
|
|
|
10645
10645
|
el.setSelectionRange(draft.length, draft.length);
|
|
10646
10646
|
}
|
|
10647
10647
|
}, [draft, setDraft]);
|
|
10648
|
-
|
|
10648
|
+
React122.useLayoutEffect(() => {
|
|
10649
10649
|
const el = textareaRef.current;
|
|
10650
10650
|
if (!el) return;
|
|
10651
10651
|
const style = getComputedStyle(el);
|
|
@@ -10848,8 +10848,8 @@ function UploadRequestCard() {
|
|
|
10848
10848
|
const removeUploadFile = useChatStore((s) => s.removeUploadFile);
|
|
10849
10849
|
const submitUpload = useChatStore((s) => s.submitUpload);
|
|
10850
10850
|
const clearUploadRequest = useChatStore((s) => s.clearUploadRequest);
|
|
10851
|
-
const cameraRef =
|
|
10852
|
-
const browseRef =
|
|
10851
|
+
const cameraRef = React122.useRef(null);
|
|
10852
|
+
const browseRef = React122.useRef(null);
|
|
10853
10853
|
if (!request) return null;
|
|
10854
10854
|
const working = request.status === "working";
|
|
10855
10855
|
const accept = request.accept ?? "image/*";
|
|
@@ -10991,8 +10991,8 @@ function LiveWaveform({
|
|
|
10991
10991
|
compact,
|
|
10992
10992
|
tone = "primary"
|
|
10993
10993
|
}) {
|
|
10994
|
-
const barsRef =
|
|
10995
|
-
|
|
10994
|
+
const barsRef = React122.useRef([]);
|
|
10995
|
+
React122.useEffect(() => {
|
|
10996
10996
|
if (!live) return;
|
|
10997
10997
|
let frame = 0;
|
|
10998
10998
|
const draw = () => {
|
|
@@ -11141,7 +11141,7 @@ function ChatMarkdown({ content }) {
|
|
|
11141
11141
|
}
|
|
11142
11142
|
const sub = subOrdered ? /* @__PURE__ */ jsx("ol", { start: subStart, className: "mt-0.5 space-y-0.5 pl-4 list-decimal", children: subItems }, `sub${items.length}`) : /* @__PURE__ */ jsx("ul", { className: "mt-0.5 space-y-0.5 pl-4 list-disc", children: subItems }, `sub${items.length}`);
|
|
11143
11143
|
const prev = items.pop();
|
|
11144
|
-
if (prev &&
|
|
11144
|
+
if (prev && React122.isValidElement(prev)) {
|
|
11145
11145
|
items.push(
|
|
11146
11146
|
/* @__PURE__ */ jsxs("li", { children: [
|
|
11147
11147
|
prev.props.children,
|
|
@@ -11238,7 +11238,7 @@ var CARD_CTA = {
|
|
|
11238
11238
|
function useConnectorJourney(card) {
|
|
11239
11239
|
const panelAvailable = useConnectorsPanelAvailable();
|
|
11240
11240
|
useChatStore((s) => s.setOpen);
|
|
11241
|
-
return
|
|
11241
|
+
return React122.useCallback(() => {
|
|
11242
11242
|
if (panelAvailable && card.id) {
|
|
11243
11243
|
openConnectorsPanel({ id: card.id });
|
|
11244
11244
|
return;
|
|
@@ -11328,7 +11328,7 @@ function ConnectorSuggestionRow({ card }) {
|
|
|
11328
11328
|
] });
|
|
11329
11329
|
}
|
|
11330
11330
|
function ConnectorSuggestionGroup({ cards }) {
|
|
11331
|
-
const shelves =
|
|
11331
|
+
const shelves = React122.useMemo(() => shelveByCategory(cards), [cards]);
|
|
11332
11332
|
return /* @__PURE__ */ jsx("div", { className: "w-full max-w-[88%] overflow-hidden rounded-xl border border-border/60 bg-card/60 motion-safe:animate-zoom-in", children: shelves.map((shelf, shelfIndex) => /* @__PURE__ */ jsxs("div", { className: cn(shelfIndex > 0 && "border-t border-border/50"), children: [
|
|
11333
11333
|
shelf.label && /* @__PURE__ */ jsx("p", { className: "bg-background/40 px-2.5 py-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground", children: shelf.label }),
|
|
11334
11334
|
/* @__PURE__ */ jsx("div", { className: "divide-y divide-border/40", children: shelf.items.map((card) => /* @__PURE__ */ jsx(ConnectorSuggestionRow, { card }, card.slug ?? card.id ?? card.name)) })
|
|
@@ -11338,8 +11338,8 @@ function ChoiceCard({ card }) {
|
|
|
11338
11338
|
const queuePrompt = useChatStore((s) => s.queuePrompt);
|
|
11339
11339
|
const isStreaming = useChatStore((s) => s.isStreaming);
|
|
11340
11340
|
const messages = useChatStore((s) => s.messages);
|
|
11341
|
-
const [optimistic, setOptimistic] =
|
|
11342
|
-
const answeredInThread =
|
|
11341
|
+
const [optimistic, setOptimistic] = React122.useState(null);
|
|
11342
|
+
const answeredInThread = React122.useMemo(
|
|
11343
11343
|
() => answeredOptionId(messages, card.options),
|
|
11344
11344
|
[messages, card.options]
|
|
11345
11345
|
);
|
|
@@ -11394,7 +11394,7 @@ function humanizeToolName(name) {
|
|
|
11394
11394
|
}
|
|
11395
11395
|
function ToolCallRow({ call: call2 }) {
|
|
11396
11396
|
const { t } = useTranslation$1();
|
|
11397
|
-
const [open, setOpen] =
|
|
11397
|
+
const [open, setOpen] = React122.useState(false);
|
|
11398
11398
|
const failed = call2.declined || /"error"\s*:/.test(call2.result ?? "");
|
|
11399
11399
|
return /* @__PURE__ */ jsxs("div", { className: "overflow-hidden rounded-xl border border-border/50 bg-muted/30", children: [
|
|
11400
11400
|
/* @__PURE__ */ jsxs(
|
|
@@ -11471,15 +11471,15 @@ function HandoffNotice({ notice }) {
|
|
|
11471
11471
|
}
|
|
11472
11472
|
function MessageBubble({ message, isPending }) {
|
|
11473
11473
|
const isUser = message.role === "user";
|
|
11474
|
-
const connectorCards =
|
|
11474
|
+
const connectorCards = React122.useMemo(
|
|
11475
11475
|
() => (message.cards ?? []).filter((card) => card.kind === "connector"),
|
|
11476
11476
|
[message.cards]
|
|
11477
11477
|
);
|
|
11478
|
-
const choiceCards =
|
|
11478
|
+
const choiceCards = React122.useMemo(
|
|
11479
11479
|
() => (message.cards ?? []).filter((card) => card.kind === "choice"),
|
|
11480
11480
|
[message.cards]
|
|
11481
11481
|
);
|
|
11482
|
-
const routedLinks =
|
|
11482
|
+
const routedLinks = React122.useMemo(
|
|
11483
11483
|
() => (message.links ?? []).filter(
|
|
11484
11484
|
(l) => !!l.path || !!resolveEntityRoute(l.archetype, l.kind, l.entityKey)
|
|
11485
11485
|
),
|
|
@@ -11570,9 +11570,9 @@ function ConfirmActionCard({
|
|
|
11570
11570
|
onResolveAll
|
|
11571
11571
|
}) {
|
|
11572
11572
|
const { t } = useTranslation$1();
|
|
11573
|
-
const schema =
|
|
11573
|
+
const schema = React122.useMemo(() => action.fields ?? [], [action.fields]);
|
|
11574
11574
|
const partial = action.partial === true;
|
|
11575
|
-
const seedValues =
|
|
11575
|
+
const seedValues = React122.useCallback(
|
|
11576
11576
|
(params) => {
|
|
11577
11577
|
if (partial) return { ...params };
|
|
11578
11578
|
const seeded = {};
|
|
@@ -11581,18 +11581,18 @@ function ConfirmActionCard({
|
|
|
11581
11581
|
},
|
|
11582
11582
|
[schema, partial]
|
|
11583
11583
|
);
|
|
11584
|
-
const [values, setValues] =
|
|
11585
|
-
const [showAll, setShowAll] =
|
|
11584
|
+
const [values, setValues] = React122.useState(() => seedValues(action.params));
|
|
11585
|
+
const [showAll, setShowAll] = React122.useState(false);
|
|
11586
11586
|
const batch = Math.max(0, sameToolQueued);
|
|
11587
|
-
|
|
11587
|
+
React122.useEffect(() => setValues(seedValues(action.params)), [action.params, seedValues]);
|
|
11588
11588
|
const isSet = (v) => v !== void 0 && v !== null && v !== "";
|
|
11589
|
-
const primaryKeys =
|
|
11589
|
+
const primaryKeys = React122.useMemo(() => {
|
|
11590
11590
|
const keys = Object.keys(action.params).filter((k) => isSet(action.params[k]));
|
|
11591
11591
|
if (partial) return keys;
|
|
11592
11592
|
for (const f of schema) if (f.required && !keys.includes(f.key)) keys.push(f.key);
|
|
11593
11593
|
return keys;
|
|
11594
11594
|
}, [action.params, schema, partial]);
|
|
11595
|
-
const extraKeys =
|
|
11595
|
+
const extraKeys = React122.useMemo(
|
|
11596
11596
|
() => schema.map((f) => f.key).filter((k) => !primaryKeys.includes(k) && k !== "id"),
|
|
11597
11597
|
[schema, primaryKeys]
|
|
11598
11598
|
);
|
|
@@ -11609,20 +11609,20 @@ function ConfirmActionCard({
|
|
|
11609
11609
|
const translatedTool = t(toolKey);
|
|
11610
11610
|
const heading = action.title ?? (translatedTool !== toolKey ? translatedTool : humanizeToolName(action.toolName));
|
|
11611
11611
|
const ruleLabel = action.scopeLabel ?? heading;
|
|
11612
|
-
const missingRequiredKeys =
|
|
11612
|
+
const missingRequiredKeys = React122.useMemo(
|
|
11613
11613
|
() => partial ? [] : schema.filter((f) => f.required && !isSet(values[f.key])).map((f) => f.key),
|
|
11614
11614
|
[schema, values, partial]
|
|
11615
11615
|
);
|
|
11616
11616
|
const canConfirm = missingRequiredKeys.length === 0;
|
|
11617
|
-
const submitted =
|
|
11617
|
+
const submitted = React122.useCallback(
|
|
11618
11618
|
() => partial ? Object.fromEntries(Object.entries(values).filter(([, v]) => isSet(v))) : values,
|
|
11619
11619
|
[partial, values]
|
|
11620
11620
|
);
|
|
11621
|
-
const approve =
|
|
11621
|
+
const approve = React122.useCallback(() => {
|
|
11622
11622
|
if (canConfirm) onResolve(true, submitted());
|
|
11623
11623
|
}, [canConfirm, onResolve, submitted]);
|
|
11624
|
-
const decline =
|
|
11625
|
-
const approveAlways =
|
|
11624
|
+
const decline = React122.useCallback(() => onResolve(false), [onResolve]);
|
|
11625
|
+
const approveAlways = React122.useCallback(() => {
|
|
11626
11626
|
if (!canConfirm) return;
|
|
11627
11627
|
grantAutoApproval({
|
|
11628
11628
|
toolName: action.toolName,
|
|
@@ -11632,7 +11632,7 @@ function ConfirmActionCard({
|
|
|
11632
11632
|
});
|
|
11633
11633
|
onResolve(true, submitted());
|
|
11634
11634
|
}, [canConfirm, action.toolName, action.scope, ruleLabel, destructive, onResolve, submitted]);
|
|
11635
|
-
|
|
11635
|
+
React122.useEffect(() => {
|
|
11636
11636
|
const handler = (event) => {
|
|
11637
11637
|
const target = event.target;
|
|
11638
11638
|
const typing = target?.tagName === "INPUT" || target?.tagName === "TEXTAREA" || target?.tagName === "SELECT";
|
|
@@ -11969,8 +11969,8 @@ var TYPE_MS = 620;
|
|
|
11969
11969
|
var MIN_CHAR_MS = 12;
|
|
11970
11970
|
var MAX_CHAR_MS = 34;
|
|
11971
11971
|
function usePrefersReducedMotion() {
|
|
11972
|
-
const [reduced, setReduced] =
|
|
11973
|
-
|
|
11972
|
+
const [reduced, setReduced] = React122.useState(false);
|
|
11973
|
+
React122.useEffect(() => {
|
|
11974
11974
|
if (typeof matchMedia !== "function") return;
|
|
11975
11975
|
const query = matchMedia("(prefers-reduced-motion: reduce)");
|
|
11976
11976
|
const sync = () => setReduced(query.matches);
|
|
@@ -11989,10 +11989,10 @@ function TypedText({
|
|
|
11989
11989
|
onDone
|
|
11990
11990
|
}) {
|
|
11991
11991
|
const reduced = usePrefersReducedMotion();
|
|
11992
|
-
const [count, setCount] =
|
|
11993
|
-
const done =
|
|
11992
|
+
const [count, setCount] = React122.useState(reduced ? text2.length : 0);
|
|
11993
|
+
const done = React122.useRef(onDone);
|
|
11994
11994
|
done.current = onDone;
|
|
11995
|
-
|
|
11995
|
+
React122.useEffect(() => {
|
|
11996
11996
|
if (!start) {
|
|
11997
11997
|
setCount(0);
|
|
11998
11998
|
return;
|
|
@@ -12032,9 +12032,9 @@ function RevealSequence({
|
|
|
12032
12032
|
children
|
|
12033
12033
|
}) {
|
|
12034
12034
|
const reduced = usePrefersReducedMotion();
|
|
12035
|
-
const items =
|
|
12036
|
-
const [shown, setShown] =
|
|
12037
|
-
|
|
12035
|
+
const items = React122.Children.toArray(children);
|
|
12036
|
+
const [shown, setShown] = React122.useState(0);
|
|
12037
|
+
React122.useEffect(() => {
|
|
12038
12038
|
if (!start) {
|
|
12039
12039
|
setShown(0);
|
|
12040
12040
|
return;
|
|
@@ -12096,7 +12096,7 @@ function UpgradePrompt({ feature, inline, className }) {
|
|
|
12096
12096
|
const currentPlan = plans.find((p) => p.id === currentPlanId);
|
|
12097
12097
|
const currentPrice = currentPlan?.price ?? 0;
|
|
12098
12098
|
const currentPlanName = currentPlan?.name ?? tr("billing.free", "Free");
|
|
12099
|
-
const featureName =
|
|
12099
|
+
const featureName = React122.useMemo(() => {
|
|
12100
12100
|
if (!feature) return null;
|
|
12101
12101
|
const label2 = features.find((f) => f.id === feature)?.label;
|
|
12102
12102
|
if (label2) return featureDisplayName(label2);
|
|
@@ -12104,7 +12104,7 @@ function UpgradePrompt({ feature, inline, className }) {
|
|
|
12104
12104
|
const named = t(key);
|
|
12105
12105
|
return named && named !== key ? named : featureDisplayName(feature);
|
|
12106
12106
|
}, [features, feature, t]);
|
|
12107
|
-
const unlockingPlans =
|
|
12107
|
+
const unlockingPlans = React122.useMemo(
|
|
12108
12108
|
() => plans.filter((p) => p.id !== currentPlanId && p.price > currentPrice && planUnlocks(p, feature)).sort((a, b) => a.price - b.price),
|
|
12109
12109
|
[plans, currentPlanId, currentPrice, feature]
|
|
12110
12110
|
);
|
|
@@ -12285,26 +12285,26 @@ function ChatConversation({
|
|
|
12285
12285
|
usable && !pendingAction && !isStreaming,
|
|
12286
12286
|
receiveFiles
|
|
12287
12287
|
);
|
|
12288
|
-
|
|
12289
|
-
const [view, setView] =
|
|
12288
|
+
React122.useEffect(ensureIntroStyles, []);
|
|
12289
|
+
const [view, setView] = React122.useState(
|
|
12290
12290
|
() => useChatStore.getState().messages.length > 0 ? "thread" : "list"
|
|
12291
12291
|
);
|
|
12292
|
-
const [drawer, setDrawer] =
|
|
12293
|
-
const [introStep, setIntroStep] =
|
|
12294
|
-
const [atBottom, setAtBottom] =
|
|
12295
|
-
const scrollRef =
|
|
12292
|
+
const [drawer, setDrawer] = React122.useState("none");
|
|
12293
|
+
const [introStep, setIntroStep] = React122.useState(0);
|
|
12294
|
+
const [atBottom, setAtBottom] = React122.useState(true);
|
|
12295
|
+
const scrollRef = React122.useRef(null);
|
|
12296
12296
|
const hasMessages = messages.length > 0;
|
|
12297
12297
|
const showThread = view === "thread" && hasMessages;
|
|
12298
12298
|
const totalTools = toolGroups.reduce((sum, g) => sum + g.tools.length, 0);
|
|
12299
|
-
const scrollToBottom =
|
|
12299
|
+
const scrollToBottom = React122.useCallback((behavior = "smooth") => {
|
|
12300
12300
|
const el = scrollRef.current;
|
|
12301
12301
|
if (!el) return;
|
|
12302
12302
|
el.scrollTo({ top: el.scrollHeight, behavior });
|
|
12303
12303
|
}, []);
|
|
12304
|
-
|
|
12304
|
+
React122.useEffect(() => {
|
|
12305
12305
|
if (atBottom) scrollToBottom();
|
|
12306
12306
|
}, [messages, activeTools, pendingAction, atBottom, scrollToBottom]);
|
|
12307
|
-
|
|
12307
|
+
React122.useEffect(() => {
|
|
12308
12308
|
loadConversations();
|
|
12309
12309
|
setSuggestionsOpen(useChatStore.getState().messages.length === 0);
|
|
12310
12310
|
return () => stopSpeaking();
|
|
@@ -12321,7 +12321,7 @@ function ChatConversation({
|
|
|
12321
12321
|
};
|
|
12322
12322
|
const queuedPrompt = useChatStore((s) => s.queuedPrompt);
|
|
12323
12323
|
const consumeQueuedPrompt = useChatStore((s) => s.consumeQueuedPrompt);
|
|
12324
|
-
|
|
12324
|
+
React122.useEffect(() => {
|
|
12325
12325
|
if (!queuedPrompt) return;
|
|
12326
12326
|
const prompt = consumeQueuedPrompt();
|
|
12327
12327
|
if (prompt && usable) send(prompt);
|
|
@@ -12353,7 +12353,7 @@ function ChatConversation({
|
|
|
12353
12353
|
);
|
|
12354
12354
|
const connectorsPending = useConnectorsSurface((s) => s.pending);
|
|
12355
12355
|
const consumeConnectorsRequest = useConnectorsSurface((s) => s.consume);
|
|
12356
|
-
|
|
12356
|
+
React122.useEffect(() => {
|
|
12357
12357
|
if (!connectorsPending) return;
|
|
12358
12358
|
setDrawer("connectors");
|
|
12359
12359
|
consumeConnectorsRequest();
|
|
@@ -12361,7 +12361,7 @@ function ChatConversation({
|
|
|
12361
12361
|
const greetingName = (user?.fullName || user?.email || "").split(/[\s@]/)[0];
|
|
12362
12362
|
const invite = useAssistantInviteStore((s) => s.invite);
|
|
12363
12363
|
const introKey = `${onDuty?.role ?? "solo"}:${invite?.id ?? ""}`;
|
|
12364
|
-
|
|
12364
|
+
React122.useEffect(() => setIntroStep(0), [introKey]);
|
|
12365
12365
|
const greeting = invite ? (invite.pitch ?? invite.headline).replace("{{name}}", greetingName) : onDuty?.greeting ? onDuty.greeting.replace("{{name}}", greetingName) : greetingName ? t("chat.greetingNamed", { name: greetingName }) : t("chat.greeting");
|
|
12366
12366
|
const greetingHint = invite?.description ?? onDuty?.goal ?? t("chat.greetingHint");
|
|
12367
12367
|
const openers = invite?.suggestions?.length ? invite.suggestions : onDuty?.suggestions?.length ? onDuty.suggestions : suggestions.length ? suggestions : [
|
|
@@ -12683,7 +12683,7 @@ function AgentAvatar({
|
|
|
12683
12683
|
size = "md",
|
|
12684
12684
|
className
|
|
12685
12685
|
}) {
|
|
12686
|
-
const [failed, setFailed] =
|
|
12686
|
+
const [failed, setFailed] = React122.useState(false);
|
|
12687
12687
|
const { box, text: text2, px } = SIZES[size];
|
|
12688
12688
|
if (Face) {
|
|
12689
12689
|
return /* @__PURE__ */ jsx(
|
|
@@ -13471,7 +13471,7 @@ function TaskStatusGroup({ status, tasks }) {
|
|
|
13471
13471
|
function useDelegateToAssistant() {
|
|
13472
13472
|
const queuePrompt = useChatStore((s) => s.queuePrompt);
|
|
13473
13473
|
const openPanel = useRightRailStore((s) => s.openPanel);
|
|
13474
|
-
return
|
|
13474
|
+
return React122.useCallback(
|
|
13475
13475
|
(prompt) => {
|
|
13476
13476
|
queuePrompt(prompt);
|
|
13477
13477
|
openPanel("chat");
|
|
@@ -13708,12 +13708,12 @@ function TasksPanel() {
|
|
|
13708
13708
|
const fetchTasks = useTasksStore((s) => s.fetchTasks);
|
|
13709
13709
|
const fetchLabels = useTasksStore((s) => s.fetchLabels);
|
|
13710
13710
|
const fetchSummary = useTasksStore((s) => s.fetchSummary);
|
|
13711
|
-
|
|
13711
|
+
React122__default.useEffect(() => {
|
|
13712
13712
|
void fetchTasks();
|
|
13713
13713
|
void fetchLabels();
|
|
13714
13714
|
void fetchSummary();
|
|
13715
13715
|
}, [fetchTasks, fetchLabels, fetchSummary]);
|
|
13716
|
-
const { onboarding, grouped } =
|
|
13716
|
+
const { onboarding, grouped } = React122__default.useMemo(() => {
|
|
13717
13717
|
const split = splitOnboardingTasks(tasks);
|
|
13718
13718
|
const map = /* @__PURE__ */ new Map();
|
|
13719
13719
|
for (const s of STATUS_ORDER) map.set(s, []);
|
|
@@ -13748,7 +13748,7 @@ function TasksPanel() {
|
|
|
13748
13748
|
function useTasksSummaryLine() {
|
|
13749
13749
|
const t = useTranslation();
|
|
13750
13750
|
const summary = useTasksStore((s) => s.summary);
|
|
13751
|
-
return
|
|
13751
|
+
return React122__default.useMemo(() => {
|
|
13752
13752
|
if (!summary) return "";
|
|
13753
13753
|
const parts = [];
|
|
13754
13754
|
if (summary.overdue > 0) parts.push(`${summary.overdue} ${t("tasks.summary.overdue")}`);
|
|
@@ -13773,16 +13773,16 @@ function TasksRailPanel() {
|
|
|
13773
13773
|
const fetchSummary = useTasksStore((s) => s.fetchSummary);
|
|
13774
13774
|
const setCurrentUserId = useTasksStore((s) => s.setCurrentUserId);
|
|
13775
13775
|
const userId = useAuthStore6((s) => s.user?.id);
|
|
13776
|
-
|
|
13776
|
+
React122__default.useEffect(() => {
|
|
13777
13777
|
void fetchSummary();
|
|
13778
13778
|
}, [fetchSummary]);
|
|
13779
|
-
|
|
13779
|
+
React122__default.useEffect(() => {
|
|
13780
13780
|
setCurrentUserId(userId ?? null);
|
|
13781
13781
|
}, [userId, setCurrentUserId]);
|
|
13782
13782
|
const openCount = summary ? summary.todo + summary.inProgress : 0;
|
|
13783
13783
|
const defer = tasksSurfaceOwner() === "plugin";
|
|
13784
13784
|
useRightRailPanel(
|
|
13785
|
-
|
|
13785
|
+
React122__default.useMemo(
|
|
13786
13786
|
() => defer ? null : {
|
|
13787
13787
|
id: "tasks",
|
|
13788
13788
|
label: t("tasks.drawer.title") || "Tasks",
|
|
@@ -13806,15 +13806,15 @@ var useSettingsTabsStore = create((set, get) => ({
|
|
|
13806
13806
|
}));
|
|
13807
13807
|
function usePublishSettingsTabs(ids) {
|
|
13808
13808
|
const key = ids.join(",");
|
|
13809
|
-
|
|
13809
|
+
React122.useEffect(() => {
|
|
13810
13810
|
useSettingsTabsStore.getState().setIds(key ? key.split(",") : []);
|
|
13811
13811
|
}, [key]);
|
|
13812
13812
|
}
|
|
13813
13813
|
function useAgentSurface(contribution) {
|
|
13814
|
-
const ref =
|
|
13814
|
+
const ref = React122.useRef(contribution);
|
|
13815
13815
|
ref.current = contribution;
|
|
13816
13816
|
const id = contribution.id;
|
|
13817
|
-
|
|
13817
|
+
React122.useEffect(() => {
|
|
13818
13818
|
registerSurface({ id, get: () => ref.current });
|
|
13819
13819
|
const names = (ref.current.tools ?? []).map((t) => t.tool.name);
|
|
13820
13820
|
for (const name of names) {
|
|
@@ -14594,9 +14594,9 @@ function featureMap() {
|
|
|
14594
14594
|
}));
|
|
14595
14595
|
}
|
|
14596
14596
|
function ActivationAgentSurface({ programs }) {
|
|
14597
|
-
const programsRef =
|
|
14597
|
+
const programsRef = React122.useRef(programs);
|
|
14598
14598
|
programsRef.current = programs;
|
|
14599
|
-
const contribution =
|
|
14599
|
+
const contribution = React122.useMemo(
|
|
14600
14600
|
() => ({
|
|
14601
14601
|
id: "onboarding.activation",
|
|
14602
14602
|
pluginId: "onboarding",
|
|
@@ -14917,7 +14917,7 @@ Quando a pessoa perguntar COMO fazer algo que tem guia em \`setupGuides\` ("como
|
|
|
14917
14917
|
- Termine dizendo o que isso destrava e oferecendo a pr\xF3xima, uma vez s\xF3.`
|
|
14918
14918
|
);
|
|
14919
14919
|
function SetupAgentSurface() {
|
|
14920
|
-
const contribution =
|
|
14920
|
+
const contribution = React122.useMemo(
|
|
14921
14921
|
() => ({
|
|
14922
14922
|
id: "setup.guides",
|
|
14923
14923
|
pluginId: "setup",
|
|
@@ -15033,7 +15033,7 @@ function SetupAgentSurface() {
|
|
|
15033
15033
|
}
|
|
15034
15034
|
var DEBOUNCE_MS = 1200;
|
|
15035
15035
|
function useActivationWatch() {
|
|
15036
|
-
|
|
15036
|
+
React122.useEffect(() => {
|
|
15037
15037
|
let timer = null;
|
|
15038
15038
|
let running = false;
|
|
15039
15039
|
const sweep = async () => {
|
|
@@ -15072,7 +15072,7 @@ function useActivationWatch() {
|
|
|
15072
15072
|
off();
|
|
15073
15073
|
};
|
|
15074
15074
|
}, []);
|
|
15075
|
-
|
|
15075
|
+
React122.useEffect(() => {
|
|
15076
15076
|
useActivationStore.setState({
|
|
15077
15077
|
onStepCompleted: (step, by) => {
|
|
15078
15078
|
const state = useActivationStore.getState();
|
|
@@ -15729,7 +15729,7 @@ function ActivationProvider() {
|
|
|
15729
15729
|
const programs = runtime?.onboardingPrograms ?? [];
|
|
15730
15730
|
const settingsIds = useSettingsTabsStore((s) => s.ids);
|
|
15731
15731
|
const routeKey = (runtime?.routes.length ?? 0) + ":" + settingsIds.join(",");
|
|
15732
|
-
const hasRoute =
|
|
15732
|
+
const hasRoute = React122.useMemo(() => {
|
|
15733
15733
|
const known = /* @__PURE__ */ new Set(["/", "/settings"]);
|
|
15734
15734
|
for (const route of runtime?.routes ?? []) known.add(route.path);
|
|
15735
15735
|
for (const id of settingsIds) known.add(`/settings/${id}`);
|
|
@@ -15737,14 +15737,14 @@ function ActivationProvider() {
|
|
|
15737
15737
|
}, [routeKey]);
|
|
15738
15738
|
const answers = useBusinessProfileStore((s) => s.profile?.answers);
|
|
15739
15739
|
const programKey = programs.map((p) => p.id).join(",");
|
|
15740
|
-
const catalog =
|
|
15740
|
+
const catalog = React122.useMemo(
|
|
15741
15741
|
() => buildActivationCatalog({ verticalId, programs, hasRoute, answers }),
|
|
15742
15742
|
[verticalId, programKey, hasRoute, answers]
|
|
15743
15743
|
);
|
|
15744
|
-
|
|
15744
|
+
React122.useEffect(() => {
|
|
15745
15745
|
setCatalog(catalog);
|
|
15746
15746
|
}, [catalog, setCatalog]);
|
|
15747
|
-
|
|
15747
|
+
React122.useEffect(() => {
|
|
15748
15748
|
if (!tenantId2) return;
|
|
15749
15749
|
let cancelled = false;
|
|
15750
15750
|
void (async () => {
|
|
@@ -15776,14 +15776,14 @@ function ActivationProvider() {
|
|
|
15776
15776
|
cancelled = true;
|
|
15777
15777
|
};
|
|
15778
15778
|
}, [tenantId2, catalog, answers, hasRoute, settingsIds, user?.id, load]);
|
|
15779
|
-
|
|
15779
|
+
React122.useEffect(() => {
|
|
15780
15780
|
if (!tenantId2) {
|
|
15781
15781
|
useBusinessProfileStore.getState().clear();
|
|
15782
15782
|
return;
|
|
15783
15783
|
}
|
|
15784
15784
|
void useBusinessProfileStore.getState().load(tenantId2, orgName);
|
|
15785
15785
|
}, [tenantId2, orgName]);
|
|
15786
|
-
|
|
15786
|
+
React122.useEffect(() => {
|
|
15787
15787
|
if (!tenantId2) return;
|
|
15788
15788
|
const key = `${GREETING_FLAG}:${tenantId2}`;
|
|
15789
15789
|
let pending2 = false;
|
|
@@ -15805,10 +15805,10 @@ function ActivationProvider() {
|
|
|
15805
15805
|
return () => window.clearTimeout(timer);
|
|
15806
15806
|
}, [tenantId2]);
|
|
15807
15807
|
const guides = runtime?.setupGuides;
|
|
15808
|
-
|
|
15808
|
+
React122.useEffect(() => {
|
|
15809
15809
|
setRuntimeSetupGuides(guides ?? []);
|
|
15810
15810
|
}, [guides]);
|
|
15811
|
-
|
|
15811
|
+
React122.useEffect(() => {
|
|
15812
15812
|
setTourNavigator(navigateTo);
|
|
15813
15813
|
return () => setTourNavigator(void 0);
|
|
15814
15814
|
}, []);
|
|
@@ -15981,7 +15981,7 @@ Escrita:
|
|
|
15981
15981
|
E quando a coisa precisa ser FEITA em vez de lembrada, \xE9 tarefa e n\xE3o p\xE1gina \u2014 crie com createRecord na entidade Task.`
|
|
15982
15982
|
);
|
|
15983
15983
|
function HandbookAgentSurface() {
|
|
15984
|
-
const contribution =
|
|
15984
|
+
const contribution = React122.useMemo(
|
|
15985
15985
|
() => ({
|
|
15986
15986
|
id: "handbook",
|
|
15987
15987
|
pluginId: "handbook",
|
|
@@ -16092,18 +16092,18 @@ function NotebookPanel() {
|
|
|
16092
16092
|
const userId = useHandbookStore((s) => s.userId);
|
|
16093
16093
|
const write3 = useHandbookStore((s) => s.write);
|
|
16094
16094
|
const remove = useHandbookStore((s) => s.remove);
|
|
16095
|
-
const [filter, setFilter] =
|
|
16096
|
-
const [search, setSearch] =
|
|
16097
|
-
const [draft, setDraft] =
|
|
16098
|
-
const [preview, setPreview] =
|
|
16099
|
-
const [confirming, setConfirming] =
|
|
16100
|
-
const entries2 =
|
|
16095
|
+
const [filter, setFilter] = React122.useState("all");
|
|
16096
|
+
const [search, setSearch] = React122.useState("");
|
|
16097
|
+
const [draft, setDraft] = React122.useState(null);
|
|
16098
|
+
const [preview, setPreview] = React122.useState(false);
|
|
16099
|
+
const [confirming, setConfirming] = React122.useState(null);
|
|
16100
|
+
const entries2 = React122.useMemo(
|
|
16101
16101
|
() => (pages ?? []).map((p) => ({ page: p, entry: toEntry2(p) })),
|
|
16102
16102
|
[pages]
|
|
16103
16103
|
);
|
|
16104
|
-
const timer =
|
|
16105
|
-
const inFlight =
|
|
16106
|
-
const persist =
|
|
16104
|
+
const timer = React122.useRef(null);
|
|
16105
|
+
const inFlight = React122.useRef(false);
|
|
16106
|
+
const persist = React122.useCallback(async (d) => {
|
|
16107
16107
|
const title = titleFromBody(d.body);
|
|
16108
16108
|
if (!title && !d.body.trim()) return d.id;
|
|
16109
16109
|
const filed = d.folder !== null;
|
|
@@ -16125,7 +16125,7 @@ function NotebookPanel() {
|
|
|
16125
16125
|
});
|
|
16126
16126
|
return saved?.id ?? d.id;
|
|
16127
16127
|
}, [write3, userId]);
|
|
16128
|
-
const schedule =
|
|
16128
|
+
const schedule = React122.useCallback((next) => {
|
|
16129
16129
|
setDraft(next);
|
|
16130
16130
|
if (timer.current) clearTimeout(timer.current);
|
|
16131
16131
|
timer.current = setTimeout(() => {
|
|
@@ -16157,7 +16157,7 @@ function NotebookPanel() {
|
|
|
16157
16157
|
legacyId: null
|
|
16158
16158
|
});
|
|
16159
16159
|
};
|
|
16160
|
-
const folders =
|
|
16160
|
+
const folders = React122.useMemo(() => {
|
|
16161
16161
|
const set = /* @__PURE__ */ new Set();
|
|
16162
16162
|
for (const { page } of entries2) {
|
|
16163
16163
|
if (page.kind !== "doc" || !page.path) continue;
|
|
@@ -16549,10 +16549,10 @@ ${body}`
|
|
|
16549
16549
|
}
|
|
16550
16550
|
function NoteTodosSection({ noteId, noteTitle }) {
|
|
16551
16551
|
const adapter = useNotesTasksBridge((s) => s.adapter);
|
|
16552
|
-
const [todos, setTodos] =
|
|
16553
|
-
const [draft, setDraft] =
|
|
16554
|
-
const [busy, setBusy] =
|
|
16555
|
-
|
|
16552
|
+
const [todos, setTodos] = React122.useState([]);
|
|
16553
|
+
const [draft, setDraft] = React122.useState("");
|
|
16554
|
+
const [busy, setBusy] = React122.useState(false);
|
|
16555
|
+
React122.useEffect(() => {
|
|
16556
16556
|
if (!adapter) return;
|
|
16557
16557
|
let alive = true;
|
|
16558
16558
|
adapter.listTodos(noteId).then((rows) => {
|
|
@@ -16682,7 +16682,7 @@ function NotebookRailPanel() {
|
|
|
16682
16682
|
const pages = useHandbookStore((s) => s.pages);
|
|
16683
16683
|
const count = pages?.length ?? 0;
|
|
16684
16684
|
useRightRailPanel(
|
|
16685
|
-
|
|
16685
|
+
React122.useMemo(
|
|
16686
16686
|
() => ({
|
|
16687
16687
|
id: "notes",
|
|
16688
16688
|
label: tl("Notes", "Notas"),
|
|
@@ -16701,10 +16701,10 @@ function HandbookProvider() {
|
|
|
16701
16701
|
const userId = useAuthStore((s) => s.user?.id);
|
|
16702
16702
|
const load = useHandbookStore((s) => s.load);
|
|
16703
16703
|
const setUser = useHandbookStore((s) => s.setUser);
|
|
16704
|
-
|
|
16704
|
+
React122.useEffect(() => {
|
|
16705
16705
|
setUser(userId);
|
|
16706
16706
|
}, [userId, setUser]);
|
|
16707
|
-
|
|
16707
|
+
React122.useEffect(() => {
|
|
16708
16708
|
if (tenantId2) void load(tenantId2);
|
|
16709
16709
|
}, [tenantId2, load]);
|
|
16710
16710
|
useLocalNotesImport(tenantId2, userId);
|
|
@@ -16714,7 +16714,7 @@ function HandbookProvider() {
|
|
|
16714
16714
|
] });
|
|
16715
16715
|
}
|
|
16716
16716
|
function useLocalNotesImport(tenantId2, userId) {
|
|
16717
|
-
|
|
16717
|
+
React122.useEffect(() => {
|
|
16718
16718
|
if (!tenantId2 || !userId) return;
|
|
16719
16719
|
const source = `fayz.notes.${tenantId2}.${userId}`;
|
|
16720
16720
|
const flag = `fayz.notes.imported.${tenantId2}.${userId}`;
|
|
@@ -16762,7 +16762,7 @@ function useUnitBootstrap() {
|
|
|
16762
16762
|
const tenant = useTenantOptional();
|
|
16763
16763
|
const userId = useAuthStore((s) => s.user?.id);
|
|
16764
16764
|
const orgId = tenant?.org?.id;
|
|
16765
|
-
|
|
16765
|
+
React122.useEffect(() => {
|
|
16766
16766
|
if (!orgId) return;
|
|
16767
16767
|
const { loadedFor, load, reset } = useUnitStore.getState();
|
|
16768
16768
|
if (loadedFor && loadedFor !== orgId) reset();
|
|
@@ -16801,19 +16801,19 @@ function UnitMembersTab({ item }) {
|
|
|
16801
16801
|
const orgMembers = useOrganizationStore((s) => s.members);
|
|
16802
16802
|
const profiles = usePermissionsStore((s) => s.profiles);
|
|
16803
16803
|
const unitMode = useUnitStore((s) => s.unitMode);
|
|
16804
|
-
const [rows, setRows] =
|
|
16805
|
-
const [activity, setActivity] =
|
|
16806
|
-
const [adding, setAdding] =
|
|
16807
|
-
const [busy, setBusy] =
|
|
16808
|
-
const reload =
|
|
16804
|
+
const [rows, setRows] = React122.useState(null);
|
|
16805
|
+
const [activity, setActivity] = React122.useState({});
|
|
16806
|
+
const [adding, setAdding] = React122.useState(false);
|
|
16807
|
+
const [busy, setBusy] = React122.useState(null);
|
|
16808
|
+
const reload = React122.useCallback(async () => {
|
|
16809
16809
|
if (!unitId) return;
|
|
16810
16810
|
setRows(await fetchUnitMembers(unitId));
|
|
16811
16811
|
}, [unitId]);
|
|
16812
16812
|
const version5 = useDataVersion(UNIT_ACCESS_CHANGED);
|
|
16813
|
-
|
|
16813
|
+
React122.useEffect(() => {
|
|
16814
16814
|
void reload();
|
|
16815
16815
|
}, [reload, version5]);
|
|
16816
|
-
|
|
16816
|
+
React122.useEffect(() => {
|
|
16817
16817
|
if (!orgId) return;
|
|
16818
16818
|
let alive = true;
|
|
16819
16819
|
void fetchMemberActivity(orgId).then((a) => {
|
|
@@ -16823,7 +16823,7 @@ function UnitMembersTab({ item }) {
|
|
|
16823
16823
|
alive = false;
|
|
16824
16824
|
};
|
|
16825
16825
|
}, [orgId]);
|
|
16826
|
-
const byUser =
|
|
16826
|
+
const byUser = React122.useMemo(() => {
|
|
16827
16827
|
const map = /* @__PURE__ */ new Map();
|
|
16828
16828
|
for (const m of orgMembers) {
|
|
16829
16829
|
map.set(m.userId, {
|
|
@@ -16835,7 +16835,7 @@ function UnitMembersTab({ item }) {
|
|
|
16835
16835
|
}
|
|
16836
16836
|
return map;
|
|
16837
16837
|
}, [orgMembers]);
|
|
16838
|
-
const available =
|
|
16838
|
+
const available = React122.useMemo(
|
|
16839
16839
|
() => orgMembers.filter((m) => !(rows ?? []).some((r) => r.userId === m.userId)),
|
|
16840
16840
|
[orgMembers, rows]
|
|
16841
16841
|
);
|
|
@@ -17041,15 +17041,15 @@ function MemberAccessBody({
|
|
|
17041
17041
|
const units = useUnitStore((s) => s.units);
|
|
17042
17042
|
const byId = useUnitStore((s) => s.byId);
|
|
17043
17043
|
const profiles = usePermissionsStore((s) => s.profiles);
|
|
17044
|
-
const [bindings, setBindings] =
|
|
17045
|
-
const [loading, setLoading] =
|
|
17046
|
-
const [adding, setAdding] =
|
|
17047
|
-
const branches =
|
|
17048
|
-
const unbound =
|
|
17044
|
+
const [bindings, setBindings] = React122.useState([]);
|
|
17045
|
+
const [loading, setLoading] = React122.useState(false);
|
|
17046
|
+
const [adding, setAdding] = React122.useState(false);
|
|
17047
|
+
const branches = React122.useMemo(() => units.filter((u) => u.isActive !== false), [units]);
|
|
17048
|
+
const unbound = React122.useMemo(
|
|
17049
17049
|
() => branches.filter((u) => !bindings.some((b) => b.locationId === u.id)),
|
|
17050
17050
|
[branches, bindings]
|
|
17051
17051
|
);
|
|
17052
|
-
const reload =
|
|
17052
|
+
const reload = React122.useCallback(async () => {
|
|
17053
17053
|
if (!userId) return;
|
|
17054
17054
|
setLoading(true);
|
|
17055
17055
|
try {
|
|
@@ -17059,7 +17059,7 @@ function MemberAccessBody({
|
|
|
17059
17059
|
}
|
|
17060
17060
|
}, [userId]);
|
|
17061
17061
|
const version5 = useDataVersion(UNIT_ACCESS_CHANGED);
|
|
17062
|
-
|
|
17062
|
+
React122.useEffect(() => {
|
|
17063
17063
|
void reload();
|
|
17064
17064
|
}, [reload, version5]);
|
|
17065
17065
|
async function add(unitId) {
|
|
@@ -17706,7 +17706,7 @@ function useWrongApp() {
|
|
|
17706
17706
|
const tenantId2 = useAppConfigStore((s) => s.tenantId);
|
|
17707
17707
|
const activeTenantId = useOrganizationStore((s) => s.currentOrg?.id ?? null);
|
|
17708
17708
|
const appId = resolveAppId();
|
|
17709
|
-
return
|
|
17709
|
+
return React122.useMemo(() => {
|
|
17710
17710
|
if (!appId || !activeTenantId || tenantId2 !== activeTenantId) return { app: null };
|
|
17711
17711
|
const list = (apps ?? []).filter((a) => !a.house);
|
|
17712
17712
|
if (!list.length) return { app: null };
|
|
@@ -17829,13 +17829,13 @@ function surveyTokenFromPath(pathname) {
|
|
|
17829
17829
|
return m ? decodeURIComponent(m[1]) : null;
|
|
17830
17830
|
}
|
|
17831
17831
|
function PublicSurveyPage({ token, appName }) {
|
|
17832
|
-
const [loaded2, setLoaded] =
|
|
17833
|
-
const [draft, setDraft] =
|
|
17834
|
-
const [name, setName] =
|
|
17835
|
-
const [sending, setSending] =
|
|
17836
|
-
const [sent, setSent] =
|
|
17837
|
-
const [failed, setFailed] =
|
|
17838
|
-
|
|
17832
|
+
const [loaded2, setLoaded] = React122__default.useState(null);
|
|
17833
|
+
const [draft, setDraft] = React122__default.useState({});
|
|
17834
|
+
const [name, setName] = React122__default.useState("");
|
|
17835
|
+
const [sending, setSending] = React122__default.useState(false);
|
|
17836
|
+
const [sent, setSent] = React122__default.useState(null);
|
|
17837
|
+
const [failed, setFailed] = React122__default.useState(null);
|
|
17838
|
+
React122__default.useEffect(() => {
|
|
17839
17839
|
let alive = true;
|
|
17840
17840
|
const client3 = getFayzSupabaseClientOptional();
|
|
17841
17841
|
if (!client3) {
|
|
@@ -18121,7 +18121,7 @@ function isServed2(route) {
|
|
|
18121
18121
|
function getPersonActions(kind) {
|
|
18122
18122
|
return ACTIONS.filter((a) => !a.kinds || (kind ? a.kinds.includes(kind) : false)).filter((a) => !a.requiresRoute || isServed2(a.requiresRoute)).sort((a, b) => (a.order ?? 100) - (b.order ?? 100));
|
|
18123
18123
|
}
|
|
18124
|
-
var RouteErrorBoundary = class extends
|
|
18124
|
+
var RouteErrorBoundary = class extends React122.Component {
|
|
18125
18125
|
constructor() {
|
|
18126
18126
|
super(...arguments);
|
|
18127
18127
|
this.state = { crashed: false, report: null };
|
|
@@ -18163,7 +18163,7 @@ var RouteErrorBoundary = class extends React120.Component {
|
|
|
18163
18163
|
}
|
|
18164
18164
|
};
|
|
18165
18165
|
function RouteErrorScreen({ report, tr, onBack, onRetry, backLabel }) {
|
|
18166
|
-
const [copied, setCopied] =
|
|
18166
|
+
const [copied, setCopied] = React122.useState(false);
|
|
18167
18167
|
const copyDetails = () => {
|
|
18168
18168
|
if (!report || typeof navigator === "undefined" || !navigator.clipboard) return;
|
|
18169
18169
|
const details = [
|
|
@@ -18268,9 +18268,9 @@ function UnitSwitching({ unitName, isAll, onDone }) {
|
|
|
18268
18268
|
const v = t(key);
|
|
18269
18269
|
return !v || v === key ? fallback : v;
|
|
18270
18270
|
};
|
|
18271
|
-
const doneRef =
|
|
18271
|
+
const doneRef = React122.useRef(onDone);
|
|
18272
18272
|
doneRef.current = onDone;
|
|
18273
|
-
|
|
18273
|
+
React122.useEffect(() => {
|
|
18274
18274
|
const id = window.setTimeout(() => doneRef.current(), HOLD_MS);
|
|
18275
18275
|
return () => window.clearTimeout(id);
|
|
18276
18276
|
}, []);
|
|
@@ -18327,11 +18327,11 @@ function UnitPickerDialog() {
|
|
|
18327
18327
|
const myUnitIds = useUnitStore((s) => s.myUnitIds);
|
|
18328
18328
|
const activeUnitId = useUnitStore((s) => s.activeUnitId);
|
|
18329
18329
|
const beginSwitch = useUnitSwitchingStore((s) => s.begin);
|
|
18330
|
-
const reachable =
|
|
18330
|
+
const reachable = React122.useMemo(
|
|
18331
18331
|
() => myUnitIds.length > 0 ? myUnitIds : units.filter((u) => u.kind !== "region").map((u) => u.id),
|
|
18332
18332
|
[myUnitIds, units]
|
|
18333
18333
|
);
|
|
18334
|
-
const groups =
|
|
18334
|
+
const groups = React122.useMemo(() => {
|
|
18335
18335
|
const out = [];
|
|
18336
18336
|
if (reachable.length > 1) {
|
|
18337
18337
|
out.push({ id: "_all", options: [{ id: ALL_UNITS, label: "Todas as unidades" }] });
|
|
@@ -18530,16 +18530,16 @@ function WorkspaceSetupFlow({
|
|
|
18530
18530
|
const user = useAuthStore((s) => s.user);
|
|
18531
18531
|
const { switchOrg } = useTenant();
|
|
18532
18532
|
const closeSetup = useWorkspaceSetupStore((s) => s.close);
|
|
18533
|
-
const uploadLogo =
|
|
18533
|
+
const uploadLogo = React122.useMemo(
|
|
18534
18534
|
() => user ? createLogoUploader(user.id) : void 0,
|
|
18535
18535
|
[user?.id]
|
|
18536
18536
|
);
|
|
18537
|
-
const country =
|
|
18537
|
+
const country = React122.useMemo(
|
|
18538
18538
|
() => currency === "BRL" || (locale ?? "").toLowerCase().startsWith("pt") ? "BR" : void 0,
|
|
18539
18539
|
[currency, locale]
|
|
18540
18540
|
);
|
|
18541
|
-
const stepsRef =
|
|
18542
|
-
const analyzeSite =
|
|
18541
|
+
const stepsRef = React122.useRef([]);
|
|
18542
|
+
const analyzeSite = React122.useMemo(
|
|
18543
18543
|
() => createSiteAnalyzer({
|
|
18544
18544
|
apiBaseUrl: resolveFayzApiBaseUrl(),
|
|
18545
18545
|
steps: () => stepsRef.current,
|
|
@@ -18547,7 +18547,7 @@ function WorkspaceSetupFlow({
|
|
|
18547
18547
|
}),
|
|
18548
18548
|
[locale]
|
|
18549
18549
|
);
|
|
18550
|
-
const steps =
|
|
18550
|
+
const steps = React122.useMemo(
|
|
18551
18551
|
() => buildWorkspaceSetupSteps({
|
|
18552
18552
|
verticalId,
|
|
18553
18553
|
uploadLogo,
|
|
@@ -18559,13 +18559,13 @@ function WorkspaceSetupFlow({
|
|
|
18559
18559
|
[verticalId, uploadLogo, media, country, analyzeSite]
|
|
18560
18560
|
);
|
|
18561
18561
|
stepsRef.current = steps;
|
|
18562
|
-
const initialValues2 =
|
|
18562
|
+
const initialValues2 = React122.useMemo(
|
|
18563
18563
|
// Seeding the contact email with the account's own is one field fewer to
|
|
18564
18564
|
// type, and it is right far more often than it is wrong.
|
|
18565
18565
|
() => user?.email ? { "workspace.email": user.email } : {},
|
|
18566
18566
|
[user?.email]
|
|
18567
18567
|
);
|
|
18568
|
-
const onSubmit =
|
|
18568
|
+
const onSubmit = React122.useCallback(
|
|
18569
18569
|
async (values) => {
|
|
18570
18570
|
if (!user) throw new Error(tl("You are signed out.", "Sua sess\xE3o terminou."));
|
|
18571
18571
|
const org = await submitWorkspaceSetup({
|
|
@@ -18682,16 +18682,16 @@ function GettingStartedWidget() {
|
|
|
18682
18682
|
const t = useTranslation();
|
|
18683
18683
|
const rows = useActivationStore((s) => s.rows);
|
|
18684
18684
|
const catalog = useActivationStore((s) => s.catalog);
|
|
18685
|
-
const steps =
|
|
18685
|
+
const steps = React122.useMemo(
|
|
18686
18686
|
() => selectSteps({ ...useActivationStore.getState(), rows, catalog }),
|
|
18687
18687
|
[rows, catalog]
|
|
18688
18688
|
);
|
|
18689
|
-
const onNavigate =
|
|
18689
|
+
const onNavigate = React122.useCallback((path) => {
|
|
18690
18690
|
const step = useActivationStore.getState().catalog.find((s) => s.route === path);
|
|
18691
18691
|
navigateTo(path);
|
|
18692
18692
|
if (step?.tour) useTourStore.getState().start(step.tour);
|
|
18693
18693
|
}, []);
|
|
18694
|
-
const onAskAgent =
|
|
18694
|
+
const onAskAgent = React122.useCallback((step) => {
|
|
18695
18695
|
void startGuidedRun(step.id);
|
|
18696
18696
|
}, []);
|
|
18697
18697
|
if (!rows || rows.length === 0) return null;
|
|
@@ -18716,16 +18716,16 @@ function ActivationChecklistCard({
|
|
|
18716
18716
|
}) {
|
|
18717
18717
|
const rows = useActivationStore((s) => s.rows);
|
|
18718
18718
|
const catalog = useActivationStore((s) => s.catalog);
|
|
18719
|
-
const steps =
|
|
18719
|
+
const steps = React122.useMemo(
|
|
18720
18720
|
() => selectSteps({ ...useActivationStore.getState(), rows, catalog }),
|
|
18721
18721
|
[rows, catalog]
|
|
18722
18722
|
);
|
|
18723
|
-
const onNavigate =
|
|
18723
|
+
const onNavigate = React122.useCallback((path) => {
|
|
18724
18724
|
const step = useActivationStore.getState().catalog.find((s) => s.route === path);
|
|
18725
18725
|
navigateTo(path);
|
|
18726
18726
|
if (step?.tour) useTourStore.getState().start(step.tour);
|
|
18727
18727
|
}, []);
|
|
18728
|
-
const onAskAgent =
|
|
18728
|
+
const onAskAgent = React122.useCallback((step) => {
|
|
18729
18729
|
void startGuidedRun(step.id);
|
|
18730
18730
|
}, []);
|
|
18731
18731
|
if (!rows || rows.length === 0) return null;
|
|
@@ -18745,9 +18745,62 @@ function ActivationChecklistCard({
|
|
|
18745
18745
|
}
|
|
18746
18746
|
);
|
|
18747
18747
|
}
|
|
18748
|
-
|
|
18748
|
+
function wasCompleted(storageKey2) {
|
|
18749
|
+
try {
|
|
18750
|
+
return localStorage.getItem(storageKey2) === "true";
|
|
18751
|
+
} catch {
|
|
18752
|
+
return false;
|
|
18753
|
+
}
|
|
18754
|
+
}
|
|
18755
|
+
function rememberCompleted(storageKey2) {
|
|
18756
|
+
try {
|
|
18757
|
+
localStorage.setItem(storageKey2, "true");
|
|
18758
|
+
} catch {
|
|
18759
|
+
}
|
|
18760
|
+
}
|
|
18761
|
+
function usePluginOnboardingGate(storageKey2, checkExistingData) {
|
|
18762
|
+
const checkRef = React122.useRef(checkExistingData);
|
|
18763
|
+
checkRef.current = checkExistingData;
|
|
18764
|
+
const [status, setStatus] = React122.useState(
|
|
18765
|
+
() => wasCompleted(storageKey2) ? "complete" : "checking"
|
|
18766
|
+
);
|
|
18767
|
+
React122.useEffect(() => {
|
|
18768
|
+
if (status !== "checking") return;
|
|
18769
|
+
let cancelled = false;
|
|
18770
|
+
void checkRef.current().then((hasData) => {
|
|
18771
|
+
if (cancelled) return;
|
|
18772
|
+
if (hasData) rememberCompleted(storageKey2);
|
|
18773
|
+
setStatus(hasData ? "complete" : "needed");
|
|
18774
|
+
}).catch(() => {
|
|
18775
|
+
if (!cancelled) setStatus("complete");
|
|
18776
|
+
});
|
|
18777
|
+
return () => {
|
|
18778
|
+
cancelled = true;
|
|
18779
|
+
};
|
|
18780
|
+
}, [status, storageKey2]);
|
|
18781
|
+
const complete = React122.useCallback(() => {
|
|
18782
|
+
rememberCompleted(storageKey2);
|
|
18783
|
+
setStatus("complete");
|
|
18784
|
+
}, [storageKey2]);
|
|
18785
|
+
return { status, complete };
|
|
18786
|
+
}
|
|
18787
|
+
function PluginOnboardingGateSkeleton() {
|
|
18788
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-4 p-4 sm:p-6", "aria-busy": "true", "aria-label": "Carregando m\xF3dulo", children: [
|
|
18789
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3", children: [
|
|
18790
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-7 w-40" }),
|
|
18791
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-32 rounded-button" })
|
|
18792
|
+
] }),
|
|
18793
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-3", children: [
|
|
18794
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-24 rounded-card" }),
|
|
18795
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-24 rounded-card" }),
|
|
18796
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-24 rounded-card" })
|
|
18797
|
+
] }),
|
|
18798
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-72 rounded-card" })
|
|
18799
|
+
] });
|
|
18800
|
+
}
|
|
18801
|
+
var WidgetSurfaceContext = React122.createContext("rail");
|
|
18749
18802
|
function useWidgetSurface() {
|
|
18750
|
-
return
|
|
18803
|
+
return React122.useContext(WidgetSurfaceContext);
|
|
18751
18804
|
}
|
|
18752
18805
|
function WidgetSlot({
|
|
18753
18806
|
zone,
|
|
@@ -18791,7 +18844,7 @@ function useNavContribution(id, entries2) {
|
|
|
18791
18844
|
const setContribution = useNavContributionsStore((s) => s.setContribution);
|
|
18792
18845
|
const clearContribution = useNavContributionsStore((s) => s.clearContribution);
|
|
18793
18846
|
const key = JSON.stringify(entries2);
|
|
18794
|
-
|
|
18847
|
+
React122.useEffect(() => {
|
|
18795
18848
|
setContribution(id, entries2);
|
|
18796
18849
|
return () => clearContribution(id);
|
|
18797
18850
|
}, [id, key]);
|
|
@@ -18861,7 +18914,7 @@ function useAppDirectory() {
|
|
|
18861
18914
|
const tenantId2 = useActiveTenantId();
|
|
18862
18915
|
const apps = useAppDirectoryStore((s) => s.apps);
|
|
18863
18916
|
const load = useAppDirectoryStore((s) => s.load);
|
|
18864
|
-
|
|
18917
|
+
React122.useEffect(() => {
|
|
18865
18918
|
if (tenantId2) void load(tenantId2, resolveAppId());
|
|
18866
18919
|
}, [tenantId2, load]);
|
|
18867
18920
|
return { apps };
|
|
@@ -18953,7 +19006,7 @@ var CSS2 = `
|
|
|
18953
19006
|
}
|
|
18954
19007
|
`;
|
|
18955
19008
|
function useWordmarkStyle() {
|
|
18956
|
-
|
|
19009
|
+
React122.useEffect(() => {
|
|
18957
19010
|
if (typeof document === "undefined") return;
|
|
18958
19011
|
const existing = document.getElementById(STYLE_ID2);
|
|
18959
19012
|
if (existing) {
|
|
@@ -19187,7 +19240,7 @@ var SWAP_CSS = `
|
|
|
19187
19240
|
}
|
|
19188
19241
|
`;
|
|
19189
19242
|
function useSwapStyle() {
|
|
19190
|
-
|
|
19243
|
+
React122.useEffect(() => {
|
|
19191
19244
|
if (typeof document === "undefined" || document.getElementById(SWAP_STYLE_ID)) return;
|
|
19192
19245
|
const el = document.createElement("style");
|
|
19193
19246
|
el.id = SWAP_STYLE_ID;
|
|
@@ -19196,9 +19249,9 @@ function useSwapStyle() {
|
|
|
19196
19249
|
}, []);
|
|
19197
19250
|
}
|
|
19198
19251
|
function AppSwitcherView({ apps, mark, logo, collapsed = false, label: label2, onSelect, brandedByTenant = false }) {
|
|
19199
|
-
const [hovered, setHovered] =
|
|
19200
|
-
const [open, setOpen] =
|
|
19201
|
-
const [pending2, setPending] =
|
|
19252
|
+
const [hovered, setHovered] = React122.useState(false);
|
|
19253
|
+
const [open, setOpen] = React122.useState(false);
|
|
19254
|
+
const [pending2, setPending] = React122.useState(null);
|
|
19202
19255
|
const active2 = hovered || open;
|
|
19203
19256
|
useSwapStyle();
|
|
19204
19257
|
const brand = /* @__PURE__ */ jsx(BrandFace, { mark, logo, collapsed });
|
|
@@ -19345,7 +19398,7 @@ function useContextualNav(nav) {
|
|
|
19345
19398
|
const setNav = useContextualNavStore((s) => s.setNav);
|
|
19346
19399
|
const clearNav = useContextualNavStore((s) => s.clearNav);
|
|
19347
19400
|
const key = nav ? JSON.stringify(nav) : null;
|
|
19348
|
-
|
|
19401
|
+
React122.useEffect(() => {
|
|
19349
19402
|
if (!nav) return;
|
|
19350
19403
|
setNav(nav);
|
|
19351
19404
|
return () => clearNav(nav.base);
|
|
@@ -19417,7 +19470,7 @@ async function findNearestUnit(units, reachable) {
|
|
|
19417
19470
|
}
|
|
19418
19471
|
var UNIT_SEARCH_THRESHOLD = 8;
|
|
19419
19472
|
function WorkspaceUnitSheet({ onClose, canCreate = true }) {
|
|
19420
|
-
const [level, setLevel] =
|
|
19473
|
+
const [level, setLevel] = React122.useState("root");
|
|
19421
19474
|
return /* @__PURE__ */ jsxs(
|
|
19422
19475
|
BottomSheet,
|
|
19423
19476
|
{
|
|
@@ -19480,9 +19533,9 @@ function WorkspaceLevel({ canCreate }) {
|
|
|
19480
19533
|
const closeSheet = useSheetClose();
|
|
19481
19534
|
const beginSwitch = useWorkspaceSwitchingStore((s) => s.begin);
|
|
19482
19535
|
const openSetup = useWorkspaceSetupStore((s) => s.open);
|
|
19483
|
-
const [query, setQuery] =
|
|
19536
|
+
const [query, setQuery] = React122.useState("");
|
|
19484
19537
|
const org = tenant?.org ?? null;
|
|
19485
|
-
const options =
|
|
19538
|
+
const options = React122.useMemo(() => {
|
|
19486
19539
|
const list = tenant?.userOrgs ?? [];
|
|
19487
19540
|
if (list.length) return list;
|
|
19488
19541
|
return org ? [{ orgId: org.id, orgName: org.name, orgSlug: org.slug, orgLogoUrl: org.logoUrl }] : [];
|
|
@@ -19491,7 +19544,7 @@ function WorkspaceLevel({ canCreate }) {
|
|
|
19491
19544
|
const v = t.t(key);
|
|
19492
19545
|
return !v || v === key ? fallback : v;
|
|
19493
19546
|
};
|
|
19494
|
-
const search =
|
|
19547
|
+
const search = React122.useMemo(
|
|
19495
19548
|
() => searchWorkspaces(options, query, org?.id),
|
|
19496
19549
|
[options, query, org?.id]
|
|
19497
19550
|
);
|
|
@@ -19543,8 +19596,8 @@ function WorkspaceLevel({ canCreate }) {
|
|
|
19543
19596
|
function UnitLevel() {
|
|
19544
19597
|
useUnitBootstrap();
|
|
19545
19598
|
const closeSheet = useSheetClose();
|
|
19546
|
-
const [locating, setLocating] =
|
|
19547
|
-
const [query, setQuery] =
|
|
19599
|
+
const [locating, setLocating] = React122.useState(false);
|
|
19600
|
+
const [query, setQuery] = React122.useState("");
|
|
19548
19601
|
const units = useUnitStore((s) => s.units);
|
|
19549
19602
|
const tree = useUnitStore((s) => s.tree);
|
|
19550
19603
|
const byId = useUnitStore((s) => s.byId);
|
|
@@ -19581,7 +19634,7 @@ function UnitLevel() {
|
|
|
19581
19634
|
const leaves = node.children.filter((c) => c.kind !== "region" && reachable.includes(c.id));
|
|
19582
19635
|
const regions = node.children.filter((c) => c.kind === "region");
|
|
19583
19636
|
if (leaves.length === 0 && regions.length === 0) return null;
|
|
19584
|
-
return /* @__PURE__ */ jsxs(
|
|
19637
|
+
return /* @__PURE__ */ jsxs(React122.Fragment, { children: [
|
|
19585
19638
|
/* @__PURE__ */ jsx("p", { className: "px-4 pb-1 pt-3 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground", children: node.name }),
|
|
19586
19639
|
leaves.length > 0 && /* @__PURE__ */ jsx(SheetCard, { children: leaves.map(leaf) }),
|
|
19587
19640
|
regions.map(group)
|
|
@@ -19651,7 +19704,7 @@ function UnitLevel() {
|
|
|
19651
19704
|
}
|
|
19652
19705
|
function WorkspaceUnitRow({ canCreate = true }) {
|
|
19653
19706
|
useUnitBootstrap();
|
|
19654
|
-
const [open, setOpen] =
|
|
19707
|
+
const [open, setOpen] = React122.useState(false);
|
|
19655
19708
|
const tenant = useTenantOptional();
|
|
19656
19709
|
const org = tenant?.org ?? null;
|
|
19657
19710
|
const unitMode = useUnitStore((s) => s.unitMode);
|
|
@@ -19838,10 +19891,10 @@ function SeuSiteWidget({ fallback, onEdit }) {
|
|
|
19838
19891
|
const load = useFayzProjectsStore((s) => s.load);
|
|
19839
19892
|
const loadedFor = useFayzProjectsStore((s) => s.loadedFor);
|
|
19840
19893
|
const collapsed = useLayoutStore((s) => s.sidebarCollapsed);
|
|
19841
|
-
const [selectedId, setSelectedId] =
|
|
19842
|
-
const [hovered, setHovered] =
|
|
19843
|
-
const [primed, setPrimed] =
|
|
19844
|
-
const closeTimer =
|
|
19894
|
+
const [selectedId, setSelectedId] = React122.useState(null);
|
|
19895
|
+
const [hovered, setHovered] = React122.useState(false);
|
|
19896
|
+
const [primed, setPrimed] = React122.useState(false);
|
|
19897
|
+
const closeTimer = React122.useRef(null);
|
|
19845
19898
|
const cancelClose = () => {
|
|
19846
19899
|
if (closeTimer.current) {
|
|
19847
19900
|
clearTimeout(closeTimer.current);
|
|
@@ -19857,8 +19910,8 @@ function SeuSiteWidget({ fallback, onEdit }) {
|
|
|
19857
19910
|
cancelClose();
|
|
19858
19911
|
closeTimer.current = setTimeout(() => setHovered(false), 140);
|
|
19859
19912
|
};
|
|
19860
|
-
|
|
19861
|
-
|
|
19913
|
+
React122.useEffect(() => () => cancelClose(), []);
|
|
19914
|
+
React122.useEffect(() => {
|
|
19862
19915
|
if (loadedFor !== (currentOrgId ?? null)) void load(currentOrgId);
|
|
19863
19916
|
}, [currentOrgId, loadedFor, load]);
|
|
19864
19917
|
const active2 = projects.find((p) => p.id === selectedId) ?? defaultProjectOf(projects) ?? synthFromFallback(fallback);
|
|
@@ -19969,10 +20022,10 @@ function SitePreview({
|
|
|
19969
20022
|
onEdit,
|
|
19970
20023
|
tr
|
|
19971
20024
|
}) {
|
|
19972
|
-
const [nonce, setNonce] =
|
|
19973
|
-
const [loading, setLoading] =
|
|
20025
|
+
const [nonce, setNonce] = React122.useState(0);
|
|
20026
|
+
const [loading, setLoading] = React122.useState(true);
|
|
19974
20027
|
const url = previewSourceOf(project);
|
|
19975
|
-
|
|
20028
|
+
React122.useEffect(() => {
|
|
19976
20029
|
setLoading(true);
|
|
19977
20030
|
}, [nonce, url]);
|
|
19978
20031
|
const action = "flex items-center gap-1.5 rounded-button px-2 py-1 text-[11.5px] font-medium text-sidebar-foreground/80 transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground disabled:cursor-not-allowed disabled:opacity-40";
|
|
@@ -20082,10 +20135,10 @@ function RightRail({ frame = true, attached = true }) {
|
|
|
20082
20135
|
const pageOpen = useRightRailStore((s) => s.pageOpen);
|
|
20083
20136
|
const setPageSlot = useRightRailStore((s) => s.setPageSlot);
|
|
20084
20137
|
const setWidth = useRightRailStore((s) => s.setWidth);
|
|
20085
|
-
const rootRef =
|
|
20086
|
-
const [actionsSlot, setActionsSlot] =
|
|
20087
|
-
const [leadingSlot, setLeadingSlot] =
|
|
20088
|
-
|
|
20138
|
+
const rootRef = React122.useRef(null);
|
|
20139
|
+
const [actionsSlot, setActionsSlot] = React122.useState(null);
|
|
20140
|
+
const [leadingSlot, setLeadingSlot] = React122.useState(null);
|
|
20141
|
+
React122.useEffect(() => {
|
|
20089
20142
|
if (!open) return;
|
|
20090
20143
|
const el = rootRef.current;
|
|
20091
20144
|
if (!el) return;
|
|
@@ -20107,8 +20160,8 @@ function RightRail({ frame = true, attached = true }) {
|
|
|
20107
20160
|
el.removeEventListener("transitionend", publish);
|
|
20108
20161
|
};
|
|
20109
20162
|
}, [open, setWidth]);
|
|
20110
|
-
const [narrow, setNarrow] =
|
|
20111
|
-
|
|
20163
|
+
const [narrow, setNarrow] = React122.useState(false);
|
|
20164
|
+
React122.useEffect(() => {
|
|
20112
20165
|
if (!open) return;
|
|
20113
20166
|
const el = rootRef.current;
|
|
20114
20167
|
if (!el) return;
|
|
@@ -20462,9 +20515,9 @@ var TYPE_COLORS = {
|
|
|
20462
20515
|
fix: "text-success"
|
|
20463
20516
|
};
|
|
20464
20517
|
function ChangelogFeed({ changelogUrl, className }) {
|
|
20465
|
-
const [entries2, setEntries] =
|
|
20466
|
-
const [loading, setLoading] =
|
|
20467
|
-
|
|
20518
|
+
const [entries2, setEntries] = React122.useState([]);
|
|
20519
|
+
const [loading, setLoading] = React122.useState(false);
|
|
20520
|
+
React122.useEffect(() => {
|
|
20468
20521
|
if (!changelogUrl) return;
|
|
20469
20522
|
setLoading(true);
|
|
20470
20523
|
fetch(changelogUrl).then((r) => r.json()).then((data) => setEntries(data)).catch(() => setEntries([])).finally(() => setLoading(false));
|
|
@@ -20524,7 +20577,7 @@ function NotificationInbox({
|
|
|
20524
20577
|
changelogUrl,
|
|
20525
20578
|
className
|
|
20526
20579
|
}) {
|
|
20527
|
-
const [activeTab, setActiveTab] =
|
|
20580
|
+
const [activeTab, setActiveTab] = React122.useState("inbox");
|
|
20528
20581
|
const unreadCount = notifications.filter((n) => !n.read).length;
|
|
20529
20582
|
const inboxNotifications = notifications.filter((n) => n.category !== "changelog");
|
|
20530
20583
|
return /* @__PURE__ */ jsxs("div", { className: cn("flex w-80 flex-col", className), children: [
|
|
@@ -20621,11 +20674,11 @@ function NotificationInbox({
|
|
|
20621
20674
|
}
|
|
20622
20675
|
function BrandAgentSurface() {
|
|
20623
20676
|
const org = useOrganizationStore((s) => s.currentOrg);
|
|
20624
|
-
const brand =
|
|
20677
|
+
const brand = React122__default.useMemo(
|
|
20625
20678
|
() => normalizeBrand(org?.settings?.branding, { name: org?.name, logoUrl: org?.logoUrl }),
|
|
20626
20679
|
[org?.settings, org?.name, org?.logoUrl]
|
|
20627
20680
|
);
|
|
20628
|
-
const surface =
|
|
20681
|
+
const surface = React122__default.useMemo(() => ({
|
|
20629
20682
|
id: "core.brand",
|
|
20630
20683
|
describe: () => ({
|
|
20631
20684
|
title: "Marca da casa",
|
|
@@ -20638,15 +20691,15 @@ function BrandAgentSurface() {
|
|
|
20638
20691
|
return null;
|
|
20639
20692
|
}
|
|
20640
20693
|
function ConnectConsentPage({ appName, logo }) {
|
|
20641
|
-
const [state, setState] =
|
|
20642
|
-
const [tenantId2, setTenantId] =
|
|
20643
|
-
const request =
|
|
20694
|
+
const [state, setState] = React122__default.useState({ status: "loading" });
|
|
20695
|
+
const [tenantId2, setTenantId] = React122__default.useState("");
|
|
20696
|
+
const request = React122__default.useMemo(
|
|
20644
20697
|
() => new URLSearchParams(window.location.search).get("request") ?? "",
|
|
20645
20698
|
[]
|
|
20646
20699
|
);
|
|
20647
|
-
const connection =
|
|
20700
|
+
const connection = React122__default.useMemo(() => resolveFayzAgentConnection(), []);
|
|
20648
20701
|
const product = appName ?? document.title ?? "este app";
|
|
20649
|
-
const authorizedFetch =
|
|
20702
|
+
const authorizedFetch = React122__default.useCallback(
|
|
20650
20703
|
async (path, init) => {
|
|
20651
20704
|
if (!connection) throw new Error("Este app n\xE3o est\xE1 ligado a um projeto Fayz.");
|
|
20652
20705
|
const supabase = getFayzSupabaseClientOptional();
|
|
@@ -20670,7 +20723,7 @@ function ConnectConsentPage({ appName, logo }) {
|
|
|
20670
20723
|
},
|
|
20671
20724
|
[connection]
|
|
20672
20725
|
);
|
|
20673
|
-
|
|
20726
|
+
React122__default.useEffect(() => {
|
|
20674
20727
|
let cancelled = false;
|
|
20675
20728
|
(async () => {
|
|
20676
20729
|
if (!request) {
|
|
@@ -20914,7 +20967,7 @@ function Row2({ label: label2, value }) {
|
|
|
20914
20967
|
function PageActions({ actions, className }) {
|
|
20915
20968
|
const access = useAccessOptional();
|
|
20916
20969
|
const openUpgrade = useUpgradeModalStore((s) => s.open);
|
|
20917
|
-
const resolved =
|
|
20970
|
+
const resolved = React122__default.useMemo(
|
|
20918
20971
|
() => actions.map((a) => {
|
|
20919
20972
|
const { permission, limitKey, onSelect, ...rest } = a;
|
|
20920
20973
|
let hidden = false;
|
|
@@ -20944,25 +20997,25 @@ function AddConnectorPanel({
|
|
|
20944
20997
|
onSelect
|
|
20945
20998
|
}) {
|
|
20946
20999
|
const { t } = useTranslation$1();
|
|
20947
|
-
const [query, setQuery] =
|
|
21000
|
+
const [query, setQuery] = React122__default.useState("");
|
|
20948
21001
|
const modules = useInstalledModuleIds();
|
|
20949
21002
|
const catalog = useConnectorCatalog();
|
|
20950
21003
|
const scoped = !!categories?.length;
|
|
20951
|
-
const addable =
|
|
21004
|
+
const addable = React122__default.useMemo(
|
|
20952
21005
|
() => inCategories(addableConnectors(connectors ?? []), categories),
|
|
20953
21006
|
[connectors, categories]
|
|
20954
21007
|
);
|
|
20955
|
-
const shelf =
|
|
21008
|
+
const shelf = React122__default.useMemo(() => {
|
|
20956
21009
|
if (connectors === null) return [];
|
|
20957
21010
|
return inCategories(
|
|
20958
21011
|
shelfIntegrations({ present: connectors, installedModules: modules, catalog: catalog ?? [] }),
|
|
20959
21012
|
categories
|
|
20960
21013
|
);
|
|
20961
21014
|
}, [connectors, modules, catalog, categories]);
|
|
20962
|
-
const filtered =
|
|
20963
|
-
const filteredShelf =
|
|
20964
|
-
const soon =
|
|
20965
|
-
const elsewhere =
|
|
21015
|
+
const filtered = React122__default.useMemo(() => filterConnectors(addable, "all", query), [addable, query]);
|
|
21016
|
+
const filteredShelf = React122__default.useMemo(() => filterAvailable(shelf, query), [shelf, query]);
|
|
21017
|
+
const soon = React122__default.useMemo(() => comingSoonHere(filteredShelf), [filteredShelf]);
|
|
21018
|
+
const elsewhere = React122__default.useMemo(() => withAnotherModule(filteredShelf), [filteredShelf]);
|
|
20966
21019
|
const searchable = addable.length + shelf.length > 6;
|
|
20967
21020
|
return /* @__PURE__ */ jsx(Modal, { open, onOpenChange, children: /* @__PURE__ */ jsxs(ModalContent, { size: "2xl", children: [
|
|
20968
21021
|
/* @__PURE__ */ jsxs(ModalHeader, { children: [
|
|
@@ -21121,22 +21174,22 @@ function AddConnectorButton({ onClick }) {
|
|
|
21121
21174
|
function ConnectorsTab() {
|
|
21122
21175
|
const { t } = useTranslation$1();
|
|
21123
21176
|
const { connectors, error, reload, revokeGrant, agentAvailable, tenantReady } = useConnectors();
|
|
21124
|
-
const [adding, setAdding] =
|
|
21125
|
-
const [selected, setSelected] =
|
|
21126
|
-
const [filter, setFilter] =
|
|
21127
|
-
const [failure, setFailure] =
|
|
21128
|
-
const [revoking, setRevoking] =
|
|
21177
|
+
const [adding, setAdding] = React122__default.useState(false);
|
|
21178
|
+
const [selected, setSelected] = React122__default.useState(null);
|
|
21179
|
+
const [filter, setFilter] = React122__default.useState("all");
|
|
21180
|
+
const [failure, setFailure] = React122__default.useState(null);
|
|
21181
|
+
const [revoking, setRevoking] = React122__default.useState(null);
|
|
21129
21182
|
const assistantAvailable = useConnectorsPanelAvailable();
|
|
21130
|
-
const openJourney =
|
|
21183
|
+
const openJourney = React122__default.useCallback(
|
|
21131
21184
|
(connector) => {
|
|
21132
21185
|
if (assistantAvailable) openConnectorsPanel(connector);
|
|
21133
21186
|
else setSelected(connector);
|
|
21134
21187
|
},
|
|
21135
21188
|
[assistantAvailable]
|
|
21136
21189
|
);
|
|
21137
|
-
const visible =
|
|
21138
|
-
const groups =
|
|
21139
|
-
|
|
21190
|
+
const visible = React122__default.useMemo(() => filterConnectors(connectors ?? [], filter), [connectors, filter]);
|
|
21191
|
+
const groups = React122__default.useMemo(() => groupConnectors(visible), [visible]);
|
|
21192
|
+
React122__default.useEffect(() => {
|
|
21140
21193
|
if (!selected || !connectors) return;
|
|
21141
21194
|
const fresh = connectors.find((c) => c.id === selected.id);
|
|
21142
21195
|
if (fresh && fresh !== selected) setSelected(fresh);
|
|
@@ -21171,7 +21224,7 @@ function ConnectorsTab() {
|
|
|
21171
21224
|
(connectors?.length ?? 0) > 4 && /* @__PURE__ */ jsx(Filters, { value: filter, onChange: setFilter }),
|
|
21172
21225
|
connectors === null && /* @__PURE__ */ jsx(ConnectionsSkeleton, {}),
|
|
21173
21226
|
connectors !== null && visible.length === 0 && /* @__PURE__ */ jsx(Empty2, { title: t("connectors.emptyTitle"), body: t("connectors.emptyBody") }),
|
|
21174
|
-
visible.length > 0 && /* @__PURE__ */ jsx("ul", { className: "fayz-glass-surface divide-y divide-border overflow-hidden rounded-card border bg-card text-card-foreground shadow-sm", children: groups.map((group) => /* @__PURE__ */ jsxs(
|
|
21227
|
+
visible.length > 0 && /* @__PURE__ */ jsx("ul", { className: "fayz-glass-surface divide-y divide-border overflow-hidden rounded-card border bg-card text-card-foreground shadow-sm", children: groups.map((group) => /* @__PURE__ */ jsxs(React122__default.Fragment, { children: [
|
|
21175
21228
|
groups.length > 1 && /* @__PURE__ */ jsx(
|
|
21176
21229
|
"li",
|
|
21177
21230
|
{
|
|
@@ -21309,7 +21362,7 @@ function oauthFailureMessage(t, result) {
|
|
|
21309
21362
|
function useConnectorOAuthReturn() {
|
|
21310
21363
|
const { t } = useTranslation$1();
|
|
21311
21364
|
const runtime = usePluginRuntimeOptional();
|
|
21312
|
-
|
|
21365
|
+
React122__default.useEffect(() => {
|
|
21313
21366
|
if (typeof window === "undefined") return;
|
|
21314
21367
|
const result = readConnectorOAuthReturn(window.location.search);
|
|
21315
21368
|
if (!result) return;
|
|
@@ -21344,8 +21397,8 @@ function ConnectorDeliveries({
|
|
|
21344
21397
|
limit = 10
|
|
21345
21398
|
}) {
|
|
21346
21399
|
const { t } = useTranslation$1();
|
|
21347
|
-
const [rows, setRows] =
|
|
21348
|
-
|
|
21400
|
+
const [rows, setRows] = React122__default.useState(null);
|
|
21401
|
+
React122__default.useEffect(() => {
|
|
21349
21402
|
let cancelled = false;
|
|
21350
21403
|
void load({ limit }).then((r) => {
|
|
21351
21404
|
if (!cancelled) setRows(r);
|
|
@@ -21419,11 +21472,11 @@ var CURRENCIES = [
|
|
|
21419
21472
|
function CompanySettings({ tenant, onSave }) {
|
|
21420
21473
|
const { t } = useTranslation$1();
|
|
21421
21474
|
const { locale: uiLocale, setLocale: setUiLocale } = useLocaleStore();
|
|
21422
|
-
const [name, setName] =
|
|
21423
|
-
const [timezone, setTimezone] =
|
|
21424
|
-
const [currency, setCurrency] =
|
|
21425
|
-
const [saving, setSaving] =
|
|
21426
|
-
|
|
21475
|
+
const [name, setName] = React122.useState(tenant?.name ?? "");
|
|
21476
|
+
const [timezone, setTimezone] = React122.useState(tenant?.settings?.timezone ?? "UTC");
|
|
21477
|
+
const [currency, setCurrency] = React122.useState(tenant?.settings?.currency ?? "USD");
|
|
21478
|
+
const [saving, setSaving] = React122.useState(false);
|
|
21479
|
+
React122.useEffect(() => {
|
|
21427
21480
|
if (tenant) {
|
|
21428
21481
|
setName(tenant.name);
|
|
21429
21482
|
setTimezone(tenant.settings?.timezone ?? "UTC");
|
|
@@ -21515,15 +21568,15 @@ function UnitModeCard() {
|
|
|
21515
21568
|
const units = useUnitStore((s) => s.units);
|
|
21516
21569
|
const setMode = useUnitStore((s) => s.setMode);
|
|
21517
21570
|
const load = useUnitStore((s) => s.load);
|
|
21518
|
-
const [unbound, setUnbound] =
|
|
21519
|
-
const [bindEveryone, setBindEveryone] =
|
|
21520
|
-
const [pending2, setPending] =
|
|
21521
|
-
const [saving, setSaving] =
|
|
21522
|
-
const headquarters =
|
|
21571
|
+
const [unbound, setUnbound] = React122.useState(null);
|
|
21572
|
+
const [bindEveryone, setBindEveryone] = React122.useState(true);
|
|
21573
|
+
const [pending2, setPending] = React122.useState(null);
|
|
21574
|
+
const [saving, setSaving] = React122.useState(false);
|
|
21575
|
+
const headquarters = React122.useMemo(
|
|
21523
21576
|
() => units.find((u) => u.isHeadquarters && u.kind !== "region") ?? units.find((u) => u.kind !== "region"),
|
|
21524
21577
|
[units]
|
|
21525
21578
|
);
|
|
21526
|
-
|
|
21579
|
+
React122.useEffect(() => {
|
|
21527
21580
|
if (!org?.id || unitMode) return;
|
|
21528
21581
|
let alive = true;
|
|
21529
21582
|
void countUnboundMembers(org.id).then((n) => {
|
|
@@ -21687,10 +21740,10 @@ function getInitials(name) {
|
|
|
21687
21740
|
}
|
|
21688
21741
|
function UserProfile({ user, onSave, onAvatarChange }) {
|
|
21689
21742
|
const { t } = useTranslation$1();
|
|
21690
|
-
const [fullName, setFullName] =
|
|
21691
|
-
const [saving, setSaving] =
|
|
21692
|
-
const fileInputRef =
|
|
21693
|
-
|
|
21743
|
+
const [fullName, setFullName] = React122.useState(user?.fullName ?? "");
|
|
21744
|
+
const [saving, setSaving] = React122.useState(false);
|
|
21745
|
+
const fileInputRef = React122.useRef(null);
|
|
21746
|
+
React122.useEffect(() => {
|
|
21694
21747
|
if (user) {
|
|
21695
21748
|
setFullName(user.fullName);
|
|
21696
21749
|
}
|
|
@@ -21830,8 +21883,8 @@ async function fetchMyPersonId(tenantId2, userId) {
|
|
|
21830
21883
|
function useMyPersonId(enabled = true) {
|
|
21831
21884
|
const orgId = useOrganizationStore((s) => s.currentOrg?.id);
|
|
21832
21885
|
const userId = useAuthStore((s) => s.user?.id);
|
|
21833
|
-
const [personId, setPersonId] =
|
|
21834
|
-
|
|
21886
|
+
const [personId, setPersonId] = React122.useState(void 0);
|
|
21887
|
+
React122.useEffect(() => {
|
|
21835
21888
|
if (!enabled || !orgId || !userId) return;
|
|
21836
21889
|
let alive = true;
|
|
21837
21890
|
void dedup(`self:person:${orgId}:${userId}`, () => fetchMyPersonId(orgId, userId)).then((id) => {
|
|
@@ -21891,18 +21944,18 @@ function MyWorkspaceCard() {
|
|
|
21891
21944
|
const myUnitIds = useUnitStore((s) => s.myUnitIds);
|
|
21892
21945
|
const activeUnitId = useUnitStore((s) => s.activeUnitId);
|
|
21893
21946
|
const entryReason = useUnitStore((s) => s.entryReason);
|
|
21894
|
-
const [person, setPerson] =
|
|
21895
|
-
const [candidate, setCandidate] =
|
|
21896
|
-
const [linking, setLinking] =
|
|
21947
|
+
const [person, setPerson] = React122.useState(void 0);
|
|
21948
|
+
const [candidate, setCandidate] = React122.useState(null);
|
|
21949
|
+
const [linking, setLinking] = React122.useState(false);
|
|
21897
21950
|
const orgId = currentOrg?.id;
|
|
21898
21951
|
const userId = user?.id;
|
|
21899
|
-
const load =
|
|
21952
|
+
const load = React122.useCallback(async () => {
|
|
21900
21953
|
if (!orgId || !userId) return;
|
|
21901
21954
|
const linked = await fetchMyPersonRecord(orgId, userId);
|
|
21902
21955
|
setPerson(linked);
|
|
21903
21956
|
setCandidate(linked ? null : await findMyPersonCandidate(orgId, user?.email, staffKinds));
|
|
21904
21957
|
}, [orgId, userId, user?.email, staffKinds]);
|
|
21905
|
-
|
|
21958
|
+
React122.useEffect(() => {
|
|
21906
21959
|
void load();
|
|
21907
21960
|
}, [load]);
|
|
21908
21961
|
if (!currentOrg) return null;
|
|
@@ -21996,10 +22049,10 @@ var useStore = create((set) => ({
|
|
|
21996
22049
|
function useHeaderAction(zone, action) {
|
|
21997
22050
|
const register = useStore((s) => s.register);
|
|
21998
22051
|
const unregister = useStore((s) => s.unregister);
|
|
21999
|
-
const latest =
|
|
22052
|
+
const latest = React122.useRef(action);
|
|
22000
22053
|
latest.current = action;
|
|
22001
22054
|
const id = action?.id;
|
|
22002
|
-
|
|
22055
|
+
React122.useEffect(() => {
|
|
22003
22056
|
if (!zone || !id) return;
|
|
22004
22057
|
const current2 = latest.current;
|
|
22005
22058
|
if (current2) register(zone, { ...current2, onSelect: () => latest.current?.onSelect() });
|
|
@@ -22008,7 +22061,7 @@ function useHeaderAction(zone, action) {
|
|
|
22008
22061
|
}
|
|
22009
22062
|
function useHeaderActions(zone) {
|
|
22010
22063
|
const byZone = useStore((s) => s.byZone);
|
|
22011
|
-
return
|
|
22064
|
+
return React122.useMemo(() => Object.values(byZone[zone] ?? {}), [byZone, zone]);
|
|
22012
22065
|
}
|
|
22013
22066
|
function useUserLabel(userId) {
|
|
22014
22067
|
const members = useOrganizationStore((s) => s.members);
|
|
@@ -22738,7 +22791,7 @@ function SubjectFormLayout({ fields, allFields, fieldGroups, values, onChange, r
|
|
|
22738
22791
|
const IconComponent = getLucideIcon(entityIcon ?? "Heart") ?? Heart;
|
|
22739
22792
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
22740
22793
|
/* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsx(CardContent, { className: "pt-5", children: /* @__PURE__ */ jsxs("div", { className: "flex gap-5", children: [
|
|
22741
|
-
/* @__PURE__ */ jsx("div", { className: "flex h-20 w-20 shrink-0 items-center justify-center rounded-2xl bg-primary/10 text-primary", children:
|
|
22794
|
+
/* @__PURE__ */ jsx("div", { className: "flex h-20 w-20 shrink-0 items-center justify-center rounded-2xl bg-primary/10 text-primary", children: React122__default.createElement(IconComponent, { className: "h-8 w-8" }) }),
|
|
22742
22795
|
/* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-4", children: [
|
|
22743
22796
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4", children: [
|
|
22744
22797
|
nameField && /* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-1.5", children: [
|
|
@@ -23197,14 +23250,14 @@ function ImageSlot({
|
|
|
23197
23250
|
onDraftFile
|
|
23198
23251
|
}) {
|
|
23199
23252
|
const t = useTranslation();
|
|
23200
|
-
const inputRef =
|
|
23201
|
-
const [url, setUrl] =
|
|
23202
|
-
const [busy, setBusy] =
|
|
23203
|
-
const [error, setError] =
|
|
23204
|
-
const draftUrlRef =
|
|
23253
|
+
const inputRef = React122__default.useRef(null);
|
|
23254
|
+
const [url, setUrl] = React122__default.useState(() => image.get(row));
|
|
23255
|
+
const [busy, setBusy] = React122__default.useState(false);
|
|
23256
|
+
const [error, setError] = React122__default.useState(null);
|
|
23257
|
+
const draftUrlRef = React122__default.useRef(null);
|
|
23205
23258
|
const currentUrl = image.get(row);
|
|
23206
23259
|
const draftFile = image.draftField ? row[image.draftField] : void 0;
|
|
23207
|
-
|
|
23260
|
+
React122__default.useEffect(() => {
|
|
23208
23261
|
if (draftFile) return;
|
|
23209
23262
|
if (draftUrlRef.current) {
|
|
23210
23263
|
URL.revokeObjectURL(draftUrlRef.current);
|
|
@@ -23212,7 +23265,7 @@ function ImageSlot({
|
|
|
23212
23265
|
}
|
|
23213
23266
|
setUrl(currentUrl);
|
|
23214
23267
|
}, [currentUrl, draftFile]);
|
|
23215
|
-
|
|
23268
|
+
React122__default.useEffect(() => () => {
|
|
23216
23269
|
if (draftUrlRef.current) URL.revokeObjectURL(draftUrlRef.current);
|
|
23217
23270
|
}, []);
|
|
23218
23271
|
const acceptsDraft = !canEdit && Boolean(image.draftField && onDraftFile);
|
|
@@ -23330,7 +23383,7 @@ function CrudFormPage({ entityDef, mode, initialData, onSubmit, onCancel, namePl
|
|
|
23330
23383
|
const [values, setValues] = useState(computeInit);
|
|
23331
23384
|
const [saving, setSaving] = useState(false);
|
|
23332
23385
|
const [invalidKeys, setInvalidKeys] = useState(EMPTY_KEYS);
|
|
23333
|
-
const initialRef =
|
|
23386
|
+
const initialRef = React122__default.useRef(JSON.stringify(values));
|
|
23334
23387
|
useEffect(() => {
|
|
23335
23388
|
const init = computeInit();
|
|
23336
23389
|
setValues(init);
|
|
@@ -23375,7 +23428,7 @@ function CrudFormPage({ entityDef, mode, initialData, onSubmit, onCancel, namePl
|
|
|
23375
23428
|
if (submitRef) submitRef.current = () => {
|
|
23376
23429
|
void submit();
|
|
23377
23430
|
};
|
|
23378
|
-
|
|
23431
|
+
React122__default.useEffect(() => () => {
|
|
23379
23432
|
if (submitRef) submitRef.current = null;
|
|
23380
23433
|
}, [submitRef]);
|
|
23381
23434
|
const dirty = JSON.stringify(values) !== initialRef.current;
|
|
@@ -23975,7 +24028,7 @@ function CrudListView({
|
|
|
23975
24028
|
if (onImport) {
|
|
23976
24029
|
createRoutes.push({ id: "import", label: t("crud.import.action"), description: t("crud.import.hint"), icon: "Upload", action: onImport });
|
|
23977
24030
|
}
|
|
23978
|
-
const createActions =
|
|
24031
|
+
const createActions = React122__default.useMemo(() => {
|
|
23979
24032
|
const out = createRoutes.map((qa, i) => ({
|
|
23980
24033
|
id: qa.id,
|
|
23981
24034
|
label: qa.label,
|
|
@@ -24379,9 +24432,9 @@ function buildCrudSurfaceContribution(read3) {
|
|
|
24379
24432
|
};
|
|
24380
24433
|
}
|
|
24381
24434
|
function CrudAgentSurface(props) {
|
|
24382
|
-
const ref =
|
|
24435
|
+
const ref = React122.useRef(props);
|
|
24383
24436
|
ref.current = props;
|
|
24384
|
-
const contribution =
|
|
24437
|
+
const contribution = React122.useMemo(
|
|
24385
24438
|
() => buildCrudSurfaceContribution(() => ref.current),
|
|
24386
24439
|
[]
|
|
24387
24440
|
);
|
|
@@ -24432,8 +24485,8 @@ function useFieldRules(entityKey) {
|
|
|
24432
24485
|
};
|
|
24433
24486
|
}, [entityKey, fieldRules]);
|
|
24434
24487
|
}
|
|
24435
|
-
var ImportWizard2 =
|
|
24436
|
-
() => import('./ImportWizard-
|
|
24488
|
+
var ImportWizard2 = React122__default.lazy(
|
|
24489
|
+
() => import('./ImportWizard-7UFB2PPF.js').then((m) => ({ default: m.ImportWizard }))
|
|
24437
24490
|
);
|
|
24438
24491
|
var PAGE_SIZE = 50;
|
|
24439
24492
|
function getRouteDepth(sub) {
|
|
@@ -24917,7 +24970,7 @@ function CrudPage({ entityDef: rawEntityDef, useStore: useStore2, basePath, disp
|
|
|
24917
24970
|
displayValue: deleteItem ? deleteItem[displayField] : void 0
|
|
24918
24971
|
}
|
|
24919
24972
|
),
|
|
24920
|
-
/* @__PURE__ */ jsx(
|
|
24973
|
+
/* @__PURE__ */ jsx(React122__default.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
|
|
24921
24974
|
ImportWizard2,
|
|
24922
24975
|
{
|
|
24923
24976
|
open: importOpen,
|
|
@@ -25223,7 +25276,7 @@ function columnOf(entity, key) {
|
|
|
25223
25276
|
function RelatedListTab({ item, related }) {
|
|
25224
25277
|
const parentId = item?.id;
|
|
25225
25278
|
const pathname = useHashPath();
|
|
25226
|
-
const Page =
|
|
25279
|
+
const Page = React122.useMemo(() => {
|
|
25227
25280
|
if (!parentId) return null;
|
|
25228
25281
|
const child = related.entity;
|
|
25229
25282
|
const fkColumn = columnOf(child, related.foreignKey);
|
|
@@ -25250,8 +25303,8 @@ function tabBasePath(pathname, tabId) {
|
|
|
25250
25303
|
}
|
|
25251
25304
|
function useHashPath() {
|
|
25252
25305
|
const read3 = () => typeof window === "undefined" ? "/" : window.location.hash.slice(1) || "/";
|
|
25253
|
-
const [path, setPath] =
|
|
25254
|
-
|
|
25306
|
+
const [path, setPath] = React122.useState(read3);
|
|
25307
|
+
React122.useEffect(() => {
|
|
25255
25308
|
const handler = () => setPath(read3());
|
|
25256
25309
|
window.addEventListener("hashchange", handler);
|
|
25257
25310
|
return () => window.removeEventListener("hashchange", handler);
|
|
@@ -25641,30 +25694,30 @@ function AccessTab({ item }) {
|
|
|
25641
25694
|
const hasSystemPermission = useSystemPermission();
|
|
25642
25695
|
const canManageTeam = hasSystemPermission("manage_team");
|
|
25643
25696
|
const guardSeats = useLimitGuard("users");
|
|
25644
|
-
const [access, setAccess] =
|
|
25645
|
-
const [email, setEmail] =
|
|
25646
|
-
const [roleId, setRoleId] =
|
|
25647
|
-
const [busy, setBusy] =
|
|
25648
|
-
const [confirmRemove, setConfirmRemove] =
|
|
25649
|
-
|
|
25697
|
+
const [access, setAccess] = React122.useState(void 0);
|
|
25698
|
+
const [email, setEmail] = React122.useState(person?.email ?? "");
|
|
25699
|
+
const [roleId, setRoleId] = React122.useState("");
|
|
25700
|
+
const [busy, setBusy] = React122.useState(false);
|
|
25701
|
+
const [confirmRemove, setConfirmRemove] = React122.useState(false);
|
|
25702
|
+
React122.useEffect(() => {
|
|
25650
25703
|
if (!roleId && profiles.length) setRoleId(profiles[1]?.id ?? profiles[0].id);
|
|
25651
25704
|
}, [profiles, roleId]);
|
|
25652
|
-
|
|
25705
|
+
React122.useEffect(() => {
|
|
25653
25706
|
setEmail(person?.email ?? "");
|
|
25654
25707
|
}, [person?.email]);
|
|
25655
|
-
const reload =
|
|
25708
|
+
const reload = React122.useCallback(async () => {
|
|
25656
25709
|
if (!personId) return;
|
|
25657
25710
|
setAccess(await fetchPersonAccess(personId));
|
|
25658
25711
|
}, [personId]);
|
|
25659
|
-
|
|
25712
|
+
React122.useEffect(() => {
|
|
25660
25713
|
void reload();
|
|
25661
25714
|
}, [reload]);
|
|
25662
|
-
|
|
25715
|
+
React122.useEffect(() => {
|
|
25663
25716
|
if (!adapter || !currentOrg || invites.length > 0) return;
|
|
25664
25717
|
adapter.listInvites(currentOrg.id).then(setInvites).catch(() => {
|
|
25665
25718
|
});
|
|
25666
25719
|
}, [adapter, currentOrg?.id]);
|
|
25667
|
-
const pendingInvite =
|
|
25720
|
+
const pendingInvite = React122.useMemo(() => {
|
|
25668
25721
|
const target = (person?.email ?? "").trim().toLowerCase();
|
|
25669
25722
|
if (!target) return void 0;
|
|
25670
25723
|
return invites.find((i) => i.status === "pending" && i.email.toLowerCase() === target);
|
|
@@ -25878,11 +25931,11 @@ function PersonUnitsTab({ item }) {
|
|
|
25878
25931
|
const units = useUnitStore((s) => s.units);
|
|
25879
25932
|
const unitMode = useUnitStore((s) => s.unitMode);
|
|
25880
25933
|
const profiles = usePermissionsStore((s) => s.profiles);
|
|
25881
|
-
const [userId, setUserId] =
|
|
25882
|
-
const [bindings, setBindings] =
|
|
25883
|
-
const [busy, setBusy] =
|
|
25934
|
+
const [userId, setUserId] = React122.useState(void 0);
|
|
25935
|
+
const [bindings, setBindings] = React122.useState({});
|
|
25936
|
+
const [busy, setBusy] = React122.useState(null);
|
|
25884
25937
|
const bindingsVersion = useDataVersion(UNIT_ACCESS_CHANGED);
|
|
25885
|
-
|
|
25938
|
+
React122.useEffect(() => {
|
|
25886
25939
|
if (!personId) return;
|
|
25887
25940
|
let alive = true;
|
|
25888
25941
|
void fetchUserIdForPerson(personId).then((uid2) => {
|
|
@@ -25892,11 +25945,11 @@ function PersonUnitsTab({ item }) {
|
|
|
25892
25945
|
alive = false;
|
|
25893
25946
|
};
|
|
25894
25947
|
}, [personId]);
|
|
25895
|
-
const reload =
|
|
25948
|
+
const reload = React122.useCallback(async (uid2) => {
|
|
25896
25949
|
const rows = await fetchMemberUnits(uid2);
|
|
25897
25950
|
setBindings(Object.fromEntries(rows.map((r) => [r.locationId, r.role])));
|
|
25898
25951
|
}, []);
|
|
25899
|
-
|
|
25952
|
+
React122.useEffect(() => {
|
|
25900
25953
|
if (userId) void reload(userId);
|
|
25901
25954
|
}, [userId, reload, bindingsVersion]);
|
|
25902
25955
|
async function toggle(unitId, on) {
|
|
@@ -25991,8 +26044,124 @@ function PersonUnitsTab({ item }) {
|
|
|
25991
26044
|
] })
|
|
25992
26045
|
] }) });
|
|
25993
26046
|
}
|
|
25994
|
-
|
|
25995
|
-
|
|
26047
|
+
function PersonAvailabilityTab({ item }) {
|
|
26048
|
+
const person = item;
|
|
26049
|
+
const personId = person?.id;
|
|
26050
|
+
const [units, setUnits] = React122.useState([]);
|
|
26051
|
+
const [selected, setSelected] = React122.useState(/* @__PURE__ */ new Set());
|
|
26052
|
+
const [loading, setLoading] = React122.useState(true);
|
|
26053
|
+
const [busy, setBusy] = React122.useState(false);
|
|
26054
|
+
const [availabilityReady, setAvailabilityReady] = React122.useState(true);
|
|
26055
|
+
const db2 = () => getSupabaseClientOptional();
|
|
26056
|
+
const load = React122.useCallback(async () => {
|
|
26057
|
+
const client3 = db2();
|
|
26058
|
+
if (!client3 || !personId) {
|
|
26059
|
+
setLoading(false);
|
|
26060
|
+
return;
|
|
26061
|
+
}
|
|
26062
|
+
setLoading(true);
|
|
26063
|
+
try {
|
|
26064
|
+
const [{ data: unitRows, error: unitError }, { data: unitIds, error: grantError }] = await Promise.all([
|
|
26065
|
+
client3.from("v_units").select("id,name,city").eq("is_active", true).order("name"),
|
|
26066
|
+
client3.rpc("people_available_unit_ids", { p_person: personId })
|
|
26067
|
+
]);
|
|
26068
|
+
if (unitError) throw unitError;
|
|
26069
|
+
setUnits(unitRows ?? []);
|
|
26070
|
+
if (grantError) {
|
|
26071
|
+
const missingRpc = grantError.code === "PGRST202" || String(grantError.message ?? "").includes("people_available_unit_ids");
|
|
26072
|
+
if (!missingRpc) throw grantError;
|
|
26073
|
+
setSelected(/* @__PURE__ */ new Set());
|
|
26074
|
+
setAvailabilityReady(false);
|
|
26075
|
+
return;
|
|
26076
|
+
}
|
|
26077
|
+
setSelected(new Set((unitIds ?? []).map((unitId) => String(unitId))));
|
|
26078
|
+
setAvailabilityReady(true);
|
|
26079
|
+
} catch (error) {
|
|
26080
|
+
toast.error("N\xE3o foi poss\xEDvel carregar as unidades", { description: error?.message });
|
|
26081
|
+
} finally {
|
|
26082
|
+
setLoading(false);
|
|
26083
|
+
}
|
|
26084
|
+
}, [personId]);
|
|
26085
|
+
React122.useEffect(() => {
|
|
26086
|
+
void load();
|
|
26087
|
+
}, [load]);
|
|
26088
|
+
async function makeOrganizationWide() {
|
|
26089
|
+
const client3 = db2();
|
|
26090
|
+
if (!client3 || !personId || busy) return;
|
|
26091
|
+
setBusy(true);
|
|
26092
|
+
try {
|
|
26093
|
+
const { error } = await client3.rpc("people_set_available_units", {
|
|
26094
|
+
p_person: personId,
|
|
26095
|
+
p_unit_ids: []
|
|
26096
|
+
});
|
|
26097
|
+
if (error) throw error;
|
|
26098
|
+
setSelected(/* @__PURE__ */ new Set());
|
|
26099
|
+
toast.success("Dispon\xEDvel em todas as unidades.");
|
|
26100
|
+
} catch (error) {
|
|
26101
|
+
toast.error("N\xE3o foi poss\xEDvel atualizar as unidades", { description: error?.message });
|
|
26102
|
+
} finally {
|
|
26103
|
+
setBusy(false);
|
|
26104
|
+
}
|
|
26105
|
+
}
|
|
26106
|
+
async function toggle(unitId, enabled) {
|
|
26107
|
+
const client3 = db2();
|
|
26108
|
+
if (!client3 || !personId || busy) return;
|
|
26109
|
+
setBusy(true);
|
|
26110
|
+
try {
|
|
26111
|
+
const next = new Set(selected);
|
|
26112
|
+
if (enabled) next.add(unitId);
|
|
26113
|
+
else next.delete(unitId);
|
|
26114
|
+
const { error } = await client3.rpc("people_set_available_units", {
|
|
26115
|
+
p_person: personId,
|
|
26116
|
+
p_unit_ids: Array.from(next)
|
|
26117
|
+
});
|
|
26118
|
+
if (error) throw error;
|
|
26119
|
+
await load();
|
|
26120
|
+
toast.success("Unidades atualizadas.");
|
|
26121
|
+
} catch (error) {
|
|
26122
|
+
toast.error("N\xE3o foi poss\xEDvel atualizar as unidades", { description: error?.message });
|
|
26123
|
+
} finally {
|
|
26124
|
+
setBusy(false);
|
|
26125
|
+
}
|
|
26126
|
+
}
|
|
26127
|
+
if (loading) {
|
|
26128
|
+
return /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-2 py-6", children: [
|
|
26129
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" }),
|
|
26130
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" })
|
|
26131
|
+
] }) });
|
|
26132
|
+
}
|
|
26133
|
+
const organizationWide = selected.size === 0;
|
|
26134
|
+
return /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-4 py-6", children: [
|
|
26135
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-2", children: [
|
|
26136
|
+
/* @__PURE__ */ jsxs(Button, { type: "button", variant: organizationWide ? "default" : "outline", size: "sm", onClick: () => void makeOrganizationWide(), disabled: busy || !availabilityReady, children: [
|
|
26137
|
+
/* @__PURE__ */ jsx(Globe2, { className: "mr-2 h-4 w-4" }),
|
|
26138
|
+
" Todas as unidades"
|
|
26139
|
+
] }),
|
|
26140
|
+
/* @__PURE__ */ jsx("span", { className: "self-center text-xs text-muted-foreground", children: "Marque uma unidade abaixo para restringir este cadastro." })
|
|
26141
|
+
] }),
|
|
26142
|
+
!availabilityReady ? /* @__PURE__ */ jsx("p", { role: "status", className: "rounded-lg border border-warning/40 bg-warning/5 p-3 text-xs text-muted-foreground", children: "As unidades est\xE3o vis\xEDveis, mas a distribui\xE7\xE3o deste cadastro ficar\xE1 dispon\xEDvel ap\xF3s a atualiza\xE7\xE3o do banco." }) : null,
|
|
26143
|
+
person?.unitId ? /* @__PURE__ */ jsx("p", { className: "rounded-lg border border-warning/40 bg-warning/5 p-3 text-xs text-muted-foreground", children: "Este cadastro nasceu dentro de uma unidade. A unidade de origem continua prevalecendo sobre a distribui\xE7\xE3o da rede." }) : null,
|
|
26144
|
+
units.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Nenhuma unidade cadastrada." }) : /* @__PURE__ */ jsx("div", { className: "divide-y rounded-lg border", children: units.map((unit) => /* @__PURE__ */ jsxs("label", { className: "flex cursor-pointer items-center gap-3 px-3 py-2.5 hover:bg-muted/40", children: [
|
|
26145
|
+
/* @__PURE__ */ jsx(
|
|
26146
|
+
Checkbox,
|
|
26147
|
+
{
|
|
26148
|
+
checked: selected.has(unit.id),
|
|
26149
|
+
disabled: busy || !availabilityReady,
|
|
26150
|
+
onChange: (next) => void toggle(unit.id, next),
|
|
26151
|
+
"aria-label": unit.name
|
|
26152
|
+
}
|
|
26153
|
+
),
|
|
26154
|
+
/* @__PURE__ */ jsx(Building2, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
|
|
26155
|
+
/* @__PURE__ */ jsxs("span", { className: "min-w-0", children: [
|
|
26156
|
+
/* @__PURE__ */ jsx("span", { className: "block truncate text-sm font-medium", children: unit.name }),
|
|
26157
|
+
unit.city ? /* @__PURE__ */ jsx("span", { className: "block truncate text-xs text-muted-foreground", children: unit.city }) : null
|
|
26158
|
+
] })
|
|
26159
|
+
] }, unit.id)) }),
|
|
26160
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Sem nenhuma sele\xE7\xE3o, o cadastro \xE9 da organiza\xE7\xE3o e aparece em todas as unidades. Com sele\xE7\xF5es, aparece somente nas unidades marcadas." })
|
|
26161
|
+
] }) });
|
|
26162
|
+
}
|
|
26163
|
+
var ScheduleEditor2 = React122__default.lazy(
|
|
26164
|
+
() => import('./ScheduleEditor-YE42HL7P.js').then((m) => ({ default: m.ScheduleEditor }))
|
|
25996
26165
|
);
|
|
25997
26166
|
function ComingSoon({ icon: Icon, title, description }) {
|
|
25998
26167
|
const t = useTranslation();
|
|
@@ -26060,6 +26229,25 @@ function FinancialTab({ item }) {
|
|
|
26060
26229
|
}
|
|
26061
26230
|
return null;
|
|
26062
26231
|
}
|
|
26232
|
+
function FinancialSettingsTab({ item }) {
|
|
26233
|
+
const runtime = usePluginRuntimeOptional();
|
|
26234
|
+
const widgets = runtime ? getWidgetsForZone(runtime, "person.detail.financial-settings") : [];
|
|
26235
|
+
if (widgets.length > 0 && item) {
|
|
26236
|
+
const w = widgets[0];
|
|
26237
|
+
const Widget = w.component;
|
|
26238
|
+
return /* @__PURE__ */ jsx(
|
|
26239
|
+
Widget,
|
|
26240
|
+
{
|
|
26241
|
+
item,
|
|
26242
|
+
config: w.config,
|
|
26243
|
+
runtime: runtime?.context,
|
|
26244
|
+
plugin: w.plugin,
|
|
26245
|
+
widget: w
|
|
26246
|
+
}
|
|
26247
|
+
);
|
|
26248
|
+
}
|
|
26249
|
+
return null;
|
|
26250
|
+
}
|
|
26063
26251
|
function AttendanceTab({ item }) {
|
|
26064
26252
|
const runtime = usePluginRuntimeOptional();
|
|
26065
26253
|
const widgets = runtime ? getWidgetsForZone(runtime, "person.detail.attendance") : [];
|
|
@@ -26095,7 +26283,7 @@ function ScheduleTab({ item }) {
|
|
|
26095
26283
|
return (
|
|
26096
26284
|
// O interruptor "Aparece na agenda" agora vem DENTRO do editor: era a
|
|
26097
26285
|
// única coisa que esta porta mostrava e a da agenda não.
|
|
26098
|
-
/* @__PURE__ */ jsx(
|
|
26286
|
+
/* @__PURE__ */ jsx(React122__default.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(ScheduleEditor2, { assigneeId: item.id }) })
|
|
26099
26287
|
);
|
|
26100
26288
|
}
|
|
26101
26289
|
var PERSON_DETAIL_TABS = [
|
|
@@ -26108,12 +26296,27 @@ var PERSON_DETAIL_TABS = [
|
|
|
26108
26296
|
// have units — she is a record IN one. The tab renders its own "no login yet"
|
|
26109
26297
|
// state, so it is safe to show for staff who never sign in.
|
|
26110
26298
|
{ id: "units", label: "Unidades", icon: "Building2", component: PersonUnitsTab, visibleFor: ["staff"] },
|
|
26299
|
+
{
|
|
26300
|
+
id: "record-units",
|
|
26301
|
+
label: "Unidades",
|
|
26302
|
+
icon: "Building2",
|
|
26303
|
+
component: PersonAvailabilityTab,
|
|
26304
|
+
visibleFor: ["customer", "supplier", "contact", "lead", "partner"]
|
|
26305
|
+
},
|
|
26111
26306
|
{ id: "schedule", label: "Schedule", icon: "CalendarDays", component: ScheduleTab, visibleFor: ["staff"] },
|
|
26112
26307
|
// Core table (public.addresses), so every app with a person record gets this:
|
|
26113
26308
|
// delivery addresses for a client, pickup point for a supplier, home address
|
|
26114
26309
|
// for staff. Not shop-specific.
|
|
26115
26310
|
{ id: "addresses", label: "Endere\xE7os", icon: "MapPin", component: AddressesTab },
|
|
26116
26311
|
{ id: "documents", label: "Documents", icon: "FileText", component: DocumentsTab },
|
|
26312
|
+
{
|
|
26313
|
+
id: "financial-settings",
|
|
26314
|
+
label: "Configura\xE7\xF5es",
|
|
26315
|
+
icon: "Settings",
|
|
26316
|
+
component: FinancialSettingsTab,
|
|
26317
|
+
visibleFor: ["supplier"],
|
|
26318
|
+
requiresWidgetZone: "person.detail.financial-settings"
|
|
26319
|
+
},
|
|
26117
26320
|
// Per-person financial statement — only shown when the financial plugin contributes
|
|
26118
26321
|
// its widget (see requiresWidgetZone). Clients = paid invoices; staff = commissions.
|
|
26119
26322
|
{ id: "financial", label: "Statement", icon: "DollarSign", component: FinancialTab, requiresWidgetZone: "person.detail.financial" },
|
|
@@ -26121,11 +26324,25 @@ var PERSON_DETAIL_TABS = [
|
|
|
26121
26324
|
// contador daquele dia congelado. Só aparece onde algum plugin sabe
|
|
26122
26325
|
// responder: sem prontuário instalado, a aba não existe (em vez de existir
|
|
26123
26326
|
// vazia, afirmando que a pessoa nunca foi atendida).
|
|
26124
|
-
{
|
|
26327
|
+
{
|
|
26328
|
+
id: "attendance",
|
|
26329
|
+
label: "Atendimentos",
|
|
26330
|
+
icon: "Stethoscope",
|
|
26331
|
+
component: AttendanceTab,
|
|
26332
|
+
visibleFor: ["customer"],
|
|
26333
|
+
requiresWidgetZone: "person.detail.attendance"
|
|
26334
|
+
},
|
|
26125
26335
|
// V1 keeps these two side by side, and the split is the point: Atendimentos
|
|
26126
26336
|
// is the day-by-day, Serviços is the running balance per procedure — how
|
|
26127
26337
|
// many sessions bought, how many done, how many left.
|
|
26128
|
-
{
|
|
26338
|
+
{
|
|
26339
|
+
id: "services",
|
|
26340
|
+
label: "Servi\xE7os",
|
|
26341
|
+
icon: "Layers",
|
|
26342
|
+
component: PersonServicesTab,
|
|
26343
|
+
visibleFor: ["customer"],
|
|
26344
|
+
requiresWidgetZone: "person.detail.services"
|
|
26345
|
+
},
|
|
26129
26346
|
{ id: "activity", label: "Activity", icon: "Clock", component: ActivityTab }
|
|
26130
26347
|
];
|
|
26131
26348
|
function ComingSoon2({ icon: Icon, title, description }) {
|
|
@@ -26492,7 +26709,7 @@ function InlineEditor({
|
|
|
26492
26709
|
}) {
|
|
26493
26710
|
const [draft, setDraft] = useState(value ?? "");
|
|
26494
26711
|
const [saving, setSaving] = useState(false);
|
|
26495
|
-
const inputRef =
|
|
26712
|
+
const inputRef = React122__default.useRef(null);
|
|
26496
26713
|
useEffect(() => {
|
|
26497
26714
|
inputRef.current?.focus();
|
|
26498
26715
|
if (inputRef.current instanceof HTMLInputElement) inputRef.current.select();
|
|
@@ -26770,7 +26987,7 @@ function CrudDetailPage({
|
|
|
26770
26987
|
const displayFieldDef = entityDef.fields.find((f) => f.key === displayField);
|
|
26771
26988
|
const nameEditable = Boolean(onFieldSave) && Boolean(displayFieldDef) && isInlineEditable(displayFieldDef);
|
|
26772
26989
|
const [editingName, setEditingName] = useState(false);
|
|
26773
|
-
const imageInputRef =
|
|
26990
|
+
const imageInputRef = React122__default.useRef(null);
|
|
26774
26991
|
const runtime = usePluginRuntimeOptional();
|
|
26775
26992
|
const archetypeTabs = getArchetypeTabs(entityDef.layout, entityDef.data?.archetypeKind);
|
|
26776
26993
|
const relatedTabs = (entityDef.relatedLists ?? []).map((related) => ({
|
|
@@ -26828,7 +27045,7 @@ function CrudDetailPage({
|
|
|
26828
27045
|
window.history.replaceState(null, "", `#${segments.length ? `${base}/${segments.join("/")}` : base}`);
|
|
26829
27046
|
}, [basePath, item.id, selectedTab, embedded]);
|
|
26830
27047
|
const parentLabel = usePresetLabel(basePath, namePlural);
|
|
26831
|
-
const headerNode =
|
|
27048
|
+
const headerNode = React122__default.useMemo(
|
|
26832
27049
|
() => embedded ? null : /* @__PURE__ */ jsx(SubpageHeader, { title: displayValue, parentLabel, onBack }),
|
|
26833
27050
|
[embedded, displayValue, parentLabel, onBack]
|
|
26834
27051
|
);
|
|
@@ -26956,12 +27173,12 @@ function CrudDetailPage({
|
|
|
26956
27173
|
] }, tab.id);
|
|
26957
27174
|
})
|
|
26958
27175
|
] }),
|
|
26959
|
-
/* @__PURE__ */ jsx(TabsContent, { value: "overview", className: embedded ? "mt-2" : "mt-4", children: entityDef.overviewComponent ?
|
|
27176
|
+
/* @__PURE__ */ jsx(TabsContent, { value: "overview", className: embedded ? "mt-2" : "mt-4", children: entityDef.overviewComponent ? React122__default.createElement(entityDef.overviewComponent, { item, entityDef }) : /* @__PURE__ */ jsx(OverviewTab, { entityDef, item, compact: embedded, onFieldSave }) }),
|
|
26960
27177
|
customTabs.map((tab) => /* @__PURE__ */ jsx(TabsContent, { value: tab.id, className: "mt-4", children: tab.component ? (
|
|
26961
27178
|
// `tabPath` only to the tab the URL is actually addressing —
|
|
26962
27179
|
// handing it to every tab would have the documents tab trying to
|
|
26963
27180
|
// open a recording id when the user switches across.
|
|
26964
|
-
|
|
27181
|
+
React122__default.createElement(tab.component, {
|
|
26965
27182
|
item,
|
|
26966
27183
|
entityDef,
|
|
26967
27184
|
...tab.id === selectedTab ? { tabPath, setTabPath } : {},
|
|
@@ -26993,8 +27210,8 @@ function MyRecordPanel() {
|
|
|
26993
27210
|
const userId = useAuthStore((s) => s.user?.id);
|
|
26994
27211
|
const members = useOrganizationStore((s) => s.members);
|
|
26995
27212
|
const myRole = members.find((m) => m.userId === userId)?.profileName;
|
|
26996
|
-
const [state, setState] =
|
|
26997
|
-
const load =
|
|
27213
|
+
const [state, setState] = React122.useState({ status: "loading" });
|
|
27214
|
+
const load = React122.useCallback(async () => {
|
|
26998
27215
|
if (!orgId || !userId) return;
|
|
26999
27216
|
const person = await dedup(`self:record:${orgId}:${userId}`, () => fetchMyPersonRecord(orgId, userId));
|
|
27000
27217
|
if (!person) return setState({ status: "none" });
|
|
@@ -27011,10 +27228,10 @@ function MyRecordPanel() {
|
|
|
27011
27228
|
setState({ status: "none" });
|
|
27012
27229
|
}
|
|
27013
27230
|
}, [orgId, userId]);
|
|
27014
|
-
|
|
27231
|
+
React122.useEffect(() => {
|
|
27015
27232
|
void load();
|
|
27016
27233
|
}, [load]);
|
|
27017
|
-
const changePhoto =
|
|
27234
|
+
const changePhoto = React122.useCallback(async (file) => {
|
|
27018
27235
|
if (state.status !== "ready") return;
|
|
27019
27236
|
const supabase = getFayzSupabaseClientOptional();
|
|
27020
27237
|
if (!supabase) return;
|
|
@@ -27070,8 +27287,8 @@ function ConnectedUserProfile() {
|
|
|
27070
27287
|
const myPersonId = useMyPersonId();
|
|
27071
27288
|
const hasRecord = Boolean(myPersonId);
|
|
27072
27289
|
const setUser = useAuthStore((s) => s.setUser);
|
|
27073
|
-
const [profile, setProfile] =
|
|
27074
|
-
|
|
27290
|
+
const [profile, setProfile] = React122.useState(null);
|
|
27291
|
+
React122.useEffect(() => {
|
|
27075
27292
|
const supabase = getFayzSupabaseClientOptional();
|
|
27076
27293
|
if (!user || !supabase) return;
|
|
27077
27294
|
let cancelled = false;
|
|
@@ -27182,9 +27399,9 @@ function SecuritySettings({
|
|
|
27182
27399
|
onTenantSecurityChange
|
|
27183
27400
|
}) {
|
|
27184
27401
|
const { t } = useTranslation$1();
|
|
27185
|
-
const [resetting, setResetting] =
|
|
27186
|
-
const [resetSent, setResetSent] =
|
|
27187
|
-
const [savingTenant, setSavingTenant] =
|
|
27402
|
+
const [resetting, setResetting] = React122.useState(false);
|
|
27403
|
+
const [resetSent, setResetSent] = React122.useState(false);
|
|
27404
|
+
const [savingTenant, setSavingTenant] = React122.useState(false);
|
|
27188
27405
|
const handleResetPassword = async () => {
|
|
27189
27406
|
if (!onResetPassword) return;
|
|
27190
27407
|
setResetting(true);
|
|
@@ -27358,8 +27575,8 @@ function FileUploadField({
|
|
|
27358
27575
|
hint
|
|
27359
27576
|
}) {
|
|
27360
27577
|
const { t } = useTranslation$1();
|
|
27361
|
-
const inputRef =
|
|
27362
|
-
const [preview, setPreview] =
|
|
27578
|
+
const inputRef = React122.useRef(null);
|
|
27579
|
+
const [preview, setPreview] = React122.useState(null);
|
|
27363
27580
|
const handleChange = (e) => {
|
|
27364
27581
|
const file = e.target.files?.[0];
|
|
27365
27582
|
if (file) {
|
|
@@ -27576,13 +27793,13 @@ function BrandPreview({ brand, t }) {
|
|
|
27576
27793
|
}
|
|
27577
27794
|
function BrandingSettings({ brand, onSave }) {
|
|
27578
27795
|
const { t } = useTranslation$1();
|
|
27579
|
-
const [section, setSection] =
|
|
27580
|
-
const [saved, setSaved] =
|
|
27581
|
-
const [draft, setDraft] =
|
|
27582
|
-
const [logoFile, setLogoFile] =
|
|
27583
|
-
const [faviconFile, setFaviconFile] =
|
|
27584
|
-
const [saving, setSaving] =
|
|
27585
|
-
|
|
27796
|
+
const [section, setSection] = React122.useState("identity");
|
|
27797
|
+
const [saved, setSaved] = React122.useState(brand ?? EMPTY_BRAND);
|
|
27798
|
+
const [draft, setDraft] = React122.useState(brand ?? EMPTY_BRAND);
|
|
27799
|
+
const [logoFile, setLogoFile] = React122.useState(null);
|
|
27800
|
+
const [faviconFile, setFaviconFile] = React122.useState(null);
|
|
27801
|
+
const [saving, setSaving] = React122.useState(false);
|
|
27802
|
+
React122.useEffect(() => {
|
|
27586
27803
|
if (brand) {
|
|
27587
27804
|
setSaved(brand);
|
|
27588
27805
|
setDraft(brand);
|
|
@@ -27956,11 +28173,11 @@ function ConnectedBrandingSettings() {
|
|
|
27956
28173
|
toast.error("N\xE3o foi poss\xEDvel salvar a marca", { description: err?.message });
|
|
27957
28174
|
}
|
|
27958
28175
|
};
|
|
27959
|
-
const [brand, setBrand] =
|
|
28176
|
+
const [brand, setBrand] = React122.useState(() => normalizeBrand(
|
|
27960
28177
|
(currentOrg?.settings ?? {}).branding,
|
|
27961
28178
|
{ name: currentOrg?.name, logoUrl: currentOrg?.logoUrl }
|
|
27962
28179
|
));
|
|
27963
|
-
|
|
28180
|
+
React122.useEffect(() => {
|
|
27964
28181
|
let alive = true;
|
|
27965
28182
|
void (async () => {
|
|
27966
28183
|
try {
|
|
@@ -28081,12 +28298,12 @@ function ProjectsSettings() {
|
|
|
28081
28298
|
const projects = useFayzProjectsStore((s) => s.projects);
|
|
28082
28299
|
const load = useFayzProjectsStore((s) => s.load);
|
|
28083
28300
|
const refresh = useFayzProjectsStore((s) => s.refresh);
|
|
28084
|
-
const [linking, setLinking] =
|
|
28301
|
+
const [linking, setLinking] = React122.useState(false);
|
|
28085
28302
|
const connected = isPlatformConnected();
|
|
28086
|
-
|
|
28303
|
+
React122.useEffect(() => {
|
|
28087
28304
|
void load(currentOrgId);
|
|
28088
28305
|
}, [currentOrgId, load]);
|
|
28089
|
-
|
|
28306
|
+
React122.useEffect(() => {
|
|
28090
28307
|
if (!connected || projects.length === 0) return;
|
|
28091
28308
|
let cancelled = false;
|
|
28092
28309
|
void (async () => {
|
|
@@ -28158,7 +28375,7 @@ function SiteRow({
|
|
|
28158
28375
|
showDefaultAction,
|
|
28159
28376
|
onChanged
|
|
28160
28377
|
}) {
|
|
28161
|
-
const [busy, setBusy] =
|
|
28378
|
+
const [busy, setBusy] = React122.useState(false);
|
|
28162
28379
|
const editorUrl = editorUrlOf(project);
|
|
28163
28380
|
const run = async (action) => {
|
|
28164
28381
|
setBusy(true);
|
|
@@ -28229,7 +28446,7 @@ function SiteRow({
|
|
|
28229
28446
|
] });
|
|
28230
28447
|
}
|
|
28231
28448
|
function LinkSiteModal({ onClose, onLinked }) {
|
|
28232
|
-
const [mode, setMode] =
|
|
28449
|
+
const [mode, setMode] = React122.useState("import");
|
|
28233
28450
|
return /* @__PURE__ */ jsx(Modal, { open: true, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxs(ModalContent, { size: "lg", children: [
|
|
28234
28451
|
/* @__PURE__ */ jsxs(ModalHeader, { children: [
|
|
28235
28452
|
/* @__PURE__ */ jsx(ModalTitle, { children: "Vincular um site" }),
|
|
@@ -28265,11 +28482,11 @@ function ModeTab({
|
|
|
28265
28482
|
}
|
|
28266
28483
|
function ImportPane({ onLinked }) {
|
|
28267
28484
|
const linked = useFayzProjectsStore((s) => s.projects);
|
|
28268
|
-
const [search, setSearch] =
|
|
28269
|
-
const [remote, setRemote] =
|
|
28270
|
-
const [error, setError] =
|
|
28271
|
-
const [linkingId, setLinkingId] =
|
|
28272
|
-
|
|
28485
|
+
const [search, setSearch] = React122.useState("");
|
|
28486
|
+
const [remote, setRemote] = React122.useState(null);
|
|
28487
|
+
const [error, setError] = React122.useState(null);
|
|
28488
|
+
const [linkingId, setLinkingId] = React122.useState(null);
|
|
28489
|
+
React122.useEffect(() => {
|
|
28273
28490
|
let cancelled = false;
|
|
28274
28491
|
setError(null);
|
|
28275
28492
|
const timer = setTimeout(() => {
|
|
@@ -28351,9 +28568,9 @@ function ImportPane({ onLinked }) {
|
|
|
28351
28568
|
}
|
|
28352
28569
|
function CreatePane({ onLinked, onCancel }) {
|
|
28353
28570
|
const linked = useFayzProjectsStore((s) => s.projects);
|
|
28354
|
-
const [prompt, setPrompt] =
|
|
28355
|
-
const [busy, setBusy] =
|
|
28356
|
-
const [error, setError] =
|
|
28571
|
+
const [prompt, setPrompt] = React122.useState("");
|
|
28572
|
+
const [busy, setBusy] = React122.useState(false);
|
|
28573
|
+
const [error, setError] = React122.useState(null);
|
|
28357
28574
|
const tooShort = prompt.trim().length < PROMPT_MIN_CHARS;
|
|
28358
28575
|
const submit = async () => {
|
|
28359
28576
|
setBusy(true);
|
|
@@ -28498,10 +28715,10 @@ function ModuleCatalogSections({
|
|
|
28498
28715
|
onToggle,
|
|
28499
28716
|
busy
|
|
28500
28717
|
}) {
|
|
28501
|
-
const [query, setQuery] =
|
|
28718
|
+
const [query, setQuery] = React122.useState("");
|
|
28502
28719
|
const total = categories.reduce((n, c) => n + c.rows.length, 0);
|
|
28503
28720
|
const searchable = total > 6;
|
|
28504
|
-
const filtered =
|
|
28721
|
+
const filtered = React122.useMemo(() => filterCategories(categories, query), [categories, query]);
|
|
28505
28722
|
if (categories.length === 0) {
|
|
28506
28723
|
return /* @__PURE__ */ jsxs("div", { className: "py-8 text-center", children: [
|
|
28507
28724
|
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-foreground", children: "Nada a adicionar" }),
|
|
@@ -28543,7 +28760,7 @@ function CategorySection({
|
|
|
28543
28760
|
onToggle,
|
|
28544
28761
|
busy
|
|
28545
28762
|
}) {
|
|
28546
|
-
const [open, setOpen] =
|
|
28763
|
+
const [open, setOpen] = React122.useState(category.mine);
|
|
28547
28764
|
const expanded = open || forceOpen;
|
|
28548
28765
|
const Chevron = expanded ? ChevronDown : ChevronRight;
|
|
28549
28766
|
return /* @__PURE__ */ jsxs("section", { children: [
|
|
@@ -28625,8 +28842,8 @@ function buildCategories(catalog, rows) {
|
|
|
28625
28842
|
}
|
|
28626
28843
|
function useModuleCatalog() {
|
|
28627
28844
|
const tenantId2 = useOrganizationStore((s) => s.currentOrg?.id ?? null);
|
|
28628
|
-
const [catalog, setCatalog] =
|
|
28629
|
-
|
|
28845
|
+
const [catalog, setCatalog] = React122.useState([]);
|
|
28846
|
+
React122.useEffect(() => {
|
|
28630
28847
|
const supabase = getSupabaseClientOptional$1();
|
|
28631
28848
|
if (!supabase) return;
|
|
28632
28849
|
let alive = true;
|
|
@@ -28643,15 +28860,15 @@ function useModuleCatalog() {
|
|
|
28643
28860
|
function ModulesSettings({ hidden = [], onToggle, permits, busy, catalog = [] }) {
|
|
28644
28861
|
const runtime = usePluginRuntime();
|
|
28645
28862
|
const offered = useOfferedPlugins();
|
|
28646
|
-
const [adding, setAdding] =
|
|
28647
|
-
const rows =
|
|
28863
|
+
const [adding, setAdding] = React122.useState(false);
|
|
28864
|
+
const rows = React122.useMemo(() => {
|
|
28648
28865
|
const known = catalog.length ? new Set(catalog.flatMap((app) => app.modules)) : new Set(offered);
|
|
28649
28866
|
const inCatalogue = known.size ? runtime.plugins.filter((p) => known.has(p.id) || p.isActive) : runtime.plugins;
|
|
28650
28867
|
return buildRows(inCatalogue, new Set(hidden), permits);
|
|
28651
28868
|
}, [runtime.plugins, hidden, permits, offered, catalog]);
|
|
28652
28869
|
const on = rows.filter((r) => r.plugin.isActive);
|
|
28653
|
-
const off =
|
|
28654
|
-
const categories =
|
|
28870
|
+
const off = React122.useMemo(() => rows.filter((r) => !r.plugin.isActive), [rows]);
|
|
28871
|
+
const categories = React122.useMemo(() => buildCategories(catalog, off), [catalog, off]);
|
|
28655
28872
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-8", children: [
|
|
28656
28873
|
/* @__PURE__ */ jsx(PageHeaderActions, { children: /* @__PURE__ */ jsxs(Button, { size: "sm", className: "shrink-0 gap-1.5", onClick: () => setAdding(true), children: [
|
|
28657
28874
|
/* @__PURE__ */ jsx(Plus, { className: "h-4 w-4" }),
|
|
@@ -28859,8 +29076,8 @@ function ConnectedModulesSettings({ hidden = SHELL_PLUGINS }) {
|
|
|
28859
29076
|
const access = useAccessOptional();
|
|
28860
29077
|
const catalog = useModuleCatalog();
|
|
28861
29078
|
const tenantId2 = useOrganizationStore((s) => s.currentOrg?.id ?? null);
|
|
28862
|
-
const [busy, setBusy] =
|
|
28863
|
-
const onToggle =
|
|
29079
|
+
const [busy, setBusy] = React122.useState(false);
|
|
29080
|
+
const onToggle = React122.useCallback(
|
|
28864
29081
|
async (plugin, status, facet) => {
|
|
28865
29082
|
const supabase = getSupabaseClientOptional$1();
|
|
28866
29083
|
if (!supabase) return;
|
|
@@ -28886,7 +29103,7 @@ function ConnectedModulesSettings({ hidden = SHELL_PLUGINS }) {
|
|
|
28886
29103
|
},
|
|
28887
29104
|
[refresh, tenantId2]
|
|
28888
29105
|
);
|
|
28889
|
-
const permits =
|
|
29106
|
+
const permits = React122.useCallback(
|
|
28890
29107
|
(plugin) => access ? access.can(plugin, "read").allowed || access.entitled(plugin) : true,
|
|
28891
29108
|
[access]
|
|
28892
29109
|
);
|
|
@@ -28897,7 +29114,7 @@ function useCoreSettingsTabs({
|
|
|
28897
29114
|
showBranding = true
|
|
28898
29115
|
} = {}) {
|
|
28899
29116
|
const { t } = useTranslation$1();
|
|
28900
|
-
return
|
|
29117
|
+
return React122.useMemo(() => [
|
|
28901
29118
|
...showCompany ? [{ id: "general", label: t("settings.general"), icon: /* @__PURE__ */ jsx(Building2, { className: "h-4 w-4" }), iconName: "Building2", component: /* @__PURE__ */ jsx(ConnectedCompanySettings, {}) }] : [],
|
|
28902
29119
|
{ id: "profile", label: t("settings.profile"), icon: /* @__PURE__ */ jsx(User, { className: "h-4 w-4" }), iconName: "User", component: /* @__PURE__ */ jsx(ConnectedUserProfile, {}) },
|
|
28903
29120
|
{ id: "security", label: t("settings.security"), icon: /* @__PURE__ */ jsx(Shield, { className: "h-4 w-4" }), iconName: "Shield", component: /* @__PURE__ */ jsx(ConnectedSecuritySettings, {}) },
|
|
@@ -28942,10 +29159,10 @@ function SettingsPage({
|
|
|
28942
29159
|
}
|
|
28943
29160
|
return null;
|
|
28944
29161
|
}
|
|
28945
|
-
const [activeTab, setActiveTab] =
|
|
29162
|
+
const [activeTab, setActiveTab] = React122.useState(() => {
|
|
28946
29163
|
return getTabFromHash() ?? defaultTab ?? null;
|
|
28947
29164
|
});
|
|
28948
|
-
|
|
29165
|
+
React122.useEffect(() => {
|
|
28949
29166
|
const handler = () => {
|
|
28950
29167
|
const tab = getTabFromHash();
|
|
28951
29168
|
if (tab) setActiveTab(tab);
|
|
@@ -28971,7 +29188,7 @@ function SettingsPage({
|
|
|
28971
29188
|
setActiveTab(null);
|
|
28972
29189
|
window.location.hash = "/settings";
|
|
28973
29190
|
};
|
|
28974
|
-
const sections =
|
|
29191
|
+
const sections = React122.useMemo(() => {
|
|
28975
29192
|
const out = [];
|
|
28976
29193
|
for (const tab of resolvedTabs) {
|
|
28977
29194
|
const heading = tab.isPlugin ? tab.group ?? t("common.plugins") : null;
|
|
@@ -29052,14 +29269,14 @@ function InviteMemberDialog({ open, onOpenChange, defaultEmail }) {
|
|
|
29052
29269
|
const profiles = usePermissionsStore((s) => s.profiles);
|
|
29053
29270
|
const setInvites = useInviteStore((s) => s.setInvites);
|
|
29054
29271
|
const { user } = useAuthStore();
|
|
29055
|
-
const [emails, setEmails] =
|
|
29056
|
-
const [profileId, setProfileId] =
|
|
29057
|
-
const [sending, setSending] =
|
|
29058
|
-
const [sent, setSent] =
|
|
29059
|
-
|
|
29272
|
+
const [emails, setEmails] = React122.useState([defaultEmail ?? ""]);
|
|
29273
|
+
const [profileId, setProfileId] = React122.useState(profiles[1]?.id ?? profiles[0]?.id ?? "");
|
|
29274
|
+
const [sending, setSending] = React122.useState(false);
|
|
29275
|
+
const [sent, setSent] = React122.useState(false);
|
|
29276
|
+
React122.useEffect(() => {
|
|
29060
29277
|
if (open) setEmails([defaultEmail ?? ""]);
|
|
29061
29278
|
}, [open, defaultEmail]);
|
|
29062
|
-
|
|
29279
|
+
React122.useEffect(() => {
|
|
29063
29280
|
if (!profileId && profiles.length) setProfileId(profiles[1]?.id ?? profiles[0].id);
|
|
29064
29281
|
}, [profiles, profileId]);
|
|
29065
29282
|
const addEmail = () => setEmails((prev) => [...prev, ""]);
|
|
@@ -29163,7 +29380,7 @@ function UnitSwitcher({ collapsed = false, className }) {
|
|
|
29163
29380
|
const myUnitIds = useUnitStore((s) => s.myUnitIds);
|
|
29164
29381
|
const activeUnitId = useUnitStore((s) => s.activeUnitId);
|
|
29165
29382
|
const beginSwitch = useUnitSwitchingStore((s) => s.begin);
|
|
29166
|
-
const [query, setQuery] =
|
|
29383
|
+
const [query, setQuery] = React122.useState("");
|
|
29167
29384
|
const singular = label(t, "unit.singular", "unidade");
|
|
29168
29385
|
const plural = label(t, "unit.plural", "unidades");
|
|
29169
29386
|
if (!unitMode) return null;
|
|
@@ -29188,13 +29405,13 @@ function UnitSwitcher({ collapsed = false, className }) {
|
|
|
29188
29405
|
}
|
|
29189
29406
|
const renderNode = (node, depth) => {
|
|
29190
29407
|
if (node.kind === "region") {
|
|
29191
|
-
return /* @__PURE__ */ jsxs(
|
|
29408
|
+
return /* @__PURE__ */ jsxs(React122.Fragment, { children: [
|
|
29192
29409
|
/* @__PURE__ */ jsx(DropdownLabel, { className: "px-2 pt-2 text-[10px] uppercase tracking-wide text-muted-foreground", children: node.name }),
|
|
29193
29410
|
node.children.map((child) => renderNode(child, depth + 1))
|
|
29194
29411
|
] }, node.id);
|
|
29195
29412
|
}
|
|
29196
29413
|
if (!reachable.includes(node.id)) return null;
|
|
29197
|
-
return /* @__PURE__ */ jsxs(
|
|
29414
|
+
return /* @__PURE__ */ jsxs(React122.Fragment, { children: [
|
|
29198
29415
|
/* @__PURE__ */ jsxs(
|
|
29199
29416
|
DropdownItem,
|
|
29200
29417
|
{
|
|
@@ -29277,7 +29494,7 @@ function UnitSwitcher({ collapsed = false, className }) {
|
|
|
29277
29494
|
var MENU_LIST_CAP = 5;
|
|
29278
29495
|
function UnitMenuSection() {
|
|
29279
29496
|
useUnitBootstrap();
|
|
29280
|
-
const [locating, setLocating] =
|
|
29497
|
+
const [locating, setLocating] = React122.useState(false);
|
|
29281
29498
|
const unitMode = useUnitStore((s) => s.unitMode);
|
|
29282
29499
|
const units = useUnitStore((s) => s.units);
|
|
29283
29500
|
const tree = useUnitStore((s) => s.tree);
|
|
@@ -29328,13 +29545,13 @@ function UnitMenuSection() {
|
|
|
29328
29545
|
if (node.kind === "region") {
|
|
29329
29546
|
const visibleChildren = node.children.filter((c) => c.kind === "region" || reachable.includes(c.id));
|
|
29330
29547
|
if (visibleChildren.length === 0) return null;
|
|
29331
|
-
return /* @__PURE__ */ jsxs(
|
|
29548
|
+
return /* @__PURE__ */ jsxs(React122.Fragment, { children: [
|
|
29332
29549
|
/* @__PURE__ */ jsx(DropdownLabel, { className: "px-2 pt-2 text-[10px] uppercase tracking-wide text-muted-foreground", children: node.name }),
|
|
29333
29550
|
visibleChildren.map((child) => renderNode(child, depth + 1))
|
|
29334
29551
|
] }, node.id);
|
|
29335
29552
|
}
|
|
29336
29553
|
if (!reachable.includes(node.id)) return null;
|
|
29337
|
-
return /* @__PURE__ */ jsxs(
|
|
29554
|
+
return /* @__PURE__ */ jsxs(React122.Fragment, { children: [
|
|
29338
29555
|
/* @__PURE__ */ jsxs(
|
|
29339
29556
|
DropdownItem,
|
|
29340
29557
|
{
|
|
@@ -29473,9 +29690,9 @@ function MemberUnitsCell({
|
|
|
29473
29690
|
const byId = useUnitStore((s) => s.byId);
|
|
29474
29691
|
const unitMode = useUnitStore((s) => s.unitMode);
|
|
29475
29692
|
const openUnit = useUnitPanel((s) => s.openUnit);
|
|
29476
|
-
const [unitIds, setUnitIds] =
|
|
29693
|
+
const [unitIds, setUnitIds] = React122.useState(null);
|
|
29477
29694
|
const version5 = useDataVersion(UNIT_ACCESS_CHANGED);
|
|
29478
|
-
|
|
29695
|
+
React122.useEffect(() => {
|
|
29479
29696
|
if (!userId) {
|
|
29480
29697
|
setUnitIds([]);
|
|
29481
29698
|
return;
|
|
@@ -29533,10 +29750,10 @@ function TeamTab() {
|
|
|
29533
29750
|
const { user } = useAuthStore();
|
|
29534
29751
|
const hasSystemPermission = useSystemPermission();
|
|
29535
29752
|
const personMode = teamPersonKinds.length > 0 && typeof adapter?.listTeam === "function";
|
|
29536
|
-
const [team, setTeam] =
|
|
29537
|
-
const [inviteOpen, setInviteOpen] =
|
|
29753
|
+
const [team, setTeam] = React122.useState(null);
|
|
29754
|
+
const [inviteOpen, setInviteOpen] = React122.useState(false);
|
|
29538
29755
|
const guardSeats = useLimitGuard("users");
|
|
29539
|
-
const [inviteEmail, setInviteEmail] =
|
|
29756
|
+
const [inviteEmail, setInviteEmail] = React122.useState(void 0);
|
|
29540
29757
|
const handleOpenInvite = async (row) => {
|
|
29541
29758
|
if (row && !row.email && row.personId && entityRouteHasDetail("person", row.kind)) {
|
|
29542
29759
|
openEntity(row.personId, "person", row.kind, "access");
|
|
@@ -29546,7 +29763,7 @@ function TeamTab() {
|
|
|
29546
29763
|
setInviteEmail(row?.email || void 0);
|
|
29547
29764
|
setInviteOpen(true);
|
|
29548
29765
|
};
|
|
29549
|
-
const reloadTeam =
|
|
29766
|
+
const reloadTeam = React122.useCallback(async () => {
|
|
29550
29767
|
if (!adapter || !currentOrg) return;
|
|
29551
29768
|
if (personMode && adapter.listTeam) {
|
|
29552
29769
|
setTeam(await adapter.listTeam(currentOrg.id, teamPersonKinds));
|
|
@@ -29554,12 +29771,12 @@ function TeamTab() {
|
|
|
29554
29771
|
setMembers(await adapter.listMembers(currentOrg.id));
|
|
29555
29772
|
}
|
|
29556
29773
|
}, [adapter, currentOrg?.id, personMode, teamPersonKinds, setMembers]);
|
|
29557
|
-
|
|
29774
|
+
React122.useEffect(() => {
|
|
29558
29775
|
if (personMode && adapter?.listTeam && currentOrg) {
|
|
29559
29776
|
dedup("team:people:" + currentOrg.id, () => adapter.listTeam(currentOrg.id, teamPersonKinds)).then(setTeam).catch(() => setTeam([]));
|
|
29560
29777
|
}
|
|
29561
29778
|
}, [personMode, adapter, currentOrg?.id, teamPersonKinds.join(",")]);
|
|
29562
|
-
|
|
29779
|
+
React122.useEffect(() => {
|
|
29563
29780
|
if (adapter && currentOrg) {
|
|
29564
29781
|
dedup("team:invites:" + currentOrg.id, () => adapter.listInvites(currentOrg.id)).then(setInvites).catch(() => {
|
|
29565
29782
|
});
|
|
@@ -29640,7 +29857,7 @@ function TeamTab() {
|
|
|
29640
29857
|
};
|
|
29641
29858
|
const { t } = useTranslation$1();
|
|
29642
29859
|
const canManageTeam = hasSystemPermission("manage_team");
|
|
29643
|
-
const inviteActions =
|
|
29860
|
+
const inviteActions = React122.useMemo(() => [{
|
|
29644
29861
|
id: "invite",
|
|
29645
29862
|
label: t("organization.team.invite"),
|
|
29646
29863
|
icon: UserPlus,
|
|
@@ -29827,13 +30044,13 @@ var SYSTEM_PERMISSIONS = [
|
|
|
29827
30044
|
];
|
|
29828
30045
|
function PermissionMatrixEditor({ features, profile, onSave, onCancel, saving, isNew, parentLabel }) {
|
|
29829
30046
|
const { t } = useTranslation$1();
|
|
29830
|
-
const [name, setName] =
|
|
29831
|
-
const [description, setDescription] =
|
|
29832
|
-
const [systemPerms, setSystemPerms] =
|
|
29833
|
-
const [grants, setGrants] =
|
|
29834
|
-
const [collapsed, setCollapsed] =
|
|
29835
|
-
const [search, setSearch] =
|
|
29836
|
-
const initial =
|
|
30047
|
+
const [name, setName] = React122.useState(profile?.name ?? "");
|
|
30048
|
+
const [description, setDescription] = React122.useState(profile?.description ?? "");
|
|
30049
|
+
const [systemPerms, setSystemPerms] = React122.useState(profile?.systemPermissions ?? []);
|
|
30050
|
+
const [grants, setGrants] = React122.useState(profile?.grants ?? {});
|
|
30051
|
+
const [collapsed, setCollapsed] = React122.useState(/* @__PURE__ */ new Set());
|
|
30052
|
+
const [search, setSearch] = React122.useState("");
|
|
30053
|
+
const initial = React122.useRef({
|
|
29837
30054
|
name: profile?.name ?? "",
|
|
29838
30055
|
description: profile?.description ?? "",
|
|
29839
30056
|
systemPerms: JSON.stringify(profile?.systemPermissions ?? []),
|
|
@@ -29870,7 +30087,7 @@ function PermissionMatrixEditor({ features, profile, onSave, onCancel, saving, i
|
|
|
29870
30087
|
onDiscard: onCancel,
|
|
29871
30088
|
saveLabel: isNew ? t("organization.permissions.createProfile") : t("organization.permissions.updateProfile")
|
|
29872
30089
|
});
|
|
29873
|
-
const groups =
|
|
30090
|
+
const groups = React122.useMemo(() => {
|
|
29874
30091
|
const filtered = search ? features.filter((f) => f.label.toLowerCase().includes(search.toLowerCase())) : features;
|
|
29875
30092
|
const map = /* @__PURE__ */ new Map();
|
|
29876
30093
|
for (const f of filtered) {
|
|
@@ -29939,7 +30156,7 @@ function PermissionMatrixEditor({ features, profile, onSave, onCancel, saving, i
|
|
|
29939
30156
|
}
|
|
29940
30157
|
) }) })
|
|
29941
30158
|
] }, sp.id)),
|
|
29942
|
-
Array.from(groups.entries()).map(([groupName, groupFeatures]) => /* @__PURE__ */ jsxs(
|
|
30159
|
+
Array.from(groups.entries()).map(([groupName, groupFeatures]) => /* @__PURE__ */ jsxs(React122.Fragment, { children: [
|
|
29943
30160
|
/* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: 5, className: "p-2 px-3", children: /* @__PURE__ */ jsxs(
|
|
29944
30161
|
"button",
|
|
29945
30162
|
{
|
|
@@ -30011,12 +30228,12 @@ function PermissionProfilesTab() {
|
|
|
30011
30228
|
const startImpersonation = usePermissionsStore((s) => s.startImpersonation);
|
|
30012
30229
|
const canPreview = (realProfile?.systemPermissions ?? []).includes("manage_permissions") ?? false;
|
|
30013
30230
|
const { t } = useTranslation$1();
|
|
30014
|
-
const [editingProfile, setEditingProfile] =
|
|
30015
|
-
const [creating, setCreating] =
|
|
30016
|
-
const [duplicateSource, setDuplicateSource] =
|
|
30017
|
-
const [saving, setSaving] =
|
|
30018
|
-
const [error, setError] =
|
|
30019
|
-
const [deleting, setDeleting] =
|
|
30231
|
+
const [editingProfile, setEditingProfile] = React122.useState(null);
|
|
30232
|
+
const [creating, setCreating] = React122.useState(false);
|
|
30233
|
+
const [duplicateSource, setDuplicateSource] = React122.useState(null);
|
|
30234
|
+
const [saving, setSaving] = React122.useState(false);
|
|
30235
|
+
const [error, setError] = React122.useState(null);
|
|
30236
|
+
const [deleting, setDeleting] = React122.useState(null);
|
|
30020
30237
|
const handleDuplicate = (profile) => {
|
|
30021
30238
|
setEditingProfile(null);
|
|
30022
30239
|
setCreating(false);
|
|
@@ -30026,9 +30243,9 @@ function PermissionProfilesTab() {
|
|
|
30026
30243
|
isSystem: false
|
|
30027
30244
|
});
|
|
30028
30245
|
};
|
|
30029
|
-
const surfaceRef =
|
|
30246
|
+
const surfaceRef = React122.useRef({ features, profiles, adapter, currentOrg, setProfiles });
|
|
30030
30247
|
surfaceRef.current = { features, profiles, adapter, currentOrg, setProfiles };
|
|
30031
|
-
const agentSurface =
|
|
30248
|
+
const agentSurface = React122.useMemo(() => ({
|
|
30032
30249
|
id: "org.permissions",
|
|
30033
30250
|
instructions: PERMISSIONS_INSTRUCTIONS,
|
|
30034
30251
|
describe: () => {
|
|
@@ -30082,7 +30299,7 @@ function PermissionProfilesTab() {
|
|
|
30082
30299
|
}]
|
|
30083
30300
|
}), []);
|
|
30084
30301
|
useAgentSurface(agentSurface);
|
|
30085
|
-
const createActions =
|
|
30302
|
+
const createActions = React122.useMemo(() => [
|
|
30086
30303
|
{
|
|
30087
30304
|
id: "new",
|
|
30088
30305
|
label: t("organization.permissions.createProfile"),
|
|
@@ -30111,7 +30328,7 @@ function PermissionProfilesTab() {
|
|
|
30111
30328
|
})
|
|
30112
30329
|
}
|
|
30113
30330
|
], [t]);
|
|
30114
|
-
const memberCountByProfile =
|
|
30331
|
+
const memberCountByProfile = React122.useMemo(() => {
|
|
30115
30332
|
const counts = {};
|
|
30116
30333
|
for (const m of members) {
|
|
30117
30334
|
counts[m.profileId] = (counts[m.profileId] ?? 0) + 1;
|
|
@@ -30416,7 +30633,7 @@ function FieldRulesSettings({ entities, rules: initialRules, onSave }) {
|
|
|
30416
30633
|
const [saving, setSaving] = useState(false);
|
|
30417
30634
|
const [search, setSearch] = useState("");
|
|
30418
30635
|
const [showMore, setShowMore] = useState(false);
|
|
30419
|
-
|
|
30636
|
+
React122.useEffect(() => {
|
|
30420
30637
|
setDraft(initialRules);
|
|
30421
30638
|
}, [initialRules]);
|
|
30422
30639
|
const isDirty = useMemo(
|
|
@@ -30816,19 +31033,19 @@ function SoftLimitWidget() {
|
|
|
30816
31033
|
function LimitProbe({ limitKey }) {
|
|
30817
31034
|
const info = useLimit(limitKey);
|
|
30818
31035
|
const report = useSoftLimitStore((s) => s.report);
|
|
30819
|
-
|
|
31036
|
+
React122.useEffect(() => {
|
|
30820
31037
|
report(limitKey, info);
|
|
30821
31038
|
}, [limitKey, info, report]);
|
|
30822
31039
|
return null;
|
|
30823
31040
|
}
|
|
30824
31041
|
function SoftLimitProbes({ keys }) {
|
|
30825
|
-
const monitored =
|
|
31042
|
+
const monitored = React122.useMemo(() => Array.from(new Set(keys)), [keys]);
|
|
30826
31043
|
return /* @__PURE__ */ jsx(Fragment, { children: monitored.map((k) => /* @__PURE__ */ jsx(LimitProbe, { limitKey: k }, k)) });
|
|
30827
31044
|
}
|
|
30828
|
-
var CommandPalette =
|
|
31045
|
+
var CommandPalette = React122.lazy(
|
|
30829
31046
|
() => import('./CommandPalette-B5PMQFDG.js').then((m) => ({ default: m.CommandPalette }))
|
|
30830
31047
|
);
|
|
30831
|
-
var SubscriptionPage =
|
|
31048
|
+
var SubscriptionPage = React122.lazy(
|
|
30832
31049
|
() => import('./SubscriptionPage-TVAEOFNC.js').then((m) => ({ default: m.SubscriptionPage }))
|
|
30833
31050
|
);
|
|
30834
31051
|
function WorkspaceSwitcher({
|
|
@@ -30878,8 +31095,8 @@ function WorkspaceSwitcher({
|
|
|
30878
31095
|
const v = t(key);
|
|
30879
31096
|
return !v || v === key ? fallback : v;
|
|
30880
31097
|
};
|
|
30881
|
-
const [query, setQuery] =
|
|
30882
|
-
const search =
|
|
31098
|
+
const [query, setQuery] = React122.useState("");
|
|
31099
|
+
const search = React122.useMemo(
|
|
30883
31100
|
() => searchWorkspaces(
|
|
30884
31101
|
options,
|
|
30885
31102
|
query,
|
|
@@ -31193,9 +31410,9 @@ function PluginHeaderControls() {
|
|
|
31193
31410
|
}
|
|
31194
31411
|
function AdminNotifications() {
|
|
31195
31412
|
const { notifications, unreadCount, fetchNotifications, markAsRead, markAllAsRead } = useNotifications();
|
|
31196
|
-
const [open, setOpen] =
|
|
31197
|
-
const fetchedRef =
|
|
31198
|
-
|
|
31413
|
+
const [open, setOpen] = React122.useState(false);
|
|
31414
|
+
const fetchedRef = React122.useRef(false);
|
|
31415
|
+
React122.useEffect(() => {
|
|
31199
31416
|
if (fetchedRef.current) return;
|
|
31200
31417
|
fetchedRef.current = true;
|
|
31201
31418
|
void fetchNotifications();
|
|
@@ -31341,7 +31558,7 @@ function buildSettingsTabs(pluginTabs, can, hasSystem, t, showOrgSettings, hasBi
|
|
|
31341
31558
|
// sidebar ICON_MAP, which made the settings rail fall back to Home.
|
|
31342
31559
|
icon: /* @__PURE__ */ jsx(CreditCard, { className: "h-4 w-4" }),
|
|
31343
31560
|
iconName: "CreditCard",
|
|
31344
|
-
component: /* @__PURE__ */ jsx(
|
|
31561
|
+
component: /* @__PURE__ */ jsx(React122.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(SubscriptionPage, {}) })
|
|
31345
31562
|
});
|
|
31346
31563
|
}
|
|
31347
31564
|
if (showOrgSettings) {
|
|
@@ -31369,9 +31586,9 @@ function buildSettingsTabs(pluginTabs, can, hasSystem, t, showOrgSettings, hasBi
|
|
|
31369
31586
|
settingsTabs.push({
|
|
31370
31587
|
id: tab.id,
|
|
31371
31588
|
label: translated === labelKey ? tab.label : translated,
|
|
31372
|
-
icon:
|
|
31589
|
+
icon: React122.createElement(IconComp, { className: "h-4 w-4" }),
|
|
31373
31590
|
iconName,
|
|
31374
|
-
component:
|
|
31591
|
+
component: React122.createElement(tab.component),
|
|
31375
31592
|
// Flag plugin-contributed tabs so SettingsPage draws the core/plugins divider.
|
|
31376
31593
|
isPlugin: true,
|
|
31377
31594
|
group: tab.group
|
|
@@ -31419,12 +31636,12 @@ function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar",
|
|
|
31419
31636
|
profileKnown: !activeTenantId || profileKnownFor === activeTenantId
|
|
31420
31637
|
});
|
|
31421
31638
|
const navError = configError ?? tenantCtx?.loadError ?? null;
|
|
31422
|
-
const onNavRetry =
|
|
31639
|
+
const onNavRetry = React122.useCallback(() => {
|
|
31423
31640
|
if (tenantCtx?.loadError) tenantCtx.retryOrgs();
|
|
31424
31641
|
else window.location.reload();
|
|
31425
31642
|
}, [tenantCtx]);
|
|
31426
31643
|
const currentProfile = usePermissionsStore((s) => s.currentProfile);
|
|
31427
|
-
const hasSystem =
|
|
31644
|
+
const hasSystem = React122.useCallback(
|
|
31428
31645
|
(perm) => {
|
|
31429
31646
|
if (!currentProfile) return false;
|
|
31430
31647
|
if (currentProfile.id === "owner" || currentProfile.name?.toLowerCase() === "owner") return true;
|
|
@@ -31438,8 +31655,8 @@ function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar",
|
|
|
31438
31655
|
};
|
|
31439
31656
|
const path = useAdminPath();
|
|
31440
31657
|
const { user, signOut } = useAuth();
|
|
31441
|
-
|
|
31442
|
-
|
|
31658
|
+
React122.useEffect(() => installGlobalErrorHandlers(), []);
|
|
31659
|
+
React122.useEffect(() => registerErrorReporter((report) => {
|
|
31443
31660
|
if (report.source !== "data") return;
|
|
31444
31661
|
const alvo = report.extra?.operation;
|
|
31445
31662
|
toast.error(
|
|
@@ -31457,15 +31674,15 @@ function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar",
|
|
|
31457
31674
|
const hasChatPanel = useRightRailStore((s) => s.panels.some((pn) => pn.id === "chat"));
|
|
31458
31675
|
const rightRail = railHasPanels ? /* @__PURE__ */ jsx(RightRail, { frame: contentFrame, attached: layout !== "topbar" }) : null;
|
|
31459
31676
|
const setRailMounted = useRightRailStore((s) => s.setMounted);
|
|
31460
|
-
|
|
31677
|
+
React122.useEffect(() => {
|
|
31461
31678
|
setRailMounted(true);
|
|
31462
31679
|
return () => setRailMounted(false);
|
|
31463
31680
|
}, [setRailMounted]);
|
|
31464
31681
|
useConnectorOAuthReturn();
|
|
31465
31682
|
const railWidthLive = useRightRailStore((s) => s.width);
|
|
31466
31683
|
const setSidebarCollapsed = useLayoutStore((s) => s.setSidebarCollapsed);
|
|
31467
|
-
const railAutoCollapsedRef =
|
|
31468
|
-
|
|
31684
|
+
const railAutoCollapsedRef = React122.useRef(false);
|
|
31685
|
+
React122.useEffect(() => {
|
|
31469
31686
|
if (layout !== "sidebar") return;
|
|
31470
31687
|
const SIDEBAR_EXPANDED = 224;
|
|
31471
31688
|
const MIN_CONTENT = 620;
|
|
@@ -31487,22 +31704,22 @@ function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar",
|
|
|
31487
31704
|
window.addEventListener("resize", apply);
|
|
31488
31705
|
return () => window.removeEventListener("resize", apply);
|
|
31489
31706
|
}, [railOpen, railWidthLive, layout, setSidebarCollapsed]);
|
|
31490
|
-
const [railWidth] =
|
|
31707
|
+
const [railWidth] = React122.useState(() => readRightRailWidth());
|
|
31491
31708
|
const billingPlans = useBillingStore((s) => s.plans);
|
|
31492
31709
|
const hasBilling = billingPlans.length > 0;
|
|
31493
31710
|
const orgPlan = useTenantOptional()?.org?.plan;
|
|
31494
|
-
const planBadge =
|
|
31711
|
+
const planBadge = React122.useMemo(
|
|
31495
31712
|
() => hasBilling ? resolvePlanBadge(orgPlan, billingPlans) : null,
|
|
31496
31713
|
[hasBilling, orgPlan, billingPlans]
|
|
31497
31714
|
);
|
|
31498
|
-
const softLimitKeys =
|
|
31715
|
+
const softLimitKeys = React122.useMemo(() => {
|
|
31499
31716
|
const plan = billingPlans.find((p) => p.id === (orgPlan || "free"));
|
|
31500
31717
|
return Object.keys(getPlanEntitlements(plan)?.limits ?? {});
|
|
31501
31718
|
}, [billingPlans, orgPlan]);
|
|
31502
31719
|
const overshoots = useOvershoots();
|
|
31503
31720
|
const navContributions = useNavContributionsStore((s) => s.contributions);
|
|
31504
31721
|
const appConfigNav = useAppConfigStore((state) => state.config.nav);
|
|
31505
|
-
const navigation =
|
|
31722
|
+
const navigation = React122.useMemo(() => {
|
|
31506
31723
|
const contributed = Object.values(navContributions).flat();
|
|
31507
31724
|
const flat = dedupeByRoute(
|
|
31508
31725
|
[...runtime.navigation, ...contributed].map((entry) => ({
|
|
@@ -31573,7 +31790,7 @@ function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar",
|
|
|
31573
31790
|
}).filter((item) => item !== null).sort(compareNavigation);
|
|
31574
31791
|
return applyRailPreset(gated, presetRail, presetHide, presetWhole);
|
|
31575
31792
|
}, [runtime.navigation, runtime.routes, navContributions, pages, access, navWaiting, presetRail, presetHide, presetWhole, presetLabels]);
|
|
31576
|
-
const composedNavigation =
|
|
31793
|
+
const composedNavigation = React122.useMemo(() => {
|
|
31577
31794
|
if (!appConfigNav.length) return navigation;
|
|
31578
31795
|
const keyed = navigation.map((item) => ({ ...item, key: item.route }));
|
|
31579
31796
|
return applyNavComposition(keyed, appConfigNav).map((item) => {
|
|
@@ -31589,13 +31806,13 @@ function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar",
|
|
|
31589
31806
|
};
|
|
31590
31807
|
});
|
|
31591
31808
|
}, [navigation, appConfigNav]);
|
|
31592
|
-
const resolvedBottomNav =
|
|
31809
|
+
const resolvedBottomNav = React122.useMemo(
|
|
31593
31810
|
() => deriveBottomNav(navigation, bottomNav, { assistant: hasChatPanel }),
|
|
31594
31811
|
[navigation, bottomNav, hasChatPanel]
|
|
31595
31812
|
);
|
|
31596
31813
|
const commandPaletteOpen = useLayoutStore((s) => s.commandPaletteOpen);
|
|
31597
31814
|
const setCommandPaletteOpen = useLayoutStore((s) => s.setCommandPaletteOpen);
|
|
31598
|
-
const commandItems =
|
|
31815
|
+
const commandItems = React122.useMemo(() => {
|
|
31599
31816
|
const navGroup = tr("layout.commandPalette.navigation", "Navigation");
|
|
31600
31817
|
const items = [];
|
|
31601
31818
|
for (const nav of navigation) {
|
|
@@ -31607,7 +31824,7 @@ function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar",
|
|
|
31607
31824
|
return items;
|
|
31608
31825
|
}, [navigation]);
|
|
31609
31826
|
const globalSearch = useGlobalSearch();
|
|
31610
|
-
const routes =
|
|
31827
|
+
const routes = React122.useMemo(() => {
|
|
31611
31828
|
const list = [];
|
|
31612
31829
|
const entityRouteMap = /* @__PURE__ */ new Map();
|
|
31613
31830
|
for (const r of runtime.routes) {
|
|
@@ -31630,14 +31847,14 @@ function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar",
|
|
|
31630
31847
|
setEntityRouteMap(entityRouteMap);
|
|
31631
31848
|
return list.sort((a, b) => routeScore(b.path) - routeScore(a.path));
|
|
31632
31849
|
}, [runtime.routes, pages, showSettings]);
|
|
31633
|
-
const match =
|
|
31850
|
+
const match = React122.useMemo(() => {
|
|
31634
31851
|
for (const r of routes) {
|
|
31635
31852
|
const params = matchRoute(r.path, path);
|
|
31636
31853
|
if (params) return { route: r, params };
|
|
31637
31854
|
}
|
|
31638
31855
|
return null;
|
|
31639
31856
|
}, [routes, path]);
|
|
31640
|
-
|
|
31857
|
+
React122.useEffect(() => {
|
|
31641
31858
|
if (!match && (path === "/" || path === "") && navigation.length > 0) {
|
|
31642
31859
|
navigateTo(navigation[0].route);
|
|
31643
31860
|
}
|
|
@@ -31645,11 +31862,11 @@ function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar",
|
|
|
31645
31862
|
const ActiveComponent = match?.route.Component;
|
|
31646
31863
|
const activeParams = match?.params ?? {};
|
|
31647
31864
|
const routeKey = (match?.route.path ?? path).replace(/\/\*$/, "");
|
|
31648
|
-
const settingsTabs =
|
|
31865
|
+
const settingsTabs = React122.useMemo(
|
|
31649
31866
|
() => buildSettingsTabs(runtime.settingsTabs, can, hasSystem, t, showOrgSettings, hasBilling),
|
|
31650
31867
|
[runtime.settingsTabs, can, hasSystem, t, showOrgSettings, hasBilling]
|
|
31651
31868
|
);
|
|
31652
|
-
const profileRoute =
|
|
31869
|
+
const profileRoute = React122.useMemo(() => {
|
|
31653
31870
|
const explicit = routes.find((r) => r.path === "/perfil" || r.path === "/profile");
|
|
31654
31871
|
if (explicit) return explicit.path;
|
|
31655
31872
|
return showSettings ? "/settings/profile" : null;
|
|
@@ -31657,7 +31874,7 @@ function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar",
|
|
|
31657
31874
|
const onProfile = profileRoute ? () => navigateTo(profileRoute) : void 0;
|
|
31658
31875
|
const onBilling = hasBilling && showSettings ? () => navigateTo("/settings/subscription") : void 0;
|
|
31659
31876
|
const coreSettingsTabs = useCoreSettingsTabs({ showCompany: showBranding, showBranding });
|
|
31660
|
-
const allSettingsTabs =
|
|
31877
|
+
const allSettingsTabs = React122.useMemo(
|
|
31661
31878
|
() => {
|
|
31662
31879
|
const hidden = new Set(hiddenSettingsTabs ?? []);
|
|
31663
31880
|
const visible = [...coreSettingsTabs, ...settingsTabs].filter((tab) => !hidden.has(tab.id));
|
|
@@ -31673,12 +31890,12 @@ function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar",
|
|
|
31673
31890
|
const moduleRail = !inSettings && layout === "sidebar" && contextualNav && (path === contextualNav.base || path.startsWith(contextualNav.base + "/")) ? contextualNav : null;
|
|
31674
31891
|
const settingsPathActive = showSettings && (path === "/settings" || path.startsWith("/settings/"));
|
|
31675
31892
|
const activeSettingsTab = settingsPathActive ? path === "/settings" ? null : path.slice("/settings/".length).split("/")[0] : void 0;
|
|
31676
|
-
const settingsTabDef =
|
|
31893
|
+
const settingsTabDef = React122.useMemo(() => {
|
|
31677
31894
|
if (!showSettings || !path.startsWith("/settings/")) return void 0;
|
|
31678
31895
|
const id = path.slice("/settings/".length).split("/")[0];
|
|
31679
31896
|
return allSettingsTabs.find((tab) => tab.id === id);
|
|
31680
31897
|
}, [showSettings, path, allSettingsTabs]);
|
|
31681
|
-
const settingsNavigation =
|
|
31898
|
+
const settingsNavigation = React122.useMemo(
|
|
31682
31899
|
() => allSettingsTabs.map((tab) => ({
|
|
31683
31900
|
id: `settings:${tab.id}`,
|
|
31684
31901
|
label: tab.label,
|
|
@@ -31696,10 +31913,10 @@ function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar",
|
|
|
31696
31913
|
const shellUser = user ? { fullName: user.fullName ?? user.email, email: user.email, avatarUrl: user.avatarUrl } : void 0;
|
|
31697
31914
|
const moduleVariant = moduleNav ?? (layout === "sidebar" ? "tabs" : "rail");
|
|
31698
31915
|
const setRailAvailable = useContextualNavStore((s) => s.setRailAvailable);
|
|
31699
|
-
|
|
31916
|
+
React122.useEffect(() => {
|
|
31700
31917
|
setRailAvailable(layout === "sidebar" && moduleVariant !== "rail");
|
|
31701
31918
|
}, [layout, moduleVariant, setRailAvailable]);
|
|
31702
|
-
const activePageTitle =
|
|
31919
|
+
const activePageTitle = React122.useMemo(() => {
|
|
31703
31920
|
if (settingsTabDef) return settingsTabDef.label;
|
|
31704
31921
|
if (path === "/settings" || path.startsWith("/settings/")) return tr("common.settings", "Settings");
|
|
31705
31922
|
if (match?.route.title) return match.route.title;
|
|
@@ -31713,7 +31930,7 @@ function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar",
|
|
|
31713
31930
|
if (hiddenHit?.label) return hiddenHit.label;
|
|
31714
31931
|
return candidates.find((n) => n.route === "/")?.label ?? "";
|
|
31715
31932
|
}, [navigation, pages, path, tr, match, settingsTabDef]);
|
|
31716
|
-
const parentBack =
|
|
31933
|
+
const parentBack = React122.useMemo(() => {
|
|
31717
31934
|
if (settingsTabDef) {
|
|
31718
31935
|
const first = allSettingsTabs[0]?.id;
|
|
31719
31936
|
return {
|
|
@@ -31751,9 +31968,9 @@ function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar",
|
|
|
31751
31968
|
]
|
|
31752
31969
|
}
|
|
31753
31970
|
);
|
|
31754
|
-
const [railQuery, setRailQuery] =
|
|
31971
|
+
const [railQuery, setRailQuery] = React122.useState("");
|
|
31755
31972
|
const railBase = moduleRail?.base ?? null;
|
|
31756
|
-
|
|
31973
|
+
React122.useEffect(() => {
|
|
31757
31974
|
setRailQuery("");
|
|
31758
31975
|
}, [railBase]);
|
|
31759
31976
|
const railSearch = (placeholder) => /* @__PURE__ */ jsxs("div", { className: "relative px-0.5 pt-1", children: [
|
|
@@ -31966,7 +32183,7 @@ function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar",
|
|
|
31966
32183
|
]
|
|
31967
32184
|
}
|
|
31968
32185
|
),
|
|
31969
|
-
/* @__PURE__ */ jsx(
|
|
32186
|
+
/* @__PURE__ */ jsx(React122.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
|
|
31970
32187
|
CommandPalette,
|
|
31971
32188
|
{
|
|
31972
32189
|
commands: commandItems,
|
|
@@ -32233,7 +32450,7 @@ function buildI18nConfig(config) {
|
|
|
32233
32450
|
function BillingInitializer({ config }) {
|
|
32234
32451
|
const setPlans = useBillingStore((s) => s.setPlans);
|
|
32235
32452
|
const setCheckout = useBillingStore((s) => s.setCheckout);
|
|
32236
|
-
|
|
32453
|
+
React122.useEffect(() => {
|
|
32237
32454
|
if (config.billing?.plans) setPlans(config.billing.plans.map(normalizeBillingPlan));
|
|
32238
32455
|
setCheckout(config.billing?.onCheckout ?? null);
|
|
32239
32456
|
}, [config.billing, setPlans, setCheckout]);
|
|
@@ -32350,9 +32567,9 @@ function ThemeInitializer({ config }) {
|
|
|
32350
32567
|
const setOverrides = useThemeStore((s) => s.setOverrides);
|
|
32351
32568
|
const setMode = useThemeStore((s) => s.setMode);
|
|
32352
32569
|
const rawBranding = useOrganizationStore((s) => s.currentOrg?.settings?.branding);
|
|
32353
|
-
const brandTokens =
|
|
32570
|
+
const brandTokens = React122.useMemo(() => normalizeBrand(rawBranding).tokens, [rawBranding]);
|
|
32354
32571
|
const brandKey = JSON.stringify(brandTokens);
|
|
32355
|
-
|
|
32572
|
+
React122.useEffect(() => {
|
|
32356
32573
|
const tokens = JSON.parse(brandKey);
|
|
32357
32574
|
const brand = tokens.color?.primary ? hexToHslTriplet(tokens.color.primary) : null;
|
|
32358
32575
|
if (config.theme) {
|
|
@@ -32369,20 +32586,20 @@ function ThemeInitializer({ config }) {
|
|
|
32369
32586
|
return null;
|
|
32370
32587
|
}
|
|
32371
32588
|
function PersistentCacheInitializer() {
|
|
32372
|
-
|
|
32589
|
+
React122.useEffect(() => {
|
|
32373
32590
|
attachPersistentCache();
|
|
32374
32591
|
void getPersistentCache()?.hydrate();
|
|
32375
32592
|
}, []);
|
|
32376
32593
|
return null;
|
|
32377
32594
|
}
|
|
32378
32595
|
function FayzEventBridgeInitializer({ config }) {
|
|
32379
|
-
|
|
32596
|
+
React122.useEffect(() => startFayzEventBridge(config.chat?.agent), [config.chat?.agent]);
|
|
32380
32597
|
return null;
|
|
32381
32598
|
}
|
|
32382
32599
|
function TeamInitializer({ config }) {
|
|
32383
32600
|
const setTeamPersonKinds = useOrganizationStore((s) => s.setTeamPersonKinds);
|
|
32384
32601
|
const kinds = config.team?.personKinds;
|
|
32385
|
-
|
|
32602
|
+
React122.useEffect(() => {
|
|
32386
32603
|
setTeamPersonKinds(kinds ?? []);
|
|
32387
32604
|
}, [setTeamPersonKinds, kinds]);
|
|
32388
32605
|
return null;
|
|
@@ -32398,7 +32615,7 @@ function ChatRailPanel({ config }) {
|
|
|
32398
32615
|
const agent = config.chat?.agent;
|
|
32399
32616
|
const voice = config.chat?.voice;
|
|
32400
32617
|
const whatsapp = config.chat?.whatsapp;
|
|
32401
|
-
const Component2 =
|
|
32618
|
+
const Component2 = React122.useMemo(() => {
|
|
32402
32619
|
const Panel = () => /* @__PURE__ */ jsx(
|
|
32403
32620
|
ChatConversation,
|
|
32404
32621
|
{
|
|
@@ -32415,8 +32632,8 @@ function ChatRailPanel({ config }) {
|
|
|
32415
32632
|
const conversations = useChatStore((s) => s.conversations);
|
|
32416
32633
|
const setConversations = useChatStore((s) => s.setConversations);
|
|
32417
32634
|
const user = useAuthStore((s) => s.user);
|
|
32418
|
-
const connection =
|
|
32419
|
-
|
|
32635
|
+
const connection = React122.useMemo(() => resolveFayzAgentConnection(agent), [agent]);
|
|
32636
|
+
React122.useEffect(() => {
|
|
32420
32637
|
if (!connection) return;
|
|
32421
32638
|
getFayzAgentClient(connection).listConversations(user?.id).then(setConversations).catch(() => {
|
|
32422
32639
|
});
|
|
@@ -32425,7 +32642,7 @@ function ChatRailPanel({ config }) {
|
|
|
32425
32642
|
useAssistantInviteStore((s) => s.invite?.id === ASK_AI_HANDOFF_ID);
|
|
32426
32643
|
const activeAgent = useAgent();
|
|
32427
32644
|
const persona = activeAgent?.name ?? invitePersona;
|
|
32428
|
-
const icon =
|
|
32645
|
+
const icon = React122.useMemo(
|
|
32429
32646
|
() => activeAgent ? function AgentTabIcon() {
|
|
32430
32647
|
return /* @__PURE__ */ jsx(
|
|
32431
32648
|
AgentAvatar,
|
|
@@ -32440,7 +32657,7 @@ function ChatRailPanel({ config }) {
|
|
|
32440
32657
|
[activeAgent]
|
|
32441
32658
|
);
|
|
32442
32659
|
useRightRailPanel(
|
|
32443
|
-
|
|
32660
|
+
React122.useMemo(
|
|
32444
32661
|
() => ({
|
|
32445
32662
|
id: "chat",
|
|
32446
32663
|
label: persona ?? "Chat",
|
|
@@ -32454,17 +32671,17 @@ function ChatRailPanel({ config }) {
|
|
|
32454
32671
|
[Component2, conversations.length, persona, icon, activeAgent]
|
|
32455
32672
|
)
|
|
32456
32673
|
);
|
|
32457
|
-
|
|
32674
|
+
React122.useEffect(() => {
|
|
32458
32675
|
if (chatOpen) openPanel("chat");
|
|
32459
32676
|
}, [chatOpen, openPanel]);
|
|
32460
|
-
|
|
32677
|
+
React122.useEffect(() => {
|
|
32461
32678
|
if (!(railOpen && railActive === "chat")) setChatOpen(false);
|
|
32462
32679
|
}, [railOpen, railActive, setChatOpen]);
|
|
32463
32680
|
return null;
|
|
32464
32681
|
}
|
|
32465
32682
|
function AdminProviders({ config, children }) {
|
|
32466
32683
|
const currentOrg = useOrganizationStore((s) => s.currentOrg);
|
|
32467
|
-
const hasFayzAgent =
|
|
32684
|
+
const hasFayzAgent = React122.useMemo(
|
|
32468
32685
|
() => !!resolveFayzAgentConnection(config.chat?.agent),
|
|
32469
32686
|
[config.chat?.agent]
|
|
32470
32687
|
);
|
|
@@ -32473,7 +32690,7 @@ function AdminProviders({ config, children }) {
|
|
|
32473
32690
|
const surface = config.chat?.surface ?? "dock";
|
|
32474
32691
|
const onConsentScreen = typeof window !== "undefined" && window.location.pathname.replace(/\/+$/, "").endsWith("/connect");
|
|
32475
32692
|
const showFab = assistantEnabled && surface === "dock" && !onConsentScreen;
|
|
32476
|
-
const resolved =
|
|
32693
|
+
const resolved = React122.useMemo(() => {
|
|
32477
32694
|
if (config.supabaseUrl && config.supabaseAnonKey) {
|
|
32478
32695
|
createFayzSupabaseClient(config.supabaseUrl, config.supabaseAnonKey);
|
|
32479
32696
|
}
|
|
@@ -32491,7 +32708,7 @@ function AdminProviders({ config, children }) {
|
|
|
32491
32708
|
const { bindings, ready: configReady } = useAppConfig();
|
|
32492
32709
|
const offeredPlugins = useOfferedPlugins();
|
|
32493
32710
|
const path = useAdminPath();
|
|
32494
|
-
const runtime =
|
|
32711
|
+
const runtime = React122.useMemo(
|
|
32495
32712
|
() => resolvePluginRuntime({
|
|
32496
32713
|
plugins: resolved.plugins,
|
|
32497
32714
|
// Só as ligações DESTA conta. Na janela da troca o config em mãos ainda
|
|
@@ -32531,7 +32748,7 @@ function AdminProviders({ config, children }) {
|
|
|
32531
32748
|
}),
|
|
32532
32749
|
[resolved.plugins, bindings, offeredPlugins, configReady, path, config.layout, currentOrg]
|
|
32533
32750
|
);
|
|
32534
|
-
|
|
32751
|
+
React122.useEffect(() => {
|
|
32535
32752
|
if (!import.meta.env?.DEV || !currentOrg) return;
|
|
32536
32753
|
const registered = new Set(resolved.plugins.map((p) => p.id));
|
|
32537
32754
|
const bound = new Set(bindings.map((b) => b.pluginId));
|
|
@@ -32883,8 +33100,8 @@ function manifestToFayzConfig(manifest, surfaceName) {
|
|
|
32883
33100
|
};
|
|
32884
33101
|
}
|
|
32885
33102
|
function AdminScaffold({ manifest, surface }) {
|
|
32886
|
-
const config =
|
|
32887
|
-
const authShellProps =
|
|
33103
|
+
const config = React122.useMemo(() => manifestToFayzConfig(manifest, surface), [manifest, surface]);
|
|
33104
|
+
const authShellProps = React122.useMemo(() => getAuthShellProps(config.auth), [config.auth]);
|
|
32888
33105
|
return /* @__PURE__ */ jsx(AdminProviders, { config, children: /* @__PURE__ */ jsx(ScaffoldShell, { config, authShellProps }) });
|
|
32889
33106
|
}
|
|
32890
33107
|
function ScaffoldShell({
|
|
@@ -33123,8 +33340,8 @@ function Badge24({ badge, className = "" }) {
|
|
|
33123
33340
|
}
|
|
33124
33341
|
function OrderDetailBlock({ title, hint, children }) {
|
|
33125
33342
|
return /* @__PURE__ */ jsxs("div", { className: "rounded-card border bg-card p-4", children: [
|
|
33126
|
-
/* @__PURE__ */ jsxs("div", { className: "mb-2", children: [
|
|
33127
|
-
/* @__PURE__ */ jsx("h3", { className: "text-sm font-medium", children: title }),
|
|
33343
|
+
(title || hint) && /* @__PURE__ */ jsxs("div", { className: "mb-2", children: [
|
|
33344
|
+
title && /* @__PURE__ */ jsx("h3", { className: "text-sm font-medium", children: title }),
|
|
33128
33345
|
hint && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: hint })
|
|
33129
33346
|
] }),
|
|
33130
33347
|
children
|
|
@@ -33325,12 +33542,12 @@ function CrudRecordModal({
|
|
|
33325
33542
|
essentialFirst,
|
|
33326
33543
|
notice
|
|
33327
33544
|
}) {
|
|
33328
|
-
const [record, setRecord] =
|
|
33329
|
-
const [loading, setLoading] =
|
|
33330
|
-
const [saving, setSaving] =
|
|
33331
|
-
const [error, setError] =
|
|
33332
|
-
const formId =
|
|
33333
|
-
|
|
33545
|
+
const [record, setRecord] = React122.useState(null);
|
|
33546
|
+
const [loading, setLoading] = React122.useState(false);
|
|
33547
|
+
const [saving, setSaving] = React122.useState(false);
|
|
33548
|
+
const [error, setError] = React122.useState(null);
|
|
33549
|
+
const formId = React122.useId();
|
|
33550
|
+
React122.useEffect(() => {
|
|
33334
33551
|
if (!open) return;
|
|
33335
33552
|
setError(null);
|
|
33336
33553
|
if (mode === "create" || !load) {
|
|
@@ -33406,9 +33623,9 @@ function LookupCreateInline({
|
|
|
33406
33623
|
className
|
|
33407
33624
|
}) {
|
|
33408
33625
|
const t = useTranslation();
|
|
33409
|
-
const [saving, setSaving] =
|
|
33410
|
-
const [error, setError] =
|
|
33411
|
-
const submitForm =
|
|
33626
|
+
const [saving, setSaving] = React122.useState(false);
|
|
33627
|
+
const [error, setError] = React122.useState(null);
|
|
33628
|
+
const submitForm = React122.useRef(null);
|
|
33412
33629
|
async function submit(data) {
|
|
33413
33630
|
setSaving(true);
|
|
33414
33631
|
setError(null);
|
|
@@ -33485,17 +33702,20 @@ function LookupCreateInline({
|
|
|
33485
33702
|
);
|
|
33486
33703
|
}
|
|
33487
33704
|
function useLookupCreate(lookup, onCreated, options = {}) {
|
|
33488
|
-
const [draftName, setDraftName] =
|
|
33705
|
+
const [draftName, setDraftName] = React122.useState(null);
|
|
33489
33706
|
const can = usePermissionOptional();
|
|
33490
33707
|
const entityDef = lookup?.entityDef;
|
|
33491
33708
|
const feature = entityDef?.permission?.feature;
|
|
33492
33709
|
const allowed = !feature || can(feature, "create");
|
|
33493
33710
|
const canCreate = !!lookup?.create && allowed;
|
|
33494
|
-
const
|
|
33711
|
+
const canEdit = !!entityDef && !!lookup?.load && !!lookup?.update && (!feature || can(feature, "edit"));
|
|
33712
|
+
const [editingId, setEditingId] = React122.useState(null);
|
|
33713
|
+
const onEdit = React122.useMemo(() => canEdit ? (id) => setEditingId(id) : void 0, [canEdit]);
|
|
33714
|
+
const createByName = React122.useCallback(async (name) => {
|
|
33495
33715
|
if (!lookup?.create) return;
|
|
33496
33716
|
onCreated(await lookup.create({ name }));
|
|
33497
33717
|
}, [lookup, onCreated]);
|
|
33498
|
-
const onCreate =
|
|
33718
|
+
const onCreate = React122.useMemo(() => {
|
|
33499
33719
|
if (!canCreate) return void 0;
|
|
33500
33720
|
if (!entityDef) return (name) => {
|
|
33501
33721
|
void createByName(name);
|
|
@@ -33511,10 +33731,27 @@ function useLookupCreate(lookup, onCreated, options = {}) {
|
|
|
33511
33731
|
return created;
|
|
33512
33732
|
};
|
|
33513
33733
|
const inline = options.variant === "inline";
|
|
33734
|
+
const editModal = editingId && entityDef ? /* @__PURE__ */ jsx(
|
|
33735
|
+
CrudRecordModal,
|
|
33736
|
+
{
|
|
33737
|
+
open: true,
|
|
33738
|
+
mode: "edit",
|
|
33739
|
+
entityDef,
|
|
33740
|
+
load: async () => await lookup.load(editingId),
|
|
33741
|
+
onClose: () => setEditingId(null),
|
|
33742
|
+
save: async (data) => {
|
|
33743
|
+
const updated = await lookup.update(editingId, data);
|
|
33744
|
+
onCreated(updated);
|
|
33745
|
+
setEditingId(null);
|
|
33746
|
+
return updated;
|
|
33747
|
+
}
|
|
33748
|
+
}
|
|
33749
|
+
) : null;
|
|
33514
33750
|
return {
|
|
33515
33751
|
onCreate,
|
|
33752
|
+
onEdit,
|
|
33516
33753
|
creating: open,
|
|
33517
|
-
modal: open && !inline ? /* @__PURE__ */ jsx(
|
|
33754
|
+
modal: editModal ?? (open && !inline ? /* @__PURE__ */ jsx(
|
|
33518
33755
|
CrudRecordModal,
|
|
33519
33756
|
{
|
|
33520
33757
|
open: true,
|
|
@@ -33525,7 +33762,7 @@ function useLookupCreate(lookup, onCreated, options = {}) {
|
|
|
33525
33762
|
onClose: () => setDraftName(null),
|
|
33526
33763
|
save
|
|
33527
33764
|
}
|
|
33528
|
-
) : null,
|
|
33765
|
+
) : null),
|
|
33529
33766
|
form: open && inline ? /* @__PURE__ */ jsx(
|
|
33530
33767
|
LookupCreateInline,
|
|
33531
33768
|
{
|
|
@@ -33553,7 +33790,8 @@ var ITEM_LABELS = {
|
|
|
33553
33790
|
remove: "Remover item",
|
|
33554
33791
|
done: "Conclu\xEDdo",
|
|
33555
33792
|
create: "Cadastrar",
|
|
33556
|
-
clear: "Limpar"
|
|
33793
|
+
clear: "Limpar",
|
|
33794
|
+
edit: "Editar"
|
|
33557
33795
|
};
|
|
33558
33796
|
function OrderFormItemRow({
|
|
33559
33797
|
index,
|
|
@@ -33576,15 +33814,16 @@ function OrderFormItemRow({
|
|
|
33576
33814
|
allowSurcharge = false,
|
|
33577
33815
|
extraFields,
|
|
33578
33816
|
labels,
|
|
33579
|
-
extraFieldGroups
|
|
33817
|
+
extraFieldGroups,
|
|
33818
|
+
readOnly = false
|
|
33580
33819
|
}) {
|
|
33581
33820
|
const l = { ...ITEM_LABELS, ...labels };
|
|
33582
33821
|
const total = quantity * unitPrice - (discount ?? 0) + (surcharge ?? 0);
|
|
33583
33822
|
const rawKindLabel = itemTypes.find((tp) => tp.value === itemKind)?.label ?? itemKind;
|
|
33584
33823
|
const kindLabel = !itemKind || itemKind === "other" ? null : rawKindLabel;
|
|
33585
33824
|
const hasAdjustments = (discount ?? 0) > 0 || (surcharge ?? 0) > 0;
|
|
33586
|
-
const [showAdjustments, setShowAdjustments] =
|
|
33587
|
-
const [openExtras, setOpenExtras] =
|
|
33825
|
+
const [showAdjustments, setShowAdjustments] = React122.useState(hasAdjustments);
|
|
33826
|
+
const [openExtras, setOpenExtras] = React122.useState(
|
|
33588
33827
|
() => (extraFieldGroups ?? []).filter((g) => g.filled).map((g) => g.id)
|
|
33589
33828
|
);
|
|
33590
33829
|
const lookup = entityLookups[itemKind];
|
|
@@ -33606,10 +33845,10 @@ function OrderFormItemRow({
|
|
|
33606
33845
|
/* @__PURE__ */ jsxs(
|
|
33607
33846
|
"div",
|
|
33608
33847
|
{
|
|
33609
|
-
className:
|
|
33610
|
-
onClick: onToggle,
|
|
33848
|
+
className: `group flex items-center gap-2 px-4 py-3 transition-colors ${readOnly ? "" : "cursor-pointer hover:bg-muted/30"}`,
|
|
33849
|
+
onClick: readOnly ? void 0 : onToggle,
|
|
33611
33850
|
children: [
|
|
33612
|
-
/* @__PURE__ */ jsx(ChevronDown, { className: `h-3 w-3 shrink-0 text-muted-foreground transition-transform ${expanded ? "rotate-0" : "-rotate-90"}` }),
|
|
33851
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: `h-3 w-3 shrink-0 text-muted-foreground transition-transform ${readOnly ? "invisible" : ""} ${expanded ? "rotate-0" : "-rotate-90"}` }),
|
|
33613
33852
|
/* @__PURE__ */ jsxs("span", { className: "w-5 shrink-0 text-[10px] font-medium text-muted-foreground", children: [
|
|
33614
33853
|
index + 1,
|
|
33615
33854
|
"."
|
|
@@ -33622,7 +33861,7 @@ function OrderFormItemRow({
|
|
|
33622
33861
|
formatMoney(unitPrice)
|
|
33623
33862
|
] }),
|
|
33624
33863
|
/* @__PURE__ */ jsx("span", { className: "shrink-0 text-right text-sm font-semibold tabular-nums", children: formatMoney(total) }),
|
|
33625
|
-
/* @__PURE__ */ jsx(
|
|
33864
|
+
!readOnly && /* @__PURE__ */ jsx(
|
|
33626
33865
|
"button",
|
|
33627
33866
|
{
|
|
33628
33867
|
type: "button",
|
|
@@ -33638,7 +33877,7 @@ function OrderFormItemRow({
|
|
|
33638
33877
|
]
|
|
33639
33878
|
}
|
|
33640
33879
|
),
|
|
33641
|
-
expanded && /* @__PURE__ */ jsxs("div", { className: "ml-8 space-y-3 bg-muted/10 px-4 pb-4 pt-1", children: [
|
|
33880
|
+
expanded && !readOnly && /* @__PURE__ */ jsxs("div", { className: "ml-8 space-y-3 bg-muted/10 px-4 pb-4 pt-1", children: [
|
|
33642
33881
|
showTypeSelector && itemTypes.length > 1 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1.5", children: itemTypes.map((tp) => /* @__PURE__ */ jsx(
|
|
33643
33882
|
"button",
|
|
33644
33883
|
{
|
|
@@ -33672,6 +33911,8 @@ function OrderFormItemRow({
|
|
|
33672
33911
|
createLabel: l.create,
|
|
33673
33912
|
clearLabel: l.clear,
|
|
33674
33913
|
onCreate: itemCreate.onCreate,
|
|
33914
|
+
onEdit: itemCreate.onEdit,
|
|
33915
|
+
editLabel: l.edit,
|
|
33675
33916
|
placeholder: `${l.item}\u2026`,
|
|
33676
33917
|
renderOption: (opt) => /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
33677
33918
|
/* @__PURE__ */ jsx("p", { className: "truncate text-sm", children: opt.label }),
|
|
@@ -33851,6 +34092,8 @@ function OrderFormItemsCard({
|
|
|
33851
34092
|
label: label2 = "Itens",
|
|
33852
34093
|
addLabel = "Adicionar item",
|
|
33853
34094
|
onAdd,
|
|
34095
|
+
addDisabled = false,
|
|
34096
|
+
addDisabledHint,
|
|
33854
34097
|
count,
|
|
33855
34098
|
countLabel,
|
|
33856
34099
|
totalLabel = "Total",
|
|
@@ -33869,7 +34112,9 @@ function OrderFormItemsCard({
|
|
|
33869
34112
|
{
|
|
33870
34113
|
type: "button",
|
|
33871
34114
|
onClick: onAdd,
|
|
33872
|
-
|
|
34115
|
+
disabled: addDisabled,
|
|
34116
|
+
title: addDisabled ? addDisabledHint : void 0,
|
|
34117
|
+
className: "fz-tap inline-flex items-center gap-2 rounded-button border border-primary bg-primary px-4 py-2 text-sm font-semibold text-primary-foreground shadow-button-primary transition-colors hover:bg-primary/90 active:shadow-button-inset disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-primary",
|
|
33873
34118
|
children: [
|
|
33874
34119
|
/* @__PURE__ */ jsx(Plus, { className: "h-4 w-4" }),
|
|
33875
34120
|
" ",
|
|
@@ -33882,7 +34127,7 @@ function OrderFormItemsCard({
|
|
|
33882
34127
|
header,
|
|
33883
34128
|
count === 0 && !header ? /* @__PURE__ */ jsxs("div", { className: "py-12 text-center", children: [
|
|
33884
34129
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: emptyLabel }),
|
|
33885
|
-
onAdd && /* @__PURE__ */ jsx("button", { type: "button", onClick: onAdd, className: "mt-1 text-xs text-primary hover:underline", children: emptyActionLabel })
|
|
34130
|
+
onAdd && !addDisabled && /* @__PURE__ */ jsx("button", { type: "button", onClick: onAdd, className: "mt-1 text-xs text-primary hover:underline", children: emptyActionLabel })
|
|
33886
34131
|
] }) : children
|
|
33887
34132
|
] }),
|
|
33888
34133
|
count > 0 && /* @__PURE__ */ jsxs("div", { className: "mt-auto flex items-center justify-between border-t bg-muted/20 px-4 py-3", children: [
|
|
@@ -34228,7 +34473,7 @@ function OrderCreateScreen({
|
|
|
34228
34473
|
errorActions,
|
|
34229
34474
|
saveBar
|
|
34230
34475
|
}) {
|
|
34231
|
-
const subtotal =
|
|
34476
|
+
const subtotal = React122.useMemo(
|
|
34232
34477
|
() => lines.reduce((sum, line) => sum + line.unitPrice * line.quantity, 0),
|
|
34233
34478
|
[lines]
|
|
34234
34479
|
);
|
|
@@ -34379,7 +34624,7 @@ function mergeLines(current2, incoming) {
|
|
|
34379
34624
|
return merged;
|
|
34380
34625
|
}
|
|
34381
34626
|
function ItemPicker({ search, onPick }) {
|
|
34382
|
-
const [open, setOpen] =
|
|
34627
|
+
const [open, setOpen] = React122.useState(false);
|
|
34383
34628
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
34384
34629
|
/* @__PURE__ */ jsxs(
|
|
34385
34630
|
"button",
|
|
@@ -34457,9 +34702,9 @@ function KanbanBoard({
|
|
|
34457
34702
|
toolbarActions
|
|
34458
34703
|
}) {
|
|
34459
34704
|
const collapsible = !!onToggleColumn;
|
|
34460
|
-
const frameRef =
|
|
34461
|
-
const [hoveredCol, setHoveredCol] =
|
|
34462
|
-
const centerFocused =
|
|
34705
|
+
const frameRef = React122.useRef(null);
|
|
34706
|
+
const [hoveredCol, setHoveredCol] = React122.useState(null);
|
|
34707
|
+
const centerFocused = React122.useCallback((event) => {
|
|
34463
34708
|
const frame = frameRef.current;
|
|
34464
34709
|
const column = event.target?.closest("[data-kanban-column]");
|
|
34465
34710
|
if (!frame || !column || frame.scrollWidth <= frame.clientWidth) return;
|
|
@@ -34571,10 +34816,10 @@ function BoardFrame({
|
|
|
34571
34816
|
toolbarActions,
|
|
34572
34817
|
className = ""
|
|
34573
34818
|
}) {
|
|
34574
|
-
const [open, setOpen] =
|
|
34575
|
-
const inputRef =
|
|
34819
|
+
const [open, setOpen] = React122.useState(false);
|
|
34820
|
+
const inputRef = React122.useRef(null);
|
|
34576
34821
|
const expanded = open || !!search;
|
|
34577
|
-
|
|
34822
|
+
React122.useEffect(() => {
|
|
34578
34823
|
if (open) inputRef.current?.focus();
|
|
34579
34824
|
}, [open]);
|
|
34580
34825
|
function collapse() {
|
|
@@ -34653,14 +34898,14 @@ function OrderBoardView({
|
|
|
34653
34898
|
rowId,
|
|
34654
34899
|
selectedRowId
|
|
34655
34900
|
}) {
|
|
34656
|
-
const getId =
|
|
34901
|
+
const getId = React122.useCallback(
|
|
34657
34902
|
(row) => rowId ? rowId(row) : String(row.id ?? ""),
|
|
34658
34903
|
[rowId]
|
|
34659
34904
|
);
|
|
34660
|
-
const [lastClicked, setLastClicked] =
|
|
34661
|
-
const [advancing, setAdvancing] =
|
|
34905
|
+
const [lastClicked, setLastClicked] = React122.useState(null);
|
|
34906
|
+
const [advancing, setAdvancing] = React122.useState({});
|
|
34662
34907
|
const selected = selectedRowId !== void 0 ? selectedRowId : lastClicked;
|
|
34663
|
-
const grouped =
|
|
34908
|
+
const grouped = React122.useMemo(() => {
|
|
34664
34909
|
const map = /* @__PURE__ */ new Map();
|
|
34665
34910
|
for (const col of board.columns) map.set(col.id, []);
|
|
34666
34911
|
for (const row of rows) {
|
|
@@ -34784,24 +35029,24 @@ function OrderListView({
|
|
|
34784
35029
|
boards,
|
|
34785
35030
|
viewKey
|
|
34786
35031
|
}) {
|
|
34787
|
-
const [search, setSearch] =
|
|
34788
|
-
const [page, setPage] =
|
|
34789
|
-
const [rawSelection, setRawSelection] =
|
|
34790
|
-
const offered =
|
|
35032
|
+
const [search, setSearch] = React122.useState("");
|
|
35033
|
+
const [page, setPage] = React122.useState(1);
|
|
35034
|
+
const [rawSelection, setRawSelection] = React122.useState([]);
|
|
35035
|
+
const offered = React122.useMemo(
|
|
34791
35036
|
() => views && views.length > 0 ? views : ["list"],
|
|
34792
35037
|
[views]
|
|
34793
35038
|
);
|
|
34794
|
-
const customFor =
|
|
35039
|
+
const customFor = React122.useCallback(
|
|
34795
35040
|
(id) => boards?.[id]?.render ?? null,
|
|
34796
35041
|
[boards]
|
|
34797
35042
|
);
|
|
34798
|
-
const boardFor =
|
|
35043
|
+
const boardFor = React122.useCallback(
|
|
34799
35044
|
(id) => (id === "board" ? board : boards?.[id]?.config) ?? null,
|
|
34800
35045
|
[board, boards]
|
|
34801
35046
|
);
|
|
34802
35047
|
const canBoard = offered.length > 1 && offered.some((id) => id !== "list" && (!!boardFor(id) || !!customFor(id)));
|
|
34803
35048
|
const storageKey2 = viewKey ? `fayz.orderView.${viewKey}` : null;
|
|
34804
|
-
const [view, setView] =
|
|
35049
|
+
const [view, setView] = React122.useState(() => {
|
|
34805
35050
|
const fallback = offered.includes(defaultView) ? defaultView : offered[0];
|
|
34806
35051
|
if (!storageKey2) return fallback;
|
|
34807
35052
|
try {
|
|
@@ -34811,7 +35056,7 @@ function OrderListView({
|
|
|
34811
35056
|
return fallback;
|
|
34812
35057
|
}
|
|
34813
35058
|
});
|
|
34814
|
-
const viewTabs =
|
|
35059
|
+
const viewTabs = React122.useMemo(
|
|
34815
35060
|
() => offered.map((option) => ({
|
|
34816
35061
|
value: option,
|
|
34817
35062
|
label: option === "list" ? "Lista" : boards?.[option]?.label ?? "Quadro",
|
|
@@ -34819,7 +35064,7 @@ function OrderListView({
|
|
|
34819
35064
|
})),
|
|
34820
35065
|
[offered, boards]
|
|
34821
35066
|
);
|
|
34822
|
-
const chooseView =
|
|
35067
|
+
const chooseView = React122.useCallback((next) => {
|
|
34823
35068
|
setView(next);
|
|
34824
35069
|
if (!storageKey2) return;
|
|
34825
35070
|
try {
|
|
@@ -34837,7 +35082,7 @@ function OrderListView({
|
|
|
34837
35082
|
const activeBoard = view === "list" ? null : boardFor(view);
|
|
34838
35083
|
const activeCustom = view === "list" ? null : customFor(view);
|
|
34839
35084
|
const showingBoard = !!activeBoard || !!activeCustom;
|
|
34840
|
-
const cols =
|
|
35085
|
+
const cols = React122.useMemo(
|
|
34841
35086
|
() => columns.map((c) => ({
|
|
34842
35087
|
id: c.key,
|
|
34843
35088
|
header: () => /* @__PURE__ */ jsx("div", { className: c.align === "right" ? "text-right" : "", children: c.header }),
|
|
@@ -34845,25 +35090,25 @@ function OrderListView({
|
|
|
34845
35090
|
})),
|
|
34846
35091
|
[columns]
|
|
34847
35092
|
);
|
|
34848
|
-
const filtered =
|
|
35093
|
+
const filtered = React122.useMemo(() => {
|
|
34849
35094
|
const term = search.trim().toLowerCase();
|
|
34850
35095
|
if (!term || !searchText) return rows;
|
|
34851
35096
|
return rows.filter((row) => searchText(row).toLowerCase().includes(term));
|
|
34852
35097
|
}, [rows, search, searchText]);
|
|
34853
|
-
|
|
35098
|
+
React122.useEffect(() => {
|
|
34854
35099
|
setPage(1);
|
|
34855
35100
|
}, [search]);
|
|
34856
35101
|
const paged = pageSize > 0 ? filtered.slice((page - 1) * pageSize, page * pageSize) : filtered;
|
|
34857
|
-
const getId =
|
|
35102
|
+
const getId = React122.useCallback(
|
|
34858
35103
|
(row) => rowId ? rowId(row) : String(row.id ?? ""),
|
|
34859
35104
|
[rowId]
|
|
34860
35105
|
);
|
|
34861
|
-
const pageIds =
|
|
34862
|
-
const selectedIds =
|
|
35106
|
+
const pageIds = React122.useMemo(() => paged.map(getId), [paged, getId]);
|
|
35107
|
+
const selectedIds = React122.useMemo(
|
|
34863
35108
|
() => rawSelection.filter((id) => pageIds.includes(id)),
|
|
34864
35109
|
[rawSelection, pageIds]
|
|
34865
35110
|
);
|
|
34866
|
-
const selectedRows =
|
|
35111
|
+
const selectedRows = React122.useMemo(
|
|
34867
35112
|
() => paged.filter((row) => selectedIds.includes(getId(row))),
|
|
34868
35113
|
[paged, selectedIds, getId]
|
|
34869
35114
|
);
|
|
@@ -35013,13 +35258,13 @@ function PaymentStatusBadge({
|
|
|
35013
35258
|
receiveLabel = "Receber",
|
|
35014
35259
|
onOpenDetails
|
|
35015
35260
|
}) {
|
|
35016
|
-
const [open, setOpen] =
|
|
35017
|
-
const [lines, setLines] =
|
|
35018
|
-
const timer =
|
|
35019
|
-
|
|
35261
|
+
const [open, setOpen] = React122__default.useState(false);
|
|
35262
|
+
const [lines, setLines] = React122__default.useState(null);
|
|
35263
|
+
const timer = React122__default.useRef(null);
|
|
35264
|
+
React122__default.useEffect(() => {
|
|
35020
35265
|
setLines(null);
|
|
35021
35266
|
}, [status, paidAmount]);
|
|
35022
|
-
const load =
|
|
35267
|
+
const load = React122__default.useCallback(() => {
|
|
35023
35268
|
if (lines || !onLoadDetails) return;
|
|
35024
35269
|
void onLoadDetails().then(setLines).catch(() => setLines([]));
|
|
35025
35270
|
}, [lines, onLoadDetails]);
|
|
@@ -35154,13 +35399,13 @@ function invalidateOrdersPaymentStatus(orderId) {
|
|
|
35154
35399
|
else cache2.clear();
|
|
35155
35400
|
}
|
|
35156
35401
|
function useOrdersPaymentStatus(orderIds) {
|
|
35157
|
-
const key =
|
|
35402
|
+
const key = React122.useMemo(
|
|
35158
35403
|
() => Array.from(new Set(orderIds.filter(Boolean))).sort().join(","),
|
|
35159
35404
|
[orderIds]
|
|
35160
35405
|
);
|
|
35161
|
-
const [byOrder, setByOrder] =
|
|
35162
|
-
const [loading, setLoading] =
|
|
35163
|
-
const load =
|
|
35406
|
+
const [byOrder, setByOrder] = React122.useState(() => /* @__PURE__ */ new Map());
|
|
35407
|
+
const [loading, setLoading] = React122.useState(false);
|
|
35408
|
+
const load = React122.useCallback(async (force = false) => {
|
|
35164
35409
|
const ids = key ? key.split(",") : [];
|
|
35165
35410
|
if (ids.length === 0) {
|
|
35166
35411
|
setByOrder(/* @__PURE__ */ new Map());
|
|
@@ -35191,7 +35436,7 @@ function useOrdersPaymentStatus(orderIds) {
|
|
|
35191
35436
|
}
|
|
35192
35437
|
setByOrder(new Map(ids.map((id) => [id, cache2.get(id)]).filter(([, v]) => Boolean(v))));
|
|
35193
35438
|
}, [key]);
|
|
35194
|
-
|
|
35439
|
+
React122.useEffect(() => {
|
|
35195
35440
|
void load();
|
|
35196
35441
|
}, [load]);
|
|
35197
35442
|
return { byOrder, loading, reload: () => load(true) };
|
|
@@ -35258,12 +35503,12 @@ function money(value, currency) {
|
|
|
35258
35503
|
return value.toLocaleString("pt-BR", { style: "currency", currency: currency || "BRL" });
|
|
35259
35504
|
}
|
|
35260
35505
|
function useOrderDetail(orderId) {
|
|
35261
|
-
const [order, setOrder] =
|
|
35262
|
-
const [loading, setLoading] =
|
|
35263
|
-
const [error, setError] =
|
|
35264
|
-
const [nonce, setNonce] =
|
|
35265
|
-
const reload =
|
|
35266
|
-
|
|
35506
|
+
const [order, setOrder] = React122.useState(null);
|
|
35507
|
+
const [loading, setLoading] = React122.useState(false);
|
|
35508
|
+
const [error, setError] = React122.useState(null);
|
|
35509
|
+
const [nonce, setNonce] = React122.useState(0);
|
|
35510
|
+
const reload = React122.useCallback(() => setNonce((n) => n + 1), []);
|
|
35511
|
+
React122.useEffect(() => {
|
|
35267
35512
|
if (!orderId) {
|
|
35268
35513
|
setOrder(null);
|
|
35269
35514
|
setError(null);
|
|
@@ -35380,8 +35625,8 @@ function OrderDetailRail({
|
|
|
35380
35625
|
}) {
|
|
35381
35626
|
const { order, loading, error, reload } = useOrderDetail(orderId);
|
|
35382
35627
|
const { byOrder: paymentByOrder } = useOrdersPaymentStatus([orderId]);
|
|
35383
|
-
const [running, setRunning] =
|
|
35384
|
-
const [pending2, setPending] =
|
|
35628
|
+
const [running, setRunning] = React122.useState(null);
|
|
35629
|
+
const [pending2, setPending] = React122.useState(null);
|
|
35385
35630
|
const perform = async (action) => {
|
|
35386
35631
|
if (!order) return;
|
|
35387
35632
|
setRunning(action.id);
|
|
@@ -35539,11 +35784,11 @@ function receivableTone(value) {
|
|
|
35539
35784
|
return "warning";
|
|
35540
35785
|
}
|
|
35541
35786
|
function useOrderReceivable(orderId) {
|
|
35542
|
-
const [receivable, setReceivable] =
|
|
35787
|
+
const [receivable, setReceivable] = React122.useState(
|
|
35543
35788
|
() => orderId ? cache3.get(orderId) ?? null : null
|
|
35544
35789
|
);
|
|
35545
|
-
const [loading, setLoading] =
|
|
35546
|
-
const reload =
|
|
35790
|
+
const [loading, setLoading] = React122.useState(() => Boolean(orderId) && !cache3.has(orderId));
|
|
35791
|
+
const reload = React122.useCallback(async (force = false) => {
|
|
35547
35792
|
if (!orderId) return;
|
|
35548
35793
|
const db2 = getSupabaseClientOptional();
|
|
35549
35794
|
if (!db2) {
|
|
@@ -35566,7 +35811,7 @@ function useOrderReceivable(orderId) {
|
|
|
35566
35811
|
setReceivable(next);
|
|
35567
35812
|
setLoading(false);
|
|
35568
35813
|
}, [orderId]);
|
|
35569
|
-
|
|
35814
|
+
React122.useEffect(() => {
|
|
35570
35815
|
void reload();
|
|
35571
35816
|
}, [reload]);
|
|
35572
35817
|
return { receivable, loading, reload };
|
|
@@ -35719,15 +35964,15 @@ function linesOf(order) {
|
|
|
35719
35964
|
}
|
|
35720
35965
|
function useOrderEditor(orderId) {
|
|
35721
35966
|
const { order, loading, error } = useOrderDetail(orderId);
|
|
35722
|
-
const [lines, setLines] =
|
|
35723
|
-
const [saving, setSaving] =
|
|
35724
|
-
const originalRef =
|
|
35725
|
-
|
|
35967
|
+
const [lines, setLines] = React122.useState([]);
|
|
35968
|
+
const [saving, setSaving] = React122.useState(false);
|
|
35969
|
+
const originalRef = React122.useRef([]);
|
|
35970
|
+
React122.useEffect(() => {
|
|
35726
35971
|
const seeded = linesOf(order);
|
|
35727
35972
|
originalRef.current = seeded;
|
|
35728
35973
|
setLines(seeded);
|
|
35729
35974
|
}, [order]);
|
|
35730
|
-
const dirty =
|
|
35975
|
+
const dirty = React122.useMemo(() => {
|
|
35731
35976
|
const before = originalRef.current;
|
|
35732
35977
|
if (before.length !== lines.length) return true;
|
|
35733
35978
|
return lines.some((line, i) => {
|
|
@@ -35735,7 +35980,7 @@ function useOrderEditor(orderId) {
|
|
|
35735
35980
|
return !was || was.key !== line.key || was.quantity !== line.quantity || was.unitPrice !== line.unitPrice;
|
|
35736
35981
|
});
|
|
35737
35982
|
}, [lines]);
|
|
35738
|
-
const save =
|
|
35983
|
+
const save = React122.useCallback(async () => {
|
|
35739
35984
|
if (!orderId || !order) return { ok: false, error: "Pedido n\xE3o carregado" };
|
|
35740
35985
|
const db2 = getSupabaseClientOptional();
|
|
35741
35986
|
if (!db2) return { ok: false, error: "Sem conex\xE3o" };
|
|
@@ -36065,11 +36310,11 @@ function PersonTimeline({
|
|
|
36065
36310
|
pageSize,
|
|
36066
36311
|
activeSourceIds
|
|
36067
36312
|
});
|
|
36068
|
-
const toneBySource =
|
|
36313
|
+
const toneBySource = React122__default.useMemo(
|
|
36069
36314
|
() => new Map(sources2.map((s) => [s.id, s.tone ?? "neutral"])),
|
|
36070
36315
|
[sources2]
|
|
36071
36316
|
);
|
|
36072
|
-
const hrefFor =
|
|
36317
|
+
const hrefFor = React122__default.useCallback(
|
|
36073
36318
|
(item) => {
|
|
36074
36319
|
if (item.href) return item.href;
|
|
36075
36320
|
if (!recordPath || !item.targetTab) return void 0;
|
|
@@ -36112,19 +36357,19 @@ function PersonTimeline({
|
|
|
36112
36357
|
}
|
|
36113
36358
|
function createPlaceholder(title, description) {
|
|
36114
36359
|
return function PlaceholderPage() {
|
|
36115
|
-
return
|
|
36360
|
+
return React122__default.createElement(
|
|
36116
36361
|
"div",
|
|
36117
36362
|
{ className: "mx-auto max-w-4xl" },
|
|
36118
|
-
|
|
36119
|
-
description ?
|
|
36120
|
-
|
|
36363
|
+
React122__default.createElement("h1", { className: "text-3xl font-bold text-foreground" }, title),
|
|
36364
|
+
description ? React122__default.createElement("p", { className: "mt-1 text-muted-foreground" }, description) : null,
|
|
36365
|
+
React122__default.createElement(
|
|
36121
36366
|
"div",
|
|
36122
36367
|
{ className: "mt-8 flex items-center justify-center rounded-card border border-dashed border-border bg-card p-16" },
|
|
36123
|
-
|
|
36368
|
+
React122__default.createElement(
|
|
36124
36369
|
"div",
|
|
36125
36370
|
{ className: "text-center" },
|
|
36126
|
-
|
|
36127
|
-
|
|
36371
|
+
React122__default.createElement("p", { className: "text-lg font-medium text-muted-foreground" }, "Coming Soon"),
|
|
36372
|
+
React122__default.createElement(
|
|
36128
36373
|
"p",
|
|
36129
36374
|
{ className: "mt-1 text-sm text-muted-foreground/70" },
|
|
36130
36375
|
"This module is being built as a plugin."
|
|
@@ -36205,7 +36450,7 @@ function ModuleActionBar({
|
|
|
36205
36450
|
trailing
|
|
36206
36451
|
}) {
|
|
36207
36452
|
const t = useTranslation();
|
|
36208
|
-
const actions =
|
|
36453
|
+
const actions = React122__default.useMemo(() => {
|
|
36209
36454
|
const out = (quickActions ?? []).map((qa, i) => ({
|
|
36210
36455
|
id: qa.id,
|
|
36211
36456
|
label: qa.label,
|
|
@@ -36237,9 +36482,9 @@ function ModuleActionBar({
|
|
|
36237
36482
|
] });
|
|
36238
36483
|
}
|
|
36239
36484
|
function createPluginContext(displayName) {
|
|
36240
|
-
const ConfigContext =
|
|
36241
|
-
const ProviderContext =
|
|
36242
|
-
const StoreContext =
|
|
36485
|
+
const ConfigContext = React122__default.createContext(null);
|
|
36486
|
+
const ProviderContext = React122__default.createContext(null);
|
|
36487
|
+
const StoreContext = React122__default.createContext(null);
|
|
36243
36488
|
const ContextProvider = ({
|
|
36244
36489
|
config,
|
|
36245
36490
|
provider: provider2,
|
|
@@ -36248,17 +36493,17 @@ function createPluginContext(displayName) {
|
|
|
36248
36493
|
}) => /* @__PURE__ */ jsx(ConfigContext.Provider, { value: config, children: /* @__PURE__ */ jsx(ProviderContext.Provider, { value: provider2, children: /* @__PURE__ */ jsx(StoreContext.Provider, { value: store, children }) }) });
|
|
36249
36494
|
ContextProvider.displayName = `${displayName}ContextProvider`;
|
|
36250
36495
|
function useConfig() {
|
|
36251
|
-
const ctx =
|
|
36496
|
+
const ctx = React122__default.useContext(ConfigContext);
|
|
36252
36497
|
if (!ctx) throw new Error(`useConfig must be used within ${displayName}`);
|
|
36253
36498
|
return ctx;
|
|
36254
36499
|
}
|
|
36255
36500
|
function useProvider() {
|
|
36256
|
-
const ctx =
|
|
36501
|
+
const ctx = React122__default.useContext(ProviderContext);
|
|
36257
36502
|
if (!ctx) throw new Error(`useProvider must be used within ${displayName}`);
|
|
36258
36503
|
return ctx;
|
|
36259
36504
|
}
|
|
36260
36505
|
function useStore2(selector) {
|
|
36261
|
-
const store =
|
|
36506
|
+
const store = React122__default.useContext(StoreContext);
|
|
36262
36507
|
if (!store) throw new Error(`useStore must be used within ${displayName}`);
|
|
36263
36508
|
return useStore$1(store, selector);
|
|
36264
36509
|
}
|
|
@@ -36315,7 +36560,7 @@ function PluginRegistryManager({ registries, routeBase, className }) {
|
|
|
36315
36560
|
return registries[0]?.id ?? "";
|
|
36316
36561
|
};
|
|
36317
36562
|
const [activeTab, setActiveTab] = useState(getTabFromHash);
|
|
36318
|
-
|
|
36563
|
+
React122__default.useEffect(() => {
|
|
36319
36564
|
if (!routeBase) return;
|
|
36320
36565
|
const handler = () => setActiveTab(getTabFromHash());
|
|
36321
36566
|
window.addEventListener("hashchange", handler);
|
|
@@ -36526,7 +36771,7 @@ function PersonLink2({ personId, name, lookup, kind, profileHref, tab, size = "d
|
|
|
36526
36771
|
const email = data?.email;
|
|
36527
36772
|
const phone = data?.phone;
|
|
36528
36773
|
const resolvedKind = kind ?? data?.kind ?? person?.group;
|
|
36529
|
-
const actions =
|
|
36774
|
+
const actions = React122__default.useMemo(
|
|
36530
36775
|
() => personId ? getPersonActions(resolvedKind) : [],
|
|
36531
36776
|
[personId, resolvedKind]
|
|
36532
36777
|
);
|
|
@@ -37221,10 +37466,10 @@ function useTeachMe(def) {
|
|
|
37221
37466
|
return useFeatureHelp(def).teach;
|
|
37222
37467
|
}
|
|
37223
37468
|
function useFeatureHelp(def) {
|
|
37224
|
-
const ref =
|
|
37469
|
+
const ref = React122.useRef(def);
|
|
37225
37470
|
ref.current = def;
|
|
37226
37471
|
const id = `teach.${def.feature}`;
|
|
37227
|
-
const contribution =
|
|
37472
|
+
const contribution = React122.useMemo(
|
|
37228
37473
|
() => ({
|
|
37229
37474
|
id,
|
|
37230
37475
|
pluginId: "teach-me",
|
|
@@ -37258,7 +37503,7 @@ function useFeatureHelp(def) {
|
|
|
37258
37503
|
[id]
|
|
37259
37504
|
);
|
|
37260
37505
|
useAgentSurface(contribution);
|
|
37261
|
-
return
|
|
37506
|
+
return React122.useMemo(
|
|
37262
37507
|
() => ({
|
|
37263
37508
|
help: () => helpWith(ref.current),
|
|
37264
37509
|
teach: () => teachMe(ref.current),
|
|
@@ -37424,21 +37669,21 @@ function ConnectorsHub({ hostPluginId }) {
|
|
|
37424
37669
|
const { t } = useTranslation$1();
|
|
37425
37670
|
const { connectors, reload } = useConnectors({ includeGrants: false });
|
|
37426
37671
|
const assistantAvailable = useConnectorsPanelAvailable();
|
|
37427
|
-
const [selected, setSelected] =
|
|
37428
|
-
const [adding, setAdding] =
|
|
37429
|
-
const hosted =
|
|
37672
|
+
const [selected, setSelected] = React122__default.useState(null);
|
|
37673
|
+
const [adding, setAdding] = React122__default.useState(false);
|
|
37674
|
+
const hosted = React122__default.useMemo(
|
|
37430
37675
|
() => (connectors ?? []).filter((c) => c.hostPluginId === hostPluginId),
|
|
37431
37676
|
[connectors, hostPluginId]
|
|
37432
37677
|
);
|
|
37433
|
-
const categories =
|
|
37678
|
+
const categories = React122__default.useMemo(
|
|
37434
37679
|
() => [...new Set(hosted.map((c) => c.category).filter((c) => !!c))],
|
|
37435
37680
|
[hosted]
|
|
37436
37681
|
);
|
|
37437
|
-
const scoped =
|
|
37682
|
+
const scoped = React122__default.useMemo(() => {
|
|
37438
37683
|
const siblings = inCategories(connectors ?? [], categories).filter((c) => c.hostPluginId !== hostPluginId);
|
|
37439
37684
|
return [...hosted, ...siblings];
|
|
37440
37685
|
}, [connectors, hosted, categories, hostPluginId]);
|
|
37441
|
-
|
|
37686
|
+
React122__default.useEffect(() => {
|
|
37442
37687
|
if (!selected || !connectors) return;
|
|
37443
37688
|
const fresh = connectors.find((c) => c.id === selected.id);
|
|
37444
37689
|
if (fresh && fresh !== selected) setSelected(fresh);
|
|
@@ -37540,6 +37785,11 @@ function SettingsTabs({ tabs, value, onChange, actions, className, ...rest }) {
|
|
|
37540
37785
|
] });
|
|
37541
37786
|
}
|
|
37542
37787
|
function RegistryCrudView2({ registry: registry4, basePath, embedded }) {
|
|
37788
|
+
const Custom = registry4.component;
|
|
37789
|
+
if (Custom) return /* @__PURE__ */ jsx(Custom, { basePath, embedded });
|
|
37790
|
+
return /* @__PURE__ */ jsx(GenericRegistryCrudView, { registry: registry4, basePath, embedded });
|
|
37791
|
+
}
|
|
37792
|
+
function GenericRegistryCrudView({ registry: registry4, basePath, embedded }) {
|
|
37543
37793
|
const useStore2 = useMemo(() => {
|
|
37544
37794
|
const mockData = registry4.mockData ?? registry4.seedData ?? [];
|
|
37545
37795
|
const provider2 = registry4.dataProvider ?? resolveDataProvider(registry4.entity, mockData);
|
|
@@ -37573,7 +37823,7 @@ function PropertiesTab({ registries, routeBase, regLabel }) {
|
|
|
37573
37823
|
return registries[0]?.id ?? "";
|
|
37574
37824
|
}
|
|
37575
37825
|
const [active2, setActive] = useState(getActive);
|
|
37576
|
-
|
|
37826
|
+
React122__default.useEffect(() => {
|
|
37577
37827
|
const handler = () => setActive(getActive());
|
|
37578
37828
|
window.addEventListener("hashchange", handler);
|
|
37579
37829
|
return () => window.removeEventListener("hashchange", handler);
|
|
@@ -37648,7 +37898,7 @@ function PluginSettingsPanel({ title, generalSettings, registries, customTabs, r
|
|
|
37648
37898
|
return tabs[0]?.id ?? "";
|
|
37649
37899
|
}
|
|
37650
37900
|
const [activeTab, setActiveTab] = useState(getActiveFromHash);
|
|
37651
|
-
|
|
37901
|
+
React122__default.useEffect(() => {
|
|
37652
37902
|
const handler = () => setActiveTab(getActiveFromHash());
|
|
37653
37903
|
window.addEventListener("hashchange", handler);
|
|
37654
37904
|
return () => window.removeEventListener("hashchange", handler);
|
|
@@ -37675,6 +37925,6 @@ var renderApp = (...args) => {
|
|
|
37675
37925
|
return renderApp$1(...args);
|
|
37676
37926
|
};
|
|
37677
37927
|
|
|
37678
|
-
export { ALWAYS_ON_TOOLS, ActivationChecklistCard, ActivationProvider, AddConnectorButton, AddConnectorPanel, AdminProviders, AdminScaffold, AdminShell, AskAIButton, AskAIMenuItem, AssistantInvite, BoardFrame, ChatConversation, ClientOrdersTab, ConnectConsentPage, ConnectorDeliveries, ConnectorDetail, ConnectorMark, ConnectorRow, ConnectorSyncActions, ConnectorsHub, ConnectorsTab, ContactPicker, CredentialSinkMissingError, CrudCardGrid, CrudDetailPage, CrudDetailSkeleton, CrudFormPage, CrudFormSkeleton, CrudListView, CrudPage, CrudRecordModal, DeleteConfirmDialog, DetailTabHeader, EntitlementGate, EntityLink, GetStarted, GettingStartedWidget, NotebookPanel as HandbookPanel, HandbookProvider, NotebookRailPanel as HandbookRailPanel, KanbanBoard, LimitGate, LookupCreateInline, MemberAccessRailPage, ModuleActionBar, MultiSelectRow, NOTE_LABEL_PREFIX, NotebookPanel, NotebookRailPanel, ONBOARDING_TASK_SOURCE, ORDER_CHANNEL_LABELS, ORDER_KIND_LABELS, OTHER_CONNECTOR, OrderAmount, OrderBoardView, OrderCreateScreen, OrderDetailBlock, OrderDetailPage, OrderDetailRail, OrderDetailRow, OrderDetailSkeleton, OrderDetailView, OrderFormAddItemStep, OrderDetailBlock as OrderFormBlock, OrderFormItemRow, OrderFormItemsCard, OrderFormSkeleton, OrderFormView, OrderListView, OrderPaymentChip, PAYMENT_STATUS_CONFIG, PAYMENT_STATUS_LABEL, PageActions, PaymentStatusBadge, PermissionGate, PersonLink2 as PersonLink, PersonTimeline, PlatformError, PluginRegistryManager, PluginSettingsPanel, ProjectsSettings, QUESTION_PACKS, QuickActionsButton, RECEIVABLE_LABEL, RecordPickerModal, RegistryCrudView2 as RegistryCrudView, RightRailActions, RightRailLeading, RightRailPage, RouteErrorBoundary, RouteErrorScreen, SelectRow, SettingsGroup, SettingsTabs, SetupAgentSurface, SetupMeLink, SeuSiteWidget, StateChip, TASK_PRIORITIES, TASK_STATUSES, TaskCard, TaskDetail, TaskGroup, TaskLabelBadge, TaskLabelBadges, TaskPriorityBadge, TaskQuickAdd, TaskSourceBadge, TaskStatusGroup, TasksFilterBar, TasksPanel, TasksRailPanel, TeachMeLink, TextRow, ToggleRow, UnitSwitcher, UnitsSettingsPage, UpgradePrompt, WORKSPACE_SETUP_FLOW_ID, WORKSPACE_SETUP_FLOW_VERSION, WORKSPACE_SETUP_ROUTE, WidgetSlot, WorkspaceSetupFlow, WorkspaceSetupGate, appendHandbookPage, askAI, beautyPack, brandMark, buildBusinessProfile, buildHandbookTree, buildWorkspaceSetupSteps, businessProfileBlock, categoryLabel, checkSlugAvailable, claimTasksSurface, clearPersonActions, connectorOptions, connectorRoute, connectorRows, createClientOrdersProvider, createCrudPage, createFayzApp, createFayzProject, createLogoUploader, createMockTasksProvider, createCrudPage as createNativeCrudPage, createPlaceholder, createPlatformProject, createPluginContext, createSupabaseTasksProvider, createViewRouter, currentBusinessProfileBlock, dedup, defaultProjectOf, defineSaas, deleteFayzProject, deriveAgentContract, duplicateWrite, ensureChecklist, exportToCSV, filterConnectors, foodPack, formatActivityElapsed, formatCurrency4 as formatCurrency, formatSetupGuide, getActiveAgent, getAgent, getDefaultFayzProject, getFayzAgentClient, getGenerationStatus, getHost, getPersonActions, getPersonPath, getPreview, getQuestionPack, getRailPage, getSetupGuide, getSetupGuideForStep, getTasksProvider, getTimelineSources, helpWith, humanizeWriteError, inferVerticalId, invalidateOrderReceivable, invalidateOrdersPaymentStatus, invalidateRelationOptions, isPlatformConnected, listFayzProjects, listHandbook, listPlatformProjects, listSetupGuides, loadArea, loadTools, loadedToolNames, mergeLines, needsCredentialSink, normalizePath, openAssistant, openAssistantAs, openConnectorsPanel, orderChannelColumn, orderIsEditable, orderKindColumn, orientationTour, parseViewId, publishAssistantActivity, readAttachmentBytes, readHandbookPage, readSetupAnswers, receivableTone, recordOnboardingResponse, registerAdminScaffold, registerAssistantLauncher, registerEntityPath, registerNotesTasksAdapter, registerPersonActions, registerRailPage, registerSetupGuides, registerTimelineSource, renderApp, renderHandbookOutline, requestChatUpload, requestProjectChange, resetLoadedTools, resolveFayzAgentConnection, resolveSetupMode, resolveVerticalId, retailPack, revealPage, runWelcome, searchHandbook, searchSetupGuides, setServedRoutes, setTasksProvider, setUpWithMe, slugify, soleAgent, splitConnectorValues, splitOnboardingTasks, startGuidedRun, startPreview, stopPreview, submitConnection, submitWorkspaceSetup, summariseSetupGuides, taskEntityDef, tasksSurfaceOwner, teachMe, toInlineFile, toOrderDetailReceivable, unregisterAssistantLauncher, unregisterTimelineSource, updateFayzProject, useActivationStore, useActiveAgent, useAgent, useAgentStore, useAgentSurface, useAppConfig, useAssistantActivity, useAssistantInviteStore, useAssistantLaunchers, useBusinessProfileStore, useChatStore, useConnectors, useConnectorsPanelAvailable, useContextualNav, useContextualNavStore, useDelegateToAssistant, useFayzProjectsStore, useFeatureHelp, useFieldRules, useHandbookStore, useHasRightRail, useHeaderAction, useHeaderActions, useLaunchersForRole, useLookupCreate, useMemberAccessPanel, useModuleNavigation, useNavContribution, useNavContributionsStore, useNotesTasksBridge, useOrderDetail, useOrderEditor, useOrderReceivable, useOrdersPaymentStatus, usePersistedState, usePersonTimeline, usePluginPrefs, usePresetLabel, usePublishAssistantActivity, useRegisterAssistantLauncher, useRightRailDrill, useRightRailHosted, useRightRailPanel, useRightRailStore, useScrollMemory, useSettingsTabsStore, useShellRailAvailable, useTasksStore, useTasksSummaryLine, useTeachMe, useTenantPluginSettings, useUnitBootstrap, useUnitStore, useWidgetSurface, useWorkspaceSetupBusy, useWorkspaceSetupGate, useWorkspaceSetupStore, validateSetupGuides, withdrawAssistantActivity, writeHandbookPage };
|
|
37928
|
+
export { ALWAYS_ON_TOOLS, ActivationChecklistCard, ActivationProvider, AddConnectorButton, AddConnectorPanel, AdminProviders, AdminScaffold, AdminShell, AskAIButton, AskAIMenuItem, AssistantInvite, BoardFrame, ChatConversation, ClientOrdersTab, ConnectConsentPage, ConnectorDeliveries, ConnectorDetail, ConnectorMark, ConnectorRow, ConnectorSyncActions, ConnectorsHub, ConnectorsTab, ContactPicker, CredentialSinkMissingError, CrudCardGrid, CrudDetailPage, CrudDetailSkeleton, CrudFormPage, CrudFormSkeleton, CrudListView, CrudPage, CrudRecordModal, DeleteConfirmDialog, DetailTabHeader, EntitlementGate, EntityLink, GetStarted, GettingStartedWidget, NotebookPanel as HandbookPanel, HandbookProvider, NotebookRailPanel as HandbookRailPanel, KanbanBoard, LimitGate, LookupCreateInline, MemberAccessRailPage, ModuleActionBar, MultiSelectRow, NOTE_LABEL_PREFIX, NotebookPanel, NotebookRailPanel, ONBOARDING_TASK_SOURCE, ORDER_CHANNEL_LABELS, ORDER_KIND_LABELS, OTHER_CONNECTOR, OrderAmount, OrderBoardView, OrderCreateScreen, OrderDetailBlock, OrderDetailPage, OrderDetailRail, OrderDetailRow, OrderDetailSkeleton, OrderDetailView, OrderFormAddItemStep, OrderDetailBlock as OrderFormBlock, OrderFormItemRow, OrderFormItemsCard, OrderFormSkeleton, OrderFormView, OrderListView, OrderPaymentChip, PAYMENT_STATUS_CONFIG, PAYMENT_STATUS_LABEL, PageActions, PaymentStatusBadge, PermissionGate, PersonLink2 as PersonLink, PersonTimeline, PlatformError, PluginOnboardingGateSkeleton, PluginRegistryManager, PluginSettingsPanel, ProjectsSettings, QUESTION_PACKS, QuickActionsButton, RECEIVABLE_LABEL, RecordPickerModal, RegistryCrudView2 as RegistryCrudView, RightRailActions, RightRailLeading, RightRailPage, RouteErrorBoundary, RouteErrorScreen, SelectRow, SettingsGroup, SettingsTabs, SetupAgentSurface, SetupMeLink, SeuSiteWidget, StateChip, TASK_PRIORITIES, TASK_STATUSES, TaskCard, TaskDetail, TaskGroup, TaskLabelBadge, TaskLabelBadges, TaskPriorityBadge, TaskQuickAdd, TaskSourceBadge, TaskStatusGroup, TasksFilterBar, TasksPanel, TasksRailPanel, TeachMeLink, TextRow, ToggleRow, UnitSwitcher, UnitsSettingsPage, UpgradePrompt, WORKSPACE_SETUP_FLOW_ID, WORKSPACE_SETUP_FLOW_VERSION, WORKSPACE_SETUP_ROUTE, WidgetSlot, WorkspaceSetupFlow, WorkspaceSetupGate, appendHandbookPage, askAI, beautyPack, brandMark, buildBusinessProfile, buildHandbookTree, buildWorkspaceSetupSteps, businessProfileBlock, categoryLabel, checkSlugAvailable, claimTasksSurface, clearPersonActions, connectorOptions, connectorRoute, connectorRows, createClientOrdersProvider, createCrudPage, createFayzApp, createFayzProject, createLogoUploader, createMockTasksProvider, createCrudPage as createNativeCrudPage, createPlaceholder, createPlatformProject, createPluginContext, createSupabaseTasksProvider, createViewRouter, currentBusinessProfileBlock, dedup, defaultProjectOf, defineSaas, deleteFayzProject, deriveAgentContract, duplicateWrite, ensureChecklist, exportToCSV, filterConnectors, foodPack, formatActivityElapsed, formatCurrency4 as formatCurrency, formatSetupGuide, getActiveAgent, getAgent, getDefaultFayzProject, getFayzAgentClient, getGenerationStatus, getHost, getPersonActions, getPersonPath, getPreview, getQuestionPack, getRailPage, getSetupGuide, getSetupGuideForStep, getTasksProvider, getTimelineSources, helpWith, humanizeWriteError, inferVerticalId, invalidateOrderReceivable, invalidateOrdersPaymentStatus, invalidateRelationOptions, isPlatformConnected, listFayzProjects, listHandbook, listPlatformProjects, listSetupGuides, loadArea, loadTools, loadedToolNames, mergeLines, needsCredentialSink, normalizePath, openAssistant, openAssistantAs, openConnectorsPanel, orderChannelColumn, orderIsEditable, orderKindColumn, orientationTour, parseViewId, publishAssistantActivity, readAttachmentBytes, readHandbookPage, readSetupAnswers, receivableTone, recordOnboardingResponse, registerAdminScaffold, registerAssistantLauncher, registerEntityPath, registerNotesTasksAdapter, registerPersonActions, registerRailPage, registerSetupGuides, registerTimelineSource, renderApp, renderHandbookOutline, requestChatUpload, requestProjectChange, resetLoadedTools, resolveFayzAgentConnection, resolveSetupMode, resolveVerticalId, retailPack, revealPage, runWelcome, searchHandbook, searchSetupGuides, setServedRoutes, setTasksProvider, setUpWithMe, slugify, soleAgent, splitConnectorValues, splitOnboardingTasks, startGuidedRun, startPreview, stopPreview, submitConnection, submitWorkspaceSetup, summariseSetupGuides, taskEntityDef, tasksSurfaceOwner, teachMe, toInlineFile, toOrderDetailReceivable, unregisterAssistantLauncher, unregisterTimelineSource, updateFayzProject, useActivationStore, useActiveAgent, useAgent, useAgentStore, useAgentSurface, useAppConfig, useAssistantActivity, useAssistantInviteStore, useAssistantLaunchers, useBusinessProfileStore, useChatStore, useConnectors, useConnectorsPanelAvailable, useContextualNav, useContextualNavStore, useDelegateToAssistant, useFayzProjectsStore, useFeatureHelp, useFieldRules, useHandbookStore, useHasRightRail, useHeaderAction, useHeaderActions, useLaunchersForRole, useLookupCreate, useMemberAccessPanel, useModuleNavigation, useNavContribution, useNavContributionsStore, useNotesTasksBridge, useOrderDetail, useOrderEditor, useOrderReceivable, useOrdersPaymentStatus, usePersistedState, usePersonTimeline, usePluginOnboardingGate, usePluginPrefs, usePresetLabel, usePublishAssistantActivity, useRegisterAssistantLauncher, useRightRailDrill, useRightRailHosted, useRightRailPanel, useRightRailStore, useScrollMemory, useSettingsTabsStore, useShellRailAvailable, useTasksStore, useTasksSummaryLine, useTeachMe, useTenantPluginSettings, useUnitBootstrap, useUnitStore, useWidgetSurface, useWorkspaceSetupBusy, useWorkspaceSetupGate, useWorkspaceSetupStore, validateSetupGuides, withdrawAssistantActivity, writeHandbookPage };
|
|
37679
37929
|
//# sourceMappingURL=index.js.map
|
|
37680
37930
|
//# sourceMappingURL=index.js.map
|