/*!CK:18328741!*//*1403688549,*/ if (self.CavalryLogger) { CavalryLogger.start_js(["mgs9l"]); } __d("NodeHighlighter",["concatMap","createArrayFrom","escapeRegex","TokenizeUtil","DOM"],function(a,b,c,d,e,f,g,h,i,j,k){var l={};function m(p,q){var r=k.getText(p).split(q),s=r.map(function(t){if(q.test(t))return n(t);return t||'';});return r.length>1?s:null;}function n(p){var q=k.create('span',{'class':'highlightNode',className:'highlightNode'},p);return q;}var o={getTextNodes:function(p){if(this.isLeafNode(p)||this.isStopNode(p)){return p;}else if(this.isDiscardNode(p))return [];return g(this.getTextNodes.bind(this),h(p.childNodes));},getHighlightCandidates:function(){return [];},isLeafNode:function(p){return k.isTextNode(p);},isStopNode:function(p){return false;},isDiscardNode:function(p){return false;},createSegmentedRegex:function(p){var q=j.getPunctuation();p=this.escapeAndAddBidirectionalCharsToTokens(p);return '(^|\\s|'+q+')('+p.join('|')+')(?=(?:$|\\s|'+q+'))';},createNonSegmentedRegex:function(p){return '('+p.map(i).join('|')+')';},escapeAndAddBidirectionalCharsToTokens:function(p){var q='[\\u200E\\u200F\\u202A\\u202B\\u202C\\u202D\\u202E]*';return p.map(function(r){return q+String(r).split('').map(i).join(q)+q;});},createRegex:function(p){p=p.filter(function(w){return w;});if(!p||p.length===0)return new RegExp(null);var q=p.join('|');if(l[q])return l[q];var r=/[\u0E00-\u109F\u2000-\uFFFF]/,s=[],t=[];p.forEach(function(w){if(r.test(w)){t.push(w);}else s.push(w);});var u='';if(s.length){u+=this.createSegmentedRegex(s);u+=(t.length)?'|':'';}if(t.length)u+=this.createNonSegmentedRegex(t);var v=new RegExp(u,'i');l[q]=v;return v;},searchNodes:function(p,q){return k.scry(p,q);},highlight:function(p,q){q=q.filter(function(t){return t;});if(!q||q.length===0||!p)return;var r=g(function(t){return g(this.getTextNodes.bind(this),this.searchNodes(p,t));}.bind(this),this.getHighlightCandidates()),s=this.createRegex(q);r.forEach(function(t){var u=m(t,s);if(u)if(this.isStopNode(t)){k.setContent(t,u);}else k.replace(t,u);}.bind(this));}};e.exports=o;},null); __d("BrowseFacebarHighlighter",["copyProperties","CSS","csx","NodeHighlighter"],function(a,b,c,d,e,f,g,h,i,j){var k={};g(k,j,{getHighlightCandidates:function(){return ["._53ad"];},isDiscardNode:function(l){return h.hasClass(l,'DefaultText');},createSegmentedRegex:function(l){l=this.escapeAndAddBidirectionalCharsToTokens(l);return '(^|\\s|\\b)('+l.join('|')+')';}});e.exports=k;},null); __d("BrowseLogger",["Banzai","copyProperties","mapObject","Run"],function(a,b,c,d,e,f,g,h,i,j){var k='browse',l='browse_aggr',m=null,n={},o={},p=function(x){if(x==null)return 'undefined';var y=x.tagName.toLowerCase(),z=x.id,aa=x.className;if(z)y+='#'+z;if(aa)y+='.'+aa;return y;};function q(){m=null;n={};o={};}function r(x){h(x,{clientSessionID:m});return x;}function s(x){g.post(k,r(x));}function t(){if(m===null)return;o.aggregated=n;g.post(l,r(o));q();}function u(x){n[x]=(n[x]||0)+1;}function v(x){h(o,x);}j.onUnload(t);var w={newSession:function(){t();m=Math.random().toString();if(!o.start_time)o.start_time=Math.round(Date.now()/1000);},logResultClick:function(x,y,z,aa){var ba={action:'result_click',click_type:x.ct||'result',section:x.section||'unknown',id:x.id||0,path:x.path||'unknown',rank:x.rank||0,referrer:x.referrer||'unknown',result_type:x.result_type||'unknown',session_id:x.session_id||0,query_time:x.query_time,abtest_version:x.abtest_version||'NONE',abtest_params:x.abtest_params,typeahead_sid:x.typeahead_sid||'',result_title:x.result_title||'unknown',result_href:x.result_href||'unknown',result_semantic:x.result_semantic||'unknown',type:x.experience_type||'unknown',click_action:z,sub_id:x.sub_id,owner_id:x.owner_id,browse_location:x.browse_location||'unknown',query_data:x.query_data||'unknown',is_headline:x.is_headline||false};if(y.tn)ba.tn=y.tn;if(x.cst)ba.click_subtype=x.cst;u('result_click_'+ba.click_type);v({path:ba.path,referrer:ba.referrer,result_type:ba.result_type,session_id:ba.session_id,abtest_version:ba.abtest_version,abtest_params:ba.abtest_params,typeahead_sid:ba.typeahead_sid});s(ba);if(!x.id)s({action:'logging_error',click_action:z,click_type:ba.click_type,attributes:JSON.stringify(x),element:i({srcElement:aa.srcElement,target:aa.target,toElement:aa.toElement},p),event:{button:aa.button,clientX:aa.clientX,clientY:aa.clientY,ctrlKey:aa.ctrlKey,layerX:aa.layerX,layerY:aa.layerY,offsetX:aa.offsetX,offsetY:aa.offsetY,pageX:aa.pageX,pageY:aa.pageY,screenX:aa.screenX,screenY:aa.screenY,shiftKey:aa.shiftKey,type:aa.type,x:aa.x,y:aa.y}});},logControlsClick:function(x,y){var z={action:'controls_click',click_type:y,path:x.path||'unknown',referrer:x.referrer||'unknown',session_id:x.session_id||0,query_time:x.query_time,filter_name:x.name||'unknown',typeahead_sid:x.typeahead_sid||'',result_type:x.result_type||'unknown',type:x.experience_type||'unknown'};if(x.cst)z.click_subtype=x.cst;u('controls_click_'+y);v({path:z.path,referrer:z.referrer,session_id:z.session_id,typeahead_sid:z.typeahead_sid});s(z);},logResultHover:function(x,y){var z={action:'result_hover',id:x.id||0,path:x.path||'unknown',rank:x.rank,result_type:x.result_type||'unknown',session_id:x.session_id||0,query_time:x.query_time,time_elapsed:y,typeahead_sid:x.typeahead_sid||0,type:x.experience_type||'unknown'};u('result_hover');v({path:z.path,session_id:z.session_id,typeahead_sid:z.typeahead_sid});s(z);},logScroll:function(x,y,z,aa){var ba={action:'scroll',encoded_query:x,fragments:y,position:z,session_id:aa||0};s(ba);},logNUXStep:function(x){var y={action:'nux_step',step:x};s(y);},logDisambiguationImpression:function(x,y,z,aa,ba){var ca={action:'disambiguation_imp',ids:aa,name:x,path:z,type:y,typeahead_sid:ba};s(ca);},logDisambiguationClick:function(x,y,z,aa,ba,ca){var da={action:'disambiguation_clk',id:ba,index:aa,name:x,path:z,type:y,typeahead_sid:ca};s(da);}};e.exports=w;},null); __d("StaticContainer.react",["React","onlyChild"],function(a,b,c,d,e,f,g,h){var i=g.createClass({displayName:'StaticContainer',shouldComponentUpdate:function(j){return !!j.shouldUpdate;},render:function(){return h(this.props.children);}});e.exports=i;},null); __d("TypeaheadFacepileX.react",["React"],function(a,b,c,d,e,f,g){var h=g.createClass({displayName:'TypeaheadFacepile',renderPic:function(i,j){return (g.DOM.span({className:'splitpic '+j},g.DOM.img({alt:"",src:i})));},renderPics:function(){var i=this.props.photos,j=this.props.size;if(j>=3){return [this.renderPic(i[0],'leftpic'),this.renderPic(i[1],'toppic'),this.renderPic(i[2],'bottompic')];}else return [this.renderPic(i[0],'leftpic'),this.renderPic(i[1],'')];},render:function(){return this.transferPropsTo(g.DOM.span({className:"splitpics clearfix"},this.renderPics()));}});e.exports=h;},null); __d("clip",[],function(a,b,c,d,e,f){function g(h,i,j){return Math.min(Math.max(h,i),j);}e.exports=g;},null); __d("FacebarSemanticQuery",["CurrentUser","URI","copyProperties"],function(a,b,c,d,e,f,g,h,i){var j='str',k=/\*[\w\-]+\(/g;function l(v){var w={me:g.getID()};return i(w,v.semantic_map);}function m(v,w){var x=l(v);if(typeof x[w]!=='undefined')return String(x[w]);return w;}function n(v){return new h("/profile.php").addQueryData({id:v});}function o(v,w){var x=[w],y=[],z=v.browse_functions,aa=v.search_path;while(x.length>0){var ba=x.pop();if(!r(ba)){y.push(ba);continue;}var ca=ba.substring(0,ba.indexOf('(')),da=ca,ea=s(ba);if(!z[ca]){y=[];break;}var fa=z[ca].minNumParams,ga=z[ca].maxNumParams;if(x.length>0)if(z[ca].numParamsUnbounded){if(y.length>0)ca+='-'+ea.length;}else if((ea.length!=1&&ea.length>fa)||(ea.length===0&&fa!=ga))ca+='-'+ea.length;x.push(ca);for(var ha=0;ha<ea.length;ha++){if(ea[ha].length===0)continue;if(z[da].allowsFreeText){x.push(j+'/'+encodeURIComponent(encodeURIComponent(ea[ha])));}else x.push(ea[ha]);}}return h(aa+y.join('/'));}function p(v){return v.replace(/['"\[\]]/g,'');}function q(v,w){var x=JSON.parse(w),y=[];if(x.length>0)y=[x[0]];var z=[],aa=v.browse_functions,ba=v.search_path;while(y.length>0){var ca=y.pop();if(typeof(ca)!=='object'){z.push(p(ca));continue;}var da=Object.keys(ca)[0],ea=da,fa=ca[da];if(!aa[da]){z=[];break;}var ga=aa[da].minNumParams,ha=aa[da].maxNumParams;if(y.length>0)if(aa[da].numParamsUnbounded){if(z.length>0)da+='-'+fa.length;}else if((fa.length!=1&&fa.length>ga)||(fa.length===0&&ga!=ha))da+='-'+fa.length;y.push(da);for(var ia=0;ia<fa.length;ia++){if(fa[ia].length===0)continue;if(aa[ea].allowsFreeText){y.push(j+'/'+encodeURIComponent(fa[ia]));}else y.push(fa[ia]);}}return h(ba+z.join('/'));}function r(v){return (/^[a-z\-]+\(.*\)$/).test(v);}function s(v){if(!r(v)&&v.indexOf('param_')!==0)return [v];var w=v.substring(v.indexOf('(')+1,v.length-1);if(w.length===0)return [];return t(w);}function t(v){var w=[],x=0,y=0;for(var z=0;z<v.length;++z)if(v[z]==','&&y===0){w.push(v.substring(x,z));x=z+1;}else if(v[z]=='('){y++;}else if(v[z]==')')y--;w.push(v.substring(x,v.length));return w;}function u(v,w,x){"use strict";this.facebarConfig=v;this.unmapped=(w||"").trim();this.mapped=m(v,this.unmapped);this.position=null;this.$FacebarSemanticQuery0=typeof x!=='undefined'?x:false;}u.prototype.isEntity=function(){"use strict";return (/^\d+$/).test(this.mapped);};u.prototype.isShortcut=function(){"use strict";return this.mapped.indexOf('shortcut(')===0;};u.prototype.isImplemented=function(){"use strict";return this.mapped&&!this.mapped.match(k);};u.prototype.isSemanticForest=function(){"use strict";return this.$FacebarSemanticQuery0;};u.prototype.getUnimplemented=function(){"use strict";return (this.mapped.match(k)||[]).map(function(v){return v.substr(1,v.length-2);});};u.prototype.getURI=function(){"use strict";if(this.isEntity()){return n(this.mapped);}else if(this.isShortcut()){return new h(this.mapped.substr(9,this.mapped.length-10));}else if(this.isSemanticForest()){return q(this.facebarConfig,this.unmapped);}else return o(this.facebarConfig,this.unmapped);};e.exports=u;},null); __d("FacebarURI",["FacebarJSConstants","FacebarSemanticQuery","URI","WWWBase"],function(a,b,c,d,e,f,g,h,i,j){var k={event:{ref:g.eventLinkRef},user:{fref:'ts'}},l={getSearchRawPrefix:function(){return 'search';},getSearchPath:function(){return '/'+this.getSearchRawPrefix()+'/';},getURI:function(m,n){var o=null,p=!n.song&&!n.isExtendedResult&&n.path;if(p){o=new i(p);if(n.type in k)o.addQueryData(k[n.type]);}else{var q=new h(m,n.semantic);if(q&&q.isImplemented())o=q.getURI();}return o&&l.getQualifiedURI(o);},getQualifiedURI:function(m){var n=new i(m);if(!n.getDomain()){var o=i(j.uri);n.setProtocol(o.getProtocol()).setDomain(o.getDomain()).setPort(o.getPort());}return n;}};e.exports=l;},null); __d("FacebarKeywordSearchUtils",["FacebarURI","FacebarStructuredText","KeywordsSearchResultConfig","URI","startsWith"],function(a,b,c,d,e,f,g,h,i,j,k){var l=function(n){var o=0;while(o<n.length)if(n[o].exactMatchKeyword){n.splice(o,1);}else ++o;},m={addExactMatch:function(n,o,p){if(!o.length)return;var q,r;for(var s=0,t=o.length;s<t;s++){r=o[s];if(r.type==='grammar')continue;q=true;break;}if(!q)return;var u=this.getExactMatchKeywordResult(n);if(!u)return;var v=Math.min(o.length,p),w=v;for(s=0;s<v;s++){r=o[s];if(r.exactMatchKeyword)return;if(r.cost>i.default_cost)--w;if(r.type!==i.result_type)continue;u.backendCost=r.cost+i.exact_match_cost_delta_from_best;u.cost=r.backendCost;l(o);o.splice(s,0,u);return;}l(o);o.splice(Math.min(Math.min(v,p-1),w),0,u);},getExactMatchKeywordResult:function(n){if(!n||n.is_empty||!n.raw_text)return;var o=n.raw_text.toLowerCase().replace(/\s{2,}/g,' ').trim(),p=i.query_prefix_blacklist;for(var q=0;q<p.length;q++)if(k(o,p[q]))return;var r=this.makeFacebarEntry(o);return this._makeFacebarResult(r,n.cache_id.length);},makeFacebarEntry:function(n){var o=null,p=null;if(i.gsv2_results_page){p='str/'+n+'/'+i.gsv2_browse_edge;}else{o=g.getQualifiedURI(j(i.results_page_url).addQueryData('q',n));p=i.shortcut+'('+o.toString()+')';}return {semantic:p,text:n,type:i.result_type,resultsSetType:i.result_set_type,uid:i.uid_prefix+n,iconClass:i.icon_class,uri:o,structure:new h()};},_makeFacebarResult:function(n,o){var p={semantic:n.semantic,structure:[{type:'grammar',text:n.text,uid:n.semantic}],type:n.type,resultsSetType:n.resultsSetType,cost:i.default_cost,cache_id_length:o,parse:{display:[{type:'grammar',uid:i.uid_prefix+n.text}],remTokens:[],suffix:''},iconClass:n.iconClass,exactMatchKeyword:true};p.tuid=JSON.stringify({semantic:p.semantic,structure:p.structure});return p;}};e.exports=m;},null); __d("FacebarSemanticUtils",[],function(a,b,c,d,e,f){var g={_semanticForestConversionSub:function(h){var i=[],j=arguments.callee;h.forEach(function(k){if(typeof k==='string'){i.push(k);return;}var l=null;for(var m in k)l=m;if(!l)return;var n=l+'('+j(k[l])+')';i.push(n);});return i.join(',');},semanticForestConversion:function(h){if(!h)return '';var i=JSON.parse(h);return this._semanticForestConversionSub(i);},isEntity:function(h){if(!h)return false;return (/^\d+$/).test(h);}};e.exports=g;},null); __d("FacebarResultStore",["copyProperties","concatMap","FacebarGlobalOptions","FacebarJSConstants","FacebarKeywordSearchUtils","FacebarResultStoreUtils","FacebarSemanticUtils","FacebarStructuredText","KeywordsSearchResultConfig","TokenizeUtil","UnicodeMatch"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){function r(s,t,u,v){"use strict";this.facebarConfig=s;this.facebarConfig.grammar_stop_words_penalty=this.facebarConfig.grammar_stop_words_penalty||2;this.facebarConfig.grammar_stop_words=this.facebarConfig.grammar_stop_words||{};this.facebarConfig.options=v;this.tokenize=t;this.getEntry=u;this.typeaheadTypeMap=this.facebarConfig.mapped_types;this.facebarConfig.typeahead_types.forEach(function(w){this.typeaheadTypeMap[w]=w;},this);this.unicodeMatch=new q({prefix_hangul_conjoining_jamo:true});this.resetCaches();}r.prototype.transformStructured=function(s){"use strict";var t=[],u=[],v='',w='';s.forEach(function(z,aa){if(z.isType('text')){v+=z.getText();w=(w==null)?null:w+z.getText();}else{var ba=v.match(/\"/g);if(ba&&ba.length%2)v=v.replace(/\s+$/,'')+'"';if(v.length){Array.prototype.push.apply(t,this.tokenize(v));u.push(v);v='';}t.push(z.toStruct());u.push({uid:String(z.getUID()),type:this._getFBObjectType(z.getTypePart(1)),text:z.getText()});w=null;}},this);if(v.length){if(v[v.length-1]=='\'')v=v.substr(0,v.length-1);Array.prototype.push.apply(t,this.tokenize(v));u.push(v);if(v[v.length-1]==' ')t.push('');}var x=JSON.stringify(u),y=x.replace(/\]$/,'').replace(/\"$/,'');y=y.replace(/\s{2,}/g,' ');return {tokens:t,text_form:x,is_empty:!!x.match(/^\[(\"\s*\")?\]$/),raw_text:w,cache_id:y};};r.prototype.resetCaches=function(){"use strict";this.bootstrapCache={};this.queryCache={'':{tokens:[],results:[]}};};r.prototype.setNullState=function(s){"use strict";this.facebarConfig.null_state=s.map(this._extractStructure,this);};r.prototype.addEntryToNullState=function(s){"use strict";if(this.facebarConfig.null_state){var t=this.facebarConfig.entity_cost+s.grammar_costs['{'+s.type+'}'],u=l.processEntityResult(s.type,s.uid,s.text,t);this.facebarConfig.null_state.unshift(u);}};r.prototype.setSortFunction=function(s){"use strict";this._sortFunction=s;};r.prototype.addBootstrap=function(s){"use strict";var t=this.bootstrapCache;s.forEach(function(u){var v=this.getEntry(u);v.bootstrapped=true;var w=this.tokenize(v.textToIndex,true);if(v.tokens)Array.prototype.push.apply(w,v.tokens.split(' '));Array.prototype.push.apply(w,this.getExtraTokensToIndex(v));w.forEach(function(x){if(!t.hasOwnProperty(x))t[x]={};t[x][u]=true;});},this);};r.prototype.getExtraTokensToIndex=function(s){"use strict";var t=[];if(s.alias!=null)t.push(s.alias.toLowerCase());return t;};r.prototype.addNullStateToQueryCache=function(s,t){"use strict";this.saveResults(this.facebarConfig.null_state,s,true);if(i.includeInitialTypeNamedX)this.saveResults(t,s,true);};r.prototype.extendResult=function(s,t){"use strict";var u=s.cache_id.substr(t.cache_id_length);if((u.indexOf("\"")>=0||t.tokens.length===0)&&!t.isTypeNamedXBootstrap)return null;var v;if(!!t.isTypeNamedXBootstrap){if(s.raw_text!==null){v=t.ext_text+u;}else if(s.tokens.length!==0&&s.tokens[0].text){v=s.tokens[0].text;}else return null;}else if(t.tokens[t.tokens.length-1].length!==0){v=t.ext_text+u;}else v=t.ext_text+" "+u;if(v.length===0)return null;t.ext_node.text=v;t.parse.entTokens=[v];t.parse.suffix="";this._extractStructure(t);if(!this._punctRegexp)this._punctRegexp=new RegExp(p.getPunctuation(),'g');t.semantic=t.ext_semantic.replace('(ext_string)','('+v.replace(this._punctRegexp,"")+')');t.isExtendedResult=true;return t;};r.prototype.getResults=function(s,t){"use strict";if(s.tokens.length===0||(s.tokens.length==1&&s.tokens[0]===''))return {results:this.facebarConfig.null_state||[],null_state:true};var u=this._getBestQueryCache(s.cache_id),v=u.results,w={},x=this._getBootstrapMatchByType(s.tokens,w),y=this._addMatchingBootstrapResults(s,x[0]||{});Array.prototype.push.apply(y,h(this._getResultsFromCache.bind(this,x,s),v));var z={},aa=[],ba=false,ca=0;y.sort(this._sortFunction);if(i.keywordSearchEnabled)k.addExactMatch(s,y,t);y.forEach(function(da){var ea=n.fromStruct(da.structure);if(ea.hasType('blank')){aa.push(da);return;}da.semantic=da.semantic.toLowerCase();if(!da.termMatches)da.termMatches=w[da.semantic];var fa=r.getUniqueSemantic(da.semantic),ga=r.getUniqueSemantic(da.alternateSemantic);if(!fa)return;var ha=z[fa]||(ga&&z[ga]);if(ha){if(da.isJSBootstrapMatch){ha.isJSBootstrapMatch=true;ha.bootstrapCost=da.bootstrapCost;}else if(ha.isJSBootstrapMatch&&da.backendCost!==undefined&&ha.backendCost===undefined)ha.backendCost=da.backendCost;if(!!da.tags)g(ha.tags,da.tags);return;}if(ba&&da.blankFilled)return;if(da.type.indexOf('browse_type')>=0){ca+=1;if(this.facebarConfig.maxGrammarResults!==undefined&&ca>this.facebarConfig.maxGrammarResults)return;}ba=ba||!!da.blankFilled;z[fa]=da;if(ga)z[ga]=da;aa.push(da);},this);return {results:aa,webSuggOnTop:u.webSuggOnTop,webSuggLimit:u.webSuggLimit,webSuggLimitSeeMore:u.webSuggLimitSeeMore};};r.prototype.saveResults=function(s,t,u,v,w){"use strict";s=s.map(this._processBackendResult,this);var x=[],y={},z={};s.forEach(function(ba){z[ba.semantic]=true;ba.parse&&ba.parse.disambiguation&&ba.parse.disambiguation.forEach(function(ca){var da=m.semanticForestConversion(ca);y[da]=true;});});var aa=this._getBestQueryCache(t.cache_id);aa.results.forEach(function(ba){if(ba.type==='websuggestion')return;if(ba.exactMatchKeyword)return;if(ba.isExtendedResult)return;if(ba.semantic in y)return;var ca=this._getDifferenceArrayTokens(ba.tokens,t.tokens),da=this._getNumTokensMatching(ca,ba);da=this._tryMatchingFinalInsertedEntity(ca,da,ba);if(da>0&&da==ca.length){ba.cacheOnlyResult=!z[ba.semantic];x.push(ba);}},this);s.forEach(function(ba){ba.tokens=t.tokens;ba.cache_id_length=t.cache_id.length;if(!!ba.isTypeNamedXBootstrap)++ba.cache_id_length;x.push(ba);},this);if(w)Array.prototype.push.apply(x,w);if(this.queryCache[t.cache_id]===undefined)this.queryCache[t.cache_id]={};g(this.queryCache[t.cache_id],{tokens:t.tokens,results:x,incomplete:u});g(this.queryCache[t.cache_id],v);};r.prototype.alreadyKnown=function(s){"use strict";return !!this.queryCache[s]&&!this.queryCache[s].incomplete;};r.prototype.stripBrackets=function(s){"use strict";return s.replace(/^[\[\{]/,'').replace(/[\]\}]$/,'');};r.prototype._extractStructure=function(s){"use strict";function t(w,x,y){return {type:w==='ent:extend_string'?'text':w,text:x,uid:y||null};}function u(w,x){w.split(' ').forEach(function(y){if(y!==''){if(x)s.chunks.push(s.structure.length);s.structure.push(t('text',y));}s.structure.push(t('text',' '));});s.structure.pop();}function v(w){if(s.structure.length!==0||j.nonGrammarTypes[s.type])return w;return w.charAt(0).toUpperCase()+w.substr(1);}s.structure=[];s.chunks=[];s.parse.display.forEach(function(w){if(typeof w==='string'){u(v(w),true);}else if(w.type==='ent:extend_string'){u(w.text,true);}else if(w.uid){var x=this.getEntry(w.uid,w.fetchType);s.chunks.push(s.structure.length);if(x==null)throw new Error('No entry found for uid \"'+w.uid+'\", type \"'+w.fetchType+'\" and piece text \"'+w.text+'\"');if(x.grammar_like){u(v(x.text),false);}else{var y=w.type;if(w.fetchType)y+=':'+w.fetchType;s.structure.push(t(y,x.text,w.uid));}}else if(w.type=='blank'){s.chunks.push(s.structure.length);s.structure.push(t(w.type,'...'));}},this);return s;};r.prototype._getDifferenceArrayTokens=function(s,t){"use strict";if(!s.length)return [''].concat(t);var u=s.length-1,v=s[u];if(v==='')v=s[--u];var w='';if(typeof(v)=='string'&&u<t.length)w=t[u].substr(v.length);if(w===''&&u+1<t.length&&t[u+1]==='')return [''];return [w].concat(t.slice(u+1));};r.prototype._processBackendResult=function(s){"use strict";if(s.isTypeNamedXBootstrap&&s.cache_id_length)return s;s.semantic=s.semantic.toString();s.backendCost=s.cost;this._extractStructure(s);if(s.type.match(/^\{.*\}$/))s.useExtendedIndex=true;if(s.alternateSemantic)s.alternateSemantic=s.alternateSemantic.toLowerCase().replace(/\[(\d*)\]/g,'$1');if(s.parse.extendable){var t=null;s.parse.display.forEach(function(z){if(z.type!=="ent:extend_string")return;t=z;},this);if(!t||s.semantic.match(/\[.*\]/).length!==1){s.parse.extendable=false;}else{s.ext_node=t;s.ext_semantic=s.semantic.replace(/\[(.*)\]/g,'ext_string');s.ext_text=t.text;}}if(s.semantic.match(/\[\d*\]/)){var u=s.parse,v=u.pos;if(v===undefined){s.semantic=s.semantic.replace(/\[(\d*)\]/g,'$1');}else{var w=u.remTokens[u.remTokens.length-1];if(u.remTokens.length&&s.structure[s.chunks[w]]&&s.structure[s.chunks[w]].uid){v=u.remTokens[u.remTokens.length-1];s.completed=true;}var x=s.structure[s.chunks[v]].uid;if(x===null){s.semantic=s.semantic.replace(/\[(\d*)\]/g,'$1');}else{var y=new RegExp('\\['+x+'\\]','g');s.unsubstituted_semantic=s.semantic;s.semantic=s.semantic.replace(y,x);if(u&&u.disambiguation&&u.disambiguation.length>0){u.disambiguation=u.disambiguation.filter(function(z){return z.indexOf('['+x+']')!==-1;});u.unsubstituted_disambiguation=u.disambiguation.splice(0);u.disambiguation=u.disambiguation.map(function(z){return z.replace(y,x);});}}}}s.semantic=s.semantic.replace(/\[(.*)\]/g,'$1');s.tuid=JSON.stringify({semantic:s.semantic,structure:s.structure});return s;};r.prototype._sortFunction=function(s,t){"use strict";return (s.cost||0)-(t.cost||0);};r.prototype._getResultsFromCache=function(s,t,u){"use strict";var v=t.tokens,w=this._getDifferenceArrayTokens(u.tokens,v),x=[],y=this._getNumTokensMatching(w,u),z=this._tryMatchingFinalInsertedEntity(w,y,u);if(u.parse.extendable||u.isExtendedResult){var aa=this.extendResult(t,u);if(aa)x.push(aa);if(u.isExtendedResult)return x;}if(z>0&&z==w.length&&!(u.type===o.result_type&&w.length===1&&w[0]==='"'))x.push(u);return x;};r.prototype._addMatchingBootstrapResults=function(s,t){"use strict";var u=s.tokens;return h(function(v){var w=t[v];if(w===undefined)return [];var x=[];w.forEach(function(y){var z=this.getEntry(y,v);if(!this._isTitleTermMatch(u,z)&&!this._isAliasMatch(s.raw_text,z))return;var aa=(this._isExactNameMatch(u,z)||this._isAliasMatch(s.raw_text,z))?0:this.facebarConfig.non_title_term_match_penalty,ba=this._isNonGrammarTermMatch(u,z),ca=z.grammar_costs['{'+v+'}']+aa+this.facebarConfig.entity_cost+this.facebarConfig.grammar_stop_words_penalty*!ba,da=l.processEntityResult(v,y,z.text,ca);da.bootstrapCost=ca;da.isJSBootstrapMatch=true;x.push(da);},this);return x;}.bind(this),this.facebarConfig.bootstrap_types);};r.prototype._isTitleTermMatch=function(s,t){"use strict";var u=s[0]||{};if(typeof(u)=='object')return false;var v=t.titleToIndex;return s.length===1?this._isTokenizePrefixMatch(u,v):p.isExactMatch(u,v);};r.prototype._isExactNameMatch=function(s,t){"use strict";var u=s[0]||{};if(typeof(u)=='object')return false;var v=t.text;for(var w=0;w<s.length-1;++w)if(s[w]!==''&&!p.isExactMatch(s[w],v))return false;return s.length>0&&this._isTokenizePrefixMatch(s[s.length-1],v);};r.prototype._isAliasMatch=function(s,t){"use strict";return (t.alias!=null&&s!=null&&p.isExactMatch(t.alias,s));};r.prototype._isNonGrammarTermMatch=function(s,t){"use strict";var u=p.parse(t.titleToIndex.toLowerCase()),v=u.tokens.filter(function(y){return y!==''&&!this.facebarConfig.grammar_stop_words[y];},this);v=v.join(' ');for(var w=0;w<s.length;++w){if(typeof(s[w])=='object')return true;var x=w===s.length-1?this._isTokenizePrefixMatch(s[w],v):p.isQueryMatch(s[w],v);if(x)return true;}return false;};r.prototype._getBootstrapMatchByType=function(s,t){"use strict";if(s.length===0)return [];var u=s.map(function(){return {};}),v=(s[s.length-1]===''),w={},x,y=(v?s.length-1:s.length),z=s[y-1];if(y&&z.uid){this._pushBootstrapEntryAtPosition(u,y-1,z.uid);return u;}for(var aa in this.bootstrapCache)if(y&&this.unicodeMatch.prefixMatch(aa,z)&&(!v||aa===z))for(x in this.bootstrapCache[aa])if(!w[x]){w[x]=1;this._addMatchedTerm(x,aa,t);this._pushBootstrapEntryAtPosition(u,y-1,x);}for(var ba=y-2;ba>=0;ba--){if(typeof(s[ba])=='object')break;if(s[ba].length&&s[ba][0]=='"')break;for(x in this.bootstrapCache[s[ba]]){if(!w[x])w[x]=0;if(w[x]+ba==y-1){++w[x];this._addMatchedTerm(x,s[ba],t);this._pushBootstrapEntryAtPosition(u,ba,x);}}}return u;};r.prototype._addMatchedTerm=function(s,t,u){"use strict";(u[s]=u[s]||[]).push(t);return u;};r.prototype._pushBootstrapEntryAtPosition=function(s,t,u){"use strict";var v=this.getEntry(u);if(!v)return;for(var w in v.grammar_costs){var x=this.stripBrackets(w);if(s[t][x]===undefined)s[t][x]=[];s[t][x].push(u);}};r.prototype._getNumTokensMatching=function(s,t){"use strict";var u=0,v=t.parse,w=s.length,x=null,y=null;if(v.pos!==undefined){var z=t.structure[t.chunks[v.pos]];if(z){x=z.uid;y=z.type.split(':')[2];}}t.outputTokensUsed=[];t.termMatches=[];if(x){u=this._prefixMatchEntity(s,v,x,t.outputTokensUsed,y,!!t.useExtendedIndex,t.termMatches);if(u===0||u===w)return u;}else if(v.suffix&&w==1&&v.suffix.indexOf(s[0])===0){return w;}else if(v.suffix==s[0]){++u;}else return 0;var aa=[];v.remTokens=v.remTokens||[];for(var ba=0;ba<v.remTokens.length;ba++){if(typeof(s[u])!='string'||t.chunks.length<=v.remTokens[ba]||t.structure.length<=t.chunks[v.remTokens[ba]]||t.structure[t.chunks[v.remTokens[ba]]].uid)break;var ca=t.structure[t.chunks[v.remTokens[ba]]].text;aa.push(ca.toLowerCase());}u=this._greedyMatchText(aa,s,u,v.remTokens,t.outputTokensUsed,t.isNullState);if(u==w-1&&s[u]==='')return w;return u;};r.prototype._prefixMatchEntity=function(s,t,u,v,w,x,y){"use strict";t.entTokens=t.entTokens||[];if(t.entTokens.length===0){if(s[0]!=='')return 0;if(t.possessive&&s.length>1&&s[1]=='\'s'){v.push([t.pos+1]);return 2;}else return 1;}var z=false,aa=this.getEntry(u,w);if(typeof(w)!=='undefined'&&w!==aa.fetchType)return 0;var ba=this.tokenize(x?aa.textToIndex:aa.text,true),ca=[];for(var da=0;da<s.length+t.entTokens.length-1;da++)if(da<t.entTokens.length-1){ca.push(t.entTokens[da]);}else if(da==t.entTokens.length-1){ca.push(t.entTokens[da]+s[0]);}else ca.push(s[da-t.entTokens.length+1]);var ea=-t.entTokens.length+1;for(var fa=0;fa<ca.length;++fa){var ga=ca[fa];if(typeof(ga)!='string')break;if(ga===''){ea++;continue;}var ha=false;for(var ia=0;ia<ba.length;ia++)if(ba[ia]==ga||(fa===ca.length-1&&ba[ia].indexOf(ga)===0)){if(y)y.push(ba[ia]);ba[ia]='';ha=true;++ea;break;}if(ha)continue;if(!t.possessive||ga.length<=2||ga.substr(ga.length-2)!='\'s')break;var ja=ga.substr(0,ga.length-2);for(ia=0;ia<ba.length;ia++)if(ba[ia]==ja){++ea;if(v)z=true;break;}break;}if(ea>0){if(z)v.push([t.pos+1]);return ea;}if(v===undefined)return 0;var ka=s[0],la=ka;if(t.possessive&&ka.length>=2&&ka.substr(ka.length-2)=='\'s')la=ka.substr(0,ka.length-2);t.suffix=t.suffix||'';if((s.length==1&&t.suffix.indexOf(ka)===0)||t.suffix==la||t.suffix==ka){if(la!=ka&&t.suffix==la)v.push([t.pos+1]);return 1;}return 0;};r.prototype._tryMatchingFinalInsertedEntity=function(s,t,u){"use strict";if(!u.completed||t<0)return t;var v=u.parse,w=v.remTokens[v.remTokens.length-1],x=u.structure[u.chunks[w]],y=this.getEntry(x.uid,x.type),z=this.tokenize(y.text,true);t=this._greedyMatchText(z,s,t);if(t==s.length-1&&s[t]==='')return s.length;return t;};r.prototype._greedyMatchText=function(s,t,u,v,w,x){"use strict";for(var y=0;y<s.length;y++){var z=s[y];if(z==t[u]){if(w!==undefined)w.push(v[y]);++u;continue;}if(u===t.length-1&&z.indexOf(t[u])===0){if(w!==undefined)if(z==t[u]){w.push([v[y]]);}else w.push([v[y],t[u].length]);return t.length;}if(x)break;}return u;};r.prototype._getBestQueryCache=function(s){"use strict";for(var t=s.length;t>=0;t--){var u=this.queryCache[s.slice(0,t)];if(u)return u;}};r.prototype._getFBObjectType=function(s){"use strict";if(this.typeaheadTypeMap[s]){return this.typeaheadTypeMap[s];}else return 'page';};r.prototype._isTokenizePrefixMatch=function(s,t){"use strict";return p.isPrefixMatch(this.unicodeMatch.prefixMatchPrepare(s),this.unicodeMatch.prefixMatchPrepare(t));};r.EPSILON=1e-05;r.getUniqueSemantic=function(s){if(!s)return;var t=[],u=[],v=[];s='('+s+')';var w=s,x=false;s.replace(/[\(\),]/g,function(y,z){var aa;switch(y){case ',':var ba=v.length-1;aa=w.substr(v[ba],z-v[ba]);t[ba].push(aa);v[ba]=z+1;break;case '(':v.push(z+1);t.push([]);u.push(z+1);break;case ')':if(v.length===0)throw s+' is not a valid semantic string';var ca=v.pop();aa=w.substr(ca,z-ca);aa=decodeURI(aa.replace(/%/g,'%25').replace(/\s/g,'+').trim());var da=t.pop();da.push(aa);var ea=da.sort();for(var fa=1;fa<ea.length;fa++)if(ea[fa]==ea[fa-1])x=true;var ga=ea.join(',');w=w.substr(0,u.pop())+ga+w.substr(z);break;}return y;});if(x)return '';return w.replace(/\((.*)\)/,'$1');};e.exports=r;},null); __d("FacebarTimerUtils",[],function(a,b,c,d,e,f){var g={getTimestamp:function(){return Date.now();}};e.exports=g;},null); __d("FacebarTokenizer",["TokenizeUtil"],function(a,b,c,d,e,f,g){var h="[^\"]",i=["\\s's","'s","\""+h+"*\"?"],j=[[/\s+$/,''],[/\"\s+/,'"'],[/\s+\"/,'"'],[/\"\"/,''],[/^\"$/,''],[/\s+/,' ']],k={tokenize:function(l,m){var n=[],o=0;l=l.replace(/\s/g,' ').toLowerCase();l.replace(new RegExp(i.join('|'),'g'),function(q,r){if(r>o){var s=l.substr(o,r-o);Array.prototype.push.apply(n,g.parse(s).tokens.slice(0));}var t=q;for(var u=0;u<j.length;u++){var v=j[u];t=t.replace(v[0],v[1]);}if(n.length&&t=='\'s'){n[n.length-1]+=t;}else if(t!=='')n.push(t);if(m)Array.prototype.push.apply(n,g.parse(q).tokens);o=r+q.length;});if(o<l.length){var p=l.substr(o,l.length-o);Array.prototype.push.apply(n,g.parse(p).tokens.slice(0));}return n;}};e.exports=k;},null); __d("FacebarTypeaheadTypeNamedX",[],function(a,b,c,d,e,f){var g={browse_type_user:'user',browse_type_page:'page',browse_type_place:'place',browse_type_group:'group',browse_type_application:'app'},h=1,i=2;function j(){"use strict";}j.addTypeNamedX=function(k,l,m,n){"use strict";var o=new j(),p=[],q=[];k.forEach(function(v){delete v.tags.hiddenSeeMore;if(v.isSeeMore){p.push(v);}else q.push(v);});if(!n.showTypeNamedX){p.forEach(function(v){v.tags.hiddenSeeMore=true;});return q;}var r=o.buildTypeNamedXBuckets(q,p,m,n),s=r[0],t=r[1];s.forEach(function(v){v.tags.displayedSeeMore=true;});var u=o.replaceResults(q,l,s);Array.prototype.push.apply(u,t);u.forEach(function(v){v.tags.hiddenSeeMore=true;});return q;};j.prototype.buildTypeNamedXBuckets=function(k,l,m,n){"use strict";var o={};n=n||{};k.forEach(function(s,t){var u=s.render_type||s.type;if(o[u]===undefined)o[u]={index:t,matchCount:0};if(!n.alwaysDisplayTypeNamedX&&s.text.toLowerCase().indexOf(m.toLowerCase())<0)return;o[u].matchCount++;});var p=[],q=[];l.forEach(function(s){var t=g[s.results_set_type];if(o[t]!==undefined&&o[t].matchCount>=h){p.push([s,o[t].index]);}else q.push(s);});p.sort(function(s,t){return s[1]-t[1];});var r=p.map(function(s){return s[0];});Array.prototype.push.apply(q,r.slice(i));r.length=Math.min(r.length,i);return [r,q];};j.prototype.replaceResults=function(k,l,m){"use strict";var n=[],o=Math.min(0,k.length-l)+m.length;for(var p=0;p<o;++p){var q=-1;for(var r=0;r<Math.min(l-p,k.length);++r){var s=k[r];if(!s.exactMatchKeyword&&s.type!=='websuggestion')q=r;}if(q>=0){n.push(k[q]);k.splice(q,1);}}Array.prototype.unshift.apply(k,m);return n;};e.exports=j;},null); __d("FacebarTypeaheadL2Terms",["FacebarJSConstants"],function(a,b,c,d,e,f,g){var h=3,i={addL2Terms:function(j,k,l,m){if(!m.suggestBackendL2Terms)return j;var n=[],o=[];j.forEach(function(q){if(q.exactMatchKeyword){q.tags.l2_suggestion=true;n.push(q);}else if(q.isKeywordL2){q.tags.l2_suggestion=true;q.type='l2suggestion';n.push(q);}else if(q.type!=='keywords')o.push(q);});var p=0;return o.map(function(q){if(g.entityTypes[q.type])if(p<h){p++;}else if(n.length)return n.pop();return q;});}};e.exports=i;},null); __d("ResultsBucketizer",["copyProperties"],function(a,b,c,d,e,f,g){function h(i,j){"use strict";this.$ResultsBucketizer0=i;this.$ResultsBucketizer1=j;}h.trimResults=function(i,j,k){"use strict";var l=[];i.forEach(function(m,n){if(m.indexBeforeBuckets>j)l.push({index:n,originalIndex:m.indexBeforeBuckets});});l.sort(function(m,n){return m.originalIndex-n.originalIndex;}).slice(k).sort(function(m,n){return n.index-m.index;}).forEach(function(m){i.splice(m.index,1);});};h.mergeBuckets=function(i,j){"use strict";var k=[];for(var l in j)if(!j[l].rule.hidden&&(!j[l].rule.xor||!j[j[l].rule.xor]))k.push(j[l]);k.sort(function(m,n){var o=(m.rule.position||0)-(n.rule.position||0);if(o!==0)return o;return m.results[0].indexBeforeBuckets-n.results[0].indexBeforeBuckets;});i.length=0;k.forEach(function(m,n){if(m.rule.maxPromotions!=null&&n<k.length-1)h.trimResults(m.results,k[n+1].results[0].indexBeforeBuckets,m.rule.maxPromotions);Array.prototype.push.apply(i,m.results);}.bind(this));};h.prototype.$ResultsBucketizer2=function(i,j){"use strict";if(j.propertyName==null)return j.bucketName||'default';var k=this.$ResultsBucketizer1(i,j.propertyName);if(k==null||(j.propertyValue!=null&&(''+k)!==j.propertyValue))return false;return j.bucketName||(j.propertyName+'.'+k);};h.prototype.$ResultsBucketizer3=function(i,j){"use strict";var k={};i.forEach(function(l,m){j.some(function(n){var o=this.$ResultsBucketizer2(l,n);if(o===false)return false;if(k[o]==null)k[o]={results:[],rule:n};if(!!n.maxResults&&k[o].results.length>=n.maxResults)return true;l.bucketLineage.push({bucketName:o,bucketIndex:k[o].results.length});k[o].results.push(l);return true;}.bind(this));}.bind(this));return k;};h.prototype.$ResultsBucketizer4=function(i,j){"use strict";var k=this.$ResultsBucketizer0[j];if(!k)return {};var l=this.$ResultsBucketizer3(i,k);for(var m in l){var n=l[m].rule.subBucketRules;if(!!n)this.$ResultsBucketizer4(l[m].results,n);}h.mergeBuckets(i,l);return l;};h.prototype.$ResultsBucketizer5=function(i,j,k){"use strict";if(j.length<=k)return j.slice();var l=j.map(function(n){return n.indexBeforeBuckets;}),m=l.sort(function(n,o){return n-o;})[k];return j.filter(function(n){return n.indexBeforeBuckets<m;});};h.prototype.bucketize=function(i,j,k){"use strict";i.forEach(function(l,m){l.bucketLineage=[];l.indexBeforeBuckets=m;});k=k||{};g(k,this.$ResultsBucketizer4(i,'main'));return this.$ResultsBucketizer5(k,i,j);};e.exports=h;},null); __d("FacebarDataSource",["Arbiter","AsyncRequest","BingScalingCommon","FacebarGlobalOptions","FacebarJSConstants","FacebarResultStore","FacebarStructuredText","FacebarTimerUtils","FacebarSemanticUtils","FacebarTokenizer","FacebarTypeaheadTypeNamedX","FacebarTypeNamedXBootstrap","FacebarTypeaheadL2Terms","FacebarTypeNamedXTokenOptions","FacebarURI","ResultsBucketizer","ResultsBucketizerConfig","SearchDataSource","Vector","ViewportBounds","copyProperties","throttle","invariant","setTimeoutAcrossTransitions"],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,y,z,aa,ba,ca,da){for(var ea in x)if(x.hasOwnProperty(ea))ga[ea]=x[ea];var fa=x===null?null:x.prototype;ga.prototype=Object.create(fa);ga.prototype.constructor=ga;ga.__superConstructor__=x;function ga(ha){"use strict";x.call(this,ha);this.filterOutWebSuggestion=true;this._fetched_null_state=null;this._initialQueryData=null;this._curQueryId=-1;this._maxRemoteQueryId=-1;this._single_state=true;this._waitingQueries=0;this.mixGrammarAndEntity=ha.mixGrammarAndEntity!==undefined?ha.mixGrammarAndEntity:true;this.grammarVersion=ha.grammarVersion||'';if(!ha.grammarOptions)ha.grammarOptions={};this.recordingRoute=ha.grammarOptions.recordingRoute||'banzai_vital';this._maxGrammarResults=ha.grammarOptions.maxGrammarResults;this.nullStateEndpoint=ha.nullStateEndpoint||'/ajax/browse/null_state.php';this.setNullStateData(ha.nullStateData||{},true);this._minWebSugg=ha.minWebSugg||1;this._minQueryLength=ha.minQueryLength||-1;this.allowWebSuggOnTop=ha.allowWebSuggOnTop||false;this._maxWebSuggToCountFetchMore=ha.maxWebSuggToCountFetchMore||0;this._fixProcessLean=ha.grammarOptions.fixProcessLean||false;this.throttleExecuteQuery();this.throttleSendRemoteQuery();this.throttleRenderResults();this.resultStoreOptions=ha.grammarOptions||{};this.resultStoreOptions.useNewExactNameMatch=(ha.grammarOptions.useNewExactNameMatch==="true");this._bypassBucketizer=false;this._resultsBucketizer=new v(w.rules,function(ia,ja){switch(ja){case 'isSeeMore':return ia.isSeeMore;case 'objectType':return ia.type;case 'resultSetType':return ia.results_set_type;case 'renderType':return ia.render_type||ia.type;case 'cacheOnlyResult':return ia.cacheOnlyResult;case 'closeEntity':return ia.bootstrapped||(!!ia.tags?ia.tags[ja]:undefined);default:return !!ia.tags?ia.tags[ja]:undefined;}});this.fetchNullState();this.initWithConfig(j.grammarConfig);if(j.noTitleInSingleState)g.subscribe('facebar/updateNullStateQuery',this.updateNullStateQuery.bind(this));}ga.prototype.initWithConfig=function(ha){"use strict";this.facebarConfig=ha;this.createResultStore();this.blockees={};if(this._fetched_null_state){this.setNullState(this._fetched_null_state);this._fetched_null_state=null;}};ga.prototype.throttleExecuteQuery=function(){"use strict";var ha=j.executeQueryThrottleTime;this.executeQueryThrottled=ba.withBlocking(this.executeQuery,ha,this);};ga.prototype.throttleSendRemoteQuery=function(){"use strict";var ha=j.sendRemoteQueryThrottleTime;if(ha===0){this.sendRemoteQueryThrottled=this.sendRemoteQuery;return;}if(j.lazyThrottleRemoteQuery){var ia=Date.now(),ja=j.enableSendRemoteQueryDelay,ka=j.sendRemoteQueryDelayTime;this.sendRemoteQueryThrottled=function(){var la=Date.now(),ma=arguments;if(ia+ha<la){ia=la;if(ja){da(function(){this.sendRemoteQuery.apply(this,ma);}.bind(this),ka);}else this.sendRemoteQuery.apply(this,ma);}}.bind(this);return;}this.sendRemoteQueryThrottled=ba.withBlocking(this.sendRemoteQuery,ha,this);};ga.prototype.throttleRenderResults=function(){"use strict";var ha=j.renderThrottleTime;if(ha===0){this.renderResultsThrottled=this.renderResults;return;}var ia=Date.now();this.renderResultsThrottled=function(ja,ka,la,ma){var na=Date.now();if(la||ia+ha<na){ia=na;this.renderResults(ja,ka,la,ma);}}.bind(this);};ga.prototype.createResultStore=function(){"use strict";this.facebarConfig.maxGrammarResults=this._maxGrammarResults;this.resultStore=new l(this.facebarConfig,p.tokenize,this.getEntry.bind(this),this.resultStoreOptions);if(this._fixProcessLean)this._processLean();this.subscribe('setSortFunction',function(ha,ia){this.resultStore.setSortFunction(ia);}.bind(this));};ga.prototype.dirty=function(){"use strict";this._nullStateFetched=false;this.resultStore.resetCaches();fa.dirty.call(this);};ga.prototype.addEntries=function(ha){"use strict";this.resultStore.addBootstrap(this.processEntries(ha));};ga.prototype._processLean=function(){"use strict";if(this._fixProcessLean){if(this._leanPayload&&this.resultStore){var ha,ia=this._leanPayload.entries;for(var ja in ia){ha=this.getEntry(ja);if(!ha)continue;for(var ka in ia[ja]){if(!ha.grammar_costs)ha.grammar_costs={};ha.grammar_costs['{'+ka+'}']=ia[ja][ka];}}this.setExclusions(this._leanPayload.blocked);this._leanPayload=null;}}else fa._processLean.call(this);};ga.prototype._parseResultsForNullState=function(ha){"use strict";ha.forEach(function(ia){if(!ia.parse)ia.parse={};ia.parse.entTokens=ia.parse.entTokens||[];ia.parse.remTokens=ia.parse.remTokens||[];ia.parse.suffix=ia.parse.suffix||'';if(o.isEntity(ia.semantic))ia=this._buildCommonEntityFields(ia);}.bind(this));return ha;};ga.prototype.setNullStateData=function(ha,ia){"use strict";if(ia)this.nullStateData={grammar_version:this.grammarVersion};aa(this.nullStateData,ha);return this;};ga.prototype.setNullState=function(ha){"use strict";this._null_state=ha;this.processEntries(this._null_state.entities);var ia=this._null_state.queries;if(this._null_state.results)ia=this._parseResultsForNullState(this._null_state.results);this.resultStore.setNullState(ia);var ja=r.typeNamedX;ja.forEach(function(ka){ka.parse.extendable=true;ka.qid=this._curQueryId;ka.isTypeNamedXBootstrap=true;},this);this.resultStore.addNullStateToQueryCache(this.getRawStructure(m.fromString('')),ja);this._typeNamedXResults={};ja.forEach(function(ka){this._typeNamedXResults[k.grammarToEntityTypes[ka.resultsSetType]]=ka;},this);};ga.prototype.getNullStateTrending=function(){"use strict";return this._null_state.trending;};ga.prototype.setSingleState=function(ha){"use strict";this._single_state=ha;};ga.prototype.overrideNullState=function(ha){"use strict";ca(this._null_state!=null);this._original_null_state=this._original_null_state||this._null_state;this.setNullState(ha);};ga.prototype.restoreNullState=function(){"use strict";if(this._original_null_state)this.setNullState(this._original_null_state);};ga.prototype.updateNullStateQuery=function(ha,ia){"use strict";this._nullStateFetched=false;this.fetchNullState(ia);};ga.prototype.fetchNullState=function(ha){"use strict";if(this._nullStateFetched||!j.allowGrammar){this.activityStart();setTimeout(this.activityEnd.bind(this),0);return;}var ia=null;if(ha)ia={value:'['+JSON.stringify(ha)+']',grammar_version:this.grammarVersion};var ja=new h().setURI(ha?this.queryEndpoint:this.nullStateEndpoint).setData(ha?ia:this.nullStateData).setMethod('GET').setReadOnly(true).setAllowCrossPageTransition(true).setHandler(function(ka){if(this.resultStore){this.setNullState(ka.payload);this.inform('nullstateReady',true);}else this._fetched_null_state=ka.payload;this._nullStateFetched=true;}.bind(this)).setFinallyHandler(this.activityEnd.bind(this));this.activityStart();ja.send();};ga.prototype.fetchNUXResults=function(ha){"use strict";if(!j.allowGrammar)return;ha=ha||{};var ia=new h().setURI(ha.URI).setData(this.nullStateData).setMethod('GET').setReadOnly(true).setAllowCrossPageTransition(true).setHandler(function(ja){if(this.resultStore){this.overrideNullState(ja.payload);ha.success&&ha.success();}}.bind(this)).setFinallyHandler(this.activityEnd.bind(this));this.activityStart();ia.send();};ga.prototype.toTypeaheadEntryUid=function(ha){"use strict";var ia,ja=m.fromStruct(ha.structure),ka=ja.getFragment(0);if(ja.getCount()==1&&ka.isType('ent')){var la=ka.getType().split(':')[2];ia=this.getEntry(ka.getUID(),la);ia.type=this.resultStore.stripBrackets(ha.type);}else{ia=this.getEntry(ha.tuid);if(!ia){ia={dynamic_cost:ha.dynamic_cost,extra_uri_params:ha.extra_uri_params,icon_class:ha.iconClass,memcache:ha.fromMemcache,photo:ha.photo,results_set_type:ha.resultsSetType,tuid:ha.tuid,type:ha.type,uid:ha.tuid,tags:ha.tags,websuggestion_source:ha.websuggestion_source,is_redirect:ha.isRedirect};this.processEntries([ia]);ia=this.getEntry(ha.tuid);}}if(ia.type==='websuggestion'||ia.is_redirect)ia.path=ha.path;ia.error_info=ha.errorInfo;ia.logInfo=ha.logInfo;ia.structure=ja;ia.text=ia.structure.toString();ia.queryTypeText=ha.queryTypeText;ia.semantic=ha.semantic;ia.alternateSemantic=ha.alternateSemantic;ia.tree=ha.tree;ia.cost=ha.cost;ia.isSeeMore=!!ha.isSeeMore;ia.isNullState=!!ha.isNullState;ia.isSingleState=!!ha.isSingleState;ia.isTrending=!!ha.isTrending;ia.isRecent=!!ha.isRecent;ia.entityInfo=ha.entityInfo;ia.cacheOnlyResult=ha.cacheOnlyResult||false;ia.isExtendedResult=ha.isExtendedResult||false;if(ha.isExtendedResult){ia.uri=u.getURI(this.facebarConfig,ia);}else ia.uri=ia.uri||u.getURI(this.facebarConfig,ia);ia.semanticForest=ha.semanticForest;ia.parse=ha.parse;ia.tags=ha.tags||{};ia.isKeywordL2=ha.isKeywordL2||false;ia.exactMatchKeyword=ha.exactMatchKeyword||false;ia.qid=ha.qid;ia.templateID=ha.templateID;if(ha.isJSBootstrapMatch){ia.isJSBootstrapMatch=ha.isJSBootstrapMatch;ia.backendCost=ha.backendCost;ia.bootstrapCost=ha.bootstrapCost;}this._replaceCategoryWithTermMatches(ia,ha);return ia.tuid;};ga.prototype._replaceCategoryWithTermMatches=function(ha,ia){"use strict";if(ha.type!=="user"||!ha.term_to_subtitle||!ia.termMatches)return;var ja=[];ia.termMatches.forEach(function(la){if(ha.term_to_subtitle[la])ja.push(ha.term_to_subtitle[la]);},this);if(ha.category===undefined)ha.category="";var ka=ha.category.split(" \xB7 ");ka.unshift.apply(ka,ja);ka=ka.filter(function(la,ma,na){return ma==na.indexOf(la);});ha.category=ka.splice(0,2).join(" \xB7 ");};ga.prototype.getRawStructure=function(ha){"use strict";if(typeof ha=='string')ha=m.fromString(ha);if(this.resultStore)return this.resultStore.transformStructured(ha.toArray());};ga.prototype.saveResult=function(ha){"use strict";this._initialQueryData=this.getUID(ha.uid,ha.fetchType);};ga.prototype.buildUids=function(ha){"use strict";if(!ha||!this.resultStore)return [];if(typeof ha==='string')ha=m.fromString(ha);var ia=this.getRawStructure(ha),ja=this.resultStore.getResults(ia,this.getMaxResults()),ka=ja.results;if(typeof ka==='undefined')return [];var la=ja.webSuggOnTop;if(typeof la==='undefined')la=false;var ma=ja.webSuggLimit||0,na=ja.null_state===true,oa=this.filterOutWebSuggestion&&!na,pa=0;ka=ka.filter(function(ua,va){if(!j.allowGrammar&&ua.type=='grammar')return false;if(ua.type!='websuggestion'){return ua.semantic!='<blank>'&&(ua.type!='unimplemented'||pa++===0);}else return !oa;},this);var qa=ka.slice(),ra=[],sa=[],ta=[];ka.forEach(function(ua){if(ua.forcedPosition>0){ta.push(ua);}else if(ua.isSeeMore){ra.push(ua);}else sa.push(ua);});if(na){ka=this.orderNullState(ka,this.getMaxResults());}else if(j.webSuggestionsEnabled){ka=i.integrateWebsuggestions(sa,Boolean(la),this.getMaxResults(),ma,this._minWebSugg);}else ka=sa;this.inform('decorateSeeMoreSuggestions',{structured:ha,allResults:qa,selectedResults:ka,seeMoreResults:ra});if(ta.length>0){ta.sort(function(ua,va){return ua.forcedPosition-va.forcedPosition;});ta.forEach(function(ua){ka.splice(ua.forcedPosition,0,ua);});}if(ra.length>0)ka.push.apply(ka,ra);return ka.map(this.toTypeaheadEntryUid,this);};ga.prototype.orderNullState=function(ha,ia){"use strict";var ja={top:[],bottom:[],middle:[]},ka=function(na){var oa=na.null_state_position;return ja.hasOwnProperty(oa)?oa:'middle';},la=function(na,oa){return na.original_cost-oa.original_cost;};ha&&ha.forEach(function(na){ja[ka(na)].push(na);},this);for(var ma in ja){ja[ma]=ja[ma].sort(la).slice(0,ia);ia-=ja[ma].length;}return [].concat(ja.top,ja.middle,ja.bottom);};ga.prototype.handleResponse=function(ha,ia){"use strict";if(!(ha.payload.errors)){this.processEntries(ha.payload.entities);this.filterOutWebSuggestion=true;for(var ja=0;ja<ha.payload.results.length;ja++)if(ha.payload.results[ja].type=='websuggestion'){this.filterOutWebSuggestion=false;break;}if(ha.payload.blockees)ha.payload.blockees.forEach(function(ma){if(!(this.blockees.hasOwnProperty(ma)))this.blockees[ma.toLocaleLowerCase()]=ma;}.bind(this));ha.payload.results.forEach(function(ma){ma.qid=ha.queryId;if(!ma.parse)ma.parse={};ma.parse.entTokens=ma.parse.entTokens||[];ma.parse.remTokens=ma.parse.remTokens||[];ma.parse.suffix=ma.parse.suffix||'';if(o.isEntity(ma.semantic))ma=this._buildCommonEntityFields(ma,ia.tokens);}.bind(this));var ka={};['webSuggOnTop','webSuggLimit','webSuggLimitSeeMore'].forEach(function(ma){if(ha.payload.hasOwnProperty(ma))ka[ma]=ha.payload[ma];});var la=[];if(ha.payload.seemore&&this._typeNamedXResults)ha.payload.seemore.forEach(function(ma){la.push(this._typeNamedXResults[ma]);},this);this.resultStore.saveResults(ha.payload.results,ia,ha.payload.incomplete,ka,la);}};ga.prototype.processEntries=function(ha){"use strict";return ha.map(function(ia,ja){var ka=(ia.uid=ia.uid+'');ia.textToIndex=this.getTitleTerms(ia);ia.titleToIndex=this.getTitleTerms(ia);ka=this.getUID(ka,ia.fetchType);var la=this.getEntry(ka);if(!la){this.setEntry(ka,{});la=this.getEntry(ka);}else{delete ia.photo;delete ia.category;delete ia.subtext;}aa(la,ia);la.tuid=ka;la.index===undefined&&(la.index=ja);return ka;},this);};ga.prototype.getUID=function(ha,ia){"use strict";ha=ha+'';if(ia!==undefined){ia=/([^:]+:)?([^:]+)(:.*)?/.exec(ia)[2];return JSON.stringify([ha,ia]);}return ha;};ga.prototype.getEntry=function(ha,ia){"use strict";var ja;ha=''+ha;ja=ia!=null?fa.getEntry.call(this,this.getUID(ha,ia))||fa.getEntry.call(this,ha):fa.getEntry.call(this,ha);return ja;};ga.prototype.getEntryForFragment=function(ha){"use strict";return this.getEntry(ha.getUID(),ha.getTypePart(2));};ga.prototype.getMaxResults=function(){"use strict";return this._numResults.max;};ga.prototype.query=function(ha,ia,ja){"use strict";this.executeQueryThrottled(ha,this._initialQueryData,{keyPress:n.getTimestamp()});this._initialQueryData=null;};ga.prototype.executeQuery=function(ha,ia,ja){"use strict";this._curQueryId++;ja.queryId=this._curQueryId;ja.startCacheQuery=n.getTimestamp();var ka=(this.getMaxResults()+t.additionalResultsToFetch);this.setQueryData({qid:this._curQueryId,max_results:ka});this.inform('beforeQuery',{value:ha,queryId:this._curQueryId});this.value=ha;var la=this.buildUids(ha,[]);ja.endCacheQuery=n.getTimestamp();if(ia&&la.length===0)la.push(ia);if(j.sendExistingIDs){var ma=[];la.forEach(function(na){var oa=this.getEntry(na);if(oa&&oa.type in k.entityTypes)ma.push(oa.uid);},this);if(ma.length>0)this.setQueryData({qid:this._curQueryID,existing_ids:JSON.stringify(ma),max_results:ka});}this.inform('query',{value:ha,results:la,queryId:this._curQueryId});if(this.resultStore)this.respond(ha,la,false,false,ja);};ga.prototype.shouldFetchMore=function(ha,ia){"use strict";if(ha.is_empty)return false;if(this.resultStore.alreadyKnown(ha.cache_id))return false;if(ha.raw_text&&this._isQueryTooShort(ha.raw_text))return false;if(j.alwaysFetchMore)return true;if(ia.length<this.getMaxResults())return true;return this.countValidResults(ia)<this.getMaxResults();};ga.prototype.countValidResults=function(ha){"use strict";var ia=0,ja=0;ha.forEach(function(ka){if(ka&&!ka.isNullState&&!ka.isSeeMore)if(ka.type==='websuggestion'){ia++;}else ja++;},this);return ja+Math.min(this._maxWebSuggToCountFetchMore,ia);};ga.prototype.sendRemoteQuery=function(ha,ia,ja){"use strict";var ka=this._single_state,la=new h().setURI(this.queryEndpoint).setData(this.getQueryData(ha.text_form)).setMethod('GET').setReadOnly(true).setAllowCrossPageTransition(true).setHandler(function(ma,na){na.queryId=ma;na.inputQuery=ha.text_form;na.payload.results.forEach(function(oa){oa.isSingleState=ka;});ja.endRemoteQuery=n.getTimestamp();this.inform('response_received',na);this.handleResponse(na,ha);this.respond(ia,[],true,na.payload&&(!na.payload.results||na.payload.results.length===0),ja);this.inform('backend_response',na);}.bind(this,ja.queryId)).setFinallyHandler(this.activityEnd.bind(this));this.inform('sending_request',la);this._maxRemoteQueryId=ja.queryId;ja.waitingQueries=this._waitingQueries;ja.inflightRequests=h.getInflightCount();ja.startRemoteQuery=n.getTimestamp();la.send();this.activityStart();};ga.prototype.activityStart=function(){"use strict";if(!this._waitingQueries)this.inform('activity',{activity:true},g.BEHAVIOR_STATE);this._waitingQueries++;};ga.prototype.activityEnd=function(){"use strict";this._waitingQueries--;if(!this._waitingQueries)this.inform('activity',{activity:false},g.BEHAVIOR_STATE);};ga.prototype._bucketizeResults=function(ha,ia){"use strict";ia=this._tagKeywordsSuggestions(ia);ia=s.addL2Terms(ia,this.getMaxResults(),ha.toString(),j);ia=q.addTypeNamedX(ia,this.getMaxResults(),ha.toString(),j);var ja=Math.min(ia.length,this.getMaxResults());return this._resultsBucketizer.bucketize(ia,ja);};ga.prototype._tagKeywordsSuggestions=function(ha){"use strict";if(!ha||ha.length===0)return ha;var ia=ha[0];if(ia.bootstrapped)return ha;if(ia.type==='grammar'||(ia.cost<j.closeEntityThreshold&&ia.type==='user'))return ha;return ha.map(function(ja){if(ja.type!==k.keywordType)return ja;ja=aa(null,ja);ja.tags.topBucket=true;return ja;});};ga.prototype._buildCommonEntityFields=function(ha,ia){"use strict";if(ha.queryTypeText)return ha;if(j.unbreakParseDisplay){ha.parse.display=[{type:'ent:'+ha.type,uid:ha.semantic}];}else ha.parse.display=[{type:'ent:'+ha.type,uid:parseInt(ha.semantic,10)}];if(ha.parse.fetchType)ha.parse.display[0].fetchType=ha.parse.fetchType;ha.parse.entTokens=ia;ha.parse.pos=0;ha.resultsSetType='{'+ha.type+'}';ha.queryTypeText=k.defaultQueryTypeText;return ha;};ga.prototype.setBypassBucketizer=function(ha){"use strict";this._bypassBucketizer=ha;};ga.prototype.respond=function(ha,ia,ja,ka,la){"use strict";if(ja&&this.value){if(typeof this.value==='string')this.value=m.fromString(this.value);this.inform('remote_query_match',{isMatch:this.value.matches(ha),queryId:la?la.queryId:0});ha=this.value;ia=this.buildUids(ha);}this.inform('reorderResults',ia);this.inform('respondValidUids',ia);var ma=ia.map(this.getEntry,this);if(!ja){var na=this.getRawStructure(ha);if(this.shouldFetchMore(na,ma)){if(la!=null)la.dispatchRemoteQuery=n.getTimestamp();this.sendRemoteQueryThrottled(na,ha,la);}}if(!ja||!la||la.queryId===this._maxRemoteQueryId)this.renderResultsThrottled(ha,ma,ja,ka);if(la!=null)this.logLatencies(ja,la);};ga.prototype.renderResults=function(ha,ia,ja,ka){"use strict";if(!!ha&&(ha instanceof m&&!ha.isEmptyOrWhitespace())&&!this._bypassBucketizer)ia=this._bucketizeResults(ha,ia);ia.length=Math.min(ia.length,this.getMaxResults());ka=ja&&ia.length===0;this.inform('respond',{value:ha,results:ia,isAsync:!!ja,isEmptyResults:ka});};ga.prototype.logLatencies=function(ha,ia){"use strict";var ja=n.getTimestamp();if(ha){this.inform('remote_query_latency',{queryId:ia.queryId,latencies:{queryStart:Math.max(ia.startRemoteQuery-ia.dispatchRemoteQuery,0),queryEnd:Math.max(ia.endRemoteQuery-ia.startRemoteQuery,0),keyPressToQueryDispatch:Math.max(ia.dispatchRemoteQuery-ia.keyPress,0),keyPressToQueryStart:Math.max(ia.startRemoteQuery-ia.keyPress,0),keyPressToQueryEnd:Math.max(ia.endRemoteQuery-ia.keyPress,0),render:Math.max(ja-ia.endRemoteQuery,0),inflightRequests:ia.inflightRequests,waitingQueries:ia.waitingQueries,keyPressToRender:Math.max(ja-ia.keyPress,0)}});}else this.inform('cache_query_latency',{queryId:ia.queryId,latencies:{queryStart:Math.max(ia.startCacheQuery-ia.keyPress,0),queryEnd:Math.max(ia.endCacheQuery-ia.startCacheQuery,0),keyPressToQueryEnd:Math.max(ia.endCacheQuery-ia.keyPress,0),render:Math.max(ja-ia.endCacheQuery,0),keyPressToRender:Math.max(ja-ia.keyPress,0)}});};ga.prototype._updateMaxResults=function(){"use strict";var ha=y.getViewportDimensions().y,ia=z.getTop()||42,ja=56,ka=48;this._maxResults=Math.max(this._numResults.min,Math.min(this._numResults.max,Math.floor((ha-ia-ka-25)/ja)-1));this.value&&this.query(this.value);};ga.prototype.getCurQueryId=function(){"use strict";return this._curQueryId;};ga.prototype.setTypenamedXOption=function(ha){"use strict";j.showTypeNamedX=ha;};aa(ga.prototype,{events:['query','respond','bootstrapped','activity','ready']});e.exports=ga;},null); __d("FacebarTypeaheadDebugPane.react",["Banzai","LeftRight.react","ReactPropTypes","React","Image.react"],function(a,b,c,d,e,f,g,h,i,j,k){var l=j.createClass({displayName:'FacebarTypeaheadDebugPane',propTypes:{result:i.object.isRequired},getInitialState:function(){return {feedbackSent:false};},componentWillReceiveProps:function(m){if(m.result!==this.props.result)this.setState({feedbackSent:false});},sendFeedback:function(m){var n=this.props.result;if(n.decoration.entity===n)n.decoration.entity='';var o=JSON.stringify(n),p=JSON.stringify(n.debug.allResults),q={result:o,query:n.debug.query,position:n.debug.position,sid:n.debug.sid,allResults:p,isOK:m};g.post('facebar_feedback',q,{delay:0});this.setState({feedbackSent:true});this.setState({feedbackOK:m});return false;},renderDebugText:function(m){return j.DOM.div(null,m);},render:function(){var m=this.sendFeedback.bind(this,true),n=this.sendFeedback.bind(this,false),o=this.state.feedbackSent,p=o&&this.state.feedbackOK,q=o&&!this.state.feedbackOK;return (j.DOM.div({className:"fsm pam"},h(null,j.DOM.div(null,this.props.result.debug.map(this.renderDebugText)),j.DOM.div(null,j.DOM.div({className:p?'':'hidden_elem'},j.DOM.strong(null,"Feedback sent"),k({className:"mls",src:'/images/green_up.gif'})),j.DOM.div({className:q?'':'hidden_elem'},j.DOM.strong(null,"Feedback sent"),k({className:"mls",src:'/images/red_down.gif'})),j.DOM.div({className:o?'hidden_elem':''},j.DOM.a({href:"#",onClick:m},k({src:'/images/green_up.gif'})),j.DOM.a({href:"#",onClick:n},k({className:"mls",src:'/images/red_down.gif'})))))));}});e.exports=l;},null); __d("FacebarTypeaheadDiffText.react",["React","ReactPropTypes","cx"],function(a,b,c,d,e,f,g,h,i){var j=g.createClass({displayName:'FacebarTypeaheadDiffText',propTypes:{prefix:h.string,text:h.string},renderDiff:function(k){return (g.DOM.span({className:"diffNode _5td3"},k));},renderParts:function(){var k=this.props.prefix,l=this.props.text;if(k==null)return this.renderDiff(l);var m=l.toLowerCase().indexOf((k.toLowerCase()));k=k.trim();if(m===0)l=l.slice(k.length);var n=l.split(/\b/).map(this.renderDiff);if(m===0)n.unshift(k);return n;},render:function(){return this.transferPropsTo(g.DOM.span(null,this.renderParts()));}});j.generatePrefixes=function(k,l){var m=[],n,o;for(var p=0,q=l.length;p<q;p++){o=l[p].getText();n=k.slice(0,Math.min(k.length,o.length));if(n==='')return m;if(o.toLowerCase().indexOf(n.toLowerCase())===0){m.push(n);k=k.slice(n.length);}else return m;}return m;};e.exports=j;},null); __d("FacebarTypeaheadHighlightedText.react",["BrowseFacebarHighlighter","React","ReactPropTypes"],function(a,b,c,d,e,f,g,h,i){var j=h.createClass({displayName:'FacebarTypeaheadHighlightedText',propTypes:{text:i.string,tokens:i.array},renderHighlight:function(k,l){if((l+1)%3===0){return h.DOM.span({className:"highlightNode"},k);}else if(k)return k;},renderParts:function(){var k=this.props.text,l=this.props.tokens;if(l&&k){var m=g.createRegex(l),n=k.split(m);return n.map(this.renderHighlight);}else return k;},render:function(){return this.transferPropsTo(h.DOM.span(null,this.renderParts()));}});e.exports=j;},null); __d("FacebarTypeaheadItem.react",["Badge.react","ReactPropTypes","React","FacebarGlobalOptions","FacebarTypeaheadDebugPane.react","FacebarTypeaheadDiffText.react","FacebarTypeaheadHighlightedText.react","cx","joinClasses"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){function p(r){var s=r.getTypePart(0);return s?"fragment"+s.charAt(0).toUpperCase()+s.substr(1):"fragment";}var q=i.createClass({displayName:'FacebarTypeaheadItem',propTypes:{result:h.object.isRequired,className:h.string,icon:h.object,token:h.object,highlight:h.array,prefix:h.string,message:h.object,valign:h.bool},getDefaultProps:function(){return {valign:true};},renderHighlightedFragment:function(r){return (m({className:p(r),text:r.getText(),tokens:this.props.highlight}));},renderDiffedFragment:function(r,s){return (l({className:p(r),prefix:s,text:r.getText()}));},renderText:function(){var r=this.props.result.structure.toArray(),s=this.props.prefix;if(j.graphSearchV2&&s!=null&&s.trim()!==''){var t=l.generatePrefixes(s,r);return r.map(function(u,v){return this.renderDiffedFragment(u,t[v]);}.bind(this));}else return r.map(this.renderHighlightedFragment);},renderBadge:function(){if(this.props.result.is_verified)return (g({type:"verified",size:"medium"}));},renderIcon:function(){var r=this.props.result.icon_class;if(r){return (i.DOM.span({className:"_k83"},i.DOM.span({className:r})));}else if(this.props.result.photo)return (i.DOM.img({className:"_20h",alt:"",src:this.props.result.photo}));},renderLabel:function(){var r=(("_53ad")+(this.props.valign&&this.props.token&&this.props.token.props&&this.props.token.props.text.length>0?' '+"_55y-":'')),s=i.DOM.span({className:r},this.renderText(),this.renderBadge(),this.props.token),t=(("_7gk")+(this.props.message?' '+"_5byz":''));return (i.DOM.span({className:t},s,this.props.message));},renderMain:function(){var r=this.props.result.uri;return (i.DOM.a({className:"_205",href:r?r.toString():'#',rel:"ignore"},i.DOM.span({className:"_6i1"},this.props.icon||this.renderIcon(),this.renderLabel())));},renderDebug:function(){return this.props.result.debug?k({result:this.props.result}):null;},render:function(){var r="_202 _5bl2 _6_k";return (i.DOM.li({className:o(r,this.props.className),onClick:this.props.onClick,onMouseEnter:this.props.onMouseEnter,'aria-label':this.props.result.structure.toString(),role:"option"},this.renderMain(),this.renderDebug()));}});e.exports=q;},null); __d("FacebarTypeaheadToken.react",["FacebarTypeaheadHighlightedText.react","ReactPropTypes","React","cx"],function(a,b,c,d,e,f,g,h,i,j){var k=' \u00B7 ',l=i.createClass({displayName:'FacebarTypeaheadToken',propTypes:{text:h.array.isRequired,highlight:h.array,limit:h.number,innerClass:h.string,leadingMiddot:h.bool},render:function(){var m=this.props.text;if(this.props.limit)m.splice(this.props.limit);m.forEach(function(q,r){if(r!==0||this.props.leadingMiddot)m[r]=k+q;}.bind(this));var n=g({tokens:this.props.highlight,text:m.shift()}),o=m.length?g({tokens:this.props.highlight,className:"_53ab",text:m.join('')}):null,p=this.props.innerClass||"_53aa";return (i.DOM.span({className:"_53a9"},i.DOM.span({className:p},n,o)));}});e.exports=l;},null); __d("FacebarTypeaheadTokenText",["DOM","HTML"],function(a,b,c,d,e,f,g,h){var i='\u00B7';function j(n){if(typeof n==='object'){return g.getText(h(n).getRootNode());}else return n||'';}function k(n){return j(n).split(i).map(function(o){return o.trim();});}function l(n){var o={};return n.filter(function(p){var q=!o[p];o[p]=true;return q&&p;});}var m={textForEntity:function(n,o){var p=n.category||o[n.type]||'',q=n.subtext||'',r=k(p).concat(k(q));return l(r);},text:function(n){return l(k(n));}};e.exports=m;},null); __d("FacebarTypeaheadEntityItem.react",["React","FacebarTypeaheadItem.react","FacebarTypeaheadToken.react","FacebarTypeaheadTokenText","TypeaheadFacepileX.react","cx"],function(a,b,c,d,e,f,g,h,i,j,k,l){var m=g.createClass({displayName:'FacebarTypeaheadEntityItem',renderToken:function(){return (i({highlight:this.getHighlightTokens(),text:j.textForEntity(this.props.result,{})}));},renderIcon:function(){if(this.props.result.size>1&&this.props.result.photos){return (k({className:"_51l_",photos:this.props.result.photos,size:this.props.result.size}));}else if(this.props.result.photo)return (g.DOM.img({className:"_20h",alt:"",src:this.props.result.photo}));},getHighlightTokens:function(){if(this.props.result.original_query){var n=this.props.result.original_query.toString().trim(),o=n.split(' '),p=o.length>1?[n].concat(o):[n];return p.filter(function(q){return (q!=='');});}},render:function(){return this.transferPropsTo(h({icon:this.renderIcon(),token:this.renderToken(),highlight:this.getHighlightTokens(),valign:true}));}});e.exports=m;},null); __d("FacebarDisambiguationDialog",["Event","BrowseLogger","CSS","cx","Dialog","DOM","FacebarStructuredText","FacebarTypeaheadEntityItem.react","React","tx"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){var q=650;function r(s,t,u,v,w){"use strict";this._sets=s;this._path=t;this._ondone=u;this._oncancel=v;this._selection=[];this._typeaheadSID=w;}r.prototype.show=function(){"use strict";new k().setTitle("Which of these did you mean?").setBody(this._createBody()).setContentWidth(q).setModal(true).setButtons([k.CONFIRM,k.CANCEL]).setHandler(this._handleDone.bind(this)).setCancelHandler(this._handleCancel.bind(this)).show();this._sets.forEach(function(s){var t=[];s.forEach(function(v){t.push(v.uid);});var u=s[0];h.logDisambiguationImpression(u.text,u.type,this._path,t.join(','),this._typeaheadSID);}.bind(this));};r.prototype._createBody=function(){"use strict";var s=[];this._sets.forEach(function(t,u){s.length&&s.push(l.create('li',{className:"_200"}));t.forEach(function(v){var w=this._createItem(v,u);this._selection[u]||this._selectItem(w);s.push(w.root);}.bind(this));}.bind(this));return l.create('ul',{className:'viewList disambiguationList'},s);};r.prototype._createItem=function(s,t){"use strict";var u={uri:null,subtext:s.subtext,category:s.category,photo:s.photo,type:s.type,structure:m.fromStruct([{text:s.text,type:'ent:'+s.type,uid:s.uid}])},v=l.create('div',{className:"_201"}),w=n({result:u}),x=l.create('div');o.renderComponent(w,x);var y=x.firstChild;i.addClass(y,"_6i3");l.appendContent(y,i.hide(v));var z={setId:t,result:s,root:y,check:v};g.listen(y,'mouseover',this._toggleHover.bind(this,z,true));g.listen(y,'mouseout',this._toggleHover.bind(this,z,false));g.listen(y,'click',function(event){this._selectItem(z);return event.kill();}.bind(this));return z;};r.prototype._toggleHover=function(s,t){"use strict";i.conditionClass(s.root,'selected',t);};r.prototype._toggleCheck=function(s,t){"use strict";i.conditionShow(s.check,t);};r.prototype._selectItem=function(s){"use strict";var t=this._selection[s.setId];this._selection[s.setId]=s;t&&this._toggleCheck(t,false);this._toggleCheck(s,true);};r.prototype._handleDone=function(s){"use strict";this._ondone(s==k.CONFIRM?this._selection.map(function(t){var u=t.result;h.logDisambiguationClick(u.text,u.type,this._path,u.index,u.uid,this._typeaheadSID);return u;}.bind(this)):null);};r.prototype._handleCancel=function(){"use strict";this._oncancel();};e.exports=r;},null); __d("FacebarTypeahead",["Arbiter","Typeahead","copyProperties","emptyFunction","FacebarGlobalOptions","throttle"],function(a,b,c,d,e,f,g,h,i,j,k,l){for(var m in h)if(h.hasOwnProperty(m))o[m]=h[m];var n=h===null?null:h.prototype;o.prototype=Object.create(n);o.prototype.constructor=o;o.__superConstructor__=h;function o(p,q,r,s,t,u){"use strict";h.call(this,p,q,r,s);this.getCore();this.proxyEvents();this.initBehaviors(t||[]);var v=this.core.subscribe('focus',function(){if(u)u.init(this);this.core.unsubscribe(v);this.data.bootstrap(false);this.core.input.focus();if(k.fetchLeanOnFocus){var w=k.fetchLeanOnFocusThrottleTime;this.core.subscribe('focus',l(this.data.fetchLean,w,this.data));}}.bind(this));this.data.bootstrap(true);this.inform('init',this,g.BEHAVIOR_PERSISTENT);g.inform('Facebar/init',this,g.BEHAVIOR_PERSISTENT);}o.prototype.proxyEvents=function(){"use strict";var p,q=[],r=null,s=(function(){while(p=q.shift())this.inform(p[0],p[1]);r=null;}).bind(this);[this.data,this.view,this.core].forEach(function(t){t.subscribe(t.events,function(u,v){q.push([u,v]);r=r||setTimeout(s,0);}.bind(this));},this);};i(o.prototype,{init:j});e.exports=o;},null); __d("StructuredInputDOM",["createArrayFrom","CSS","cx","DOM"],function(a,b,c,d,e,f,g,h,i,j){var k={ENTITY_CLASS:"_586o",encodeText:function(l){return l.replace(/ /g,'\u00a0');},decodeText:function(l){return l.replace(/\u00a0/g,' ');},createIconNode:function(l){if(l&&typeof l=='object'){var m=j.create('i',{className:l.className,style:l.uri&&{backgroundImage:'url("'+l.uri+'")'}});m.setAttribute('data-select','ignore');return m;}},createTextNode:function(l){return j.create('span',{'data-si':true},k.encodeText(l||""));},createEntityNode:function(l,m){var n=k.encodeText(l.text),o=k.createIconNode(m.icon),p=j.create('span',{},o?[o,n]:n),q=(m.className||'').split(/\s+/);q.push(k.ENTITY_CLASS);q.forEach(h.addClass.bind(h,p));var r={si:true,uid:l.uid,type:l.type,text:n,fulltext:n,group:m.group,select:m.select,icon:JSON.stringify(m.icon||null)};for(var s in r)if(r[s]!=null)p.setAttribute('data-'+s,r[s]);return p;},convertToTextNode:function(l){l.className='';l.setAttribute('data-type','text');l.removeAttribute('data-group');l.removeAttribute('data-select');l.removeAttribute('data-icon');l.removeAttribute('data-uid');for(var m=l.firstChild;m;m=m.nextSibling)if(!j.isTextNode(m))j.remove(m);},isEntityNode:function(l){return j.isElementNode(l)&&h.hasClass(l,k.ENTITY_CLASS);},containsOnlyText:function(l,m){m=g(m);for(var n=l.firstChild;n;n=n.nextSibling)if(!(j.isTextNode(n)||l.nodeName in m))return false;return true;},getText:function(l){return j.getText(l).replace(/ /g,'\u00a0');},getDecodedText:function(l){return k.decodeText(j.getText(l));},getLength:function(l){return j.getText(l).length;},getMarker:function(l,m,n){var o=l.firstChild;while(o){var p=k.getLength(o);if(p>m||!o.nextSibling){if(j.isTextNode(o)||!n){return {node:o,offset:Math.min(m,p)};}else return k.getMarker(o,m);}else m-=p;o=o.nextSibling;}}};e.exports=k;},null); __d("StructuredInputUtil",["StructuredInputDOM"],function(a,b,c,d,e,f,g){function h(n,o,p){var q=n.substr(0,o).lastIndexOf(p);return q!==-1?q+1:0;}function i(n,o,p){var q=n.indexOf(p,o);return q!==-1?q:n.length;}function j(n,o,p){return (o===0||o===n.length||n.substr(o,p.length)==p);}function k(n,o,p,q){switch(o){case 'none':return p;case 'all':return q?n.length:0;case 'word':if(j(n,p,'\u00a0')){return p;}else if(q){return i(n,p,'\u00a0');}else return h(n,p,'\u00a0');}}function l(n,o){return o&&g.isEntityNode(n)&&!g.isEntityNode(o);}var m={getMarkerAtOffset:function(n,o){var p=n.firstChild,q=0,r=0;while(p){q+=r;r=g.getLength(p);if(q+r>o){break;}else p=p.nextSibling;}return {node:p||n.lastChild,offset:o-q};},validateEntityText:function(n){var o=g.getText(n),p=n.getAttribute('data-fulltext'),q=n.getAttribute('data-group');if(q=='hashtag'){var r=o.match(/#[^\s]+/);p=r&&r[0];}var s=o.indexOf(p),t={prefix:null,entity:null,suffix:null};switch(q){case 'none':t.entity=o;break;case 'hashtag':case 'all':if(s!=-1){t.prefix=o.substr(0,s);t.entity=o.substr(s,p.length);t.suffix=o.substr(s+p.length);}else t.suffix=o;break;case 'word':if(s!=-1){t.prefix=o.substr(0,s);o=o.substr(s);}var u=0,v=0;while(u<p.length){v=i(p,u+1,'\u00a0');if(o.substr(0,v)!=p.substr(0,v)){break;}else u=v;}t.entity=o.substr(0,u)||null;t.suffix=o.substr(u)||null;}return t;},getGrouping:function(n,o){var p=n.getAttribute('data-group'),q=n.getAttribute('data-select');if(o=='select'){return q=='group'?p:'none';}else return p;},snapMarkerToText:function(n,o){var p=n.node;if(g.isEntityNode(p)){var q=n.offset,r=m.getGrouping(p,o);if(r!='none')if(q===0){var s=p.previousSibling;if(l(p,s))return {node:s,offset:g.getLength(s)};}else if(q==g.getLength(p)){var t=p.nextSibling;if(l(p,t))return {node:t,offset:0};}}return n;},nextMarkerBoundary:function(n,o,p){var q=n.node;if(g.isEntityNode(q)&&(!o||n.offset!==0)){var r=m.getGrouping(q,p);if(r!='none')return {node:n.node,offset:k(g.getText(q),r,n.offset,o)};}return n;}};e.exports=m;},null); __d("StructuredInputCleaner",["DOM","createArrayFrom","copyProperties","StructuredInputUtil","StructuredInputDOM","UserAgent"],function(a,b,c,d,e,f,g,h,i,j,k,l){function m(n,o,p){"use strict";this._node=n;this._selection=o;this._wrapText=p;}m.prototype._cleanEntityNode=function(n){"use strict";var o=n.getAttribute('data-text'),p=k.getText(n);n.style.cssText='';if(o==p&&k.containsOnlyText(n,{I:true}))return null;var q=[],r=j.validateEntityText(n),s=k.createIconNode(JSON.parse(n.getAttribute('data-icon')));if(!r.entity&&((r.suffix&&!r.prefix)||(r.prefix&&!r.suffix))){k.convertToTextNode(n);n.setAttribute('data-text',p);return null;}if(r.prefix)q.push(this._createTextNode(r.prefix));if(r.entity){if(this._selection&&g.getText(n)!==r.entity)this._selection.markDirty(n);g.setContent(n,s?[s,r.entity]:r.entity);n.setAttribute('data-text',r.entity);q.push(n);}if(r.suffix)q.push(this._createTextNode(r.suffix));return q;};m.prototype._removeSpecialNodes=function(){"use strict";var n=h(this._node.getElementsByTagName('script')),o=h(this._node.getElementsByTagName('style'));n.forEach(g.remove);o.forEach(g.remove);};m.prototype._collapseNodes=function(){"use strict";for(var n,o=this._node.firstChild;o;o=n){n=o.nextSibling;if(!g.isTextNode(o)&&!k.isEntityNode(o)&&!k.containsOnlyText(o))for(var p=o.lastChild;p;p=o.lastChild){this._node.insertBefore(p,n);n=p;}}};m.prototype._createTextNode=function(n){"use strict";if(this._wrapText){return k.createTextNode(n);}else return document.createTextNode(n);};m.prototype.replaceNodes=function(n,o){"use strict";if(o==null)return;var p=n.length?n[n.length-1].nextSibling:null;n.forEach(function(q){if(o.indexOf(q)===-1)g.remove(q);},this);o.reverse().forEach(function(q){if(n.indexOf(q)===-1)this._node.insertBefore(q,p);p=q;},this);};m.prototype.clean=function(){"use strict";this._removeSpecialNodes();this._collapseNodes();var n=[],o=function(){if(n.length){this.replaceNodes(n,this._cleanTextNodes(n));n.length=0;}}.bind(this);h(this._node.childNodes).forEach(function(p){if(k.isEntityNode(p)){this.replaceNodes([p],this._cleanEntityNode(p));o(n);}else n.push(p);}.bind(this));o();if(!this._node.firstChild&&l.firefox())this._node.appendChild(this._createTextNode());};m.prototype.endOnText=function(){"use strict";var n=function(o,p){if(k.isEntityNode(o))this._node.insertBefore(this._createTextNode(),p?o:null);}.bind(this);n(this._node.firstChild,true);n(this._node.lastChild,false);};i(m.prototype,{_cleanTextNodes:(function(){var n=function(p){return (p.nodeName==='BR'||p.nodeName==='SPAN'&&o(p));},o=function(p){return p.getAttribute('data-si')&&k.containsOnlyText(p)&&k.getLength(p)>0;};return function(p){if(p.length!=1||!n(p[0])){var q=p.map(k.getText).join('').replace(/\s+/g,' ');return q?[this._createTextNode(q)]:[];}else{p[0].style.cssText='';return;}};})()});e.exports=m;},null); __d("DOMSelection",[],function(a,b,c,d,e,f){(function(){var g=this,h={isPreceding:function(n,o){return o.compareDocumentPosition(n)&2;},contains:function(n,o){if(n.compareDocumentPosition!=null){return n.compareDocumentPosition(o)&16;}else return n.contains(o);},isCursorPreceding:function(n,o,p,q){if(n===p)return o<=q;if(h.isText(n)&&h.isText(p))return h.isPreceding(n,p);if(h.isText(n)&&!h.isText(p))return !h.isCursorPreceding(p,q,n,o);if(!h.contains(n,p))return h.isPreceding(n,p);if(n.childNodes.length<=o)return false;if(n.childNodes[o]===p)return 0<=q;return h.isPreceding(n.childNodes[o],p);},isText:function(n){return (n!=null?n.nodeType==3:false);},getChildIndex:function(n){var o=0;while(n=n.previousSibling)o++;return o;}},i=g.Selection=(function(){function n(o){this.win=o;}n.prototype.hasSelection=function(){return n.hasSelection(this.win);};n.prototype.isBidirectional=function(){return n.isBidirectional(this.win);};n.prototype.getOrigin=function(){return n.getOrigin(this.win);};n.prototype.getFocus=function(){return n.getFocus(this.win);};n.prototype.getStart=function(){return n.getStart(this.win);};n.prototype.getEnd=function(){return n.getEnd(this.win);};n.prototype.trySelection=function(o,p,q,r){return n.trySelection(this.win,o,p,q,r);};n.prototype.setSelection=function(o,p,q,r){return n.setSelection(this.win,o,p,q,r);};n.prototype.clearSelection=function(){return n.clearSelection(this.win);};return n;})();function j(){if(g.document.selection&&/MSIE 9\./.test(navigator.userAgent)){return false;}else return !!g.getSelection;}if(j()){i.supported=true;i.hasSelection=function(n){var o;return (o=n.getSelection())&&(o.focusNode!=null)&&(o.anchorNode!=null);};i.isBidirectional=function(n){return true;};i.getOrigin=function(n){var o;if(!((o=n.getSelection())&&(o.anchorNode!=null)))return null;return [o.anchorNode,o.anchorOffset];};i.getFocus=function(n){var o;if(!((o=n.getSelection())&&(o.focusNode!=null)))return null;return [o.focusNode,o.focusOffset];};i.getStart=function(n){var o,p,q,r,s,t;if(!i.hasSelection(n))return null;s=i.getOrigin(n),o=s[0],q=s[1];t=i.getFocus(n),p=t[0],r=t[1];if(h.isCursorPreceding(o,q,p,r))return [o,q];return [p,r];};i.getEnd=function(n){var o,p,q,r,s,t;if(!i.hasSelection(n))return null;s=i.getOrigin(n),o=s[0],q=s[1];t=i.getFocus(n),p=t[0],r=t[1];if(h.isCursorPreceding(o,q,p,r))return [p,r];return [o,q];};var k=function(n,o,p,q,s,t){var u=o.getSelection();if(!u)return;if(s==null)s=p;if(t==null)t=q;if(u.collapse&&u.extend){u.collapse(p,q);u.extend(s,t);}else{r=o.document.createRange();r.setStart(p,q);r.setEnd(s,t);if(n||!i.hasSelection(o)||(r.endContainer===s&&r.endOffset===t&&r.startContainer===p&&r.startOffset===q)){try{u.removeAllRanges();}catch(v){}u.addRange(r);}}};i.setSelection=k.bind(i,true);i.trySelection=k.bind(i,false);i.clearSelection=function(n){try{var p=n.getSelection();if(!p)return;p.removeAllRanges();}catch(o){}};i.getText=function(n){var o=n.getSelection();if(!o)return;return o.toString();};}else if(g.document.selection){var l=function(n,o,p){var q,r,s,t,u;r=n.createElement('a');q=o.duplicate();q.collapse(p);u=q.parentElement();while(true){u.insertBefore(r,r.previousSibling);q.moveToElementText(r);if(!(q.compareEndPoints((p?'StartToStart':'StartToEnd'),o)>0&&(r.previousSibling!=null)))break;}if(q.compareEndPoints((p?'StartToStart':'StartToEnd'),o)===-1&&r.nextSibling){q.setEndPoint((p?'EndToStart':'EndToEnd'),o);s=r.nextSibling;t=q.text.length;}else{s=r.parentNode;t=h.getChildIndex(r);}r.parentNode.removeChild(r);return [s,t];},m=function(n,o,p,q,r){var s,t,u,v,w;w=0;s=h.isText(q)?q:q.childNodes[r];t=h.isText(q)?q.parentNode:q;if(h.isText(q))w=r;v=n.createElement('a');t.insertBefore(v,s||null);u=n.body.createTextRange();u.moveToElementText(v);v.parentNode.removeChild(v);o.setEndPoint((p?'StartToStart':'EndToEnd'),u);return o[p?'moveStart':'moveEnd']('character',w);};i.supported=true;i.hasSelection=function(n){var o;if(!n.document.selection)return false;o=n.document.selection.createRange();return o&&o.parentElement().document===n.document;};i.getStart=function(n){var o;if(!i.hasSelection(n))return null;o=n.document.selection.createRange();return l(n.document,o,true);};i.getEnd=function(n){var o;if(!i.hasSelection(n))return null;o=n.document.selection.createRange();return l(n.document,o,false);};i.isBidirectional=function(n){return false;};i.getOrigin=function(n){return i.getStart(n);};i.getFocus=function(n){return i.getEnd(n);};var k=function(n,o,p,q,r,s){if(r==null)r=p;if(s==null)s=q;var t=o.document.body.createTextRange();m(o.document,t,false,r,s);m(o.document,t,true,p,q);return t.select();};i.setSelection=k.bind(i,true);i.trySelection=k.bind(i,false);i.clearSelection=function(n){return n.document.selection.empty();};i.getText=function(n){if(!i.hasSelection(n))return null;var o=n.document.selection.createRange();return o&&o.text;};}else i.supported=false;}).call(this);e.exports=Selection;},null); __d("StructuredInputSelection",["DOM","DOMSelection","Vector","StructuredInputUtil","StructuredInputDOM"],function(a,b,c,d,e,f,g,h,i,j,k){function l(n){"use strict";var o=n.ownerDocument;this.window=o.defaultView||o.parentWindow;this.root=n;this.selection=false;this.start=new m(this,[]);this.end=new m(this,[]);this.update();}l.prototype.isSupported=function(){"use strict";return !!(h&&h.hasSelection);};l.prototype.update=function(){"use strict";this.selection=false;if(this.isSupported()&&this.root==document.activeElement)if(h.hasSelection(this.window)){var n=h.getStart(this.window),o=h.getEnd(this.window),p=h.getFocus(this.window);this.start=this.makeMarker(n);this.end=this.makeMarker(o);this.backward=n[0]==p[0]&&n[1]==p[1];this.selection=this.start.node&&this.end.node;}};l.prototype.makeMarker=function(n){"use strict";if(n[0]===this.root){return new m(this,[this.root.childNodes[n[1]],0]);}else return new m(this,n);};l.prototype.getFocus=function(){"use strict";return this.backward?this.start:this.end;};l.prototype.getOrigin=function(){"use strict";return this.backward?this.end:this.start;};l.prototype.move=function(n){"use strict";if(this.selection){this.start.move(n);this.start.snap();this.end.setPosition(this.start);return this.apply();}};l.prototype.expand=function(n){"use strict";if(this.selection){if(h.isBidirectional()){this.start.move(!n);this.start.snap();this.end.move(n);this.end.snap();}return this.apply();}};l.prototype.getText=function(){"use strict";if(this.selection&&this.isSupported()){var n=h.getText(this.window);return n;}};l.prototype.getOffset=function(){"use strict";if(this.selection)return this.start.rootOffset;};l.prototype.getLength=function(){"use strict";return (this.getText()||"").length;};l.prototype.setPosition=function(n,o){"use strict";this.backward=false;this.selection=true;this.start.setPosition(j.getMarkerAtOffset(this.root,n));this.start.snap();if(o>0){this.end.setPosition(j.getMarkerAtOffset(this.root,n+o));this.end.snap();}else this.end.setPosition(this.start);return this.apply();};l.prototype.hasRange=function(){"use strict";return this.selection&&(this.start.node!=this.end.node||this.start.offset!=this.end.offset);};l.prototype.scrollToFocus=function(){"use strict";var n=5,o=this.getFocus();if(o.node){var p=i.getElementDimensions(this.root).x,q=this.root.scrollLeft,r=o.node.offsetLeft+o.node.offsetWidth;if(r-q<n){this.root.scrollLeft=r-n;}else if(r-q>p-n)this.root.scrollLeft=r-p+n;}};l.prototype.apply=function(){"use strict";if(this.start.hasChanged()||this.end.hasChanged()){var n=this.getOrigin().getMarker(true),o=this.getFocus().getMarker(true);this.selection=this.selection&&n&&n.node&&o&&o.node;if(this.selection&&this.isSupported()){this.start.changed=false;this.end.changed=false;h.trySelection(this.window,n.node,n.offset,o.node,o.offset);return true;}}};l.prototype.markDirty=function(n){"use strict";if(g.contains(n,this.start.node,n))this.start.changed=true;if(g.contains(n,this.end.node,n))this.end.changed=true;};function m(n,o){"use strict";this.selection=n;this.node=o[0];this.offset=o[1];this.rootOffset=this.getRootOffset(o[0],o[1]);this.sibling=this.node&&this.node.previousSibling;this.changed=false;}m.prototype.hasChanged=function(){"use strict";return this.changed||!this.isNodeValid();};m.prototype.isNodeValid=function(){"use strict";if(k.getLength(this.node)>this.offset){var n=this.node;while(n=n.parentNode)if(n==this.selection.root)return true;}};m.prototype.getMarker=function(n){"use strict";if(this.isNodeValid()&&((n&&!this.node.firstChild)||(!n&&this.node.parentNode==this.selection.root))){return this;}else return k.getMarker(this.selection.root,this.rootOffset,n);};m.prototype.move=function(n){"use strict";this.node&&this.setPosition(j.nextMarkerBoundary(this.getMarker(false),n,'select'));};m.prototype.snap=function(){"use strict";this.node&&this.setPosition(j.snapMarkerToText(this.getMarker(false),'select'));};m.prototype.setPosition=function(n){"use strict";if(n.offset!=this.offset||n.node!=this.node){this.changed=true;this.node=n.node;this.offset=n.offset;this.rootOffset=this.getRootOffset(this.node,this.offset);}};m.prototype.getRootOffset=function(n,o){"use strict";var p=0,q=5;while(n&&p++<q)if(n===this.selection.root){return o;}else{var r=n;while(r=r.previousSibling)o+=k.getLength(r);n=n.parentNode;}};e.exports=l;},null); __d("StructuredInput",["Arbiter","ArbiterMixin","CSS","DOM","DataStore","Event","Input","InputSelection","JSLogger","Keys","Parent","StructuredInputCleaner","StructuredInputDOM","StructuredInputSelection","StructuredInputUtil","Style","UserAgent","createArrayFrom","createObjectFrom","cx","csx","emptyFunction","getActiveElement","mixin"],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,y,z,aa,ba,ca,da){var ea=229,fa=y([p.UP,p.DOWN,p.LEFT,p.RIGHT]),ga=y([p.BACKSPACE,p.DELETE]),ha=y([p.SPACE,p.RETURN]),ia=y('IUB'.split('').map(function(qa){return qa.charCodeAt(0);})),ja=w.firefox(),ka=w.ie(),la=w.webkit(),ma=da(h);for(var na in ma)if(ma.hasOwnProperty(na))pa[na]=ma[na];var oa=ma===null?null:ma.prototype;pa.prototype=Object.create(oa);pa.prototype.constructor=pa;pa.__superConstructor__=ma;function pa(qa){"use strict";k.set(qa,'StructuredInput',this);this._root=qa;this._richInput=j.find(qa,"._586i");this._textInput=j.find(qa,"._586f");this._placeholderText=j.scry(qa,"._586j")[0];this._hintText=j.find(qa,"._586k");this._contentWidth=null;this._richWidth=null;this._hintNodes=[];g.subscribe(o.DUMP_EVENT,function(ra,sa){sa.structuredInputState={initInputsFinished:!!this._initInputsFinished,initEventsFinished:!!this._initEventsFinished,cleanInputPreTogglesFinished:!!this._cleanInputPreTogglesFinished,cleanInputFinished:!!this._cleanInputFinished,elements:{richInput:!!this._richInput,textInput:!!this._textInput,placeholderText:!!this._placeholderText,hintText:!!this._hintText}};}.bind(this));this.init();}pa.prototype.init=function(){"use strict";this.init=ba;this._initSelection();this._initCleaner();this._initInputs();this._initInputsFinished=true;this._initEvents();this._initEventsFinished=true;this._scheduledCleanInput=false;this._richChanged=false;this._textChanged=false;this._selectionChanged=false;this._selectionIgnore=false;this._imeMode=false;this.cleanInput();this.inform('init',null,g.BEHAVIOR_PERSISTENT);};pa.prototype._initInputs=function(){"use strict";this._richInput.contentEditable=true;this._richInput.spellcheck=false;this._richInput.tabIndex=0;this._textInput.tabIndex=-1;this._multiline=this._textInput.nodeName=='TEXTAREA';if(!i.shown(this._richInput)){var qa=n.get(this._textInput),ra=ca()===this._textInput;j.setContent(this._richInput,s.encodeText(m.getValue(this._textInput)));i.hide(this._textInput);i.show(this._richInput);this.cleanInput();if(ra){this._richInput.focus();this.setSelection({offset:qa.start,length:qa.end-qa.start});}}this.togglePlaceholder();this._toggleHint();};pa.prototype._initEvents=function(){"use strict";var qa=null,ra=false,sa=function(){this._richChanged=true;ra||this.scheduleCleanInput(true);}.bind(this),ta=function(){this._textChanged=true;ra||this.scheduleCleanInput(false);}.bind(this),ua=function(){this._selectionChanged=true;this.scheduleCleanInput(false);}.bind(this),va=function(){this._imeMode=true;this._placeholderText&&i.hide(this._placeholderText);i.hide(this._hintText);}.bind(this),wa=function(){this._imeMode=false;this._richChanged=true;this.cleanInput();}.bind(this);l.listen(this._richInput,'keydown',function(xa){qa=xa.keyCode;if(xa.ctrlKey&&xa.keyCode in ia){return xa.kill();}else if(xa.keyCode in fa){ua();}else if(xa.keyCode===p.BACKSPACE&&this._deleteTrailingChunk()){this._richChanged=true;this.cleanInput();return xa.kill();}else if(xa.keyCode in ga){sa();}else if(xa.keyCode==ea)va();}.bind(this));l.listen(this._richInput,'keypress',function(xa){if(xa.keyCode==p.RETURN){this._multiline&&this._insertText("\n");return xa.kill();}else if(!this._selectionChanged&&this._selectionIsText()){ta();}else sa();}.bind(this));if(!ra){l.listen(this._richInput,'keyup',function(xa){if((this._imeMode||xa.keyCode!=qa)&&xa.keyCode in ha){wa();return xa.kill();}else if(this._imeMode){this._textChanged=true;this.cleanInput();}}.bind(this));if(ja)l.listen(this._richInput,'input',function(){this._textChanged=true;this.cleanInput();}.bind(this));}else{l.listen(this._richInput,'compositionstart',va);l.listen(this._richInput,'compositionend',function(){setTimeout(wa,0);});l.listen(this._richInput,'input',function(){this._textChanged=true;if(!this._imeMode)if(!this._richChanged){this.cleanInput();}else this.scheduleCleanInput();}.bind(this));}l.listen(document,'selectionchange',function(){if(this._selectionIgnore){this._selectionIgnore=false;}else this._selectionChanged=true;}.bind(this));l.listen(this._richInput,'mousedown',function(){this._selectionChanged=true;this._selectionLength=0;this._selectionOffset=0;}.bind(this));l.listen(this._richInput,'mouseup',function(){this._selectionChanged=true;this.scheduleCleanInput();}.bind(this));l.listen(this._richInput,'cut',function(){this._richChanged=true;this.scheduleCleanInput(false);}.bind(this));l.listen(this._richInput,'paste',function(xa){this._richChanged=true;this.scheduleCleanInput(true);}.bind(this));l.listen(this._richInput,'drop',function(xa){this.focus();this.selectAll();this._insertClipboard(xa&&xa.dataTransfer);return xa.kill();}.bind(this));l.listen(this._richInput,'dragover',function(xa){xa.dataTransfer.dropEffect='move';xa.dataTransfer.effectAllowed='move';return xa.kill();});l.listen(this._richInput,'focus',function(xa){this._toggleHint();this.inform('focus');}.bind(this));l.listen(this._richInput,'blur',function(xa){i.hide(this._hintText);this._imeMode=false;this._richChanged=true;this.scheduleCleanInput(false);this.inform('blur');}.bind(this));};pa.prototype._initCleaner=function(){"use strict";this._cleaner=new r(this._richInput,this._selection,true);};pa.prototype._initSelection=function(){"use strict";this._selection=new t(this._richInput);this._selectionLength=0;this._selectionOffset=0;};pa.prototype._insertClipboard=function(qa){"use strict";if(qa&&typeof qa.getData==='function'){var ra=qa.getData('Text');this._insertText(ra);}};pa.prototype._deleteTrailingChunk=function(qa){"use strict";var ra=this.getSelection();if(ra.length>0||ra.offset===0)return false;var sa=this.getSelection().offset-1,ta=u.getMarkerAtOffset(this._richInput,sa);if(ta&&s.isEntityNode(ta.node)&&u.getGrouping(ta.node,'select')!=='none'){j.remove(ta.node);return true;}return false;};pa.prototype._selectionIsText=function(){"use strict";var qa=this._selection.start.node,ra=this._selection.end.node;return qa&&qa===ra&&!s.isEntityNode(qa)&&!s.isEntityNode(qa.parentNode);};pa.prototype._insertText=function(qa){"use strict";if(qa){var ra=j.create('div',{},qa);return this._insertNodes(ra);}};pa.prototype._insertHTML=function(qa){"use strict";if(qa){var ra=j.create('div'),sa=new r(ra,null,false);ra.innerHTML=qa;sa.clean();return this._insertNodes(ra);}};pa.prototype._insertNodes=function(qa){"use strict";if(document.selection){document.selection.createRange().pasteHTML(qa.innerHTML);}else document.execCommand('insertHTML',false,qa.innerHTML);this._richChanged=true;this.cleanInput();};pa.prototype.togglePlaceholder=function(qa){"use strict";if(!this._placeholderText)return;var ra=s.getLength(this._richInput)===0;if(qa&&ra){i.show(this._placeholderText);}else i.conditionShow(this._placeholderText,ra&&!this._imeMode);};pa.prototype._toggleHint=function(){"use strict";var qa=x(this._hintNodes),ra=null,sa='',ta=s.getText(this._richInput).toLowerCase();if(!this.hasFocus())return;if(this._contentOverflows()){i.hide(this._hintText);return;}while(qa.length&&sa.length<ta.length){ra=qa.shift();sa+=s.getText(ra);}if(ta.length&&sa.substr(0,ta.length).toLowerCase()==ta.toLowerCase()){j.setContent(this._hintText,x(this._richInput.cloneNode(true).childNodes));var ua=s.createTextNode(sa.substr(ta.length));qa.unshift(ua);j.appendContent(this._hintText,j.create('span',{className:"_586h"},qa));i.show(this._hintText);i.hide(this._placeholderText);}else i.hide(this._hintText);};pa.prototype._contentOverflows=function(){"use strict";if(this._richWidth===null)this._richWidth=this._richInput.clientWidth;if(this._contentWidth===null){var qa=this._richInput.lastChild;this._contentWidth=j.isElementNode(qa)?qa.offsetLeft+qa.offsetWidth:0;}return this._contentWidth>this._richWidth;};pa.prototype._forceTop=function(){"use strict";if(!this._multiline)this._richInput.scrollTop=0;this._root.scrollTop=0;};pa.prototype._createStructureNodes=function(qa){"use strict";return qa.map(function(ra){return ra.uid||(ra.type&&ra.type!='text')?s.createEntityNode(ra,ra.display||{}):s.createTextNode(ra.text);}.bind(this));};pa.prototype._suppressInput=function(){"use strict";if(ja||ka){if(this._richClean)return;this._richClean=this._richInput.cloneNode(true);this._richClean.contentEditable=false;this._root.insertBefore(this._richClean,this._richInput.nextSibling);this._richClean.scrollLeft=this._richInput.scrollLeft;v.set(this._richInput,'padding',0);v.set(this._richInput,'height',0);}};pa.prototype._revealInput=function(){"use strict";if(!this._richClean)return;v.set(this._richInput,'height','');v.set(this._richInput,'padding','');this._root.removeChild(this._richClean);this.focus();this._richClean=null;};pa.prototype._cleanInput=function(){"use strict";var qa;if(this._textChanged&&!this._richChanged){this._selection.update();qa='change';}else if(this._richChanged||this._selectionChanged){this._selection.update();if(this._richChanged){this._contentWidth=null;this._cleaner.clean();this._cleaner.endOnText();this._selection.apply();qa='change';}if(this._selectionChanged){this._cleanSelection();if(this._selectionLength||!this._richChanged)qa='select';}}this._revealInput();this._forceTop();this._cleanInputPreTogglesFinished=true;if(this._richChanged||this._textChanged){this.togglePlaceholder();this._toggleHint();}this._selectionIgnore=true;this._selectionChanged=false;this._richChanged=false;this._textChanged=false;this._cleanInputFinished=true;qa&&this.inform(qa);};pa.prototype._cleanSelection=function(){"use strict";var qa=this._selection.getLength(),ra=this._selection.getOffset();if(qa){this._selection.expand(qa>=this._selectionLength);qa=this._selection.getLength();ra=this._selection.getOffset();}this._selectionLength=qa;this._selectionOffset=ra;};pa.prototype.cleanInput=function(){"use strict";this._scheduledCleanInput||this._cleanInput();};pa.prototype.scheduleCleanInput=function(qa){"use strict";qa&&this._suppressInput();if(!this._scheduledCleanInput){this._scheduledCleanInput=true;setTimeout(function(){this._cleanInput();this._scheduledCleanInput=false;}.bind(this),0);}};pa.prototype.setEnabled=function(qa){"use strict";this._textInput.disabled=!qa;this._richInput.contentEditable=qa;};pa.prototype.getRoot=function(){"use strict";return this._root;};pa.prototype.getRichInput=function(){"use strict";return this._richInput;};pa.prototype.getEnabled=function(){"use strict";return !this._textInput.disabled;};pa.prototype.getText=function(){"use strict";return s.getDecodedText(this._richInput);};pa.prototype.setText=function(qa){"use strict";j.setContent(this._richInput,s.createTextNode(qa));this._richChanged=false;this._selectionChanged=false;this.inform('change');};pa.prototype.setHint=function(qa){"use strict";this._hintNodes=this._createStructureNodes(qa);this._toggleHint();};pa.prototype.getStructure=function(){"use strict";var qa=[];x(this._richInput.childNodes).forEach(function(ra){var sa=!j.isTextNode(ra),ta=s.getDecodedText(ra);ta.length&&qa.push({text:ta,uid:sa?ra.getAttribute('data-uid'):null,type:(sa&&ra.getAttribute('data-type'))||'text'});}.bind(this));return qa;};pa.prototype.setStructure=function(qa){"use strict";j.setContent(this._richInput,this._createStructureNodes(qa));this._cleaner.endOnText();this._cleaner.clean();this.togglePlaceholder();this._toggleHint();this._richChanged=false;this._selectionChanged=false;this.inform('change');};pa.prototype.getContentDimensions=function(){"use strict";var qa=this._richInput.lastChild;return {width:qa?qa.offsetLeft+qa.offsetWidth:0,height:qa?qa.offsetTop+qa.offsetHeight:0};};pa.prototype.getSelection=function(){"use strict";if(this._selection)return {offset:this._selection.getOffset(),length:this._selection.getLength()};};pa.prototype.setSelection=function(qa){"use strict";if(this.hasFocus()&&this._selection){this._selection.update();this._selection.setPosition(qa.offset,qa.length);this._selection.scrollToFocus();this._selectionChanged=false;this.inform('select');}};pa.prototype.moveSelectionToEnd=function(){"use strict";this.setSelection({length:0,offset:s.getLength(this._richInput)});};pa.prototype.isSelectionAtEnd=function(){"use strict";var qa=this.getSelection().offset,ra=s.getLength(this._richInput);return qa>=ra;};pa.prototype.selectAll=function(){"use strict";this.setSelection({offset:0,length:s.getLength(this._richInput)});};pa.prototype.hasFocus=function(){"use strict";return j.contains(this._root,document.activeElement);};pa.prototype.focus=function(){"use strict";this._richInput.focus();};pa.prototype.blur=function(){"use strict";var qa=j.create('input',{type:'text',tabIndex:-1,style:{position:'absolute',top:0,left:'-100px',width:'1px',height:'1px'}});j.appendContent(this._root,qa);var ra=function(){if(this.hasFocus()||(la&&document.activeElement===document.body)){qa.focus();qa.blur();}};this.blur=ra;this.blur();};pa.getInstance=function(qa){var ra=q.byClass(qa,"_586g");if(!ra)throw new Error('No DOMElement structured input found using '+qa);return k.get(ra,'StructuredInput')||new pa(ra);};e.exports=pa;},null); __d("FacebarTypeaheadInput",["ArbiterMixin","csx","DOM","FacebarStructuredText","StructuredInput","Vector","copyProperties","Locale","mixin"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){var p={text:{className:"text",group:"all",select:"none"},ent:{className:"entity",group:"all",select:"group"},'ent:hashtag_exact':{className:"entity",group:"hashtag",select:"none"}};function q(v){return m(v.toStruct(),{display:p[v.getType()]||p[v.getTypePart(0)]});}var r=o(g);for(var s in r)if(r.hasOwnProperty(s))u[s]=r[s];var t=r===null?null:r.prototype;u.prototype=Object.create(t);u.prototype.constructor=u;u.__superConstructor__=r;function u(v){"use strict";this.root=v;this.input=k.getInstance(v);this.value=null;this.selection={offset:0,length:0};this.resetOnChange=true;this.initEvents();}u.prototype.initEvents=function(){"use strict";var v=function(w,x){this.inform(w,x);}.bind(this);this.input.subscribe('blur',v);this.input.subscribe('focus',v);this.input.subscribe('change',function(w,x){if(this.resetOnChange)this.value=null;this.inform('change',x);}.bind(this));};u.prototype.togglePlaceholder=function(v){"use strict";return this.input.togglePlaceholder(v);};u.prototype.focus=function(){"use strict";this.input.focus();};u.prototype.blur=function(){"use strict";this.input.blur();};u.prototype.getElement=function(){"use strict";return this.root;};u.prototype.getRawPlaceholderElement=function(){"use strict";return i.find(this.root,"._586j");};u.prototype.getRawInputElement=function(){"use strict";return i.scry(this.root,"._586i")[0];};u.prototype.getValue=function(){"use strict";if(this.value===null)this.value=j.fromStruct(this.input.getStructure());return this.value;};u.prototype.getLength=function(){"use strict";return this.getValue().getLength();};u.prototype.resetPlaceholder=function(){"use strict";this.input.resetPlaceholder();};u.prototype.setValue=function(v){"use strict";this.value=v;this.resetOnChange=false;var w=v.toArray().map(q);this.input.setStructure(w);this.input.setSelection({offset:v.getLength(),length:0});this.resetOnChange=true;};u.prototype.storeSelection=function(){"use strict";this.selection=this.input.getSelection();};u.prototype.restoreSelection=function(){"use strict";if(this.selection)this.input.setSelection(this.selection);};u.prototype.setHint=function(v){"use strict";var w=v&&!v.hasRTL()&&!n.isRTL()?v.toArray().map(q):[];this.input.setHint(w);};u.prototype.isSelectionAtEnd=function(){"use strict";return this.input.isSelectionAtEnd();};u.prototype.selectInput=function(v){"use strict";this.input.setSelection({offset:v||0,length:this.getLength()});};u.prototype.getEndOffset=function(){"use strict";var v=l.getElementDimensions(this.root),w=this.input.getContentDimensions();return Math.min(v.x,w.width);};m(u.prototype,{events:['change','focus','blur']});e.exports=u;},null); __d("FacebarTypeaheadWebSearch",["startsWith","FacebarStructuredFragment","FacebarStructuredText"],function(a,b,c,d,e,f,g,h,i){var j=new h({type:'ent:websuggestion',text:'Web Search: ',uid:null}),k=j.getText().toLowerCase().trim();function l(o,p){if(!o||o.type!=='websuggestion')return;var q=p.getValue().toArray();q.forEach(function(r){if(r.isType('ent')&&!r.isType('ent','user')&&r.getUID())if(o.extra_uri_params){o.extra_uri_params.qh=r.getUID();return;}});}function m(o){return o.getType()===j.getType();}function n(o){"use strict";this._core=o.getCore();this._view=o.getView();this._input=this._core.input;this._isEnabled=false;}n.prototype.enable=function(){"use strict";this._isEnabled=true;this.changeListener=this._input.subscribe('change',this._changeWebSearch.bind(this));this.lockListener=this._input.subscribe('shortcut',this._lockWebSearch.bind(this));this.beforeSelectListener=this._view.subscribe('beforeSelect',this._beforeSelect.bind(this));this.beforeRenderListener=this._view.subscribe('beforeRender',this._beforeRender.bind(this));};n.prototype._changeWebSearch=function(){"use strict";var o=this._input.getValue(),p=o.toArray(),q=p[0];if(q&&q.getType()==='text')if(g(q.getText().toLowerCase(),k)){p.splice(0,1,j,new h({text:q.getText().substr(k.length).replace(/^ /,'')}));this._replaceFragments(p);}else if(p.length>1&&p.some(m)){var r='';p.forEach(function(s){if(m(s))return;r+=s.getText();});this._input.storeSelection();this._input.setValue(i.fromString(r));this._input.restoreSelection();}};n.prototype._replaceFragments=function(o){"use strict";this._input.storeSelection();this._input.setValue(new i(o));this._input.restoreSelection();};n.prototype._beforeSelect=function(o,p){"use strict";l(p.selected,this._input);return true;};n.prototype._beforeRender=function(o,p){"use strict";var q=this._input.getValue().toArray()[0],r=q&&m(q);p.results.forEach(function(s){if(s.type==='websuggestion')s.isLockedWebSearchMode=r;});return true;};n.prototype._lockWebSearch=function(o,p){"use strict";if(p.shift){var q=this._input.getValue().toArray()[0];if(!q||!m(q))this._input.setValue(new i([j]));}};n.prototype.disable=function(){"use strict";this.beforeSelectListener.unsubscribe();this.changeListener.unsubscribe();this.lockListener.unsubscribe();this.beforeRenderListener.unsubscribe();this._isEnabled=false;};n.addPrefix=function(o){"use strict";var p=m(o.getFragment(0))||g(o.getFragment(0).getText().toLowerCase(),k);if(!p){var q=[j].concat(o.toArray());return new i(q);}else return o;};e.exports=n;},null); __d("FacebarTypeaheadCore",["Animation","Arbiter","ArbiterMixin","Base64","DOM","Event","FacebarGlobalOptions","FacebarJSConstants","FacebarStructuredText","FacebarTypeaheadInput","FacebarTypeaheadWebSearch","Keys","KeywordsSearchResultConfig","Parent","Style","URI","arrayContains","copyProperties","cx","csx","getActiveElement","invariant","mixin","startsWith"],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,y,z,aa,ba,ca,da){var ea=ca(i);for(var fa in ea)if(ea.hasOwnProperty(fa))ha[fa]=ea[fa];var ga=ea===null?null:ea.prototype;ha.prototype=Object.create(ga);ha.prototype.constructor=ha;ha.__superConstructor__=ea;function ha(ia){"use strict";x(this,ia);}ha.prototype.init=function(ia,ja,ka){"use strict";if(window.getSelection===null)throw new Error('Facebar: window.getSelection is null!');this.init=function(){};this.data=ia;this.view=ja;this.root=ka;this.windowFocused=true;this.isFocused=false;this.hoverAnimation=null;this.stickyQuery=null;this.settedQuery=null;this.selectedQuery=null;this.currentQuery=null;this.initSubcomponents();this.initEvents();this.checkValue();};ha.prototype.initSubcomponents=function(){"use strict";var ia=k.find(this.root,"._5861");this.input=new p(ia);this.view.setInputElement(this.input.getRawInputElement());};ha.prototype.initEvents=function(){"use strict";l.listen(this.root,'keydown',this.keydown.bind(this));l.listen(this.root.parentNode,'mousedown',this.mousedown.bind(this));l.listen(this.view.getElement(),'mousedown',this.mousedown.bind(this));l.listen(window,'focus',this.focusWindow.bind(this));l.listen(window,'blur',this.blurWindow.bind(this));this.view.subscribe('select',this.selectView.bind(this));this.view.subscribe('highlight',this.highlightView.bind(this));this.view.subscribe('render',this.highlightView.bind(this));this.view.subscribe('hideHelp',this.performQuery.bind(this));this.input.subscribe('focus',this.focusInput.bind(this));this.input.subscribe('blur',this.blurInput.bind(this));this.input.subscribe('change',this.changeInput.bind(this));this.data.subscribe('activity',this.typeaheadActivity.bind(this));this.data.subscribe('respond',this.completeData.bind(this));this.data.subscribe('nullstateReady',this.performQueryIfVisible.bind(this));setTimeout(this.initFocus.bind(this),0);if(m.noTitleInSingleState)h.subscribe('facebar/updateNullStateQuery',function(){this.needsRefresh=true;}.bind(this));};ha.prototype.initFocus=function(){"use strict";if(!this.lazyFocused&&k.contains(this.input.root,aa())){this.lazyFocused=true;this.isFocused=true;this._newSession();this.inform('focus',{catchup:true});this.open();}};ha.prototype.cleanQuery=function(ia){"use strict";ia=x({},ia)||{};if(!ia.structure)ia.structure=new o();if(!m.allowGrammar||n.nonGrammarTypes[ia.type])ia.structure=o.fromString(ia.structure.toString());ba(ia.structure instanceof o);if(ia.type=='websuggestion'&&m.allowGrammar&&m.webSearchLockedInMode)ia.structure=q.addPrefix(ia.structure);return ia;};ha.prototype._unlockQuery=function(){"use strict";var ia=this.input.getValue();if(ia.hasType('ent')&&ia.trim().getCount()===1){this.input.storeSelection();this.input.setValue(o.fromString(ia.toString()));this.input.restoreSelection();}};ha.prototype.setPageQuery=function(ia){"use strict";ia=this.cleanQuery(ia);var ja=this.input.getValue(),ka=ia.structure,la=!ka.isEmptyOrWhitespace()&&(ja.isEmptyOrWhitespace()||ja.toString().trim()==ka.toString().trim());return this.selectQuery(ia,la);};ha.prototype.selectQuery=function(ia,ja){"use strict";ja=ja!==false;ia=this.cleanQuery(ia);if(ja||!this.selectedQuery){if(ja||this.getValue().isEmptyOrWhitespace())this.setQuery(ia);this.selectedQuery=ia;}return ia;};ha.prototype.completeSelection=function(){"use strict";var ia=this.view.getSelection();if(ia&&!ia.search){this.data.saveResult(ia);ia.structure=ia.structure.pad();this.setQuery(ia);return true;}};ha.prototype.setQuery=function(ia,ja){"use strict";ia=this.cleanQuery(ia);if(ia.structure.hasType('blank'))ia.structure=new o(ia.structure.toArray().filter(function(ka){return ka.getType()!='blank';}));if(m.graphSearchV2){this.input.setValue(o.fromString(ia.structure.toString()));}else this.input.setValue(ia.structure);this.settedQuery=ia;this.stickyQuery=ja===false?this.stickyQuery:ia;this.checkValue();};ha.prototype.checkValue=function(){"use strict";if(!this.needsRefresh&&this.value&&this.value.getHash()==this.input.getValue().getHash()){this.needsRefresh=false;return;}this.checkBlockedSearch();this.performQueryIfVisible();};ha.prototype.checkBlockedSearch=function(){"use strict";var ia=this.input.getValue().toString().toLocaleLowerCase();if(!this.data.blockees||!(this.data.blockees.hasOwnProperty(ia))){this.view.hideBlockNotification();}else this.view.showBlockNotification(this.data.blockees[ia]);};ha.prototype.isNullState=function(){"use strict";return (this.input.getValue().getHash()==='');};ha.prototype.performQueryIfVisible=function(){"use strict";if(!this.view.visible)return;this.value=this.nextQuery=this.getValue();this.performQuery();};ha.prototype.performQuery=function(){"use strict";this.data.query(this.nextQuery);this.currentQuery=this.nextQuery;};ha.prototype.requery=function(){"use strict";if(this.currentQuery)this.data.query(this.currentQuery);};ha.prototype.executeQuery=function(ia){"use strict";ia=this.cleanQuery(ia);var ja=this.inform('execute',ia),ka=this.getSessionID();this.close();if(m.allowGrammar){this.selectQuery(ia);}else this.selectQuery();if(!ja)this._navigateToQuery(ia,ka);};ha.prototype.getSearchType=function(){"use strict";return 'facebar';};ha.prototype._newSession=function(){"use strict";if(this._sessionID!=null)return;this._sessionID=Math.random().toString();this.inform('session',this._sessionID,h.BEHAVIOR_STATE);};ha.prototype._closeSession=function(){"use strict";this._sessionID=null;this.inform('session',null,h.BEHAVIOR_STATE);};ha.prototype.getSessionID=function(){"use strict";return this._sessionID;};ha.prototype._navigateToQuery=function(ia,ja){"use strict";var ka=this.data.facebarConfig;if(ia.uri){ia.uri.addQueryData(ia.extra_uri_params);ia.uri.addQueryData({ref:'br_tf'});if(ia.structure&&(ia.type=='websuggestion'||ia.type==s.result_type||(ia.type=='grammar'&&(!ka||da(ia.uri.getPath(),ka.search_path))))){var la=this.data.getRawStructure(ia.structure).text_form,ma=j.encode(encodeURIComponent(la)).replace(/\=+$/,''),na={sid:ja,qs:ma,gv:this.data.getQueryData().grammar_version},oa=j.encode(JSON.stringify(na)).replace(/\=+$/,'');ia.uri.addQueryData({ref:oa});}ia.uri.go();return;}};ha.prototype.reset=function(){"use strict";this.selectQuery();this.inform('reset');};ha.prototype.animateInputValue=function(ia,ja,ka){"use strict";this.hoverAnimation&&this.hoverAnimation.stop();var la=new g(ja).from('opacity',1).to('opacity',0).duration(150).ondone(function(){this.input.setValue(ka);this.hoverAnimation=ma.go();}.bind(this)),ma=new g(ia).from('opacity',0).to('opacity',1).duration(150).ondone(function(){this.hoverAnimation=null;u.set(ja,'opacity','');u.set(ia,'opacity','');}.bind(this));u.set(ia,'opacity',0);this.hoverAnimation=la.go();};ha.prototype.open=function(){"use strict";this.inform('open');this.view.show();this.input.focus();this.checkValue();if(!this.isFocused){this.isFocused=true;this._newSession();this.inform('focus');}};ha.prototype.close=function(){"use strict";this._closeSession();if(this.inform('close')===false)return;if((!this.value||this.value.isEmptyOrWhitespace())&&this.selectedQuery){this.input.setValue(this.selectedQuery.structure);}else if(this.stickyQuery)this.input.setValue(this.stickyQuery.structure);this.input.blur();this.view.hide();this.view.setAutoSelect(false);this.inform('session',null,h.BEHAVIOR_STATE);if(this.isFocused){this.isFocused=false;setTimeout(this.inform.bind(this,'blur'),0);}};ha.prototype.getElement=function(){"use strict";return this.root;};ha.prototype.getValue=function(){"use strict";return this.input.getValue();};ha.prototype.getText=function(){"use strict";return this.getValue().toString();};ha.prototype.keydown=function(event){"use strict";var ia=true,ja=l.getKeyCode(event);switch(ja){case r.ESC:this.close();break;case r.RIGHT:if(!m.disableLockingEntitiesOnRightArrow){ia=this.input.isSelectionAtEnd()&&this.completeSelection();}else ia=false;break;case r.TAB:var ka=this.cleanQuery(this.view.getSelection()),la=ka.structure.hasType('blank');if(event.getModifiers().shift||(!this.completeSelection()&&!this.loading)){this.view.setAutoSelect(false);this.view.hide();ia=false;}else if(!la&&!m.graphSearchV2)this.tabQueued=true;break;case r.UP:this.view.prev();break;case r.DOWN:this.view.next();break;case r.RETURN:this.view.select();break;case r.PAGE_UP:this.view.first();break;case 222:var ma=this.input.value.trim();if(!event.getModifiers().shift&&ma.endsOnType('ent'))this.input.setValue(ma);ia=false;break;default:var na=(ja<=46&&ja!==8),oa=(ja>=112&&ja<=126),pa=(ja===144||ja===145);if(!na&&!oa&&!pa){if(m.unlockTextOnKeypress)this._unlockQuery();this.data.setSingleState(false);this.view.setAutoSelect(true);}this.stickyQuery=null;ia=false;break;}this.input.storeSelection();if(ia)return event.kill();};ha.prototype.mousedown=function(event){"use strict";this.view.setAutoSelect(true);this.input.storeSelection();if(t.byClass(event.target,"_50c9"))event.preventDefault();};ha.prototype.focusWindow=function(){"use strict";this.windowFocused=true;};ha.prototype.blurWindow=function(){"use strict";this.windowFocused=false;};ha.prototype.selectView=function(ia,ja){"use strict";if(!ja||!ja.selected)return;this.data.setSingleState(true);this.inform('select',ja);var ka=this.cleanQuery(ja.selected);this.executeQuery(ka);};ha.prototype.highlightView=function(){"use strict";var ia=this.view.getSelection();ia&&this.input.setHint(ia.structure);};ha.prototype.blurInput=function(){"use strict";setTimeout((function(){if(this.windowFocused||v.getRequestURI().getSubdomain()==='apps'){this.input.togglePlaceholder();this.close();}}).bind(this),0);};ha.prototype.changeInput=function(){"use strict";this.inform('change');this.checkValue();this.inform('change_end');};ha.prototype.focusInput=function(){"use strict";this.open();this.input.togglePlaceholder(false);};ha.prototype.updateData=function(){"use strict";this.view.setLoading(this.loading);};ha.prototype.completeData=function(ia,ja){"use strict";this.checkBlockedSearch();if(ja.forceDisplay||(this.value&&this.value.matches(ja.value))){this.view.render(ja.value,ja.results,ja.isAsync,(ja.results.length===0)&&ja.isEmptyResults);if(this.tabQueued&&this.completeSelection())delete this.tabQueued;}};ha.prototype.typeaheadActivity=function(ia,ja){"use strict";this.fetching=ja.activity;if(this.loading!==this.fetching){this.loading=this.fetching;this.updateData();}};ha.prototype.getNameTextFromSelected=function(){"use strict";var ia=this.settedQuery&&this.settedQuery.semantic,ja=this.data.facebarConfig&&this.data.facebarConfig.name_functions,ka=ia&&ja&&ia.match(/[a-z-]+\([^()]+\)/g);if(ka)for(var la=0;la<ka.length;la++){var ma=ka[la].match(/([a-z-]+)\(([^()]+)\)/);if(ma&&w(ja,ma[1]))return ma[2];}return this.value.toString();};x(ha.prototype,{events:['session','focus','select','change','execute','blur']});e.exports=ha;},null); __d("FacebarTypeaheadRecorder",["clickRefAction","copyProperties","Event","Keys","SearchTypeaheadRecorder","URI","userAction","Arbiter","FacebarTimerUtils","FacebarGlobalOptions"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){for(var q in k)if(k.hasOwnProperty(q))s[q]=k[q];var r=k===null?null:k.prototype;s.prototype=Object.create(r);s.prototype.constructor=s;s.__superConstructor__=k;function s(t){"use strict";this.typeahead=t;k.call(this,t);this.userText="";this.queryTimes={};this._sessionDisabled=false;this.type="facebar";this._maxQueryID=0;this._isQueryMatch=true;}s.prototype.initEvents=function(){"use strict";this.typeahead.getCore().subscribe('session',function(t,u){if(u===null){this.sessionEnd();}else this.sessionStart(u);}.bind(this));this.typeahead.getCore().subscribe('select',function(t,u){this.recordSelectInfo(u);}.bind(this));this.typeahead.getCore().input.subscribe('shortcut',function(t,u){this.recordShortcut(u);}.bind(this));this.typeahead.getCore().subscribe('quickSelectRedirect',function(t,u){this.recordQuickSelectInfo(u);}.bind(this));this.typeahead.getView().subscribe('render',function(t,u){this.recordRender(u);}.bind(this));this.typeahead.getView().subscribe('logPerformanceTiming',function(t,u){this.performanceTimings[u.field]=u.value;}.bind(this));this.typeahead.data.subscribe('query',function(t,u){if(!u.value.isEmpty())this.recordCountStat('num_queries');this.recordAvgStat('num_results_from_cache',u.results.length);this.queryTimes[u.queryId]={send:o.getTimestamp()};}.bind(this));this.typeahead.data.subscribe('sending_request',function(t,u){var v=u.data.value;if(!v)return;this.backendQueries.push(v);}.bind(this));this.typeahead.subscribe('navigation',function(t,u){if(u&&u.structure){this.recordStat('navigation_input',JSON.stringify(u.structure.toStruct()));this.recordStat('navigation_text',u.structure.toString());}}.bind(this));this.typeahead.data.subscribe('response_received',function(t,u,v){if(this.queryTimes[u.queryId]){var w=this.queryTimes[u.queryId];w.recv=o.getTimestamp()-w.send;if(u&&u.payload)w.payload_size=JSON.stringify(u.payload).length;}}.bind(this));this.typeahead.data.subscribe('remote_query_latency',function(t,u){if(this.queryTimes[u.queryId]){var v=this.queryTimes[u.queryId];v.remoteQueryLatencies=u.latencies;}}.bind(this));this.typeahead.data.subscribe('cache_query_latency',function(t,u){if(this.queryTimes[u.queryId]){var v=this.queryTimes[u.queryId];v.cacheQueryLatencies=u.latencies;}}.bind(this));this.typeahead.data.subscribe('backend_response',function(t,u){if(this.queryTimes[u.queryId]){var v=this.queryTimes[u.queryId];v.render=o.getTimestamp()-v.send;if(u.payload.incomplete)v.incomplete=true;v.backendInfo=u.payload.info;if(this.core.scubaInfo)this.logToScuba(u,v,this.core.scubaInfo,u.inputQuery,this.type);}}.bind(this));this.typeahead.data.subscribe('remote_query_match',function(t,u){if(this._maxQueryID<u.queryId){this._maxQueryID=u.queryId;this._isQueryMatch=u.isMatch;}}.bind(this));n.subscribe('BrowseNUX/typing',this.disableThisSession.bind(this));n.subscribe('TestConsole/typing',this.disableThisSession.bind(this));this.typeahead.getCore().subscribe('change',function(t,u){this.userInput(this.core.getText());}.bind(this));this.typeahead.subscribe('clear',function(){this.recordAppendStat('before_clear_queries',this.userText);}.bind(this));i.listen(this.element,'keydown',function(event){this.recordStat('keypressed',1);this.recordCountStat('count_keys_pressed');if(i.getKeyCode(event)==j.BACKSPACE){if(!this._backspacing){this._backspacing=true;this.recordAppendStat('before_backspace_queries',this.core.getText());}}else this._backspacing=false;}.bind(this));this.typeahead.subscribe('filter',function(t,u){this._unsupportedGrammarInfo=this.buildUnsupportedGrammarInfo(u);}.bind(this));this.typeahead.getCore().subscribe('recordFunction',function(t,u){this._extraRecorder.push(u);}.bind(this));};s.prototype._reset=function(t){"use strict";this.stats={};this.avgStats={};this.appendStats={};this._backspacing=false;this.backendQueries=[];this._topreplace=false;this._inflightRequests={};};s.prototype.sessionStart=function(t){"use strict";this._sessionEnded=false;this.data.setQueryData({sid:t});this.recordStat('sid',t);if(!this.stats.session_start_time){this.recordStat('session_start_time',o.getTimestamp());var u=new Date(),v=u.getTimezoneOffset(),w=Date.now()-v*60*1000;this.recordStat('session_start_time_user_timezone',w);}this.recordStat('keypressed',0);this.queryTimes={};};s.prototype.sessionEnd=function(){"use strict";if(this._sessionEnded||this._sessionDisabled){if(this._sessionDisabled){this.reset();this._sessionDisabled=false;this._sessionEnded=true;}return;}this._sessionEnded=true;this.recordStat('session_end_time',o.getTimestamp());this.recordStat('grammar_version',this.data.getQueryData().grammar_version);this.submit();};s.prototype.disableThisSession=function(){"use strict";this._sessionDisabled=true;};s.prototype.userInput=function(t){"use strict";this.userText=t;};s.prototype.buildUnsupportedGrammarInfo=function(t){"use strict";var u=t.results?t.results[0]:null;if(!u||u.results_set_type!=='unimplemented')return null;return {unsupported_grammar:{category:u.error_info.category||'unknown',edge:u.error_info.blamed_edge}};};s.prototype.buildTypeaheadRecord=function(t,u){"use strict";var v=t.rankType||t.render_type||t.type,w=0,x=u;if(typeof t.groupIndex=='number'){w=t.groupIndex;x=t.indexInGroup;}var y={group_index:w,index_in_group:x,cost:t.cost,s_value:t.s_value||0,semantic:t.semantic,text:t.structure.toString(),cache_only:(t.cacheOnlyResult?1:0),parse:t.parse,semantic_forest:t.semanticForest,category:t.category,type:v,source:t.bootstrapped,grammar_results_type:(t.results_set_type||'').replace(/[\[\{](.*)[\]\}]/,'$1'),result_from_memcache:t.memcache,websuggestion_source:t.websuggestion_source,dynamic_cost:t.dynamic_cost,is_js_bootstrap_match:t.isJSBootstrapMatch,backend_cost:t.backendCost,bootstrap_cost:t.bootstrapCost,match_type:t.match_type,l_type:t.l_type,vertical_type:t.vertical_type,prefix_match:t.prefix_match,prefix_length:t.prefix_length,index_before_buckets:t.indexBeforeBuckets,bucket_lineage:t.bucketLineage,nullstate:t.isNullState,singlestate:t.isSingleState,query_id:t.qid,template_id:t.templateID,coeff_cost:(typeof t.grammar_costs=='undefined')?-1:t.grammar_costs["{"+t.type+"}"]};if(t.logInfo)y.backend_log_info=t.logInfo;if(t.s_token)y.s_token=t.s_token;if(t.s_categories)y.s_categories=t.s_categories;return y;};s.prototype.buildListTypeaheadRecords=function(){"use strict";var t=[];this.results&&this.results.forEach(function(u,v){if(u.uid!=='search')t.push(this.buildTypeaheadRecord(u,v));}.bind(this));return t;};s.prototype.recordShortcut=function(t){"use strict";this.recordStat('shortcut',1);this.recordStat('shortcut_with_shift',t.shift);};s.prototype.recordStats=function(t,u){"use strict";for(var v in u)this.recordStat(t+'_'+v,u[v]);};s.prototype.getTypeaheadIndex=function(t,u){"use strict";var v=typeof t.groupIndex=='number'?t.groupIndex+1:0;return u-v;};s.prototype.recordQuickSelectInfo=function(t){"use strict";var u={input_query:t.input_query,semantic:t.semantic,type:t.type,position:t.position,with_mouse:t.with_mouse,text:t.text,quick_select:1};this.recordStats('selected',u);this.recordStat('quick_select',1);};s.prototype.recordSelectInfo=function(t){"use strict";var u=t.selected,v=this.getTypeaheadIndex(u,t.index),w={};if(u.uid=='search'){w.selected_search=1;}else{w=this.buildTypeaheadRecord(u);var x=(w.type=='friend'?'user':w.type);w.position=v;w[x]=1;}w.with_mouse=t.clicked?1:0;w.quick_select=0;w.input_query=this.userText;w.input_fragments=JSON.stringify(this.core.currentQuery.toStruct());var y=u.dataGT?{gt:JSON.parse(u.dataGT)}:{},z={href:u.path};g('click',z,null,null,y);m('search').uai('click');this.recordStats('selected',w);this.recordAppendStat('selection_history',{selected:w,candidate_results:this.buildListTypeaheadRecords(),timestamp:o.getTimestamp()});var aa={};this._extraRecorder.forEach(function(ba){ba(t,this.results,aa);}.bind(this));this.recordStat('extra_select_info',JSON.stringify(aa));this.recordStat('selected_with_mouse',t.clicked?1:0);};s.prototype._dataToSubmit=function(){"use strict";this.recordStat('max_results',this.data._maxResults);if(this.stats&&this.stats.selected_input_query){this.recordStat('input_query',this.stats.selected_input_query);}else this.recordStat('input_query',this.userText);this.recordStat('uri',l().toString());if(!this.stats.shortcut){this.recordStat('shortcut',0);this.recordStat('shortcut_with_shift',false);}var t=this.stats;for(var u in this.avgStats){var v=this.avgStats[u];t[u]=v[0]/v[1];}var w={candidate_results:this.buildListTypeaheadRecords(),timestamp:o.getTimestamp(),input_query:this.userText,remote_query_match:this._isQueryMatch};if(this._unsupportedGrammarInfo)h(w,this._unsupportedGrammarInfo);this.recordAppendStat('suggestions_at_end_of_session',w);this.recordAppendStat('query_times',this.queryTimes);if(this.backendQueries.length>0){if(this.backendQueries.length>this.data.logBackendQueriesWindow)this.backendQueries=this.backendQueries.slice(this.backendQueries.length-this.data.logBackendQueriesWindow);this.recordStat('backend_queries',this.backendQueries);}if(p.taSessionLoggingSample){var x=[];this.results.forEach(function(z){x.push([z.text||'',z.category||'',z.subtext||'']);});this.recordStat('raw_suggestions_text',x);}for(var y in this.appendStats)t[y]=JSON.stringify(this.appendStats[y]);return t;};s.prototype.getDataToSubmit=function(){"use strict";return this._dataToSubmit();};s.prototype.reset=function(){"use strict";return this._reset();};s.prototype.submit=function(){"use strict";if(!this._sessionDisabled)r.submit.call(this);this.view.inform('feedback');this._reset();};h(s.prototype,{_endPoint:'/ajax/typeahead/search/record_metrics.php',_sessionEnded:true,_extraRecorder:[],_banzaiRoute:'facebar'});e.exports=s;},null); __d("FacebarTypeaheadGrammarItem.react",["React","FacebarTypeaheadItem.react","FacebarTypeaheadToken.react","FacebarTypeaheadTokenText","cx","fbt"],function(a,b,c,d,e,f,g,h,i,j,k,l){var m={user:"Person"},n=g.createClass({displayName:'FacebarTypeaheadGrammarItem',renderToken:function(){var o=this.props.result.decoration,p=this.props.result.ambiguity,q=p&&p.text,r=(o&&o.entity)||(p&&p.entity);if(this.props.result.isRecent){var s="Recent search";return (i({text:[s],innerClass:"_53ab"}));}else if(q){return (i({text:j.text(q)}));}else if(r)return (i({text:j.textForEntity(r,m),limit:2,leadingMiddot:true}));},render:function(){var o=this.renderToken(),p=o&&!o.props.leadingMiddot;return this.transferPropsTo(h({className:"_207",valign:p,token:o}));}});e.exports=n;},null); __d("FacebarTypeaheadKeywordItem.react",["FacebarTypeaheadItem.react","FacebarTypeaheadToken.react","React","cx","fbt"],function(a,b,c,d,e,f,g,h,i,j,k){var l=i.createClass({displayName:'FacebarTypeaheadKeywordItem',render:function(){var m=["Search"];if(this.props.result.isTrending){m.push("Trending");}else if(this.props.result.type=='related')m=["Related search"];var n=h({text:m,innerClass:"_53ab"});return this.transferPropsTo(g({className:"_207",token:n,prefix:this.props.result.query_string.toLowerCase()}));}});e.exports=l;},null); __d("FacebarTypeaheadTrendingItem.react",["FacebarTypeaheadItem.react","FacebarTypeaheadToken.react","React","cx"],function(a,b,c,d,e,f,g,h,i,j){var k=i.createClass({displayName:'FacebarTypeaheadTrendingItem',render:function(){var l=this.props.result.articleTitle||'',m=h({text:[l],innerClass:"_53ab",leadingMiddot:true});return this.transferPropsTo(g({className:"_207",token:m,valign:false}));}});e.exports=k;},null); __d("FacebarTypeaheadNodeItem.react",["React","DOM"],function(a,b,c,d,e,f,g,h){var i=g.createClass({displayName:'FacebarTypeaheadNodeItem',render:function(){var j=this.props.result.node;return this.transferPropsTo(g.DOM.li(null,!h.isElementNode(j)?j:null));},attachNode:function(j){var k=this.props.result.node;if(h.isElementNode(k))h.setContent(j,k);},componentDidMount:function(){this.attachNode(this.getDOMNode());},componentDidUpdate:function(j,k,l){this.attachNode(this.getDOMNode());},shouldComponentUpdate:function(j){return this.props.result.node!==j.result.node;}});e.exports=i;},null); __d("FacebarTypeaheadWebSuggestionItem.react",["FacebarTypeaheadItem.react","FacebarTypeaheadToken.react","React","cx","fbt"],function(a,b,c,d,e,f,g,h,i,j,k){var l={EXACT_MATCH:1,BING:2,BING_POPULAR:3,WEBSUGGESTIONS_AS_KEYWORDS:4},m=i.createClass({displayName:'FacebarTypeaheadWebSuggestionItem',renderToken:function(){if(this.props.result.isLockedWebSearchMode)return;var n=this.props.result.websuggestion_source,o;if(n===l.WEBSUGGESTIONS_AS_KEYWORDS){o="Search";}else if(n===l.BING_POPULAR){o="Popular Web Search";}else o="Web Search";return (h({innerClass:"_57q5",text:[o]}));},render:function(){this.props.result.icon_class="_6-a";return this.transferPropsTo(g({className:"_207",token:this.renderToken()}));}});e.exports=m;},null); __d("FacebarTypeaheadList.react",["React","ReactPropTypes","StaticContainer.react","FacebarTypeaheadEntityItem.react","FacebarTypeaheadGrammarItem.react","FacebarTypeaheadKeywordItem.react","FacebarTypeaheadTrendingItem.react","FacebarTypeaheadNodeItem.react","FacebarTypeaheadWebSuggestionItem.react","LoadingIndicator.react","FacebarJSConstants","cx","fbt"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s){var t={grammar:k,node:n,trending:m,related:l,websuggestion:o};t[q.browseTypes.keyword]=l;var u=g.createClass({displayName:'FacebarTypeaheadList',propTypes:{results:h.array,onRender:h.func,onSelect:h.func.isRequired,onHighlight:h.func.isRequired},getItemComponent:function(v,w){var x=v.type,y;if(v.results_set_type===q.browseTypes.keyword)x=q.browseTypes.keyword;if(v.node)x='node';if(x==null)x='entity';y=t[x];if(y==null){y=j;x='entity';}return {type:x,constructor:y};},renderItem:function(v,w){var x=this.getItemComponent(v);x=x.constructor({result:v,onClick:this.handleClick.bind(null,v),onMouseEnter:this.handleMouseEnter.bind(null,v)});return (i({key:v.semantic||v.uid||v.tuid},x));},renderFooter:function(){var v=(("_3su")+(!this.props.loading?' '+"hidden_elem":''));return (g.DOM.li({className:v},this.props.loading,g.DOM.div({className:"_21f"},"Retrieving suggestions",p({size:"medium",color:"white"}))));},render:function(){var v=this.props.results;return (g.DOM.ul({className:"_21c",role:"listbox"},v&&v.map(this.renderItem),this.renderFooter()));},handleClick:function(v,w){if(!w.nativeEvent.isMiddleClick()&&!w.nativeEvent.getModifiers().any){this.props.onSelect(v);w.preventDefault();}},handleMouseEnter:function(v){this.props.onHighlight(v);},componentDidUpdate:function(v,w,x){this.props.onRender();},shouldComponentUpdate:function(v){return this.props.loading!==v.loading||this.props.results!==v.results;}});e.exports=u;},null); __d("FacebarTypeaheadView",["Arbiter","CSS","ContextualLayer","DOM","FacebarGlobalOptions","FacebarTypeaheadList.react","Parent","React","TypeaheadView","copyProperties","performanceNow","csx","cx","fbt","URI","Link.react"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v){var w='unimplemented';for(var x in o)if(o.hasOwnProperty(x))z[x]=o[x];var y=o===null?null:o.prototype;z.prototype=Object.create(y);z.prototype.constructor=z;z.__superConstructor__=o;function z(aa,ba){"use strict";o.call(this,aa,ba);this.sid='';this.index=-1;this.warningShown=false;this.autoSelect=false;this.loading=false;this.handleRender=this.handleRender.bind(this);this.handleHighlight=this.handleHighlight.bind(this);this.handleSelect=this.handleSelect.bind(this);this.events=['highlight','render','filter'];}z.prototype.init=function(){"use strict";this.initializeElements();};z.prototype.initGSV2Elements=function(){"use strict";var aa=this.element;this.contentKeyword=j.find(aa,"._f7s");this.contentEntity=j.find(aa,"._f7t");this.keywordResultsContainer=j.create('div');this.entityResultsContainer=j.create('div');this.keywordResults=[];this.entityResults=[];};z.prototype.initGSV2Construct=function(){"use strict";this.contentKeyword.appendChild(this.keywordResultsContainer);this.contentEntity.appendChild(this.entityResultsContainer);this.resultsContainer.appendChild(this.contentKeyword);this.resultsContainer.appendChild(this.contentEntity);};z.prototype.initializeElements=function(){"use strict";var aa=this.element;this.isGSV2=k.graphSearchV2;this.content=j.find(aa,"._21r");this.warningNode=j.find(aa,"._553e");this.blockNotificationNode=j.find(aa,"._2hh");this.resultsContainer=j.create('div');if(this.isGSV2)this.initGSV2Elements();this.renderTypeaheadList();this.content.appendChild(this.resultsContainer);if(this.isGSV2)this.initGSV2Construct();};z.prototype.initializeLayer=function(){"use strict";this.layer=new i({context:m.byClass(this.causalElement,"_585-"),position:'below',causalElement:this.causalElement},this.element);var aa=this.layer.getContentRoot();this.root=j.find(aa,"._50c9");h.addClass(aa,"_5tlx");};z.prototype.setInputElement=function(aa){"use strict";this.setAccessibilityControlElement(aa);this.causalElement=aa;this.initializeLayer();};z.prototype.setAutoSelect=function(aa){"use strict";this.autoSelect=aa;if(this.index===-1&&aa)this.first();};z.prototype.handleHighlight=function(aa){"use strict";this.highlight(this.results.indexOf(aa),false);};z.prototype.handleSelect=function(aa){"use strict";this.handleHighlight(aa);this.select(true);};z.prototype.show=function(){"use strict";if(!this.visible){this.inform('beforeShow',this.layer);var aa=y.show.call(this);this.first();this.layer.show();this.layer.updatePosition();this.inform('show');g.inform('layer_shown',{type:'FacebarTypeahead'});return aa;}};z.prototype.hide=function(){"use strict";if(this.visible){this.layer.hide();y.hide.call(this);this.inform('hide');g.inform('layer_hidden',{type:'FacebarTypeahead'});}return this;};z.prototype.select=function(aa){"use strict";var ba=this.results&&this.results[this.index];if(!ba){this.inform('quickSelect');return;}var ca=this.inform('beforeSelect',{index:this.index,selected:ba});if(ca!==false)y.select.call(this,aa);};z.prototype.divideResults=function(aa){"use strict";this.keywordResults=[];this.entityResults=[];aa.forEach(function(ba){if(ba.type==='keyword'){this.keywordResults.push(ba);}else this.entityResults.push(ba);}.bind(this));return this.keywordResults.concat(this.entityResults);};z.prototype.buildResults=function(aa){"use strict";aa.forEach(function(ca){ca.query_string=this.value.toString();}.bind(this));this.results=aa;if(this.isGSV2)this.results=this.divideResults(aa);var ba=q();this.renderTypeaheadList({results:this.results,loading:this.loading});this.inform('logPerformanceTiming',{field:'build_results_set_props_duration',value:q()-ba});return this.resultsContainer;};z.prototype.getGSV2Items=function(){"use strict";var aa=y.getItems.call(this),ba=aa.slice(0,this.keywordResults.length),ca=aa.slice(this.keywordResults.length+1,-1);aa=ba.concat(ca);return aa;};z.prototype.getItems=function(){"use strict";if(this.isGSV2)return this.getGSV2Items();return y.getItems.call(this).slice(0,-1);};z.prototype.handleRender=function(){"use strict";this.items=this.getItems();};z.prototype.render=function(aa,ba,ca,da){"use strict";this.inform('filter',{results:ba,value:aa});this.seeMoreResult=null;if(ba.length&&aa.getLength()){this.seeMoreResult=this.inform('seeMore',{value:aa,results:ba});if(!this.loading&&this.seeMoreResult)ba.push(this.seeMoreResult);}var ea=ba[0];if(da){this.showWarning(t._("There are no results for '{query}'",[t.param("query",aa.toString())]));}else if(ea&&ea.results_set_type===w){if(!ea.error_info.suppress)this.showWarning(ea.error_info.errorMessage||"This search isn't currently supported.");}else this.hideWarning();if(this.inform('removeUnimplementedGrammar')!==false)ba=ba.filter(function(fa){return fa.results_set_type!==w;}.bind(this));y.render.call(this,aa,ba,ca);};z.prototype.reset=function(){"use strict";this.index=-1;this.items=[];this.results=[];this.value='';this.buildResults([]);this.inform('reset');return this;};z.prototype.showBlockNotification=function(aa){"use strict";var ba=u('https://www.facebook.com').setPath('/settings').addQueryData('tab','blocking'),ca=n.DOM.div(null,t._("You've blocked {fullName}. For more info on privacy and blocking, go to your {settings}.",[t.param("fullName",aa),t.param("settings",v({href:{url:ba}},"settings"))]));h.show(this.blockNotificationNode);n.renderComponent(ca,this.blockNotificationNode);};z.prototype.hideBlockNotification=function(){"use strict";h.hide(this.blockNotificationNode);j.setContent(this.blockNotificationNode,'');};z.prototype.showWarning=function(aa){"use strict";h.show(this.warningNode);j.setContent(this.warningNode,aa);this.warningShown=true;this.highlight(-1,false);};z.prototype.hideWarning=function(){"use strict";h.hide(this.warningNode);this.warningShown=false;this.highlight(this.index,false);};z.prototype.setLoading=function(aa){"use strict";if(this.loading!=aa){this.loading=aa;if(this.seeMoreResult){if(this.loading){this.results.splice(this.results.indexOf(this.seeMoreResult),1);}else this.results.push(this.seeMoreResult);this.buildResults(this.results);}else this.renderTypeaheadList({results:this.results,loading:aa});}};z.prototype.first=function(){"use strict";this.index=this.autoSelect?0:-1;this.highlight(this.index);};z.prototype.prev=function(){"use strict";if(this.index<=0)this.index=this.items.length;this.ignoreMouseover=true;y.prev.call(this);};z.prototype.next=function(){"use strict";if(this.index+1>=this.items.length)this.index=-1;this.ignoreMouseover=true;y.next.call(this);};z.prototype.highlight=function(aa,ba){"use strict";ba=ba!==false&&(this.index!=aa);if(!ba||this.inform('beforeHighlight')!==false){var ca=this.warningShown||!this.autoSelect?-1:0;y.highlight.call(this,Math.max(ca,aa),ba);}};z.prototype.copyProps=function(aa){"use strict";return p({onRender:this.handleRender,onHighlight:this.handleHighlight,onSelect:this.handleSelect},aa);};z.prototype.renderList=function(aa,ba){"use strict";n.renderComponent(l(this.copyProps(aa)),ba);};z.prototype.renderGSV2TypeaheadList=function(aa){"use strict";var ba=this.copyProps(aa),ca=this.copyProps(aa);ba.results=this.keywordResults;ba.loading=false;ca.results=this.entityResults;this.renderList(ba,this.keywordResultsContainer);this.renderList(ca,this.entityResultsContainer);h.conditionShow(this.contentKeyword,!!this.keywordResults.length);h.conditionShow(this.contentEntity,!!this.entityResults.length);};z.prototype.renderTypeaheadList=function(aa){"use strict";aa=aa||{};if(this.isGSV2){this.renderGSV2TypeaheadList(aa);}else this.renderList(aa,this.resultsContainer);};e.exports=z;},null); __d("FacebarTypeaheadAutoWidth",["CSS","cx"],function(a,b,c,d,e,f,g,h){function i(j){"use strict";this._view=j.view;}i.prototype.enable=function(){"use strict";g.addClass(this._view.element,"_5tw_");};i.prototype.disable=function(){"use strict";g.removeClass(this._view.element,"_5tw_");};e.exports=i;},null); __d("FacebarTypeaheadDecorateEntities",["arrayContains","copyProperties","emptyFunction"],function(a,b,c,d,e,f,g,h,i){function j(n){var o=[];n.forEach(function(p){if(p.isType('ent'))o.push(p.getUID());});return o;}function k(n,o){var p=null;n.structure.forEach(function(q){if(q.isType('ent')&&!g(o,q.getUID()))p=q;});return p;}function l(n,o,p){n.forEach(function(q){var r=k(q,o);q.decoration={entity:r&&p.getEntryForFragment(r)};});}function m(n){"use strict";this._typeahead=n;}m.prototype.enable=function(){"use strict";this._typeahead.view.subscribe('filter',function(n,o){l(o.results,j(this._typeahead.core.getValue()),this._typeahead.data);}.bind(this));};h(m.prototype,{disable:i});e.exports=m;},null); __d("FacebarTypeaheadDisambiguateResults",["FacebarDisambiguationDialog","FacebarStructuredFragment","FacebarStructuredText","URI","copyProperties","emptyFunction","getObjectValues"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){function n(w,x){var y={};w.forEach(function(ba){if(ba.type=='grammar'){var ca=x(ba.structure).toLowerCase();y[ca]=y[ca]||[];y[ca].push(ba);}});var z=[];for(var aa in y)if(y[aa].length>1)z.push(y[aa]);return z;}function o(w){var x=[];w.toArray().forEach(function(y,z){if(y.isType('ent'))x.push(z);});return x;}function p(w,x,y){var z={},aa={},ba={};x.forEach(function(da){var ea=w[0].structure.getFragment(da),fa=ea.getHash();aa[fa]=aa[fa]||[];ba[da]=aa[fa];w.forEach(function(ga){var ha=ga.structure.getFragment(da),ia=ha&&ha.getUID();if(ia&&!z.hasOwnProperty(ia)){aa[fa].push(y.getEntryForFragment(ha));z[ia]=true;}});});for(var ca in ba)if(ba[ca].length<=1)delete ba[ca];return ba;}function q(w,x){var y={},z=[];w.forEach(function(aa){var ba=aa.structure.getFragment(x).getUID();if(!y.hasOwnProperty(ba)){y[ba]=z.length;z.push([]);}z[y[ba]].push(aa);});return z;}function r(w,x,y){var z=w.shift();z.ambiguity.entities=x;y.push.apply(y,w);return z;}function s(w,x){var y=[],z=[],aa=false;w.forEach(function(ca){ca.ambiguity={fragment:null,entities:null,text:null};});n(w,function(ca){return ca.getHash();}).forEach(function(ca){var da=ca[0].structure,ea=o(da),fa=p(ca,ea,x);if(aa){r(ca,fa,y);return;}var ga=ea.pop();if(typeof ga=='number'){var ha=q(ca,ga);aa=ha.length>1;if(aa)delete fa[ga];ha.forEach(function(ia){var ja=r(ia,fa,y);if(aa){var ka=ja.structure.getFragment(ga).getUID();ja.ambiguity.entity=x.getEntry(ka);z.push(ja);}});}});y.forEach(function(ca){var da=w.indexOf(ca);da!=-1&&w.splice(da,1);});n(w,function(ca){return ca.toString();}).forEach(function(ca){ca.forEach(function(da){if(!da.ambiguity.entities)da.ambiguity.text=da.queryTypeText;});});var ba=w.indexOf(z[0]);z.slice(1).forEach(function(ca){var da=w.indexOf(ca);if(da!=-1&&da!=++ba){w.splice(da,1);w.splice(ba,0,ca);}});}function t(w,x){var y=w&&w.ambiguity&&w.ambiguity.entities,z=y&&Object.keys(y).map(Number),aa=x.core.input;if(!z||z.length===0)return false;var ba=function(ea){x.core.executeQuery(u(w,z,ea));},ca=function(){aa.focus();aa.input.moveSelectionToEnd();};y=y?m(y):[];var da=new g(y,w.uri.getPath(),ba,ca,x.getCore().getSessionID());aa.blur();da.show();return true;}function u(w,x,y){var z=w.structure.toArray(),aa=j(w.uri),ba=aa.getPath().split('/');x.forEach(function(ca){var da=z[ca],ea=y.shift(),fa=ba.indexOf(String(da.getUID()));if(fa!=-1)ba[fa]=ea.uid;z[ca]=new h({uid:ea.uid,text:ea.text,type:'ent:'+ea.type});});return {uri:aa.setPath(ba.join('/')),structure:new i(z)};}function v(w){"use strict";this._typeahead=w;}v.prototype.enable=function(){"use strict";this._typeahead.view.subscribe('filter',function(w,x){s(x.results,this._typeahead.data);}.bind(this));this._typeahead.view.subscribe('beforeSelect',function(w,x){return !t(x.selected,this._typeahead);}.bind(this));};k(v.prototype,{disable:l});e.exports=v;},null); __d("FacebarTypeaheadHashtagResult",["HashtagSearchResultUtils"],function(a,b,c,d,e,f,g){function h(i){"use strict";this.$FacebarTypeaheadHashtagResult0=i.getData();}h.prototype.enable=function(){"use strict";this.$FacebarTypeaheadHashtagResult1=this.$FacebarTypeaheadHashtagResult0.subscribe('beforeQuery',this.$FacebarTypeaheadHashtagResult2.bind(this));};h.prototype.$FacebarTypeaheadHashtagResult2=function(i,j){"use strict";if(!j||!j.value)return;var k=this.$FacebarTypeaheadHashtagResult0.getRawStructure(j.value);if(!k||k.is_empty||!k.raw_text)return;var l=g.getHashtagFromQuery(k.raw_text);if(!l)return;var m='hashtag:'+l,n=this.$FacebarTypeaheadHashtagResult0.getEntry(m);if(!n){this.$FacebarTypeaheadHashtagResult0.processEntries([g.makeFacebarEntry(l)]);this.$FacebarTypeaheadHashtagResult0.resultStore.saveResults([g.makeFacebarResult(l)],k,true);}return;};h.prototype.disable=function(){"use strict";this.$FacebarTypeaheadHashtagResult1&&this.$FacebarTypeaheadHashtagResult0.unsubscribe(this.$FacebarTypeaheadHashtagResult1);};e.exports=h;},null); __d("FacebarTypeaheadMagGo",["csx","DOM","Event","$","SubscriptionsHandler"],function(a,b,c,d,e,f,g,h,i,j,k){function l(m){"use strict";this._core=m.getCore();this._view=this._core.view;this._handler=new k();this._selected=null;}l.prototype.enable=function(){"use strict";var m=h.find(j('blueBar'),"._585_");this._handler.addSubscriptions(i.listen(m,'click',this._runQuery.bind(this)),this._view.subscribe('highlight',this._highlight.bind(this)),this._view.subscribe('render',this._render.bind(this)),this._core.subscribe('close',this._close.bind(this)));};l.prototype.disable=function(){"use strict";this._handler.release();};l.prototype._highlight=function(m,n){"use strict";this._selected=n.selected;};l.prototype._render=function(m,n){"use strict";this._selected=this._view.results[this._view.index];};l.prototype._runQuery=function(){"use strict";if(this._selected)return this._core.selectView(null,{selected:this._selected});};l.prototype._close=function(){"use strict";this._selected=null;};e.exports=l;},null); __d("FacebarTypeaheadNavigation",["Arbiter","FacebarNavigation","copyProperties","emptyFunction"],function(a,b,c,d,e,f,g,h,i,j){function k(l){"use strict";this._core=l.core;this._preserveQuery=false;this._typeahead=l;}k.prototype.enable=function(){"use strict";h.registerBehavior(this);this._core.subscribe('execute',this.executedUserQuery.bind(this));};k.prototype.executedUserQuery=function(l,m){"use strict";this._preserveQuery=true;};k.prototype.pageTransition=function(){"use strict";if(!this._preserveQuery){this._core.close();this._core.reset();}else this._preserveQuery=false;};k.prototype.setPageQuery=function(l){"use strict";l=this._core.setPageQuery(l);this._typeahead.inform('navigation',l,g.BEHAVIOR_PERSISTENT);};i(k.prototype,{disable:j});e.exports=k;},null); __d("FacebarTypeaheadPrefixLengthOrderedCache",["copyProperties","emptyFunction","Arbiter"],function(a,b,c,d,e,f,g,h,i){function j(k){"use strict";this._typeahead=k;}j.prototype.enable=function(){"use strict";this._typeahead.data.inform('setSortFunction',function(k,l){if(k.cache_id_length!=l.cache_id_length)return k.cache_id_length-l.cache_id_length;var m=(k.cost||0)-(l.cost||0);if(m!==0)return m;return (k.semantic||'').localeCompare(l.semantic||'');},i.BEHAVIOR_STATE);};g(j.prototype,{disable:h});e.exports=j;},null); __d("FacebarTypeaheadQuickSelect",["FacebarStructuredText","URI"],function(a,b,c,d,e,f,g,h){var i='/search/web/direct_search.php';function j(k){"use strict";this._core=k.getCore();this._view=k.getView();this._input=this._core.input;this._beforeSelectListener=null;this._quickSelectListener=null;}j.prototype.enable=function(){"use strict";this._beforeSelectListener=this._view.subscribe('beforeSelect',this._quickSelect.bind(this));this._quickSelectListener=this._view.subscribe('quickSelect',this._quickSelect.bind(this));};j.prototype._quickSelect=function(k,l){"use strict";if(l&&l.selected&&l.selected.uid!=='search')return true;var m=this._input.getValue().toArray(),n=new g(m),o=n.toString();if(!o)return true;var p=h(i).addQueryData('q',o),q={input_query:o,type:'quickselect',text:o,position:0,with_mouse:0,semantic:'quickselect('+p.toString()+')',extra_uri_params:{source:'quickselect',sid:this._core.getSessionID()},uri:p};this._core.inform('quickSelectRedirect',q);this._core.executeQuery(q);return false;};j.prototype.disable=function(){"use strict";this._beforeSelectListener&&this._view.unsubscribe(this._beforeSelectListener);this._quickSelectListener&&this._view.unsubscribe(this._quickSelectListener);};e.exports=j;},null); __d("FacebarTypeaheadRecorderBasic",["FacebarTypeaheadRecorder","copyProperties"],function(a,b,c,d,e,f,g,h){function i(j){"use strict";this._typeahead=j;}i.prototype.enable=function(){"use strict";var j=this._typeahead;this._recorder=new g(j);};i.prototype.disable=function(){"use strict";this._typeahead.unsubscribe(this._subscription);this._recorder=null;this._subscription=null;};h(i.prototype,{_subscription:null});e.exports=i;},null); __d("FacebarTypeaheadSearchMap",["URI"],function(a,b,c,d,e,f,g){function h(i){"use strict";this._typeahead=i;this._subscription=null;}h.prototype.enable=function(){"use strict";this._subscription=this._typeahead.core.subscribe('execute',function(i,j){if(this._moveMapToQuery(j))return true;}.bind(this));};h.prototype._moveMapToQuery=function(i){"use strict";var j=i.results_set_type==='browse_type_place'||i.results_set_type==='page',k=window.searchmap&&window.location.pathname==='/nearby';if(!j||i.is_redirect){return false;}else if(k){window.searchmap.doFacebarSearch(i);return true;}else{var l=g('/nearby').addQueryData({query:i.structure._textHash,query_path:i.uri.getPath(),ref:'typeahead'});l.go();return true;}};h.prototype.disable=function(){"use strict";this._subscription&&this._subscription.unsubscribe();};e.exports=h;},null); __d("FacebarTypeaheadSeeMoreSerp",["cx","FacebarStructuredText","FacebarURI","fbt","URI","React"],function(a,b,c,d,e,f,g,h,i,j,k,l){function m(n){"use strict";this.$FacebarTypeaheadSeeMoreSerp0=n.getCore();this.$FacebarTypeaheadSeeMoreSerp1=this.$FacebarTypeaheadSeeMoreSerp0.view;}m.prototype.enable=function(){"use strict";this.$FacebarTypeaheadSeeMoreSerp2=this.$FacebarTypeaheadSeeMoreSerp1.subscribe('seeMore',this.$FacebarTypeaheadSeeMoreSerp3.bind(this));};m.prototype.disable=function(){"use strict";this.$FacebarTypeaheadSeeMoreSerp2.unsubscribe();};m.prototype.$FacebarTypeaheadSeeMoreSerp3=function(n,o){"use strict";var p=o.value.toString().trim();p=p.replace(/web\ssearch[\:]*\s*/i,'');var q=j._("See more results for \"{query}\"",[j.param("query",p)]),r=l.DOM.div({className:"_57zy calltoaction",'aria-label':q},l.DOM.span({className:"text"},l.DOM.span({className:"seeMore"},q))),s=k(this.$FacebarTypeaheadSeeMoreSerp1.seeMoreSerpEndpoint).addQueryData('q',p).addQueryData('sid',this.$FacebarTypeaheadSeeMoreSerp0.getSessionID());s=i.getQualifiedURI(s);return {uid:'see_more_serp',node:r,structure:new h(),search:true,uri:s,semantic:'seemore('+p+')',type:'see_more_serp',text:p};};e.exports=m;},null); __d("FacebarTypeaheadSelectAll",["requestAnimationFrame"],function(a,b,c,d,e,f,g){function h(i){"use strict";this._core=i.getCore();this._listener=null;}h.prototype.enable=function(){"use strict";var i=this._core.input;this._listener=this._core.subscribe('focus',function(j,k){var l=k&&k.catchup;l||g(function(){i.selectInput();});});};h.prototype.disable=function(){"use strict";this._listener&&this._core.unsubscribe(this._listener);};e.exports=h;},null); __d("FacebarTypeaheadShortcut",["FacebarTypeaheadShortcutConfig","KeyEventController","Run","copyProperties","emptyFunction"],function(a,b,c,d,e,f,g,h,i,j,k){function l(m){"use strict";this._input=m.core.input;this._view=m.view;this._listener=null;}l.prototype.enable=function(){"use strict";this._registerListener();};l.prototype._registerListener=function(){"use strict";h.registerKey('SLASH',this._handleKeydown.bind(this));i.onLeave(function(){setTimeout(this._registerListener.bind(this),0);}.bind(this));};l.prototype._handleKeydown=function(m){"use strict";var n=m.getModifiers().shift;if(n&&!g.gkWebShortcut)return;this._view.setAutoSelect(true);this._input.focus();this._input.selectInput();this._input.inform('shortcut',{shift:n});return false;};j(l.prototype,{disable:k});e.exports=l;},null); __d("FacebarTypeaheadSizeAdjuster",["copyProperties","createArrayFrom","clip","emptyFunction","Style","Vector"],function(a,b,c,d,e,f,g,h,i,j,k,l){var m=12,n=20,o=50,p=200,q=5;function r(t){return l.getElementDimensions(t).x;}function s(t){"use strict";this._core=t.getCore();this._view=this._core.view;this._input=this._core.input;this._cachedSizes={};this._appliedSize=null;this._defaultSize=this.getDefaultFontSize();this._calculatedSize=this._defaultSize;this._containerWidth=this.getContainerWidth();}s.prototype.enable=function(){"use strict";this._input.subscribe('change',this.adjustFontSize.bind(this));this.adjustFontSize();};s.prototype.getContainerWidth=function(){"use strict";return l.getElementDimensions(this._input.getElement()).x;};s.prototype.getDefaultFontSize=function(){"use strict";var t=k.get(this._input.getElement(),'font-size'),u=/^([\d\.]+)px$/.exec(t),v=u&&Number(u[1]);return Math.max(m,Math.min(n,v));};s.prototype.calculateFontSize=function(){"use strict";var t=this.getTextWidth(),u=this._calculatedSize;if(t>this._containerWidth-o){u--;}else if(t<this._containerWidth-p)u++;this._calculatedSize=i(u,m,this._defaultSize);return this._calculatedSize;};s.prototype.getTextWidth=function(){"use strict";var t=this._calculatedSize+this.getValueKey();if(!this._cachedSizes.hasOwnProperty(t))this._cachedSizes[t]=this.measureTextWidth();return this._cachedSizes[t];};s.prototype.getValueKey=function(){"use strict";var t=this._core.getValue().getHash(),u=q*Math.floor(t.length/q);return t.substr(0,u);};s.prototype.measureTextWidth=function(){"use strict";var t=this._input.getRawInputElement().childNodes;return h(t).reduce(function(u,v){return u+r(v);},0);};s.prototype.adjustFontSize=function(){"use strict";for(var t=0;t<10;t++){var u=this.calculateFontSize();if(u!=this._appliedSize){this._appliedSize=u;k.set(this._input.getElement(),'font-size',u+'px');k.set(this._view.content,'font-size',u+'px');}else break;}};g(s.prototype,{disable:j});e.exports=s;},null);