!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="9079cebf-78f2-36ad-8b1c-4a44a30be19d")}catch(e){}}(); define(["exports","./e_file_viewer_static_scl_page_folder","./c_init_data_debug_panel","./c_download_components_post-download-pre-susi-modal","./c_core_i18n","react","./c_flux_action_type","./e_core_exception","./e_edison","./c_pap-events_enums_flexible_sharing_entry_point_variant-utils","./c_src_sink_index","./c_pap-events_browse_view_folder_picker","./e_data_modules_stormcrow","./c_react-use_misc_util","./c_lodash-es_lodash","./c_core_notify","react-dom","metaserver/static/js/langpack","./c_api_v2_routes_team_provider"],(function(e,o,n,t,r,i,a,l,d,s,_,c,u,w,p,T,g,m,v){"use strict";e.onDownload=(e,{entry:i,entryShareToken:a,entrySharedLinkInfo:d,origin:s,onShowPreDownloadSUSIModal:_,actionElement:c})=>{const u=e.$user.get(),w=e.$encryptionOptions.get();o.logTiburonEvent(u,i,o.TiburonEventName.ClickDownload,a,s,d.url);const p=!u&&!n.is_mobile_or_tablet(),T=()=>{o.logTiburonEvent(u,i,o.TiburonEventName.DownloadAttempt,a,s,d.url);const n={actionSurface:"shared_folder_previews",actionElement:c,...i.is_dir?{}:{fileSize:i.bytes,fileType:o.getFileTypeFromString(o.getExtension$1(i))}};o.downloadFileOrFolder({sharedLinkUrl:d.url,origin:s,targetObjectMetadata:o.getTargetObjectMetadataFromEntry(i),downloadTestUrl:d.downloadTestUrl,rlkey:a.rlkey,userId:null==u?void 0:u.id,loggingParams:n}).then((n=>{"success"===n?(o.logTiburonEvent(u,i,o.TiburonEventName.DownloadSuccess,a,s,d.url),e.$actionNotificationTitle.set(o.formatDownloadStartText(r.intl)),u||(w?!p&&t.getIsTimeEligibleToShowPostDownloadPreSUSIModal()&&(e.$downloadIsFolder.set(i.is_dir),e.$postDownloadPreSUSIModalOpen.set(!0),o.logTiburonEvent(void 0,i,o.TiburonEventName.ViewPostDownloadPreSUSIModal,a,s,d.url,"shared_folder_download_register")):l.reportException({err:new Error("No encryption options provided to shared folder preview download button"),severity:"non-critical",tags:["sharing-encryption-options"]}))):"tooLarge"===n?(o.logTiburonEvent(u,i,o.TiburonEventName.DownloadFail,a,s,d.url,{downloadStatus:n}),e.$actionNotificationTitle.set(o.formatDownloadFolderSizeTooLargeText(r.intl))):"accessDenied"!==n&&"contentNotFound"!==n&&"invalidToken"!==n&&"unknownTokenLinkType"!==n&&"permissionDenied"!==n&&"unknownError"!==n||(o.logTiburonEvent(u,i,o.TiburonEventName.DownloadFail,a,s,d.url,{downloadStatus:n}),e.$actionNotificationTitle.set(i.is_dir?o.formatDownloadFolderGenericErrorText(r.intl):o.formatDownloadGenericErrorText(r.intl)))}))};p?_(T):T()}})); //# sourceMappingURL=c_shared-folder-preview-page_actions_on-download.after-display.js-vfltBO0DE.map //# debugId=9079cebf-78f2-36ad-8b1c-4a44a30be19d