@burdenoff/microfe-tours 2026.1004.1 → 2026.1004.2
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/tours/ToursUserRoot.js +1 -1
- package/dist/tours/ToursUserRoot.js.map +1 -1
- package/dist/tours/i18n.js +1 -0
- package/dist/tours/i18n.js.map +1 -1
- package/dist/tours/pages/MyToursPage.js +35 -20
- package/dist/tours/pages/MyToursPage.js.map +1 -1
- package/dist/tours/pages/MyToursProgressPage.js +29 -12
- package/dist/tours/pages/MyToursProgressPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToursUserRoot.js","names":[],"sources":["../../src/tours/ToursUserRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { Compass, ListChecks } from 'lucide-react';\nimport { ToursProvider } from './providers/ToursProvider';\nimport { useToursStore } from './store/toursStore';\nimport { ToursUserRoutes } from './ToursUserRoutes';\nimport { useTr } from './i18n';\nimport type { NavItem, ToursRootProps } from './types';\nimport { joinPath } from './utils/joinPath';\n\n/**\n * User-facing root component for the Tours microfrontend.\n *\n * Mounts the read-only \"My Tours\" + \"My Progress\" surface for product\n * user shells (vibecontrols-app, and later workspaces-app / bigconsole-app).\n * Registers exactly two nav items; never exposes authoring or governance\n * pages.\n *\n * Pair with `ToursAdminRoot` for the admin shell.\n */\nexport const ToursUserRoot: FC<ToursRootProps> = (props) => {\n const tr = useTr();\n const { basePath = '/', registerNavItems, workspaceId } = props;\n const resetTransientState = useToursStore((state) => state.resetTransientState);\n\n useEffect(() => {\n return () => {\n resetTransientState();\n };\n }, [resetTransientState]);\n\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: 'tours-my',\n label: tr('myTours.title', 'My Tours'),\n path: basePath,\n icon: <Compass size={20} />,\n order: 10,\n group: 'tours',\n },\n {\n id: 'tours-my-progress',\n label: tr('myToursProgress.title', 'My Progress'),\n path: joinPath(basePath, 'progress'),\n icon: <ListChecks size={20} />,\n order: 20,\n group: 'tours',\n },\n ];\n\n return registerNavItems(navItems);\n }, [registerNavItems, basePath, tr]);\n\n return (\n <FeatureFlagProvider workspaceId={workspaceId ?? null} gateway=\"global\" defaultEnabled={true}>\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n {tr(\n 'toursShell.moduleError',\n 'Something went wrong loading this module. Please refresh the page.'\n )}\n </div>\n }\n >\n <ToursProvider {...props} variant=\"user\">\n <ToursUserRoutes />\n </ToursProvider>\n </ErrorBoundary>\n </FeatureFlagProvider>\n );\n};\n"],"mappings":";;;;;;;;;;;AAsBA,IAAa,KAAqC,MAAU;CAC1D,IAAM,IAAK,GAAO,EACZ,EAAE,cAAW,KAAK,qBAAkB,mBAAgB,GACpD,IAAsB,GAAe,MAAU,EAAM,oBAAoB;AAiC/E,QA/BA,cACe;AACX,KAAqB;IAEtB,CAAC,EAAoB,CAAC,EAEzB,QAAgB;AACT,QAqBL,QAAO,EAnBqB,CAC1B;GACE,IAAI;GACJ,OAAO,EAAG,iBAAiB,WAAW;GACtC,MAAM;GACN,MAAM,kBAAC,GAAD,EAAS,MAAM,IAAM,CAAA;GAC3B,OAAO;GACP,OAAO;GACR,EACD;GACE,IAAI;GACJ,OAAO,EAAG,yBAAyB,cAAc;GACjD,MAAM,EAAS,GAAU,WAAW;GACpC,MAAM,kBAAC,GAAD,EAAY,MAAM,IAAM,CAAA;GAC9B,OAAO;GACP,OAAO;GACR,CACF,CAEgC;IAChC;EAAC;EAAkB;EAAU;EAAG,CAAC,EAGlC,kBAAC,GAAD;EAAqB,aAAa,KAAe;EAAM,SAAQ;EAAS,gBAAgB;YACtF,kBAAC,GAAD;GACE,UACE,kBAAC,OAAD;IAAK,WAAU;cACZ,EACC,0BACA,qEACD;IACG,CAAA;aAGR,kBAAC,GAAD;IAAe,GAAI;IAAO,SAAQ;cAChC,kBAAC,GAAD,
|
|
1
|
+
{"version":3,"file":"ToursUserRoot.js","names":[],"sources":["../../src/tours/ToursUserRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { Compass, ListChecks } from 'lucide-react';\nimport { ToursProvider } from './providers/ToursProvider';\nimport { useToursStore } from './store/toursStore';\nimport { ToursUserRoutes } from './ToursUserRoutes';\nimport { useTr } from './i18n';\nimport type { NavItem, ToursRootProps } from './types';\nimport { joinPath } from './utils/joinPath';\n\n/**\n * User-facing root component for the Tours microfrontend.\n *\n * Mounts the read-only \"My Tours\" + \"My Progress\" surface for product\n * user shells (vibecontrols-app, and later workspaces-app / bigconsole-app).\n * Registers exactly two nav items; never exposes authoring or governance\n * pages.\n *\n * Pair with `ToursAdminRoot` for the admin shell.\n */\nexport const ToursUserRoot: FC<ToursRootProps> = (props) => {\n const tr = useTr();\n const { basePath = '/', registerNavItems, workspaceId } = props;\n const resetTransientState = useToursStore((state) => state.resetTransientState);\n\n useEffect(() => {\n return () => {\n resetTransientState();\n };\n }, [resetTransientState]);\n\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: 'tours-my',\n label: tr('myTours.title', 'My Tours'),\n path: basePath,\n icon: <Compass size={20} />,\n order: 10,\n group: 'tours',\n },\n {\n id: 'tours-my-progress',\n label: tr('myToursProgress.title', 'My Progress'),\n path: joinPath(basePath, 'progress'),\n icon: <ListChecks size={20} />,\n order: 20,\n group: 'tours',\n },\n ];\n\n return registerNavItems(navItems);\n }, [registerNavItems, basePath, tr]);\n\n return (\n <FeatureFlagProvider workspaceId={workspaceId ?? null} gateway=\"global\" defaultEnabled={true}>\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n {tr(\n 'toursShell.moduleError',\n 'Something went wrong loading this module. Please refresh the page.'\n )}\n </div>\n }\n >\n <ToursProvider {...props} variant=\"user\">\n <ToursUserRoutes\n key={`${props.currentUser?.id ?? 'anonymous'}:${workspaceId ?? 'global'}`}\n />\n </ToursProvider>\n </ErrorBoundary>\n </FeatureFlagProvider>\n );\n};\n"],"mappings":";;;;;;;;;;;AAsBA,IAAa,KAAqC,MAAU;CAC1D,IAAM,IAAK,GAAO,EACZ,EAAE,cAAW,KAAK,qBAAkB,mBAAgB,GACpD,IAAsB,GAAe,MAAU,EAAM,oBAAoB;AAiC/E,QA/BA,cACe;AACX,KAAqB;IAEtB,CAAC,EAAoB,CAAC,EAEzB,QAAgB;AACT,QAqBL,QAAO,EAnBqB,CAC1B;GACE,IAAI;GACJ,OAAO,EAAG,iBAAiB,WAAW;GACtC,MAAM;GACN,MAAM,kBAAC,GAAD,EAAS,MAAM,IAAM,CAAA;GAC3B,OAAO;GACP,OAAO;GACR,EACD;GACE,IAAI;GACJ,OAAO,EAAG,yBAAyB,cAAc;GACjD,MAAM,EAAS,GAAU,WAAW;GACpC,MAAM,kBAAC,GAAD,EAAY,MAAM,IAAM,CAAA;GAC9B,OAAO;GACP,OAAO;GACR,CACF,CAEgC;IAChC;EAAC;EAAkB;EAAU;EAAG,CAAC,EAGlC,kBAAC,GAAD;EAAqB,aAAa,KAAe;EAAM,SAAQ;EAAS,gBAAgB;YACtF,kBAAC,GAAD;GACE,UACE,kBAAC,OAAD;IAAK,WAAU;cACZ,EACC,0BACA,qEACD;IACG,CAAA;aAGR,kBAAC,GAAD;IAAe,GAAI;IAAO,SAAQ;cAChC,kBAAC,GAAD,EAEE,EADK,GAAG,EAAM,aAAa,MAAM,YAAY,GAAG,KAAe,WAC/D;IACY,CAAA;GACF,CAAA;EACI,CAAA"}
|
package/dist/tours/i18n.js
CHANGED
|
@@ -229,6 +229,7 @@ var n = {
|
|
|
229
229
|
"toursList.subtitle": "Create and manage interactive product tours",
|
|
230
230
|
"toursList.title": "Product Tours",
|
|
231
231
|
"toursList.views": "views",
|
|
232
|
+
"userTours.loadError": "Your tours could not be loaded. Please try again.",
|
|
232
233
|
"myTours.title": "My Tours",
|
|
233
234
|
"myTours.subtitle": "Walkthroughs available in this product. Take a tour to learn a feature.",
|
|
234
235
|
"myTours.loading": "Loading...",
|
package/dist/tours/i18n.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","names":[],"sources":["../../src/tours/i18n.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\n\nconst toursTranslationFallbacks = {\n 'stepEditor.addFirstStep': 'Add First Step',\n 'stepEditor.addStep': 'Add Step',\n 'stepEditor.clickAddStep': 'Click \"Add Step\" to create one',\n 'stepEditor.closeSteps': 'Close steps',\n 'stepEditor.content': 'Content',\n 'stepEditor.contentPlaceholder': 'Enter step content or instructions',\n 'stepEditor.createFirstStep': 'Create your first step to get started',\n 'stepEditor.cssSelector': 'CSS Selector',\n 'stepEditor.cssSelectorPlaceholder': \"[data-tour='element-name'] or #id or .class\",\n 'stepEditor.dataTourHint': \"Use data-tour attributes like [data-tour='sidenav'] for best results\",\n 'stepEditor.deleteStep': 'Delete step',\n 'stepEditor.desktopSelector': 'Desktop Selector',\n 'stepEditor.deviceSelectorHint': 'Override the default selector for specific device types',\n 'stepEditor.deviceSpecificSelectors': 'Device-Specific Selectors (Advanced)',\n 'stepEditor.editStep': 'Edit Step',\n 'stepEditor.goBack': 'Go back',\n 'stepEditor.leaveEmptyDefault': 'Leave empty to use default',\n 'stepEditor.mobileSelector': 'Mobile Selector',\n 'stepEditor.noStepSelected': 'No step selected',\n 'stepEditor.noStepsYet': 'No steps yet',\n 'stepEditor.of': 'of',\n 'stepEditor.nextStep': 'Next step',\n 'stepEditor.placementAuto': 'Auto (recommended)',\n 'stepEditor.placementBottom': 'Bottom',\n 'stepEditor.placementCenter': 'Center (modal style)',\n 'stepEditor.placementLeft': 'Left',\n 'stepEditor.placementRight': 'Right',\n 'stepEditor.placementTop': 'Top',\n 'stepEditor.previousStep': 'Previous step',\n 'stepEditor.save': 'Save',\n 'stepEditor.saving': 'Saving...',\n 'stepEditor.selectStepToEdit': 'Select a step from the list to edit it',\n 'stepEditor.stepNumber': 'Step',\n 'stepEditor.steps': 'Steps',\n 'stepEditor.stepsCount': 'steps',\n 'stepEditor.stepsLabel': 'Steps',\n 'stepEditor.stepTitle': 'Step Title',\n 'stepEditor.stepTitlePlaceholder': 'Enter step title',\n 'stepEditor.tabletSelector': 'Tablet Selector',\n 'stepEditor.targetElement': 'target element',\n 'stepEditor.tooltipPlacement': 'Tooltip Placement',\n 'stepEditor.tourFallback': 'Tour',\n 'stepEditor.tourSteps': 'Tour Steps',\n 'stepEditor.untitled': 'Untitled',\n\n // Step editor additions (BOFF-7116)\n 'stepEditor.moveStepUp': 'Move step up',\n 'stepEditor.moveStepDown': 'Move step down',\n 'stepEditor.requireInteraction': 'Require interaction',\n 'stepEditor.requireInteractionDescription':\n 'User must interact with the highlighted element before advancing.',\n 'stepEditor.waitForTimeout': 'Wait for timeout (ms)',\n 'stepEditor.advancedSettings': 'Advanced settings',\n 'stepEditor.advancedSettingsDescription':\n 'Step-timing waits, skip conditions, and analytics tags.',\n 'stepEditor.waitForSelector': 'Wait for selector',\n 'stepEditor.waitForEvent': 'Wait for event',\n 'stepEditor.skipConditions': 'Skip conditions (JSON)',\n 'stepEditor.stepMedia': 'Step media',\n 'stepEditor.noMediaAttached': 'No media attached to this step yet.',\n 'stepEditor.loadingMedia': 'Loading media...',\n 'stepEditor.selectUploadedMedia': 'Select uploaded media',\n 'stepEditor.positionHeader': 'Header',\n 'stepEditor.positionBody': 'Body',\n 'stepEditor.positionFooter': 'Footer',\n 'stepEditor.attach': 'Attach',\n 'stepEditor.saveBeforeAttach': 'Save your steps before attaching media to them.',\n 'stepEditor.newStep': 'New Step',\n 'stepEditor.copySuffix': '(Copy)',\n\n 'templateLibrary.adjustFilters': 'Try adjusting your filters or search query',\n 'templateLibrary.allCategories': 'All Categories',\n 'templateLibrary.categoryCustom': 'Custom',\n 'templateLibrary.categoryFeatureAnnouncement': 'Feature Announcement',\n 'templateLibrary.categoryHelp': 'Help',\n 'templateLibrary.categoryOnboarding': 'Onboarding',\n 'templateLibrary.deleteConfirm': 'Delete this template?',\n 'templateLibrary.deleteTemplate': 'Delete template',\n 'templateLibrary.loading': 'Loading templates...',\n 'templateLibrary.noTemplatesFound': 'No templates found',\n 'templateLibrary.publicOnly': 'Public only',\n 'templateLibrary.searchPlaceholder': 'Search templates...',\n 'templateLibrary.subtitle': 'Browse and use pre-built tour templates',\n 'templateLibrary.times': 'times',\n 'templateLibrary.title': 'Tour Templates',\n 'templateLibrary.useTemplate': 'Use Template',\n 'templateLibrary.usedTimes': 'Used',\n\n 'tourBuilder.accessDeniedTitle': 'Access Denied',\n 'tourBuilder.analytics': 'Analytics',\n 'tourBuilder.createAndAddSteps': 'Create & Add Steps',\n 'tourBuilder.createAccessDeniedMessage': 'You do not have permission to create tours.',\n 'tourBuilder.editSteps': 'Edit Steps',\n 'tourBuilder.errorTitle': 'Error',\n 'tourBuilder.goBack': 'Go back',\n 'tourBuilder.labelDescription': 'Description',\n 'tourBuilder.labelName': 'Tour Name *',\n 'tourBuilder.labelPriority': 'Priority (1-100)',\n 'tourBuilder.labelProductId': 'Product ID *',\n 'tourBuilder.labelTriggerType': 'Trigger Type',\n 'tourBuilder.loading': 'Loading...',\n 'tourBuilder.preview': 'Preview',\n 'tourBuilder.saving': 'Saving...',\n 'tourBuilder.sectionBasicInfo': 'Basic Information',\n 'tourBuilder.sectionTriggerSettings': 'Trigger Settings',\n\n 'tourBuilder.seedVibeControls.button': 'Seed VibeControls user tours',\n 'tourBuilder.seedVibeControls.confirm':\n 'This will overwrite the built-in Support, Notifications, and Conversations user tours from the service seed file. Continue?',\n 'tourBuilder.seedVibeControls.description':\n 'Overwrites the built-in Support, Notifications, and Conversations user tours from the service seed file.',\n 'tourBuilder.seedVibeControls.error': 'Failed to seed VibeControls user tours.',\n 'tourBuilder.seedVibeControls.loading': 'Seeding...',\n 'tourBuilder.seedVibeControls.permissionHint':\n 'Requires tour create and update permissions. The service also enforces RBAC when the seed mutation runs.',\n 'tourBuilder.seedVibeControls.result':\n 'Seeded {{totalCount}} tours for {{productId}} in workspace {{workspaceId}}: {{createdCount}} created, {{updatedCount}} updated.',\n 'tourBuilder.seedVibeControls.title': 'Seed VibeControls user tours',\n\n 'tourBuilder.seedBuildmyiq.button': 'Seed Buildmyiq user tours',\n 'tourBuilder.seedBuildmyiq.confirm':\n 'This will overwrite the built-in Buildmyiq dashboard user tour from the service seed file. Continue?',\n 'tourBuilder.seedBuildmyiq.description':\n 'Overwrites the built-in Buildmyiq dashboard user tour from the service seed file.',\n 'tourBuilder.seedBuildmyiq.error': 'Failed to seed Buildmyiq user tours.',\n 'tourBuilder.seedBuildmyiq.loading': 'Seeding...',\n 'tourBuilder.seedBuildmyiq.permissionHint':\n 'Requires tour create and update permissions. The service also enforces RBAC when the seed mutation runs.',\n 'tourBuilder.seedBuildmyiq.result':\n 'Seeded {{totalCount}} tours for {{productId}} in workspace {{workspaceId}}: {{createdCount}} created, {{updatedCount}} updated.',\n 'tourBuilder.seedBuildmyiq.title': 'Seed Buildmyiq user tours',\n 'tourBuilder.seedBigconsole.button': 'Seed BigConsole user tours',\n 'tourBuilder.seedBigconsole.confirm':\n 'This will overwrite the built-in BigConsole onboarding tours from the service seed file. Continue?',\n 'tourBuilder.seedBigconsole.description':\n 'Overwrites the built-in BigConsole onboarding tours from the service seed file.',\n 'tourBuilder.seedBigconsole.error': 'Failed to seed BigConsole user tours.',\n 'tourBuilder.seedBigconsole.loading': 'Seeding...',\n 'tourBuilder.seedBigconsole.permissionHint':\n 'Requires tour create and update permissions. The service also enforces RBAC when the seed mutation runs.',\n 'tourBuilder.seedBigconsole.result':\n 'Seeded {{totalCount}} tours for {{productId}} in workspace {{workspaceId}}: {{createdCount}} created, {{updatedCount}} updated.',\n 'tourBuilder.seedBigconsole.title': 'Seed BigConsole user tours',\n\n 'tourBuilder.subtitle': 'Configure tour details and settings',\n 'tourBuilder.titleCreate': 'Create Tour',\n 'tourBuilder.titleEdit': 'Edit Tour',\n 'tourBuilder.triggerAutoAlways': 'Auto (Always)',\n 'tourBuilder.triggerAutoFirstVisit': 'Auto (First Visit)',\n 'tourBuilder.triggerManual': 'Manual',\n 'tourBuilder.triggerOnEvent': 'On Event',\n 'tourBuilder.triggerScheduled': 'Scheduled',\n 'tourBuilder.updateTour': 'Update Tour',\n 'tourBuilder.updateAccessDeniedMessage': 'You do not have permission to update this tour.',\n 'tourBuilder.validationErrorsTitle': 'Validation Errors',\n\n // Tour builder additions (BOFF-7116)\n 'tourBuilder.schedule': 'Schedule',\n 'tourBuilder.saveAsTemplate': 'Save as Template',\n 'tourBuilder.templateDefaultName': '{{name}} Template',\n 'tourBuilder.templateNamePrompt': 'Template name',\n 'tourBuilder.templateCategoryPrompt':\n 'Template category (ONBOARDING, FEATURE_ANNOUNCEMENT, HELP, CUSTOM)',\n 'tourBuilder.seedMutationErrors': 'Seed mutation returned errors.',\n 'tourBuilder.seedMutationNoResult': 'Seed mutation returned no result.',\n 'tourBuilder.selectProduct': 'Select product',\n 'tourBuilder.loadingProducts': 'Loading products…',\n 'tourBuilder.currentValue': 'Current: {{value}}',\n 'tourBuilder.customProductSlug': 'Custom product slug',\n 'tourBuilder.productSlugPlaceholder': 'vibecontrols',\n 'tourBuilder.labelModuleId': 'Module ID',\n 'tourBuilder.allModules': 'All modules',\n 'tourBuilder.customModuleId': 'Custom module ID',\n 'tourBuilder.moduleSlugPlaceholder': 'vibecontrols',\n 'tourBuilder.labelPageId': 'Page ID',\n 'tourBuilder.allPages': 'All pages',\n 'tourBuilder.customPageId': 'Custom page ID',\n 'tourBuilder.pageSlugPlaceholder': 'agents',\n 'tourBuilder.labelActive': 'Active',\n 'tourBuilder.labelStartDate': 'Start Date',\n 'tourBuilder.labelEndDate': 'End Date',\n 'tourBuilder.errorLoadTour': 'Failed to load tour',\n 'tourBuilder.errorCreateTour': 'Failed to create tour',\n 'tourBuilder.errorUpdateTour': 'Failed to update tour',\n 'tourBuilder.errorDeleteTour': 'Failed to delete tour',\n 'tourBuilder.errorSyncSteps': 'Failed to sync steps',\n 'tourBuilder.errorValidationFailed': 'Validation failed',\n 'tourBuilder.errorNoTourSelected': 'No tour selected',\n\n 'tourPreview.accessDeniedMessage': 'You do not have permission to preview this tour.',\n 'tourPreview.accessDeniedTitle': 'Access Denied',\n 'tourPreview.deviceDesktop': 'Desktop preview',\n 'tourPreview.deviceMobile': 'Mobile preview',\n 'tourPreview.deviceTablet': 'Tablet preview',\n 'tourPreview.finish': 'Finish',\n 'tourPreview.loading': 'Loading tour...',\n 'tourPreview.next': 'Next',\n 'tourPreview.nextFooter': 'Next',\n 'tourPreview.previewSuffix': 'Preview',\n 'tourPreview.previous': 'Previous',\n 'tourPreview.readyHint': 'Click \"Start Preview\" to begin',\n 'tourPreview.readyTitle': 'Preview ready',\n 'tourPreview.startPreview': 'Start Preview',\n 'tourPreview.stepOf': 'Step',\n 'tourPreview.stepOfConnector': 'of',\n 'tourPreview.stopPreview': 'Stop Preview',\n 'tourPreview.validationErrorsTitle': 'Validation Errors',\n 'tourPreview.warningsTitle': 'Warnings',\n\n // Tour preview validation additions (BOFF-7116)\n 'tourPreview.errorNoTour': 'No tour selected',\n 'tourPreview.errorNoSteps': 'Tour has no steps',\n 'tourPreview.errorStepNoSelector': 'Step {{number}} has no selector',\n 'tourPreview.warningStepEmptyContent': 'Step {{number}} has empty content',\n 'tourPreview.warningStepNoMobileSelector': 'Step {{number}} has no mobile selector',\n 'tourPreview.warningStepNoTabletSelector': 'Step {{number}} has no tablet selector',\n 'tourPreview.warningStepNoDesktopSelector': 'Step {{number}} has no desktop selector',\n 'tourPreview.errorStepMediaNoUrl': 'Step {{number}}, media {{mediaNumber}} has no URL',\n 'tourPreview.warningStepMediaMissingAlt':\n 'Step {{number}}, media {{mediaNumber}} missing alt text',\n\n 'toursList.accessDeniedMessage': 'You do not have permission to view product tours.',\n 'toursList.accessDeniedTitle': 'Access Denied',\n 'toursList.actionArchive': 'Archive',\n 'toursList.actionDelete': 'Delete',\n 'toursList.actionDuplicate': 'Duplicate',\n 'toursList.actionPublish': 'Publish',\n 'toursList.actionUnpublish': 'Unpublish',\n 'toursList.confirmDelete': 'Are you sure you want to delete this tour?',\n 'toursList.createTour': 'Create Tour',\n 'toursList.editStepsTitle': 'Edit Steps',\n 'toursList.emptySubtitle': 'Create your first tour to get started',\n 'toursList.emptyTitle': 'No tours found',\n 'toursList.errorArchive': 'Failed to archive tour',\n 'toursList.errorDelete': 'Failed to delete tour',\n 'toursList.errorDuplicate': 'Failed to duplicate tour',\n 'toursList.errorPublish': 'Failed to publish tour',\n 'toursList.errorUnpublish': 'Failed to unpublish tour',\n 'toursList.gridView': 'Grid view',\n 'toursList.listView': 'List view',\n 'toursList.loading': 'Loading tours...',\n 'toursList.moreActionsTitle': 'More actions',\n 'toursList.previewButton': 'Preview',\n 'toursList.previewTitle': 'Preview Tour',\n 'toursList.searchPlaceholder': 'Search tours...',\n 'toursList.settingsTitle': 'Settings',\n 'toursList.statusAll': 'All Statuses',\n 'toursList.statusArchived': 'Archived',\n 'toursList.statusDraft': 'Draft',\n 'toursList.statusPublished': 'Published',\n 'toursList.statusScheduled': 'Scheduled',\n 'toursList.steps': 'steps',\n 'toursList.stepsButton': 'Steps',\n 'toursList.subtitle': 'Create and manage interactive product tours',\n 'toursList.title': 'Product Tours',\n 'toursList.views': 'views',\n\n // User-facing surface (BOFF-2391: My Tours + My Progress).\n 'myTours.title': 'My Tours',\n 'myTours.subtitle': 'Walkthroughs available in this product. Take a tour to learn a feature.',\n 'myTours.loading': 'Loading...',\n 'myTours.empty': 'No tours are available in this context yet.',\n 'myTours.status.completed': 'Completed',\n 'myTours.status.inProgress': 'In progress',\n 'myTours.status.skipped': 'Skipped',\n 'myTours.status.notStarted': 'Not started',\n 'myTours.notFoundTitle': 'Page not found',\n 'myTours.notFoundBody': \"That tour page isn't available — returning to My Tours.\",\n\n 'myToursProgress.title': 'My Progress',\n 'myToursProgress.subtitle': 'Tours you have started, completed, or skipped.',\n 'myToursProgress.loading': 'Loading...',\n 'myToursProgress.inProgress': 'In progress',\n 'myToursProgress.completed': 'Completed',\n 'myToursProgress.skipped': 'Skipped or dismissed',\n 'myToursProgress.emptyInProgress': 'No tours in progress.',\n 'myToursProgress.emptyCompleted': 'No completed tours yet.',\n 'myToursProgress.emptySkipped': 'No skipped tours.',\n 'myToursProgress.other': 'Other',\n 'myToursProgress.emptyOther': 'No tours in other states.',\n 'myToursProgress.empty':\n \"You haven't started any tours yet. Open My Tours and take a walkthrough — your progress will show up here.\",\n\n // Page-purpose (\"what is this page for\") + next-step guidance copy.\n 'toursList.purpose':\n 'Author and manage the interactive product tours users see in-app — onboarding flows, feature spotlights, and help walkthroughs. Create a tour, add steps that point at real UI elements, then publish it so it appears for the right product, module, and page.',\n 'myTours.purpose':\n 'Browse the guided walkthroughs available right here in this product. Take a tour to learn a feature step by step — your progress is saved so you can pick up where you left off.',\n 'myToursProgress.purpose':\n 'Track every tour you have interacted with, grouped by status. See what you have completed, what is still in progress, and what you skipped so you know which walkthroughs are left to finish.',\n 'templateLibrary.purpose':\n 'Start from a pre-built tour template instead of a blank canvas. Pick an onboarding, feature-announcement, or help template, then customise its steps — a fast way to ship a consistent walkthrough.',\n\n 'tourBuilder.purpose':\n 'Set up a tour: give it a name, choose where it appears (product, module, page) and how it triggers (manually, on first visit, or scheduled). Save it, then add the steps users will walk through.',\n 'tourBuilder.nextStepsTitle': 'Recommended next steps',\n 'tourBuilder.nextStepEditSteps': 'Add the steps',\n 'tourBuilder.nextStepEditStepsDesc': 'Define the tooltips and target elements users will see.',\n 'tourBuilder.nextStepPreview': 'Preview it',\n 'tourBuilder.nextStepPreviewDesc': 'Walk through the tour on mobile, tablet, and desktop.',\n 'tourBuilder.nextStepSchedule': 'Schedule activation',\n 'tourBuilder.nextStepScheduleDesc': 'Choose when this tour goes live and how often it recurs.',\n 'tourBuilder.nextStepAnalytics': 'Check analytics',\n 'tourBuilder.nextStepAnalyticsDesc': 'See views, completion, and drop-off once it is live.',\n\n 'stepEditor.purpose':\n 'Build the actual walkthrough. Each step is a tooltip anchored to a real UI element via a CSS or data-tour selector. Add steps, reorder them, attach media, and set placement so the tour guides users exactly where you intend.',\n 'stepEditor.emptyTitle': 'No step selected',\n\n 'tourPreview.purpose':\n 'Walk through this tour exactly as your users will, on simulated mobile, tablet, and desktop viewports. Validate that every step finds its target element before you publish.',\n\n // Analytics dashboard (BOFF-7116)\n 'analyticsDashboard.accessDenied': 'Access Denied',\n 'analyticsDashboard.noPermission': 'You do not have permission to view tour analytics.',\n 'analyticsDashboard.loading': 'Loading analytics...',\n 'analyticsDashboard.noData': 'No analytics data available',\n 'analyticsDashboard.noDataHint':\n 'Analytics appear once this tour has been published and seen by users. Publish the tour and check back after it starts collecting views.',\n 'analyticsDashboard.title': 'Tour Analytics',\n 'analyticsDashboard.subtitle': 'Performance metrics and insights',\n 'analyticsDashboard.purpose':\n 'See how this specific tour is performing: how many people viewed it, how many finished versus skipped, and exactly which step they drop off on. Use the per-step drop-off to find and fix the weak point in your walkthrough.',\n 'analyticsDashboard.totalViews': 'Total Views',\n 'analyticsDashboard.completionRate': 'Completion Rate',\n 'analyticsDashboard.skipRate': 'Skip Rate',\n 'analyticsDashboard.avgDuration': 'Avg Duration',\n 'analyticsDashboard.deviceBreakdown': 'Device Breakdown',\n 'analyticsDashboard.stepPerformance': 'Step Performance',\n 'analyticsDashboard.tableStep': 'Step',\n 'analyticsDashboard.tableViews': 'Views',\n 'analyticsDashboard.tableCompletions': 'Completions',\n 'analyticsDashboard.tableDropOffRate': 'Drop-off Rate',\n 'analyticsDashboard.stepLabel': 'Step',\n\n // System analytics (BOFF-7116)\n 'systemAnalytics.accessDenied': 'Access Denied',\n 'systemAnalytics.noPermission': 'You do not have permission to view system analytics.',\n 'systemAnalytics.loading': 'Loading analytics...',\n 'systemAnalytics.noData': 'No analytics data available',\n 'systemAnalytics.noDataHint':\n 'Workspace-wide tour metrics appear once you have published tours and users have started seeing them. Publish a tour to begin collecting data.',\n 'systemAnalytics.title': 'System Analytics',\n 'systemAnalytics.subtitle': 'Workspace-wide tour performance overview',\n 'systemAnalytics.purpose':\n 'Get the big-picture health of onboarding across the whole workspace: how many tours exist, how many are live, total reach, and the overall completion rate. Use it to judge whether your guided experiences are actually landing.',\n 'systemAnalytics.completionRate': 'Completion Rate',\n 'systemAnalytics.completionRateHint':\n 'The share of started tours that users finished across this workspace.',\n 'systemAnalytics.totalTours': 'Total Tours',\n 'systemAnalytics.publishedTours': 'Published Tours',\n 'systemAnalytics.totalViews': 'Total Views',\n 'systemAnalytics.totalCompletions': 'Total Completions',\n\n // Tour scheduler (BOFF-7116)\n 'tourScheduler.goBack': 'Go back',\n 'tourScheduler.title': 'Schedule Tour',\n 'tourScheduler.subtitle': 'Configure when this tour should be activated',\n 'tourScheduler.purpose':\n 'Decide exactly when this tour goes live and how often it repeats — for example, run an onboarding tour every Monday, or activate a feature-announcement tour for a single launch window. Set a start (and optional end) date plus a recurrence pattern, and the tour will surface to users automatically on schedule.',\n 'tourScheduler.existingSchedules': 'Existing Schedules',\n 'tourScheduler.noEndDate': 'No end date',\n 'tourScheduler.oneTime': 'One-time',\n 'tourScheduler.active': 'Active',\n 'tourScheduler.inactive': 'Inactive',\n 'tourScheduler.runs': 'Runs',\n 'tourScheduler.sectionDateRange': 'Date Range',\n 'tourScheduler.labelStartDate': 'Start Date *',\n 'tourScheduler.labelEndDate': 'End Date (Optional)',\n 'tourScheduler.sectionRecurrence': 'Recurrence',\n 'tourScheduler.labelRecurrencePattern': 'Recurrence Pattern',\n 'tourScheduler.recurrenceDaily': 'Daily',\n 'tourScheduler.recurrenceWeekly': 'Weekly',\n 'tourScheduler.recurrenceMonthly': 'Monthly',\n 'tourScheduler.recurrenceCustom': 'Custom',\n 'tourScheduler.labelTimezone': 'Timezone',\n 'tourScheduler.statusActiveLabel': 'Active',\n 'tourScheduler.statusActiveDescription': 'Enable this schedule immediately after creation',\n 'tourScheduler.cancel': 'Cancel',\n 'tourScheduler.creating': 'Creating...',\n 'tourScheduler.createSchedule': 'Create Schedule',\n\n // Media library (BOFF-7116)\n 'mediaLibrary.title': 'Media Library',\n 'mediaLibrary.subtitle': 'Upload and manage media for tour steps',\n 'mediaLibrary.uploadMedia': 'Upload Media',\n 'mediaLibrary.purpose':\n 'Store and organise the images, videos, audio, and documents you attach to tour steps. Upload an asset here once, then reference it from any step — handy for product screenshots, short demo clips, or callout graphics that make a walkthrough clearer.',\n 'mediaLibrary.searchPlaceholder': 'Search media...',\n 'mediaLibrary.filterByType': 'Filter by media type',\n 'mediaLibrary.allTypes': 'All Types',\n 'mediaLibrary.typeImages': 'Images',\n 'mediaLibrary.typeVideos': 'Videos',\n 'mediaLibrary.typeAudio': 'Audio',\n 'mediaLibrary.typeDocuments': 'Documents',\n 'mediaLibrary.uploading': 'Uploading...',\n 'mediaLibrary.deleteConfirm': 'Delete this media?',\n 'mediaLibrary.delete': 'Delete',\n 'mediaLibrary.noMedia': 'No media files',\n 'mediaLibrary.uploadFirstMedia': 'Upload your first media file to get started',\n\n // Markdown editor (BOFF-7116)\n 'markdownEditor.bold': 'Bold',\n 'markdownEditor.italic': 'Italic',\n 'markdownEditor.link': 'Link',\n 'markdownEditor.inlineCode': 'Inline code',\n 'markdownEditor.bulletList': 'Bullet list',\n 'markdownEditor.linkTextPlaceholder': 'link text',\n 'markdownEditor.writeTab': 'Write',\n 'markdownEditor.previewTab': 'Preview',\n 'markdownEditor.nothingToPreview': 'Nothing to preview',\n 'markdownEditor.tabsAriaLabel': 'Markdown editor tabs',\n\n // Tours shell / nav (BOFF-7116)\n 'toursNav.allTours': 'All Tours',\n 'toursNav.createTour': 'Create Tour',\n 'toursNav.templates': 'Templates',\n 'toursNav.analytics': 'Analytics',\n 'toursNav.mediaLibrary': 'Media Library',\n\n 'toursShell.productToursReady': 'Product Tours Ready',\n 'toursShell.moduleError': 'Something went wrong loading this module. Please refresh the page.',\n\n // Route-level errors (BOFF-7116)\n 'routeErrors.failedToLoadPage': 'Failed to load page',\n 'routeErrors.chunkLoadRetry':\n 'The page chunk could not be loaded. This may be due to a network issue.',\n 'routeErrors.chunkLoadRefresh':\n 'The page chunk could not be loaded after multiple attempts. Please refresh the page.',\n 'routeErrors.tryAgain': 'Try Again',\n 'routeErrors.refreshPage': 'Refresh Page',\n\n // Feature disabled fallback (BOFF-7116)\n 'featureDisabled.title': 'Feature Not Available',\n 'featureDisabled.description':\n 'This feature is not currently enabled. Redirecting you to the tours list…',\n\n // User tours unavailable fallback (BOFF-7116)\n 'userTours.unavailable': 'Tours are not available for this workspace right now.',\n\n // Device type labels (BOFF-7116)\n 'deviceType.mobile': 'Mobile',\n 'deviceType.tablet': 'Tablet',\n 'deviceType.desktop': 'Desktop',\n\n // Common unit labels (BOFF-7116)\n 'common.fileSize.bytes': 'Bytes',\n 'common.fileSize.kb': 'KB',\n 'common.fileSize.mb': 'MB',\n 'common.fileSize.gb': 'GB',\n 'common.duration.seconds': 's',\n 'common.duration.minutes': 'm',\n 'common.duration.hours': 'h',\n\n // Validation messages returned by the store and rendered by the builder (BOFF-7116)\n 'validation.noTourSelected': 'No tour selected',\n 'validation.tourNameRequired': 'Tour name is required',\n 'validation.productIdRequired': 'Product ID is required',\n 'validation.stepsRequired': 'At least one step is required',\n 'validation.stepTitleRequired': 'Step {{number}} title is required',\n 'validation.stepContentRequired': 'Step {{number}} content is required',\n 'validation.stepSelectorRequired': 'Step {{number}} selector is required',\n\n // Tours list async error (BOFF-7116)\n 'toursList.errorFetch': 'Failed to fetch tours',\n\n // Analytics dashboard labels still needed after first pass (BOFF-7116)\n 'analyticsDashboard.deviceViews': 'views',\n} as const;\n\nexport type ToursTranslationKey = keyof typeof toursTranslationFallbacks;\n\ntype TranslationParams = Record<string, string | number>;\n\nexport function useToursI18n() {\n const i18n = useI18n();\n // The installed fe-libs typings still expose the older 2-argument shape, but the\n // runtime provider supports fallback strings. Narrow locally so this MFE can rely\n // on fallback-backed translations without changing the shared package here.\n const translateWithFallback = i18n.t as (key: string, fallback?: string) => string;\n\n const tr = useCallback(\n (\n key: ToursTranslationKey,\n fallbackOrParams?: string | TranslationParams,\n params?: TranslationParams\n ): string => {\n const fallbackString =\n typeof fallbackOrParams === 'string'\n ? fallbackOrParams\n : (toursTranslationFallbacks[key] as string | undefined);\n const interpolationParams = typeof fallbackOrParams === 'object' ? fallbackOrParams : params;\n\n const resolved = translateWithFallback(key, fallbackString);\n\n if (!interpolationParams) {\n return resolved;\n }\n\n return Object.entries(interpolationParams).reduce(\n (value, [paramKey, paramValue]) =>\n value.replace(new RegExp(`\\\\{\\\\{${paramKey}\\\\}\\\\}`, 'g'), String(paramValue)),\n resolved\n );\n },\n [translateWithFallback]\n );\n\n return {\n ...i18n,\n tr,\n };\n}\n\n/**\n * `useTr` — VibeControls-style translation hook with inline English fallback.\n *\n * Wraps the MFE's typed `useToursI18n()` so call sites can keep a readable\n * fallback string next to the key, matching the pattern used by\n * `microfe-vibecontrols/src/shared/hooks/useTr.ts`.\n *\n * @example\n * const tr = useTr();\n * return <h1>{tr('toursList.title', 'Product Tours')}</h1>;\n * return <p>{tr('toursList.selectedCount', '{{count}} tours selected', { count: 5 })}</p>;\n */\nexport function useTr(): (key: string, fallback: string, params?: TranslationParams) => string {\n const { tr } = useToursI18n();\n return useCallback(\n (key: string, fallback: string, params?: TranslationParams): string =>\n tr(key as ToursTranslationKey, fallback, params),\n [tr]\n );\n}\n\nexport function getToursTranslationFallback(key: ToursTranslationKey) {\n return toursTranslationFallbacks[key];\n}\n"],"mappings":";;;AAGA,IAAM,IAA4B;CAChC,2BAA2B;CAC3B,sBAAsB;CACtB,2BAA2B;CAC3B,yBAAyB;CACzB,sBAAs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file":"i18n.js","names":[],"sources":["../../src/tours/i18n.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\n\nconst toursTranslationFallbacks = {\n 'stepEditor.addFirstStep': 'Add First Step',\n 'stepEditor.addStep': 'Add Step',\n 'stepEditor.clickAddStep': 'Click \"Add Step\" to create one',\n 'stepEditor.closeSteps': 'Close steps',\n 'stepEditor.content': 'Content',\n 'stepEditor.contentPlaceholder': 'Enter step content or instructions',\n 'stepEditor.createFirstStep': 'Create your first step to get started',\n 'stepEditor.cssSelector': 'CSS Selector',\n 'stepEditor.cssSelectorPlaceholder': \"[data-tour='element-name'] or #id or .class\",\n 'stepEditor.dataTourHint': \"Use data-tour attributes like [data-tour='sidenav'] for best results\",\n 'stepEditor.deleteStep': 'Delete step',\n 'stepEditor.desktopSelector': 'Desktop Selector',\n 'stepEditor.deviceSelectorHint': 'Override the default selector for specific device types',\n 'stepEditor.deviceSpecificSelectors': 'Device-Specific Selectors (Advanced)',\n 'stepEditor.editStep': 'Edit Step',\n 'stepEditor.goBack': 'Go back',\n 'stepEditor.leaveEmptyDefault': 'Leave empty to use default',\n 'stepEditor.mobileSelector': 'Mobile Selector',\n 'stepEditor.noStepSelected': 'No step selected',\n 'stepEditor.noStepsYet': 'No steps yet',\n 'stepEditor.of': 'of',\n 'stepEditor.nextStep': 'Next step',\n 'stepEditor.placementAuto': 'Auto (recommended)',\n 'stepEditor.placementBottom': 'Bottom',\n 'stepEditor.placementCenter': 'Center (modal style)',\n 'stepEditor.placementLeft': 'Left',\n 'stepEditor.placementRight': 'Right',\n 'stepEditor.placementTop': 'Top',\n 'stepEditor.previousStep': 'Previous step',\n 'stepEditor.save': 'Save',\n 'stepEditor.saving': 'Saving...',\n 'stepEditor.selectStepToEdit': 'Select a step from the list to edit it',\n 'stepEditor.stepNumber': 'Step',\n 'stepEditor.steps': 'Steps',\n 'stepEditor.stepsCount': 'steps',\n 'stepEditor.stepsLabel': 'Steps',\n 'stepEditor.stepTitle': 'Step Title',\n 'stepEditor.stepTitlePlaceholder': 'Enter step title',\n 'stepEditor.tabletSelector': 'Tablet Selector',\n 'stepEditor.targetElement': 'target element',\n 'stepEditor.tooltipPlacement': 'Tooltip Placement',\n 'stepEditor.tourFallback': 'Tour',\n 'stepEditor.tourSteps': 'Tour Steps',\n 'stepEditor.untitled': 'Untitled',\n\n // Step editor additions (BOFF-7116)\n 'stepEditor.moveStepUp': 'Move step up',\n 'stepEditor.moveStepDown': 'Move step down',\n 'stepEditor.requireInteraction': 'Require interaction',\n 'stepEditor.requireInteractionDescription':\n 'User must interact with the highlighted element before advancing.',\n 'stepEditor.waitForTimeout': 'Wait for timeout (ms)',\n 'stepEditor.advancedSettings': 'Advanced settings',\n 'stepEditor.advancedSettingsDescription':\n 'Step-timing waits, skip conditions, and analytics tags.',\n 'stepEditor.waitForSelector': 'Wait for selector',\n 'stepEditor.waitForEvent': 'Wait for event',\n 'stepEditor.skipConditions': 'Skip conditions (JSON)',\n 'stepEditor.stepMedia': 'Step media',\n 'stepEditor.noMediaAttached': 'No media attached to this step yet.',\n 'stepEditor.loadingMedia': 'Loading media...',\n 'stepEditor.selectUploadedMedia': 'Select uploaded media',\n 'stepEditor.positionHeader': 'Header',\n 'stepEditor.positionBody': 'Body',\n 'stepEditor.positionFooter': 'Footer',\n 'stepEditor.attach': 'Attach',\n 'stepEditor.saveBeforeAttach': 'Save your steps before attaching media to them.',\n 'stepEditor.newStep': 'New Step',\n 'stepEditor.copySuffix': '(Copy)',\n\n 'templateLibrary.adjustFilters': 'Try adjusting your filters or search query',\n 'templateLibrary.allCategories': 'All Categories',\n 'templateLibrary.categoryCustom': 'Custom',\n 'templateLibrary.categoryFeatureAnnouncement': 'Feature Announcement',\n 'templateLibrary.categoryHelp': 'Help',\n 'templateLibrary.categoryOnboarding': 'Onboarding',\n 'templateLibrary.deleteConfirm': 'Delete this template?',\n 'templateLibrary.deleteTemplate': 'Delete template',\n 'templateLibrary.loading': 'Loading templates...',\n 'templateLibrary.noTemplatesFound': 'No templates found',\n 'templateLibrary.publicOnly': 'Public only',\n 'templateLibrary.searchPlaceholder': 'Search templates...',\n 'templateLibrary.subtitle': 'Browse and use pre-built tour templates',\n 'templateLibrary.times': 'times',\n 'templateLibrary.title': 'Tour Templates',\n 'templateLibrary.useTemplate': 'Use Template',\n 'templateLibrary.usedTimes': 'Used',\n\n 'tourBuilder.accessDeniedTitle': 'Access Denied',\n 'tourBuilder.analytics': 'Analytics',\n 'tourBuilder.createAndAddSteps': 'Create & Add Steps',\n 'tourBuilder.createAccessDeniedMessage': 'You do not have permission to create tours.',\n 'tourBuilder.editSteps': 'Edit Steps',\n 'tourBuilder.errorTitle': 'Error',\n 'tourBuilder.goBack': 'Go back',\n 'tourBuilder.labelDescription': 'Description',\n 'tourBuilder.labelName': 'Tour Name *',\n 'tourBuilder.labelPriority': 'Priority (1-100)',\n 'tourBuilder.labelProductId': 'Product ID *',\n 'tourBuilder.labelTriggerType': 'Trigger Type',\n 'tourBuilder.loading': 'Loading...',\n 'tourBuilder.preview': 'Preview',\n 'tourBuilder.saving': 'Saving...',\n 'tourBuilder.sectionBasicInfo': 'Basic Information',\n 'tourBuilder.sectionTriggerSettings': 'Trigger Settings',\n\n 'tourBuilder.seedVibeControls.button': 'Seed VibeControls user tours',\n 'tourBuilder.seedVibeControls.confirm':\n 'This will overwrite the built-in Support, Notifications, and Conversations user tours from the service seed file. Continue?',\n 'tourBuilder.seedVibeControls.description':\n 'Overwrites the built-in Support, Notifications, and Conversations user tours from the service seed file.',\n 'tourBuilder.seedVibeControls.error': 'Failed to seed VibeControls user tours.',\n 'tourBuilder.seedVibeControls.loading': 'Seeding...',\n 'tourBuilder.seedVibeControls.permissionHint':\n 'Requires tour create and update permissions. The service also enforces RBAC when the seed mutation runs.',\n 'tourBuilder.seedVibeControls.result':\n 'Seeded {{totalCount}} tours for {{productId}} in workspace {{workspaceId}}: {{createdCount}} created, {{updatedCount}} updated.',\n 'tourBuilder.seedVibeControls.title': 'Seed VibeControls user tours',\n\n 'tourBuilder.seedBuildmyiq.button': 'Seed Buildmyiq user tours',\n 'tourBuilder.seedBuildmyiq.confirm':\n 'This will overwrite the built-in Buildmyiq dashboard user tour from the service seed file. Continue?',\n 'tourBuilder.seedBuildmyiq.description':\n 'Overwrites the built-in Buildmyiq dashboard user tour from the service seed file.',\n 'tourBuilder.seedBuildmyiq.error': 'Failed to seed Buildmyiq user tours.',\n 'tourBuilder.seedBuildmyiq.loading': 'Seeding...',\n 'tourBuilder.seedBuildmyiq.permissionHint':\n 'Requires tour create and update permissions. The service also enforces RBAC when the seed mutation runs.',\n 'tourBuilder.seedBuildmyiq.result':\n 'Seeded {{totalCount}} tours for {{productId}} in workspace {{workspaceId}}: {{createdCount}} created, {{updatedCount}} updated.',\n 'tourBuilder.seedBuildmyiq.title': 'Seed Buildmyiq user tours',\n 'tourBuilder.seedBigconsole.button': 'Seed BigConsole user tours',\n 'tourBuilder.seedBigconsole.confirm':\n 'This will overwrite the built-in BigConsole onboarding tours from the service seed file. Continue?',\n 'tourBuilder.seedBigconsole.description':\n 'Overwrites the built-in BigConsole onboarding tours from the service seed file.',\n 'tourBuilder.seedBigconsole.error': 'Failed to seed BigConsole user tours.',\n 'tourBuilder.seedBigconsole.loading': 'Seeding...',\n 'tourBuilder.seedBigconsole.permissionHint':\n 'Requires tour create and update permissions. The service also enforces RBAC when the seed mutation runs.',\n 'tourBuilder.seedBigconsole.result':\n 'Seeded {{totalCount}} tours for {{productId}} in workspace {{workspaceId}}: {{createdCount}} created, {{updatedCount}} updated.',\n 'tourBuilder.seedBigconsole.title': 'Seed BigConsole user tours',\n\n 'tourBuilder.subtitle': 'Configure tour details and settings',\n 'tourBuilder.titleCreate': 'Create Tour',\n 'tourBuilder.titleEdit': 'Edit Tour',\n 'tourBuilder.triggerAutoAlways': 'Auto (Always)',\n 'tourBuilder.triggerAutoFirstVisit': 'Auto (First Visit)',\n 'tourBuilder.triggerManual': 'Manual',\n 'tourBuilder.triggerOnEvent': 'On Event',\n 'tourBuilder.triggerScheduled': 'Scheduled',\n 'tourBuilder.updateTour': 'Update Tour',\n 'tourBuilder.updateAccessDeniedMessage': 'You do not have permission to update this tour.',\n 'tourBuilder.validationErrorsTitle': 'Validation Errors',\n\n // Tour builder additions (BOFF-7116)\n 'tourBuilder.schedule': 'Schedule',\n 'tourBuilder.saveAsTemplate': 'Save as Template',\n 'tourBuilder.templateDefaultName': '{{name}} Template',\n 'tourBuilder.templateNamePrompt': 'Template name',\n 'tourBuilder.templateCategoryPrompt':\n 'Template category (ONBOARDING, FEATURE_ANNOUNCEMENT, HELP, CUSTOM)',\n 'tourBuilder.seedMutationErrors': 'Seed mutation returned errors.',\n 'tourBuilder.seedMutationNoResult': 'Seed mutation returned no result.',\n 'tourBuilder.selectProduct': 'Select product',\n 'tourBuilder.loadingProducts': 'Loading products…',\n 'tourBuilder.currentValue': 'Current: {{value}}',\n 'tourBuilder.customProductSlug': 'Custom product slug',\n 'tourBuilder.productSlugPlaceholder': 'vibecontrols',\n 'tourBuilder.labelModuleId': 'Module ID',\n 'tourBuilder.allModules': 'All modules',\n 'tourBuilder.customModuleId': 'Custom module ID',\n 'tourBuilder.moduleSlugPlaceholder': 'vibecontrols',\n 'tourBuilder.labelPageId': 'Page ID',\n 'tourBuilder.allPages': 'All pages',\n 'tourBuilder.customPageId': 'Custom page ID',\n 'tourBuilder.pageSlugPlaceholder': 'agents',\n 'tourBuilder.labelActive': 'Active',\n 'tourBuilder.labelStartDate': 'Start Date',\n 'tourBuilder.labelEndDate': 'End Date',\n 'tourBuilder.errorLoadTour': 'Failed to load tour',\n 'tourBuilder.errorCreateTour': 'Failed to create tour',\n 'tourBuilder.errorUpdateTour': 'Failed to update tour',\n 'tourBuilder.errorDeleteTour': 'Failed to delete tour',\n 'tourBuilder.errorSyncSteps': 'Failed to sync steps',\n 'tourBuilder.errorValidationFailed': 'Validation failed',\n 'tourBuilder.errorNoTourSelected': 'No tour selected',\n\n 'tourPreview.accessDeniedMessage': 'You do not have permission to preview this tour.',\n 'tourPreview.accessDeniedTitle': 'Access Denied',\n 'tourPreview.deviceDesktop': 'Desktop preview',\n 'tourPreview.deviceMobile': 'Mobile preview',\n 'tourPreview.deviceTablet': 'Tablet preview',\n 'tourPreview.finish': 'Finish',\n 'tourPreview.loading': 'Loading tour...',\n 'tourPreview.next': 'Next',\n 'tourPreview.nextFooter': 'Next',\n 'tourPreview.previewSuffix': 'Preview',\n 'tourPreview.previous': 'Previous',\n 'tourPreview.readyHint': 'Click \"Start Preview\" to begin',\n 'tourPreview.readyTitle': 'Preview ready',\n 'tourPreview.startPreview': 'Start Preview',\n 'tourPreview.stepOf': 'Step',\n 'tourPreview.stepOfConnector': 'of',\n 'tourPreview.stopPreview': 'Stop Preview',\n 'tourPreview.validationErrorsTitle': 'Validation Errors',\n 'tourPreview.warningsTitle': 'Warnings',\n\n // Tour preview validation additions (BOFF-7116)\n 'tourPreview.errorNoTour': 'No tour selected',\n 'tourPreview.errorNoSteps': 'Tour has no steps',\n 'tourPreview.errorStepNoSelector': 'Step {{number}} has no selector',\n 'tourPreview.warningStepEmptyContent': 'Step {{number}} has empty content',\n 'tourPreview.warningStepNoMobileSelector': 'Step {{number}} has no mobile selector',\n 'tourPreview.warningStepNoTabletSelector': 'Step {{number}} has no tablet selector',\n 'tourPreview.warningStepNoDesktopSelector': 'Step {{number}} has no desktop selector',\n 'tourPreview.errorStepMediaNoUrl': 'Step {{number}}, media {{mediaNumber}} has no URL',\n 'tourPreview.warningStepMediaMissingAlt':\n 'Step {{number}}, media {{mediaNumber}} missing alt text',\n\n 'toursList.accessDeniedMessage': 'You do not have permission to view product tours.',\n 'toursList.accessDeniedTitle': 'Access Denied',\n 'toursList.actionArchive': 'Archive',\n 'toursList.actionDelete': 'Delete',\n 'toursList.actionDuplicate': 'Duplicate',\n 'toursList.actionPublish': 'Publish',\n 'toursList.actionUnpublish': 'Unpublish',\n 'toursList.confirmDelete': 'Are you sure you want to delete this tour?',\n 'toursList.createTour': 'Create Tour',\n 'toursList.editStepsTitle': 'Edit Steps',\n 'toursList.emptySubtitle': 'Create your first tour to get started',\n 'toursList.emptyTitle': 'No tours found',\n 'toursList.errorArchive': 'Failed to archive tour',\n 'toursList.errorDelete': 'Failed to delete tour',\n 'toursList.errorDuplicate': 'Failed to duplicate tour',\n 'toursList.errorPublish': 'Failed to publish tour',\n 'toursList.errorUnpublish': 'Failed to unpublish tour',\n 'toursList.gridView': 'Grid view',\n 'toursList.listView': 'List view',\n 'toursList.loading': 'Loading tours...',\n 'toursList.moreActionsTitle': 'More actions',\n 'toursList.previewButton': 'Preview',\n 'toursList.previewTitle': 'Preview Tour',\n 'toursList.searchPlaceholder': 'Search tours...',\n 'toursList.settingsTitle': 'Settings',\n 'toursList.statusAll': 'All Statuses',\n 'toursList.statusArchived': 'Archived',\n 'toursList.statusDraft': 'Draft',\n 'toursList.statusPublished': 'Published',\n 'toursList.statusScheduled': 'Scheduled',\n 'toursList.steps': 'steps',\n 'toursList.stepsButton': 'Steps',\n 'toursList.subtitle': 'Create and manage interactive product tours',\n 'toursList.title': 'Product Tours',\n 'toursList.views': 'views',\n\n // User-facing surface (BOFF-2391: My Tours + My Progress).\n 'userTours.loadError': 'Your tours could not be loaded. Please try again.',\n 'myTours.title': 'My Tours',\n 'myTours.subtitle': 'Walkthroughs available in this product. Take a tour to learn a feature.',\n 'myTours.loading': 'Loading...',\n 'myTours.empty': 'No tours are available in this context yet.',\n 'myTours.status.completed': 'Completed',\n 'myTours.status.inProgress': 'In progress',\n 'myTours.status.skipped': 'Skipped',\n 'myTours.status.notStarted': 'Not started',\n 'myTours.notFoundTitle': 'Page not found',\n 'myTours.notFoundBody': \"That tour page isn't available — returning to My Tours.\",\n\n 'myToursProgress.title': 'My Progress',\n 'myToursProgress.subtitle': 'Tours you have started, completed, or skipped.',\n 'myToursProgress.loading': 'Loading...',\n 'myToursProgress.inProgress': 'In progress',\n 'myToursProgress.completed': 'Completed',\n 'myToursProgress.skipped': 'Skipped or dismissed',\n 'myToursProgress.emptyInProgress': 'No tours in progress.',\n 'myToursProgress.emptyCompleted': 'No completed tours yet.',\n 'myToursProgress.emptySkipped': 'No skipped tours.',\n 'myToursProgress.other': 'Other',\n 'myToursProgress.emptyOther': 'No tours in other states.',\n 'myToursProgress.empty':\n \"You haven't started any tours yet. Open My Tours and take a walkthrough — your progress will show up here.\",\n\n // Page-purpose (\"what is this page for\") + next-step guidance copy.\n 'toursList.purpose':\n 'Author and manage the interactive product tours users see in-app — onboarding flows, feature spotlights, and help walkthroughs. Create a tour, add steps that point at real UI elements, then publish it so it appears for the right product, module, and page.',\n 'myTours.purpose':\n 'Browse the guided walkthroughs available right here in this product. Take a tour to learn a feature step by step — your progress is saved so you can pick up where you left off.',\n 'myToursProgress.purpose':\n 'Track every tour you have interacted with, grouped by status. See what you have completed, what is still in progress, and what you skipped so you know which walkthroughs are left to finish.',\n 'templateLibrary.purpose':\n 'Start from a pre-built tour template instead of a blank canvas. Pick an onboarding, feature-announcement, or help template, then customise its steps — a fast way to ship a consistent walkthrough.',\n\n 'tourBuilder.purpose':\n 'Set up a tour: give it a name, choose where it appears (product, module, page) and how it triggers (manually, on first visit, or scheduled). Save it, then add the steps users will walk through.',\n 'tourBuilder.nextStepsTitle': 'Recommended next steps',\n 'tourBuilder.nextStepEditSteps': 'Add the steps',\n 'tourBuilder.nextStepEditStepsDesc': 'Define the tooltips and target elements users will see.',\n 'tourBuilder.nextStepPreview': 'Preview it',\n 'tourBuilder.nextStepPreviewDesc': 'Walk through the tour on mobile, tablet, and desktop.',\n 'tourBuilder.nextStepSchedule': 'Schedule activation',\n 'tourBuilder.nextStepScheduleDesc': 'Choose when this tour goes live and how often it recurs.',\n 'tourBuilder.nextStepAnalytics': 'Check analytics',\n 'tourBuilder.nextStepAnalyticsDesc': 'See views, completion, and drop-off once it is live.',\n\n 'stepEditor.purpose':\n 'Build the actual walkthrough. Each step is a tooltip anchored to a real UI element via a CSS or data-tour selector. Add steps, reorder them, attach media, and set placement so the tour guides users exactly where you intend.',\n 'stepEditor.emptyTitle': 'No step selected',\n\n 'tourPreview.purpose':\n 'Walk through this tour exactly as your users will, on simulated mobile, tablet, and desktop viewports. Validate that every step finds its target element before you publish.',\n\n // Analytics dashboard (BOFF-7116)\n 'analyticsDashboard.accessDenied': 'Access Denied',\n 'analyticsDashboard.noPermission': 'You do not have permission to view tour analytics.',\n 'analyticsDashboard.loading': 'Loading analytics...',\n 'analyticsDashboard.noData': 'No analytics data available',\n 'analyticsDashboard.noDataHint':\n 'Analytics appear once this tour has been published and seen by users. Publish the tour and check back after it starts collecting views.',\n 'analyticsDashboard.title': 'Tour Analytics',\n 'analyticsDashboard.subtitle': 'Performance metrics and insights',\n 'analyticsDashboard.purpose':\n 'See how this specific tour is performing: how many people viewed it, how many finished versus skipped, and exactly which step they drop off on. Use the per-step drop-off to find and fix the weak point in your walkthrough.',\n 'analyticsDashboard.totalViews': 'Total Views',\n 'analyticsDashboard.completionRate': 'Completion Rate',\n 'analyticsDashboard.skipRate': 'Skip Rate',\n 'analyticsDashboard.avgDuration': 'Avg Duration',\n 'analyticsDashboard.deviceBreakdown': 'Device Breakdown',\n 'analyticsDashboard.stepPerformance': 'Step Performance',\n 'analyticsDashboard.tableStep': 'Step',\n 'analyticsDashboard.tableViews': 'Views',\n 'analyticsDashboard.tableCompletions': 'Completions',\n 'analyticsDashboard.tableDropOffRate': 'Drop-off Rate',\n 'analyticsDashboard.stepLabel': 'Step',\n\n // System analytics (BOFF-7116)\n 'systemAnalytics.accessDenied': 'Access Denied',\n 'systemAnalytics.noPermission': 'You do not have permission to view system analytics.',\n 'systemAnalytics.loading': 'Loading analytics...',\n 'systemAnalytics.noData': 'No analytics data available',\n 'systemAnalytics.noDataHint':\n 'Workspace-wide tour metrics appear once you have published tours and users have started seeing them. Publish a tour to begin collecting data.',\n 'systemAnalytics.title': 'System Analytics',\n 'systemAnalytics.subtitle': 'Workspace-wide tour performance overview',\n 'systemAnalytics.purpose':\n 'Get the big-picture health of onboarding across the whole workspace: how many tours exist, how many are live, total reach, and the overall completion rate. Use it to judge whether your guided experiences are actually landing.',\n 'systemAnalytics.completionRate': 'Completion Rate',\n 'systemAnalytics.completionRateHint':\n 'The share of started tours that users finished across this workspace.',\n 'systemAnalytics.totalTours': 'Total Tours',\n 'systemAnalytics.publishedTours': 'Published Tours',\n 'systemAnalytics.totalViews': 'Total Views',\n 'systemAnalytics.totalCompletions': 'Total Completions',\n\n // Tour scheduler (BOFF-7116)\n 'tourScheduler.goBack': 'Go back',\n 'tourScheduler.title': 'Schedule Tour',\n 'tourScheduler.subtitle': 'Configure when this tour should be activated',\n 'tourScheduler.purpose':\n 'Decide exactly when this tour goes live and how often it repeats — for example, run an onboarding tour every Monday, or activate a feature-announcement tour for a single launch window. Set a start (and optional end) date plus a recurrence pattern, and the tour will surface to users automatically on schedule.',\n 'tourScheduler.existingSchedules': 'Existing Schedules',\n 'tourScheduler.noEndDate': 'No end date',\n 'tourScheduler.oneTime': 'One-time',\n 'tourScheduler.active': 'Active',\n 'tourScheduler.inactive': 'Inactive',\n 'tourScheduler.runs': 'Runs',\n 'tourScheduler.sectionDateRange': 'Date Range',\n 'tourScheduler.labelStartDate': 'Start Date *',\n 'tourScheduler.labelEndDate': 'End Date (Optional)',\n 'tourScheduler.sectionRecurrence': 'Recurrence',\n 'tourScheduler.labelRecurrencePattern': 'Recurrence Pattern',\n 'tourScheduler.recurrenceDaily': 'Daily',\n 'tourScheduler.recurrenceWeekly': 'Weekly',\n 'tourScheduler.recurrenceMonthly': 'Monthly',\n 'tourScheduler.recurrenceCustom': 'Custom',\n 'tourScheduler.labelTimezone': 'Timezone',\n 'tourScheduler.statusActiveLabel': 'Active',\n 'tourScheduler.statusActiveDescription': 'Enable this schedule immediately after creation',\n 'tourScheduler.cancel': 'Cancel',\n 'tourScheduler.creating': 'Creating...',\n 'tourScheduler.createSchedule': 'Create Schedule',\n\n // Media library (BOFF-7116)\n 'mediaLibrary.title': 'Media Library',\n 'mediaLibrary.subtitle': 'Upload and manage media for tour steps',\n 'mediaLibrary.uploadMedia': 'Upload Media',\n 'mediaLibrary.purpose':\n 'Store and organise the images, videos, audio, and documents you attach to tour steps. Upload an asset here once, then reference it from any step — handy for product screenshots, short demo clips, or callout graphics that make a walkthrough clearer.',\n 'mediaLibrary.searchPlaceholder': 'Search media...',\n 'mediaLibrary.filterByType': 'Filter by media type',\n 'mediaLibrary.allTypes': 'All Types',\n 'mediaLibrary.typeImages': 'Images',\n 'mediaLibrary.typeVideos': 'Videos',\n 'mediaLibrary.typeAudio': 'Audio',\n 'mediaLibrary.typeDocuments': 'Documents',\n 'mediaLibrary.uploading': 'Uploading...',\n 'mediaLibrary.deleteConfirm': 'Delete this media?',\n 'mediaLibrary.delete': 'Delete',\n 'mediaLibrary.noMedia': 'No media files',\n 'mediaLibrary.uploadFirstMedia': 'Upload your first media file to get started',\n\n // Markdown editor (BOFF-7116)\n 'markdownEditor.bold': 'Bold',\n 'markdownEditor.italic': 'Italic',\n 'markdownEditor.link': 'Link',\n 'markdownEditor.inlineCode': 'Inline code',\n 'markdownEditor.bulletList': 'Bullet list',\n 'markdownEditor.linkTextPlaceholder': 'link text',\n 'markdownEditor.writeTab': 'Write',\n 'markdownEditor.previewTab': 'Preview',\n 'markdownEditor.nothingToPreview': 'Nothing to preview',\n 'markdownEditor.tabsAriaLabel': 'Markdown editor tabs',\n\n // Tours shell / nav (BOFF-7116)\n 'toursNav.allTours': 'All Tours',\n 'toursNav.createTour': 'Create Tour',\n 'toursNav.templates': 'Templates',\n 'toursNav.analytics': 'Analytics',\n 'toursNav.mediaLibrary': 'Media Library',\n\n 'toursShell.productToursReady': 'Product Tours Ready',\n 'toursShell.moduleError': 'Something went wrong loading this module. Please refresh the page.',\n\n // Route-level errors (BOFF-7116)\n 'routeErrors.failedToLoadPage': 'Failed to load page',\n 'routeErrors.chunkLoadRetry':\n 'The page chunk could not be loaded. This may be due to a network issue.',\n 'routeErrors.chunkLoadRefresh':\n 'The page chunk could not be loaded after multiple attempts. Please refresh the page.',\n 'routeErrors.tryAgain': 'Try Again',\n 'routeErrors.refreshPage': 'Refresh Page',\n\n // Feature disabled fallback (BOFF-7116)\n 'featureDisabled.title': 'Feature Not Available',\n 'featureDisabled.description':\n 'This feature is not currently enabled. Redirecting you to the tours list…',\n\n // User tours unavailable fallback (BOFF-7116)\n 'userTours.unavailable': 'Tours are not available for this workspace right now.',\n\n // Device type labels (BOFF-7116)\n 'deviceType.mobile': 'Mobile',\n 'deviceType.tablet': 'Tablet',\n 'deviceType.desktop': 'Desktop',\n\n // Common unit labels (BOFF-7116)\n 'common.fileSize.bytes': 'Bytes',\n 'common.fileSize.kb': 'KB',\n 'common.fileSize.mb': 'MB',\n 'common.fileSize.gb': 'GB',\n 'common.duration.seconds': 's',\n 'common.duration.minutes': 'm',\n 'common.duration.hours': 'h',\n\n // Validation messages returned by the store and rendered by the builder (BOFF-7116)\n 'validation.noTourSelected': 'No tour selected',\n 'validation.tourNameRequired': 'Tour name is required',\n 'validation.productIdRequired': 'Product ID is required',\n 'validation.stepsRequired': 'At least one step is required',\n 'validation.stepTitleRequired': 'Step {{number}} title is required',\n 'validation.stepContentRequired': 'Step {{number}} content is required',\n 'validation.stepSelectorRequired': 'Step {{number}} selector is required',\n\n // Tours list async error (BOFF-7116)\n 'toursList.errorFetch': 'Failed to fetch tours',\n\n // Analytics dashboard labels still needed after first pass (BOFF-7116)\n 'analyticsDashboard.deviceViews': 'views',\n} as const;\n\nexport type ToursTranslationKey = keyof typeof toursTranslationFallbacks;\n\ntype TranslationParams = Record<string, string | number>;\n\nexport function useToursI18n() {\n const i18n = useI18n();\n // The installed fe-libs typings still expose the older 2-argument shape, but the\n // runtime provider supports fallback strings. Narrow locally so this MFE can rely\n // on fallback-backed translations without changing the shared package here.\n const translateWithFallback = i18n.t as (key: string, fallback?: string) => string;\n\n const tr = useCallback(\n (\n key: ToursTranslationKey,\n fallbackOrParams?: string | TranslationParams,\n params?: TranslationParams\n ): string => {\n const fallbackString =\n typeof fallbackOrParams === 'string'\n ? fallbackOrParams\n : (toursTranslationFallbacks[key] as string | undefined);\n const interpolationParams = typeof fallbackOrParams === 'object' ? fallbackOrParams : params;\n\n const resolved = translateWithFallback(key, fallbackString);\n\n if (!interpolationParams) {\n return resolved;\n }\n\n return Object.entries(interpolationParams).reduce(\n (value, [paramKey, paramValue]) =>\n value.replace(new RegExp(`\\\\{\\\\{${paramKey}\\\\}\\\\}`, 'g'), String(paramValue)),\n resolved\n );\n },\n [translateWithFallback]\n );\n\n return {\n ...i18n,\n tr,\n };\n}\n\n/**\n * `useTr` — VibeControls-style translation hook with inline English fallback.\n *\n * Wraps the MFE's typed `useToursI18n()` so call sites can keep a readable\n * fallback string next to the key, matching the pattern used by\n * `microfe-vibecontrols/src/shared/hooks/useTr.ts`.\n *\n * @example\n * const tr = useTr();\n * return <h1>{tr('toursList.title', 'Product Tours')}</h1>;\n * return <p>{tr('toursList.selectedCount', '{{count}} tours selected', { count: 5 })}</p>;\n */\nexport function useTr(): (key: string, fallback: string, params?: TranslationParams) => string {\n const { tr } = useToursI18n();\n return useCallback(\n (key: string, fallback: string, params?: TranslationParams): string =>\n tr(key as ToursTranslationKey, fallback, params),\n [tr]\n );\n}\n\nexport function getToursTranslationFallback(key: ToursTranslationKey) {\n return toursTranslationFallbacks[key];\n}\n"],"mappings":";;;AAGA,IAAM,IAA4B;CAChC,2BAA2B;CAC3B,sBAAsB;CACtB,2BAA2B;CAC3B,yBAAyB;CACzB,sBAAsB;CACtB,iCAAiC;CACjC,8BAA8B;CAC9B,0BAA0B;CAC1B,qCAAqC;CACrC,2BAA2B;CAC3B,yBAAyB;CACzB,8BAA8B;CAC9B,iCAAiC;CACjC,sCAAsC;CACtC,uBAAuB;CACvB,qBAAqB;CACrB,gCAAgC;CAChC,6BAA6B;CAC7B,6BAA6B;CAC7B,yBAAyB;CACzB,iBAAiB;CACjB,uBAAuB;CACvB,4BAA4B;C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E;CACF,gCACE;CACF,wBAAwB;CACxB,2BAA2B;CAG3B,yBAAyB;CACzB,+BACE;CAGF,yBAAyB;CAGzB,qBAAqB;CACrB,qBAAqB;CACrB,sBAAsB;CAGtB,yBAAyB;CACzB,sBAAsB;CACtB,sBAAsB;CACtB,sBAAsB;CACtB,2BAA2B;CAC3B,2BAA2B;CAC3B,yBAAyB;CAGzB,6BAA6B;CAC7B,+BAA+B;CAC/B,gCAAgC;CAChC,4BAA4B;CAC5B,gCAAgC;CAChC,kCAAkC;CAClC,mCAAmC;CAGnC,wBAAwB;CAGxB,kCAAkC;CACnC;AAMD,SAAgB,IAAe;CAC7B,IAAM,IAAO,GAAS,EAIhB,IAAwB,EAAK,GAE7B,IAAK,GAEP,GACA,GACA,MACW;EACX,IAAM,IACJ,OAAO,KAAqB,WACxB,IACC,EAA0B,IAC3B,IAAsB,OAAO,KAAqB,WAAW,IAAmB,GAEhF,IAAW,EAAsB,GAAK,EAAe;AAM3D,SAJK,IAIE,OAAO,QAAQ,EAAoB,CAAC,QACxC,GAAO,CAAC,GAAU,OACjB,EAAM,QAAY,OAAO,SAAS,EAAS,SAAS,IAAI,EAAE,OAAO,EAAW,CAAC,EAC/E,EACD,GAPQ;IASX,CAAC,EAAsB,CACxB;AAED,QAAO;EACL,GAAG;EACH;EACD;;AAeH,SAAgB,IAA+E;CAC7F,IAAM,EAAE,UAAO,GAAc;AAC7B,QAAO,GACJ,GAAa,GAAkB,MAC9B,EAAG,GAA4B,GAAU,EAAO,EAClD,CAAC,EAAG,CACL"}
|
|
@@ -17,9 +17,9 @@ function S(e, t) {
|
|
|
17
17
|
return e && b.test(e) ? e : t;
|
|
18
18
|
}
|
|
19
19
|
function C() {
|
|
20
|
-
let { tr: o } = e(), { productId: s, moduleId: c, pageId: l, workspaceId: y } = t(), [
|
|
20
|
+
let { tr: o } = e(), { productId: s, moduleId: c, pageId: l, workspaceId: y, currentUser: b } = t(), [C] = f(), T = v(), E = i(!1);
|
|
21
21
|
r(() => {
|
|
22
|
-
|
|
22
|
+
E.current || (E.current = !0, T.emit("tours.page.viewed", {
|
|
23
23
|
page: "/tours",
|
|
24
24
|
productId: s,
|
|
25
25
|
moduleId: c,
|
|
@@ -27,21 +27,27 @@ function C() {
|
|
|
27
27
|
workspaceId: y
|
|
28
28
|
}));
|
|
29
29
|
}, [
|
|
30
|
-
|
|
30
|
+
T,
|
|
31
31
|
s,
|
|
32
32
|
c,
|
|
33
33
|
l,
|
|
34
34
|
y
|
|
35
35
|
]);
|
|
36
|
-
let
|
|
37
|
-
variables:
|
|
38
|
-
productId:
|
|
39
|
-
moduleId:
|
|
40
|
-
pageId:
|
|
36
|
+
let D = x(s, void 0) ?? x(C.get("productId"), void 0), O = x(c, void 0) ?? x(C.get("moduleId"), void 0), k = S(l, void 0) ?? S(C.get("pageId"), void 0), { data: A, loading: j, error: M, refetch: N } = n({
|
|
37
|
+
variables: D ? { context: {
|
|
38
|
+
productId: D,
|
|
39
|
+
moduleId: O,
|
|
40
|
+
pageId: k,
|
|
41
|
+
workspaceId: y
|
|
41
42
|
} } : void 0,
|
|
42
|
-
skip: !
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
skip: !D || !b?.id,
|
|
44
|
+
context: {
|
|
45
|
+
requiredWorkspaceAuth: !!y,
|
|
46
|
+
requiredWorkspaceId: y,
|
|
47
|
+
queryDeduplication: !1
|
|
48
|
+
},
|
|
49
|
+
fetchPolicy: "no-cache"
|
|
50
|
+
}), P = j || M || !b?.id || !D ? [] : A?.toursForContext ?? [], F = j, I = P.find((e) => e.myProgress?.status === "IN_PROGRESS") ?? P.find((e) => !e.myProgress?.status || e.myProgress.status !== "COMPLETED" && e.myProgress.status !== "SKIPPED" && e.myProgress.status !== "DISMISSED"), L = P.filter((e) => e.id !== I?.id);
|
|
45
51
|
return /* @__PURE__ */ d("div", {
|
|
46
52
|
className: "space-y-4 sm:space-y-6 p-3 sm:p-6",
|
|
47
53
|
children: [
|
|
@@ -53,33 +59,42 @@ function C() {
|
|
|
53
59
|
children: o("myTours.subtitle")
|
|
54
60
|
})] }),
|
|
55
61
|
/* @__PURE__ */ u(_, { children: o("myTours.purpose") }),
|
|
56
|
-
M
|
|
62
|
+
M ? /* @__PURE__ */ d("div", {
|
|
63
|
+
role: "alert",
|
|
64
|
+
className: "space-y-3 text-sm text-text-secondary",
|
|
65
|
+
children: [/* @__PURE__ */ u("p", { children: o("userTours.loadError") }), /* @__PURE__ */ u("button", {
|
|
66
|
+
type: "button",
|
|
67
|
+
onClick: () => void N().catch(() => void 0),
|
|
68
|
+
className: "px-4 py-2 rounded-md bg-action-primary-bg text-action-primary-text",
|
|
69
|
+
children: o("routeErrors.tryAgain")
|
|
70
|
+
})]
|
|
71
|
+
}) : F ? /* @__PURE__ */ u("output", {
|
|
57
72
|
className: "text-sm text-text-secondary",
|
|
58
73
|
children: o("myTours.loading")
|
|
59
|
-
}) :
|
|
74
|
+
}) : P.length === 0 ? /* @__PURE__ */ u(g, {
|
|
60
75
|
illustration: "empty-generic",
|
|
61
76
|
title: o("myTours.empty")
|
|
62
77
|
}) : /* @__PURE__ */ d("div", {
|
|
63
78
|
className: "space-y-4 sm:space-y-6",
|
|
64
|
-
children: [
|
|
79
|
+
children: [I ? /* @__PURE__ */ d(p, {
|
|
65
80
|
className: "p-4 sm:p-5",
|
|
66
81
|
children: [/* @__PURE__ */ d("div", {
|
|
67
82
|
className: "flex items-start justify-between gap-3",
|
|
68
83
|
children: [/* @__PURE__ */ u("h2", {
|
|
69
84
|
className: "text-lg font-semibold text-text-primary line-clamp-2",
|
|
70
|
-
children:
|
|
85
|
+
children: I.name
|
|
71
86
|
}), /* @__PURE__ */ u(w, {
|
|
72
|
-
status:
|
|
87
|
+
status: I.myProgress?.status,
|
|
73
88
|
tr: o
|
|
74
89
|
})]
|
|
75
|
-
}),
|
|
90
|
+
}), I.description ? /* @__PURE__ */ u(a, {
|
|
76
91
|
inline: !0,
|
|
77
92
|
className: "mt-2 text-sm text-text-secondary line-clamp-3",
|
|
78
|
-
children:
|
|
93
|
+
children: I.description
|
|
79
94
|
}) : null]
|
|
80
|
-
}) : null,
|
|
95
|
+
}) : null, L.length > 0 ? /* @__PURE__ */ u("ul", {
|
|
81
96
|
className: "grid gap-3 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",
|
|
82
|
-
children:
|
|
97
|
+
children: L.map((e) => /* @__PURE__ */ u("li", { children: /* @__PURE__ */ d(m, {
|
|
83
98
|
treatment: "plain",
|
|
84
99
|
className: "h-full p-4 flex flex-col gap-2 border-border-seam shadow-[var(--shadow-pop)]",
|
|
85
100
|
children: [/* @__PURE__ */ d("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MyToursPage.js","names":[],"sources":["../../../src/tours/pages/MyToursPage.tsx"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport { useSearchParams } from 'react-router';\nimport { CheckCircle2, Circle, MinusCircle, Play } from 'lucide-react';\nimport {\n useGetToursForContextQuery,\n type GetToursForContextQuery,\n} from '../../generated/global-operations';\nimport { useToursContext } from '../providers/ToursProvider';\nimport { useToursI18n, type ToursTranslationKey } from '../i18n';\nimport { Markdown } from '@burdenoff/fe-libs/shared/components';\nimport { useEventBus } from '@burdenoff/fe-libs/shared/events';\nimport {\n EmphasisPanel,\n GlassCard,\n GradientText,\n IllustratedEmptyState,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\n\ntype TourSummary = GetToursForContextQuery['toursForContext'][number];\n\n// Plain slug validator for productId and moduleId.\nconst SLUG_PATTERN = /^[a-zA-Z0-9_-]+$/;\n\n// pageId is documented with path-style values like \"settings/team\" per\n// ToursRootProps — tighten to URL-safe characters only, but permit `/`.\nconst PAGE_PATH_PATTERN = /^[a-zA-Z0-9_\\-/]+$/;\n\nfunction safeSlug<T extends string | undefined>(\n raw: string | null | undefined,\n fallback: T\n): string | T {\n if (raw && SLUG_PATTERN.test(raw)) return raw;\n return fallback;\n}\n\nfunction safePageId<T extends string | undefined>(\n raw: string | null | undefined,\n fallback: T\n): string | T {\n if (raw && PAGE_PATH_PATTERN.test(raw)) return raw;\n return fallback;\n}\n\n/**\n * MyToursPage — user-facing browse for available tours.\n *\n * Lists tours returned by `toursForContext` (filtered to the current\n * product/module/page surface) and decorates each with the requesting\n * user's `TourUserProgress` status (Completed / In progress / Skipped /\n * Not started). Read-only — tours are actually played via the SDK overlay,\n * not via mutations on this page.\n */\nexport function MyToursPage() {\n const { tr } = useToursI18n();\n const {\n productId: shellProductId,\n moduleId: shellModuleId,\n pageId: shellPageId,\n workspaceId,\n } = useToursContext();\n const [searchParams] = useSearchParams();\n const eventBus = useEventBus();\n\n // Emit page view event exactly once per mount. A ref guard keeps the effect\n // semantically mount-only while satisfying exhaustive-deps with the real\n // dependency list, so we don't have to disable the lint rule.\n const pageViewedRef = useRef(false);\n useEffect(() => {\n if (pageViewedRef.current) return;\n pageViewedRef.current = true;\n eventBus.emit('tours.page.viewed', {\n page: '/tours',\n productId: shellProductId,\n moduleId: shellModuleId,\n pageId: shellPageId,\n workspaceId,\n });\n }, [eventBus, shellProductId, shellModuleId, shellPageId, workspaceId]);\n\n // Preferred source is the shell's productId prop (the host app knows\n // which product it is — \"workspaces\", \"vibecontrols\", \"bigconsole\", etc.).\n // Fall back to a query-param override for deep-link scenarios, but only\n // after passing a plain-slug validator so we never forward arbitrary\n // strings into the GraphQL variables. No hardcoded product default —\n // if neither source provides one, skip the query entirely so non-\n // workspaces integrations don't get workspaces tours.\n const productId =\n safeSlug(shellProductId, undefined) ?? safeSlug(searchParams.get('productId'), undefined);\n const moduleId =\n safeSlug(shellModuleId, undefined) ?? safeSlug(searchParams.get('moduleId'), undefined);\n const pageId =\n safePageId(shellPageId, undefined) ?? safePageId(searchParams.get('pageId'), undefined);\n\n const { data: toursData, loading: toursLoading } = useGetToursForContextQuery({\n variables: productId ? { context: { productId, moduleId, pageId } } : undefined,\n skip: !productId,\n fetchPolicy: 'cache-and-network',\n });\n\n const tours = toursData?.toursForContext ?? [];\n const isLoading = toursLoading;\n\n // Surface a single, clearly-emphasised \"pick up where you left off / start\n // here\" tour: prefer one already in progress, then the first not-yet-started\n // tour, so a new user always has one obvious next walkthrough to take.\n const featuredTour =\n tours.find((tour: TourSummary) => tour.myProgress?.status === 'IN_PROGRESS') ??\n tours.find(\n (tour: TourSummary) =>\n !tour.myProgress?.status ||\n (tour.myProgress.status !== 'COMPLETED' &&\n tour.myProgress.status !== 'SKIPPED' &&\n tour.myProgress.status !== 'DISMISSED')\n );\n const restTours = tours.filter((tour: TourSummary) => tour.id !== featuredTour?.id);\n\n return (\n <div className=\"space-y-4 sm:space-y-6 p-3 sm:p-6\">\n <div>\n <h1 className=\"text-xl sm:text-2xl font-bold text-text-primary\">\n <GradientText>{tr('myTours.title')}</GradientText>\n </h1>\n <p className=\"text-sm sm:text-base text-text-secondary\">{tr('myTours.subtitle')}</p>\n </div>\n\n <PagePurpose>{tr('myTours.purpose')}</PagePurpose>\n\n {isLoading && tours.length === 0 ? (\n <output className=\"text-sm text-text-secondary\">{tr('myTours.loading')}</output>\n ) : tours.length === 0 ? (\n <IllustratedEmptyState illustration=\"empty-generic\" title={tr('myTours.empty')} />\n ) : (\n <div className=\"space-y-4 sm:space-y-6\">\n {/* Featured \"start here\" tour — the single emphasis zone on this page. */}\n {featuredTour ? (\n <EmphasisPanel className=\"p-4 sm:p-5\">\n <div className=\"flex items-start justify-between gap-3\">\n <h2 className=\"text-lg font-semibold text-text-primary line-clamp-2\">\n {featuredTour.name}\n </h2>\n <ProgressBadge status={featuredTour.myProgress?.status} tr={tr} />\n </div>\n {featuredTour.description ? (\n <Markdown inline className=\"mt-2 text-sm text-text-secondary line-clamp-3\">\n {featuredTour.description}\n </Markdown>\n ) : null}\n </EmphasisPanel>\n ) : null}\n\n {restTours.length > 0 ? (\n <ul className=\"grid gap-3 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3\">\n {restTours.map((tour: TourSummary) => (\n <li key={tour.id}>\n <GlassCard\n treatment=\"plain\"\n className=\"h-full p-4 flex flex-col gap-2 border-border-seam shadow-[var(--shadow-pop)]\"\n >\n <div className=\"flex items-start justify-between gap-2\">\n <h2 className=\"font-semibold text-text-primary line-clamp-2\">{tour.name}</h2>\n <ProgressBadge status={tour.myProgress?.status} tr={tr} />\n </div>\n {tour.description ? (\n <Markdown inline className=\"text-sm text-text-secondary line-clamp-3\">\n {tour.description}\n </Markdown>\n ) : null}\n </GlassCard>\n </li>\n ))}\n </ul>\n ) : null}\n </div>\n )}\n </div>\n );\n}\n\nfunction ProgressBadge({\n status,\n tr,\n}: {\n status: string | undefined;\n tr: (key: ToursTranslationKey) => string;\n}) {\n switch (status) {\n case 'COMPLETED':\n return (\n <span className=\"inline-flex items-center gap-1 text-xs text-success\">\n <CheckCircle2 size={14} />\n {tr('myTours.status.completed')}\n </span>\n );\n case 'IN_PROGRESS':\n return (\n <span className=\"inline-flex items-center gap-1 text-xs text-warning motion-safe:animate-vc-glow-pulse\">\n <Play size={14} />\n {tr('myTours.status.inProgress')}\n </span>\n );\n case 'SKIPPED':\n case 'DISMISSED':\n return (\n <span className=\"inline-flex items-center gap-1 text-xs text-text-secondary\">\n <MinusCircle size={14} />\n {tr('myTours.status.skipped')}\n </span>\n );\n default:\n return (\n <span className=\"inline-flex items-center gap-1 text-xs text-text-secondary\">\n <Circle size={14} />\n {tr('myTours.status.notStarted')}\n </span>\n );\n }\n}\n"],"mappings":";;;;;;;;;;;AAsBA,IAAM,IAAe,oBAIf,IAAoB;AAE1B,SAAS,EACP,GACA,GACY;AAEZ,QADI,KAAO,EAAa,KAAK,EAAI,GAAS,IACnC;;AAGT,SAAS,EACP,GACA,GACY;AAEZ,QADI,KAAO,EAAkB,KAAK,EAAI,GAAS,IACxC;;AAYT,SAAgB,IAAc;CAC5B,IAAM,EAAE,UAAO,GAAc,EACvB,EACJ,WAAW,GACX,UAAU,GACV,QAAQ,GACR,mBACE,GAAiB,EACf,CAAC,KAAgB,GAAiB,EAClC,IAAW,GAAa,EAKxB,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BAA4B,CAC3B;;EAEX,KAAK;EACL,KAAK,YACH,QACE,kBAAC,QAAD;GAAM,WAAU;aAAhB,CACE,kBAAC,GAAD,EAAa,MAAM,IAAM,CAAA,EACxB,EAAG,yBAAyB,CACxB;;EAEX,QACE,QACE,kBAAC,QAAD;GAAM,WAAU;aAAhB,CACE,kBAAC,GAAD,EAAQ,MAAM,IAAM,CAAA,EACnB,EAAG,4BAA4B,CAC3B"}
|
|
1
|
+
{"version":3,"file":"MyToursPage.js","names":[],"sources":["../../../src/tours/pages/MyToursPage.tsx"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport { useSearchParams } from 'react-router';\nimport { CheckCircle2, Circle, MinusCircle, Play } from 'lucide-react';\nimport {\n useGetToursForContextQuery,\n type GetToursForContextQuery,\n} from '../../generated/global-operations';\nimport { useToursContext } from '../providers/ToursProvider';\nimport { useToursI18n, type ToursTranslationKey } from '../i18n';\nimport { Markdown } from '@burdenoff/fe-libs/shared/components';\nimport { useEventBus } from '@burdenoff/fe-libs/shared/events';\nimport {\n EmphasisPanel,\n GlassCard,\n GradientText,\n IllustratedEmptyState,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\n\ntype TourSummary = GetToursForContextQuery['toursForContext'][number];\n\n// Plain slug validator for productId and moduleId.\nconst SLUG_PATTERN = /^[a-zA-Z0-9_-]+$/;\n\n// pageId is documented with path-style values like \"settings/team\" per\n// ToursRootProps — tighten to URL-safe characters only, but permit `/`.\nconst PAGE_PATH_PATTERN = /^[a-zA-Z0-9_\\-/]+$/;\n\nfunction safeSlug<T extends string | undefined>(\n raw: string | null | undefined,\n fallback: T\n): string | T {\n if (raw && SLUG_PATTERN.test(raw)) return raw;\n return fallback;\n}\n\nfunction safePageId<T extends string | undefined>(\n raw: string | null | undefined,\n fallback: T\n): string | T {\n if (raw && PAGE_PATH_PATTERN.test(raw)) return raw;\n return fallback;\n}\n\n/**\n * MyToursPage — user-facing browse for available tours.\n *\n * Lists tours returned by `toursForContext` (filtered to the current\n * product/module/page surface) and decorates each with the requesting\n * user's `TourUserProgress` status (Completed / In progress / Skipped /\n * Not started). Read-only — tours are actually played via the SDK overlay,\n * not via mutations on this page.\n */\nexport function MyToursPage() {\n const { tr } = useToursI18n();\n const {\n productId: shellProductId,\n moduleId: shellModuleId,\n pageId: shellPageId,\n workspaceId,\n currentUser,\n } = useToursContext();\n const [searchParams] = useSearchParams();\n const eventBus = useEventBus();\n\n // Emit page view event exactly once per mount. A ref guard keeps the effect\n // semantically mount-only while satisfying exhaustive-deps with the real\n // dependency list, so we don't have to disable the lint rule.\n const pageViewedRef = useRef(false);\n useEffect(() => {\n if (pageViewedRef.current) return;\n pageViewedRef.current = true;\n eventBus.emit('tours.page.viewed', {\n page: '/tours',\n productId: shellProductId,\n moduleId: shellModuleId,\n pageId: shellPageId,\n workspaceId,\n });\n }, [eventBus, shellProductId, shellModuleId, shellPageId, workspaceId]);\n\n // Preferred source is the shell's productId prop (the host app knows\n // which product it is — \"workspaces\", \"vibecontrols\", \"bigconsole\", etc.).\n // Fall back to a query-param override for deep-link scenarios, but only\n // after passing a plain-slug validator so we never forward arbitrary\n // strings into the GraphQL variables. No hardcoded product default —\n // if neither source provides one, skip the query entirely so non-\n // workspaces integrations don't get workspaces tours.\n const productId =\n safeSlug(shellProductId, undefined) ?? safeSlug(searchParams.get('productId'), undefined);\n const moduleId =\n safeSlug(shellModuleId, undefined) ?? safeSlug(searchParams.get('moduleId'), undefined);\n const pageId =\n safePageId(shellPageId, undefined) ?? safePageId(searchParams.get('pageId'), undefined);\n\n const {\n data: toursData,\n loading: toursLoading,\n error,\n refetch,\n } = useGetToursForContextQuery({\n variables: productId ? { context: { productId, moduleId, pageId, workspaceId } } : undefined,\n skip: !productId || !currentUser?.id,\n context: {\n requiredWorkspaceAuth: Boolean(workspaceId),\n requiredWorkspaceId: workspaceId,\n queryDeduplication: false,\n },\n fetchPolicy: 'no-cache',\n });\n\n // A pending scope change or failed request must never present old progress.\n const tours =\n toursLoading || error || !currentUser?.id || !productId\n ? []\n : (toursData?.toursForContext ?? []);\n const isLoading = toursLoading;\n\n // Surface a single, clearly-emphasised \"pick up where you left off / start\n // here\" tour: prefer one already in progress, then the first not-yet-started\n // tour, so a new user always has one obvious next walkthrough to take.\n const featuredTour =\n tours.find((tour: TourSummary) => tour.myProgress?.status === 'IN_PROGRESS') ??\n tours.find(\n (tour: TourSummary) =>\n !tour.myProgress?.status ||\n (tour.myProgress.status !== 'COMPLETED' &&\n tour.myProgress.status !== 'SKIPPED' &&\n tour.myProgress.status !== 'DISMISSED')\n );\n const restTours = tours.filter((tour: TourSummary) => tour.id !== featuredTour?.id);\n\n return (\n <div className=\"space-y-4 sm:space-y-6 p-3 sm:p-6\">\n <div>\n <h1 className=\"text-xl sm:text-2xl font-bold text-text-primary\">\n <GradientText>{tr('myTours.title')}</GradientText>\n </h1>\n <p className=\"text-sm sm:text-base text-text-secondary\">{tr('myTours.subtitle')}</p>\n </div>\n\n <PagePurpose>{tr('myTours.purpose')}</PagePurpose>\n\n {error ? (\n <div role=\"alert\" className=\"space-y-3 text-sm text-text-secondary\">\n <p>{tr('userTours.loadError')}</p>\n <button\n type=\"button\"\n onClick={() => void refetch().catch(() => undefined)}\n className=\"px-4 py-2 rounded-md bg-action-primary-bg text-action-primary-text\"\n >\n {tr('routeErrors.tryAgain')}\n </button>\n </div>\n ) : isLoading ? (\n <output className=\"text-sm text-text-secondary\">{tr('myTours.loading')}</output>\n ) : tours.length === 0 ? (\n <IllustratedEmptyState illustration=\"empty-generic\" title={tr('myTours.empty')} />\n ) : (\n <div className=\"space-y-4 sm:space-y-6\">\n {/* Featured \"start here\" tour — the single emphasis zone on this page. */}\n {featuredTour ? (\n <EmphasisPanel className=\"p-4 sm:p-5\">\n <div className=\"flex items-start justify-between gap-3\">\n <h2 className=\"text-lg font-semibold text-text-primary line-clamp-2\">\n {featuredTour.name}\n </h2>\n <ProgressBadge status={featuredTour.myProgress?.status} tr={tr} />\n </div>\n {featuredTour.description ? (\n <Markdown inline className=\"mt-2 text-sm text-text-secondary line-clamp-3\">\n {featuredTour.description}\n </Markdown>\n ) : null}\n </EmphasisPanel>\n ) : null}\n\n {restTours.length > 0 ? (\n <ul className=\"grid gap-3 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3\">\n {restTours.map((tour: TourSummary) => (\n <li key={tour.id}>\n <GlassCard\n treatment=\"plain\"\n className=\"h-full p-4 flex flex-col gap-2 border-border-seam shadow-[var(--shadow-pop)]\"\n >\n <div className=\"flex items-start justify-between gap-2\">\n <h2 className=\"font-semibold text-text-primary line-clamp-2\">{tour.name}</h2>\n <ProgressBadge status={tour.myProgress?.status} tr={tr} />\n </div>\n {tour.description ? (\n <Markdown inline className=\"text-sm text-text-secondary line-clamp-3\">\n {tour.description}\n </Markdown>\n ) : null}\n </GlassCard>\n </li>\n ))}\n </ul>\n ) : null}\n </div>\n )}\n </div>\n );\n}\n\nfunction ProgressBadge({\n status,\n tr,\n}: {\n status: string | undefined;\n tr: (key: ToursTranslationKey) => string;\n}) {\n switch (status) {\n case 'COMPLETED':\n return (\n <span className=\"inline-flex items-center gap-1 text-xs text-success\">\n <CheckCircle2 size={14} />\n {tr('myTours.status.completed')}\n </span>\n );\n case 'IN_PROGRESS':\n return (\n <span className=\"inline-flex items-center gap-1 text-xs text-warning motion-safe:animate-vc-glow-pulse\">\n <Play size={14} />\n {tr('myTours.status.inProgress')}\n </span>\n );\n case 'SKIPPED':\n case 'DISMISSED':\n return (\n <span className=\"inline-flex items-center gap-1 text-xs text-text-secondary\">\n <MinusCircle size={14} />\n {tr('myTours.status.skipped')}\n </span>\n );\n default:\n return (\n <span className=\"inline-flex items-center gap-1 text-xs text-text-secondary\">\n <Circle size={14} />\n {tr('myTours.status.notStarted')}\n </span>\n );\n }\n}\n"],"mappings":";;;;;;;;;;;AAsBA,IAAM,IAAe,oBAIf,IAAoB;AAE1B,SAAS,EACP,GACA,GACY;AAEZ,QADI,KAAO,EAAa,KAAK,EAAI,GAAS,IACnC;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V,WAAU;gBAFZ,CAIE,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,kBAAC,MAAD;QAAI,WAAU;kBAAgD,EAAK;QAAU,CAAA,EAC7E,kBAAC,GAAD;QAAe,QAAQ,EAAK,YAAY;QAAY;QAAM,CAAA,CACtD;UACL,EAAK,cACJ,kBAAC,GAAD;OAAU,QAAA;OAAO,WAAU;iBACxB,EAAK;OACG,CAAA,GACT,KACM;SACT,EAfI,EAAK,GAeT,CACL;KACC,CAAA,GACH,KACA;;GAEJ;;;AAIV,SAAS,EAAc,EACrB,WACA,SAIC;AACD,SAAQ,GAAR;EACE,KAAK,YACH,QACE,kBAAC,QAAD;GAAM,WAAU;aAAhB,CACE,kBAAC,GAAD,EAAc,MAAM,IAAM,CAAA,EACzB,EAAG,2BAA2B,CAC1B;;EAEX,KAAK,cACH,QACE,kBAAC,QAAD;GAAM,WAAU;aAAhB,CACE,kBAAC,GAAD,EAAM,MAAM,IAAM,CAAA,EACjB,EAAG,4BAA4B,CAC3B;;EAEX,KAAK;EACL,KAAK,YACH,QACE,kBAAC,QAAD;GAAM,WAAU;aAAhB,CACE,kBAAC,GAAD,EAAa,MAAM,IAAM,CAAA,EACxB,EAAG,yBAAyB,CACxB;;EAEX,QACE,QACE,kBAAC,QAAD;GAAM,WAAU;aAAhB,CACE,kBAAC,GAAD,EAAQ,MAAM,IAAM,CAAA,EACnB,EAAG,4BAA4B,CAC3B"}
|
|
@@ -24,7 +24,7 @@ function g() {
|
|
|
24
24
|
x,
|
|
25
25
|
S
|
|
26
26
|
]);
|
|
27
|
-
let { data: T, loading: E } = n({
|
|
27
|
+
let { data: T, loading: E, error: D, refetch: O } = n({
|
|
28
28
|
variables: {
|
|
29
29
|
userId: v?.id,
|
|
30
30
|
pagination: {
|
|
@@ -33,22 +33,30 @@ function g() {
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
skip: !v?.id,
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
context: {
|
|
37
|
+
requiredWorkspaceAuth: !!S,
|
|
38
|
+
requiredWorkspaceId: S,
|
|
39
|
+
queryDeduplication: !1
|
|
40
|
+
},
|
|
41
|
+
fetchPolicy: "no-cache"
|
|
42
|
+
}), k = i(() => {
|
|
38
43
|
let e = {
|
|
39
44
|
IN_PROGRESS: [],
|
|
40
45
|
COMPLETED: [],
|
|
41
46
|
SKIPPED: [],
|
|
42
47
|
OTHER: []
|
|
43
|
-
}, t = (T?.userTourProgresses ?? []).filter((e) => !(y && e.tour.productId !== y || b && e.tour.moduleId && e.tour.moduleId !== b || x && e.tour.pageId && e.tour.pageId !== x));
|
|
48
|
+
}, t = (E || D || !v?.id ? [] : T?.userTourProgresses ?? []).filter((e) => !(y && e.tour.productId !== y || b && e.tour.moduleId && e.tour.moduleId !== b || x && e.tour.pageId && e.tour.pageId !== x));
|
|
44
49
|
for (let n of t) n.status === "COMPLETED" ? e.COMPLETED.push(n) : n.status === "IN_PROGRESS" ? e.IN_PROGRESS.push(n) : n.status === "SKIPPED" || n.status === "DISMISSED" ? e.SKIPPED.push(n) : e.OTHER.push(n);
|
|
45
50
|
return e;
|
|
46
51
|
}, [
|
|
47
52
|
T,
|
|
53
|
+
E,
|
|
54
|
+
D,
|
|
55
|
+
v?.id,
|
|
48
56
|
y,
|
|
49
57
|
b,
|
|
50
58
|
x
|
|
51
|
-
]),
|
|
59
|
+
]), A = k.IN_PROGRESS.length + k.COMPLETED.length + k.SKIPPED.length + k.OTHER.length;
|
|
52
60
|
return /* @__PURE__ */ d("div", {
|
|
53
61
|
className: "space-y-4 sm:space-y-6 p-3 sm:p-6",
|
|
54
62
|
children: [
|
|
@@ -60,10 +68,19 @@ function g() {
|
|
|
60
68
|
children: g("myToursProgress.subtitle")
|
|
61
69
|
})] }),
|
|
62
70
|
/* @__PURE__ */ u(m, { children: g("myToursProgress.purpose") }),
|
|
63
|
-
|
|
71
|
+
D ? /* @__PURE__ */ d("div", {
|
|
72
|
+
role: "alert",
|
|
73
|
+
className: "space-y-3 text-sm text-text-secondary",
|
|
74
|
+
children: [/* @__PURE__ */ u("p", { children: g("userTours.loadError") }), /* @__PURE__ */ u("button", {
|
|
75
|
+
type: "button",
|
|
76
|
+
onClick: () => void O().catch(() => void 0),
|
|
77
|
+
className: "px-4 py-2 rounded-md bg-action-primary-bg text-action-primary-text",
|
|
78
|
+
children: g("routeErrors.tryAgain")
|
|
79
|
+
})]
|
|
80
|
+
}) : E ? /* @__PURE__ */ u("output", {
|
|
64
81
|
className: "text-sm text-text-secondary",
|
|
65
82
|
children: g("myToursProgress.loading")
|
|
66
|
-
}) :
|
|
83
|
+
}) : A === 0 ? /* @__PURE__ */ u(p, {
|
|
67
84
|
illustration: "empty-data",
|
|
68
85
|
title: g("myToursProgress.empty")
|
|
69
86
|
}) : /* @__PURE__ */ d("div", {
|
|
@@ -77,7 +94,7 @@ function g() {
|
|
|
77
94
|
size: 16,
|
|
78
95
|
className: "text-warning"
|
|
79
96
|
}),
|
|
80
|
-
rows:
|
|
97
|
+
rows: k.IN_PROGRESS,
|
|
81
98
|
emptyText: g("myToursProgress.emptyInProgress")
|
|
82
99
|
})
|
|
83
100
|
}),
|
|
@@ -87,7 +104,7 @@ function g() {
|
|
|
87
104
|
size: 16,
|
|
88
105
|
className: "text-success"
|
|
89
106
|
}),
|
|
90
|
-
rows:
|
|
107
|
+
rows: k.COMPLETED,
|
|
91
108
|
emptyText: g("myToursProgress.emptyCompleted")
|
|
92
109
|
}),
|
|
93
110
|
/* @__PURE__ */ u(_, {
|
|
@@ -96,16 +113,16 @@ function g() {
|
|
|
96
113
|
size: 16,
|
|
97
114
|
className: "text-text-secondary"
|
|
98
115
|
}),
|
|
99
|
-
rows:
|
|
116
|
+
rows: k.SKIPPED,
|
|
100
117
|
emptyText: g("myToursProgress.emptySkipped")
|
|
101
118
|
}),
|
|
102
|
-
|
|
119
|
+
k.OTHER.length > 0 ? /* @__PURE__ */ u(_, {
|
|
103
120
|
title: g("myToursProgress.other"),
|
|
104
121
|
icon: /* @__PURE__ */ u(s, {
|
|
105
122
|
size: 16,
|
|
106
123
|
className: "text-text-secondary"
|
|
107
124
|
}),
|
|
108
|
-
rows:
|
|
125
|
+
rows: k.OTHER,
|
|
109
126
|
emptyText: g("myToursProgress.emptyOther")
|
|
110
127
|
}) : null
|
|
111
128
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MyToursProgressPage.js","names":[],"sources":["../../../src/tours/pages/MyToursProgressPage.tsx"],"sourcesContent":["import { useMemo, useEffect, useRef } from 'react';\nimport { CheckCircle2, HelpCircle, MinusCircle, Play } from 'lucide-react';\nimport { useGetUserTourProgressesQuery } from '../../generated/global-operations';\nimport { useToursContext } from '../providers/ToursProvider';\nimport { useToursI18n } from '../i18n';\nimport { useEventBus } from '@burdenoff/fe-libs/shared/events';\nimport { EmphasisPanel, IllustratedEmptyState, PagePurpose } from '@burdenoff/fe-libs/ui';\n\ntype ProgressGroup = 'IN_PROGRESS' | 'COMPLETED' | 'SKIPPED' | 'OTHER';\n\ntype ProgressRow = {\n id: string;\n status: string;\n tour: { id: string; name: string; productId?: string; moduleId?: string; pageId?: string };\n lastViewedAt?: string | null;\n};\n\n/**\n * MyToursProgressPage — user-facing read-only view of the current user's\n * tour interactions, grouped by status (In progress / Completed / Skipped).\n */\nexport function MyToursProgressPage() {\n const { tr } = useToursI18n();\n const {\n currentUser,\n productId: shellProductId,\n moduleId: shellModuleId,\n pageId: shellPageId,\n workspaceId,\n } = useToursContext();\n const eventBus = useEventBus();\n\n // Emit page view event exactly once per mount. A ref guard keeps the effect\n // semantically mount-only while satisfying exhaustive-deps with the real\n // dependency list, so we don't have to disable the lint rule.\n const pageViewedRef = useRef(false);\n useEffect(() => {\n if (pageViewedRef.current) return;\n pageViewedRef.current = true;\n eventBus.emit('tours.page.viewed', {\n page: '/tours/progress',\n productId: shellProductId,\n moduleId: shellModuleId,\n pageId: shellPageId,\n workspaceId,\n });\n }, [eventBus, shellProductId, shellModuleId, shellPageId, workspaceId]);\n\n const { data, loading } = useGetUserTourProgressesQuery({\n variables: { userId: currentUser?.id, pagination: { limit: 100, offset: 0 } },\n skip: !currentUser?.id,\n fetchPolicy: 'cache-and-network',\n });\n\n const grouped = useMemo(() => {\n const result: Record<ProgressGroup, NonNullable<typeof data>['userTourProgresses']> = {\n IN_PROGRESS: [],\n COMPLETED: [],\n SKIPPED: [],\n OTHER: [],\n };\n // Filter the raw progress list to the shell's product/module/page context\n // so a user's vibecontrols session doesn't see workspaces / bigconsole\n // progress rows. `userTourProgresses` returns everything scoped by userId;\n // this MFE is mounted per-shell so we narrow to what the shell advertises.\n // When the shell didn't supply a filter, the corresponding level is not\n // checked (e.g., no shellModuleId → accept any moduleId).\n const rows = (data?.userTourProgresses ?? []).filter((row: ProgressRow) => {\n if (shellProductId && row.tour.productId !== shellProductId) return false;\n if (shellModuleId && row.tour.moduleId && row.tour.moduleId !== shellModuleId) return false;\n if (shellPageId && row.tour.pageId && row.tour.pageId !== shellPageId) return false;\n return true;\n });\n for (const row of rows) {\n if (row.status === 'COMPLETED') result.COMPLETED.push(row);\n else if (row.status === 'IN_PROGRESS') result.IN_PROGRESS.push(row);\n else if (row.status === 'SKIPPED' || row.status === 'DISMISSED') result.SKIPPED.push(row);\n // Unknown / future status values fall through here so nothing is\n // silently dropped if the backend introduces a new state.\n else result.OTHER.push(row);\n }\n return result;\n }, [data, shellProductId, shellModuleId, shellPageId]);\n\n const totalInContext =\n grouped.IN_PROGRESS.length +\n grouped.COMPLETED.length +\n grouped.SKIPPED.length +\n grouped.OTHER.length;\n\n return (\n <div className=\"space-y-4 sm:space-y-6 p-3 sm:p-6\">\n <div>\n <h1 className=\"text-xl sm:text-2xl font-bold text-text-primary\">\n {tr('myToursProgress.title')}\n </h1>\n <p className=\"text-sm sm:text-base text-text-secondary\">{tr('myToursProgress.subtitle')}</p>\n </div>\n\n <PagePurpose>{tr('myToursProgress.purpose')}</PagePurpose>\n\n {loading && (data?.userTourProgresses?.length ?? 0) === 0 ? (\n <output className=\"text-sm text-text-secondary\">{tr('myToursProgress.loading')}</output>\n ) : totalInContext === 0 ? (\n <IllustratedEmptyState illustration=\"empty-data\" title={tr('myToursProgress.empty')} />\n ) : (\n <div className=\"space-y-6\">\n <EmphasisPanel className=\"p-4 sm:p-5\">\n <ProgressSection\n title={tr('myToursProgress.inProgress')}\n icon={<Play size={16} className=\"text-warning\" />}\n rows={grouped.IN_PROGRESS}\n emptyText={tr('myToursProgress.emptyInProgress')}\n />\n </EmphasisPanel>\n <ProgressSection\n title={tr('myToursProgress.completed')}\n icon={<CheckCircle2 size={16} className=\"text-success\" />}\n rows={grouped.COMPLETED}\n emptyText={tr('myToursProgress.emptyCompleted')}\n />\n <ProgressSection\n title={tr('myToursProgress.skipped')}\n icon={<MinusCircle size={16} className=\"text-text-secondary\" />}\n rows={grouped.SKIPPED}\n emptyText={tr('myToursProgress.emptySkipped')}\n />\n {grouped.OTHER.length > 0 ? (\n <ProgressSection\n title={tr('myToursProgress.other')}\n icon={<HelpCircle size={16} className=\"text-text-secondary\" />}\n rows={grouped.OTHER}\n emptyText={tr('myToursProgress.emptyOther')}\n />\n ) : null}\n </div>\n )}\n </div>\n );\n}\n\nfunction ProgressSection({\n title,\n icon,\n rows,\n emptyText,\n}: {\n title: string;\n icon: React.ReactNode;\n rows: Array<{ id: string; tour: { id: string; name: string }; lastViewedAt?: string | null }>;\n emptyText: string;\n}) {\n return (\n <section className=\"space-y-2\">\n <h2 className=\"flex items-center gap-2 text-sm font-semibold text-text-primary\">\n {icon}\n {title}\n <span className=\"text-xs text-text-secondary font-normal\">({rows.length})</span>\n </h2>\n {rows.length === 0 ? (\n <p className=\"text-sm text-text-secondary\" role=\"status\" aria-live=\"polite\">\n {emptyText}\n </p>\n ) : (\n <ul className=\"divide-y divide-border-seam rounded-md border border-border-seam\">\n {rows.map((row) => (\n <li key={row.id} className=\"flex items-center justify-between gap-3 p-3\">\n <span className=\"text-sm text-text-primary line-clamp-1\">{row.tour.name}</span>\n {row.lastViewedAt ? (\n <time className=\"text-xs text-text-secondary\" dateTime={row.lastViewedAt}>\n {new Date(row.lastViewedAt).toLocaleDateString()}\n </time>\n ) : null}\n </li>\n ))}\n </ul>\n )}\n </section>\n );\n}\n"],"mappings":";;;;;;;;;AAqBA,SAAgB,IAAsB;CACpC,IAAM,EAAE,UAAO,GAAc,EACvB,EACJ,gBACA,WAAW,GACX,UAAU,GACV,QAAQ,GACR,mBACE,GAAiB,EACf,IAAW,GAAa,EAKxB,IAAgB,EAAO,GAAM;AACnC,SAAgB;AACV,IAAc,YAClB,EAAc,UAAU,IACxB,EAAS,KAAK,qBAAqB;GACjC,MAAM;GACN,WAAW;GACX,UAAU;GACV,QAAQ;GACR;GACD,CAAC;IACD;EAAC;EAAU;EAAgB;EAAe;EAAa;EAAY,CAAC;CAEvE,IAAM,EAAE,SAAM,eAAY,EAA8B;EACtD,WAAW;GAAE,QAAQ,GAAa;GAAI,YAAY;IAAE,OAAO;IAAK,QAAQ;IAAG;GAAE;EAC7E,MAAM,CAAC,GAAa;EACpB,aAAa;EACd,CAAC,EAEI,IAAU,QAAc;EAC5B,IAAM,IAAgF;GACpF,aAAa,EAAE;GACf,WAAW,EAAE;GACb,SAAS,EAAE;GACX,OAAO,EAAE;GACV,EAOK,KAAQ,GAAM,sBAAsB,EAAE,EAAE,QAAQ,MAGpD,EAFI,KAAkB,EAAI,KAAK,cAAc,KACzC,KAAiB,EAAI,KAAK,YAAY,EAAI,KAAK,aAAa,KAC5D,KAAe,EAAI,KAAK,UAAU,EAAI,KAAK,WAAW,GAE1D;AACF,OAAK,IAAM,KAAO,EAChB,CAAI,EAAI,WAAW,cAAa,EAAO,UAAU,KAAK,EAAI,GACjD,EAAI,WAAW,gBAAe,EAAO,YAAY,KAAK,EAAI,GAC1D,EAAI,WAAW,aAAa,EAAI,WAAW,cAAa,EAAO,QAAQ,KAAK,EAAI,GAGpF,EAAO,MAAM,KAAK,EAAI;AAE7B,SAAO;IACN;EAAC;EAAM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BAAC,GAAD;OAAY,MAAM;OAAI,WAAU;OAAwB,CAAA;MAC9D,MAAM,EAAQ;MACd,WAAW,EAAG,6BAA6B;MAC3C,CAAA,GACA;KACA;;GAEJ;;;AAIV,SAAS,EAAgB,EACvB,UACA,SACA,SACA,gBAMC;AACD,QACE,kBAAC,WAAD;EAAS,WAAU;YAAnB,CACE,kBAAC,MAAD;GAAI,WAAU;aAAd;IACG;IACA;IACD,kBAAC,QAAD;KAAM,WAAU;eAAhB;MAA0D;MAAE,EAAK;MAAO;MAAQ;;IAC7E;MACJ,EAAK,WAAW,IACf,kBAAC,KAAD;GAAG,WAAU;GAA8B,MAAK;GAAS,aAAU;aAChE;GACC,CAAA,GAEJ,kBAAC,MAAD;GAAI,WAAU;aACX,EAAK,KAAK,MACT,kBAAC,MAAD;IAAiB,WAAU;cAA3B,CACE,kBAAC,QAAD;KAAM,WAAU;eAA0C,EAAI,KAAK;KAAY,CAAA,EAC9E,EAAI,eACH,kBAAC,QAAD;KAAM,WAAU;KAA8B,UAAU,EAAI;eACzD,IAAI,KAAK,EAAI,aAAa,CAAC,oBAAoB;KAC3C,CAAA,GACL,KACD;MAPI,EAAI,GAOR,CACL;GACC,CAAA,CAEC"}
|
|
1
|
+
{"version":3,"file":"MyToursProgressPage.js","names":[],"sources":["../../../src/tours/pages/MyToursProgressPage.tsx"],"sourcesContent":["import { useMemo, useEffect, useRef } from 'react';\nimport { CheckCircle2, HelpCircle, MinusCircle, Play } from 'lucide-react';\nimport { useGetUserTourProgressesQuery } from '../../generated/global-operations';\nimport { useToursContext } from '../providers/ToursProvider';\nimport { useToursI18n } from '../i18n';\nimport { useEventBus } from '@burdenoff/fe-libs/shared/events';\nimport { EmphasisPanel, IllustratedEmptyState, PagePurpose } from '@burdenoff/fe-libs/ui';\n\ntype ProgressGroup = 'IN_PROGRESS' | 'COMPLETED' | 'SKIPPED' | 'OTHER';\n\ntype ProgressRow = {\n id: string;\n status: string;\n tour: { id: string; name: string; productId?: string; moduleId?: string; pageId?: string };\n lastViewedAt?: string | null;\n};\n\n/**\n * MyToursProgressPage — user-facing read-only view of the current user's\n * tour interactions, grouped by status (In progress / Completed / Skipped).\n */\nexport function MyToursProgressPage() {\n const { tr } = useToursI18n();\n const {\n currentUser,\n productId: shellProductId,\n moduleId: shellModuleId,\n pageId: shellPageId,\n workspaceId,\n } = useToursContext();\n const eventBus = useEventBus();\n\n // Emit page view event exactly once per mount. A ref guard keeps the effect\n // semantically mount-only while satisfying exhaustive-deps with the real\n // dependency list, so we don't have to disable the lint rule.\n const pageViewedRef = useRef(false);\n useEffect(() => {\n if (pageViewedRef.current) return;\n pageViewedRef.current = true;\n eventBus.emit('tours.page.viewed', {\n page: '/tours/progress',\n productId: shellProductId,\n moduleId: shellModuleId,\n pageId: shellPageId,\n workspaceId,\n });\n }, [eventBus, shellProductId, shellModuleId, shellPageId, workspaceId]);\n\n const { data, loading, error, refetch } = useGetUserTourProgressesQuery({\n variables: { userId: currentUser?.id, pagination: { limit: 100, offset: 0 } },\n skip: !currentUser?.id,\n context: {\n requiredWorkspaceAuth: Boolean(workspaceId),\n requiredWorkspaceId: workspaceId,\n queryDeduplication: false,\n },\n fetchPolicy: 'no-cache',\n });\n\n const grouped = useMemo(() => {\n const result: Record<ProgressGroup, NonNullable<typeof data>['userTourProgresses']> = {\n IN_PROGRESS: [],\n COMPLETED: [],\n SKIPPED: [],\n OTHER: [],\n };\n // Filter the raw progress list to the shell's product/module/page context\n // so a user's vibecontrols session doesn't see workspaces / bigconsole\n // progress rows. `userTourProgresses` returns everything scoped by userId;\n // this MFE is mounted per-shell so we narrow to what the shell advertises.\n // When the shell didn't supply a filter, the corresponding level is not\n // checked (e.g., no shellModuleId → accept any moduleId).\n const rows = (\n loading || error || !currentUser?.id ? [] : (data?.userTourProgresses ?? [])\n ).filter((row: ProgressRow) => {\n if (shellProductId && row.tour.productId !== shellProductId) return false;\n if (shellModuleId && row.tour.moduleId && row.tour.moduleId !== shellModuleId) return false;\n if (shellPageId && row.tour.pageId && row.tour.pageId !== shellPageId) return false;\n return true;\n });\n for (const row of rows) {\n if (row.status === 'COMPLETED') result.COMPLETED.push(row);\n else if (row.status === 'IN_PROGRESS') result.IN_PROGRESS.push(row);\n else if (row.status === 'SKIPPED' || row.status === 'DISMISSED') result.SKIPPED.push(row);\n // Unknown / future status values fall through here so nothing is\n // silently dropped if the backend introduces a new state.\n else result.OTHER.push(row);\n }\n return result;\n }, [data, loading, error, currentUser?.id, shellProductId, shellModuleId, shellPageId]);\n\n const totalInContext =\n grouped.IN_PROGRESS.length +\n grouped.COMPLETED.length +\n grouped.SKIPPED.length +\n grouped.OTHER.length;\n\n return (\n <div className=\"space-y-4 sm:space-y-6 p-3 sm:p-6\">\n <div>\n <h1 className=\"text-xl sm:text-2xl font-bold text-text-primary\">\n {tr('myToursProgress.title')}\n </h1>\n <p className=\"text-sm sm:text-base text-text-secondary\">{tr('myToursProgress.subtitle')}</p>\n </div>\n\n <PagePurpose>{tr('myToursProgress.purpose')}</PagePurpose>\n\n {error ? (\n <div role=\"alert\" className=\"space-y-3 text-sm text-text-secondary\">\n <p>{tr('userTours.loadError')}</p>\n <button\n type=\"button\"\n onClick={() => void refetch().catch(() => undefined)}\n className=\"px-4 py-2 rounded-md bg-action-primary-bg text-action-primary-text\"\n >\n {tr('routeErrors.tryAgain')}\n </button>\n </div>\n ) : loading ? (\n <output className=\"text-sm text-text-secondary\">{tr('myToursProgress.loading')}</output>\n ) : totalInContext === 0 ? (\n <IllustratedEmptyState illustration=\"empty-data\" title={tr('myToursProgress.empty')} />\n ) : (\n <div className=\"space-y-6\">\n <EmphasisPanel className=\"p-4 sm:p-5\">\n <ProgressSection\n title={tr('myToursProgress.inProgress')}\n icon={<Play size={16} className=\"text-warning\" />}\n rows={grouped.IN_PROGRESS}\n emptyText={tr('myToursProgress.emptyInProgress')}\n />\n </EmphasisPanel>\n <ProgressSection\n title={tr('myToursProgress.completed')}\n icon={<CheckCircle2 size={16} className=\"text-success\" />}\n rows={grouped.COMPLETED}\n emptyText={tr('myToursProgress.emptyCompleted')}\n />\n <ProgressSection\n title={tr('myToursProgress.skipped')}\n icon={<MinusCircle size={16} className=\"text-text-secondary\" />}\n rows={grouped.SKIPPED}\n emptyText={tr('myToursProgress.emptySkipped')}\n />\n {grouped.OTHER.length > 0 ? (\n <ProgressSection\n title={tr('myToursProgress.other')}\n icon={<HelpCircle size={16} className=\"text-text-secondary\" />}\n rows={grouped.OTHER}\n emptyText={tr('myToursProgress.emptyOther')}\n />\n ) : null}\n </div>\n )}\n </div>\n );\n}\n\nfunction ProgressSection({\n title,\n icon,\n rows,\n emptyText,\n}: {\n title: string;\n icon: React.ReactNode;\n rows: Array<{ id: string; tour: { id: string; name: string }; lastViewedAt?: string | null }>;\n emptyText: string;\n}) {\n return (\n <section className=\"space-y-2\">\n <h2 className=\"flex items-center gap-2 text-sm font-semibold text-text-primary\">\n {icon}\n {title}\n <span className=\"text-xs text-text-secondary font-normal\">({rows.length})</span>\n </h2>\n {rows.length === 0 ? (\n <p className=\"text-sm text-text-secondary\" role=\"status\" aria-live=\"polite\">\n {emptyText}\n </p>\n ) : (\n <ul className=\"divide-y divide-border-seam rounded-md border border-border-seam\">\n {rows.map((row) => (\n <li key={row.id} className=\"flex items-center justify-between gap-3 p-3\">\n <span className=\"text-sm text-text-primary line-clamp-1\">{row.tour.name}</span>\n {row.lastViewedAt ? (\n <time className=\"text-xs text-text-secondary\" dateTime={row.lastViewedAt}>\n {new Date(row.lastViewedAt).toLocaleDateString()}\n </time>\n ) : null}\n </li>\n ))}\n </ul>\n )}\n </section>\n );\n}\n"],"mappings":";;;;;;;;;AAqBA,SAAgB,IAAsB;CACpC,IAAM,EAAE,UAAO,GAAc,EACvB,EACJ,gBACA,WAAW,GACX,UAAU,GACV,QAAQ,GACR,mBACE,GAAiB,EACf,IAAW,GAAa,EAKxB,IAAgB,EAAO,GAAM;AACnC,SAAgB;AACV,IAAc,YAClB,EAAc,UAAU,IACxB,EAAS,KAAK,qB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