@datarecce/ui 1.52.0 → 1.53.0-nightly.20260615
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/advanced.d.ts +7 -7
- package/dist/advanced.js +1 -1
- package/dist/advanced.js.map +1 -1
- package/dist/{api-e2VbrOsl.d.ts → api-DC7Dozi1.d.ts} +2 -2
- package/dist/{api-e2VbrOsl.d.ts.map → api-DC7Dozi1.d.ts.map} +1 -1
- package/dist/api-DTKI1Y_n.js +3 -0
- package/dist/{api-S5ho3Qs3.js.map → api-DTKI1Y_n.js.map} +1 -1
- package/dist/api.d.ts +2 -2
- package/dist/api.js +1 -1
- package/dist/components-DhHBt0fL.js +3 -0
- package/dist/components-DhHBt0fL.js.map +1 -0
- package/dist/components-run.d.ts +2 -2
- package/dist/components-run.js +1 -1
- package/dist/components.d.ts +6 -6
- package/dist/components.js +1 -1
- package/dist/contexts.d.ts +3 -3
- package/dist/contexts.js +1 -1
- package/dist/{fetchClient-D0p358nB.js → fetchClient-Bf9Q3QKq.js} +2 -2
- package/dist/{fetchClient-D0p358nB.js.map → fetchClient-Bf9Q3QKq.js.map} +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/hooks.js +1 -1
- package/dist/{index-CL1zCliW.d.ts → index-CbMseltT.d.ts} +2 -2
- package/dist/{index-CL1zCliW.d.ts.map → index-CbMseltT.d.ts.map} +1 -1
- package/dist/{index-BOFGzyVm.d.ts → index-CtXdIcug.d.ts} +3 -3
- package/dist/{index-BOFGzyVm.d.ts.map → index-CtXdIcug.d.ts.map} +1 -1
- package/dist/{index-DjuwVxKT.d.ts → index-DNkSLklg.d.ts} +4 -4
- package/dist/{index-DjuwVxKT.d.ts.map → index-DNkSLklg.d.ts.map} +1 -1
- package/dist/{index-jFG10ql3.d.ts → index-DgZ__aEk.d.ts} +5 -5
- package/dist/{index-jFG10ql3.d.ts.map → index-DgZ__aEk.d.ts.map} +1 -1
- package/dist/{index-CPBF1Xr2.d.ts → index-DjOBN7u1.d.ts} +3 -3
- package/dist/{index-CPBF1Xr2.d.ts.map → index-DjOBN7u1.d.ts.map} +1 -1
- package/dist/{index-DnkjRy48.d.ts → index-JMq11hbe.d.ts} +3 -3
- package/dist/{index-DnkjRy48.d.ts.map → index-JMq11hbe.d.ts.map} +1 -1
- package/dist/index.d.ts +10 -10
- package/dist/index.js +1 -1
- package/dist/{instanceInfo-CMOHULsR.d.ts → instanceInfo-D3d5flul.d.ts} +1 -3
- package/dist/{instanceInfo-CMOHULsR.d.ts.map → instanceInfo-D3d5flul.d.ts.map} +1 -1
- package/dist/{keepAlive-bjIHulj-.js → keepAlive-Bowms1oa.js} +2 -2
- package/dist/keepAlive-Bowms1oa.js.map +1 -0
- package/dist/lib/api/user.js +1 -1
- package/dist/lineage-CTqImE8Y.js +7 -0
- package/dist/lineage-CTqImE8Y.js.map +1 -0
- package/dist/{lineage-2nc0YlpN.d.ts → lineage-CwiFPVvR.d.ts} +11 -11
- package/dist/{lineage-2nc0YlpN.d.ts.map → lineage-CwiFPVvR.d.ts.map} +1 -1
- package/dist/{primitives-Dvljxc6u.d.ts → primitives-BjWGLhDI.d.ts} +4 -7
- package/dist/primitives-BjWGLhDI.d.ts.map +1 -0
- package/dist/primitives.d.ts +3 -3
- package/dist/primitives.js +1 -1
- package/dist/result.js +1 -1
- package/dist/src-D-gy72sb.js +3 -0
- package/dist/src-D-gy72sb.js.map +1 -0
- package/dist/style.css +23 -23
- package/dist/theme-u98ih3Tv.js +3 -0
- package/dist/theme-u98ih3Tv.js.map +1 -0
- package/dist/theme.js +1 -1
- package/dist/{types-9MeiHUfo.d.ts → types-C7lJDCVr.d.ts} +11 -16
- package/dist/{types-9MeiHUfo.d.ts.map → types-C7lJDCVr.d.ts.map} +1 -1
- package/dist/{types-CbujhEfL.d.ts → types-Je-sKjuJ.d.ts} +2 -2
- package/dist/{types-CbujhEfL.d.ts.map → types-Je-sKjuJ.d.ts.map} +1 -1
- package/dist/types.d.ts +7 -7
- package/dist/utils-BzZEjJAS.js +3 -0
- package/dist/{utils-FOrjYCpW.js.map → utils-BzZEjJAS.js.map} +1 -1
- package/dist/utils-h0d712cQ.js +6 -0
- package/dist/utils-h0d712cQ.js.map +1 -0
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/package.json +1 -1
- package/dist/api-S5ho3Qs3.js +0 -3
- package/dist/hooks-CrJq15DU.js +0 -7
- package/dist/hooks-CrJq15DU.js.map +0 -1
- package/dist/keepAlive-bjIHulj-.js.map +0 -1
- package/dist/primitives-Dvljxc6u.d.ts.map +0 -1
- package/dist/src-DI-sLY25.js +0 -12
- package/dist/src-DI-sLY25.js.map +0 -1
- package/dist/theme-wN7zbYoG.js +0 -3
- package/dist/theme-wN7zbYoG.js.map +0 -1
- package/dist/utils-Dl2dMzK8.js +0 -6
- package/dist/utils-Dl2dMzK8.js.map +0 -1
- package/dist/utils-FOrjYCpW.js +0 -3
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keepAlive-bjIHulj-.js","names":[],"sources":["../src/api/cacheKeys.ts","../src/providers/contexts/ApiContext.tsx","../src/api/flag.ts","../src/api/instanceInfo.ts","../src/api/keepAlive.ts"],"sourcesContent":["\"use client\";\n\n/**\n * Cache keys for TanStack Query.\n * Provides consistent query keys for API caching.\n */\nexport const cacheKeys = {\n rowCount: (model: string) => [\"row_count\", model],\n lineage: () => [\"lineage\"],\n checks: () => [\"checks\", \"list\"],\n check: (checkId: string) => [\"checks\", checkId],\n checkEvents: (checkId: string) => [\"checks\", checkId, \"events\"],\n runs: () => [\"runs\"],\n run: (runId: string) => [\"runs\", runId],\n runsAggregated: () => [\"runs_aggregated\"],\n flag: () => [\"flag\"],\n instanceInfo: () => [\"instance_info\"],\n user: () => [\"user\"],\n};\n","\"use client\";\n\nimport {\n createContext,\n type ReactNode,\n useContext,\n useMemo,\n useRef,\n} from \"react\";\nimport { type ApiClient, createFetchClient } from \"../../lib/fetchClient\";\n\n/**\n * API Configuration\n *\n * baseUrl: Base URL for all requests\n * apiPrefix: Replaces /api in URLs (for cloud mode sessions)\n * authToken: Bearer token for Authorization header\n * headers: Additional headers\n * timeout: Request timeout in ms\n */\n/**\n * API configuration inputs for {@link ApiProvider}.\n */\ninterface ApiConfig {\n baseUrl: string;\n apiPrefix?: string;\n authToken?: string;\n headers?: Record<string, string>;\n timeout?: number;\n}\n\n/**\n * Resolved API context values exposed by {@link useApiConfig}.\n */\ninterface ApiContextValue {\n apiClient: ApiClient;\n apiPrefix: string;\n authToken?: string;\n baseUrl: string;\n}\n\nconst ApiContext = createContext<ApiContextValue | null>(null);\nApiContext.displayName = \"RecceApiContext\";\n\n/**\n * Access the API configuration, including the configured API client.\n *\n * @returns The API context values (client, baseUrl, apiPrefix, authToken).\n * @throws Error if used outside {@link RecceProvider}.\n */\nexport function useApiConfig(): ApiContextValue {\n const context = useContext(ApiContext);\n if (!context) {\n throw new Error(\"useApiConfig must be used within RecceProvider\");\n }\n return context;\n}\n\n/**\n * Non-throwing version of {@link useApiConfig}.\n *\n * @returns The API context values, or null if outside {@link RecceProvider}.\n */\nexport function useApiConfigOptional(): ApiContextValue | null {\n return useContext(ApiContext);\n}\n\n/**\n * Convenience hook for the configured API client.\n *\n * @returns ApiClient configured with API prefix and auth token.\n * @throws Error if used outside {@link RecceProvider}.\n */\nexport function useApiClient() {\n return useApiConfig().apiClient;\n}\n\n/**\n * Custom client config that allows passing a pre-configured API client\n * along with the API configuration values for context.\n */\n/**\n * Custom client configuration for {@link ApiProvider}.\n */\ninterface CustomClientConfig {\n client: ApiClient;\n apiPrefix?: string;\n authToken?: string;\n baseUrl?: string;\n}\n\n/**\n * Props for {@link ApiProvider}.\n */\ninterface ApiProviderProps {\n children: ReactNode;\n config: ApiConfig | CustomClientConfig;\n}\n\n// Hook to memoize headers by value (JSON comparison) instead of reference\nfunction useStableHeaders(\n headers: Record<string, string> | undefined,\n): Record<string, string> | undefined {\n const headersRef = useRef(headers);\n const keyRef = useRef(headers ? JSON.stringify(headers) : \"\");\n\n const currentKey = headers ? JSON.stringify(headers) : \"\";\n if (currentKey !== keyRef.current) {\n headersRef.current = headers;\n keyRef.current = currentKey;\n }\n\n return headersRef.current;\n}\n\n/**\n * Creates an ApiClient configured with the given API config.\n *\n * Uses middleware to:\n * 1. Replace /api prefix with the configured apiPrefix (if provided)\n * 2. Add Authorization header with Bearer token (if authToken provided)\n */\nfunction createApiClient(\n baseUrl: string,\n apiPrefix: string,\n authToken: string | undefined,\n headers: Record<string, string> | undefined,\n timeout: number,\n): ApiClient {\n return createFetchClient({\n baseURL: baseUrl,\n headers: headers,\n timeout: timeout,\n middleware:\n apiPrefix || authToken\n ? (url, init) => {\n try {\n let resolvedUrl = url;\n\n // Replace /api prefix with configured apiPrefix (only if apiPrefix is non-empty).\n // Middleware runs on the relative path (before baseURL is prepended),\n // matching Axios interceptor ordering.\n if (apiPrefix) {\n const apiExact = resolvedUrl.endsWith(\"/api\")\n ? resolvedUrl.lastIndexOf(\"/api\")\n : -1;\n const apiSlash = resolvedUrl.indexOf(\"/api/\");\n\n if (apiExact >= 0) {\n // Exact \"/api\" at end of URL\n resolvedUrl = resolvedUrl.slice(0, apiExact) + apiPrefix;\n } else if (apiSlash >= 0) {\n // \"/api/...\" — replace /api with apiPrefix, keep the rest\n resolvedUrl =\n resolvedUrl.slice(0, apiSlash) +\n apiPrefix +\n resolvedUrl.slice(apiSlash + 4);\n }\n }\n\n // Add auth header if token is provided\n if (authToken) {\n init.headers.set(\"Authorization\", `Bearer ${authToken}`);\n }\n\n return { url: resolvedUrl, init };\n } catch (error) {\n // If anything goes wrong in the middleware, fall back to the original config\n // to avoid breaking all API requests.\n console.warn(\n \"API request middleware error, proceeding with unmodified request:\",\n error,\n );\n return { url, init };\n }\n }\n : undefined,\n });\n}\n\n/**\n * Provides API configuration and an API client to the subtree.\n */\nexport function ApiProvider({ children, config }: ApiProviderProps) {\n // Extract primitive values to stabilize dependency - prevents client recreation\n // when parent re-renders with new object reference but same values\n const isCustomClient = \"client\" in config;\n const customClient = isCustomClient ? config.client : null;\n const baseUrl = isCustomClient ? (config.baseUrl ?? \"\") : config.baseUrl;\n const timeout = !isCustomClient ? config.timeout : undefined;\n const headersFromConfig = !isCustomClient ? config.headers : undefined;\n const apiPrefix = config.apiPrefix ?? \"\";\n const authToken = config.authToken;\n\n // Use stable headers reference (compared by value, not reference)\n const headers = useStableHeaders(headersFromConfig);\n\n const client = useMemo(() => {\n if (customClient) {\n return customClient;\n }\n return createApiClient(\n baseUrl,\n apiPrefix,\n authToken,\n headers,\n timeout ?? 30000,\n );\n }, [customClient, baseUrl, apiPrefix, authToken, headers, timeout]);\n\n const contextValue: ApiContextValue = useMemo(\n () => ({\n apiClient: client,\n apiPrefix,\n authToken,\n baseUrl,\n }),\n [client, apiPrefix, authToken, baseUrl],\n );\n\n return (\n <ApiContext.Provider value={contextValue}>{children}</ApiContext.Provider>\n );\n}\n","import type { ApiClient, ApiResponse } from \"../lib/fetchClient\";\n\n/**\n * Server-side feature flags\n */\nexport interface RecceServerFlags {\n single_env_onboarding: boolean;\n show_relaunch_hint: boolean;\n disable_cll_cache: boolean;\n impact_at_startup: boolean;\n new_cll_experience: boolean;\n /** Whole-model impact highlighting. Implies new_cll_experience. */\n whole_model_impact: boolean;\n /**\n * Inline paired-distribution profiles in the schema view (DRC-3390 Stage B).\n * When false (the default), Stage C's hook short-circuits and no\n * ``profile_distribution`` runs are submitted from the UI.\n */\n inline_profile: boolean;\n}\n\n/**\n * Fetch server flags from API\n */\nexport async function getServerFlag(\n client: ApiClient,\n): Promise<RecceServerFlags> {\n const response = await client.get<never, ApiResponse<RecceServerFlags>>(\n \"/api/flag\",\n );\n return response.data;\n}\n\n/**\n * Mark relaunch hint as completed\n */\nexport async function markRelaunchHintCompleted(\n client: ApiClient,\n): Promise<void> {\n try {\n await client.post<never, ApiResponse<never>>(\n \"/api/relaunch-hint/completed\",\n );\n } catch {\n // Skip any errors\n }\n}\n","\"use client\";\n\nimport type { ApiClient, ApiResponse } from \"../lib/fetchClient\";\n\n/**\n * Server mode for the Recce instance.\n * - \"server\": Full read-write mode\n * - \"preview\": Metadata only mode (no database queries)\n * - \"read-only\": Read-only mode (no modifications allowed)\n */\nexport type ServerMode = \"server\" | \"preview\" | \"read-only\";\n\n/**\n * Information about the Recce instance returned from the server.\n */\nexport interface RecceInstanceInfo {\n server_mode: ServerMode;\n single_env: boolean;\n authed: boolean;\n cloud_instance: boolean;\n lifetime_expired_at?: Date;\n idle_timeout?: number;\n share_url?: string;\n session_id?: string;\n organization_name?: string;\n web_url?: string;\n python_version?: string;\n user_role?: string;\n}\n\n/**\n * Fetches instance information from the Recce server.\n *\n * @param client - Axios instance to use for the request\n * @returns Promise resolving to RecceInstanceInfo\n */\nexport async function getRecceInstanceInfo(\n client: ApiClient,\n): Promise<RecceInstanceInfo> {\n return (\n await client.get<never, ApiResponse<RecceInstanceInfo>>(\n \"/api/instance-info\",\n )\n ).data;\n}\n","\"use client\";\n\nimport type { ApiClient } from \"../lib/fetchClient\";\n\n/**\n * Check if debug logging is enabled via window.RECCE_DEBUG_IDLE\n */\nfunction isDebugEnabled(): boolean {\n // biome-ignore lint/suspicious/noExplicitAny: window flag for debug logging\n return typeof window !== \"undefined\" && !!(window as any).RECCE_DEBUG_IDLE;\n}\n\n/**\n * Minimum interval between keep-alive API calls (3 seconds)\n * This prevents excessive API calls while still maintaining responsive idle detection\n */\nconst MIN_KEEP_ALIVE_INTERVAL_MS = 3 * 1000;\n\n/**\n * State for API-layer throttling\n * - lastKeepAliveTime: timestamp of last SUCCESSFUL keep-alive sent to server\n * - isSending: lock to prevent concurrent API calls\n */\nlet lastKeepAliveTime = 0;\nlet isSending = false;\n\n/** Callback to notify listeners when keep-alive is successfully sent */\ntype KeepAliveCallback = (timestamp: number) => void;\nlet onKeepAliveSuccess: KeepAliveCallback | null = null;\n\n/**\n * Register a callback to be notified when keep-alive is successfully sent\n * Used by IdleTimeoutContext to track server sync time\n */\nexport function setKeepAliveCallback(callback: KeepAliveCallback | null): void {\n onKeepAliveSuccess = callback;\n}\n\n/**\n * Send a keep-alive signal to the server to reset the idle timeout timer.\n * This prevents the server from shutting down due to inactivity.\n *\n * Includes built-in throttling at the API layer:\n * - Minimum 3 seconds between API calls\n * - Prevents concurrent API calls with a lock\n *\n * @param client - API client instance (required)\n * @returns true if keep-alive was sent, false if throttled/skipped\n */\nexport async function sendKeepAlive(client: ApiClient): Promise<boolean> {\n const now = Date.now();\n const elapsed = now - lastKeepAliveTime;\n\n // Throttle: skip if called within minimum interval\n if (elapsed < MIN_KEEP_ALIVE_INTERVAL_MS) {\n return false;\n }\n\n // Prevent concurrent sends\n if (isSending) {\n return false;\n }\n\n try {\n // Acquire lock inside try to ensure finally always releases it\n isSending = true;\n await client.post(\"/api/keep-alive\");\n // Update timestamp only on SUCCESS\n lastKeepAliveTime = Date.now();\n // Notify listeners\n if (onKeepAliveSuccess) {\n onKeepAliveSuccess(lastKeepAliveTime);\n }\n return true;\n } catch (error) {\n // Silent fail - don't disrupt user experience if keep-alive fails\n if (isDebugEnabled()) {\n const errorMessage =\n error instanceof Error ? error.message : String(error);\n console.log(\"[Keep-Alive] Failed to send\", {\n error: errorMessage,\n timestamp: new Date().toISOString(),\n willRetryOnNextActivity: true,\n });\n }\n return false;\n } finally {\n isSending = false;\n }\n}\n\n/**\n * Get the last successful keep-alive timestamp\n * This represents the last time the server confirmed it received our keep-alive\n */\nexport function getLastKeepAliveTime(): number {\n return lastKeepAliveTime;\n}\n\n/**\n * Reset all module state (for testing purposes)\n */\nexport function resetKeepAliveState(): void {\n lastKeepAliveTime = 0;\n isSending = false;\n onKeepAliveSuccess = null;\n}\n"],"mappings":";qKAMA,MAAa,EAAY,CACvB,SAAW,GAAkB,CAAC,YAAa,CAAK,EAChD,YAAe,CAAC,SAAS,EACzB,WAAc,CAAC,SAAU,MAAM,EAC/B,MAAQ,GAAoB,CAAC,SAAU,CAAO,EAC9C,YAAc,GAAoB,CAAC,SA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B,CAAiB,EAE/B,EACT,OAAS,EAAO,CAEd,GAAI,EAAe,EAAG,CACpB,IAAM,EACJ,aAAiB,MAAQ,EAAM,QAAU,OAAO,CAAK,EACvD,QAAQ,IAAI,8BAA+B,CACzC,MAAO,EACP,UAAW,IAAI,KAAK,CAAA,CAAE,YAAY,EAClC,wBAAyB,EAC3B,CAAC,CACH,CACA,MAAO,EACT,QAAU,CACR,EAAY,EACd,CACF,CAMA,SAAgB,GAA+B,CAC7C,OAAO,CACT,CAKA,SAAgB,GAA4B,CAC1C,EAAoB,EACpB,EAAY,GACZ,EAAqB,IACvB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"primitives-Dvljxc6u.d.ts","names":[],"sources":["../src/components/lineage/nodes/LineageNode.tsx","../src/components/lineage/edges/LineageEdge.tsx","../src/components/lineage/LineageView.tsx","../src/components/check/CheckActions.tsx","../src/components/check/CheckBreadcrumb.tsx","../src/components/check/CheckCard.tsx","../src/components/check/CheckDescription.tsx","../src/components/check/CheckDetail.tsx","../src/components/check/CheckEmptyState.tsx","../src/components/check/CheckList.tsx","../src/components/check/PresetCheckTemplateView.tsx","../src/components/lineage/columns/LineageColumnNode.tsx","../src/components/lineage/legend/LineageLegend.tsx","../src/components/lineage/tags/NodeTag.tsx","../src/components/check/timeline/CommentInput.tsx","../src/components/check/timeline/TimelineEvent.tsx","../src/components/check/utils.ts","../src/components/data/HistogramChart.tsx","../src/components/data/InlineProfileDistributionCell.tsx","../src/components/data/PairedHistogramContinuous.tsx","../src/components/data/PairedHistogramDiscrete.tsx","../src/components/data/ProfileDistributionUnsupportedBanner.tsx","../src/components/data/TopKBarChart.tsx","../src/components/schema/ColumnNameCell.tsx","../src/components/schema/SchemaView.tsx","../src/components/ui/dataGrid/schemaCells.tsx","../src/lib/dataGrid/generators/toSchemaDataGrid.ts","../src/components/schema/types.ts","../src/components/editor/CodeEditor.tsx","../src/components/editor/DiffEditor.tsx","../src/components/ui/ChangedOnlyCheckbox.tsx","../src/components/ui/DiffDisplayModeSwitch.tsx","../src/components/ui/DiffText.tsx","../src/components/ui/DiffTextWithToast.tsx","../src/components/ui/DropdownValuesInput.tsx","../src/components/ui/EmptyState.tsx","../src/components/ui/ExternalLinkConfirmDialog.tsx","../src/components/ui/MarkdownContent.tsx","../src/components/ui/ScreenshotBox.tsx","../src/components/ui/Split.tsx","../src/components/ui/SplitPane.tsx","../src/components/ui/Toaster.tsx","../src/components/ui/ToggleSwitch.tsx","../src/primitives.ts"],"mappings":";;;;;;;;;;;;;;;KAoDY,gBAAA;;;;KAKA,UAAA;;;;KAKA,cAAA;AAVZ;;;AAAA,UAmBiB,eAAA,SAAwB,MAAA;EAnBb;EAqB1B,KAAA;EAhBoB;EAkBpB,QAAA;EAlBoB;EAoBpB,YAAA,GAAe,gBAAA;EAfL;EAiBV,UAAA;;EAEA,YAAA;EAnBwB;EAqBxB,YAAA;EAZ+B;EAc/B,WAAA;EARe;EAUf,gBAAA;EAMU;EAJV,UAAA;EAlB6C;EAoB7C,WAAA;EApBuC;EAsBvC,OAAA,GAAU,KAAA;IACR,IAAA;IACA,IAAA;IACA,YAAA,GAAe,gBAAA;EAAA;AAAA;;;;UAOF,gBAAA;EAZf;EAcA,EAAA;EAZU;EAcV,IAAA,EAAM,eAAA;EAZJ;EAcF,QAAA;EAbiB;EAiBjB,WAAA;EAjBiC;EAmBjC,UAAA,GAAa,UAAA;EAZkB;EAc/B,cAAA;EAVM;EAYN,SAAA;EAQY;EANZ,aAAA;EAYoB;EAVpB,WAAA;EA8CkC;EA1ClC,SAAA,GAAY,SAAA;EAtBZ;EAwBA,kBAAA;EAtBM;EAwBN,cAAA,GAAiB,cAAA;EAlBjB;EAoBA,iBAAA,GAAoB,SAAA;EAlBP;EAsBb,UAAA;EAlBA;EAoBA,WAAA;EAhBA;EAkBA,WAAA;EAdY;EAgBZ,YAAA;EAZA;EAgBA,MAAA;EAdA;EAkBA,gBAAA;EAdA;EAgBA,UAAA;EAZA;EAcA,m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AA,EAAS,IAAA,CAAK,YAAA;EACrB,OAAA,GAAU,OAAA,EAAS,IAAA,CAAK,YAAA;EACxB,OAAA,GAAU,EAAA;EACV,MAAA,GAAS,EAAA,UAAY,OAAA,EAAS,OAAA,CAAQ,YAAA;AAAA;;AzCkBd;AAS1B;iByCjBgB,eAAA;EAAkB;AAAA;EAAc,QAAA,EAAU,SAAS;AAAA,gCAAE,GAAA,CAAA,OAAA;;;;iBAiGrD,UAAA,IAAc,mBAAmB;;;;;UAYvC,UAAA;EACR,IAAA;EACA,OAAA,GAAU,YAAY;EACtB,EAAA;AAAA;AAAA,cAKW,OAAA;oBACO,YAAA;qBAOC,IAAA,CAAK,YAAA;mBAEP,IAAA,CAAK,YAAA;qBAEH,IAAA,CAAK,YAAA;kBAER,IAAA,CAAK,YAAA;qBAEF,IAAA,CAAK,YAAA;;;uBASL,OAAA,EAAW,OAAA,CAAQ,YAAA;yBAGf,KAAA,EAAO,UAAA;AAAA;AzChGhC;;;AAAA,iByCyGgB,OAAA,gCAAO,GAAA,CAAA,OAAA;;;UChMN,iBAAA;;EAEf,KAAA;;EAEA,QAAA,GAAW,KAAA;;EAEX,MAAA;;EAEA,OAAA;AAAA;;;;A1C4BF;;;;AAA4B;AAK5B;;;;AAAsB;iB0CbN,YAAA;EACd,KAAA;EACA,QAAA;EACA,MAAA;EACA;AAAA,GACC,iBAAA,+BAAiB,GAAA,CAAA,OAAA;;;;;;cCzCP,sBAAA"}
|
package/dist/src-DI-sLY25.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import{$ as e,A as t,C as n,D as r,E as i,F as a,I as o,J as s,M as c,N as l,P as u,S as d,T as f,V as p,Y as m,_ as h,a as g,at as _,c as v,d as y,ft as b,gt as x,h as S,j as C,l as w,m as T,n as E,nt as D,o as O,p as k,q as A,rt as j,s as ee,st as M,u as N,vt as P,yt as te}from"./api-S5ho3Qs3.js";import{c as ne,f as F}from"./keepAlive-bjIHulj-.js";import{n as re,r as ie,t as ae}from"./fetchClient-D0p358nB.js";import{A as oe,D as se,E as ce,N as I,S as le,T as ue,_ as de,a as fe,b as pe,c as me,d as he,f as ge,g as _e,h as ve,j as ye,l as be,m as xe,o as Se,p as Ce,s as we,u as Te,v as Ee,x as De,y as L}from"./utils-FOrjYCpW.js";import{i as Oe,n as ke}from"./colors-4aGxuAVw.js";import{$t as Ae,An as je,Bn as Me,Bt as Ne,C as Pe,Cn as Fe,Dn as Ie,En as R,F as Le,Ft as Re,Gt as z,Hn as ze,Ht as Be,It as Ve,Jt as He,Kt as Ue,L as We,Lt as Ge,M as Ke,Mn as qe,N as Je,Nn as Ye,Nt as Xe,On as Ze,P as Qe,Pn as $e,Qt as et,Rt as tt,Sn as nt,St as rt,T as it,Tn as at,Un as ot,Ut as st,V as B,Vt as ct,Wt as lt,Xt as ut,Yt as dt,_t as ft,an as pt,bn as mt,bt as ht,cn as gt,d as _t,dt as vt,en as yt,f as bt,hn as xt,i as St,in as Ct,j as wt,jn as Tt,k as Et,kn as Dt,l as Ot,lt as kt,n as At,nn as jt,on as Mt,p as Nt,pt as Pt,qt as Ft,rn as It,t as Lt,tn as Rt,tt as zt,u as Bt,ut as Vt,vn as Ht,vt as Ut,w as Wt,wn as Gt,x as Kt,xn as qt,xt as Jt,yn as Yt,zn as Xt}from"./hooks-CrJq15DU.js";import{Rt as Zt,c as Qt,g as $t,gt as en,l as tn,o as nn,r as rn,s as an,st as on,t as sn,ut as cn,zt as ln}from"./utils-Dl2dMzK8.js";import{EXPLORE_ACTION as un,EXPLORE_SOURCE as dn,trackArtifactUploadStarted as fn,trackColumnLevelLineage as pn,trackCopyToClipboard as mn,trackDwSetupCompleted as hn,trackDwSetupShown as gn,trackDwSetupSkipped as _n,trackEnvironmentConfig as vn,trackExploreAction as yn,trackHistoryAction as bn,trackInit as xn,trackLineageSelection as Sn,trackLineageViewRender as Cn,trackMultiNodesAction as wn,trackNavigation as Tn,trackOssShareButtonClicked as En,trackProfileDistribution as Dn,trackRedirectToCloudSession as On,trackSignupCompleted as kn,trackSignupRedirectInitiated as An,trackStateAction as jn}from"./lib/api/track.js";import{PUBLIC_API_URL as Mn,PUBLIC_CLOUD_WEB_URL as Nn,RECCE_SUPPORT_CALENDAR_URL as Pn}from"./lib/const.js";import{t as Fn}from"./constants-Bgp90yan.js";import{fetchGitHubAvatar as In,fetchUser as Ln}from"./lib/api/user.js";import{QueryClient as Rn,QueryClientProvider as zn,useMutation as Bn,useQuery as Vn,useQueryClient as Hn}from"@tanstack/react-query";import{Suspense as Un,createContext as Wn,forwardRef as Gn,memo as Kn,useCallback as V,useContext as qn,useEffect as H,useImperativeHandle as Jn,useLayoutEffect as Yn,useMemo as U,useRef as Xn,useState as W}from"react";import{Fragment as G,jsx as K,jsxs as q}from"react/jsx-runtime";import J from"@mui/material/Box";import Y from"@mui/material/Button";import Zn from"@mui/material/Dialog";import Qn from"@mui/material/DialogActions";import $n from"@mui/material/DialogContent";import er from"@mui/material/DialogTitle";import tr from"@mui/material/Link";import X from"@mui/material/Stack";import Z from"@mui/material/Typography";import nr from"js-cookie";import{LuExternalLink as rr,LuSave as ir}from"react-icons/lu";import{useTheme as ar}from"@mui/material/styles";import{useTheme as or}from"next-themes";import Q from"@mui/material/IconButton";import sr from"next/link";import{IoBookmarksOutline as cr,IoClose as lr,IoSync as ur,IoWarning as dr}from"react-icons/io5";import fr from"@mui/material/Chip";import{Background as pr,BackgroundVariant as mr,BaseEdge as hr,ControlButton as gr,Controls as _r,MiniMap as vr,Panel as yr,Position as br,ReactFlow as xr,ReactFlowProvider as Sr,getBezierPath as Cr,getNodesBounds as wr,useEdgesState as Tr,useNodesState as Er,useReactFlow as Dr,useStore as Or}from"@xyflow/react";import $ from"@mui/material/Tooltip";import kr from"file-saver";import Ar from"@mui/material/Checkbox";import jr from"@mui/material/FormControlLabel";import{PiBookmarkSimple as Mr,PiCaretDown as Nr,PiChatText as Pr,PiCheckCircle as Fr,PiCircle as Ir,PiCopy as Lr,PiExport as Rr,PiInfo as zr,PiInfoFill as Br,PiMoon as Vr,PiNotePencil as Hr,PiPencil as Ur,PiPencilSimple as Wr,PiPlusCircle as Gr,PiRepeat as Kr,PiSun as qr,PiTrashFill as Jr,PiTrashSimple as Yr,PiUserPlus as Xr,PiX as Zr}from"react-icons/pi";import Qr from"@mui/material/Menu";import $r from"@mui/material/MenuItem";import{VscCircleLarge as ei,VscGitPullRequest as ti,VscHistory as ni,VscKebabVertical as ri}from"react-icons/vsc";import ii from"@mui/material/CircularProgress";import ai from"@mui/material/ListSubheader";import oi from"@mui/material/FormControl";import{Box as si,Typography as ci}from"@mui/material";import li from"@mui/material/TextField";import{format as ui,formatDistanceToNow as di}from"date-fns";import fi from"@mui/material/Divider";import pi from"@mui/material/Tab";import mi from"@mui/material/Tabs";import hi from"@mui/material/List";import gi from"@mui/material/ListItem";import _i from"@mui/material/Avatar";import vi from"@mui/material/Popover";import yi from"@mui/material/Alert";import bi from"@mui/material/InputBase";import{isEmpty as xi}from"lodash";import{usePathname as Si,useRouter as Ci,useSearchParams as wi}from"next/navigation";import{FaCloud as Ti,FaExpandArrowsAlt as Ei,FaGithub as Di,FaQuestionCircle as Oi,FaRegDotCircle as ki,FaSlack as Ai,FaUser as ji}from"react-icons/fa";import{MdArrowBack as Mi,MdArrowDownward as Ni,MdArrowUpward as Pi,MdGpsFixed as Fi,MdInfo as Ii,MdSearch as Li}from"react-icons/md";import{TbChecklist as Ri,TbEdit as zi}from"react-icons/tb";import{FiArrowRight as Bi,FiCopy as Vi,FiInfo as Hi,FiPackage as Ui}from"react-icons/fi";import Wi from"@mui/material/Switch";import{RiArrowDownSFill as Gi,RiArrowUpSFill as Ki,RiMindMap as qi,RiSwapLine as Ji,RiTerminalBoxLine as Yi}from"react-icons/ri";import{FaBookmark as Xi,FaFileImport as Zi}from"react-icons/fa6";import Qi from"@mui/material/ListItemIcon";import $i from"@mui/material/ListItemText";import{captureException as ea}from"@sentry/react";import{BiArrowFromBottom as ta,BiArrowToBottom as na}from"react-icons/bi";import"@xyflow/react/dist/style.css";import ra from"@dagrejs/dagre";import ia from"@mui/material/Skeleton";import aa from"@mui/material/Radio";import oa from"@mui/material/RadioGroup";import{snapdom as sa}from"@zumer/snapdom";import ca from"@mui/material/Paper";import la from"@mui/material/Table";import ua from"@mui/material/TableBody";import da from"@mui/material/TableCell";import fa from"@mui/material/TableContainer";import pa from"@mui/material/TableHead";import ma from"@mui/material/TableRow";import ha from"@mui/material/InputLabel";import ga from"@mui/material/Select";import _a from"@mui/material/Badge";import va from"@mui/material/Grid";import{stripIndents as ya}from"common-tags";import{IoMdCodeWorking as ba}from"react-icons/io";import{DragDropContext as xa,Draggable as Sa,Droppable as Ca}from"@hello-pangea/dnd";import wa from"@mui/material/Card";import Ta from"@mui/material/CardContent";import Ea from"@mui/material/CardHeader";const Da=Wn(null);Da.displayName=`RecceRoutingContext`;function Oa(){return qn(Da)||{basePath:``,buildPath:e=>e,pathname:``,navigate:e=>{typeof window<`u`&&(window.location.href=e)}}}function ka(){let{pathname:e,navigate:t}=Oa();return[e,t]}function Aa({children:e,config:t}){let n=t?.basePath??``,r=t?.pathname??``,i=t?.onNavigate,a=V(e=>n?`${n}${e.startsWith(`/`)?e:`/${e}`}`:e,[n]),o=V((e,t)=>{i?i(e,t):typeof window<`u`&&(t?.replace?(window.history.replaceState(null,``,e),window.dispatchEvent(new PopStateEvent(`popstate`))):window.location.href=e)},[i]),s=U(()=>({basePath:n,buildPath:a,pathname:r,navigate:o}),[n,a,r,o]);return K(Da.Provider,{value:s,children:e})}const ja=e=>new Rn({defaultOptions:{queries:{staleTime:e?.staleTime??1e3*60,gcTime:e?.gcTime??1e3*60*5,retry:1,refetchOnWindowFocus:!1}}});function Ma({children:e,api:t,theme:n=`system`,routing:r,queryClient:i,runActions:a,lineage:o,checks:s,query:c,features:l={}}){let u=i?.staleTime,d=i?.gcTime,f=U(()=>ja({staleTime:u,gcTime:d}),[u,d]),{enableInstance:p=!0,enableIdleTimeout:m=!0,enableLineage:h=!0,enableRunActions:g=!0,enableChecks:_=!0,enableQuery:v=!0}=l,y=e;return y=K(Aa,{config:r,children:y}),y=K(ln,{defaultMode:n,children:y}),y=K(ne,{config:t,children:y}),y=K(zn,{client:f,children:y}),v&&(y=K(Me,{sql:c?.sql,isExecuting:c?.isExecuting,error:c?.error,baseResult:c?.baseResult,currentResult:c?.currentResult,onSqlChange:c?.onSqlChange,onExecute:c?.onExecute,onCancel:c?.onCancel,children:y})),_&&(y=K(ze,{checks:s?.checks,isLoading:s?.isLoading,error:s?.error,selectedCheckId:s?.selectedCheckId,onSelectCheck:s?.onSelectCheck,onCreateCheck:s?.onCreateCheck,onUpdateCheck:s?.onUpdateCheck,onDeleteCheck:s?.onDeleteCheck,onReorderChecks:s?.onReorderChecks,refetchChecks:s?.refetchChecks,children:y})),g&&(y=K(oe,{onRunAction:a?.onRunAction,onShowRunId:a?.onShowRunId,initialRunId:a?.initialRunId,initialHistoryOpen:a?.initialHistoryOpen,children:y})),h&&(y=K(Ee,{lineageGraph:o?.lineageGraph,envInfo:o?.envInfo,reviewMode:o?.reviewMode,cloudMode:o?.cloudMode,fileMode:o?.fileMode,fileName:o?.fileName,isDemoSite:o?.isDemoSite,isCodespace:o?.isCodespace,isLoading:o?.isLoading,error:o?.error,supportTasks:o?.supportTasks,onRefetchLineageGraph:o?.onRefetchLineageGraph,runsAggregated:o?.runsAggregated,onRefetchRunsAggregated:o?.onRefetchRunsAggregated,children:y})),m&&(y=K(De,{children:y})),p&&(y=K(ue,{children:y})),y}function Na(e){let{id:t,data:n}=e,{id:r}=n.node,{column:i,type:a,transformationType:o,changeStatus:s,isImpacted:c}=n,l=Or(e=>e.transform[2]>.3),{isDark:u}=Lt(),{viewOptions:d,showContextMenu:f,isNodeHighlighted:p,isNodeShowingChangeAnalysis:m,newCllExperience:h}=de(),g=d.column_level_lineage?.node_id,_=i===d.column_level_lineage?.column&&r===g,v=p(t),y=m(r);return K(Ht,{id:t,data:{column:i,type:a,nodeId:r,transformationType:o,changeStatus:s,isHighlighted:v,isFocused:_,isImpacted:c},showContent:l,showChangeAnalysis:y,isDark:u,newCllExperience:h,onContextMenu:(t,n)=>{f(t,e)}})}const Pa=Kn(Na);Pa.displayName=`GraphColumnNode`;function Fa(e){let{source:t,target:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,style:l={},markerEnd:u,data:d,isEdgeHighlighted:f}=e,p={...l};d?.changeStatus&&(p.stroke=Ze(d.changeStatus).hexColor,p.strokeDasharray=`5`),!f||f(t,n)||(p.filter=Tt);let[m]=Cr({sourceX:r,sourceY:i,sourcePosition:s,targetX:a,targetY:o,targetPosition:c});return K(G,{children:K(hr,{path:m,markerEnd:u,style:{...p,...l}})})}const Ia=Kn(Fa);Ia.displayName=`GraphEdge`;function La(e){let{isEdgeHighlighted:t}=de();return K(Ia,{...e,isEdgeHighlighted:t})}const Ra=()=>K(`svg`,{stroke:`currentColor`,fill:`currentColor`,strokeWidth:`0`,viewBox:`0 0 256 256`,height:`1em`,width:`1em`,xmlns:`http://www.w3.org/2000/svg`,children:K(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z`})}),za=()=>K(`svg`,{stroke:`currentColor`,fill:`currentColor`,strokeWidth:`0`,viewBox:`0 0 256 256`,height:`1em`,width:`1em`,xmlns:`http://www.w3.org/2000/svg`,children:K(`path`,{d:`M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z`})});function Ba({skipReason:e}){return K(fr,{size:`small`,label:q(X,{direction:`row`,sx:{fontSize:`10pt`,color:`grey.500`,alignItems:`center`,gap:`3px`},children:[K(J,{children:`Skipped`}),e&&K($,{title:e,children:K(J,{component:`span`,sx:{display:`flex`},children:K(Ra,{})})})]}),sx:{bgcolor:`grey.100`}})}function Va({errorMessage:e}){return q(X,{direction:`row`,sx:{fontSize:`10pt`,color:`gray`,alignItems:`center`},children:[K(J,{children:`Error`}),e&&K($,{title:e,children:K(J,{component:`span`,sx:{display:`flex`},children:K(za,{})})})]})}function Ha({result:e}){let{mismatchedColumns:t}=e,n=t>0;return K(fr,{size:`small`,sx:{bgcolor:n?`error.light`:`success.light`},label:K(X,{direction:`row`,sx:{fontSize:`10pt`,color:n?`error.main`:`success.main`,alignItems:`center`,gap:`3px`},children:n?`${t} columns mismatched`:`All columns match`})})}function Ua({result:e}){let{base:t,current:n}=e,r=t===null?`N/A`:t.toLocaleString(),i=n===null?`N/A`:n.toLocaleString(),a=``,o=`grey.500`;return t!==null&&n!==null&&(n>t?(a=`↑`,o=`success.main`):n<t?(a=`↓`,o=`error.main`):a=`=`),K(fr,{size:`small`,sx:{bgcolor:`grey.100`},label:q(X,{direction:`row`,sx:{fontSize:`10pt`,alignItems:`center`,gap:`3px`},children:[K(J,{children:r}),K(J,{children:`→`}),K(J,{children:i}),a&&K(J,{component:`span`,sx:{color:o,ml:.5},children:a})]})})}function Wa({status:e,skipReason:t,errorMessage:n,progress:r,valueDiffResult:i,rowCountDiffResult:a,runId:o,"data-testid":s}){return e===`pending`?K(ii,{size:16,"data-testid":s,"data-status":`pending`}):e===`skipped`?K(J,{"data-testid":s,"data-status":`skipped`,children:K(Ba,{skipReason:t})}):e===`running`?r?.percentage===void 0?K(ii,{size:16,"data-testid":s,"data-status":`running`}):K(ii,{variant:`determinate`,value:r.percentage*100,size:16,"data-testid":s,"data-status":`running`}):e===`error`?K(J,{"data-testid":s,"data-status":`error`,children:K(Va,{errorMessage:n})}):i?K(J,{"data-testid":s,"data-status":`success`,children:K(Ha,{result:i})}):a?K(J,{"data-testid":s,"data-status":`success`,children:K(Ua,{result:a})}):K(J,{"data-testid":s,"data-status":`success`,children:o||`Complete`})}const Ga=Kn(Wa);Ga.displayName=`ActionTag`;function Ka({color:e}){return K(J,{component:`span`,sx:{display:`inline-block`,width:`10px`,height:`10px`,bgcolor:e,mr:1,borderRadius:`4px`}})}const qa=({defaultPrimaryKeys:e,onPrimaryKeysChange:t,...n})=>{let{isActionAvailable:r}=L(),i=U(()=>[],[]);return K(J,{sx:{display:`flex`},...n,children:q(X,{spacing:0,sx:{m:`0 0.5rem`},children:[q(X,{direction:`row`,spacing:.5,sx:{alignItems:`center`},children:[K(Z,{component:`label`,sx:{fontSize:`0.625rem`,color:`text.secondary`},children:`Diff with Primary Key(s) (suggested)`}),K($,{title:`Provide a primary key to perform query diff in data warehouse and only return changed rows.`,placement:`bottom-end`,children:K(J,{component:`span`,sx:{display:`flex`,color:`grey.600`,cursor:`help`},children:K(zr,{fontSize:`0.75rem`})})})]}),K(ft,{className:`no-track-pii-safe`,unitName:`key`,defaultValues:e,suggestionList:i,onValuesChange:t,size:`2xs`,width:`240px`,placeholder:`Select or type to add keys`,disabled:!r(`query_diff_with_primary_key`)})]})})};function Ja({supportCalendarUrl:e=`https://cal.com/team/recce/chat`}){let{data:t}=se();return K(`div`,{className:`flex flex-1 h-full min-h-0 m-2 p-4 bg-blue-50 rounded-lg shadow-md justify-center`,children:q(`div`,{className:`w-4/5 flex flex-col overflow-y-auto gap-6 px-8 pb-8`,children:[q(X,{spacing:2,sx:{alignItems:`center`},children:[K(J,{sx:{p:1,bgcolor:`background.paper`,borderRadius:`50%`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:2},children:K(J,{component:Yi,sx:{fontSize:28,color:`iochmara.500`}})}),K(Z,{variant:`h5`,sx:{mt:2},children:`Wait, there's more!`}),q(Z,{sx:{fontSize:`1rem`,textAlign:`center`},children:[`Query functions disabled without a`,` `,K(Z,{component:`span`,sx:{fontWeight:`bold`},children:`data warehouse connection`})]})]}),K(X,{sx:{width:`50%`,mt:3,mx:`auto`},children:K(Y,{color:`iochmara`,variant:`contained`,size:`large`,onClick:()=>{window.open(sn(t,e),`_blank`)},children:`Connect to Data Warehouse`})})]})})}const Ya=()=>{let{isCustomQueries:e,setCustomQueries:t,sqlQuery:n,setBaseSqlQuery:r}=Kt();return q(J,{children:[q(X,{direction:`row`,spacing:.5,sx:{alignItems:`center`,fontSize:`0.75rem`},children:[K(Z,{variant:`body2`,sx:{fontSize:`0.75rem`},children:`Custom Queries`}),K($,{title:`Custom queries allow you to use two SQL queries to compare results between current and base environments.`,children:K(J,{component:`span`,sx:{display:`flex`,color:`grey.600`},children:K(Br,{fontSize:`1rem`})})})]}),K(Wi,{size:`small`,checked:e,onChange:()=>{!e&&r&&r(n),t(!e)},color:`primary`})]})},Xa=()=>{let{sqlQuery:e,baseSqlQuery:t,setSqlQuery:n,setBaseSqlQuery:r,primaryKeys:i,setPrimaryKeys:a,isCustomQueries:o}=Kt(),{lineageGraph:c,envInfo:l}=L(),{featureToggles:u,singleEnv:d}=ce(),f=e;l?.adapterType===`sqlmesh`&&e===`select * from {{ ref("mymodel") }}`&&(f=`select * from db.mymodel`),u.mode===`read only`&&(f=`--- Would like to do query here? Book a demo with us at ${Pn}\n${f}`);let{showRunId:p}=ye(),{apiClient:h}=Wt(),{mutate:g,isPending:_}=Bn({mutationFn:async e=>{function n(e){switch(e){case`query`:return A;case`query_base`:return s;case`query_diff`:return m;default:throw Error(`Unknown query type: ${e}`)}}let r=e===`query_base`?t??``:f,a=n(e),c={sql_template:r},l={nowait:!0};e===`query_diff`&&(c.primary_keys=i,o&&(c.base_sql_template=t));let{run_id:u}=await a(c,l,h);return p(u),await j(u,void 0,h)}}),v=U(()=>{let e={};if(!c)return`N/A`;for(let t in c.nodes){let n=c.nodes[t].data.schema;n&&(e[n]=(e[n]||0)+1)}return Object.keys(e).reduce((t,n)=>e[n]>(e[t]||0)?n:t,`N/A`)},[c]);return d||u.mode===`metadata only`?q(J,{sx:{display:`flex`,flexDirection:`column`,height:`100%`},children:[q(J,{sx:{display:`flex`,justifyContent:`right`,alignItems:`center`,padding:`4pt 8pt`,gap:`5px`,height:`54px`,borderBottom:`1px solid`,borderColor:`divider`},children:[K(ec,{}),K(J,{sx:{flexGrow:1}}),d?K($,{title:`Please configure the base environment before running the diff`,placement:`left`,children:K(`span`,{children:K(Y,{variant:`contained`,disabled:!0,size:`small`,sx:{fontSize:`14px`,mt:`16px`},children:`Run Diff`})})}):K(ul,{display:u.mode===`metadata only`,children:K(Y,{variant:`contained`,disabled:!0,size:`small`,sx:{fontSize:`14px`,mt:`16px`},children:`Run Diff`})})]}),K(Ke,{value:f,onChange:n,onRun:()=>{g(`query`)},labels:[`base (production)`,`current (${v})`],SetupGuide:u.mode===`metadata only`?K(Ja,{}):K(Ys,{})})]}):q(J,{sx:{display:`flex`,flexDirection:`column`,height:`100%`},children:[q(J,{sx:{display:`flex`,justifyContent:`right`,alignItems:`flex-end`,padding:`4pt 8pt`,gap:`5px`,height:`54px`,borderBottom:`1px solid`,borderColor:`divider`,flex:`0 0 54px`},children:[K(ec,{}),K(Ya,{}),K(J,{sx:{flexGrow:1}}),K(qa,{defaultPrimaryKeys:i,onPrimaryKeysChange:a}),K(Y,{variant:`contained`,onClick:()=>{g(`query_diff`)},disabled:_||u.disableDatabaseQuery,size:`small`,children:`Run Diff`})]}),K(J,{sx:{width:`100%`,flex:1,overflowY:`auto`},children:o?K(Ke,{value:f,baseValue:t,onChange:n,onChangeBase:r,onRun:()=>{g(`query`)},onRunBase:()=>{g(`query_base`)},onRunDiff:()=>{g(`query_diff`)}}):K(Je,{value:f,onChange:n,onRun:()=>{g(`query`)},onRunDiff:()=>{g(`query_diff`)}})})]})};function Za({rowCount:e}){let t=e.base,n=e.curr,r=e.base===null?`N/A`:`${e.base} Rows`,i=e.curr===null?`N/A`:`${e.curr} Rows`,a,o;t===null&&n===null?(a=`Failed to load`,o=`default`):t===null||n===null?(a=`${r} -> ${i}`,o=t===null?`success`:`error`):t===n?(a=`=`,o=`default`):(a=`${$t(t,n)} Rows`,o=t<n?`success`:`error`);let s=B(`row_count_diff`).icon;return K(fr,{size:`small`,color:o,icon:s?K(s,{}):void 0,label:a,sx:{height:20,fontSize:`0.7rem`}})}function Qa({id:e,inverted:t}){let{lineageGraph:n,runsAggregated:r}=L(),{text:i,isDark:a}=Lt(),o=r?.[e],s=n?.nodes[e];if(!o&&!s)return null;let c;s?.data.change?.columns&&(c=Object.keys(s.data.change.columns).length>0);let l;if(o?.row_count_diff){let e=o.row_count_diff.result;l=e.curr!==e.base}let u=t?i.inverted:Ze(`modified`).color,d=t?i.secondary:a?`grey.700`:`grey.100`,f=B(`schema_diff`).icon;return q(J,{sx:{display:`flex`,flex:1,alignItems:`center`},children:[c!==void 0&&K($,{title:`Schema (${c?`changed`:`no change`})`,enterDelay:500,children:K(J,{sx:{height:16},children:f&&K(J,{component:f,sx:{color:c?u:d}})})}),K(J,{sx:{flexGrow:1}}),o?.row_count_diff&&l!==void 0&&K($,{title:`Row count (${l?`changed`:`=`})`,enterDelay:500,children:K(J,{children:K(Za,{rowCount:o.row_count_diff.result})})})]})}function $a({nodeId:e,nodeName:t}){let{getNodeAction:n}=de(),r=n(e);if(!r)return null;let{status:i,skipReason:a,run:o}=r;if(i===`pending`)return K(Ga,{status:`pending`});if(i===`skipped`)return K(Ga,{status:`skipped`,skipReason:a});if(!o)return K(Ga,{status:`pending`});let{error:s,run_id:c,progress:l}=o;if(i===`running`)return K(Ga,{status:`running`,progress:{percentage:l?.percentage}});if(s)return K(Ga,{status:`error`,errorMessage:s});if(o.type===`value_diff`&&o.result){let e=o.result,t=0,n=e.data.data.length;for(let n of e.data.data)n[2]<1&&t++;return K(Ga,{status:`success`,valueDiffResult:{mismatchedColumns:t,totalColumns:n}})}if(b(o)&&o.result){let e=o.result[t];if(e)return K(Za,{rowCount:e})}if(o.type===`row_count`&&o.result){let e=o.result[t];if(e?.curr!==void 0&&e.curr!==null)return K(fr,{size:`small`,label:`${e.curr.toLocaleString()} Rows`,sx:{height:20,fontSize:`0.7rem`}})}return K(Ga,{status:`success`,runId:c})}function eo(e){let{data:t}=e,{id:n,resourceType:r,changeStatus:i,name:a}=t,o=Or(e=>e.transform[2]>.3),{isDark:s}=Lt(),c=de(),{interactive:l,selectNode:u,selectMode:d,focusedNode:f,getNodeAction:p,getNodeColumnSet:m,isNodeHighlighted:h,isNodeSelected:g,isNodeShowingChangeAnalysis:_,showContextMenu:v,viewOptions:y,cll:b,impactedNodeIds:x,newCllExperience:S,wholeModelImpact:C}=c,w=S?x.has(n):!1,{isWholeModelChanged:T,isWholeModelImpacted:E}=Ct(n,c),D=b?.current.nodes[n]?.change_category,O=h(n),k=g(n),A=y.column_level_lineage?.node_id===n&&y.column_level_lineage.column===void 0,j=f?.id===n||A,ee=_(n),M=m(t.id),N=d===`action_result`?p(t.id):void 0,P=i,te=d,ne=d===`action_result`&&N?K($a,{nodeId:n,nodeName:a}):void 0,F=d!==`action_result`&&t.resourceType===`model`?K(Qa,{id:t.id,inverted:d===`selecting`&&k}):void 0;return K(Rt,{id:n,data:{label:a,changeStatus:P,resourceType:r,materialized:t.materialized},newCllExperience:S,isImpacted:w,isWholeModelChanged:T,isWholeModelImpacted:E,wholeModelImpact:C,interactive:l,selectMode:te,isNodeSelected:k,isFocused:j,isHighlighted:O,showContent:o,actionTag:ne,showChangeAnalysis:ee,changeCategory:D,runsAggregatedTag:F,hasParents:Object.keys(t.parents).length>0,hasChildren:Object.keys(t.children).length>0,columnCount:M.size,columnHeight:24,isDark:s,onSelect:e=>{u(e)},onContextMenu:(t,n)=>{v(t,e)}})}const to=Kn(eo);to.displayName=`GraphNode`;const no={lineageGraphNode:to,lineageGraphColumnNode:Pa},ro={lineageGraphEdge:La},io=[],ao=(e={})=>t=>{let{impactedNodeIds:n,newCllExperience:r}=e;return je({changeStatus:t.data.changeStatus,isImpacted:r?n?.has(t.id):!1,newCllExperience:r}).color},oo={ROW_COUNT:`row_count`,ROW_COUNT_DIFF:`row_count_diff`,PROFILE:`profile`,PROFILE_DIFF:`profile_diff`,VALUE_DIFF:`value_diff`,HISTOGRAM_DIFF:`histogram_diff`,TOP_K_DIFF:`top_k_diff`},so={LINEAGE_VIEW_CONTEXT_MENU:`lineage_view_context_menu`},co={SELECT_PARENT_NODES:`select_parent_nodes`,SELECT_CHILD_NODES:`select_child_nodes`,SELECT_ALL_UPSTREAM:`select_all_upstream`,SELECT_ALL_DOWNSTREAM:`select_all_downstream`},lo=({menuItems:e,open:t,onClose:n,x:r,y:i,featureToggles:a,DisabledItemWrapper:o})=>{let s=o??(({children:e})=>K(G,{children:e})),c=a?.mode===`metadata only`;return K(Qr,{open:t,onClose:n,anchorReference:`anchorPosition`,anchorPosition:{top:i,left:r},slotProps:{paper:{sx:{fontSize:`0.85rem`,width:`250px`}}},children:e.length===0?K($r,{disabled:!0,children:`No action available`},`no action`):e.map(({isSeparator:e,label:t,isDisabled:r,action:i,itemIcon:a})=>{if(e)return K(fi,{},t);let l=q($r,{disabled:r,onClick:()=>{i&&i(),n()},children:[a,` `,t]},t);return r&&o?K(s,{display:c,children:l},t):l})})},uo=({isOpen:e,onClose:t,x:n,y:r,node:i,deps:a={},viewOptions:o={},featureToggles:s={},serverFlags:c={},noCatalogCurrent:l=!1,isActionAvailable:u=()=>!0})=>{let d=[],{runAction:f,onNavigate:p,onTrack:m,findByRunType:h,setSqlQuery:g,setPrimaryKeys:_,getPrimaryKey:v,DisabledItemWrapper:y}=a,{selectMode:b,cll:x,showColumnLevelLineage:S,setChangeAnalysisMode:C,selectParentNodes:w,selectChildNodes:T,getNodeColumnSet:E}=o,D=c.single_env_onboarding??!1,O=s.disableDatabaseQuery??!1;if(!i?.data)return K(G,{});let k=i.data,A=k.resourceType,j=E?Array.from(E(i.id)):[],ee={source:`lineage_model_node`},M=k.changeStatus,N=v?.(k.name);if(M===`modified`&&d.push({label:`Show Impact Radius`,itemIcon:K(ki,{}),isDisabled:l||!u(`change_analysis`),action:()=>{C?.(!0),S?.({node_id:i.id,change_analysis:!0,no_upstream:!0})}}),!b&&A&&[`model`,`seed`,`snapshot`].includes(A)){d.length>0&&d.push({label:`select group one`,isSeparator:!0});let e=h?.(D?`query`:`query_diff`),t=k.change?.columns?Object.keys(k.change.columns):[],n=Qt(t,t),r=`select * from {{ ref("${k.name}") }}`;if(n.length&&(r=`select \n ${n.join(`
|
|
3
|
-
`)}\nfrom {{ ref("${k.name}") }}`),e&&d.push({label:`Query`,itemIcon:K(J,{component:e.icon,sx:{display:`inline-flex`}}),isDisabled:O,action:()=>{g?.(r),u(`query_diff_with_primary_key`)&&_?.(N===void 0?void 0:[N]),p?.(`/query`)}}),j.length>0&&e)if(x!==void 0){let t=new Set;N&&t.add(N),j.forEach(e=>{t.add(e)}),d.push({label:`Query Related Columns`,itemIcon:K(J,{component:e.icon,sx:{display:`inline-flex`}}),isDisabled:O,action:()=>{let e=`select \n ${Array.from(t).join(`,
|
|
4
|
-
`)}\nfrom {{ ref("${k.name}") }}`;g?.(e),u(`query_diff_with_primary_key`)&&_?.(N===void 0?void 0:[N]),p?.(`/query`)}})}else{let t=Object.entries(k.change?.columns??{}).filter(([,e])=>e===`modified`).map(([e])=>e);if(t.length>0){let n=new Set;N&&n.add(N),t.forEach(e=>{n.add(e)}),d.push({label:`Query Modified Columns`,itemIcon:K(J,{component:e.icon,sx:{display:`inline-flex`}}),isDisabled:O,action:()=>{let e=`select \n ${Array.from(n).join(`,
|
|
5
|
-
`)}\nfrom {{ ref("${k.name}") }}`;g?.(e),u(`query_diff_with_primary_key`)&&_?.(N===void 0?void 0:[N]),p?.(`/query`)}})}}let a=D?`row_count`:`row_count_diff`,o=h?.(a);o&&d.push({label:o.title,itemIcon:K(J,{component:o.icon,sx:{display:`inline-flex`}}),isDisabled:O,action:()=>{m?.(`explore_action`,{action:D?oo.ROW_COUNT:oo.ROW_COUNT_DIFF,source:so.LINEAGE_VIEW_CONTEXT_MENU,node_count:1}),f?.(a,{node_names:[k.name]},{showForm:!1,trackProps:ee})}});let s=D?`profile`:`profile_diff`,c=h?.(s);if(c&&d.push({label:c.title,itemIcon:K(J,{component:c.icon,sx:{display:`inline-flex`}}),isDisabled:O,action:()=>{let e=E?Array.from(E(i.id)):[];m?.(`explore_action`,{action:D?oo.PROFILE:oo.PROFILE_DIFF,source:so.LINEAGE_VIEW_CONTEXT_MENU,node_count:1}),f?.(s,{model:k.name,columns:e},{showForm:!0,trackProps:ee})}}),!D){let e=h?.(`value_diff`);e&&d.push({label:e.title,itemIcon:K(J,{component:e.icon,sx:{display:`inline-flex`}}),isDisabled:O,action:()=>{let e=E?Array.from(E(i.id)):[];m?.(`explore_action`,{action:oo.VALUE_DIFF,source:so.LINEAGE_VIEW_CONTEXT_MENU,node_count:1}),f?.(`value_diff`,{model:k.name,columns:e},{showForm:!0,trackProps:ee})}})}}return D||(d.length>0&&d.push({label:`select group two`,isSeparator:!0}),d.push({label:`Select Parent Nodes`,itemIcon:K(ta,{}),action:()=>{m?.(`lineage_selection`,{action:co.SELECT_PARENT_NODES}),w?.(i.id,1)}}),d.push({label:`Select Child Nodes`,itemIcon:K(na,{}),action:()=>{m?.(`lineage_selection`,{action:co.SELECT_CHILD_NODES}),T?.(i.id,1)}}),d.push({label:`Select All Upstream Nodes`,itemIcon:K(ta,{}),action:()=>{m?.(`lineage_selection`,{action:co.SELECT_ALL_UPSTREAM}),w?.(i.id)}}),d.push({label:`Select All Downstream Nodes`,itemIcon:K(na,{}),action:()=>{m?.(`lineage_selection`,{action:co.SELECT_ALL_DOWNSTREAM}),T?.(i.id)}})),K(lo,{x:n,y:r,menuItems:d,open:e,onClose:t,featureToggles:s,DisabledItemWrapper:y})},fo=({isOpen:e,onClose:t,x:n,y:r,node:i,deps:a={},featureToggles:o={},serverFlags:s={},isActionAvailable:c=()=>!0})=>{let l=[],{runAction:u,onTrack:d,findByRunType:f,supportsHistogramDiff:p,DisabledItemWrapper:m}=a,h=s.single_env_onboarding??!1,g=o.disableDatabaseQuery??!1;if(i?.data===void 0)return K(G,{});let _=i.data,v=_.node,y=_.column,b=_.type,x={source:`lineage_column_node`},S=()=>{d?.(`explore_action`,{action:oo.PROFILE_DIFF,source:so.LINEAGE_VIEW_CONTEXT_MENU,node_count:1}),u?.(`profile_diff`,{model:v.name,columns:[y]},{showForm:!1,trackProps:x})},C=()=>{d?.(`explore_action`,{action:oo.HISTOGRAM_DIFF,source:so.LINEAGE_VIEW_CONTEXT_MENU,node_count:1}),u?.(`histogram_diff`,{model:v.name,column_name:y,column_type:b},{showForm:!1,trackProps:x})},w=()=>{d?.(`explore_action`,{action:oo.TOP_K_DIFF,source:so.LINEAGE_VIEW_CONTEXT_MENU,node_count:1}),u?.(`top_k_diff`,{model:v.name,column_name:y,k:50},{showForm:!1,trackProps:x})},T=()=>{d?.(`explore_action`,{action:oo.VALUE_DIFF,source:so.LINEAGE_VIEW_CONTEXT_MENU,node_count:1}),u?.(`value_diff`,{model:v.name,columns:[y]},{showForm:!0,trackProps:x})},E=_.changeStatus===`added`||_.changeStatus===`removed`,D=f?.(h?`profile`:`profile_diff`);if(D&&l.push({label:D.title,itemIcon:K(J,{component:D.icon,sx:{display:`inline-flex`}}),action:S,isDisabled:E||!c(`profile_diff`)||g}),!h){let e=f?.(`histogram_diff`);if(e){let t=p?.(b)??!0;l.push({label:e.title,itemIcon:K(J,{component:e.icon,sx:{display:`inline-flex`}}),action:C,isDisabled:E||!t||g})}let t=f?.(`top_k_diff`);t&&l.push({label:t.title,itemIcon:K(J,{component:t.icon,sx:{display:`inline-flex`}}),action:w,isDisabled:E||g});let n=f?.(`value_diff`);n&&l.push({label:n.title,itemIcon:K(J,{component:n.icon,sx:{display:`inline-flex`}}),action:T,isDisabled:E||g})}return K(lo,{x:n,y:r,menuItems:l,open:e,onClose:t,featureToggles:o,DisabledItemWrapper:m})},po=({isOpen:e,onClose:t,x:n,y:r,node:i,deps:a={},viewOptions:o={},featureToggles:s={},serverFlags:c={},noCatalogCurrent:l=!1,isActionAvailable:u=()=>!0})=>s.disableViewActionDropdown?K(lo,{menuItems:[],open:e,onClose:t,x:n,y:r,featureToggles:s,DisabledItemWrapper:a.DisabledItemWrapper}):i&&xe(i)?K(uo,{x:n,y:r,isOpen:e,onClose:t,node:i,deps:a,viewOptions:o,featureToggles:s,serverFlags:c,noCatalogCurrent:l,isActionAvailable:u}):i&&Ce(i)?K(fo,{x:n,y:r,isOpen:e,onClose:t,node:i,deps:a,featureToggles:s,serverFlags:c,isActionAvailable:u}):null,mo=()=>{let[e,t]=W(!1),n=()=>t(!0),r=()=>t(!1),[i,a]=W({x:0,y:0}),[o,s]=W();return{props:{x:i.x,y:i.y,node:o,isOpen:e,onClose:r},showContextMenu:(e,t,r)=>{a({x:e,y:t}),s(r),n()},closeContextMenu:()=>{a({x:0,y:0}),s(void 0),r()}}};function ho({actionState:e,onCancel:t,onClose:n}){let r=()=>e.mode===`per_node`?`${e.completed} / ${e.total}`:e.currentRun?.progress?.percentage?`${e.currentRun.progress.percentage*100}%`:e.status===`completed`?`100%`:`0%`,i=e.status===`running`||e.status===`canceling`;return K(J,{sx:{bgcolor:`background.paper`,borderRadius:1,boxShadow:6},children:q(X,{direction:`row`,divider:K(fi,{orientation:`vertical`,flexItem:!0}),spacing:2,sx:{p:`5px 15px`,mt:2},children:[q(J,{sx:{fontSize:`10pt`},children:[`Progress: `,r(),` `,e.status===`canceled`?` (canceled)`:``]}),i?K(Y,{size:`small`,variant:`outlined`,onClick:t,disabled:e.status===`canceling`,children:e.status===`canceling`?`Canceling`:`Cancel`}):K(X,{direction:`row`,children:K(Y,{size:`small`,variant:`outlined`,onClick:n,children:`Close`})})]})})}const go=({lineageGraph:e,cllInput:t,onCenterNode:n})=>{let r={cursor:`pointer`,fontFamily:`monospace`,bgcolor:en()?`grey.700`:`grey.100`,px:.5,borderRadius:.5};if(!e)return K(G,{});if(!t)return K(G,{children:`Default View`});if(t.node_id===void 0)return K(Z,{component:`span`,children:`Impact Radius for All Changed Models`});let i=t.node_id in e.nodes?e.nodes[t.node_id].data.name:t.node_id;if(!t.column){let e=t.node_id;return q(G,{children:[K(Z,{component:`span`,sx:{mr:`5px`},children:`Impact Radius for`}),K(J,{component:`code`,onClick:()=>{n(e)},sx:r,children:i})]})}let a=`${t.node_id}_${t.column}`;return q(G,{children:[q(Z,{component:`span`,sx:{mr:`5px`},children:[`Column Lineage for`,` `]}),q(J,{component:`code`,onClick:()=>{n(a)},sx:r,children:[i,`.`,t.column]})]})},_o=({action:e,interactive:t,viewOptions:n,lineageGraph:r,singleEnvMode:i=!1,changeAnalysisAvailable:a=!0,onShowCll:o,onResetCll:s,onCenterNode:c,setChangeAnalysisMode:l,newCllExperience:u=!1,changeAnalysisMode:d=!1})=>{let f=n.column_level_lineage,p=!r?.catalogMetadata.current,m=u&&d,h=f&&!(u&&!f.column);return q(X,{direction:`row`,spacing:`5px`,children:[!i&&!m&&K(J,{sx:{borderRadius:1,boxShadow:3},children:K($,{enterDelay:50,title:a?p?`Please provide catalog.json to enable Impact Radius`:``:`Requires warehouse connection`,placement:`top`,children:K(`span`,{children:K(Y,{size:`small`,variant:`outlined`,color:`neutral`,sx:{whiteSpace:`nowrap`,display:`inline-flex`,bgcolor:`background.paper`},disabled:!t||p||!a||e.isPending,startIcon:K(ki,{}),onClick:()=>{l?.(!0),o({no_upstream:!0,change_analysis:!0})},children:`Impact Radius`})})})}),h&&q(X,{direction:`row`,sx:{alignItems:`center`,borderRadius:1,boxShadow:3,border:`1px solid`,borderColor:`divider`,bgcolor:`background.paper`,fontSize:`0.8rem`,p:`0 0.625rem`},children:[K(go,{lineageGraph:r,cllInput:f,onCenterNode:c}),e.isError&&K($,{title:`Error: ${e.error.message}`,placement:`bottom`,children:K(Z,{component:`span`,sx:{color:`error.main`,ml:`2px`,display:`inline-flex`,alignItems:`center`},children:K(J,{component:zr,sx:{color:`error.main`,fontSize:`14px`}})})}),e.isPending?K(ii,{size:12,sx:{ml:`2px`}}):K(Q,{size:`small`,sx:{ml:`2px`},"aria-label":`Reset Column Level Lineage`,onClick:()=>{s()},children:K(Zr,{size:`10px`})})]})]})};function vo({anchorEl:e}){let[t,n]=W(!1),r=Xn(!1);H(()=>{if(!r.current){r.current=!0;try{localStorage.getItem(g.snapshotBaseIntroSeen)||n(!0)}catch{}}},[]);let i=V(()=>{try{localStorage.setItem(g.snapshotBaseIntroSeen,`1`)}catch{}n(!1)},[]);return q(vi,{open:t&&e!==null,anchorEl:e,onClose:i,anchorOrigin:{vertical:`bottom`,horizontal:`left`},transformOrigin:{vertical:`top`,horizontal:`left`},disableAutoFocus:!0,slotProps:{paper:{sx:{bgcolor:`grey.800`,color:`white`,p:2,maxWidth:360}}},children:[K(Z,{variant:`body2`,sx:{mb:1.5},children:`New: Recce now snapshots your base data when each PR is created. We'll let you know when production has changed since then so your comparisons stay accurate.`}),K(Y,{size:`small`,variant:`contained`,onClick:i,sx:{bgcolor:`grey.600`,"&:hover":{bgcolor:`grey.500`}},children:`Got it`})]})}const yo=()=>{let{isDark:e}=Lt(),{successToast:t,failToast:n}=on();return bt({imageType:`png`,shadowEffect:!0,backgroundColor:e?ke.neutral[900]:ke.neutral[50],ignoreElements:e=>{try{return e.classList.contains(_t)}catch{return e.className?e.className.includes(_t):!1}},onSuccess:()=>{t(`Copied the Lineage View as an image to clipboard`)},onError:e=>{console.error(`Error taking screenshot`,e),n(`Failed to copy image to clipboard`,e)}})},bo=()=>{let e=Ci(),{basePath:t}=I();return V(n=>{n.check_id&&e.push(`${t}/checks/?id=${n.check_id}`)},[e.push,t])},xo=new Set;function So(){let[e,t]=W(()=>new Set),[n,r]=W(()=>new Set),[i,a]=W(()=>xo),[o,s]=W(()=>xo);return{impactedNodeIds:e,impactedColumnIds:n,wholeModelImpactedNodeIds:i,wholeModelChangedNodeIds:o,publish:V(e=>{t(e.nodeIds),r(e.columnIds),a(e.wholeModelImpactedNodeIds??xo),s(e.wholeModelChangedNodeIds??xo)},[])}}const Co=(e,t)=>{let n=Xn({width:0,height:0});H(()=>{let r=e.current,i=new ResizeObserver(e=>{for(let r of e){let e=r.contentRect.width,i=r.contentRect.height;(Math.abs(i-n.current.height)>10||Math.abs(e-n.current.width)>10)&&n.current.height>0&&i>0&&n.current.width>0&&e>0&&t(),n.current={width:e,height:i}}});return r&&i.observe(r),()=>{r&&i.unobserve(r)}},[t,e])},wo=()=>V((e,t,n,r,i)=>{let a=e.filter(xe),o=Object.groupBy(a,e=>e.data.changeStatus??`unchanged`),s=Object.fromEntries(Object.entries(o).map(([e,t])=>[`nodes_${e}`,t?.length??0])),c={node_count:a.length,view_mode:t,impact_radius_enabled:n,right_sidebar_open:i,...s};r&&(c.cll_column_active=!0),Cn(c)},[]),To={lineageNode:Rt,lineageGraphColumnNode:Ht},Eo={lineageEdge:xt};function Do({nodes:e,edges:t,onNodeSelect:n,onNodeDoubleClick:r,onNodeContextMenu:i,showMiniMap:a=!0,showControls:o=!0,showBackground:s=!0,height:c=600,interactive:l=!0,minZoom:u,maxZoom:d,fitViewOptions:f}){let[p,m,h]=Er(e),[g,_,v]=Tr(t),y=V((e,t)=>{n?.(t.id)},[n]),b=V(()=>{n?.(null)},[n]),x=V((e,t)=>{r?.(t.id)},[r]),S=Xn(i);H(()=>{S.current=i},[i]);let C=i!=null,w=U(()=>{if(!C)return To;let e=e=>K(Rt,{...e,onContextMenu:(e,t)=>S.current?.(e,t)});return e.displayName=`LineageNodeWithContextMenu`,{...To,lineageNode:e}},[C]);return K(J,{sx:{width:`100%`,height:c},children:q(xr,{nodes:p,edges:g,onNodesChange:l?h:void 0,onEdgesChange:l?v:void 0,onNodeClick:y,onNodeDoubleClick:x,onPaneClick:b,nodeTypes:w,edgeTypes:Eo,fitView:!0,fitViewOptions:f,minZoom:u,maxZoom:d,nodesDraggable:l,nodesConnectable:!1,elementsSelectable:l,children:[s&&K(pr,{}),o&&K(_r,{}),a&&K(vr,{nodeColor:e=>{let t=e.data;return je({changeStatus:t.changeStatus,isImpacted:t.isImpacted,newCllExperience:t.newCllExperience}).color}})]})})}const Oo={row_count:un.ROW_COUNT,row_count_diff:un.ROW_COUNT_DIFF,value_diff:un.VALUE_DIFF},ko=e=>{let t=Oo[e.action];t&&yn({action:t,source:dn.LINEAGE_VIEW_TOP_BAR,node_count:e.node_count})},Ao=(e,t)=>it(e,{...t,onTrackAction:ko,trackingSource:dn.LINEAGE_VIEW_TOP_BAR});function jo({notification:e,type:t}){let n=O.lineageNotificationDismissed,[r,i]=W(()=>sessionStorage.getItem(n)!==`true`);if(e===null||!r)return null;let a={info:`iochmara.light`,success:`success.light`,warning:`warning.light`,error:`error.light`}[t];return q(J,{sx:{width:`100%`,display:`flex`,flexDirection:`row`,p:`5px 10px`,gap:`5px`,alignItems:`flex-start`,borderRadius:1,boxShadow:4,border:`1px solid`,borderColor:`neutral.light`,bgcolor:a},children:[e,K(J,{sx:{flex:1}}),K(Q,{size:`small`,onClick:()=>{sessionStorage.setItem(n,`true`),i(!1)},children:K(lr,{})})]})}function Mo({onClose:e}){let{cancel:t,actionState:n}=de();return K(ho,{actionState:n,onCancel:t,onClose:e})}const No=({action:e})=>{let{showColumnLevelLineage:t,resetColumnLevelLineage:n,interactive:r,viewOptions:i,centerNode:a,setChangeAnalysisMode:o,newCllExperience:s,changeAnalysisMode:c}=de(),{data:l}=ge(),u=l?.single_env_onboarding??!1,{lineageGraph:d,isActionAvailable:f}=L();return K(_o,{action:e,interactive:r,viewOptions:i,lineageGraph:d,singleEnvMode:u,changeAnalysisAvailable:f(`change_analysis`),onShowCll:t,onResetCll:()=>n(),onCenterNode:a,setChangeAnalysisMode:o,newCllExperience:s,changeAnalysisMode:c})};function Po(e){let{columns:t,parent_map:n}=e.current,r=new Map;function i(e){let a=r.get(e);if(a===`pending`)return!1;if(a!==void 0)return a;if(r.set(e,`pending`),t[e]?.change_status)return r.set(e,!0),!0;let o=n[e]??[];for(let t of o)if(i(t))return r.set(e,!0),!0;return r.set(e,!1),!1}let a=new Set;for(let e of Object.keys(t))i(e)&&a.add(e);return a}function Fo(e,t,n,r){if(n)return!0;if(!t)return!1;if(t.current.nodes[e]?.impacted)return!0;let i=r,a=`${e}_`;for(let e of i)if(e.startsWith(a))return!0;return!1}function Io(e,t){let n=[];for(let[e,r]of Object.entries(t.current.nodes))r.change_category===`breaking`&&n.push(e);if(n.length===0)return{wholeModelImpactedNodeIds:new Set,wholeModelChangedNodeIds:new Set};let r=new Set(n),i=new Set(n),a=new Set(n),o=[...n];for(;o.length>0;){let t=[];for(let n of o){let i=e.nodes[n];if(i)for(let e of Object.keys(i.data.children))a.has(e)||(a.add(e),r.add(e),t.push(e))}o=t}return{wholeModelImpactedNodeIds:r,wholeModelChangedNodeIds:i}}const Lo=e=>{let{runAction:t}=ye(),{setSqlQuery:n,setPrimaryKeys:r}=Kt(),i=Ci(),{primaryKey:a}=St(e),{basePath:o}=I();return{runAction:(e,n,r)=>{t(e,n,r)},onNavigate:e=>{i.push(`${o}${e}`)},onTrack:(e,t)=>{e===`explore_action`?yn({action:t.action,source:so.LINEAGE_VIEW_CONTEXT_MENU,node_count:t.node_count}):e===`lineage_selection`&&Sn({action:t.action})},supportsHistogramDiff:gt,findByRunType:e=>{let t=B(e);return t?{title:t.title,icon:t.icon}:void 0},setSqlQuery:n,setPrimaryKeys:r,getPrimaryKey:()=>a,DisabledItemWrapper:ul}},Ro=({isOpen:e,onClose:t,x:n,y:r,node:i})=>{let{selectParentNodes:a,selectChildNodes:o,getNodeColumnSet:s,selectMode:c,cll:l,showColumnLevelLineage:u,setChangeAnalysisMode:d}=de(),{featureToggles:f}=ce(),{isActionAvailable:p,lineageGraph:m}=L(),{data:h}=ge(),g=!m?.catalogMetadata.current;return K(po,{x:n,y:r,node:i,isOpen:e,onClose:t,deps:Lo(i?.type===`lineageGraphNode`?i.data?.name:i?.type===`lineageGraphColumnNode`?i.data?.node?.name:void 0),viewOptions:{selectMode:c,cll:l,showColumnLevelLineage:u,setChangeAnalysisMode:d,selectParentNodes:a,selectChildNodes:o,getNodeColumnSet:s},featureToggles:{disableDatabaseQuery:f.disableDatabaseQuery,disableViewActionDropdown:f.disableViewActionDropdown,mode:f.mode??void 0},serverFlags:{single_env_onboarding:h?.single_env_onboarding},noCatalogCurrent:g,isActionAvailable:p})},zo=mo;function Bo(e,t){let n=[],r=[],{selectedNodes:i,cll:a,existingPositions:o,newCllExperience:s,columnAncestry:c}=t??{},l={};function u(e){return e===`removed`?0:e===`added`?2:1}function d(e,t){let n=u(e.data?.changeStatus),r=u(t.data?.changeStatus);return n<r?-1:+(n>r)}let f=i===void 0?void 0:new Set(i),p=Object.values(e.nodes).sort(d);for(let e of p){if(f&&!f.has(e.id))continue;let t=new Set,i=0;if(a&&!s){let o=a.current,s=o?.parent_map[e.id]??new Set;for(let t of s){let n=t,i=e.id;r.push({id:`m2c_${n}_${i}`,source:n,target:i,style:{zIndex:9999}})}let c=Object.entries(o?.columns??{}).filter(([t])=>t.startsWith(`${e.id}_`)).map(([t])=>t.slice(e.id.length+1));for(let o of c){let s=`${e.id}_${o}`,c=a.current,l=c?.columns[s],u=c?.parent_map[s]??new Set;if(l!=null){n.push({id:s,position:{x:10,y:70+i*24},parentId:e.id,extent:`parent`,draggable:!1,className:`no-track-pii-safe`,data:{node:e.data,column:l.name,type:l.type,transformationType:l.transformation_type,changeStatus:Te(l.change_status)},style:{zIndex:9999},type:`lineageGraphColumnNode`,targetPosition:br.Left,sourcePosition:br.Right});for(let e of u){let t=e,n=s;r.push({id:`${t}_${n}`,source:t,target:n,style:{zIndex:9999}})}i++,t.add(l.name)}}}l[e.id]=t;let c=60;i>0&&(c+=20+i*24);let u=o?.get(e.id);n.unshift({id:e.id,position:u??{x:0,y:0},width:300,height:c,className:`no-track-pii-safe`,data:{...e.data},type:`lineageGraphNode`,targetPosition:br.Left,sourcePosition:br.Right,style:{width:300,height:c}})}let m=Object.values(e.edges).sort(d);for(let e of m)f&&(!f.has(e.source)||!f.has(e.target))||r.push({id:e.id,type:`lineageGraphEdge`,source:e.source,target:e.target,data:{...e.data}});return s&&c&&a&&Vo(n,r,c,a,f),n.some(e=>e.type===`lineageGraphNode`&&!o?.has(e.id))&&Ho(n,r),[n,r,l]}function Vo(e,t,n,r,i){let a=new Set,o=new Map;for(let[t,s]of n)if(!(i&&!i.has(t))){for(let n=0;n<s.length;n++){let i=s[n],c=`${t}_${i.column}`;a.add(c),o.set(c,{modelId:t,isImpacted:i.isImpacted});let l=r.current.columns[c];e.push({id:c,position:{x:10,y:64+n*24},parentId:t,draggable:!1,className:`no-track-pii-safe`,data:{node:{id:t},column:i.column,type:l?.type,transformationType:i.transformationType,changeStatus:i.changeStatus,isHighlighted:!0,isFocused:!1,isImpacted:i.isImpacted},style:{zIndex:9999},type:`lineageGraphColumnNode`,targetPosition:br.Left,sourcePosition:br.Right})}if(s.length>0){let n=e.find(e=>e.id===t&&e.type===`lineageGraphNode`);n&&(n.height=80+s.length*24)}}for(let e of a){let n=r.current.parent_map[e]??[];for(let r of n)if(a.has(r)){let n=o.get(r)?.isImpacted??!1;t.push({id:`ancestry_${r}_${e}`,source:r,target:e,style:{zIndex:9999,strokeWidth:2,stroke:n?Gt.impacted:Gt.unchanged}})}}}const Ho=(e,t,n=`LR`)=>{fe(ra,e,t,n)},Uo={};function Wo(e){return e?.type===`profile_distribution`?e.result:void 0}function Go(e){let t=0;for(let n of Object.values(e))n.kind===null&&(t+=1);return t}const Ko=e=>typeof performance<`u`?Math.round(performance.now()-e):0,qo=e=>ie(e)&&e.status>=400&&e.status<500;function Jo(e){let{model:t,columns:n,enabled:r=!0}=e,i=e.nodeId??t,{apiClient:a}=Wt(),{data:o}=ge(),s=(o?.inline_profile??!1)&&r&&!!t,{data:c,error:l,isFetching:u}=Vn({queryKey:[`profile_distribution`,i,n?JSON.stringify(n):`*`],queryFn:async()=>{let e=typeof performance<`u`?performance.now():0;try{let r=await h({model:t,columns:n},{trackProps:{source:dn.SCHEMA_VIEW}},a);return Yo(r,Ko(e)),r}catch(t){throw Dn({status:`error`,total_wall_ms:Ko(e),column_count:0,error_count:0}),qo(t)||ea(t,{tags:{feature:`inline_profile_distribution`}}),t}},enabled:s,staleTime:1/0,gcTime:300*1e3,retry:!1,refetchOnWindowFocus:!1,placeholderData:(e,t)=>t&&t.queryKey[1]===i?e:void 0}),d=c?.error?Error(c.error):void 0;return U(()=>{if(!s)return{status:`disabled`,isLoading:!1,columns:Uo,baseTotal:0,currentTotal:0};let e=l??d??void 0;if(e)return{status:`error`,isLoading:!1,columns:Uo,error:e,baseTotal:0,currentTotal:0};let t=Wo(c);return t?t.status===`unsupported`?{status:`unsupported`,isLoading:!1,columns:Uo,unsupportedReason:t.reason,baseTotal:0,currentTotal:0}:{status:`ok`,isLoading:u,columns:t.columns,baseTotal:t.base_total,currentTotal:t.current_total}:{status:`loading`,isLoading:!0,columns:Uo,baseTotal:0,currentTotal:0}},[s,l,d,c,u])}function Yo(e,t){if(e.error){Dn({status:`error`,total_wall_ms:t,column_count:0,error_count:0});return}let n=Wo(e);if(!n||n.status===`unsupported`){Dn({status:`unsupported`,total_wall_ms:t,column_count:0,error_count:0});return}Dn({status:`ok`,strategy:n.strategy,total_wall_ms:t,column_count:Object.keys(n.columns).length,error_count:Go(n.columns),cache_hit:n.cache_hit})}function Xo({newCllExperience:e,columnChanges:t,impactedColumns:n,nodeId:r,nodeColumnNames:i,wholeModelChange:a,profileAllColumns:o}){if(!e)return{changedColumns:void 0,scopedColumns:void 0,profileEnabled:!1,profilingAll:!1};let s=new Set(Object.keys(t??{}));if(n&&r&&i)for(let e of i)Zt(r,e,n)&&s.add(e);let c=[...s],l=c.length>0,u=o||a||!l?void 0:c,d=l||a||o;return{changedColumns:c,scopedColumns:u,profileEnabled:d,profilingAll:u===void 0&&d}}function Zo(){return q(J,{sx:{display:`flex`,gap:2,px:1,py:.5,fontSize:`0.75rem`,color:`text.secondary`},children:[q(`span`,{children:[K(`span`,{className:`schema-change-badge schema-change-badge-added`,children:`+`}),` `,`added`]}),q(`span`,{children:[K(`span`,{className:`schema-change-badge schema-change-badge-removed`,children:`-`}),` `,`removed`]}),q(`span`,{children:[K(`span`,{className:`schema-change-badge schema-change-badge-changed`,children:`~`}),` `,`changed`]})]})}function Qo({current:e,showMenu:t=!0},n){let r=_e(),[i,a]=W(null),[o,s]=W(new Map),{columns:c,rows:l}=U(()=>zt({type:`schema_single`,columns:e?.columns},{node:e,cllRunningMap:o,showMenu:t}),[e,o,t]),{lineageGraph:u,isActionAvailable:d}=L(),f=d(`change_analysis`),p=!u?.catalogMetadata.current,m;p&&(m="catalog.json not found. Run `recce debug` to troubleshoot.");let h=e&&e.columns===void 0,g;h&&(g=`Node schema not found in catalog.json. Please regenerate your catalog.json to update.`);let _=async t=>{if(!f)return;pn({action:`view`,source:`schema_column`}),s(e=>new Map(e).set(t,!0));let n=e?.id;n&&await r?.showColumnLevelLineage({node_id:n,column:t}),s(e=>new Map(e).set(t,!1))},v=V(t=>`${e?.id}-${t.data.name}`,[e?.id]),y=r?.viewOptions.column_level_lineage,b=y?`${y.node_id}-${y.column}`:null;H(()=>{if(i&&(i.deselectAll(),b)){let e=i.getRowNode(b);e&&e.setSelected(!0)}},[i,b]);let x=V(e=>{a(e.api)},[]);return q(J,{sx:{display:`flex`,flexDirection:`column`,height:`100%`},children:[m?K(yi,{severity:`warning`,sx:{fontSize:`12px`,p:1},children:m}):g?K(yi,{severity:`warning`,sx:{fontSize:`12px`,p:1},children:g}):K(G,{}),l.length>0&&K(Jt,{style:{blockSize:`auto`,maxHeight:`100%`,overflow:`auto`,fontSize:`10pt`,borderWidth:1},columns:c,rows:l,renderers:{noRowsFallback:K(ht,{})},ref:n,getRowId:v,getRowClass:e=>r!==void 0&&f?`row-normal row-selectable`:`row-normal`,onCellClicked:async e=>{if((e.event?.target)?.closest(`.row-context-menu`))return;let t=e.data;t&&await _(t.name)},onGridReady:x,rowSelection:{mode:`singleRow`,checkboxes:!1},containerClassName:`no-track-pii-safe`,rowClassName:`no-track-pii-safe`})]})}function $o({base:e,current:t,showMenu:n=!0,columnChanges:r,onViewCode:i,headerAction:a},o){let s=_e(),{data:c}=ge(),l=c?.new_cll_experience??!1,u=c?.inline_profile??!1,[d,f]=W(null),[p,m]=W(new Map),[h,g]=W(null),_=U(()=>{if(!l)return;let e=s?.impactedColumnIds;return e?.size?e:void 0},[l,s?.impactedColumnIds]),v=U(()=>{let n=t?.resource_type??e?.resource_type;return n&&[`model`,`seed`,`snapshot`,`source`].includes(n)?t??e:void 0},[t,e]),y=t?.id??e?.id,b=U(()=>{let n=new Set;for(let t of Object.keys(e?.columns??{}))n.add(t);for(let e of Object.keys(t?.columns??{}))n.add(e);return n},[e,t]),x=h!=null&&h===y,S=s?.wholeModelChangedNodeIds?.has(y??``)??!1,{scopedColumns:C,profileEnabled:w,profilingAll:T}=U(()=>Xo({newCllExperience:l,columnChanges:r,impactedColumns:_,nodeId:y,nodeColumnNames:b,wholeModelChange:S,profileAllColumns:x}),[l,r,_,y,b,S,x]),E=Jo({model:v?.name,nodeId:y,columns:C,enabled:w}),D=U(()=>{if(!(E.status===`disabled`||E.status===`unsupported`))return{payloads:E.columns,baseTotal:E.baseTotal,currentTotal:E.currentTotal,isLoading:E.isLoading,hasError:E.status===`error`,scopedColumns:C}},[E.status,E.columns,E.baseTotal,E.currentTotal,E.isLoading,C]),{columns:O,rows:k}=U(()=>zt({type:`schema_diff`,base:e?.columns,current:t?.columns},{node:v,cllRunningMap:p,showMenu:n,columnChanges:r,onViewCode:i,impactedColumns:_,nodeId:y,distribution:D}),[e,t,v,y,p,n,r,i,_,D]),{lineageGraph:A,isActionAvailable:j}=L(),ee=j(`change_analysis`),M=!A?.catalogMetadata.base,N=!A?.catalogMetadata.current,P;M&&N?P="catalog.json not found on both environments. Run `recce debug` to troubleshoot.":M?P="catalog.json not found on base environment. Run `recce debug` to troubleshoot.":N&&(P="catalog.json not found on current environment. Run `recce debug` to troubleshoot.");let te=e&&e.columns===void 0,ne=t&&t.columns===void 0,F;te&&ne?F=`Node schema not found in catalog.json on both environments. Please regenerate your catalog.json to update.`:ne?F=`Node schema not found in catalog.json on current environment. Please regenerate your catalog.json to update.`:te&&(F=`Node schema not found in catalog.json on base environment. Please regenerate your catalog.json to update.`);let re=async n=>{if(!ee)return;pn({action:`view`,source:`schema_column`}),m(e=>new Map(e).set(n,!0));let r=t?.id??e?.id;r&&await s?.showColumnLevelLineage({node_id:r,column:n}),m(e=>new Map(e).set(n,!1))},ie=V(n=>`${t?.id??e?.id}-${n.data.name}`,[t?.id,e?.id]),ae=s?.viewOptions.column_level_lineage,oe=ae?`${ae.node_id}-${ae.column}`:null;H(()=>{if(d&&(d.deselectAll(),oe)){let e=d.getRowNode(oe);e&&e.setSelected(!0)}},[d,oe]);let se=V(e=>{f(e.api)},[]);return q(J,{sx:{display:`flex`,flexDirection:`column`,height:`100%`},children:[P?K(yi,{severity:`warning`,sx:{fontSize:`12px`,p:1},children:P}):F?K(yi,{severity:`warning`,sx:{fontSize:`12px`,p:1},children:F}):K(G,{}),q(X,{direction:`row`,sx:{alignItems:`center`,justifyContent:`space-between`,gap:1,pr:1},children:[K(Zo,{}),q(X,{direction:`row`,sx:{alignItems:`center`,gap:1},children:[l&&u&&v&&E.status!==`unsupported`&&!T&&K(Y,{size:`small`,variant:`text`,onClick:()=>{g(y??null)},sx:{textTransform:`none`,fontSize:`0.7rem`,py:.25,px:1,minWidth:0,whiteSpace:`nowrap`},children:`Profile all columns`}),a]})]}),E.status===`unsupported`&&K(J,{sx:{px:1,pb:.5},children:K(rt,{reason:E.unsupportedReason})}),k.length>0&&K(Jt,{style:{blockSize:`auto`,maxHeight:`100%`,overflow:`auto`,fontSize:`0.8rem`,borderWidth:1},columns:O,rows:k,rowHeight:35,renderers:{noRowsFallback:K(ht,{})},className:`rdg-light no-track-pii-safe${l?` cll-experience`:``}`,ref:o,getRowId:ie,getRowClass:e=>{let t=e.data;if(!t)return`row-normal`;let n;if(t.baseIndex===void 0)n=`row-added`;else if(t.currentIndex===void 0)return`row-removed`;else n=t.baseType!==t.currentType||t.reordered===!0||t.definitionChanged===!0||t.changeUnknown===!0?`row-changed`:t.isImpacted?`row-impacted`:`row-normal`;return s!==void 0&&ee&&(n+=` row-selectable`),n},onCellClicked:async e=>{if((e.event?.target)?.closest(`.row-context-menu`))return;let t=e.data;t&&(t.baseIndex!==void 0&&t.currentIndex===void 0||await re(t.name))},onGridReady:se,rowSelection:{mode:`singleRow`,checkboxes:!1},containerClassName:`no-track-pii-safe`,rowClassName:`no-track-pii-safe`})]})}const es=Gn($o),ts=Gn(Qo);function ns(e){let t=e?.current.nodes;if(!t)return{impactingNodeIds:void 0,impactedNodeIds:void 0};let n=new Set,r=new Set;for(let[e,i]of Object.entries(t))i.impacted===!0?(r.add(e),n.add(e)):(i.change_category===`partial_breaking`||i.change_status===`removed`)&&n.add(e);return{impactingNodeIds:n,impactedNodeIds:r}}const rs={light:`rgb(252 211 77 / 0.18)`,dark:`rgb(252 211 77 / 0.10)`};function is(e){return e?Ie.dark:Ie.light}function as(e){return e?.data.changeStatus??`unchanged`}function os(e,t){return e===`unchanged`&&t?`impacted`:e}function ss(e){return e===`impacted`?Gt.impacted:Fe[e]}function cs(e,t){return t?.[e]?.data.name??e}function ls(e,t,n){let r=t.trim().toLowerCase();return r?e.filter(e=>cs(e,n).toLowerCase().includes(r)):e}function us(e,t){return e?`Show all models`:t?`Show only impacting models`:`Show only impacted models`}function ds({status:e,cllImpacted:t}){let n=os(e,t);return K(J,{component:`span`,"data-testid":`lineage-status-dot`,"data-status":n,sx:{width:`8px`,height:`8px`,borderRadius:`2px`,backgroundColor:ss(n),flex:`0 0 auto`}})}function fs({name:e,status:t,direction:n,decorateAsImpacted:r,dotImpacted:i,onClick:a}){let{isDark:o}=Lt(),s=n===`up`?`Impacts this model`:`Impacted by this model`;return q(J,{onClick:a,sx:{position:`relative`,display:`flex`,alignItems:`center`,gap:.75,pl:1.5,pr:1.25,py:.5,cursor:a?`pointer`:`default`,fontSize:`12px`,fontFamily:`ui-monospace, 'IBM Plex Mono', monospace`,lineHeight:1.3,color:`text.primary`,minWidth:0,backgroundColor:r?o?rs.dark:rs.light:void 0,"&:hover":a?{backgroundColor:`action.hover`}:void 0},children:[r&&K(J,{"aria-hidden":`true`,sx:{position:`absolute`,left:0,top:0,bottom:0,width:`3px`,backgroundColor:Gt.impacted}}),K(ds,{status:t,cllImpacted:i}),K(J,{component:`span`,sx:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,minWidth:0,flex:1},title:e,children:e}),r&&K($,{title:s,placement:`top`,arrow:!0,children:K(J,{component:`span`,"aria-label":s,"data-testid":`lineage-impact-mark`,sx:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:`16px`,height:`16px`,color:is(o),flex:`0 0 auto`},children:K(Ni,{size:12})})})]})}function ps({isDark:e,active:t}){return t?at.dark:e?R.dark:R.light}function ms({isDark:e,active:t}){return t?`#fff`:e?Ie.dark:Ie.light}const hs={display:`inline-flex`,alignItems:`center`,gap:`4px`,ml:.75,px:`7px`,py:`1px`,borderRadius:`999px`,fontSize:`10px`,fontWeight:600,letterSpacing:`0.02em`};function gs({color:e}){return K(J,{component:`span`,"aria-hidden":`true`,sx:{width:`5px`,height:`5px`,borderRadius:`50%`,backgroundColor:e}})}function _s({label:e,title:t,active:n,isDark:r,onClick:i}){let a={isDark:r,active:n};return K($,{title:t,placement:`top`,arrow:!0,children:q(J,{component:`button`,type:`button`,"data-testid":`lineage-impact-chip`,"aria-pressed":n,"aria-label":t,onClick:i,sx:{...hs,backgroundColor:ps(a),color:ms(a),border:`none`,font:`inherit`,cursor:`pointer`,"&:hover":{filter:n?`brightness(0.95)`:`brightness(0.97)`}},children:[K(gs,{color:ms(a)}),e]})})}function vs({direction:e,directCount:t,impactCount:n,onlyImpact:r,onToggleOnlyImpact:i}){let a=e===`up`,o=a?Pi:Ni,{isDark:s,background:c}=Lt(),l=n??0,u=l>0,d=a?`${l} impacting`:`${l} impacted`;return q(X,{direction:`row`,spacing:.75,sx:{alignItems:`center`,px:1.5,py:.875,backgroundColor:c.subtle,borderTop:`1px solid`,borderBottom:`1px solid`,borderColor:`divider`,fontSize:`11px`,color:`text.secondary`,fontWeight:600},children:[K(o,{size:11}),K(J,{component:`span`,sx:{textTransform:`uppercase`,letterSpacing:`0.06em`},children:a?`Upstream`:`Downstream`}),q(J,{component:`span`,sx:{color:`text.disabled`,fontWeight:500},children:[`· `,t,` direct`]}),u&&K(_s,{label:d,title:us(r,a),active:r,isDark:s,onClick:i})]})}function ys({label:e}){return K(J,{sx:{px:1.5,py:1,fontSize:`11px`,color:`text.disabled`,fontStyle:`italic`},children:e})}function bs({direction:e,query:t,onChange:n}){return K(J,{sx:{px:1.25,py:.75,borderBottom:`1px solid`,borderColor:`divider`,backgroundColor:`background.paper`},children:q(X,{direction:`row`,spacing:.5,sx:{alignItems:`center`,border:`1px solid`,borderColor:`divider`,borderRadius:`4px`,px:.875,py:.25},children:[K(Li,{size:12,color:`currentColor`,opacity:.55}),K(bi,{value:t,onChange:e=>{n(e.target.value)},placeholder:`filter…`,inputProps:{"aria-label":`Filter ${e===`up`?`Upstream`:`Downstream`}`,style:{padding:0,fontSize:`11px`,fontFamily:`ui-monospace, 'IBM Plex Mono', monospace`}},sx:{flex:1,fontSize:`11px`}})]})})}function xs({hidden:e,onClick:t}){return q(J,{onClick:t,role:`button`,tabIndex:0,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())},sx:{px:1.5,py:.75,fontSize:`11px`,color:`info.main`,cursor:`pointer`,userSelect:`none`,"&:hover":{backgroundColor:`action.hover`}},children:[`+ show `,Math.min(20,e),` more`,` `,q(J,{component:`span`,sx:{color:`text.disabled`,ml:.5},children:[`(`,e,` hidden)`]})]})}function Ss({node:e,onCenterFocus:t,cllImpacted:n}){let r=os(as(e),n),{isDark:i,background:a}=Lt(),o=ss(r),s=r===`impacted`?is(i):o,c=r===`impacted`?is(i):`divider`;return q(X,{direction:`row`,spacing:1,sx:{alignItems:`center`,px:1.5,py:1.25,backgroundColor:i?a.emphasized:`rgb(255 245 241)`,borderTop:`1px solid`,borderBottom:`1px solid`,borderColor:`divider`},children:[K(J,{component:`span`,sx:{width:`4px`,height:`26px`,borderRadius:`2px`,backgroundColor:o,flex:`0 0 auto`}}),K(J,{component:`span`,sx:{flex:1,minWidth:0,fontFamily:`ui-monospace, 'IBM Plex Mono', monospace`,fontSize:`13px`,fontWeight:700,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},title:e.data.name,children:e.data.name}),t&&K($,{title:`Center on canvas`,placement:`top`,children:K(Q,{size:`small`,"aria-label":`Center on canvas`,onClick:t,sx:{p:.5,color:`text.secondary`,flex:`0 0 auto`},children:K(Fi,{size:14})})}),K(J,{component:`span`,sx:{fontSize:`10px`,fontWeight:600,px:.875,py:`2px`,borderRadius:`3px`,color:s,backgroundColor:`background.paper`,border:`1px solid`,borderColor:c,textTransform:`capitalize`,flex:`0 0 auto`},children:r})]})}function Cs({previousName:e,currentName:t,onJumpBack:n}){let{isDark:r}=Lt();return q(X,{direction:`row`,spacing:.75,sx:{alignItems:`center`,minWidth:0,flex:1,overflow:`hidden`,fontFamily:`ui-monospace, 'IBM Plex Mono', monospace`,fontSize:`12px`},children:[K(J,{component:`span`,sx:{color:`text.secondary`,fontFamily:`inherit`,flex:`0 0 auto`},children:`Path`}),K(J,{component:`span`,role:n?`button`:void 0,tabIndex:n?0:void 0,onClick:n,onKeyDown:n?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n())}:void 0,sx:{color:`text.primary`,cursor:n?`pointer`:`default`,textDecoration:`underline`,textDecorationColor:r?`rgb(255 255 255 / 0.35)`:`rgb(0 0 0 / 0.25)`,textUnderlineOffset:`2px`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,minWidth:0,"&:hover":n?{textDecorationColor:`currentColor`}:void 0},title:e,children:e}),K(J,{component:`span`,"aria-hidden":`true`,sx:{color:`text.disabled`,flex:`0 0 auto`},children:`›`}),K(J,{component:`span`,sx:{color:`primary.main`,fontWeight:700,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,minWidth:0},title:t,children:t})]})}function ws({node:e,nodesById:t,onNavigate:n,onBack:r,onCenterFocus:i,historyTrail:a,onJumpToHistory:o,impactingNodeIds:s,impactedNodeIds:c}){let{background:l}=Lt(),[u,d]=W(``),[f,p]=W(``),[m,h]=W(8),[g,_]=W(8),[v,y]=W(!1),[b,x]=W(!1);H(()=>{d(``),p(``),h(8),_(8),y(!1),x(!1)},[e.id]);let S=U(()=>Object.keys(e.data.parents??{}),[e.data.parents]),C=U(()=>Object.keys(e.data.children??{}),[e.data.children]),w=U(()=>ls(S,u,t),[S,u,t]),T=U(()=>ls(C,f,t),[C,f,t]),E=((s?.size??0)>0||(c?.size??0)>0)&&((s?.has(e.id)??!1)||(c?.has(e.id)??!1)),D=(e,t)=>E?(t===`up`?s:c)?.has(e)??!1:!1,O=E?S.filter(e=>s?.has(e)).length:0,k=E?C.filter(e=>c?.has(e)).length:0,A=e=>{let r=e===`up`,i=r?S:C,a=r?w:T,o=(r?v:b)?a.filter(t=>D(t,e)):a,s=r?u:f,l=r?d:p,y=r?m:g,x=r?h:_,E=i.length>8,O=o.slice(0,y),k=o.length-O.length,A=r?`(source — no upstream)`:`(leaf — no downstream)`;return q(G,{children:[E&&K(bs,{direction:e,query:s,onChange:e=>{l(e),x(8)}}),i.length===0?K(ys,{label:A}):o.length===0?K(ys,{label:`no matches`}):O.map(r=>K(fs,{name:cs(r,t),status:as(t?.[r]),direction:e,decorateAsImpacted:D(r,e),dotImpacted:c?.has(r)??!1,onClick:n?()=>n(r):void 0},`${e}-${r}`)),k>0&&K(xs,{hidden:k,onClick:()=>x(e=>Math.min(o.length,e+20))})]})},j=(a?.length??0)>0;return q(J,{sx:{height:`100%`,display:`flex`,flexDirection:`column`,backgroundColor:`background.paper`},"data-testid":`lineage-tab-content`,children:[(!!r||j)&&q(X,{direction:`row`,spacing:1,sx:{alignItems:`center`,px:1.25,py:.75,borderBottom:`1px solid`,borderColor:`divider`,backgroundColor:l.subtle,minWidth:0},children:[r&&K($,{title:`Back to previous node`,placement:`top`,children:K(Q,{size:`small`,"aria-label":`Back to previous node`,onClick:r,sx:{flex:`0 0 auto`,border:`1px solid`,borderColor:`divider`,borderRadius:`6px`,px:1,py:.375,color:`text.secondary`,backgroundColor:`background.paper`,"&:hover":{backgroundColor:`action.hover`}},children:K(Mi,{size:14})})}),j&&a?K(Cs,{previousName:cs(a[a.length-1],t),currentName:e.data.name,onJumpBack:o?()=>o(a.length-1):r}):K(J,{sx:{flex:1}})]}),q(J,{sx:{flex:1,overflowY:`auto`,minHeight:0},children:[K(vs,{direction:`up`,directCount:S.length,impactCount:O,onlyImpact:v,onToggleOnlyImpact:()=>{y(e=>!e),h(8)}}),A(`up`),K(Ss,{node:e,onCenterFocus:i,cllImpacted:c?.has(e.id)??!1}),K(vs,{direction:`down`,directCount:C.length,impactCount:k,onlyImpact:b,onToggleOnlyImpact:()=>{x(e=>!e),_(8)}}),A(`down`)]})]})}const Ts=({node:e,modelDetail:t,isSingleEnv:n,CodeEditor:r,DiffEditor:i,isDark:a=!1})=>{let[o,s]=W(!1),[c,l]=W(!1);if(e.data.resourceType!==`model`&&e.data.resourceType!==`snapshot`)return`Not available`;let u=t?.base?.raw_code,d=t?.current?.raw_code,f=t?.base?.name??t?.current?.name??e.data.name??``,p=u!=null||d!=null;return q(J,{className:`no-track-pii-safe`,sx:{position:`relative`,height:`100%`},onMouseEnter:()=>{l(!0)},onMouseLeave:()=>{l(!1)},children:[p?n?K(r,{language:`sql`,value:u??``,readOnly:!0,lineNumbers:!0,wordWrap:!1,theme:a?`dark`:`light`}):K(i,{original:u??``,modified:d??``,language:`sql`,readOnly:!0,lineNumbers:!0,sideBySide:!1,theme:a?`dark`:`light`,height:`100%`}):K(J,{sx:{display:`flex`,alignItems:`center`,justifyContent:`center`,height:`100%`,color:`text.secondary`},children:`No code available`}),K(Q,{onClick:()=>s(!0),size:`medium`,"aria-label":`Expand`,sx:{position:`absolute`,top:`5px`,right:`20px`,opacity:c?.5:.1,transition:`opacity 0.3s ease-in-out`},children:K(Ei,{})}),q(Zn,{open:o,onClose:()=>s(!1),maxWidth:`sm`,fullWidth:!0,slotProps:{paper:{sx:{height:`75%`,overflowY:`auto`}}},children:[q(er,{sx:{display:`flex`,alignItems:`center`},children:[n?q(G,{children:[K(`code`,{children:f}),`\xA0Model Code`]}):q(G,{children:[K(`code`,{children:f}),`\xA0Model Code Diff`]}),K(J,{sx:{flex:1}}),K(Q,{size:`small`,onClick:()=>s(!1),children:K(lr,{})})]}),K($n,{children:p?n?K(r,{language:`sql`,value:u??``,fontSize:16,readOnly:!0,lineNumbers:!0,wordWrap:!1,theme:a?`dark`:`light`}):K(i,{original:u??``,modified:d??``,language:`sql`,theme:a?`dark`:`light`,className:`text-base`}):K(J,{sx:{display:`flex`,alignItems:`center`,justifyContent:`center`,height:`100%`,color:`text.secondary`},children:`No code available`})})]})]})},Es=({node:e})=>{let{data:t,isLoading:r}=ge(),i=en(),{apiClient:a}=Wt(),o=e.data.resourceType,s=o===`model`||o===`snapshot`,{data:c,isLoading:l}=Vn({queryKey:[`modelDetail`,e.id],queryFn:()=>n(e.id,a),enabled:s&&!!a,staleTime:300*1e3,retry:1});return r?K(G,{}):s&&l?K(J,{"aria-label":`Loading model code`,sx:{p:2,height:`100%`},"data-testid":`node-sql-view-loading`,children:K(ia,{variant:`rectangular`,height:`100%`,animation:`wave`})}):K(Ts,{node:e,modelDetail:c?.model,isSingleEnv:t?.single_env_onboarding??!1,CodeEditor:st,DiffEditor:Ut,isDark:i})};function Ds({rowCount:e}){return`base`in e?K(ks,{rowCount:e}):K(`span`,{children:Os(e.curr)})}function Os(e){return e===null?`N/A`:`${e.toLocaleString()} ${e===1?`row`:`rows`}`}function ks({rowCount:e}){let t=e.base,n=e.curr,r=Os(t),i=Os(n);return t===null&&n===null?K(G,{children:`Failed to load`}):t===null||n===null?q(X,{component:`span`,direction:`row`,spacing:.5,sx:{display:`inline-flex`,alignItems:`center`},children:[K(Z,{variant:`body2`,component:`span`,children:r}),K(Bi,{}),K(Z,{variant:`body2`,component:`span`,children:i})]}):t===n?q(X,{component:`span`,direction:`row`,spacing:.5,sx:{display:`inline-flex`,alignItems:`center`},children:[K(Z,{variant:`body2`,component:`span`,children:i}),K(J,{component:`span`,sx:{color:`grey.500`,display:`flex`},children:K(Ji,{})}),K(Z,{variant:`body2`,component:`span`,sx:{color:`grey.500`},children:`No Change`})]}):t<n?q(X,{component:`span`,direction:`row`,spacing:.5,sx:{display:`inline-flex`,alignItems:`center`},children:[K(Z,{variant:`body2`,component:`span`,children:i}),K(J,{component:`span`,sx:{color:`success.main`,display:`flex`},children:K(Ki,{})}),K(Z,{variant:`body2`,component:`span`,sx:{color:`success.main`},children:$t(t,n)})]}):q(X,{component:`span`,direction:`row`,spacing:.5,sx:{display:`inline-flex`,alignItems:`center`},children:[K(Z,{variant:`body2`,component:`span`,children:i}),K(J,{component:`span`,sx:{color:`error.main`,display:`flex`},children:K(Gi,{})}),K(Z,{variant:`body2`,component:`span`,sx:{color:`error.main`},children:$t(t,n)})]})}function As({rowCount:e,node:t,onRefresh:n,isFetching:r}){let i=en(),{featureToggles:a}=ce(),{runsAggregated:o}=L(),s=o?.[t.id]?.row_count_diff.result,c=B(`row_count_diff`).icon,l=e??s,u=l;return K($,{title:l?`${l.base??`N/A`} -> ${l.curr??`N/A`} rows`:``,children:K(ul,{display:a.mode===`metadata only`,children:q(J,{component:`span`,sx:{...Ae(i),gap:.5},children:[K(c,{}),u!=null||r?r?K(ia,{width:30,height:16}):u==null?K(Z,{variant:`caption`,children:`row count`}):K(ks,{rowCount:u}):K(Z,{variant:`caption`,children:`row count`}),n&&K(Q,{"aria-label":`Query Row Count`,size:`small`,onClick:n,disabled:a.disableDatabaseQuery,sx:{p:0,ml:.5},children:K(Kr,{size:12})})]})})})}function js({rowCount:e,node:t,onRefresh:n,isFetching:r}){let i=en(),{runsAggregated:a}=L(),o=a?.[t.id]?.row_count.result,s=B(`row_count`).icon,c,l=e??o;return l&&(c=`${l.curr??`N/A`} rows`),q(J,{component:`span`,sx:Ae(i),children:[K(J,{component:`span`,sx:yt,children:K(s,{})}),l||r?r?K(ia,{width:30,height:16}):K(Z,{variant:`caption`,children:c}):K(Z,{variant:`caption`,children:`row count`}),n&&K(Q,{"aria-label":`Query Row Count`,size:`small`,onClick:n,disabled:t.data.changeStatus===`removed`,sx:{p:0,ml:.5},children:K(Kr,{size:12})})]})}function Ms({children:e,value:t,index:n}){return t===n?K(G,{children:e}):null}const Ns=()=>K(`span`,{}),Ps=({children:e})=>K(G,{children:e}),Fs=()=>!0;function Is(e,t,n){return e?Fn.add_or_remove:n(t)?``:`This action is not supported yet.`}function Ls({node:e,actionCallbacks:t,runTypeIcons:n,isActionAvailable:r,rowCountDisplay:i}){let a=e.data.changeStatus===`added`||e.data.changeStatus===`removed`,o=n?.query??Ns,s=n?.row_count??Ns,c=n?.profile??Ns;return q(X,{direction:`row`,sx:{alignItems:`center`,flexWrap:`wrap`,gap:1},children:[K(Y,{size:`xsmall`,variant:`outlined`,color:`neutral`,startIcon:K(o,{fontSize:`small`}),onClick:t?.onQueryClick,sx:{textTransform:`none`},children:`Query`}),q(Y,{size:`xsmall`,variant:`outlined`,color:`neutral`,startIcon:K(s,{fontSize:`small`}),onClick:t?.onRowCountClick,sx:{textTransform:`none`},children:[`Row Count`,i!=null&&q(G,{children:[`:\xA0`,i]})]}),K($,{title:Is(a,`profile`,r),placement:`top`,children:K(`span`,{children:K(Y,{size:`xsmall`,variant:`outlined`,color:`neutral`,startIcon:K(c,{fontSize:`small`}),onClick:t?.onProfileClick,disabled:a,sx:{textTransform:`none`},children:`Profile`})})})]})}function Rs({onClick:e,Icon:t}){return K(Y,{size:`xsmall`,variant:`outlined`,color:`neutral`,startIcon:K(t,{fontSize:`small`}),onClick:e,sx:{textTransform:`none`},children:`Add schema diff to checklist`})}function zs({node:e,actionCallbacks:t,runTypeIcons:n,featureToggles:r,isActionAvailable:i,ConnectionPopoverWrapper:a,rowCountDisplay:o}){let s=r?.mode===`metadata only`,c=e.data.changeStatus===`added`||e.data.changeStatus===`removed`,l=n?.query_diff??Ns,u=n?.row_count_diff??Ns,d=n?.profile_diff??Ns,f=n?.value_diff??Ns,p=n?.top_k_diff??Ns,m=n?.histogram_diff??Ns,h=(e,t)=>s?K(a,{display:!0,children:e}):K($,{title:Is(c,t,i),placement:`top`,children:K(`span`,{children:e})});return q(X,{direction:`row`,sx:{alignItems:`center`,flexWrap:`wrap`,gap:2},children:[K(Z,{variant:`caption`,sx:{fontWeight:`bold`},children:`Diff`}),q(X,{direction:`row`,sx:{alignItems:`center`,flexWrap:`wrap`,gap:1,width:`93%`},children:[K(a,{display:s,children:q(Y,{size:`xsmall`,variant:`outlined`,color:`neutral`,startIcon:K(u,{fontSize:`small`}),onClick:t?.onRowCountDiffClick,disabled:r?.disableDatabaseQuery,sx:{textTransform:`none`},children:[`Row Count`,o!=null&&q(G,{children:[`:\xA0`,o]})]})}),h(K(Y,{size:`xsmall`,variant:`outlined`,color:`neutral`,startIcon:K(d,{fontSize:`small`}),onClick:t?.onProfileDiffClick,disabled:c||r?.disableDatabaseQuery,sx:{textTransform:`none`},children:`Profile`}),`profile_diff`),h(K(Y,{size:`xsmall`,variant:`outlined`,color:`neutral`,startIcon:K(f,{fontSize:`small`}),onClick:t?.onValueDiffClick,disabled:c||r?.disableDatabaseQuery,sx:{textTransform:`none`},children:`Value`}),`value_diff`),h(K(Y,{size:`xsmall`,variant:`outlined`,color:`neutral`,startIcon:K(p,{fontSize:`small`}),onClick:t?.onTopKDiffClick,disabled:c||r?.disableDatabaseQuery,sx:{textTransform:`none`},children:`Top-K`}),`top_k_diff`),h(K(Y,{size:`xsmall`,variant:`outlined`,color:`neutral`,startIcon:K(m,{fontSize:`small`}),onClick:t?.onHistogramDiffClick,disabled:c||r?.disableDatabaseQuery,sx:{textTransform:`none`},children:`Histogram`}),`histogram_diff`),K(a,{display:s,children:K(Y,{size:`xsmall`,variant:`outlined`,color:`neutral`,startIcon:K(l,{fontSize:`small`}),onClick:t?.onQueryDiffClick,disabled:r?.disableDatabaseQuery,sx:{textTransform:`none`},children:`Query`})})]})]})}function Bs({node:e,onCloseNode:t,isSingleEnv:n,featureToggles:r,modelDetail:i,lineageTabContent:a,SchemaView:o,SingleEnvSchemaView:s,NodeSqlView:c,ResourceTypeTag:l,NotificationComponent:u,ConnectionPopoverWrapper:d=Ps,runTypeIcons:f,actionCallbacks:p,isActionAvailable:m=Fs,isWholeModelChanged:h=!1,isWholeModelImpacted:g=!1,wholeModelImpact:_=!1,isImpacted:v=!1,rowCountDisplay:y}){let b=e.data.resourceType===`model`||e.data.resourceType===`seed`||e.data.resourceType===`source`||e.data.resourceType===`snapshot`,[x,S]=W(!0),[C,w]=W(0),{base:T,current:E}=i??{},D=!n&&e.data.change?.columns!=null&&Object.keys(e.data.change.columns).length>0,O=!n&&e.data.changeStatus===`modified`,k=e.data.resourceType===`model`||e.data.resourceType===`seed`||e.data.resourceType===`snapshot`,A=!n&&k&&p?.onAddSchemaDiffClick!=null,j=f?.schema_diff??Ns,{isDark:ee}=Lt(),M={wholeModelImpact:_,isWholeModelChanged:h,isWholeModelImpacted:g,isImpacted:v,changeCategory:e.data.change?.category},N=It(M,ee),P=jt({name:e.data.name,resourceType:e.data.resourceType,materialized:e.data.materialized},M);return q(J,{className:N?`cll-experience`:void 0,sx:{height:`100%`,display:`flex`,flexDirection:`column`,borderLeft:`3px solid ${N?N.tokens.stripeAccent:`transparent`}`},children:[q(X,{direction:`row`,sx:{alignItems:`center`,px:2,py:1.5,gap:1},children:[K($,{title:P,placement:`top`,children:N?K(pt,{tokens:N.tokens,variant:`titleChip`,testId:`whole-model-${N.kind}-title-chip`,sx:{flex:`0 1 auto`,mr:`auto`,minWidth:0},children:K(Z,{variant:`subtitle1`,component:`span`,className:`no-track-pii-safe`,sx:{fontWeight:600,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,color:`inherit`},children:e.data.name})}):K(Z,{component:`span`,variant:`subtitle1`,className:`no-track-pii-safe`,sx:{fontWeight:600,flex:`0 1 auto`,mr:`auto`,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.data.name})}),l&&K(J,{sx:{color:`text.secondary`,flexShrink:0},children:K(l,{node:e})}),K(Q,{size:`small`,onClick:t,sx:{flexShrink:0},children:K(lr,{})})]}),k&&K(J,{sx:{pl:2,py:1},children:n?K(Ls,{node:e,actionCallbacks:p,runTypeIcons:f,isActionAvailable:m,rowCountDisplay:y}):K(zs,{node:e,actionCallbacks:p,runTypeIcons:f,featureToggles:r,isActionAvailable:m,ConnectionPopoverWrapper:d,rowCountDisplay:y})}),b&&q(J,{sx:{overflow:`auto`,display:`flex`,flexDirection:`column`,flex:1,minHeight:0},children:[n&&x&&u&&K(J,{sx:{p:1.5},children:K(u,{onClose:()=>S(!1),children:K(Z,{variant:`body2`,children:`Enable the Recce Checklist and start adding checks for better data validation and review.`})})}),q(mi,{value:C,onChange:(e,t)=>w(t),sx:{borderBottom:1,borderColor:`divider`},children:[K(pi,{label:q(J,{component:`span`,sx:{display:`flex`,alignItems:`center`,gap:.75},children:[`Columns`,D&&K(J,{component:`span`,sx:{color:`amber.main`,fontSize:`0.5rem`,lineHeight:1},children:`●`})]})}),K(pi,{label:q(J,{component:`span`,sx:{display:`flex`,alignItems:`center`,gap:.75},children:[`Code`,O&&K(J,{component:`span`,sx:{color:`amber.main`,fontSize:`0.5rem`,lineHeight:1},children:`●`})]})}),a&&K(pi,{label:`Lineage`})]}),q(J,{sx:{overflow:`auto`,height:`calc(100% - 48px)`},children:[K(Ms,{value:C,index:0,children:K(J,{sx:{overflowY:`auto`,height:`100%`},children:n?s&&K(s,{current:E}):o&&K(o,{base:T,current:E,columnChanges:e.data.change?.columns,onViewCode:()=>w(1),headerAction:A?K(Rs,{onClick:p?.onAddSchemaDiffClick,Icon:j}):void 0})})}),K(Ms,{value:C,index:1,children:K(J,{sx:{height:`100%`},children:c&&K(c,{node:e})})}),a&&K(Ms,{value:C,index:2,children:K(J,{sx:{height:`100%`},children:a})})]})]})]})}const Vs=({node:e})=>K(et,{resourceType:e.data.resourceType,materialized:e.data.materialized});function Hs({onClose:e}){return K(Le,{onClose:e,align:`flex-start`,children:q(Z,{variant:`body2`,children:[`Enable the Recce Checklist and start adding checks for better data validation and review.`,K(`br`,{}),K(Qe,{})]})})}function Us({node:e,onCloseNode:t,onNavigateToNode:r,onBack:i,onCenterFocused:a,historyTrail:o,onJumpToHistory:s}){let c=Ci(),{runAction:l}=ye(),{isActionAvailable:u,envInfo:d,lineageGraph:f}=L(),p=_e(),{impactingNodeIds:m,impactedNodeIds:h}=U(()=>ns(p?.cll),[p?.cll]),{singleEnv:g,featureToggles:_}=ce(),{setSqlQuery:v,setPrimaryKeys:y}=Kt(),{primaryKey:b}=St(e.data.name),{apiClient:x}=Wt(),{basePath:C}=I(),{runsAggregated:w}=L(),T=g??!1,E=U(()=>{let t=w?.[e.id],n=T?t?.row_count?.result:t?.row_count_diff?.result;return n?K(Ds,{rowCount:n}):void 0},[w,e.id,T]),{data:D}=Vn({queryKey:[`modelDetail`,e.id],queryFn:()=>n(e.id,x),enabled:!!x,staleTime:300*1e3}),O=D?.model,k=U(()=>({query:B(`query`).icon,row_count:B(`row_count`).icon,row_count_diff:B(`row_count_diff`).icon,profile:B(`profile`).icon,profile_diff:B(`profile_diff`).icon,query_diff:B(`query_diff`).icon,value_diff:B(`value_diff`).icon,top_k_diff:B(`top_k_diff`).icon,histogram_diff:B(`histogram_diff`).icon,schema_diff:B(`schema_diff`).icon}),[]),A=Qt(Object.keys(O?.base?.columns??{}),Object.keys(O?.current?.columns??{})),j=U(()=>A.length?`select \n ${A.join(`
|
|
6
|
-
`)}\nfrom {{ ref("${e.data.name}") }}`:`select * from {{ ref("${e.data.name}") }}`,[A,e.data.name]),ee=U(()=>({onQueryClick:()=>{d?.adapterType===`dbt`?v(j):d?.adapterType===`sqlmesh`&&v(`select * from ${e.data.name}`),c.push(`${C}/query`)},onRowCountClick:()=>{yn({action:un.ROW_COUNT,source:dn.SCHEMA_ROW_COUNT_BUTTON,node_count:1}),l(`row_count`,{node_names:[e.data.name]},{showForm:!1,showLast:!1})},onRowCountDiffClick:()=>{yn({action:un.ROW_COUNT_DIFF,source:dn.SCHEMA_ROW_COUNT_BUTTON,node_count:1}),l(`row_count_diff`,{node_names:[e.data.name]},{showForm:!1,showLast:!1})},onProfileClick:()=>{yn({action:un.PROFILE,source:dn.NODE_SIDEBAR_SINGLE_ENV,node_count:1}),l(`profile`,{model:e.data.name},{showForm:!0,showLast:!1})},onProfileDiffClick:()=>{yn({action:un.PROFILE_DIFF,source:dn.NODE_SIDEBAR_MULTI_ENV,node_count:1}),l(`profile_diff`,{model:e.data.name},{showForm:!0,showLast:!1})},onQueryDiffClick:()=>{d?.adapterType===`dbt`?v(j):d?.adapterType===`sqlmesh`&&v(`select * from ${e.data.name}`),u(`query_diff_with_primary_key`)&&y(b===void 0?void 0:[b]),c.push(`${C}/query`)},onValueDiffClick:()=>{yn({action:un.VALUE_DIFF,source:dn.NODE_SIDEBAR_MULTI_ENV,node_count:1}),l(`value_diff`,{model:e.data.name},{showForm:!0,showLast:!1})},onTopKDiffClick:()=>{yn({action:un.TOP_K_DIFF,source:dn.NODE_SIDEBAR_MULTI_ENV,node_count:1}),l(`top_k_diff`,{model:e.data.name,column_name:``,k:50},{showForm:!0})},onHistogramDiffClick:()=>{yn({action:un.HISTOGRAM_DIFF,source:dn.NODE_SIDEBAR_MULTI_ENV,node_count:1}),l(`histogram_diff`,{model:e.data.name,column_name:``,column_type:``},{showForm:!0})},onAddSchemaDiffClick:async()=>{let t=await S({node_id:e.id},x);c.push(`${C}/checks/?id=${t.check_id}`)}}),[e,j,d,v,l,u,y,b,x,c.push,C]),M=p?Ct(e.id,p):{isWholeModelChanged:!1,isWholeModelImpacted:!1};return K(Bs,{node:e,onCloseNode:t,isSingleEnv:T,featureToggles:_,isWholeModelChanged:M.isWholeModelChanged,isWholeModelImpacted:M.isWholeModelImpacted,wholeModelImpact:p?.wholeModelImpact??!1,isImpacted:h?.has(e.id)??!1,modelDetail:(()=>{if(!O)return;let t=!!O.base&&Object.keys(O.base).length>0,n=!!O.current&&Object.keys(O.current).length>0;if(!(!t&&!n))return{base:t?{id:e.id,unique_id:e.id,name:e.data.name,resource_type:e.data.resourceType,package_name:e.data.packageName,...O.base}:void 0,current:n?{id:e.id,unique_id:e.id,name:e.data.name,resource_type:e.data.resourceType,package_name:e.data.packageName,...O.current}:void 0}})(),SchemaView:es,SingleEnvSchemaView:ts,NodeSqlView:Es,ResourceTypeTag:Vs,rowCountDisplay:E,NotificationComponent:Hs,ConnectionPopoverWrapper:ul,runTypeIcons:k,actionCallbacks:ee,isActionAvailable:u,lineageTabContent:r?K(ws,{node:e,nodesById:f?.nodes,onNavigate:r,onBack:i,onCenterFocus:a,historyTrail:o,onJumpToHistory:s,impactingNodeIds:m,impactedNodeIds:h}):void 0})}function Ws(e,t){let n={...e.nodes};for(let[e,r]of Object.entries(t.current.nodes)){if(!r.change_status)continue;let t=n[e];if(!t)continue;let i;if(r.columns){let e={},t=!1;for(let n of Object.values(r.columns))n.change_status&&(e[n.name]=n.change_status,t=!0);t&&(i=e)}n[e]={...t,change_status:r.change_status,change:r.change_category?{category:r.change_category,columns:i}:t.change}}return{...e,nodes:n}}function Gs(e){return!!e&&(x(e)||M(e)||_(e)||te(e)||P(e))}function Ks(e,t){if(!Gs(e))return!1;let n=e.params?.model;return!n||t.length===0?!1:!t.filter(xe).some(e=>e.data.name===n)}function qs({featureToggles:e,settingsUrl:t}){return e.mode===`metadata only`?K(J,{sx:{display:`flex`,alignItems:`center`,width:`100%`,px:1,py:.25,bgcolor:`cyan.50`},children:q(X,{direction:`row`,spacing:1,sx:{alignItems:`center`,flex:1,fontSize:`0.875rem`,color:`cyan.600`},children:[K(J,{component:zr}),K(Z,{sx:{fontSize:`inherit`,color:`inherit`},children:`Query functions disabled without a data warehouse connection.`}),K(Y,{sx:{bgcolor:`iochmara.400`},size:`small`,variant:`contained`,onClick:()=>{window.open(t,`_blank`)},children:`Connect to Data Warehouse`})]})}):null}function Js(e){let{featureToggles:t}=ce(),{data:n}=se();return K(qs,{featureToggles:e.featureToggles??t,settingsUrl:e.settingsUrl??sn(n,Pn)})}function Ys({docsUrl:e=`https://docs.reccehq.com/get-started/#prepare-dbt-artifacts`,onStartClick:t}={}){return K(X,{sx:{flex:1,height:`100%`,minHeight:0,m:1,p:2,bgcolor:`iochmara.50`,borderRadius:2,boxShadow:2,justifyContent:`center`},children:q(X,{sx:{alignSelf:`center`,width:`80%`,overflowY:`auto`,gap:3,px:4,pb:4},children:[q(X,{spacing:2,sx:{alignItems:`center`},children:[K(J,{sx:{p:1,bgcolor:`background.paper`,borderRadius:`50%`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:2},children:K(J,{component:Yi,sx:{fontSize:28,color:`iochmara.500`}})}),K(Z,{variant:`h5`,sx:{mt:2},children:`Wait, there's more!`}),q(Z,{sx:{textAlign:`center`},children:[`Recce is currently running in`,` `,K(Z,{component:`span`,sx:{fontWeight:`bold`},children:`limited functionality mode`}),` `,`so you can run queries but`,` `,K(Z,{component:`span`,sx:{fontWeight:`bold`},children:`can't diff the results yet!`})]})]}),q(X,{spacing:1,children:[K(Z,{children:`To unlock the full power of Recce, set up a base environment of dbt artifacts for comparison.`}),K(Z,{children:`Once configured, you'll be able to:`}),q(hi,{sx:{listStyleType:`disc`,pl:2},children:[K(gi,{sx:{display:`list-item`,p:0},children:K(Z,{children:`Run statistical data diffs`})}),K(gi,{sx:{display:`list-item`,p:0},children:K(Z,{children:`Run query diffs`})}),K(gi,{sx:{display:`list-item`,p:0},children:K(Z,{children:`Save checks to your Recce Checklist`})}),K(gi,{sx:{display:`list-item`,p:0},children:K(Z,{children:`...and more!`})})]}),K(Z,{children:`Take the next step toward better data impact assessment.`})]}),K(X,{sx:{width:`100%`,mt:3},children:K(Y,{color:`iochmara`,variant:`contained`,size:`large`,onClick:()=>{t?t():window.open(e,`_blank`)},children:`Start Now`})})]})})}function Xs({docsUrl:e=`https://docs.reccehq.com/configure-diff/`}={}){return q(X,{direction:`row`,spacing:`10px`,sx:{alignItems:`flex-start`},children:[K(J,{component:qi,sx:{color:`iochmara.main`,fontSize:20}}),q(X,{spacing:`5px`,children:[q(Z,{sx:{fontWeight:700},children:[`Single Environment Mode`,` `,K(Z,{component:`span`,sx:{color:`error.main`,fontWeight:600},children:`Limited Functionality`})]}),K(Z,{sx:{fontSize:`0.875rem`},children:`Single Environment Mode allows you to explore your dbt project but won't show data comparisons between environments.`}),K(Z,{sx:{fontSize:`0.875rem`},children:`To set up full environment comparison:`}),q(hi,{sx:{pl:2},children:[K(gi,{sx:{p:0,display:`list-item`},children:K(Z,{sx:{fontSize:`0.875rem`},children:"Run `recce debug` for setup assistance"})}),K(gi,{sx:{p:0,display:`list-item`},children:q(Z,{sx:{fontSize:`0.875rem`},children:[`Visit`,` `,K(tr,{sx:{color:`primary.main`,fontWeight:500},target:`_blank`,href:e,children:`docs`}),` `,`for configuration details`]})})]})]})]})}function Zs(){return K(J,{sx:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:K(ii,{size:48})})}function Qs({error:e,onRetry:t}){return K(J,{sx:{height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:q(X,{spacing:1,sx:{alignItems:`center`},children:[K(J,{children:`Failed to load lineage data. This could be because the server has been terminated or there is a network error.`}),q(J,{children:[`[Reason: `,e,`]`]}),K(Y,{color:`iochmara`,variant:`contained`,onClick:()=>{t&&t()},children:`Retry`})]})})}function $s({viewOptions:e,onViewOptionsChanged:t}){return K(J,{sx:{height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:q(X,{spacing:1,sx:{alignItems:`center`},children:[K(G,{children:`No change detected`}),K(Y,{color:`iochmara`,variant:`contained`,onClick:async()=>{await t({...e,view_mode:`all`})},children:`Show all nodes`})]})})}function ec(){let{isHistoryOpen:e,showHistory:t}=ye();if(!e)return q(J,{children:[K(J,{sx:{fontSize:`8pt`},children:`History`}),K(Y,{size:`xsmall`,variant:`outlined`,color:`neutral`,startIcon:K(ni,{}),onClick:()=>{bn({name:e?`hide`:`show`}),t()},children:`Show`})]})}const tc=e=>({fontSize:`8pt`,bgcolor:e?`grey.700`:`grey.100`,px:.5,borderRadius:1}),nc=()=>{let e=tc(en());return q(X,{spacing:0,sx:{alignItems:`flex-start`},children:[K(Z,{sx:{fontSize:`10pt`,color:`text.secondary`,pb:1},children:`Select nodes by dbt node selector syntax`}),q(Z,{sx:{fontSize:`8pt`},children:[K(J,{component:`code`,sx:e,children:`model_name`}),` `,`Select a node`]}),q(Z,{sx:{fontSize:`8pt`},children:[K(J,{component:`code`,sx:e,children:`model_name+`}),` `,`Select downstream nodes`]}),q(Z,{sx:{fontSize:`8pt`},children:[K(J,{component:`code`,sx:e,children:`+model_name`}),` `,`Select upstream nodes`]}),q(Z,{sx:{fontSize:`8pt`},children:[K(J,{component:`code`,sx:e,children:`model*`}),` `,`Select by wildcard`]})]})},rc=({isDisabled:e,viewOptions:t,onViewOptionsChanged:n})=>{let[r,i]=W(null),a=!!r,o=t.view_mode??`changed_models`,s=o===`changed_models`?`Changed Models`:`All`,c=e=>{i(e.currentTarget)},l=()=>{i(null)},u=e=>{n({...t,view_mode:e}),l()},d=Dt(`model`).icon;return q(G,{children:[K(Y,{size:`xsmall`,variant:`outlined`,color:`neutral`,onClick:c,disabled:e,startIcon:d&&K(d,{}),endIcon:K(Nr,{}),sx:{minWidth:100,textTransform:`none`,fontSize:`0.75rem`},children:s}),q(Qr,{anchorEl:r,open:a,onClose:l,children:[K(ai,{sx:{lineHeight:`32px`,bgcolor:`transparent`},children:`mode`}),q(oa,{value:o,children:[K($r,{onClick:()=>u(`changed_models`),children:K(jr,{value:`changed_models`,control:K(aa,{size:`small`,sx:{py:0}}),label:`Changed Models`,sx:{m:0}})}),K($r,{onClick:()=>u(`all`),children:K(jr,{value:`all`,control:K(aa,{size:`small`,sx:{py:0}}),label:`All`,sx:{m:0}})})]})]})]})},ic=({isDisabled:e,viewOptions:t,onViewOptionsChanged:n,lineageGraph:r})=>{let[i,a]=W(null),o=!!i,s=new Set,c=Object.values(r?.nodes??{});for(let e of c)e.data.packageName&&s.add(e.data.packageName);let l=r?.manifestMetadata.current?.project_name,u=t.packages?new Set(t.packages):l?new Set([l]):s,d=u.size===s.size,f=u.size===0,p=u.size===1?Array.from(u)[0]:d?`All Packages`:f?`No Package`:`${u.size} Packages`,m=e=>{a(e.currentTarget)},h=()=>{a(null)},g=()=>{n(d?{...t,packages:[]}:{...t,packages:Array.from(s)})},_=e=>{let r=new Set(u);r.has(e)?r.delete(e):r.add(e),n({...t,packages:Array.from(r)})};return q(G,{children:[K(Y,{size:`xsmall`,variant:`outlined`,color:`neutral`,onClick:m,disabled:e,startIcon:K(Ui,{}),endIcon:K(Nr,{}),sx:{minWidth:100,textTransform:`none`,fontSize:`0.75rem`},children:p}),q(Qr,{anchorEl:i,open:o,onClose:h,children:[K(ai,{sx:{lineHeight:`32px`,bgcolor:`transparent`},children:`Select Packages`}),q($r,{onClick:g,children:[K(Ar,{checked:d,indeterminate:!d&&!f,size:`small`,sx:{py:0}}),K($i,{children:`Select All`})]}),K(fi,{}),Array.from(s).map(e=>q($r,{onClick:()=>_(e),children:[K(Ar,{checked:u.has(e),size:`small`,sx:{py:0}}),K($i,{className:`no-track-pii-safe`,children:e})]},e))]})]})},ac=({value:e,onChange:t,isDisabled:n,tooltipComponent:r,showTooltip:i=!0})=>{let[a,o]=W(e),s=Xn(null);return H(()=>{s.current&&(s.current.value=e)},[e]),K($,{title:i?r:``,placement:`bottom-start`,slotProps:{tooltip:{sx:{width:`18.75rem`,p:2,boxShadow:3,border:1,borderRadius:1,color:`text.primary`,bgcolor:`background.paper`}}},children:K(li,{inputRef:s,size:`small`,placeholder:`with selectors`,disabled:n,value:a,onChange:e=>{o(e.target.value)},onKeyUp:n=>{n.key===`Enter`?t(a):n.key===`Escape`&&(n.preventDefault(),o(e),s.current&&s.current.blur())},onBlur:()=>{o(e)},sx:{"& .MuiInputBase-root":{width:`18.75rem`,height:24,fontSize:`0.75rem`},"& .MuiInputBase-input":{py:.5,px:1}}})})},oc=({isDisabled:e,viewOptions:t,onViewOptionsChanged:n,showTooltip:r})=>K(ac,{isDisabled:e,value:t.select??``,onChange:e=>{n({...t,select:e||void 0})},tooltipComponent:K(nc,{}),showTooltip:r}),sc=({isDisabled:e,viewOptions:t,onViewOptionsChanged:n})=>K(ac,{isDisabled:e,value:t.exclude??``,onChange:e=>{n({...t,exclude:e||void 0})}}),cc=({label:e,children:t,style:n})=>q(J,{style:n,sx:{maxWidth:300},children:[K(Z,{sx:{fontSize:`8pt`},children:(e??``).trim()||K(G,{children:`\xA0`})}),t]}),lc=({children:e})=>K(G,{children:e}),uc=({viewOptions:e,onViewOptionsChanged:t,lineageGraph:n,featureToggles:r,serverFlags:i,focusedNode:a,selectedNodes:o,onDeselect:s,onRunRowCount:c,onRunRowCountDiff:l,onRunValueDiff:u,onAddLineageDiffCheck:d,onAddSchemaDiffCheck:f,runTypeIcons:p,historyToggleSlot:m,SetupConnectionPopoverSlot:h=lc})=>{let g=i?.single_env_onboarding,[_,v]=W(null),y=!!_,b=o.length>0,x=b,S=e=>{v(e.currentTarget)},C=()=>{v(null)},w=p.rowCountDiff,T=p.valueDiff,E=p.lineageDiff,D=p.schemaDiff;return K(X,{direction:`row`,sx:{alignItems:`center`,borderBottom:1,borderColor:`neutral.light`,width:`100%`,p:`4pt 8pt`,gap:`0.5rem`},children:q(X,{direction:`row`,sx:{alignItems:`center`,flex:1,gap:`0.5rem`},children:[m,K(cc,{label:`Mode`,style:{flexShrink:1},children:K(rc,{isDisabled:x,viewOptions:e,onViewOptionsChanged:t})}),K(cc,{label:`Package`,style:{flexShrink:1},children:K(ic,{isDisabled:x,viewOptions:e,onViewOptionsChanged:t,lineageGraph:n})}),K(cc,{label:`Select`,style:{flexShrink:1},children:K(oc,{isDisabled:x,viewOptions:e,onViewOptionsChanged:t,showTooltip:g})}),K(cc,{label:`Exclude`,style:{flexShrink:1},children:K(sc,{isDisabled:x,viewOptions:e,onViewOptionsChanged:t})}),K(J,{sx:{flexGrow:1}}),b&&q(G,{children:[K(cc,{label:``,style:{flexShrink:0},children:K(Z,{sx:{fontSize:`9pt`,color:`text.secondary`},children:o.length>1?`${o.length} nodes selected`:`${o.length} node selected`})}),K(cc,{label:``,children:K(Y,{variant:`outlined`,color:`neutral`,size:`xsmall`,onClick:()=>{s()},sx:{textTransform:`none`,fontSize:`9pt`},children:`Deselect`})}),g&&K(cc,{label:`Explore`,children:q(J,{sx:{display:`inline-flex`},children:[K(Y,{size:`xsmall`,color:`neutral`,variant:`outlined`,onClick:S,endIcon:K(Nr,{}),sx:{textTransform:`none`,fontSize:`0.75rem`},children:`Actions`}),K(Qr,{anchorEl:_,open:y,onClose:C,anchorOrigin:{vertical:`bottom`,horizontal:`right`},transformOrigin:{vertical:`top`,horizontal:`right`},children:q($r,{disabled:r.disableDatabaseQuery,onClick:async()=>{await c?.(),C()},children:[K(Qi,{children:K(w,{fontSize:`small`})}),K($i,{children:`Row Count`})]})})]})})]}),!g&&K(cc,{label:`Explore`,children:q(J,{sx:{display:`inline-flex`},children:[K(Y,{size:`xsmall`,color:`neutral`,variant:`outlined`,disabled:r.disableViewActionDropdown,onClick:S,endIcon:K(Nr,{}),sx:{textTransform:`none`,fontSize:`0.75rem`},children:`Actions`}),q(Qr,{anchorEl:_,open:y,onClose:C,anchorOrigin:{vertical:`bottom`,horizontal:`right`},transformOrigin:{vertical:`top`,horizontal:`right`},children:[K(ai,{sx:{lineHeight:`32px`,bgcolor:`transparent`},children:`Diff`}),K(h,{display:r.mode===`metadata only`,children:q($r,{disabled:r.disableDatabaseQuery,onClick:async()=>{await l?.(),C()},children:[K(Qi,{children:K(w,{fontSize:`small`})}),K($i,{children:`Row Count Diff`})]})}),K(h,{display:r.mode===`metadata only`,children:q($r,{disabled:r.disableDatabaseQuery,onClick:async()=>{await u?.(),C()},children:[K(Qi,{children:K(T,{fontSize:`small`})}),K($i,{children:`Value Diff`})]})}),(!r.disableUpdateChecklist||r.checklistPermissionDenied)&&[K(fi,{},`checklist-divider`),K(ai,{sx:{lineHeight:`32px`,bgcolor:`transparent`},children:`Add to Checklist`},`checklist-header`),K($,{title:r.checklistPermissionDenied?`You don't have permission to add checks`:``,placement:`left`,children:K(`span`,{children:q($r,{disabled:r.checklistPermissionDenied,onClick:()=>{r.checklistPermissionDenied||(d?.(e.view_mode),C())},children:[K(Qi,{children:K(E,{fontSize:`small`})}),K($i,{children:`Lineage Diff`})]})})},`add-lineage-diff`),K($,{title:r.checklistPermissionDenied?`You don't have permission to add checks`:``,placement:`left`,children:K(`span`,{children:q($r,{disabled:r.checklistPermissionDenied,onClick:()=>{r.checklistPermissionDenied||(f?.(),C())},children:[K(Qi,{children:K(D,{fontSize:`small`})}),K($i,{children:`Schema Diff`})]})})},`add-schema-diff`)]]})]})})]})})},dc=({display:e,children:t})=>K(ul,{display:e,children:t}),fc=()=>{let{deselect:e,focusedNode:t,selectedNodes:n,viewOptions:r,onViewOptionsChanged:i,runRowCount:a,runRowCountDiff:o,runValueDiff:s,addLineageDiffCheck:c,addSchemaDiffCheck:l}=de(),{lineageGraph:u}=L(),{featureToggles:d}=ce(),{data:f}=ge();return K(uc,{viewOptions:r,onViewOptionsChanged:i,lineageGraph:u,featureToggles:d,serverFlags:f,focusedNode:t,selectedNodes:n,onDeselect:e,onRunRowCount:a,onRunRowCountDiff:o,onRunValueDiff:s,onAddLineageDiffCheck:c,onAddSchemaDiffCheck:l,runTypeIcons:{rowCountDiff:B(`row_count_diff`).icon,valueDiff:B(`value_diff`).icon,lineageDiff:B(`lineage_diff`).icon,schemaDiff:B(`schema_diff`).icon},historyToggleSlot:K(ec,{}),SetupConnectionPopoverSlot:dc})};function pc(e,t,n=!1){let r=Po(t),i=new Set;for(let n of Object.keys(e.nodes)){let a=e.nodes[n];Fo(n,t,a.data.changeStatus,r)&&i.add(n)}if(n){let{wholeModelImpactedNodeIds:n,wholeModelChangedNodeIds:a}=Io(e,t);return{nodeIds:i,columnIds:r,wholeModelImpactedNodeIds:n,wholeModelChangedNodeIds:a}}return{nodeIds:i,columnIds:r}}function mc(e,t,n,r){return e&&t&&n?.node_id&&n?.column?he(t,n.node_id,n.column,r??new Set):void 0}async function hc(e,t,n,r,i){let a={...e,change_analysis:e.change_analysis??t},o=await n.mutateAsync(a);return a.change_analysis&&o&&(r.current={pending:!0,cllData:o},i.setQueryData(F.lineage(),e=>e&&{...e,lineage:Ws(e.lineage,o)})),o}function gc({interactive:e=!1,...t},n){let{isDark:i}=Lt(),{apiClient:a}=Wt(),o=Hn(),s=Dr(),c=Xn(null),{copyToClipboard:l,ImageDownloadModal:u,ref:f}=yo(),[p,m,h]=Er(io),[g,v,y]=Tr([]),{lineageGraph:b,refetchLineageGraph:C,isLoading:w,error:E,refetchRunsAggregated:D}=L(),{featureToggles:O,singleEnv:k}=ce(),{data:A}=ge(),j=A?.new_cll_experience??!1,ee=A?.whole_model_impact??!1,{runId:N,showRunId:ne,closeRunResult:re,runAction:ie,isRunResultOpen:oe}=ye(),{run:se}=At(N),[I,le]=W({...t.viewOptions}),ue=wo(),de=Xn([]).current,[fe,pe]=W(void 0),[me,he]=W(!1),_e=Xn(!1);_e.current=me;let Te=Bn({mutationFn:e=>r(e,a)}),Ee=Xn({pending:!1}),[De,Oe]=W({}),Ae=V(e=>p.filter(xe).find(t=>t.data.name===e),[p]);Jn(n,()=>({copyToClipboard:l}));let je=U(()=>!!(b&&b.modifiedSet.length>0),[b]),Me=I.view_mode??`changed_models`,Ne=U(()=>p.filter(e=>e.type===`lineageGraphNode`).map(e=>e.id),[p]),Pe=U(()=>b?Ne.map(e=>b.nodes[e]):[],[b,Ne]),[Fe,Ie]=W(),R=Fe?b?.nodes[Fe]:void 0,[Le,Re]=W([]),[z,ze]=W(),[Be,Ve]=W(new Set),He=U(()=>b?Array.from(Be).map(e=>b.nodes[e]):[],[b,Be]),Ue=Ao(He.length>0?He:Pe,{onActionStarted:()=>{ze(`action_result`)},onActionNodeUpdated:e=>{m(t=>t.map(t=>t.id===e.id?{...t}:t))},onActionCompleted:()=>{}}),We=V(()=>{let e=new Map,t=s.getNodes();for(let n of t)!n.parentId&&n.position&&e.set(n.id,{x:n.position.x,y:n.position.y});return e},[s]),Ge=U(()=>{if(!b)return new Set;let e=new Set;if(fe){for(let[t,n]of Object.entries(fe.current.nodes))n.impacted!==!1&&e.add(t);for(let t of Object.keys(fe.current.columns))e.add(t)}else if(z===`action_result`){let t=Object.keys(Ue.actionState.actions);e=new Set(t)}else e=R?be(we(b,[R.id]),Se(b,[R.id])):je?Se(b,b.modifiedSet):new Set(Ne);return new Set(e)},[b,fe,z,R,je,Ue.actionState.actions,Ne]),Ke=zo(),Je=()=>{Ke.closeContextMenu()},Xe=Xn(!1),{impactedNodeIds:Ze,impactedColumnIds:Qe,wholeModelImpactedNodeIds:et,wholeModelChangedNodeIds:tt,publish:nt}=So(),rt=U(()=>ao({impactedNodeIds:Ze,newCllExperience:j}),[Ze,j]);Yn(()=>{(async()=>{let e;if(!b)return;if(I.node_ids)e=I.node_ids;else{let n=b.manifestMetadata.current?.project_name,r={view_mode:I.view_mode??(je?`changed_models`:`all`),packages:n?[n]:void 0,...t.viewOptions};try{e=(await T({select:r.select,exclude:r.exclude,packages:r.packages,view_mode:r.view_mode},a)).nodes}catch{r.view_mode=`all`,e=(await T({select:r.select,exclude:r.exclude,packages:r.packages,view_mode:r.view_mode},a)).nodes}le(r)}let n=I.column_level_lineage,r=!1;A?.impact_at_startup&&!Xe.current&&!n&&(Xe.current=!0,r=!0,_e.current=!0,he(!0),n={change_analysis:!0,no_upstream:!0},le(e=>({...e,column_level_lineage:n})));let i;if(n)if(Ee.current.pending)i=Ee.current.cllData,Ee.current={pending:!1};else try{i=await hc(n,_e.current,Te,Ee,o)}catch(e){if(r&&(_e.current=!1,he(!1),le(e=>({...e,column_level_lineage:void 0})),n=void 0),e instanceof ae){cn.create({title:`Column Level Lineage error`,description:e.data?.detail??e.message,type:`error`,closable:!0});return}}else Ee.current={pending:!1};let s=j&&i?pc(b,i,A?.whole_model_impact??!1):void 0,[c,l,u]=await Bo(b,{selectedNodes:e,cll:i,newCllExperience:j,columnAncestry:mc(j,i,n,s?.columnIds)});m(c),v(l),Oe(u),pe(i),s&&n?.change_analysis&&!n?.column&&nt(s),ue(c,I.view_mode??`changed_models`,_e.current,!!n?.column,!!Fe||!!se)})()},[b,A?.impact_at_startup]);let it=()=>{Ie(void 0),Re([])},at=e=>{b?.nodes[e]&&(Fe&&Fe!==e&&Re(e=>[...e,Fe]),Ie(e))},ot=()=>{if(Le.length===0)return;let e=Le[Le.length-1];b?.nodes[e]&&(Ie(e),Re(e=>e.slice(0,-1)))},st=e=>{if(e<0||e>=Le.length)return;let t=Le[e];b?.nodes[t]&&(Ie(t),Re(t=>t.slice(0,e)))},B=()=>{Fe&&ct(Fe)},ct=async e=>{let t=p.find(t=>t.id===e);if(t){if(t.parentId){let e=t.parentId;t=p.find(t=>t.id===e)??t}if(t.measured!=null){let{width:e,height:n}=t.measured;if(e&&n){let r=t.position.x+e/2,i=t.position.y+n/2,a=s.getZoom();await s.setCenter(r,i,{zoom:a,duration:200})}}}},lt=bo();Co(c,async()=>{z!==`selecting`&&(Fe?await ct(Fe):await s.fitView({nodes:p,duration:200,padding:Ye,minZoom:$e,maxZoom:1}))});let ut=async(e,t=!1)=>{let n=I.column_level_lineage;!e&&!j&&he(!1);let r=n!==void 0;await ht({...I,column_level_lineage:e},!1,r),t||de.push(n),e?.node_id?Ie(e.node_id):e||Ie(void 0)},dt=async e=>{if(e){if(de.length===0)return;let e=de.pop();e?await ut(e,!0):await ut(void 0,!0)}else j&&me?await ut({change_analysis:!0,no_upstream:!0},!0):await ut(void 0,!0)},ft=(e,t)=>{z||ut({node_id:t.data.node.id,column:t.data.column})},pt=(t,n)=>{if(e&&b){if(Ce(n)){ft(t,n);return}if(Je(),!z)Ie(n.id),Re([]);else if(z===`action_result`){let e=Ue.actionState.actions[n.id];e.run?.run_id&&ne(e.run.run_id),Ie(n.id),Re([])}else{let e=new Set(Be);Be.has(n.id)?e.delete(n.id):e.add(n.id),Ve(e),e.size===0&&ze(void 0)}}},mt=async e=>{let{viewOptions:t=I}=e,{fitView:n,preservePositions:r=!1}=e,i;if(!b)return;if(I.select!==t.select||I.exclude!==t.exclude||I.packages!==t.packages||I.view_mode!==t.view_mode){try{let e=await T({select:t.select,exclude:t.exclude,packages:t.packages,view_mode:t.view_mode},a);t={...t,column_level_lineage:void 0},i=e.nodes}catch(e){e instanceof ae&&cn.create({title:`Select node error`,description:e.data?.detail??e.message,type:`error`,closable:!0});return}Ie(void 0)}else i=p.map(e=>e.id);let c;if(t.column_level_lineage)try{c=await hc(t.column_level_lineage,me,Te,Ee,o)}catch(e){if(e instanceof ae){cn.create({title:`Column Level Lineage error`,description:e.data?.detail??e.message,type:`error`,closable:!0});return}}else j||he(!1);let l;(r||j)&&(l=We());let u=t.column_level_lineage,d=j&&c?pc(b,c,A?.whole_model_impact??!1):void 0,[f,h,g]=await Bo(b,{selectedNodes:i,cll:c,existingPositions:l,newCllExperience:j,columnAncestry:mc(j,c,u,d?.columnIds)});m(f),v(h),Oe(g),pe(c),d&&!u?.column&&nt(d),ue(f,t.view_mode??`changed_models`,me,!!t.column_level_lineage?.column,!!Fe||!!se),Ks(se,p)&&re(),n&&(await new Promise(e=>setTimeout(e,1)),s.fitView({nodes:f,duration:200,padding:Ye,minZoom:$e,maxZoom:1}))},ht=async(e,t=!0,n=!1)=>{le(e),await mt({viewOptions:e,fitView:t,preservePositions:n})};H(()=>{let t=se?.type;if(e&&oe&&!(!t||[`query_diff`,`query`,`row_count`,`row_count_diff`].includes(t))&&!z){let e;(x(se)||M(se)||_(se)||te(se)||P(se))&&(e=se.params?.model);let t=new MouseEvent(`click`,{bubbles:!0,cancelable:!0,view:window});if(e){let n=Ae(e);n?xe(n)&&R?.id!==n.id&&pt(t,n):ht({...I,view_mode:`all`})}else it()}},[se,I,oe,z,Ae,R,e]);let gt=(e,t=1e3)=>{z===`action_result`||b===void 0||(z||(ze(`selecting`),Ue.reset(),I.column_level_lineage&&ht({...I,column_level_lineage:void 0})),Ve(be(Be,we(b,[e],t))))},vt=(e,t=1e3)=>{z===`action_result`||b===void 0||(z||(ze(`selecting`),Ue.reset(),I.column_level_lineage&&ht({...I,column_level_lineage:void 0})),Ve(be(Be,Se(b,[e],t))))},yt=(t,n)=>{if(!e||z===`action_result`)return;t.preventDefault();let r=f.current,i=r.getBoundingClientRect(),a=t.clientX-i.left,o=t.clientY-i.top+r.offsetTop;Ke.showContextMenu(a,o,n)},bt=e=>{if(!z){if(!b)return;Ve(new Set([e])),ze(`selecting`),Ie(void 0),Ue.reset()}else if(z===`selecting`){let t=new Set(Be);Be.has(e)?t.delete(e):t.add(e),Ve(t),t.size===0&&ze(void 0)}},xt=()=>{ze(void 0),Ve(new Set),Ie(void 0),re(),D?.()},St={interactive:e,nodes:p,focusedNode:R,selectedNodes:He,viewOptions:I,showContextMenu:yt,onViewOptionsChanged:ht,selectMode:z,selectNode:bt,selectParentNodes:gt,selectChildNodes:vt,deselect:xt,impactedNodeIds:Ze,impactedColumnIds:Qe,wholeModelChangedNodeIds:tt,wholeModelImpactedNodeIds:et,isNodeHighlighted:e=>Ge.has(e),isNodeSelected:e=>Be.has(e),isEdgeHighlighted:(e,t)=>fe?e in fe.current.parent_map?t in fe.current.parent_map[e]:!1:Ge.has(e)&&Ge.has(t),isNodeShowingChangeAnalysis:e=>{if(!b||!me)return!1;let t=e in b.nodes?b.nodes[e]:void 0,n=I.column_level_lineage;return n?.node_id&&!n.column?n.node_id===e&&!!t?.data.changeStatus:!!t?.data.changeStatus},changeAnalysisMode:me,newCllExperience:j,wholeModelImpact:ee,setChangeAnalysisMode:he,getNodeAction:e=>Ue.actionState.actions[e],getNodeColumnSet:e=>e in De?new Set(De[e]):new Set,runRowCount:async()=>{z===`selecting`?(await Ue.runRowCount(),wn({type:`row_count`,selected:`multi`})):R?(ie(`row_count`,{node_names:[R.data.name]},{showForm:!1,showLast:!1}),wn({type:`row_count`,selected:`single`})):(ie(`row_count`,{select:I.select,exclude:I.exclude,packages:I.packages,view_mode:I.view_mode}),wn({type:`row_count`,selected:`none`}))},runRowCountDiff:async()=>{z===`selecting`?(await Ue.runRowCountDiff(),wn({type:`row_count_diff`,selected:`multi`})):R?(ie(`row_count_diff`,{node_names:[R.data.name]},{showForm:!1,showLast:!1}),wn({type:`row_count_diff`,selected:`single`})):(ie(`row_count_diff`,{select:I.select,exclude:I.exclude,packages:I.packages,view_mode:I.view_mode}),wn({type:`row_count_diff`,selected:`none`}))},runValueDiff:async()=>{R?(ie(`value_diff`,{model:R.data.name},{showForm:!0,showLast:!1}),wn({type:`value_diff`,selected:`single`})):(await Ue.runValueDiff(),wn({type:`value_diff`,selected:z===`selecting`?`multi`:`none`}))},addLineageDiffCheck:async()=>{let e=await d(I,a),t;t=z===`selecting`?`multi`:R?`single`:`none`,wn({type:`lineage_diff`,selected:t}),e&&(await o.invalidateQueries({queryKey:F.checks()}),lt(e))},addSchemaDiffCheck:async()=>{let e;z===`selecting`?He.length>0&&(e=await Ue.addSchemaDiffCheck(),xt(),wn({type:`schema_diff`,selected:`multi`})):R?(e=await S({node_id:R.id},a),wn({type:`schema_diff`,selected:`single`})):(e=await S({select:I.select,exclude:I.exclude,packages:I.packages,view_mode:I.view_mode},a),wn({type:`schema_diff`,selected:`none`})),e&&(await o.invalidateQueries({queryKey:F.checks()}),lt(e))},cancel:Ue.cancel,actionState:Ue.actionState,centerNode:ct,cll:fe,showColumnLevelLineage:ut,resetColumnLevelLineage:dt};return w?K(Zs,{}):E?K(Qs,{error:E,onRetry:C}):!b||p==io?K(G,{}):Me===`changed_models`&&!b.modifiedSet.length?K($s,{viewOptions:I,onViewOptionsChanged:ht}):K(ve.Provider,{value:St,children:q(kt,{sizes:R?[70,30]:[100,0],minSize:0,gutterSize:5,className:R?void 0:`split-gutter-hidden`,style:{height:`100%`,width:`100%`},children:[q(X,{ref:c,divider:K(fi,{sx:{borderColor:`grey.200`}}),spacing:0,sx:{contain:`strict`,position:`relative`},children:[e&&q(G,{children:[K(fc,{}),O.mode===`metadata only`&&K(Js,{})]}),q(xr,{proOptions:{hideAttribution:!0},nodeTypes:no,edgeTypes:ro,nodes:p,edges:g,onNodesChange:h,onEdgesChange:y,onNodeClick:pt,onNodeContextMenu:yt,onClick:Je,onInit:async()=>{if(je){let e=p.filter(e=>xe(e)&&e.data.changeStatus!==void 0),t=e.length>0?e:p;await s.fitView({nodes:t,duration:200,padding:Ye,minZoom:$e,maxZoom:1})}else{let e=wr(p,{});await s.setCenter(e.x+e.width/2,e.y+e.height/2,{zoom:1})}},maxZoom:1,minZoom:qe,nodesDraggable:e,ref:f,colorMode:i?`dark`:`light`,children:[K(pr,{id:`lineage-bg`,variant:mr.Dots,color:i?ke.neutral[700]:ke.neutral[300],gap:20,size:2}),K(_r,{showInteractive:!1,position:`top-right`,className:_t,style:{backgroundColor:i?ke.neutral[700]:void 0,borderColor:i?ke.neutral[600]:void 0},children:K(gr,{title:`copy image`,onClick:async()=>{await l(),mn({type:Me,from:`lineage_view`})},style:{backgroundColor:i?ke.neutral[700]:void 0,color:i?ke.neutral[200]:void 0},children:K(J,{component:Vi})})}),K(u,{}),K(yr,{position:`bottom-left`,children:q(X,{spacing:`5px`,children:[je&&K(Mt,{variant:`changeStatus`,newCllExperience:j}),I.column_level_lineage&&K(Mt,{variant:`transformation`})]})}),K(yr,{position:`top-center`,children:K(jo,{notification:k?K(Xs,{}):null,type:`info`})}),K(yr,{position:`top-left`,children:q(X,{spacing:`5px`,children:[K(No,{action:Te}),p.length==0&&K(Z,{sx:{fontSize:`1.25rem`,color:`grey`,opacity:.5},children:`No nodes`})]})}),p.length<=500&&K(vr,{nodeColor:rt,nodeStrokeWidth:3,zoomable:!0,pannable:!0,bgColor:i?ke.neutral[800]:void 0,maskColor:i?`${ke.neutral[900]}99`:`${ke.neutral[100]}99`}),z===`action_result`&&K(yr,{position:`bottom-center`,className:`ignore-screenshot`,children:K(Mo,{onClose:()=>{xt()}})})]}),K(Ro,{...Ke.props})]}),R?K(J,{sx:{borderLeft:`solid 1px`,borderColor:`divider`,height:`100%`},children:K(Us,{node:R,onCloseNode:it,onNavigateToNode:at,onBack:Le.length>0?ot:void 0,onCenterFocused:B,historyTrail:Le,onJumpToHistory:st})}):K(J,{})]})})}const _c=Gn(gc);function vc(){return K(Sr,{children:K(_c,{interactive:!0})})}const yc=Gn(function(e,t){let{lineageGraph:n,viewOptions:r,interactive:i=!0,height:a=600,filterNodes:o,onNodeSelect:s,onNodeDoubleClick:c,dagre:l,showMiniMap:u=!0,showControls:d=!0,showBackground:f=!0}=e,p=Xn(null),m=L(),h=n??m.lineageGraph,g=!n&&m.isLoading,_=n?void 0:m.error,{nodes:v,edges:y}=U(()=>{if(!h)return{nodes:[],edges:[]};let e;if(r?.node_ids&&r.node_ids.length>0?e=r.node_ids:r?.view_mode===`changed_models`&&(e=h.modifiedSet),r?.select&&e&&r.select.includes(`+`)){let t=we(h,e),n=Se(h,e);e=[...new Set([...t,...n])]}if(r?.packages&&r.packages.length>0){let t=new Set(r.packages);e=(e??Object.keys(h.nodes)).filter(e=>{let n=h.nodes[e];return n?.data.packageName&&t.has(n.data.packageName)})}o&&(e=(e??Object.keys(h.nodes)).filter(e=>{let t=h.nodes[e];return t?o(e,t):!1}));let[t,n]=me(h,e);return l&&t.length>0&&bc(l,t,n),{nodes:t.map(e=>({id:e.id,position:e.position,type:`lineageNode`,data:{label:e.data.name,nodeType:e.data.resourceType,changeStatus:e.data.changeStatus,resourceType:e.data.resourceType,packageName:e.data.packageName}})),edges:n.map(e=>({id:e.id,source:e.source,target:e.target,type:`lineageEdge`,data:{changeStatus:e.data?.changeStatus}}))}},[h,r,o,l]),b=V(async()=>{if(p.current)try{let e=await sa.toBlob(p.current,{backgroundColor:`#ffffff`,dpr:1,scale:2,type:`png`});await navigator.clipboard.write([new ClipboardItem({[e.type]:e})])}catch(e){throw console.error(`Failed to copy to clipboard:`,e),e}},[]);return Jn(t,()=>({copyToClipboard:b}),[b]),g?K(J,{sx:{width:`100%`,height:a,display:`flex`,alignItems:`center`,justifyContent:`center`},children:K(ii,{})}):_?K(J,{sx:{width:`100%`,height:a,display:`flex`,alignItems:`center`,justifyContent:`center`},children:K(Z,{color:`error`,children:_})}):h?v.length===0?K(J,{sx:{width:`100%`,height:a,display:`flex`,alignItems:`center`,justifyContent:`center`},children:K(Z,{sx:{color:`text.secondary`},children:`No nodes match the current filter criteria.`})}):K(J,{ref:p,sx:{width:`100%`,height:a},children:K(Do,{nodes:v,edges:y,onNodeSelect:s,onNodeDoubleClick:c,showMiniMap:u,showControls:d,showBackground:f,height:`100%`,interactive:i})}):K(J,{sx:{width:`100%`,height:a,display:`flex`,alignItems:`center`,justifyContent:`center`},children:K(Z,{sx:{color:`text.secondary`},children:`No lineage data available. Provide data via LineageGraphProvider or lineageGraph prop.`})})});function bc(e,t,n,r=`LR`){let i=new e.graphlib.Graph;i.setDefaultEdgeLabel(()=>({})),i.setGraph({rankdir:r,ranksep:50,nodesep:30});for(let e of t){let t=e.style?.width?Number(e.style.width):300,n=e.style?.height?Number(e.style.height):60;i.setNode(e.id,{width:t,height:n})}for(let e of n)i.setEdge(e.source,e.target);e.layout(i);for(let e of t){let t=e.style?.width?Number(e.style.width):300,n=e.style?.height?Number(e.style.height):60,r=i.node(e.id);r&&(e.position={x:r.x-t/2,y:r.y-n/2})}}function xc({variant:e=`banner`,dismissible:t=!1,sessionId:n,toastAdapter:r,successToastOnlyOnUserRefresh:a=!1,requireCloudMode:o=!0,messageVariant:s=`data`,showFirstTimePopover:c=!0,cardSx:l}={}){let{cloudMode:u}=L(),{apiClient:d}=Wt(),p=r??wc,[m,h]=W(!1),g=Xn(null),[_,v]=W(null),y=Xn(!1),{data:b}=Pe({select:e=>e.session_staleness}),x=Xn(null),S=b==null?!1:f(b),C=t&&n?`recce-staleness-banner-dismissed-signature::${n}`:null,[w,T]=W(()=>Cc(C));if(H(()=>{T(Cc(C))},[C]),H(()=>{},[t,n]),H(()=>{},[o,r]),H(()=>{let e=x.current===!0&&!S,t=!a||y.current;e&&t&&(p.success(`Base refreshed. If you've saved checks in this session, you may want to re-run them against the new base.`,{duration:8e3}),h(!1),g.current&&=(clearTimeout(g.current),null),y.current=!1),x.current=S},[S,a,p]),H(()=>()=>{g.current&&clearTimeout(g.current)},[]),o&&!u||!b||!S)return null;let E=Sc(b);if(t&&w===E)return null;let D=b.current_base_session_id===null,O=s===`metadata`?`Production metadata has changed since this PR's base was captured. Comparisons may not reflect current state.`:`Production data has changed since this PR's base was captured. Comparisons may not reflect current state.`,k=async()=>{y.current=!0,h(!0),g.current=setTimeout(()=>{h(!1),p.error(`Refresh failed — try again.`,{duration:5e3}),g.current=null,y.current=!1},3e4);try{await i(d)}catch{if(!g.current)return;clearTimeout(g.current),g.current=null,h(!1),y.current=!1,p.error(`Refresh failed — try again.`,{duration:5e3})}},A=()=>{if(g.current&&=(clearTimeout(g.current),null),h(!1),y.current=!1,C)try{sessionStorage.setItem(C,E)}catch{}T(E)},j=D?`This PR's base snapshot may be out of date, and no shared base is currently configured for this project. Comparisons may not reflect current state.`:O,ee=K($,{title:D?`No shared base configured for this project.`:``,disableHoverListener:!D,children:K(`span`,{children:K(Y,{size:`small`,variant:`outlined`,onClick:()=>void k(),disabled:m||D,startIcon:m?K(ii,{size:12}):void 0,sx:{whiteSpace:`nowrap`},children:m?`Refreshing…`:`Refresh base`})})}),M=t?K(Q,{"aria-label":`Dismiss`,size:`small`,onClick:A,sx:{flex:`0 0 auto`},children:K(lr,{})}):null,N=c?K(vo,{anchorEl:_}):null;return e===`card`?q(ca,{ref:v,role:`status`,elevation:4,sx:[{position:`fixed`,left:`50%`,transform:`translateX(-50%)`,zIndex:e=>e.zIndex.drawer+1,maxWidth:760,minWidth:480,bgcolor:`warning.light`,border:1,borderColor:`warning.main`,borderRadius:1,px:1.5,py:1},...Array.isArray(l)?l:[l]],children:[q(X,{direction:`row`,spacing:1,sx:{alignItems:`center`},children:[K(J,{component:Ii,sx:{flex:`0 0 auto`},size:18}),K(Z,{variant:`body2`,sx:{flex:1},children:j}),ee,M]}),N]}):q(J,{ref:v,role:`status`,sx:{bgcolor:`warning.light`,borderBottom:1,borderColor:`warning.main`,px:2,py:.75},children:[q(X,{direction:`row`,spacing:1,sx:{alignItems:`center`},children:[K(Ii,{color:`inherit`,size:16}),K(Z,{variant:`body2`,sx:{flex:1},children:j}),ee,M]}),N]})}function Sc(e){return`${e.source_session_id}|${e.source_session_updated_at}|${e.current_base_session_id}|${e.current_base_updated_at}`}function Cc(e){if(!e||typeof window>`u`)return null;try{return sessionStorage.getItem(e)}catch{return null}}const wc={success:(e,t)=>{cn.success({description:e,duration:t?.duration??5e3,closable:!0})},error:(e,t)=>{cn.error({description:e,duration:t?.duration??5e3,closable:!0})}},Tc=re({baseURL:Mn??``});async function Ec(e=Tc){return(await e.post(`/api/connect`)).data}function Dc({handleParentClose:e,parentOpen:t=!1,ignoreCookie:n=!1,variant:r=`auth`}){let{authed:i}=ce(),{apiClient:a}=Wt(),[o,s]=W(t||!i),c=nr.get(`authState`)??`pending`,[l,u]=W(n?`pending`:c);if(l===`ignored`&&!n||i)return null;let d={auth:{title:`Configure Cloud Token`,action:`Get token and configure`},"enable-share":{title:`Enable Sharing with Cloud`,action:`Enable sharing`},"user-profile":{title:`Configure Cloud Token`,action:`Get token and configure`}}[r],f=()=>{s(!1),e&&e(!1)};return q(Zn,{open:o,onClose:f,maxWidth:`sm`,fullWidth:!0,slotProps:{paper:{sx:{borderRadius:`1rem`}}},children:[l!==`authenticating`&&K(er,{sx:{textAlign:`center`,fontSize:`1.5rem`},children:d.title}),l===`authenticating`?q(G,{children:[K($n,{className:`space-y-2 self-center font-light`,children:q(X,{spacing:2,sx:{alignItems:`center`,pt:`1rem`},children:[K(J,{component:`img`,sx:{height:`6rem`,objectFit:`contain`,mx:`auto`,mb:1},src:`/imgs/reload-image.svg`,alt:`Reload`}),K(Z,{sx:{fontSize:`1.5rem`,fontWeight:500},children:`Reload to Finish`}),K(Z,{children:`Reload to complete connection to Recce Cloud`})]})}),K(Qn,{sx:{px:3,pb:3},children:K(Y,{fullWidth:!0,color:`brand`,variant:`contained`,onClick:()=>{window.location.reload()},children:`Reload`})})]}):q(G,{children:[q($n,{className:`space-y-2 font-light`,children:[K(Z,{children:`To enable sharing, get your token from Recce Cloud and launch your local instance with it.`}),q(`ul`,{className:`list-inside list-disc`,children:[K(`li`,{children:`Share your instance with teammates via Recce Cloud.`}),K(`li`,{children:`Your instance will be securely and freely hosted for sharing.`}),r===`auth`&&K(`li`,{children:`This step is recommended but optional.`})]}),q(J,{sx:{display:`flex`,gap:1},children:[`More directions`,q(tr,{underline:`always`,sx:{color:`primary.main`,"&:focus":{outline:`none`}},href:new URL(`/connect-to-cloud`,Nn).href,target:`_blank`,children:[`here `,K(rr,{style:{display:`inline`}})]})]})]}),q(Qn,{sx:{flexDirection:`column`,gap:1,px:3,pb:3},children:[q(Y,{fullWidth:!0,color:`brand`,variant:`contained`,sx:{borderRadius:2,fontWeight:500},onClick:async()=>{u(`authenticating`);let{connection_url:e}=await Ec(a);window.open(e,`_blank`)},children:[d.action,` `,K(rr,{style:{marginLeft:4}})]}),K(Y,{fullWidth:!0,color:`neutral`,variant:`text`,size:`small`,sx:{borderRadius:2,fontWeight:500},onClick:f,children:r===`auth`?`Skip`:`Cancel`}),r===`auth`&&K(Y,{fullWidth:!0,variant:`text`,size:`small`,sx:{borderRadius:2,fontWeight:500,color:`text.primary`},onClick:()=>{nr.set(`authState`,`ignored`,{expires:30}),u(`ignored`),f()},children:`Snooze for 30 days`})]})]})]})}function Oc(){let{apiClient:e}=Wt(),{data:t,isLoading:n,error:r}=Vn({queryKey:F.user(),queryFn:()=>Ln(e),retry:!1}),{data:i}=Vn({queryKey:[`github-avatar`,t?.id],queryFn:()=>t?In(t.id):Promise.resolve(null),enabled:!!t?.id&&t.login_type===`github`,retry:!1,staleTime:300*1e3}),[a,o]=W(null),s=!!a,c=e=>{o(e.currentTarget)},l=()=>{o(null)},u=!n&&!r&&t;return q(G,{children:[n?K(J,{onClick:c,sx:{width:32,height:32,borderRadius:`50%`,bgcolor:`background.paper`,color:`primary.main`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`},children:K(ii,{size:16})}):K(_i,{onClick:c,src:i||void 0,sx:{width:28,height:28,cursor:`pointer`,outline:`1px solid white`,fontSize:`0.875rem`},children:(e=>e?e.charAt(0).toUpperCase():`U`)(t?.login)}),q(Qr,{anchorEl:a,open:s,onClose:l,slotProps:{paper:{sx:{bgcolor:`background.paper`,borderColor:`divider`,boxShadow:3,minWidth:180}}},children:[q(J,{sx:{px:2,py:1.5},children:[n&&q(J,{sx:{display:`flex`,alignItems:`center`,gap:1},children:[K(Z,{variant:`body2`,sx:{color:`text.primary`},children:`Loading...`}),K(ii,{size:16})]}),r&&K(Z,{variant:`caption`,color:`error`,children:`Failed to load user information`}),u&&q(G,{children:[K(Z,{variant:`body2`,sx:{fontWeight:`600`,color:`text.primary`},children:t.login}),t.email&&K(Z,{variant:`caption`,sx:{color:`text.secondary`},children:t.email})]})]}),K(fi,{}),q($r,{onClick:()=>{window.open(Nn,`_blank`),l()},children:[K(Qi,{children:K(Ti,{})}),K($i,{children:`Recce Cloud`})]}),q($r,{onClick:()=>{window.open(Pn,`_blank`),l()},children:[K(Qi,{children:K(ji,{})}),K($i,{children:`Get live support`})]})]})]})}const kc=()=>{let{setTheme:e,resolvedTheme:t}=or(),[n,r]=W(!1);H(()=>{r(!0)},[]);let i=()=>{e(t===`dark`?`light`:`dark`)};if(!n)return K(Q,{size:`small`,sx:{color:`rgba(255, 255, 255, 0.8)`,"&:hover":{bgcolor:`rgba(255, 255, 255, 0.1)`}},disabled:!0,children:K(qr,{style:{width:18,height:18}})});let a=t===`dark`;return K($,{title:a?`Switch to light mode`:`Switch to dark mode`,children:K(Q,{size:`small`,onClick:i,sx:{color:`rgba(255, 255, 255, 0.8)`,"&:hover":{bgcolor:`rgba(255, 255, 255, 0.1)`}},"aria-label":a?`Switch to light mode`:`Switch to dark mode`,children:K(a?qr:Vr,{style:{width:18,height:18}})})})};function Ac(e,t,n,r){let i=e?.git,a=e?.pullRequest,o=e?.dbt?.base,s=e?.dbt?.current,c={review_mode:t||!1,adapter_type:e?.adapterType||null,has_git_info:!xi(i),has_pr_info:!xi(a)};return e?.adapterType===`dbt`&&(c.base={schema_count:n.size,dbt_version:o?.dbt_version||null,timestamp:o?.generated_at||null},c.current={schema_count:r.size,dbt_version:s?.dbt_version||null,timestamp:s?.generated_at||null},c.schemas_match=n.size===r.size&&Array.from(n).every(e=>r.has(e))),e?.adapterType===`sqlmesh`&&(c.base={has_env:!!e.sqlmesh?.base_env},c.current={has_env:!!e.sqlmesh?.current_env}),c}function jc(e){return Object.values(e).every(e=>e===null)?[K(J,{sx:{ml:`10px`},children:`No information`},`no info`)]:Object.entries(e).filter(([e,t])=>e!==`url`&&t!=null).map(([e,t])=>q(`li`,{style:{marginLeft:`10px`},children:[e,`: `,t]},e))}function Mc(){let{envInfo:e,reviewMode:t,lineageGraph:n}=L(),[r,i]=W(!1),a=e?.git,o=e?.pullRequest,s={...a,...o},c=e?.dbt?.base,l=e?.dbt?.current,u=c?.generated_at?an(c.generated_at):``,d=l?.generated_at?an(l.generated_at):``,f=``,p=``;c&&(f=c.generated_at?nn(c.generated_at):``),l&&(p=l.generated_at?nn(l.generated_at):``);let[m,h]=tn(n),g=Xn(!1);H(()=>{!g.current&&e&&(g.current=!0,vn(Ac(e,t,m,h)))},[e,t,m,h]);let _=()=>i(!0),v=()=>i(!1);return q(G,{children:[K($,{title:`Environment Info`,placement:`bottom-end`,children:q(J,{sx:{display:`flex`,alignItems:`center`,cursor:`pointer`,"&:hover":{color:`text.primary`}},onClick:_,children:[q(X,{direction:`column`,sx:{display:{xs:`none`,lg:`flex`},fontSize:`0.875rem`},children:[q(J,{sx:{display:`flex`,alignItems:`baseline`,gap:.5},children:[K(Z,{component:`span`,noWrap:!0,sx:{color:`warning.main`,maxWidth:128},className:`no-track-pii-safe`,children:Array.from(m).join(`, `)}),q(Z,{component:`span`,noWrap:!0,children:[`(`,f,`)`]})]}),q(J,{sx:{display:`flex`,alignItems:`baseline`,gap:.5},children:[K(Z,{component:`span`,noWrap:!0,sx:{color:`primary.main`,maxWidth:128},className:`no-track-pii-safe`,children:Array.from(h).join(`, `)}),q(Z,{component:`span`,noWrap:!0,children:[`(`,p,`)`]})]})]}),K(Q,{size:`small`,"aria-label":`Environment Info`,children:K(J,{component:zr,sx:{fontSize:16,verticalAlign:`middle`}})})]})}),q(Zn,{open:r,onClose:v,maxWidth:`sm`,fullWidth:!0,children:[q(er,{sx:{display:`flex`,alignItems:`center`},children:[`Environment Information`,K(J,{sx:{flexGrow:1}}),K(Q,{size:`small`,onClick:v,children:K(lr,{})})]}),K($n,{children:q(X,{direction:`column`,spacing:1,children:[t?q(X,{direction:`column`,spacing:.5,children:[K(Z,{variant:`h6`,sx:{fontSize:`1rem`},children:`Review Information`}),q(`ul`,{style:{margin:0,paddingLeft:`20px`},children:[s.url&&q(`li`,{style:{marginLeft:`10px`},children:[`url:`,` `,q(tr,{href:s.url,target:`_blank`,sx:{color:`primary.main`},children:[s.url,` `,K(rr,{})]})]}),!xi(s)&&jc(s)]})]}):q(X,{direction:`column`,spacing:.5,children:[K(Z,{variant:`h6`,sx:{fontSize:`1rem`},children:`Dev Information`}),K(`ul`,{style:{margin:0,paddingLeft:`20px`},children:a&&jc(a)})]}),K(fi,{}),e?.adapterType===`dbt`&&q(X,{direction:`column`,spacing:.5,children:[K(Z,{variant:`h6`,sx:{fontSize:`1rem`},children:`DBT`}),K(fa,{sx:{border:1,borderColor:`divider`,maxHeight:`30rem`},children:q(la,{size:`small`,stickyHeader:!0,children:[K(pa,{children:q(ma,{children:[K(da,{}),K(da,{children:`base`}),K(da,{children:`current`})]})}),q(ua,{children:[q(ma,{children:[K(da,{children:`schema`}),K(da,{className:`no-track-pii-safe`,children:Array.from(m).map(e=>K($,{title:e,placement:`bottom`,children:K(`div`,{className:`max-w-72 truncate`,children:e})},e))}),K(da,{className:`no-track-pii-safe`,children:Array.from(h).map(e=>K($,{title:e,placement:`bottom`,children:K(`div`,{className:`max-w-72 truncate`,children:e})},e))})]}),q(ma,{children:[K(da,{children:`version`}),K(da,{children:c?.dbt_version}),K(da,{children:l?.dbt_version})]}),q(ma,{children:[K(da,{children:`timestamp`}),K(da,{children:u}),K(da,{children:d})]})]})]})})]}),e?.adapterType===`sqlmesh`&&q(X,{direction:`column`,spacing:.5,children:[K(Z,{variant:`h6`,sx:{fontSize:`1rem`},children:`SQLMesh`}),K(fa,{sx:{border:1,borderColor:`divider`,maxHeight:`30rem`},children:q(la,{stickyHeader:!0,children:[K(pa,{children:q(ma,{children:[K(da,{}),K(da,{children:`base`}),K(da,{children:`current`})]})}),K(ua,{children:q(ma,{children:[K(da,{children:`Environment`}),K(da,{className:`no-track-pii-safe`,children:e.sqlmesh?.base_env}),K(da,{className:`no-track-pii-safe`,children:e.sqlmesh?.current_env})]})})]})})]})]})}),K(Qn,{children:K(Y,{color:`iochmara`,onClick:v,children:`Close`})})]})]})}const Nc=()=>({toastSuccess:e=>{cn.create({description:e,type:`success`,duration:5e3,closable:!0})},toastError:(e,t)=>{let n=e;t!=null&&(n=ie(t)?`${e}. ${String(t.data?.detail)}`:`${e}. ${t}`),cn.create({description:n,type:`error`,duration:5e3,closable:!0})}}),Pc=e=>{H(()=>{let t=e=>{e.preventDefault()};return e&&window.addEventListener(`beforeunload`,t),()=>{e&&window.removeEventListener(`beforeunload`,t)}},[e])},Fc=()=>{let{featureToggles:e}=ce(),{fileName:t,cloudMode:n,isDemoSite:r,envInfo:i}=L(),{apiClient:a}=Wt(),[s,c]=W(!1),[l,u]=W(!1),d=!t&&!n&&!r,{data:f}=o(d),p=f!=null&&f.filter(e=>!e.is_preset).length>0;Pc(d&&p);let[{newFileName:m,errorMessage:h,modified:_,overwriteWithMethod:v,bypass:b},x]=W({newFileName:t??`recce_state.json`,bypass:!1}),S=Xn(null),{toastSuccess:C,toastError:w}=Nc(),T=Hn(),E=()=>{x({newFileName:t??`recce_state.json`,modified:!t,bypass:!1}),c(!0)},D=()=>c(!1),O=()=>u(!1),k=async(e,t)=>{if(!m)return;let n=localStorage.getItem(g.bypassSaveOverwrite)===`true`;try{e===`save`?await y({filename:m,overwrite:t??n},a):await N({filename:m,overwrite:t??n},a),C(e===`save`?`Save file successfully`:`Rename file successfully`),await T.invalidateQueries({queryKey:F.lineage()}),b&&localStorage.setItem(g.bypassSaveOverwrite,`true`)}catch(t){if(ie(t)&&t.status===409){x(t=>({...t,overwriteWithMethod:e})),u(!0);return}w(e===`save`?`Save file failed`:`Rename file failed`,t)}finally{D()}},A=()=>{O(),c(!0),x(e=>({...e,overwriteWithMethod:void 0}))};if(n||r)return K(G,{});let j=`New Instance`+(p?` (unsaved)`:``),ee;if(e.disableSaveToFile&&t){let e=i?.stateMetadata?.generated_at,n=e?Xe(new Date(e)):null;ee=n?`${t} (${n})`:null}return q(G,{children:[q(X,{direction:`row`,sx:{alignItems:`center`,justifyContent:`center`},children:[K(J,{sx:{fontWeight:600},children:ee??t??j}),!e.disableSaveToFile&&K($,{title:t?`Change Filename`:`Save`,enterDelay:1e3,children:K(Q,{onClick:E,"aria-label":t?`Change Filename`:`Save`,size:`small`,children:K(J,{component:t?Ur:ir,sx:{fontSize:16,verticalAlign:`middle`}})})})]}),q(Zn,{open:s,onClose:D,children:[q(er,{sx:{display:`flex`,alignItems:`center`},children:[t?`Change Filename`:`Save File`,K(J,{sx:{flexGrow:1}}),K(Q,{size:`small`,onClick:D,children:K(lr,{})})]}),K($n,{onKeyDown:e=>{e.stopPropagation()},children:K(li,{inputRef:S,value:m,label:`File name`,placeholder:`Enter filename`,error:!!h,helperText:h,fullWidth:!0,size:`small`,sx:{mt:1},onChange:e=>{let n=e.target.value,r;n?n.endsWith(`.json`)?/^[a-zA-Z0-9 _-]+\.json$/.test(n)?t&&n===t&&(r=`Filename is the same as the current one.`):r=`Invalid filename. Only alphanumeric, space, _ and - are allowed.`:r=`Filename must end with .json.`:r=`Filename cannot be empty.`,x(e=>({...e,modified:!0,newFileName:n,errorMessage:r}))},onKeyDown:e=>{if(e.key===`Enter`){if(h)return;k(t?`rename`:`save`)}else e.key===`Escape`&&D()}})}),q(Qn,{sx:{gap:`5px`},children:[K(Y,{size:`small`,color:t?`inherit`:`iochmara`,variant:`contained`,onClick:async()=>{await k(`save`)},disabled:!m||!!h||!_,children:t?`Save as New File`:`Confirm`}),t&&K(Y,{size:`small`,color:`iochmara`,variant:`contained`,onClick:async()=>{await k(`rename`)},disabled:!m||!!h||!_,children:`Rename`})]})]}),q(Zn,{open:l,onClose:O,children:[q(er,{sx:{display:`flex`,alignItems:`center`},children:[`Overwrite File?`,K(J,{sx:{flexGrow:1}}),K(Q,{size:`small`,onClick:O,children:K(lr,{})})]}),q($n,{sx:{borderTop:`solid 1px`,borderBottom:`solid 1px`,borderColor:`divider`},onKeyDown:e=>{e.stopPropagation()},children:[K(Z,{sx:{fontSize:`12pt`},children:v===`save`?`Saving a file with this name will overwrite the existing file. Are you sure you wish to continue?`:`Renaming the file with this name will overwrite the existing file. Are you sure you wish to continue?`}),K(jr,{control:K(Ar,{size:`small`,checked:b,onChange:e=>{x(t=>({...t,bypass:e.target.checked}))}}),label:K(Z,{sx:{fontWeight:`bold`,pt:`8px`},children:`Don't show this again`})})]}),q(Qn,{sx:{gap:`5px`},children:[K(Y,{variant:`outlined`,onClick:A,size:`small`,children:`Back`}),K(Y,{size:`small`,color:`iochmara`,variant:`contained`,onClick:()=>{v&&(k(v,!0),O())},children:`Overwrite`})]})]})]})};async function Ic(e){return(await e.get(`/api/cloud/organizations`)).data.organizations}async function Lc(e,t){return(await e.get(`/api/cloud/organizations/${t}/projects`)).data.projects}async function Rc(e,t,n){return(await e.get(`/api/cloud/organizations/${t}/projects/${n}/base-status`)).data}async function zc(e,t){return(await e.post(`/api/cloud/upload`,t)).data}async function Bc(e){return(await e.get(`/api/connection-info`)).data.connection_info}async function Vc(e,t){return(await e.post(`/api/cloud/warehouse-setup`,t)).data}const Hc={snowflake:{type:`snowflake`,label:`Snowflake`,commonFields:[{name:`account`,label:`Account`,type:`text`,isCredential:!1,required:!0},{name:`user`,label:`User`,type:`text`,isCredential:!1,required:!0},{name:`warehouse`,label:`Warehouse`,type:`text`,isCredential:!1,required:!0},{name:`database`,label:`Database`,type:`text`,isCredential:!1,required:!0},{name:`schema`,label:`Schema`,type:`text`,isCredential:!1,required:!0}],authMethods:[{value:`user-password`,label:`User & Password`,fields:[{name:`password`,label:`Password`,type:`password`,isCredential:!0,required:!0}]},{value:`key-pair`,label:`Key Pair`,fields:[{name:`private_key`,label:`Private Key`,type:`textarea`,isCredential:!0,required:!0,placeholder:`Paste PEM-encoded private key`},{name:`private_key_passphrase`,label:`Private Key Passphrase`,type:`password`,isCredential:!0,required:!1}]}]},databricks:{type:`databricks`,label:`Databricks`,commonFields:[{name:`host`,label:`Host`,type:`text`,isCredential:!1,required:!0},{name:`http_path`,label:`HTTP Path`,type:`text`,isCredential:!1,required:!0},{name:`catalog`,label:`Catalog`,type:`text`,isCredential:!1,required:!1,prefillFrom:`database`},{name:`schema`,label:`Schema`,type:`text`,isCredential:!1,required:!0}],authMethods:[{value:`token`,label:`Token`,fields:[{name:`token`,label:`Access Token`,type:`password`,isCredential:!0,required:!0}]},{value:`oauth`,label:`OAuth (M2M)`,fields:[{name:`client_id`,label:`Client ID`,type:`text`,isCredential:!0,required:!0},{name:`client_secret`,label:`Client Secret`,type:`password`,isCredential:!0,required:!0}]}]},bigquery:{type:`bigquery`,label:`BigQuery`,commonFields:[{name:`project`,label:`Project`,type:`text`,isCredential:!1,required:!0,prefillFrom:`database`},{name:`dataset`,label:`Dataset`,type:`text`,isCredential:!1,required:!0,prefillFrom:`schema`}],authMethods:[{value:`service-account-json`,label:`Service Account JSON`,fields:[{name:`keyfile_json`,label:`Service Account Key (JSON)`,type:`textarea`,isCredential:!0,required:!0,placeholder:`Paste service account JSON`}]}]},redshift:{type:`redshift`,label:`Redshift`,commonFields:[{name:`host`,label:`Host`,type:`text`,isCredential:!1,required:!0},{name:`user`,label:`User`,type:`text`,isCredential:!1,required:!0},{name:`port`,label:`Port`,type:`number`,isCredential:!1,required:!0},{name:`dbname`,label:`Database`,type:`text`,isCredential:!1,required:!0,prefillFrom:`database`},{name:`schema`,label:`Schema`,type:`text`,isCredential:!1,required:!0}],authMethods:[{value:`password`,label:`Password`,fields:[{name:`password`,label:`Password`,type:`password`,isCredential:!0,required:!0}]}]}};function Uc(e){return e in Hc}function Wc(e){return Hc[e]?.authMethods[0]?.value??``}function Gc(e,t){let n=Hc[e];if(!n)return[];let r=n.authMethods.find(e=>e.value===t);return[...n.commonFields,...r?.fields??[]]}function Kc(e,t){let n=Hc[e];if(!n)return{};let r={};for(let e of n.commonFields){if(e.isCredential)continue;let n=t[e.prefillFrom??e.name];n!=null&&(r[e.name]=String(n))}return r}function qc({open:e,onClose:t}){let{apiClient:n}=Wt(),[r,i]=W(`select`),[a,o]=W([]),[s,c]=W([]),[l,u]=W(``),[d,f]=W(``),[p,m]=W(``),[h,g]=W(!1),[_,v]=W(!1),[y,b]=W(``),[x,S]=W(!1),[C,w]=W(``),[T,E]=W(null),[D,O]=W({}),[k,A]=W(``),[j,ee]=W(null);H(()=>{e&&(i(`select`),m(`dev-${new Date().toISOString().slice(0,16).replace(`T`,`-`).replace(`:`,``)}`),g(!0),Ic(n).then(e=>{o(e),e.length===1&&u(String(e[0].id))}).catch(()=>o([])).finally(()=>g(!1)))},[e,n]),H(()=>{if(!l){c([]),f(``);return}v(!0),f(``),Lc(n,l).then(e=>{c(e),e.length===1&&f(String(e[0].id))}).catch(()=>c([])).finally(()=>v(!1))},[l,n]),H(()=>{if(!l||!d){S(!1);return}Rc(n,l,d).then(e=>S(e.base_needs_upload)).catch(()=>S(!1))},[l,d,n]);let M=async()=>{if(!(!l||!d||!p.trim())){fn(),i(`uploading`);try{let e=await zc(n,{org_id:l,project_id:d,session_name:p.trim()});if(e.status===`success`&&e.session_url){ee({sessionUrl:e.session_url,baseUploaded:x});let t=ne?.warehouse_connection?null:await Bc(n);t&&Uc(t.type)?(E(t),O(Kc(t.type,t)),A(Wc(t.type)),gn(),i(`dw_setup`)):(b(e.session_url),i(`success`),On(),window.open(e.session_url,`_blank`))}else w(e.message||`Upload failed`),i(`error`)}catch(e){w(e instanceof Error?e.message:`An error occurred during upload`),i(`error`)}}},N=async()=>{if(!T||!j)return;let e=Gc(T.type,k),t=[];for(let n of e){let e=D[n.name]?.trim();if(n.required&&!e)t.push(`${n.label} is required`);else if(n.type===`number`&&e){let r=Number(e);Number.isFinite(r)||t.push(`${n.label} must be a valid number`)}}if(t.length>0){w(t.join(`. `)),i(`dw_error`);return}i(`dw_saving`);try{let t={type:T.type};T.type===`databricks`&&k===`oauth`&&(t.auth_type=`oauth`),T.type===`bigquery`&&(t.method=`service-account-json`);for(let n of e){let e=D[n.name];e&&(t[n.name]=n.type===`number`?Number(e):e)}await Vc(n,{org_id:l,project_id:d,connection_name:`${ne?.display_name||ne?.name||`Project`} DW`,config:t}),hn(),b(j.sessionUrl),i(`success`),On(),window.open(j.sessionUrl,`_blank`)}catch(e){w(e instanceof Error?e.message:`Failed to set up warehouse connection`),i(`dw_error`)}},P=()=>{j&&(_n(),b(j.sessionUrl),i(`success`),On(),window.open(j.sessionUrl,`_blank`))},te=a.find(e=>String(e.id)===l),ne=s.find(e=>String(e.id)===d),F=te&&ne?`${Nn}/${te.name}/${ne.name}`:void 0,re=l&&d&&p.trim()&&!h;return q(Zn,{open:e,onClose:r===`uploading`||r===`dw_saving`?void 0:t,maxWidth:`sm`,fullWidth:!0,slotProps:{paper:{sx:{borderRadius:`1rem`}}},children:[r===`select`&&q(G,{children:[K(er,{sx:{textAlign:`center`,fontSize:`1.25rem`,pb:.5},children:`Upload to Recce Cloud`}),K($n,{children:q(X,{spacing:2,sx:{pt:.5},children:[K(Z,{variant:`body2`,sx:{color:`text.secondary`},children:`Upload your local artifacts to Recce Cloud so your team can review and query the data.`}),q(oi,{fullWidth:!0,size:`small`,children:[K(ha,{children:`Organization`}),K(ga,{value:l,label:`Organization`,onChange:e=>u(e.target.value),disabled:h,children:a.map(e=>K($r,{value:String(e.id),children:e.display_name||e.name},e.id))})]}),q(oi,{fullWidth:!0,size:`small`,children:[K(ha,{children:`Project`}),K(ga,{value:d,label:`Project`,onChange:e=>f(e.target.value),disabled:!l||_,children:s.map(e=>K($r,{value:String(e.id),children:e.display_name||e.name},e.id))})]}),K(li,{fullWidth:!0,size:`small`,label:`Session Name`,value:p,onChange:e=>m(e.target.value),placeholder:`e.g., my-feature-review`}),x&&K(Z,{variant:`body2`,sx:{color:`text.secondary`},children:`Base artifacts will also be uploaded to set up the project's base environment for diffing.`})]})}),K(Qn,{sx:{px:3,pb:3},children:K(Y,{fullWidth:!0,variant:`contained`,color:`primary`,onClick:M,disabled:!re,sx:{borderRadius:2,fontWeight:500},children:`Upload`})})]}),r===`uploading`&&K($n,{children:q(X,{spacing:1.5,sx:{alignItems:`center`,py:3},children:[K(ii,{size:36}),K(Z,{sx:{fontWeight:500,fontSize:`1rem`},children:`Uploading artifacts...`}),K(Z,{variant:`body2`,sx:{color:`text.secondary`,textAlign:`center`},children:x?`Uploading base and current artifacts. This may take a moment.`:`This may take a moment.`})]})}),r===`dw_setup`&&T&&(()=>{let e=Hc[T.type];if(!e)return null;let t=e.authMethods.length>1,n=e.authMethods.find(e=>e.value===k);return q(G,{children:[K(er,{sx:{textAlign:`center`,fontSize:`1.25rem`,pb:.5},children:`Set Up Data Warehouse`}),K($n,{children:q(X,{spacing:2,sx:{pt:.5},children:[q(Z,{variant:`body2`,sx:{color:`text.secondary`},children:[`Connect your `,e.label,` warehouse so Recce Cloud can query your data. You can skip this and set it up later.`]}),e.commonFields.map(e=>K(li,{fullWidth:!0,size:`small`,label:e.label,type:e.type===`textarea`?`text`:e.type,multiline:e.type===`textarea`,minRows:e.type===`textarea`?3:void 0,required:e.required,placeholder:e.placeholder,value:D[e.name]??``,onChange:t=>O(n=>({...n,[e.name]:t.target.value}))},e.name)),t&&q(oi,{fullWidth:!0,size:`small`,children:[K(ha,{children:`Authentication`}),K(ga,{value:k,label:`Authentication`,onChange:t=>{A(t.target.value),O(t=>{let n={...t};for(let t of e.authMethods)for(let e of t.fields)delete n[e.name];return n})},children:e.authMethods.map(e=>K($r,{value:e.value,children:e.label},e.value))})]}),n?.fields.map(e=>K(li,{fullWidth:!0,size:`small`,label:e.label,type:e.type===`textarea`?`text`:e.type,multiline:e.type===`textarea`,minRows:e.type===`textarea`?3:void 0,required:e.required,placeholder:e.placeholder,value:D[e.name]??``,onChange:t=>O(n=>({...n,[e.name]:t.target.value}))},e.name))]})}),q(Qn,{sx:{px:3,pb:3,gap:1},children:[K(Y,{fullWidth:!0,variant:`outlined`,color:`neutral`,onClick:P,sx:{borderRadius:2,fontWeight:500},children:`Skip`}),K(Y,{fullWidth:!0,variant:`contained`,color:`primary`,onClick:N,sx:{borderRadius:2,fontWeight:500},children:`Setup & Continue`})]})]})})(),r===`dw_saving`&&K($n,{children:q(X,{spacing:1.5,sx:{alignItems:`center`,py:3},children:[K(ii,{size:36}),K(Z,{sx:{fontWeight:500,fontSize:`1rem`},children:`Setting up warehouse connection...`})]})}),r===`success`&&q($n,{sx:{position:`relative`},children:[K(Q,{size:`small`,onClick:t,sx:{position:`absolute`,top:8,right:8},"aria-label":`Close`,children:K(Zr,{})}),q(X,{spacing:1.5,sx:{alignItems:`center`,pt:2,pb:1},children:[K(J,{component:Fr,sx:{fontSize:36,color:`success.main`}}),K(Z,{sx:{fontWeight:600,fontSize:`1rem`},children:`Upload Complete`}),K(Z,{variant:`body2`,sx:{color:`text.secondary`,textAlign:`center`},children:`Your artifacts have been uploaded to Recce Cloud.`}),K(Y,{variant:`contained`,color:`primary`,href:y,target:`_blank`,component:`a`,sx:{borderRadius:2,textTransform:`none`,fontWeight:600,mt:1},children:`Open in Recce Cloud`}),F&&q(tr,{href:F,target:`_blank`,sx:{display:`flex`,alignItems:`center`,gap:.5,fontSize:`0.8125rem`,mt:1},children:[`Go to project page `,K(rr,{size:12})]})]})]}),r===`dw_error`&&q(G,{children:[K($n,{children:q(X,{spacing:1.5,sx:{alignItems:`center`,py:2},children:[K(Z,{sx:{fontWeight:500,fontSize:`1rem`},children:`Warehouse Setup Failed`}),K(Z,{variant:`body2`,sx:{color:`text.secondary`,textAlign:`center`},children:C})]})}),q(Qn,{sx:{px:3,pb:2,gap:1},children:[K(Y,{fullWidth:!0,variant:`outlined`,color:`neutral`,onClick:P,sx:{borderRadius:2,fontWeight:500},children:`Skip`}),K(Y,{fullWidth:!0,variant:`contained`,color:`primary`,onClick:()=>i(`dw_setup`),sx:{borderRadius:2,fontWeight:500},children:`Retry Setup`})]})]}),r===`error`&&q(G,{children:[K($n,{children:q(X,{spacing:1.5,sx:{alignItems:`center`,py:2},children:[K(Z,{sx:{fontWeight:500,fontSize:`1rem`},children:`Upload Failed`}),K(Z,{variant:`body2`,sx:{color:`text.secondary`,textAlign:`center`},children:C})]})}),K(Qn,{sx:{px:3,pb:2},children:K(Y,{fullWidth:!0,variant:`outlined`,color:`neutral`,onClick:()=>i(`select`),sx:{borderRadius:2,fontWeight:500},children:`Try Again`})})]})]})}function Jc(){let{authed:e}=ce(),{apiClient:t}=Wt(),[n,r]=W(null),[i,a]=W(`signup`),[o,s]=W(!1),c=Xn(!1),l=V(async()=>{if(c.current)try{await Ln(t),c.current=!1,kn(),a(`reload`)}catch{}},[t]);if(H(()=>{let e=()=>{document.visibilityState===`visible`&&l()};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[l]),e)return q(G,{children:[K(Y,{variant:`contained`,color:`primary`,size:`small`,startIcon:K(Xr,{}),onClick:()=>{En({authed:!0}),s(!0)},sx:{borderRadius:`100px`,textTransform:`none`,fontWeight:600,px:2,py:.5,mr:1,whiteSpace:`nowrap`},children:`Share`}),K(qc,{open:o,onClose:()=>s(!1)})]});let u=e=>{En({authed:!1}),a(`signup`),c.current=!1,r(e.currentTarget)},d=()=>{r(null),c.current=!1},f=async()=>{An();let e=window.open(``,`_blank`);try{let{connection_url:n}=await Ec(t);e&&!e.closed?e.location.href=n:window.open(n,`_blank`),c.current=!0,a(`waiting`)}catch{e?.close(),a(`error`)}};return q(G,{children:[K(Y,{variant:`contained`,color:`primary`,size:`small`,startIcon:K(Xr,{}),onClick:u,sx:{borderRadius:`100px`,textTransform:`none`,fontWeight:600,px:2,py:.5,mr:1,whiteSpace:`nowrap`},children:`Share`}),K(vi,{open:!!n,anchorEl:n,onClose:d,anchorOrigin:{vertical:`bottom`,horizontal:`right`},transformOrigin:{vertical:`top`,horizontal:`right`},slotProps:{paper:{sx:{borderRadius:`12px`,p:3,maxWidth:360,mt:1}}},children:q(J,{sx:{position:`relative`},children:[K(Q,{size:`small`,onClick:d,sx:{position:`absolute`,top:-12,right:-12},"aria-label":`Close`,children:K(Zr,{})}),i===`signup`&&q(G,{children:[K(Z,{sx:{mb:3,pr:2},children:`Sign up to Recce Cloud so your team members can see and query your instance directly`}),K(Y,{variant:`contained`,color:`primary`,onClick:f,sx:{borderRadius:`8px`,textTransform:`none`,fontWeight:600,px:4,py:1},children:`Sign up`})]}),i===`waiting`&&q(X,{spacing:2,sx:{alignItems:`center`,py:1},children:[K(ii,{size:40}),K(Z,{sx:{fontWeight:500,fontSize:`1.1rem`},children:`Waiting for signup...`}),K(Z,{sx:{color:`text.secondary`,textAlign:`center`},children:`Complete signup in the browser tab.`}),K(Y,{fullWidth:!0,variant:`text`,color:`primary`,size:`small`,onClick:f,sx:{textTransform:`none`},children:`Retry`})]}),i===`reload`&&q(X,{spacing:2,sx:{alignItems:`center`,py:1},children:[K(J,{component:`img`,sx:{height:`5rem`,objectFit:`contain`},src:`/imgs/reload-image.svg`,alt:`Reload`}),K(Z,{sx:{fontWeight:500,fontSize:`1.1rem`},children:`Reload to Finish`}),K(Z,{sx:{color:`text.secondary`,textAlign:`center`},children:`Signup complete! Reload to connect to Recce Cloud.`}),K(Y,{fullWidth:!0,variant:`contained`,color:`primary`,onClick:()=>window.location.reload(),sx:{borderRadius:`8px`,textTransform:`none`,fontWeight:600},children:`Reload`})]}),i===`error`&&q(X,{spacing:2,sx:{alignItems:`center`,py:1},children:[K(Z,{sx:{fontWeight:500,fontSize:`1.1rem`},children:`Connection Failed`}),K(Z,{sx:{color:`text.secondary`,textAlign:`center`},children:`Could not connect to Recce Cloud. Please try again.`}),K(Y,{fullWidth:!0,variant:`contained`,color:`primary`,onClick:f,sx:{borderRadius:`8px`,textTransform:`none`,fontWeight:600},children:`Retry`})]})]})})]})}function Yc(){let{featureToggles:e}=ce(),{apiClient:t}=Wt(),n=async()=>{try{let e=await ee(t),n=JSON.stringify(e,null,2);kr(new Blob([n],{type:`application/json`}),`recce-state-${ui(new Date,`yyyy-MM-dd-HH-mm-ss`)}.json`)}catch(e){console.error(`Export failed`,e),cn.create({title:`Export failed`,description:String(e),type:`error`,duration:5e3,closable:!0})}};return K($,{title:`Export`,children:K(Q,{size:`small`,"aria-label":`Export state`,onClick:async()=>{await n(),jn({name:`export`})},disabled:e.disableExportStateFile,children:K(J,{component:Rr,sx:{verticalAlign:`middle`,width:`16px`,height:`16px`}})})})}function Xc(e){return/^\/checks\/([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/.test(e)}function Zc(){return K($,{title:`Syncing`,children:K(J,{sx:{mx:`10px`},children:K(ii,{size:20})})})}function Qc(){let[e,t]=W(!1),n=Hn(),{apiClient:r}=Wt(),i=Ci(),a=Si(),{basePath:o}=I(),[s,c]=W(!1),[l,u]=W(``),{data:d}=se(),f=()=>c(!1),p=V(async e=>{if(c(!1),t(!0),(await k(e,r)).status===`conflict`){c(!0),t(!1);return}for(;await w(r);)await new Promise(e=>setTimeout(e,1e3));cn.create({description:`Sync Completed`,type:`success`,duration:5e3,closable:!0}),t(!1),u(``),await n.invalidateQueries({queryKey:F.lineage()}),await n.invalidateQueries({queryKey:F.checks()}),await n.invalidateQueries({queryKey:F.runs()}),Xc(a)&&i.push(`${o}/checks`)},[n,a,r,i.push,o]);return e?K(Zc,{}):q(G,{children:[K($,{title:`Sync with Cloud`,children:K(Q,{size:`small`,"aria-label":`Sync state`,onClick:()=>p(d?.session_id?{method:`merge`}:{}),children:K(J,{component:ur,sx:{fontSize:16,verticalAlign:`middle`}})})}),q(Zn,{open:s,onClose:f,children:[q(er,{sx:{display:`flex`,alignItems:`center`,fontWeight:`bold`},children:[`Sync with Cloud`,K(J,{sx:{flexGrow:1}}),K(Q,{size:`small`,onClick:f,children:K(lr,{})})]}),q($n,{children:[K(Z,{children:`New changes have been detected in the cloud. Please choose a method to sync your state`}),K(J,{sx:{mt:`5px`},children:K(oa,{value:l,onChange:e=>{u(e.target.value)},children:q(X,{direction:`column`,children:[K(jr,{value:`merge`,control:K(aa,{}),label:q(X,{direction:`row`,sx:{alignItems:`center`},children:[`Merge`,K($,{title:`This will merge the local and remote states.`,children:K(J,{component:zr,sx:{ml:2,cursor:`pointer`}})})]})}),K(jr,{value:`overwrite`,control:K(aa,{}),label:q(X,{direction:`row`,sx:{alignItems:`center`},children:[`Overwrite`,K($,{title:`This will overwrite the remote state file with the local state.`,children:K(J,{component:zr,sx:{ml:2,cursor:`pointer`}})})]})}),K(jr,{value:`revert`,control:K(aa,{}),label:q(X,{direction:`row`,sx:{alignItems:`center`},children:[`Revert`,K($,{title:`This will discard local changes and revert to the cloud state.`,children:K(J,{component:zr,sx:{ml:2,cursor:`pointer`}})})]})})]})})})]}),q(Qn,{children:[K(Y,{onClick:f,sx:{mr:1},children:`Cancel`}),K(Y,{color:`iochmara`,variant:`contained`,onClick:()=>p({method:l||void 0}),disabled:!l,children:`Sync`})]})]})]})}const $c=[{path:`/lineage`,name:`Lineage`},{path:`/query`,name:`Query`},{path:`/checks`,name:`Checklist`}];function el({queryKey:e,fetchCallback:t,selectCallback:n}){let{data:r,isLoading:i,error:a}=Vn({queryKey:e,queryFn:t,select:n});return i||a||r===0?K(G,{}):K(J,{sx:{bgcolor:`brand.main`,display:`flex`,justifyContent:`center`,alignItems:`center`,p:1,borderRadius:`100%`,color:`white`,fontWeight:700,fontSize:`0.75rem`},children:K(`span`,{children:r})})}function tl(){let{apiClient:e}=Wt();return K(el,{queryKey:F.checks(),fetchCallback:()=>c(e),selectCallback:e=>e.filter(e=>!e.is_checked).length})}const nl=()=>{let e=Si(),{isDemoSite:t,isLoading:n,cloudMode:r}=L(),{featureToggles:i}=ce(),{data:a,isLoading:o}=ge(),s=Xn(null);return H(()=>{s.current&&s.current!==e&&Tn({from:s.current,to:e}),s.current=e},[e]),K(J,{sx:{borderBottom:`1px solid lightgray`,px:`12px`},children:q(J,{sx:{display:`grid`,gridTemplateColumns:`1fr auto 1fr`,width:`100%`,alignItems:`center`},children:[K(mi,{value:U(()=>e.startsWith(`/checks`)?`/checks`:e.startsWith(`/query`)?`/query`:e.startsWith(`/runs`)?`/runs`:`/lineage`,[e]),sx:{borderBottom:`none`,minHeight:`auto`},children:$c.map(({path:e,name:t})=>t===`Query`&&a?.single_env_onboarding?null:t===`Checklist`&&tl?K(pi,{value:e,disabled:n||o,sx:{p:0},label:K(J,{sx:{display:`flex`,alignItems:`center`,gap:`4px`},children:q(sr,{href:e,style:{textDecoration:`none`,color:`inherit`,padding:`0.875rem 1.1875rem`,display:`flex`,gap:3,alignItems:`center`},children:[t,` `,K(tl,{})]})})},e):K(pi,{value:e,disabled:n||o,sx:{p:0},label:K(J,{sx:{display:`flex`,alignItems:`center`,gap:`4px`},children:K(sr,{href:e,style:{textDecoration:`none`,color:`inherit`,padding:`0.875rem 1.1875rem`},children:t})})},e))}),K(J,{sx:{display:`flex`,alignItems:`center`,gap:`12px`,justifyContent:`center`},children:!n&&!t&&K(Fc,{})}),!n&&q(J,{sx:{display:`flex`,justifyContent:`right`,alignItems:`center`,mr:`8px`},children:[!t&&!a?.single_env_onboarding&&!i.disableShare&&K(Jc,{}),K(Mc,{}),r&&K(Qc,{}),K(Yc,{})]})]})})};function rl(){let{remainingSeconds:e,isEnabled:t}=le();return!t||e===null||e>60?null:q(_a,{color:`warning`,variant:`standard`,sx:{display:`flex`,alignItems:`center`,gap:1,fontSize:`0.75rem`,mr:2},children:[K(J,{component:dr,sx:{display:`inline-flex`}}),`Idle timeout: `,rn(e,`compact`)]})}const il=()=>{let{version:e,latestVersion:t}=E(),n=U(()=>RegExp(`^\\d+\\.\\d+\\.\\d+$`),[]);return H(()=>{if(n.test(e)&&e!==t){let e=`recce-update-toast-shown`;if(sessionStorage.getItem(e))return;setTimeout(()=>{cn.create({id:`recce-update-available`,title:`Update available`,description:q(`span`,{children:[`A new version of Recce (v`,t,`) is available.`,K(`br`,{}),`Please run`,` `,K(J,{component:`code`,sx:{bgcolor:`grey.200`,px:.5,py:.25,borderRadius:.5,fontFamily:`monospace`,fontSize:`0.875em`},children:`pip install --upgrade recce`}),` `,`to update Recce.`,K(`br`,{}),K(tr,{sx:{color:`primary.main`,fontWeight:`bold`,"&:hover":{textDecoration:`underline`}},href:`https://github.com/DataRecce/recce/releases/tag/v${t}`,target:`_blank`,children:`Click here to view the detail of latest release`})]}),duration:60*1e3,closable:!0}),sessionStorage.setItem(e,`true`)},0)}},[e,t,n]),n.test(e)?K(tr,{href:`https://github.com/DataRecce/recce/releases/tag/v${e}`,sx:{"&:hover":{textDecoration:`none`},fontSize:`sm`,color:`rgba(255,255,255,0.8)`,textTransform:`uppercase`,borderWidth:1,px:1,borderRadius:.75},target:`_blank`,children:e}):K(Z,{component:`span`,sx:{fontSize:`sm`,color:`rgba(255,255,255,0.8)`,textTransform:`uppercase`,borderWidth:1,px:1,borderRadius:.75},children:e})};function al({icon:e,href:t,sx:n,...r}){let i=ar();return K(tr,{sx:{height:`20px`,color:`common.white`,...n},href:t,target:`_blank`,...r,children:K(e,{style:{color:i.palette.common.white,width:20,height:20}})})}const ol=()=>{let{reviewMode:e,isDemoSite:t,envInfo:n,cloudMode:r}=L(),{featureToggles:i,authed:a}=ce(),{url:o,id:s}=n?.pullRequest??{},c=o?o.split(`/`).pop():null,l=r||a?Nn:`https://reccehq.com/`,[u,d]=W(!1);return q(J,{sx:{display:`flex`,gap:`10px`,minHeight:`40px`,alignItems:`center`,bgcolor:ke.brand[400]},children:[K(tr,{href:l,target:`_blank`,sx:{"&:hover":{textDecoration:`none`}},children:q(J,{sx:{display:`flex`,gap:`10px`,alignItems:`center`},children:[K(J,{component:`img`,sx:{width:20,height:20,ml:`18px`},src:`/logo/recce-logo-white.png`,alt:`recce-logo-white`}),K(Z,{variant:`h4`,sx:{fontFamily:`"Montserrat", sans-serif`,color:`common.white`,fontSize:`1.25rem`},children:`RECCE`})]})}),K(kc,{}),K(il,{}),(i.mode??e)&&K(_a,{sx:{fontSize:`0.875rem`,color:`rgba(255,255,255,0.8)`,textTransform:`uppercase`,borderWidth:1,px:1,borderRadius:.75,borderColor:`rgba(255,255,255,0.8)`},children:i.mode??`review mode`}),r&&s&&K(_a,{sx:{fontSize:`0.875rem`,color:`rgba(255,255,255,0.8)`,textTransform:`uppercase`,borderWidth:1,px:1,borderRadius:.75,borderColor:`rgba(255,255,255,0.8)`},children:q(X,{direction:`row`,spacing:1,sx:{alignItems:`center`},children:[K(J,{children:`cloud mode`}),K(J,{sx:{borderLeft:`1px solid rgba(255,255,255,0.8)`,pl:`8px`},children:q(tr,{href:o,sx:{"&:hover":{textDecoration:`none`}},target:`_blank`,children:[K(ti,{style:{color:`rgba(255,255,255,0.8)`,width:12,height:12,marginRight:2,display:`inline`,verticalAlign:`middle`}}),K(Z,{component:`span`,sx:{color:`rgba(255,255,255,0.8)`,display:`inline`},children:`#${String(s)}`})]})})]})}),t&&o&&c&&K(_a,{sx:{fontSize:`0.875rem`,color:`rgba(255,255,255,0.8)`,textTransform:`uppercase`,borderWidth:1,px:1,borderRadius:.75,borderColor:`rgba(255,255,255,0.8)`},children:q(X,{direction:`row`,spacing:1,sx:{alignItems:`center`},children:[K(J,{children:`demo mode`}),K(J,{sx:{borderLeft:`1px solid rgba(255,255,255,0.8)`,pl:`8px`},children:q(tr,{href:o,sx:{"&:hover":{textDecoration:`none`}},target:`_blank`,children:[K(ti,{style:{color:`rgba(255,255,255,0.8)`,width:12,height:12,marginRight:2,display:`inline`,verticalAlign:`middle`}}),K(Z,{component:`span`,sx:{color:`rgba(255,255,255,0.8)`,display:`inline`},children:`#${c}`})]})})]})}),K(J,{sx:{flex:1}}),(t||i.mode===`read only`)&&q(G,{children:[K(al,{icon:Di,href:`https://github.com/DataRecce/recce`}),K(al,{icon:Ai,href:`https://getdbt.slack.com/archives/C05C28V7CPP`}),K(al,{sx:{mr:2},icon:Oi,href:`https://docs.reccehq.com`})]}),!t&&i.mode!==`read only`&&q(G,{children:[K(rl,{}),a||r?K(J,{sx:{mr:2},children:K(Oc,{})}):q(G,{children:[K(J,{component:`button`,sx:{color:`common.white`,fontSize:`0.875rem`,fontWeight:600,bgcolor:`brand.700`,borderRadius:1,px:3,py:1,mr:2,cursor:`pointer`,border:`none`},onClick:()=>{d(!0)},children:`Connect to Cloud`}),u&&K(Dc,{parentOpen:u,handleParentClose:d,ignoreCookie:!0,variant:`user-profile`})]})]})]})};function sl(){return K(J,{sx:{display:`flex`,height:`100%`,alignItems:`center`,justifyContent:`center`,contain:`size`},children:K(J,{sx:{display:`flex`,alignItems:`center`,justifyContent:`center`,height:`100%`},children:K(ii,{size:48})})})}function cl({children:e,lineage:t}){let n=Si(),{isDemoSite:r,isLoading:i,isCodespace:a}=L(),{featureToggles:o}=ce(),s=n.replace(/\/$/,``)||`/`,c=s===`/lineage`||s===`/`;return H(()=>{xn()},[]),q(J,{sx:{display:`flex`,flexDirection:`column`,height:`100vh`,overflow:`hidden`},children:[K(xc,{}),K(ol,{}),K(nl,{}),K(ll,{isLineageRoute:c,lineage:t,children:e}),!i&&!r&&!a&&o.mode===null&&K(Dc,{})]})}function ll({children:e,lineage:t,isLineageRoute:n,disableInternalHistory:r=!1}){let{isRunResultOpen:i,isHistoryOpen:a,closeRunResult:o}=ye(),{basePath:s}=I(),{data:c}=ge(),l=Si(),u=en(),d=i&&!l.startsWith(`${s}/checks`),f=r?!1:a&&!l.startsWith(`${s}/checks`);return q(kt,{sizes:f?[20,80]:[0,100],minSize:0,gutterSize:5,className:f?void 0:`split-gutter-hidden`,style:{height:`100%`},children:[K(J,{style:{contain:`size`},suppressHydrationWarning:!0,children:f&&K(We,{})}),q(Vt,{sizes:d?[50,50]:[100,0],minSize:0,gutterSize:5,className:d?void 0:`split-gutter-hidden`,style:{flex:`1`,contain:`size`},children:[K(Un,{fallback:K(sl,{}),children:q(J,{sx:{p:0,contain:`content`,height:`100%`,position:`relative`},suppressHydrationWarning:!0,children:[K(J,{sx:{display:n?`block`:`none`,height:`100%`,position:n?`relative`:`absolute`,inset:0},children:t}),!n&&e]})}),K(J,{sx:{height:`100%`,bgcolor:u?`grey.900`:`grey.50`},suppressHydrationWarning:!0,children:d?K(wt,{onClose:o,isSingleEnvironment:!!c?.single_env_onboarding}):null})]})]})}function ul({children:e,display:t}){let[n,r]=W(!1),i=Xn(null),a=Xn(null),o=V(()=>{i.current&&=(clearTimeout(i.current),null),r(!0)},[]),s=V(()=>{i.current=setTimeout(()=>{r(!1)},100)},[]);return t?q(G,{children:[K(J,{ref:a,onMouseEnter:o,onMouseLeave:s,sx:{display:`contents`},children:e}),q(vi,{open:n,anchorEl:a.current,onClose:()=>r(!1),anchorOrigin:{vertical:`bottom`,horizontal:`left`},transformOrigin:{vertical:`top`,horizontal:`left`},disableAutoFocus:!0,disableEnforceFocus:!0,sx:{pointerEvents:`none`},slotProps:{paper:{onMouseEnter:o,onMouseLeave:s,sx:{bgcolor:`grey.600`,color:`white`,p:1.5,pointerEvents:`auto`}}},children:[`Connect to a data warehouse to unlock Diff.`,` `,K(tr,{href:Pn,target:`_blank`,sx:{color:`white`,textDecoration:`underline`},children:`Learn more`}),`.`]})]}):e}function dl({checksOnly:e=!0}){let t=en(),{featureToggles:n}=ce(),r=Hn(),{apiClient:i}=Wt(),a=Xn(null),o=Xn(null),[s,c]=W(null),[l,u]=W(!1),d=Ci(),f=Si(),{basePath:p}=I(),[,m]=pe(),h=V(async()=>{if(s){try{let{runs:t,checks:n}=await v(s,e,i);m?.(),await r.invalidateQueries({queryKey:F.checks()}),await r.invalidateQueries({queryKey:F.runs()}),f.includes(`/checks`)&&d.push(`${p}/checks`);let a=e?`${n} checks imported successfully`:`${t} runs and ${n} checks imported successfully`;cn.create({description:a,type:`info`,duration:5e3,closable:!0})}catch(e){console.error(`Import failed`,e),cn.create({title:`Import failed`,description:String(e),type:`error`,duration:5e3,closable:!0})}u(!1)}},[r,s,f,m,e,i,d.push,p]),g=()=>{a.current&&a.current.click()},_=e=>{e.target.files?.length===1&&(c(e.target.files[0]),u(!0)),a.current&&(a.current.value=``)},y=()=>u(!1),b=e?`checks`:`runs and checks`,{isDemoSite:x}=L();return q(G,{children:[K($,{title:`Import Checklist from State File`+(x?` (Disabled in the demo site)`:``),children:K(Q,{sx:{pt:`6px`,color:t?`grey.300`:`grey.600`,"&:hover":{color:t?`grey.100`:`grey.800`},fontSize:20},"aria-label":`Import state`,onClick:()=>{g(),jn({name:`import`})},disabled:n.disableImportStateFile||x,children:K(Zi,{})})}),K(`input`,{type:`file`,style:{display:`none`},ref:a,onChange:_}),q(Zn,{open:l,onClose:y,maxWidth:`sm`,fullWidth:!0,"aria-labelledby":`import-dialog-title`,children:[q(er,{id:`import-dialog-title`,sx:{display:`flex`,alignItems:`center`,fontWeight:`bold`},children:[`Import state`,K(J,{sx:{flexGrow:1}}),K(Q,{size:`small`,onClick:y,children:K(lr,{})})]}),K($n,{children:q(X,{direction:`column`,spacing:1,sx:{px:`5px`,borderRadius:1},children:[q(X,{direction:`row`,spacing:.5,sx:{alignItems:`center`},children:[K(J,{component:zr,sx:{color:`error.main`}}),K(Z,{component:`span`,sx:{fontWeight:500,color:`error.main`},children:`Caution!`})]}),q(Z,{children:[`The current `,b,` will be`,` `,K(Z,{component:`span`,sx:{fontWeight:600},children:`merged`}),` `,`with the imported state`]})]})}),q(Qn,{children:[K(Y,{ref:o,onClick:y,children:`Cancel`}),K(Y,{color:`iochmara`,variant:`contained`,onClick:h,sx:{ml:`5px`},children:`Import`})]})]})]})}function fl({check:e},t){return K(J,{sx:{display:`flex`,flexDirection:`column`,height:`100%`},children:K(Sr,{children:K(_c,{viewOptions:{...e.params,...e.view_options},interactive:!1,ref:t})})})}const pl=Gn(fl),ml=({node:e,selected:t,onSelect:n,schemaChanged:r,isDark:i})=>{let{icon:a}=Dt(e.data.resourceType),o,s;return r?(o=B(`schema_diff`).icon,s=Ze(`modified`).color):e.data.changeStatus===`added`?(o=Ze(`added`).icon,s=Ze(`added`).color):e.data.changeStatus===`removed`&&(o=Ze(`removed`).icon,s=Ze(`removed`).color),K(gi,{disablePadding:!0,children:q(J,{sx:{display:`flex`,width:`100%`,fontSize:`10pt`,p:`5px 8px`,cursor:`pointer`,"&:hover":{bgcolor:i?`grey.700`:`grey.200`},bgcolor:t?i?`grey.800`:`grey.100`:`inherit`,alignItems:`center`,gap:`5px`},onClick:()=>{n(e.id)},children:[a&&K(J,{component:a}),K(J,{sx:{flex:1,textOverflow:`ellipsis`,whiteSpace:`nowrap`,overflow:`hidden`},children:e.data.name}),o&&s&&K(J,{component:o,sx:{color:s}})]})})};function hl({check:e},t){let r=en(),{apiClient:i}=Wt(),{lineageGraph:a}=L(),o=e.params,{isLoading:s,error:c,data:l}=Vn({queryKey:[...F.check(e.check_id),`select`],queryFn:async()=>T({select:o.select,exclude:o.exclude,packages:o.packages,view_mode:o.view_mode},i),refetchOnMount:!0,enabled:!o.node_id}),[u,d]=U(()=>{let e=[],t=[],n=[],r=[];if(o.node_id){let t=o.node_id instanceof Array?o.node_id:[o.node_id];for(let n of t){let t=a?.nodes[n];t&&e.push(t)}}else for(let t of l?.nodes??[]){let n=a?.nodes[t];n&&e.push(n)}let i=e.filter(e=>e.data.resourceType===`model`||e.data.resourceType===`seed`||e.data.resourceType===`source`||e.data.resourceType===`snapshot`);for(let e of i)e.data.change?.columns&&Object.keys(e.data.change.columns).length>0?t.push(e.id):e.data.changeStatus===`added`?n.push(e.id):e.data.changeStatus===`removed`&&r.push(e.id);function s(e){return t.includes(e.id)?3:n.includes(e.id)?2:+!!r.includes(e.id)}return i.sort((e,t)=>{let n=s(e),r=s(t);return n===r?e.data.name.localeCompare(t.data.name):r-n}),[i,t]},[o.node_id,l?.nodes,a]),[f,p]=W(0),m=f<u.length?u[f]:void 0,{data:h}=Vn({queryKey:[`modelDetail`,m?.id],queryFn:()=>n(m?.id??``,i),enabled:!!m&&!!i,staleTime:300*1e3});if(s)return K(J,{sx:{display:`flex`,alignItems:`center`,justifyContent:`center`,bgcolor:r?`grey.900`:`grey.50`,height:`100%`},children:`Loading...`});if(c)return q(J,{sx:{display:`flex`,alignItems:`center`,justifyContent:`center`,bgcolor:r?`grey.900`:`grey.50`,height:`100%`},className:`no-track-pii-safe`,children:[`Error: `,c.message]});if(u.length==0)return K(J,{sx:{display:`flex`,alignItems:`center`,justifyContent:`center`,bgcolor:r?`grey.900`:`grey.50`,height:`100%`},children:`No nodes matched`});if(f<u.length){let e=u[f];return q(kt,{sizes:[80,20],minSize:30,style:{height:`100%`},children:[K(es,{base:h?.model?.base&&Object.keys(h.model.base).length>0?{id:e.id,unique_id:e.id,name:e.data.name,...h.model.base}:void 0,current:h?.model?.current&&Object.keys(h.model.current).length>0?{id:e.id,unique_id:e.id,name:e.data.name,...h.model.current}:void 0,columnChanges:e.data.change?.columns,enableScreenshot:!0,showMenu:!1,ref:t}),K(hi,{sx:{overflow:`auto`,bgcolor:`background.paper`,listStyle:`none`},children:u.map((e,t)=>K(ml,{node:e,schemaChanged:d.includes(e.id),selected:t===f,isDark:r,onSelect:()=>{p(t)}},e.id))})]})}return K(G,{})}const gl=Gn(hl),_l={success:`#059669`,failure:`#ef4444`,error:`#ef4444`,warning:`#f59e0b`},vl={success:`PASSED`,failure:`FAILED`,error:`ERROR`,warning:`WARNING`};function yl(e){return _l[e]??`#6b7280`}function bl(e){return vl[e]??e.toUpperCase()}function xl({run:e,index:t,onClick:n}){let r=yl(e.status),i=bl(e.status),a=di(new Date(e.run_at),{addSuffix:!0}),o=!!n;return q(si,{component:o?`button`:`div`,type:o?`button`:void 0,onClick:o?()=>n?.(e.run_id):void 0,"aria-label":o?`View run #${t} — ${i}`:void 0,sx:{p:1,border:`none`,borderLeft:`3px solid ${r}`,borderRadius:1,bgcolor:`action.hover`,cursor:o?`pointer`:`default`,"&:hover":o?{bgcolor:`action.selected`}:{},textAlign:`left`,width:`100%`,font:`inherit`,color:`inherit`},children:[q(ci,{variant:`body2`,sx:{fontWeight:600,fontSize:`0.75rem`},children:[`Run #`,t,` — `,i,e.triggered_by===`recce_ai`&&K(ci,{component:`span`,sx:{ml:.75,fontSize:`0.65rem`,fontWeight:500,color:`#7c3aed`},children:`by AI`})]}),e.summary&&K(ci,{variant:`body2`,sx:{color:`text.secondary`,fontSize:`0.7rem`,mt:.25},children:e.summary}),K(ci,{variant:`body2`,sx:{color:`text.secondary`,fontSize:`0.65rem`,mt:.25},children:a})]})}function Sl({event:e}){let t=p(e),n={create:Gr,comment:Pr,approve:Fr,unapprove:Ir,edit:Hr,preset:Mr},r={create:`primary.main`,comment:`grey.500`,approve:`success.main`,unapprove:`grey.400`,edit:`warning.main`,preset:`secondary.main`},i=n[t],a=r[t];return K(J,{component:i,sx:{color:a,fontSize:16}})}function Cl({event:e}){let{actor:t}=e,{avatarUrl:n}=Bt({userId:t.user_id}),r=(t.fullname||t.login||`User`).charAt(0).toUpperCase();return K(_i,{src:n||void 0,sx:{width:24,height:24,fontSize:`0.75rem`},children:r})}function wl({event:e}){let{actor:t}=e,n=t.fullname||t.login||`Someone`,r=di(new Date(e.created_at),{addSuffix:!0}),i=``;switch(e.event_type){case`check_created`:i=`created this check`;break;case`approval_change`:i=e.new_value===`true`?`approved this check`:`unapproved this check`;break;case`description_change`:i=`updated the description`;break;case`name_change`:i=`renamed this check`;break;case`preset_applied`:i=`applied a preset`;break;default:i=`made a change`}return q(J,{sx:{display:`flex`,gap:1,alignItems:`flex-start`,py:1},children:[K(J,{sx:{pt:`2px`},children:K(Sl,{event:e})}),K(J,{sx:{flex:1},children:q(X,{direction:`row`,spacing:.5,sx:{flexWrap:`wrap`,alignItems:`center`},children:[K(Cl,{event:e}),K(Z,{variant:`body2`,sx:{fontWeight:`500`},children:n}),K(Z,{variant:`body2`,sx:{color:`text.secondary`},children:i}),K(Z,{variant:`caption`,sx:{color:`text.disabled`},children:r})]})})]})}function Tl({event:e,currentUserId:t,onEdit:n,onDelete:r}){let i=en(),[a,o]=W(!1),[s,c]=W(e.content||``),[l,u]=W(!1),[d,f]=W(!1),[p,m]=W(null),h=!!p,{actor:g}=e,_=g.fullname||g.login||`Someone`,v=di(new Date(e.created_at),{addSuffix:!0}),y=t&&String(g.user_id)===String(t),b=()=>{c(e.content||``),o(!0)},x=()=>{c(e.content||``),o(!1)},S=async()=>{let t=s.trim();if(!t||t===e.content){x();return}if(n){u(!0);try{await n(e.id,t),o(!1)}finally{u(!1)}}},C=e=>{e.key===`Escape`?x():e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),S())},w=e=>{m(e.currentTarget)},T=()=>{m(null)};return e.is_deleted?q(J,{sx:{display:`flex`,gap:1,alignItems:`center`,py:1},children:[K(J,{sx:{pt:`2px`,display:`flex`,alignItems:`center`},children:K(Sl,{event:e})}),K(J,{sx:{display:`flex`,flex:1,alignItems:`center`},children:K(Z,{variant:`body2`,sx:{color:`text.disabled`,fontStyle:`italic`},children:`Comment deleted`})})]}):q(J,{sx:{display:`flex`,gap:1,alignItems:`flex-start`,py:1},children:[K(J,{sx:{pt:`2px`},children:K(Sl,{event:e})}),q(J,{sx:{flex:1},children:[q(X,{direction:`row`,spacing:.5,sx:{flexWrap:`wrap`,alignItems:`center`,mb:.5},children:[K(Cl,{event:e}),q(Z,{variant:`body2`,sx:{fontWeight:`500`},children:[_,y&&q(Z,{component:`span`,variant:`body2`,sx:{color:`text.secondary`},children:[` `,`(Author)`]})]}),K(Z,{variant:`caption`,sx:{color:`text.disabled`},children:v}),e.is_edited&&K(Z,{variant:`caption`,sx:{color:`text.disabled`},children:`(edited)`})]}),a?q(J,{children:[K(li,{value:s,onChange:e=>c(e.target.value),onKeyDown:C,size:`small`,multiline:!0,minRows:3,fullWidth:!0,disabled:l,autoFocus:!0,sx:{"& .MuiOutlinedInput-root":{bgcolor:`background.paper`,"&:focus-within":{borderColor:`primary.main`}}}}),q(X,{direction:`row`,spacing:1,sx:{justifyContent:`flex-end`,mt:1},children:[K(Y,{size:`small`,variant:`text`,onClick:x,disabled:l,children:`Cancel`}),K(Y,{size:`small`,variant:`contained`,onClick:S,disabled:!s.trim()||l,children:l?`Saving...`:`Save`})]})]}):q(J,{sx:{bgcolor:i?`grey.800`:`grey.50`,borderRadius:1,p:1,border:`1px solid`,borderColor:i?`grey.700`:`grey.200`,position:`relative`,"&:hover .comment-actions":{opacity:1}},children:[K(Pt,{content:e.content||``,fontSize:`sm`}),y&&(n||r)&&q(X,{className:`comment-actions`,direction:`row`,spacing:0,sx:{position:`absolute`,top:4,right:4,opacity:0,transition:`opacity 0.2s`},children:[n&&K($,{title:`Edit comment`,children:K(Q,{"aria-label":`Edit comment`,size:`small`,onClick:b,children:K(Wr,{})})}),r&&q(G,{children:[K($,{title:`Delete comment`,children:K(Q,{"aria-label":`Delete comment`,size:`small`,color:`error`,onClick:w,children:K(Yr,{})})}),K(vi,{open:h,anchorEl:p,onClose:T,anchorOrigin:{vertical:`bottom`,horizontal:`center`},transformOrigin:{vertical:`top`,horizontal:`center`},children:q(J,{sx:{p:2},children:[K(Z,{variant:`body2`,sx:{mb:2},children:`Delete this comment?`}),q(X,{direction:`row`,spacing:1,sx:{justifyContent:`flex-end`},children:[K(Y,{size:`small`,variant:`text`,onClick:T,disabled:d,children:`Cancel`}),K(Y,{size:`small`,variant:`contained`,color:`error`,onClick:async()=>{if(r){f(!0);try{await r(e.id),T()}finally{f(!1)}}},disabled:d,children:d?`Deleting...`:`Delete`})]})]})})]})]})]})]})]})}function El({event:e,currentUserId:t,onEdit:n,onDelete:r}){return e.event_type===`comment`?K(Tl,{event:e,currentUserId:t,onEdit:n,onDelete:r}):K(wl,{event:e})}function Dl(e,t){let n=e?.toLowerCase();return n===`finished`?t?`error`:`success`:n===`failed`?`error`:e??`unknown`}function Ol(e,t){let n=[];for(let t of e)n.push({kind:`event`,event:t,at:t.created_at});if(t){let e=[...t].sort((e,t)=>new Date(e.run_at).getTime()-new Date(t.run_at).getTime());for(let t=0;t<e.length;t++)n.push({kind:`run`,run:e[t],index:t+1,at:e[t].run_at})}return n.sort((e,t)=>new Date(t.at).getTime()-new Date(e.at).getTime()),n}function kl({checkId:t}){let n=en(),{apiClient:r,authToken:i}=Wt(),{events:a,isLoading:o,error:s,createComment:c,isCreatingComment:l,updateComment:u,deleteComment:d}=Ot(t),{data:f}=Vn({queryKey:F.user(),queryFn:()=>Ln(r),retry:!1}),{data:p}=Vn({queryKey:[`check-runs`,t],queryFn:async()=>(await e(r)).filter(e=>e.check_id===t).map(e=>({run_id:e.run_id,run_at:e.run_at,status:Dl(e.status,e.error),summary:e.error||void 0,triggered_by:e.triggered_by})),enabled:!!i,staleTime:3e4}),m=U(()=>Ol(a,p),[a,p]),h=e=>{c(e)},g=async(e,t)=>{await u({eventId:e,content:t})},_=async e=>{await d(e)};return o?K(J,{sx:{height:`100%`,p:4,display:`flex`,justifyContent:`center`,alignItems:`center`},children:K(ii,{size:20})}):s?K(J,{sx:{height:`100%`,p:4,display:`flex`,justifyContent:`center`,alignItems:`center`},children:K(Z,{sx:{fontSize:`0.875rem`,color:`error.main`},children:`Failed to load timeline`})}):q(X,{sx:{height:`100%`,alignItems:`stretch`,borderLeft:`1px solid`,borderColor:n?`grey.700`:`grey.200`},spacing:0,children:[K(J,{sx:{px:3,py:2,borderBottom:`1px solid`,borderColor:n?`grey.700`:`grey.200`},children:K(Z,{variant:`subtitle2`,sx:{fontWeight:500},children:`Activity`})}),K(J,{sx:{flex:1,overflowY:`auto`,px:3,py:2},children:m.length===0?K(Z,{sx:{fontSize:`0.875rem`,color:`grey.500`},children:`No activity yet`}):K(X,{sx:{alignItems:`stretch`},spacing:0,children:m.map((e,t)=>q(J,{children:[e.kind===`event`?K(El,{event:e.event,currentUserId:f?.id,onEdit:g,onDelete:_}):K(xl,{run:e.run,index:e.index}),t<m.length-1&&K(fi,{sx:{borderColor:n?`grey.700`:`grey.100`}})]},e.kind===`event`?e.event.id:e.run.run_id))})}),K(J,{sx:{px:3,py:3,borderTop:`1px solid`,borderColor:n?`grey.700`:`grey.200`,bgcolor:n?`grey.900`:`grey.50`},children:K(Ne,{onSubmit:h,isSubmitting:l})})]})}function Al({checkId:e,refreshCheckList:n}){let r=ar(),i=en(),{apiClient:o}=Wt(),{featureToggles:s,sessionId:c}=ce(),{setLatestSelectedCheckId:u}=Xt(),{cloudMode:d}=L(),f=Hn(),p=Ci(),{basePath:m}=I(),{setSqlQuery:h,setBaseSqlQuery:g,setCustomQueries:_,setPrimaryKeys:v}=Kt(),{successToast:y,failToast:b}=on(),[x,S]=W(),[w]=W(),[T,E]=W(!1),[O,k]=W(null),A=!!O,{isLoading:j,error:ee,data:M}=Vn({queryKey:F.check(e),queryFn:async()=>C(e,o),refetchOnMount:!0}),N=x??M?.last_run?.run_id,{run:P,error:te,onCancel:ne}=At(N),re=x?!P||P.status===`Running`:P?.status===`Running`,ie=M?.type?B(M.type):void 0,ae;ie&&(ae=ie.RunResultView);let oe=M?.is_preset??!1,se=Xn(null),{mutate:le}=Bn({mutationFn:t=>a(e,t,o),onSuccess:async()=>{await f.invalidateQueries({queryKey:F.check(e)}),await f.invalidateQueries({queryKey:F.checks()})}}),{mutate:ue}=Bn({mutationFn:()=>t(e,o),onSuccess:async()=>{u(``),await f.invalidateQueries({queryKey:F.checks()}),p.push(`${m}/checks`)}}),{mutate:de,isPending:fe}=Bn({mutationFn:async()=>{if(!M)throw Error(`Check not found`);return await l(e,o)},onSuccess:async()=>{y(`Check marked as preset successfully`),await f.invalidateQueries({queryKey:F.check(e)})},onError:e=>{b(`Failed to mark check as preset`,e)}}),pe=V(async()=>{M?.type&&(S((await D(e,{nowait:!0},o)).run_id),await f.invalidateQueries({queryKey:F.check(e)}),n&&n())},[M,e,f,n,o]),me=async()=>{if(!M)return;let e=jl(M);if(!window.isSecureContext){b(`Failed to copy the check to clipboard`,Error(`Copy to clipboard is available only in secure contexts (HTTPS)`));return}try{await navigator.clipboard.writeText(e),y(`Copied the check to the clipboard`)}catch(e){b(`Failed to copy the check to clipboard`,e)}},he=V(()=>{let e=M?.is_checked;le({is_checked:!e}),e||cn.create({title:`Marked as approved`,type:`success`,duration:2e3})},[M?.is_checked,le]),ge=e=>{le({view_options:e})},_e=e=>{le({description:e})},ve=e=>{k(e.currentTarget)},ye=()=>{k(null)},be=V(()=>{if(!M)return;let e=M.params;h(e?.sql_template||``),`base_sql_template`in e&&e.base_sql_template?(g(e.base_sql_template),_(!0)):(g(``),_(!1)),`primary_keys`in e&&e.primary_keys?v(e.primary_keys):v(void 0),p.push(`${m}/query`)},[M,p,m,h,g,_,v]),[xe,Se]=W(`result`),{ref:Ce,onCopyToClipboard:we,onMouseEnter:Te,onMouseLeave:Ee}=Nt(),De=Be({name:M?.name??``,description:M?.description??``,type:M?.type??``,params:M?.params,viewOptions:M?.view_options});if(j)return K(J,{sx:{display:`flex`,alignItems:`center`,justifyContent:`center`,height:`100%`},children:`Loading`});if(ee)return q(J,{sx:{display:`flex`,alignItems:`center`,justifyContent:`center`,height:`100%`},children:[`Error: `,K(`span`,{className:`no-track-pii-safe`,children:ee.message})]});if(!M)return K(Vt,{minSize:100,sizes:[30,70],style:{height:`100%`,width:`100%`,maxHeight:`100%`},children:K(J,{style:{contain:`strict`},sx:{display:`flex`,flexDirection:`column`},children:K(J,{sx:{display:`flex`,p:`0px 16px`,alignItems:`center`,height:40},children:K(ut,{name:`Check not found`,disabled:!0})})})});let Oe=P?.run_at?di(new Date(P.run_at),{addSuffix:!0}):null,ke=ie?.icon;return q(va,{spacing:0,container:!0,sx:{height:`100%`,width:`100%`},children:[K(va,{size:{xs:12,md:d?9:12},sx:{height:`100%`},children:q(Vt,{minSize:100,sizes:[40,60],style:{height:`100%`,width:`100%`,maxHeight:`100%`},children:[K(J,{sx:{height:`100%`,contain:`strict`,display:`flex`,flexDirection:`row`},children:q(J,{sx:{flex:1,height:`100%`,display:`flex`,flexDirection:`column`,overflow:`hidden`,minWidth:0},children:[q(J,{sx:{display:`flex`,p:`0px 16px`,alignItems:`center`,height:40,borderBottom:`2px solid`,borderColor:i?`grey.700`:`grey.300`},children:[ke&&K(J,{component:ke,sx:{fontSize:20,mr:1,flexShrink:0}}),K(ut,{name:M.name,onNameChange:e=>{le({name:e})}}),K(J,{sx:{flexGrow:1}}),q(X,{direction:`row`,spacing:2,sx:{mr:`10px`},children:[oe&&K($,{title:`This is a preset check`,children:K(J,{sx:{display:`flex`,alignItems:`center`,justifyContent:`center`},children:K(Xi,{size:`1rem`,color:r.palette.iochmara.dark})})}),M?.actor_type&&!M.is_preset&&He[M.actor_type]&&K(fr,{label:He[M.actor_type].label,size:`small`,sx:{height:20,fontSize:`0.65rem`,fontWeight:500,backgroundColor:He[M.actor_type].bg,color:He[M.actor_type].color,flexShrink:0,"& .MuiChip-label":{px:.75}}}),K(Q,{size:`small`,onClick:ve,children:K(ri,{})}),q(Qr,{anchorEl:O,open:A,onClose:ye,children:[c&&q($r,{onClick:()=>{de(),ye()},disabled:fe||oe,children:[K(Qi,{children:K(cr,{})}),K($i,{children:`Mark as Preset Check`})]}),q($r,{onClick:()=>{E(!0),ye()},children:[K(Qi,{children:K(ba,{})}),K($i,{children:`Get Preset Check Template`})]}),q($r,{onClick:()=>{me(),ye()},children:[K(Qi,{children:K(Lr,{})}),K($i,{children:`Copy Markdown`})]}),K(fi,{}),q($r,{onClick:()=>{ue(),ye()},disabled:s.disableUpdateChecklist,sx:{color:`error.main`},children:[K(Qi,{sx:{color:`error.main`},children:K(Jr,{})}),K($i,{children:`Delete`})]})]}),K($,{title:tt({type:M.type,hasResult:!!P?.result,hasError:!!P?.error})?`Run the check first`:M.is_checked?`Remove approval`:`Mark as approved`,placement:`bottom-end`,children:K(Y,{size:`small`,color:M.is_checked?`success`:`neutral`,variant:M.is_checked?`contained`:`outlined`,onClick:()=>{he()},disabled:tt({type:M.type,hasResult:!!P?.result,hasError:!!P?.error})||s.disableUpdateChecklist,startIcon:M.is_checked?K(Fr,{}):K(ei,{style:{color:i?r.palette.grey[600]:r.palette.grey[400]}}),sx:{flex:`0 0 auto`,textTransform:`none`},children:M.is_checked?`Approved`:`Pending`})})]})]}),K(J,{sx:{flex:1,p:`8px 16px`,minHeight:100},children:K(Ft,{value:M.description,onChange:_e,disabled:s.disableUpdateChecklist},M.check_id)})]})}),K(J,{style:{contain:`strict`},children:q(J,{sx:{height:`100%`,display:`flex`,flexDirection:`column`},children:[q(J,{sx:{display:`flex`,alignItems:`center`,borderBottom:1,borderColor:`divider`,height:50},children:[q(mi,{value:xe,onChange:(e,t)=>Se(t),children:[K(pi,{label:`Result`,value:`result`,sx:{fontSize:`0.75rem`,textTransform:`none`}}),(M.type===`query`||M.type===`query_diff`)&&K(pi,{label:`Query`,value:`query`,sx:{fontSize:`0.75rem`,textTransform:`none`}})]}),Oe&&K(Z,{variant:`caption`,sx:{color:`text.secondary`,ml:1,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,minWidth:0,display:`flex`,alignItems:`center`},children:Oe}),K(J,{sx:{flexGrow:1}}),q(X,{direction:`row`,spacing:1,sx:{mr:`10px`},children:[(M.type===`query`||M.type===`query_base`||M.type===`query_diff`)&&K($,{title:`Open in Query tab`,children:K(Y,{variant:`outlined`,color:`neutral`,size:`small`,onClick:be,disabled:s.disableDatabaseQuery,startIcon:K(zi,{}),sx:{textTransform:`none`},children:`Open Query`})}),ae&&K($,{title:`Rerun`,children:K(Y,{variant:`outlined`,color:`neutral`,size:`small`,onClick:()=>pe(),disabled:s.disableDatabaseQuery||re,startIcon:K(Kr,{}),sx:{textTransform:`none`},children:re?`Running...`:`Rerun`})}),K(Y,{variant:`outlined`,color:`neutral`,disabled:tt({type:M.type,hasResult:!!P?.result,hasError:!!P?.error})||xe!==`result`,onMouseEnter:Te,onMouseLeave:Ee,size:`small`,onClick:async()=>{M.type===`lineage_diff`?se.current?.copyToClipboard():await we(),mn({type:M.type,from:`check`})},startIcon:K(Lr,{}),sx:{textTransform:`none`},children:`Copy to Clipboard`})]})]}),q(J,{sx:{flex:1,contain:`strict`},children:[xe===`result`&&q(J,{sx:{width:`100%`,height:`100%`},children:[ae&&(M.last_run||N?K(Et,{ref:Ce,runId:N,isRunning:re,run:N?P:M.last_run,error:te,progress:w,RunResultView:ae,viewOptions:M.view_options,onViewOptionsChanged:ge,onCancel:ne,onExecuteRun:pe}):K(J,{sx:{display:`flex`,alignItems:`center`,justifyContent:`center`,bgcolor:i?`grey.900`:`grey.50`,height:`100%`},children:q(X,{spacing:2,sx:{alignItems:`center`},children:[K(J,{children:`This action is part of the initial preset and has not been performed yet. Once performed, the result will be shown here.`}),K(ul,{display:s.mode===`metadata only`,children:K(Y,{onClick:pe,variant:`contained`,size:`small`,disabled:s.disableDatabaseQuery,children:`Run Query`})})]})})),M.type===`schema_diff`&&K(gl,{check:M,ref:Ce},M.check_id),M.type===`lineage_diff`&&K(pl,{check:M,ref:se},M.check_id)]}),xe===`query`&&(M.type===`query`||M.type===`query_diff`||M.type===`query_base`)&&K(J,{sx:{height:`100%`,width:`100%`},children:M.params.base_sql_template?K(Ke,{value:M.params.sql_template||``,baseValue:M.params.base_sql_template??``,options:{readOnly:!0}}):K(Je,{value:M.params.sql_template||``,options:{readOnly:!0}})})]})]})}),q(Zn,{open:T,onClose:()=>E(!1),maxWidth:`md`,fullWidth:!0,children:[K(er,{children:`Preset Check Template`}),q($n,{children:[q(Z,{variant:`subtitle2`,sx:{fontWeight:`bold`,mb:2},children:[`Please`,` `,K(Z,{component:`span`,sx:{cursor:`pointer`,"&:hover":{textDecoration:`underline`},color:`primary.main`},onClick:async()=>{await navigator.clipboard.writeText(De),y(`Copied the template to the clipboard`)},children:`copy`}),` `,`the following template and paste it into the`,` `,K(J,{component:`span`,sx:{px:.5,bgcolor:`error.light`,borderRadius:.5},children:`recce.yml`}),` `,`file.`]}),K(ct,{yamlTemplate:De})]}),K(Qn,{children:K(Q,{size:`small`,onClick:()=>E(!1),sx:{position:`absolute`,top:8,right:8},children:K(lr,{})})})]})]})}),d&&K(va,{size:3,sx:{height:`100%`,overflow:`hidden`,flexShrink:0,display:{xs:`none`,md:`block`}},children:K(kl,{checkId:e})})]})}function jl(e){return ya`
|
|
7
|
-
<details><summary>${Ve({name:e.name,isChecked:e.is_checked})}</summary>
|
|
8
|
-
|
|
9
|
-
${Ml(e)}
|
|
10
|
-
|
|
11
|
-
</details>`}function Ml(e){let t=Re({description:e.description});if(e.type===`query`||e.type===`query_diff`){let n=e.params;return`${t}\n\n${Ge({sql:n&&`sql_template`in n?n.sql_template:``})}`}return t}const Nl=()=>{let e=Hn(),t=Ci(),{apiClient:n}=Wt(),{basePath:r}=I(),{mutate:i,isPending:a}=Bn({mutationFn:()=>S({select:`state:modified`},n),onSuccess:async n=>{await e.invalidateQueries({queryKey:F.checks()}),t.push(`${r}/checks/?id=${n.check_id}`)}});return K(z,{title:`No checks yet`,description:`Checks help you validate data quality and catch issues.`,icon:K(Ri,{size:48}),actionText:`Create Schema Diff Check`,onAction:()=>{i()},isLoading:a,helperText:`The schema checks compare modified models between environments to detect changes, additions, or removals.`})},Pl=({check:e,selected:t,onSelect:n,onApprovalChange:r})=>{let{featureToggles:i}=ce(),a=e.last_run?.run_id,{run:o}=At(a),s=tt({type:e.type,hasResult:!!o?.result,hasError:!!o?.error}),c=s||i.disableUpdateChecklist;return K(dt,{check:{id:e.check_id,name:e.name,type:e.type,isApproved:e.is_checked,runStatus:(()=>{if(o){if(o.error)return`error`;if(o.result)return`success`}})(),isPreset:e.is_preset,isOutdated:e.is_outdated,lastRunAt:e.last_run?.run_at,actorType:e.actor_type},isSelected:t,onClick:n,onApprovalChange:r,disableApproval:c,disabledApprovalTooltip:s?`Run the check first`:void 0})},Fl=({checks:e,selectedItem:t,onCheckSelected:n,onChecksReordered:r})=>{let[i,o]=W(!1),[s,c]=W(!1),[l,u]=W(null),d=Hn(),{apiClient:f}=Wt(),{mutate:p}=Bn({mutationFn:({checkId:e,isChecked:t})=>a(e,{is_checked:t},f),onSuccess:async(e,{checkId:t})=>{await d.invalidateQueries({queryKey:F.check(t)}),await d.invalidateQueries({queryKey:F.checks()})}}),m=e=>{e.destination&&r(e.source.index,e.destination.index)},h=()=>c(!0),g=()=>{c(!1),u(null)},_=()=>{cn.create({title:`Marked as approved`,type:`success`,duration:2e3})},v=(e,t)=>{t?localStorage.getItem(`bypassMarkAsApprovedWarning`)===`true`?(p({checkId:e,isChecked:!0}),_()):(u(e),h()):p({checkId:e,isChecked:!1})};return q(G,{children:[K(xa,{onDragEnd:m,children:K(Ca,{droppableId:`checklist`,children:r=>q(X,{...r.droppableProps,ref:r.innerRef,className:`no-track-pii-safe`,sx:{width:`100%`,flex:1,overflow:`auto`},spacing:0,children:[e.map((e,r)=>K(Sa,{draggableId:e.check_id,index:r,children:(r,i)=>{let a=r.draggableProps.style;if(i.isDragging&&a&&`left`in a){let e={x:0,y:80};a={...a,left:a.left-e.x,top:a.top-e.y}}return K(J,{ref:r.innerRef,...r.draggableProps,...r.dragHandleProps,style:a,sx:{borderBottom:`1px solid`,borderColor:`divider`,width:`100%`},children:K(Pl,{check:e,selected:e.check_id===t,onSelect:n,onApprovalChange:v},e.check_id)})}},e.check_id)),r.placeholder]})})}),q(Zn,{open:s,onClose:g,maxWidth:`xs`,fullWidth:!0,children:[q(er,{sx:{display:`flex`,alignItems:`center`},children:[`Mark as Approved?`,K(J,{sx:{flexGrow:1}}),K(Q,{size:`small`,onClick:g,children:K(lr,{})})]}),K(fi,{}),q($n,{sx:{fontSize:`0.875rem`},children:[K(Z,{children:`Please ensure you have reviewed the contents of this check before marking it as approved.`}),K(jr,{control:K(Ar,{checked:i,onChange:e=>{o(e.target.checked)},size:`small`}),label:K(Z,{sx:{fontWeight:`bold`,pt:`8px`},children:`Don't show this again`})})]}),K(fi,{}),q(Qn,{sx:{gap:0},children:[K(Y,{variant:`outlined`,size:`small`,onClick:g,children:`Cancel`}),K(Y,{color:`iochmara`,variant:`contained`,size:`small`,onClick:()=>{l&&(p({checkId:l,isChecked:!0}),i&&localStorage.setItem(`bypassMarkAsApprovedWarning`,`true`),_(),g(),u(null))},children:`Mark as approved`})]})]})]})},Il=()=>{let{isDark:e}=Lt(),t=e?`grey.700`:`grey.300`,n=Ci(),r=wi().get(`id`),{latestSelectedCheckId:i,setLatestSelectedCheckId:a}=Xt(),o=Hn(),{apiClient:s}=Wt(),{basePath:l}=I(),d=r;H(()=>{d&&a(d)},[d,a]);let{isLoading:f,error:p,data:m,status:h,refetch:g}=Vn({queryKey:F.checks(),queryFn:()=>c(s),refetchOnMount:!0}),_=V(e=>{n.push(`${l}/checks/?id=${e}`)},[n.push,l]),[v,y]=W(m??[]),[b,x]=W(m);m!==b&&(x(m),y(m??[]));let{mutate:S}=Bn({mutationFn:e=>u(e,s),onSuccess:async()=>{await o.invalidateQueries({queryKey:F.checks()})}}),C=V((e,t)=>{let n=[...v],[r]=n.splice(e,1);n.splice(t,0,r),S({source:e,destination:t}),y(n)},[v,S]),w=U(()=>!!(d&&m?.some(e=>e.check_id===d)),[d,m]);return H(()=>{h!==`success`||m.length===0||w||(i&&m.some(e=>e.check_id===i)?n.replace(`${l}/checks/?id=${i}`):n.replace(`${l}/checks/?id=${m[0].check_id}`))},[h,w,m,i,n.replace,l]),f?null:p?q(J,{children:[`Error: `,K(`span`,{className:`no-track-pii-safe`,children:p.message})]}):m?.length?q(kt,{style:{height:`100%`},minSize:50,sizes:[20,80],children:[K(J,{sx:{height:`100%`},style:{contain:`size`},children:q(X,{sx:{height:`100%`,alignItems:`stretch`},style:{contain:`strict`},spacing:0,children:[K(J,{sx:{display:`flex`,justifyContent:`flex-end`,p:`0px 10px`},children:K(dl,{checksOnly:!0})}),K(fi,{}),K(Fl,{checks:v,selectedItem:d,onCheckSelected:_,onChecksReordered:C})]})}),K(J,{sx:{height:`100%`},children:w&&d&&K(Al,{checkId:d,refreshCheckList:g},d)})]}):q(kt,{style:{height:`100%`},minSize:50,sizes:[20,80],children:[K(J,{sx:{borderRight:`1px solid`,borderRightColor:t,height:`100%`},style:{contain:`size`},children:q(X,{sx:{height:`100%`,alignItems:`stretch`},style:{contain:`strict`},spacing:0,children:[K(J,{sx:{display:`flex`,justifyContent:`flex-end`,p:`0px 10px`},children:K(dl,{checksOnly:!0})}),K(fi,{}),K(J,{sx:{height:`100%`,display:`flex`,justifyContent:`center`,alignItems:`center`},children:K(J,{sx:{textAlign:`center`,color:`grey.500`},children:`No checks`})})]})}),K(J,{children:K(J,{sx:{height:`100%`,display:`flex`,justifyContent:`center`,alignItems:`center`},children:K(Nl,{})})})]})},Ll=()=>{let{isDark:e}=Lt();return q(kt,{style:{height:`100%`},minSize:50,sizes:[20,80],children:[K(J,{sx:{borderRight:`1px solid`,borderRightColor:e?`grey.700`:`grey.300`,height:`100%`},style:{contain:`size`},children:K(J,{sx:{height:`100%`,display:`flex`,justifyContent:`center`,alignItems:`center`},children:K(ii,{size:20})})}),K(J,{children:K(J,{sx:{height:`100%`,display:`flex`,justifyContent:`center`,alignItems:`center`},children:K(ii,{size:20})})})]})},Rl={added:[`Model Added`,`Added resource`],removed:[`Model Removed`,`Removed resource`],modified:[`Model Modified`,`Modified resource`],col_added:[`Column Added`,`Added column`],col_removed:[`Column Removed`,`Removed column`],col_changed:[`Column Modified`,`Modified column`],folder_changed:[`Modified`,`Modified folder`]};function zl(e){let t=String(Oe(`colors.green.solid`)),n=String(Oe(`colors.red.solid`)),r=String(Oe(`colors.amber.emphasized`));return e===`added`?{color:t,icon:Yt}:e===`removed`?{color:n,icon:nt}:e===`modified`?{color:r,icon:qt}:e===`col_added`?{color:t,icon:Yt}:e===`col_removed`?{color:n,icon:nt}:e===`col_changed`?{color:r,icon:qt}:e===`folder_changed`?{color:r,icon:mt}:{color:`inherit`,icon:void 0}}function Bl(e,t){let n=0,r=0,i=0;return!e&&!t?{adds:n,removes:r,modifies:i}:(t&&Object.keys(t.columns??{}).forEach(t=>{e?.columns?.[t]||n++}),e&&Object.keys(e.columns??{}).forEach(e=>{t?.columns?.[e]||r++}),t&&e&&Object.keys(t.columns??{}).forEach(n=>{e.columns&&t.columns?.[n]&&e.columns[n]&&e.columns[n].type!==t.columns[n].type&&i++}),{adds:n,removes:r,modifies:i})}function Vl(e){let t=e.modifiedSet,n=0,r=0,i=0,a=0,o=0,s=0;return t.forEach(t=>{e.nodes[t].data.changeStatus===`added`?n++:e.nodes[t].data.changeStatus===`removed`?r++:e.nodes[t].data.changeStatus===`modified`&&i++;let c=e.nodes[t].data.change?.columns;if(c)for(let e of Object.values(c))e===`added`?a++:e===`removed`?o++:(e===`modified`||e===`unknown`)&&s++}),{adds:n,removes:r,modifies:i,col_added:a,col_removed:o,col_changed:s}}function Hl({name:e,value:t,tip:n}){return q(X,{sx:{alignItems:`stretch`},children:[q(Z,{sx:{fontSize:`0.875rem`,color:`grey.600`},children:[e,n&&K($,{title:n,children:K(J,{sx:{display:`inline-block`},children:K(J,{component:Hi,sx:{mx:`2px`,fontSize:12,verticalAlign:`middle`}})})})]}),t]})}function Ul({changeStatus:e,value:t}){let[n]=e?Rl[e]:[``],{icon:r,color:i}=zl(e);return q(X,{sx:{alignItems:`stretch`},children:[q(X,{direction:`row`,sx:{alignItems:`center`,fontSize:`0.875rem`,color:`grey.600`},children:[r&&K(J,{component:r,sx:{mr:`5px`,color:i,fontSize:`1rem`}}),n]}),K(Z,{sx:{fontSize:`0.875rem`},children:t})]})}function Wl({lineageGraph:e}){let{adds:t,removes:n,modifies:r,col_added:i,col_removed:a,col_changed:o}=Vl(e);return q(va,{container:!0,sx:{mb:`10px`,borderTop:`1px solid`,borderColor:`divider`,p:`2.5vw`},children:[K(va,{size:6,sx:{borderColor:`divider`},children:K(Hl,{name:`Code Changes`,value:q(va,{container:!0,sx:{width:`100%`},children:[K(va,{size:4,children:K(Ul,{changeStatus:`added`,value:t})}),K(va,{size:4,children:K(Ul,{changeStatus:`removed`,value:n})}),K(va,{size:4,children:K(Ul,{changeStatus:`modified`,value:r})})]})})}),K(va,{size:6,sx:{borderLeft:`1px solid`,borderLeftColor:`divider`,pl:`12px`},children:K(Hl,{name:`Column Changes`,value:q(va,{container:!0,sx:{width:`100%`},children:[K(va,{size:4,children:K(Ul,{changeStatus:`col_added`,value:i})}),K(va,{size:4,children:K(Ul,{changeStatus:`col_removed`,value:a})}),K(va,{size:4,children:K(Ul,{changeStatus:`col_changed`,value:o})})]})})})]})}function Gl({node:e,...t}){let{apiClient:r}=Wt(),{data:i,isLoading:a}=Vn({queryKey:[`modelDetail`,e.id],queryFn:()=>n(e.id,r),enabled:!!r,staleTime:300*1e3}),o=i?.model;return q(wa,{sx:{maxWidth:500},children:[K(Ea,{title:K(Z,{sx:{fontSize:18,fontWeight:`bold`},children:t.title}),subheader:q(X,{direction:`row`,spacing:`8px`,sx:{p:`16px`},children:[K(et,{resourceType:e.data.resourceType,materialized:e.data.materialized}),e.data.resourceType===`model`&&K(As,{node:e})]})}),K(Ta,{children:K(J,{sx:{display:`flex`},children:a?K(ia,{variant:`rectangular`,width:`100%`,height:100}):K(es,{base:o?.base&&Object.keys(o.base).length>0?{id:e.id,unique_id:e.id,name:e.data.name,...o.base}:void 0,current:o?.current&&Object.keys(o.current).length>0?{id:e.id,unique_id:e.id,name:e.data.name,...o.current}:void 0,columnChanges:e.data.change?.columns})})})]})}function Kl(e){let t=[],n=e.nodes;return e.modifiedSet.forEach(e=>{let r=n[e];r.data.change?.columns&&Object.keys(r.data.change.columns).length>0&&t.push(r)}),t}function ql({lineageGraph:e}){let[t,n]=W([]);return H(()=>{n(Kl(e))},[e]),q(G,{children:[K(J,{sx:{width:`100%`,pb:`10px`,mb:`20px`,mt:`20px`},children:K(Z,{variant:`h5`,sx:{fontSize:24},children:`Schema Summary`})}),K(J,{sx:{width:`100%`,pb:`10px`,mb:`20px`},children:t.length===0?K(Z,{sx:{fontSize:18,color:`grey.600`},children:`No schema changes detected.`}):K(J,{sx:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(400px, 1fr))`,gap:`2vw`,p:`2.5vw`,width:`100%`,bgcolor:`lightgray`},children:t.map(e=>K(Gl,{title:e.data.name,node:e},e.id))})})]})}function Jl({checks:e,isLoading:t,error:n,selectedCheckId:r,onCheckSelect:i,onApprovalChange:a,onAction:o,onReorder:s,onDescriptionChange:c,onNameChange:l,onCreateCheck:u,getCheckTabs:d,getPrimaryActions:f,getSecondaryActions:p,disableApproval:m=!1,disabledApprovalTooltip:h,height:g=`100%`,listPaneSize:_=30,minListSize:v=200,maxListSize:y=500,listTitle:b,className:x}){let S=ot(),C=e??S.checks,w=t===void 0?S.isLoading:t,T=n??S.error,E=r??S.selectedCheckId,D=i??S.onSelectCheck,O=U(()=>C.map(e=>({id:e.check_id,name:e.name,type:e.type,description:e.description,isApproved:e.is_checked})),[C]),k=U(()=>C.find(e=>e.check_id===E),[C,E]),A=V(e=>{D?.(e)},[D]),j=V((e,t)=>{o?.(e,t)},[o]),ee=V(e=>{E&&c?.(E,e)},[E,c]),M=V(e=>{E&&l?.(E,e)},[E,l]);if(w)return K(J,{className:x,sx:{width:`100%`,height:g,display:`flex`,alignItems:`center`,justifyContent:`center`},children:K(ii,{})});if(T)return K(J,{className:x,sx:{width:`100%`,height:g,display:`flex`,alignItems:`center`,justifyContent:`center`},children:K(Z,{color:`error`,children:T})});if(C.length===0)return K(J,{className:x,sx:{width:`100%`,height:g,display:`flex`,alignItems:`center`,justifyContent:`center`},children:K(z,{title:`No checks yet`,description:`Create your first check to start validating your data.`,actionText:`Create Check`,onAction:u})});let N=k?d?.(k):void 0,P=k?f?.(k):void 0,te=k?p?.(k):void 0;return K(J,{className:x,sx:{width:`100%`,height:g},children:q(vt,{direction:`horizontal`,sizes:[_,100-_],minSizes:[v,200],maxSizes:[y,1/0],children:[K(J,{sx:{height:`100%`,overflow:`auto`},children:K(lt,{checks:O,selectedId:E,onCheckSelect:A,onApprovalChange:a,onReorder:s,disableApproval:m,disabledApprovalTooltip:h,title:b})}),K(J,{sx:{height:`100%`,overflow:`auto`},children:k?K(Ue,{checkId:k.check_id,name:k.name,type:k.type,description:k.description,isApproved:k.is_checked,tabs:N,primaryActions:P,secondaryActions:te,onAction:j,onDescriptionChange:ee,onNameChange:M}):K(J,{sx:{height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:K(Z,{sx:{color:`text.secondary`},children:`Select a check from the list to view details`})})})]})})}const Yl=Kn(Jl);Yl.displayName=`ChecksView`;const Xl=`0.2.0`;export{Ho as A,Ka as B,As as C,Zo as D,ws as E,Do as F,ka as H,vo as I,Xa as L,Fo as M,Po as N,es as O,jo as P,Ja as R,Bs as S,js as T,Oa as U,Ma as V,Mc as _,Vl as a,vc as b,Rl as c,Fl as d,Nl as f,rl as g,cl as h,Wl as i,Bo as j,ts as k,Ll as l,ll as m,Yl as n,Bl as o,Al as p,ql as r,zl as s,Xl as t,Il as u,xc as v,Ds as w,ec as x,yc as y,qa as z};
|
|
12
|
-
//# sourceMappingURL=src-DI-sLY25.js.map
|