/*1358156629,178142543*/

if (self.CavalryLogger) { CavalryLogger.start_js(["FpZX3"]); }

/** js/composerx/ComposerXAttachmentBootstrap.js */
__d("ComposerXAttachmentBootstrap",["CSS","Form","Parent","URI","cx"],function(a,b,c,d,e,f){



var g=b('CSS'),
h=b('Form'),
i=b('Parent'),
j=b('URI'),

k=b('cx'),

l=[],

m=




{bootstrap:function(n){
m.load
(i.byTag(n,'form'),
n.getAttribute('data-endpoint'));},


load:function(n,o,p){
var q=j(o).addQueryData
({composerurihash:m.getURIHash(o)});

g.conditionClass
(n,
"_fu",
p);


var r=i.byClass(n,"_2_4");
g.removeClass(r,'async_saving');
h.setDisabled(n,false);

n.action=q.toString();
h.bootstrap(n);},





getURIHash:function(n){
if(n==='initial')
return 'initial';

var o=l.indexOf(n);
if(o!==-1){
return o+'';}else{

o=l.length;
l[o]=n;
return o+'';}}};




e.exports=m;});

/** js/composerx/ComposerXStore.js */
__d("ComposerXStore",["function-extensions","Arbiter","ge"],function(a,b,c,d,e,f){








b('function-extensions');

var g=b('Arbiter'),

h=b('ge'),

i={};

function j(l,m){
return 'ComposerX/'+l+'/'+m;}


var k=
{set:function(l,m,n){
if(!i[l])
i[l]={};

i[l][m]=n;
g.inform
(j(l,m),
{},
g.BEHAVIOR_STATE);},


get:function(l,m){
if(i[l])
return i[l][m];

return null;},


getAllForComposer:function(l){
return i[l]||{};},






waitForComponents:function(l,m,n){
g.registerCallback
(n,
m.map(j.curry(l)));}};







g.subscribe('page_transition',function(){
for(var l in i)
if(!h(l))
delete i[l];});




e.exports=k;});

/** js/composerx/ComposerX.js */
__d("ComposerX",["Arbiter","ComposerXAttachmentBootstrap","ComposerXStore","CSS","DOM","DOMQuery","copyProperties","csx","cx","getObjectValues"],function(a,b,c,d,e,f){



var g=b('Arbiter'),
h=b('ComposerXAttachmentBootstrap'),
i=b('ComposerXStore'),
j=b('CSS'),
k=b('DOM'),
l=b('DOMQuery'),

m=b('copyProperties'),
n=b('csx'),
o=b('cx'),
p=b('getObjectValues'),

q='any';

function r(s){
this._root=s;
this._composerID=s.id;
this._attachments={};

this._attachmentFetchForm=
l.find(s,"._2_4");
this._resetSubscription=
g.subscribe('composer/publish',function(t,u){
if(u.composer_id===this._composerID)
this.reset();}.

bind(this));}


m(r.prototype,
{_endpointHashToShow:q,
_lastFetchEndpoint:'',
_initialAttachmentEndpoint:'',

getAttachment:function(s,t){
var u=h.getURIHash(s);
this._endpointHashToShow=u;


var v=this._attachments[u];
if(v){

this._showAttachmentAfterComponentsLoaded(u);}else 


this.fetchAttachmentData(s,t);},





fetchAttachmentData:function(s,t){
var u=h.getURIHash(s);


if(this._attachments[u])
return;


if(s!==this._lastFetchEndpoint){
h.load
(this._attachmentFetchForm,s,t);
this._lastFetchEndpoint=s;}},



setAttachment:
function(s,t,u,v){

this._setupAttachment
(s,t,u,v);
this._showAttachmentAfterComponentsLoaded(s);},


setInitialAttachment:
function(s,t,u,v){

var w=h.getURIHash(s);
this._setupAttachment
(w,t,u,v);
this._initialAttachmentEndpoint=s;



if(!this._currentInstance)
this._showAttachmentAfterComponentsLoaded(w);},



setComponent:function(s,t){

if(!i.get(this._composerID,s)){
i.set(this._composerID,s,t);


k.appendContent
(this._attachmentFetchForm,
k.create('input',
{type:'hidden',
name:'loaded_components[]',
value:s}));}},





reset:function(){
if(this._currentInstance){
this._currentInstance.cleanup();
this._currentInstance=null;}

for(var s in this._attachments)
this._attachments[s].instance.reset();

var t=i.getAllForComposer(this._composerID);
p(t).forEach(function(u){
if(u.reset)
u.reset(u);});


this.getAttachment(this._initialAttachmentEndpoint);
g.inform('composer/reset');},


destroy:function(){
if(this._resetSubscription){
this._resetSubscription.unsubscribe();
this._resetSubscription=null;}},







addPlaceholders:function(s,t){
var u;
for(var v in this._attachments){
u=this._attachments[v];
if(u.instance===s){
t.forEach(function(w){
u.placeholders.push(w);
u.required_components.push(w.component_name);});

break;}}


if(this._currentInstance===s)
this._fillPlaceholders(t);},



_setupAttachment:
function(s,t,u,v){
t.setComposerID(this._composerID);

this._attachments[s]=
{instance:t,
placeholders:u,
required_components:v};




var w=l.find(this._root,"div._118"),
x=t.getRoot();
if(x.parentNode!==w){
j.hide(x);
k.appendContent(w,x);}},



_showAttachment:function(s,t,u){
if(this._currentInstance===s)
return;


if(this._endpointHashToShow===q){
this._endpointHashToShow=null;}else
if(this._endpointHashToShow!==t)
return;


if(this._currentInstance){
if(!this._currentInstance.canSwitchAway())
return;

this._currentInstance.cleanup();}

this._currentInstance=s;

var v=l.find(this._root,"div._118"),
w=v.childNodes,
x=s.getRoot();
for(var y=0;y<w.length;y++)
if(w[y]!==x)
j.hide(w[y]);


j.show(x);

this._fillPlaceholders(u);
var z=
h.getURIHash(this._initialAttachmentEndpoint),
aa=t===z;
s.initWithComponents(aa);

this._setAttachmentSelectedClass(s.attachmentClassName);

g.inform
('composer/initializedAttachment',

{composerRoot:this._root,
isInitial:aa});},








_showAttachmentAfterComponentsLoaded:function(s){
var t=this._attachments[s];
i.waitForComponents
(this._composerID,
t.required_components,
this._showAttachment.bind
(this,t.instance,s,t.placeholders));},


_fillPlaceholders:function(s){
s.forEach(function(t){
var u=
i.get(this._composerID,t.component_name);
if(t.element!==u.element.parentNode)
k.setContent(t.element,u.element);}.

bind(this));},


_setAttachmentSelectedClass:function(s){
var t=
l.scry(this._root,"._4n")[0];
if(t)
j.removeClass(t,"_4n");

if(s){
var u=
l.scry(this._root,'.'+s)[0];
if(u)
j.addClass(u,"_4n");}}});





e.exports=r;});

