@optifye/dashboard-core 6.12.15 → 6.12.16

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/index.js CHANGED
@@ -16848,6 +16848,7 @@ function useHlsStream(videoRef, { src, shouldPlay, onFatalError, hlsConfig }) {
16848
16848
  return url.includes(proxyBaseUrl);
16849
16849
  }
16850
16850
  };
16851
+ const isSnapshotStreamUrl = (url) => url.includes("/api/automation/snapshot/stream/");
16851
16852
  const getR2CameraUuid = (url) => {
16852
16853
  try {
16853
16854
  const parsed = new URL(url);
@@ -17436,11 +17437,16 @@ function useHlsStream(videoRef, { src, shouldPlay, onFatalError, hlsConfig }) {
17436
17437
  return;
17437
17438
  }
17438
17439
  if (Hls__default.default.isSupported() && !isNativeHlsRef.current) {
17440
+ const usesSnapshotStream = isSnapshotStreamUrl(resolvedHlsSrc);
17439
17441
  const mergedConfig = {
17440
17442
  ...HLS_CONFIG,
17441
17443
  ...hlsConfig,
17444
+ enableWorker: usesSnapshotStream ? false : hlsConfig?.enableWorker ?? HLS_CONFIG.enableWorker,
17442
17445
  xhrSetup: (xhr, url) => {
17443
17446
  const usesProxy = isProxyUrl(url);
17447
+ if (isSnapshotStreamUrl(url)) {
17448
+ xhr.withCredentials = true;
17449
+ }
17444
17450
  if (isR2WorkerUrl(url, r2WorkerDomain) || usesProxy) {
17445
17451
  if (isManifestUrl(url)) {
17446
17452
  xhr.open("GET", buildCacheBustedUrl(url), true);
@@ -17454,7 +17460,11 @@ function useHlsStream(videoRef, { src, shouldPlay, onFatalError, hlsConfig }) {
17454
17460
  const isR2Url = isR2WorkerUrl(context.url, r2WorkerDomain);
17455
17461
  const isManifestRequest = isManifestUrl(context.url);
17456
17462
  const usesProxy = isProxyUrl(context.url);
17463
+ const isSnapshotStream = isSnapshotStreamUrl(context.url);
17457
17464
  let requestUrl = context.url;
17465
+ if (isSnapshotStream) {
17466
+ initParams.credentials = "include";
17467
+ }
17458
17468
  if (isR2Url || usesProxy) {
17459
17469
  if (authToken) {
17460
17470
  initParams.headers = {
@@ -85847,6 +85857,246 @@ var streamProxyConfig = {
85847
85857
  responseLimit: false
85848
85858
  }
85849
85859
  };
85860
+ var MOBILE_SCROLL_THRESHOLD2 = 15;
85861
+ var MOBILE_BREAKPOINT_PX2 = 640;
85862
+ var sortWorkspaces = (left, right) => {
85863
+ if (left.line_id !== right.line_id) {
85864
+ return left.line_id.localeCompare(right.line_id);
85865
+ }
85866
+ const leftMatch = left.workspace_name.match(/WS(\d+)/);
85867
+ const rightMatch = right.workspace_name.match(/WS(\d+)/);
85868
+ if (leftMatch && rightMatch) {
85869
+ return parseInt(leftMatch[1], 10) - parseInt(rightMatch[1], 10);
85870
+ }
85871
+ return left.workspace_name.localeCompare(right.workspace_name, void 0, { numeric: true });
85872
+ };
85873
+ var RecentFlowSnapshotGrid = ({
85874
+ workspaces,
85875
+ videoStreamsByWorkspaceId,
85876
+ legend,
85877
+ className = ""
85878
+ }) => {
85879
+ const containerRef = React144.useRef(null);
85880
+ const readinessRef = React144.useRef(null);
85881
+ const [gridCols, setGridCols] = React144.useState(4);
85882
+ const [gridRows, setGridRows] = React144.useState(1);
85883
+ const [isMobileScrollableGrid, setIsMobileScrollableGrid] = React144.useState(false);
85884
+ const sortedWorkspaces = React144.useMemo(
85885
+ () => [...workspaces || []].sort(sortWorkspaces),
85886
+ [workspaces]
85887
+ );
85888
+ const effectiveLegend = legend || DEFAULT_EFFICIENCY_LEGEND;
85889
+ const displayMinuteBucket = Math.floor(Date.now() / 6e4);
85890
+ const expectedVideoCount = React144.useMemo(
85891
+ () => sortedWorkspaces.filter((workspace) => {
85892
+ const workspaceId = workspace.workspace_uuid || workspace.workspace_name;
85893
+ return Boolean(workspaceId && videoStreamsByWorkspaceId[workspaceId]?.hls_url);
85894
+ }).length,
85895
+ [sortedWorkspaces, videoStreamsByWorkspaceId]
85896
+ );
85897
+ const publishSnapshotReadiness = React144.useCallback((readyVideoCount) => {
85898
+ const status = {
85899
+ expectedVideoCount,
85900
+ readyVideoCount,
85901
+ status: expectedVideoCount === 0 ? "no_videos" : readyVideoCount >= expectedVideoCount ? "ready" : "loading",
85902
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
85903
+ };
85904
+ const isReady = expectedVideoCount > 0 && status.status === "ready";
85905
+ if (typeof window !== "undefined") {
85906
+ window.__OPTIFYE_SNAPSHOT_READY__ = isReady;
85907
+ window.__OPTIFYE_SNAPSHOT_VIDEO_STATUS__ = status;
85908
+ }
85909
+ const marker = readinessRef.current;
85910
+ if (marker) {
85911
+ marker.dataset.ready = isReady ? "true" : "false";
85912
+ marker.dataset.status = status.status;
85913
+ marker.dataset.expectedVideoCount = String(status.expectedVideoCount);
85914
+ marker.dataset.readyVideoCount = String(status.readyVideoCount);
85915
+ marker.dataset.updatedAt = status.updatedAt;
85916
+ }
85917
+ }, [expectedVideoCount]);
85918
+ const calculateOptimalGrid = React144.useCallback(() => {
85919
+ if (!containerRef.current) return;
85920
+ const containerPadding = 16;
85921
+ const rawContainerWidth = containerRef.current.clientWidth;
85922
+ const containerWidth = rawContainerWidth - containerPadding;
85923
+ const containerHeight = containerRef.current.clientHeight - containerPadding;
85924
+ const count = sortedWorkspaces.length;
85925
+ if (count === 0) {
85926
+ setGridCols(1);
85927
+ setGridRows(1);
85928
+ setIsMobileScrollableGrid(false);
85929
+ return;
85930
+ }
85931
+ const shouldUseMobileScroll = rawContainerWidth < MOBILE_BREAKPOINT_PX2 && count >= MOBILE_SCROLL_THRESHOLD2;
85932
+ const optimalLayouts = {
85933
+ 1: 1,
85934
+ 2: 2,
85935
+ 3: 3,
85936
+ 4: 2,
85937
+ 5: 3,
85938
+ 6: 3,
85939
+ 7: 4,
85940
+ 8: 4,
85941
+ 9: 3,
85942
+ 10: 5,
85943
+ 11: 4,
85944
+ 12: 4,
85945
+ 13: 5,
85946
+ 14: 5,
85947
+ 15: 5,
85948
+ 16: 4,
85949
+ 17: 6,
85950
+ 18: 6,
85951
+ 19: 5,
85952
+ 20: 5,
85953
+ 21: 7,
85954
+ 22: 6,
85955
+ 23: 6,
85956
+ 24: 6
85957
+ };
85958
+ let bestCols = optimalLayouts[count] || Math.ceil(Math.sqrt(count));
85959
+ const containerAspectRatio = containerWidth / containerHeight;
85960
+ const targetAspectRatio = 16 / 9;
85961
+ const gap = 8;
85962
+ if (containerAspectRatio > targetAspectRatio * 1.5 && count > 6) {
85963
+ bestCols = Math.min(bestCols + 1, Math.ceil(count / 2));
85964
+ }
85965
+ const minCellWidth = 100;
85966
+ const availableWidth = containerWidth - gap * (bestCols - 1);
85967
+ const cellWidth = availableWidth / bestCols;
85968
+ if (cellWidth < minCellWidth && bestCols > 1) {
85969
+ bestCols = Math.max(1, Math.floor((containerWidth + gap) / (minCellWidth + gap)));
85970
+ }
85971
+ setGridCols(bestCols);
85972
+ setGridRows(Math.ceil(count / bestCols));
85973
+ setIsMobileScrollableGrid(shouldUseMobileScroll);
85974
+ }, [sortedWorkspaces.length]);
85975
+ React144.useEffect(() => {
85976
+ calculateOptimalGrid();
85977
+ window.addEventListener("resize", calculateOptimalGrid);
85978
+ return () => window.removeEventListener("resize", calculateOptimalGrid);
85979
+ }, [calculateOptimalGrid]);
85980
+ React144.useEffect(() => {
85981
+ const attachedVideos = /* @__PURE__ */ new Set();
85982
+ const videoEvents = ["loadeddata", "canplay", "playing", "timeupdate", "error", "stalled"];
85983
+ const hasDecodedFrame = (video) => video.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA && video.videoWidth > 0 && video.videoHeight > 0;
85984
+ const updateReadiness = () => {
85985
+ const videos = Array.from(containerRef.current?.querySelectorAll("video") ?? []);
85986
+ const readyVideoCount = videos.filter(hasDecodedFrame).length;
85987
+ publishSnapshotReadiness(Math.min(readyVideoCount, expectedVideoCount));
85988
+ for (const video of videos) {
85989
+ if (attachedVideos.has(video)) continue;
85990
+ attachedVideos.add(video);
85991
+ for (const eventName of videoEvents) {
85992
+ video.addEventListener(eventName, updateReadiness);
85993
+ }
85994
+ }
85995
+ };
85996
+ publishSnapshotReadiness(0);
85997
+ updateReadiness();
85998
+ const intervalId = window.setInterval(updateReadiness, 250);
85999
+ return () => {
86000
+ window.clearInterval(intervalId);
86001
+ for (const video of attachedVideos) {
86002
+ for (const eventName of videoEvents) {
86003
+ video.removeEventListener(eventName, updateReadiness);
86004
+ }
86005
+ }
86006
+ if (typeof window !== "undefined") {
86007
+ window.__OPTIFYE_SNAPSHOT_READY__ = false;
86008
+ window.__OPTIFYE_SNAPSHOT_VIDEO_STATUS__ = void 0;
86009
+ }
86010
+ };
86011
+ }, [expectedVideoCount, publishSnapshotReadiness]);
86012
+ if (!sortedWorkspaces.length) {
86013
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
86014
+ /* @__PURE__ */ jsxRuntime.jsx(
86015
+ "div",
86016
+ {
86017
+ ref: readinessRef,
86018
+ "data-testid": "snapshot-video-readiness",
86019
+ "data-ready": "false",
86020
+ "data-status": "no_videos",
86021
+ "data-expected-video-count": "0",
86022
+ "data-ready-video-count": "0",
86023
+ hidden: true
86024
+ }
86025
+ ),
86026
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-h-[320px] items-center justify-center rounded-md border border-dashed border-slate-300 bg-slate-50 text-sm font-medium text-slate-500", children: "No workstation snapshot available" })
86027
+ ] });
86028
+ }
86029
+ return /* @__PURE__ */ jsxRuntime.jsxs(
86030
+ "div",
86031
+ {
86032
+ "aria-label": "Recent-flow workstation snapshot",
86033
+ className: `relative h-full min-h-0 w-full overflow-hidden bg-slate-50/30 ${className}`,
86034
+ children: [
86035
+ /* @__PURE__ */ jsxRuntime.jsx(
86036
+ "div",
86037
+ {
86038
+ ref: readinessRef,
86039
+ "data-testid": "snapshot-video-readiness",
86040
+ "data-ready": "false",
86041
+ "data-status": expectedVideoCount === 0 ? "no_videos" : "loading",
86042
+ "data-expected-video-count": expectedVideoCount,
86043
+ "data-ready-video-count": "0",
86044
+ hidden: true
86045
+ }
86046
+ ),
86047
+ /* @__PURE__ */ jsxRuntime.jsx(
86048
+ "div",
86049
+ {
86050
+ ref: containerRef,
86051
+ "data-testid": "video-grid-scroll-container",
86052
+ "data-mobile-scrollable": isMobileScrollableGrid ? "true" : "false",
86053
+ className: `absolute inset-0 w-full overflow-x-hidden px-1 py-1 sm:px-2 sm:py-2 ${isMobileScrollableGrid ? "overflow-y-auto" : "overflow-hidden"}`,
86054
+ children: /* @__PURE__ */ jsxRuntime.jsx(
86055
+ "div",
86056
+ {
86057
+ "data-testid": "video-grid-layout",
86058
+ className: `grid min-w-0 w-full gap-1.5 sm:gap-2 ${isMobileScrollableGrid ? "content-start" : "h-full"}`,
86059
+ style: {
86060
+ gridTemplateColumns: `repeat(${gridCols}, minmax(0, 1fr))`,
86061
+ gridTemplateRows: isMobileScrollableGrid ? void 0 : `repeat(${gridRows}, 1fr)`,
86062
+ gridAutoFlow: "row"
86063
+ },
86064
+ children: sortedWorkspaces.map((workspace) => {
86065
+ const workspaceId = workspace.workspace_uuid || workspace.workspace_name;
86066
+ const stream = workspaceId ? videoStreamsByWorkspaceId[workspaceId] : null;
86067
+ const hlsUrl = stream?.hls_url || "";
86068
+ return /* @__PURE__ */ jsxRuntime.jsx(
86069
+ "div",
86070
+ {
86071
+ "data-workspace-id": workspaceId,
86072
+ className: isMobileScrollableGrid ? "workspace-card relative min-w-0 w-full aspect-video min-h-[92px]" : "workspace-card relative min-w-0 w-full h-full",
86073
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0", children: /* @__PURE__ */ jsxRuntime.jsx(
86074
+ VideoCard,
86075
+ {
86076
+ workspace,
86077
+ hlsUrl,
86078
+ shouldPlay: Boolean(hlsUrl),
86079
+ legend: effectiveLegend,
86080
+ cropping: stream?.crop || void 0,
86081
+ canvasFps: 10,
86082
+ useRAF: false,
86083
+ displayMinuteBucket,
86084
+ displayName: workspace.displayName || workspace.workspace_name,
86085
+ compact: true
86086
+ }
86087
+ ) })
86088
+ },
86089
+ `${workspace.line_id}-${workspaceId}`
86090
+ );
86091
+ })
86092
+ }
86093
+ )
86094
+ }
86095
+ )
86096
+ ]
86097
+ }
86098
+ );
86099
+ };
85850
86100
 
85851
86101
  exports.ACTION_FAMILIES = ACTION_FAMILIES;
85852
86102
  exports.ACTION_NAMES = ACTION_NAMES;
@@ -86003,6 +86253,7 @@ exports.PrefetchStatus = PrefetchStatus;
86003
86253
  exports.PrefetchTimeoutError = PrefetchTimeoutError;
86004
86254
  exports.ProfileView = ProfileView_default;
86005
86255
  exports.ROOT_DASHBOARD_EVENT_NAMES = ROOT_DASHBOARD_EVENT_NAMES;
86256
+ exports.RecentFlowSnapshotGrid = RecentFlowSnapshotGrid;
86006
86257
  exports.RegistryProvider = RegistryProvider;
86007
86258
  exports.RoleBadge = RoleBadge;
86008
86259
  exports.S3ClipsService = S3ClipsSupabaseService;
package/dist/index.mjs CHANGED
@@ -16819,6 +16819,7 @@ function useHlsStream(videoRef, { src, shouldPlay, onFatalError, hlsConfig }) {
16819
16819
  return url.includes(proxyBaseUrl);
16820
16820
  }
16821
16821
  };
16822
+ const isSnapshotStreamUrl = (url) => url.includes("/api/automation/snapshot/stream/");
16822
16823
  const getR2CameraUuid = (url) => {
16823
16824
  try {
16824
16825
  const parsed = new URL(url);
@@ -17407,11 +17408,16 @@ function useHlsStream(videoRef, { src, shouldPlay, onFatalError, hlsConfig }) {
17407
17408
  return;
17408
17409
  }
17409
17410
  if (Hls.isSupported() && !isNativeHlsRef.current) {
17411
+ const usesSnapshotStream = isSnapshotStreamUrl(resolvedHlsSrc);
17410
17412
  const mergedConfig = {
17411
17413
  ...HLS_CONFIG,
17412
17414
  ...hlsConfig,
17415
+ enableWorker: usesSnapshotStream ? false : hlsConfig?.enableWorker ?? HLS_CONFIG.enableWorker,
17413
17416
  xhrSetup: (xhr, url) => {
17414
17417
  const usesProxy = isProxyUrl(url);
17418
+ if (isSnapshotStreamUrl(url)) {
17419
+ xhr.withCredentials = true;
17420
+ }
17415
17421
  if (isR2WorkerUrl(url, r2WorkerDomain) || usesProxy) {
17416
17422
  if (isManifestUrl(url)) {
17417
17423
  xhr.open("GET", buildCacheBustedUrl(url), true);
@@ -17425,7 +17431,11 @@ function useHlsStream(videoRef, { src, shouldPlay, onFatalError, hlsConfig }) {
17425
17431
  const isR2Url = isR2WorkerUrl(context.url, r2WorkerDomain);
17426
17432
  const isManifestRequest = isManifestUrl(context.url);
17427
17433
  const usesProxy = isProxyUrl(context.url);
17434
+ const isSnapshotStream = isSnapshotStreamUrl(context.url);
17428
17435
  let requestUrl = context.url;
17436
+ if (isSnapshotStream) {
17437
+ initParams.credentials = "include";
17438
+ }
17429
17439
  if (isR2Url || usesProxy) {
17430
17440
  if (authToken) {
17431
17441
  initParams.headers = {
@@ -85818,5 +85828,245 @@ var streamProxyConfig = {
85818
85828
  responseLimit: false
85819
85829
  }
85820
85830
  };
85831
+ var MOBILE_SCROLL_THRESHOLD2 = 15;
85832
+ var MOBILE_BREAKPOINT_PX2 = 640;
85833
+ var sortWorkspaces = (left, right) => {
85834
+ if (left.line_id !== right.line_id) {
85835
+ return left.line_id.localeCompare(right.line_id);
85836
+ }
85837
+ const leftMatch = left.workspace_name.match(/WS(\d+)/);
85838
+ const rightMatch = right.workspace_name.match(/WS(\d+)/);
85839
+ if (leftMatch && rightMatch) {
85840
+ return parseInt(leftMatch[1], 10) - parseInt(rightMatch[1], 10);
85841
+ }
85842
+ return left.workspace_name.localeCompare(right.workspace_name, void 0, { numeric: true });
85843
+ };
85844
+ var RecentFlowSnapshotGrid = ({
85845
+ workspaces,
85846
+ videoStreamsByWorkspaceId,
85847
+ legend,
85848
+ className = ""
85849
+ }) => {
85850
+ const containerRef = useRef(null);
85851
+ const readinessRef = useRef(null);
85852
+ const [gridCols, setGridCols] = useState(4);
85853
+ const [gridRows, setGridRows] = useState(1);
85854
+ const [isMobileScrollableGrid, setIsMobileScrollableGrid] = useState(false);
85855
+ const sortedWorkspaces = useMemo(
85856
+ () => [...workspaces || []].sort(sortWorkspaces),
85857
+ [workspaces]
85858
+ );
85859
+ const effectiveLegend = legend || DEFAULT_EFFICIENCY_LEGEND;
85860
+ const displayMinuteBucket = Math.floor(Date.now() / 6e4);
85861
+ const expectedVideoCount = useMemo(
85862
+ () => sortedWorkspaces.filter((workspace) => {
85863
+ const workspaceId = workspace.workspace_uuid || workspace.workspace_name;
85864
+ return Boolean(workspaceId && videoStreamsByWorkspaceId[workspaceId]?.hls_url);
85865
+ }).length,
85866
+ [sortedWorkspaces, videoStreamsByWorkspaceId]
85867
+ );
85868
+ const publishSnapshotReadiness = useCallback((readyVideoCount) => {
85869
+ const status = {
85870
+ expectedVideoCount,
85871
+ readyVideoCount,
85872
+ status: expectedVideoCount === 0 ? "no_videos" : readyVideoCount >= expectedVideoCount ? "ready" : "loading",
85873
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
85874
+ };
85875
+ const isReady = expectedVideoCount > 0 && status.status === "ready";
85876
+ if (typeof window !== "undefined") {
85877
+ window.__OPTIFYE_SNAPSHOT_READY__ = isReady;
85878
+ window.__OPTIFYE_SNAPSHOT_VIDEO_STATUS__ = status;
85879
+ }
85880
+ const marker = readinessRef.current;
85881
+ if (marker) {
85882
+ marker.dataset.ready = isReady ? "true" : "false";
85883
+ marker.dataset.status = status.status;
85884
+ marker.dataset.expectedVideoCount = String(status.expectedVideoCount);
85885
+ marker.dataset.readyVideoCount = String(status.readyVideoCount);
85886
+ marker.dataset.updatedAt = status.updatedAt;
85887
+ }
85888
+ }, [expectedVideoCount]);
85889
+ const calculateOptimalGrid = useCallback(() => {
85890
+ if (!containerRef.current) return;
85891
+ const containerPadding = 16;
85892
+ const rawContainerWidth = containerRef.current.clientWidth;
85893
+ const containerWidth = rawContainerWidth - containerPadding;
85894
+ const containerHeight = containerRef.current.clientHeight - containerPadding;
85895
+ const count = sortedWorkspaces.length;
85896
+ if (count === 0) {
85897
+ setGridCols(1);
85898
+ setGridRows(1);
85899
+ setIsMobileScrollableGrid(false);
85900
+ return;
85901
+ }
85902
+ const shouldUseMobileScroll = rawContainerWidth < MOBILE_BREAKPOINT_PX2 && count >= MOBILE_SCROLL_THRESHOLD2;
85903
+ const optimalLayouts = {
85904
+ 1: 1,
85905
+ 2: 2,
85906
+ 3: 3,
85907
+ 4: 2,
85908
+ 5: 3,
85909
+ 6: 3,
85910
+ 7: 4,
85911
+ 8: 4,
85912
+ 9: 3,
85913
+ 10: 5,
85914
+ 11: 4,
85915
+ 12: 4,
85916
+ 13: 5,
85917
+ 14: 5,
85918
+ 15: 5,
85919
+ 16: 4,
85920
+ 17: 6,
85921
+ 18: 6,
85922
+ 19: 5,
85923
+ 20: 5,
85924
+ 21: 7,
85925
+ 22: 6,
85926
+ 23: 6,
85927
+ 24: 6
85928
+ };
85929
+ let bestCols = optimalLayouts[count] || Math.ceil(Math.sqrt(count));
85930
+ const containerAspectRatio = containerWidth / containerHeight;
85931
+ const targetAspectRatio = 16 / 9;
85932
+ const gap = 8;
85933
+ if (containerAspectRatio > targetAspectRatio * 1.5 && count > 6) {
85934
+ bestCols = Math.min(bestCols + 1, Math.ceil(count / 2));
85935
+ }
85936
+ const minCellWidth = 100;
85937
+ const availableWidth = containerWidth - gap * (bestCols - 1);
85938
+ const cellWidth = availableWidth / bestCols;
85939
+ if (cellWidth < minCellWidth && bestCols > 1) {
85940
+ bestCols = Math.max(1, Math.floor((containerWidth + gap) / (minCellWidth + gap)));
85941
+ }
85942
+ setGridCols(bestCols);
85943
+ setGridRows(Math.ceil(count / bestCols));
85944
+ setIsMobileScrollableGrid(shouldUseMobileScroll);
85945
+ }, [sortedWorkspaces.length]);
85946
+ useEffect(() => {
85947
+ calculateOptimalGrid();
85948
+ window.addEventListener("resize", calculateOptimalGrid);
85949
+ return () => window.removeEventListener("resize", calculateOptimalGrid);
85950
+ }, [calculateOptimalGrid]);
85951
+ useEffect(() => {
85952
+ const attachedVideos = /* @__PURE__ */ new Set();
85953
+ const videoEvents = ["loadeddata", "canplay", "playing", "timeupdate", "error", "stalled"];
85954
+ const hasDecodedFrame = (video) => video.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA && video.videoWidth > 0 && video.videoHeight > 0;
85955
+ const updateReadiness = () => {
85956
+ const videos = Array.from(containerRef.current?.querySelectorAll("video") ?? []);
85957
+ const readyVideoCount = videos.filter(hasDecodedFrame).length;
85958
+ publishSnapshotReadiness(Math.min(readyVideoCount, expectedVideoCount));
85959
+ for (const video of videos) {
85960
+ if (attachedVideos.has(video)) continue;
85961
+ attachedVideos.add(video);
85962
+ for (const eventName of videoEvents) {
85963
+ video.addEventListener(eventName, updateReadiness);
85964
+ }
85965
+ }
85966
+ };
85967
+ publishSnapshotReadiness(0);
85968
+ updateReadiness();
85969
+ const intervalId = window.setInterval(updateReadiness, 250);
85970
+ return () => {
85971
+ window.clearInterval(intervalId);
85972
+ for (const video of attachedVideos) {
85973
+ for (const eventName of videoEvents) {
85974
+ video.removeEventListener(eventName, updateReadiness);
85975
+ }
85976
+ }
85977
+ if (typeof window !== "undefined") {
85978
+ window.__OPTIFYE_SNAPSHOT_READY__ = false;
85979
+ window.__OPTIFYE_SNAPSHOT_VIDEO_STATUS__ = void 0;
85980
+ }
85981
+ };
85982
+ }, [expectedVideoCount, publishSnapshotReadiness]);
85983
+ if (!sortedWorkspaces.length) {
85984
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
85985
+ /* @__PURE__ */ jsx(
85986
+ "div",
85987
+ {
85988
+ ref: readinessRef,
85989
+ "data-testid": "snapshot-video-readiness",
85990
+ "data-ready": "false",
85991
+ "data-status": "no_videos",
85992
+ "data-expected-video-count": "0",
85993
+ "data-ready-video-count": "0",
85994
+ hidden: true
85995
+ }
85996
+ ),
85997
+ /* @__PURE__ */ jsx("div", { className: "flex min-h-[320px] items-center justify-center rounded-md border border-dashed border-slate-300 bg-slate-50 text-sm font-medium text-slate-500", children: "No workstation snapshot available" })
85998
+ ] });
85999
+ }
86000
+ return /* @__PURE__ */ jsxs(
86001
+ "div",
86002
+ {
86003
+ "aria-label": "Recent-flow workstation snapshot",
86004
+ className: `relative h-full min-h-0 w-full overflow-hidden bg-slate-50/30 ${className}`,
86005
+ children: [
86006
+ /* @__PURE__ */ jsx(
86007
+ "div",
86008
+ {
86009
+ ref: readinessRef,
86010
+ "data-testid": "snapshot-video-readiness",
86011
+ "data-ready": "false",
86012
+ "data-status": expectedVideoCount === 0 ? "no_videos" : "loading",
86013
+ "data-expected-video-count": expectedVideoCount,
86014
+ "data-ready-video-count": "0",
86015
+ hidden: true
86016
+ }
86017
+ ),
86018
+ /* @__PURE__ */ jsx(
86019
+ "div",
86020
+ {
86021
+ ref: containerRef,
86022
+ "data-testid": "video-grid-scroll-container",
86023
+ "data-mobile-scrollable": isMobileScrollableGrid ? "true" : "false",
86024
+ className: `absolute inset-0 w-full overflow-x-hidden px-1 py-1 sm:px-2 sm:py-2 ${isMobileScrollableGrid ? "overflow-y-auto" : "overflow-hidden"}`,
86025
+ children: /* @__PURE__ */ jsx(
86026
+ "div",
86027
+ {
86028
+ "data-testid": "video-grid-layout",
86029
+ className: `grid min-w-0 w-full gap-1.5 sm:gap-2 ${isMobileScrollableGrid ? "content-start" : "h-full"}`,
86030
+ style: {
86031
+ gridTemplateColumns: `repeat(${gridCols}, minmax(0, 1fr))`,
86032
+ gridTemplateRows: isMobileScrollableGrid ? void 0 : `repeat(${gridRows}, 1fr)`,
86033
+ gridAutoFlow: "row"
86034
+ },
86035
+ children: sortedWorkspaces.map((workspace) => {
86036
+ const workspaceId = workspace.workspace_uuid || workspace.workspace_name;
86037
+ const stream = workspaceId ? videoStreamsByWorkspaceId[workspaceId] : null;
86038
+ const hlsUrl = stream?.hls_url || "";
86039
+ return /* @__PURE__ */ jsx(
86040
+ "div",
86041
+ {
86042
+ "data-workspace-id": workspaceId,
86043
+ className: isMobileScrollableGrid ? "workspace-card relative min-w-0 w-full aspect-video min-h-[92px]" : "workspace-card relative min-w-0 w-full h-full",
86044
+ children: /* @__PURE__ */ jsx("div", { className: "absolute inset-0", children: /* @__PURE__ */ jsx(
86045
+ VideoCard,
86046
+ {
86047
+ workspace,
86048
+ hlsUrl,
86049
+ shouldPlay: Boolean(hlsUrl),
86050
+ legend: effectiveLegend,
86051
+ cropping: stream?.crop || void 0,
86052
+ canvasFps: 10,
86053
+ useRAF: false,
86054
+ displayMinuteBucket,
86055
+ displayName: workspace.displayName || workspace.workspace_name,
86056
+ compact: true
86057
+ }
86058
+ ) })
86059
+ },
86060
+ `${workspace.line_id}-${workspaceId}`
86061
+ );
86062
+ })
86063
+ }
86064
+ )
86065
+ }
86066
+ )
86067
+ ]
86068
+ }
86069
+ );
86070
+ };
85821
86071
 
85822
- export { ACTION_FAMILIES, ACTION_NAMES, AIAgentView_default as AIAgentView, AcceptInvite, AcceptInviteView_default as AcceptInviteView, AdvancedFilterDialog, AdvancedFilterPanel, AudioService, AuthCallback, AuthCallbackView_default as AuthCallbackView, AuthProvider, AuthService, AuthenticatedBottleneckClipsView, AuthenticatedFactoryView, AuthenticatedHelpView, AuthenticatedHomeView, AuthenticatedShiftsView, AuthenticatedTargetsView, AuthenticatedTicketsView, AuthenticatedWorkspaceHealthView, AvatarUpload, AxelNotificationPopup, AxelOrb, BackButton, BackButtonMinimal, BarChart, BaseHistoryCalendar, BottleneckClipsModal, BottleneckClipsView_default as BottleneckClipsView, BottlenecksContent, BreakNotificationPopup, CachePrefetchStatus, Card2 as Card, CardContent2 as CardContent, CardDescription2 as CardDescription, CardFooter2 as CardFooter, CardHeader2 as CardHeader, CardTitle2 as CardTitle, ChangeRoleDialog, ClipFilterProvider, ClipsCostView_default as ClipsCostView, CompactWorkspaceHealthCard, ConfirmRemoveUserDialog, CongratulationsOverlay, CroppedHlsVideoPlayer, CroppedVideoPlayer, CycleTimeChart, CycleTimeOverTimeChart, DEFAULT_ANALYTICS_CONFIG, DEFAULT_AUTH_CONFIG, DEFAULT_CONFIG, DEFAULT_DATABASE_CONFIG, DEFAULT_DATE_TIME_CONFIG, DEFAULT_ENDPOINTS_CONFIG, DEFAULT_ENTITY_CONFIG, DEFAULT_HOME_VIEW_CONFIG, DEFAULT_MAP_VIEW_CONFIG, DEFAULT_SHIFT_CONFIG, DEFAULT_SHIFT_DATA, DEFAULT_THEME_CONFIG, DEFAULT_VIDEO_CONFIG, DEFAULT_WORKSPACE_CONFIG, DEFAULT_WORKSPACE_POSITIONS, DashboardHeader, DashboardLayout, DashboardOverridesProvider, DashboardProvider, DateDisplay_default as DateDisplay, DateTimeDisplay, DebugAuth, DebugAuthView_default as DebugAuthView, DetailedHealthStatus, DiagnosisVideoModal, EFFICIENCY_ON_TRACK_THRESHOLD, EmptyStateMessage, EncouragementOverlay, FactoryAssignmentDropdown, FactoryView_default as FactoryView, FileManagerFilters, FilterDialogTrigger, FirstTimeLoginDebug, FirstTimeLoginHandler, FittingTitle, GaugeChart, GridComponentsPlaceholder, HamburgerButton, Header, HealthDateShiftSelector, HealthStatusGrid, HealthStatusIndicator, HelpView_default as HelpView, HlsVideoPlayer, HomeView_default as HomeView, HourlyOutputChart2 as HourlyOutputChart, HourlyUptimeChart, ISTTimer_default as ISTTimer, IdleTimeVlmConfigProvider, ImprovementCenterView_default as ImprovementCenterView, InlineEditableText, InteractiveOnboardingTour, InvitationService, InvitationsTable, InviteUserDialog, KPICard, KPIDetailView_default as KPIDetailView, KPIGrid, KPIHeader, KPISection, KPIsOverviewView_default as KPIsOverviewView, LINE_1_UUID, LINE_2_UUID, LargeOutputProgressChart, LeaderboardDetailView_default as LeaderboardDetailView, Legend5 as Legend, LineAssignmentDropdown, LineChart, LineHistoryCalendar, LineMonthlyHistory, LineMonthlyPdfGenerator, LinePdfExportButton, LinePdfGenerator, LineWhatsAppShareButton, LinesService, LiveTimer, LoadingInline, LoadingOverlay_default as LoadingOverlay, LoadingPage_default as LoadingPage, LoadingSkeleton, LoadingState, LoginPage, LoginView_default as LoginView, Logo, MainLayout, MapGridView, MetricCard_default as MetricCard, MinimalOnboardingPopup, MobileMenuProvider, NewClipsNotification, NoWorkspaceData, OnboardingDemo, OnboardingTour, OptifyeAgentClient, OptifyeLogoLoader_default as OptifyeLogoLoader, OutputProgressChart, PageHeader, PieChart4 as PieChart, PlantHeadView_default as PlantHeadView, PlayPauseIndicator, PrefetchConfigurationError, PrefetchError, PrefetchEvents, PrefetchStatus, PrefetchTimeoutError, ProfileView_default as ProfileView, ROOT_DASHBOARD_EVENT_NAMES, RegistryProvider, RoleBadge, S3ClipsSupabaseService as S3ClipsService, S3Service, SENTRY_HANDLED_EVENT_SESSION_LIMIT, SENTRY_HANDLED_EVENT_WINDOW_MS, SENTRY_QUOTA_STORAGE_KEY, SKUManagementView, SOPComplianceChart, SSEChatClient, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SessionTracker, SessionTrackingContext, SessionTrackingProvider, SettingsPopup, ShiftDisplay_default as ShiftDisplay, ShiftsView_default as ShiftsView, SideNavBar, SignupWithInvitation, SilentErrorBoundary, SimpleOnboardingPopup, SingleVideoStream_default as SingleVideoStream, Skeleton, SubscriptionManager, SubscriptionManagerProvider, SupabaseProvider, SupervisorDropdown_default as SupervisorDropdown, SupervisorManagementView_default as SupervisorManagementView, SupervisorService, TargetWorkspaceGrid, TargetsView_default as TargetsView, TeamManagementView_default as TeamManagementView, ThreadSidebar, TicketHistory_default as TicketHistory, TicketHistoryService, TicketsView_default as TicketsView, TimeDisplay_default as TimeDisplay, TimePickerDropdown, Timer_default as Timer, TimezoneProvider, TimezoneService, UptimeDonutChart, UptimeLineChart, UptimeMetricCards, UserAvatar, UserManagementService, UserManagementTable, UserService, UserUsageDetailModal, UserUsageStats, VideoCard, VideoGridView, VideoPlayer, VideoPreloader, WORKSPACE_POSITIONS, WhatsAppShareButton, WorkspaceCard, WorkspaceCycleTimeMetricCards, WorkspaceDetailView_default as WorkspaceDetailView, WorkspaceDisplayNameExample, WorkspaceGrid, WorkspaceGridItem, WorkspaceHealthCard, WorkspaceHealthView_default as WorkspaceHealthView, WorkspaceHistoryCalendar, WorkspaceMetricCards, WorkspaceMetricCardsImpl, WorkspaceMonthlyDataFetcher, WorkspaceMonthlyHistory, WorkspaceMonthlyPdfGenerator, WorkspacePdfExportButton, WorkspacePdfGenerator, WorkspaceWhatsAppShareButton, actionService, addSentryBreadcrumb, aggregateKPIsFromLineMetricsRows, alertsService, apiUtils, areAllLinesOnSameShift, authCoreService, authOTPService, authRateLimitService, awardsService, buildDateKey, buildKPIsFromLineMetricsRow, buildKpiLineHierarchy, buildLineSkuBreakdown, buildShiftGroupsKey, canRoleAccessDashboardPath, canRoleAccessTeamManagement, canRoleAssignFactories, canRoleAssignLines, canRoleChangeRole, canRoleInviteRole, canRoleManageCompany, canRoleManageTargets, canRoleManageUsers, canRoleRemoveUser, canRoleViewClipsCost, canRoleViewUsageStats, captureHandledFrontendException, captureSentryException, captureSentryMessage, checkRateLimit2 as checkRateLimit, clearAllRateLimits2 as clearAllRateLimits, clearRateLimit2 as clearRateLimit, clearS3VideoCache, clearS3VideoFromCache, clearSentryContext, clearWorkspaceDisplayNamesCache, cn, combineLineMetricsRows, countRealSkus, createDefaultKPIs, createInvitationService, createLinesService, createSessionTracker, createStorageService, createStreamProxyHandler, createSupabaseClient, createSupervisorService, createThrottledReload, createUserManagementService, createUserService, dashboardService, deleteThread, fetchIdleTimeReasons, fetchLineDummySkuId, fetchLineSkuCatalog, filterDataByDateKeyRange, filterRealSkuBreakdown, forceRefreshWorkspaceDisplayNames, formatAwardMonth, formatDateInZone, formatDateKeyForDisplay, formatDateTimeInZone, formatDuration2 as formatDuration, formatISTDate, formatIdleTime, formatRangeLabel, formatReasonLabel, formatRelativeTime, formatTimeInZone, fromUrlFriendlyName, getActionDisplayName, getActiveShift, getAllLineDisplayNames, getAllThreadMessages, getAllWorkspaceDisplayNamesAsync, getAllWorkspaceDisplayNamesSnapshot, getAnonClient, getAssignableRoles, getAssignmentColumnLabel, getAvailableShiftIds, getAwardBadgeType, getAwardDescription, getAwardTitle, getBrowserName, getCameraNumber, getCompanyMetricsTableName, getConfigurableShortWorkspaceDisplayName, getConfigurableWorkspaceDisplayName, getConfiguredLineIds, getCoreSessionRecordingProperties, getCoreSessionReplayUrl, getCurrentShift, getCurrentShiftForLine, getCurrentTimeInZone, getCurrentWeekFullRange, getCurrentWeekToDateRange, getDashboardHeaderTimeInZone, getDateKeyFromDate, getDateKeyFromValue, getDayDateKey, getDaysDifferenceInZone, getDefaultCameraStreamUrl, getDefaultLineId, getDefaultTabForWorkspace, getInitials, getLineDisplayName, getManufacturingInsights, getMetricsTablePrefix, getMonthKeyBounds, getMonthWeekRanges, getMonthlyTrendComparisonLabel, getNextUpdateInterval, getOperationalDate, getRoleAssignmentKind, getRoleDescription, getRoleLabel, getRoleMetadata, getRoleNavPaths, getS3SignedUrl, getS3VideoSrc, getShiftData, getShiftNameById, getShiftWorkDurationSeconds, getShortShiftName, getShortWorkspaceDisplayName, getShortWorkspaceDisplayNameAsync, getStoredWorkspaceMappings, getSubscriptionManager, getThreadMessages, getUniformShiftGroup, getUserThreads, getUserThreadsPaginated, getVisibleRolesForCurrentUser, getWorkspaceDisplayName, getWorkspaceDisplayNameAsync, getWorkspaceDisplayNamesMap, getWorkspaceFromUrl, getWorkspaceNavigationParams, groupLinesByShift, hasAnyShiftData, identifyCoreUser, initializeCoreMixpanel, isEfficiencyOnTrack, isFactoryScopedRole, isFullMonthRange, isIgnorableFrontendError, isLegacyConfiguration, isLoopbackHostname, isPrefetchError, isRealSku, isRecentFlowVideoGridMetricMode, isSafari, isSupervisorRole, isTransitionPeriod, isUrlPermanentlyFailed, isValidFactoryViewConfiguration, isValidLineInfoPayload, isValidPrefetchParams, isValidPrefetchStatus, isValidWorkspaceDetailedMetricsPayload, isValidWorkspaceMetricsPayload, isWipGatedVideoGridMetricMode, isWorkspaceDisplayNamesLoaded, isWorkspaceDisplayNamesLoading, lineLeaderboardService, linesService, mergeWithDefaultConfig, migrateLegacyConfiguration, normalizeActionFamily, normalizeDateKeyRange, normalizeDateKeyRangeUnbounded, normalizeRoleLevel, normalizeVideoGridMetricMode, optifyeAgentClient, parseDateKeyToDate, parseS3Uri, pickPreferredLineMetricsRow, preInitializeWorkspaceDisplayNames, preloadS3Video, preloadS3VideoUrl, preloadS3VideosUrl, preloadVideoUrl, preloadVideosUrl, qualityService, realtimeService, refreshWorkspaceDisplayNames, resetCoreMixpanel, resetFailedUrl, resetSentryQuotaForTests, resetSubscriptionManager, resolveDefaultSkuId, resolveLiveSkuId, s3VideoPreloader, selectPreferredLineMetricsRow, setSentryUserContext, setSentryWorkspaceContext, shouldEnableLocalDevTestLogin, shuffleArray, simulateApiDelay, skuService, startCoreSessionRecording, stopCoreSessionRecording, storeWorkspaceMapping, streamProxyConfig, subscribeWorkspaceDisplayNames, throttledReloadDashboard, toUrlFriendlyName, trackCoreEvent, trackCorePageView, transformToChartData, updateThreadTitle, upsertWorkspaceDisplayNameInCache, useAccessControl, useActiveBreaks, useActiveLineId, useAllWorkspaceMetrics, useAnalyticsConfig, useAppTimezone, useAudioService, useAuth, useAuthConfig, useAxelNotifications, useCanSaveTargets, useClipFilter, useClipTypes, useClipTypesWithCounts, useClipsInit, useCompanyClipsCost, useCompanyFastSlowClipFiltersEnabled, useCompanyHasVlmEnabledLine, useCompanyUsersUsage, useComponentOverride, useCustomConfig, useDashboardConfig, useDashboardMetrics, useDatabaseConfig, useDateFormatter, useDateTimeConfig, useDynamicShiftConfig, useEndpointsConfig, useEntityConfig, useFactoryOverviewMetrics, useFeatureFlags, useFormatNumber, useHasLineAccess, useHideMobileHeader, useHistoricWorkspaceMetrics, useHlsStream, useHlsStreamWithCropping, useHookOverride, useHourEndTimer, useHourlyTargetAchievements, useHourlyTargetMisses, useIdleTimeClipClassifications, useIdleTimeReasons, useIdleTimeVlmConfig, useKpiTrends, useLeaderboardMetrics, useLineDetailedMetrics, useLineKPIs, useLineMetrics, useLineShiftConfig, useLineSupervisor, useLineWorkspaceMetrics, useLines, useMessages, useMetrics, useMobileMenu, useMonthlyTrend, useMultiLineShiftConfigs, useNavigation, useOperationalShiftKey, useOptionalSupabase, useOverrides, usePageOverride, usePrefetchClipCounts, useRealtimeLineMetrics, useRegistry, useSKUs, useSessionKeepAlive, useSessionTracking, useSessionTrackingContext, useShiftConfig, useShiftGroups, useShifts, useSubscriptionManager, useSubscriptionManagerSafe, useSupabase, useSupabaseClient, useSupervisorsByLineIds, useTargets, useTeamManagementPermissions, useTheme, useThemeConfig, useThreads, useTicketHistory, useTimezoneContext, useUserLineAccess, useUserUsage, useVideoConfig, useWorkspaceConfig, useWorkspaceDetailedMetrics, useWorkspaceDisplayName, useWorkspaceDisplayNames, useWorkspaceDisplayNamesMap, useWorkspaceHealthById, useWorkspaceHealthLastSeen, useWorkspaceHealthStatus, useWorkspaceMetrics, useWorkspaceNavigation, useWorkspaceOperators, useWorkspaceUptimeTimeline, useWorkspaceVideoStreams, userService, videoPrefetchManager, videoPreloader, weeklyTopPerformerService, whatsappService, withAccessControl, withAuth, withRegistry, withTimezone, workspaceHealthService, workspaceService };
86072
+ export { ACTION_FAMILIES, ACTION_NAMES, AIAgentView_default as AIAgentView, AcceptInvite, AcceptInviteView_default as AcceptInviteView, AdvancedFilterDialog, AdvancedFilterPanel, AudioService, AuthCallback, AuthCallbackView_default as AuthCallbackView, AuthProvider, AuthService, AuthenticatedBottleneckClipsView, AuthenticatedFactoryView, AuthenticatedHelpView, AuthenticatedHomeView, AuthenticatedShiftsView, AuthenticatedTargetsView, AuthenticatedTicketsView, AuthenticatedWorkspaceHealthView, AvatarUpload, AxelNotificationPopup, AxelOrb, BackButton, BackButtonMinimal, BarChart, BaseHistoryCalendar, BottleneckClipsModal, BottleneckClipsView_default as BottleneckClipsView, BottlenecksContent, BreakNotificationPopup, CachePrefetchStatus, Card2 as Card, CardContent2 as CardContent, CardDescription2 as CardDescription, CardFooter2 as CardFooter, CardHeader2 as CardHeader, CardTitle2 as CardTitle, ChangeRoleDialog, ClipFilterProvider, ClipsCostView_default as ClipsCostView, CompactWorkspaceHealthCard, ConfirmRemoveUserDialog, CongratulationsOverlay, CroppedHlsVideoPlayer, CroppedVideoPlayer, CycleTimeChart, CycleTimeOverTimeChart, DEFAULT_ANALYTICS_CONFIG, DEFAULT_AUTH_CONFIG, DEFAULT_CONFIG, DEFAULT_DATABASE_CONFIG, DEFAULT_DATE_TIME_CONFIG, DEFAULT_ENDPOINTS_CONFIG, DEFAULT_ENTITY_CONFIG, DEFAULT_HOME_VIEW_CONFIG, DEFAULT_MAP_VIEW_CONFIG, DEFAULT_SHIFT_CONFIG, DEFAULT_SHIFT_DATA, DEFAULT_THEME_CONFIG, DEFAULT_VIDEO_CONFIG, DEFAULT_WORKSPACE_CONFIG, DEFAULT_WORKSPACE_POSITIONS, DashboardHeader, DashboardLayout, DashboardOverridesProvider, DashboardProvider, DateDisplay_default as DateDisplay, DateTimeDisplay, DebugAuth, DebugAuthView_default as DebugAuthView, DetailedHealthStatus, DiagnosisVideoModal, EFFICIENCY_ON_TRACK_THRESHOLD, EmptyStateMessage, EncouragementOverlay, FactoryAssignmentDropdown, FactoryView_default as FactoryView, FileManagerFilters, FilterDialogTrigger, FirstTimeLoginDebug, FirstTimeLoginHandler, FittingTitle, GaugeChart, GridComponentsPlaceholder, HamburgerButton, Header, HealthDateShiftSelector, HealthStatusGrid, HealthStatusIndicator, HelpView_default as HelpView, HlsVideoPlayer, HomeView_default as HomeView, HourlyOutputChart2 as HourlyOutputChart, HourlyUptimeChart, ISTTimer_default as ISTTimer, IdleTimeVlmConfigProvider, ImprovementCenterView_default as ImprovementCenterView, InlineEditableText, InteractiveOnboardingTour, InvitationService, InvitationsTable, InviteUserDialog, KPICard, KPIDetailView_default as KPIDetailView, KPIGrid, KPIHeader, KPISection, KPIsOverviewView_default as KPIsOverviewView, LINE_1_UUID, LINE_2_UUID, LargeOutputProgressChart, LeaderboardDetailView_default as LeaderboardDetailView, Legend5 as Legend, LineAssignmentDropdown, LineChart, LineHistoryCalendar, LineMonthlyHistory, LineMonthlyPdfGenerator, LinePdfExportButton, LinePdfGenerator, LineWhatsAppShareButton, LinesService, LiveTimer, LoadingInline, LoadingOverlay_default as LoadingOverlay, LoadingPage_default as LoadingPage, LoadingSkeleton, LoadingState, LoginPage, LoginView_default as LoginView, Logo, MainLayout, MapGridView, MetricCard_default as MetricCard, MinimalOnboardingPopup, MobileMenuProvider, NewClipsNotification, NoWorkspaceData, OnboardingDemo, OnboardingTour, OptifyeAgentClient, OptifyeLogoLoader_default as OptifyeLogoLoader, OutputProgressChart, PageHeader, PieChart4 as PieChart, PlantHeadView_default as PlantHeadView, PlayPauseIndicator, PrefetchConfigurationError, PrefetchError, PrefetchEvents, PrefetchStatus, PrefetchTimeoutError, ProfileView_default as ProfileView, ROOT_DASHBOARD_EVENT_NAMES, RecentFlowSnapshotGrid, RegistryProvider, RoleBadge, S3ClipsSupabaseService as S3ClipsService, S3Service, SENTRY_HANDLED_EVENT_SESSION_LIMIT, SENTRY_HANDLED_EVENT_WINDOW_MS, SENTRY_QUOTA_STORAGE_KEY, SKUManagementView, SOPComplianceChart, SSEChatClient, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SessionTracker, SessionTrackingContext, SessionTrackingProvider, SettingsPopup, ShiftDisplay_default as ShiftDisplay, ShiftsView_default as ShiftsView, SideNavBar, SignupWithInvitation, SilentErrorBoundary, SimpleOnboardingPopup, SingleVideoStream_default as SingleVideoStream, Skeleton, SubscriptionManager, SubscriptionManagerProvider, SupabaseProvider, SupervisorDropdown_default as SupervisorDropdown, SupervisorManagementView_default as SupervisorManagementView, SupervisorService, TargetWorkspaceGrid, TargetsView_default as TargetsView, TeamManagementView_default as TeamManagementView, ThreadSidebar, TicketHistory_default as TicketHistory, TicketHistoryService, TicketsView_default as TicketsView, TimeDisplay_default as TimeDisplay, TimePickerDropdown, Timer_default as Timer, TimezoneProvider, TimezoneService, UptimeDonutChart, UptimeLineChart, UptimeMetricCards, UserAvatar, UserManagementService, UserManagementTable, UserService, UserUsageDetailModal, UserUsageStats, VideoCard, VideoGridView, VideoPlayer, VideoPreloader, WORKSPACE_POSITIONS, WhatsAppShareButton, WorkspaceCard, WorkspaceCycleTimeMetricCards, WorkspaceDetailView_default as WorkspaceDetailView, WorkspaceDisplayNameExample, WorkspaceGrid, WorkspaceGridItem, WorkspaceHealthCard, WorkspaceHealthView_default as WorkspaceHealthView, WorkspaceHistoryCalendar, WorkspaceMetricCards, WorkspaceMetricCardsImpl, WorkspaceMonthlyDataFetcher, WorkspaceMonthlyHistory, WorkspaceMonthlyPdfGenerator, WorkspacePdfExportButton, WorkspacePdfGenerator, WorkspaceWhatsAppShareButton, actionService, addSentryBreadcrumb, aggregateKPIsFromLineMetricsRows, alertsService, apiUtils, areAllLinesOnSameShift, authCoreService, authOTPService, authRateLimitService, awardsService, buildDateKey, buildKPIsFromLineMetricsRow, buildKpiLineHierarchy, buildLineSkuBreakdown, buildShiftGroupsKey, canRoleAccessDashboardPath, canRoleAccessTeamManagement, canRoleAssignFactories, canRoleAssignLines, canRoleChangeRole, canRoleInviteRole, canRoleManageCompany, canRoleManageTargets, canRoleManageUsers, canRoleRemoveUser, canRoleViewClipsCost, canRoleViewUsageStats, captureHandledFrontendException, captureSentryException, captureSentryMessage, checkRateLimit2 as checkRateLimit, clearAllRateLimits2 as clearAllRateLimits, clearRateLimit2 as clearRateLimit, clearS3VideoCache, clearS3VideoFromCache, clearSentryContext, clearWorkspaceDisplayNamesCache, cn, combineLineMetricsRows, countRealSkus, createDefaultKPIs, createInvitationService, createLinesService, createSessionTracker, createStorageService, createStreamProxyHandler, createSupabaseClient, createSupervisorService, createThrottledReload, createUserManagementService, createUserService, dashboardService, deleteThread, fetchIdleTimeReasons, fetchLineDummySkuId, fetchLineSkuCatalog, filterDataByDateKeyRange, filterRealSkuBreakdown, forceRefreshWorkspaceDisplayNames, formatAwardMonth, formatDateInZone, formatDateKeyForDisplay, formatDateTimeInZone, formatDuration2 as formatDuration, formatISTDate, formatIdleTime, formatRangeLabel, formatReasonLabel, formatRelativeTime, formatTimeInZone, fromUrlFriendlyName, getActionDisplayName, getActiveShift, getAllLineDisplayNames, getAllThreadMessages, getAllWorkspaceDisplayNamesAsync, getAllWorkspaceDisplayNamesSnapshot, getAnonClient, getAssignableRoles, getAssignmentColumnLabel, getAvailableShiftIds, getAwardBadgeType, getAwardDescription, getAwardTitle, getBrowserName, getCameraNumber, getCompanyMetricsTableName, getConfigurableShortWorkspaceDisplayName, getConfigurableWorkspaceDisplayName, getConfiguredLineIds, getCoreSessionRecordingProperties, getCoreSessionReplayUrl, getCurrentShift, getCurrentShiftForLine, getCurrentTimeInZone, getCurrentWeekFullRange, getCurrentWeekToDateRange, getDashboardHeaderTimeInZone, getDateKeyFromDate, getDateKeyFromValue, getDayDateKey, getDaysDifferenceInZone, getDefaultCameraStreamUrl, getDefaultLineId, getDefaultTabForWorkspace, getInitials, getLineDisplayName, getManufacturingInsights, getMetricsTablePrefix, getMonthKeyBounds, getMonthWeekRanges, getMonthlyTrendComparisonLabel, getNextUpdateInterval, getOperationalDate, getRoleAssignmentKind, getRoleDescription, getRoleLabel, getRoleMetadata, getRoleNavPaths, getS3SignedUrl, getS3VideoSrc, getShiftData, getShiftNameById, getShiftWorkDurationSeconds, getShortShiftName, getShortWorkspaceDisplayName, getShortWorkspaceDisplayNameAsync, getStoredWorkspaceMappings, getSubscriptionManager, getThreadMessages, getUniformShiftGroup, getUserThreads, getUserThreadsPaginated, getVisibleRolesForCurrentUser, getWorkspaceDisplayName, getWorkspaceDisplayNameAsync, getWorkspaceDisplayNamesMap, getWorkspaceFromUrl, getWorkspaceNavigationParams, groupLinesByShift, hasAnyShiftData, identifyCoreUser, initializeCoreMixpanel, isEfficiencyOnTrack, isFactoryScopedRole, isFullMonthRange, isIgnorableFrontendError, isLegacyConfiguration, isLoopbackHostname, isPrefetchError, isRealSku, isRecentFlowVideoGridMetricMode, isSafari, isSupervisorRole, isTransitionPeriod, isUrlPermanentlyFailed, isValidFactoryViewConfiguration, isValidLineInfoPayload, isValidPrefetchParams, isValidPrefetchStatus, isValidWorkspaceDetailedMetricsPayload, isValidWorkspaceMetricsPayload, isWipGatedVideoGridMetricMode, isWorkspaceDisplayNamesLoaded, isWorkspaceDisplayNamesLoading, lineLeaderboardService, linesService, mergeWithDefaultConfig, migrateLegacyConfiguration, normalizeActionFamily, normalizeDateKeyRange, normalizeDateKeyRangeUnbounded, normalizeRoleLevel, normalizeVideoGridMetricMode, optifyeAgentClient, parseDateKeyToDate, parseS3Uri, pickPreferredLineMetricsRow, preInitializeWorkspaceDisplayNames, preloadS3Video, preloadS3VideoUrl, preloadS3VideosUrl, preloadVideoUrl, preloadVideosUrl, qualityService, realtimeService, refreshWorkspaceDisplayNames, resetCoreMixpanel, resetFailedUrl, resetSentryQuotaForTests, resetSubscriptionManager, resolveDefaultSkuId, resolveLiveSkuId, s3VideoPreloader, selectPreferredLineMetricsRow, setSentryUserContext, setSentryWorkspaceContext, shouldEnableLocalDevTestLogin, shuffleArray, simulateApiDelay, skuService, startCoreSessionRecording, stopCoreSessionRecording, storeWorkspaceMapping, streamProxyConfig, subscribeWorkspaceDisplayNames, throttledReloadDashboard, toUrlFriendlyName, trackCoreEvent, trackCorePageView, transformToChartData, updateThreadTitle, upsertWorkspaceDisplayNameInCache, useAccessControl, useActiveBreaks, useActiveLineId, useAllWorkspaceMetrics, useAnalyticsConfig, useAppTimezone, useAudioService, useAuth, useAuthConfig, useAxelNotifications, useCanSaveTargets, useClipFilter, useClipTypes, useClipTypesWithCounts, useClipsInit, useCompanyClipsCost, useCompanyFastSlowClipFiltersEnabled, useCompanyHasVlmEnabledLine, useCompanyUsersUsage, useComponentOverride, useCustomConfig, useDashboardConfig, useDashboardMetrics, useDatabaseConfig, useDateFormatter, useDateTimeConfig, useDynamicShiftConfig, useEndpointsConfig, useEntityConfig, useFactoryOverviewMetrics, useFeatureFlags, useFormatNumber, useHasLineAccess, useHideMobileHeader, useHistoricWorkspaceMetrics, useHlsStream, useHlsStreamWithCropping, useHookOverride, useHourEndTimer, useHourlyTargetAchievements, useHourlyTargetMisses, useIdleTimeClipClassifications, useIdleTimeReasons, useIdleTimeVlmConfig, useKpiTrends, useLeaderboardMetrics, useLineDetailedMetrics, useLineKPIs, useLineMetrics, useLineShiftConfig, useLineSupervisor, useLineWorkspaceMetrics, useLines, useMessages, useMetrics, useMobileMenu, useMonthlyTrend, useMultiLineShiftConfigs, useNavigation, useOperationalShiftKey, useOptionalSupabase, useOverrides, usePageOverride, usePrefetchClipCounts, useRealtimeLineMetrics, useRegistry, useSKUs, useSessionKeepAlive, useSessionTracking, useSessionTrackingContext, useShiftConfig, useShiftGroups, useShifts, useSubscriptionManager, useSubscriptionManagerSafe, useSupabase, useSupabaseClient, useSupervisorsByLineIds, useTargets, useTeamManagementPermissions, useTheme, useThemeConfig, useThreads, useTicketHistory, useTimezoneContext, useUserLineAccess, useUserUsage, useVideoConfig, useWorkspaceConfig, useWorkspaceDetailedMetrics, useWorkspaceDisplayName, useWorkspaceDisplayNames, useWorkspaceDisplayNamesMap, useWorkspaceHealthById, useWorkspaceHealthLastSeen, useWorkspaceHealthStatus, useWorkspaceMetrics, useWorkspaceNavigation, useWorkspaceOperators, useWorkspaceUptimeTimeline, useWorkspaceVideoStreams, userService, videoPrefetchManager, videoPreloader, weeklyTopPerformerService, whatsappService, withAccessControl, withAuth, withRegistry, withTimezone, workspaceHealthService, workspaceService };
package/package.json CHANGED
@@ -1,13 +1,15 @@
1
1
  {
2
2
  "name": "@optifye/dashboard-core",
3
- "version": "6.12.15",
3
+ "version": "6.12.16",
4
4
  "description": "Reusable UI & logic for Optifye dashboard",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
8
8
  "files": [
9
9
  "dist",
10
- "global.css"
10
+ "global.css",
11
+ "automation.d.ts",
12
+ "automation.js"
11
13
  ],
12
14
  "sideEffects": [
13
15
  "global.css"
@@ -20,6 +22,13 @@
20
22
  "require": "./dist/index.js",
21
23
  "default": "./dist/index.js"
22
24
  },
25
+ "./automation": {
26
+ "types": "./dist/automation.d.ts",
27
+ "node": "./dist/automation.js",
28
+ "import": "./dist/automation.js",
29
+ "require": "./dist/automation.js",
30
+ "default": "./dist/automation.js"
31
+ },
23
32
  "./global.css": "./global.css"
24
33
  },
25
34
  "author": "",