/*!CK:2174695988!*//*1403497380,*/ if (self.CavalryLogger) { CavalryLogger.start_js(["ZPJC4"]); } __d("PlaceTagType",[],function(a,b,c,d,e,f){e.exports={CITY:"city",STATE_PROVINCE:"state_province",COUNTRY:"country",PLACE:"place",EVENT:"event",UNCONFIRMED_RESIDENCE:"unconfirmed_residence",RESIDENCE:"residence",TEXT:"text"};},null); __d("PhotoAlbumAudienceInput",["Arbiter","CSS","DOM","Event"],function(a,b,c,d,e,f,g,h,i,j){function k(l,m,n,o,p){"use strict";this.$PhotoAlbumAudienceInput0=l;if(m){this.$PhotoAlbumAudienceInput1=m;this.$PhotoAlbumAudienceInput2=n;this.$PhotoAlbumAudienceInput3=o;this.$PhotoAlbumAudienceInput4=p;g.subscribe('Tokenizer/init',this.$PhotoAlbumAudienceInput5.bind(this));j.listen(this.$PhotoAlbumAudienceInput3,'click',this.$PhotoAlbumAudienceInput6.bind(this));}}k.prototype.removeHiddenPrivacyWidget=function(){"use strict";[this.$PhotoAlbumAudienceInput0,this.$PhotoAlbumAudienceInput1,this.$PhotoAlbumAudienceInput4].forEach(function(l){if(l&&h.hasClass(l,'hidden_elem'))i.remove(l);});};k.prototype.$PhotoAlbumAudienceInput6=function(){"use strict";this.$PhotoAlbumAudienceInput7.removeAllTokens();this.$PhotoAlbumAudienceInput8(null,null);};k.prototype.$PhotoAlbumAudienceInput5=function(l,m){"use strict";if(this.$PhotoAlbumAudienceInput7||this.$PhotoAlbumAudienceInput2!=m.element)return;this.$PhotoAlbumAudienceInput7=m;this.$PhotoAlbumAudienceInput8(null,null);g.subscribe('Form/change',this.$PhotoAlbumAudienceInput8.bind(this));};k.prototype.$PhotoAlbumAudienceInput8=function(l,m){"use strict";var n=this.$PhotoAlbumAudienceInput7.getTokens().length>0;this.$PhotoAlbumAudienceInputa(n);};k.prototype.$PhotoAlbumAudienceInputa=function(l){"use strict";h.conditionShow(this.$PhotoAlbumAudienceInput1,l);h.conditionShow(this.$PhotoAlbumAudienceInput0,!l);this.$PhotoAlbumAudienceInput4&&h.conditionShow(this.$PhotoAlbumAudienceInput4,l);};e.exports=k;},null); __d("PhotoAlbumPlacesTypeahead",["Arbiter"],function(a,b,c,d,e,f,g){function h(i){"use strict";if(!i)return;if(i.getCore().getHiddenValue()){var j={uid:i.getCore().getHiddenValue(),text:i.getCore().getValue()};g.inform('PhotoAlbumPlacesTypeahead.EXIST_PLACE',j);}i.subscribe('select',function(k,l){g.inform('PhotoAlbumPlacesTypeahead.SELECTED_PLACE',l.selected);}.bind(this));i.subscribe('reset',function(){if(!i.getCore().getHiddenValue())g.inform('PhotoAlbumPlacesTypeahead.RESET_PLACE');}.bind(this));this._initialized=true;}h.prototype.init=function(i){"use strict";if(this._initialized)return;h.call(this,i);};e.exports=h;},null); __d("PhotoBulkEditTagger",["Arbiter","AsyncRequest","CSS","DOM","DOMQuery","Event","FaceboxSourceConstants","Parent","PhotosConst","PhotosTaggingWaterfall","PhotoTagger","SubscriptionsHandler","Vector","$","copyProperties","csx","ge"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w){var x=60;for(var y in q)if(q.hasOwnProperty(y))aa[y]=q[y];var z=q===null?null:q.prototype;aa.prototype=Object.create(z);aa.prototype.constructor=aa;aa.__superConstructor__=q;function aa(ba,ca,da,ea){"use strict";q.call(this,ba);this.editor=ba;this.faceboxes=[];this.gkEnableTagNext=ea.gkEnableTagNext;this._qn=ea.qn;this.tokenizer=da;this.editor.registerTagger(this);this.typeahead=da.getTypeahead();this.handlers=new r();this.root=this.editor.getRoot();this.tagger=ca;this.hideNewTagTimer=null;this.photoKey=null;this._needTaggingData=true;this._currentRecognition={box:null,isTagged:false,suggestion:null};this._hoverState=false;this._tagging=false;this.setupHandlers();this._sendWaterfallLogSignal(p.BEGIN);this.fetchTaggingSuggestions();this.setTagAccumulator(ea.bulkSaveTags);this.setNeedTaggingData(ea.needTaggingData);this.version=o.BULK_EDITOR;l.listen(this.root,'mousemove',function(event){var fa=event.getTarget();if(this._hoverState&&!(n.byClass(fa,'faceBox')||n.byClass(fa,'tagPointer')||n.byClass(fa,'arrow')||n.byClass(fa,'faceboxSuggestion'))){this.removeSuggestionFromTagger();this.hideTagger();}}.bind(this));}aa.prototype.setupUserActionLogging=function(){"use strict";return null;};aa.prototype.logUserActionEvent=function(ba){"use strict";return null;};aa.prototype.addFaceboxes=function(ba){"use strict";this.faceboxes=k.scry(ba.parentNode,'.faceBox');this.faceboxes.sort(function(ca,da){return ca.offsetLeft===da.offsetLeft?ca.offsetTop-da.offsetTop:ca.offsetLeft-da.offsetLeft;});this.faceboxes.forEach(function(ca){var da={image:ba,facebox:ca};l.listen(ca,'mouseenter',this._mouseOverFacebox.bind(this,da));}.bind(this));};aa.prototype.saveTag=function(ba,ca,da){"use strict";z.saveTag.call(this,ba,ca,da);g.inform('PhotoBulkEditTagger.TAG_SAVED',{editor:this.root,fbid:this.photoData.fbid});};aa.prototype.setNeedTaggingData=function(ba){"use strict";this._needTaggingData=ba;return this;};aa.prototype.setTagAccumulator=function(ba){"use strict";z.setTagAccumulator.call(this,ba);return this;};aa.prototype.needTaggingData=function(){"use strict";return this._needTaggingData;};aa.prototype.setupHandlers=function(){"use strict";l.listen(this.root,'click',this.clickHandler.bind(this));this.tokenizer.subscribe(['addToken','removeToken'],this.handleTokenAction.bind(this));this.tokenizer.subscribe('switchTarget',this.switchPhoto.bind(this));g.subscribe('PhotoBulkEditTagger.DATA_SOURCE_READY',this.useTaggingDataSource.bind(this));g.subscribe(this.editor.mapEventNameToNamespace('PhotosBulkEditor.PHOTO_REORDER_START'),this.hideTagger.bind(this));};aa.prototype.hideTagger=function(){"use strict";z.hideTagger.apply(this,arguments);if(this._currentRecognition.box&&!this._currentRecognition.isTagged)i.show(this._currentRecognition.box);this._tagging=false;this._hoverState=false;this._currentRecognition.box=null;this._currentRecognition.isTagged=false;this._currentRecognition.suggestion=null;this.recognizedUsers=[];};aa.prototype.done=function(){"use strict";this._sendWaterfallLogSignal(p.FINISH);};aa.prototype.handleTokenAction=function(ba,ca){"use strict";var da=t(this.photoKey),ea=j.find(da,'.peopleIcon'),fa=j.find(da,'.editablePhotoTagList'),ga=j.find(ea,'.count'),ha=this.tokenizer.getTokens().length,ia=ca.info.suggestion?m.UPLOADER_SUGGEST:null;if(this._currentRecognition.box)this._currentRecognition.isTagged=!!ha;i.conditionClass(ea,'hasPeople',!!ha);i.conditionClass(fa,'hasPeople',!!ha);j.setContent(ga,ha);if(ba=='addToken'){this.saveTag(ba,ca,ia);if(!this.gkEnableTagNext)return;for(var ja=0;ja<this.faceboxes.length;ja++)if(i.shown(this.faceboxes[ja])){setTimeout(function(){this.showTaggerByFacebox(this.faceboxes[ja]);}.bind(this),100);break;}}else this.removeTag(ba,ca);};aa.prototype.useTaggingDataSource=function(ba,ca){"use strict";if(!this._needTaggingData)return;var da=this.tokenizer.getTypeahead();da.swapData(ca);this.setNeedTaggingData(false);};aa.prototype.getTaggerPositioningOrigin=function(){"use strict";return s.getElementPosition(this.root);};aa.prototype.showTaggerByFacebox=function(ba){"use strict";var ca=n.byClass(ba,'faceBox');if(!ca)ca=n.byClass(ba,'recognitionBox');this._currentRecognition.box=ca;var da=n.byClass(ba,'editablePhotoImage');this.setupPhotoDataForTarget(da);var ea=j.find(da,'.scaledImage img'),fa=null,ga=null,ha=null,ia=this.getRecognitionBoxCenter(ca,ea);fa=ia.boxPos;ga=ia.boxDim;ha=ia.taggerPos;i.hide(this._currentRecognition.box);this.recognizedUsers=JSON.parse(ca.getAttribute('data-recognizeduids'));this.setUpTagger(ea,da,fa,ga,ha);};aa.prototype.getRecognitionBoxCenter=function(ba,ca){"use strict";var da=s.getElementPosition(ba).add(s.getElementDimensions(ba).mul(.5)),ea=s.getElementDimensions(this._currentRecognition.box),fa=this.calcTaggerPosition(ca,da,ea.x,ea.y);return {boxPos:da,boxDim:ea,taggerPos:fa};};aa.prototype.setUpTagger=function(ba,ca,da,ea,fa){"use strict";this.calcClickPoint(ba,da);fa.setElementPosition(this.tagger);if(ea)ea.setElementDimensions(this.tagger);i.hide(j.find(ca,'.clickToTagMessage'));this._sendWaterfallLogSignal(p.TAG_FACE);this.updateTypeaheadSuggestions();this.updateWithSuggestions();this.showTagger();this._tagging=true;};aa.prototype.clickHandler=function(event){"use strict";var ba=event.getTarget();if(n.byClass(ba,'photoTagTypeahead'))return;if(this._hoverState){this._hoverState=false;this._tagging=true;return;}if(this.tagger){this.hideTagger();this.removeSuggestionFromTagger();this.handlers.release();}if(n.byClass(ba,'photoContextualSelector')||n.byClass(ba,'removePhotoButton'))return;var ca=n.byClass(ba,'editablePhotoImage');if(!ca){var da=n.byClass(ba,'peopleIcon');if(da)this.setupPhotoDataForTarget(da);return;}this.setupPhotoDataForTarget(ca);var ea=j.find(ca,'.scaledImage img'),fa=null,ga=null,ha=null,ia=n.byClass(ba,'faceBox');if(!ia)ia=n.byClass(ba,'recognitionBox');this._currentRecognition.box=ia;if(this._currentRecognition.box&&i.shown(this._currentRecognition.box)){var ja=this.getRecognitionBoxCenter(ia,ea);fa=ja.boxPos;ga=ja.boxDim;ha=ja.taggerPos;i.hide(this._currentRecognition.box);this._currentRecognition.isTagged=false;var ka=this.getFaceboxSuggestionFromFaceboxElem(ia);if(ka){this._currentRecognition.suggestion=ka;this.addSuggestionToTagger(ia,ka);this._sendFaceboxSuggestionLogSignal(ka.getAttribute('data-id'),m.UPLOADER_SUGGEST);}else this.recognizedUsers=JSON.parse(ia.getAttribute('data-recognizeduids'));}if(ha===null){fa=s.getEventPosition(event);ha=this.calcTaggerPosition(ea,fa,x);}if(!ha)return;this.setUpTagger(ea,ca,fa,ga,ha);};aa.prototype._mouseOverFacebox=function(ba){"use strict";if(this._tagging)return;var ca=ba.image,da=ba.facebox,ea=this.getFaceboxSuggestionFromFaceboxElem(da);if(ea){this._hoverState=true;this._currentRecognition.box=da;this._currentRecognition.suggestion=ea;this.setupPhotoDataForTarget(ca);this.addSuggestionToTagger(da,ea);this._sendFaceboxSuggestionLogSignal(ea.getAttribute('data-id'),m.UPLOADER_SUGGEST);this._sendWaterfallLogSignal(p.HOVER_TAG_FACE);var fa=s.getElementPosition(da).add(s.getElementDimensions(da).mul(.5)),ga=s.getElementDimensions(this._currentRecognition.box),ha=this.calcTaggerPosition(ca,fa,ga.x,ga.y);this.calcClickPoint(ca,fa);ha.setElementPosition(this.tagger);ga.setElementDimensions(this.tagger);this.showTagger();}};aa.prototype.fetchTaggingSuggestions=function(){"use strict";this.logUserActionEvent('sugg_fetch');new h().setURI(this.ajaxURIs.tagsInit).setData({owner:this.photoData.owner}).setOption('retries',1).setHandler(function(ba){var ca=ba.getPayload();this.featuredSuggestions=ca.featuredTaggees;this.friendSuggestions=ca.friendTaggees;this.logUserActionEvent('sugg_fetch_done');}.bind(this)).send();};aa.prototype.switchPhoto=function(ba,ca){"use strict";var da=w(ca);da&&this.setupPhotoDataForTarget(da);this.hideTagger();};aa.prototype.getImageByID=function(ba){"use strict";return w('editablePhoto_'+ba);};aa.prototype.setupPhotoDataForTarget=function(ba){"use strict";var ca;if(ba&&!i.hasClass(ba,'editablePhoto')){ca=n.byClass(ba,'editablePhoto');}else ca=ba;if(!ca){this.photoKey=null;this.photoData=null;return false;}var da=ca.id;if(da===this.photoKey)return;this.photoKey=da;this.photoData=this.editor.getPhotoData(da);this.tokenizer.setTokenarea(j.find(ca,'div.editablePhotoTagList'));};aa.prototype.getPosition=function(){"use strict";return this.photoData.fbid;};aa.prototype.tagsChangeHandler=function(ba){"use strict";};aa.prototype.removeTagByID=function(ba,ca,da){"use strict";this.hideTagger();this.setupPhotoDataForTarget(this.getImageByID(ba));z.removeTagByID.call(this,ba,ca,da);};aa.prototype.setupFaceboxSuggestionHandlers=function(ba,ca){"use strict";var da=j.find(ca,"._570w"),ea=j.find(ca,"._570x");this.handlers.engage();this.handlers.addSubscriptions(l.listen(da,'click',function(fa){this.dismissFaceboxSuggestion(ba.id.replace('face:',''),ca.getAttribute('data-id'),this.photoData.owner,m.UPLOADER_DISMISS);this.removeSuggestionFromTagger();this.hideTagger();j.remove(this.getFaceboxSuggestionFromFaceboxElem(ba));}.bind(this)),l.listen(ea,'click',function(fa){var ga=this.tokenizer.createToken({uid:ca.getAttribute('data-id'),text:ca.getAttribute('data-text'),suggestion:true});this.removeSuggestionFromTagger();i.hide(ba);this.tokenizer.addToken(ga);}.bind(this)));};u(aa.prototype,{elemNames:{}});e.exports=aa;},null); __d("PhotosBulkBackdateEditor",["Event","Arbiter","DOMQuery","Focus","Form"],function(a,b,c,d,e,f,g,h,i,j,k){var l={setup:function(m,n){g.listen(m,'click',function(){n.setContext(m);n.show();});var o=i.find(n.getContent(),"^.photosBulkDatePicker .saveBackdatedTime");g.listen(o,'click',function(){var p=k.serialize(n.getContent()),q=p.backdated_date,r=parseInt(p.use_date_from_file,10)>0,s=i.scry(n.getContent(),'#hide_from_newsfeed')[0],t=s&&s.checked;h.inform('PhotosBulkBackdateEditor.SAVED',{context:m,backdatedDate:q,hideFromNewsfeed:t,useDateFromFile:r});n.hide();j.set(m);});}};e.exports=l;},null); __d("PhotoBulkEditTokenizer",["DOM","Event","Input","Parent","Tokenizer","UserAgent","getObjectValues"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){for(var n in k)if(k.hasOwnProperty(n))p[n]=k[n];var o=k===null?null:k.prototype;p.prototype=Object.create(o);p.prototype.constructor=p;p.__superConstructor__=k;function p(){"use strict";if(k!==null)k.apply(this,arguments);}p.prototype.init=function(q,r,s,t){"use strict";this._tokenareaListeners={};o.init.call(this,q,r,s,t);this.inform('initialized');};p.prototype.initEvents=function(){"use strict";var q=l.firefox()<4?'keypress':'keydown';h.listen(this.input,'paste',this.paste.bind(this));h.listen(this.input,q,this.keydown.bind(this));};p.prototype.setTokenarea=function(q){"use strict";this.tokenarea=q;this.addTokenareaListener(q);this.reset();};p.prototype.addTokenareaListener=function(q){"use strict";if(this._tokenareaListeners[q.id])return;var r=this.handleEvents.bind(this);this._tokenareaListeners[q.id]=m(h.listen(q,{click:r,keydown:r}));};p.prototype.handleEvents=function(event){"use strict";var q=j.byClass(event.getTarget(),'editablePhotoTagList');if(!q){return;}else if(this.tokenarea!==q){this.setTokenarea(q);this.inform('switchTarget',this.tokenarea.id);}return o.handleEvents.call(this,event);};p.prototype.reset=function(){"use strict";var q=this.getTokenElements().map(function(r){return {uid:g.scry(r,'input')[0].value,text:g.scry(r,'input')[1].value};});i.reset(this.input);return o.reset.call(this,q);};p.prototype.updateTokenareaVisibility=function(){"use strict";return null;};p.prototype.insertToken=function(q){"use strict";g.prependContent(this.tokenarea,q.getElement());};e.exports=p;},null); __d("PlaceUtils",["PlaceTagType"],function(a,b,c,d,e,f,g){var h={placesClose:function(i,j,k,l){i=i||0;j=j||0;k=k||0;l=l||0;return (Math.abs(i-k)<1e-05)&&(Math.abs(j-l)<1e-05);},isNonSpecificPlace:function(i){return (i==g.CITY||i==g.STATE_PROVINCE||i==g.COUNTRY);}};e.exports=h;},null); __d("ProgressiveDatepicker",["Arbiter","ArbiterMixin","CSS","DataStore","DOM","Event","Parent","copyProperties","mixin","shield"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){function q(w){return new Date(w[0],w[1],w[2],w[3],w[4]);}function r(w,x){while(w.length)k.insertAfter(x,w.pop());}var s=o(h);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){"use strict";this._root=w;this._savedLabels={};this._savedPeriodsBack=[];this._savedPeriodsFront=[];this._menus={};this._mintime=x.mintime&&new Date(1000*x.mintime);this._maxtime=x.maxtime&&new Date(1000*x.maxtime);j.set(w,'datepicker',this);k.scry(w,'select').forEach(function(y){l.listen(y,'change',p(this._handleChange,this,y));var z=m.byClass(y,'period');l.listen(y,'focus',i.addClass.bind(null,z,'periodFocus'));l.listen(y,'blur',i.removeClass.bind(null,z,'periodFocus'));this._setMenuSelectionState(y);if(y.getAttribute('data-name')==='month')this._filterInvalidDates();}.bind(this));k.scry(w,'a.periodLabel').forEach(function(y){var z=m.byClass(y,'period');l.listen(y,'click',function(){i.addClass(z,'periodSelected');i.addClass(z,'periodFocus');});});this._filterInvalidDates();this.inform('initialized',this,g.BEHAVIOR_STATE);}v.prototype.setDate=function(w,x,y,z,aa){"use strict";this._addSavedPeriods();var ba=v.PERIODS;for(var ca=0;ca<ba.length;ca++)this._setValueForPeriod(ba[ca],arguments[ca]);this._filterInvalidDates();this.inform('changed');};v.prototype.setDateWithTimestamp=function(w){"use strict";var x=new Date(w);this.setDate(x.getFullYear(),x.getMonth()+1,x.getDate(),x.getHours(),x.getMinutes());};v.prototype.isSet=function(){"use strict";var w=v.PERIODS;for(var x=0;x<w.length;x++)if(this._getValueForPeriod(w[x]))return true;return false;};v.prototype.getRoot=function(){"use strict";return this._root;};v.prototype.getValues=function(){"use strict";var w=v.PERIODS,x={};for(var y=0;y<w.length;y++){var z=this._getValueForPeriod(w[y]);if(z)x[w[y]]=z;}return x;};v.prototype.getDate=function(){"use strict";var w=this.getValues();return new Date(w.year||0,(w.month||1)-1,w.day||1,w.hour||0,w.minute||0);};v.prototype.getTimestamp=function(){"use strict";return Math.round(this.getDate().getTime()/1000);};v.prototype._setValueForPeriod=function(w,x){"use strict";var y=this._menuForPeriodName(w);if(!y)return;if(x===undefined)x='';var z=y.options;for(var aa=0,ba=z.length;aa<ba;aa++)if(z[aa].value==x){y.selectedIndex=aa;break;}this._setMenuSelectionState(y);};v.prototype._getValueForPeriod=function(w){"use strict";var x=this._menuForPeriodName(w);return (x&&x.options[x.selectedIndex].value);};v.prototype._handleChange=function(w){"use strict";this._setMenuSelectionState(w);this._filterInvalidDates();this.inform('changed');};v.prototype._setMenuSelectionState=function(w){"use strict";var x=m.byClass(w,'period');if(!x)return;if(i.hasClass(x,'periodRequired')){if(w.selectedIndex===0)w.selectedIndex=1;}else this._updateLabel(w);var y=w.getAttribute('data-name'),z=w.options[w.selectedIndex].value;i.conditionClass(x,'periodSelected',z);i.conditionClass(this._root,this._selectedClass(y),z);if(!z)this._resetMenu(v.PERIODS.indexOf(y)+1);};v.prototype._updateLabel=function(w){"use strict";var x=w.getAttribute('data-name'),y=w.options[0];if(!this._savedLabels[x])this._savedLabels[x]=k.getText(y);if(w.selectedIndex===0){k.setContent(y,this._savedLabels[x]);}else k.setContent(y,'--');};v.prototype._daysInMonth=function(w,x){"use strict";return new Date(w||1999,x+1||1,0).getDate();};v.prototype._daysInCurrentMonth=function(){"use strict";return this._daysInMonth(this._getValueForPeriod('year'),this._getValueForPeriod('month')-1);};v.prototype._menuForPeriodName=function(w){"use strict";if(!this._menus[w])this._menus[w]=k.scry(this._root,'.'+w+'Menu')[0];return this._menus[w];};v.prototype._selectedClass=function(w){"use strict";return 'uiProgressiveDatepickerSelected-'+w;};v.prototype._resetMenu=function(w){"use strict";var x=v.PERIODS;for(;w<x.length;w++){var y=x[w],z=this._menuForPeriodName(y);if(!z)return;if(m.byClass(z,'periodRequired')){z.selectedIndex=1;}else{i.removeClass(m.byClass(z,'period'),'periodSelected');i.removeClass(this._root,this._selectedClass(y));z.selectedIndex=0;this._updateLabel(z);}}};v.prototype._addSavedPeriods=function(){"use strict";var w=v.PERIODS;for(var x=0;x<w.length;x++){var y=this._menuForPeriodName(w[x]);if(!y)return;this._savedPeriodsFront[x]||(this._savedPeriodsFront[x]=[]);this._savedPeriodsBack[x]||(this._savedPeriodsBack[x]=[]);var z=y.options[0],aa=y.options[y.options.length-1];if(x===v.PERIODS.indexOf('hour')||x===v.PERIODS.indexOf('minute')){r(this._savedPeriodsFront[x],z);r(this._savedPeriodsBack[x],aa);}else{r(this._savedPeriodsBack[x],z);r(this._savedPeriodsFront[x],aa);}}};v.prototype._filterInvalidDates=function(){"use strict";this._addSavedPeriods();var w=v.PERIODS,x=this.getValues();for(var y=0;y<w.length;y++){var z=this._menuForPeriodName(w[y]);if(!z)return;this._savedPeriodsFront[y]||(this._savedPeriodsFront[y]=[]);this._savedPeriodsBack[y]||(this._savedPeriodsBack[y]=[]);for(var aa=1;aa<z.options.length;){var ba=z.options[aa],ca=[((y-1>=0)?x[w[0]]:0),((y-1>=1)?x[w[1]]-1:0),((y-1>=2)?x[w[2]]:1),((y-1>=3)?x[w[3]]:0),((y-1>=4)?x[w[4]]:0)];ca[y]=ba.value;if(y===v.PERIODS.indexOf('month'))ca[y]=ca[y]-1;var da=q(ca),ea=[((y-1>=0)?x[w[0]]:9001),((y-1>=1)?x[w[1]]-1:11),((y-1>=2)?x[w[2]]:this._daysInCurrentMonth()),((y-1>=3)?x[w[3]]:23),((y-1>=4)?x[w[4]]:59)];ea[y]=ba.value;if(y===v.PERIODS.indexOf('month')){ea[y]--;ea[y+1]=this._daysInMonth(ea[0],ea[1]);}var fa=q(ea),ga=(da>this._maxtime),ha=(fa<this._mintime),ia=(y===v.PERIODS.indexOf('day')&&ba.value>this._daysInCurrentMonth());if(ha||ga||ia){if(ba.selected){ba.selected=false;this._resetMenu(y);}k.remove(ba);if(ga||ia){this._savedPeriodsBack[y].push(ba);}else this._savedPeriodsFront[y].push(ba);}else aa++;}}};v.getInstance=function(w){"use strict";return w?j.get(w,'datepicker'):null;};n(v,{PERIODS:['year','month','day','hour','minute']});e.exports=v;},null); __d("PhotosBulkEditablePhoto",["Arbiter","AsyncDialog","AsyncRequest","AsyncResponse","CSS","Dialog","DOM","Event","Focus","Form","Input","Parent","PhotosConst","PlaceUtils","ProgressiveDatepicker","csx","cx","tx"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x){var y=null,z=null,aa=false;function ba(ca,da,ea,fa,ga,ha,ia){"use strict";this._root=ca;this._mentionsTypeahead=da;this._placesTypeahead=ea;this._photoData=fa;this._hasOwnPlaceValue=!!ea.getCore().getHiddenValue();var ja=m.find(ca,'.placesInput'),ka=m.find(ca,'.captionTextarea');this._metadataInputs=m.find(ca,'.metadataInputs');this._editorId=ga;this._published=ha;this._showMove=ia;this._photoDataKey=this._root.id;this._hasTimeTaken=!!this._photoData.timeTaken;this._hasExistingDateValue=this._photoData.isBackdated||this._photoData.hasDerivedDateFromAlbum;this._listeners=[n.listen(ca,'click',this._handleClick.bind(this)),n.listen(ja,'focus',this._placesFocus.bind(this)),n.listen(ka,'focus',this._captionFocus.bind(this)),n.listen(ka,'blur',this._save.bind(this)),n.listen(ca,'submit',function(){return false;})];this._previousSaveData=p.serialize(this._root);var la=m.scry(this._root,'div.backdateInput .periodMenu');for(var ma=0;ma<la.length;ma++){var na=la[ma];this._listeners.push(n.listen(na,'change',this._saveDate.bind(this)));}var oa=m.scry(this._root,"._2sfm").pop();if(oa){this._rotateButtonType=oa.getAttribute('data-btn-type');var pa=oa.getAttribute('data-direction');this._listeners.push(n.listen(oa,'click',this._rotate.bind(this,pa)));}var qa=m.scry(ca,'.photoContextualSelector')[0];if(qa){var ra=m.scry(qa,'.moveAlbum')[0];ra&&this._listeners.push(n.listen(ra,'click',this._move.bind(this)));var sa=m.scry(qa,'.albumCover')[0];sa&&this._listeners.push(n.listen(sa,'click',this._setAlbumCover.bind(this)));var ta=m.scry(qa,'.removePhoto')[0];ta&&this._listeners.push(n.listen(ta,'click',this.remove.bind(this)));}else{var ua=m.find(ca,'.removePhotoButton');this._listeners.push(n.listen(ua,'click',this.remove.bind(this)));}this._placesDataListener=[ea.subscribe(['select','reset','render'],function(va,wa){if(va=='render'){k.addClass(this._root,'focusedInput');return;}if(va=='reset'&&ea.getCore().getHiddenValue())return;if(wa&&wa.selected){y=wa.selected;if(z==y.text){aa=true;}else{z=y.text;aa=false;}}else{y=null;z=null;aa=false;}this._hasOwnPlaceValue=va=='select';k.conditionClass(m.find(ca,'.placeIcon'),'hasPlace',this._hasOwnPlaceValue);k.removeClass(this._root,'focusedInput');this._save();}.bind(this))];this._placesInputBlurListener=ea.getCore().subscribe('blur',function(va,wa){k.removeClass(this._root,'focusedInput');}.bind(this));g.inform(this.mapEventNameToNamespace('PhotosBulkEditablePhoto.INITIALIZED'),this,g.BEHAVIOR_PERSISTENT);}ba.prototype.getPhotoDataKey=function(){"use strict";return this._photoDataKey;};ba.prototype.getPhotoData=function(){"use strict";return this._photoData;};ba.prototype.getRoot=function(){"use strict";return this._root;};ba.prototype.getRotateButtonType=function(){"use strict";return this._rotateButtonType;};ba.prototype.swapData=function(ca,da){"use strict";var ea=this._mentionsTypeahead.getData(),fa=this._placesTypeahead.getData();if(ea!==ca)this._mentionsTypeahead.swapData(ca);if(fa!==da){var ga=this._placesTypeahead.getCore().getValue(),ha=this._placesTypeahead.getCore().getHiddenValue();this._placesTypeahead.swapData(da);if(this.hasOwnPlaceValue())this._placesTypeahead.getCore().select({text:ga,uid:ha});}};ba.prototype.hasOwnPlaceValue=function(){"use strict";return this._hasOwnPlaceValue;};ba.prototype.setAlbumPlace=function(ca){"use strict";this._hasOwnPlaceValue=false;var da=this._placesTypeahead.getCore();k.conditionClass(m.find(this._root,'.placeIcon'),'hasPlace',!!ca);if(ca){da.select(ca);this._save();}else da.reset();};ba.prototype.addPlaceSelectHandler=function(ca){"use strict";this._placesDataListener.push(this._placesTypeahead.subscribe('select',ca));};ba.prototype.mapEventNameToNamespace=function(ca){"use strict";return ca+(this._editorId?'/'+this._editorId:'');};ba.prototype.setDate=function(ca){"use strict";if(this._hasExistingDateValue)return;var da=!ca,ea=ca;if(da){if(!this._hasTimeTaken)return;ea=Math.round(this._photoData.timeTaken/600)*600*1000;}var fa=m.find(this.getRoot(),'.uiProgressiveDatepicker'),ga=u.getInstance(fa);ga.setDateWithTimestamp(ea);if(da){k.conditionClass(m.find(this._root,'.dateIcon'),'hasDate',da);this._saveDate();}};ba.prototype._doRemove=function(){"use strict";m.remove(this._root);this._unsubscribeAll();g.inform(this.mapEventNameToNamespace('PhotosBulkEditablePhoto.REMOVED'),this);};ba.prototype._unsubscribeAll=function(){"use strict";this._listeners.forEach(function(ca){ca.remove();});this._listeners=[];this._placesDataListener.forEach(function(ca){this._placesTypeahead.unsubscribe(ca);}.bind(this));this._placesTypeahead.getCore().unsubscribe(this._placesInputBlurListener);};ba.prototype._handleClick=function(ca){"use strict";var da=ca.getTarget();if(r.byClass(da,'confirmPhotoBackdate')){this._saveDate();return;}if(!r.byClass(da,'metaIcon'))return;k.addClass(this._root,'showControls');if(r.byClass(da,'placeIcon')){this._showMetadataInput('place');o.set(this._placesTypeahead.getCore().getElement());}else if(r.byClass(da,'dateIcon')){this._showMetadataInput('date');}else if(r.byClass(da,'peopleIcon')){this._showMetadataInput('people');}else k.removeClass(this._root,'showControls');};ba.prototype.hideMetadataInputs=function(){"use strict";this._showMetadataInput();};ba.prototype._showMetadataInput=function(ca){"use strict";['people','date','place'].forEach(function(da){k.conditionClass(this._metadataInputs,da,ca==da);}.bind(this));};ba.prototype._captionFocus=function(ca){"use strict";this.hideMetadataInputs();k.addClass(this._root,'focusedInput');};ba.prototype.remove=function(){"use strict";var ca={fbid:this._photoData.fbid,version:s.BULK_EDITOR,confirmed:true};new l().setTitle("Delete Photo").setBody("Are you sure you want to delete this photo?").setButtons(l.OK_AND_CANCEL).setModal(true).setHandler(function(){k.addClass(this._root,'editablePhotoWillBeRemoved');new i().setURI('/ajax/photos/photo/delete/dialog.php').setData(ca).setHandler(function(da){if(da.getPayload().success){this._doRemove();}else k.removeClass(this._root,'editablePhotoWillBeRemoved');}.bind(this)).setErrorHandler(function(da){k.removeClass(this._root,'editablePhotoWillBeRemoved');j.defaultErrorHandler(da);}.bind(this)).send();}.bind(this)).show();};ba.prototype._setAlbumCover=function(){"use strict";var ca={aid:this._photoData.aid,albumFBID:this._photoData.albumFBID,fbid:this._photoData.fbid,owner:this._photoData.owner,pid:this._photoData.pid},da=new i().setURI('/ajax/photos/album/setcover/').setData(ca).setAllowCrossPageTransition(false);h.send(da);};ba.prototype._move=function(){"use strict";var ca={aid:this._photoData.aid,albumFBID:this._photoData.albumFBID,datakey:this._photoDataKey,fbid:this._photoData.fbid,owner:this._photoData.owner,pid:this._photoData.pid},da=new i().setURI('/ajax/photos/photo/move/dialog.php').setData(ca).setAllowCrossPageTransition(false);h.send(da);};ba.prototype._timeclose=function(ca,da){"use strict";ca=ca||0;da=da||0;return Math.abs(ca-da)<43200;};ba.prototype._placesFocus=function(ca){"use strict";k.addClass(this._root,'focusedInput');var da=m.scry(this._root,'input.latitude')[0],ea=m.scry(this._root,'input.longitude')[0],fa=m.scry(this._root,'input.takentime')[0],ga=fa?q.getValue(fa):null,ha=this._placesTypeahead.getData(),ia=ha.getBootstrapData(),ja={};if(da&&ea){ja={latitude:q.getValue(da),longitude:q.getValue(ea),proximity_boost:'true',city_id:null,search_time:ga};ha.setQueryData(ja,false);if(!t.placesClose(ia.latitude,ia.longitude,ja.latitude,ja.longitude)||!this._timeclose(ia.search_time,ja.search_time))ha.setBootstrapData(ja,false).setBootstrapEndpoint(ha.getQueryEndpoint());}else{ja={latitude:null,longitude:null,proximity_boost:null,city_id:null,search_time:ga};if(y)if(y.city_id){ja.city_id=y.city_id;}else if(y.latitude&&y.longitude){ja.latitude=y.latitude;ja.longitude=y.longitude;}ha.setQueryData(ja,false);if(!aa){ha.setBootstrapData(ja).resetBootstrapEndpoint(true);}else if(!t.placesClose(ia.latitude,ia.longitude,ja.latitude,ja.longitude)||!this._timeclose(ia.search_time,ja.search_time))ha.setBootstrapData(ja,false).resetBootstrapEndpoint();}};ba.prototype._saveDate=function(){"use strict";var ca=m.find(this._root,'div.backdateInput'),da=p.serialize(ca);da.source=this.source;da.fbid=this._photoData.fbid;da.version=s.BULK_EDITOR;k.addClass(ca,'backdating');new i().setURI('/ajax/photos/photo/backdate/').setData(da).setRelativeTo(this._root).send();};ba.prototype._save=function(){"use strict";var ca=p.serialize(this._root);if(this._previousSaveData){var da=false;for(var ea in ca){if(ea!=='caption'&&ea!=='location'&&ea!=='location_data')continue;if(ca[ea]!==this._previousSaveData[ea]){da=true;this._previousSaveData[ea]=ca[ea];}}if(!da)return;}ca.source=this.source;ca.bulk=!this._hasOwnPlaceValue;k.removeClass(this._root,'focusedInput');new i().setURI('/ajax/photos/metadata/save/').setData(ca).setAllowCrossPageTransition(true).send();};ba.prototype._setLoadingIndicator=function(ca){"use strict";k.conditionClass(this._root,"_2sfl",ca);};ba.prototype._rotate=function(ca){"use strict";var da={fbid:this._photoData.fbid,cs_ver:s.BULK_EDITOR,editor_id:this._editorId,published:this._published,showMove:this._showMove};da[ca]=1;this._setLoadingIndicator(true);new i('/ajax/photos/photo/rotate/').setData(da).setHandler(function(ea){m.replace(this._root,ea.getPayload());this._unsubscribeAll();g.inform(this.mapEventNameToNamespace('PhotosBulkEditablePhoto.ROTATED'),this);}.bind(this)).setFinallyHandler(function(){this._setLoadingIndicator(false);}.bind(this)).setMethod('POST').send();return false;};e.exports=ba;},null); __d("PhotosBulkEditablePhotoPlaceholder",["CSS","DOM","Event","csx","mixInEventEmitter"],function(a,b,c,d,e,f,g,h,i,j,k){function l(m,n,o){"use strict";this._root=m;this._progressBar=n;this._uploadID=o;this._initAndGetGatedButton("._3273",'cancelButtonClicked');this._retryButton=this._initAndGetGatedButton("._3p03",'retryButtonClicked');this._errorOkayButton=this._initAndGetGatedButton("._8qx",'dismissPlaceholder');this._errorCloseButton=this._initAndGetGatedButton("._8qy",'dismissPlaceholder');}l.prototype._initAndGetGatedButton=function(m,n){"use strict";var o=h.scry(this._root,m);if(o.length){o=o[0];i.listen(o,'click',function(){return this.emit(n,this._uploadID);}.bind(this));return o;}};l.prototype.getProgressBar=function(){"use strict";return this._progressBar;};l.prototype.getRoot=function(){"use strict";return this._root;};l.prototype.setStatus=function(m){"use strict";var n=h.find(this._root,'.editablePhotoPlaceholderStatus');h.setContent(n,m);};l.prototype.hide=function(){"use strict";g.hide(this._root);};l.prototype.show=function(){"use strict";g.show(this._root);};l.prototype.showRetryButton=function(){"use strict";this._retryButton&&g.show(this._retryButton);};l.prototype.showErrorOkayButton=function(){"use strict";this._errorOkayButton&&g.show(this._errorOkayButton);};l.prototype.showErrorCloseButton=function(){"use strict";this._errorCloseButton&&g.show(this._errorCloseButton);};k(l,{cancelButtonClicked:true,retryButtonClicked:true,dismissPlaceholder:true});e.exports=l;},null); __d("PhotosBulkEditor",["Arbiter","AsyncRequest","CSS","DOM","Event","PageTransitions","Parent","PhotosConst","SortableGroup"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){function p(q,r,s,t,u,v,w,x){"use strict";this.source=q;if(!r)return;this._root=r;this._id=r.getAttribute('id');this._photos={};this._tagger=null;this._isNamespaced=x;this._placeholder=u;this._waitingTemplate=v;this._mentionsData=s;this._placesData=t;this._albumPlace=null;this._userDate=null;this._useDateFromFile=false;this._albumCoverListeners={};this._albumCoverTracksFirstPhoto=(this.source===n.FLASH_UPLOADER);this._coverPhotoSortingID=null;if(w.canReorder)this._initSorting(w.autosaveReorder);var y=this._setPlace.bind(this),z=[g.subscribe(this.mapEventNameToNamespace('PhotosBulkEditablePhoto.INITIALIZED'),this._registerPhoto.bind(this)),g.subscribe([this.mapEventNameToNamespace('PhotosBulkEditablePhoto.REMOVED'),this.mapEventNameToNamespace('PhotosBulkEditablePhoto.ROTATED')],function(aa,ba){if(this._sortableGroup){var ca=ba.getPhotoData().fbid;this._sortableGroup.removeSortable(ca);}delete this._photos[ba.getPhotoDataKey()];}.bind(this)),g.subscribe('PhotosBulkEditor.AUTO_ORDER',this._autoOrder.bind(this)),g.subscribe('PhotosBulkBackdateEditor.SAVED',function(aa,ba){this._useDateFromFile=ba.useDateFromFile;this._userDate=ba.backdatedDate;this._setDate();}.bind(this)),g.subscribe('PhotoAlbumPlacesTypeahead.SELECTED_PLACE',y),g.subscribe('PhotoAlbumPlacesTypeahead.EXIST_PLACE',y),g.subscribe('PhotoAlbumPlacesTypeahead.RESET_PLACE',y),g.subscribe('PhotosBulkEditablePhoto.MOVED',function(aa,ba){if(this.getPhotoData(ba))this._photos[ba]._doRemove();}.bind(this))];k.listen(this._root,'click',function(aa){g.inform('BulkEditor.CLICK',aa);var ba=m.byClass(aa.getTarget(),'editablePhoto'),ca=this._photos;j.scry(this._root,'.showControls').forEach(function(da){if(ba!==da){i.removeClass(da,'showControls');ca[da.id].hideMetadataInputs();}});}.bind(this));l.registerHandler(function(){z.forEach(function(aa){aa.unsubscribe();});if(this._tagger)this._tagger.done();}.bind(this));this._autoOrderIncreasing=true;}p.prototype.init=function(q,r,s,t,u,v){"use strict";p.call(this,this.source,q,r,s,t,u,v);};p.prototype.getRoot=function(){"use strict";return this._root;};p.prototype.getSourceString=function(){"use strict";if(this.source===n.BULK_EDITOR){return 'bulk_editor';}else if(this.source===n.FLASH_UPLOADER){return 'flash_uploader';}else return null;};p.prototype.isNamespaced=function(){"use strict";return this._isNamespaced;};p.prototype.getVersionConst=function(){"use strict";return this.source;};p.prototype.getViewerSource=function(){"use strict";return null;};p.prototype.getViewerSet=function(){"use strict";return null;};p.prototype.registerTagger=function(q){"use strict";this._tagger=q;};p.prototype.needTaggingData=function(){"use strict";return this._tagger&&this._tagger.needTaggingData();};p.prototype.getPhotoData=function(q){"use strict";var r=this._photos[q];if(r)return r.getPhotoData();return {};};p.prototype.getPlaceholder=function(){"use strict";return this._placeholder;};p.prototype.getBackdateInput=function(){"use strict";return j.scry(this._root,'div.backdateInput').pop();};p.prototype.getWaitingTemplate=function(){"use strict";return this._waitingTemplate;};p.prototype.addFaceboxes=function(q){"use strict";this._tagger&&this._tagger.addFaceboxes(q);};p.prototype.mapEventNameToNamespace=function(q){"use strict";return q+(this._isNamespaced?'/'+this._id:'');};p.prototype._registerPhoto=function(event,q){"use strict";this._photos[q.getPhotoDataKey()]=q;q.source=this.source;var r=q.getPhotoData(),s=r.fbid;if(this._sortableGroup)this._sortableGroup.addSortable(s,q.getRoot());q.swapData(this._mentionsData,this._placesData);if(this._sortableGroup)q.addPlaceSelectHandler(function(){this._sortableGroup.killDrag(s);}.bind(this));if(this._albumPlace&&!q.hasOwnPlaceValue())q.setAlbumPlace(this._albumPlace);if(this._sortableGroup&&this._albumCoverTracksFirstPhoto)this._coverPhotoSortingID=this._sortableGroup.getOrder()[0];};p.prototype._initSorting=function(q){"use strict";this._sortableGroup=new o().setDropCallback(function(r,s){var t=this._photos[s.id].getPhotoData(),u={order:this._sortableGroup.getOrder(),owner:t.owner};if(q){var v;if(t.set){u.set=t.set;v='/ajax/photos/sets/static/reorder.php';}else{u.album_fbid=t.albumFBID;v='/ajax/photos/reorder.php';}new h(v).setData(u).send();}if(this._sortableGroup&&this._albumCoverTracksFirstPhoto&&this._coverPhotoSortingID!==u.order[0]){var w=this._photos[this._sortableGroup.sortables[u.order[0]].id];if(w)this._makeAlbumCover(w);this._coverPhotoSortingID=u.order[0];}}.bind(this)).setBeforeGrabCallback(function(){g.inform(this.mapEventNameToNamespace('PhotosBulkEditor.PHOTO_REORDER_START'));}.bind(this));};p.prototype._compare=function(q,r,s){"use strict";if(s)return q.timeTaken<r.timeTaken;return q.timeTaken>r.timeTaken;};p.prototype._autoOrder=function(){"use strict";var q=this._sortableGroup.getOrder().map(function(w){return this._photos['editablePhoto_'+w].getPhotoData();}.bind(this));for(var r=0;r<q.length;r++){var s=r;for(var t=r+1;t<q.length;t++)if(this._compare(q[t],q[r],this._autoOrderIncreasing))s=t;if(r!==s){var u=q[s].fbid,v=q[r].fbid;this._sortableGroup.dragOverHandler(v,u);this._sortableGroup.dropHandler(u);q.splice(r,0,q.splice(s,1)[0]);}}this._autoOrderIncreasing=!this._autoOrderIncreasing;};p.prototype._setPlace=function(event,q){"use strict";this._albumPlace=q||null;var r;for(var s in this._photos){r=this._photos[s];r.hasOwnPlaceValue()||r.setAlbumPlace(this._albumPlace);}};p.prototype._setDate=function(){"use strict";var q='',r=null,s;for(var t in this._photos){s=this._photos[t];if(!this._useDateFromFile){q=this._userDate.month+'/'+this._userDate.day+'/'+this._userDate.year;r=new Date(q).getTime();}s.setDate(r);}};p.prototype._showAlbumCoverSet=function(q){"use strict";if(this._albumCover)i.removeClass(this._albumCover,"checked");var r=j.find(q.getRoot(),'.albumCover');i.addClass(r,"checked");this._albumCover=r;};p.prototype._makeAlbumCover=function(q){"use strict";new h().setURI('/ajax/photos/album/setcover').setData(q.getPhotoData()).send();};p.prototype.getOrder=function(){"use strict";if(this._sortableGroup){return this._sortableGroup.getOrder();}else return [];};p.prototype.hasOrder=function(){"use strict";return !!this._sortableGroup;};e.exports=p;},null); __d("PhotosBulkHeader",["Arbiter","AsyncRequest","DOM","Event","Form","Run","areJSONRepresentationsEqual","goURI","tx"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){function p(q,r,s,t){"use strict";this._form=q;this._isAlbum=r;this._editable=s;this._audience=t;this._backdatedTime=null;this._initialData=null;g.subscribe('PhotosBulkBackdateEditor.SAVED',function(u,v){if(!i.contains(this._form.getRoot(),v.context))return;this._backdatedTime=v.backdatedDate;}.bind(this));l.onBeforeUnload(function(){if(this.isDataDirty())return "Some of your changes have not been saved. Would you like to save your changes now?";return false;}.bind(this));this._initialData=this.getSerializedData();}p.prototype.getSerializedData=function(){"use strict";var q=k.serialize(this._form.getRoot());if(this._backdatedTime)q.backTime=this._backdatedTime;return q;};p.prototype.isDataDirty=function(){"use strict";return !m(this._initialData,this.getSerializedData());};p.prototype.save=function(q){"use strict";if(!this._editable)return q.call();if(this._audience&&this._audience.removeHiddenPrivacyWidget)this._audience.removeHiddenPrivacyWidget();var r=this._isAlbum?'/ajax/photos/album/edit':'/ajax/photos/sets/edit',s=k.serialize(this._form.getRoot());if(this._backdatedTime)s.backdated_time=this._backdatedTime;new h(r).setData(s).setMethod('POST').setHandler(function(){this._initialData=this.getSerializedData();q();}.bind(this)).send();};p.doneButtonSaveHandler=function(q,r,s){"use strict";var t=q.save.bind(q,function(){n(r);return true;});q._listeners=[j.listen(s,'click',t)];};e.exports=p;},null);