/** js/composerx/ComposerXAttachment.js */
__d("ComposerXAttachment",["ComposerXStore","copyProperties","emptyFunction"],function(a,b,c,d,e,f){



var g=b('ComposerXStore'),

h=b('copyProperties'),
i=b('emptyFunction');












function j(){}

h(j.prototype,



{getRoot:i,
initWithComponents:function(k){},


cleanup:i,


reset:i,





attachmentClassName:'',







getComponent:function(k){
return g.get(this._composerID,k);},







canSwitchAway:i.thatReturnsTrue,




setComposerID:function(k){
this._composerID=k;}});



e.exports=j;});

/** js/composerx/ComposerXController.js */
__d("ComposerXController",["Arbiter","ComposerX","ComposerXAttachmentBootstrap","Parent","$","cx","emptyFunction","ge"],function(a,b,c,d,e,f){



var g=b('Arbiter'),
h=b('ComposerX'),
i=b('ComposerXAttachmentBootstrap'),
j=b('Parent'),

k=b('$'),
l=b('cx'),
m=b('emptyFunction'),
n=b('ge'),

o={};

function p(r){
var s=j.byClass(k(r),"_119"),
t=s.id;
if(!o[t])
o[t]=new h(s);

return o[t];}


var q=
{getAttachment:function(r,s,t){
var u=p(r);
u.getAttachment(s,t);},


fetchAttachmentData:function(r,s,t){
p(r).fetchAttachmentData(s,t);},


setAttachment:
function(r,s,t,u,v){
var w=p(r);
w.setAttachment
(s,t,u,v);},


setInitialAttachment:
function(r,s,t,u,v){
var w=p(r);
w.setInitialAttachment
(s,t,u,v);},


setComponent:function(r,s,t){
var u=p(r);
u.setComponent(s,t);},


reset:function(r){
var s=p(r);
s.reset();},


holdTheMarkup:m,


getEndpoint:function(r,s,t){
var u=p(r);

i.load
(u._attachmentFetchForm,
s,
t);},


addPlaceholders:function(r,s,t){
var u=p(r);
u.addPlaceholders(s,t);}};








i.bootstrap=function(r){
q.getAttachment(r,r.getAttribute('data-endpoint'));};


g.subscribe('page_transition',function(){
for(var r in o)
if(!n(r)){
o[r].destroy();
delete o[r];}});




e.exports=q;});

