/*1328829986,169776320*/ if (window.CavalryLogger) { CavalryLogger.start_js(["ghcdO"]); } function incorporate_fragment(a){var b=/^(?:(?:[^:\/?#]+):)?(?:\/\/(?:[^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/,c='';a.href.replace(b,function(d,e,f,g){var h,i;h=i=e+(f?'?'+f:'');if(g){g=g.replace(/^(!|%21)/,'');if(g.charAt(0)=='/')h=g.replace(/^\/+/,'/');}if(h!=i){if(window._script_path)document.cookie="rdir="+window._script_path+"; path=/; domain="+window.location.hostname.replace(/^.*(\.facebook\..*)$/i,'$1');window.location.replace(c+h);}});}if(window._incorporate_fragment)incorporate_fragment(window.location); window.__DEV__=window.__DEV__||0;if(!window.skipDomainLower&&document.domain.toLowerCase().match(/(^|\.)facebook\..*/))document.domain=window.location.hostname.replace(/^.*(facebook\..*)$/i,'$1');function bagofholding(){}function bagof(a){return function(){return a;};}if(!Date.now)Date.now=function now(){return new Date().getTime();};if(!Array.isArray)Array.isArray=function(a){return Object.prototype.toString.call(a)=='[object Array]';};Env=window.Env||{};Env.start=Env.start||Date.now();document.documentElement.className=document.documentElement.className.replace('no_js',''); window.require||(function(){var a={},b={},c=0,d=this,e=1,f=2,g='special',h='exports',i='dependencies',j='module',k='waiting',l='factory',m=undefined,n='define',o='global',p='require',q='requireLazy',r='requireDynamic',s='context';function t(ea){var fa=a[ea],ga,ha;if(fa[k]&&fa[g]&f)w();if(!fa[h]){var ia=fa[h]={},ja=fa[l];if(Object.prototype.toString.call(ja)==='[object Function]'){var ka=[],la=fa[i],ma=la.length;if(fa[g]&f)ma=Math.min(ma,ja.length);for(ha=0;ha=o){for(v in p){x.push(p[v].signal);w.push(p[v].error);}p={};}else for(v in p){var y=p[v].signal,z=window.getComputedStyle?getComputedStyle(y,null):y.currentStyle;if(z&&parseInt(z.height,10)>1){w.push(p[v].load);x.push(y);delete p[v];}}for(var aa=0;aa<\/script\>');}var da=z.onload;z.onload=function(){j('t_layout');da&&da();g.inform(k.ONLOAD,true,i);};z.onbeforeunload=function(){var ea={};g.inform(k.ONBEFOREUNLOAD,ea,i);if(!ea.warn)g.inform('onload/exit',true);return ea.warn;};}var v=g.registerCallback(function(){j('t_onload');g.inform(k.ONLOAD_CALLBACK,true,i);},[k.ONLOAD]),w=g.registerCallback(function(){j('t_domcontent');g.inform(k.ONLOAD_DOMCONTENT_CALLBACK,true,i);},[k.ONLOAD_DOMCONTENT]);u();e.exports={Event:k,runOnload:m,runAfterload:n,runOnleave:q,runBeforeUnload:o,runOnUnload:p};var x=b('copyProperties');x(a,{OnloadEvent:k,onloadRegister_DEPRECATED:m,onloadRegister:function(){return m.apply(this,arguments);},onafterloadRegister_DEPRECATED:n,onafterloadRegister:function(){return n.apply(this,arguments);},onleaveRegister:q,onbeforeunloadRegister:o,onunloadRegister:p,domcontent_callback:w,onload_callback:v,_domcontentready:t,removeHook:s,_addHook:r});},3); __e("EagleEye",["Arbiter","bootloader","Env","onload","Util"],function(a,b,c,d,e,f){var g=b('Arbiter'),h=b('bootloader'),i=b('Env'),j=b('onload'),k=b('Util'),l=i.eagleEyeConfig||{},m='_e_',n=(window.name||'').toString();if(n.length==7&&n.substr(0,3)==m){n=n.substr(3);}else{n=l.seed;if(window==window.top)window.name=m+n;}var o=(window.location.protocol=='https:'&&document.cookie.match(/\bcsm=1/))?'; secure':'',p=m+n+'_',q=new Date(Date.now()+604800000).toGMTString(),r=window.location.hostname.replace(/^.*(facebook\..*)$/i,'$1'),s='; expires='+q+';path=/; domain='+r+o,t=0,u,v=l.sessionStorage&&a.sessionStorage,w=document.cookie.length,x=false,y=Date.now();function z(ea){var fa=2166136261;for(var ga=0,ha=ea.length;ga>7;fa+=fa<<3;fa^=fa>>17;fa+=fa<<5;return (fa|0)+2147483648;}function aa(ea){return p+(t++)+'='+encodeURIComponent(ea)+s;}function ba(){var ea=[],fa=false,ga=0,ha=0;this.isEmpty=function(){return !ea.length;};this.enqueue=function(ia,ja){if(ja){ea.unshift(ia);}else ea.push(ia);};this.dequeue=function(){ea.shift();};this.peek=function(){return ea[0];};this.clear=function(ia){w=Math.min(w,document.cookie.length);if(!x&&(new Date()-y>60000))x=true;var ja=!ia&&(document.cookie.search(m)>=0),ka=!!i.cookie_header_limit,la=i.cookie_count_limit||19,ma=i.cookie_header_limit||3950,na=la-5,oa=ma-1000;while(!this.isEmpty()){var pa=aa(this.peek());if(ka&&(pa.length>ma||(x&&pa.length+w>ma))){this.dequeue();continue;}if((ja||ka)&&((document.cookie.length+pa.length>ma)||(document.cookie.split(';').length>la)))break;document.cookie=pa;ja=true;this.dequeue();}var qa=Date.now();if(ia||!fa&&ja&&((ha>0)&&(Math.min(10*Math.pow(2,ha-1),60000)+gaoa)||(document.cookie.split(';').length>na))){var ra=new Image(),sa=this,ta=i.tracking_domain||'';fa=true;ra.onload=function _EagleEye_logged(){fa=false;ha=0;sa.clear();};ra.onerror=ra.onabort=function _EagleEye_error(){fa=false;ga=Date.now();ha++;};var ua=i.fb_isb?'&fb_isb='+i.fb_isb:'',va='&__user='+i.user;ra.src=ta+'/ajax/nectar.php?asyncSignal='+(Math.floor(Math.random()*10000)+1)+ua+va+'&'+(!ia?'':'s=')+qa;}};}u=new ba();if(v){var ca=function(){var ea=0,fa=ea;function ga(){var ja=sessionStorage.getItem('_e_ids');if(ja){var ka=(ja+'').split(';');if(ka.length==2){ea=parseInt(ka[0],10);fa=parseInt(ka[1],10);}}}function ha(){var ja=ea+';'+fa;sessionStorage.setItem('_e_ids',ja);}function ia(ja){return '_e_'+((ja!==undefined)?ja:ea++);}this.isEmpty=function(){return fa===ea;};this.enqueue=function(ja,ka){var la=ka?ia(--fa):ia();sessionStorage.setItem(la,ja);ha();};this.dequeue=function(){this.isEmpty();sessionStorage.removeItem(ia(fa));fa++;ha();};this.peek=function(){var ja=sessionStorage.getItem(ia(fa));return ja?(ja+''):ja;};this.clear=u.clear;ga();};u=new ca();}var da={log:function(ea,fa,ga){if(i.no_cookies)return;var ha=[n,Date.now(),ea].concat(fa);ha.push(ha.length);function ia(){var ja=JSON.stringify(ha);try{u.enqueue(ja,!!ga);u.clear(!!ga);}catch(ka){if(v&&(ka.code===1000)){u=new ba();v=false;ia();}}}if(a.JSON){ia();}else h.loadComponents('json',ia);},createLogger:function(ea,fa){fa=(fa===undefined)?1:fa;var ga=function(ha,ia){if(ga.enabled)da.log(ea,ha,ia);};ga.enabled=false;ga._key=(i.user||Math.random())+ea;ga.enabled=(z(ga._key)%65535/65535)<=fa;return ga;},getSessionID:function(){return n;}};a.EagleEye=e.exports=da;},3); __e("setUECookie",["Env"],function(a,b,c,d,e,f){var g=b("Env");function h(i){if(!g.no_cookies){var j=0;if(a.afterloaded){j=2;}else if(a.loaded)j=1;document.cookie="act="+encodeURIComponent(i+":"+j)+"; path=/; domain="+window.location.hostname.replace(/^.*(\.facebook\..*)$/i,'$1');}}e.exports=h;}); __e("json",[],function(global,require,requireDynamic,requireLazy,module,exports){if(!this.JSON)this.JSON={};(function(){function f(n){return n<10?'0'+n:n;}if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+f(this.getUTCMonth()+1)+'-'+f(this.getUTCDate())+'T'+f(this.getUTCHours())+':'+f(this.getUTCMinutes())+':'+f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function')value=value.toJSON(key);if(typeof rep==='function')value=rep.call(holder,key,value);switch(typeof value){case 'string':return quote(value);case 'number':return isFinite(value)?String(value):'null';case 'boolean':case 'null':return String(value);case 'object':if(!value)return 'null';gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i-1;},addClass:function(i,j){i=g(i);if(j&&!h.hasClass(i,j))i.className=i.className+' '+j;return i;},removeClass:function(i,j){i=g(i);if(h.hasClass(i,j))i.className=i.className.replace(new RegExp('(^|\\s)'+j+'(?:\\s|$)','g'),'$1').replace(/\s+/g,' ').replace(/^\s*|\s*$/g,'');return i;},toggleClass:function(i,j){return h.conditionClass(i,j,!h.hasClass(i,j));},conditionClass:function(i,j,k){return (k?h.addClass:h.removeClass)(i,j);},show:function(i){h.removeClass(i,'hidden_elem');},hide:function(i){h.addClass(i,'hidden_elem');},conditionShow:function(i,j){h.conditionClass(i,'hidden_elem',!j);}};a.CSS=e.exports=h;},3); __e("Parent",["css-core"],function(a,b,c,d,e,f){var g=b("css-core"),h={byTag:function(i,j){j=j.toUpperCase();while(i&&i.nodeName!=j)i=i.parentNode;return i;},byClass:function(i,j){while(i&&!g.hasClass(i,j))i=i.parentNode;return i;},byAttribute:function(i,j){while(i&&(!i.getAttribute||!i.getAttribute(j)))i=i.parentNode;return i;}};e.exports=h;}); __e("legacy:parent",["Parent"],function(a,b,c,d){a.Parent=b('Parent');},3); __e("trackReferrer",["Parent"],function(a,b,c,d,e,f){var g=b("Parent");function h(i,j){i=g.byAttribute(i,'data-referrer');if(i){var k=/^(?:(?:[^:\/?#]+):)?(?:\/\/(?:[^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/.exec(j)[1]||'';if(!k)return;var l=k+'|'+i.getAttribute('data-referrer'),m=new Date();m.setTime(Date.now()+1000);document.cookie="x-src="+encodeURIComponent(l)+"; "+"expires="+m.toGMTString()+";path=/; domain="+window.location.hostname.replace(/^.*(\.facebook\..*)$/i,'$1');}return i;}e.exports=h;}); __e("legacy:referrer-tracker",["trackReferrer"],function(a,b,c,d){a.trackReferrer=b('trackReferrer');},3); __e("UserNoOp",[],function(a,b,c,d,e,f){var g=function(){},h=function(){return this;};g.prototype={add_event:h,add_data:h,set_ua_id:h,set_namespace:h};e.exports=g;}); __e("FunctionUtils",[],function(a,b,c,d,e,f){function g(h,i,j,k){var l,m=function(){var n=arguments,o=this,p=function(){l=null;h.apply(o,n);};j&&m.reset();if(j||!l)l=setTimeout(p,i,k);};m.reset=function(){l&&clearTimeout(l);l=null;};return m;}e.exports={debounce:function(h,i,j){return g(h,i,true,j);},throttle:function(h,i,j){return g(h,i,false,j);}};}); __e("userAction",["function-extensions","Arbiter","EagleEye","FunctionUtils","copyProperties","hasArrayNature"],function(a,b,c,d,e,f){b("function-extensions");var g=b("Arbiter"),h=b("EagleEye"),i=b("FunctionUtils"),j=b("copyProperties"),k=b("hasArrayNature");function l(s,t,u){var v=s+'/'+t;j(this,{ue:v,_ua_id:null,_ts:s,_ns:null,_start_ts:s,_prev_event:'s',_ue_ts:s,_ue_count:t,_context:u,_data_version:1,_event_version:2,_info_version:1});if(l.enable.report)h.log('uan',[s,t]);this._report=i.debounce(function report(){if(!l.enable.report)return;var w=[this._info_version,this.ue,this._ns,this._ua_id];h.log('uai',w);}.bind(this),100);}var m=[];l.enable=function(s){if(!s)return;if(!k(s))s=[s];for(var t=0;t10)m.shift();g.inform("UserAction/new",{ua:z,node:t,mode:u,event:event,extra_data:v});o=w;n++;return z;}g.subscribe("UserAction/enable",function(s,t){l.enable(t);});e.exports=r;}); __e("legacy:UserAction",["UserNoOp","userAction"],function(a,b,c,d){a.UserNoOp=b('UserNoOp');a.user_action=a.user_action||b('userAction');a.report_data=a.report_data||function(e,f){user_action(e,null,null,'FORCE',f);};},3); !function(){if(window.__primer)return;window.__primer=true;var a=null,b=/async(?:-post)?|dialog(?:-pipe|-post)?|theater|toggle/;document.documentElement.onclick=function(d){d=d||window.event;a=d.target||d.srcElement;var e=Parent.byTag(a,'A');if(!e)return;var f=e.getAttribute('ajaxify'),g=e.href,h=f||g;if(h){var i=user_action('a',e,d).set_namespace('primer');if(window.ArbiterMonitor)ArbiterMonitor.initUA(i,[e]);}if(f&&g&&!(/#$/).test(g)){var j=d.which&&d.which!=1,k=d.altKey||d.ctrlKey||d.metaKey||d.shiftKey;if(j||k)return;}trackReferrer(e,h);var l=['dialog'],m=e.rel&&e.rel.match(b);m=m&&m[0];switch(m){case 'dialog-pipe':l.push('ajaxpipe');case 'dialog':case 'dialog-post':Bootloader.loadComponents(l,function(){Dialog.bootstrap(h,null,m=='dialog',null,null,e);});break;case 'async':case 'async-post':Bootloader.loadComponents('async',function(){AsyncRequest.bootstrap(h,e);});break;case 'theater':if(window.Env&&Env.snowlift){Bootloader.loadComponents('PhotoSnowlift',function(){PhotoSnowlift.bootstrap(h,e);});}else Bootloader.loadComponents('PhotoSnowbox',function(){PhotoSnowbox.bootstrap(h,e);});break;case 'toggle':CSS.toggleClass(e.parentNode,'openToggler');Bootloader.loadComponents('Toggler',function(){Toggler.bootstrap(e);});break;default:return;}return false;};document.documentElement.onsubmit=function(d){d=d||window.event;var e=d.target||d.srcElement;if(e&&e.nodeName=='FORM'&&e.getAttribute('rel')=='async'){var f=user_action('f',e,d).set_namespace('primer');if(window.ArbiterMonitor)ArbiterMonitor.initUA(f,[e]);var g=a;Bootloader.loadComponents('dom-form',function(){Form.bootstrap(e,g);});return false;}};var c=null;document.documentElement.onmouseover=function(d){d=d||window.event;c=d.target||d.srcElement;var e=Parent.byAttribute(c,'data-hover');if(!e)return;switch(e.getAttribute('data-hover')){case 'tooltip':Bootloader.loadComponents('Tooltip',function(){Tooltip.process(e,c);});break;}};}(); __e("DynaTemplate",["Util","hasArrayNature"],function(a,b,c,d,e,f){var g=b("Util"),h=b("hasArrayNature"),i='[[',j='\\[\\[',k='\\]\\]',l={},m={};function n(s,t){return t.indexOf(i+s)!=-1;}function o(s){switch(s){case "&":return "&";case '"':return '"';case "'":return ''';case "<":return "<";case ">":return ">";default:return s;}}function p(s){s=String(s===null?'':s);return s.replace(/&(?!\w+;)|["'<>]/g,o);}function q(s,t){if(s.charAt(0)=='@')return q(m[s.substring(1)],t);if(n('#',s)||n('^',s)){var u=new RegExp(j+'(\\^|\\#)\\s*(.+)\\s*'+k+'\n*([\\s\\S]+?)'+j+'\\/\\s*\\2\\s*'+k+'\\s*','mg');s=s.replace(u,function(w,x,y,z){var aa=t[y];aa=(aa&&aa.__html!==undefined)?aa.__html:aa;if(x=='^'){if(!aa||h(aa)&&aa.length===0)return q(z,t);return '';}if(x=='#'&&aa){if(h(aa)){var ba=[];for(var ca=0;ca|\\[|&)?([^\\/#\\^]+?)\\1?'+k+'+','g');return s.replace(v,function(w,x,y){y=y.replace(/^\s*|\s*$/g,"");var z=t[y];if(!z||z instanceof Array&&z.length===0)return '';switch(x){case '>':if(z[0].charAt(0)=='@'){return q(z[0],z[1]);}else if(!(z[0] in l))return '';return q(l[z[0]],z[1]);case '&':default:if(window.HTML&&z instanceof window.HTML)return z.toString();return z.__html!==undefined?z.__html:p(z);}});}var r={registerTemplates:function(s){for(var t in s){var u=s[t];m[u[0]]=u[1];l[t]=u[1];}},renderToHtml:q};e.exports=a.DynaTemplate||r;}); __e("JSCC",["array-extensions","Util","isEmpty"],function(a,b,c,d,e,f){b("array-extensions");var g=b("Util"),h=b("isEmpty"),i={},j={};function k(n){var o,p=false;return function(){if(!p){o=n();p=true;}return o;};}function l(n,o){if(h(n))return;for(var p in n){i[p]=k(n[p]);if(o){if(!j[o])j[o]=[];j[o].push(p);}}}var m={get:function(n){!i[n];return i[n]();},init:function(n){l(n);},initForPagelet:function(n,o){l(o,n);},clearForPagelet:function(n){if(j[n]){for(var o=0;o=2)return DynaTemplate.renderToHtml(content[0],content[1]);return null;}function extractMarkup(container){if(!container.firstChild){Bootloader.loadComponents('error-signal',function(){send_error_signal('bigpipe','Pagelet markup container is empty.');});return null;}if(container.firstChild.nodeType!==8)return null;var comment=container.firstChild.nodeValue;comment=comment.substring(1,comment.length-1);return comment.replace(/\\([\s\S]|$)/g,'$1');}function appendNodes(container,markup){var nn=document.createElement('div'),hax=ie<7;if(hax)container.appendChild(nn);nn.innerHTML=markup;var frag=document.createDocumentFragment();while(nn.firstChild)frag.appendChild(nn.firstChild);container.appendChild(frag);if(hax)container.removeChild(nn);}function BigPipe(options){copyProperties(this,{arbiter:Arbiter,rootNodeID:'content',lid:0,isAjax:false,rrEnabled:true,domContentCallback:domcontent_callback,onloadCallback:onload_callback,domContentEvt:OnloadEvent.ONLOAD_DOMCONTENT_CALLBACK,onloadEvt:OnloadEvent.ONLOAD_CALLBACK,forceFinish:false,jsEarlier:false,_phaseDoneCallbacks:[],_currentPhase:0,_lastPhase:-1});copyProperties(this,options);this._cavalry=(this.lid&&window.CavalryLogger)?CavalryLogger.getInstance(this.lid):null;this._inst=this._cavalry&&(window._pagelet_profile||this._cavalry.isPageletProfiler());BigPipe._current_instance=this;if(Env.tti_vision==1)(new TTIVisualizer(this)).init();this.arbiter.registerCallback(this.domContentCallback,['pagelet_displayed_all']);this.arbiter.inform('phase_begin_0',true,Arbiter.BEHAVIOR_STATE);this._inst&&this._cavalry.setTimeStamp('t_phase_begin_0');this.onloadCallback=this.arbiter.registerCallback(this.onloadCallback,['pagelet_displayed_all']);}copyProperties(BigPipe.prototype,{_displayPageletHandler:function(pagelet){if(this.displayCallback){this.displayCallback(this._displayPagelet.bind(this,pagelet));}else this._displayPagelet(pagelet);},_displayPagelet:function(pagelet){if(this._inst)this._cavalry.onPageletEvent('display_start',pagelet.id);pagelet.content=objectify(pagelet.content);var inform_now=true,after_display=function(){if(this._inst)this._cavalry.onPageletEvent('display',pagelet.id);this.arbiter.inform(pagelet.id+'_displayed',true,Arbiter.BEHAVIOR_STATE);}.bind(this);for(var target_id in pagelet.content){var content=pagelet.content[target_id];if(pagelet.append)target_id=this._getAppendTargetID(pagelet);var target=ge(target_id);if(target){content=getContentMarkup(content);if(content)if(!pagelet.append&&pagelet.has_inline_js){if(window.DOM&&window.HTML){DOM.setContent(target,HTML(content));}else{inform_now=false;Bootloader.loadComponents(['dom','dom-html'],function(){DOM.setContent(target,HTML(content));after_display();}.bind(this));}}else if(pagelet.append||ie<8){if(!pagelet.append)while(target.firstChild)target.removeChild(target.firstChild);appendNodes(target,content);}else target.innerHTML=content;var referrer=target.getAttribute('data-referrer');if(!referrer)target.setAttribute('data-referrer',target_id);}}if(inform_now)after_display();if(pagelet.cache_hit&&Env.pc_debug==1)$(pagelet.id).style.border="1px red solid";},_getAppendTargetID:function(pagelet){if(!pagelet.append)return null;return (pagelet.append==='bigpipe_root')?this.rootNodeID:pagelet.append;},_downloadJsForPagelet:function(pagelet){Bootloader.loadResources(pagelet.js||[],bind(this,function(){if(this._inst)this._cavalry.onPageletEvent('jsdone',pagelet.id);pagelet.requires=pagelet.requires||[];if(!this.isAjax||pagelet.phase>=1)pagelet.requires.push('uipage_onload');var fire_onloads=bind(this,function(){this._isRelevant()&&invokeCallbacks(pagelet.onload);if(this._inst)this._cavalry.onPageletEvent('onload',pagelet.id);this.arbiter.inform('pagelet_onload',true,Arbiter.BEHAVIOR_EVENT);pagelet.provides&&this.arbiter.inform(pagelet.provides,true,Arbiter.BEHAVIOR_STATE);}),fire_onafterloads=bind(this,function(){this._isRelevant()&&invokeCallbacks(pagelet.onafterload);});if(this.delay){var temp=fire_onloads;fire_onloads=function(){setTimeout(temp,400);};}this.arbiter.registerCallback(fire_onloads,pagelet.requires);this.arbiter.registerCallback(fire_onafterloads,[this.onloadEvt]);}),false,pagelet.id);},_downloadCssAndDisplayPagelet:function(pagelet){if(this._inst)this._cavalry.onPageletEvent('css',pagelet.id);var fn=bind(this,function(){var dep=pagelet.display_dependency||[],signals=[];for(var i=0;i=g.length&&this.substring(this.length-g.length)==g;};String.prototype.split=(function(g){return function(h,i){var j="";if(h===null||i===null){return [];}else if(typeof h=='string'){return g.call(this,h,i);}else if(h===undefined){return [this.toString()];}else if(h instanceof RegExp){if(!h._2||!h._1){j=h.toString().replace(/^[\S\s]+\//,"");if(!h._1)if(!h.global){h._1=new RegExp(h.source,"g"+j);}else h._1=1;}separator1=h._1===1?h:h._1;var k=(h._2?h._2:h._2=new RegExp("^"+separator1.source+"$",j));if(i===undefined||i<0){i=false;}else{i=Math.floor(i);if(!i)return [];}var l,m=[],n=0,o=0;while((i?o++<=i:true)&&(l=separator1.exec(this))){if((l[0].length===0)&&(separator1.lastIndex>l.index))separator1.lastIndex--;if(separator1.lastIndex>n){if(l.length>1)l[0].replace(k,function(){for(var p=1;p'+this._extra_action+'';return l;},setAction:function(l){this._extra_action=l;return this;},getAction:function(){this._fillCache();var l=function(){this._inline_js();j(this._extra_action);}.bind(this);if(this.getDeferred()){return l.defer.bind(l);}else return l;},setDeferred:function(l){this._defer=!!l;return this;},getDeferred:function(){return this._defer;},getContent:function(){return this._content;},getNodes:function(){this._fillCache();return this._nodes;},getRootNode:function(){return this.getNodes()[0];},ieCloneBug:function(){this._fillCache();return this._ie_clone_bug;},_fillCache:function(){if(null!==this._nodes)return;var l=this._content;if(!l){this._nodes=[];return;}l=l.replace(/(<(\w+)[^>]*?)\/>/g,function(w,x,y){return y.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?w:x+'>';});var m=l.trim().toLowerCase(),n=document.createElement('div'),o=false,p=(!m.indexOf('',''])||(!m.indexOf('',''])||(m.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,'','
'])||(!m.indexOf('',''])||((!m.indexOf('',''])||(!m.indexOf('',''])||null;if(null===p){n.className='__WRAPPER';if(h.ie()){p=[0,' ',''];o=true;}else p=[0,'',''];}n.innerHTML=p[1]+l+p[2];while(p[0]--)n=n.lastChild;if(o)n.removeChild(n.firstChild);n.className!='__WRAPPER';if(0!==n.getElementsByTagName('option').length||0!==n.getElementsByTagName('object').length)this._ie_clone_bug=true;if(h.ie()){var q;if(!m.indexOf(''&&-1==m.indexOf('=0;--r)if(q[r].nodeName&&q[r].nodeName.toLowerCase()=='tbody'&&q[r].childNodes.length==0)q[r].parentNode.removeChild(q[r]);}var s=n.getElementsByTagName('script'),t=[];for(var u=0;u=0;u--)s[u].parentNode.removeChild(s[u]);var v=function(){for(var w=0;w7&&!q.isNodeOfType(u,['table','tbody','thead','tfoot','tr','select','fieldset']))){var w=v?" ":"";u.innerHTML=w+s;v&&u.removeChild(u.firstChild);return g.createFrom(u.childNodes);}}else if(q.isTextNode(u)){u.data=s;return [s];}var x,y=[],z=[],aa=document.createDocumentFragment();if(!(s instanceof Array))s=[s];for(var ba=0;ba=300&&err<=399){summary="Redirection";desc="Your access to Facebook was redirected or blocked by a third party at this time, please contact your ISP or reload. ";redir_url=this.transport.getResponseHeader("Location");if(redir_url)goURI(redir_url,true);silent=true;}else{summary="Oops!";desc="Something went wrong. We're working on getting this fixed as soon as we can. You may be able to try again.";}!this.getOption('suppressErrorAlerts');copyProperties(r,{error:err,errorSummary:summary,errorDescription:desc,silentError:silent});dispatchErrorResponse(r,true);}}),handleResponse=function(response){var asyncResponse=this.interpretResponse(response);this.invokeResponseHandler(asyncResponse);},onStateChange=function(){try{if(this.transport.readyState==4){AsyncRequest._inflightPurge();try{if(typeof(this.transport.getResponseHeader)!='undefined'&&this.transport.getResponseHeader('X-FB-Debug'))this._xFbServer=this.transport.getResponseHeader('X-FB-Debug');}catch(ex){}if(this.transport.status>=200&&this.transport.status<300){AsyncRequest.lastSuccessTime=Date.now();invokeResponseHandler(_interpretTransportResponse());}else if(ua.safari()&&(typeof(this.transport.status)=='undefined')){invokeErrorHandler(1002);}else if(window.Env&&window.Env.retry_ajax_on_network_error&&this.transport.status in {0:1,12029:1,12030:1,12031:1,12152:1}&&this.remainingRetries>0){--this.remainingRetries;delete this.transport;this.send(true);return;}else invokeErrorHandler();if(this.getOption('asynchronous')!==false)delete this.transport;}}catch(exception){try{if(!window.loaded)return;}catch(ex){return;}delete this.transport;if(this.remainingRetries>0){--this.remainingRetries;this.send(true);}else{!this.getOption('suppressErrorAlerts');if(window.send_error_signal)send_error_signal('async_xport_resp','1007:'+(this._xFbServer||'-')+':'+this.getURI()+':'+exception.message);invokeErrorHandler(1007);}}},onJSONPResponse=function(data,more_chunked_response){var is_first=(this.is_first===undefined);this.is_first=is_first;if(this.transportIframe&&!more_chunked_response){if(this.cavalry)this.cavalry.collectBrowserTiming(this.transportIframe.contentWindow);(function(x){document.body.removeChild(x);}).bind(null,this.transportIframe).defer();}if(ua.ie()>=9&&window.JSON)data=window.JSON.parse(window.JSON.stringify(data));var r=this.interpretResponse(data);r.asyncResponse.is_first=is_first;r.asyncResponse.is_last=!more_chunked_response;this.invokeResponseHandler(r);return more_chunked_response;};copyProperties(this,{onstatechange:onStateChange,onjsonpresponse:onJSONPResponse,invokeResponseHandler:invokeResponseHandler,interpretResponse:interpretResponse,handleResponse:handleResponse,transport:null,method:'POST',uri:'',timeout:null,timer:null,initialHandler:bagofholding,handler:null,errorHandler:null,transportErrorHandler:null,timeoutHandler:null,finallyHandler:bagofholding,serverDialogCancelHandler:null,relativeTo:null,statusElement:null,statusClass:'',data:{},file:null,context:{},readOnly:false,writeRequiredParams:['post_form_id'],remainingRetries:0,option:{asynchronous:true,suppressErrorHandlerWarning:false,suppressEvaluation:false,suppressErrorAlerts:false,retries:0,jsonp:false,bundle:false,useIframeTransport:false,tfbEndpoint:true,handleErrorAfterUnload:false},userActionID:'-'});this.errorHandler=AsyncResponse.defaultErrorHandler;this.transportErrorHandler=bind(this,'errorHandler');if(uri!=undefined)this.setURI(uri);return this;}Arbiter.subscribe("page_transition",function(type,message){AsyncRequest._id_threshold=message.id;});copyProperties(AsyncRequest,{receiveJSONPResponse:function(id,data,more_chunked_response){if(this._JSONPReceivers[id]){if(!this._JSONPReceivers[id](data,more_chunked_response))delete this._JSONPReceivers[id];}else if(window.logJSError&&!more_chunked_response){var uri=(data.payload&&data.payload.uri)||'';logJSError('ajax',{error:'UnexpectedJsonResponse',extra:{id:id,uri:uri}});}},_bundleRequest:function(request){if(request.getOption('jsonp')||request.getOption('useIframeTransport')){request.setOption('bundle',false);return false;}else if(!request.uri.isFacebookURI()){request.setOption('bundle',false);return false;}else if(!request.getOption('asynchronous')){request.setOption('bundle',false);return false;}var path=request.uri.getPath();if(!AsyncRequest._bundleTimer)AsyncRequest._bundleTimer=setTimeout(function(){AsyncRequest._sendBundledRequests();},0);AsyncRequest._allBundledRequests.push([path,request]);return true;},_sendBundledRequests:function(){clearTimeout(AsyncRequest._bundleTimer);AsyncRequest._bundleTimer=null;var bundled_requests=AsyncRequest._allBundledRequests;AsyncRequest._allBundledRequests=[];if(bundled_requests.length==1){var request=bundled_requests[0][1];request.setOption('bundle',false).send();return request;}if(bundled_requests.length===0)return null;var data=[];for(var ii=0;iiAsyncRequest._id_threshold;},clearStatusIndicator:function(){var statusElem=this.getStatusElement();if(statusElem){CSS.removeClass(statusElem,'async_saving');CSS.removeClass(statusElem,this.statusClass);}},addStatusIndicator:function(){var statusElem=this.getStatusElement();if(statusElem){CSS.addClass(statusElem,'async_saving');CSS.addClass(statusElem,this.statusClass);}},specifiesWriteRequiredParams:function(){return this.writeRequiredParams.every(function(param){this.data[param]=this.data[param]||Env[param]||(ge(param)||{}).value;if(this.data[param]!==undefined)return true;return false;},this);},setOption:function(opt,v){if(typeof(this.option[opt])!='undefined')this.option[opt]=v;return this;},getOption:function(opt){typeof(this.option[opt])=='undefined';return this.option[opt];},abort:function(){if(this.transport){var old_handler=this.getTransportErrorHandler();this.setOption('suppressErrorAlerts',true);this.setTransportErrorHandler(bagofholding);this._requestAborted=1;this.transport.abort();this.setTransportErrorHandler(old_handler);}},abandon:function(){clearTimeout(this.timer);this.setOption('suppressErrorAlerts',true).setHandler(bagofholding).setErrorHandler(bagofholding).setTransportErrorHandler(bagofholding);if(this.transport){this._requestAborted=1;this.transport.abort();}},setNectarData:function(nctrParams){if(nctrParams){if(this.data.nctr===undefined)this.data.nctr={};copyProperties(this.data.nctr,nctrParams);}return this;},setNectarModuleDataSafe:function(elem){if(this.setNectarModuleData)this.setNectarModuleData(elem);return this;},setNectarImpressionIdSafe:function(){if(this.setNectarImpressionId)this.setNectarImpressionId();return this;},setAllowCrossPageTransition:function(allow){this._allowCrossPageTransition=!!allow;if(this.timer)this.resetTimeout(this.timeout);return this;},send:function(isRetry){isRetry=isRetry||false;if(!this.uri)return false;!this.errorHandler&&!this.getOption('suppressErrorHandlerWarning');if(this.getOption('jsonp')&&this.method!='GET')this.setMethod('GET');if(this.getOption('useIframeTransport')&&this.method!='GET')this.setMethod('GET');this.timeoutHandler!==null&&(this.getOption('jsonp')||this.getOption('useIframeTransport'));if(!this.getReadOnly()){this.specifiesWriteRequiredParams();if(this.method!='POST')return false;}if(this.method=='POST'&&this.getOption('tfbEndpoint')){this.data.fb_dtsg=Env.fb_dtsg;this.data.lsd=Cookie.get('lsd');}if(!isEmpty(this.context)&&this.getOption('tfbEndpoint')){copyProperties(this.data,this.context);this.data.ajax_log=1;}if(window.Env&&Env.force_param)copyProperties(this.data,Env.force_param);if(!this.getReadOnly()&&this.getOption('tfbEndpoint')&&this.method=='POST'&&this.data.post_form_id_source===undefined)this.data.post_form_id_source='AsyncRequest';if(window.Env)this.data.__user=Env.user;this._setUserActionID();if(this.getOption('bundle')&&AsyncRequest._bundleRequest(this))return true;this.setNewSerial();if(this.getOption('tfbEndpoint')){this.uri.addQueryData({__a:1});if(!this.getOption('asynchronous'))this.uri.addQueryData({__s:1});if(Env.fb_isb)this.uri.addQueryData({fb_isb:Env.fb_isb});}this.finallyHandler=async_callback(this.finallyHandler,'final');var uri_str,query;if(this.method=='GET'||this.file){uri_str=this.uri.addQueryData(this.data).toString();query='';}else{uri_str=this.uri.toString();this._setDataHash();query=URI.implodeQuery(this.data);}if(this.getOption('jsonp')||this.getOption('useIframeTransport')){uri_str=this.uri.addQueryData({__a:this.id}).toString();AsyncRequest._JSONPReceivers[this.id]=async_callback(bind(this,'onjsonpresponse'),'json');if(this.getOption('jsonp')){(function(){document.body.appendChild($N('script',{src:uri_str,type:"text/javascript"}));}).bind(this).defer();}else{var style={position:'absolute',top:'-9999999px',width:'80px',height:'80px'};this.transportIframe=$N('iframe',{src:"javascript:''",style:style});document.body.appendChild(this.transportIframe);this.transportIframe.src=uri_str;}return true;}if(this.transport)return false;var transport=null;try{transport=new XMLHttpRequest();}catch(ignored){}if(!transport)try{transport=new ActiveXObject("Msxml2.XMLHTTP");}catch(ignored){}if(!transport)try{transport=new ActiveXObject("Microsoft.XMLHTTP");}catch(ignored){}if(!transport)return false;transport.onreadystatechange=async_callback(bind(this,'onstatechange'),'xhr');if(!isRetry)this.remainingRetries=this.getOption('retries');if(window.send_error_signal||window.ArbiterMonitor)this._sendTimeStamp=this._sendTimeStamp||Date.now();this.transport=transport;try{this.transport.open(this.method,uri_str,this.getOption('asynchronous'));}catch(ex){return false;}var svn_rev=Env.svn_rev;if(svn_rev)this.transport.setRequestHeader('X-SVN-Rev',String(svn_rev));if(this.method=='POST')this.transport.setRequestHeader('Content-Type','application/x-www-form-urlencoded');this.addStatusIndicator();query=this.file||query;this.transport.send(query);if(this.timeout!==null)this.resetTimeout(this.timeout);AsyncRequest._inflightAdd(this);return true;},_displayServerDialog:function(model,is_confirmation){Bootloader.loadComponents('dialog',function(){var dialog=new Dialog(model);if(is_confirmation)dialog.setHandler(this._displayConfirmationHandler.bind(this,dialog));dialog.setCancelHandler(function(){var handler=this.getServerDialogCancelHandler();if(handler)handler.apply(this,arguments);this.finallyHandler.apply(this,arguments);}.bind(this)).setCausalElement(this.relativeTo).setCloseHandler(this.finallyHandler.bind(this)).show();}.bind(this));},_displayConfirmationHandler:function(dialog){this.data.confirmed=1;copyProperties(this.data,dialog.getFormData());this.send();}});module.exports=AsyncRequest;}); __e("goOrReplace",["URI"],function(a,b,c,d,e,f){var g=b("URI");function h(i,j,k){var l=new g(j);if(i.pathname=='/'&&l.getPath()!='/'&&l.isQuicklingEnabled()){var m=i.search?{}:{q:''};l=new g().setPath('/').setQueryData(m).setFragment(l.getUnqualifiedURI()).toString();j=l.toString();}if(k&&!(ua.ie()<8)){i.replace(j);}else if(i.href==j){i.reload();}else i.href=j;}e.exports=h;}); __e("AjaxPipeRequest",["Arbiter","AsyncRequest","BigPipe","dom","Env","JSCC","copyProperties","goOrReplace","dom-core"],function(a,b,c,d,e,f){var g=b("Arbiter"),h=b("AsyncRequest"),i=b("BigPipe"),j=b("dom"),k=b("Env"),l=b("JSCC"),m=b("copyProperties"),n=b("goOrReplace"),o=b("dom-core").ge;function p(s,t){var u=o(s);if(u){if(!t)u.style.minHeight='600px';for(var v in i.pageletIDs)if(s!==v&&j.contains(u,v)){l.clearForPagelet(v);delete i.pageletIDs[v];}j.empty(u);}}function q(s,t){var u=o(s);if(u)if(!t)u.style.minHeight='100px';}function r(s,t){this._uri=s;this._query_data=t;this._request=new h();this._canvas_id=null;this._allow_cross_page_transition=true;}m(r.prototype,{setCanvasId:function(s){this._canvas_id=s;return this;},setURI:function(s){this._uri=s;return this;},setData:function(s){this._query_data=s;return this;},getData:function(s){return this._query_data;},setAllowCrossPageTransition:function(s){this._allow_cross_page_transition=s;return this;},setAppend:function(s){this._append=s;return this;},send:function(){this._request.setOption('useIframeTransport',true).setURI(this._uri).setData(m({ajaxpipe:1,ajaxpipe_token:k.ajaxpipe_token},this._query_data)).setPreBootloadHandler(this._preBootloadHandler.bind(this)).setInitialHandler(this._onInitialResponse.bind(this)).setHandler(this._onResponse.bind(this)).setMethod('GET').setReadOnly(true).setAllowCrossPageTransition(this._allow_cross_page_transition);r._current_request=this._request;this._request.send();return this;},_preBootloadFirstResponse:function(s){return false;},_fireDomContentCallback:function(){this._arbiter.inform('ajaxpipe/domcontent_callback',true,g.BEHAVIOR_STATE);},_fireOnloadCallback:function(){this._arbiter.inform('ajaxpipe/onload_callback',true,g.BEHAVIOR_STATE);},_isRelevant:function(s){return this._request==r._current_request||this._jsNonBlock;},_preBootloadHandler:function(s){var t=s.getPayload();if(!t||t.redirect||!this._isRelevant(s))return false;var u=false;if(s.is_first){!this._append&&!this._displayCallback&&p(this._canvas_id,this._constHeight);this._arbiter=new g();u=this._preBootloadFirstResponse(s);this.pipe=new i({arbiter:this._arbiter,rootNodeID:this._canvas_id,lid:this._request.lid,rrEnabled:s.payload.roadrunner_enabled,isAjax:true,domContentCallback:this._fireDomContentCallback.bind(this),onloadCallback:this._fireOnloadCallback.bind(this),domContentEvt:'ajaxpipe/domcontent_callback',onloadEvt:'ajaxpipe/onload_callback',jsNonBlock:this._jsNonBlock,displayCallback:this._displayCallback});}return u;},_redirect:function(s){if(s.redirect){if(s.force||!this.isPageActive(s.redirect)){var t=['ajaxpipe','ajaxpipe_token'].concat(this.getSanitizedParameters());n(window.location,URI(s.redirect).removeQueryData(t),true);}else PageTransitions.go(s.redirect,true);return true;}else return false;},isPageActive:function(s){return true;},getSanitizedParameters:function(){return [];},_versionCheck:function(s){return true;},_onInitialResponse:function(s){var t=s.getPayload();if(!this._isRelevant(s))return false;if(!t)return true;if(this._redirect(t)||!this._versionCheck(t))return false;return true;},_processFirstResponse:function(s){var t=s.getPayload();if(o(this._canvas_id)&&t.canvas_class!==null)CSS.setClass(this._canvas_id,t.canvas_class);},setFirstResponseCallback:function(s){this._firstResponseCallback=s;return this;},setFirstResponseHandler:function(s){this._processFirstResponse=s;return this;},_onResponse:function(s){var t=s.payload;if(!this._isRelevant(s))return h.suppressOnloadToken;if(s.is_first){this._processFirstResponse(s);this._firstResponseCallback&&this._firstResponseCallback();t.provides=t.provides||[];t.provides.push('uipage_onload');if(this._append)t.append=this._canvas_id;}if(t){if('content' in t.content&&this._canvas_id!==null&&this._canvas_id!='content'){t.content[this._canvas_id]=t.content.content;delete t.content.content;}this.pipe.onPageletArrive(t);}if(s.is_last)q(this._canvas_id,this._constHeight);return h.suppressOnloadToken;},setNectarModuleDataSafe:function(s){this._request.setNectarModuleDataSafe(s);return this;},setFinallyHandler:function(s){this._request.setFinallyHandler(s);return this;},setErrorHandler:function(s){this._request.setErrorHandler(s);return this;},abort:function(){this._request.abort();if(r._current_request==this._request)r._current_request=null;this._request=null;return this;},setJSNonBlock:function(s){this._jsNonBlock=s;return this;},setDisplayCallback:function(s){this._displayCallback=s;return this;},setConstHeight:function(s){this._constHeight=s;return this;},getAsyncRequest:function(){return this._request;}});m(r,{getCurrentRequest:function(){return r._current_request;},setCurrentRequest:function(s){r._current_request=s;}});e.exports=a.AjaxPipeRequest||r;}); __e("animation",["css"],function(a,b,c,d,e,f){var g=b('css');function h(i){if(i==undefined)return;if(a==this){return new h(i);}else{this.obj=i;this._reset_state();this.queue=[];this.last_attr=null;}}h.resolution=20;h.offset=0;h.prototype._reset_state=function(){this.state={attrs:{},duration:500};};h.prototype.stop=function(){this._reset_state();this.queue=[];return this;};h.prototype._build_container=function(){if(this.container_div){this._refresh_container();return;}if(this.obj.firstChild&&this.obj.firstChild.__animation_refs){this.container_div=this.obj.firstChild;this.container_div.__animation_refs++;this._refresh_container();return;}var i=document.createElement('div');i.style.padding='0px';i.style.margin='0px';i.style.border='0px';i.__animation_refs=1;var j=this.obj.childNodes;while(j.length)i.appendChild(j[0]);this.obj.appendChild(i);this._orig_overflow=this.obj.style.overflow;this.obj.style.overflow='hidden';this.container_div=i;this._refresh_container();};h.prototype._refresh_container=function(){this.container_div.style.height='auto';this.container_div.style.width='auto';this.container_div.style.height=this.container_div.offsetHeight+'px';this.container_div.style.width=this.container_div.offsetWidth+'px';};h.prototype._destroy_container=function(){if(!this.container_div)return;if(!--this.container_div.__animation_refs){var i=this.container_div.childNodes;while(i.length)this.obj.appendChild(i[0]);this.obj.removeChild(this.container_div);}this.container_div=null;this.obj.style.overflow=this._orig_overflow;};h.ATTR_TO=1;h.ATTR_BY=2;h.ATTR_FROM=3;h.prototype._attr=function(i,j,k){i=i.replace(/-[a-z]/gi,function(m){return m.substring(1).toUpperCase();});var l=false;switch(i){case 'background':this._attr('backgroundColor',j,k);return this;case 'margin':j=h.parse_group(j);this._attr('marginBottom',j[0],k);this._attr('marginLeft',j[1],k);this._attr('marginRight',j[2],k);this._attr('marginTop',j[3],k);return this;case 'padding':j=h.parse_group(j);this._attr('paddingBottom',j[0],k);this._attr('paddingLeft',j[1],k);this._attr('paddingRight',j[2],k);this._attr('paddingTop',j[3],k);return this;case 'backgroundColor':case 'borderColor':case 'color':j=h.parse_color(j);break;case 'opacity':j=parseFloat(j,10);break;case 'height':case 'width':if(j=='auto'){l=true;}else j=parseInt(j,10);break;case 'borderWidth':case 'lineHeight':case 'fontSize':case 'marginBottom':case 'marginLeft':case 'marginRight':case 'marginTop':case 'paddingBottom':case 'paddingLeft':case 'paddingRight':case 'paddingTop':case 'bottom':case 'left':case 'right':case 'top':case 'scrollTop':case 'scrollLeft':j=parseInt(j,10);break;default:throw new Error(i+' is not a supported attribute!');}if(this.state.attrs[i]===undefined)this.state.attrs[i]={};if(l)this.state.attrs[i].auto=true;switch(k){case h.ATTR_FROM:this.state.attrs[i].start=j;break;case h.ATTR_BY:this.state.attrs[i].by=true;case h.ATTR_TO:this.state.attrs[i].value=j;break;}};h._get_box_width=function(i){var j=parseInt(g.getStyle(i,'paddingLeft'),10),k=parseInt(g.getStyle(i,'paddingRight'),10),l=parseInt(g.getStyle(i,'borderLeftWidth'),10),m=parseInt(g.getStyle(i,'borderRightWidth'),10);return i.offsetWidth-(j?j:0)-(k?k:0)-(l?l:0)-(m?m:0);};h._get_box_height=function(i){var j=parseInt(g.getStyle(i,'paddingTop'),10),k=parseInt(g.getStyle(i,'paddingBottom'),10),l=parseInt(g.getStyle(i,'borderTopWidth'),10),m=parseInt(g.getStyle(i,'borderBottomWidth'),10);return i.offsetHeight-(j?j:0)-(k?k:0)-(l?l:0)-(m?m:0);};h.prototype.to=function(i,j){if(j===undefined){this._attr(this.last_attr,i,h.ATTR_TO);}else{this._attr(i,j,h.ATTR_TO);this.last_attr=i;}return this;};h.prototype.by=function(i,j){if(j===undefined){this._attr(this.last_attr,i,h.ATTR_BY);}else{this._attr(i,j,h.ATTR_BY);this.last_attr=i;}return this;};h.prototype.from=function(i,j){if(j===undefined){this._attr(this.last_attr,i,h.ATTR_FROM);}else{this._attr(i,j,h.ATTR_FROM);this.last_attr=i;}return this;};h.prototype.duration=function(i){this.state.duration=i?i:0;return this;};h.prototype.checkpoint=function(i,j){if(i===undefined)i=1;this.state.checkpoint=i;this.queue.push(this.state);this._reset_state();this.state.checkpointcb=j;return this;};h.prototype.blind=function(){this.state.blind=true;return this;};h.prototype.hide=function(){this.state.hide=true;return this;};h.prototype.show=function(){this.state.show=true;return this;};h.prototype.ease=function(i){this.state.ease=i;return this;};h.prototype.go=function(){var i=(new Date()).getTime();this.queue.push(this.state);for(var j=0;ji){j=false;continue;}if(p.checkpointcb){this._callback(p.checkpointcb,i-p.start);p.checkpointcb=null;}if(p.started===undefined){if(p.show)this._show();for(var q in p.attrs){if(p.attrs[q].start!==undefined)continue;switch(q){case 'backgroundColor':case 'borderColor':case 'color':m=h.parse_color(g.getStyle(this.obj,q=='borderColor'?'borderLeftColor':q));if(p.attrs[q].by){p.attrs[q].value[0]=Math.min(255,Math.max(0,p.attrs[q].value[0]+m[0]));p.attrs[q].value[1]=Math.min(255,Math.max(0,p.attrs[q].value[1]+m[1]));p.attrs[q].value[2]=Math.min(255,Math.max(0,p.attrs[q].value[2]+m[2]));}break;case 'opacity':m=g.getOpacity(this.obj);if(p.attrs[q].by)p.attrs[q].value=Math.min(1,Math.max(0,p.attrs[q].value+m));break;case 'height':m=h._get_box_height(this.obj);if(p.attrs[q].by)p.attrs[q].value+=m;break;case 'width':m=h._get_box_width(this.obj);if(p.attrs[q].by)p.attrs[q].value+=m;break;case 'scrollLeft':case 'scrollTop':m=(this.obj===document.body)?n(q):this.obj[q];if(p.attrs[q].by)p.attrs[q].value+=m;p['last'+q]=m;break;default:m=parseInt(g.getStyle(this.obj,q),10)||0;if(p.attrs[q].by)p.attrs[q].value+=m;break;}p.attrs[q].start=m;}if((p.attrs.height&&p.attrs.height.auto)||(p.attrs.width&&p.attrs.width.auto)){if(ua.firefox()<3)l=true;this._destroy_container();for(var q in {height:1,width:1,fontSize:1,borderLeftWidth:1,borderRightWidth:1,borderTopWidth:1,borderBottomWidth:1,paddingLeft:1,paddingRight:1,paddingTop:1,paddingBottom:1})if(p.attrs[q])this.obj.style[q]=p.attrs[q].value+(typeof p.attrs[q].value=='number'?'px':'');if(p.attrs.height&&p.attrs.height.auto)p.attrs.height.value=h._get_box_height(this.obj);if(p.attrs.width&&p.attrs.width.auto)p.attrs.width.value=h._get_box_width(this.obj);}p.started=true;if(p.blind)this._build_container();}var r=(i-p.start)/p.duration;if(r>=1){r=1;if(p.hide)this._hide();}else j=false;var s=p.ease?p.ease(r):r;if(!k&&r!=1&&p.blind)k=true;if(l&&this.obj.parentNode){var t=this.obj.parentNode,u=this.obj.nextSibling;t.removeChild(this.obj);}for(var q in p.attrs)switch(q){case 'backgroundColor':case 'borderColor':case 'color':this.obj.style[q]='rgb('+h.calc_tween(s,p.attrs[q].start[0],p.attrs[q].value[0],true)+','+h.calc_tween(s,p.attrs[q].start[1],p.attrs[q].value[1],true)+','+h.calc_tween(s,p.attrs[q].start[2],p.attrs[q].value[2],true)+')';break;case 'opacity':g.setStyle(this.obj,'opacity',h.calc_tween(s,p.attrs[q].start,p.attrs[q].value));break;case 'height':case 'width':this.obj.style[q]=s==1&&p.attrs[q].auto?'auto':h.calc_tween(s,p.attrs[q].start,p.attrs[q].value,true)+'px';break;case 'scrollLeft':case 'scrollTop':var v=this.obj===document.body;m=v?n(q):this.obj[q];if(p['last'+q]!==m){delete p.attrs[q];}else{var w=h.calc_tween(s,p.attrs[q].start,p.attrs[q].value,true);if(!v){w=this.obj[q]=w;}else{if(q=='scrollLeft'){a.scrollTo(w,n('scrollTop'));}else a.scrollTo(n('scrollLeft'),w);w=n(q);}p['last'+q]=w;}break;default:this.obj.style[q]=h.calc_tween(s,p.attrs[q].start,p.attrs[q].value,true)+'px';break;}if(r==1){this.queue.splice(o--,1);this._callback(p.ondone,i-p.start-p.duration);}}if(l)t[u?'insertBefore':'appendChild'](this.obj,u);if(!k&&this.container_div)this._destroy_container();return !j;};h.prototype.ondone=function(i){this.state.ondone=i;return this;};h.prototype._callback=function(i,j){if(i){h.offset=j;i.call(this);h.offset=0;}};h.calc_tween=function(i,j,k,l){return (l?parseInt:parseFloat)((k-j)*i+j,10);};h.parse_color=function(i){var j=/^#([a-f0-9]{1,2})([a-f0-9]{1,2})([a-f0-9]{1,2})$/i.exec(i);if(j){return [parseInt(j[1].length==1?j[1]+j[1]:j[1],16),parseInt(j[2].length==1?j[2]+j[2]:j[2],16),parseInt(j[3].length==1?j[3]+j[3]:j[3],16)];}else{var k=/^rgba? *\(([0-9]+), *([0-9]+), *([0-9]+)(?:, *([0-9]+))?\)$/.exec(i);if(k){if(k[4]==='0'){return [255,255,255];}else return [parseInt(k[1],10),parseInt(k[2],10),parseInt(k[3],10)];}else if(i=='transparent'){return [255,255,255];}else throw 'Named color attributes are not supported.';}};h.parse_group=function(i){i=trim(i).split(/ +/);if(i.length==4){return i;}else if(i.length==3){return [i[0],i[1],i[2],i[1]];}else if(i.length==2){return [i[0],i[1],i[0],i[1]];}else return [i[0],i[0],i[0],i[0]];};h.push=function(i){if(!h.active)h.active=[];h.active.push(i);if(h.active.length===1){if(!h.requestAnimationFrame){var j=a.requestAnimationFrame||a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame;if(j)h.requestAnimationFrame=j.bind(a);}if(h.requestAnimationFrame){h.requestAnimationFrame(h._animate);}else h.timeout=setInterval(h._animate,h.resolution,false);}if(h.requestAnimationFrame)h._updateEndingTimer();h._animate(Date.now(),true);};h._updateEndingTimer=function(){if(!h.requestAnimationFrame)throw new Error('Ending timer only valid with requestAnimationFrame');var i=0;for(var j=0;ji)i=m;}}if(h.timeout){clearTimeout(h.timeout);delete h.timeout;}var n=Date.now();if(i>n)h.timeout=setTimeout(h._animate.shield(),i-n,false);};h._animate=function(i,j){i=i||Date.now();for(var k=(j===true)?h.active.length-1:0;k=0;l--)if(j=k.style[i[l]]!==undefined)break;g.supportsBorderRadius=bagof(j);return j;}});e.exports=g;},3); __e("DOMControl",["DataStore","dom-core"],function(a,b,c,d,e,f){var g=b("DataStore"),h=b("dom-core").$;function i(j){this.root=h(j);this.updating=false;g.set(j,'DOMControl',this);}i.prototype={getRoot:function(){return this.root;},beginUpdate:function(){if(this.updating)return false;this.updating=true;return true;},endUpdate:function(){this.updating=false;},update:function(j){if(!this.beginUpdate())return this;this.onupdate(j);this.endUpdate();},onupdate:function(j){}};i.getInstance=function(j){return g.get(j,'DOMControl');};e.exports=i;}); __e("InputSelection",["dom","Input"],function(a,b,c,d,e,f){var g=b("dom"),h=b("Input"),i={get:function(j){if(!document.selection)return {start:j.selectionStart,end:j.selectionEnd};var k=document.selection.createRange();if(k.parentElement()!==j)return {start:0,end:0};var l=j.value.length;if(g.isNodeOfType(j,'input')){return {start:-k.moveStart('character',-l),end:-k.moveEnd('character',-l)};}else{var m=k.duplicate();m.moveToElementText(j);m.setEndPoint('StartToEnd',k);var n=l-m.text.length;m.setEndPoint('StartToStart',k);return {start:l-m.text.length,end:n};}},set:function(j,k,l){if(typeof l=='undefined')l=k;if(document.selection){if(j.tagName=='TEXTAREA'){var m=(j.value.slice(0,k).match(/\r/g)||[]).length,n=(j.value.slice(k,l).match(/\r/g)||[]).length;k-=m;l-=m+n;}var o=j.createTextRange();o.collapse(true);o.moveStart('character',k);o.moveEnd('character',l-k);o.select();}else{j.selectionStart=k;j.selectionEnd=Math.min(l,j.value.length);h.focus(j);}}};e.exports=i;}); __e("enforceMaxLength",["event-extensions","function-extensions","dom","Input","InputSelection"],function(a,b,c,d,e,f){b("event-extensions");b("function-extensions");var g=b("dom"),h=b("Input"),i=b("InputSelection"),j=function(l,m){var n=h.getValue(l),o=n.length,p=o-m;if(p>0){var q,r;try{q=i.get(l);r=q.end;}catch(s){q=null;r=0;}if(r>=p)o=r;var t=o-p;if(t&&(n.charCodeAt(t-1)&64512)===55296)t--;r=Math.min(r,t);h.setValue(l,n.slice(0,t)+n.slice(o));if(q)i.set(l,Math.min(q.start,r),r);}},k=function(event){var l=event.getTarget(),m=l.getAttribute&&parseInt(l.getAttribute('maxlength'),10);if(m>0&&g.isNodeOfType(l,['input','textarea']))j.bind(null,l,m).defer();};Event.listen(document.documentElement,{keydown:k,paste:k});e.exports=j;}); __e("Input",["bootloader","css-core","dom","DOMControl"],function(a,b,c,d,e,f){var g=b("bootloader"),h=b("css-core"),i=b("dom"),j=b("DOMControl"),k=function(m){var n=m.getAttribute('maxlength');if(n&&n>0)d(["enforceMaxLength"],function(o){o(m,n);});},l={focus:function(m){try{m.focus();}catch(n){}},isEmpty:function(m){return !(/\S/).test(m.value||'')||h.hasClass(m,'DOMControl_placeholder');},getValue:function(m){return l.isEmpty(m)?'':m.value;},setValue:function(m,n){h.removeClass(m,'DOMControl_placeholder');m.value=n||'';k(m);var o=j.getInstance(m);o&&o.resetHeight&&o.resetHeight();},setPlaceholder:function(m,n){m.setAttribute('title',n);m.setAttribute('placeholder',n);if(m==document.activeElement)return;if(l.isEmpty(m)){h.conditionClass(m,'DOMControl_placeholder',n);m.value=n||'';}},reset:function(m){var n=m!==document.activeElement?(m.getAttribute('placeholder')||''):'';m.value=n;h.conditionClass(m,'DOMControl_placeholder',n);m.style.height='';},setSubmitOnEnter:function(m,n){h.conditionClass(m,'enter_submit',n);},getSubmitOnEnter:function(m){return h.hasClass(m,'enter_submit');},setMaxLength:function(m,n){if(n>0){m.setAttribute('maxlength',n);k(m);}else m.removeAttribute('maxlength');}};e.exports=l;}); __e("Vector",["dom","ua","event-extensions","copyProperties"],function(a,b,c,d,e,f){var g=b("dom"),h=b("ua"),i=b("event-extensions").$E,j=b("copyProperties");function k(l,m,n){j(this,{x:parseFloat(l),y:parseFloat(m),domain:n||'pure'});}j(k.prototype,{toString:function(){return '('+this.x+', '+this.y+')';},add:function(l,m){if(arguments.length==1){if(l.domain!='pure')l=l.convertTo(this.domain);return this.add(l.x,l.y);}var n=parseFloat(l),o=parseFloat(m);return new k(this.x+n,this.y+o,this.domain);},mul:function(l,m){if(typeof m=="undefined")m=l;return new k(this.x*l,this.y*m,this.domain);},sub:function(l,m){if(arguments.length==1){return this.add(l.mul(-1));}else return this.add(-l,-m);},distanceTo:function(l){return this.sub(l).magnitude();},magnitude:function(){return Math.sqrt((this.x*this.x)+(this.y*this.y));},convertTo:function(l){if(l!='pure'&&l!='viewport'&&l!='document')return new k(0,0);if(l==this.domain)return new k(this.x,this.y,this.domain);if(l=='pure')return new k(this.x,this.y);if(this.domain=='pure')return new k(0,0);var m=k.getScrollPosition('document'),n=this.x,o=this.y;if(this.domain=='document'){n-=m.x;o-=m.y;}else{n+=m.x;o+=m.y;}return new k(n,o,l);},setElementPosition:function(l){var m=this.convertTo('document');l.style.left=parseInt(m.x)+'px';l.style.top=parseInt(m.y)+'px';return this;},setElementDimensions:function(l){return this.setElementWidth(l).setElementHeight(l);},setElementWidth:function(l){l.style.width=parseInt(this.x,10)+'px';return this;},setElementHeight:function(l){l.style.height=parseInt(this.y,10)+'px';return this;},scrollElementBy:function(l){if(l==document.body){window.scrollBy(this.x,this.y);}else{l.scrollLeft+=this.x;l.scrollTop+=this.y;}return this;}});j(k,{getEventPosition:function(l,m){m=m||'document';l=i(l);var n=g.getDocumentScrollElement(),o=l.pageX||(l.clientX+n.scrollLeft),p=l.pageY||(l.clientY+n.scrollTop),q=new k(o,p,'document');return q.convertTo(m);},getScrollPosition:function(l){l=l||'document';var m=g.getDocumentScrollElement(),n=m.scrollLeft,o=m.scrollTop;return new k(n,o,'document').convertTo(l);},getElementPosition:function(l,m){m=m||'document';if(!l)return;if(!('getBoundingClientRect' in l))return new k(0,0,'document');var n=l.getBoundingClientRect(),o=document.documentElement,p=Math.round(n.left)-o.clientLeft,q=Math.round(n.top)-o.clientTop;return new k(p,q,'viewport').convertTo(m);},getElementDimensions:function(l){return new k(l.offsetWidth||0,l.offsetHeight||0);},getViewportDimensions:function(){var l=(window&&window.innerWidth)||(document&&document.documentElement&&document.documentElement.clientWidth)||(document&&document.body&&document.body.clientWidth)||0,m=(window&&window.innerHeight)||(document&&document.documentElement&&document.documentElement.clientHeight)||(document&&document.body&&document.body.clientHeight)||0;return new k(l,m,'viewport');},getDocumentDimensions:function(l){l=l||document;var m=g.getDocumentScrollElement(l);if(m===l.body&&h.firefox())m=l.documentElement;var n=m.scrollWidth||0,o=m.scrollHeight||0;return new k(n,o,'document');},deserialize:function(l){var m=l.split(',');return new k(m[0],m[1]);}});e.exports=k;}); __e("Form",["event-extensions","ArrayUtils","AsyncRequest","AsyncResponse","DataStore","dom","Env","Input","Parent","URI","Vector","trackReferrer"],function(a,b,c,d,e,f){b("event-extensions");var g=b("ArrayUtils"),h=b("AsyncRequest"),i=b("AsyncResponse"),j=b("DataStore"),k=b("dom"),l=b("Env"),m=b("Input"),n=b("Parent"),o=b("URI"),p=b("Vector"),q=b("trackReferrer"),r={getInputs:function(s){s=s||document;return [].concat(g.createFrom(k.scry(s,'input')),g.createFrom(k.scry(s,'select')),g.createFrom(k.scry(s,'textarea')),g.createFrom(k.scry(s,'button')));},getSelectValue:function(s){return s.options[s.selectedIndex].value;},setSelectValue:function(s,t){for(var u=0;u0){var v=0,w=true;t.sort().each(function(y){if(y!=v++)w=false;});if(w){var x=[];t.each(function(y){x[y]=s[y];});return x;}}return s;},post:function(s,t,u){var v=document.createElement('form');v.action=s.toString();v.method='POST';v.style.display='none';if(u)v.target=u;if(ge('post_form_id'))t.post_form_id=$('post_form_id').value;t.fb_dtsg=l.fb_dtsg;t.post_form_id_source='dynamic_post';r.createHiddenInputs(t,v);k.getRootElement().appendChild(v);v.submit();return false;},createHiddenInputs:function(s,t,u,v){u=u||{};var w,x=o.implodeQuery(s,'',false),y=x.split('&');for(var z=0;z0&&z.x>0)return x;}catch(y){}}}return null;},focusFirst:function(s){var t=r.getFirstElement(s);if(t){t.focus();return true;}return false;}};e.exports=r;}); __e("Keys",[],function(a,b,c,d,e,f){var g={BACKSPACE:8,TAB:9,RETURN:13,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,COMMA:188};e.exports=g;}); __e("Locale",["css"],function(a,b,c,d,e,f){var g=b("css"),h={isRTL:function(){return 'rtl'===g.getStyle(document.body,'direction');}};e.exports=h;}); __e("getOverlayZIndex",["css"],function(a,b,c,d,e,f){var g=b("css");function h(i,j){j=j||document.body;var k=[];while(i&&i!==j){k.push(i);i=i.parentNode;}if(i!==j)return 0;for(var l=k.length-1;l>=0;l--){var m=k[l];if(g.getStyle(m,'position')!='static'){var n=parseInt(g.getStyle(m,'z-index'),10);if(!isNaN(n))return n;}}return 0;}e.exports=h;}); __e("Dialog",["array-extensions","event-extensions","AjaxPipeRequest","animation","Arbiter","ArrayUtils","AsyncRequest","bootloader","Button","css-support","dom","Form","HTML","Input","Keys","Locale","ObjectUtils","onload","Parent","ua","URI","Vector","bind","copyProperties","getOverlayZIndex","tx"],function(global,require,requireDynamic,requireLazy,module,exports){require("array-extensions");require("event-extensions");var AjaxPipeRequest=require("AjaxPipeRequest"),animation=require("animation"),Arbiter=require("Arbiter"),ArrayUtils=require("ArrayUtils"),AsyncRequest=require("AsyncRequest"),Bootloader=require("bootloader"),Button=require("Button"),CSS=require("css-support"),DOM=require("dom"),Form=require("Form"),HTML=require("HTML"),Input=require("Input"),Keys=require("Keys"),Locale=require("Locale"),ObjectUtils=require("ObjectUtils"),Onload=require("onload"),Parent=require("Parent"),ua=require("ua"),URI=require("URI"),Vector=require("Vector"),bind=require("bind"),copyProperties=require("copyProperties"),getOverlayZIndex=require("getOverlayZIndex");global.tx=require("tx");var _supportsPositionFixed=function(){var body=document.body,test=document.createElement('div'),control=document.createElement('div');body.insertBefore(test,body.firstChild);body.insertBefore(control,body.firstChild);test.style.position='fixed';test.style.top='20px';var result=test.offsetTop!==control.offsetTop;body.removeChild(test);body.removeChild(control);_supportsPositionFixed=bagof(result);return result;};function Dialog(model){this._show_loading=true;this._auto_focus=true;this._submit_on_enter=false;this._fade_enabled=true;this._onload_handlers=[];this._top=125;this._uniqueID='dialog_'+Dialog._globalCount++;this._content=null;this._obj=null;this._popup=null;this._overlay=null;this._shim=null;this._causal_elem=null;this._previous_focus=null;this._buttons=[];this._buildDialog();if(model)this._setFromModel(model);Dialog._init();}copyProperties(Dialog,{OK:{name:'ok',label:"Okay"},CANCEL:{name:'cancel',label:"Cancel",className:'inputaux'},CLOSE:{name:'close',label:"Close"},NEXT:{name:'next',label:"Next"},SAVE:{name:'save',label:"Save"},SUBMIT:{name:'submit',label:"Submit"},CONFIRM:{name:'confirm',label:"Confirm"},DELETE:{name:'delete',label:"Delete"},_globalCount:0,_bottoms:[0],max_bottom:0,_updateMaxBottom:function(){Dialog.max_bottom=Math.max.apply(Math,Dialog._bottoms);}});copyProperties(Dialog,{OK_AND_CANCEL:[Dialog.OK,Dialog.CANCEL],_STANDARD_BUTTONS:[Dialog.OK,Dialog.CANCEL,Dialog.CLOSE,Dialog.SAVE,Dialog.SUBMIT,Dialog.CONFIRM,Dialog.DELETE],SIZE:{WIDE:555,STANDARD:445},_HALO_WIDTH:10,_BORDER_WIDTH:1,_PADDING_WIDTH:10,_PAGE_MARGIN:40,_stack:[],_isUsingCSSBorders:function(){return CSS.supportsBorderRadius()||ua.ie()<7;},newButton:function(name,label,className,handler){var button={name:name,label:label};if(className)button.className=className;if(handler)button.handler=handler;return button;},getCurrent:function(){var stack=Dialog._stack;return stack.length?stack[stack.length-1]:null;},bootstrap:function(uri,data,read_only,method,model,elem){data=data||{};var use_pipe=elem&&elem.rel=='dialog-pipe';copyProperties(data,new URI(uri).getQueryData());method=method||(read_only?'GET':'POST');var status_elem=Parent.byClass(elem,'stat_elem')||elem;if(status_elem&&CSS.hasClass(status_elem,'async_saving'))return false;var request;if(use_pipe){request=new AjaxPipeRequest();}else request=new AsyncRequest().setReadOnly(!!read_only).setMethod(method).setRelativeTo(elem).setStatusElement(status_elem);request.setURI(uri).setNectarModuleDataSafe(elem).setData(data);var dialog=new Dialog(model).setCausalElement(elem).setAsync(request,use_pipe);dialog.show();return false;},_init:function(){this._init=bagofholding;Onload.runOnleave(Dialog._tearDown.shield(null,false));Arbiter.subscribe('page_transition',Dialog._tearDown.shield(null,true));Event.listen(document.documentElement,'keydown',function(event){if(Event.getKeyCode(event)==Keys.ESC&&!event.getModifiers().any){if(Dialog._escape())event.kill();}else if(Event.getKeyCode(event)==Keys.RETURN&&!event.getModifiers().any)if(Dialog._enter())event.kill();});Event.listen(window,'resize',function(event){var dialog=Dialog.getCurrent();dialog&&dialog._resetDialogObj();});},_findButton:function(buttons,name){if(buttons)for(var i=0;i=0;ii--)if(!(is_page_transition&&stack[ii]._cross_transition))stack[ii].hide();},_escape:function(){var dialog=Dialog.getCurrent();if(!dialog)return false;var semi_modal=dialog._semi_modal,buttons=dialog._buttons;if(!buttons.length&&!semi_modal)return false;if(semi_modal&&!buttons.length){dialog.hide();return true;}var button_to_simulate,cancel_button=Dialog._findButton(buttons,'cancel');if(dialog._cancelHandler){dialog.cancel();return true;}else if(cancel_button){button_to_simulate=cancel_button;}else if(buttons.length==1){button_to_simulate=buttons[0];}else return false;dialog._handleButton(button_to_simulate);return true;},_enter:function(){var dialog=Dialog.getCurrent();if(!dialog||!dialog._submit_on_enter)return false;if(document.activeElement!=dialog._frame)return false;var buttons=dialog._buttons;if(!buttons)return false;dialog._handleButton(buttons[0]);return true;},call_or_eval:function(obj,func,args){if(!func)return undefined;args=args||{};if(typeof(func)=='string'){var params=ObjectUtils.getKeys(args).join(', ');func=eval('({f: function('+params+') { '+func+'}})').f;}return func.apply(obj,ObjectUtils.getValues(args));}});copyProperties(Dialog.prototype,{_cross_transition:false,_loading:false,_showing:false,show:function(){if(this._async_request&&this._show_loading){this.showLoading();}else{this._showing=true;this._update();}return this;},showLoading:function(){this._loading=true;CSS.addClass(this._frame,'dialog_loading_shown');this._renderDialog();return this;},hide:function(){if(!this._showing&&!this._loading)return this;this._showing=false;if(this._autohide_timeout){clearTimeout(this._autohide_timeout);this._autohide_timeout=null;}if(this._fade_enabled&&Dialog._stack.length<=1){this._fadeOut();}else this._hide();return this;},cancel:function(){if(!this._cancelHandler||this._cancelHandler()!==false)this.hide();},getRoot:function(){return this._obj;},getBody:function(){return DOM.scry(this._obj,'div.dialog_body')[0];},getButtonElement:function(button){if(typeof button=='string')button=Dialog._findButton(this._buttons,button);if(!button||!button.name)return null;var inputs=DOM.scry(this._popup,'input'),name_filter=function(elem){return elem.name==button.name;};return inputs.filter(name_filter)[0]||null;},getContentNode:function(){return DOM.find(this._content,'div.dialog_content');},getFormData:function(){return Form.serialize(this.getContentNode());},setAllowCrossPageTransition:function(allow){this._cross_transition=allow;return this;},setShowing:function(){this.show();return this;},setHiding:function(){this.hide();return this;},setTitle:function(title){var node=this._nodes.title,inner_node=this._nodes.title_inner,content_node=this._nodes.content;DOM.setContent(inner_node,this._format(title||''));CSS.conditionShow(node,!!title);CSS.conditionClass(content_node,'dialog_content_titleless',!title);return this;},setBody:function(body){DOM.setContent(this._nodes.body,this._format(body));return this;},setExtraData:function(data){this._extra_data=data;return this;},setReturnData:function(data){this._return_data=data;return this;},setShowLoading:function(show){this._show_loading=show;return this;},setFullBleed:function(is_full_bleed){this._full_bleed=is_full_bleed;this._updateWidth();CSS.conditionClass(this._obj,'full_bleed',is_full_bleed);return this;},setCausalElement:function(elem){this._causal_elem=elem;return this;},setUserData:function(data){this._user_data=data;return this;},getUserData:function(){return this._user_data;},setAutohide:function(autohide){if(autohide){if(this._showing){this._autohide_timeout=setTimeout(this.hide.shield(this),autohide);}else this._autohide=autohide;}else{this._autohide=null;if(this._autohide_timeout){clearTimeout(this._autohide_timeout);this._autohide_timeout=null;}}return this;},setSummary:function(summary){var node=this._nodes.summary;DOM.setContent(node,this._format(summary||''));CSS.conditionShow(node,!!summary);return this;},setButtons:function(b){var buttons,button;if(!(b instanceof Array)){buttons=ArrayUtils.createFrom(arguments);}else buttons=b;for(var i=0;i0)for(var ii=0;ii5)button_input.setAttribute(attr,button[attr]);button_content.push(button_node);}DOM.setContent(this._nodes.buttons,button_content);this._updateButtonVisibility();return this;},setButtonsMessage:function(message){DOM.setContent(this._nodes.button_message,this._format(message||''));this._has_button_message=!!message;this._updateButtonVisibility();return this;},_updateButtonVisibility:function(){var show=this._buttons.length>0||this._has_button_message;CSS.conditionShow(this._nodes.button_wrapper,show);CSS.conditionClass(this._obj,'omitDialogFooter',!show);},setClickButtonOnEnter:function(input_id,button){this._clickOnEnterTarget=input_id;if(!this._clickOnEnterListener)this._clickOnEnterListener=Event.listen(this._nodes.body,'keypress',function(event){var target=event.getTarget();if(target&&target.id===this._clickOnEnterTarget)if(Event.getKeyCode(event)==Keys.RETURN){this._handleButton(button);event.kill();}return true;}.bind(this));return this;},setStackable:function(stackable,shown){this._is_stackable=stackable;this._shown_while_stacked=stackable&&shown;return this;},setHandler:function(handler){this._handler=handler;return this;},setCancelHandler:function(cancelHandler){this._cancelHandler=Dialog.call_or_eval.bind(null,this,cancelHandler);return this;},setCloseHandler:function(close_handler){this._close_handler=Dialog.call_or_eval.bind(null,this,close_handler);return this;},clearHandler:function(){return this.setHandler(null);},setPostURI:function(post_uri,asynchronous){if(asynchronous===undefined)asynchronous=true;if(asynchronous){this.setHandler(this._submitForm.bind(this,'POST',post_uri));}else this.setHandler(function(){Form.post(post_uri,this.getFormData());this.hide();}.bind(this));return this;},setGetURI:function(get_uri){this.setHandler(this._submitForm.bind(this,'GET',get_uri));return this;},setModal:function(modal){this._modal=modal;CSS.conditionClass(this._obj,'generic_dialog_modal',modal);return this;},setSemiModal:function(clickout){if(clickout){this.setModal(true);this._semiModalListener=Event.listen(this._obj,'click',function(e){if(!DOM.contains(this._popup,e.getTarget()))this.hide();}.bind(this));}else this._semiModalListener&&this._semiModalListener.remove();this._semi_modal=clickout;return this;},setWideDialog:function(is_wide){this._wide_dialog=is_wide;this._updateWidth();return this;},setContentWidth:function(width){this._content_width=width;this._updateWidth();return this;},setTitleLoading:function(loading){if(loading===undefined)loading=true;var header=DOM.find(this._popup,'h2.dialog_title');if(header)CSS.conditionClass(header,'loading',loading);return this;},setSecure:function(is_secure){CSS.conditionClass(this._nodes.title,'secure',is_secure);return this;},setClassName:function(class_name){CSS.addClass(this._obj,class_name);return this;},setFadeEnabled:function(enabled){this._fade_enabled=enabled;return this;},setFooter:function(footer){var node=this._nodes.footer;DOM.setContent(node,this._format(footer||''));CSS.conditionShow(node,!!footer);return this;},setAutoFocus:function(focus){this._auto_focus=focus;return this;},setTop:function(top){this._top=top;this._resetDialogObj();return this;},onloadRegister:function(handler){ArrayUtils.createFrom(handler).forEach(function(i){if(typeof i=='string')i=new Function(i);this._onload_handlers.push(i.bind(this));}.bind(this));return this;},setAsyncURL:function(url){return this.setAsync(new AsyncRequest(url));},setAsync:function(async_request,use_pipe){var handler=function(response){if(this._async_request!=async_request)return;this._async_request=null;var payload=response.getPayload(),dialog=payload,fn=function(){if(this._loading)this._showing=true;if(typeof dialog=='string'){this.setBody(dialog);}else this._setFromModel(dialog);this._update();}.bind(this);if(use_pipe){dialog=payload.dialog;Bootloader.setResourceMap(payload.resource_map);Bootloader.loadResources(payload.css,fn);}else fn();}.bind(this),data=async_request.getData();data.__d=1;async_request.setData(data);var request;if(use_pipe){async_request.setFirstResponseHandler(handler);request=async_request.getAsyncRequest();}else{var orig_handler=async_request.getHandler()||bagofholding;async_request.setHandler(function(response){orig_handler(response);handler(response);});request=async_request;}var orig_error_handler=request.getErrorHandler()||bagofholding,orig_trans_error_handler=request.getTransportErrorHandler()||bagofholding,handle_error=function(){this._async_request=null;if(this._showing){this._update();}else this._hide();}.bind(this),server_cancel_handler=request.getServerDialogCancelHandler()||handle_error;request.setAllowCrossPageTransition(this._cross_transition).setErrorHandler(function(response){handle_error();orig_error_handler(response);}).setTransportErrorHandler(function(response){handle_error();orig_trans_error_handler(response);}).setServerDialogCancelHandler(server_cancel_handler);async_request.send();this._async_request=async_request;this._update();return this;},_format:function(content){if(typeof content=='string'){content=HTML(content);}else content=HTML.replaceJSONWrapper(content);if(content instanceof HTML)content.setDeferred(true);return content;},_update:function(){if(!this._showing)return;if(this._autohide&&!this._async_request&&!this._autohide_timeout)this._autohide_timeout=setTimeout(bind(this,'hide'),this._autohide);if(this._async_request&&this._show_loading){this.showLoading();}else{CSS.removeClass(this._frame,'dialog_loading_shown');this._loading=false;this._renderDialog();this._runOnloads();this._previous_focus=document.activeElement;Input.focus(this._frame);}},_runOnloads:function(){for(var i=0;i(this._modal?400:200);CSS.setStyle(this._obj,'z-index',this._hasSetZIndex?z_index:'');}this._pushOntoStack();this._obj.style.height=(this._modal&&ua.ie()<7)?Vector.getDocumentDimensions().y+'px':null;if(this._obj&&this._obj.style.display){this._obj.style.visibility='hidden';this._obj.style.display='';this.resetDialogPosition();this._obj.style.visibility='';this._obj.dialog=this;}else this.resetDialogPosition();clearInterval(this.active_hiding);this.active_hiding=setInterval(this._activeResize.bind(this),500);return this;},_updateShim:function(){return this._shim&&this._shim.show();},_activeResize:function(){if(this.last_offset_height!=this._content.offsetHeight){this.last_offset_height=this._content.offsetHeight;this.resetDialogPosition();}},_buildDialogContainer:function(){CSS.addClass(this._obj,'pop_dialog');if(Locale.isRTL())CSS.addClass(this._obj,'pop_dialog_rtl');var markup;if(Dialog._isUsingCSSBorders()){markup='
'+'
'+'
';}else markup='
'+'
'+'
'+'
'+'
'+'
'+'
'+'
'+'
';DOM.setContent(this._popup,HTML(markup));var frame=DOM.find(this._popup,'div.pop_content');frame.setAttribute('tabIndex','0');frame.setAttribute('role','alertdialog');this._frame=this._content=frame;},_buildDialogContent:function(){var loading=DOM.$N('div',{className:'dialog_loading'},"Loading..."),title_inner=DOM.$N('span'),title=DOM.$N('h2',{className:'dialog_title hidden_elem',id:'title_'+this._uniqueID},title_inner),summary=DOM.$N('div',{className:'dialog_summary hidden_elem'}),body=DOM.$N('div',{className:'dialog_body'}),buttons=DOM.$N('div'),button_message=DOM.$N('div',{className:'dialog_buttons_msg'}),button_wrapper=DOM.$N('div',{className:'dialog_buttons clearfix hidden_elem'},[button_message,buttons]),footer=DOM.$N('div',{className:'dialog_footer hidden_elem'}),content=DOM.$N('div',{className:'dialog_content'},[summary,body,button_wrapper,footer]);this._nodes={summary:summary,body:body,buttons:buttons,button_message:button_message,button_wrapper:button_wrapper,footer:footer,content:content,title:title,title_inner:title_inner};DOM.setContent(this._frame,[title,content,loading]);},resetDialogPosition:function(){if(!this._popup)return;this._resetDialogObj();this._updateShim();},_resetDialogObj:function(){var total_margin=2*Dialog._PAGE_MARGIN,viewport_dimensions=Vector.getViewportDimensions(),viewport_width=viewport_dimensions.x-total_margin,viewport_height=viewport_dimensions.y-total_margin,total_halo_width=2*Dialog._HALO_WIDTH,content_dimensions=Vector.getElementDimensions(this._content),content_width=content_dimensions.x+total_halo_width,content_height=content_dimensions.y+total_halo_width,top=this._top,empty_horiz_space=viewport_width-content_width,empty_vertical_space=viewport_height-content_height;if(empty_vertical_space<0){top=Dialog._PAGE_MARGIN;}else if(top>empty_vertical_space)top=Dialog._PAGE_MARGIN+(Math.max(empty_vertical_space,0)/2);var is_fixed=_supportsPositionFixed();if(!is_fixed)top+=Vector.getScrollPosition().y;CSS.setStyle(this._popup,'top',top+'px');var scroll=is_fixed&&(empty_horiz_space<0||empty_vertical_space<0);CSS.conditionClass(this._obj,'generic_dialog_fixed_overflow',scroll);CSS.conditionClass(document.documentElement,'generic_dialog_overflow_mode',scroll);},_fadeOut:function(temporary){if(!this._popup)return;try{animation(this._obj).duration(0).checkpoint().to('opacity',0).hide().duration(250).ondone(this._hide.bind(this,temporary)).go();}catch(e){this._hide(temporary);}},_hide:function(temporary){if(this._obj)this._obj.style.display='none';CSS.removeClass(document.documentElement,'generic_dialog_overflow_mode');this._updateShim();clearInterval(this.active_hiding);if(this._bottom){var bs=Dialog._bottoms;bs.splice(bs.indexOf(this._bottom),1);Dialog._updateMaxBottom();}if(this._previous_focus&&document.activeElement&&DOM.contains(this._obj,document.activeElement))Input.focus(this._previous_focus);if(temporary)return;this.destroy();},destroy:function(){this._popFromStack();if(this._obj){DOM.remove(this._obj);this._obj=null;this._shim&&this._shim.hide();this._shim=null;}this._clickOnEnterListener&&this._clickOnEnterListener.remove();if(this._close_handler)this._close_handler({return_data:this._return_data});},_handleButton:function(button){if(typeof button=='string')button=Dialog._findButton(this._buttons,button);var value=Dialog.call_or_eval(button,button.handler);if(value===false)return;if(button.name=='cancel'){this.cancel();}else if(Dialog.call_or_eval(this,this._handler,{button:button})!==false)this.hide();},_submitForm:function(method,uri,button){var data=this.getFormData();if(button)data[button.name]=button.label;if(this._extra_data)copyProperties(data,this._extra_data);var async_request=new AsyncRequest().setURI(uri).setData(data).setMethod(method).setNectarModuleDataSafe(this._causal_elem).setReadOnly(method=='GET');this.setAsync(async_request);return false;},_setFromModel:function(original_model){var model={};copyProperties(model,original_model);for(var propertyName in model){if(propertyName=='onloadRegister'){this.onloadRegister(model[propertyName]);continue;}var mutator=this['set'+propertyName.substr(0,1).toUpperCase()+propertyName.substr(1)];mutator.apply(this,ArrayUtils.createFrom(model[propertyName]));}},_updateBottom:function(){var bottom=Vector.getElementDimensions(this._content).y+Vector.getElementPosition(this._content).y;Dialog._bottoms[Dialog._bottoms.length-1]=bottom;Dialog._updateMaxBottom();},_pushOntoStack:function(){var stack=Dialog._stack;if(!stack.length)Arbiter.inform('layer_shown',{type:'Dialog'});stack.remove(this);stack.push(this);for(var i=stack.length-2;i>=0;i--){var prev_dialog=stack[i];if(!prev_dialog._is_stackable&&!prev_dialog._async_request){prev_dialog._hide();}else if(!prev_dialog._shown_while_stacked)prev_dialog._hide(true);}},_popFromStack:function(){var stack=Dialog._stack,was_top=(stack[stack.length-1]===this);stack.remove(this);if(stack.length){if(was_top)stack[stack.length-1]._showDialog();}else Arbiter.inform('layer_hidden',{type:'Dialog'});}});module.exports=Dialog;}); __e("legacy:dialog",["Dialog"],function(a,b,c,d){var e=b('Dialog');a.Dialog=e;},3); __e("legacy:async",["AsyncRequest","AsyncResponse"],function(a,b,c,d){a.AsyncRequest=b('AsyncRequest');a.AsyncResponse=b('AsyncResponse');},3); __e("legacy:input-selection",["InputSelection","copyProperties"],function(a,b,c,d){var e=b('InputSelection'),f=b('copyProperties');f(a.Input||(a.Input={}),{getSelection:e.get,setSelection:e.set});},3); __e("legacy:data-store",["DataStore"],function(a,b,c,d){a.DataStore=a.DataStore||b('DataStore');},3); __e("legacy:dom-html",["HTML"],function(a,b,c,d){a.HTML=b('HTML');},3); __e("legacy:input-methods",["Input","copyProperties"],function(a,b,c,d){var e=b('Input'),f=b('copyProperties');f(a.Input||(a.Input={}),e);},3); __e("StringEscape",[],function(a,b,c,d,e,f){var g={escapeJSQuotes:function(h){if(typeof h=='undefined'||h==null||!h.valueOf())return '';return h.toString().replace(/\\/g,'\\\\').replace(/\n/g,'\\n').replace(/\r/g,'\\r').replace(/"/g,'\\x22').replace(/'/g,'\\\'').replace(//g,'\\x3e').replace(/&/g,'\\x26');},htmlSpecialChars:function(h){if(typeof h=='undefined'||h===null||!h.toString)return '';if(h===false){return '0';}else if(h===true)return '1';return h.toString().replace(/&/g,'&').replace(/"/g,'"').replace(/'/g,''').replace(//g,'>');},htmlize:function(h){return g.htmlSpecialChars(h).replace(/\r\n|[\r\n]/g,'
');}};e.exports=g;}); __e("legacy:string-escape",["StringEscape"],function(a,b,c,d){var e=b('StringEscape');a.escape_js_quotes=e.escapeJSQuotes;a.htmlspecialchars=e.htmlSpecialChars;a.htmlize=e.htmlize;},3); var TypeaheadUtil=(function(){var a=/[ ]+/g,b=/[^ ]+/g,c=/[.,+*?$|#{}()\^\-\[\]\\\/!@%'"~=<>_:;\u2010\u2011\u2012\u2013\u2014\u2015\u30fb]/g,d={},e={a:"\u0430 \u00e0 \u00e1 \u00e2 \u00e3 \u00e4 \u00e5",b:"\u0431",c:"\u0446 \u00e7 \u010d",d:"\u0434 \u00f0 \u010f \u0111",e:"\u044d \u0435 \u00e8 \u00e9 \u00ea \u00eb \u011b",f:"\u0444",g:"\u0433 \u011f",h:"\u0445 \u0127",i:"\u0438 \u00ec \u00ed \u00ee \u00ef \u0131",j:"\u0439",k:"\u043a \u0138",l:"\u043b \u013e \u013a \u0140 \u0142",m:"\u043c",n:"\u043d \u00f1 \u0148 \u0149 \u014b",o:"\u043e \u00f8 \u00f6 \u00f5 \u00f4 \u00f3 \u00f2",p:"\u043f",r:"\u0440 \u0159 \u0155",s:"\u0441 \u015f \u0161 \u017f",t:"\u0442 \u0165 \u0167 \u00fe",u:"\u0443 \u044e \u00fc \u00fb \u00fa \u00f9 \u016f",v:"\u0432",y:"\u044b \u00ff \u00fd",z:"\u0437 \u017e",ae:"\u00e6",oe:"\u0153",ts:"\u0446",ch:"\u0447",ij:"\u0133",sh:"\u0448",ss:"\u00df",ya:"\u044f"};for(var f in e){var g=e[f].split(' ');for(var h=0;h_:;',c='\\b[A-Z][^ A-Z'+b+']',d='([^'+a+b+']|['+b+'][^ '+b+'])',e='(?:^|\\s)(?:['+a+']('+d+'{0,20}))',f='(?:(?:'+c+'+)|'+e+')',g='(?:'+c+'{4,})';MentionsInput.prototype={_triggers:new RegExp('['+a+']$'),_matcher:new RegExp(e+'$'),_autoMatcher:new RegExp(f+'$'),_userMatcher:new RegExp(g+'$')};})();Class.mixin(MentionsInput,'Arbiter',{init:function(a,b,c){this.init=bagofholding;this._initialized=true;this._typeahead=Typeahead.getInstance(DOM.find(this._root,'.mentionsTypeahead'));this._highlighter=DOM.find(this._root,'.highlighter');this._highlighterInner=this._highlighter.firstChild;this._highlighterContent=DOM.find(this._root,'.highlighterContent');this._hiddenInput=DOM.find(this._root,'.mentionsHidden');this._input=this._typeahead.getCore().getElement();this._placeholder=this._input.getAttribute('placeholder')||'';this._maxMentions=a.max||6;this._metrics=c;if(ua.firefox()<4){this._input.blur();setTimeout(function(){this._input.focus();}.bind(this));}if(!this._hiddenInput.name){var d=this._input.name;this._input.name=d+'_text';this._hiddenInput.name=d;}this._initEvents();this._initTypeahead();this.reset(b);this.inform('init',null,Arbiter.BEHAVIOR_STATE);},reset:function(a){if(!this._initialized)return;this._mentioned={};this._orderedUIDs=[];this._numMentioned=0;this._filterData=null;this._hiddenInput&&(this._hiddenInput.value='');this._highlighterContent&&DOM.empty(this._highlighterContent);this._highlighterAuxContent&&DOM.remove(this._highlighterAuxContent);this._highlighterAuxContent=null;Input.setPlaceholder(this._input,this._placeholder);CSS.setStyle(this._typeahead.getElement(),'height','auto');if(a){Input.setValue(this._input,a.flattened);for(var b in a.mention_data)this._addToken({uid:b,text:a.mention_data[b],type:'unknown'});}this._updateTypeahead();this._updateWidth();this._update();},getRawValue:function(){return Input.getValue(this._hiddenInput);},checkValue:function(){var a=this._typeahead.getCore().getValue();if(this._triggers.exec(a)||a==='')this.inform('sessionEnd',{});},getTypeahead:function(){return this._typeahead;},_initEvents:function(){var a=this._update.bind(this);Event.listen(this._input,{input:a,keyup:a,change:a,focus:this._updateWidth.bind(this)});if(this._metrics){this._metrics._reset();this._metrics.bindSessionStart(this._typeahead,'render',true);this._metrics.bindSessionEnd(this._typeahead.getView(),'select',true);this._metrics.bindSessionEnd(this,'sessionEnd',false);Event.listen(this._input,'keyup',function(event){this.checkValue.bind(this).defer();}.bind(this));}},_initTypeahead:function(){this._typeahead.subscribe('select',function(e,f){var g=f.selected;this._addToken({uid:g.uid,text:g.text,type:g.type});this.updateValue();}.bind(this));var a=this._input,b=null,c=function(){if(b===null){b=Input.getSubmitOnEnter(a);Input.setSubmitOnEnter(a,false);}},d=function(){if(b!==null){Input.setSubmitOnEnter(a,b);b=null;}};this._typeahead.subscribe('render',c);this._typeahead.subscribe('reset',d);this._typeahead.subscribe('highlight',function(e,f){f.index>=0?c():d();});this._typeahead.subscribe('query',function(){this._filterData=null;}.bind(this));this._typeahead.getCore().suffix='';this._typeahead.getData().setFilter(this._filterResults.bind(this));},_filterResults:function(a){if(this._filterData===null){var b=Input.getSelection(this._input).start||0;for(var c=0;cd[0]&&b<=d[1]){this._filterData={caretIsInsideMention:true};return false;}}var e=this._typeahead.getCore();this._filterData={value:e.getValue(),rawValue:e.getRawValue()};}if(this._filterData.caretIsInsideMention)return false;if(this._matcher.test(this._filterData.rawValue))return true;if(a.type!='user')return false;if(this._userMatcher.test(this._filterData.value))return true;return TypeaheadUtil.isExactMatch(this._filterData.value,this._typeahead.getData().getTextToIndex(a));},_addToken:function(a){var b=a.uid;if(!this._mentioned.hasOwnProperty(b)){this._mentioned[b]=a;this._orderedUIDs.push(b);this._numMentioned++;this._updateTypeahead();}},_removeToken:function(a){if(this._mentioned.hasOwnProperty(a)){delete this._mentioned[a];this._orderedUIDs.remove(a);this._numMentioned--;this._updateTypeahead();}},_reduceToken:function(a,b){var c=b.split(' '),d=[];for(var e=0;e'+htmlize(e)+'');e=e.replace(/[\\\]:]/g,function(h){return '\\'+h;});a=a.replace('@['+f+':]','@['+f+':'+e+']');}if(ua.ie())d=d.replace(/ {2}/g,'  ');this._offsets=c;this._hiddenInput.value=a;DOM.setContent(this._highlighterContent,HTML(d));this._updateHighlighter();this._updateHeight();},_updateDirection:function(){var a=CSS.getStyle(this._input,'direction');if(a==this._dir)return;this._dir=a;CSS.setStyle(this._highlighter,'direction',a);if(a=='rtl'){CSS.setStyle(this._highlighter,'text-align','right');}else CSS.setStyle(this._highlighter,'text-align','left');},_updateWidth:function(){var a=CSS.getStyleFloat.curry(this._input),b=this._input.offsetWidth-a('paddingLeft')-a('paddingRight')-a('borderLeftWidth')-a('borderRightWidth');if(ua.firefox())b-=2;if(ua.ie()<=7){b-=CSS.getStyleFloat(this._highlighterInner,'paddingLeft');this._highlighter.style.zoom=1;}this._highlighterInner.style.width=Math.max(b,0)+'px';},_updateHeight:function(){if(this._highlighterAuxContent){var a=this._highlighter.offsetHeight,b=this._typeahead.getElement();if(a>b.offsetHeight){CSS.setStyle(b,'height',a+'px');Arbiter.inform('reflow');}}},_updateTypeahead:function(){var a=this._typeahead.getCore(),b=null;if(!this._maxMentions||this._numMentioned0||this.hasAuxContent());},setAuxContent:function(a){if(this._highlighterContent){if(!this._highlighterAuxContent){this._highlighterAuxContent=$N('span',{className:'highlighterAuxContent'});DOM.insertAfter(this._highlighterContent,this._highlighterAuxContent);}DOM.setContent(this._highlighterAuxContent,a);if(a){Input.setPlaceholder(this._input,'');}else Input.setPlaceholder(this._input,this._placeholder);this._updateHighlighter();this._updateHeight();}},hasAuxContent:function(){var a=this.getAuxContentRoot();return a&&a.innerHTML.length>0;},getAuxContentRoot:function(){return this._highlighterAuxContent;},addMention:function(a){var b=Input.getValue(this._input);Input.setValue(this._input,b+" "+a.text);this._addToken(a);this._update();},getMentions:function(){return this._mentioned;}}); function intl_inline_insert_token(a,b,c,d){intl_inline_insert(b,a);if(a.indexOf('}')==-1){var e=Input.getSelection(b).end;Input.setSelection(b,e+a.length-1);if(b.typeahead){b.typeahead.show();b.typeahead.check_value();}}if(c===undefined)return;CSS.hide(c);Event.listen(b,'keyup',function(event){if(Input.getValue(b).indexOf(a)==-1){CSS.show(c);var f=Input.getValue(b);if(d.length===0&&f.indexOf(a)==-1&&f.indexOf(a.substr(0,a.length-1))!=-1)Input.setValue(b,f.replace(a.substr(0,a.length-1),''));}});}function intl_inline_insert(a,b){Input.focus(a);var c=Input.getSelection(a).end,d=Input.getValue(a),e=d.substr(0,c)+b+d.substr(c);Input.setValue(a,e);Input.setSelection(a,c+b.length);var f=MentionsInput.getInstance(a);f&&f.updateValue();intl_inline_refresh_tokens(a);}function intl_inline_copy_translation(a,b){Input.setValue(a,'');intl_inline_insert(a,b);}function intl_inline_refresh_tokens(a){if(Input.isEmpty(a)||!CSS.hasClass(a,'rtl'))return true;return intl_inline_rtl_refresh_tokens(a);}function intl_inline_rtl_refresh_tokens(a){var b='',c=Input.getSelection(a).end,d=Input.getValue(a).substr(0,c),e=Input.getValue(a).substr(c),f=function(i){return i.replace(/\}(?!\u200e\u200f)/g,'}\u200e\u200f').replace(/(?!\u200e)\{/g,'\u200e{');};d=f(d);b=d+f(e);var g=d.length;if(b.match(/\{[^}]*[\- ]/)){var h='';do{h=b;b=b.replace(/(\{[^}]*) /g,'$1\u00a0').replace(/(\{[^}]*)-/g,'$1\u2011');}while(h!=b);}if(b!=Input.getValue(a)){Input.setValue(a,b);Input.setSelection(a,g,g);}return true;}function intl_inline_rtl_check_backspace(a,b){var c=Input.getSelection(a);if(!CSS.hasClass(a,'rtl')||c.start!=c.end||c.end===0)return true;var d={'\u200e':true,'\u200f':true},e=c.end-1,f=Input.getValue(a);while(e>0&&(f.charAt(e) in d))e--;Input.setValue(a,f.substr(0,e)+f.substr(c.end));Input.setSelection(a,e,e);$E(b).prevent();return true;}function intl_inline_translate_focus(a){var b=Input.getValue(a).length;Input.setSelection(a,b);Input.focus(a);}function intl_inline_translate_listeners(a){Arbiter.subscribe('intldialog/menu_pillTranslate',function(b,c){if(DOM.find(c.form,'.translate .textarea')==a)intl_inline_translate_focus(a);});if(CSS.hasClass(a,'rtl')){Event.listen(a,'keyup',function(b){intl_inline_rtl_refresh_tokens(a);});Event.listen(a,'keydown',function(b){var c=Event.getKeyCode(b);if(c==8)intl_inline_rtl_check_backspace(a,b);});}} function IntlTranslationBase(a,b,c,d,e,f,g,h){this.isRightToLeft=a;this.textarea=b;this.native_string=g;this.native_type=h;this.previewDiv=d;this.previewParagraph=null;this.segmentPrev=ge('intl_segment_prev:'+f);if(this.segmentPrev){this.segmentNext=ge('intl_segment_next:'+f);Event.listen(this.segmentPrev,'click',this.prevSegment.bind(this));Event.listen(this.segmentNext,'click',this.nextSegment.bind(this));this.segmentInsert=ge('intl_segment_insert:'+f);Event.listen(this.segmentInsert,'click',this.insertSegment.bind(this));}this.segmentNumber=0;this.segmentCount=0;this.segmentsInserted=[];this.child_markup=[];if(d){this.child_markup=DOM.scry(d,'p');this.previewParagraph=this.child_markup[0];}this.anchors=[];this.glossaryAnchors=[];this.anchor_states=[];this.tokens=[];this.glossary=[];if(c){var i=c.getElementsByTagName('a');for(var j=0;j=this.segmentCount||a<0)return false;hide($('intl_segment_text:'+this.segmentNumber));}this.segmentNumber=a;show($('intl_segment_text:'+this.segmentNumber));if(this.segmentNumber>0){CSS.removeClass(this.segmentPrev,'intl-disabled');}else CSS.addClass(this.segmentPrev,'intl-disabled');if(this.segmentNumber]+)>)/gi,''),d=this.textarea.value;if(intl_ends_in_punct(d))d+=' ';d+=c;this.setTranslationText(d);this.segmentsInserted[this.segmentNumber]=true;CSS.addClass(this.segmentInsert,'intl-disabled');}},refreshSegment:function(){if(this.segmentPrev)if(!this.canInsert()){CSS.addClass(this.segmentInsert,'intl-disabled');}else CSS.removeClass(this.segmentInsert,'intl-disabled');},_getAnchorIndex:function(a){for(var b=0;b1){var e={'\u200e':true,'\u200f':true},f=d.end-1,g=this.textarea.value;while(f>0&&(g.charAt(f) in e))f--;this.textarea.value=g.substr(0,f)+g.substr(d.end);Input.setSelection(this.textarea,f,f);$E(a).prevent();}}return true;},cleanseToken:function(a){return a.replace(/\u00a0/g,' ').replace(/\u2011/g,'-').replace(/\u200e/g,'').replace(/\u200f/g,'');},uncleanseToken:function(a){if(this.isRightToLeft)return '\u200e'+a.replace(/ /g,'\u00a0').replace(/-/g,'\u2011')+'\u200e\u200f';return a;},refreshPreview:function(){if(this.previewDiv){(this.textarea.value.length==0?hide:show)(this.previewDiv);var a=this.textarea.value;for(var b=0;b1){var d=this.child_markup[b+1].innerHTML;a=a.replace(this.uncleanseToken(this.tokens[b]),d);}}this.previewParagraph.innerHTML=a;}},activeTokensRegex:function(){return (/\{[^{}]+\}/g);},refreshTokens:function(){if(this.textarea){var a=this.activeTokensRegex(),b=null,c={};for(var d=0;d1)f[0]+="}";c[f[0]]=true;}for(var d=0;d0)intl_inline_rtl_refresh_tokens(this.textarea);}return true;}});function intlXdAsync(a,b,c,d){var e=new AsyncRequest().setURI(a).setData(b).setHandler(d).setMethod(c);if(c=='GET')e.setReadOnly(true);e.send();}function intl_is_facebook_app_id(a){if(a==1)return true;return false;} __e("legacy:cookie",["Cookie"],function(a,b,c,d){var e=b('Cookie');a.getCookie=e.get;a.setCookie=e.set;a.clearCookie=e.clear;},3); __e("legacy:vector",["Vector"],function(a,b,c,d){a.Vector2=b('Vector');},3); function ContextualDialog(a){var b=new Dialog();copy_properties(b,ContextualDialog.prototype);b._buildDialog();b._setFromModel(a);return b;}ContextualDialog.prototype={setContext:function(a){this._context=a;this.resetDialogPosition();return this;},_buildDialogContainer:function(){CSS.addClass(this._obj,'contextual_dialog');this._content=this._frame=$N('div',{className:'contextual_dialog_content'});this._arrow=$N('div',{className:'arrow'});DOM.setContent(this._popup,[this._content,this._arrow]);},_resetDialogObj:function(){if(!this._context||!this._showing)return;var a=Vector2.getElementPosition(this._context),b=this._context.offsetWidth,c=this._context.offsetHeight,d=a.x,e=a.y+c,f=Vector2.getViewportDimensions().x,g=Vector2.getScrollPosition().x,h=Vector2.getDocumentDimensions().x,i=Vector2.getElementDimensions(this._popup).x,j=0,k;if(b<64){k=d+b/2;}else k=d+32;if(h>0&&h0&&d+i>g+f){j=(g+f-i)-d;if(d+j0&&d+i>h)j=(h-i)-d;}d+=j;if(k-d<32){d=k-32;if(d<0)d=0;}var l=Vector2.getElementDimensions(this._arrow).x,m=k-d-l/2;if(m<0)m=0;if(m>i-32)m=i-32;CSS.setStyle(this._arrow,'marginLeft',m+'px');new Vector2(d,e,'document').setElementPosition(this._popup);},_renderDialog:function(a){if(window!=top)this._auto_focus=false;Dialog.prototype._renderDialog.call(this,a);}}; function BorderlessDialog(a){this._dialog=new Dialog(a);this._dialog._auto_focus=false;this._dialog._buildDialogContent=BorderlessDialog._buildDialogContent;this._dialog._resetDialogObj=BorderlessDialog._resetDialogObj;}BorderlessDialog.prototype={setContext:function(a){this._context=a;this._dialog._dirty();return this;},getDialog:function(){return this._dialog;}};copy_properties(BorderlessDialog,{_buildDialogContent:function(){CSS.addClass(this._obj,'borderless_dialog');DOM.setContent(this._popup,HTML('
'));this._content=this._frame=DOM.find(this._popup,'div.borderless_dialog_content');},_resetDialogObj:function(){if(!this._context)return;var a=Vector2.getElementPosition(this._context),b=document.body.offsetWidth,c=(b-this._popup.offsetWidth)/2,d;if(a.x1)for(var i=0;i]*>/g,d=b.toLowerCase().match(c),e=d?d.sort():[],f=a.toLowerCase().match(c),g=f?f.sort():[],h=e.join(';'),i=g.join(';');if(h!=i)return "HTML markup mismatch. The HTML markup you entered does not match the original markup.";};function intl_explode_inflection(a){var b=window.intl_locale_inflections,c=[];if(b)for(var d in b){var e=b[d];if(e[e.length-1]==='+'){c[c.length]=intl_phonological_rules(e+a);}else if(e[0]==='+')c[c.length]=intl_phonological_rules(a+e);}return c;}intl_translation_dialog.prototype.rule_canon=function(a,b){var c=b.toLowerCase();if(this.glossary)for(var d=0;d
  • '+b.join('
  • ')+'

'+l).setButtons([Dialog.newButton('submit-translation',"Submit Translation",'',function(){m.hide();this.translation_submit();}.bind(this)),Dialog.newButton('review-translation',"Review Translation")]).show();}else this.translation_submit();};intl_translation_dialog.prototype.handle_approver_checkbox=function(a){var b=DOM.getText(ge('tr_id_'+a.value));if(a.checked==false){this.textarea.value='';}else this.textarea.value=b;if(this.form.approved_tr_id)this.form.approved_tr_id.value=a.value;this.refreshTokens();this.refreshPreview();};function substr_count(a,b){var c=0,d=a.indexOf(b);while(d!=-1){c++;d=a.indexOf(b,d+1);}return c;}function intl_amode_reset_tr_checkbox(a){var b=document.getElementsByName('approved_trs');if(b.length)for(var c=0;c1)for(var b=0;b1)for(var c=0;c]+id=trans__'+k+' [^>]*>).*()'),m=window.intl_replaced_trans[k];for(var n in j){var o=j[n];if(typeof(o)=='string')j[n]=o.replace(l,'$1'+m+'$2');}}}else window.intl_replaced_trans={};i.innerHTML=tx._(e,j);window.intl_replaced_trans[a+'__'+b+'__\\d+__'+c+'__'+d]=e;if(f)i.id='trans__'+a+'__'+b+'__'+g+'__'+c+'__'+f;}var p={translatable:'contributed',approvable:'iapproved',votable:'voted',unvotable:'voted',complainable:'complained'};for(var q in p)if(CSS.hasClass(i,'intl-prototype-'+q)){CSS.removeClass(i,'intl-prototype-'+q);CSS.addClass(i,'intl-prototype-'+p[q]);}}}function intl_update_vote_controls(a,b,c){var d=['vmode_dialog','vmode_bulk','app_bulk'];for(var e=0;e(12*3600)||(new Date(j*1000).getDay()!=new Date(k*1000).getDay()))return l;var m=j-k,n=Math.floor(m/60),o=Math.floor(n/60);if(n<1){l.text="a few seconds ago";l.next=60-m%60;return l;}if(o<1){if(n==1){l.text="about a minute ago";}else l.text=tx._("{number} minutes ago",{number:n});l.next=60-m%60;return l;}if(o!=11)l.next=3600-m%3600;if(o==1){l.text="about an hour ago";return l;}l.text=tx._("{number} hours ago",{number:o});return l;}};}); __e("legacy:live-timer",["LiveTimer"],function(a,b,c,d){a.LiveTimer=b('LiveTimer');},3); __e("legacy:uri",["URI"],function(a,b,c,d){a.URI=b('URI');},3); WidgetArbiter={_findSiblings:function(){if(WidgetArbiter._siblings)return;WidgetArbiter._siblings=[];for(var a=parent.frames.length-1;a>=0;a--)try{if(parent.frames[a]&&parent.frames[a].Arbiter&&parent.frames[a].Arbiter.inform)WidgetArbiter._siblings.push(parent.frames[a].Arbiter);}catch(b){}},inform:function(){WidgetArbiter._findSiblings();var a=$A(arguments);WidgetArbiter._siblings.each(function(b){b.inform.apply(b,a);});}}; WindowComm={_callbacks:{},makeHandler:function(a,b){b=b||'opener';var c='f'+(Math.random()*(1<<30)).toString(16).replace('.','');WindowComm._callbacks[c]=a;return new URI('/connect/window_comm.php').setQueryData({_id:c,_relation:b}).getQualifiedURI().toString();},_recv:function(a){var b=new URI(a).getQueryData();WindowComm._callbacks[b._id](b);}}; __e("PopupWindow",["copyProperties","ua","Vector","dom"],function(a,b,c,d,e,f){var g=b("copyProperties"),h=b("ua"),i=b("Vector"),j=b("dom"),k={_opts:{allowShrink:true,strategy:'vector',timeout:100,widthElement:null},init:function(l){copy_properties(k._opts,l);setInterval(k._resizeCheck,k._opts.timeout);},_resizeCheck:function(){var l=i.getViewportDimensions(),m=k._getDocumentSize(),n=m.y-l.y,o=m.x-l.x;if(o<0&&!k._opts.widthElement)o=0;if(!k._opts.allowShrink&&n<0)n=0;if(n||o)try{if(window.console&&window.console.firebug)console.log('Resizing will not work in firefox with firebug enabled. '+'See https://bugzilla.mozilla.org/show_bug.cgi?id=691693');window.resizeBy(o,n);if(o)window.moveBy(o/-2,0);}catch(p){}},_getDocumentSize:function(){var l=i.getDocumentDimensions();if(k._opts.strategy==='offsetHeight')l.y=document.body.offsetHeight;if(k._opts.widthElement){var m=j.scry(document.body,k._opts.widthElement)[0];if(m)l.x=i.getElementDimensions(m).x;}if(window.Dialog&&Dialog.max_bottom&&Dialog.max_bottom>l.y)l.y=Dialog.max_bottom;return l;},open:function(l,m,n){var o=typeof window.screenX!='undefined'?window.screenX:window.screenLeft,p=typeof window.screenY!='undefined'?window.screenY:window.screenTop,q=typeof window.outerWidth!='undefined'?window.outerWidth:document.body.clientWidth,r=typeof window.outerHeight!='undefined'?window.outerHeight:(document.body.clientHeight-22),s=parseInt(o+((q-n)/2),10),t=parseInt(p+((r-m)/2.5),10),u=('width='+n+',height='+m+',left='+s+',top='+t);return window.open(l,'_blank',u);}};e.exports=k;}); __e("legacy:popup-resizer",["PopupWindow"],function(a,b,c,d){a.PopupResizer=b('PopupWindow');},3); var PlatformOptInPopup=function(){};copy_properties(PlatformOptInPopup,{DIALOG_URL:'/connect/uiserver.php',DIALOG_WIDTH:420,DIALOG_HEIGHT:450,APP_ID:127760087237610,open:function(a,b,c){if(!a)a='generic';if(!b)b='opt.in';var d=new URI(PlatformOptInPopup.DIALOG_URL);d.addQueryData({social_plugin:a,method:b,display:'popup',secure:URI.getRequestURI().isSecure(),app_id:PlatformOptInPopup.APP_ID});if(c)d.addQueryData(c);return PopupResizer.open(d.toString(),PlatformOptInPopup.DIALOG_WIDTH,PlatformOptInPopup.DIALOG_HEIGHT);}}); function ConnectSocialWidget(a,b){ConnectSocialWidget.setInstance(b,this);ConnectSocialWidget.delayUntilDisplayed(function(){this.initializeObject.call(this,a,b);}.bind(this));}copy_properties(ConnectSocialWidget,{OPT_IN_FACEBOOK_APP_ID:'127760087237610',TYPE_ACTIVITY:'A',TYPE_RECOMMENDATIONS:'R',TYPE_LIKEBOX:'L',instances:{},setInstance:function(a,b){ConnectSocialWidget.instances[a]=b;},getInstance:function(a){return ConnectSocialWidget.instances[a];},popups:{},login:function(a,b){ConnectSocialWidget.popups[b]={popup:PlatformOptInPopup.open('login','opt.in')};},aDelayedFunctions:[],delayUntilDisplayed:function(a){ConnectSocialWidget.aDelayedFunctions.push(a);if(ConnectSocialWidget.aDelayedFunctions.length===1){if(!ConnectSocialWidget.ndTestDim){var b=document.createElement('div'),c={position:'absolute',width:'1px',height:'1px',overflow:'hidden',top:'0px'};for(var d in c)if(typeof c[d]==='string')CSS.setStyle(b,d,c[d]);document.body.appendChild(b);ConnectSocialWidget.ndTestDim=b;}ConnectSocialWidget.testForDisplay();}},testForDisplay:function(){var a=Vector2.getElementDimensions(ConnectSocialWidget.ndTestDim).y;if(a!==0){ConnectSocialWidget.aDelayedFunctions.forEach(function(b){b();});ConnectSocialWidget.aDelayedFunctions=[];}else ConnectSocialWidget.testForDisplay.defer(100);},listenForLogin:function(){if(!ConnectSocialWidget.listenerAttached){Arbiter.subscribe('platform/socialplugins/login',function(a){if(a.user!==Env.user)document.location.reload();});ConnectSocialWidget.listenerAttached=true;}}});copy_properties(ConnectSocialWidget.prototype,{initializeObject:function(a,b){var c=DOM.scry(document.body,a.sOverflowContainerSelector)[0],d=DOM.scry(c,'.fbConnectWidgetFooter')[0],e=d?Vector2.getElementDimensions(d).y:0,f=a.sOverflowItemsSelector,g=DOM.scry(document.body,a.sStreamContainerSelector)[0];this.fRemoveOverflowElements=this.removeOverflowElements.bind(this,c,g,f,-e);copy_properties(this,{bInitialized:true,sWidgetId:b,iFooterHeight:e,ndTop:c,ndFooter:d,ndContentContainer:g,oQueryParams:new URI(window.location.href).getQueryData(),bComboMode:a.bComboMode,sOverflowItemsSelector:f});copy_properties(this.oQueryParams,{post_form_id:Env.post_form_id,user:Env.user});this.fRemoveOverflowElements();CSS.setStyle(g,'visibility','visible');animation(g).from('opacity',0).to('opacity',1).duration(200).go();ConnectSocialWidget.listenForLogin();},getElementTop:function(a){var b=DOM.scry(a,'^'+this.sOverflowItemsSelector);return b[0];},getItemPosition:function(a){var b=DOM.scry(this.ndContentContainer,this.sOverflowItemsSelector),c=b.length,d=b.indexOf(a)+1;return d+'/'+c;},removeOverflowElements:function(a,b,c,d,e){var f,g=c?DOM.scry(b,c):$A(b.childNodes);if(!e){var d=d||0,h=Vector2.getElementDimensions(a).y+d,i=Vector2.getElementPosition(a).y;e=h+i;}while(g.length>0&&(f=$(g.pop()))&&(Vector2.getElementDimensions(f).y+Vector2.getElementPosition(f).y)>e)DOM.remove(f);},login:function(){ConnectSocialWidget.login(this.appID,this.sWidgetId);},toggleLogin:function(){DOM.scry(this.ndTop,'.fbToggleLogin').forEach(function(a){CSS.toggle(a);});this.fRemoveOverflowElements();}});function ActivityWidget(a,b){this.parent.construct(this,a,b);}Class.extend(ActivityWidget,'ConnectSocialWidget');ActivityWidget.REQUEST_INTERVAL=15*1000;ActivityWidget.ACTIVITY_HEIGHT=45;ActivityWidget.MAX_INTERVAL=30;ActivityWidget.MAX_ITEMS=24;copy_properties(ActivityWidget.prototype,{initializeObject:function(a,b){this.parent.initializeObject.call(this,a,b);this.oQueryParams.nb_activities=Math.min(ActivityWidget.MAX_ITEMS,Math.round((this.oQueryParams.height||300)/ActivityWidget.ACTIVITY_HEIGHT));this.oQueryParams.newest=a.iNewestStoryTime||0;},removeOverflowElements:function(){if(this.bComboMode&&!this.bFirstRound){this.bFirstRound=true;var a=Vector2.getElementPosition(this.ndTop).y,b=Vector2.getElementDimensions(document.body).y-(a+this.iFooterHeight),c=Math.round(b/2),d=$A(arguments);d[d.length]=c;ConnectSocialWidget.prototype.removeOverflowElements.apply(this,d);}else ConnectSocialWidget.prototype.removeOverflowElements.apply(this,arguments);},hasFriendsActivity:function(){return DOM.scry(this.ndContentContainer,'div.fbFriendsActivity')[0].childNodes.length>0;},hasContent:function(){return DOM.scry(this.ndTop,this.sOverflowItemsSelector).length>0;},getEmptyMessage:function(){return DOM.find(this.ndContentContainer,'div.fbEmptyWidget');},showEmptyMessage:function(){var a=this.getEmptyMessage();if(a)CSS.show(a);}});function RecommendationsWidget(a,b){this.parent.construct(this,a,b);}Class.extend(RecommendationsWidget,'ConnectSocialWidget');copy_properties(RecommendationsWidget.prototype,{initializeObject:function(a,b){this.parent.initializeObject.call(this,a,b);this.sActivityParent=a.sActivityParent;this.cropImages(DOM.scry(this.ndContentContainer,".fbImageContainer img"),RecommendationsWidget.IMAGE_HEIGHT,true);this.cropImages(DOM.scry(this.ndContentContainer,"img.fbGalleryImage"),RecommendationsWidget.GALLERY_IMAGE_HEIGHT,false);},cropImages:function(a,b,c){if(a.length>0){var d=function(event){RecommendationsWidget.image_resize({image:event.getTarget(),dimension:b,centerimage:c});};a.forEach(function(e){if(e.complete){RecommendationsWidget.image_resize({image:e,dimension:b,centerimage:c});}else Event.listen(e,'load',d);});}},hasContent:function(){return this.ndContentContainer.childNodes.length>0;},getParent:function(){if(this.sActivityParent)return ConnectSocialWidget.getInstance(this.sActivityParent);},showRecommendationsSeparator:function(){var a=this.getParent();if(a&&a.hasContent()){var b=DOM.scry(this.ndTop,'div.fbRecommendationsSeparator')[0];CSS.show(b);CSS.setStyle(b,'visibility','visible');}return this;},removeOverflowElements:function(){ConnectSocialWidget.prototype.removeOverflowElements.apply(this,arguments);if(this.sActivityParent&&!this.hasContent()){var a=DOM.scry(this.ndTop,'div.fbRecommendationsSeparator')[0];CSS.hide(a);}}});RecommendationsWidget.IMAGE_HEIGHT=35;RecommendationsWidget.GALLERY_IMAGE_HEIGHT=105;function LikeBoxWidget(a,b){this.parent.construct(this,a,b);}Class.extend(LikeBoxWidget,'ConnectSocialWidget');copy_properties(LikeBoxWidget.prototype,{});RecommendationsWidget.image_resize=function(a){var b=a.image,c=Vector2.getElementDimensions(b),d=c.y,e=c.x,f=a.dimension,g=f+'px',h=a.centerimage;if(d<=5||e<=5)return;var i=d/e;if(i<.5||i>2)return;if(d===e){CSS.setStyle(b,'width',g);}else if(d