import{o}from"./rolldown-runtime-iuO8RvI4.js";import{Ly as e}from"./shared-0-C4kdVF7Y.js";import{Mi as r}from"./vendor-frame-CwiylG4Y.js";import{Mh as s,iv as a,nv as t}from"./shared-1-3-6x7RKF.js";import{rn as n}from"./vendor-all-2-BJdkbLSj.js";import{Tr as i}from"./shared-8-C1HP2d2B.js";var d=o(r());function l({filePath:o,sessionId:r,spaceId:l,errorSource:m}){const f=n(),{addError:h}=s(),c=t(),p=a(),g=(0,d.useMemo)(()=>o.replace(/^computer:\/\//,""),[o]);return{handleShowInFolder:(0,d.useCallback)(async()=>{try{r?await(e?.openLocalFile?.(r,encodeURIComponent(g),!0)):await(e?.showInFolder?.(g))}catch(o){h(i(o,f,"showInFolder"),{error:o,errorContext:{tags:{source:m}},messageForLogging:"Failed to show file in folder"})}},[r,l,g,h,f,m]),showInFolderTooltip:c?f.formatMessage({defaultMessage:"Show in Finder",id:"LVY6c4L1SF"}):p?f.formatMessage({defaultMessage:"Show in Explorer",id:"ySAk9qhogV"}):f.formatMessage({defaultMessage:"Show in Folder",id:"qJzHPN7NHs"})}}export{l as t};