/** js/dragdrop/DragDropFileUpload.js */
__d("DragDropFileUpload",[],function(a,b,c,d,e,f){



f.isSupported=function(){
return typeof(FileList)!=="undefined";};});

/** js/dragdrop/DocumentDragDrop.js */
__d("DocumentDragDrop",["Event","Arbiter","CSS","DOM","DOMQuery","DragDropFileUpload","emptyFunction","getObjectValues"],function(a,b,c,d,e,f){



var g=b('Event'),

h=b('Arbiter'),
i=b('CSS'),
j=b('DOM'),
k=b('DOMQuery'),
l=b('DragDropFileUpload'),

m=b('emptyFunction'),
n=b('getObjectValues'),


o={},

p=0;

function q(){
p=0;
n(o).forEach(function(t){
i.removeClass(t.element,t.className);
h.inform('dragleave',{element:t.element});});}



function r(){

if(!l.isSupported())
return;












g.listen(document,'dragenter',function(u){
if(p===0)
n(o).forEach(function(v){
i.addClass(v.element,v.className);
h.inform('dragenter',{element:v.element,event:u});});


p++;});


g.listen(document,'dragleave',function(u){
p--;
if(p===0)
q();});













g.listen(document,'drop',function(u){

var v=u.getTarget();
if(k.isNodeOfType(u.getTarget(),'input'))
if(v.type==='file')
return;



u.prevent();});

g.listen(document,'dragover',g.prevent);









var t=null;


document.addEventListener('dragover',function(){
t&&clearTimeout(t);
t=setTimeout(q,839);},
true);

r=m;}


var s=
{registerStatusElement:function(t,u){
r();
o[j.getID(t)]=
{element:t,
className:u};},



removeStatusElement:function(t){
var u=j.getID(t),
v=o[u];
i.removeClass(v.element,v.className);
delete o[u];}};



e.exports=s;});

/** js/dragdrop/DragDropTarget.js */
__d("DragDropTarget",["Event","CSS","DocumentDragDrop","DragDropFileUpload","copyProperties","emptyFunction"],function(a,b,c,d,e,f){



var g=b('Event'),

h=b('CSS'),
i=b('DocumentDragDrop'),
j=b('DragDropFileUpload'),

k=b('copyProperties'),
l=b('emptyFunction');







































function m(n){
this._element=n;
this._listeners=[];
this._statusElem=n;
this._dragEnterCount=0;
this._enabled=false;}


k(m.prototype,
{_onFilesDropCallback:l,
_onURLDropCallback:l,
_fileFilterFn:l.thatReturnsArgument,

setOnFilesDropCallback:function(n){
this._onFilesDropCallback=n;
return this;},


setOnURLDropCallback:function(n){
this._onURLDropCallback=n;
return this;},


enable:function(){
if(!j.isSupported())
return this;


i.registerStatusElement(this._statusElem,'fbWantsDragDrop');

this._listeners.push
(g.listen(this._element,'dragenter',this._onDragEnter.bind(this)));
this._listeners.push
(g.listen(this._element,'dragleave',this._onDragLeave.bind(this)));
this._listeners.push
(g.listen(this._element,'dragover',g.kill));

this._listeners.push
(g.listen(this._element,'drop',function(n){
this._dragEnterCount=0;
h.removeClass(this._statusElem,'fbDropReady');

var o=this._fileFilterFn(n.dataTransfer.files);
if(o.length)
this._onFilesDropCallback(o);

var p=
n.dataTransfer.getData('url')||
n.dataTransfer.getData('text/uri-list');
if(p)
this._onURLDropCallback(p);


n.kill();}.
bind(this)));

this._enabled=true;
return this;},


disable:function(){
if(!this._enabled)
return this;

i.removeStatusElement(this._statusElem,'fbWantsDragDrop');
h.removeClass(this._statusElem,'fbDropReady');

while(this._listeners.length)
this._listeners.pop().remove();


this._enabled=false;
return this;},


setFileFilter:function(n){
this._fileFilterFn=n;
return this;},


setStatusElement:function(n){
this._statusElem=n;
return this;},






_onDragEnter:function(){
if(this._dragEnterCount===0)
h.addClass(this._statusElem,'fbDropReady');

this._dragEnterCount++;},


_onDragLeave:function(){
this._dragEnterCount=Math.max(this._dragEnterCount-1,0);
if(this._dragEnterCount===0)
h.removeClass(this._statusElem,'fbDropReady');}});




e.exports=m;});

