Ñ{"x-fb-debug":"xQaGZ7AVpgBFxDAEbfXyl98rcVHp1wyZWr7DvDpisO7ukmfvtROSZvInSqP+yIRVdaSdYgIomIcfM6C8//jCEA==","x-fb-trip-id":"420120009","x-content-type-options":"nosniff","content-md5":"dgvv7yOIAi20d/qIxdOHrw==","access-control-allow-origin":"*","vary":"Accept-Encoding","content-type":"application/x-javascript; charset=utf-8","status":"200","content-encoding":"br","cache-control":"public,max-age=31536000,immutable","timing-allow-origin":"*","content-length":"6533"}if (self.CavalryLogger) { CavalryLogger.start_js(["v1kl2"]); } __d("FeedStoryCategory",[],(function(a,b,c,d,e,f){e.exports={UNKNOWN:0,ORGANIC:1,ENGAGEMENT:2,FIXED_POSITION:3,PROMOTION:4,SPONSORED:5,END_OF_FEED_CONTENT:6,FB_STORIES:7,HIGH_VALUE_PROMOTION:8,FB_STORIES_ENGAGEMENT:9}}),null); __d("AdAllocationIntegrityGapsInfo",["FeedStoryCategory"],(function(a,b,c,d,e,f){__p&&__p();a=function(){"use strict";__p&&__p();function a(a){this.story_category=a,this.dist_to_top=-1,this.dist_to_fixed=-1,this.dist_to_promo=-1,this.dist_to_sponsored=-1,this.dist_to_engagement=-1}var c=a.prototype;c.setDistToTop=function(a){this.dist_to_top=a};c.setDistIfAbsent=function(a,c){__p&&__p();if(c<0||a===b("FeedStoryCategory").UNKNOWN||a===b("FeedStoryCategory").ORGANIC)return;switch(a){case b("FeedStoryCategory").ENGAGEMENT:this.dist_to_engagement=this.$1(c,this.dist_to_engagement);break;case b("FeedStoryCategory").FIXED_POSITION:this.dist_to_fixed=this.$1(c,this.dist_to_fixed);break;case b("FeedStoryCategory").PROMOTION:this.dist_to_promo=this.$1(c,this.dist_to_promo);break;case b("FeedStoryCategory").SPONSORED:this.dist_to_sponsored=this.$1(c,this.dist_to_sponsored);break}};c.$1=function(a,b){return b===-1?a:b};return a}();e.exports=a}),null); __d("AdAllocationIntegrityUtils",["DataAttributeUtils","FeedStoryCategory","collectDataAttributes"],(function(a,b,c,d,e,f){"use strict";__p&&__p();var g="data-story_category",h="data-dedupekey",i="ft";a={getFeedStoryCategory:function(a){__p&&__p();var c=b("collectDataAttributes")(a,[i]).ft;a=b("DataAttributeUtils").getDataAttribute(a,g);if(a)switch(a){case"2":return b("FeedStoryCategory").ENGAGEMENT;case"3":return b("FeedStoryCategory").FIXED_POSITION;case"4":return b("FeedStoryCategory").PROMOTION;default:return b("FeedStoryCategory").UNKNOWN}else if(c.ei)return b("FeedStoryCategory").SPONSORED;else return b("FeedStoryCategory").ORGANIC},isGapRuleCategory:function(a){if(a===b("FeedStoryCategory").SPONSORED||a===b("FeedStoryCategory").ENGAGEMENT||a===b("FeedStoryCategory").FIXED_POSITION||a===b("FeedStoryCategory").PROMOTION)return!0;else return!1},getDedupKey:function(a){return b("DataAttributeUtils").getDataAttribute(a,h)}};e.exports=a}),null); __d("ViewportTrackingHooks",["Base64"],(function(a,b,c,d,e,f){__p&&__p();var g={},h=[];a={registerFeedObject:function(a,c){g[a]=b("Base64").encode(c)},updateVisibleViewportObjects:function(a){var b=[],c=!1;for(var d=0;d0?e[e.length-1].appendChild(d[0]):c.appendChild(d[0]);c.insertBefore(d[1],c.firstChild)}e=this.totalVPVDuration[a];c=Math.floor(e/1e3)+"."+Math.floor(e%1e3/100);b("DOM").setContent(d[0],c);b("DOM").setContent(d[1],c)};c.updateVPVDTimers=function(){for(var a in this.activeStories)Object.prototype.hasOwnProperty.call(this.activeStories,a)&&this.updateVPVDTimer(a)};c.logVpvdAnalysis=function(a,c,d,e,f,g){__p&&__p();var h=new(b("BanzaiScuba"))("vpv_duration");h.addDenorm("qid",this.getQueryID(this.activeStories[a].story));h.addDenorm("uid",b("CurrentUser").getID());h.addDenorm("vsid",a);h.addInteger("time",Math.round(Date.now()/1e3));h.addInteger("duration",e);h.addInteger("total_duration",f);h.addNormal("story_state",this.activeStories[a].state);h.addNormal("is_active_state",d);h.addNormal("num_visible_stories",this.numVisibleStories);h.addInteger("story_height",this.activeStories[a].story_height);h.addInteger("story_visible_height",this.activeStories[a].height);h.addInteger("state_visible_height",g);h.addInteger("total_visible_height",this.totalVisibleHeight);h.addInteger("total_height",this.totalHeight);h.addNormal("user_focus",this.latestUserFocus);h.addNormal("next_user_focus",this.userFocus);h.addInteger("vpvd",c);h.addInteger("accumulated_vpvd",this.activeStories[a].vpvd);h.addNormal("user_activity",this.latestUserActivity);h.addNormal("next_user_activity",this.userActivity);h.addInteger("story_position_y",this.activeStories[a].y);h.addInteger("feed_insertion_position",this.getFBFeedInsertionPosition(this.activeStories[a].story));h.addNormal("visible_position",this.activeStories[a].visible_position);h.addNormal("is_focused_story",this.activeStories[a].is_focused);h.post()};c.shouldDiscardStory=function(a){var b=this.activeStories[a].height||0;return b!=this.activeStories[a].story_height&&bthis.discardVPVDIntervalThreshold)return;b=(b={},b[m]=0,b[l]=0,b[k]=0,b);var c=a-this.latestTimeTrackingTimestamp>=this.focused_state_duration;this.totalVisibleHeight=0;for(var d in this.activeStories)if(Object.prototype.hasOwnProperty.call(this.activeStories,d)&&!(this.latestUserFocus===o&&c&&this.shouldDiscardStory(d))){var e=this.activeStories[d].state||null,f=this.activeStories[d].height||0;e!==null&&Object.prototype.hasOwnProperty.call(b,e)&&(b[e]+=f);this.totalVisibleHeight+=f}e=0;f=a-this.latestTimeTrackingTimestamp;this.latestUserFocus===o&&(f=b[k]>0?this.focused_state_duration:this.active_state_duration,f=Math.min(f,a-this.latestTimeTrackingTimestamp),e=a-this.latestTimeTrackingTimestamp-f);a=0;var g=k;for(var h=k;h>=m;h--)if(b[h]>0){a=b[h];g=h;break}h=b[k]+b[l]+b[m];b=0;for(d in this.activeStories)if(Object.prototype.hasOwnProperty.call(this.activeStories,d)){if(this.latestUserFocus===o&&c&&this.shouldDiscardStory(d))continue;var i=this.activeStories[d].state||n;if(a>0&&i>=g){i=this.activeStories[d].height||0;b=f*(i/a);this.vpvdAnalysis&&f>0&&this.logVpvdAnalysis(d,b,!0,f,f+e,a);this.activeStories[d].vpvd+=b;this.totalVPVDuration[d]+=b}if(h>0){i=this.activeStories[d].height||0;b=e*(i/h);this.vpvdAnalysis&&e>0&&this.logVpvdAnalysis(d,b,!1,e,f+e,h);this.activeStories[d].vpvd+=b;this.totalVPVDuration[d]+=b}}};c.updateActiveStory=function(a,b,c,d){this.activeStories[a].state=b,this.activeStories[a].ts=c,this.activeStories[a].height_snapshot=d[a].height,this.activeStories[a].is_focused=this.focusedStory===d[a].story,this.activeStories[a].story_height=d[a].story_height,this.vpvdAnalysis&&(this.activeStories[a].visible_position=d[a].visible_position,this.activeStories[a].y=d[a].y)};c.updateActiveStories=function(a,b){for(var c in a)if(Object.prototype.hasOwnProperty.call(a,c))if(c in this.activeStories){var d=a[c].height||0;this.activeStories[c].height=d;d=d-(this.activeStories[c].height_snapshot||0);this.focusedStory===a[c].story?this.updateActiveStory(c,k,b,a):d<=-this.height_diff_to_change_state?this.updateActiveStory(c,this.shouldDiscardStory(c)?n:m,b,a):(d>=this.height_diff_to_change_state||this.activeStories[c].is_focused||this.activeStories[c].height===this.activeStories[c].story_height)&&this.updateActiveStory(c,l,b,a)}else this.storyIDsWasInView[c]=!0,this.activeStories[c]={evp_ts:b,story:a[c].story,height:a[c].height,vpvd:0},this.totalVPVDuration[c]||(this.totalVPVDuration[c]=0),this.updateActiveStory(c,l,b,a),this.behavior.afterStoryEntersViewport&&this.behavior.afterStoryEntersViewport(this.activeStories[c].story)};c.recordVPVDurations=function(a,b){for(var c in this.activeStories)if(Object.prototype.hasOwnProperty.call(this.activeStories,c)&&(b||!(c in a))){var d=this.activeStories[c].vpvd||0;(d>this.focused_state_duration||d===this.totalVPVDuration[c])&&this.recordTimeStoryWasInView(this.activeStories[c]);this.behavior.afterStoryExitsViewport&&this.behavior.afterStoryExitsViewport(this.activeStories[c].story);delete this.activeStories[c]}};c.updateTimeTrackingData=function(a,b){__p&&__p();this.userActivity=b;this.activeStories||(this.activeStories={});b=Date.now();this.latestTimeTrackingTimestamp||(this.latestTimeTrackingTimestamp=b);var c=this.getVisibleStoriesFromCache();this.calculateTotalHeight();this.updateVPVDurations(b);this.updateActiveStories(c,b);this.vpvdDebug&&this.updateVPVDTimers();this.recordVPVDurations(c,a);a?this.latestTimeTrackingTimestamp=0:this.latestTimeTrackingTimestamp=b;this.latestUserActivity=this.userActivity;this.latestUserFocus=this.userFocus;this.focusedStory&&(this.latestActiveStory=this.focusedStory);this.latestFocusedStory=this.focusedStory;this.focusedStory=null};c.needsToUpdateTimeTrackingData=function(){return!(this.latestUserFocus===this.userFocus&&(this.userFocus===p||this.userFocus===o&&!this.latestFocusedStory&&!this.focusedStory))};c.getfocusedStory=function(a){var c=this.getVisibleStoriesFromCache();for(var d in c)if(Object.prototype.hasOwnProperty.call(c,d)){var e=c[d].story;if(e&&b("ViewportTrackingHelper").isDescendantOf(a,e))return e}return null};c.handleLayers=function(){if(this.userFocus===q||this.userFocus===r){this.focusedStory=this.latestActiveStory;this.updateTimeTrackingData(!1,"media_layer");return!0}return!1};c.didInteractWithStream=function(a){if(!this.behavior.getStream)return!1;var c=this.behavior.getStream();return b("ViewportTrackingHelper").isDescendantOf(a,c)||b("ViewportTrackingHelper").isDescendantOf(c,a)};c.handleScroll=function(a){if(this.handleLayers())return;var c=Date.now();this.behavior.getStream||h(0,1116);var d=b("getElementPosition")(this.behavior.getStream()).y;d!=this.lastStreamY||c-this.latestStreamYChangedTimeStamp<2.5*this.scrollThrottlingInterval||this.didInteractWithStream(a.target)?(this.latestStreamYChangedTimeStamp=c,this.userFocus=o):this.userFocus=p;this.lastStreamY=d;(this.userFocus===o||this.needsToUpdateTimeTrackingData())&&this.updateTimeTrackingData(!1,"scroll")};c.handleKeyboard=function(a){if(this.handleLayers())return;this.didInteractWithStream(a.target)?(this.userFocus=o,this.focusedStory=this.getfocusedStory(a.target)):b("CSS").hasClass(a.target,"shareInput")?(this.userFocus=o,this.focusedStory=this.latestActiveStory):this.userFocus=p;(this.userFocus===o||this.needsToUpdateTimeTrackingData())&&this.updateTimeTrackingData(!1,"keyboard")};c.handleMouse=function(a){if(this.handleLayers())return;if(a.type!="click"&&a.clientX===this.lastMouseX&&a.clientY===this.lastMouseY)return;a.type==="click"&&this.invalidateVisibleStoriesCache();this.didInteractWithStream(a.target)?(this.userFocus=o,this.focusedStory=this.getfocusedStory(a.target)):this.userFocus=p;this.lastMouseX=a.clientX;this.lastMouseY=a.clientY;this.needsToUpdateTimeTrackingData()&&this.updateTimeTrackingData(!1,a.type)};c.getStoriesInView=function(){__p&&__p();var a=this.behavior.getAllStories(),c=[],d=!1;for(var e=0;ef/2&&(e=f-1,f=-1,g=-g);for(var e=e;e!=f;e+=g){var i=a[e],j=b("ViewportTrackingHelper").getHeightIfVisible(i,Math.min(this.minSizeToBeVisible,this.minFractionToBeVisibleForTimetracking*b("DOMDimensions").getElementDimensions(i).height));if(j>0||i===this.focusedStory){i.getAttribute("data-insertion-position")===null&&i.setAttribute("data-insertion-position",(e-this._headLoadStoryCount).toString());var k=this.behavior.getStoryID(i);k&&(c[k]={story:i,height:j,story_height:b("DOMDimensions").getElementDimensions(i).height},d=!0,this.vpvdAnalysis&&(c[k].y=b("getElementPosition")(i).y,c[k].visible_position=e,h=Math.min(h,e)))}else if(d){this._indexOfLastVisibleStoryOnPreviousPass=e-g;break}}if(this.vpvdAnalysis){this.numVisibleStories=0;for(k in c)Object.prototype.hasOwnProperty.call(c,k)&&(c[k].visible_position-=h,this.numVisibleStories++)}return c};c.getTimetrackingDataToLog=function(a){a={evt:i,time_spent_id:b("pageID"),vpvd_start_timestamp:a.evp_ts||null,vpvd_time_delta:Math.round(a.vpvd||0),story_height:b("DOMDimensions").getElementDimensions(a.story).height,viewport_height:this.cachedViewportHeight};return{ft:a}};c.getGapsInfoToLog=function(a){__p&&__p();var c=this;if(a===null||a===void 0)return null;var d=b("AdAllocationIntegrityUtils").getFeedStoryCategory(a),e=new(b("AdAllocationIntegrityGapsInfo"))(d);if(!b("AdAllocationIntegrityUtils").isGapRuleCategory(d))return e;else{d=b("AdAllocationIntegrityUtils").getDedupKey(a);if(d===null)return null;a=this.behavior.getAllStories().filter(function(a){return Object.prototype.hasOwnProperty.call(c.storyIDsWasInView,c.behavior.getStoryID(a))});var f=-1;for(var g=a.length-1;g>=0;g--){var h=b("AdAllocationIntegrityUtils").getDedupKey(a[g]);if(f<0)h!==null&&d===h&&(f=g,e.setDistToTop(f+1));else{h=b("AdAllocationIntegrityUtils").getFeedStoryCategory(a[g]);b("AdAllocationIntegrityUtils").isGapRuleCategory(h)&&e.setDistIfAbsent(h,f-g)}}return e}};c.recordTimeStoryWasInView=function(a){__p&&__p();if(!this.isTimetrackingEnabled)return;var c=a.story;if(!a.vpvd||!c)return;if(a.vpvd>0){a=this.getTimetrackingDataToLog(a);var d=b("collectDataAttributes")(c,["ft"]);Object.assign(a.ft,d.ft);if(this.adAllocationIntegrityLoggingEnabled){var e=this.getGapsInfoToLog(c);Object.assign(a.ft,e)}e=!!d.ft.ei&&a.ft.vpvd_time_delta>this.minTimeToReportImmediately;a.ei&&delete a.ei;this.sendDataToLog(c,a,e)}};c.hasBeenVisible=function(a){return a in this.readStoryIDs};c.sendDataToLog=function(a,c,d){if(this.useBanzai){var e={};d&&(e.delay=3e3);d=this.getSessionID();d&&(c.ft.session_id=d);c.ft.raw_client_time=Date.now()/1e3;b("Banzai").post("feed_tracking",c,e)}else b("clickRefAction")(j,a,null,"FORCE",c)};c.markStoryRead=function(a){__p&&__p();var c=this.behavior.getStoryID(a);if(!c||this.hasBeenVisible(c))return;this.readStoryIDs[c]=!0;this.annotatedStoryIDs[c]=!0;c=this._getDataToLogImpl(a);var d=b("collectDataAttributes")(a,["ft"]);Object.assign(c.ft,d.ft);delete c.ei;this.sendDataToLog(a,c,!1);this.vpvDebug&&b("CSS").addClass(a,"_5m7s")};c.logAnnotatedVPV=function(a){__p&&__p();var c=this.behavior.getStoryID(a);if(!c||c in this.annotatedStoryIDs)return;this.annotatedStoryIDs[c]=!0;c=this._getDataToLogImpl(a);var d=b("collectDataAttributes")(a,["ft"]);Object.assign(c.ft,d.ft);delete c.ei;c.ft.vpv_ft_only=1;this.sendDataToLog(a,c,!1)};c._getDataToLogImpl=function(a){a=this.behavior.getDataToLog(a);a.ft||(a.ft={});return a};return a}();s.clearSingleton=function(){};var t={getAllStories:function(){return[]},getStoryID:function(a){return null},getDataToLog:function(a){return{}}};a=b("viewportTrackingBuilder")(function(a){return new s(t)});s.factory=a.factory.bind(a);s.singleton=a.singleton.bind(a);s.clearSingleton=a.clearSingleton.bind(a);s.getBehavior=function(){return t};e.exports=s}),null); __d("collectSubtreeData",[],(function(a,b,c,d,e,f){__p&&__p();function g(a,b,c,d,e){__p&&__p();if(a.offsetWidth===0&&a.offsetHeight===0)return e;var f={};if(a.getAttribute)for(j=0;j0&&e[k][i].push(d[i]),e[k][i].push("("+h[i]))}}for(var j=0;j0&&h.charAt(0)=="("?e[k][l][e[k][l].length-1]=h.substr(1):e[k][l].push(")")}return e}function a(a,b){__p&&__p();var c={};for(var d=0;d0&&(d.ft.cta_types=a)}return d};d.cleanup=function(){j.clearSingleton(),c.prototype.cleanup.call(this)};return a}(b("ViewportTracking")),j=b("viewportTrackingBuilder")(function(a,b){b=new i(h(a,b,".uiStreamStory"));b.init(a);return b});i.factory=j.factory.bind(j);i.singleton=j.singleton.bind(j);i.clearSingleton=j.clearSingleton.bind(j);i.getBehavior=h;e.exports=i}),null);