if (self.CavalryLogger) { CavalryLogger.start_js(["qYv8O"]); } __d("ImageUtils",["UserAgent_DEPRECATED"],(function(a,b,c,d,e,f){__p&&__p();a={hasLoaded:function(a){__p&&__p();if(a.naturalWidth!==void 0)return a.complete&&a.width!==0;else if(a.height==20&&a.width==20&&a.complete)return!1;else if(a.complete===void 0&&b("UserAgent_DEPRECATED").webkit()<500){var c=new Image();c.src=a.src;return c.complete}return a.complete}};e.exports=a}),null); __d("PhotoEverstoreLogger",["AsyncRequest","Event","ImageUtils"],(function(a,b,c,d,e,f){__p&&__p();var g={BATCH_WINDOW_MS:500,storedLog:[]};function h(){}Object.assign(h,{_log:function(a){g.storedLog.push(a),g.storedLog.length==1&&setTimeout(i,g.BATCH_WINDOW_MS)},logImmediately:function(a){h._log(a)},registerForLogging:function(a){var c=document.getElementById(a);c!=null&&(b("ImageUtils").hasLoaded(c)?h._log(c.src):b("Event").listen(c,"load",function(a){h._log(c.src)}))}});function i(){var a=g.storedLog;g.storedLog=[];a=JSON.stringify(a);new(b("AsyncRequest"))().setURI("/ajax/photos/logging/everstore_logging.php").setData({loggedUrls:a}).setMethod("POST").setOption("suppressErrorHandlerWarning",!0).setOption("suppressErrorAlerts",!0).send()}e.exports=h}),null); __d("PhotoViewerImage",["PhotoEverstoreLogger","URI","Vector"],(function(a,b,c,d,e,f){__p&&__p();a=function(){"use strict";__p&&__p();function a(a){this._hiResDimensions=a.hiResDimensions&&b("Vector").deserialize(a.hiResDimensions),this._normalDimensions=a.normalDimensions&&b("Vector").deserialize(a.normalDimensions),this._info=a.info,this._video=a.video,this._shouldLog=a.everstoreLogThis,this._hiResSrc=a.hiResSrc,this._normalSrc=a.normalSrc,this._thumbSrc=a.thumbSrc,this._isInverted=!1,this._data=a}var c=a.prototype;c.getURIString=function(){return new(b("URI"))(this._info.permalink).getUnqualifiedURI().toString()};c.hasHiResDimensions=function(){return!!this._hiResDimensions};c.getHiResDimensions=function(){return this._hiResDimensions};c.getNormalDimensions=function(){return this._normalDimensions};c.getHiResSrc=function(){return this._hiResSrc};c.getNormalSrc=function(){return this._normalSrc};c.getThumbSrc=function(){return this._thumbSrc};c.getInfo=function(){return this._info};c.getPermalink=function(){return this._info.permalink};c.getHighestResSrc=function(){return this._hiResSrc||this._normalSrc};c.preload=function(a){var c;this.getHighestResSrc()&&(a&&!this._resource?(this._resource=new Image(),this._resource.src=this.getHighestResSrc(),c=this._resource.src,this._shouldLog&&b("PhotoEverstoreLogger").logImmediately(this._resource.src)):!a&&!this._small&&(this._small=new Image(),this._small.src=this._normalSrc||this._hiResSrc,c=this._small.src,this._shouldLog&&b("PhotoEverstoreLogger").logImmediately(this._small.src)));return c};c.setNormalDimensions=function(a,c){this._normalDimensions=new(b("Vector"))(a,c)};c.setHiResDimensions=function(a,c){this._hiResDimensions=new(b("Vector"))(a,c)};c.invertDimensions=function(){this.hasHiResDimensions()&&(this._hiResDimensions=new(b("Vector"))(this._hiResDimensions.y,this._hiResDimensions.x)),this._normalDimensions=new(b("Vector"))(this._normalDimensions.y,this._normalDimensions.x),this._isInverted=!this._isInverted};c.copy=function(){return new a(this._data)};return a}();e.exports=a}),null); __d("PhotosConst",[],(function(a,b,c,d,e,f){a={VIEWER_PERMALINK:0,VIEWER_SNOWLIFT:6,VIEWER_VAULTBOX:8,VIEWER_SNOWFLAKE:14,VIEWER_COMPOSER:16,VIEWER_CAROUSEL:19,VIEWER_SPHERICAL:20,VIEWER_PERMALINK_STRING:"permalink",VIEWER_SNOWLIFT_STRING:"snowlift",VIEWER_VAULTBOX_STRING:"vaultbox",VIEWER_CAROUSEL_STRING:"carousel",BULK_EDITOR:3,BULK_EDITOR_REACT:15,EDITOR_MODAL:17,FLASH_UPLOADER:4,HTML5_UPLOADER:10,SIZE_NORMAL:"n",PIC_NORMAL_FBX_SIZE:180,ALBUM_NAME_MAXLEN:65};e.exports=a}),null); __d("UFI2DOMAttachmentEventEmitter",["EventEmitter"],(function(a,b,c,d,e,f){"use strict";e.exports=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(b("EventEmitter"))}),null); __d("PhotoStreamCache",["DOM","HTML","PhotoEverstoreLogger","PhotosConst","PhotoViewerImage","React","ReactDOM","ReactRenderer","Rect","UFI2DOMAttachmentEventEmitter","UIPagelet","URI","Vector","ge"],(function(a,b,c,d,e,f){__p&&__p();a=function(){"use strict";__p&&__p();function a(){}var c=a.prototype;c.init=function(b,c,d,e,f){this.version=b,this.pageletName=c,this.pageletRootID=d,this.tagSuggestionMode=f,this.bufferSize=a.BUFFER_SIZE,this.fullBucketSize=a.FULL_BUCKET_SIZE,this.initError=!1,this.isActive=!0,this.usesOpaqueCursor=!1,this.usesNonCircularPhotoSet=!1,this.reachedLeftEnd=!1,this.reachedRightEnd=!1,this.leftLock=!1,this.rightLock=!1,this.useAjaxPipe=!0,this.logger=e,this.viewAsUser=null,this.reset()};c.setViewAs=function(a){this.viewAsUser=a};c.isInViewAsMode=function(){return!!this.viewAsUser};c.getViewAsUserId=function(){return this.viewAsUser};c.getUsesOpaqueCursor=function(){return this.usesOpaqueCursor};c.isNonCircularPhotoSet=function(){return this.usesNonCircularPhotoSet};c.setReachedLeftEnd=function(){this.reachedLeftEnd=!0};c.setReachedRightEnd=function(){this.reachedRightEnd=!0};c.hasReachedLeftEnd=function(){return this.reachedLeftEnd};c.hasReachedRightEnd=function(){return this.reachedRightEnd};c.nonCircularPhotoSetCanPage=function(a){if(!this.isNonCircularPhotoSet())return!0;if(a<0)return this.getCursorPos()||!this.hasReachedLeftEnd();return a>0?this.getLength()-1!=this.getCursorPos()||!this.hasReachedRightEnd():!0};c.setUseAjaxPipe=function(a){this.useAjaxPipe=a};c.reset=function(){this.cache={image:{},extra:{},html:{},ufi_config:{},ufi_dom_attachment_event_emitters:{},ufi_roots:{}},this.snowliftUFIModule=null,this.fbidList=[],this.loaded=!1,this.allLoaded=!1,this.permalinkMap={},this.position=0,this.totalCount=null,this.firstCursor=null,this.firstCursorIndex=null,this.firstOpaqueCursor=null};c.waitForInitData=function(){this.fbidList.push(a.INIT_PLACEHOLDER)};c.unmountUFIRoots=function(){Object.entries(this.cache.ufi_roots).forEach(function(a){a[0];a=a[1];return a.ufiMainRoot&&b("ReactDOM").unmountComponentAtNode(a.ufiMainRoot)})};c.destroy=function(){this.unmountUFIRoots(),this.reset(),this.isActive=!1};c.isLoaded=function(){return this.loaded};c.canPage=function(){if(!this.isLoaded())return!1;if(this.totalCount!==null)return this.totalCount>1;return this.usesNonCircularPhotoSet?!0:this.getLength()>1};c.errorInCurrent=function(){if(this.initError)return!0;else if(!this.isLoaded())return!1;return this.checkErrorAt(this.getCursor())};c.getLength=function(){return this.fbidList.length};c.getPhotoSet=function(){return this.photoSetQuery.set};c.getPhotoSetQuery=function(){return this.photoSetQuery};c.getCurrentImageData=function(){return this.getImageData(this.getCursor())};c.getNextImageData=function(){if(!this.fbidList||!this.fbidList.length)return null;var a=(this.position+1)%this.fbidList.length;return this.getImageData(this.getCursorAt(a))};c.getPreviousImageData=function(){if(!this.fbidList||!this.fbidList.length)return null;var a=this.fbidList.length;a=(this.position+a-1)%a;return this.getImageData(this.getCursorAt(a))};c.addViewAsToURI=function(a){a=new(b("URI"))(a);this.isInViewAsMode()&&a.addQueryData({viewas:this.getViewAsUserId()});return a};c.getOpaqueCursor=function(a){if(this.getImageData(a))return this.version===b("PhotosConst").VIEWER_VAULTBOX?this.getImageData(a).getInfo().opaquecursor:this.getImageData(a).info.opaquecursor;return a==this.firstCursor?this.firstOpaqueCursor:null};c.getImageData=function(b){b=this.getCacheContent(b,a.IMAGE_DATA);b&&(b.info.permalink=this.addViewAsToURI(b.info.permalink));return b};c.getCurrentHtml=function(){return this.getCacheContent(this.getCursor(),a.HTML)};c.getCurrentExtraData=function(){return this.getCacheContent(this.getCursor(),a.EXTRA)};c.getCurrentUFIConfig=function(){return this.getCacheContent(this.getCursor(),a.UFI_CONFIG)};c.getCurrentUFIRoots=function(b){var c=this.getCacheContent(this.getCursor(),a.UFI_ROOTS),d=this.getCacheContent(this.getCursor(),a.UFI_DOM_ATTACHMENT_EVENT_EMITTERS);if(c){b(c,d);return}this.createUFIRoots(this.getCursor(),function(a,c){b(a,c)})};c.shouldRenderModernUFIforCurrent=function(){var a=this.getCursor();return a in this.cache.ufi_config};c.containsUFIConfig=function(){return Object.keys(this.cache.ufi_config).length>0};c.getCacheContent=function(b,c){return!b||b===a.ERROR_ID||b===a.INIT_PLACEHOLDER?null:this.cache[c][b]};c.getCursorPos=function(){return this.position};c.getCursor=function(){return this.position>=0&&this.position0||a>=0&&a0)};c.checkErrorAt=function(b){if(!this.isLoaded())return!1;return b===a.ERROR_ID?!0:!1};c.getRelativeMovement=function(a){for(var b=0;bg*2?(d=(this.position+e-g%e)%e,g=(this.position+g)%e):(d=0,g=e-1);while(d!=g){var h,i=this.fbidList[d],j=c&&c(f[i]);this.version===b("PhotosConst").VIEWER_VAULTBOX?h=f[i]&&f[i].preload(j):f[i]&&f[i].url&&(j&&!f[i].resource?(f[i].resource=new Image(),f[i].resource.src=f[i].url,h=f[i].url,f[i].everstoreLogThis===!0&&b("PhotoEverstoreLogger").logImmediately(f[i].resource.src)):!j&&!f[i].small&&(f[i].small=new Image(),f[i].small.src=f[i].smallurl||f[i].url,h=f[i].small.src,f[i].everstoreLogThis===!0&&b("PhotoEverstoreLogger").logImmediately(f[i].small.src)));this.logger&&h&&this.logger.log(h);d=(d+1)%e}};c.loadMoreIfNeccessary=function(a){if(this.allLoaded||a&&this.rightLock||!a&&this.leftLock)return;a=a?1:-1;a=this.position+this.bufferSize*a;a<0&&!this.checkErrorAt(this.getEndCursor(!1))?(this.leftLock=!0,this.fetch(this.fullBucketSize,!1)):a>this.getLength()&&!this.checkErrorAt(this.getEndCursor(!0))&&(this.rightLock=!0,this.fetch(this.fullBucketSize,!0))};c.getEndCursor=function(a){return a?this.fbidList[this.getLength()-1]:this.fbidList[0]};c.calculateRelativeIndex=function(a,b,c){if(!this.totalCount)return null;b=this.fbidList.indexOf(b);c=this.fbidList.indexOf(c);if(b===-1||c===-1)return null;c=c-b;return(a+c+this.totalCount)%this.totalCount};c.calculateDistance=function(a,b){a=this.fbidList.indexOf(a);b=this.fbidList.indexOf(b);return a===-1||b===-1?null:(b-a+this.getLength())%this.getLength()};c.fetch=function(a,c){var d=this.getEndCursor(c);c=babelHelpers["extends"]({cursor:d,version:this.version,end:this.getEndCursor(!c),fetchSize:c?a:-1*a,relevant_count:this.relevantCount,opaqueCursor:this.getOpaqueCursor(d),tagSuggestionMode:this.tagSuggestionMode,is_from_groups:this.isFromGroups},this.photoSetQuery);this.isInViewAsMode()&&(c.viewas=this.getViewAsUserId());this.totalCount&&this.firstCursorIndex!==null&&(c.total=this.totalCount,c.cursorIndex=this.calculateRelativeIndex(this.firstCursorIndex,this.firstCursor,d));a=b("ge")(this.pageletRootID);a||(a=b("DOM").create("div",{id:this.pageletRootID}),b("DOM").appendContent(document.body,a));b("UIPagelet").loadFromEndpoint(this.pageletName,a,c,{usePipe:this.useAjaxPipe,automatic:!0,jsNonblock:!0,crossPage:!0});this.useAjaxPipe||this.setUseAjaxPipe(!0)};c.storeToCache=function(a){__p&&__p();var b={};if(!this.isActive)return b;if("error"in a){this.processErrorResult(a.error);b.error=!0;return b}"init"in a&&(this.processInitResult(a.init),b.init={logids:a.init.logids,fbid:a.init.fbid,loggedin:a.init.loggedin,fromad:a.init.fromad,withinbusiness:a.init.withinbusiness,eid:a.init.eid});"image"in a&&(this.processImageResult(a.image),b.image=!0);"data"in a&&(this.processDataResult(a.data),b.data=!0);return b};c.processInitResult=function(c){__p&&__p();if(this.loaded)return;this.usesOpaqueCursor=c.usesopaquecursor;this.usesNonCircularPhotoSet=c.isnoncircularphotoset;this.setIsFromGroups(c.is_from_groups);this.loaded=!0;this.photoSetQuery=c.query;c.bufferSize&&(this.bufferSize=c.bufferSize);c.fullBucketSize&&(this.fullBucketSize=c.fullBucketSize);if(this.fbidList.length===0)this.fbidList.push(c.fbid),this.rightLock=!0;else{var d=this.fbidList.indexOf(a.INIT_PLACEHOLDER);d!=-1&&(this.fbidList[d]=c.fbid)}this.firstCursor=c.fbid;this.firstOpaqueCursor=c.opaquecursor;"initIndex"in c&&"totalCount"in c&&(this.firstCursorIndex=c.initIndex,this.totalCount=c.totalCount);if(this.version==b("PhotosConst").VIEWER_PERMALINK){d=c.initialBucketSize?c.initialBucketSize:a.INIT_BUCKET_SIZE;this.fetch(d,!0)}};c.processImageResult=function(a){for(var c in a){c===this.firstCursor&&a[c].everstoreLogThis&&b("PhotoEverstoreLogger").logImmediately(a[c].url);if(this.version===b("PhotosConst").VIEWER_VAULTBOX){var d=a[c];this.cache.image[c]=new(b("PhotoViewerImage"))(d);this.permalinkMap[this.cache.image[c].getURIString()]=c}else this.cache.image[c]=a[c],a[c].dimensions&&(this.cache.image[c].dimensions=b("Vector").deserialize(a[c].dimensions)),a[c].originalDimensions&&(this.cache.image[c].originalDimensions=b("Vector").deserialize(a[c].originalDimensions)),a[c].smalldims&&(this.cache.image[c].smalldims=b("Vector").deserialize(a[c].smalldims)),this.permalinkMap[new(b("URI"))(a[c].info.permalink).getUnqualifiedURI().toString()]=c}};c.attachToFbidsList=function(a,b,c){__p&&__p();var d=this;if(this.allLoaded)return;a=a.filter(function(a){return!d.fbidList.includes(a)});if(b===-1){for(var b=a.length-1;b>=0;b--)this.fbidList.unshift(a[b]),this.position++;this.leftLock=!1}else{for(var b=0;b=this.AGGREGATION_COUNT&&this.logPhotoViews(this.AGGREGATE),this.updateLastFbidDuration(),this.views++,a&&this.fbidList.push([a.fbid,a.owner,Date.now()]),b&&this.hiResLoads++,c&&(this.fullScreenViews[a.fbid]=!0)},updateLastFbidDuration:function(){this.updateDuration(),this.fbidList.length>0&&this.fbidList[this.fbidList.length-1].push(this.currentDuration),this.updateLastVisibleTime(),this.currentDuration=0},updateDuration:function(){this.currentDuration+=Date.now()-this.lastVisibleStart},updateLastVisibleTime:function(){this.lastVisibleStart=Date.now()},logEnterFullScreen:function(a){this.fullScreenViews[a]=!0},addDetailData:function(a,b){this.details[a]||(this.details[a]={t:b.num_tags,l:b.has_location,c:b.has_caption,cm:b.comment_count,lk:b.like_count,w:b.width,h:b.height,ad:"{}",p:this.pagingAction})},updateAdData:function(a,b){this.details[a]&&(this.details[a].ad=JSON.stringify(b))},logPhotoViews:function(a){__p&&__p();if(!this.views)return;this.updateLastFbidDuration();a!=this.AGGREGATE&&(this.last=!0);this.logData(a?a:this.UNKNOWN);this.views=0;this.hiResLoads=0;this.fbidList=[];this.details={};this.first=!1;this.buttonLikes=0;this.last&&(this.set=null,this.logIds=!1,this.fullScreenViews={})},logInitialLoad:function(){this.logData(g.LOADING)},logData:function(a){__p&&__p();var c=[],d={},e=0;a===this.LOADING?(e=this.topLevelPostId,this.topLevelPostId||(c=this.fbidList,d=this.details)):(c=this.fbidList,d=this.details);c={set:this.set,time:new Date()-this.time,fbids:c,details:d,eid:this.eid,first:this.first,last:this.last,close:a,button_likes:this.buttonLikes,version:this.version,endmetric:this.endMetrics,cycle:this.cycle,end_relev:this.endOfRelevant,relev_count:this.relevantCount,source:this.source,top_level_post_id:e,story_location:this.storyLocation,story_attachment_style:this.storyAttachmentStyle,attached_story_attachment_style:this.attachedStoryAttachmentStyle,qid:this.qid,mf_story_key:this.mfStoryKey,page_insights:this.pageInsightsData};if(this.version===g.SNOWLIFT){d=b("Vector").getViewportDimensions();c.width=d.x||this.width;c.height=d.y||this.height;this.hiResLoads>0&&(c.hires_loads=this.hiResLoads);if(this.last){e=Object.keys(this.fullScreenViews).length;e>0&&(c.fullscreen=e)}}d=new(b("URI"))(b("WWWBase").uri).setPath("/ajax/photos/logging/session_logging.php");new(b("AsyncRequest"))().setAllowCrossPageTransition(!0).setURI(d).setOption("asynchronous_DEPRECATED",a!=g.UNLOAD).setOption("suppressErrorHandlerWarning",!0).setData(c).send()}});b("Run").onUnload(function(){g.logPhotoViews(g.UNLOAD)});b("Run").onLeave(function(){g.logPhotoViews(g.LEAVE)});e.exports=g}),null); __d("PhotosUtils",["Vector"],(function(a,b,c,d,e,f){__p&&__p();function a(){}Object.assign(a,{getNearestBox:function(a,b){var c=Infinity,d=null;for(var e in a){var f=a[e];if(f.contains(b)){f=b.distanceTo(f.getCenter());f=3&&a[2]==="photos")if(a.length===4&&/^\d+$/.exec(a[3])!==null)return{photo_id:a[3],set_token:null};else if(a.length===5&&/^\d+$/.exec(a[4])!==null)return{photo_id:a[4],set_token:a[3]};return null},isValidLegacy:function(a){a=a.getPath();a[a.length-1]==="/"&&(a=a.substring(0,a.length-1));return a==="/photo.php"||a==="/force_photo/photo.php"||a==="/photo"||a==="/force_photo/photo/index.php"||a==="/photo/index.php"||a==="/force_photo/photo"||a==="/video.php"||a==="/video/video.php"?!0:!1}};e.exports=g}),null); __d("PhotoTagSearchPivotLogger",["Banzai"],(function(a,b,c,d,e,f){__p&&__p();var g={};b("Banzai").subscribe(b("Banzai").SHUTDOWN,function(){Object.keys(g).forEach(function(a){var c=g[a];Object.keys(c).forEach(function(d){b("Banzai").post("photo_tag_search_pivot",{source:a,action:d,count:c[d]})})})});var h=/^(perm:)?tag:/,i;a={logImpression:function(a,b){a=a in g?g[a]:g[a]={};a[b]=b in a?a[b]+1:1},logImageImpression:function(a,b,c){i!==b&&(c.some(function(a){return h.test(a)})&&this.logImpression(a,"image_impression"),i=b)},logPivotImpression:function(a,b){h.test(b)&&this.logImpression(a,"pivot_impression")},logShowMorePhotos:function(){this.logImpression("photoset","show_more_photos")},logHideMorePhotos:function(){this.logImpression("photoset","hide_more_photos")},logSuggestMorePhotos:function(){this.logImpression("photoset","suggest_more_photos")},logMorePhotosNavigation:function(a){b("Banzai").post("photo_tag_search_pivot",{source:"photoset",action:"more_photos_search",query:a,count:1})}};e.exports=a}),null); __d("PhotosetSearchPivot.react",["cx","fbt","LeftRight.react","PhotosetSearchPivotData","PhotoTagSearchPivotLogger","React","XUISpinner.react","XUIText.react","joinClasses"],(function(a,b,c,d,e,f,g,h){__p&&__p();a=b("React").PropTypes;var i=function(c){"use strict";__p&&__p();babelHelpers.inheritsLoose(a,c);function a(){var a,d;for(var e=arguments.length,f=new Array(e),g=0;gd){b=D.$PhotoSnowliftViewableSphericalPhoto13-d;for(var a=0;a0&&b("CSS").hide(d[0])}return a(c)}}};D.$PhotoSnowliftViewableSphericalPhoto28=function(){return function(a){return function(c){c.type===b("SphericalMediaActions").SETUP_RENDERER&&(D.$PhotoSnowliftViewableSphericalPhoto11=!0,b("CSS").hide(D.$PhotoSnowliftViewableSphericalPhoto4),D.$PhotoSnowliftViewableSphericalPhoto15.adjustStageSize());return a(c)}}};D.$PhotoSnowliftViewableSphericalPhoto29=function(a){var c=a.dispatch;return function(a){return function(d){if(d.type===b("SphericalMediaActions").SETUP_RENDERER){var e=D.$PhotoSnowliftViewableSphericalPhoto15.getTagger();e&&e.taggingMode!=D.$PhotoSnowliftViewableSphericalPhoto22&&(D.$PhotoSnowliftViewableSphericalPhoto22=e.taggingMode,c(e.taggingMode?i():j()))}return a(d)}}};D.$PhotoSnowliftViewableSphericalPhoto30=function(a){__p&&__p();a.getState;var c=a.dispatch;return function(a){return function(d){if(d.type===b("SphericalMediaActions").TURN_ON||d.type===b("SphericalMediaActions").SHOW_FALLBACK){var e=function(){var a=D.$PhotoSnowliftViewableSphericalPhoto27();c(l(a.x,a.y))};D.$PhotoSnowliftViewableSphericalPhoto18.addSubscriptions(D.addListener("onEnterFullScreen",e),D.addListener("onExitFullScreen",e),D.addListener("onSetDimensions",e));e()}return a(d)}}};b("EventProfiler").tagCurrentActiveInteractionsAs("PSVSphericalPhoto");D.$PhotoSnowliftViewableSphericalPhoto1=C;D.$PhotoSnowliftViewableSphericalPhoto2=e;D.$PhotoSnowliftViewableSphericalPhoto3=v;D.$PhotoSnowliftViewableSphericalPhoto6=B;D.$PhotoSnowliftViewableSphericalPhoto7=y;D.$PhotoSnowliftViewableSphericalPhoto8=!1;D.$PhotoSnowliftViewableSphericalPhoto9=t;D.$PhotoSnowliftViewableSphericalPhoto10=!1;D.$PhotoSnowliftViewableSphericalPhoto11=!1;D.$PhotoSnowliftViewableSphericalPhoto14=w;D.$PhotoSnowliftViewableSphericalPhoto15=z;D.$PhotoSnowliftViewableSphericalPhoto16=A;D.$PhotoSnowliftViewableSphericalPhoto17=d;D.$PhotoSnowliftViewableSphericalPhoto18=new(b("SubscriptionsHandler"))();D.$PhotoSnowliftViewableSphericalPhoto20=f;D.$PhotoSnowliftViewableSphericalPhoto21=c;D.$PhotoSnowliftViewableSphericalPhoto5=b("DOM").create("div",{className:"_zq_ _5nxw"});D.$PhotoSnowliftViewableSphericalPhoto4=b("DOM").create("div",{className:"_zr0 _5nxw"});D.getElement().appendChild(D.$PhotoSnowliftViewableSphericalPhoto5);D.getElement().appendChild(D.$PhotoSnowliftViewableSphericalPhoto4);b("CSS").addClass(D.getElement(),"_zr1");D.$PhotoSnowliftViewableSphericalPhoto12={fov:g,pitch:q,yaw:r};D.$PhotoSnowliftViewableSphericalPhoto19=new(b("SubscriptionsHandler"))();b("CSS").addClass(D.$PhotoSnowliftViewableSphericalPhoto15.stage,"_1ziy");D.$PhotoSnowliftViewableSphericalPhoto23();u(D.$PhotoSnowliftViewableSphericalPhoto24());return D}var d=c.prototype;d.$PhotoSnowliftViewableSphericalPhoto24=function(){return{photoID:this.$PhotoSnowliftViewableSphericalPhoto7,surface:r.snowlift}};d.$PhotoSnowliftViewableSphericalPhoto25=function(a){this.$PhotoSnowliftViewableSphericalPhoto20.useTiledRenderer&&b("SphericalPhotoTypedConfig").show_new_renderer?b("ReactDOM").render(b("React").createElement(b("SphericalPhotoPlaceHolderWithGyroOverlay.react"),{placeholderImageURL:this.$PhotoSnowliftViewableSphericalPhoto26(),showNewRenderer:!0,width:a.x,height:a.y}),this.$PhotoSnowliftViewableSphericalPhoto4):b("ReactDOM").render(b("React").createElement(b("SphericalPhotoPlaceHolderWithGyroOverlay.react"),{placeholderImageURL:this.$PhotoSnowliftViewableSphericalPhoto26()}),this.$PhotoSnowliftViewableSphericalPhoto4)};d.$PhotoSnowliftViewableSphericalPhoto23=function(){var a=this.$PhotoSnowliftViewableSphericalPhoto27(),c=[this.$PhotoSnowliftViewableSphericalPhoto28,this.$PhotoSnowliftViewableSphericalPhoto29,this.$PhotoSnowliftViewableSphericalPhoto30,this.$PhotoSnowliftViewableSphericalPhoto31,this.$PhotoSnowliftViewableSphericalPhoto32];b("SphericalPhotoTypedConfig").www_can_viewer_tag&&c.push(this.$PhotoSnowliftViewableSphericalPhoto33);this.$PhotoSnowliftViewableSphericalPhoto25(a);b("ReactDOM").render(b("React").createElement(b("SphericalMediaBootloaded.react"),{ambientAudio:this.$PhotoSnowliftViewableSphericalPhoto1,componentName:q,canvasNamespace:"Snowlift",cubeImageURI:this.$PhotoSnowliftViewableSphericalPhoto2,fallback:this.$PhotoSnowliftViewableSphericalPhoto6,enableGyro:!0,enableZoom:!0,enableTagging:!0,enableRubberBanding:!0,height:a.y,initialView:this.$PhotoSnowliftViewableSphericalPhoto12,photoID:this.$PhotoSnowliftViewableSphericalPhoto7,partialLimits:this.$PhotoSnowliftViewableSphericalPhoto14,photoSphereMetadata:this.$PhotoSnowliftViewableSphericalPhoto16,surface:r.snowlift,tiledSphericalConfig:this.$PhotoSnowliftViewableSphericalPhoto20,middlewares:c,useLargeVolumeIcon:!0,width:a.x}),this.$PhotoSnowliftViewableSphericalPhoto5);this.$PhotoSnowliftViewableSphericalPhoto10=!0;this.emit("ready")};d.$PhotoSnowliftViewableSphericalPhoto34=function(){this.$PhotoSnowliftViewableSphericalPhoto19.release(),this.$PhotoSnowliftViewableSphericalPhoto18.release(),b("ReactDOM").unmountComponentAtNode(this.$PhotoSnowliftViewableSphericalPhoto4),b("ReactDOM").unmountComponentAtNode(this.$PhotoSnowliftViewableSphericalPhoto5)};d.suspend=function(){this.$PhotoSnowliftViewableSphericalPhoto34()};d.resume=function(){this.$PhotoSnowliftViewableSphericalPhoto23()};d.reload=function(){this.$PhotoSnowliftViewableSphericalPhoto23()};d.hide=function(){b("CSS").shown(this.getElement())&&w(this.$PhotoSnowliftViewableSphericalPhoto24()),a.prototype.hide.call(this),this.$PhotoSnowliftViewableSphericalPhoto34()};d.getDimensions=function(){var a=b("getViewportDimensions")(),c=a.width;a=a.height;b("SphericalPhotoTypedConfig").should_snowlift_fit_to_screen?(this.$PhotoSnowliftViewableSphericalPhoto8||(c-=y),(!this.isRenderReady()||this.$PhotoSnowliftViewableSphericalPhoto16&&this.$PhotoSnowliftViewableSphericalPhoto16.ProjectionType==="transverse-cylindrical")&&(c=a=Math.min(c,a))):c=a=Math.min(c,a);return b("Vector").from(c,a)};d.$PhotoSnowliftViewableSphericalPhoto27=function(){var a=b("Vector").getElementDimensions(this.getElement());return a.x===0||a.y===0?this.$PhotoSnowliftViewableSphericalPhoto3||a:a};d.$PhotoSnowliftViewableSphericalPhoto35=function(a){var c=this.getElement().parentElement;a=new(b("Vector"))(a.x,a.y);if(c&&c instanceof HTMLElement){c=b("Vector").getElementDimensions(c);var d=b("Vector").getElementDimensions(this.getElement());(c.x!==d.x||a.xthis.currentImageSize.y&&this.currentImageSize.x<=c.TIMELINE_STRETCH_WIDTH&&d.offsetWidth===c.TIMELINE_STRETCH_WIDTH;if(d)a=d.src,this.thumbSpherical=Boolean(d.getAttribute("data-is-spherical-photo")),this.sphericalPhotoData=b("DataStore").get(d,"sphericalPhotoData");else if(e)a=b("Style").get(e,"backgroundImage").replace(/.*url\(\"?([^\"]*)\"?\).*/,"$1");else return;this.thumbSrc=a};d.loadFrameIfUninitialized=function(){if(this.root)return;var a=String(b("URI").getMostRecentURI().getQueryData().viewas);b("PhotoSnowliftLoader").loadFrame(a)};d.init=function(a,c){this.init=b("emptyFunction"),this._shouldLog=c.photos_client_loading,this._logger=null,this._shouldLog&&(this._logger=new(b("PhotoLogger"))(b("PhotosConst").VIEWER_SNOWLIFT_STRING)),this._showHover=c.pivot_hover,this._showMorePhotos=c.show_more_photos,this._extraSlidePivot=c.extra_slide_pivot,this._uiRefresh=c.snowlift_ui_refresh,b("PhotoSessionLog").setEndMetrics(c.pivot_end_metric),this.startingMousePos=null,this.haveLeftBufferRegion=!1,this.showingTypeaheadSuggestions=!1,this.isFullScreenSupported=b("FullScreen").isSupportedWithKeyboardInput(),this.showOGVideos=c.og_videos,this.spotlight=a,this.spotlight.subscribe("blur",function(){this.closingAction=b("PhotoSessionLog").OUTSIDE}.bind(this)),this.spotlight.subscribe("hide",this.closeHandler.bind(this)),this.spotlight.subscribe("key",this.keyHandler.bind(this)),this._actionMenuOpen=!1,this._mouseOnPhotoStage=!1,this.initializeNodes(this.spotlight.getRoot()),this.disableContextMenu(),this.subscription||(b("LinkController").registerHandler(this.handleNavigateAway.bind(this)),this.subscription=b("Arbiter").subscribe("PhotoSnowlift.GO",function(a,c){this.openExplicitly=!0,this.loading&&b("CSS").removeClass(this.loading,"loading"),this.open(c)}.bind(this))),this.transitionHandlerRegistered=!1,this.returningToStart=!1,b("PageTransitions").registerHandler(this.openHandler.bind(this)),this.openHandlerRegistered=!0,b("Arbiter").subscribe("PhotoTagApproval.HILITE_TAG",this.onHiliteTag.bind(this)),b("Arbiter").subscribe("PhotoTagApproval.UPDATE_TAG_BOX",this.onUpdateTagBox.bind(this)),b("Arbiter").subscribe("ObjectionableContentToggleButton.COVERED",this.handleObjectionableContentToggleButtonClicked.bind(this)),this.buttonTruncateGk=c.snowlift_button_truncate,this.allowIrrelevantRequests=!!c.snowlift_allow_irrelevant_requests,this.snowflake&&(b("CSS").addClass(this.root,"snowflake"),this.extraClasses.forEach(function(a){b("CSS").addClass(this.root,a)},this))};d.initializeNodes=function(a){this.root=a,this.container=b("DOM").find(a,"div.fbPhotoSnowliftContainer"),this._updateContainerOwnerID(),this.snowliftPopup=b("DOM").find(this.container,"div.fbPhotoSnowliftPopup"),this.rhc=b("DOM").find(this.snowliftPopup,"div.rhc"),this.details=b("DOM").find(this.rhc,"#fbPhotoSnowliftDetails"),this.rhcBody=b("DOM").find(this.rhc,"div.rhcBody"),this.rhcHeader=b("DOM").find(this.rhc,"div.rhcHeader"),this.taglist=b("DOM").find(this.rhc,"span.fbPhotoTagList"),this.ufiForm=b("DOM").find(this.rhc,"form.fbPhotosSnowliftFeedbackForm"),this.ufiInputContainer=b("DOM").find(this.rhc,"div.fbPhotosSnowboxFeedbackInput"),this.ufiMainContainer=this.ufiForm.appendChild(document.createElement("div")),this.ufiStageActionsContainer=b("DOM").scry(this.root,"._29qf")[0],this.ufiContainers={ufiMainContainer:this.ufiMainContainer,ufiComposerContainer:this.ufiInputContainer,ufiStageActionsContainer:this.ufiStageActionsContainer},this.scroller=b("DOM").find(this.rhc,"div.rhcScroller"),this.scrollerBody=b("DOM").find(this.scroller,"div.uiScrollableAreaBody"),this.stageWrapper=b("DOM").find(this.snowliftPopup,"div.stageWrapper"),this.overlay=b("DOM").find(this.snowliftPopup,"div.snowliftOverlay"),this.errorBox=b("DOM").find(this.stageWrapper,"div.stageError"),this._viewable=b("PhotoSnowliftViewableUtils").fromImageElement(b("DOM").find(this.stageWrapper,"img.spotlight")),this.stage=b("DOM").find(this.stageWrapper,"div.stage"),this.videoStage=b("DOM").find(this.stageWrapper,"div.videoStage"),this.prevPager=b("DOM").find(this.snowliftPopup,"a.snowliftPager.prev"),this.nextPager=b("DOM").find(this.snowliftPopup,"a.snowliftPager.next"),this.stageActions=b("DOM").find(a,"div.stageActions"),this._uiRefresh||(this.buttonActions=b("DOM").find(this.stageActions,"div.fbPhotosPhotoButtons")),this.placeInfo=b("DOM").find(this.rhc,"div.fbPhotosSnowliftPlaceInfo"),this.seeMore=b("DOM").find(this.rhc,"._jke"),b("CSS").conditionClass(this.root,"fullScreenAvailable",this.isFullScreenSupported)};d.getContextMenuContainer=function(){return this.stageWrapper};d.getObjectionableWarningContainer=function(){return this.stageWrapper};d.getObjectionableWarningHiddenContent=function(){return this.isVideo()?this.videoStage:this.stage};d.isVideo=function(){var a=this.stream.getCurrentImageData();return a&&a.info.video?!0:!1};d.initializeScroller=function(){__p&&__p();var a=this;this.initializeScroller=b("emptyFunction");b("CSS").addClass(this.scroller,"_467y");this.scrollableArea=b("ScrollableArea").fromNative(this.scroller,{fade:!0,persistent:!0});var c=function(a){__p&&__p();a=b("Event").$E(a).getTarget();if(b("DOM").contains(this.ufiInputContainer,a)){var c=b("DOMControl").getInstance(a);if(c){this.scrollableArea.scrollToBottom();var d=c.subscribe("resize",function(){var a=this.scrollableArea.isScrolledToBottom();this.adjustScroller();a&&this.scrollableArea.scrollToBottom()}.bind(this)),e=b("Event").listen(a,"blur",function(){c.unsubscribe(d),e.remove()})}}(a.classList.contains("UFIPagerLink")||a.classList.contains("UFICommentLink"))&&(this.autoplayOptionScreenConfig&&this.autoplayOptionScreenConfig.enabled&&(this.haltAutoplay=!0))}.bind(this);b("Arbiter").subscribe("ufi/inputHeightChanged",function(c,d){b("DOM").contains(a.ufiInputContainer,d.node)&&a.adjustScroller()});b("Arbiter").subscribe("ufi/photoPreviewHightChanged",function(c,d){(!d.node||b("DOM").contains(a.ufiInputContainer,d.node))&&a.adjustScroller()});b("Visibility").addListener(b("Visibility").HIDDEN,function(){b("PhotoSessionLog").updateDuration()});b("Visibility").addListener(b("Visibility").VISIBLE,function(){b("PhotoSessionLog").updateLastVisibleTime()});b("Arbiter").subscribe("ufi/changed",function(a,b){this.ufiForm===b.form&&this.adjustScrollerIfNecessary()}.bind(this));b("Arbiter").subscribe("ufi/comment",function(a,b){this.ufiForm===b.form&&(this.adjustScrollerIfNecessary(),b.isinverted?this.scrollableArea.scrollToTop():this.scrollableArea.scrollToBottom())}.bind(this));b("Event").listen(this.rhc,"click",function(a){a=a.getTarget();(b("Parent").byTag(a,"a")||b("Parent").byTag(a,"button")||b("DOM").isNodeOfType(a,"input"))&&this.adjustScrollerIfNecessary()}.bind(this));b("Arbiter").subscribe(["reflow","CommentUFI.Pager"],function(){this.isOpen&&this.adjustScrollerIfNecessary()}.bind(this));b("Arbiter").subscribe("ufi/translationRendered",function(){a.adjustScrollerIfNecessary()});b("Event").listen(this.ufiForm,"focusin",c)};d.openHandler=function(a){if(this.isOpen||!b("PhotoPermalinkURI").isValid(a)||this.returningToStart||a.getQueryData().closeTheater||a.getQueryData().permPage){this.openHandlerRegistered=!1;return!1}this.open(a);this._uriStack.push(new(b("URI"))(a).getQualifiedURI().toString());b("PageTransitions").transitionComplete(!0);return!0};d.addHaltAutoplaySubscription=function(){b("Arbiter").subscribe(["ufi/focus"],function(){this.haltAutoplay=!0}.bind(this)),b("Arbiter").subscribe(["ufi/blur"],function(a,b){this.haltAutoplay=b.hasEnteredText}.bind(this))};d.open=function(a){__p&&__p();var d=new(b("URI"))(a),e=d.getQueryData(),f=Object.create(null),g=b("PhotoPermalinkURI").parse(d);g!=null&&(e.fbid=g.photo_id,e.set=g.set_token,f.snowlift_content_id=g.photo_id);g=b("VideoPermalinkURI").parse(d);g!=null&&(e.v=g.video_id,e.set=g.set_token,f.snowlift_content_id=g.video_id);this._elem!=null&&(e.external_log_id=this._elem.getAttribute("data-external-log-id"),e.player_origin=this._elem.getAttribute("data-player-origin"));b("ScriptPath").openOverlayView("snowlift",f);if(!e.fbid&&!e.v&&!e.pid){g=s.exec(d.getPath());g&&(e.v=g[1])}this.resetUriStack&&(this._uriStack=[]);this.initialLoad||(e.firstLoad=!0,this.initialLoad=!0,b("LitestandStoryInsertionStatus").registerBlocker(function(){return this.isOpen}.bind(this)));this.sessionID=Date.now();this.loadQuery=Object.assign(e,{ssid:this.sessionID});this._dataFt&&(this.loadQuery.data_ft=this._dataFt);this.isOpen=!0;this.pagersShown=!1;this.refreshOnClose=!1;this.hilitedTag=null;this.loadingStates={image:!1,html:!1};this.replaceUrl=!1;this.movementDelta=0;this.pivotsCarouselElement=null;this.autoplayOptionScreenConfig=null;this.haltAutoplay=!1;this.shouldRenderVideoPivots=!1;b("CSS").show(this.nextPager);b("CSS").show(this.prevPager);this.source=null;this.saveTagSubscription=b("Arbiter").subscribe("PhotoTagger.SAVE_TAG",this.onTagSaved.bind(this));this.taggedPhotoIds=[];this.didReceivePayloadHavingInitProperty=!1;this.payloadsReceivedBeforePayloadHavingInitProperty.length=0;this.stream=new(b("PhotoStreamCache"))();this.stream.init(b("PhotosConst").VIEWER_SNOWLIFT,"PhotoViewerPagelet","pagelet_photo_viewer",this._shouldLog?this._logger:null,e.tagSuggestionMode||"everyone");b("URI").getMostRecentURI().getQueryData().viewas&&this.stream.setViewAs(b("URI").getMostRecentURI().getQueryData().viewas+"");b("URI").getMostRecentURI().getQueryData().ifg&&this.stream.setIsFromGroups(b("URI").getMostRecentURI().getQueryData().ifg);this.fetchInitialData();this.setLoadingState(c.STATE_HTML,!0);this.rhcCollapsed=!1;this._open(a);b("Bootloader").loadModules(["PhotosButtonTooltips"],function(a){a.init()},"PhotoSnowlift");this._navHistory.push(d.getQualifiedURI().toString())};d._open=function(a){__p&&__p();var d=this;this.createLoader();this.hideObjectionableWarning();this.spotlight.show();b("Arbiter").inform("layer_shown",{type:"PhotoSnowlift"});b("Arbiter").inform("PhotoSnowlift.OPEN");var e=this.adjustForResize.bind(this);this.stageHandlers&&this.stageHandlers.release();this.stageHandlers=new(b("SubscriptionsHandler"))();this.stageHandlers.addSubscriptions(b("Event").listen(window,"resize",function(){if(b("FullScreen").isFullScreen())return;e()}),b("FullScreen").subscribe("changed",function(){b("setImmediate")(e)}),b("Event").listen(this.stageWrapper,"click",function(a){__p&&__p();a=b("DataAttributeUtils").getClickTrackingParent(a.getTarget());if(!a)return;try{a=JSON.parse(b("DataAttributeUtils").getDataFt(a));if(!a.tn)return;var c=b("TrackingNodes").parseTrackingNodeString(a.tn);a=Object.keys(b("TrackingNodeTypes")).filter(function(a){return b("TrackingNodeTypes")[a]===c});a.length&&b("FunnelLogger").appendAction(k,"click_"+a.join("_"))}catch(a){}}),b("Event").listen(this.stageWrapper,"click",this.buttonListener.bind(this)),b("Event").listen(this.stageWrapper,"mouseleave",function(a){a=a.getTarget();if(b("Parent").bySelector(a,"._khz")||b("Parent").bySelector(a,"._6a-y"))return;b("Parent").byClass(a,"snowliftOverlay")||b("Parent").byClass(a,"fbPhotoSnowliftTagApproval")||b("Parent").byClass(a,"tagPointer")||b("Parent").byClass(a,"arrow")||b("Parent").byClass(a,"faceboxSuggestion")||b("Parent").byClass(a,"typeaheadWrapper")||b("Parent").byClass(a,"photoTagTypeahead")||b("Parent").byClass(a,"fbPhotoTagger")||this.unhiliteAllTags();this._mouseOnPhotoStage=!1;this.hidePagers()}.bind(this)),b("Event").listen(this.stageWrapper,"mousemove",this.hilitePager.bind(this)),b("Event").listen(this.stageWrapper,"mousemove",this.hiliteTagsOnMouseMove.bind(this)),b("Event").listen(this.stageWrapper,"mouseenter",function(){d._mouseOnPhotoStage=!0,b("Arbiter").inform("lwf/entryModal/logImpression")}),b("Event").listen(this.overlay,"mouseenter",this.unhiliteAllTags.bind(this)),b("Event").listen(this.container,"mousemove",this._enableMouseOver.bind(this)),b("Event").listen(this.container,"mouseover",this._interceptMouseOver.bind(this)),b("Event").listen(this.stageWrapper,"focusin",this.hilitePager.bind(this)),b("Event").listen(this.rhc,"focusin",this.hidePagers.bind(this)),b("Event").listen(this.root,"click",function(a){__p&&__p();a=a.getTarget();if(b("Parent").bySelector(a,"._418x")){if(b("FullScreen").isFullScreen()){b("FunnelLogger").appendActionWithTagIfNew(k,"fullscreen_exit","fbPhotoSnowlift/close");b("FullScreen").toggleFullScreen();return}d.closingAction=b("PhotoSessionLog").X;d.spotlight.hide()}else d._isLiveBroadcast&&b("Parent").bySelector(a,"._3ixn")&&d.spotlight.hide()}),b("Event").listen(this.container,"click",function(a){__p&&__p();var c=a.getTarget();if(b("Parent").byClass(c,"rotateRight"))b("FunnelLogger").appendActionWithTag(k,"rotate_image","right"),this.rotate("right");else if(b("Parent").byClass(c,"rotateLeft"))b("FunnelLogger").appendActionWithTag(k,"rotate_image","left"),this.rotate("left");else if(b("Parent").bySelector(c,"._32_l")){b("FunnelLogger").appendAction(k,"click-pivot-item");var d=b("Parent").bySelector(c,"._32_l");d=d.getAttribute("data-fbid");var e=this.stream.getCursor();e=this.stream.calculateDistance(e,d);d=this.stream.fbidList.indexOf(d);b("SnowliftVideoPivotsCarouselController").adjustCarousel(d);this.page(e,!1);this.haltAutoplay=!1;this.removeAutoplayOptionScreen()}else b("Parent").byClass(c,"fbPhotoSnowliftZoom")?this.openZoom(a):this.isFullScreenSupported&&(b("Parent").byClass(c,"fbPhotoSnowliftFullScreen")?(b("FunnelLogger").appendActionWithTagIfNew(k,b("FullScreen").isFullScreen()?"fullscreen_exit":"fullscreen_enter","fbPhotoSnowliftFullScreen"),this.toggleFullScreen()):b("Parent").byClass(c,"fbPhotoSnowliftCollapse")?(this.toggleCollapse(),b("FunnelLogger").appendAction(k,"toggle_collapse-rhc")):b("FullScreen").isFullScreen()&&(b("Parent").bySelector(c,".overlayBarButtons .comment_link")||b("Parent").bySelector(c,".overlayBarButtons ._666h"))&&(this.toggleCollapse(),b("FunnelLogger").appendAction(k,"toggle_collapse-rhc")));d=b("Parent").byAttribute(c,"data-action-type");if(d){e=d.getAttribute("data-action-type");a=d.getAttribute("data-action-tag");b("FunnelLogger").appendActionWithTag(k,e,a)}else if(b("Parent").byClass(c,"addLocation")){d=b("Parent").byClass(c,"addLocation");b("FunnelLogger").appendActionWithTag(k,"add_location",b("CSS").hasClass(d,"photosTruncatingUIButton")?null:"from-action-bar")}else if(b("Parent").byClass(c,"fbPhotosPhotoActionsTag")){e=b("Parent").byClass(c,"fbPhotosPhotoActionsTag");b("CSS").hasClass(e,"tagButton")?b("FunnelLogger").appendActionWithTag(k,"tag_photo","start-tagging"):b("CSS").hasClass(e,"doneTaggingLink")?b("FunnelLogger").appendActionWithTag(k,"tag_photo","end-tagging"):b("CSS").hasClass(e,"taggingOff")?b("FunnelLogger").appendActionWithTag(k,"tag_photo","tagging-off"):b("CSS").hasClass(e,"taggingOn")&&b("FunnelLogger").appendActionWithTag(k,"tag_photo","tagging-on")}else b("Parent").byClass(c,"UFILikeLink")&&b("FunnelLogger").appendAction(k,"like-photo")}.bind(this)));a=b("ge")("fbPhotoSnowliftFeedback");a&&this.stageHandlers.addSubscriptions(b("Event").listen(a,"click",function(a){var c=a.getTarget();(b("Parent").byClass(c,"like_link")||b("Parent").byClass(c,"UFILikeLink")&&b("Parent").byClass(c,"UIActionLinks"))&&this.toggleLikeButton();c=b("Parent").byClass(a.getTarget(),"uiUfiCollapsedComment");c&&(b("FunnelLogger").appendActionWithTag(k,"like-photo","snowlift-feedback"),b("CSS").addClass(c,"uiUfiCollapsedCommentToggle"))}.bind(this)));a=b("ge")("fbPhotoSnowliftOnProfile");a&&this.stageHandlers.addSubscriptions(b("Event").listen(a,"click",function(a){b("Parent").byClass(a.getTarget(),"fbPhotoRemoveFromProfileLink")&&(this.refreshOnClose=!0)}.bind(this)));this.resetUriStack&&(this.startingURI=b("URI").getMostRecentURI().addQueryData({closeTheater:1}).getUnqualifiedURI());this.setLoadingState(c.STATE_IMAGE_DATA,!0);this.transitionHandlerRegistered||(b("PageTransitions").registerHandler(this.transitionHandler.bind(this)),this.transitionHandlerRegistered=!0);b("PhotoSessionLog").initLogging(b("PhotoSessionLog").SNOWLIFT);this._dataFt&&(b("PhotoSessionLog").setTopLevelPostId(this._dataFt.top_level_post_id),b("gkx")("831476")&&(this._dataFt.story_location&&b("PhotoSessionLog").setStoryLocation(this._dataFt.story_location),this._dataFt.story_attachment_style&&b("PhotoSessionLog").setStoryAttachmentStyle(this._dataFt.story_attachment_style),this._dataFt.attached_story_attachment_style&&b("PhotoSessionLog").setAttachedStoryAttachmentStyle(this._dataFt.attached_story_attachment_style),this._dataFt.qid&&b("PhotoSessionLog").setQid(this._dataFt.qid),this._dataFt.mf_story_key&&b("PhotoSessionLog").setMfStoryKey(this._dataFt.mf_story_key),this._dataFt.page_insights&&!b("killswitch")("PAGE_INSIGHTS_STOP_SENDING_PI_TRACKING_DATA_FROM_SNOWLIFT")&&b("PhotoSessionLog").setPageInsightsData(this._dataFt.page_insights)));this.pivots&&b("PhotoSessionLog").setRelevantCount(this.pivots.relevantCount)};d.toggleFullScreen=function(){var a=b("FullScreen").toggleFullScreen(document.documentElement);a?(this._viewable.onToggleIntoFullScreen(),b("PhotoSessionLog").logEnterFullScreen(this.stream.getCursor())):this._viewable.onToggleOutOfFullScreen()};d._getIsZoomAllowed=function(a){return!!(a&&!a.video&&!a.spherical&&a.dimensions&&(a.dimensions.x>window.innerWidth||a.dimensions.y>window.innerHeight))};d.showZoom=function(a){b("CSS").conditionClass(this.root,"zoomAvailable",this._getIsZoomAllowed(a))};d.openZoom=function(a){__p&&__p();var c=this.stream.getCurrentImageData();this._viewable.onToggleIntoFullScreen();var d=b("DOM").find(this.stageWrapper,"._2-sx"),e=d.getBoundingClientRect();d.style.width="auto";d.style.height="auto";d.classList.add("zoom");var f,g;if(c){c=c.dimensions;f=Math.max(0,c.x-window.innerWidth);g=Math.max(0,c.y-window.innerHeight)}else{c=d.getBoundingClientRect();f=Math.max(0,c.width-window.innerWidth);g=Math.max(0,c.height-window.innerHeight)}c=!1;f&&(c=!0,f+=q*2,d.classList.add("overflowX"));g&&(c=!0,g+=q*2,d.classList.add("overflowY"));var h;if(c){c=-a.clientX/window.innerWidth*f+"px";a=-a.clientY/window.innerHeight*g+"px";d.style.transform="translate3d("+c+","+a+",0)";h=b("Event").listen(d,"mousemove",function(a){var b=-a.clientX/window.innerWidth*f+"px";a=-a.clientY/window.innerHeight*g+"px";d.style.transform="translate3d("+b+","+a+",0)"})}var i=null,j=null;c=function(){d.style.width=e.width+"px";d.style.height=e.height+"px";d.style.transform="";d.classList.remove("zoom","overflowX","overflowY");h&&h.remove();i.remove();k.unsubscribe(j);k.destroy();return!1};var k=new(b("Layer"))({},document.createElement("div"));j=k.subscribe("key",c);k.show();i=b("Event").listen(d,"click",c);this._viewable.onEnterFullScreen()};d.getStream=function(){return this.stream};d.fetchInitialData=function(){this.stream.waitForInitData();var a=this.loadQuery.within_business?this.loadQuery.business_thread_id:this.loadQuery.fbid;a=b("UFIFeedbackTargets").getFeedbackTargetIfExists(a)||{};a={actorID:a.actorforpost||null,usePipe:!0,jsNonblock:!0,crossPage:!0,allowIrrelevantRequests:this.allowIrrelevantRequests};this.loadQuery.__tn__&&this.loadQuery.__xts__&&(a.query=b("PHPQuerySerializer").serialize({__tn__:this.loadQuery.__tn__,__xts__:this.loadQuery.__xts__}));b("UIPagelet").loadFromEndpoint("PhotoViewerInitPagelet",b("ge")("pagelet_photo_viewer_init",this.root),this.loadQuery,a);this.adjustScroller()};d.toggleCollapse=function(){this.rhcCollapsed?this.uncollapseRHC():this.collapseRHC()};d.collapseRHC=function(){this.rhcCollapsed=!0,b("CSS").addClass(this.root,"collapseRHC"),this.adjustForResize()};d.uncollapseRHC=function(){this.rhcCollapsed=!1,b("CSS").removeClass(this.root,"collapseRHC"),this.adjustForResize()};d.closeHandler=function(){if(!this.isOpen)return;this.closingAction=this.closingAction||b("PhotoSessionLog").ESC;if(b("URI").getMostRecentURI().addQueryData({closeTheater:1}).getUnqualifiedURI().toString()==this.startingURI.toString()){this.close();return}this.returnToStartingURI(this.refreshOnClose);this.close()};d.returnToStartingURI=function(a,c){__p&&__p();var d=this;a||(c?this.squashNextTransition(b("goURI").bind(null,c)):this.squashNextTransition());this.returningToStart=!0;var e=b("Arbiter").subscribe("page_transition",function(){d.returningToStart=!1,e.unsubscribe()});c=a||isNaN(b("UserAgent_DEPRECATED").opera());a=this._uriStack.length;if(c&&a0){var a=null;this.source===c.COLLECTIONS_UNTAGGED_PHOTOS?a="/ajax/photos/photo/edit/skiptag/":(this.source===c.PHOTOS_OF_YOU_SUGGESTIONS||this.source===c.FRIENDS_IN_PHOTOS_SUGGESTIONS)&&(a="/ajax/photos/photo/add_to_star_grid/");a&&new(b("AsyncRequest"))().setURI(a).setAllowCrossPageTransition(!0).setData({media_id:this.taggedPhotoIds,source:this.source}).send()}};d.onTagSaved=function(a,b){if(this.taggedPhotoIds){if(this.source===c.PHOTOS_OF_YOU_SUGGESTIONS&&!b.self_tag)return;this.taggedPhotoIds.push(b.photo_fbid)}};d.clearAlbumBoundaries=function(){this._albumBoundaries={start:0,end:0,dir:0}};d.close=function(){__p&&__p();if(!this.isOpen)return;b("FunnelLogger").appendActionWithTag(k,"close_snowlift",b("PhotoSessionLog").closingTypeToString(this.closingAction));b("FunnelLogger").endFunnel(k);this._albumFBID=null;this.hideMorePhotos();this.hidePivotSlide();this._pauseVideoIfNeeded();this._destroyVideoIfNeeded();this._bodyMutationObserver&&(this._bodyMutationObserver.disconnect(),this._bodyMutationObserver=null);this.isOpen=!1;this._navCount=0;this.clearAlbumBoundaries();this.isFullScreenSupported&&b("FullScreen").disableFullScreen();b("CSS").removeClass(document.body,"fbPhotoSnowliftFullScreenMode");this.spotlight.hide();this.openExplicitly=!1;this.postProcessTaggedPhotos();b("Arbiter").inform("lwf/unmount");b("Arbiter").unsubscribe(this.saveTagSubscription);this.taggedPhotoIds=[];this.closeDirty=!0;b("setTimeoutAcrossTransitions")(this.closeCleanup.bind(this),0);this.snowflake&&(b("CSS").removeClass(this.root,"snowflake"),this.extraClasses.forEach(function(a){b("CSS").removeClass(this.root,a)},this));b("UFIRootRegistry").cleanupSnowliftNodes();this.extraClasses=[];this.snowflake=!1;this.firstInSet=null;this.movementDelta=0};d.closeCleanup=function(){__p&&__p();b("ScriptPath").closeOverlayView("snowlift");this.closeDirty=!1;b("CSS").removeClass(this.root,"dataLoading");b("PhotoSessionLog").logPhotoViews(this.closingAction);this.destroy();b("CSS").hide(this.errorBox);this._viewable.hide();this.thumbSpherical=!1;this.thumbSrc=null;this.shouldStretch=!1;this.resetUriStack=!0;var a=this.stream.getCursor();if(b("VideoPlayerAbortLoadingExperiment").canAbort){var c;for(c=0;c=e?a>e?a-=e:a=0:a-=d}else{e=b("Vector").getElementDimensions(this.scrollerBody).y;d=Math.max(c.MIN_UFI_HEIGHT,a);e>=d?(a>d?(b("CSS").removeClass(this.rhc,"pinnedUfi"),a-=d):(b("CSS").addClass(this.rhc,"pinnedUfi"),a=0),b("Style").set(this.scroller,"height",d+"px")):(b("Style").set(this.scroller,"height","auto"),b("CSS").removeClass(this.rhc,"pinnedUfi"),a-=e)}this.scrollableArea.adjustGripper()};d.adjustForResize=function(){this.currentMinSize=null,this.adjustStageSize(),this.adjustForNewData()};d.shouldShowHiRes=function(a){if(!a||!a.smallurl)return!1;var b=this.getStageSize(a.dimensions);b=this._adjustStageSizeForPixelRatio(b);a=this.getImageSizeInStage(a.dimensions,b);return a.x>c.STAGE_NORMAL_MAX.x||a.y>c.STAGE_NORMAL_MAX.y};d._adjustStageSizeForPixelRatio=function(a){window.devicePixelRatio&&window.devicePixelRatio>1&&(a=new(b("Vector"))(a.x*window.devicePixelRatio,a.y*window.devicePixelRatio));return a};d.getImageURL=function(a){if(a.video)return null;else if(a.smallurl&&!this.shouldShowHiRes(a))return a.smallurl;return a.url};d.getImageOrVideoDimensions=function(a){if(a.video){a=this.getVideoElement(a.video);if(a)return this.getVideoSize(a)}return this._viewable.getNaturalDimensions()};d.getStageSize=function(a,d){__p&&__p();var e=b("Vector").getViewportDimensions();this._isLiveBroadcast&&(e.y-=200);var f=new(b("Vector"))(a.x,a.y);d&&(f=new(b("Vector"))(Math.max(a.x,d.x),Math.max(a.y,d.y)));if(this.isFullScreenSupported&&b("FullScreen").isFullScreen()){a=screen.height-c.FULL_SCREEN_PADDING*2;return new(b("Vector"))(this.rhcCollapsed?screen.width:screen.width-c.SIDEBAR_SIZE_MAX,a)}else{d=Math.min(f.x,e.x-c.SIDEBAR_SIZE_MAX-c.STAGE_CHROME.x);e=e.y-c.STAGE_CHROME.y;a=Math.min(f.y,e)}if(d===0&&a===0)return new(b("Vector"))(0,0);e=d/a;f=f.x/f.y;return e=c.x||a>=c.y){f=c.x/c.y;var g=d/a;fg?(a=c.y,d=Math.round(a*g)):(d=c.x,a=c.y)}return new(b("Vector"))(d,a+e)};d.adjustStageSize=function(a){__p&&__p();var d=this.currentImageSize;if(a)d=a;else{a=this.stream&&this.stream.getCurrentImageData();a&&(d=this.getImageOrVideoDimensions(a))}if(!d)return;this.currentImageSize=d;a=this.getExtraVerticalSpace();this.shouldStretch&&!this.getVideoOnStage()&&d.x>d.y&&d.x<=c.TIMELINE_STRETCH_WIDTH&&d.x>=c.TIMELINE_STRETCH_MIN&&(d.y=Math.round(d.y*c.TIMELINE_STRETCH_WIDTH/d.x),d.x=c.TIMELINE_STRETCH_WIDTH);var e=this.getStageSize(d,this.currentMinSize);this.currentMinSize||(this.currentMinSize=new(b("Vector"))(0,0));this.currentMinSize=new(b("Vector"))(Math.max(e.x,this.getMinimumStageWidth(),this.currentMinSize.x),Math.max(e.y,c.STAGE_MIN.y,this.currentMinSize.y));e=this.getImageSizeInStage(d,this.currentMinSize);d=this.currentMinSize.x-e.x;var f=this.currentMinSize.y-e.y;d>0&&d0&&f0)){this.showPagers(c.PAGER_FADE);return}this.lastPage=Date.now();this.unhiliteAllTags();this.startingMousePos=null;this.haveLeftBufferRegion=!1;this._seenTags={};this._navCount+=a;var g=this.stream.allLoaded?Math.abs(this._navCount)-this.stream.getLength():null;if(this._extraSlidePivot&&this._albumFBID){!this._albumBoundaries.end&&g===0?(this._albumBoundaries.end=this.stream.getCursor(),this._albumBoundaries.dir=a):g===-1&&b("PhotosetSearchPivotData").fetch(this._albumFBID,this.stream);if(!this.onExtraSlide)if(this.stream.getCursor()===this._albumBoundaries.end&&f===this._albumBoundaries.start&&a===this._albumBoundaries.dir){this.showPivotSlide(this._albumFBID,d);return}else this.stream.getCursor()===this._albumBoundaries.start&&f===this._albumBoundaries.end&&a===-this._albumBoundaries.dir&&this.showPivotSlide(this._albumFBID,d);else{this.hidePivotSlide();if(a===-this._albumBoundaries.dir)return}}f=this.getVideoOnStage();f&&this.switchVideo(f,!1);if(this.pivots&&this.pivots.page(a))return;b("Arbiter").inform("PhotoSnowlift.PAGE");b("Toggler").hide();this.recacheData();this.stream.moveCursor(a);this._viewable.hide();a!==0&&(this.storyID=null,this._updateContainerOwnerID());if(this.stream.errorInCurrent()){this.setLoadingState(c.STATE_HTML,!0);b("CSS").show(this.errorBox);return}this.movementDelta+=a;f=this.stream.getCurrentImageData();if(f){a=this.getImageURL(f);a?this._switchViewable(a,null,!0):f.video&&this.switchVideo(f.video,!0,e);this._updateObjectionableWarning(f);f.info.disablecontextmenu?this.disableContextMenu():this.enableContextMenu();d||(this.replaceUrl=!0,b("goURI")(f.info.permalink));this.setLoadingState(c.STATE_IMAGE_DATA,!1)}else this.setLoadingState(c.STATE_IMAGE_PIXELS,!0),this.setLoadingState(c.STATE_IMAGE_DATA,!0);this.stream.getCurrentHtml()?this.swapData():this.setLoadingState(c.STATE_HTML,!0);this.setLeftAndRightPagersState();!this._extraSlidePivot&&this._showMorePhotos&&this._albumFBID&&(g===-1?b("PhotosetSearchPivotData").fetch(this._albumFBID,this.stream):g===0?(b("PhotoTagSearchPivotLogger").logSuggestMorePhotos(),this.showMorePhotos(this._albumFBID,!0),this.showPagers(),this._navCount=0):(this.hideMorePhotos(),this.hidePagers()));this._initLitestandShareAttachments()};d.showMorePhotos=function(a,c){if(this._showingMorePhotos)return;this._showingMorePhotos=!0;this.searchPivot||(this.searchPivot=this.overlay.appendChild(document.createElement("div")));b("CSS").addClass(this.stageWrapper,"_5ymv");this.searchPivotComponent=new(b("ReactComponentRenderer"))(b("PhotosetSearchPivot.react"),this.searchPivot);this.searchPivotComponent.setProps({className:"_27g",fbid:a,onclose:this.hideMorePhotos.bind(this),endofalbum:c||!1,withBackground:!0})};d.hideMorePhotos=function(){this.searchPivotComponent&&this._showingMorePhotos&&(this._showingMorePhotos=!1,b("CSS").removeClass(this.stageWrapper,"_5ymv"),this.searchPivotComponent.setProps({fbid:null}))};d.showPivotSlide=function(a,c){if(this.onExtraSlide)return;this.onExtraSlide=!0;b("CSS").addClass(this.stageWrapper,"_3tvf");this.pivotSlide||(this.pivotSlide=b("DOM").create("div"),b("DOM").insertBefore(this.stageActions,this.pivotSlide));this.pivotSlideComponent=new(b("ReactComponentRenderer"))(b("PhotosetPivotSlide.react"),this.pivotSlide);this.pivotSlideComponent.setProps({fbid:a,isAlbum:this._isAlbum,albumOwnerName:this._albumOwnerName,visible:!0,onReturn:this.page.bind(this,this._albumBoundaries.dir,c)})};d.hidePivotSlide=function(){this.pivotSlideComponent&&this.onExtraSlide&&(this.pivotSlideComponent.setProps({visible:!1}),b("CSS").removeClass(this.stageWrapper,"_3tvf")),this.onExtraSlide=!1};d.logImpressionDetailsForPhoto=function(){__p&&__p();var a=[].concat(b("DOM").scry(b("$")("fbPhotoSnowliftTagList"),"input.photoImpressionDetails"),b("DOM").scry(b("$")("fbPhotoSnowliftFeedback"),"input.photoImpressionDetails"));if(a.length===0)return;var c={};for(var d=0;d=2&&this._uriStack[c-2]==a.getQualifiedURI().toString()&&this._uriStack.pop();c=this.stream.getCursorForURI(a.getUnqualifiedURI().toString());if(c){a=this.stream.getRelativeMovement(c);this.page(a,!0);b("PageTransitions").transitionComplete(!1);return!0}if(this.isOpen){b("PageTransitions").transitionComplete(!0);this.close();return!0}this.transitionHandlerRegistered=!1;return!1};d.recacheData=function(){if(!this.loadingStates.html){var a=this.stream.getCurrentHtml();for(var c in a){var d=b("ge")(c);d&&(a[c]=Array.from(d.childNodes),b("DOM").empty(d))}this.stream.containsUFIConfig()&&this._clearUFIContainers()}};d.reloadIfTimeout=function(){if(!b("ImageUtils").hasLoaded(this.image)){var a=this.makeNewImage(this.image.src,!0);b("Event").listen(a,"load",this.useImage.bind(this,a,null,!0));this._log(a.src)}};d._useViewable=function(a,c,d,e){__p&&__p();e===void 0;if(d&&this._viewable.isReady())return;e=function(){var d=this,e=this._viewable;this._viewable=a;b("DOM").replace(e.getElement(),a.getElement());this.setLoadingState(this.STATE_IMAGE_PIXELS,!1);this.adjustStageSize(c);window.setTimeout(function(){d.isOpen&&(d.adjustStageSize(),d.adjustForNewData())},0);e.suspend()}.bind(this);a.whenReady(e)};d.useImage=function(a,c,d,e){e===void 0&&(e=!1);if(d&&b("ImageUtils").hasLoaded(this.image))return;d=function(){b("DOM").replace(this.image,a),this.image=a,this.adjustStageSize(c)}.bind(this);!e||b("ImageUtils").hasLoaded(a)?d():b("Event").listen(a,"load",d)};d.makeNewImage=function(a,d){__p&&__p();this.imageLoadingTimer?(window.clearTimeout(this.imageLoadingTimer),this.imageLoadingTimer=null):d||(this.imageRefreshTimer=window.setTimeout(this.reloadIfTimeout.bind(this),c.LOADING_TIMEOUT));d=b("DOM").create("img",{className:"spotlight",alt:""});d.setAttribute("aria-describedby","fbPhotosSnowliftCaption");d.setAttribute("aria-busy","true");var e=function(){var a=this;window.clearTimeout(this.imageRefreshTimer);this.image.setAttribute("aria-busy","false");this.setLoadingState(this.STATE_IMAGE_PIXELS,!1);window.setTimeout(function(){a.isOpen&&(a.adjustStageSize(),a.adjustForNewData())},0)}.bind(this);b("Event").listen(d,"load",e);this._log(a);b("EncryptedImg").isEncrypted(a)?b("EncryptedImg").insertIntoDOM(a,d):d.src=a;return d};d._updateObjectionableWarning=function(a){a.info.ocmarkup?(this.showObjectionableWarning(a.info.ocmarkup),this.obscuredByOverlay=!0):(this.hideObjectionableWarning(),this.obscuredByOverlay=!1)};d.handleObjectionableContentToggleButtonClicked=function(a,b){this.obscuredByOverlay=b,b&&this.getTagger().deactivateTagging()};d._switchViewable=function(a,c,d,e){__p&&__p();e===void 0&&(e=!1);b("CSS").hide(this.errorBox);e||this._viewable.hide();this.setLoadingState(this.STATE_IMAGE_PIXELS,!0);var f=this.stream&&this.stream.getCurrentImageData();if(f){e||b("PhotoSessionLog").addPhotoView(f.info,this.shouldShowHiRes(f),this.isFullScreenSupported&&b("FullScreen").isFullScreen());if(this._showHover){var g=this.stream.getCurrentExtraData();g&&b("PhotoTagSearchPivotLogger").logImageImpression("snowlift",String(this.stream.getCursor()),Object.keys(g.tagRects))}this._updateObjectionableWarning(f)}g=this._viewable.getElement().children[0];var h;this.isSpherical()?h=!!this.sphericalPhotoData&&f.info.fbid.toString()===this.sphericalPhotoData.fbid:h=g.src===a;if(!h){h=b("PhotoSnowliftViewableUtils").fromStreamData(f,this);this.sphericalPhotoData=null;this.isFullScreenSupported&&b("FullScreen").isFullScreen()&&(h.onToggleIntoFullScreen(),h.onEnterFullScreen());this._log(a);this._useViewable(h,c,!1,e)}else g.setAttribute("alt",f.info.caption),g.setAttribute("aria-busy","true"),this.adjustStageSize(c),this._viewable.show(),this._log(a);d&&this.stream.preloadImages(this.shouldShowHiRes.bind(this));b("Arbiter").inform("PhotoSnowlift.SWITCH_IMAGE")};d._preloadNextVideo=function(){var a=this.stream.calculatePositionForMovement(1);a=this.stream.getCursorAt(a);a=this.stream.getImageData(a);a&&a.video&&a.controller&&a.controller.preload()};d._emptyVideoStage=function(){b("DOM").empty(this.videoStage)};d.switchVideo=function(a,c,d){__p&&__p();var e=this;this._pauseVideoIfNeeded();var f="swf_"+a;window.videoStage=this.videoStage;this._emptyVideoStage();if(c){this._preloadNextVideo();b("CSS").addClass(this.stageWrapper,"showVideo");var g=this.stream.getCurrentImageData();this.shouldRenderVideoPivots&&(b("CSS").hide(this.nextPager),b("CSS").hide(this.prevPager));var h,i;this._abortVideoWhenSwitch=!0;if(g.useReactPlayer){h=b("DOM").create("div");c=new(b("VideoData"))(g.videoData);var j=g.PhotoSnowliftVideoNode;j&&!this.PhotoSnowliftVideoNode&&(this.PhotoSnowliftVideoNode=j);var k=j.getVideoNode(c.getVideoID());if(k)h=k.getVideoContainer(),this._videoPlayerStateManager=k.getVideoPlayerController(),k.updateDimension(g.width,g.height),g.keepReactVideoNodeLoaded&&(this._abortVideoWhenSwitch=!1);else{k=g.PhotoSnowliftVideo;b("ReactDOM").render(b("React").createElement(k,{width:g.width,height:g.height,videoData:c,ref:function(a){return i=a}}),h);this._videoPlayerStateManager=i.getVpc();j.destroyVideoNode()}}else h=g.video_element,b("DOM").scry(h,"._ox1")[0].style.cssText="",this._videoPlayerStateManager=g.controller;k=null;this.pivotsCarouselElement&&(k=b("DOMQuery").scry(this.pivotsCarouselElement,"._32_l"));k&&k.forEach(function(a){var c=a.getAttribute("data-fbid"),d=e.stream.getCursor();a=b("DOM").find(a,"._1pqn");c===d?b("CSS").show(a):b("CSS").hide(a)});b("CSS").addClass(h,"videoStageContainer");b("DOM").appendContent(this.videoStage,h);b("DOM").appendContent(this.videoStage,this.pivotsCarouselElement);this.videoContainer=h;window[f]&&!b("ge")(f)&&window[f].write(a);c="video_warning_"+a;j=b("ge")(a);this.videoWarnings||(this.videoWarnings=[]);j&&this.videoWarnings[c]&&b("DOM").setContent(j,this.videoWarnings[c]);g.abortedLoadingOtherVideos&&(this._preloadTimeout&&window.clearTimeout(this._preloadTimeout),this._preloadTimeout=window.setTimeout(function(){var a=[e.stream.getPreviousImageData(),e.stream.getNextImageData()],b=a[0];a=a[1];a&&a.controller&&a.controller.preload();b&&b.controller&&b.controller.preload()},r));g.useReactPlayer||this._videoPlayerStateManager.reset();this._videoPlayerStateManager.collectFeedTrackingData();this._videoPlayerStateManager.hasOption("PhotoSnowlift","isInSnowlift")||this._videoPlayerStateManager.registerOption("PhotoSnowlift","isInSnowlift",function(){return!0});this._videoPlayerStateManager.emit("PhotoSnowlift/enterSnowlift");if(this._autoplayVideos){k=d||"user_initiated";this._videoPlayerStateManager.play(k)}this._autoplayNextVideo&&this._videoPlayerStateManager.addListener("finishPlayback",function(){var a=g.info.fbid.toString();if(e.haltAutoplay&&a!==e.stream.fbidList[e.stream.fbidList.length-1]){if(e.autoplayOptionScreenConfig){a=e.autoplayOptionScreenConfig.controller;a.registerCallbacks(h,e.chooseToReplayVideo.bind(e,e._videoPlayerStateManager),e.handleAutoplay.bind(e,g))}}else e.handleAutoplay(g)});window.setTimeout(this.adjustStageSizeForVideo.bind(this,a),0)}else window[f]&&window[f].addVariable("video_autoplay",0),this.videoLoadTimer&&window.clearTimeout(this.videoLoadTimer),b("CSS").removeClass(this.stageWrapper,"showVideo")};d.removeAutoplayOptionScreen=function(){this.autoplayOptionScreenConfig&&this.autoplayOptionScreenConfig.controller.removeSelf()};d.chooseToReplayVideo=function(a){a.play("user_initiated"),this.removeAutoplayOptionScreen(),this.haltAutoplay=!1};d.handleAutoplay=function(a){a=a.info.fbid.toString();a===this.stream.getCursor()&&a!==this.stream.fbidList[this.stream.fbidList.length-1]&&(b("SnowliftVideoPivotsCarouselController").adjustCarouselOnAutoPlay(),this.page(1,!1,"autoplay_initiated"));this.removeAutoplayOptionScreen();this.haltAutoplay=!1};d.checkVideoStatus=function(a){this.videoLoadTimer&&window.clearTimeout(this.videoLoadTimer);var b=this.getVideoOnStage();if(!b)return;else{if(b!==a)return;this.adjustStageSizeForVideo(a)}};d.getVideoSize=function(a){a=new(b("Vector"))(a.getAttribute("data-video-width"),+a.getAttribute("data-video-height")+this.getVideoComponentsHeight(a));if(this._videoPlayerStateManager&&this._videoPlayerStateManager.isSpherical&&this._videoPlayerStateManager.isSpherical()){var c=b("Vector").getViewportDimensions(),d=c.x;c=c.x/2;return new(b("Vector"))(d,c)}else return a};d.getVideoElement=function(a){return b("DOM").scry(this.videoStage,"._ox1")[0]};d.getVideoComponentsHeight=function(a){__p&&__p();var c=0;a=b("Parent").bySelector(a,"._1c_u");if(!a)return 0;a=b("DOM").scry(a,"._2i84");if(a.length){a=a[0].getBoundingClientRect();c=a.bottom-a.top}return c};d.adjustStageSizeForVideo=function(a){var b=this.getVideoElement(a);!b?this.videoLoadTimer=window.setTimeout(this.checkVideoStatus.bind(this,a),200):this.adjustStageSize(this.getVideoSize(b))};d.handleServerError=function(a,c){b("DOM").setContent(this.errorBox,a),this.storeFromData(c)};d.fixButtonText=function(a){__p&&__p();if(!this.buttonTruncateGk)return;var c=b("DOM").scry(a,".photosTruncatingUIButton");a=parseInt(b("Style").get(a,"width"),10);if(a>p){a={tagPhoto:i._("Tag Photo"),doneTagPhoto:i._("Done Tagging"),productTagPhoto:i._("Tag Products"),doneProductTagPhoto:i._("Done Tagging"),addLocation:i._("Add Location"),editPhoto:i._("Edit")};for(var d=0;d1&&this.previousAuthorName){d=this._navHistory[this._navHistory.length-2];this.backButton=b("ReactDOM").render(b("React").createElement(b("PhotoSnowliftBackLink.react"),{href:d,name:this.previousAuthorName,visible:!0}),c)}else this.backButton=b("ReactDOM").render(b("React").createElement(b("PhotoSnowliftBackLink.react"),{visible:!1}),c)}};d.storeFromData=function(a){__p&&__p();var d=this;if(!this.isOpen)return;a.pivots&&(this.pivotsCarouselElement=a.pivots);a.autoplay_option_screen_config&&(this.autoplayOptionScreenConfig=a.autoplay_option_screen_config,this.autoplayOptionScreenConfig&&this.autoplayOptionScreenConfig.enabled&&this.addHaltAutoplaySubscription());this.shouldRenderVideoPivots=a.should_render_pivots;if(a.ssid&&this.sessionID&&this.sessionID!=a.ssid)return;if("error"in a){this.stream.storeToCache(a);this.checkState(c.STATE_ERROR);return}if(this.didReceivePayloadHavingInitProperty===!1&&Object.prototype.hasOwnProperty.call(a,"init")===!1){this.payloadsReceivedBeforePayloadHavingInitProperty.push(a);return}var e=this.stream.storeToCache(a);if("init"in a){var f;this.shouldRenderVideoPivots&&(this._videoSameAsSource=a.init.videoSameAsSource);this._mediaFBID=a.init.fbid;this._albumFBID=a.init.album_fbid;this._isAlbum=a.init.is_album;this._albumOwnerName=a.init.album_owner_name;this._autoplayVideos=a.init.autoplay_videos;this._autoplayNextVideo=a.init.autoplay_next_video;this._referrerProfileID=a.init.referrer_profile_id;this._ownerID=a==null?void 0:(f=a.image[this._mediaFBID])==null?void 0:(f=f.info)==null?void 0:f.owner}else this._preloadNextVideo();f="init"in e;f&&(this.initialDataFetched(e.init),this.openExplicitly&&(this.replaceUrl=!0,b("goURI")(this.stream.getCurrentImageData().info.permalink)),this.stream.canPage()&&this.setStagePagersState("ready"),this.setLeftAndRightPagersState());"image"in e&&this.checkState(c.STATE_IMAGE_DATA,f);"data"in e&&this.checkState(c.STATE_HTML);if(Object.prototype.hasOwnProperty.call(a,"init")){this.didReceivePayloadHavingInitProperty=!0;if(this.payloadsReceivedBeforePayloadHavingInitProperty.length){f=[].concat(this.payloadsReceivedBeforePayloadHavingInitProperty);this.payloadsReceivedBeforePayloadHavingInitProperty.length=0;f.forEach(function(a){b("ErrorUtils").applyWithGuard(function(){d.storeFromData(a)},null,null,null,"PhotoSnowlift::storeFromData() payload queue flusher")})}}};d.setLeftAndRightPagersState=function(){this.stream.isNonCircularPhotoSet()&&(b("CSS").conditionClass(this.root,"disableLeft",!this.stream.nonCircularPhotoSetCanPage(-1)),b("CSS").conditionClass(this.root,"disableRight",!this.stream.nonCircularPhotoSetCanPage(1)));if(this.snowflake){b("CSS").conditionClass(this.root,"disableLeft",this.stream.getCursor()==this.firstInSet);var a=this.stream.getCursorAt(this.stream.calculatePositionForMovement(1));b("CSS").conditionClass(this.root,"disableRight",a==this.firstInSet)}};d.setStagePagersActivated=function(a){b("CSS").hasClass(this.root,"pagingActivated")!==a&&b("CSS").conditionClass(this.root,"pagingActivated",a)};d.setStagePagersState=function(a){switch(a){case"ready":b("CSS").addClass(this.root,"pagingReady");this.pagersShown=!0;return;case"disabled":case"reset":b("CSS").removeClass(this.root,"pagingReady");return}};d.deletePhoto=function(a){this.closeRefresh()};d.closeRefresh=function(){this.refreshOnClose=!0,this.spotlight.hide()};d.onHiliteTag=function(a,c){if(c.version!=b("PhotosConst").VIEWER_SNOWLIFT)return;a=c.tag;a&&this.switchHilitedTags(a,!0)};d.onUpdateTagBox=function(a,c){c.version==b("PhotosConst").VIEWER_SNOWLIFT&&this.updateTagBox(c.id,c.approve)};d.isSpherical=function(){var a=this.stream.getCurrentImageData();return Boolean(a&&a.spherical)||this.thumbSpherical};d._log=function(a){if(this._shouldLog){this._logger&&this._logger.log(a.startsWith("data:")?b("EncryptedImg").dataUrlPrefix(a):a,String(this.stream.getCursor()),this.getViewerSource(),this._referrerProfileID);return!0}return!1};d._enableMouseOver=function(){this._disableMouseOver=!1};d._interceptMouseOver=function(a){this._disableMouseOver&&a.kill()};d.isReturningToStart=function(){return!!this.returningToStart};d._pauseVideoIfNeeded=function(){this._videoPlayerStateManager&&(this._videoPlayerStateManager.pause("unloaded"),b("VideoPlayerAbortLoadingExperiment").canAbort&&this._abortVideoWhenSwitch&&this._videoPlayerStateManager.abortLoading(),this._videoPlayerStateManager.hasOption("PhotoSnowlift","isInSnowlift")&&this._videoPlayerStateManager.unregisterOption("PhotoSnowlift","isInSnowlift"),this._videoPlayerStateManager.emit("PhotoSnowlift/exitSnowlift"))};d._destroyVideoIfNeeded=function(){this._videoPlayerStateManager&&b("SnowliftDestroyVideoPlayerExperiment").destroyVideoOnExit&&this._videoPlayerStateManager.destroy()};d.setIsLiveBroadcast=function(){this._isLiveBroadcast=!0};d.registerLiveInputBar=function(a){this._liveInputBar=a};d.setActionsMenuState=function(a){this._actionMenuOpen=a,a||this.hidePagers()};d.registerActionsMenu=function(a){var c=this;this._actionsMenuSubscriptionsHandler=new(b("SubscriptionsHandler"))();this._actionsMenuSubscriptionsHandler.addSubscriptions(a.getPopover().subscribe("show",function(){return c.setActionsMenuState(!0)}),a.getPopover().subscribe("hide",function(){return c.setActionsMenuState(!1)}))};c.getInstance=function(){c._instance||(c._instance=new c());return c._instance};c.initWithSpotlight=function(a,b){c.getInstance().init(a,b)};c.addPhotoFbids=function(a,b,d,e){c.getInstance().addPhotoFbids(a,b,d,e)};c.registerActionsMenu=function(a){var b=c.getInstance();b||j(0,198);b.registerActionsMenu(a)};c.registerLiveInputBar=function(a){c.getInstance().registerLiveInputBar(a)};c.setIsLiveBroadcast=function(){c.getInstance().setIsLiveBroadcast()};c.setReachedLeftEnd=function(){c.getInstance().setReachedLeftEnd()};c.setReachedRightEnd=function(){c.getInstance().setReachedRightEnd()};c.attachFollowFlyout=function(a){b("DOM").insertAfter(b("$")("fbPhotoSnowliftSubscribe"),a)};c.attachSubscribeFlyout=function(a){b("DOM").insertAfter(b("$")("fbPhotoSnowliftSubscribe"),a)};c.attachTagger=function(a,b,d){c.getInstance().attachTagger(a,b,d)};c.bootstrap=function(a,d){var e=String(b("URI").getMostRecentURI().getQueryData().viewas),f=new(b("URI"))(a).getQueryData();if(!b("PhotoSnowliftLoader").shouldUseSnowlift(f,a,d,e))return;b("FunnelLogger").startFunnel(k);d!=null&&b("Parent").bySelector(d,"._18ia")!=null&&b("FunnelLogger").addFunnelTag(k,"via_search_media_module");c.getInstance().bootstrap(a,d)};c.closeRefresh=function(){c.getInstance().closeRefresh()};c.deletePhoto=function(a){c.getInstance().deletePhoto(a)};c.getImage=function(){return c.getInstance().getImage()};c.getImageId=function(){return c.getInstance().getImageId()};c.getLoadQuery=function(){return c.getInstance().getLoadQuery()};c.getRHCBody=function(){return c.getInstance().getRHCBody()};c.getRHCHeader=function(){return c.getInstance().getRHCHeader()};c.getRoot=function(){return c.getInstance().getRoot()};c.saveTagsFromPayload=function(a){c.getInstance().saveTagsFromPayload(a)};c.saveTagsFromPayloadDelayed=function(a){window.setTimeout(c.saveTagsFromPayload.bind(null,a),2e3)};c.handleServerError=function(a,b){c.getInstance().handleServerError(a,b)};c.setAuthorName=function(a,b){c.getInstance().setAuthorName(a,b)};c.storeFromData=function(a){c.getInstance().storeFromData(a)};c.swapData=function(){c.getInstance().swapData()};c.updateTotalCount=function(a,b,d){c.getInstance().updateTotalCount(a,b,d)};c.setVideoRotateURI=function(a){c.getInstance().videoRotateURI=a};return c}(b("classWithMixins")(b("PhotoViewer"),b("mixin")(b("ObjectionableContentFilterMixin"),b("DisableContextMenuMixin"))));Object.assign(a,{STATE_ERROR:"error",STATE_HTML:"html",STATE_IMAGE_PIXELS:"image_pixels",STATE_IMAGE_DATA:"image",LOADING_TIMEOUT:2e3,PAGER_FADE:3e3,FULL_SCREEN_PADDING:10,STAGE_NORMAL_MAX:b("PhotoSnowliftLoader").STAGE_NORMAL_MAX,STAGE_MIN:{x:520,y:520},PROFILE_PICTURE_BUTTON_WIDTH:140,SIDEBAR_SIZE_MAX:b("PhotoSnowliftLoader").SIDEBAR_SIZE_MAX,STAGE_CHROME:b("PhotoSnowliftLoader").STAGE_CHROME,VIDEO_BOTTOM_BAR_SPACE:50,GOPREV_AREA:120,TIMELINE_STRETCH_WIDTH:843,TIMELINE_STRETCH_MIN:480,MIN_TAG_DISTANCE:83,PADDING_MIN:40,MIN_UFI_HEIGHT:250,COLLECTIONS_UNTAGGED_PHOTOS:3,PHOTOS_OF_YOU_SUGGESTIONS:28,FRIENDS_IN_PHOTOS_SUGGESTIONS:31,PINNED_UFI_ADJUSTMENT:11,ADD_COMMENT_HEIGHT:54,_instance:null,touch:b("emptyFunction"),touchMarkup:b("emptyFunction")});e.exports=a}),null);