/** js/composerx/dragdrop/ComposerXDragDrop.js */
__d("ComposerXDragDrop",["Arbiter","ComposerXController","CSS","DragDropTarget","DOMQuery","Parent","URI","copyProperties","csx","cx"],function(a,b,c,d,e,f){










var g=b('Arbiter'),
h=b('ComposerXController'),
i=b('CSS'),
j=b('DragDropTarget'),
k=b('DOMQuery'),
l=b('Parent'),
m=b('URI'),

n=b('copyProperties'),
o=b('csx'),
p=b('cx'),

q='/ajax/composerx/attachment/media/upload/',
r='/ajax/composerx/attachment/link/scraper/',

s=function(u){
u();};






function t(u,v,w,x){
this._root=u;
this._composerID=v;
this._targetID=w;
x=x||s;

this._dragdrop=
new j(u).
setOnFilesDropCallback(function(y){
x(this._uploadFiles.bind(this,y));}.
bind(this)).
setFileFilter(t.filterImages).
enable();
t.handleDragEnterAndLeave(u);}


n(t,



{handleDragEnterAndLeave:function(u){
var v=k.scry
(l.byClass(u,"_119"),
"._2wr");

g.subscribe('dragenter',function(w,x){
if(u==x.element)
v.forEach(i.hide);});


g.subscribe('dragleave',function(w,x){
if(u==x.element)
v.forEach(i.show);});},




filterImages:function(u){
var v=[];
for(var w=0;w<u.length;w++)
if(u[w].type.match('image/*'))
v.push(u[w]);


return v;}});



n(t.prototype,
{enableURLDropping:function(){
this._dragdrop.setOnURLDropCallback(this._onURLDrop.bind(this));},


deactivate:function(){
this._dragdrop.disable();},


_uploadFiles:function(u){
h.getAttachment(this._root,q);
g.inform
('ComposerXFilesStore/filesDropped/'+this._composerID+'/mediaupload',
{files:u},
g.BEHAVIOR_PERSISTENT);},



_onURLDrop:function(u){
var v=new m(r);
v.addQueryData
({scrape_url:encodeURIComponent(u)});

h.getAttachment(this._root,v.toString());}});



e.exports=t;});

/** js/modules/PopoverMenuInterface.js */
__d("PopoverMenuInterface",["ArbiterMixin","copyProperties","emptyFunction"],function(a,b,c,d,e,f){



var g=b('ArbiterMixin'),

h=b('copyProperties'),
i=b('emptyFunction');

function j(){}

h(j.prototype,g,






{getRoot:i,




onShow:i,




onHide:i,






focusAnItem:i.thatReturnsFalse,




blur:i,





handleKeydown:i.thatReturnsFalse,






done:function(){
this.inform('done');}});



e.exports=j;});

