define("metaserver/static/js/modules/clean/react/tidy_up/api_v2",["require","exports","tslib","metaserver/static/js/api_v2/user_client","metaserver/static/js/modules/clean/react/tidy_up/utils","metaserver/static/js/modules/clean/react/tidy_up/constants","metaserver/static/js/modules/clean/react/tidy_up/modal/smart_preview_view/tidy_preview_types"],(function(e,t,r,i,a,n,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shouldShowMoveSnackbar=t.dismissSnackbar=t.shouldShowSnackbar=t.getNumAddedFilesAndFolders=t.applySmartPreview=t.createRequestPreviewDataFn=t.submitFeedback=t.undo=t.getKeyphrases=t.preview=t.applyPreview=t.tidy=void 0,t.tidy=function(e,t,a,n){return r.__awaiter(this,void 0,void 0,(function*(){const r=new i.UserApiV2Client;return c(()=>r.ns("tidy_up").rpc("tidy",{request:n,source_path:t,ns_id:a,source:"web_modal"},{subjectUserId:e}),e,r)}))},t.applyPreview=function(e,t,a,n){return r.__awaiter(this,void 0,void 0,(function*(){const r=new i.UserApiV2Client;return c(()=>r.ns("tidy_up").rpc("apply_preview",{rule:a,source_path:t,entries_to_tidy:n,source:"web_modal"},{subjectUserId:e}),e,r)}))},t.preview=function(e,t,a){return r.__awaiter(this,void 0,void 0,(function*(){const r=new i.UserApiV2Client;try{return{result:yield r.ns("tidy_up").rpc("preview",{rule:a,source_path:t},{subjectUserId:e})}}catch(e){return{isError:!0,error:e.error,error_summary:e.summary}}}))};const o=(e,t,r)=>r.ns("tidy_up").rpc("tidy/check",{async_job_id:e},{subjectUserId:t});t.getKeyphrases=function(e,t){return r.__awaiter(this,void 0,void 0,(function*(){const r=new i.UserApiV2Client;try{return(yield r.ns("tidy_up").rpc("get_keyphrases",{path:t},{subjectUserId:e})).entries}catch(e){return[]}}))},t.undo=function(e,t,a,n,s){return r.__awaiter(this,void 0,void 0,(function*(){const r=new i.UserApiV2Client;try{const i=yield r.ns("tidy_up_api_proxy").rpc("undo",{source_path:e,moved_files_changesets:a,created_directories_changesets:n,renamed_directories_changesets:s},{subjectUserId:t}),o=void 0!==i.files_result&&"success"===i.files_result[".tag"],c=!i.folders_result||"success"===i.folders_result[".tag"],u=!i.renamed_folders_result||"success"===i.renamed_folders_result[".tag"];return o&&c&&u}catch(e){return!1}}))},t.submitFeedback=function(e,t){return r.__awaiter(this,void 0,void 0,(function*(){const r=new i.UserApiV2Client;try{yield r.ns("tidy_up_api_proxy").rpc("submit_feedback",{feedback:t},{subjectUserId:e})}catch(e){}}))};const c=(e,t,i)=>r.__awaiter(void 0,void 0,void 0,(function*(){var r;try{const r=yield e();if("complete"===r[".tag"])return{isError:!1,result:r};if("other"===r[".tag"])return{isError:!0,error:{".tag":"undefined_error"},error_summary:"undefined_error"};let a=void 0;do{yield new Promise(e=>setTimeout(e,n.DEFAULT_TIME_BETWEEN_TIDY_POLL_MS)),a=yield o(r.async_job_id,t,i)}while(a&&"in_progress"===a[".tag"]);return"complete"===a[".tag"]?{isError:!1,result:a}:{isError:!0,error:{".tag":"undefined_error"},error_summary:"undefined_error"}}catch(e){return(null===(r=null==e?void 0:e.error)||void 0===r?void 0:r[".tag"])?{isError:!0,error:e.error,error_summary:e.summary}:{isError:!0,error:{".tag":"undefined_error"},error_summary:"undefined_error"}}}));t.createRequestPreviewDataFn=(e,t)=>{const n=t.replace(/\/$/,"");return o=>r.__awaiter(void 0,void 0,void 0,(function*(){var r,c,u,d,l,_,y,p,m;const f=new i.UserApiV2Client,v=[];try{let t=yield f.ns("files").rpc("list_folder",{path:n},{subjectUserId:e});for(v.push(...t.entries);t.has_more;)t=yield f.ns("files").rpc("list_folder/continue",{cursor:t.cursor},{subjectUserId:e}),v.push(...t.entries)}catch(e){return{error_tag:"list_files"}}const h={},T=[];for(const e of v)"file"===e[".tag"]&&(h[e.id]=e,T.push(s.getEntryId(e.id)));if(0===T.length)return{error_tag:"no_files"};let g;null===(r=o.onPreviewDatafetchListfolderDone)||void 0===r||r.call(o);try{g=yield f.ns("tidy_up").rpc("smart_preview",{request:{".tag":"smart_move_request",entry_ids:T}},{subjectUserId:e})}catch(e){const t=null===(c=null==e?void 0:e.error)||void 0===c?void 0:c[".tag"];if(!t)return{error_tag:"other"};switch(t){case"path":return{error_tag:"path_not_found"};case"multiple_containing_folders":case"no_files":case"no_containing_folder":case"no_destinations":case"cannot_move_entry":case"list_files":return{error_tag:t};default:return{error_tag:"other"}}}const S={};for(const e of null!==(u=g.destinations)&&void 0!==u?u:[])e.name&&(S[e.id]={id:s.getDestinationId(e.id),folderName:e.name,path:`${t}/${e.name}`});const b=[];for(const e of null!==(d=g.entries)&&void 0!==d?d:[])(null===(l=h[e.id])||void 0===l?void 0:l.name)&&e.destination_ids&&e.suggested_destination_id&&b.push({id:s.getEntryId(e.id),filename:h[e.id].name,allowedDestinationIds:e.destination_ids.map(s.getDestinationId),suggestedDestinationId:s.getDestinationId(e.suggested_destination_id),isMlSuggestion:null!==(_=e.is_ml_suggestion)&&void 0!==_?_:null,predictId:null!==(y=e.prediction_id)&&void 0!==y?y:null,score:null!==(p=e.score)&&void 0!==p?p:null,suggestionConfidence:a.TidyConversions.confidenceLevelFromApi(e.confidence_interval),path:null!==(m=h[e.id].path_lower)&&void 0!==m?m:null});return{entries:b,destinations:S}}))};t.applySmartPreview=function(e,t,a,n=setTimeout){return r.__awaiter(this,void 0,void 0,(function*(){const r={};for(const e of a)r[e.id]=e;const s=new i.UserApiV2Client,o=Object.keys(t).map(e=>t[e]).filter(e=>{var t;return(null==e?void 0:e.isSelected)&&!!(null==e?void 0:e.selectedDestinationId)&&!!(null===(t=r[null==e?void 0:e.id])||void 0===t?void 0:t.filename)}).map(e=>({from_path:e.id,to_path:`${e.selectedDestinationId}/${r[e.id].filename}`}));let c;try{c=yield s.ns("files").rpc("move_batch_v2",{entries:o,autorename:!0},{subjectUserId:e})}catch(e){return{errorTag:"move"}}let u=null;for(;"complete"!==c[".tag"]&&"complete"!==(null==u?void 0:u[".tag"]);){yield new Promise(e=>n(e,2e3));try{u=yield s.ns("files").rpc("move_batch/check_v2",{async_job_id:c.async_job_id},{subjectUserId:e})}catch(e){return{errorTag:"check"}}}return{successTag:"response"}}))},t.getNumAddedFilesAndFolders=function(e,t){return r.__awaiter(this,void 0,void 0,(function*(){const r=new i.UserApiV2Client;try{return yield r.ns("tidy_up").rpc("get_num_added_files",{user_id:e,fq_path:t},{subjectUserId:e})}catch(e){return{num_added_files:-1,num_added_folders:-1}}}))},t.shouldShowSnackbar=function(e){return r.__awaiter(this,void 0,void 0,(function*(){const t=new i.UserApiV2Client;try{return(yield t.ns("tidy_up").rpc("feature_discovery/should_show_snackbar",void 0,{subjectUserId:e})).should_show}catch(e){return!1}}))},t.dismissSnackbar=function(e){(new i.UserApiV2Client).ns("tidy_up").rpc("feature_discovery/snackbar_dismissed",{reset_criteria:!1},{subjectUserId:e})},t.shouldShowMoveSnackbar=function(e,t,a){return r.__awaiter(this,void 0,void 0,(function*(){const r=new i.UserApiV2Client;try{return(yield r.ns("tidy_up").rpc("feature_discovery/should_show_move_snackbar",{fq_path:t,num_moved_files:a},{subjectUserId:e})).should_show}catch(e){return!1}}))}})),define("metaserver/static/js/modules/clean/react/tidy_up/constants",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_TIME_BETWEEN_TIDY_POLL_MS=void 0,t.DEFAULT_TIME_BETWEEN_TIDY_POLL_MS=1e3})),define("metaserver/static/js/modules/clean/react/tidy_up/modal/options_view/tidy_radio_selection",["require","exports","tslib","react","dig-components/controls","dig-components/typography"],(function(e,t,r,i,a,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TidyUpSelection=void 0,i=r.__importDefault(i),t.TidyUpSelection=({isSelected:e,onSelect:t,value:r,label:s,subtext:o,children:c})=>i.default.createElement("div",{className:"tidy-up-view__radio-row",key:r},i.default.createElement(a.RadioButton,{id:r,value:r,checked:e,onChange:t,className:"tidy-up-view__radio-button"}),i.default.createElement("span",{className:"tidy-up-view__radio-label-container"},i.default.createElement("span",{className:"tidy-up-view__radio-label"},i.default.createElement(n.Text,{tagName:"label",htmlFor:r},s)),i.default.createElement(n.Text,{size:"small",color:"faint"},o),e&&c)),t.TidyUpSelection.displayName="TidyUpSelection"})),define("metaserver/static/js/modules/clean/react/tidy_up/modal/smart_preview_view/tidy_preview_types",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfidenceLevel=t.getDestinationId=t.getEntryId=void 0,t.getEntryId=function(e){return e},t.getDestinationId=function(e){return e},(function(e){e[e.low=0]="low",e[e.medium=1]="medium",e[e.high=2]="high"})(t.ConfidenceLevel||(t.ConfidenceLevel={}))})),define("metaserver/static/js/modules/clean/react/tidy_up/modal/types",["require","exports"],(function(e,t){"use strict";var r,i,a,n;Object.defineProperty(t,"__esModule",{value:!0}),t.TidySpecificActionSurfaceLogValue=t.defaultTidyParameters=t.TidyCustomFiltersType=t.TidyErrorType=t.initialTidyState=t.TidyStateType=t.DateFormatSelection=t.InactiveSelection=t.TidyUpType=t.toFileID=void 0,t.toFileID=e=>e,(function(e){e.none="none",e.inactive="inactive",e.by_month="by_month",e.by_year="by_year",e.smart_move="smart_move",e.keyphrase="keyphrase",e.custom_filters="custom_filters"})(r=t.TidyUpType||(t.TidyUpType={})),(function(e){e[e.thirty_days=0]="thirty_days",e[e.ninety_days=1]="ninety_days"})(i=t.InactiveSelection||(t.InactiveSelection={})),(function(e){e[e.YYYY_MM=0]="YYYY_MM",e[e.YYYY_MM_Month=1]="YYYY_MM_Month",e[e.Month_YYYY=2]="Month_YYYY"})(t.DateFormatSelection||(t.DateFormatSelection={})),(function(e){e[e.Idle=0]="Idle",e[e.Preview=1]="Preview",e[e.SmartPreview=2]="SmartPreview",e[e.Keyphrase=3]="Keyphrase",e[e.KeyphrasePreview=4]="KeyphrasePreview",e[e.FilterPreview=5]="FilterPreview",e[e.ConfirmOverrideAutomation=6]="ConfirmOverrideAutomation",e[e.ConfirmRemoveAutomation=7]="ConfirmRemoveAutomation",e[e.Feedback=8]="Feedback",e[e.CustomFilters=9]="CustomFilters"})(a=t.TidyStateType||(t.TidyStateType={})),t.initialTidyState={type:a.Idle},(function(e){e[e.Generic=0]="Generic",e[e.PartialSuccess=1]="PartialSuccess",e[e.NoMatchingFiles=2]="NoMatchingFiles"})(t.TidyErrorType||(t.TidyErrorType={})),(function(e){e.None="None",e.Keyword="Keyword",e.FileExtension="FileExtension"})(n=t.TidyCustomFiltersType||(t.TidyCustomFiltersType={})),t.defaultTidyParameters={type:r.none,activityParams:{inactiveSelection:i.thirty_days},byMonthParams:{excludeCurrentMonth:!1,dateFormatSelection:void 0},byYearParams:{excludeCurrentYear:!1},byKeyphraseParams:{keyphrase:void 0,keyphraseDestination:void 0},customFilterParams:{filters:[{rules:[{type:n.None}],actions:{destination:""}}]},previewData:void 0},(function(e){e.GROWTH_SNACKBAR_CTA="snackbar",e.DESKTOP_ENTRYPOINT="desktop",e.ORGANIZED_HOME_DESKTOP_ENTRYPOINT="desktop_organized_home",e.SNACKBAR_RETRY="from_retry",e.BROWSE_ACTIONS="browse_actions",e.MOVE_SNACKBAR_CTA="move_snackbar",e.ORGANIZE_WEB_ENTRYPOINT="web_organized_menu"})(t.TidySpecificActionSurfaceLogValue||(t.TidySpecificActionSurfaceLogValue={}))})),define("metaserver/static/js/modules/clean/react/tidy_up/utils",["require","exports","tslib","metaserver/static/js/modules/clean/react/tidy_up/modal/types","metaserver/static/js/modules/clean/filepath/filepath","metaserver/static/js/modules/clean/ts_utils","metaserver/static/js/modules/clean/react/tidy_up/modal/smart_preview_view/tidy_preview_types","metaserver/static/js/modules/clean/pap/util"],(function(e,t,r,i,a,n,s,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TidyConversions=t.AutomationConversions=void 0,a=r.__importStar(a),t.AutomationConversions={automationRuleSetToRuleType(e){var t,r;if(!e.rules||0===e.rules.length||!(null===(r=null===(t=e.rules[0])||void 0===t?void 0:t.action)||void 0===r?void 0:r.action))return;const i=e.rules[0].action.action;return"other"!==i[".tag"]?i[".tag"]:void 0}},t.TidyConversions={tidyTypeToApiV2(e){const{type:r,activityParams:a,byMonthParams:n,byYearParams:s,byKeyphraseParams:o,customFilterParams:c}=e;switch(r){case i.TidyUpType.inactive:return{inactive_for:t.TidyConversions.inactiveTimespanToApiV2(a.inactiveSelection),".tag":"inactive_request"};case i.TidyUpType.by_month:return{exclude_current:n.excludeCurrentMonth,date_format:t.TidyConversions.dateFormatSelectionToApiV2(n.dateFormatSelection),".tag":"by_month_request"};case i.TidyUpType.by_year:return{exclude_current:s.excludeCurrentYear,".tag":"by_year_request"};case i.TidyUpType.keyphrase:return{phrase:o.keyphrase||"",destination:o.keyphraseDestination||"",".tag":"keyphrase_request"};case i.TidyUpType.smart_move:return{".tag":"smart_move_request"};case i.TidyUpType.custom_filters:return{".tag":"filter_request",filters:[{filter_rules:{rules:c.filters[0].rules.map(e=>{var t,r;switch(e.type){case i.TidyCustomFiltersType.Keyword:return{rule:{".tag":"keyword_filter",keywords:null===(t=e.keywordRule)||void 0===t?void 0:t.keywords}};case i.TidyCustomFiltersType.FileExtension:return{rule:{".tag":"file_type_filter",file_types:null===(r=e.fileExtensionRule)||void 0===r?void 0:r.fileExtensions}};default:return{rule:{".tag":"other"}}}})},actions:{actions:[{action:{".tag":"move",destination:c.filters[0].actions.destination}}]}}]};default:return{".tag":"other"}}},sourceToDestinationPathFromApplyResult(e){var t;const r=[],i={};for(const t of e.entries)i[t.id]=t;for(const[a,n]of Object.entries(e.tidyPlan))if(n.isSelected&&null!==n.selectedDestinationId&&void 0!==n.selectedDestinationId&&(null===(t=e.destinations[n.selectedDestinationId])||void 0===t?void 0:t.path)&&i[a].filename){const t=i[a].path,s=`${e.destinations[n.selectedDestinationId].path}/${i[a].filename}`;t&&r.push({source_path:t,dest_path:s})}return r},tidyTypeFromApiV2(e){const r=i.defaultTidyParameters;switch(e[".tag"]){case"by_month_request":return r.type=i.TidyUpType.by_month,r.byMonthParams.excludeCurrentMonth=e.exclude_current,r.byMonthParams.dateFormatSelection=t.TidyConversions.dateFormatSelectionFromApiV2(e.date_format),r;case"by_year_request":return r.type=i.TidyUpType.by_year,r.byYearParams.excludeCurrentYear=e.exclude_current,r;case"inactive_request":return r.type=i.TidyUpType.inactive,r.activityParams.inactiveSelection=t.TidyConversions.inactiveTimespanFromApiV2(e.inactive_for),r;case"keyphrase_request":return r.type=i.TidyUpType.keyphrase,r.byKeyphraseParams.keyphrase=e.phrase,r.byKeyphraseParams.keyphraseDestination=e.destination,r;case"smart_move_request":return r.type=i.TidyUpType.smart_move,r;case"filter_request":return r.type=i.TidyUpType.custom_filters,r;default:return r}},tidyTypeToFlowsAPI(e){const r=t.TidyConversions.tidyTypeToApiV2(e);return{rules:[{enabled:!0,action:{action:{".tag":"tidy_up",args_json:JSON.stringify(r)}}}]}},tidyTypetoLoggingType(e){const{type:t,activityParams:r,byMonthParams:a,byYearParams:s}=e;let o="",c="";switch(t){case i.TidyUpType.inactive:c="inactive",o=r.inactiveSelection===i.InactiveSelection.thirty_days?"30d":"90d";break;case i.TidyUpType.by_month:c="month",a.excludeCurrentMonth&&(o="excl_current");break;case i.TidyUpType.by_year:c="year",s.excludeCurrentYear&&(o="excl_current");break;case i.TidyUpType.keyphrase:c="keyword";break;case i.TidyUpType.smart_move:c="smart_move";break;case i.TidyUpType.custom_filters:c="custom_filters";break;case i.TidyUpType.none:c="none";break;default:throw n.enforceExhaustive(t)}return{tidyUpRule:c,tidyUpSubRule:o}},inactiveTimespanToApiV2(e){switch(e){case i.InactiveSelection.thirty_days:return{".tag":"thirty_days"};case i.InactiveSelection.ninety_days:return{".tag":"ninety_days"};default:return{".tag":"other"}}},inactiveTimespanFromApiV2(e){switch(e[".tag"]){case"thirty_days":return i.InactiveSelection.thirty_days;case"ninety_days":return i.InactiveSelection.ninety_days;default:return i.InactiveSelection.thirty_days}},dateFormatSelectionToApiV2(e){switch(e){case i.DateFormatSelection.YYYY_MM:return{".tag":"yyyy_mm"};case i.DateFormatSelection.YYYY_MM_Month:return{".tag":"yyyy_mm_month"};case i.DateFormatSelection.Month_YYYY:return{".tag":"month_yyyy"};default:return}},dateFormatSelectionFromApiV2(e){if(void 0===e)return i.DateFormatSelection.YYYY_MM;switch(e[".tag"]){case"yyyy_mm":return i.DateFormatSelection.YYYY_MM;case"yyyy_mm_month":return i.DateFormatSelection.YYYY_MM_Month;case"month_yyyy":return i.DateFormatSelection.Month_YYYY;default:return i.DateFormatSelection.YYYY_MM}},previewSelectionToApiV2(e,t){const r=[];for(const i of e){if(i.isRenamed){if((t.get(i.id)||i.files.some(e=>!!t.get(e.id)))&&i.sourcePath&&i.destPath){const e={source_path:i.sourcePath,dest_path:i.destPath,is_folder:!0};r.push(e)}}for(const e of i.files)if(t.get(e.id)){const t={source_path:e.fqPathSrc,dest_path:e.fqPathDest};r.push(t)}}return r},apiV2ToPreviewSelection(e){const t={},r=[],n=[];for(const s of e){if(s.is_folder){n.push(s);continue}const e=a.parent_dir(s.dest_path),o=i.toFileID(s.dest_path),c={displayName:a.filename(s.dest_path),id:o,fqPathDest:s.dest_path,fqPathSrc:s.source_path};r.push(o),e in t?t[e].push(c):t[e]=[c]}const s=[];for(const[e,r]of Object.entries(t)){const t={isDir:!0,displayName:a.parentDirName(r[0].fqPathDest),fqPath:e,files:r,id:i.toFileID(e)};s.push(t)}for(const e of n){let t=!1;for(const r of s)if(r.fqPath===e.dest_path){r.isRenamed=!0,r.previousName=a.filename(e.source_path),r.newName=a.filename(e.dest_path),r.sourcePath=e.source_path,r.destPath=e.dest_path,t=!0;break}if(!t){const t=i.toFileID(e.dest_path),n={isDir:!0,displayName:"",fqPath:e.dest_path,files:[],isRenamed:!0,previousName:a.filename(e.source_path),newName:a.filename(e.dest_path),sourcePath:e.source_path,destPath:e.dest_path,id:t};r.push(t),s.push(n)}}return{folderHierarchy:s,fileIds:r}},compareTidyRules:(e,t)=>"inactive_request"===e[".tag"]&&"inactive_request"===t[".tag"]?e.inactive_for===t.inactive_for:"by_month_request"===e[".tag"]&&"by_month_request"===t[".tag"]?e.exclude_current===t.exclude_current&&e.date_format===t.date_format:"by_year_request"===e[".tag"]&&"by_year_request"===t[".tag"]?e.exclude_current===t.exclude_current:"keyphrase_request"===e[".tag"]&&"keyphrase_request"===t[".tag"]&&(e.phrase===t.phrase&&e.destination===t.destination),doesCurrentSelectionMatchAutomation(e,r){if(!e)return!1;const i=t.TidyConversions.tidyTypeToApiV2(r);return"by_month_request"===i[".tag"]&&"by_month_request"===e[".tag"]||("filter_request"===i[".tag"]&&"filter_request"===e[".tag"]||t.TidyConversions.compareTidyRules(e,i))},shouldSilentlyReplaceAutomation(e,r){if(!e)return!1;const i=t.TidyConversions.tidyTypeToApiV2(r);return!t.TidyConversions.compareTidyRules(e,i)&&("by_month_request"===i[".tag"]&&"by_month_request"===e[".tag"])},confidenceLevelFromApi(e){switch(null==e?void 0:e[".tag"]){case"high":return s.ConfidenceLevel.high;case"mid":return s.ConfidenceLevel.medium;default:return s.ConfidenceLevel.low}},confidenceLevelToApi(e){switch(e){case s.ConfidenceLevel.high:return{".tag":"high"};case s.ConfidenceLevel.medium:return{".tag":"mid"};case s.ConfidenceLevel.low:return{".tag":"low"};default:throw n.enforceExhaustive(e)}},tidyTypeToPapType(e,t){const{type:r,activityParams:a,byMonthParams:s,byYearParams:c}=e;let u=void 0,d="";switch(r){case i.TidyUpType.inactive:u=o.getEnumValueForString("INACTIVE_TIDYUP_RULE",t),d=a.inactiveSelection===i.InactiveSelection.thirty_days?"30d":"90d";break;case i.TidyUpType.by_month:u=o.getEnumValueForString("MONTH_TIDYUP_RULE",t),s.excludeCurrentMonth&&(d="excl_current");break;case i.TidyUpType.by_year:u=o.getEnumValueForString("YEAR_TIDYUP_RULE",t),c.excludeCurrentYear&&(d="excl_current");break;case i.TidyUpType.keyphrase:u=o.getEnumValueForString("KEYWORD_TIDYUP_RULE",t);break;case i.TidyUpType.smart_move:u=o.getEnumValueForString("SMART_MOVE_TIDYUP_RULE",t);break;case i.TidyUpType.custom_filters:u=o.getEnumValueForString("CUSTOM_FILTERS_TIDYUP_RULE",t);break;case i.TidyUpType.none:break;default:throw n.enforceExhaustive(r)}return{tidyUpRule:u,tidyUpSubrule:d}},tidyInactiveRangeToPapType(e,t){let r=void 0;switch(e){case i.InactiveSelection.thirty_days:r=o.getEnumValueForString("THIRTY_DAYS_TIDYUP_TIME_INACTIVE_SUBRULE",t);break;case i.InactiveSelection.ninety_days:r=o.getEnumValueForString("NINETY_DAYS_TIDYUP_TIME_INACTIVE_SUBRULE",t);break;default:throw n.enforceExhaustive(e)}return r},tidyDateFormatToPapType(e,t){if(void 0===e)return o.getEnumValueForString("UNKNOWN_TIDYUP_DATE_FORMAT_SUBRULE",t);switch(e){case i.DateFormatSelection.YYYY_MM:return o.getEnumValueForString("YYYY_MM_TIDYUP_DATE_FORMAT_SUBRULE",t);case i.DateFormatSelection.YYYY_MM_Month:return o.getEnumValueForString("YYYY_MM_MONTH_TIDYUP_DATE_FORMAT_SUBRULE",t);case i.DateFormatSelection.Month_YYYY:return o.getEnumValueForString("MONTH_YYYY_TIDYUP_DATE_FORMAT_SUBRULE",t);default:throw n.enforceExhaustive(e)}},tidyAutomationToPapType:(e,t,r)=>t?o.getEnumValueForString("APPLY_TIDYUP_AUTOMATION_ACTION",r):e?o.getEnumValueForString("REMOVE_TIDYUP_AUTOMATION_ACTION",r):o.getEnumValueForString("NONE_TIDYUP_AUTOMATION_ACTION",r),tidySourceToPapType:(e,t)=>e===i.TidySpecificActionSurfaceLogValue.DESKTOP_ENTRYPOINT?o.getEnumValueForString("DESKTOP_MENU_TIDYUP_SOURCE",t):e===i.TidySpecificActionSurfaceLogValue.GROWTH_SNACKBAR_CTA?o.getEnumValueForString("UPLOAD_SNACKBAR_TIDYUP_SOURCE",t):e===i.TidySpecificActionSurfaceLogValue.MOVE_SNACKBAR_CTA?o.getEnumValueForString("MOVE_SNACKBAR_TIDYUP_SOURCE",t):e===i.TidySpecificActionSurfaceLogValue.SNACKBAR_RETRY?o.getEnumValueForString("RETRY_TIDYUP_SOURCE",t):e===i.TidySpecificActionSurfaceLogValue.ORGANIZED_HOME_DESKTOP_ENTRYPOINT?o.getEnumValueForString("DESKTOP_ORGANIZED_HOME_TIDYUP_SOURCE",t):o.getEnumValueForString("WEB_BROWSE_TIDYUP_SOURCE",t)}})),define("metaserver/static/js/modules/clean/react/tidy_up/feature_growth",["require","exports","tslib","metaserver/static/js/modules/clean/web_user_action_events","react-intl","metaserver/static/js/modules/clean/react/tidy_up/api_v2","metaserver/static/js/modules/clean/web_user_action_logger","metaserver/static/js/modules/clean/react/browse/data/selectors","metaserver/static/js/modules/clean/react/browse/data/selectors","metaserver/static/js/modules/clean/react/browse/data/store","metaserver/static/js/modules/clean/react/snackbar","metaserver/static/js/modules/clean/react/browse/data/action_creators/index","metaserver/static/js/modules/core/i18n","react","metaserver/static/js/modules/clean/pap/analytics_client","metaserver/static/js/dropbox/proto/pap_events/tidyup/shown_tidyup_growth_snackbar","metaserver/static/js/modules/clean/react/tidy_up/modal/types"],(function(e,t,r,i,a,n,s,o,c,u,d,l,_,y,p,m,f){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.showTidyUpMoveSnackbar=t.openTidyUpModal=void 0,c=r.__importStar(c),l=r.__importStar(l),y=r.__importDefault(y);t.openTidyUpModal=(t,i,a,n)=>{d.Snackbar.close("tidyup-feature-growth");const s=u.getStoreForBrowse(),_=s.getState();c.path(_)!==t&&s.dispatch(l.setUrl({path:t}));const y=c.browsePostTTIExperiments(_);new Promise((t,r)=>{e(["metaserver/static/js/modules/clean/react/tidy_up/modal/tidy_up_modal"],t,r)}).then(r.__importStar).then(({showTidyUpModal:e})=>e({currentUserId:i,targetPath:t,namespaceId:a,actionSurface:n,features:y,subfolders:c.unsortedFiles(_).filter(e=>e.is_dir).toArray(),isInsideFlowsEligibleFolder:o.isInsideFlowsEligibleFolder(_)}))};const v=_.intl.formatMessage({id:"Kk24DX",defaultMessage:"Open multi-file organize"}),h=_.intl.formatMessage({id:"UArEyu",defaultMessage:"Close"});t.showTidyUpMoveSnackbar=(e,r,o)=>{if(void 0===e)return;const c=a.defineMessages({DEFAULT:{id:"4MKaZt",defaultMessage:"It looks like you’ve organized multiple files in this folder recently – organize them with our new folder organization tools."}}),u=_.intl.formatMessage(c.DEFAULT);d.Snackbar.show(y.default.createElement(d.Snackbar,{actionButtonText:v,onActionClick:()=>t.openTidyUpModal(e,r,o,f.TidySpecificActionSurfaceLogValue.MOVE_SNACKBAR_CTA),closeButtonText:h,onCloseClick:()=>n.dismissSnackbar(r),timeoutDelayMs:1e4,title:u,variant:"generic",id:"tidyup-feature-growth"})),s.WebUserActionLog.log(r,i.WebUserActionLogEvent.FEATURE_DISCOVERY_SNACKBAR_SHOW,{ns_id:o,trigger:"bulk_move",feature:"tidy_up"}),p.logEvent(m.pap_events.tidyup.Shown_TidyupGrowthSnackbar.create({actionSurface:i.ActionSurfaceLogValue.FEATURE_GROWTH,tidyupFeatureDiscoveryTrigger:m.pap_events.tidyup.Shown_TidyupGrowthSnackbar.TidyupFeatureDiscoveryTrigger.BULK_MOVE_TIDYUP_FEATURE_DISCOVERY_TRIGGER}))}})),define("metaserver/static/js/dropbox/proto/pap_events/tidyup/shown_tidyup_growth_snackbar",["require","exports","tslib","protobufjs/minimal","metaserver/static/js/dropbox/proto/pap_events/predefined_event"],(function(e,t,r,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.pap_events=void 0;const a=(i=r.__importStar(i)).Reader,n=i.Writer,s=(i.util,i.roots.default||(i.roots.default={}));var o,c;t.default=s,t.pap_events=s.pap_events=((o=s.pap_events||{}).tidyup=((c=o.tidyup||{}).Shown_TidyupGrowthSnackbar=(function(e){function e(e){if(e)for(let t=Object.keys(e),r=0;r>>3){case 1:i.actionSurface=e.string();break;case 1101:i.eventClass=e.int32();break;case 2:i.tidyupFeatureDiscoveryTrigger=e.int32();break;default:e.skipType(7&t)}}return i},e.getTypeUrl=function(){return"type.googleapis.com/pap_events.tidyup.Shown_TidyupGrowthSnackbar"},e.EventClass=(function(){const e={},t=Object.create(e);return t[e[0]="TIDYUP"]=0,t})(),e.TidyupFeatureDiscoveryTrigger=(function(){const e={},t=Object.create(e);return t[e[0]="UNKNOWN_TIDYUP_FEATURE_DISCOVERY_TRIGGER"]=0,t[e[1]="BULK_UPLOAD_TIDYUP_FEATURE_DISCOVERY_TRIGGER"]=1,t[e[2]="BULK_MOVE_TIDYUP_FEATURE_DISCOVERY_TRIGGER"]=2,t})(),e})(c.Shown_TidyupGrowthSnackbar||{}),c),o)})); //# sourceMappingURL=pkg-tidy-up.min.js-vflllM9UG.map