VideoUploadLogger",["Banzai","CurrentUser","VideoUploadLoggerEvents","VideoUploadLoggingConfig","logVideoUploadViaFalco"],(function(a,b,c,d,e,f,g){b=babelHelpers["extends"]({BANZAI_GK:"videos",BANZAI_ROUTE:"video_waterfall",SOURCE_SIMPLE:"simple",SOURCE_COMPOSER:"composer"},(a=d("VideoUploadLoggerEvents")).VideoUploadLoggerEvents);var h=new Set([a.VideoUploadLoggerEvents.EVENT_STARTED_FLOW,a.VideoUploadLoggerEvents.EVENT_FINISHED_FLOW,a.VideoUploadLoggerEvents.EVENT_FAILED_FLOW,a.VideoUploadLoggerEvents.EVENT_CANCELED_FLOW]);e=function(){function a(b){this.$1=b.source,this.$2=b.composer_dialog_version,this.$3=b.waterfall_id,this.$4=b.ad_account_id,this.$5=b.target_id,this.$6=b.delay,this.$7=[],this.$8=b.is_chunked_upload,this.$9=b.actor_id,this.$10=b.composer_entry_point_ref,this.$11=b.composer_work_shared_draft_mode,this.$12=b.is_remote_upload,this.$13=b.container_type,this.$14=b.has_file_been_replaced,this.$15=b.composer_session_id,this.$16=b.creative_tools,this.$17=b.asset_id,this.$18=c("CurrentUser").getAppID(),this.$19=!Boolean(b.reported_by_notifier)&&a.shouldSendFlowEventsViaNotifier({source_type:b.source,composer_entry_point_ref:b.composer_entry_point_ref})}a.shouldSendFlowEventsViaNotifier=function(a){return Boolean((c("VideoUploadLoggingConfig").FLOW_VIA_NOTIFIER_COMPOSERS||[]).find(function(b){return b.source_type===a.source_type&&b.composer_entry_point_ref===a.composer_entry_point_ref}))};var b=a.prototype;b.logEvent=function(a,b){if(this.$19&&h.has(a))return;b=babelHelpers["extends"]({},b);b.elapsed_time==null&&(a.indexOf("started")!==-1?this.$7[a]=Date.now():a.indexOf("finished")!==-1?b.elapsed_time=this.$20(a,"finished"):a.indexOf("canceled")!==-1?b.elapsed_time=this.$20(a,"canceled"):a.indexOf("failed")!==-1&&(b.elapsed_time=this.$20(a,"failed")));b.event=a;b.source=this.$1;b.composer_dialog_version=b.composer_dialog_version||this.$2;b.waterfall_id=this.$3;b.ad_account_id=this.$4;b.target_id=this.$5;b.is_chunked_upload=this.$8;b.actor_id=this.$9;b.composer_entry_point_ref=this.$10;b.composer_work_shared_draft_mode=this.$11;b.is_remote_upload=this.$12;b.container_type=this.$13;b.has_file_been_replaced=this.$14;b.trigger_time=Date.now();b.composer_session_id=this.$15;b.asset_id=this.$17;b.app_id=this.$18;c("logVideoUploadViaFalco")(b)};b.postOnShutdown=function(a){return c("Banzai").subscribe(c("Banzai").SHUTDOWN,a)};b.getWaterfallID=function(){return this.$3};b.$20=function(a,b){a=a.replace(b,"started");b=this.$7[a];return b?Date.now()-b:null};return a}();Object.assign(e,b);f=e;g["default"]=f}),98);
-----
VideoUploadLoggerEvents",[],(function(a,b,c,d,e,f){"use strict";a=Object.freeze({EVENT_STARTED_GENERATE_THUMBNAILS:"upload.client.started_generate_thumbnails",EVENT_FINISHED_GENERATE_THUMBNAILS:"upload.client.finished_generate_thumbnails",EVENT_SELECTED_CUSTOM_THUMBNAIL:"upload.client.selected_custom_thumbnail",EVENT_VIDEO_DIMENSIONS_UNREADABLE:"upload.client.video_dimensions_unreadable",EVENT_REPLACE_VIDEO:"upload.client.replace_video",EVENT_STARTED_FLOW:"upload.client.started_flow",EVENT_FINISHED_FLOW:"upload.client.finished_flow",EVENT_FAILED_FLOW:"upload.client.failed_flow",EVENT_CANCELED_FLOW:"upload.client.canceled_flow",EVENT_RESIGNED_FLOW:"upload.client.resigned_flow",EVENT_REQUESTED_UPLOADING:"upload.client.requested_uploading",EVENT_INVALIDATED_UPLOADING:"upload.client.invalidated_uploading",EVENT_STARTED_UPLOADING:"upload.client.started_uploading",EVENT_PROGRESS_UPLOADING_START_REQUEST:"upload.client.progress_uploading_start_request",EVENT_FINISHED_UPLOADING:"upload.client.finished_uploading",EVENT_CANCELED_UPLOADING:"upload.client.canceled_uploading",EVENT_ABANDONED_UPLOADING:"upload.client.abandoned_uploading",EVENT_FAILED_UPLOADING:"upload.client.failed_uploading",EVENT_STARTED_SENDING_BYTES:"upload.client.started_sending_bytes",EVENT_FINISHED_SENDING_BYTES:"upload.client.finished_sending_bytes",EVENT_CANCELED_SENDING_BYTES:"upload.client.canceled_sending_bytes",EVENT_FAILED_SENDING_BYTES:"upload.client.failed_sending_bytes",EVENT_STARTED_START_REQUEST:"upload.client.started_sending_start_request",EVENT_FINISHED_START_REQUEST:"upload.client.finished_sending_start_request",EVENT_FAILED_START_REQUEST:"upload.client.failed_sending_start_request",EVENT_CANCELED_START_REQUEST:"upload.client.canceled_sending_start_request",EVENT_STARTED_RECEIVE_REQUEST:"upload.client.started_sending_receive_request",EVENT_FINISHED_RECEIVE_REQUEST:"upload.client.finished_sending_receive_request",EVENT_FAILED_RECEIVE_REQUEST:"upload.client.failed_sending_receive_request",EVENT_STARTED_POST_REQUEST:"upload.client.started_sending_post_request",EVENT_FINISHED_POST_REQUEST:"upload.client.finished_sending_post_request",EVENT_FAILED_POST_REQUEST:"upload.client.failed_sending_post_request",EVENT_HANDLING_SERVER_FAILURE_RESPONSE:"upload.client.handling_server_failure_response",EVENT_HANDLING_TRANSPORT_FAILURE_RESPONSE:"upload.client.handling_transport_failure_response",EVENT_DUPLICATE_POST_REQUEST:"upload.client.duplicate_post_request",EVENT_STARTED_SENDING_CHUNK_BYTES:"upload.client.started_sending_chunk_bytes",EVENT_FINISHED_SENDING_CHUNK_BYTES:"upload.client.finished_sending_chunk_bytes",EVENT_CANCELED_SENDING_CHUNK_BYTES:"upload.client.canceled_sending_chunk_bytes",EVENT_FAILED_SENDING_CHUNK_BYTES:"upload.client.failed_sending_chunk_bytes",EVENT_TIMEOUT_SENDING_CHUNK_BYTES:"upload.client.timeout_sending_chunk_bytes",EVENT_STARTED_FETCHING_STATUS:"upload.client.started_fetching_status",EVENT_FINISHED_FETCHING_STATUS:"upload.client.finished_fetching_status",EVENT_STARTED_POST_FLOW:"upload.client.started_post_flow",EVENT_FINISHED_POST_FLOW:"upload.client.finished_post_flow",EVENT_CANCELED_POST_FLOW:"upload.client.canceled_post_flow",EVENT_FAILED_POST_FLOW:"upload.client.failed_post_flow",EVENT_RETRY_ATTEMPT:"upload.client.retry_attempt",EVENT_RESUMABLE_CALLED:"upload.client.resumable_called",EVENT_RESUMABLE_STARTED:"upload.client.resumable_started",EVENT_RESUMABLE_SUCCESS:"upload.client.resumable_success",EVENT_RESUMABLE_FAILED:"upload.client.resumable_failed",EVENT_ENCODING_START_OBSERVED:"encode.client.encoding_start_observed",EVENT_ENCODING_SUCCESS_OBSERVED:"encode.client.encoding_success_observed",EVENT_ENCODING_FAIL_OBSERVED:"encode.client.encoding_fail_observed",EVENT_ENCODING_ABORT_OBSERVED:"encode.client.encoding_abort_observed",EVENT_FETCH_FAIL_OBSERVED:"encode.client.fetch_video_info_fail_observed",EVENT_ENCODING_SUBSCRIBE_TO_VIDEO_STATUS:"encode.client.subscribe_to_video_status",EVENT_ENCODING_POLLING_FALLBACK:"encode.client.polling_fallback",EVENT_RECEIVED_RESPONSE:"upload.client.received_response",EVENT_STARTED_FLOW_EXP1:"upload.client.started_flow_exp1",EVENT_FINISHED_FLOW_EXP1:"upload.client.finished_flow_exp1",EVENT_CANCELED_FLOW_EXP1:"upload.client.canceled_flow_exp1",EVENT_MEASURE_FREE_LOCAL_STORAGE:"upload.client.free_local_storage"});f.VideoUploadLoggerEvents=a}),66);
-----
VideoUploadFlowNotifier",["Banzai","MediaCancelledPostFlowFalcoEvent","MediaFailedPostFlowFalcoEvent","MediaFinishedPostFlowFalcoEvent","MediaStartedPostFlowFalcoEvent","Run","SubscriptionsHandler","VideoUploadLoggerEvents","VideoUploadLoggerTyped","WaterfallIDGenerator"],(function(a,b,c,d,e,f,g){"use strict";var h=Object.freeze({SUCCESSFUL:"successful",FAILED:"failed",CANCELED:"canceled",REQUESTED:"requested",STARTED:"started"}),i=function(){function a(){this.$1={}}var b=a.prototype;b.registerUpload=function(a,b){var c={isStarted:!1,isUploaded:!1,isCanceled:!1,isFailed:!1};this.$1[String(b)]=c;a.subscribe("upload-started",function(){c.isStarted=!0});a.subscribe("upload-canceled",function(){c.isCanceled=!0});a.subscribe("upload-failed",function(){c.isFailed=!0});a.subscribe("upload-finished",function(){c.isUploaded=!0})};b.cancelUpload=function(a){a=this.$1[String(a)];a!=null&&(a.isCanceled=!0)};b.$2=function(a){if(a.isCanceled)return h.CANCELED;else if(a.isUploaded)return h.SUCCESSFUL;else if(a.isFailed)return h.FAILED;else if(a.isStarted)return h.STARTED;else return h.REQUESTED};b.areAnyVideosIncludedInPost=function(){var a=this,b=Object.keys(this.$1).map(function(b){return a.$2(a.$1[b])});return b.some(function(a){return a!==h.CANCELED})};b.getSummary=function(){var a=this,b=Object.keys(this.$1).map(function(b){return a.$2(a.$1[b])});return{total:b.length,successful:b.filter(function(a){return a===h.SUCCESSFUL}).length,started:b.filter(function(a){return a===h.STARTED}).length,canceled:b.filter(function(a){return a===h.CANCELED}).length,failed:b.filter(function(a){return a===h.FAILED}).length}};return a}(),j=function(){function a(){}var b=a.prototype;b.logFlowStarted=function(){};b.logFlowFinished=function(){};b.logFlowCanceled=function(){};b.logFlowFailed=function(){};b.release=function(){};return a}(),k=function(){function a(a,b){var e=this;this.$2=b;this.$1=a;this.$4=new Set();this.$3=new(c("SubscriptionsHandler"))();a.cancel_on_unload&&this.$3.addSubscriptions(c("Banzai").subscribe(c("Banzai").SHUTDOWN,function(){return e.$6("shutdown")}));a.cancel_on_leave&&this.$3.addSubscriptions(d("Run").onLeave(function(){return e.$6("leave")}))}var b=a.prototype;b.release=function(){this.$3.release()};b.$7=function(){var a=this.$2.getSummary(),b=this.$5;return{composer_session_id:this.$1.composer_session_id,source_type:this.$1.source,target_id:this.$1.target_id,target_type:this.$1.target_type,composer_entry_point_ref:this.$1.composer_entry_point_ref,total_uploads:a.total,started_uploads:a.started,successful_uploads:a.successful,canceled_uploads:a.canceled,failed_uploads:a.failed,elapsed_time:b!=null?Date.now()-b:null}};b.logFlowFinished=function(){var a=this;this.$4.has(c("MediaFinishedPostFlowFalcoEvent"))||(c("MediaFinishedPostFlowFalcoEvent").log(function(){return a.$7()}),this.$4.add(c("MediaFinishedPostFlowFalcoEvent")))};b.logFlowStarted=function(){var a=this;this.$4.has(c("MediaStartedPostFlowFalcoEvent"))||(c("MediaStartedPostFlowFalcoEvent").log(function(){return a.$7()}),this.$5=Date.now(),this.$4.add(c("MediaStartedPostFlowFalcoEvent")))};b.logFlowCanceled=function(){this.$6("user")};b.logFlowFailed=function(){var a=this;this.$4.has(c("MediaFailedPostFlowFalcoEvent"))||(c("MediaFailedPostFlowFalcoEvent").log(function(){return a.$7()}),this.$4.add(c("MediaFailedPostFlowFalcoEvent")))};b.$6=function(a){var b=this;this.$4.has(c("MediaCancelledPostFlowFalcoEvent"))||(c("MediaCancelledPostFlowFalcoEvent").log(function(){return babelHelpers["extends"]({},b.$7(),{event_reason:a})}),this.$4.add(c("MediaCancelledPostFlowFalcoEvent")))};return a}(),l=function(){function a(a,b){var e=this;this.$1=b;this.$3=new Set();this.$4=new(d("VideoUploadLoggerTyped").VideoUploadLogger)({source:a.source,waterfall_id:a.composer_session_id,composer_session_id:a.composer_session_id,target_id:a.target_id,composer_entry_point_ref:a.composer_entry_point_ref,reported_by_notifier:!0});this.$2=new(c("SubscriptionsHandler"))();this.$2.addSubscriptions(this.$4.postOnShutdown(function(){return e.$5("shutdown")}));a.cancel_on_leave&&this.$2.addSubscriptions(d("Run").onLeave(function(){return e.$5("leave")}))}var b=a.prototype;b.release=function(){this.$2.release()};b.logFlowFinished=function(){this.$6(d("VideoUploadLoggerEvents").VideoUploadLoggerEvents.EVENT_FINISHED_FLOW)};b.logFlowStarted=function(){this.$6(d("VideoUploadLoggerEvents").VideoUploadLoggerEvents.EVENT_STARTED_FLOW)};b.logFlowCanceled=function(){this.$5("user")};b.logFlowFailed=function(){this.$6(d("VideoUploadLoggerEvents").VideoUploadLoggerEvents.EVENT_FAILED_FLOW)};b.$6=function(a,b){if(!this.$3.has(a)){var c=this.$1.getSummary();this.$4.logEvent(a,babelHelpers["extends"]({},b,{debug:{total_uploads:c.total,started_uploads:c.started,successful_uploads:c.successful,canceled_uploads:c.canceled,failed_uploads:c.failed}}));this.$3.add(a)}};b.$5=function(a){this.$6(d("VideoUploadLoggerEvents").VideoUploadLoggerEvents.EVENT_CANCELED_FLOW,{event_reason:a})};return a}(),m=Object.freeze({UPLOAD_USER_REMOVED:"upload_removed"}),n=Object.freeze({POST_USER_CANCELED:"post_user_canceled",POST_USER_REQUESTED:"post_user_requested",POST_FAILED:"post_failed",POST_SUCCESSFUL:"post_successful"});function o(a){return a==null?d("WaterfallIDGenerator").generate():a}function a(a){if(a.extended_flow_logging_enabled)return new q(a);else return p.getInstance()}var p=function(){function a(){}a.getInstance=function(){return a.$1};var b=a.prototype;b.registerVideoUpload=function(a,b){return o(b)};b.notifyOnUploadAction=function(a){};b.notifyOnPostAction=function(a){};return a}();p.$1=new p();var q=function(){function a(a){this.$3=a,this.$5=new i(),this.$2=new j(),this.$1=!1,this.$4=a.composer_session_id==null?d("WaterfallIDGenerator").generate():a.composer_session_id}var b=a.prototype;b.$6=function(){var a=d("VideoUploadLoggerTyped").VideoUploadLogger.shouldSendFlowEventsViaNotifier({source_type:this.$3.source,composer_entry_point_ref:this.$3.composer_entry_point_ref});a=a?l:k;return new a({composer_entry_point_ref:this.$3.composer_entry_point_ref,source:this.$3.source,target_id:this.$3.target_id,target_type:this.$3.target_type,composer_session_id:this.$4,cancel_on_leave:this.$3.cancel_on_leave,cancel_on_unload:this.$3.cancel_on_unload==null?!0:this.$3.cancel_on_unload},this.$5)};b.registerVideoUpload=function(a,b){b=o(b);a.setComposerSessionID(this.$4);this.$5.registerUpload(a,b);return b};b.notifyOnUploadAction=function(a){switch(a.action){case m.UPLOAD_USER_REMOVED:this.$5.cancelUpload(a.trackingID);break}};b.notifyOnPostAction=function(a){switch(a.action){case n.POST_USER_REQUESTED:!this.$1&&this.$5.areAnyVideosIncludedInPost()&&(this.$2=this.$6(),this.$1=!0);this.$2.logFlowStarted();break;case n.POST_FAILED:this.$2.logFlowFailed();this.$2.release();break;case n.POST_SUCCESSFUL:this.$2.logFlowFinished();this.$2.release();this.$2=new j();break;case n.POST_USER_CANCELED:this.$2.logFlowCanceled();this.$2.release();break}};return a}();g.VideoUploadActions=m;g.VideoPostActions=n;g.createVideoUploadFlowNotifier=a;g.NoOpVideoUploadFlowNotifier=p}),98);
-----
VideoUploadFlowNotifier",["Banzai","MediaCancelledPostFlowFalcoEvent","MediaFailedPostFlowFalcoEvent","MediaFinishedPostFlowFalcoEvent","MediaStartedPostFlowFalcoEvent","Run","SubscriptionsHandler","VideoUploadLoggerEvents","VideoUploadLoggerTyped","WaterfallIDGenerator"],(function(a,b,c,d,e,f,g){"use strict";var h=Object.freeze({SUCCESSFUL:"successful",FAILED:"failed",CANCELED:"canceled",REQUESTED:"requested",STARTED:"started"}),i=function(){function a(){this.$1={}}var b=a.prototype;b.registerUpload=function(a,b){var c={isStarted:!1,isUploaded:!1,isCanceled:!1,isFailed:!1};this.$1[String(b)]=c;a.subscribe("upload-started",function(){c.isStarted=!0});a.subscribe("upload-canceled",function(){c.isCanceled=!0});a.subscribe("upload-failed",function(){c.isFailed=!0});a.subscribe("upload-finished",function(){c.isUploaded=!0})};b.cancelUpload=function(a){a=this.$1[String(a)];a!=null&&(a.isCanceled=!0)};b.$2=function(a){if(a.isCanceled)return h.CANCELED;else if(a.isUploaded)return h.SUCCESSFUL;else if(a.isFailed)return h.FAILED;else if(a.isStarted)return h.STARTED;else return h.REQUESTED};b.areAnyVideosIncludedInPost=function(){var a=this,b=Object.keys(this.$1).map(function(b){return a.$2(a.$1[b])});return b.some(function(a){return a!==h.CANCELED})};b.getSummary=function(){var a=this,b=Object.keys(this.$1).map(function(b){return a.$2(a.$1[b])});return{total:b.length,successful:b.filter(function(a){return a===h.SUCCESSFUL}).length,started:b.filter(function(a){return a===h.STARTED}).length,canceled:b.filter(function(a){return a===h.CANCELED}).length,failed:b.filter(function(a){return a===h.FAILED}).length}};return a}(),j=function(){function a(){}var b=a.prototype;b.logFlowStarted=function(){};b.logFlowFinished=function(){};b.logFlowCanceled=function(){};b.logFlowFailed=function(){};b.release=function(){};return a}(),k=function(){function a(a,b){var e=this;this.$2=b;this.$1=a;this.$4=new Set();this.$3=new(c("SubscriptionsHandler"))();a.cancel_on_unload&&this.$3.addSubscriptions(c("Banzai").subscribe(c("Banzai").SHUTDOWN,function(){return e.$6("shutdown")}));a.cancel_on_leave&&this.$3.addSubscriptions(d("Run").onLeave(function(){return e.$6("leave")}))}var b=a.prototype;b.release=function(){this.$3.release()};b.$7=function(){var a=this.$2.getSummary(),b=this.$5;return{composer_session_id:this.$1.composer_session_id,source_type:this.$1.source,target_id:this.$1.target_id,target_type:this.$1.target_type,composer_entry_point_ref:this.$1.composer_entry_point_ref,total_uploads:a.total,started_uploads:a.started,successful_uploads:a.successful,canceled_uploads:a.canceled,failed_uploads:a.failed,elapsed_time:b!=null?Date.now()-b:null}};b.logFlowFinished=function(){var a=this;this.$4.has(c("MediaFinishedPostFlowFalcoEvent"))||(c("MediaFinishedPostFlowFalcoEvent").log(function(){return a.$7()}),this.$4.add(c("MediaFinishedPostFlowFalcoEvent")))};b.logFlowStarted=function(){var a=this;this.$4.has(c("MediaStartedPostFlowFalcoEvent"))||(c("MediaStartedPostFlowFalcoEvent").log(function(){return a.$7()}),this.$5=Date.now(),this.$4.add(c("MediaStartedPostFlowFalcoEvent")))};b.logFlowCanceled=function(){this.$6("user")};b.logFlowFailed=function(){var a=this;this.$4.has(c("MediaFailedPostFlowFalcoEvent"))||(c("MediaFailedPostFlowFalcoEvent").log(function(){return a.$7()}),this.$4.add(c("MediaFailedPostFlowFalcoEvent")))};b.$6=function(a){var b=this;this.$4.has(c("MediaCancelledPostFlowFalcoEvent"))||(c("MediaCancelledPostFlowFalcoEvent").log(function(){return babelHelpers["extends"]({},b.$7(),{event_reason:a})}),this.$4.add(c("MediaCancelledPostFlowFalcoEvent")))};return a}(),l=function(){function a(a,b){var e=this;this.$1=b;this.$3=new Set();this.$4=new(d("VideoUploadLoggerTyped").VideoUploadLogger)({source:a.source,waterfall_id:a.composer_session_id,composer_session_id:a.composer_session_id,target_id:a.target_id,composer_entry_point_ref:a.composer_entry_point_ref,reported_by_notifier:!0});this.$2=new(c("SubscriptionsHandler"))();this.$2.addSubscriptions(this.$4.postOnShutdown(function(){return e.$5("shutdown")}));a.cancel_on_leave&&this.$2.addSubscriptions(d("Run").onLeave(function(){return e.$5("leave")}))}var b=a.prototype;b.release=function(){this.$2.release()};b.logFlowFinished=function(){this.$6(d("VideoUploadLoggerEvents").VideoUploadLoggerEvents.EVENT_FINISHED_FLOW)};b.logFlowStarted=function(){this.$6(d("VideoUploadLoggerEvents").VideoUploadLoggerEvents.EVENT_STARTED_FLOW)};b.logFlowCanceled=function(){this.$5("user")};b.logFlowFailed=function(){this.$6(d("VideoUploadLoggerEvents").VideoUploadLoggerEvents.EVENT_FAILED_FLOW)};b.$6=function(a,b){if(!this.$3.has(a)){var c=this.$1.getSummary();this.$4.logEvent(a,babelHelpers["extends"]({},b,{debug:{total_uploads:c.total,started_uploads:c.started,successful_uploads:c.successful,canceled_uploads:c.canceled,failed_uploads:c.failed}}));this.$3.add(a)}};b.$5=function(a){this.$6(d("VideoUploadLoggerEvents").VideoUploadLoggerEvents.EVENT_CANCELED_FLOW,{event_reason:a})};return a}(),m=Object.freeze({UPLOAD_USER_REMOVED:"upload_removed"}),n=Object.freeze({POST_USER_CANCELED:"post_user_canceled",POST_USER_REQUESTED:"post_user_requested",POST_FAILED:"post_failed",POST_SUCCESSFUL:"post_successful"});function o(a){return a==null?d("WaterfallIDGenerator").generate():a}function a(a){if(a.extended_flow_logging_enabled)return new q(a);else return p.getInstance()}var p=function(){function a(){}a.getInstance=function(){return a.$1};var b=a.prototype;b.registerVideoUpload=function(a,b){return o(b)};b.notifyOnUploadAction=function(a){};b.notifyOnPostAction=function(a){};return a}();p.$1=new p();var q=function(){function a(a){this.$3=a,this.$5=new i(),this.$2=new j(),this.$1=!1,this.$4=a.composer_session_id==null?d("WaterfallIDGenerator").generate():a.composer_session_id}var b=a.prototype;b.$6=function(){var a=d("VideoUploadLoggerTyped").VideoUploadLogger.shouldSendFlowEventsViaNotifier({source_type:this.$3.source,composer_entry_point_ref:this.$3.composer_entry_point_ref});a=a?l:k;return new a({composer_entry_point_ref:this.$3.composer_entry_point_ref,source:this.$3.source,target_id:this.$3.target_id,target_type:this.$3.target_type,composer_session_id:this.$4,cancel_on_leave:this.$3.cancel_on_leave,cancel_on_unload:this.$3.cancel_on_unload==null?!0:this.$3.cancel_on_unload},this.$5)};b.registerVideoUpload=function(a,b){b=o(b);a.setComposerSessionID(this.$4);this.$5.registerUpload(a,b);return b};b.notifyOnUploadAction=function(a){switch(a.action){case m.UPLOAD_USER_REMOVED:this.$5.cancelUpload(a.trackingID);break}};b.notifyOnPostAction=function(a){switch(a.action){case n.POST_USER_REQUESTED:!this.$1&&this.$5.areAnyVideosIncludedInPost()&&(this.$2=this.$6(),this.$1=!0);this.$2.logFlowStarted();break;case n.POST_FAILED:this.$2.logFlowFailed();this.$2.release();break;case n.POST_SUCCESSFUL:this.$2.logFlowFinished();this.$2.release();this.$2=new j();break;case n.POST_USER_CANCELED:this.$2.logFlowCanceled();this.$2.release();break}};return a}();g.VideoUploadActions=m;g.VideoPostActions=n;g.createVideoUploadFlowNotifier=a;g.NoOpVideoUploadFlowNotifier=p}),98);
-----
VideoUploadLogger",["Banzai","CurrentUser","VideoUploadLoggerEvents","VideoUploadLoggingConfig","logVideoUploadViaFalco"],(function(a,b,c,d,e,f,g){a=babelHelpers["extends"]({BANZAI_GK:"videos",BANZAI_ROUTE:"video_waterfall",SOURCE_SIMPLE:"simple",SOURCE_COMPOSER:"composer"},d("VideoUploadLoggerEvents").VideoUploadLoggerEvents);var h=new Set([d("VideoUploadLoggerEvents").VideoUploadLoggerEvents.EVENT_STARTED_FLOW,d("VideoUploadLoggerEvents").VideoUploadLoggerEvents.EVENT_FINISHED_FLOW,d("VideoUploadLoggerEvents").VideoUploadLoggerEvents.EVENT_FAILED_FLOW,d("VideoUploadLoggerEvents").VideoUploadLoggerEvents.EVENT_CANCELED_FLOW]);b=function(){function a(b){this.$1=b.source,this.$2=b.composer_dialog_version,this.$3=b.waterfall_id,this.$4=b.ad_account_id,this.$5=b.target_id,this.$6=b.delay,this.$7=[],this.$8=b.is_chunked_upload,this.$9=b.actor_id,this.$10=b.composer_entry_point_ref,this.$11=b.composer_work_shared_draft_mode,this.$12=b.is_remote_upload,this.$13=b.container_type,this.$14=b.has_file_been_replaced,this.$15=b.composer_session_id,this.$16=b.creative_tools,this.$17=b.asset_id,this.$18=c("CurrentUser").getAppID(),this.$19=!Boolean(b.reported_by_notifier)&&a.shouldSendFlowEventsViaNotifier({source_type:b.source,composer_entry_point_ref:b.composer_entry_point_ref})}a.shouldSendFlowEventsViaNotifier=function(a){return Boolean((c("VideoUploadLoggingConfig").FLOW_VIA_NOTIFIER_COMPOSERS||[]).find(function(b){return b.source_type===a.source_type&&b.composer_entry_point_ref===a.composer_entry_point_ref}))};var b=a.prototype;b.logEvent=function(a,b){if(this.$19&&h.has(a))return;b=babelHelpers["extends"]({},b);b.elapsed_time==null&&(a.indexOf("started")!==-1?this.$7[a]=Date.now():a.indexOf("finished")!==-1?b.elapsed_time=this.$20(a,"finished"):a.indexOf("canceled")!==-1?b.elapsed_time=this.$20(a,"canceled"):a.indexOf("failed")!==-1&&(b.elapsed_time=this.$20(a,"failed")));b.event=a;b.source=this.$1;b.composer_dialog_version=b.composer_dialog_version||this.$2;b.waterfall_id=this.$3;b.ad_account_id=this.$4;b.target_id=this.$5;b.is_chunked_upload=this.$8;b.actor_id=this.$9;b.composer_entry_point_ref=this.$10;b.composer_work_shared_draft_mode=this.$11;b.is_remote_upload=this.$12;b.container_type=this.$13;b.has_file_been_replaced=this.$14;b.trigger_time=Date.now();b.composer_session_id=this.$15;b.asset_id=this.$17;b.app_id=this.$18;c("logVideoUploadViaFalco")(b)};b.postOnShutdown=function(a){return c("Banzai").subscribe(c("Banzai").SHUTDOWN,a)};b.getWaterfallID=function(){return this.$3};b.$20=function(a,b){a=a.replace(b,"started");b=this.$7[a];return b?Date.now()-b:null};return a}();Object.assign(b,a);e=b;g["default"]=e}),98);
-----
VideoUploadLoggerEvents",[],(function(a,b,c,d,e,f){"use strict";a=Object.freeze({EVENT_STARTED_GENERATE_THUMBNAILS:"upload.client.started_generate_thumbnails",EVENT_FINISHED_GENERATE_THUMBNAILS:"upload.client.finished_generate_thumbnails",EVENT_SELECTED_CUSTOM_THUMBNAIL:"upload.client.selected_custom_thumbnail",EVENT_VIDEO_DIMENSIONS_UNREADABLE:"upload.client.video_dimensions_unreadable",EVENT_REPLACE_VIDEO:"upload.client.replace_video",EVENT_STARTED_FLOW:"upload.client.started_flow",EVENT_FINISHED_FLOW:"upload.client.finished_flow",EVENT_FAILED_FLOW:"upload.client.failed_flow",EVENT_CANCELED_FLOW:"upload.client.canceled_flow",EVENT_RESIGNED_FLOW:"upload.client.resigned_flow",EVENT_REQUESTED_UPLOADING:"upload.client.requested_uploading",EVENT_INVALIDATED_UPLOADING:"upload.client.invalidated_uploading",EVENT_STARTED_UPLOADING:"upload.client.started_uploading",EVENT_PROGRESS_UPLOADING_START_REQUEST:"upload.client.progress_uploading_start_request",EVENT_FINISHED_UPLOADING:"upload.client.finished_uploading",EVENT_CANCELED_UPLOADING:"upload.client.canceled_uploading",EVENT_ABANDONED_UPLOADING:"upload.client.abandoned_uploading",EVENT_FAILED_UPLOADING:"upload.client.failed_uploading",EVENT_STARTED_SENDING_BYTES:"upload.client.started_sending_bytes",EVENT_FINISHED_SENDING_BYTES:"upload.client.finished_sending_bytes",EVENT_CANCELED_SENDING_BYTES:"upload.client.canceled_sending_bytes",EVENT_FAILED_SENDING_BYTES:"upload.client.failed_sending_bytes",EVENT_STARTED_START_REQUEST:"upload.client.started_sending_start_request",EVENT_FINISHED_START_REQUEST:"upload.client.finished_sending_start_request",EVENT_FAILED_START_REQUEST:"upload.client.failed_sending_start_request",EVENT_CANCELED_START_REQUEST:"upload.client.canceled_sending_start_request",EVENT_STARTED_RECEIVE_REQUEST:"upload.client.started_sending_receive_request",EVENT_FINISHED_RECEIVE_REQUEST:"upload.client.finished_sending_receive_request",EVENT_FAILED_RECEIVE_REQUEST:"upload.client.failed_sending_receive_request",EVENT_STARTED_POST_REQUEST:"upload.client.started_sending_post_request",EVENT_FINISHED_POST_REQUEST:"upload.client.finished_sending_post_request",EVENT_FAILED_POST_REQUEST:"upload.client.failed_sending_post_request",EVENT_HANDLING_SERVER_FAILURE_RESPONSE:"upload.client.handling_server_failure_response",EVENT_HANDLING_TRANSPORT_FAILURE_RESPONSE:"upload.client.handling_transport_failure_response",EVENT_DUPLICATE_POST_REQUEST:"upload.client.duplicate_post_request",EVENT_STARTED_SENDING_CHUNK_BYTES:"upload.client.started_sending_chunk_bytes",EVENT_FINISHED_SENDING_CHUNK_BYTES:"upload.client.finished_sending_chunk_bytes",EVENT_CANCELED_SENDING_CHUNK_BYTES:"upload.client.canceled_sending_chunk_bytes",EVENT_FAILED_SENDING_CHUNK_BYTES:"upload.client.failed_sending_chunk_bytes",EVENT_TIMEOUT_SENDING_CHUNK_BYTES:"upload.client.timeout_sending_chunk_bytes",EVENT_STARTED_FETCHING_STATUS:"upload.client.started_fetching_status",EVENT_FINISHED_FETCHING_STATUS:"upload.client.finished_fetching_status",EVENT_STARTED_POST_FLOW:"upload.client.started_post_flow",EVENT_FINISHED_POST_FLOW:"upload.client.finished_post_flow",EVENT_CANCELED_POST_FLOW:"upload.client.canceled_post_flow",EVENT_FAILED_POST_FLOW:"upload.client.failed_post_flow",EVENT_RETRY_ATTEMPT:"upload.client.retry_attempt",EVENT_RESUMABLE_CALLED:"upload.client.resumable_called",EVENT_RESUMABLE_STARTED:"upload.client.resumable_started",EVENT_RESUMABLE_SUCCESS:"upload.client.resumable_success",EVENT_RESUMABLE_FAILED:"upload.client.resumable_failed",EVENT_ENCODING_START_OBSERVED:"encode.client.encoding_start_observed",EVENT_ENCODING_SUCCESS_OBSERVED:"encode.client.encoding_success_observed",EVENT_ENCODING_FAIL_OBSERVED:"encode.client.encoding_fail_observed",EVENT_ENCODING_ABORT_OBSERVED:"encode.client.encoding_abort_observed",EVENT_FETCH_FAIL_OBSERVED:"encode.client.fetch_video_info_fail_observed",EVENT_ENCODING_SUBSCRIBE_TO_VIDEO_STATUS:"encode.client.subscribe_to_video_status",EVENT_ENCODING_POLLING_FALLBACK:"encode.client.polling_fallback",EVENT_RECEIVED_RESPONSE:"upload.client.received_response",EVENT_STARTED_FLOW_EXP1:"upload.client.started_flow_exp1",EVENT_FINISHED_FLOW_EXP1:"upload.client.finished_flow_exp1",EVENT_CANCELED_FLOW_EXP1:"upload.client.canceled_flow_exp1",EVENT_MEASURE_FREE_LOCAL_STORAGE:"upload.client.free_local_storage"});f.VideoUploadLoggerEvents=a}),66);
-----
-----
VideoUploadLoggerEvents",[],(function(a,b,c,d,e,f){"use strict";a=Object.freeze({EVENT_STARTED_GENERATE_THUMBNAILS:"upload.client.started_generate_thumbnails",EVENT_FINISHED_GENERATE_THUMBNAILS:"upload.client.finished_generate_thumbnails",EVENT_SELECTED_CUSTOM_THUMBNAIL:"upload.client.selected_custom_thumbnail",EVENT_VIDEO_DIMENSIONS_UNREADABLE:"upload.client.video_dimensions_unreadable",EVENT_REPLACE_VIDEO:"upload.client.replace_video",EVENT_STARTED_FLOW:"upload.client.started_flow",EVENT_FINISHED_FLOW:"upload.client.finished_flow",EVENT_FAILED_FLOW:"upload.client.failed_flow",EVENT_CANCELED_FLOW:"upload.client.canceled_flow",EVENT_RESIGNED_FLOW:"upload.client.resigned_flow",EVENT_REQUESTED_UPLOADING:"upload.client.requested_uploading",EVENT_INVALIDATED_UPLOADING:"upload.client.invalidated_uploading",EVENT_STARTED_UPLOADING:"upload.client.started_uploading",EVENT_PROGRESS_UPLOADING_START_REQUEST:"upload.client.progress_uploading_start_request",EVENT_FINISHED_UPLOADING:"upload.client.finished_uploading",EVENT_CANCELED_UPLOADING:"upload.client.canceled_uploading",EVENT_ABANDONED_UPLOADING:"upload.client.abandoned_uploading",EVENT_FAILED_UPLOADING:"upload.client.failed_uploading",EVENT_STARTED_SENDING_BYTES:"upload.client.started_sending_bytes",EVENT_FINISHED_SENDING_BYTES:"upload.client.finished_sending_bytes",EVENT_CANCELED_SENDING_BYTES:"upload.client.canceled_sending_bytes",EVENT_FAILED_SENDING_BYTES:"upload.client.failed_sending_bytes",EVENT_STARTED_START_REQUEST:"upload.client.started_sending_start_request",EVENT_FINISHED_START_REQUEST:"upload.client.finished_sending_start_request",EVENT_FAILED_START_REQUEST:"upload.client.failed_sending_start_request",EVENT_CANCELED_START_REQUEST:"upload.client.canceled_sending_start_request",EVENT_STARTED_RECEIVE_REQUEST:"upload.client.started_sending_receive_request",EVENT_FINISHED_RECEIVE_REQUEST:"upload.client.finished_sending_receive_request",EVENT_FAILED_RECEIVE_REQUEST:"upload.client.failed_sending_receive_request",EVENT_STARTED_POST_REQUEST:"upload.client.started_sending_post_request",EVENT_FINISHED_POST_REQUEST:"upload.client.finished_sending_post_request",EVENT_FAILED_POST_REQUEST:"upload.client.failed_sending_post_request",EVENT_HANDLING_SERVER_FAILURE_RESPONSE:"upload.client.handling_server_failure_response",EVENT_HANDLING_TRANSPORT_FAILURE_RESPONSE:"upload.client.handling_transport_failure_response",EVENT_DUPLICATE_POST_REQUEST:"upload.client.duplicate_post_request",EVENT_STARTED_SENDING_CHUNK_BYTES:"upload.client.started_sending_chunk_bytes",EVENT_FINISHED_SENDING_CHUNK_BYTES:"upload.client.finished_sending_chunk_bytes",EVENT_CANCELED_SENDING_CHUNK_BYTES:"upload.client.canceled_sending_chunk_bytes",EVENT_FAILED_SENDING_CHUNK_BYTES:"upload.client.failed_sending_chunk_bytes",EVENT_TIMEOUT_SENDING_CHUNK_BYTES:"upload.client.timeout_sending_chunk_bytes",EVENT_STARTED_FETCHING_STATUS:"upload.client.started_fetching_status",EVENT_FINISHED_FETCHING_STATUS:"upload.client.finished_fetching_status",EVENT_STARTED_POST_FLOW:"upload.client.started_post_flow",EVENT_FINISHED_POST_FLOW:"upload.client.finished_post_flow",EVENT_CANCELED_POST_FLOW:"upload.client.canceled_post_flow",EVENT_FAILED_POST_FLOW:"upload.client.failed_post_flow",EVENT_RETRY_ATTEMPT:"upload.client.retry_attempt",EVENT_RESUMABLE_CALLED:"upload.client.resumable_called",EVENT_RESUMABLE_STARTED:"upload.client.resumable_started",EVENT_RESUMABLE_SUCCESS:"upload.client.resumable_success",EVENT_RESUMABLE_FAILED:"upload.client.resumable_failed",EVENT_ENCODING_START_OBSERVED:"encode.client.encoding_start_observed",EVENT_ENCODING_SUCCESS_OBSERVED:"encode.client.encoding_success_observed",EVENT_ENCODING_FAIL_OBSERVED:"encode.client.encoding_fail_observed",EVENT_ENCODING_ABORT_OBSERVED:"encode.client.encoding_abort_observed",EVENT_FETCH_FAIL_OBSERVED:"encode.client.fetch_video_info_fail_observed",EVENT_ENCODING_SUBSCRIBE_TO_VIDEO_STATUS:"encode.client.subscribe_to_video_status",EVENT_ENCODING_POLLING_FALLBACK:"encode.client.polling_fallback",EVENT_RECEIVED_RESPONSE:"upload.client.received_response",EVENT_STARTED_FLOW_EXP1:"upload.client.started_flow_exp1",EVENT_FINISHED_FLOW_EXP1:"upload.client.finished_flow_exp1",EVENT_CANCELED_FLOW_EXP1:"upload.client.canceled_flow_exp1",EVENT_MEASURE_FREE_LOCAL_STORAGE:"upload.client.free_local_storage"});f.VideoUploadLoggerEvents=a}),66);
-----
VideoUploadFlowNotifier",["Banzai","MediaCancelledPostFlowFalcoEvent","MediaFailedPostFlowFalcoEvent","MediaFinishedPostFlowFalcoEvent","MediaStartedPostFlowFalcoEvent","Run","SubscriptionsHandler","VideoUploadLoggerEvents","VideoUploadLoggerTyped","WaterfallIDGenerator"],(function(a,b,c,d,e,f,g){"use strict";var h=Object.freeze({SUCCESSFUL:"successful",FAILED:"failed",CANCELED:"canceled",REQUESTED:"requested",STARTED:"started"}),i=function(){function a(){this.$1={}}var b=a.prototype;b.registerUpload=function(a,b){var c={isStarted:!1,isUploaded:!1,isCanceled:!1,isFailed:!1};this.$1[String(b)]=c;a.subscribe("upload-started",function(){c.isStarted=!0});a.subscribe("upload-canceled",function(){c.isCanceled=!0});a.subscribe("upload-failed",function(){c.isFailed=!0});a.subscribe("upload-finished",function(){c.isUploaded=!0})};b.cancelUpload=function(a){a=this.$1[String(a)];a!=null&&(a.isCanceled=!0)};b.$2=function(a){if(a.isCanceled)return h.CANCELED;else if(a.isUploaded)return h.SUCCESSFUL;else if(a.isFailed)return h.FAILED;else if(a.isStarted)return h.STARTED;else return h.REQUESTED};b.areAnyVideosIncludedInPost=function(){var a=this,b=Object.keys(this.$1).map(function(b){return a.$2(a.$1[b])});return b.some(function(a){return a!==h.CANCELED})};b.getSummary=function(){var a=this,b=Object.keys(this.$1).map(function(b){return a.$2(a.$1[b])});return{total:b.length,successful:b.filter(function(a){return a===h.SUCCESSFUL}).length,started:b.filter(function(a){return a===h.STARTED}).length,canceled:b.filter(function(a){return a===h.CANCELED}).length,failed:b.filter(function(a){return a===h.FAILED}).length}};return a}(),j=function(){function a(){}var b=a.prototype;b.logFlowStarted=function(){};b.logFlowFinished=function(){};b.logFlowCanceled=function(){};b.logFlowFailed=function(){};b.release=function(){};return a}(),k=function(){function a(a,b){var e=this;this.$2=b;this.$1=a;this.$4=new Set();this.$3=new(c("SubscriptionsHandler"))();a.cancel_on_unload&&this.$3.addSubscriptions(c("Banzai").subscribe(c("Banzai").SHUTDOWN,function(){return e.$6("shutdown")}));a.cancel_on_leave&&this.$3.addSubscriptions(d("Run").onLeave(function(){return e.$6("leave")}))}var b=a.prototype;b.release=function(){this.$3.release()};b.$7=function(){var a=this.$2.getSummary(),b=this.$5;return{composer_session_id:this.$1.composer_session_id,source_type:this.$1.source,target_id:this.$1.target_id,target_type:this.$1.target_type,composer_entry_point_ref:this.$1.composer_entry_point_ref,total_uploads:a.total,started_uploads:a.started,successful_uploads:a.successful,canceled_uploads:a.canceled,failed_uploads:a.failed,elapsed_time:b!=null?Date.now()-b:null}};b.logFlowFinished=function(){var a=this;this.$4.has(c("MediaFinishedPostFlowFalcoEvent"))||(c("MediaFinishedPostFlowFalcoEvent").log(function(){return a.$7()}),this.$4.add(c("MediaFinishedPostFlowFalcoEvent")))};b.logFlowStarted=function(){var a=this;this.$4.has(c("MediaStartedPostFlowFalcoEvent"))||(c("MediaStartedPostFlowFalcoEvent").log(function(){return a.$7()}),this.$5=Date.now(),this.$4.add(c("MediaStartedPostFlowFalcoEvent")))};b.logFlowCanceled=function(){this.$6("user")};b.logFlowFailed=function(){var a=this;this.$4.has(c("MediaFailedPostFlowFalcoEvent"))||(c("MediaFailedPostFlowFalcoEvent").log(function(){return a.$7()}),this.$4.add(c("MediaFailedPostFlowFalcoEvent")))};b.$6=function(a){var b=this;this.$4.has(c("MediaCancelledPostFlowFalcoEvent"))||(c("MediaCancelledPostFlowFalcoEvent").log(function(){return babelHelpers["extends"]({},b.$7(),{event_reason:a})}),this.$4.add(c("MediaCancelledPostFlowFalcoEvent")))};return a}(),l=function(){function a(a,b){var e=this;this.$1=b;this.$3=new Set();this.$4=new(d("VideoUploadLoggerTyped").VideoUploadLogger)({source:a.source,waterfall_id:a.composer_session_id,composer_session_id:a.composer_session_id,target_id:a.target_id,composer_entry_point_ref:a.composer_entry_point_ref,reported_by_notifier:!0});this.$2=new(c("SubscriptionsHandler"))();this.$2.addSubscriptions(this.$4.postOnShutdown(function(){return e.$5("shutdown")}));a.cancel_on_leave&&this.$2.addSubscriptions(d("Run").onLeave(function(){return e.$5("leave")}))}var b=a.prototype;b.release=function(){this.$2.release()};b.logFlowFinished=function(){this.$6(d("VideoUploadLoggerEvents").VideoUploadLoggerEvents.EVENT_FINISHED_FLOW)};b.logFlowStarted=function(){this.$6(d("VideoUploadLoggerEvents").VideoUploadLoggerEvents.EVENT_STARTED_FLOW)};b.logFlowCanceled=function(){this.$5("user")};b.logFlowFailed=function(){this.$6(d("VideoUploadLoggerEvents").VideoUploadLoggerEvents.EVENT_FAILED_FLOW)};b.$6=function(a,b){if(!this.$3.has(a)){var c=this.$1.getSummary();this.$4.logEvent(a,babelHelpers["extends"]({},b,{debug:{total_uploads:c.total,started_uploads:c.started,successful_uploads:c.successful,canceled_uploads:c.canceled,failed_uploads:c.failed}}));this.$3.add(a)}};b.$5=function(a){this.$6(d("VideoUploadLoggerEvents").VideoUploadLoggerEvents.EVENT_CANCELED_FLOW,{event_reason:a})};return a}(),m=Object.freeze({UPLOAD_USER_REMOVED:"upload_removed"}),n=Object.freeze({POST_USER_CANCELED:"post_user_canceled",POST_USER_REQUESTED:"post_user_requested",POST_FAILED:"post_failed",POST_SUCCESSFUL:"post_successful"});function o(a){return a==null?d("WaterfallIDGenerator").generate():a}function a(a){if(a.extended_flow_logging_enabled)return new q(a);else return p.getInstance()}var p=function(){function a(){}a.getInstance=function(){return a.$1};var b=a.prototype;b.registerVideoUpload=function(a,b){return o(b)};b.notifyOnUploadAction=function(a){};b.notifyOnPostAction=function(a){};return a}();p.$1=new p();var q=function(){function a(a){this.$3=a,this.$5=new i(),this.$2=new j(),this.$1=!1,this.$4=a.composer_session_id==null?d("WaterfallIDGenerator").generate():a.composer_session_id}var b=a.prototype;b.$6=function(){var a=d("VideoUploadLoggerTyped").VideoUploadLogger.shouldSendFlowEventsViaNotifier({source_type:this.$3.source,composer_entry_point_ref:this.$3.composer_entry_point_ref});a=a?l:k;return new a({composer_entry_point_ref:this.$3.composer_entry_point_ref,source:this.$3.source,target_id:this.$3.target_id,target_type:this.$3.target_type,composer_session_id:this.$4,cancel_on_leave:this.$3.cancel_on_leave,cancel_on_unload:this.$3.cancel_on_unload==null?!0:this.$3.cancel_on_unload},this.$5)};b.registerVideoUpload=function(a,b){b=o(b);a.setComposerSessionID(this.$4);this.$5.registerUpload(a,b);return b};b.notifyOnUploadAction=function(a){switch(a.action){case m.UPLOAD_USER_REMOVED:this.$5.cancelUpload(a.trackingID);break}};b.notifyOnPostAction=function(a){switch(a.action){case n.POST_USER_REQUESTED:!this.$1&&this.$5.areAnyVideosIncludedInPost()&&(this.$2=this.$6(),this.$1=!0);this.$2.logFlowStarted();break;case n.POST_FAILED:this.$2.logFlowFailed();this.$2.release();break;case n.POST_SUCCESSFUL:this.$2.logFlowFinished();this.$2.release();this.$2=new j();break;case n.POST_USER_CANCELED:this.$2.logFlowCanceled();this.$2.release();break}};return a}();g.VideoUploadActions=m;g.VideoPostActions=n;g.createVideoUploadFlowNotifier=a;g.NoOpVideoUploadFlowNotifier=p}),98);
-----
VideoUploadFlowNotifier",["Banzai","MediaCancelledPostFlowFalcoEvent","MediaFailedPostFlowFalcoEvent","MediaFinishedPostFlowFalcoEvent","MediaStartedPostFlowFalcoEvent","Run","SubscriptionsHandler","VideoUploadLoggerEvents","VideoUploadLoggerTyped","WaterfallIDGenerator"],(function(a,b,c,d,e,f,g){"use strict";var h=Object.freeze({SUCCESSFUL:"successful",FAILED:"failed",CANCELED:"canceled",REQUESTED:"requested",STARTED:"started"}),i=function(){function a(){this.$1={}}var b=a.prototype;b.registerUpload=function(a,b){var c={isStarted:!1,isUploaded:!1,isCanceled:!1,isFailed:!1};this.$1[String(b)]=c;a.subscribe("upload-started",function(){c.isStarted=!0});a.subscribe("upload-canceled",function(){c.isCanceled=!0});a.subscribe("upload-failed",function(){c.isFailed=!0});a.subscribe("upload-finished",function(){c.isUploaded=!0})};b.cancelUpload=function(a){a=this.$1[String(a)];a!=null&&(a.isCanceled=!0)};b.$2=function(a){if(a.isCanceled)return h.CANCELED;else if(a.isUploaded)return h.SUCCESSFUL;else if(a.isFailed)return h.FAILED;else if(a.isStarted)return h.STARTED;else return h.REQUESTED};b.areAnyVideosIncludedInPost=function(){var a=this,b=Object.keys(this.$1).map(function(b){return a.$2(a.$1[b])});return b.some(function(a){return a!==h.CANCELED})};b.getSummary=function(){var a=this,b=Object.keys(this.$1).map(function(b){return a.$2(a.$1[b])});return{total:b.length,successful:b.filter(function(a){return a===h.SUCCESSFUL}).length,started:b.filter(function(a){return a===h.STARTED}).length,canceled:b.filter(function(a){return a===h.CANCELED}).length,failed:b.filter(function(a){return a===h.FAILED}).length}};return a}(),j=function(){function a(){}var b=a.prototype;b.logFlowStarted=function(){};b.logFlowFinished=function(){};b.logFlowCanceled=function(){};b.logFlowFailed=function(){};b.release=function(){};return a}(),k=function(){function a(a,b){var e=this;this.$2=b;this.$1=a;this.$4=new Set();this.$3=new(c("SubscriptionsHandler"))();a.cancel_on_unload&&this.$3.addSubscriptions(c("Banzai").subscribe(c("Banzai").SHUTDOWN,function(){return e.$6("shutdown")}));a.cancel_on_leave&&this.$3.addSubscriptions(d("Run").onLeave(function(){return e.$6("leave")}))}var b=a.prototype;b.release=function(){this.$3.release()};b.$7=function(){var a=this.$2.getSummary(),b=this.$5;return{composer_session_id:this.$1.composer_session_id,source_type:this.$1.source,target_id:this.$1.target_id,target_type:this.$1.target_type,composer_entry_point_ref:this.$1.composer_entry_point_ref,total_uploads:a.total,started_uploads:a.started,successful_uploads:a.successful,canceled_uploads:a.canceled,failed_uploads:a.failed,elapsed_time:b!=null?Date.now()-b:null}};b.logFlowFinished=function(){var a=this;this.$4.has(c("MediaFinishedPostFlowFalcoEvent"))||(c("MediaFinishedPostFlowFalcoEvent").log(function(){return a.$7()}),this.$4.add(c("MediaFinishedPostFlowFalcoEvent")))};b.logFlowStarted=function(){var a=this;this.$4.has(c("MediaStartedPostFlowFalcoEvent"))||(c("MediaStartedPostFlowFalcoEvent").log(function(){return a.$7()}),this.$5=Date.now(),this.$4.add(c("MediaStartedPostFlowFalcoEvent")))};b.logFlowCanceled=function(){this.$6("user")};b.logFlowFailed=function(){var a=this;this.$4.has(c("MediaFailedPostFlowFalcoEvent"))||(c("MediaFailedPostFlowFalcoEvent").log(function(){return a.$7()}),this.$4.add(c("MediaFailedPostFlowFalcoEvent")))};b.$6=function(a){var b=this;this.$4.has(c("MediaCancelledPostFlowFalcoEvent"))||(c("MediaCancelledPostFlowFalcoEvent").log(function(){return babelHelpers["extends"]({},b.$7(),{event_reason:a})}),this.$4.add(c("MediaCancelledPostFlowFalcoEvent")))};return a}(),l=function(){function a(a,b){var e=this;this.$1=b;this.$3=new Set();this.$4=new(d("VideoUploadLoggerTyped").VideoUploadLogger)({source:a.source,waterfall_id:a.composer_session_id,composer_session_id:a.composer_session_id,target_id:a.target_id,composer_entry_point_ref:a.composer_entry_point_ref,reported_by_notifier:!0});this.$2=new(c("SubscriptionsHandler"))();this.$2.addSubscriptions(this.$4.postOnShutdown(function(){return e.$5("shutdown")}));a.cancel_on_leave&&this.$2.addSubscriptions(d("Run").onLeave(function(){return e.$5("leave")}))}var b=a.prototype;b.release=function(){this.$2.release()};b.logFlowFinished=function(){this.$6(d("VideoUploadLoggerEvents").VideoUploadLoggerEvents.EVENT_FINISHED_FLOW)};b.logFlowStarted=function(){this.$6(d("VideoUploadLoggerEvents").VideoUploadLoggerEvents.EVENT_STARTED_FLOW)};b.logFlowCanceled=function(){this.$5("user")};b.logFlowFailed=function(){this.$6(d("VideoUploadLoggerEvents").VideoUploadLoggerEvents.EVENT_FAILED_FLOW)};b.$6=function(a,b){if(!this.$3.has(a)){var c=this.$1.getSummary();this.$4.logEvent(a,babelHelpers["extends"]({},b,{debug:{total_uploads:c.total,started_uploads:c.started,successful_uploads:c.successful,canceled_uploads:c.canceled,failed_uploads:c.failed}}));this.$3.add(a)}};b.$5=function(a){this.$6(d("VideoUploadLoggerEvents").VideoUploadLoggerEvents.EVENT_CANCELED_FLOW,{event_reason:a})};return a}(),m=Object.freeze({UPLOAD_USER_REMOVED:"upload_removed"}),n=Object.freeze({POST_USER_CANCELED:"post_user_canceled",POST_USER_REQUESTED:"post_user_requested",POST_FAILED:"post_failed",POST_SUCCESSFUL:"post_successful"});function o(a){return a==null?d("WaterfallIDGenerator").generate():a}function a(a){if(a.extended_flow_logging_enabled)return new q(a);else return p.getInstance()}var p=function(){function a(){}a.getInstance=function(){return a.$1};var b=a.prototype;b.registerVideoUpload=function(a,b){return o(b)};b.notifyOnUploadAction=function(a){};b.notifyOnPostAction=function(a){};return a}();p.$1=new p();var q=function(){function a(a){this.$3=a,this.$5=new i(),this.$2=new j(),this.$1=!1,this.$4=a.composer_session_id==null?d("WaterfallIDGenerator").generate():a.composer_session_id}var b=a.prototype;b.$6=function(){var a=d("VideoUploadLoggerTyped").VideoUploadLogger.shouldSendFlowEventsViaNotifier({source_type:this.$3.source,composer_entry_point_ref:this.$3.composer_entry_point_ref});a=a?l:k;return new a({composer_entry_point_ref:this.$3.composer_entry_point_ref,source:this.$3.source,target_id:this.$3.target_id,target_type:this.$3.target_type,composer_session_id:this.$4,cancel_on_leave:this.$3.cancel_on_leave,cancel_on_unload:this.$3.cancel_on_unload==null?!0:this.$3.cancel_on_unload},this.$5)};b.registerVideoUpload=function(a,b){b=o(b);a.setComposerSessionID(this.$4);this.$5.registerUpload(a,b);return b};b.notifyOnUploadAction=function(a){switch(a.action){case m.UPLOAD_USER_REMOVED:this.$5.cancelUpload(a.trackingID);break}};b.notifyOnPostAction=function(a){switch(a.action){case n.POST_USER_REQUESTED:!this.$1&&this.$5.areAnyVideosIncludedInPost()&&(this.$2=this.$6(),this.$1=!0);this.$2.logFlowStarted();break;case n.POST_FAILED:this.$2.logFlowFailed();this.$2.release();break;case n.POST_SUCCESSFUL:this.$2.logFlowFinished();this.$2.release();this.$2=new j();break;case n.POST_USER_CANCELED:this.$2.logFlowCanceled();this.$2.release();break}};return a}();g.VideoUploadActions=m;g.VideoPostActions=n;g.createVideoUploadFlowNotifier=a;g.NoOpVideoUploadFlowNotifier=p}),98);
-----
VideoUploadLogger",["Banzai","CurrentUser","VideoUploadLoggerEvents","VideoUploadLoggingConfig","logVideoUploadViaFalco"],(function(a,b,c,d,e,f,g){a=babelHelpers["extends"]({BANZAI_GK:"videos",BANZAI_ROUTE:"video_waterfall",SOURCE_SIMPLE:"simple",SOURCE_COMPOSER:"composer"},d("VideoUploadLoggerEvents").VideoUploadLoggerEvents);var h=new Set([d("VideoUploadLoggerEvents").VideoUploadLoggerEvents.EVENT_STARTED_FLOW,d("VideoUploadLoggerEvents").VideoUploadLoggerEvents.EVENT_FINISHED_FLOW,d("VideoUploadLoggerEvents").VideoUploadLoggerEvents.EVENT_FAILED_FLOW,d("VideoUploadLoggerEvents").VideoUploadLoggerEvents.EVENT_CANCELED_FLOW]);b=function(){function a(b){this.$1=b.source,this.$2=b.composer_dialog_version,this.$3=b.waterfall_id,this.$4=b.ad_account_id,this.$5=b.target_id,this.$6=b.delay,this.$7=[],this.$8=b.is_chunked_upload,this.$9=b.actor_id,this.$10=b.composer_entry_point_ref,this.$11=b.composer_work_shared_draft_mode,this.$12=b.is_remote_upload,this.$13=b.container_type,this.$14=b.has_file_been_replaced,this.$15=b.composer_session_id,this.$16=b.creative_tools,this.$17=b.asset_id,this.$18=c("CurrentUser").getAppID(),this.$19=!Boolean(b.reported_by_notifier)&&a.shouldSendFlowEventsViaNotifier({source_type:b.source,composer_entry_point_ref:b.composer_entry_point_ref})}a.shouldSendFlowEventsViaNotifier=function(a){return Boolean((c("VideoUploadLoggingConfig").FLOW_VIA_NOTIFIER_COMPOSERS||[]).find(function(b){return b.source_type===a.source_type&&b.composer_entry_point_ref===a.composer_entry_point_ref}))};var b=a.prototype;b.logEvent=function(a,b){if(this.$19&&h.has(a))return;b=babelHelpers["extends"]({},b);b.elapsed_time==null&&(a.indexOf("started")!==-1?this.$7[a]=Date.now():a.indexOf("finished")!==-1?b.elapsed_time=this.$20(a,"finished"):a.indexOf("canceled")!==-1?b.elapsed_time=this.$20(a,"canceled"):a.indexOf("failed")!==-1&&(b.elapsed_time=this.$20(a,"failed")));b.event=a;b.source=this.$1;b.composer_dialog_version=b.composer_dialog_version||this.$2;b.waterfall_id=this.$3;b.ad_account_id=this.$4;b.target_id=this.$5;b.is_chunked_upload=this.$8;b.actor_id=this.$9;b.composer_entry_point_ref=this.$10;b.composer_work_shared_draft_mode=this.$11;b.is_remote_upload=this.$12;b.container_type=this.$13;b.has_file_been_replaced=this.$14;b.trigger_time=Date.now();b.composer_session_id=this.$15;b.asset_id=this.$17;b.app_id=this.$18;c("logVideoUploadViaFalco")(b)};b.postOnShutdown=function(a){return c("Banzai").subscribe(c("Banzai").SHUTDOWN,a)};b.getWaterfallID=function(){return this.$3};b.$20=function(a,b){a=a.replace(b,"started");b=this.$7[a];return b?Date.now()-b:null};return a}();Object.assign(b,a);e=b;g["default"]=e}),98);
-----
VideoUploadLoggerEvents",[],(function(a,b,c,d,e,f){"use strict";a=Object.freeze({EVENT_STARTED_GENERATE_THUMBNAILS:"upload.client.started_generate_thumbnails",EVENT_FINISHED_GENERATE_THUMBNAILS:"upload.client.finished_generate_thumbnails",EVENT_SELECTED_CUSTOM_THUMBNAIL:"upload.client.selected_custom_thumbnail",EVENT_VIDEO_DIMENSIONS_UNREADABLE:"upload.client.video_dimensions_unreadable",EVENT_REPLACE_VIDEO:"upload.client.replace_video",EVENT_STARTED_FLOW:"upload.client.started_flow",EVENT_FINISHED_FLOW:"upload.client.finished_flow",EVENT_FAILED_FLOW:"upload.client.failed_flow",EVENT_CANCELED_FLOW:"upload.client.canceled_flow",EVENT_RESIGNED_FLOW:"upload.client.resigned_flow",EVENT_REQUESTED_UPLOADING:"upload.client.requested_uploading",EVENT_INVALIDATED_UPLOADING:"upload.client.invalidated_uploading",EVENT_STARTED_UPLOADING:"upload.client.started_uploading",EVENT_PROGRESS_UPLOADING_START_REQUEST:"upload.client.progress_uploading_start_request",EVENT_FINISHED_UPLOADING:"upload.client.finished_uploading",EVENT_CANCELED_UPLOADING:"upload.client.canceled_uploading",EVENT_ABANDONED_UPLOADING:"upload.client.abandoned_uploading",EVENT_FAILED_UPLOADING:"upload.client.failed_uploading",EVENT_STARTED_SENDING_BYTES:"upload.client.started_sending_bytes",EVENT_FINISHED_SENDING_BYTES:"upload.client.finished_sending_bytes",EVENT_CANCELED_SENDING_BYTES:"upload.client.canceled_sending_bytes",EVENT_FAILED_SENDING_BYTES:"upload.client.failed_sending_bytes",EVENT_STARTED_START_REQUEST:"upload.client.started_sending_start_request",EVENT_FINISHED_START_REQUEST:"upload.client.finished_sending_start_request",EVENT_FAILED_START_REQUEST:"upload.client.failed_sending_start_request",EVENT_CANCELED_START_REQUEST:"upload.client.canceled_sending_start_request",EVENT_STARTED_RECEIVE_REQUEST:"upload.client.started_sending_receive_request",EVENT_FINISHED_RECEIVE_REQUEST:"upload.client.finished_sending_receive_request",EVENT_FAILED_RECEIVE_REQUEST:"upload.client.failed_sending_receive_request",EVENT_STARTED_POST_REQUEST:"upload.client.started_sending_post_request",EVENT_FINISHED_POST_REQUEST:"upload.client.finished_sending_post_request",EVENT_FAILED_POST_REQUEST:"upload.client.failed_sending_post_request",EVENT_HANDLING_SERVER_FAILURE_RESPONSE:"upload.client.handling_server_failure_response",EVENT_HANDLING_TRANSPORT_FAILURE_RESPONSE:"upload.client.handling_transport_failure_response",EVENT_DUPLICATE_POST_REQUEST:"upload.client.duplicate_post_request",EVENT_STARTED_SENDING_CHUNK_BYTES:"upload.client.started_sending_chunk_bytes",EVENT_FINISHED_SENDING_CHUNK_BYTES:"upload.client.finished_sending_chunk_bytes",EVENT_CANCELED_SENDING_CHUNK_BYTES:"upload.client.canceled_sending_chunk_bytes",EVENT_FAILED_SENDING_CHUNK_BYTES:"upload.client.failed_sending_chunk_bytes",EVENT_TIMEOUT_SENDING_CHUNK_BYTES:"upload.client.timeout_sending_chunk_bytes",EVENT_STARTED_FETCHING_STATUS:"upload.client.started_fetching_status",EVENT_FINISHED_FETCHING_STATUS:"upload.client.finished_fetching_status",EVENT_STARTED_POST_FLOW:"upload.client.started_post_flow",EVENT_FINISHED_POST_FLOW:"upload.client.finished_post_flow",EVENT_CANCELED_POST_FLOW:"upload.client.canceled_post_flow",EVENT_FAILED_POST_FLOW:"upload.client.failed_post_flow",EVENT_RETRY_ATTEMPT:"upload.client.retry_attempt",EVENT_RESUMABLE_CALLED:"upload.client.resumable_called",EVENT_RESUMABLE_STARTED:"upload.client.resumable_started",EVENT_RESUMABLE_SUCCESS:"upload.client.resumable_success",EVENT_RESUMABLE_FAILED:"upload.client.resumable_failed",EVENT_ENCODING_START_OBSERVED:"encode.client.encoding_start_observed",EVENT_ENCODING_SUCCESS_OBSERVED:"encode.client.encoding_success_observed",EVENT_ENCODING_FAIL_OBSERVED:"encode.client.encoding_fail_observed",EVENT_ENCODING_ABORT_OBSERVED:"encode.client.encoding_abort_observed",EVENT_FETCH_FAIL_OBSERVED:"encode.client.fetch_video_info_fail_observed",EVENT_ENCODING_SUBSCRIBE_TO_VIDEO_STATUS:"encode.client.subscribe_to_video_status",EVENT_ENCODING_POLLING_FALLBACK:"encode.client.polling_fallback",EVENT_RECEIVED_RESPONSE:"upload.client.received_response",EVENT_STARTED_FLOW_EXP1:"upload.client.started_flow_exp1",EVENT_FINISHED_FLOW_EXP1:"upload.client.finished_flow_exp1",EVENT_CANCELED_FLOW_EXP1:"upload.client.canceled_flow_exp1",EVENT_MEASURE_FREE_LOCAL_STORAGE:"upload.client.free_local_storage"});f.VideoUploadLoggerEvents=a}),66);
-----