/** js/modules/MenuX.js */
__d("MenuX",["Event","Class","copyProperties","CSS","DataStore","DOM","Keys","Parent","PopoverMenuInterface","ScrollableArea","Style","UserAgent"],function(a,b,c,d,e,f){




var g=b('Event'),

h=b('Class'),
i=b('copyProperties'),
j=b('CSS'),
k=b('DataStore'),
l=b('DOM'),
m=b('Keys'),
n=b('Parent'),
o=b('PopoverMenuInterface'),
p=b('ScrollableArea'),
q=b('Style'),
r=b('UserAgent');

function s(t,u,v,w){
this.parent.construct(this);
this._id=t;
this._className=u;
this._items=[];
for(var x=0;x<v.length;x++)
this._items[x]=new v[x].ctor(v[x]);

this._config=w;}


h.extend(s,o);
i(s.prototype,
{_focused:null,
_root:null,

addItem:function(t){
this._items.push(t);

if(this._root)
this._insertItem(t);},



getRoot:function(){
if(!this._root)
this._render();

return this._root;},


onShow:function(){
if(this._config.maxheight)
if(!this._scrollableArea){
q.set
(this._scrollableElems.root,
'width',
this._scrollableElems.body.offsetWidth+'px');


this._scrollableArea=
p.fromNative(this._scrollableElems.root,{fade:true});
q.set
(this._scrollableElems.wrap,
'max-height',
this._config.maxheight+'px');}else{


q.set(this._scrollableElems.root,'width','');
q.set(this._scrollableElems.content,'width','');
if(r.ie()<=7){
q.set
(this._scrollableElems.root,
'width',
this._scrollableElems.content.offsetWidth+'px');}else 

q.set
(this._scrollableElems.root,
'width',
this._scrollableElems.content.offsetWidth+'px');

this._scrollableArea.resize();}},




onHide:function(){
this.blur();},


focusAnItem:function(){
return this._attemptFocus(0,1);},


blur:function(){
if(this._focused){
this._focused.blur();
this._focused=null;
this.inform('blur');}},



handleKeydown:function(t){
var u=this._items.indexOf(this._focused);
switch(t){

case m.UP:
case m.DOWN:
var v=t===m.UP?-1:1;
if(u!==-1){
return this._attemptFocus(u+v,v);}else 

if(t===m.UP){
return this._attemptFocus(this._items.length-1,-1);}else 

return this._attemptFocus(0,1);


break;
case m.SPACE:
if(this._items.indexOf(this._focused)!==-1){
this._handleItemClick(this._focused);
return true;}

return false;



default:var w=String.fromCharCode(t).toLowerCase(),
x;

for(var y=u+1;y<this._items.length;y++){
x=this._items[y].getAccessKey();
if(x&&x.charAt(0).toLowerCase()===w)
if(this._focusItem(this._items[y]))
return true;}



return false;
}},


_render:function(){
this._ul=l.create('ul',{className:'uiMenuX'});
this._ul.setAttribute('role','menu');

this._items.forEach(this._insertItem.bind(this));

g.listen(this._ul,'click',this._handleClick.bind(this));
g.listen(this._ul,'mouseover',this._handleMouseOver.bind(this));
g.listen(this._ul,'mouseout',this._handleMouseOut.bind(this));

var t=this._ul;
if(this._config.maxheight){
this._scrollableElems=p.renderDOM();
l.setContent(this._scrollableElems.content,this._ul);
t=this._scrollableElems.root;}




var u=
'uiMenuXWrapper'+(this._className?' '+this._className:'');
this._root=
l.create('div',{className:u},
l.create('div',{className:'uiMenuXBorder'},t));
this._id&&this._root.setAttribute('id',this._id);},


_handleClick:function(t){
var u=this._getItemInstance(t.getTarget());
if(u)
return this._handleItemClick(u);},



_handleItemClick:function(t){
this.inform('itemclick',t);
if(t.hasAction())
this.done();

return t.handleClick();},


_handleMouseOver:function(t){
var u=this._getItemInstance(t.getTarget());
u&&this._focusItem(u,true);},


_handleMouseOut:function(t){
var u=this._getItemInstance(t.getTarget());
if(u&&this._focused===u)
this.blur();},



_insertItem:function(t){
var u=t.getRoot();
j.addClass(u,'__MenuXItem');
k.set(u,'MenuXItem',t);
l.appendContent(this._ul,u);},











_attemptFocus:function(t,u){
var v=this._items[t];
if(v)
if(this._focusItem(v)){
return true;}else 

return this._attemptFocus(t+u,u);


return false;},





_focusItem:function(t,u){
if(t.focus(u)!==false){
if(this._focused!==t){
this.blur();
this._focused=t;
this.inform('focus');}

return true;}

return false;},





_getItemInstance:function(t){
var u=n.byClass(t,'__MenuXItem');
return u?k.get(u,'MenuXItem'):null;}});



e.exports=s;});

/** js/modules/MenuXSelectable.js */
__d("MenuXSelectable",["array-extensions","createArrayFrom","Class","copyProperties","MenuX"],function(a,b,c,d,e,f){



b('array-extensions');

var g=b('createArrayFrom'),
h=b('Class'),
i=b('copyProperties'),
j=b('MenuX');

function k(n,o,p,q){
this.parent.construct(this,n,o,p,q);}



function l(n){
return n.select&&n.deselect&&n.isSelected;}


function m(n){
return l(n)&&n.isSelected();}


h.extend(k,j);
i(k.prototype,
{focusAnItem:function(){

for(var n=0;n<this._items.length;n++)
if(m(this._items[n]))
if(this._focusItem(this._items[n])!==false)
return true;




return this.parent.focusAnItem();},


setValue:function(n){

if(!this._root)
this._render();









var o=g(n);
this._items.forEach(function(p){
if(l(p))
if(o.contains(p.getValue())){
p.select();}else
if(m(p))
p.deselect();});



this.inform('change',this._getSelection());},


_handleItemClick:function(n){
if(!l(n))
return this.parent._handleItemClick(n);


this.inform('itemclick',n);

if(this._config.multiple){
if(m(n)){
n.deselect();}else 

n.select();

this.inform('change',this._getSelection());}else{

if(!m(n)){
n.select();

this._items.forEach(function(o){
if(m(o)&&o!==n)
o.deselect();});


this.inform('change',this._getSelection());}



this.done();}

return n.handleClick();},







_getSelection:function(){
var n=[];
this._items.forEach(function(o){
if(m(o))
n.push
({label:o.getLabel(),
value:o.getValue(),
item:o});});




if(!this._config.multiple)
n=n[0];

return n;}});



e.exports=k;});

