/*!CK:2772515754!*//*1403491362,*/ if (self.CavalryLogger) { CavalryLogger.start_js(["wxrrY"]); } __d("TimelineProfilePictureLoggerEnums",[],function(a,b,c,d,e,f){e.exports={actions:{EDIT_THUMBNAIL:"edit_thumbnail",FROM_PHOTOS:"from_photos",MAKE_PROFILE:"make_profile",SILHOUETTE:"silhouette",SUGGESTION:"suggestion",SUGGESTION_UPLOAD:"suggestion_upload",SYNCED_PHOTO:"synced_photo",TAKE_PHOTO:"take_photo",UPLOAD:"upload_photo",USE_PREVIOUS:"use_previous"},flows:{PERMALINK:"permalink",SNOWLIFT:"snowlift",SPOTLIGHT:"spotlight",VAULT:"vault",ZOOMCROP:"zoomcrop"},steps:{INIT:"init",CANCEL:"cancel",CROP:"crop",CROP_FAIL:"crop_fail",CROP_SAVING:"crop_saving",CROP_SUCCESS:"crop_success",FAIL:"fail",LOADING:"loading",PREVIOUS_PIC_FAIL:"previous_pic_fail",PREVIOUS_PIC_INIT:"previous_pic_init",PREVIOUS_PIC_SAVING:"previous_pic_saving",PREVIOUS_PIC_SUCCESS:"previous_pic_success",SUCCESS:"success",UPLOAD_SELECT:"upload_select",UPLOAD_SUCCESS:"upload_success",VIEWER_INIT:"viewer_init"}};},null); __d("ImageUtils",["UserAgent"],function(a,b,c,d,e,f,g){var h={hasLoaded:function(i){if(i.naturalWidth!==undefined){return i.complete&&i.width!==0;}else if(i.height==20&&i.width==20&&i.complete){return false;}else if(i.complete===undefined&&g.webkit()<500){var j=new Image();j.src=i.src;return j.complete;}return i.complete;}};e.exports=h;},null); __d("PhotoEverstoreLogger",["Event","AsyncRequest","copyProperties","ImageUtils"],function(a,b,c,d,e,f,g,h,i,j){var k={BATCH_WINDOW_MS:500,storedLog:[]};function l(){}i(l,{_log:function(n){k.storedLog.push(n);if(k.storedLog.length==1)setTimeout(m,k.BATCH_WINDOW_MS);},logImmediately:function(n){l._log(n);},registerForLogging:function(n){var o=document.getElementById(n);if(o!=null)if(j.hasLoaded(o)){l._log(o.src);}else g.listen(o,'load',function(event){l._log(o.src);});}});function m(){var n=k.storedLog;k.storedLog=[];var o=JSON.stringify(n);new h().setURI('/ajax/photos/logging/everstore_logging.php').setData({loggedUrls:o}).setMethod('POST').setOption('suppressErrorHandlerWarning',true).setOption('suppressErrorAlerts',true).send();}e.exports=l;},null); __d("PhotosConst",[],function(a,b,c,d,e,f){var g={VIEWER_PERMALINK:0,VIEWER_SNOWLIFT:6,VIEWER_VAULTBOX:8,VIEWER_SNOWFLAKE:14,VIEWER_PERMALINK_STRING:'permalink',VIEWER_SNOWLIFT_STRING:'snowlift',VIEWER_VAULTBOX_STRING:'vaultbox',BULK_EDITOR:3,FLASH_UPLOADER:4,HTML5_UPLOADER:10,SIZE_NORMAL:'n',PIC_NORMAL_FBX_SIZE:180};e.exports=g;},null); __d("PhotoViewerImage",["PhotoEverstoreLogger","URI","Vector"],function(a,b,c,d,e,f,g,h,i){function j(k){"use strict";this._hiResDimensions=k.hiResDimensions&&i.deserialize(k.hiResDimensions);this._normalDimensions=k.normalDimensions&&i.deserialize(k.normalDimensions);this._info=k.info;this._video=k.video;this._shouldLog=k.everstoreLogThis;this._hiResSrc=k.hiResSrc;this._normalSrc=k.normalSrc;this._thumbSrc=k.thumbSrc;this._isInverted=false;this._data=k;}j.prototype.getURIString=function(){"use strict";return h(this._info.permalink).getUnqualifiedURI().toString();};j.prototype.hasHiResDimensions=function(){"use strict";return !!this._hiResDimensions;};j.prototype.getHiResDimensions=function(){"use strict";return this._hiResDimensions;};j.prototype.getNormalDimensions=function(){"use strict";return this._normalDimensions;};j.prototype.getHiResSrc=function(){"use strict";return this._hiResSrc;};j.prototype.getNormalSrc=function(){"use strict";return this._normalSrc;};j.prototype.getThumbSrc=function(){"use strict";return this._thumbSrc;};j.prototype.getInfo=function(){"use strict";return this._info;};j.prototype.getPermalink=function(){"use strict";return this._info.permalink;};j.prototype.getHighestResSrc=function(){"use strict";return this._hiResSrc||this._normalSrc;};j.prototype.preload=function(k){"use strict";var l;if(this.getHighestResSrc())if(k&&!this._resource){this._resource=new Image();this._resource.src=this.getHighestResSrc();l=this._resource.src;if(this._shouldLog)g.logImmediately(this._resource.src);}else if(!k&&!this._small){this._small=new Image();this._small.src=this._normalSrc||this._hiResSrc;l=this._small.src;if(this._shouldLog)g.logImmediately(this._small.src);}return l;};j.prototype.setNormalDimensions=function(k,l){"use strict";this._normalDimensions=new i(k,l);};j.prototype.setHiResDimensions=function(k,l){"use strict";this._hiResDimensions=new i(k,l);};j.prototype.invertDimensions=function(){"use strict";if(this.hasHiResDimensions())this._hiResDimensions=new i(this._hiResDimensions.y,this._hiResDimensions.x);this._normalDimensions=new i(this._normalDimensions.y,this._normalDimensions.x);this._isInverted=!this._isInverted;};j.prototype.copy=function(){"use strict";return new j(this._data);};e.exports=j;},null); __d("PhotoStreamCache",["DOM","HTML","PhotoEverstoreLogger","PhotosConst","PhotoViewerImage","Rect","UIPagelet","URI","Vector","copyProperties","createArrayFrom","ge"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r){function s(){"use strict";}s.prototype.init=function(t,u,v,w){"use strict";this.version=t;this.pageletName=u;this.pageletRootID=v;this.bufferSize=s.BUFFER_SIZE;this.fullBucketSize=s.FULL_BUCKET_SIZE;this.initError=false;this.isActive=true;this.usesOpaqueCursor=false;this.usesNonCircularPhotoSet=false;this.reachedLeftEnd=false;this.reachedRightEnd=false;this.leftLock=false;this.rightLock=false;this.useAjaxPipe=true;this.logger=w;this.viewAsUser=null;this.reset();};s.prototype.setViewAs=function(t){"use strict";this.viewAsUser=t;};s.prototype.isInViewAsMode=function(){"use strict";return !!this.viewAsUser;};s.prototype.getViewAsUserId=function(){"use strict";return this.viewAsUser;};s.prototype.getUsesOpaqueCursor=function(){"use strict";return this.usesOpaqueCursor;};s.prototype.isNonCircularPhotoSet=function(){"use strict";return this.usesNonCircularPhotoSet;};s.prototype.setReachedLeftEnd=function(){"use strict";this.reachedLeftEnd=true;};s.prototype.setReachedRightEnd=function(){"use strict";this.reachedRightEnd=true;};s.prototype.hasReachedLeftEnd=function(){"use strict";return this.reachedLeftEnd;};s.prototype.hasReachedRightEnd=function(){"use strict";return this.reachedRightEnd;};s.prototype.nonCircularPhotoSetCanPage=function(t){"use strict";if(!this.isNonCircularPhotoSet())return true;if(t<0)return this.getCursorPos()||!this.hasReachedLeftEnd();if(t>0)return (this.getLength()-1!=this.getCursorPos())||!this.hasReachedRightEnd();return true;};s.prototype.setUseAjaxPipe=function(t){"use strict";this.useAjaxPipe=t;};s.prototype.reset=function(){"use strict";this.cache={image:{},extra:{},html:{}};this.fbidList=[];this.loaded=false;this.allLoaded=false;this.permalinkMap={};this.position=0;this.totalCount=null;this.firstCursor=null;this.firstCursorIndex=null;this.firstOpaqueCursor=null;};s.prototype.waitForInitData=function(){"use strict";this.fbidList.push(s.INIT_PLACEHOLDER);};s.prototype.destroy=function(){"use strict";this.reset();this.isActive=false;};s.prototype.isLoaded=function(){"use strict";return this.loaded;};s.prototype.canPage=function(){"use strict";if(!this.isLoaded())return false;if(this.totalCount!==null)return this.totalCount>1;if(this.usesNonCircularPhotoSet)return true;return this.getLength()>1;};s.prototype.errorInCurrent=function(){"use strict";if(this.initError){return true;}else if(!this.isLoaded())return false;return this.checkErrorAt(this.getCursor());};s.prototype.getLength=function(){"use strict";return this.fbidList.length;};s.prototype.getPhotoSet=function(){"use strict";return this.photoSetQuery.set;};s.prototype.getPhotoSetQuery=function(){"use strict";return this.photoSetQuery;};s.prototype.getCurrentImageData=function(){"use strict";return this.getImageData(this.getCursor());};s.prototype.addViewAsToURI=function(t){"use strict";var u=n(t);if(this.isInViewAsMode())u.addQueryData({viewas:this.getViewAsUserId()});return u;};s.prototype.getOpaqueCursor=function(t){"use strict";if(this.getImageData(t)){if(this.version===j.VIEWER_VAULTBOX)return this.getImageData(t).getInfo().opaquecursor;return this.getImageData(t).info.opaquecursor;}if(t==this.firstCursor)return this.firstOpaqueCursor;return null;};s.prototype.getImageData=function(t){"use strict";var u=this.getCacheContent(t,s.IMAGE_DATA);if(u)u.info.permalink=this.addViewAsToURI(u.info.permalink);return u;};s.prototype.getCurrentHtml=function(){"use strict";return this.getCacheContent(this.getCursor(),s.HTML);};s.prototype.getCurrentExtraData=function(){"use strict";return this.getCacheContent(this.getCursor(),s.EXTRA);};s.prototype.getCacheContent=function(t,u){"use strict";if(!t||t===s.ERROR_ID||t===s.INIT_PLACEHOLDER)return null;return this.cache[u][t];};s.prototype.getCursorPos=function(){"use strict";return this.position;};s.prototype.getCursor=function(){"use strict";if(this.position>=0&&this.position0||(u>=0&&u0);};s.prototype.checkErrorAt=function(t){"use strict";if(!this.isLoaded())return false;if(t===s.ERROR_ID)return true;return false;};s.prototype.getRelativeMovement=function(t){"use strict";for(var u=0;uy*2){u=(this.position+w-y%w)%w;v=(this.position+y)%w;}else{u=0;v=w-1;}while(u!=v){var z,aa=this.fbidList[u],ba=t&&t(x[aa]);if(this.version===j.VIEWER_VAULTBOX){z=x[aa]&&x[aa].preload(ba);}else if(x[aa]&&x[aa].url)if(ba&&!x[aa].resource){x[aa].resource=new Image();x[aa].resource.src=x[aa].url;z=x[aa].url;if(x[aa].everstoreLogThis===true)i.logImmediately(x[aa].resource.src);}else if(!ba&&!x[aa].small){x[aa].small=new Image();x[aa].small.src=x[aa].smallurl||x[aa].url;z=x[aa].small.src;if(x[aa].everstoreLogThis===true)i.logImmediately(x[aa].small.src);}if(this.logger&&z)this.logger.log(z);u=(u+1)%w;}};s.prototype.loadMoreIfNeccessary=function(t){"use strict";if(this.allLoaded||(t&&this.rightLock)||(!t&&this.leftLock))return;var u=t?1:-1,v=this.position+this.bufferSize*u;if(v<0&&!this.checkErrorAt(this.getEndCursor(false))){this.leftLock=true;this.fetch(this.fullBucketSize,false);}else if(v>this.getLength()&&!this.checkErrorAt(this.getEndCursor(true))){this.rightLock=true;this.fetch(this.fullBucketSize,true);}};s.prototype.getEndCursor=function(t){"use strict";return t?this.fbidList[this.getLength()-1]:this.fbidList[0];};s.prototype.calculateRelativeIndex=function(t,u,v){"use strict";if(!this.totalCount)return null;var w=this.fbidList.indexOf(u),x=this.fbidList.indexOf(v);if(w===-1||x===-1)return null;var y=x-w;return (t+y+this.totalCount)%this.totalCount;};s.prototype.calculateDistance=function(t,u){"use strict";var v=this.fbidList.indexOf(t),w=this.fbidList.indexOf(u);if(v===-1||w===-1)return null;return (w-v+this.getLength())%this.getLength();};s.prototype.fetch=function(t,u){"use strict";var v=this.getEndCursor(u),w=p({cursor:v,version:this.version,end:this.getEndCursor(!u),fetchSize:u?t:-1*t,relevant_count:this.relevantCount,opaqueCursor:this.getOpaqueCursor(v)},this.photoSetQuery);if(this.isInViewAsMode())w.viewas=this.getViewAsUserId();if(this.totalCount&&this.firstCursorIndex!==null){w.total=this.totalCount;w.cursorIndex=this.calculateRelativeIndex(this.firstCursorIndex,this.firstCursor,v);}var x=r(this.pageletRootID);if(!x){x=g.create('div',{id:this.pageletRootID});g.appendContent(document.body,x);}m.loadFromEndpoint(this.pageletName,x,w,{usePipe:this.useAjaxPipe,automatic:true,jsNonblock:true,crossPage:true});if(!this.useAjaxPipe)this.setUseAjaxPipe(true);};s.prototype.storeToCache=function(t){"use strict";var u={};if(!this.isActive)return u;if('error' in t){this.processErrorResult(t.error);u.error=true;return u;}if('init' in t){this.processInitResult(t.init);u.init={logids:t.init.logids,fbid:t.init.fbid,loggedin:t.init.loggedin,fromad:t.init.fromad};}if('image' in t){this.processImageResult(t.image);u.image=true;}if('data' in t){this.processDataResult(t.data);u.data=true;}return u;};s.prototype.processInitResult=function(t){"use strict";if(this.loaded)return;this.usesOpaqueCursor=t.usesopaquecursor;this.usesNonCircularPhotoSet=t.isnoncircularphotoset;this.loaded=true;this.photoSetQuery=t.query;if(t.bufferSize)this.bufferSize=t.bufferSize;if(t.fullBucketSize)this.fullBucketSize=t.fullBucketSize;if(this.fbidList.length===0){this.fbidList.push(t.fbid);this.rightLock=true;}else{var u=this.fbidList.indexOf(s.INIT_PLACEHOLDER);if(u!=-1)this.fbidList[u]=t.fbid;}this.firstCursor=t.fbid;this.firstOpaqueCursor=t.opaquecursor;if('initIndex' in t&&'totalCount' in t){this.firstCursorIndex=t.initIndex;this.totalCount=t.totalCount;}if(this.version==j.VIEWER_PERMALINK)this.fetch(s.INIT_BUCKET_SIZE,true);};s.prototype.processImageResult=function(t){"use strict";for(var u in t){if(u===this.firstCursor&&t[u].everstoreLogThis)i.logImmediately(t[u].url);if(this.version===j.VIEWER_VAULTBOX){var v=t[u];this.cache.image[u]=new k(v);this.permalinkMap[this.cache.image[u].getURIString()]=u;}else{this.cache.image[u]=t[u];if(t[u].dimensions)this.cache.image[u].dimensions=o.deserialize(t[u].dimensions);if(t[u].originalDimensions)this.cache.image[u].originalDimensions=o.deserialize(t[u].originalDimensions);if(t[u].smalldims)this.cache.image[u].smalldims=o.deserialize(t[u].smalldims);this.permalinkMap[n(t[u].info.permalink).getUnqualifiedURI().toString()]=u;}}};s.prototype.attachToFbidsList=function(t,u,v){"use strict";if(this.allLoaded)return;if(u===-1){for(var w=t.length-1;w>=0;w--){this.fbidList.unshift(t[w]);this.position++;}this.leftLock=false;}else{for(var x=0;x0?p[r-1]:t;u=ru?u:o;p[r]=o;if(this.props.behavior===k.PUSH){for(var v=r+1,w=p.length;v=o)break;p[v]=o;}for(v=r-1;v>=0;v--){if(p[v]<=o)break;p[v]=o;}}this.setState({values:p});this.props.onChange&&this.props.onChange(p);}},_onMouseUp:function(event){if(this.state.draggingIdx!==null)this.setState({draggingIdx:null});},render:function(){var m=this.state.values,n=this.props.max-this.props.min,o=[];for(var p=0,q=m.length;p1?'['+p+']':'');o.push(h.DOM.div({className:(("_4qwr")+(this.props.disabled?' '+"_4qws":'')),'data-value':p,key:'thumb-'+p,onDragStart:g.prevent,onMouseDown:this.props.disabled?null:this._onMouseDown,style:{left:(r*100)+'%'}},h.DOM.input({onChange:this.props.onChange,name:s,value:m[p],type:"hidden"})));}return this.transferPropsTo(h.DOM.div({className:"_4qwt"},h.DOM.div({className:"_4qwu"}),o));}});e.exports=l;},null); __d("clamp",[],function(a,b,c,d,e,f){function g(h,i,j){if(ij)return j;return i;}e.exports=g;},null); __d("SpotlightViewerInit",["DOM","React"],function(a,b,c,d,e,f,g,h){var i={render:function(j,k){var l=g.create('div');j=h.renderComponent(j,l);g.appendContent(document.body,l);j.subscribeOnce('close',function(){j.unmountComponent();g.remove(l);k&&k();});return j;}};e.exports=i;},null); __d("PhotoSessionLog",["AsyncRequest","Run","Vector","copyProperties"],function(a,b,c,d,e,f,g,h,i,j){function k(){}j(k,{UNKNOWN:0,ESC:1,X:2,OUTSIDE:3,UNLOAD:4,NAVIGATE:5,AGGREGATE:6,LEAVE:7,PERMALINK:0,SNOWLIFT:6,SNOWDOWN:13,AGGREGATION_COUNT:20,set:null,time:null,views:0,fbidList:[],details:{},width:0,height:0,first:false,last:false,logIds:false,version:null,source:null,buttonLikes:0,pagingAction:'',cycle:false,endOfRelevant:false,relevantCount:0,initLogging:function(l){this.set=null;this.time=new Date();this.views=0;this.hiResLoads=0;this.fullScreenViews={};this.first=true;this.last=false;this.logIds=false;this.version=l;this.buttonLikes=0;this.pagingAction='';this.cycle=false;this.endOfRelevant=false;this.relevantCount=0;if(l===k.SNOWLIFT){var m=i.getViewportDimensions();this.width=m.x;this.height=m.y;}},setLogFbids:function(l){this.logIds=l;},setPhotoSet:function(l){this.set=l;},addButtonLike:function(){this.buttonLikes++;},setPagingAction:function(l){this.pagingAction=l;},setCycle:function(l){this.cycle=l;},setEndOfRelevant:function(l){this.endOfRelevant=l;},setRelevantCount:function(l){this.relevantCount=l;},setEndMetrics:function(l){this.endMetrics=l;},setSource:function(l){this.source=l;},addPhotoView:function(l,m,n){if(this.logIds&&this.views>=this.AGGREGATION_COUNT)this.logPhotoViews(this.AGGREGATE);this.views++;if(l)this.fbidList.push([l.fbid,l.owner,Date.now()]);if(m)this.hiResLoads++;if(n)this.fullScreenViews[l.fbid]=true;},logEnterFullScreen:function(l){this.fullScreenViews[l]=true;},addDetailData:function(l,m){if(!this.details[l])this.details[l]={t:m.num_tags,l:m.has_location,c:m.has_caption,cm:m.comment_count,lk:m.like_count,w:m.width,h:m.height,ad:'{}',p:this.pagingAction};},updateAdData:function(l,m){if(this.details[l])this.details[l].ad=JSON.stringify(m);},logPhotoViews:function(l){if(!this.views)return;if(l!=this.AGGREGATE)this.last=true;var m={set:this.set,time:new Date()-this.time,fbids:this.logIds?this.fbidList:[],details:this.logIds?this.details:{},first:this.first,last:this.last,close:l?l:this.UNKNOWN,button_likes:this.buttonLikes,version:this.version,endmetric:this.endMetrics,cycle:this.cycle,end_relev:this.endOfRelevant,relev_count:this.relevantCount,source:this.source};if(this.version===k.SNOWLIFT){var n=i.getViewportDimensions();m.width=n.x||this.width;m.height=n.y||this.height;if(this.hiResLoads>0)m.hires_loads=this.hiResLoads;if(this.last){var o=Object.keys(this.fullScreenViews).length;if(o>0)m.fullscreen=o;}}new g().setURI('/ajax/photos/logging/session_logging.php').setAllowCrossPageTransition(true).setOption('asynchronous',(l!=k.UNLOAD)).setOption('suppressErrorHandlerWarning',true).setData(m).send();this.views=0;this.hiResLoads=0;this.fbidList=[];this.details={};this.first=false;this.buttonLikes=0;if(this.last){this.set=null;this.logIds=false;this.fullScreenViews={};}}});h.onUnload(function(){k.logPhotoViews(k.UNLOAD);});h.onLeave(function(){k.logPhotoViews(k.LEAVE);});e.exports=k;},null); __d("PhotosUtils",["copyProperties","Vector"],function(a,b,c,d,e,f,g,h){function i(){}g(i,{getNearestBox:function(j,k){var l=Infinity,m=null;for(var n in j){var o=j[n];if(o.contains(k)){var p=k.distanceTo(o.getCenter());if(pthis.ratio){x=i(s,w/this.ratio,u);w=x*this.ratio;}else{w=i(p,x*this.ratio,r);x=w/this.ratio;}return new g(w,x);};n.prototype.onResize=function(p,q){"use strict";var r=this.photocrop.min_width,s=this.photocrop.min_height,t=this.photocrop.box,u=this.photocrop.wrapper.offsetWidth,v=this.photocrop.wrapper.offsetHeight,w;switch(q){case 'ne':this.displacement=this.displacement.add(p.x,-p.y);w=this.$AspectRatioConstraint0(r,this.displacement.x,u-t.l,s,this.displacement.y,t.b);t.r=t.l+w.x;t.t=t.b-w.y;break;case 'nw':this.displacement=this.displacement.add(-p.x,-p.y);w=this.$AspectRatioConstraint0(r,this.displacement.x,t.r,s,this.displacement.y,t.b);t.l=t.r-w.x;t.t=t.b-w.y;break;case 'se':this.displacement=this.displacement.add(p.x,p.y);w=this.$AspectRatioConstraint0(r,this.displacement.x,u-t.l,s,this.displacement.y,v-t.t);t.r=t.l+w.x;t.b=t.t+w.y;break;case 'sw':this.displacement=this.displacement.add(-p.x,p.y);w=this.$AspectRatioConstraint0(r,this.displacement.x,t.r,s,this.displacement.y,v-t.t);t.l=t.r-w.x;t.b=t.t+w.y;break;}};function o(p,q){var r;switch(q){case h.BOUNDARY:r=new m(p);break;case h.WIDE:case h.SQUARE:r=new n(p).setRatio(h.getAspectRatioForType(q));break;default:throw Error('unsupported PhotocropConstraint type');}return r;}e.exports=o;},null); __d("Photocrop2",["ArbiterMixin","PhotocropConstraintConstants","CSS","DOM","Event","PhotosConst","Rect","Style","Vector","copyProperties","mixin","PhotocropConstraint"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r){var s=q(g);for(var t in s)if(s.hasOwnProperty(t))v[t]=s[t];var u=s===null?null:s.prototype;v.prototype=Object.create(u);v.prototype.constructor=v;v.__superConstructor__=s;function v(w,x,y){"use strict";this.photo=w;var z=this.getPhotoDimensions();if(y){this.imageDimensions=new o(y.x,y.y);}else this.imageDimensions=new o(z.x,z.y);x.height=x.height||l.PIC_NORMAL_FBX_SIZE;x.width=x.width||l.PIC_NORMAL_FBX_SIZE;p(this,{target:this.photo.parentNode,create_target:false,target_parent:this.photo.parentNode,min_width:l.PIC_NORMAL_FBX_SIZE,min_height:l.PIC_NORMAL_FBX_SIZE,center_x:(z.x||x.width)/2,center_y:(z.y||x.height)/2,constraint_type:h.BOUNDARY},x);this._unscaledMinHeight=this.min_height;this._unscaledMinWidth=this.min_width;this._unscaledHeight=this.height;this._unscaledWidth=this.width;this.setInitialDimensionsAndPos();if(this.create_target){this.target=j.create('div');i.addClass(this.target,'stageCropper');this.target_parent.appendChild(this.target);}i.addClass(this.target,'photocrop');['bg','wrapper','viewport'].forEach(function(aa){this[aa]=j.create('div');i.addClass(this[aa],aa);}.bind(this));this.highlight=j.create('img');i.addClass(this.highlight,'highlight');this.setHighlightSource();i.addClass(this.wrapper,'photocropWrapper');this.target.appendChild(this.bg);this.target.appendChild(this.wrapper);this.wrapper.appendChild(this.highlight);this.wrapper.appendChild(this.viewport);['ne','nw','sw','se'].forEach(function(aa){var ba=j.create('div');i.addClass(ba,aa);ba.setAttribute('data-cropcorner',aa);this.viewport.appendChild(ba);i.addClass(ba,'profilePicViewportGrabby');}.bind(this));k.listen(this.viewport,{mousedown:this.mousedown.bind(this),dragstart:k.kill,selectstart:k.kill,click:k.stop});k.listen(document,{mousemove:this.mousemove.bind(this),mouseup:this.mouseup.bind(this)});k.listen(window,{resize:this.adjustForResize.bind(this)});this.realignToPictureSize();this.redraw();}v.prototype.setInitialDimensionsAndPos=function(){"use strict";this._constraint=r(this,this.constraint_type);var w=h.getAspectRatioForType(this.constraint_type),x=this.getPhotoDimensions();if(w){this._unscaledMinHeight=this._unscaledMinWidth/w;this._unscaledHeight=this._unscaledWidth/w;}this.setNewRatio();var y=Math.min(this.width,x.x),z=Math.min(this.height,x.y);this.min_width=Math.min(this.min_width,x.x);this.min_height=Math.min(this.min_height,x.y);if(w)if(x.x/x.y>w){z=Math.min(z,x.y);y=z*w;this.min_width=this.min_height*w;}else{y=Math.min(y,x.x);z=y/w;this.min_height=this.min_width/w;}var aa=this.center_x-y/2,ba=this.center_y-z/2;this.box=new m(ba,aa+y,ba+z,aa);};v.prototype.getPhotoDimensions=function(){"use strict";return new o(Math.round(parseFloat(n.get(this.photo,'width'))),Math.round(parseFloat(n.get(this.photo,'height'))));};v.prototype.getPhotoPosition=function(){"use strict";return new o(this.photo.offsetLeft,this.photo.offsetTop);};v.prototype.setHighlightSource=function(){"use strict";this.highlight.src=this.photo.src;};v.prototype.setConstraintType=function(w){"use strict";this.constraint_type=w;this.setInitialDimensionsAndPos();this.adjustForResize();};v.prototype.adjustForResize=function(){"use strict";var w=this.ratio,x=this.setNewRatio(),y=x/w;this.box.t*=y;this.box.l*=y;this.box.b*=y;this.box.r*=y;this.redraw();this.realignToPictureSize();};v.prototype.setNewRatio=function(){"use strict";this.ratio=this.getPhotoDimensions().x/this.imageDimensions.x;this.min_width=this.ratio*this._unscaledMinWidth;this.min_height=this.ratio*this._unscaledMinHeight;this.width=Math.max(1,this.ratio)*this._unscaledWidth;this.height=Math.max(1,this.ratio)*this._unscaledHeight;return this.ratio;};v.prototype.realignToPictureSize=function(){"use strict";var w=this.photo;if(!w)return;var x=this.getPhotoDimensions(),y=this.getPhotoPosition();[this.bg,this.wrapper].forEach(function(z){z.style.width=x.x+'px';z.style.height=x.y+'px';z.style.top=y.y+'px';z.style.left=y.x+'px';});};v.prototype.redraw=function(){"use strict";var w=[this.box.t,this.box.r,this.box.b,this.box.l],x=this.getPhotoDimensions();this.highlight.style.width=x.x+"px";this.highlight.style.height=x.y+"px";this.highlight.style.clip="rect("+w.join("px ")+"px)";this.viewport.style.top=this.box.t+"px";this.viewport.style.left=this.box.l+"px";this.viewport.style.height=(this.box.b-this.box.t)+"px";this.viewport.style.width=(this.box.r-this.box.l)+"px";};v.prototype.done=function(w){"use strict";this.freezeViewport=true;if(!w){[this.bg,this.wrapper].forEach(j.remove);if(this.create_target){j.remove(this.target);this.target=null;}else i.removeClass(this.target,'photocrop');}var x=Math.round(this.box.l*(1/this.ratio)),y=Math.round(this.box.t*(1/this.ratio)),z=Math.round(this.box.r*(1/this.ratio)),aa=Math.round(this.box.b*(1/this.ratio));this.inform('done',w);return {x:Math.max(x,0),y:Math.max(y,0),width:z-Math.max(x,0),height:aa-Math.max(y,0)};};v.prototype.reset=function(){"use strict";this.freezeViewport=false;};v.prototype.mousedown=function(w){"use strict";if(this.freezeViewport)return;this.mouseTarget=w.getTarget();this._constraint.onMouseDown(o.getEventPosition(w));i.addClass(document.body,'draggingMode');return false;};v.prototype.mousemove=function(w){"use strict";if(!this.mouseTarget)return;this._constraint.onMouseMove(o.getEventPosition(w),this.mouseTarget!==this.viewport,this.mouseTarget.getAttribute('data-cropcorner'));this.redraw();return false;};v.prototype.mouseup=function(w){"use strict";this.mouseTarget=null;i.removeClass(document.body,'draggingMode');};e.exports=v;},null); __d("ZoomCropDimensions",["BasicVector"],function(a,b,c,d,e,f,g){var h=320,i=.5,j=.5,k=180,l=3;function m(o,p){return Number(o.toFixed(p||l));}n.prototype.clone=function(){"use strict";return new n(this.$ZoomCropDimensions0).setSize(this.$ZoomCropDimensions1.x,this.$ZoomCropDimensions1.y).setSmallestSize(this.$ZoomCropDimensions2.x,this.$ZoomCropDimensions2.y).setCenter(this.$ZoomCropDimensions3.x,this.$ZoomCropDimensions3.y).setZoom(this.$ZoomCropDimensions4);};function n(o){"use strict";this.$ZoomCropDimensions0=o;this.setSmallestSize(k,k).setCenter(i,i);this.setSize(h,h).setZoom(j);}n.prototype.getArea=function(){"use strict";var o=this.getPosition(),p=this.$ZoomCropDimensions1.div(this.$ZoomCropDimensions4);return {height:Math.round(p.y),width:Math.round(p.x),x:Math.round(Math.abs(o.left)/this.$ZoomCropDimensions4),y:Math.round(Math.abs(o.top)/this.$ZoomCropDimensions4)};};n.prototype.getPosition=function(){"use strict";var o=this.$ZoomCropDimensions5();return {height:m(o.imageSize.y),left:m(this.$ZoomCropDimensions1.x/2-o.center.x),top:m(this.$ZoomCropDimensions1.y/2-o.center.y),width:m(o.imageSize.x)};};n.prototype.getRect=function(){"use strict";var o=this.$ZoomCropDimensions5(),p=this.$ZoomCropDimensions1.div(this.$ZoomCropDimensions4);return {center:{x:o.center.x/o.imageSize.x,y:o.center.y/o.imageSize.y},size:{x:p.x,y:p.y}};};n.prototype.getSize=function(){"use strict";return this.$ZoomCropDimensions1;};n.prototype.getZoom=function(){"use strict";return this.$ZoomCropDimensions4;};n.prototype.getZoomRange=function(){"use strict";var o=Math.min(this.$ZoomCropDimensions0.x,this.$ZoomCropDimensions0.y);return {max:this.$ZoomCropDimensions1.x/Math.min(this.$ZoomCropDimensions2.x,o),min:this.$ZoomCropDimensions1.x/o};};n.prototype.moveByPixels=function(o,p){"use strict";var q=this.$ZoomCropDimensions5();return this.moveBy(o/q.imageSize.x,p/q.imageSize.y);};n.prototype.moveBy=function(o,p){"use strict";return this.setCenter(this.$ZoomCropDimensions3.x+o,this.$ZoomCropDimensions3.y+p);};n.prototype.setCenter=function(o,p){"use strict";this.$ZoomCropDimensions3=new g(Math.min(Math.max(o,0),1),Math.min(Math.max(p,0),1));return this;};n.prototype.setSize=function(o,p){"use strict";this.$ZoomCropDimensions1=new g(o,p);return this;};n.prototype.setSmallestSize=function(o,p){"use strict";this.$ZoomCropDimensions2=new g(o,p);return this;};n.prototype.setZoom=function(o){"use strict";var p=this.getZoomRange();this.$ZoomCropDimensions4=Math.max(Math.min(o,p.max),p.min);return this;};n.prototype.$ZoomCropDimensions6=function(o,p){"use strict";var q=this.$ZoomCropDimensions1.x/2,r=this.$ZoomCropDimensions1.y/2;return new g(Math.max(Math.min(p.x,o.x-q),q),Math.max(Math.min(p.y,o.y-r),r));};n.prototype.$ZoomCropDimensions5=function(){"use strict";var o=this.$ZoomCropDimensions0.mul(this.$ZoomCropDimensions4);return {imageSize:o,center:this.$ZoomCropDimensions6(o,this.$ZoomCropDimensions3.mul(o.x,o.y))};};e.exports=n;},null); __d("ZoomCropImagePreview.react",["React","cx"],function(a,b,c,d,e,f,g,h){var i=g.createClass({displayName:'ZoomCropImagePreview',propTypes:{dimensions:g.PropTypes.object,size:g.PropTypes.object,src:g.PropTypes.string},render:function(){var j=this.props.dimensions,k=this.props.size,l=j.getSize().x/k.x;if(l!==1)j=j.clone().setSize(k.x,k.y).setZoom(j.getZoom()/l);return this.transferPropsTo(g.DOM.div({className:"_1k3v",style:{height:k.y,width:k.x}},g.DOM.img({className:"_1k3w",src:this.props.src,style:j.getPosition()})));}});e.exports=i;},null); __d("ZoomCropImage.react",["Event","React","UserAgent","Vector","Image.react","ZoomCropImagePreview.react","cx","ix","fbt"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){var p=h.createClass({displayName:'ZoomCropImage',propTypes:{dimensions:h.PropTypes.object,src:h.PropTypes.string},getInitialState:function(){return {moved:false};},componentDidMount:function(){var q=i.ie()<9?document.documentElement:window;this._listeners=g.listen(q,{mousemove:this._handleMouseMove.bind(this),mouseup:this._handleMouseUp.bind(this)});},componentWillUnmount:function(){for(var q in this._listeners){this._listeners[q]&&this._listeners[q].remove();this._listeners[q]=null;}},render:function(){var q=this.props.dimensions,r=q.getSize();return this.transferPropsTo(h.DOM.div({className:"_4on5",style:{height:r.y,width:r.x}},l({dimensions:q,size:r,src:this.props.src}),h.DOM.div({className:(("_3dfy")+(this.state.moved?' '+"_3dfz":''))},h.DOM.span({className:"_3df-"},k({className:"_3-8_ _3df_",src:n('/images/ads/cropper/drag.png')}),"Drag to reposition photo")),h.DOM.img({className:"_4on7",onDragStart:g.prevent,onMouseDown:this._handleMouseDown,src:this.props.src,style:q.getPosition()})));},_handleMouseDown:function(q){if(this._position)return;q.preventDefault();this._position=j.getEventPosition(q);},_handleMouseMove:function(q){if(!this._position)return;var r=j.getEventPosition(q),s=this._position.sub(r);this.props.onMove(s.x,s.y);this.setState({moved:true});this._position=r;},_handleMouseUp:function(){this._position=null;}});e.exports=p;},null); __d("ZoomCropSlider.react",["React","AbstractRangeInput.react","cx"],function(a,b,c,d,e,f,g,h,i){var j=g.createClass({displayName:'ZoomCropSlider',propTypes:{onZoom:g.PropTypes.func,zoom:g.PropTypes.number,zoomRange:g.PropTypes.object},render:function(){return this.transferPropsTo(g.DOM.div({className:"_55vh"},g.DOM.div({className:"_55vi"},"−"),h({className:"_55vj",disabled:this.props.zoomRange.max===this.props.zoomRange.min,max:this.props.zoomRange.max,min:this.props.zoomRange.min,onChange:this.props.onZoom,values:[this.props.zoom]}),g.DOM.div({className:"_55vk"},"+")));}});e.exports=j;},null); __d("ZoomCrop.react",["React","ZoomCropDimensions","Image.react","ZoomCropImage.react","ZoomCropImagePreview.react","ZoomCropSlider.react","cx","ix"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){var o=g.createClass({displayName:'ZoomCrop',propTypes:{center:g.PropTypes.object,cropSizeRatio:g.PropTypes.object,imageSize:g.PropTypes.object,previewSize:g.PropTypes.number,src:g.PropTypes.string,warningText:g.PropTypes.string},getDefaultProps:function(){return {previewSize:32};},getInitialState:function(){this._dims=new h(this.props.imageSize);if(this.props.center)this._dims.setCenter(this.props.center.x,this.props.center.y);if(this.props.cropSizeRatio){var p=this.props.cropSizeRatio.x*this.props.imageSize.x;this._dims.setZoom(this._dims.getSize().x/p);}return this._getDimensionsState();},render:function(){var p;if(this.state.zoom>1)p=g.DOM.div({className:"_3p9d"},i({className:"_3-8_ _3p9e",src:n('/images/mobile/glyph/error-solid_white_s.png')}),this.props.warningText);return (g.DOM.div({className:"_4liw"},j({className:"_1szc",dimensions:this._dims,onMove:this._handleMove,src:this.props.src}),k({className:"_1szd",dimensions:this._dims,size:{x:this.props.previewSize,y:this.props.previewSize},src:this.props.src}),l({className:"_4lix",onZoom:this._handleZoom,zoom:this.state.zoom,zoomRange:this._dims.getZoomRange()}),p));},getDimensions:function(){return this._dims;},_handleZoom:function(p){this._dims.setZoom(p[0]);this.setState(this._getDimensionsState());},_handleMove:function(p,q){this._dims.moveByPixels(p,q);this.setState(this._getDimensionsState());},_getDimensionsState:function(){return {dimensions:this._dims.getPosition(),zoom:this._dims.getZoom()};}});e.exports=o;},null); __d("PhotoPermalinkURI",[],function(a,b,c,d,e,f){var g={isValid:function(h){return g.parse(h)!==null;},parse:function(h){if(this.isValidLegacy(h)){var i=h.getQueryData();if(i.fbid)return {photo_id:i.fbid,set_token:i.set};if(i.id&&i.pid)return {photo_id:i.id+':'+i.pid,set_token:i.set};return null;}var j=h.getPath();if(j[j.length-1]==='/')j=j.substring(0,j.length-1);var k=j.split('/');if(k.length>=3&&k[2]==='photos')if(k.length===4&&/^\d+$/.exec(k[3])!==null){return {photo_id:k[3],set_token:null};}else if(k.length===5&&/^\d+$/.exec(k[4])!==null)return {photo_id:k[4],set_token:k[3]};return null;},isValidLegacy:function(h){var i=h.getPath();if(i[i.length-1]==='/')i=i.substring(0,i.length-1);if(i==='/photo.php'||i==='/force_photo/photo.php'||i==='/photo'||i==='/force_photo/photo/index.php'||i==='/photo/index.php'||i==='/force_photo/photo')return true;return false;}};e.exports=g;},null); __d("PhotoSnowliftAds",["Arbiter","Event","copyProperties","CSS","csx","DataStore","DOM","PhotoSessionLog","UIPagelet","URI","Vector","extendArray"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r){var s={REFRESH_RATE:30000,UNITS_REGISTER_DELAY:1000,root:null,availableDimensions:null,loadQuery:null,lastLoadTime:0,minAds:100,units:null,isLogAdData:null,displayedCallback:null,position:null,adsStatus:'null',adsEvents:{},resetEvents:function(){this.adsStatus='reset';this.adsEvents={};},addEvent:function(t,u){if(u)this.adsStatus=t;var v=Date.now();this.adsEvents[t+'_'+v]=v;},init:function(t,u,v,w){this.reset();this.root=t;this.snowlift=u;this.minAds=v.min_ads;this.displayedCallback=w;this.addEvent('init',true);},reset:function(){this.lastLoadTime=0;this.position=0;this.units=[];this.resetEvents();this.addEvent('reset',true);},resize:function(t){this.availableDimensions=t;this.loadQuery=this.snowlift.getLoadQuery();this.processResize();},calculateUnitSizes:function(t,u,v){var w={};t.forEach(function(x){var y=x.root.firstChild.offsetHeight;x.units.forEach(function(aa){if(!j.hasClass(aa,'hidden')&&!this.getIsHoldout(aa)&&!this.getIsShadow(aa)){var ba=this.getHeight(aa.firstChild,u);y-=ba;}}.bind(this));var z={height:y,visible:false};x.units.forEach(function(aa){var ba=this.getIsAds(aa),ca=this.getHeight(aa.firstChild,u),da=this.getUnitId(aa),ea=this.getIsHoldout(aa);if(ea&&v)return;w[da]={height:ca,visible:false,priority:0,is_ads:ba,is_holdout:ea,section_ref:z};}.bind(this));}.bind(this));return w;},calculateVisibleUnits:function(t,u,v){var w=0,x=this.getUnitPriority(u);x.forEach(function(y){if(u.hasOwnProperty(y)){var z=u[y],aa=z.height;if(!z.section_ref.visible)aa+=z.section_ref.height;z.height_below=v-aa;z.visible=z.height_below>=0&&aa>0;if(z.visible){z.section_ref.visible=true;v-=aa;w++;}}}.bind(this));return u;},displayUnits:function(t,u){t.forEach(function(v){var w=false,x=true;v.units.forEach(function(y){var z=this.getUnitId(y),aa=u[z];if(!aa)return;var ba=aa.visible,ca=aa.height_below,da=aa.is_ads;j.conditionClass(y,'hidden',!ba);if(da&&ba&&x){var ea=m.find(y,'div.ego_unit');j.addClass(ea,'ego_unit_no_top_border');x=false;}w=w||ba;this.calcUnitStats(this.units[da][z],ba,ca);}.bind(this));j.conditionClass(v.root,'hidden',!w);}.bind(this));g.inform('PhotoSnowliftAds/displayUnits');},getUnitsDisplayed:function(t,u){var v=0;t.forEach(function(w){w.units.forEach(function(x){var y=this.getUnitId(x),z=u[y];if(!z||!z.visible)return;v++;}.bind(this));}.bind(this));return v;},getHeightsRequired:function(t,u){var v=0,w=[];t.forEach(function(x){var y=false;x.units.forEach(function(z){var aa=this.getUnitId(z),ba=u[aa];if(!ba)return;v+=ba.height;if(!y){v+=ba.section_ref.height;y=true;}w.push(v);}.bind(this));}.bind(this));return w;},getUnitPriority:function(t){var u=[],v=0,w=0;for(var x in t){var y=t[x];u.push(x);var z=this.minAds+v+w;if(y.is_ads){if(w=this.UNITS_REGISTER_DELAY){var x=t.trackingCode;t.trackingCode=null;this.registerImpression(x,t.registerUrl);}t.visible=u;t.heightBelow=v;t.lastShowTime=w;},prepareResize:function(){var t=function(u){var v=m.create('div',{className:'inner'}),w=m.create('div',{className:'wrapper'},v);m.replace(u,w);m.setContent(v,u);return w;};this.sections=m.scry(this.root,'div.ego_section').map(function(u){return {root:t(u),units:m.scry(u,'div.ego_unit').map(t)};});},processResize:function(){if(this.isLoading||this.lastLoadTime===0||this.availableDimensions===null){this.setLogData();return;}this.updateUnitsStatus();this.setLogData();var t=this.nextRegisterTime();if(t!==Infinity)setTimeout(this.processResize.bind(this),t);},setIsLogAdData:function(t){this.isLogAdData=t;this.addEvent('setIsLogAdData',false);this.setLogData();},setLogData:function(){var t=this.snowlift.getImageId();if(this.isLogAdData&&t){var u=q.getElementDimensions(this.snowlift.getImage()),v=q.getElementDimensions(this.snowlift.getRHCHeader()),w=q.getElementDimensions(this.snowlift.getRHCBody()),x=q.getElementDimensions(this.snowlift.getRHCFooter()),y={query_set:this.snowlift.getLoadQuery().set,window_x:window.innerWidth,window_y:window.innerHeight,image_x:u.x,image_y:u.y,header_x:v.x,header_y:v.y,body_x:w.x,body_y:w.y,footer_x:x.x,footer_y:x.y,ads_below_space:this.getAdsBelowSpace(),time:Date.now(),adsStatus:this.adsStatus,adsEvents:this.adsEvents,refreshRate:this.refreshUnitsRate,position:this.position};n.updateAdData(t,y);}},getAdsBelowSpace:function(){var t=[],u=this.units[1];for(var v in u)if(u.hasOwnProperty(v)&&!this.getIsHoldout(this.getAdUnit(v)))t.push(u[v].heightBelow);return t;},getIsAds:function(t){var u=m.scry(t,"div._4u8");return u.length;},getUnitId:function(t){if(this.getIsAds(t)){return this.getAdId(t);}else return this.getEgoId(t);},getEgoId:function(t){var u=m.find(t,'div.ego_unit');return u.getAttribute('data-ego-fbid');},getAdData:function(t){var u=m.find(t,"div._4u8"),v=u.getAttribute('data-ad');return v&&JSON.parse(v)||{};},getAdId:function(t){return this.getAdData(t).adid;},getIsHoldout:function(t){return t&&this.getIsAds(t)&&this.getAdData(t).holdout;},getIsShadow:function(t){return t&&this.getIsAds(t)&&this.getAdData(t).shadow;},getAdUnit:function(t){if(!this.sections)return null;var u=[];this.sections.forEach(function(w){r(u,w.units);});for(var v=0;vs.REFRESH_RATE){j.addClass(this.root,'loading');this.isLoading=true;this.loadAdsAndEgo();}},registerImpression:function(t,u){var v=m.create('iframe',{src:p(u).addQueryData({aed:t}),width:0,height:0,frameborder:0,scrolling:'no',className:'fbEmuTracking'});v.setAttribute('aria-hidden','true');m.appendContent(this.root,v);},waitForImages:function(t){var u=m.scry(this.root,'img.img'),v=u.length,w=v;if(w===0)t();var x=function(){w--;if(w===0)setTimeout(t,0);};for(var y=0;y0){q=this.state.pivots.map(function(s){return (o({normalized:s.normalized,title:s.title,uri:s.uri,images:s.images}));});}else q=j.DOM.div({className:"_27i"},"Unfortunately, there doesn't seem to be any other relevant photos available.");var r=this.props.endofalbum?j.DOM.span({className:"_2pij"},"End of album"):null;return (j.DOM.div({className:(("_27g")+(this.state.action==='hide'?' '+"_27j":'')+(this.state.action==='show'?' '+"_27k":''))},j.DOM.div({className:"_27l"},g({className:"_27m _2pi3 _2pib"},j.DOM.span(null,r,j.DOM.span({className:"_4ptz"},"Other photos you may like")),j.DOM.a({href:"#",onClick:this.onExitClicked,className:"_27n"})),j.DOM.div({className:"_27o _2pi8 clearfix"},q))));}});e.exports=p;},null); __d("VideoPlayerStateManager",["Banzai","DOMDimensions","Flash","Run","ScriptPath","VideoPlayerApiFactory","VideoPlayerLogger","VideoPlayerLoggerEvents","VideoPlayerVersions","clickRefAction","collectDataAttributes","copyProperties","getElementPosition","VideoPlayerReason"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t){var u='buffered',v='buffering',w='finished',x='loading',y='paused',z='playing',aa='ready',ba='unloaded',ca='autoplay',da='none',ea='play';function fa(ga,ha){"use strict";this.$VideoPlayerStateManager0=ha;this.$VideoPlayerStateManager1=ga;this.$VideoPlayerStateManager2=new m(this.$VideoPlayerStateManager0.source);this.$VideoPlayerStateManager3=this.isAutoplayable()?ca:da;this.$VideoPlayerStateManager4=null;this.$VideoPlayerStateManager5=null;this.$VideoPlayerStateManager6=null;this.$VideoPlayerStateManager7=k.getScriptPath();this.$VideoPlayerStateManager2.setFTData(q(this.$VideoPlayerStateManager1,['ft']));this.$VideoPlayerStateManager2.setScriptPath(this.$VideoPlayerStateManager7);g.subscribe(g.SHUTDOWN,function(){if(this.$VideoPlayerStateManager5!==null&&this.$VideoPlayerStateManager6!==null){var ja={reason:'unloaded',video_time_position:this.$VideoPlayerStateManager5,video_last_start_time_position:this.$VideoPlayerStateManager6};if(this.$VideoPlayerStateManager8)ja.original_play_reason=this.$VideoPlayerStateManager8;this.$VideoPlayerStateManager9(n.PAUSED,ja);}}.bind(this));this.$VideoPlayerStateManagera(x);if(this.$VideoPlayerStateManager0.player_version!==o.HTML5&&!i.isAvailable()){var ia={error:m.Errors.ERROR_CALLING_FLASH,state:m.ErrorStates.PLAYER_FAILURE};this.$VideoPlayerStateManager9(n.ERROR,ia);return;}if(this.$VideoPlayerStateManager0.player_version===o.HTML5)this.$VideoPlayerStateManagerb();j.onLeave(function(){this.$VideoPlayerStateManagera(ba);}.bind(this));}fa.prototype.getDOMPosition=function(){"use strict";var ga=this.$VideoPlayerStateManager1.parentNode;return s(ga);};fa.prototype.isAutoplayable=function(){"use strict";return this.$VideoPlayerStateManager0.should_autoplay;};fa.prototype.handleFlashEvent=function(ga,ha){"use strict";if(this.$VideoPlayerStateManagerc===ba)return;switch(ga){case 'flash/buffered':this.$VideoPlayerStateManagerd();break;case 'flash/buffering':this.$VideoPlayerStateManagere();break;case 'flash/beginPlayback':this.$VideoPlayerStateManagerf(ha.position);break;case 'flash/clickForTracking':this.$VideoPlayerStateManagerg();break;case 'flash/expandVideo':this.$VideoPlayerStateManagerh();break;case 'flash/finishPlayback':this.$VideoPlayerStateManageri();break;case 'flash/logEvent':this.$VideoPlayerStateManagerj(ha.logData);break;case 'flash/pausePlayback':this.$VideoPlayerStateManagerk();break;case 'flash/ready':this.$VideoPlayerStateManagerb();break;case 'flash/updateStatus':this.$VideoPlayerStateManagerl(ha.position);break;}};fa.prototype.switchVideo=function(ga,ha){"use strict";this.$VideoPlayerStateManager1=ga;this.$VideoPlayerStateManager0.video_id=ha;};fa.prototype.play=function(ga){"use strict";if(!this.$VideoPlayerStateManager8)this.$VideoPlayerStateManager8=ga;var ha={reason:ga,player_state:this.$VideoPlayerStateManagerc,state:this.$VideoPlayerStateManagerc===y?m.PlayerStates.UNPAUSED:m.PlayerStates.STARTED};this.$VideoPlayerStateManager9(n.PLAY_REQUESTED,ha);if(this.$VideoPlayerStateManagerc===x){this.$VideoPlayerStateManager3=ga===t.AUTOPLAY?ca:ea;}else this.$VideoPlayerStateManager4.play(ga);};fa.prototype.$VideoPlayerStateManager9=function(event,ga){"use strict";var ha={ad_client_token:this.$VideoPlayerStateManager0.ad_client_token,autoplay_eligible:this.$VideoPlayerStateManager0.should_autoplay,player_version:this.$VideoPlayerStateManager0.player_version,video_id:this.$VideoPlayerStateManager0.video_id};if(ga)r(ha,ga,this.$VideoPlayerStateManagerm());this.$VideoPlayerStateManager2.logEvent(event,ha);};fa.prototype.$VideoPlayerStateManagerg=function(){"use strict";p('click',this.$VideoPlayerStateManager1,null,'FORCE');};fa.prototype.$VideoPlayerStateManagerd=function(){"use strict";this.$VideoPlayerStateManagera(u);};fa.prototype.$VideoPlayerStateManagere=function(){"use strict";this.$VideoPlayerStateManagera(v);};fa.prototype.$VideoPlayerStateManagerf=function(ga){"use strict";if(ga!==undefined)this.$VideoPlayerStateManager6=ga;this.$VideoPlayerStateManagera(z);};fa.prototype.$VideoPlayerStateManagerh=function(){"use strict";};fa.prototype.$VideoPlayerStateManageri=function(){"use strict";this.$VideoPlayerStateManagera(w);};fa.prototype.$VideoPlayerStateManagerj=function(ga){"use strict";var event=ga.event;delete ga.event;this.$VideoPlayerStateManager9(event,ga);};fa.prototype.$VideoPlayerStateManagerk=function(){"use strict";this.$VideoPlayerStateManagern();this.$VideoPlayerStateManagera(y);};fa.prototype.$VideoPlayerStateManagerb=function(){"use strict";this.$VideoPlayerStateManager4=l.create(this.$VideoPlayerStateManager1,function(ha,ia){var ja={error:m.Errors.ERROR_CALLING_FLASH,error_description:ha.message,state:ia?m.ErrorStates.PLAYBACK_FAILURE:m.ErrorStates.PLAYER_FAILURE};this.$VideoPlayerStateManager9(n.ERROR,ja);}.bind(this));this.$VideoPlayerStateManagera(aa);this.$VideoPlayerStateManagero();this.$VideoPlayerStateManagerp();if(this.$VideoPlayerStateManager3!=da){var ga=this.$VideoPlayerStateManager3===ca?t.AUTOPLAY:t.USER;this.play(ga);}this.$VideoPlayerStateManager9(n.PLAYER_LOADED,{is_auto_played:this.$VideoPlayerStateManager0.should_autoplay});};fa.prototype.$VideoPlayerStateManagerl=function(ga){"use strict";if(ga!==undefined)this.$VideoPlayerStateManager5=ga;};fa.prototype.$VideoPlayerStateManagerm=function(){"use strict";var ga=this.getDOMPosition(),ha=h.getViewportDimensions().height,ia=null;if(ga.y<=0){ia=ga.y;}else if(ga.y+ga.heightthis.currentImageSize.y&&this.currentImageSize.x<=rb.TIMELINE_STRETCH_WIDTH&&vb.offsetWidth===rb.TIMELINE_STRETCH_WIDTH;var yb;if(vb){yb=vb.src;}else if(wb){yb=oa.get(wb,'backgroundImage').replace(/.*url\("?([^"]*)"?\).*/,'$1');}else return;this.thumbSrc=yb;};rb.prototype.loadFrameIfUninitialized=function(){"use strict";if(this.root)return;new i('/ajax/photos/snowlift/init.php').setAllowCrossPageTransition(true).setMethod('GET').setReadOnly(true).send();};rb.prototype.init=function(sb,tb){"use strict";this.init=fb;this._shouldLog=tb.photos_client_loading;this._logger=null;if(this._shouldLog)this._logger=new aa(ca.VIEWER_SNOWLIFT_STRING);this._showHover=tb.pivot_hover;this._showMorePhotos=tb.show_more_photos;this._videoPlayerVersion=tb.video_player_version;this._useVideoPlayerJS=tb.use_video_player_js;da.setEndMetrics(tb.pivot_end_metric);this.startingMousePos=null;this.haveLeftBufferRegion=false;this.showingTypeaheadSuggestions=false;this.fullscreen=p.isSupported();this.showOGVideos=tb.og_videos;this.resizeCommentsForAds=tb.resize_comments_for_ads;this.spotlight=sb;this.spotlight.subscribe('blur',function(){this.closingAction=da.OUTSIDE;}.bind(this));this.spotlight.subscribe('beforehide',this.beforeCloseHandler.bind(this));this.spotlight.subscribe('hide',this.closeHandler.bind(this));this.spotlight.subscribe('key',this.keyHandler.bind(this));this.initializeNodes(this.spotlight.getRoot());ea.init(this.sideAdUnit,this,tb,this.adsDisplayedCallback.bind(this));this.inAdsDisplayedCallback=false;this.lastAdsHeight=0;if(!this.subscription){v.registerHandler(this.handleNavigateAway.bind(this));this.subscription=g.subscribe('PhotoSnowlift.GO',function(ub,vb){this.openExplicitly=true;this.loading&&k.removeClass(this.loading,'loading');this.open(vb);}.bind(this));}this.transitionHandlerRegistered=false;this.returningToStart=false;y.registerHandler(this.openHandler.bind(this));this.openHandlerRegistered=true;g.subscribe('PhotoTagApproval.HILITE_TAG',this.onHiliteTag.bind(this));g.subscribe('PhotoTagApproval.UPDATE_TAG_BOX',this.onUpdateTagBox.bind(this));if(this.fullscreen)p.subscribe('changed',this.onFullScreenChange.bind(this));this.slideshowGk=tb.snowlift_slideshow;this.allowIrrelevantRequests=!!tb.snowlift_allow_irrelevant_requests;if(this.snowflake){k.addClass(this.root,"snowflake");this.extraClasses.forEach(function(ub){k.addClass(this.root,ub);},this);}};rb.prototype.onFullScreenChange=function(){"use strict";var sb=p.isFullScreen();k.conditionClass(document.body,'fbPhotoSnowliftFullScreenMode',sb);if(sb){if(!k.hasClass(this.root,'fbPhotoSnowliftEditMode'))this.collapseRHC();var tb=this.stream.getCurrentImageData();if(tb&&tb.url&&this.image.src!==tb.url&&this.shouldShowHiRes(tb))this.switchImage(tb.url);this.adjustForResize();}else{this.uncollapseRHC();if(ta.chrome()&&!k.hasClass(this.root,'fbPhotoSnowliftEditMode'))this.page(0,false);g.inform('reflow');}pa.hide();if(this.cropper)this.cropper.resetPhoto();};rb.prototype.initializeNodes=function(sb){"use strict";this.root=sb;this.container=m.find(sb,'div.fbPhotoSnowliftContainer');this._updateContainerOwnerID();this.snowliftPopup=m.find(this.container,'div.fbPhotoSnowliftPopup');this.rhc=m.find(this.snowliftPopup,'div.rhc');this.rhcHeader=m.find(this.rhc,'div.rhcHeader');this.rhcFooter=m.find(this.rhc,'div.rhcFooter');this.ufiForm=m.find(this.rhc,'form.fbPhotosSnowliftFeedbackForm');this.ufiInputContainer=m.find(this.rhc,'div.fbPhotosSnowboxFeedbackInput');this.scroller=m.find(this.ufiForm,'div.rhcScroller');this.scrollerBody=m.find(this.scroller,'div.uiScrollableAreaBody');this.stageWrapper=m.find(this.snowliftPopup,'div.stageWrapper');this.overlay=m.find(this.snowliftPopup,'div.snowliftOverlay');this.errorBox=m.find(this.stageWrapper,'div.stageError');this.image=m.find(this.stageWrapper,'img.spotlight');this.stage=m.find(this.stageWrapper,'div.stage');this.videoStage=m.find(this.stageWrapper,'div.videoStage');this.prevPager=m.find(this.snowliftPopup,'a.snowliftPager.prev');this.nextPager=m.find(this.snowliftPopup,'a.snowliftPager.next');this.stageActions=m.find(sb,'div.stageActions');this.buttonActions=m.find(this.stageActions,'div.fbPhotosPhotoButtons');this.placeInfo=m.find(this.rhc,'div.fbPhotosSnowliftPlaceInfo');this.sideAdUnit=m.find(sb,"._5ciw");k.conditionClass(this.root,'fullScreenAvailable',this.fullscreen);};rb.prototype.initializeScroller=function(){"use strict";this.initializeScroller=fb;this.scrollableArea=na.fromNative(this.scroller,{fade:true,persistent:true});var sb=function(event){var tb=o.$E(event).getTarget();if(m.contains(this.ufiInputContainer,tb)){var ub=n.getInstance(tb);if(ub){this.scrollableArea.scrollToBottom();var vb=ub.subscribe('resize',function(){var xb=this.scrollableArea.isScrolledToBottom();this.adjustScroller();xb&&this.scrollableArea.scrollToBottom();}.bind(this)),wb=o.listen(tb,'blur',function(){ub.unsubscribe(vb);wb.remove();});}}}.bind(this);g.subscribe('ufi/changed',function(tb,ub){if(this.ufiForm===ub.form)this.adjustScrollerIfNecessary();}.bind(this));g.subscribe('ufi/comment',function(tb,ub){if(this.ufiForm===ub.form){this.adjustScrollerIfNecessary();if(ub.isranked){this.scrollableArea.scrollToTop();}else this.scrollableArea.scrollToBottom();}}.bind(this));o.listen(this.rhc,'click',function(event){var tb=event.getTarget();if(z.byTag(tb,'a')||z.byTag(tb,'button')||m.isNodeOfType(tb,'input'))this.adjustScrollerIfNecessary();}.bind(this));g.subscribe(['reflow','CommentUFI.Pager'],function(){if(this.isOpen)this.adjustScrollerIfNecessary();}.bind(this));o.listen(this.ufiForm,'focusin',sb);};rb.prototype.openHandler=function(sb){"use strict";if(this.isOpen||!ba.isValid(sb)||this.returningToStart||sb.getQueryData().closeTheater||sb.getQueryData().permPage||sb.getQueryData().makeprofile){this.openHandlerRegistered=false;return false;}this.open(sb);this._uriStack.push(sa(sb).getQualifiedURI().toString());y.transitionComplete(true);return true;};rb.prototype.getImageSrc=function(sb){"use strict";if(sb.smallsrc){if(!sb.size)return sb.smallsrc;var tb=ua.deserialize(sb.size),ub=this.getStageSize(tb);ub=this._adjustStageSizeForPixelRatio(ub);if(ub.x<=rb.STAGE_NORMAL_MAX.x&&ub.y<=rb.STAGE_NORMAL_MAX.y)return sb.smallsrc;}return sb.src;};rb.prototype.open=function(sb){"use strict";var tb=sa(sb),ub=tb.getQueryData(),vb=ba.parse(tb);if(vb!==null){ub.fbid=vb.photo_id;ub.set=vb.set_token;}var wb=this.getImageSrc(ub);if(wb){delete ub.src;delete ub.smallsrc;}if(this.resetUriStack)this._uriStack=[];if(!this.initialLoad){ub.firstLoad=true;this.initialLoad=true;w.registerBlocker(function(){return this.isOpen;}.bind(this));}this.sessionID=Date.now();this.loadQuery=bb(ub,{ssid:this.sessionID});if(this._dataFt)this.loadQuery.data_ft=this._dataFt;this.isOpen=true;this.pagersShown=false;this.refreshOnClose=false;this.hilitedTag=null;this.loadingStates={image:false,html:false};this.replaceUrl=false;this.movementDelta=0;this.source=null;this.saveTagSubscription=g.subscribe('PhotoTagger.SAVE_TAG',this.onTagSaved.bind(this));this.taggedPhotoIds=[];this.stream=new fa();this.stream.init(ca.VIEWER_SNOWLIFT,'PhotoViewerPagelet','pagelet_photo_viewer',this._shouldLog?this._logger:null);if(!!sa.getMostRecentURI().getQueryData().viewas)this.stream.setViewAs(sa.getMostRecentURI().getQueryData().viewas+'');this.fetchInitialData();this.setLoadingState(rb.STATE_HTML,true);this.rhcCollapsed=false;this._open(sb,wb);j.loadModules(["SnowliftPicCropper"],function(xb){this.cropper=xb.getInstance(this);this.cropper.init();if(this.enableCropperOnInit){var yb=g.subscribe('PhotoSnowlift.SWITCH_IMAGE',function(){this.cropper.enableCropping();g.unsubscribe(yb);}.bind(this));this.enableCropperOnInit=false;}}.bind(this));j.loadModules(["PhotosButtonTooltips"],function(xb){xb.init();});};rb.prototype._open=function(sb,tb){"use strict";this.createLoader(tb);this.spotlight.show();this.ua&&this.ua.add_event('frame');g.inform('layer_shown',{type:'PhotoSnowlift'});g.inform('PhotoSnowlift.OPEN');this.stageHandlers=[o.listen(window,'resize',this.adjustForResize.bind(this)),o.listen(this.stageWrapper,'click',this.buttonListener.bind(this)),o.listen(this.stageWrapper,'mouseleave',function(event){var wb=event.getTarget();if(!(z.byClass(wb,'snowliftOverlay')||z.byClass(wb,'fbPhotoSnowliftTagApproval')||z.byClass(wb,'tagPointer')||z.byClass(wb,'arrow')||z.byClass(wb,'faceboxSuggestion')||z.byClass(wb,'typeaheadWrapper')||z.byClass(wb,'photoTagTypeahead')||z.byClass(wb,'fbPhotoTagger')))this.unhiliteAllTags();this.hidePagers();}.bind(this)),o.listen(this.stageWrapper,'mousemove',this.hilitePager.bind(this)),o.listen(this.stageWrapper,'mousemove',this.hiliteTagsOnMouseMove.bind(this)),o.listen(this.overlay,'mouseenter',this.unhiliteAllTags.bind(this)),o.listen(this.container,'mousemove',this._enableMouseOver.bind(this)),o.listen(this.container,'mouseover',this._interceptMouseOver.bind(this)),o.listen(this.stageWrapper,'focusin',this.hilitePager.bind(this)),o.listen(this.rhc,'focusin',this.hidePagers.bind(this))];this.stageHandlers.push(o.listen(this.container,'click',function(event){var wb=event.getTarget();if(z.byClass(wb,'rotateRight')){this.rotate('right');}else if(z.byClass(wb,'rotateLeft')){this.rotate('left');}else if(z.byClass(wb,'closeTheater')){if(p.isFullScreen()){p.toggleFullScreen();return;}this.closingAction=da.X;this.spotlight.hide();return false;}else if(this.fullscreen)if(z.byClass(wb,'fbPhotoSnowliftFullScreen')){this.toggleFullScreen();}else if(z.byClass(wb,'fbPhotoSnowliftCollapse'))this.toggleCollapse();}.bind(this)));var ub=gb('fbPhotoSnowliftFeedback');if(ub)this.stageHandlers.push(o.listen(ub,'click',function(event){var wb=event.getTarget();if(z.byClass(wb,'like_link')||(z.byClass(wb,'UFILikeLink')&&z.byClass(wb,'UIActionLinks')))this.toggleLikeButton();var xb=z.byClass(event.getTarget(),'uiUfiCollapsedComment');if(xb)k.addClass(xb,'uiUfiCollapsedCommentToggle');}.bind(this)));var vb=gb('fbPhotoSnowliftOnProfile');if(vb)this.stageHandlers.push(o.listen(vb,'click',function(event){if(z.byClass(event.getTarget(),'fbPhotoRemoveFromProfileLink'))this.refreshOnClose=true;}.bind(this)));if(this.resetUriStack)this.startingURI=sa.getMostRecentURI().addQueryData({closeTheater:1}).getUnqualifiedURI();if(!tb)this.setLoadingState(rb.STATE_IMAGE_DATA,true);if(!this.transitionHandlerRegistered){y.registerHandler(this.transitionHandler.bind(this));this.transitionHandlerRegistered=true;}da.initLogging(da.SNOWLIFT);if(this.pivots)da.setRelevantCount(this.pivots.relevantCount);};rb.prototype.toggleFullScreen=function(){"use strict";var sb=p.toggleFullScreen(document.documentElement);if(sb){var tb=this.stream.getCurrentImageData();if(tb&&tb.url&&this.image.src!==tb.url&&this.shouldShowHiRes(tb))if(!this._log(tb.url))(new Image()).src=tb.url;da.logEnterFullScreen(this.stream.getCursor());}};rb.prototype.getStream=function(){"use strict";return this.stream;};rb.prototype.fetchInitialData=function(){"use strict";this.ua&&this.ua.add_event('init_data');this.stream.waitForInitData();ra.loadFromEndpoint('PhotoViewerInitPagelet',gb('pagelet_photo_viewer_init',this.root),this.loadQuery,{actorID:qa.getActorIDForFeedbackTargetIfExists(this.loadQuery.fbid),usePipe:true,jsNonblock:true,crossPage:true,allowIrrelevantRequests:this.allowIrrelevantRequests});};rb.prototype.toggleCollapse=function(){"use strict";if(this.rhcCollapsed){this.uncollapseRHC();}else this.collapseRHC();};rb.prototype.collapseRHC=function(){"use strict";this.rhcCollapsed=true;k.addClass(this.root,'collapseRHC');this.adjustForResize();};rb.prototype.uncollapseRHC=function(){"use strict";this.rhcCollapsed=false;k.removeClass(this.root,'collapseRHC');this.adjustForResize();};rb.prototype.beforeCloseHandler=function(){"use strict";if(this.isOpen&&this.cropper&&this.cropper.croppingMode){this.warnLeavePage(this.closeHandler.bind(this));return false;}};rb.prototype.closeHandler=function(){"use strict";if(!this.isOpen)return;this.closingAction=this.closingAction||da.ESC;if(sa.getMostRecentURI().addQueryData({closeTheater:1}).getUnqualifiedURI().toString()==this.startingURI.toString()){this.close();return;}this.returnToStartingURI(this.refreshOnClose);this.close();};rb.prototype.returnToStartingURI=function(sb,tb){"use strict";if(!sb)if(tb){this.squashNextTransition(ib.bind(null,tb));}else this.squashNextTransition();this.returningToStart=true;var ub=g.subscribe('page_transition',(function(){this.returningToStart=false;ub.unsubscribe();}).bind(this)),vb=sb||isNaN(ta.opera()),wb=this._uriStack.length;if(vb&&wb0){var sb=null;if(this.source===rb.COLLECTIONS_UNTAGGED_PHOTOS){sb='/ajax/photos/photo/edit/skiptag/';}else if(this.source===rb.PHOTOS_OF_YOU_SUGGESTIONS||this.source===rb.FRIENDS_IN_PHOTOS_SUGGESTIONS)sb='/ajax/photos/photo/add_to_star_grid/';if(sb)new i().setURI(sb).setAllowCrossPageTransition(true).setData({media_id:this.taggedPhotoIds,source:this.source}).send();}};rb.prototype.onTagSaved=function(sb,tb){"use strict";if(this.taggedPhotoIds){if(this.source===rb.PHOTOS_OF_YOU_SUGGESTIONS&&!tb.self_tag)return;this.taggedPhotoIds.push(tb.photo_fbid);}};rb.prototype.close=function(){"use strict";if(!this.isOpen)return;this.hideMorePhotos();this.isOpen=false;this._navCount=0;if(this.fullscreen)p.disableFullScreen();kb('snowlift').uai('close');this.cropper&&this.cropper.disableCropping();this.spotlight.hide();this.openExplicitly=false;this.postProcessTaggedPhotos();g.unsubscribe(this.saveTagSubscription);this.taggedPhotoIds=[];this.closeDirty=true;setTimeout(this.closeCleanup.bind(this),0);if(this.snowflake){k.removeClass(this.root,"snowflake");this.extraClasses.forEach(function(sb){k.removeClass(this.root,sb);},this);}this.extraClasses=[];this.snowflake=false;this.firstInSet=null;this.movementDelta=0;};rb.prototype.closeCleanup=function(){"use strict";g.unsubscribe(this.videoPlayerToken);this.closeDirty=false;k.removeClass(this.root,'dataLoading');da.logPhotoViews(this.closingAction);this.destroy();k.hide(this.errorBox);k.hide(this.image);this.currentImageSize=null;this.thumbSrc=null;this.shouldStretch=false;this.resetUriStack=true;var sb=this.stream.getCursor();k.removeClass(this.stageWrapper,'showVideo');m.empty(this.videoStage);this.uncollapseRHC();this.currentMinSize=null;this.setStagePagersState('reset');this.recacheData();m.empty(this.sideAdUnit);this.stream.destroy();this.root.setAttribute('aria-busy','true');var tb=this.closingAction===da.NAVIGATE;this.closingAction=null;if(!this.openHandlerRegistered){y.registerHandler(this.openHandler.bind(this));this.openHandlerRegistered=true;}g.inform('layer_hidden',{type:'PhotoSnowlift'});g.inform('PhotoSnowlift.CLOSE',{is_navigating:tb,fbid:sb});};rb.prototype.createLoader=function(sb){"use strict";if(this.currentImageSize===null){this.adjustStageSize(rb.STAGE_MIN);}else{var tb=this.getStageSize(this.currentImageSize);tb=new ua(Math.max(tb.x,rb.STAGE_MIN.x),Math.max(tb.y,rb.STAGE_MIN.y));var ub=this.getImageSizeInStage(this.currentImageSize,tb);if(this.thumbSrc===null){this.adjustStageSize(ub);}else this.useImage(m.create('img',{className:'spotlight',alt:'',src:this.thumbSrc,style:{width:ub.x+'px',height:ub.y+'px'}}),ub,false);}this.setLoadingState(this.STATE_IMAGE_PIXELS,true);if(sb)setTimeout((function(){var vb=new Image(),wb=o.listen(vb,'load',za(function(){if(!this.isOpen)return;if(!this.stream||!this.stream.errorInCurrent()){this.switchImage(sb,this.currentImageSize);this.ua&&this.ua.add_event('image');this.setLoadingState(rb.STATE_IMAGE_DATA,false);}}.bind(this),'photo_theater')),xb=function(){if(wb){wb.remove();wb=null;}};g.subscribeOnce('PhotoSnowlift.SWITCH_IMAGE',xb);g.subscribeOnce('PhotoSnowlift.CLOSE',xb);this._log(sb);vb.src=sb;}).bind(this),0);k.hide(this.stageActions);this.setStagePagersState('disabled');};rb.prototype.initDataFetched=function(sb){"use strict";da.setPhotoSet(this.stream.getPhotoSet());da.setLogFbids(sb.logids);var tb=this.stream.getCurrentImageData();da.addPhotoView(tb.info,this.shouldShowHiRes(tb),this.fullscreen&&p.isFullScreen());var ub=this.stream.getCurrentExtraData();if(this._showHover&&ub)ga.logImageImpression('snowlift',String(this.stream.getCursor()),Object.keys(ub.tagRects));if(ub&&ub.source!==undefined){this.source=parseInt(ub.source,10);da.setSource(this.source);}if(!this.pageHandlers)this.pageHandlers=[o.listen(this.root,'click',this.pageListener.bind(this)),o.listen(this.root,'mouseleave',this.mouseLeaveListener.bind(this))];k.show(this.stageActions);this.root.setAttribute('aria-busy','false');this.isLoggedInViewer=sb.loggedin;this.disableAds=!this.isLoggedInViewer||sb.fromad||this.stream.isInViewAsMode();this.loadAds();};rb.prototype.adjustScrollerIfNecessary=function(){"use strict";clearTimeout(this.scrollerTimeout);this.scrollerTimeout=setTimeout(this.adjustScroller.bind(this),0);};rb.prototype.adjustScroller=function(sb){"use strict";clearTimeout(this.scrollerTimeout);this.initializeScroller();this.scrollableArea.resize();var tb=ua.getElementDimensions(this.rhc),ub=tb.y;ub-=ua.getElementDimensions(this.rhcHeader).y;ub-=ua.getElementDimensions(this.ufiInputContainer).y;if(this.placeInfo){var vb=ua.getElementDimensions(this.placeInfo);ub-=vb.y;oa.set(this.sideAdUnit,'bottom',vb.y+'px');}if(sb==null)sb=this.resizeCommentsForAds?this.lastAdsHeight:0;this.lastAdsHeight=sb;ub=Math.max(0,ub);var wb=ua.getElementDimensions(this.scrollerBody).y,xb=Math.max(rb.MIN_UFI_HEIGHT,ub-sb);if(wb>=xb){if(ub>xb){k.removeClass(this.rhc,'pinnedUfi');ub-=xb;}else{k.addClass(this.rhc,'pinnedUfi');ub=0;}oa.set(this.scroller,'height',xb+'px');}else{oa.set(this.scroller,'height','auto');k.removeClass(this.rhc,'pinnedUfi');ub-=wb;}var yb=ua.getElementDimensions(this.ufiInputContainer).y;oa.set(this.ufiForm,'padding-bottom',yb+'px');ea.resize(new ua(tb.x,ub));this.scrollableArea.adjustGripper();};rb.prototype.adjustForResize=function(){"use strict";this.currentMinSize=null;this.adjustStageSize();this.adjustForNewData();};rb.prototype.shouldShowHiRes=function(sb){"use strict";if(!sb||!sb.smallurl)return false;var tb=this.getStageSize(sb.dimensions);tb=this._adjustStageSizeForPixelRatio(tb);var ub=this.getImageSizeInStage(sb.dimensions,tb);return (ub.x>rb.STAGE_NORMAL_MAX.x||ub.y>rb.STAGE_NORMAL_MAX.y);};rb.prototype._adjustStageSizeForPixelRatio=function(sb){"use strict";if(window.devicePixelRatio&&window.devicePixelRatio>1)sb=new ua(sb.x*window.devicePixelRatio,sb.y*window.devicePixelRatio);return sb;};rb.prototype.getImageURL=function(sb){"use strict";if(sb.video){return null;}else if(sb.smallurl&&!this.shouldShowHiRes(sb))return sb.smallurl;return sb.url;};rb.prototype.getImageDimensions=function(sb){"use strict";if(sb.smalldims&&(!this.shouldShowHiRes(sb)||this.image.src===sb.smallurl))return sb.smalldims;return sb.dimensions;};rb.prototype.getStageSize=function(sb,tb){"use strict";var ub=ua.getViewportDimensions(),vb=new ua(sb.x,sb.y);if(tb)vb=new ua(Math.max(sb.x,tb.x),Math.max(sb.y,tb.y));var wb,xb;if(this.fullscreen&&p.isFullScreen()){return new ua((this.rhcCollapsed?screen.width:screen.width-rb.SIDEBAR_SIZE_MAX),screen.height-rb.FULL_SCREEN_PADDING*2);}else{wb=Math.min(vb.x,(ub.x-rb.SIDEBAR_SIZE_MAX-rb.STAGE_CHROME.x));xb=Math.min(vb.y,ub.y-rb.STAGE_CHROME.y);}if(wb===0&&xb===0)return new ua(0,0);var yb=wb/xb,zb=vb.x/vb.y;if(yb=tb.x||vb>=tb.y){var wb=tb.x/tb.y,xb=ub/vb;if(wbxb){vb=tb.y;ub=Math.round(vb*xb);}else{ub=tb.x;vb=tb.y;}}return new ua(ub,vb);};rb.prototype.adjustStageSize=function(sb){"use strict";var tb=this.currentImageSize;if(sb){tb=sb;}else{var ub=this.stream&&this.stream.getCurrentImageData();if(ub)tb=this.getImageDimensions(ub);}if(!tb)return;this.currentImageSize=tb;var vb=0;if(this.shouldStretch&&!this.getVideoOnStage()&&tb.x>tb.y&&tb.x<=rb.TIMELINE_STRETCH_WIDTH&&tb.x>=rb.TIMELINE_STRETCH_MIN){tb.y=Math.round(tb.y*rb.TIMELINE_STRETCH_WIDTH/tb.x);tb.x=rb.TIMELINE_STRETCH_WIDTH;}else if(this.getVideoOnStage())vb=rb.VIDEO_BOTTOM_BAR_SPACE*2;var wb=this.getStageSize(tb,this.currentMinSize);if(!this.currentMinSize)this.currentMinSize=new ua(0,0);this.currentMinSize=new ua(Math.max(wb.x,rb.STAGE_MIN.x,this.currentMinSize.x),Math.max(wb.y,rb.STAGE_MIN.y,this.currentMinSize.y));var xb=this.getImageSizeInStage(tb,this.currentMinSize),yb=this.currentMinSize.x-xb.x,zb=this.currentMinSize.y-xb.y;if(yb>0&&yb0&&zb=rb.MIN_ADS_VISIBLE;if(ub){this.inAdsDisplayedCallback=true;var vb=tb[rb.MIN_ADS_VISIBLE-1];this.adjustScroller(vb);this.inAdsDisplayedCallback=false;}};rb.prototype.setLoadingState=function(sb,tb){"use strict";switch(sb){case rb.STATE_IMAGE_PIXELS:k.conditionClass(this.root,'imagePixelsLoading',tb);break;case rb.STATE_IMAGE_DATA:this.loadingStates[sb]=tb;k.conditionClass(this.root,'imageLoading',tb);break;case rb.STATE_HTML:this.loadingStates[sb]=tb;k.conditionClass(this.root,'dataLoading',tb);this.rhc.setAttribute('aria-busy',tb?'true':'false');break;}};rb.prototype.destroy=function(){"use strict";this.stageHandlers.forEach(function(sb){sb.remove();});if(this.pageHandlers){this.pageHandlers.forEach(function(sb){sb.remove();});this.pageHandlers=null;}this._slideshowToken&&clearInterval(this._slideshowToken);this._slideshowToken=null;this._videoPlayerStateManager=null;};rb.prototype.checkState=function(sb){"use strict";if(sb!=rb.STATE_ERROR&&!this.loadingStates[sb])return;switch(sb){case rb.STATE_IMAGE_DATA:var tb=this.stream.getCurrentImageData();if(tb){var ub=this.getImageURL(tb);if(ub){this.switchImage(ub,null,true);}else if(tb.video)this.switchVideo(tb.video,tb.info,true);this.setLoadingState(sb,false);}break;case rb.STATE_HTML:if(this.stream.getCurrentHtml()){this.swapData();this.setLoadingState(sb,false);}break;default:if(this.stream.errorInCurrent()){k.hide(this.image);k.show(this.errorBox);}break;}};rb.prototype.buttonListener=function(event){"use strict";var sb=event.getTarget(),tb=Date.now();if(z.byClass(sb,'fbPhotoTagApprovalBox'))return;if(tb-this.lastPage<350)return;if(z.byClass(sb,'fbPhotosPhotoLike')){this.likePhoto();}else if(z.byClass(sb,'tagApproveIgnore')){this.updateTagBox(event,sb);}else if(z.byClass(sb,"_5ge9")){this.hideMorePhotos();this.toggleSlideshow();return false;}else if(z.byClass(sb,"_5ymu")){if(!k.hasClass(this.stageWrapper,"_5ymv")){ga.logShowMorePhotos();var ub=this.stream.getCursor();if(ub)this.showMorePhotos(String(ub));}else{ga.logHideMorePhotos();this.hideMorePhotos();}return;}this.hideMorePhotos();};rb.prototype.toggleSlideshow=function(){"use strict";if(!this.slideshowGk)return;if(this._slideshowToken){this.stopSlideshow();}else this.startSlideshow();};rb.prototype.startSlideshow=function(){"use strict";this._slideshowToken=window.setInterval(this.page.bind(this,1,ta.chrome()&&p.isFullScreen()),rb.SLIDESHOW_TIME);k.addClass(this.root,'slideshowStarted');k.removeClass(this.root,'slideshowAvailable');};rb.prototype.stopSlideshow=function(){"use strict";this._slideshowToken&&clearInterval(this._slideshowToken);this._slideshowToken=null;k.addClass(this.root,'slideshowAvailable');k.removeClass(this.root,'slideshowStarted');};rb.prototype.likePhoto=function(){"use strict";da.addButtonLike();var sb=ya('fbPhotoSnowliftFeedback'),tb=m.scry(sb,'button.like_link')[0];if(!tb)tb=m.scry(sb,'a.UFILikeLink')[0];var ub=tb.getAttribute('href');if(p.isFullScreen())if(ta.chrome())tb.setAttribute('href','javascript:;');tb.click();tb.setAttribute('href',ub);};rb.prototype.toggleLikeButton=function(){"use strict";var sb=m.scry(this.buttonActions,'a.fbPhotosPhotoLike')[0];if(sb){var tb=m.find(this.root,'.likeCount'),ub=m.find(tb,'.likeCountNum');if(tb)if(k.hasClass(sb,'viewerLikesThis')){m.setContent(ub,parseInt(ub.textContent,10)-1);}else m.setContent(ub,parseInt(ub.textContent,10)+1);k.toggleClass(sb,'viewerLikesThis');k.removeClass(sb,'viewerAlreadyLikedThis');}};rb.prototype.likePhotoWithKey=function(){"use strict";return u.like(this.likePhoto.bind(this),hb());};rb.prototype.updateTagBox=function(sb,tb){"use strict";this.unhiliteAllTags();var ub=gb(sb);if(!ub)return;k.addClass(ub,'tagBox');k.addClass(ub,'tagBoxPendingResponse');k.removeClass(ub,'tagBoxPending');k.hide(m.find(ub,'span.tagForm'));if(tb){k.show(m.find(ub,'span.tagApproved'));}else k.show(m.find(ub,'span.tagIgnored'));};rb.prototype.rotate=function(sb){"use strict";var tb=this.stream.getCursor();if(this.getVideoOnStage()){var ub=(sb=='left')?270:90;h.isTruthy(this.videoRotateURI,"Video rotate URI not set.");j.loadModules(["VideoRotate"],function(wb){new wb(tb,this.videoRotateURI).motionRotate(ub);}.bind(this));return;}var vb=bb({fbid:tb,opaquecursor:this.stream.getOpaqueCursor(tb),cs_ver:ca.VIEWER_SNOWLIFT},this.stream.getPhotoSetQuery());vb[sb]=1;this.setLoadingState(rb.STATE_IMAGE_DATA,true);this.setLoadingState(this.STATE_IMAGE_PIXELS,true);k.hide(this.image);new i('/ajax/photos/photo/rotate/').setAllowCrossPageTransition(true).setData(vb).setErrorHandler(this.rotationError.bind(this,tb)).setFinallyHandler(this.rotationComplete.bind(this,tb)).setMethod('POST').setReadOnly(false).send();};rb.prototype.rotationComplete=function(sb,tb){"use strict";if(sb==this.stream.getCursor()){this.setLoadingState(rb.STATE_IMAGE_DATA,false);this.switchImage(this.getImageURL(this.stream.getCurrentImageData()));this.swapData();}};rb.prototype.rotationError=function(sb,tb){"use strict";if(sb==this.stream.getCursor()){this.setLoadingState(rb.STATE_IMAGE_DATA,false);this.switchImage(this.getImageURL(this.stream.getCurrentImageData()));j.loadModules(["AsyncResponse"],function(ub){ub.defaultErrorHandler(tb);});}};rb.prototype.saveTagsFromPayload=function(sb){"use strict";this.storeFromData(sb);if('data' in sb&&this.stream.getCursor() in sb.data)this.swapData();};rb.prototype.saveEdit=function(){"use strict";if(!k.hasClass(this.root,'fbPhotoSnowliftEditMode'))return;j.loadModules(["PhotoInlineEditor","Form"],function(sb,tb){var ub=sb.getInstance(this.getViewerConst());ub&&tb.bootstrap(ub.getForm().controller);}.bind(this));};rb.prototype.mouseLeaveListener=function(event){"use strict";this.unhiliteAllTags();this.reHilitePendingTag();};rb.prototype.hilitePager=function(event){"use strict";var sb=ua.getEventPosition(event),tb=ua.getElementPosition(this.stage);if(x.isRTL()){var ub=ua.getElementDimensions(this.stage);this.stagePagerPrev=ub.x-(sb.x-tb.x)0))){this.showPagers(rb.PAGER_FADE);return;}this.lastPage=Date.now();this.unhiliteAllTags();this.startingMousePos=null;this.haveLeftBufferRegion=false;this._seenTags={};var vb=this.getVideoOnStage();if(vb)this.switchVideo(vb,null,false);if(this.pivots&&this.pivots.page(sb))return;g.inform('PhotoSnowlift.PAGE');pa.hide();this.recacheData();this.stream.moveCursor(sb);k.hide(this.image);if(this.stream.errorInCurrent()){this.setLoadingState(rb.STATE_HTML,true);k.show(this.errorBox);return;}this.movementDelta+=sb;var wb=this.stream.getCurrentImageData();if(wb){var xb=this.getImageURL(wb);if(xb){this.switchImage(xb,null,true);}else if(wb.video)this.switchVideo(wb.video,wb.info,true);if(!tb){this.replaceUrl=true;ib(wb.info.permalink);}this.setLoadingState(rb.STATE_IMAGE_DATA,false);}else{this.setLoadingState(rb.STATE_IMAGE_PIXELS,true);this.setLoadingState(rb.STATE_IMAGE_DATA,true);}if(this.stream.getCurrentHtml()){this.swapData();}else this.setLoadingState(rb.STATE_HTML,true);this.disableAds=!this.isLoggedInViewer||this.stream.isInViewAsMode();this.loadAds();if(this.cropper)this.cropper.resetPhoto();this.setLeftAndRightPagersState();if(this._slideshowToken){k.addClass(this.root,'slideshowStarted');}else if(this.slideshowAvailable)k.addClass(this.root,'slideshowAvailable');if(this._showMorePhotos&&this._albumFBID){this._navCount+=sb;var yb=Math.abs(this._navCount);if(yb===this.stream.getLength()-1)ha.fetch(this._albumFBID,this.stream);if(yb===this.stream.getLength()){ga.logSuggestMorePhotos();this.showMorePhotos(this._albumFBID,true);this.showPagers();this._navCount=0;}else{this.hideMorePhotos();this.hidePagers();}}};rb.prototype.showMorePhotos=function(sb,tb){"use strict";if(!this.searchPivot)this.searchPivot=this.overlay.appendChild(document.createElement('div'));k.addClass(this.stageWrapper,"_5ymv");this.searchPivotComponent=ka.renderComponent(wa({fbid:sb,onclose:this.hideMorePhotos.bind(this),endofalbum:tb||false}),this.searchPivot);};rb.prototype.hideMorePhotos=function(){"use strict";if(this.searchPivotComponent&&k.hasClass(this.stageWrapper,"_5ymv")){k.removeClass(this.stageWrapper,"_5ymv");this.searchPivotComponent.setProps({fbid:null});}};rb.prototype.logImpressionDetailsForPhoto=function(){"use strict";var sb=[].concat(m.scry(ya('fbPhotoSnowliftTagList'),'input.photoImpressionDetails'),m.scry(ya('fbPhotoSnowliftFeedback'),'input.photoImpressionDetails'));if(sb.length===0)return;var tb={};for(var ub=0;ub=2&&this._uriStack[tb-2]==sb.getQualifiedURI().toString())this._uriStack.pop();var ub=this.stream.getCursorForURI(sb.getUnqualifiedURI().toString());if(ub){var vb=this.stream.getRelativeMovement(ub);this.page(vb,true);y.transitionComplete(false);return true;}if(this.isOpen){y.transitionComplete(true);this.close();return true;}this.transitionHandlerRegistered=false;return false;};rb.prototype.recacheData=function(){"use strict";if(!this.loadingStates.html){var sb=this.stream.getCurrentHtml();for(var tb in sb){sb[tb]=cb(ya(tb).childNodes);m.empty(ya(tb));}}};rb.prototype.reloadIfTimeout=function(){"use strict";if(!q.hasLoaded(this.image)){var sb=this.makeNewImage(this.image.src,true);o.listen(sb,'load',this.useImage.bind(this,sb,null,true));this._log(sb.src);}};rb.prototype.useImage=function(sb,tb,ub){"use strict";if(ub&&q.hasLoaded(this.image))return;m.replace(this.image,sb);this.image=sb;this.adjustStageSize(tb);};rb.prototype.makeNewImage=function(sb,tb){"use strict";if(this.imageLoadingTimer){clearTimeout(this.imageLoadingTimer);this.imageLoadingTimer=null;}else if(!tb)this.imageRefreshTimer=setTimeout(this.reloadIfTimeout.bind(this),rb.LOADING_TIMEOUT);var ub=m.create('img',{className:'spotlight',alt:''});ub.setAttribute('aria-describedby','fbPhotosSnowliftCaption');ub.setAttribute('aria-busy','true');o.listen(ub,'load',za(function(){clearTimeout(this.imageRefreshTimer);this.image.setAttribute('aria-busy','false');this.setLoadingState(this.STATE_IMAGE_PIXELS,false);setTimeout((function(){if(this.isOpen){this.adjustStageSize();this.adjustForNewData();}}).bind(this),0);}.bind(this),'photo_theater'));this._log(sb);ub.src=sb;return ub;};rb.prototype.switchImage=function(sb,tb,ub){"use strict";k.hide(this.image);k.hide(this.errorBox);this.setLoadingState(this.STATE_IMAGE_PIXELS,true);var vb=this.stream&&this.stream.getCurrentImageData();if(vb){da.addPhotoView(vb.info,this.shouldShowHiRes(vb),this.fullscreen&&p.isFullScreen());if(this._showHover){var wb=this.stream.getCurrentExtraData();if(wb)ga.logImageImpression('snowlift',String(this.stream.getCursor()),Object.keys(wb.tagRects));}}this.useImage(this.makeNewImage(sb,false),tb,false);if(ub)this.stream.preloadImages(this.shouldShowHiRes.bind(this));if(this.cropper&&this.cropper.croppingMode)this.cropper.resetPhoto();g.inform('PhotoSnowlift.SWITCH_IMAGE');};rb.prototype.switchVideo=function(sb,tb,ub){"use strict";var vb='swf_'+sb;if(ub){k.addClass(this.stageWrapper,'showVideo');var wb=m.create('div',{className:'videoStageContainer'});m.appendContent(this.videoStage,wb);wb.id=sb;if(window[vb]&&!gb(vb))window[vb].write(sb);var xb='video_warning_'+sb,yb=gb(sb);if(!this.videoWarnings)this.videoWarnings=[];if(yb&&this.videoWarnings[xb])m.setContent(yb,this.videoWarnings[xb]);var zb=tb?tb.fbid.toString():null;if(this._useVideoPlayerJS)if(this._videoPlayerStateManager==null){this._videoPlayerStateManager=new xa(yb,{player_version:this._videoPlayerVersion,should_autoplay:this._autoplayVideos,source:'snowlift',video_id:zb});}else this._videoPlayerStateManager.switchVideo(yb,zb);setTimeout(this.adjustStageSizeForVideo.bind(this,vb),0);}else{window[vb]&&window[vb].addVariable('video_autoplay',0);this.videoLoadTimer&&clearTimeout(this.videoLoadTimer);m.empty(this.videoStage);k.removeClass(this.stageWrapper,'showVideo');}};rb.prototype.checkVideoStatus=function(sb){"use strict";if(this.videoLoadTimer)clearTimeout(this.videoLoadTimer);var tb=this.getVideoOnStage();if(!tb){return;}else{var ub='swf_'+tb;if(sb!==ub)return;this.adjustStageSizeForVideo(sb);}};rb.prototype.adjustStageSizeForVideo=function(sb){"use strict";var tb=gb(sb);if(!tb){this.videoLoadTimer=setTimeout(this.checkVideoStatus.bind(this,sb),200);}else this.adjustStageSize(new ua(tb.width,tb.height));};rb.prototype.handleServerError=function(sb,tb){"use strict";m.setContent(this.errorBox,sb);this.storeFromData(tb);};rb.prototype.swapData=function(){"use strict";var sb,tb=this.stream.getCurrentHtml();if(tb){this.setLoadingState(rb.STATE_HTML,false);for(var ub in tb){sb=gb(ub);sb&&m.setContent(sb,tb[ub]);}g.inform('PhotoSnowlift.DATA_CHANGE',bb(this.stream.getCurrentImageData().info,{movement:this.movementDelta}),g.BEHAVIOR_STATE);this.movementDelta=0;if(this.stream.getCurrentExtraData())g.inform('PhotoSnowlift.EXTRA_DATA_CHANGE',this.stream.getCurrentExtraData(),g.BEHAVIOR_STATE);}this.adjustScroller();this.scrollableArea.showScrollbar(false);this.adjustForNewData();this.logImpressionDetailsForPhoto();};rb.prototype.updateTotalCount=function(sb,tb,ub){"use strict";var vb=this.stream.getCurrentHtml();if(vb){var wb=ya('fbPhotoSnowliftPositionAndCount');m.replace(wb,ub);wb=ub;k.show(wb);var xb='fbPhotoSnowliftPositionAndCount';vb[xb]=cb(wb.childNodes);}this.stream.setTotalCount(sb);this.stream.setFirstCursorIndex(tb);};rb.prototype.addPhotoFbids=function(sb,tb,ub,vb){"use strict";if(vb&&this.sessionID&&vb!=this.sessionID)return;var wb=this.stream.getCursor()===null;this.stream.attachToFbidsList(sb,tb,ub);if(ub&&wb)this.page(0,true);if(this.pivots&&ub)this.pivots.setCycleCount(this.stream.calculateDistance(this.stream.getCursor(),this.stream.firstCursor));if(!this.pagersShown&&this.stream.canPage())this.setStagePagersState('ready');if(!this.slideshowAvailable&&this.stream.canPage()){this.slideshowAvailable=true;k.addClass(this.root,'slideshowAvailable');}this.setLeftAndRightPagersState();};rb.prototype.attachTagger=function(sb){"use strict";m.appendContent(this.stageActions,sb);};rb.prototype.storeFromData=function(sb){"use strict";if(!this.isOpen)return;if(sb.ssid&&this.sessionID&&this.sessionID!=sb.ssid)return;var tb=this.stream.storeToCache(sb);if('error' in tb){this.checkState(rb.STATE_ERROR);return;}if('init' in sb){this._albumFBID=sb.init.album_fbid;this._autoplayVideos=sb.init.autoplay_videos;}if('init' in tb){this.initDataFetched(tb.init);if(this.openExplicitly){this.replaceUrl=true;ib(this.stream.getCurrentImageData().info.permalink);}if(this.stream.canPage())this.setStagePagersState('ready');this.setLeftAndRightPagersState();this.ua&&this.ua.add_event('ufi');}if('image' in tb)this.checkState(rb.STATE_IMAGE_DATA);if('data' in tb)this.checkState(rb.STATE_HTML);};rb.prototype.setLeftAndRightPagersState=function(){"use strict";if(this.stream.isNonCircularPhotoSet()){k.conditionClass(this.root,'disableLeft',!this.stream.nonCircularPhotoSetCanPage(-1));k.conditionClass(this.root,'disableRight',!this.stream.nonCircularPhotoSetCanPage(1));}if(this.snowflake){k.conditionClass(this.root,'disableLeft',this.stream.getCursor()==this.firstInSet);var sb=this.stream.getCursorAt(this.stream.calculatePositionForMovement(1));k.conditionClass(this.root,'disableRight',sb==this.firstInSet);}};rb.prototype.setStagePagersState=function(sb){"use strict";switch(sb){case 'ready':k.addClass(this.root,'pagingReady');this.pagersShown=true;this.ua&&this.ua.add_event('arrows');return;case 'active':k.addClass(this.root,'pagingActivated');return;case 'inactive':k.removeClass(this.root,'pagingActivated');return;case 'disabled':case 'reset':k.removeClass(this.root,'pagingReady');return;}};rb.prototype.deletePhoto=function(sb){"use strict";this.closeRefresh();};rb.prototype.closeRefresh=function(){"use strict";this.refreshOnClose=true;this.spotlight.hide();};rb.prototype.onHiliteTag=function(sb,tb){"use strict";if(tb.version!=ca.VIEWER_SNOWLIFT)return;var ub=tb.tag;if(ub)this.switchHilitedTags(ub,true);};rb.prototype.onUpdateTagBox=function(sb,tb){"use strict";if(tb.version==ca.VIEWER_SNOWLIFT)this.updateTagBox(tb.id,tb.approve);};rb.prototype._log=function(sb){"use strict";if(this._shouldLog){this._logger&&this._logger.log(sb);return true;}return false;};rb.prototype._enableMouseOver=function(){"use strict";this._disableMouseOver=false;};rb.prototype._interceptMouseOver=function(event){"use strict";if(this._disableMouseOver)event.kill();};rb.getInstance=function(){"use strict";if(!rb._instance)rb._instance=new rb();return rb._instance;};rb.initWithSpotlight=function(sb,tb){"use strict";rb.getInstance().init(sb,tb);};rb.addPhotoFbids=function(sb,tb,ub,vb){"use strict";rb.getInstance().addPhotoFbids(sb,tb,ub,vb);};rb.setReachedLeftEnd=function(){"use strict";rb.getInstance().setReachedLeftEnd();};rb.setReachedRightEnd=function(){"use strict";rb.getInstance().setReachedRightEnd();};rb.attachFollowFlyout=function(sb){"use strict";m.insertAfter(ya('fbPhotoSnowliftSubscribe'),sb);};rb.attachSubscribeFlyout=function(sb){"use strict";m.insertAfter(ya('fbPhotoSnowliftSubscribe'),sb);};rb.attachTagger=function(sb){"use strict";rb.getInstance().attachTagger(sb);};rb.preload=function(sb,tb){"use strict";rb.getInstance().preload(sb,tb);};rb.bootstrap=function(sb,tb){"use strict";var ub=sb&&sa(sb).getQueryData();if(ub&&ub.hasOwnProperty('share_id')){j.loadModules(["SpotlightShareViewer"],function(vb){vb.bootstrap(sb,tb);});return;}if(ub&&ub.fbid&&ub.makeprofile&&ub.profile_id){d(['ProfilePicCropViewerInit'],function(vb){if(!vb.loadID(ub.fbid,ub.profile_id))rb.getInstance().bootstrap(sb,tb);});return;}rb.getInstance().bootstrap(sb,tb);};rb.closeRefresh=function(){"use strict";rb.getInstance().closeRefresh();};rb.deletePhoto=function(sb){"use strict";rb.getInstance().deletePhoto(sb);};rb.getImage=function(){"use strict";return rb.getInstance().getImage();};rb.getImageId=function(){"use strict";return rb.getInstance().getImageId();};rb.getLoadQuery=function(){"use strict";return rb.getInstance().getLoadQuery();};rb.getRHCBody=function(){"use strict";return rb.getInstance().getRHCBody();};rb.getRHCFooter=function(){"use strict";return rb.getInstance().getRHCFooter();};rb.getRHCHeader=function(){"use strict";return rb.getInstance().getRHCHeader();};rb.getRoot=function(){"use strict";return rb.getInstance().getRoot();};rb.likePhotoSkipConfirmation=function(sb){"use strict";rb.getInstance().likePhotoSkipConfirmation(sb);};rb.saveTagsFromPayload=function(sb){"use strict";rb.getInstance().saveTagsFromPayload(sb);};rb.saveTagsFromPayloadDelayed=function(sb){"use strict";setTimeout(rb.saveTagsFromPayload.bind(null,sb),2000);};rb.handleServerError=function(sb,tb){"use strict";rb.getInstance().handleServerError(sb,tb);};rb.setVideoWarning=function(sb,tb){"use strict";var ub=rb.getInstance(),vb='video_warning_'+sb;if(!ub.videoWarnings)ub.videoWarnings=[];ub.videoWarnings[vb]=tb;};rb.storeFromData=function(sb){"use strict";rb.getInstance().storeFromData(sb);};rb.swapData=function(){"use strict";rb.getInstance().swapData();};rb.updateTotalCount=function(sb,tb,ub){"use strict";rb.getInstance().updateTotalCount(sb,tb,ub);};rb.setVideoRotateURI=function(sb){"use strict";rb.getInstance().videoRotateURI=sb;};bb(rb,{STATE_ERROR:'error',STATE_HTML:'html',STATE_IMAGE_PIXELS:'image_pixels',STATE_IMAGE_DATA:'image',LOADING_TIMEOUT:2000,PAGER_FADE:3000,FULL_SCREEN_PADDING:10,STAGE_NORMAL_MAX:{x:960,y:960},STAGE_MIN:{x:520,y:520},SIDEBAR_SIZE_MAX:360,STAGE_CHROME:{x:82,y:42},VIDEO_BOTTOM_BAR_SPACE:40,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,MIN_ADS_VISIBLE:1,PINNED_UFI_ADJUSTMENT:11,ADD_COMMENT_HEIGHT:54,SLIDESHOW_TIME:3000,_instance:null,touch:fb,touchMarkup:fb});bb(rb.prototype,{switchTimer:null,imageRefreshTimer:null,imageLoadingTimer:null,lastPage:0,currentMinSize:null,currentImageSize:null,resetUriStack:true,thumbSrc:null,shouldStretch:false,stageMax:rb.STAGE_NORMAL_MAX,stageChrome:rb.STAGE_CHROME,stagePagerPrev:null,ua:null,PhotoTagger:null});e.exports=rb;},null);