/** js/modules/MenuXSelectableItem.js */
__d("MenuXSelectableItem",["Class","copyProperties","CSS","MenuXItem"],function(a,b,c,d,e,f){



var g=b('Class'),
h=b('copyProperties'),
i=b('CSS'),
j=b('MenuXItem');

function k(l){
this.parent.construct(this,l);}


g.extend(k,j);

h(k.prototype,
{_selected:false,

getLabel:function(){
return this._data.label;},


getIcon:function(){
return this._data.icon;},


isSelected:function(){
return this._selected;},


select:function(){
i.addClass(this._root,'checked');
this._selected=true;},


deselect:function(){
i.removeClass(this._root,'checked');
this._selected=false;},


render:function(){
var l=this.parent.render();
if(this._data.selected){
i.addClass(l,'checked');
this._selected=true;}

return l;}});



e.exports=k;});

/** js/modules/Popover.js */
__d("Popover",["Event","Arbiter","ArbiterMixin","ContextualLayer","ContextualLayerHideOnScroll","CSS","DataStore","DOM","Focus","KeyStatus","LayerHideOnEscape","Toggler","copyProperties"],function(a,b,c,d,e,f){



var g=b('Event'),

h=b('Arbiter'),
i=b('ArbiterMixin'),
j=b('ContextualLayer'),
k=b('ContextualLayerHideOnScroll'),
l=b('CSS'),
m=b('DataStore'),
n=b('DOM'),
o=b('Focus'),
p=b('KeyStatus'),
q=b('LayerHideOnEscape'),
r=b('Toggler'),

s=b('copyProperties');

r.subscribe(['show','hide'],function(u,v){
var w=m.get(v.getActive(),'Popover');
if(w)
if(u==='show'){
w.showLayer();}else 

w.hideLayer();});




function t(u,v,w,x){
this._root=u;
this._triggerElem=v;
this._behaviors=w;
this._config=x;



if(!(v.nodeName==='A'&&v.rel==='toggle'))
g.listen(v,'click',function(){
r.bootstrap(v);});


v.setAttribute('role','button');
m.set(u,'Popover',this);}


s(t.prototype,i,
{_layer:null,
_closeListener:null,

ensureInit:function(){
if(!this._layer)
this._init();},



showLayer:function(){
this.ensureInit();
this._layer.show();
r.show(this._root);
l.addClass(this._root,'selected');
this.inform('show');
this._triggerElem.setAttribute('aria-expanded','true');},


getLayer:function(){
return this._layer;},


hideLayer:function(){
this._layer.hide();
this._triggerElem.setAttribute('aria-expanded','false');},


isShown:function(){
return this._layer.isShown();},


setLayerContent:function(u){
this.ensureInit();
this._layer.setContent(u);},


_init:function(){
var u=new j
({context:this._triggerElem,
position:'below'},
n.create('div'));
u.enableBehaviors([k,q]);



r.createInstance(u.getRoot()).setSticky(false);

u.subscribe('hide',this._onLayerHide.bind(this));
this._behaviors&&u.enableBehaviors(this._behaviors);
this._layer=u;

if(this._config.alignh)
this._layer.setAlignment(this._config.alignh);

if(this._config.layer_content)
this._layer.setContent(this._config.layer_content);


this.inform('init',null,h.BEHAVIOR_PERSISTENT);},






_onLayerHide:function(){
r.hide(this._root);
l.removeClass(this._root,'selected');
this.inform('hide');


if(p.isKeyDown())
o.set(this._triggerElem);}});




e.exports=t;});

/** js/modules/PopoverMenu.js */
__d("PopoverMenu",["Event","Arbiter","ArbiterMixin","ARIA","BehaviorsMixin","Focus","Keys","KeyStatus","copyProperties"],function(a,b,c,d,e,f){



var g=b('Event'),

h=b('Arbiter'),
i=b('ArbiterMixin'),
j=b('ARIA'),
k=b('BehaviorsMixin'),
l=b('Focus'),
m=b('Keys'),
n=b('KeyStatus'),

o=b('copyProperties');

function p(q,r,s,t){
this._popover=q;
this._triggerElem=r;
this._initialMenu=s;

q.subscribe('init',this._onLayerInit.bind(this));
q.subscribe('show',this._onPopoverShow.bind(this));
q.subscribe('hide',this._onPopoverHide.bind(this));

t&&this.enableBehaviors(t);}


o(p.prototype,i,k);

o(p.prototype,
{_popoverShown:false,

setMenu:function(q){
this._menu=q;

var r=q.getRoot();
this._popover.setLayerContent(r);
q.subscribe('done',this._onMenuDone.bind(this));

if(this._popoverShown)
this._menu.onShow();


j.owns(this._triggerElem,r);
this.inform('setMenu',null,h.BEHAVIOR_PERSISTENT);},


getPopover:function(){
return this._popover;},


getTriggerElem:function(){
return this._triggerElem;},


getMenu:function(){
return this._menu;},


_onLayerInit:function(){
this.setMenu(this._initialMenu);
this._popover.getLayer().subscribe('key',this._handleKeyEvent.bind(this));},


_onPopoverShow:function(){
if(this._menu){
this._menu.onShow();
if(n.isKeyDown())
this._menu.focusAnItem();}


this._popoverShown=true;},


_onPopoverHide:function(){
if(this._menu)
this._menu.onHide();

this._popoverShown=false;},


_handleKeyEvent:function(q,r){
var s=g.getKeyCode(r);
switch(s){
case m.RETURN:

return;
case m.UP:
case m.DOWN:
this._menu.handleKeydown(s);
break;



default:if(this._menu.handleKeydown(s)===false){
this._menu.blur();
this._menu.handleKeydown(s);}

break;
}
r.prevent();},


_onMenuDone:function(q){




this._popover.hideLayer.bind(this._popover).defer();



if(n.isKeyDown())
l.set(this._triggerElem);}});




e.exports=p;});

/** js/modules/PopoverAsyncMenu.js */
__d("PopoverAsyncMenu",["Event","AsyncRequest","Class","PopoverMenu","copyProperties"],function(a,b,c,d,e,f){



var g=b('Event'),

h=b('AsyncRequest'),
i=b('Class'),
j=b('PopoverMenu'),

k=b('copyProperties'),

l={},
m=0;

function n
(o,
p,
q,
r,
s){

this._endpoint=r;
this._loadingMenu=q;
this._instanceId=m++;
l[this._instanceId]=this;
this._mouseoverListener=
g.listen(p,'mouseover',this._fetchMenu.bind(this));

this.parent.construct(this,o,p,null,s);}


n.setMenu=function(o,p){
l[o].setMenu(p);};


i.extend(n,j);

k(n.prototype,
{_fetched:false,
_mouseoverListener:null,

_onLayerInit:function(){

if(!this._menu)
this.setMenu(this._loadingMenu);


this._fetchMenu();},


_fetchMenu:function(){
if(this._fetched)
return;


new h().
setURI(this._endpoint).
setData({pmid:this._instanceId}).
send();
this._fetched=true;

if(this._mouseoverListener){
this._mouseoverListener.remove();
this._mouseoverListener=null;}}});




e.exports=n;});

/** js/modules/PopoverAsyncMenuLoading.js */
__d("PopoverAsyncMenuLoading",["Class","copyProperties","DOM","PopoverMenuInterface"],function(a,b,c,d,e,f){






var g=b('Class'),
h=b('copyProperties'),
i=b('DOM'),
j=b('PopoverMenuInterface');

function k(l){
this.parent.construct(this);
this._className=l||'';}


g.extend(k,j);
h(k.prototype,
{_root:null,

getRoot:function(){
if(!this._root)
this._root=
i.create('div',{className:this._className},
i.create('div',{className:'uiMenuXBorder'},
i.create('div',{className:'uiMenuX uiMenuXLoading'},
i.create('span',{className:'spinner'}))));


return this._root;}});



e.exports=k;});

/** js/modules/PopoverMenuOverlappingBorder.js */
__d("PopoverMenuOverlappingBorder",["function-extensions","CSS","DOM","Style","copyProperties"],function(a,b,c,d,e,f){




b('function-extensions');

var g=b('CSS'),
h=b('DOM'),
i=b('Style'),

j=b('copyProperties');

function k(l){
this._popoverMenu=l;
this._popover=l.getPopover();
this._triggerElem=l.getTriggerElem();}


j(k.prototype,
{_shortBorder:null,
_setMenuSubscription:null,
_showSubscription:null,
_menuSubscription:null,

enable:function(){
this._setMenuSubscription=
this._popoverMenu.subscribe('setMenu',this._onSetMenu.bind(this));},


disable:function(){
this._popoverMenu.unsubscribe(this._setMenuSubscription);
this._setMenuSubscription=null;
this._removeBorderSubscriptions();
this._removeShortBorder();},


_onSetMenu:function(){
this._removeBorderSubscriptions();

this._menu=this._popoverMenu.getMenu();
this._renderShortBorder(this._menu.getRoot());

this._showSubscription=
this._popover.subscribe('show',this._updateBorder.bind(this));


this._menuSubscription=
this._menu.subscribe
(['change','resize'],
Function.prototype.defer.shield(this._updateBorder.bind(this)));

this._updateBorder();},


_updateBorder:function(){
var l=this._menu.getRoot(),
m=this._triggerElem.offsetWidth;


i.set(l,'min-width',m+'px');

var n=Math.max(l.offsetWidth-m,0);
i.set(this._shortBorder,'width',n+'px');},


_renderShortBorder:function(l){
this._shortBorder=h.create('div',{className:'uiMenuXShortBorder'});
h.appendContent(l,this._shortBorder);
g.addClass(l,'uiMenuXWithShortBorder');},


_removeShortBorder:function(){
if(this._shortBorder){
h.remove(this._shortBorder);
this._shortBorder=null;
g.removeClass
(this._popoverMenu.getMenu().getRoot(),
'uiMenuXShortBorder');}},



_removeBorderSubscriptions:function(){
if(this._showSubscription){
this._popover.unsubscribe(this._showSubscription);
this._showSubscription=null;}

if(this._menuSubscription){
this._menu.unsubscribe(this._menuSubscription);
this._menuSubscription=null;}}});




e.exports=k;});

/** js/modules/SelectorX.js */
__d("SelectorX",["ArbiterMixin","BehaviorsMixin","Button","copyProperties"],function(a,b,c,d,e,f){



var g=b('ArbiterMixin'),
h=b('BehaviorsMixin'),
i=b('Button'),

j=b('copyProperties');

function k(l,m,n,o){
this._button=l;
this._menu=m;
this._input=n;

this.init();
o.behaviors&&this.enableBehaviors(o.behaviors);}


j(k.prototype,g,h);

j(k.prototype,
{init:function(){
this._menu.subscribe('change',function(l,m){
i.setLabel(this._button,m.label);
this._input.value=m.value;
this.inform('change',m);}.
bind(this));},


setValue:function(l){
this._menu.setValue(l);},


getValue:function(){
return this._input.value;},


getName:function(){
return this._input.name;},


getButton:function(){
return this._button;}});



e.exports=k;});

/** js/stream/StreamShareVideo.js */





var StreamShareVideo=
{_endpoints:[],
_thumbs:[],

registerThumb:function(a,b,c,d){
StreamShareVideo._endpoints[a+' '+c]=d;
StreamShareVideo._thumbs[a+' '+c]=b;},


clickTitle:function(a,b,event){
return this.expandInlineOrRedirect(a,b,event);},






expandInlineOrRedirect:function(a,b,event){
if(StreamShareVideo._shouldFollowHref(event))
return true;


var c=StreamShareVideo._thumbs[a+' '+b],
d=ge(c);
if(d){
CSS.addClass(d,"uiVideoThumbLoading");
AsyncRequest.bootstrap
(StreamShareVideo._endpoints[a+' '+b],
d.parentElement);


return false;}


return true;},


clickTimeline:function(a,b,event){
if(StreamShareVideo._shouldFollowHref(event))
return true;


CSS.addClass(a,"_1xu");
CSS.removeClass(a,"_1xv");
AsyncRequest.bootstrap(b,a);

return false;},






_shouldFollowHref:function(event){
event=$E(event);
if(!event)
return false;

if(event.getModifiers().any||event.isMiddleClick())

return true;

return false;}};

/** js/ui/layer/behaviors/ContextualLayerAsyncRelative.js */
__d("ContextualLayerAsyncRelative",["Event","copyProperties","Parent"],function(a,b,c,d,e,f){



var g=b('Event'),

h=b('copyProperties'),
i=b('Parent');







function j(k){
this._layer=k;}


h(j.prototype,
{_layerSubscription:null,
_listener:null,

enable:function(){
this._layerSubscription=
this._layer.subscribe('show',this._attachListener.bind(this));
if(this._layer.isShown())
this._attachListener();},



disable:function(){
this._layerSubscription.unsubscribe();
this._layerSubscription=null;
if(this._listener){
this._listener.remove();
this._listener=null;}},



_attachListener:function(){
this._listener=
g.listen(this._layer.getRoot(),'click',this._onclick.bind(this));},


_onclick:function(k){
var l=i.byTag(k.getTarget(),'A');
if(!l)return;
var m=l.getAttribute('ajaxify'),
n=l.href,
o=m||n;

if(l.rel==='async'||l.rel==='async-post'){
d(['AsyncRequest'],function(p){
p.bootstrap
(o,
this._layer.getContext(),
l.rel==='async-post');}.
bind(this));

return false;}}});




e.exports=j;});
