Skip to content

Instantly share code, notes, and snippets.

@pellaeon
Last active July 3, 2023 23:40
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pellaeon/2080306b1d1db375074c to your computer and use it in GitHub Desktop.
Save pellaeon/2080306b1d1db375074c to your computer and use it in GitHub Desktop.
facebook PrivacyConst
/*!CK:1682740188!*/ /*1436151151,*/
if (self.CavalryLogger) {
CavalryLogger.start_js(["87tQA"]);
}
__d("TickerStoryList", ["Event", "Animation", "Arbiter", "AsyncRequest", "AsyncSignal", "Bootloader", "ChannelConstants", "LegacyContextualDialog", "CSS", "DOM", "HTML", "Keys", "LayerFadeOnHide", "LiveTimer", "NavigationMessage", "Parent", "Rect", "Run", "ScrollableArea", "SelectorDeprecated", "Style", "TickerController", "TickerReadStateTracking", "Toggler", "URI", "UserActivity", "UserAgent_DEPRECATED", "Vector", "DOMVector", "BanzaiODS", "clickRefAction", "collectDataAttributes", "containsNode", "cx", "csx", "ex", "emptyFunction", "ge", "getElementText", "goURI", "throttle", "tickerPhoteSnowLiftOpenStatus"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, aa, ba, ca, da, ea, fa, ga, ha, ia, ja, ka, la, ma, na, oa, pa, qa, ra, sa, ta, ua, va) {
b.__markCompiled && b.__markCompiled();
var wa = 15000,
xa = {};
function ya(za, ab, bb) {
xa[za.id] = this;
ba.setActiveInstance(this);
this._root = za;
this._content = p.find(za, '.ticker_stream');
this._stories = p.find(this._root, '.tickerActivityStories');
this._scrollableArea = ab;
this._container = p.find(za, 'div.uiScrollableAreaWrap');
this._newestStory = {};
this._objectIDs = [];
this._fetchedStories = {};
this._fetchedStoriesDialog = {};
this._storyDialogResources = {};
this._removedStoryIDs = [];
this._storiesToRemove = [];
var cb = Date.now();
this._initTime = cb;
this._lastUpdate = cb;
this._lastPull = cb;
this._lastInsert = cb;
this._pollOnly = false;
this._autoloadStoryIndex = 1;
this._scrollTopThreshold = 100;
this._scrollTopPrompt = p.find(this._root, '.scrollTopPrompt');
this._scrollTopPromptVisible = false;
this._maxStoriesToKeep = 50;
this._minStoriesToKeep = 25;
this._tickerInSidebarMode = !!v.byClass(this._root, 'fbChatSidebar');
this._loadStoriesWithActions();
ka('ticker_flyout');
ka('ticker_flyout_prefetch');
ka('ticker_flyout_loadtime');
ka('ticker_stream');
this._uaCurStoryIDFetch = null;
this._uaCurStoryIDPrefetch = null;
var db = p.create('div', {
className: 'storyQueue hidden_elem'
});
this._storyQueue = db;
p.appendContent(this._root, db);
this._lastKStories = {
head: null,
tail: null,
count: 0,
actors: {},
apps: {},
stories: {}
};
this._dedupeKeys = {};
this._initObjectIDs();
this._initConfig(bb);
this._resetMorePager();
this._initListeners();
this._initSubscriptions(bb);
i.inform('ticker/init', this, i.BEHAVIOR_PERSISTENT);
this._poll();
}
Object.assign(ya, {
instances: function() {
return xa;
}
});
Object.assign(ya.prototype, {
ADS_IDLE_MS: 300000,
FLYOUT_MAX_HEIGHT: 450,
FLYOUT_OFFSET_THRESHOLD: 20,
FLYOUT_COMMENT_OFFSET: 15,
FLYOUT_VIEWPORT_PADDING: 75,
FLYOUT_ACTION_FOOTER_PADDING: 8,
FLYOUT_TARGET_HEIGHT_OFFSET: 25,
DEFAULT_LOOK_BEHIND: 10,
init: function(za, ab, bb) {
new ya(za, ab, bb);
},
_lastKStoriesInsert: function(za) {
this._lastKStories.stories[za.getAttribute("data-story-key")] = true;
var ab = {
story: za,
next: null
};
if (this._lastKStories.head) this._lastKStories.head.next = ab;
this._lastKStories.head = ab;
this._lastKStories.count++;
if (!this._lastKStories.tail) this._lastKStories.tail = this._lastKStories.head;
var bb = za.getAttribute("data-actor");
if (!this._lastKStories.actors[bb]) this._lastKStories.actors[bb] = 0;
this._lastKStories.actors[bb]++;
var cb = za.getAttribute("data-app");
if (cb) {
if (!this._lastKStories.apps[cb]) this._lastKStories.apps[cb] = 0;
this._lastKStories.apps[cb]++;
}
if (this._lastKStories.count > this.DEFAULT_LOOK_BEHIND) {
while (this._lastKStories.tail && !this._lastKStoriesRemove(this._lastKStories.tail.story)) this._lastKStories.tail = this._lastKStories.tail.next;
if (!this._lastKStories.tail) this._lastKStories.head = null;
}
},
_lastKStoriesRemove: function(za) {
var ab = za.getAttribute("data-story-key"),
bb = za.getAttribute("data-actor"),
cb = za.getAttribute("data-app");
if (this._lastKStories.stories[ab]) {
delete this._lastKStories.stories[ab];
this._lastKStories.actors[bb]--;
if (cb) this._lastKStories.apps[cb]--;
this._lastKStories.count--;
return true;
} else return false;
},
_loadStoriesWithActions: function() {
var za = ra('rightCol');
if (!za) return;
this._toggleWrapper = p.scry(za, '.tickerToggleWrapper')[0];
if (this._toggleWrapper) {
var ab = p.scry(this._stories, '.tickerStoryWithButton');
this._storiesWithActions = {};
for (var bb = 0; bb < ab.length; bb++) {
var cb = ab[bb];
this._storiesWithActions[cb.getAttribute('data-story-key')] = cb;
}
}
},
_initConfig: function(za) {
Object.assign(this, {
_newest: za.newest,
_page_newest: za.newest,
_timeout: za.timeout,
_heartbeatTimeout: Math.min(5000, za.heartbeatTimeout),
_maxHeartbeatTimeout: Math.max(30000, za.maxHeartbeatTimeout),
_pullTimeout: Math.max(30000, za.pullTimeout),
_insertTimeout: za.insertTimeout,
_maxQueueLength: za.maxQueueLength,
_heartbeatEndpoint: za.heartbeatEndpoint,
_popupOnHover: za.popupOnHover,
_userIdleTimeout: za.userIdleTimeout,
_pollOnly: za.pollOnly,
_tickerSource: za.tickerSource,
_logFlyouts: za.logFlyouts,
_userScrollGaurdDelay: za.userScrollGaurdDelay,
_rescheduleScrollToTopDelay: za.rescheduleScrollToTopDelay
});
},
_initListeners: function() {
this._listeners = g.listen(this._root, {
click: this._handleClick.bind(this),
keydown: this._handleKeydown.bind(this),
mouseout: this._handleMouseout.bind(this),
mouseover: this._handleMouseover.bind(this),
mousedown: this._tickerDeClicker.bind(this),
mouseup: this._handleMouseup.bind(this)
});
this._listeners.scroll = g.listen(this._container, 'scroll', this._handleScroll.bind(this));
setTimeout(this._initInfiniteScrollListener.bind(this), 0);
},
_initSubscriptions: function(za) {
x.onLeave(this._cleanup.bind(this));
this._subscriptions = [i.subscribe(u.NAVIGATION_BEGIN, this._onNavHandler.bind(this)), i.subscribe('composer/publish', this._handleComposerPublish.bind(this)), i.subscribe('Ticker/storiesInserted', this._handleStoriesInserted.bind(this)), i.subscribe('Ticker/fixed', this._setFixed.bind(this, true)), i.subscribe('Ticker/unfixed', this._setFixed.bind(this, false)), i.subscribe('Ticker/resized', this._checkInfiniteScroll.bind(this)), i.subscribe('ufi/comment', this._scrollDialogToBottom.bind(this)), i.subscribe('ufi/changed', this._redrawFlyout.bind(this)), i.subscribe('Ticker/chatOpened', this._handleChatOpened.bind(this))];
if (!za.pollOnly) this._subscriptions.push(i.subscribe(m.getArbiterType('ticker_update'), this._handleTickerPush.bind(this)));
if (za.pushChannel && !za.pollOnly) this.setPushChannel(za.pushChannel);
},
_handleClick: function(event) {
if (!(event.button === 1 || event.altKey || event.ctrlKey || event.metaKey)) event.prevent();
var za = event.getTarget();
if (this._getButtonFromNode(za)) {
this._logUserAction(za, 'click', event);
this._handleActionButton(event);
return;
}
var ab = this._getStoryFromNode(za),
bb = v.byClass(za, 'tickerStoryAllowClick');
if (!ab || ab == this._selectedStory || bb) return;
if (this._storyIsHidden(ab)) return;
if (ab == this._activeStory && !this._selectedStory) this._selecting = true;
if (this._storyCanOpenExternally(ab)) {
var cb = ab.getAttribute('data-href');
if (cb && !za.getAttribute('href')) {
var db = {
href: cb
},
eb = la(za, ['ft', 'gt']);
ka('click', db, event, 'FORCE', eb);
} else this._logUserAction(za, 'click', event);
this._openStoryExternally(ab, event);
return;
}
this._logUserAction(za, 'flyout', event);
this._activateStory(ab, 'click');
this._selectStory(ab);
},
_handleMouseover: function(event) {
this._setLocked(true);
var za = event.getTarget(),
ab = this._getOpenableStory(za);
if (!ab) {
var bb = v.byClass(za, "_5wvy");
if (bb) {
clearTimeout(parseInt(bb.getAttribute('data-timeout-token'), 10));
var cb = setTimeout(function() {
ya.removeMarkup(bb, ab);
}, wa);
bb.setAttribute('data-timeout-token', cb);
}
return;
}
event.kill();
if (this._popupOnHover) {
if (!(ab.id in this._fetchedStories)) this._uaCurStoryIDPrefetch = ab.id;
this._fetchStory(ab);
}
if (this._selectedStory) return;
if (this._popupOnHover) {
this._clearHoverTimeouts();
var db = this._storyCanOpenExternally(ab) ? 500 : 1000,
eb = this._activeStory ? 75 : db;
this._hoverShowTimeout = this._setTimeout(function() {
this._activateStory(ab, 'hover');
this._logUserAction(za, 'flyout', event);
}.bind(this), eb);
}
},
_handleMouseout: function(event) {
var za = event.getTarget();
this._setLocked(false);
if (za == this._getStoryFromNode(za)) {
var ab = p.scry(za.parentNode, '.openToggler');
for (var bb = 0; bb < ab.length; bb++) z.toggle(ab[bb]);
}
this._clearClickedStory();
this._scheduleHide();
},
_handleKeydown: function(event) {
this._tickerDeClicker(event);
var za = this._activeStory;
if (!za) return;
var ab = g.getKeyCode(event);
switch (ab) {
case r.UP:
case r.DOWN:
var bb = this._getInsertedStories(),
cb;
if (event.getModifiers().any) {
cb = ab === r.UP ? 0 : bb.length - 1;
} else cb = bb.indexOf(za) + (ab === r.UP ? -1 : 1);
za = bb[cb];
break;
case r.ESC:
this._deactivateStory(true);
return;
default:
return;
}
event.kill();
if (!za) return;
this._activateStory(za, 'keypress');
this._selectStory(za);
},
_fadeTopmostStoryButton: function() {
var za = 0,
ab = 15;
if (this._storiesWithActions)
for (var bb in this._storiesWithActions) {
var cb = this._storiesWithActions[bb],
db = p.scry(cb, '.tickerInlineActionButton')[0],
eb = p.scry(db, '.tickerActionIcon')[0],
fb = ha.getElementPosition(db).y - ha.getElementPosition(this._toggleWrapper).y;
if (fb < za) {
aa.set(db, 'opacity', 0);
aa.set(eb, 'opacity', 0);
} else if (fb >= za && fb < ab) {
var gb = (fb - za) / (ab - za);
aa.set(db, 'opacity', gb);
aa.set(eb, 'opacity', gb);
break;
} else {
aa.set(db, 'opacity', 1);
aa.set(eb, 'opacity', 1);
}
}
},
_handleScroll: function() {
var za = va.checkIsOpen();
if (za) this._preventFlyoutDismiss = true;
if (!this._preventScrollDismiss && !za) {
if (!this._preventFlyoutDismiss) {
this._deactivateStory(true);
} else this._preventFlyoutDismiss = false;
} else this._preventScrollDismiss = false;
if (!this._handleScrollThrottled) this._handleScrollThrottled = ua(this._handleScrollInner.bind(this));
this._handleScrollThrottled();
},
_handleScrollInner: function() {
this._fadeTopmostStoryButton();
this._checkInfiniteScroll();
this._setIsUserScrolling();
if (!this._scrollLogged) {
this._scrollLogged = true;
var za = this._stories.childNodes.length,
ab = this._stories.getAttribute('data-gt'),
bb = {
ticker_scroll: 1,
number_stories: za,
source: ab
};
ka('scroll', null, null, 'FORCE', {
gt: bb
});
}
},
_setIsUserScrolling: function() {
clearTimeout(this._userScrollingToken);
if (this._isScrolledToTop()) {
this._userScrolling = false;
return;
}
this._userScrolling = true;
this._userScrollingToken = setTimeout(function() {
this._userScrolling = false;
this._userScrollingToken = null;
}.bind(this), this._userScrollGaurdDelay);
},
_isUserScrolling: function() {
return this._userScrolling;
},
_handleStoriesInserted: function() {
this._initInfiniteScrollListener();
if (this._scrollableArea instanceof y) this._scrollableArea.adjustGripper();
},
_handleActionButton: function(event) {
var za = event.getTarget(),
ab = this._getOpenableStory(za),
bb = this._getStoryDialog(ab);
if (bb) var cb = bb.subscribe('beforehide', function() {
bb.unsubscribe(cb);
return false;
});
},
_handleScrollToTopClick: function() {
this._scrollToTop(this._poll.bind(this));
},
_scheduleScrollToTop: function() {
this._scrollToTopToken && clearTimeout(this._scrollToTopToken);
this._scrollToTopToken = setTimeout(function() {
if (this._isLocked() || this._isUserScrolling()) {
this._scheduleScrollToTop();
} else {
this._scrollToTopToken = null;
this._scrollToTop();
}
}.bind(this), this._rescheduleScrollToTopDelay);
},
_scrollToTop: function(za) {
new h(this._container).to('scrollTop', 0).ease(h.ease.end).ondone(za).go();
},
_clearHoverTimeouts: function() {
clearTimeout(this._hoverShowTimeout);
clearTimeout(this._hoverHideTimeout);
},
_getAllStories: function() {
return p.scry(this._root, 'div.fbFeedTickerStory');
},
_findStoryById: function(za) {
var ab = p.scry(this._root, '.fbFeedTickerStory'),
bb;
for (story in ab) {
bb = ab[story];
if (za == this._getStoryDialogParams(bb).token) return bb;
}
return null;
},
_getInsertedStories: function() {
return this._getAllStories().filter(function(za) {
return !o.hasClass(za, 'queuedStory');
});
},
_getQueuedStories: function() {
return p.scry(this._storyQueue, '.fbFeedTickerStory.queuedStory');
},
_getButtonFromNode: function(za) {
return v.byClass(za, 'tickerInlineOverlay');
},
_getStoryFromNode: function(za) {
return v.byClass(za, 'fbFeedTickerStory');
},
_getActionButtonFromStory: function(za) {
return p.scry(za, '.tickerInlineActionButton')[0];
},
_getOpenableStory: function(za) {
var ab = this._getStoryFromNode(za);
return this._storyCanOpenDialog(ab) ? ab : null;
},
_getStoryDialog: function(za) {
return this._fetchedStoriesDialog[za.id] || n.getInstance(za);
},
_getStoryDialogParams: function(za) {
var ab = za && za.getAttribute('data-flyoutdata') || null;
return ab && JSON.parse(ab) || null;
},
_storyCanOpenDialog: function(za) {
return !!this._getStoryDialogParams(za) && !this._storyIsHidden(za);
},
_storyCanOpenExternally: function(za) {
return !!za.getAttribute('data-href') || !this._storyCanOpenDialog(za);
},
_storyIsHidden: function(za) {
return o.hasClass(za, 'tickerStoryHidden');
},
hideActiveStory: function() {
this._activeStory && this.hideStory(this._activeStory);
},
hideStory: function(za) {
this._deactivateStory();
if (sa(za) === '') p.remove(za);
o.addClass(za, 'tickerStoryHidden');
o.removeClass(za, 'tickerStoryClickable');
},
undoHideStory: function(za) {
o.addClass(za, 'tickerStoryClickable');
o.removeClass(za, 'tickerStoryHidden');
},
insertStoriesAtBottom: function(za) {
if (!za) return;
var ab = p.create('div');
ab.appendChild(za);
var bb = p.scry(ab, '.fbFeedTickerStory'),
cb = p.find(ab, '.tickerMorePager'),
db = [];
for (var eb = 0; eb < bb.length; eb++)
if (!this.dedupeStory(bb[eb])) db.push(bb[eb]);
if (db.length) {
db.push(cb);
p.replace(p.find(this._root, '.tickerMorePager'), db);
}
i.inform('Ticker/storiesInserted');
},
_scheduleHide: function() {
if (this._popupOnHover && !this._selectedStory) {
this._clearHoverTimeouts();
this._hoverHideTimeout = this._setTimeout(this._deactivateStory.bind(this), 100);
}
},
_setScrollTopPromptVisible: function(za) {
this._scrollTopPromptVisible = za;
o.conditionShow(this._scrollTopPrompt, za);
if (za && !this._listeners.scrollTop) {
this._listeners.scrollTop = g.listen(this._scrollTopPrompt, {
click: this._handleScrollToTopClick.bind(this)
});
} else if (!za && this._listeners.scrollTop) {
this._listeners.scrollTop.click.remove();
this._listeners.scrollTop = null;
}
},
_isUserIdle: function() {
return !fa.isActive(this._userIdleTimeout);
},
_schedulePoll: function() {
clearTimeout(this._pollToken);
this._pollToken = this._setTimeout(this._poll.bind(this), this._timeout);
},
_poll: function() {
if (!this._isTickerVisible()) return;
if (this._storiesToRemove.length > 0) {
if (this._isInsertingStory) return this._schedulePoll();
var za = this._storiesToRemove.pop();
this.removeStory(za);
}
var ab = !this._isScrolledToTop() && this._getQueuedStories().length;
this._setScrollTopPromptVisible(ab);
var bb = Date.now(),
cb = bb - this._lastInsert;
if (cb < this._insertTimeout || this._isLocked()) return this._schedulePoll();
var db = this._getQueuedStories(),
eb = this._isUserIdle(),
fb = db.length > 0;
if (fb) {
var gb = db.shift();
this.insertStory(gb);
return this._schedulePoll();
}
if (eb) return fa.subscribeOnce(this._poll.bind(this));
var hb = false,
ib = false;
if (this._pollOnly) {
ib = bb - this._lastUpdate > this._heartbeatTimeout;
} else hb = (bb - this._lastPull > this._pullTimeout);
var jb = hb || ib;
if (!jb) return this._schedulePoll();
this.update({
pull: hb,
fullpoll: ib
});
},
_updatePollOnlyHeartbeatTimeout: function() {
if (this._pollOnly && this._heartbeatTimeout < this._maxHeartbeatTimeout) this._heartbeatTimeout = Math.min(this._heartbeatTimeout + 5000, this._maxHeartbeatTimeout);
},
update: function(za) {
this._updatePollOnlyHeartbeatTimeout();
if (!this._pollOnly) return this._schedulePoll();
var ab = {
newest: (za.fullpoll || za.cache_update) ? this._newest : this._page_newest,
source: this._tickerSource
};
if (!ab.newest || ab.newest === '0') throw new Error(pa('Trying to request new ticker stories with an invalid cursor %s, with' + ' the settings fullpoll %s, cache_update %s, value coming from this.%s', typeof ab.newest === 'string' ? '"' + ab.newest + '"' : ab.newest, za.fullpoll, za.cache_update, (za.fullpoll || za.cache_update) ? '_newest' : '_page_newest'));
Object.assign(ab, za);
new j().setURI(this._heartbeatEndpoint).setReadOnly(true).setOption('retries', 0).setData(ab).setHandler(this._handleResponse.bind(this)).setFinallyHandler(this._poll.bind(this)).setAllowCrossPageTransition(true).send();
this._lastUpdate = Date.now();
if (ab.pull) this._lastPull = this._lastUpdate;
},
insertStory: function(za) {
this._lastInsert = Date.now();
window.LiveTimer && t.addTimeStamps(za);
o.removeClass(za, 'queuedStory');
if (this._isUserScrolling()) {
this._fadeStoryIn(za);
} else this._scrollToTop(this._flyStoryIn.bind(this, za));
if (this._storiesWithActions && o.hasClass(za, 'tickerStoryWithButton')) this._storiesWithActions[za.getAttribute('data-story-key')] = za;
this._removeOldStories();
},
_removeOldStories: function() {
var za = this._getInsertedStories();
if (za.length <= this._maxStoriesToKeep) return;
var ab = this._minStoriesToKeep,
bb = za.slice(ab);
bb.forEach(p.remove);
if (this._storiesWithActions)
for (var cb = 0; cb < bb.length; cb++) delete this._storiesWithActions[bb[cb].getAttribute('data-story-key')];
this._resetMorePager();
},
_resetMorePager: function() {
var za = this._getInsertedStories();
if (!za || !za.length) return;
var ab = za[za.length - 1].getAttribute('data-ticker-timestamp'),
bb = p.scry(this._root, '.tickerMorePager a')[0];
if (!bb || !ab) return;
var cb = new ea(bb.getAttribute('ajaxify'));
cb.addQueryData({
oldest: ab
});
bb.setAttribute('ajaxify', cb);
},
_setLocked: function(za) {
this._locked = za;
},
_isLocked: function() {
return !!(this._locked || this._activeStory);
},
informAndRemoveStory: function(za, ab, bb) {
var cb = this._getStoryFromNode(za),
db = cb.getAttribute('data-story-key');
p.setContent(cb, ab);
o.addClass(cb, 'highlightedStory');
this._setTimeout(this.removeStory.bind(this, db), bb || 6000);
},
_getStoryByStoryKey: function(za) {
var ab = this._getAllStories();
for (var bb = 0; bb < ab.length; bb++) {
var cb = ab[bb];
if (cb.getAttribute('data-story-key') == za) return cb;
}
return null;
},
removeStory: function(za) {
this._removedStoryIDs[za] = true;
var ab = this._getStoryByStoryKey(za);
if (!ab) return;
if (this._storiesWithActions) delete this._storiesWithActions[za];
if (ab == this._activeStory) this._deactivateStory();
var bb = this._getStoryDialog(ab);
bb && bb.destroy();
this._lastKStoriesRemove(ab);
var cb = ab.getAttribute("data-dedupe-key");
if (cb) delete this._dedupeKeys[cb];
if (o.hasClass(ab, 'queuedStory')) {
p.remove(ab);
return;
}
this._animateStoryOut(ab);
},
_isScrolledToTop: function() {
return this._container.scrollTop <= this._scrollTopThreshold;
},
_flyStoryIn: function(za) {
var ab = p.create('div', {
style: {
marginTop: '-1000px'
}
}, za);
aa.set(ab, 'opacity', 0);
p.prependContent(this._stories, ab);
var bb = ha.getElementDimensions(ab).y;
aa.set(ab, 'marginTop', '-' + bb + 'px');
this._isInsertingStory = true;
new h(ab).to('marginTop', 0).ease(h.ease.end).checkpoint(.5).to('opacity', 1).ondone(function() {
p.replace(ab, za);
this._afterInsert(za);
this._isInsertingStory = false;
}.bind(this)).go();
},
_fadeStoryIn: function(za) {
new h(this._stories).to('opacity', .5).ondone(function() {
p.prependContent(this._stories, za);
this._container.scrollTop = this._container.scrollTop + this._stories.firstChild.offsetHeight;
this._scheduleScrollToTop();
new h(this._stories).to('opacity', 1).ondone(function() {
this._afterInsert(za);
}.bind(this)).go();
}.bind(this)).go();
},
_animateStoryOut: function(za) {
var ab = p.create('div', {
style: {
overflow: 'hidden',
position: 'relative'
}
});
p.insertBefore(za, ab);
p.appendContent(ab, za);
new h(ab).to('top', 20).to('height', 0).to('opacity', 0).ease(h.ease.end).ondone(function() {
p.remove(ab);
i.inform('Ticker/animateOut');
}.bind(this)).go();
},
_afterInsert: function(za) {
i.inform('Ticker/afterInsert');
},
setPushChannel: function(za) {
this._pushSubscription && this._pushSubscription.unsubscribe();
this._pushSubscription = i.subscribe(m.getArbiterType(za), this._handleTickerPush.bind(this));
d(['ChatConfig', 'ChannelConnection'], function(ab, bb) {
this._channelConnection = bb;
this._checkChannelConnection();
this._channelConnectionSubscription = this._channelConnection.subscribe([this._channelConnection.CONNECTED, this._channelConnection.RECONNECTING, this._channelConnection.SHUTDOWN, this._channelConnection.MUTE_WARNING, this._channelConnection.UNMUTE_WARNING], this._handleChannelConnection.bind(this));
}.bind(this));
},
_checkChannelConnection: function() {
o.conditionClass(this._root, 'disconnected', this._channelConnection.disconnected());
},
_handleTickerPush: function(za, ab) {
var bb = ab.obj;
if (bb.delete_id) {
this._storiesToRemove.push(bb.delete_id);
return;
}
var cb = bb.story_xhp;
if (!cb) return;
var db = q(cb).getRootNode();
if (!bb.story_time || bb.story_time === '0') throw new Error(pa('An invalid story time was pushed: %s, for ticker story: %s', typeof bb.story_time === 'string' ? '"' + bb.story_time + '"' : bb.story_time, db.getAttribute('data-flyoutdata')));
this._newest = bb.story_time;
this.queueStory(db, bb.flyout_js_cmds);
this._newestStory = {
actorID: bb.actor,
storyKey: db.getAttribute('data-story-key')
};
},
_handleComposerPublish: function(za, ab) {
ab.tickerMarkup && this.insertStory(ab.tickerMarkup);
},
_logRender: function() {
if (this._loggedRender) return;
var za = this._tickerInSidebarMode;
if (za || v.byClass(this._content, 'home_right_column')) {
new k('/ajax/log_ticker_render.php', {
sidebar_mode: za
}).send();
this._loggedRender = true;
}
},
_isTickerVisible: function() {
var za = (ba.getActiveInstance() == this);
za && this._logRender();
return za;
},
_handleResponse: function(za) {
var ab = za.getPayload();
if (ab.newest) this._newest = this._page_newest = ab.newest;
if (ab.content)
if (ab.content instanceof Array) {
for (var bb = 0; bb < ab.content.length; bb++) this.queueStoryMarkup(ab.content[bb]);
} else this.queueStoryMarkup(ab.content);
},
queueStoryMarkup: function(za) {
var ab = q(za).getRootNode();
this.queueStory(ab);
},
dedupeStory: function(za) {
var ab = za.getAttribute('data-story-key'),
bb = ab && (!!this._objectIDs[ab] || !!this._removedStoryIDs[ab]);
bb = bb || !!this._lastKStories.actors[za.getAttribute('data-actor')] || !!this._lastKStories.apps[za.getAttribute('data-app')];
var cb = za.getAttribute('data-dedupe-key');
bb = bb || cb && this._dedupeKeys[cb];
if (za.getAttribute('data-force-push')) bb = false;
ab && (this._objectIDs[ab] = true);
return bb;
},
queueStory: function(za, ab) {
if (this.dedupeStory(za)) return;
this._lastKStoriesInsert(za);
var bb = za.getAttribute("data-dedupe-key");
if (bb) this._dedupeKeys[bb] = true;
o.addClass(za, 'queuedStory');
p.appendContent(this._storyQueue, za);
var cb = ab && ab.length;
if (cb) ab.forEach(function(eb) {
new Function(eb).apply();
});
za.setAttribute('id', za.id + '_' + this._root.id);
var db = this._getQueuedStories();
db.slice(0, -this._maxQueueLength).forEach(p.remove);
if (cb) this._fetchedStories[za.id] = true;
},
_cleanup: function() {
ba.clearRHCplaceholder();
if (!v.byClass(this._content, 'hasRightCol')) return;
this._objectIDs = [];
this._subscriptions.forEach(i.unsubscribe);
this._channelConnectionSubscription && this._channelConnection.unsubscribe(this._channelConnectionSubscription);
this._pushSubscription && this._pushSubscription.unsubscribe();
for (var za in this._listeners) this._listeners[za] && this._listeners[za].remove();
clearTimeout(this._pollToken);
this._pollToken = null;
this._cleanupInputFocusListener();
this._cleanupContentResizeListener();
i.inform('Ticker/cleanup');
},
_onNavHandler: function(za, ab) {
var bb = ab.params.key;
if (bb != 'lf' && bb != 'h') this._cleanup();
},
registerStoryDialog: function(za, ab) {
if (this._uaCurStoryIDFetch == za.id) this._uaCurStoryIDFetch = null;
if (this._uaCurStoryIDPrefetch == za.id) this._uaCurStoryIDPrefetch = null;
this._fetchedStories[za.id] = true;
this._fetchedStoriesDialog[za.id] = ab;
ab.setContext(za);
ab.subscribe('hide', this._deactivateStory.bind(this, true));
ab.subscribe('success', this._focusStory.bind(this, za));
ab.subscribe('beforehide', function() {
if (this._selecting) {
this._selecting = false;
return false;
}
}.bind(this));
if (this._popupOnHover) {
ab.subscribe('mouseenter', this._clearHoverTimeouts.bind(this));
ab.subscribe('mouseleave', this._scheduleHide.bind(this));
ab.subscribe('show', function() {
setTimeout(this._highlightDialogScrollbar.bind(this, ab), 0);
var bb = g.listen(ab.getContent(), 'mousedown', function() {
this._selectStory(za);
bb.remove();
}.bind(this));
}.bind(this));
}
if (za == this._activeStory) this._openDialog(ab);
},
_highlightDialogScrollbar: function(za) {
var ab = p.scry(za.getContent(), '.uiScrollableArea')[0];
ab && y.poke(ab);
},
_openStoryExternally: function(za, event) {
var ab = za.getAttribute('data-href');
if (!ab || ab == '#') return;
var bb = za.getAttribute('data-story-rel');
switch (bb) {
case 'theater':
this._deactivateAndClearStory();
l.loadModules(["PhotoViewer"], function(eb) {
eb.bootstrap(ab, za);
});
return;
case 'async':
this._deactivateAndClearStory();
j.bootstrap(ab, za);
return;
}
var cb = za.getAttribute('data-target'),
db = (event.which != 1 || event.getModifiers().any || cb == '_blank');
db ? window.open(ab, '_blank') : ta(ab);
},
_deactivateAndClearStory: function() {
this._clearHoverTimeouts();
this._deactivateStory();
},
_focusStoryWillTriggerScroll: function(za) {
var ab = this._container,
bb = ab.clientHeight,
cb = za.offsetHeight,
db = ab.scrollTop,
eb = db + bb,
fb = za.offsetTop,
gb = fb + cb;
return fb < db || gb > eb;
},
_focusStory: function(za) {
if (this._focusStoryWillTriggerScroll(za)) this._preventScrollDismiss = true;
var ab = new w(za),
bb = v.byClass(za, 'scrollable'),
cb = ab.boundWithin(new w(bb)).getPositionVector(),
db = ab.getPositionVector().sub(cb);
if (db.y !== 0) db.scrollElementBy(bb);
za.focus();
},
_selectStory: function(za) {
this._selectedStory = za;
o.addClass(za, 'tickerStorySelected');
o.addClass(this._root, 'tickerChildSelected');
},
_activateStory: function(za, ab) {
this._clearHoverTimeouts();
if (za == this._activeStory || !this._storyCanOpenDialog(za)) return;
this._deactivateStory();
this._focusStory(za);
this._activeStory = za;
o.addClass(za, 'tickerStoryActive');
window.Toggler && da.hide();
if (this._logFlyouts) {
ab = ab || 'unknown';
new k('/ajax/feed/ticker/flyout.php', {
src: ab
}).send();
}
ca.log(za);
var bb = this._getStoryDialog(za);
if (bb) {
if (this._storyDialogResources[za.id]) l.loadResources(this._storyDialogResources[za.id]);
this._openDialog(bb);
ja.bumpEntityKey('ticker_stories', 'flyouts.open');
return;
}
if (!(za.id in this._fetchedStories)) this._uaCurStoryIDFetch = za.id;
this._fetchStory(za);
},
handleRemoveStory: function() {
this._deactivateStory(true);
},
_deactivateStory: function(za) {
if (this._activeStory === this._deactivatingStory) return;
this._deactivatingStory = this._activeStory;
if (this._dialog) {
if (za) {
this._dialog.enableBehavior(s);
} else this._dialog.disableBehavior(s);
this._dialog.hide();
}
if (this._activeStory) {
o.removeClass(this._activeStory, 'tickerStoryActive');
o.removeClass(this._activeStory, 'tickerStorySelected');
o.removeClass(this._root, 'tickerChildSelected');
}
this._dialog = this._selectedStory = this._activeStory = null;
this._cleanupInputFocusListener();
this._cleanupContentResizeListener();
this._deactivatingStory = null;
},
_logUserAction: function(za, ab, event) {
ka(ab, za, event, 'FORCE');
},
_fetchStory: function(za) {
clearTimeout(this._fetchToken);
var ab = [],
bb = this._getInsertedStories(),
cb = bb.indexOf(za);
[-1, 0, 1].forEach(function(db) {
var eb = bb[cb + db];
eb && ab.push(eb);
}, this);
this._fetchToken = setTimeout(this._fetchStories.bind(this, ab), 100);
},
_fetchStories: function(za) {
var ab = [],
bb, cb = function(db) {
clearTimeout(bb);
za.forEach(function(eb) {
o.conditionClass(eb, 'tickerStoryFetching', db);
});
};
za = za.filter(function(db) {
if (db.id in this._fetchedStories) return false;
this._fetchedStories[db.id] = true;
var eb = this._getStoryDialogParams(db);
if (!eb) return false;
eb.uniq_id = db.getAttribute('id');
eb.referrer = this._tickerSource;
ab.push(eb);
return true;
}, this);
if (!ab.length) return;
bb = this._setTimeout(cb.bind(null, true), 500);
new j('/ajax/feed/ticker/multi_story').setInitialHandler(this._handleDialogResponse.bind(this, ab)).setFinallyHandler(cb.bind(null, false)).setErrorHandler(qa).setData({
stories: ab
}).setAllowCrossPageTransition(this._tickerInSidebarMode).send();
},
_handleDialogResponse: function(za, ab) {
if (ab && ab.resource_map) {
var bb = [];
for (var cb in ab.resource_map) {
var db = ab.resource_map[cb];
if (db.type === 'css' && !db.permanent) bb.push(cb);
}
if (bb.length > 0)
for (var eb = 0; eb < za.length; eb++) this._storyDialogResources[za[eb].uniq_id] = bb;
}
},
_tickerDeClicker: function(event) {
var za = event.getTarget(),
ab = v.byTag(za, 'a'),
bb = this._getStoryFromNode(za),
cb = this._getButtonFromNode(za);
if (bb && ab && !cb && o.hasClass(bb, 'tickerStoryClickable') && !o.hasClass(ab, 'tickerStoryAllowClick') && !this._storyIsHidden(bb)) ab.setAttribute('rel', 'ignore');
var db = (event.button == 2),
eb = (event.type === 'keydown'),
fb = bb && this._getActionButtonFromStory(bb);
if (!db && fb && !eb) this._setClickedStory(bb);
},
_handleMouseup: function(event) {
this._clearClickedStory();
},
_setClickedStory: function(za) {
this._clearClickedStory();
o.addClass(za, 'tickerStoryClicked');
this._clickedStory = za;
},
_clearClickedStory: function() {
if (this._clickedStory) {
o.removeClass(this._clickedStory, 'tickerStoryClicked');
this._clickedStory = null;
}
},
_initInfiniteScrollListener: function() {
var za = this._getInsertedStories();
if (this._storiesWithActions)
for (var ab = 0; ab < za.length; ab++) {
var bb = za[ab];
if (o.hasClass(bb, 'tickerStoryWithButton')) this._storiesWithActions[bb.getAttribute('data-story-key')] = bb;
}
var cb = Math.max(0, za.length - this._autoloadStoryIndex);
this._infiniteScrollStory = za[cb];
this._checkInfiniteScroll();
},
_checkInfiniteScroll: function() {
if (this._infiniteScrollStory) {
var za = ha.getElementPosition(this._infiniteScrollStory).y,
ab = ha.getElementPosition(this._container).y + ha.getElementDimensions(this._container).y;
if (za < ab) {
var bb = p.scry(this._root, '.tickerMorePager a')[0];
if (bb) {
var cb = v.byClass(bb, 'stat_elem') || bb;
new j(bb.getAttribute('ajaxify')).setReadOnly(true).setRelativeTo(bb).setStatusElement(cb).setAllowCrossPageTransition(true).send();
}
this._infiniteScrollStory = null;
this._autoloadStoryIndex = 5;
}
}
},
_setFixed: function(za) {
if (!this._selectedStory) return;
var ab = this._getStoryDialog(this._selectedStory);
if (ab) {
ab.setFixed && ab.setFixed(za);
ab.updatePosition();
}
},
_setTimeout: function(za, ab) {
return setTimeout(za, ab, !this._tickerInSidebarMode);
},
_scrollDialogToBottom: function() {
var za = this._dialog && this._dialog.getContent(),
ab = za && p.scry(za, '.uiScrollableAreaWrap')[0],
bb = ab && y.getInstance(ab);
bb && bb.scrollToBottom();
},
_redrawFlyout: function(za, ab) {
if (this._hasUFIUpdated) return;
var bb = this._dialog;
if (bb && bb.isShown() && ma(bb.getContent(), ab.form)) {
this._hasUFIUpdated = true;
this._updateDialogPosition();
}
},
_openDialog: function(za) {
if (!this._tickerInSidebarMode) o.addClass(za.getRoot(), 'tickerStoryOverlayOnTop');
this._hasUFIUpdated = false;
var ab = ia.getScrollPosition();
this._dialog = za.show();
window.scrollTo(ab.x, ab.y);
this._updateDialogPosition();
this._writeSwfFrame(za);
setTimeout(this._initCommentFocusListener.bind(this), 0);
setTimeout(this._initContentResizeListener.bind(this), 0);
this._stupidIE7VideoResizeHack(za);
},
_stupidIE7VideoResizeHack: function(za) {
if (ga.ie() === 7) {
var ab = p.scry(za.getContent(), '.uiVideoThumb .img');
ab.forEach(function(bb) {
aa.set(bb, 'width', '');
});
}
},
_updateDialogPosition: function() {
var za = this._tickerInSidebarMode || !!v.byClass(this._root, 'fixed_elem');
this._dialog.setFixed && this._dialog.setFixed(za);
this._adjustFlyoutContentHeight();
this._dialog.updatePosition();
},
_writeSwfFrame: function(za) {
var ab = this._dialog && this._dialog.getContent(),
bb = p.scry(ab, '.swfObject')[0];
if (!bb) return;
var cb = bb.getAttribute('data-swfid');
if (cb && window[cb]) {
var db = window[cb];
db.write(bb);
}
},
_initCommentFocusListener: function() {
var za = this._dialog && this._dialog.getContent(),
ab = za && p.scry(za, '.tickerDialogFooter textarea')[0];
if (!ab) return;
this._listeners.inputFocus = g.listen(ab, 'focus', this._scrollDialogToBottom.bind(this));
},
_cleanupInputFocusListener: function() {
if (this._listeners.inputFocus) {
this._listeners.inputFocus.remove();
this._listeners.inputFocus = null;
}
},
_initContentResizeListener: function() {
var za = this._dialog && this._dialog.getContent();
if (!za) return;
this._listeners.contentResize = g.listen(za, 'click', function() {
setTimeout(this._dialog.updatePosition.bind(this._dialog), 0);
}.bind(this));
},
_cleanupContentResizeListener: function() {
if (this._listeners.contentResize) {
this._listeners.contentResize.remove();
this._listeners.contentResize = null;
}
},
_adjustFlyoutContentHeight: function() {
var za = this._dialog && this._dialog.getContent(),
ab = za && p.scry(za, '.uiScrollableAreaWrap')[0];
if (!ab) return;
var bb = ha.getElementDimensions(ab),
cb = ha.getElementPosition(ab),
db = p.scry(ab, '.uiUfi .uiUfiComment'),
eb = p.scry(ab, "._12tg")[0],
fb = p.scry(ab, ".UFILikeSentence")[0],
gb = this.FLYOUT_MAX_HEIGHT;
if (eb || fb) {
var hb = this._getUfiItemAndTop(eb, fb),
ib = hb[0],
jb = hb[1];
gb = Math.max(gb, this.FLYOUT_TARGET_HEIGHT_OFFSET + ab.scrollTop + jb + ib.offsetHeight - cb.y);
}
var kb = ha.getViewportDimensions().y - this.FLYOUT_VIEWPORT_PADDING;
gb = Math.min(gb, kb);
var lb = gb - this.FLYOUT_TARGET_HEIGHT_OFFSET;
for (var mb = 0; mb < db.length; mb++) {
var nb = db[mb],
ob = ha.getElementPosition(nb),
pb = ob.y - cb.y;
if (Math.abs(pb - lb) <= this.FLYOUT_OFFSET_THRESHOLD) {
lb = pb + this.FLYOUT_COMMENT_OFFSET;
break;
}
}
if (bb.y >= lb) {
aa.set(ab, 'height', lb + 'px');
aa.set(ab, 'max-height', null);
} else {
aa.set(ab, 'max-height', gb + 'px');
aa.set(ab, 'height', null);
}
},
_getUfiItemAndTop: function(za, ab) {
var bb = (za && ha.getElementPosition(za).y) || 0,
cb = (ab && ha.getElementPosition(ab).y) || 0,
db = [za, bb + this.FLYOUT_ACTION_FOOTER_PADDING],
eb = [ab, cb];
return bb > cb ? db : eb;
},
_initObjectIDs: function() {
var za = this._getAllStories();
for (var ab = za.length - 1; ab >= 0; ab--) {
var bb = za[ab].getAttribute('data-story-key');
if (bb) {
this._objectIDs[bb] = true;
this._lastKStoriesInsert(za[ab]);
var cb = za[ab].getAttribute("data-dedupe-key");
if (cb) this._dedupeKeys[cb] = true;
}
}
},
_handleChatOpened: function() {
this._deactivateStory();
},
_handleChannelConnection: function() {
this._checkChannelConnection();
},
getNewest: function() {
return this._newest;
}
});
e.exports = ya;
}, null);
/*!CK:2110480670!*/ /*1438811695,*/
if (self.CavalryLogger) {
CavalryLogger.start_js(["de+3+"]);
}
__d("FullViewType", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = {
ENTIRE_UNIT: 1
};
}, null);
__d("EmuController", ["AsyncRequest", "DataStore", "URI", "emptyFunction", "ge", "goURI"], function(a, b, c, d, e, f, g, h, i, j, k, l) {
b.__markCompiled && b.__markCompiled();
function m(n, o) {
"use strict";
var p = k(n);
if (!p) return null;
this.impression = o;
this.containerId = n;
h.set(p, 'emuController', this);
return this;
}
m.prototype.event = function(n, o, p, q) {
"use strict";
var r = {
eid: this.impression,
f: 0,
ui: this.containerId,
en: n,
a: 1
};
if (o) r.ed = JSON.stringify(o);
if (!q) q = j;
var s = new g().setURI(this.EVENT_HANDLER_PATH).setData(r).setErrorHandler(q);
if (p) s.setHandler(p);
s.send();
};
m.prototype.redirect = function() {
"use strict";
var n = {
eid: this.impression,
f: 0,
ui: this.containerId,
en: this.CLICK,
a: 0,
sig: Math.floor(Math.random() * 65535) + 65536
},
o = new i(this.EVENT_HANDLER_PATH);
o.setQueryData(n);
l(o);
};
m.fromContainer = function(n) {
"use strict";
var o = k(n);
if (!o) return null;
return h.get(o, 'emuController');
};
m.getEventClass = function(n) {
"use strict";
return "emuEvent" + String(n).trim();
};
Object.assign(m.prototype, {
EVENT_HANDLER_PATH: '/ajax/emu/end.php',
CLICK: 1,
FAN: "fad_fan"
});
e.exports = m;
}, null);
__d("legacy:ad-units-base-js", ["EmuController"], function(a, b, c, d) {
b.__markCompiled && b.__markCompiled();
a.EmuController = b('EmuController');
}, 3);
__d("DesktopHscrollUnitEventConstants", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = {
HSCROLL_ITEM_INSERTED_EVENT: 'DesktopHScrollUnit/itemInserted',
HSCROLL_ITEM_SHOWN_EVENT: 'DesktopHScrollUnit/itemShown',
HSCROLL_ITEM_HIDE_EVENT: 'DesktopHScrollUnit/HideIndividualItem',
HSCROLL_ITEM_SCROLL_BEFORE_XOUT_EVENT: 'DesktopHScrollUnit/scrollItemBeforeXout',
HSCROLL_ITEM_UNHIDE_EVENT: 'DesktopHScrollUnit/unhideIndividualItem',
HSCROLL_LAST_ITEM_NFX_ACTION_TAKEN: 'logLastAdXout',
HSCROLL_PAGER_ITEM_HIDE_EVENT: 'onXoutIndividualItem'
};
}, null);
__d("BlueBarMinWidthWithJewel", ["BanzaiODS", "BlueBar", "DOMQuery", "DOMDimensions", "Event", "Locale", "Style", "UITinyViewportAction", "Vector", "CSS", "csx", "cx", "queryThenMutateDOM"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) {
b.__markCompiled && b.__markCompiled();
function t(u, v, w) {
if (u) {
if (w) {
m.set(u, 'height', '10000px');
} else m.set(u, 'height', v - 15 + 'px');
p.conditionClass(u, 'fixed_elem', !w);
}
}
f.init = function(u) {
var v = h.getNavRoot(),
w = i.scry(v, "._fmc")[0],
x = i.scry(document, "a._23nx")[0],
y = i.scry(document, "a._23ny")[0],
z = i.scry(document, "div._vox")[0],
aa = j.getViewportDimensions().height,
ba = j.getElementDimensions(v).height,
ca = false,
da = n.isTinyHeight(),
ea;
if (u && x && y) {
k.listen(x, 'click', function() {
p.removeClass(document.body, "_23nw");
p.hide(x);
g.bumpEntityKey('tinyview.bookmark', 'show.click');
});
k.listen(y, 'click', function() {
p.addClass(document.body, "_23nw");
p.show(x);
g.bumpEntityKey('tinyview.bookmark', 'hide.click');
});
}
t(z, aa - ba, da);
var fa = s.bind(null, function() {
var ga = j.getElementDimensions(v).width,
ha = j.getViewportDimensions().width;
aa = j.getViewportDimensions().height;
var ia = j.measureElementBox(v, 'width', true);
ca = n.isTinyWidth();
da = n.isTinyHeight();
var ja;
if (l.isRTL()) {
ja = -o.getElementPosition(v).x;
} else ja = 2 * o.getElementPosition(v).x + ga - ha;
var ka = ga - ja - ia;
if (ja > 0 && ka > 0) {
ea = ka + 'px';
} else ea = '';
}, function() {
m.set(w, 'width', ea);
if (u) {
p.conditionClass(document.body, "_23nw", ca);
if (x && y) {
if (ca) g.bumpEntityKey('tinyview.bookmark', 'icon.show');
p.conditionShow(x, ca);
p.conditionShow(y, ca);
}
}
t(z, aa - ba, da);
}, 'BlueBarMinWidthWithJewel');
k.listen(window, 'resize', fa);
fa();
};
}, null);
__d("BrowseClientEventLogger", ["Banzai"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
var h = 'browse_client_event_session',
i = '21.',
j = {
logData: function(event, k, l, m) {
if (!event || !k) return;
m = m || {};
m.event = event;
m.client_time = Math.floor(Date.now());
m.session_id = k;
m.vertical = l;
this.allData = this.allData || {};
this.processedSessions = this.processedSessions || [];
if (this.processedSessions.indexOf(k) !== -1) return;
if (!this.allData.sessionid) this.allData.sessionid = [];
this.allData.sessionid.push(m);
if (event === 'window_unloaded' || event === 'window_transition_to_LHC' || event === 'window_transition_to_home_click' || event === 'window_transition_to_fb_page') {
this._postBatch(this.allData.sessionid);
this.processedSessions.push(k);
}
},
logClick: function(k) {
k.event = 'click';
this.maybeLogVisiblityEvent(k, true);
},
maybeLogClientViewEvent: function(k) {
k.event = 'client_view';
this.maybeLogVisiblityEvent(k);
},
maybeLogVisiblityEvent: function(k, l) {
if (!k || !k.xt || k.xt.indexOf(i) !== 0) return;
var event = k.event,
m = JSON.parse(k.xt.substring(3));
if (l) m.click_type = k.click_type;
this.logData(event, m.session_id, m.vertical, m);
},
_postBatch: function(k) {
g.post(h, k, {
delay: 0,
retry: true
});
}
};
e.exports = j;
}, null);
__d("AdBlockerDetectorLogging", ["Banzai", "ErrorUtils", "getElementPosition"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
var j = {
doAdBlockCheck: function(k, l) {
h.applyWithGuard(function() {
this._doAdBlockImgCheck(k, l, 0);
}.bind(this), this);
},
_doAdBlockImgCheck: function(k, l, m) {
if (!l || !k) return;
var n = k.querySelectorAll('img');
if (n.length > 0) {
var o = false;
for (var p = 0; p < n.length; p++) {
var q = n[p],
r = i(q);
if (r.width > 0 || r.height > 0) {
o = true;
break;
}
}
if (!o) {
var s = k,
t = 0;
while (s !== null) {
if (t++ > 50) break;
if (s.classList.contains('hidden_elem') || s.classList.contains('holdoutAdStory') || s.classList.contains('ego_ads_holdout')) return;
s = s.parentElement;
}
g.post('xtrackable:blocked_ad_view', {
token: l
});
}
} else if (n.length === 0 && l.startsWith('7.'))
if (++m < 5) setTimeout((function() {
this._doAdBlockImgCheck(k, l, m);
}.bind(this)).bind(this), 2500);
}
};
e.exports = j;
}, null);
__d("Visibility", ["mixInEventEmitter"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
var h, i;
if (typeof document.hidden !== 'undefined') {
h = 'hidden';
i = 'visibilitychange';
} else if (typeof document.mozHidden !== 'undefined') {
h = 'mozHidden';
i = 'mozvisibilitychange';
} else if (typeof document.msHidden !== 'undefined') {
h = 'msHidden';
i = 'msvisibilitychange';
} else if (typeof document.webkitHidden !== 'undefined') {
h = 'webkitHidden';
i = 'webkitvisibilitychange';
}
function j() {
return h ? document[h] : false;
}
var k = {
HIDDEN: 'hidden',
VISIBLE: 'visible',
isHidden: j
};
g(k, {
visible: true,
hidden: true
});
if (document.addEventListener && i) document.addEventListener(i, function l() {
k.emit(j() ? k.HIDDEN : k.VISIBLE);
});
e.exports = k;
}, null);
__d("FullViewLogger", ["Banzai", "SubscriptionsHandler", "URI"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
function j() {
"use strict";
}
j.logFromViewableImpressionTracker = function(k) {
"use strict";
var l = new j();
l.subscribeToTrackerEvents(k);
};
j.prototype.subscribeToTrackerEvents = function(k) {
"use strict";
this.subscriptionsHandler = new h();
this.subscriptionsHandler.addSubscriptions(k.addListener('full_view', this.onFullView, this));
};
j.prototype.onFullView = function(k) {
"use strict";
if (this.$FullViewLogger0()) this.$FullViewLogger1(k);
var l = {
token: k.token,
fullViewType: k.fullViewType
};
g.post('xtrackable:full_view', l);
if (this.$FullViewLogger0()) this.$FullViewLogger2(l);
};
j.prototype.$FullViewLogger0 = function() {
"use strict";
return 0;
};
j.prototype.$FullViewLogger1 = function(k) {
"use strict";
};
j.prototype.$FullViewLogger2 = function(k) {
"use strict";
};
e.exports = j;
}, null);
__d("ViewableImpressionHeatmapLogger", ["Banzai"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
h.logFromViewableImpressionTracker = function(i, j) {
"use strict";
var k = new h(j);
k.subscribeToTrackerEvents(i);
};
function h(i) {
"use strict";
this.loggingDurationMS = i;
this.trackingEntries = {};
}
h.prototype.subscribeToTrackerEvents = function(i) {
"use strict";
this.visibleSubscription = i.addListener('visible', this.onElementVisible, this);
this.hiddenSubscription = i.addListener('hidden', this.onElementHidden, this);
};
h.prototype.onElementVisible = function(i) {
"use strict";
var j = this.getCurrentTimestamp(),
k = this.trackingEntries[i.id];
if (!k) {
k = this.createTrackingEntry(i);
this.beginTracking(i.id, k);
j = k.startedTrackingTS;
}
k.viewportProgressEvents.push({
timestamp: j,
percentInViewport: i.percentInViewport.toFixed(2)
});
};
h.prototype.onElementHidden = function(i) {
"use strict";
var j = this.getCurrentTimestamp(),
k = this.trackingEntries[i.id];
if (!k) return;
k.viewportProgressEvents.push({
timestamp: j,
percentInViewport: 0
});
};
h.prototype.onTrackingCompleted = function(i) {
"use strict";
var j = this.trackingEntries[i];
j.viewportProgressEvents.push({
timestamp: this.getCurrentTimestamp(),
percentInViewport: j.tracker.getPercentInViewport().toFixed(2)
});
if (this.$ViewableImpressionHeatmapLogger0()) this.$ViewableImpressionHeatmapLogger1(i, j);
this.logToServer(j);
delete this.trackingEntries[i];
};
h.prototype.logToServer = function(i) {
"use strict";
var j = i;
delete j.tracker;
g.post('xtrackable:heatmap', j);
};
h.prototype.beginTracking = function(i, j) {
"use strict";
this.trackingEntries[i] = j;
setTimeout(function() {
return this.onTrackingCompleted(i);
}.bind(this), this.loggingDurationMS);
};
h.prototype.createTrackingEntry = function(i) {
"use strict";
return {
tracker: i.tracker,
token: i.token,
startedTrackingTS: this.getCurrentTimestamp(),
viewportProgressEvents: []
};
};
h.prototype.getCurrentTimestamp = function() {
"use strict";
return (Date.now() / 1000).toFixed(2);
};
h.prototype.$ViewableImpressionHeatmapLogger0 = function() {
"use strict";
return 0;
};
h.prototype.$ViewableImpressionHeatmapLogger1 = function(i, j) {
"use strict";
var k = 'Completed tracking for id ' + i + ' token=' + j.token + ' startedTrackingTS=' + j.startedTrackingTS + '\n';
j.viewportProgressEvents.forEach(function(l) {
k += '% in view: ' + l.percentInViewport + ' timestamp=' + l.timestamp + '\n';
});
};
e.exports = h;
}, null);
__d("ViewableImpressionUtils", ["CSS", "cx"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
var i = {
isHorizontallyOffscreen: function(j, k, l) {
var m = Math.max(k.x, 0),
n = Math.min(k.x + k.width, l.width);
return ((n - m) < k.width || g.hasClass(j, "desktop_hscroll_offscreen"));
}
};
e.exports = i;
}, null);
__d("ViewableImpressionTracker", ["Banzai", "BrowseClientEventLogger", "DOM", "FullViewType", "getElementPosition", "getViewportDimensions", "mixInEventEmitter", "Style", "URI", "ViewableImpressionUtils"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
b.__markCompiled && b.__markCompiled();
function q(r, s, t) {
"use strict";
this.id = r;
this.element = s;
this.config = t;
this.iframe = null;
this.viewableTimeout = null;
this.clearSubsequentTimeout = null;
this.waitForSubsequent = false;
this.waitForLogged = false;
this.isNonViewableLogged = false;
this.isVisible = false;
this.banzaiLogged = false;
}
q.prototype.getID = function() {
"use strict";
return this.id;
};
q.prototype.getPercentInViewport = function() {
"use strict";
var r = l(),
s = k(this.element);
return this.$ViewableImpressionTracker0(r, s);
};
q.prototype.$ViewableImpressionTracker0 = function(r, s) {
"use strict";
if (s.x < r.width && s.x + s.width > 0 && s.y < r.height && s.y + s.height > 0 && n.get(this.element, 'visibility') !== 'hidden' && n.get(this.element, 'opacity') !== '0') {
var t = Math.max(s.x, 0),
u = Math.min(s.x + s.width, r.width),
v = Math.max(s.y, 0),
w = Math.min(s.y + s.height, r.height);
if ((s.height * s.width) === 0) return 100;
if (this.config.require_horizontally_onscreen && p.isHorizontallyOffscreen(this.element, s, r)) return 0;
var x = 100 * (u - t) * (w - v) / (s.height * s.width);
return x;
}
return 0;
};
q.prototype.$ViewableImpressionTracker1 = function(r, s) {
"use strict";
if (n.get(this.element, 'visibility') === 'hidden' || n.get(this.element, 'opacity') === '0') return false;
var t = s.x + s.width,
u = s.y + s.height;
return t >= 0 && t <= r.width && u >= 0 && u <= r.height;
};
q.prototype.$ViewableImpressionTracker2 = function(r, s) {
"use strict";
if (this.hasEmittedFullViewEvent) return;
if (this.$ViewableImpressionTracker1(r, s)) {
this.emit('full_view', {
tracker: this,
id: this.getID(),
token: this.getToken(),
fullViewType: j.ENTIRE_UNIT
});
this.hasEmittedFullViewEvent = true;
}
};
q.prototype.onVisible = function() {
"use strict";
this.isVisible = true;
var r = l(),
s = k(this.element),
t = this.$ViewableImpressionTracker0(r, s),
u = t > this.config.pixel_in_percentage;
this.emit('visible', {
tracker: this,
id: this.getID(),
token: this.getToken(),
percentInViewport: t
});
this.$ViewableImpressionTracker2(r, s);
if (!u) {
this.$ViewableImpressionTracker3();
return;
}
if (this.isLogged()) {
this.$ViewableImpressionTracker4();
} else this.$ViewableImpressionTracker5();
if (!this.waitForLogged && !this.isLogged()) {
this.waitForLogged = true;
this.viewableTimeout = setTimeout(function() {
this.waitForLogged = false;
var v = this.getPercentInViewport(),
w = v > this.config.pixel_in_percentage;
if (!w) {
this.$ViewableImpressionTracker6();
return;
}
this.logImpression(1, {});
this.$ViewableImpressionTracker4();
}.bind(this), this.config.duration_in_ms);
}
};
q.prototype.onHidden = function() {
"use strict";
this.emit('hidden', {
id: this.getID(),
token: this.getToken()
});
if (this.config.log_initial_nonviewable && !this.isLogged() && !this.isNonViewableLogged) {
this.logNonViewableImpression();
} else if (!this.config.log_initial_nonviewable && !this.isLogged() && this.isVisible) this.logNonViewableImpression();
this.isVisible = false;
if (this.waitForLogged) {
this.waitForLogged = false;
clearTimeout(this.viewableTimeout);
}
if (this.isLogged() && !this.waitForSubsequent && this.config.subsequent_gap_in_ms >= 0) {
this.waitForSubsequent = true;
this.clearSubsequentTimeout = setTimeout(function() {
this.waitForSubsequent = false;
this.reset();
if (this.isVisible) this.onVisible();
}.bind(this), this.config.subsequent_gap_in_ms);
}
this.$ViewableImpressionTracker6();
};
q.prototype.onRemoved = function() {
"use strict";
this.isVisible = false;
};
q.prototype.getToken = function() {
"use strict";
return this.element.getAttribute('data-xt');
};
q.prototype.logImpression = function(r, s) {
"use strict";
if (this.isLogged()) return;
var t = this.getToken(),
u = Math.floor(Date.now() / 1000),
v = {
xt: t,
isv: r,
cts: u
};
if (g.isEnabled('xtrackable_clientview_batch') && this.config.should_batch) {
this.logWithBanzai(v);
} else this.logWithIFrame(Object.assign(v, s));
};
q.prototype.logNonViewableImpression = function() {
"use strict";
if (this.config.nonviewableEnabled) {
var r = this.getToken();
g.post('xtrackable:nonviewable', {
xt: r
});
}
this.isNonViewableLogged = true;
};
q.prototype.isLogged = function() {
"use strict";
return this.iframe !== null || this.banzaiLogged;
};
q.prototype.reset = function() {
"use strict";
if (this.iframe) {
i.remove(this.iframe);
this.iframe = null;
}
if (this.banzaiLogged) this.banzaiLogged = false;
this.isNonViewableLogged = false;
this.isVisible = false;
this.waitForLogged = false;
this.waitForSubsequent = false;
};
q.prototype.logWithBanzai = function(r) {
"use strict";
this.banzaiLogged = true;
h.maybeLogClientViewEvent(r);
g.post('xtrackable:clientview_batch', r);
};
q.prototype.logWithIFrame = function(r) {
"use strict";
this.iframe = i.create('iframe', {
src: new o(this.config.impressionURL).addQueryData(r),
width: 0,
height: 0,
frameborder: 0,
scrolling: 'no',
className: 'fbEmuTracking'
});
this.iframe.setAttribute('aria-hidden', 'true');
i.appendContent(this.element, this.iframe);
};
q.prototype.$ViewableImpressionTracker7 = function() {
"use strict";
return 0;
};
q.prototype.$ViewableImpressionTracker3 = function() {
"use strict";
if (this.$ViewableImpressionTracker7()) {
n.set(this.element, 'background-color', '#abab9a');
n.set(this.element, 'outline', '3px solid #abab9a');
}
};
q.prototype.$ViewableImpressionTracker5 = function() {
"use strict";
if (this.$ViewableImpressionTracker7()) {
n.set(this.element, 'background-color', '#e4f70a');
n.set(this.element, 'outline', '3px solid #e4f70a');
}
};
q.prototype.$ViewableImpressionTracker6 = function() {
"use strict";
if (this.$ViewableImpressionTracker7()) {
n.set(this.element, 'background-color', null);
n.set(this.element, 'outline', null);
}
};
q.prototype.$ViewableImpressionTracker4 = function() {
"use strict";
if (this.$ViewableImpressionTracker7()) {
n.set(this.element, 'background-color', '#047515');
n.set(this.element, 'outline', '3px solid #047515');
}
};
m(q, {
visible: true,
hidden: true,
full_view: true
});
e.exports = q;
}, null);
__d("VisibilityTrackingHelper", ["Arbiter", "DesktopHscrollUnitEventConstants", "getViewportDimensions", "Event"], function(a, b, c, d, e, f, g, h, i, j) {
b.__markCompiled && b.__markCompiled();
var k = {
getEventListeners: function(l) {
return [j.listen(document, 'DOMContentLoaded', l), j.listen(window, 'scroll', l), j.listen(window, 'resize', l), g.subscribe(h.HSCROLL_ITEM_SHOWN_EVENT, l)];
},
getViewportInfo: function() {
return i();
}
};
e.exports = k;
}, null);
__d("VisibilityTracking", ["Banzai", "BrowseClientEventLogger", "ErrorUtils", "ScriptPath", "SubscriptionsHandler", "Visibility", "VisibilityTrackingHelper", "collectDataAttributes", "getElementPosition", "pageID", "throttle"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) {
b.__markCompiled && b.__markCompiled();
var r = 'visibility_tracking',
s = '[data-vistracking]',
t = 500,
u = 50,
v = 50,
w = 50,
x = 50,
y = {
VISIBLE: 'visible',
HIDDEN: 'hidden'
},
z = {
DEFAULT: 'default',
REMOVED: 'removed'
},
aa = {
name: y.VISIBLE,
cause: z.DEFAULT
},
ba = {
name: y.HIDDEN,
cause: z.DEFAULT
},
ca = {
name: y.HIDDEN,
cause: z.REMOVED
},
da = 0;
function ea(fa) {
"use strict";
fa = fa || {};
if (!fa.bypass_banzai_check && !g.isEnabled(r)) return;
this.visibleElementInfo = {};
this.getDataFromConfig(fa);
l.addListener(l.VISIBLE, i.guard(this.fireEvent, 'VisibilityTracking:visible', this));
if (!this.skipVisibilityHiddenEvents) l.addListener(l.HIDDEN, i.guard(this.clearAllVisibleElements, 'VisibilityTracking:hidden', this));
j.subscribe(i.guard(this.updateVisibleElements, 'VisibilityTracking:scriptPath', this));
g.subscribe(g.SHUTDOWN, i.guard(this.onUnload, 'VisibilityTracking:banzaiShutdown', this));
this.fireEventCallback = q.acrossTransitions(i.guard(this.fireEvent, 'VisibilityTracking:fireEventCallback', this), this.timeout, this);
this.listeners = new k();
m.getEventListeners(this.fireEventCallback).forEach(function(ga) {
this.listeners.addSubscriptions(ga);
}, this);
if (this.extraInit) i.applyWithGuard(this.extraInit.bind(this));
}
ea.prototype.getDataFromConfig = function(fa) {
"use strict";
this.config = fa;
this.root = fa.root || document.documentElement;
this.selector = fa.selector || s;
this.timeout = (typeof fa.timeout !== 'undefined') ? fa.timeout : t;
this.minOffsetVisibleFromBottom = (typeof fa.minOffsetVisibleFromBottom !== 'undefined') ? fa.minOffsetVisibleFromBottom : u;
this.minOffsetVisibleFromTop = (typeof fa.minOffsetVisibleFromTop !== 'undefined') ? fa.minOffsetVisibleFromTop : v;
this.minOffsetVisibleFromLeft = (typeof fa.minOffsetVisibleFromLeft !== 'undefined') ? fa.minOffsetVisibleFromLeft : w;
this.minOffsetVisibleFromRight = (typeof fa.minOffsetVisibleFromRight !== 'undefined') ? fa.minOffsetVisibleFromRight : x;
this.handleAllHiddenEvents = (typeof fa.handleAllHiddenEvents !== 'undefined') ? fa.handleAllHiddenEvents : false;
this.handleAllVisibleEvents = (typeof fa.handleAllVisibleEvents !== 'undefined') ? fa.handleAllVisibleEvents : false;
this.skipVisibilityHiddenEvents = (typeof fa.skipVisibilityHiddenEvents !== 'undefined') ? fa.skipVisibilityHiddenEvents : false;
this.cacheTrackedElements = (typeof fa.cacheTrackedElements !== 'undefined') ? fa.cacheTrackedElements : false;
};
ea.prototype.getAllTrackedElements = function() {
"use strict";
if (!this.allTrackedElements) {
this.allTrackedElements = {};
if (this.root.querySelectorAll) {
var fa = this.root.querySelectorAll(this.selector);
for (var ga = 0; ga < fa.length; ga++) {
var ha = this.getElementID(fa[ga]);
this.allTrackedElements[ha] = fa[ga];
}
}
}
return this.allTrackedElements;
};
ea.prototype.refreshAllTrackedElements = function() {
"use strict";
delete this.allTrackedElements;
return this.getAllTrackedElements();
};
ea.prototype.getDataToLog = function(fa) {
"use strict";
var ga = Object.assign(n(fa, ['gt']).gt, {
client_time: Date.now() / 1000,
time_spent_id: p,
script_path: j.getScriptPath()
});
return ga;
};
ea.prototype.getElementID = function(fa) {
"use strict";
var ga = fa.$VisibilityTracking0;
if (ga) return ga;
fa.$VisibilityTracking0 = ++da;
return da;
};
ea.prototype.sendDataToLog = function(fa) {
"use strict";
h.maybeLogVisiblityEvent(fa);
g.post(r, fa);
};
ea.prototype.fireEvent = function() {
"use strict";
var fa = this.cacheTrackedElements ? this.allTrackedElements : this.refreshAllTrackedElements();
for (var ga in fa) {
var ha = fa[ga],
ia = m.getViewportInfo(),
ja = this.isVisible(ha, ia);
if (!ja && (ga in this.visibleElementInfo || this.handleAllHiddenEvents)) {
this.handleEvent(ha, ba);
} else if (ja && (!(ga in this.visibleElementInfo) || this.handleAllVisibleEvents)) this.handleEvent(ha, aa);
}
this.clearUntrackedVisibleElements();
};
ea.prototype.isVisible = function(fa, ga) {
"use strict";
var ha = o(fa);
return (ha.x || ha.y || ha.width || ha.height) && (ha.y + ha.height >= this.minOffsetVisibleFromTop) && (ha.y <= ga.height - this.minOffsetVisibleFromBottom) && (ha.x + ha.width >= this.minOffsetVisibleFromLeft) && (ha.x <= ga.width - this.minOffsetVisibleFromRight);
};
ea.prototype.handleEvent = function(fa, event) {
"use strict";
var ga = this.getElementID(fa),
ha = this.getDataToLog(fa),
ia;
if (event.name === y.VISIBLE) {
var ja = Math.floor(Date.now() / 1000);
ia = p.concat(":", ja.toString(), ":", this.getElementID(fa).toString());
this.visibleElementInfo[ga] = {
visibility_id: ia,
elem: fa
};
} else if (event.name === y.HIDDEN)
if (ga in this.visibleElementInfo) {
ia = this.visibleElementInfo[ga].visibility_id;
delete this.visibleElementInfo[ga];
}
this.sendDataToLog(Object.assign(ha, {
event: event.name,
visibility_id: ia
}));
};
ea.prototype.clearUntrackedVisibleElements = function() {
"use strict";
var fa = this.getAllTrackedElements();
for (var ga in this.visibleElementInfo)
if (!(ga in fa)) {
var ha = this.visibleElementInfo[ga];
if (ha.elem) this.handleEvent(ha.elem, ca);
}
};
ea.prototype.clearAllVisibleElements = function() {
"use strict";
var fa = this.getAllTrackedElements();
for (var ga in fa)
if (ga in this.visibleElementInfo) this.handleEvent(fa[ga], ba);
this.clearUntrackedVisibleElements();
};
ea.prototype.updateVisibleElements = function() {
"use strict";
this.clearAllVisibleElements();
this.fireEvent();
};
ea.prototype.refreshAndFireEvent = function() {
"use strict";
this.refreshAllTrackedElements();
this.fireEventCallback();
};
ea.prototype.onUnload = function() {
"use strict";
this.clearAllVisibleElements();
if (this.listeners) {
this.listeners.release();
this.listeners = null;
}
if (this.extraCleanup) i.applyWithGuard(this.extraCleanup.bind(this));
};
ea.init = function(fa) {
"use strict";
new ea(fa);
};
ea.EVENT = y;
ea.CAUSE = z;
e.exports = ea;
}, null);
__d("ViewableImpressionEventHandler", ["FullViewLogger", "ViewableImpressionHeatmapLogger", "ViewableImpressionTracker", "VisibilityTracking"], function(a, b, c, d, e, f, g, h, i, j) {
b.__markCompiled && b.__markCompiled();
var k = 1;
for (var l in j)
if (j.hasOwnProperty(l)) n[l] = j[l];
var m = j === null ? null : j.prototype;
n.prototype = Object.create(m);
n.prototype.constructor = n;
n.__superConstructor__ = j;
function n() {
"use strict";
if (j !== null) j.apply(this, arguments);
}
n.prototype.extraInit = function() {
"use strict";
this.impressionTrackers = {};
};
n.prototype.getDataFromConfig = function(o) {
"use strict";
m.getDataFromConfig.call(this, o);
this.doHeatmapLogging = o.doHeatmapLogging;
this.heatmapLoggingDurationMS = o.heatmapLoggingDurationMS;
o.impressionURL = (o.impressionURL !== (void 0)) ? o.impressionURL : '/xti.php';
o.nonviewableEnabled = (o.nonviewableEnabled !== (void 0)) ? o.nonviewableEnabled : false;
};
n.prototype.getImpressionTracking = function(o) {
"use strict";
var p = this.getElementID(o),
q = Object.assign({}, this.getConfigFromElement(o), this.config),
r = this.impressionTrackers[p];
if (!r) {
r = new i(p, o, q);
this.impressionTrackers[p] = r;
if (this.doHeatmapLogging) h.logFromViewableImpressionTracker(r, this.heatmapLoggingDurationMS);
if (q.should_log_full_views) g.logFromViewableImpressionTracker(r);
}
return r;
};
n.prototype.handleEvent = function(o, event) {
"use strict";
var p = this.getImpressionTracking(o);
if (!p) return;
if (event.name === j.EVENT.VISIBLE) {
p.onVisible();
if (!this.visibleElementInfo[p.getID()]) this.visibleElementInfo[p.getID()] = {
elem: o
};
} else if (event.name === j.EVENT.HIDDEN)
if (event.cause === j.CAUSE.DEFAULT) {
p.onHidden();
delete this.visibleElementInfo[p.getID()];
} else if (event.cause === j.CAUSE.REMOVED) {
p.onRemoved();
delete this.visibleElementInfo[p.getID()];
delete this.impressionTrackers[p.getID()];
}
};
n.prototype.getConfigFromElement = function(o) {
"use strict";
return JSON.parse(o.getAttribute('data-xt-vimp'));
};
n.prototype.getElementID = function(o) {
"use strict";
if (!o.getAttribute('id')) o.setAttribute('id', 'xt_uniq_' + k++);
return o.getAttribute('id');
};
e.exports = n;
}, null);
__d("legacy:async-signal", ["AsyncSignal"], function(a, b, c, d) {
b.__markCompiled && b.__markCompiled();
a.AsyncSignal = b('AsyncSignal');
}, 3);
__d("ViewableImpressionTracking", ["Arbiter", "DesktopHscrollUnitEventConstants", "ErrorUtils", "LitestandMessages", "Run", "ViewableImpressionEventHandler", "ViewableImpressionConfig"], function(a, b, c, d, e, f, g, h, i, j, k, l, m) {
b.__markCompiled && b.__markCompiled();
var n = {
init: function() {
if (l.instance === (void 0)) {
l.instance = new l(m);
l.instance.listeners.addSubscriptions(g.subscribe([j.STORIES_INSERTED, 'AdsRefreshHandler/AdsLoaded', 'MPPInsights/ChartView', 'PhotoSnowliftAds/displayUnits', 'WebMessengerAdsControl/adjustAds', h.HSCROLL_ITEM_INSERTED_EVENT], i.guard(function() {
l.instance.refreshAndFireEvent();
}, 'ViewableImpressionTracking')));
}
k.onLoad(function() {
l.instance.refreshAndFireEvent();
});
}
};
e.exports = n;
}, null);
__d("MercuryLeftNav", ["Arbiter", "MessagingTag", "NavigationMessage", "MercuryThreadInformer", "MercuryUnreadState"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
var j = b('MercuryThreadInformer').get(),
k = b('MercuryUnreadState').get(),
l = false;
function m() {
var o = k.getUnreadCount(h.INBOX);
g.inform(i.NAVIGATION_COUNT_UPDATE, {
key: 'inbox',
hide: true
});
g.inform(i.NAVIGATION_COUNT_UPDATE, {
key: 'inbox',
count: o
});
}
var n = {
bootstrap: function() {
if (l) return;
j.subscribe('unread-updated', m);
l = true;
}
};
e.exports = n;
}, null);
__d("EgoUnitSlideInsert", ["Animation", "CSS", "DataStore", "DOM", "Ease", "Event", "Parent", "TidyArbiterMixin", "cx", "tidyEvent"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
b.__markCompiled && b.__markCompiled();
var q = 'sliding',
r = "EgoSlider/End",
s = Object.assign({
isSliding: function(t) {
return i.get(t, q);
},
runAfterSlide: function(t, u) {
var v = p(s.subscribe(r, function(w, x) {
if (x === t) {
v && v.unsubscribe();
u();
}
}));
},
registerSlide: function(t, u) {
l.listen(t, 'click', function(v) {
var w = m.byClass(v.getTarget(), "_5cl_");
if (!w) return;
var x = m.byClass(t, 'ego_unit'),
y = 0,
z = m.byClass(x, 'ego_unit_container'),
aa = j.scry(z, '.ego_unit')[0];
if (aa === x)
if (x.nextSibling) {
x.nextSibling.style.paddingTop = '0px';
x.nextSibling.style.borderTop = '0px';
}
h.addClass(x, "_5cl-");
i.set(x, q, true);
new g(x).to('height', 0).to('padding-top', y).to('padding-bottom', 0).to('margin', 0).from('opacity', 1).to('opacity', 0).ease(k.circOut).duration(300).checkpoint(1, function() {
j.appendContent(z, x);
j.prependContent(x, u);
i.remove(x, q);
}).to('height', 12).to('opacity', 1).to('margin-bottom', 10).duration(0).checkpoint(2, function() {
s.inform(r, x);
}).go();
});
}
}, n);
e.exports = s;
}, null);
__d("NetEgo", ["Animation", "Arbiter", "csx", "CSS", "DOM", "EgoUnitSlideInsert", "PageLikeConstants", "Parent", "URI", "ge"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
b.__markCompiled && b.__markCompiled();
var q = {
setup: function(r) {
h.subscribe([m.LIKED, 'FriendRequest/sending'], function(s, t) {
if ((r == t.profile_id && t.origin == 'hovercard') || r == t.uid) {
var u = p(document.body, '.ego_unit_container');
if (u) {
var v = k.scry(u, '.ego_unit'),
w = v.length;
for (var x = 0; x < w; x++) {
var y = v[x].getAttribute('data-ego-fbid');
if (y == r) {
var z = k.scry(v[x], '.ego_action a')[0];
if (z) z.click();
break;
}
}
}
}
});
},
updateXids: function(r, s, t) {
if (r.length == 0 && s.length == 0) return;
var u = function(ea) {
return function(fa) {
var ga = fa.getAttribute(ea);
if (!ga) return false;
var ha = new o(ga).getQueryData();
return !!ha.xids;
};
},
v = k.scry(document.body, '.ego_section a');
v = v.filter(u('ajaxify'));
if (v.length == 0) return;
var w = new o(v[0].getAttribute('ajaxify')),
x = w.getQueryData();
if (!x.xids) return;
var y = null;
try {
y = JSON.parse(x.xids);
} catch (z) {
return;
}
if (t)
for (var aa = 0; aa < r.length; ++aa) delete y[r[aa]];
for (aa = 0; aa < s.length; ++aa) y[s[aa]] = 1;
var ba = JSON.stringify(y),
ca = function(ea, fa) {
w = new o(ea.getAttribute(fa));
x = w.getQueryData();
x.xids = ba;
w.setQueryData(x);
ea.setAttribute(fa, w.toString());
};
for (aa = 0; aa < v.length; ++aa) ca(v[aa], 'ajaxify');
var da = k.scry(document.body, '.ego_unit form');
da = da.filter(u('action'));
for (aa = 0; aa < da.length; ++aa) ca(da[aa], 'action');
},
replaceUnit: function(r, s, t, u) {
q.replaceUnitCheckParent(r, s, t, u, '');
},
addUnitsWithSeeMore: function(r, s, t) {
if (!t) j.hide(r);
var u = r.previousSibling;
u && s && k.appendContent(u, s);
},
replaceUnitCheckParent: function(r, s, t, u, v) {
var w = n.byClass(r, 'ego_unit_container');
if (w && l.isSliding(r)) {
var x = k.appendContent(w, s);
x.forEach(j.hide);
l.runAfterSlide(r, q._replaceUnitElement.bind(null, r, x, v));
} else q._replaceUnit(r, s, t, u, v);
},
_replaceUnit: function(r, s, t, u, v) {
var w = k.insertAfter(r, s);
w.forEach(j.hide);
if (u !== (void 0) && u !== null) {
setTimeout(function() {
q._replaceUnitFadeout(r, w, t, v);
}, u);
} else q._replaceUnitFadeout(r, w, t, v);
},
_replaceUnitFadeout: function(r, s, t, u) {
if (t) {
new g(r).from('opacity', 1).to('opacity', 0).duration(t).checkpoint(1, function() {
q._replaceUnitElement(r, s, u);
}).go();
} else q._replaceUnitElement(r, s, u);
},
_replaceUnitElement: function(r, s, t) {
var u = j.hasClass(r, 'ego_unit') ? r.parentNode : null;
if (u && u.tagName === 'LI') u = k.scry(r.parentNode, '^ul')[0];
k.remove(r);
if (s.length) s.forEach(j.show);
h.inform('netego_replacedUnit', {
serializedData: t,
numUnitsRemained: u.childNodes.length
});
q.clearHeader();
},
clearHeader: function() {
var r = k.scry(document.body, '.ego_column'),
s = [];
for (var t = 0; t < r.length; ++t) s = s.concat(k.scry(r[t], '.uiHeader'));
for (t = 0; t < s.length; ++t) {
var u = s[t].nextSibling,
v = k.find(u, "._2xq");
if (!v) v = u;
if (!v || v.childNodes.length === 0) {
k.remove(s[t]);
} else if (v.childNodes.length === 1) {
var w = v.childNodes[0];
if (j.hasClass(w, 'ego_appended_units') && w.childNodes.length === 0) k.remove(s[t]);
}
}
}
};
e.exports = q;
}, null);
/*!CK:32568979!*/ /*1438875852,*/
if (self.CavalryLogger) {
CavalryLogger.start_js(["4++FI"]);
}
__d("CctaTestIDs", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = {
CCTA_VIEWER_UNIT_TESTID: "ccta_viewer_unit_testid",
CCTA_TYPE_SELECTOR_TESTID: "ccta_type_selector_testid",
CCTA_TYPE_SELECTOR_OPTION_TESTID_PREFIX: "ccta_type_selector_option_testid_",
CCTA_CANCEL_BUTTON_TESTID: "ccta_cancel_button_testid",
CCTA_SAVE_BUTTON_TESTID: "ccta_save_button_testid",
CCTA_WEB_URI_TESTID: "ccta_web_uri_testid",
CCTA_EDIT_MENU_TESTID: "ccta_edit_menu_testid",
CCTA_SWITCH_TO_APP_BUTTON_TESTID: "ccta_switch_to_app_button_testid",
CCTA_ANDROID_APPS_DROPDOWN_TESTID: "ccta_android_apps_dropdown_testid",
CCTA_ANDROID_APPS_DROPDOWN_WEBSITE_OPTION_TESTID: "ccta_android_apps_dropdown_website_option_testid",
CCTA_ANDROID_APPS_DROPDOWN_APP_OPTION_TESTID: "ccta_android_apps_dropdown_app_option_testid"
};
}, null);
__d("CustomCallToActionConstants", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = {
WEB: "CUSTOM_CTA_PLATFORM_WEB",
IOS: "CUSTOM_CTA_PLATFORM_IOS",
ANDROID: "CUSTOM_CTA_PLATFORM_ANDROID",
PRIMARY_LINK: "customCTAEditPrimaryLink",
PRIMARY_LINK_TYPE: "customCTAEditPrimaryLinkType",
FALLBACK_LINK_TYPE: "customCTAEditFallbackLinkType",
FALLBACK_LINK: "customCTAEditFallbackLink",
APP_ID: "appID",
COVER_PHOTO_SURFACE: "coverPhoto",
HOVER_CARD_SURFACE: "hoverCard",
PAGE_PLUGIN_SURFACE: "pagePlugin",
ADMIN_MENU_TEST_LINK: "adminMenuTestLink",
SKIP_PROMOTION: "skip_promotion",
GK_OPENTABLE: "ccta_open_table",
GK_BYPASS: "pages_custom_cta_bypass",
GK_PID: "pages_custom_cta_pid_2",
GK_UID: "pages_custom_cta_uid",
GK_CONTEXTUAL_ROW_UID: "pages_custom_cta_contextual_row_uid",
GK_CONTEXTUAL_ROW_ADMIN_UID: "pages_custom_cta_contextual_row_admin_uid",
GK_FOLLOW_BUTTON_IN_LIKE_DROPDOWN: "pages_follow_button_in_like_dropdown",
GK_HOVER_CARD: "custom_cta_hover_card_uid",
GK_SHOW_IN_SPRINGBOARD_UID: "pages_custom_cta_show_in_springboard_uid",
GK_ADMIN_UID: "custom_cta_admin_uid",
GK_PROMOTION_ADMIN_UID: "custom_cta_promotion_admin_uid_2",
GK_CUSTOM_CTA_CALLOUT: "custom_cta_callout",
GK_SHOW_VIEWER_UNIT_IN_LOGGED_OUT_VIEW: "custom_cta_show_viewer_unit_when_logged_out",
NECTAR_APP_NAME: "custom_cta",
GK_CCTA_NEW_DIALOG: "ccta_new_dialog",
GK_CCTA_CHARITY_DONATE: "ccta_donate_now",
GK_CCTA_MESSENGER: "ccta_messenger",
GK_CCTA_PROMOTION_DIALOG: "ccta_promotion_dialog",
OPEN_APP_ID: 1,
OPEN_WEBSITE_ID: 2,
TEST_ID_LANDING_PAGE_UNIT: "ccta_landing_page_unit"
};
}, null);
__d("PageCallToActionDestinationTypes", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = {
NONE: "NONE",
APP_DEEPLINK: "APP_DEEPLINK",
CALL_PAGE: "CALL_PAGE",
DONATE: "DONATE",
FACEBOOK_APP: "FACEBOOK_APP",
LEAD_GEN: "LEAD_GEN",
MESSENGER: "MESSENGER",
PHONE_CALL: "PHONE_CALL",
STORE_FRONT: "STORE_FRONT",
WEBSITE: "WEBSITE"
};
}, null);
__d("UFILazyActorSelector.react", ["BootloadedComponent.react", "JSResource", "React", "ActorSelectorPlaceholder.react"], function(a, b, c, d, e, f, g, h, i, j) {
b.__markCompiled && b.__markCompiled();
var k = i.createClass({
displayName: "UFILazyActorSelector",
getInitialState: function() {
return {
initialized: false
};
},
_onActivate: function(l) {
this.setState({
shouldFocus: l,
initialized: true
});
},
render: function() {
return this.state.initialized ? i.createElement(g, i.__spread({
bootloadPlaceholder: i.createElement(j, null),
bootloadLoader: h('UFIActorSelector.react'),
focusOnInit: this.state.shouldFocus
}, this.props)) : i.createElement(j, {
onActivate: this._onActivate
});
}
});
e.exports = k;
}, null);
__d("XUIDialogConfirmButton.react", ["React", "XUIDialogButton.react", "fbt"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
var j = g.createClass({
displayName: "XUIDialogConfirmButton",
render: function() {
return (g.createElement(h, g.__spread({}, this.props, {
action: "confirm",
label: i._("\u78ba\u8a8d")
})));
}
});
e.exports = j;
}, null);
__d("CustomCTAConstants", ["fbt", "CustomCallToActionConstants", "CustomCallToActionTypes"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
var i = b('CustomCallToActionTypes').TYPES,
j = {
NO_DIALOG: 'CUSTOM_CTA_DIALOG_NONE',
DELETE_DIALOG: 'CUSTOM_CTA_DIALOG_DELETE',
EDIT_DIALOG: 'CUSTOM_CTA_DIALOG_EDIT',
PROMOTE_DIALOG: 'CUSTOM_CTA_DIALOG_PROMOTE',
UPDATE_ALERT_DIALOG: 'CUSTOM_CTA_DIALOG_UPDATE_ALERT',
OPEN_APP_ID: "1",
OPEN_WEBSITE_ID: "2",
SHOW_FLYOUT: 'SHOW_FLYOUT',
CREATE_DIALOG_WIDTH: 778,
CREATE_DIALOG_HEIGHT: 504,
PREVIEW_WIDTH: 436,
PREVIEW_HEIGHT: 416,
NEW_PREVIEW_WIDTH: 412,
NEW_PREVIEW_HEIGHT: 346,
SELECTOR_WIDTH: 194,
URI_TRUNCATE_LENGTH: 30,
WEBSITE_BAR_ITEM: 'Website',
IPHONE_BAR_ITEM: 'iPhone',
ANDROID_BAR_ITEM: 'Android',
CREATE_CTA_TYPE_OPTIONS: [i.BOOK_NOW, i.CONTACT_US, i.OPEN_APP, i.PLAY_NOW, i.SHOP_NOW, i.SIGN_UP, i.WATCH_NOW],
PLATFORM_TYPE: 'CUSTOM_CTA_PLATFORM_TYPE',
WEB: h.WEB,
IOS: h.IOS,
ANDROID: h.ANDROID,
APP_ID: h.APP_ID,
FALLBACK_LINK_TYPE: h.FALLBACK_LINK_TYPE,
FALLBACK_LINK: h.FALLBACK_LINK,
PRIMARY_LINK: h.PRIMARY_LINK,
PRIMARY_LINK_TYPE: h.PRIMARY_LINK_TYPE,
FALLBACK_INSTALL_APP: 'fallback_install_app',
FALLBACK_GO_TO_WEBSITE: 'fallback_go_to_website',
API_URL: 'https://graph.facebook.com/',
INSIGHTS_LABEL: g._("\u67e5\u770b\u6d1e\u5bdf\u5831\u544a"),
EDIT_LABEL: g._("\u7de8\u8f2f\u884c\u52d5\u547c\u7c72"),
DELETE_LABEL: g._("\u522a\u9664\u884c\u52d5\u547c\u7c72"),
TEST_LABEL: g._("\u524d\u5f80\u9023\u7d50\u2026\u2026"),
PROMOTE_LABEL: g._("\u63a8\u5ee3"),
EDIT_PROMOTION_LABEL: g._("\u7de8\u8f2f\u63a8\u5ee3"),
DELETE_DIALOG_TITLE: g._("\u522a\u9664\u884c\u52d5\u547c\u7c72\u6309\u9215"),
DELETE_DIALOG_MESSAGE: g._("\u78ba\u5b9a\u8981\u5f9e Facebook \u7c89\u7d72\u5c08\u9801\u522a\u9664\u884c\u52d5\u547c\u7c72\u6309\u9215\u55ce\uff1f"),
DELETE_DURING_PROMOTION_DIALOG_TITLE: g._("\u9019\u500b\u8b8a\u66f4\u6703\u7d50\u675f\u5ee3\u544a"),
DELETE_DURING_PROMOTION_DIALOG_MESSAGE: g._("\u4f60\u76ee\u524d\u6b63\u5728\u63a8\u5ee3\u9019\u500b\u884c\u52d5\u547c\u7c72\uff0c\u4e00\u65e6\u522a\u9664\uff0c\u5ee3\u544a\u4e5f\u6703\u7d50\u675f\u520a\u767b\u3002"),
UPDATE_DURING_PROMOTION_DIALOG_TITLE: g._("\u9019\u500b\u8b8a\u66f4\u6703\u5f71\u97ff\u4f60\u7684\u5ee3\u544a"),
UPDATE_DURING_PROMOTION_DIALOG_MESSAGE: g._("\u5982\u679c\u4f60\u5f9e\u9019\u88e1\u66f4\u65b0\u884c\u52d5\u547c\u7c72\uff0c\u5247\u76ee\u524d\u520a\u767b\u4e2d\u7684\u5ee3\u544a\u4e5f\u6703\u96a8\u4e4b\u66f4\u65b0\uff0c\u800c\u4e14\u6703\u9700\u8981\u91cd\u65b0\u7d93\u904e\u5be9\u67e5\u3002"),
WEBSITE_LABEL: g._("\u7db2\u7ad9"),
IPHONE_LABEL: g._("iPhone"),
ANDROID_LABEL: g._("Android"),
CREATE_LABEL: g._("\u5efa\u7acb\u884c\u52d5\u547c\u7c72"),
CREATE_TOOLTIP: g._("\u65b0\u589e\u6309\u9215\uff0c\u8b93\u7528\u6236\u5f9e\u4f60\u7684\u7c89\u7d72\u5c08\u9801\u63a1\u53d6\u96c6\u5ba2\u529b\u884c\u52d5\uff08\u4f8b\u5982\u8cfc\u7269\u6216\u8a3b\u518a\uff09"),
CREATE_DIALOG_TITLE: g._("\u65b0\u589e\u884c\u52d5\u547c\u7c72\u6309\u9215"),
CREATE_DIALOG_BODY_MESSAGE: g._("\u65b0\u589e\u6309\u9215\u5230\u4f60\u7684\u7c89\u7d72\u5c08\u9801\uff0c\u5c07\u7528\u6236\u76f4\u63a5\u5e36\u5f80\u4f60\u7684\u61c9\u7528\u7a0b\u5f0f\u6216\u7db2\u7ad9\u3002"),
CREATE_DIALOG_BODY_MESSAGE_IOS: g._("\u9078\u64c7\u7528\u6236\u9ede\u6309 iPhone \u6216 iPad \u7684\u6309\u9215\u6642\u6703\u524d\u5f80\u7684\u9801\u9762\u3002"),
CREATE_DIALOG_APPLINK_MESSAGE_IOS: g._("\u65b0\u589e\u4f60\u61c9\u7528\u7a0b\u5f0f\u7684 iOS \u6df1\u5c64\u9023\u7d50\u7db2\u5740\u3002"),
CREATE_DIALOG_APPLINK_MESSAGE_ANDROID: g._("\u65b0\u589e\u4f60\u61c9\u7528\u7a0b\u5f0f\u7684 Android \u6df1\u5c64\u9023\u7d50\u7db2\u5740\u3002"),
CREATE_DIALOG_BACKUP_LINK_MESSAGE: g._("\u8f38\u5165\u8981\u5bc4\u7d66\u672a\u5b89\u88dd\u8a72\u61c9\u7528\u7a0b\u5f0f\u4e4b\u7528\u6236\u7684\u9023\u7d50\u3002\u5982\u679c\u4fdd\u7559\u7a7a\u767d\uff0c\u5c31\u6703\u958b\u555f\u5728\u5148\u524d\u756b\u9762\u4e2d\u8f38\u5165\u7684\u7db2\u7ad9\u3002"),
CREATE_DIALOG_BODY_MESSAGE_ANDROID: g._("\u9078\u64c7\u7528\u6236\u5728 Android \u4e0a\u9ede\u6309\u6309\u9215\u5f8c\u524d\u5f80\u7684\u7db2\u9801\u3002"),
EDIT_SECTION_MESSAGE: g._("\u4ee5\u4e0b\u662f\u7528\u6236\u9ede\u64ca\u6216\u9ede\u6309\u4f60\u7684\u884c\u52d5\u547c\u7c72\u6309\u9215\u4e4b\u5f8c\u524d\u5f80\u7684\u76ee\u6a19\u7db2\u7ad9\u8207\u61c9\u7528\u7a0b\u5f0f\u9023\u7d50\uff1a"),
EDIT_SECTION_EXAMPLE: g._("\u8209\u4f8b\u4f86\u8aaa\uff0c\u4f60\u53ef\u80fd\u6703\u5e0c\u671b\u8b93\u4f7f\u7528\u884c\u52d5\u88dd\u7f6e\u7684\u7528\u6236\u524d\u5f80\u4f60\u7684\u61c9\u7528\u7a0b\u5f0f\uff0c\u6216\u662f\u8b93\u4f7f\u7528\u684c\u4e0a\u578b\u96fb\u8166\u7684\u7528\u6236\u524d\u5f80\u4f60\u7684\u7db2\u7ad9\u3002"),
CREATE_DIALOG_PACKAGE_NAME_MESSAGE_ANDROID: g._("\u65b0\u589e\u61c9\u7528\u7a0b\u5f0f\u7684\u5957\u4ef6\u540d\u7a31"),
EDIT_SECTION_APP_LINK_HELP_MESSAGE: g._("\u6709\u627e\u4e0d\u5230\u7684\u61c9\u7528\u7a0b\u5f0f\u6216\u884c\u52d5\u7248\u7db2\u7ad9\u55ce\uff1f"),
CREATE_LOADING_MESSAGE: g._("\u6b63\u5728\u5c0b\u627e\u9023\u7d50\u5230\u4f60\u7c89\u7d72\u5c08\u9801\u7684\u7db2\u7ad9\u8207\u61c9\u7528\u7a0b\u5f0f\u2026\u2026"),
CREATE_SELECT_CTA_LABEL: g._("\u6309\u9215\u6a19\u7c64"),
CREATE_INVALID_WEB_LINK: g._("\u9023\u7d50\u6216\u7db2\u5740\u7121\u6548"),
CREATE_INVALID_PACKAGE_NAME: g._("\u5957\u4ef6\u540d\u7a31\u7121\u6548"),
CREATE_INVALID_APP_LINK: g._("\u61c9\u7528\u7a0b\u5f0f\u9023\u7d50\u7121\u6548"),
CREATE_IPHONE_DEEP_LINK_TEXT: g._("\u6211\u5011\u6703\u5728\u5b89\u88dd\u5f8c\u958b\u555f\u4e0a\u65b9\u9078\u64c7\u7684\u61c9\u7528\u7a0b\u5f0f"),
CREATE_ANDROID_DEEP_LINK_TEXT: g._("\u6211\u5011\u6703\u5728\u5b89\u88dd\u5f8c\u958b\u555f\u4e0a\u65b9\u9078\u64c7\u7684\u61c9\u7528\u7a0b\u5f0f"),
CREATE_INVALID_URL_LINK: g._("\u7db2\u5740\u9023\u7d50\u7121\u6548"),
EDIT_CARD_WEB_TITLE: g._("\u96fb\u8166"),
EDIT_CARD_IOS_TITLE: g._("iPhone \u6216\u5176\u4ed6 iOS \u88dd\u7f6e"),
EDIT_CARD_ANDROID_TITLE: g._("Android \u624b\u6a5f\u6216\u5e73\u677f\u96fb\u8166"),
EDIT_CARD_OTHER_M_TITLE: g._("\u5176\u4ed6\u667a\u6167\u578b\u624b\u6a5f"),
EDIT_LINK_TOOLTIP: g._("\u8b8a\u66f4\u6b64\u9023\u7d50\u7db2\u5740"),
WEB_LINK_INPUT_LABEL: g._("\u7db2\u7ad9"),
WEB_LINK_INPUT_PLACEHOLDER: g._("\u7bc4\u4f8b\uff1a{url}", [g.param("url", 'www.mywebsite.com')]),
MOBILE_LINK_INPUT_LABEL: g._("\u624b\u6a5f\u7248\u7db2\u7ad9"),
APP_LINK_INPUT_LABEL: g._("\u61c9\u7528\u7a0b\u5f0f\u9023\u7d50"),
APP_LINK_INPUT_LABEL_TOOLTIP: g._("\u9019\u662f\u7528\u6236\u9ede\u6309\u6216\u9ede\u64ca\u4f60\u7684\u884c\u52d5\u547c\u7c72\u6309\u9215\u5f8c\u6703\u524d\u5f80\u7684\u9023\u7d50\u7db2\u5740"),
APP_LINK_INPUT_PLACEHOLDER: g._("\u8f38\u5165\u4f60\u7684\u61c9\u7528\u7a0b\u5f0f\u9023\u7d50"),
APP_DESTINATION_SELECTOR_LABEL: g._("\u76ee\u6a19\u7db2\u9801"),
APP_DESTINATION_SELECTOR_LABEL_TOOLTIP: g._("\u9078\u64c7\u4f60\u5e0c\u671b\u7528\u6236\u5728\u9ede\u6309\u6216\u9ede\u64ca\u4f60\u7684\u884c\u52d5\u547c\u7c72\u6309\u9215\u5f8c\u524d\u5f80\u7684\u76ee\u6a19\u7db2\u9801\u985e\u578b"),
FALLBACK_CTA_SELECTOR_LABEL: g._("\u5099\u7528"),
FALLBACK_CTA_SELECTOR_LABEL_TOOLTIP: g._("\u8acb\u9078\u64c7\u4f60\u5e0c\u671b\u7528\u6236\u5728\u9ede\u6309\u6216\u9ede\u64ca\u4f60\u7684\u884c\u52d5\u547c\u7c72\u6309\u9215\u5f8c\u524d\u5f80\u7684\u76ee\u6a19\u7db2\u9801\u985e\u578b\uff08\u5982\u679c\u4ed6\u5011\u5c1a\u672a\u8a3b\u518a\u6216\u5b89\u88dd\u4f60\u7684\u61c9\u7528\u7a0b\u5f0f\uff09"),
FALLBACK_LINK_INPUT_LABEL: g._("\u5099\u7528\u7db2\u5740"),
FALLBACK_LINK_INPUT_LABEL_TOOLTIP: g._("\u5982\u679c\u7528\u6236\u5c1a\u672a\u8a3b\u518a\u6216\u5b89\u88dd\u4f60\u7684\u61c9\u7528\u7a0b\u5f0f\uff0c\u9019\u5c31\u662f\u4ed6\u5011\u9ede\u6309\u6216\u9ede\u64ca\u4f60\u7684\u884c\u52d5\u547c\u7c72\u6309\u9215\u5f8c\u6703\u524d\u5f80\u7684\u9023\u7d50\u7db2\u5740"),
STORE_ID_LABEL: g._("\u5546\u5e97\u7de8\u865f"),
STORE_ID_TOOLTIP: g._("Apple Store \u6216 Google Play \u5546\u5e97\u7684\u61c9\u7528\u7a0b\u5f0f\u7de8\u865f"),
GO_TO_WEBSITE_LABEL: g._("\u524d\u5f80\u7db2\u7ad9"),
PACKAGE_NAME_LABEL: g._("\u5957\u4ef6\u540d\u7a31"),
REVIEW_DESTINATION_LINKS_TITLE: g._("\u5be9\u67e5\u6309\u9215\u76ee\u6a19\u7db2\u9801\u9023\u7d50"),
CREATE_CALL_TO_ACTION_WEBSITE: g._("\u5efa\u7acb\u884c\u52d5\u547c\u7c72\u6309\u9215"),
EDIT_CALL_TO_ACTION_WEBSITE: g._("\u7de8\u8f2f\u884c\u52d5\u547c\u7c72\u6309\u9215"),
CREATE_CALL_TO_ACTION_IPHONE: g._("\u70ba\u4f7f\u7528 iOS \u7684\u7528\u6236\u9078\u64c7\u76ee\u6a19\u7db2\u9801"),
CREATE_CALL_TO_ACTION_ANDROID: g._("\u70ba\u4f7f\u7528 Android \u7684\u7528\u6236\u9078\u64c7\u76ee\u6a19\u7db2\u5740"),
CREATE_CALL_TO_ACTION_IPAD: g._("\u70ba\u4f7f\u7528 iPad \u7684\u7528\u6236\u9078\u64c7\u76ee\u6a19\u7db2\u9801"),
ACTION_SELECTOR_LABEL: g._("\u9078\u64c7\u6309\u9215"),
OPTIONAL_LABEL: g._("\u9078\u586b"),
IOS_SECTION_TITLE: g._("iOS \u76ee\u6a19\u7db2\u9801"),
ANDROID_SECTION_TITLE: g._("Android \u76ee\u6a19\u7db2\u9801"),
BACKUP_LINK_LABEL: g._("\u5099\u7528\u76ee\u6a19\u7db2\u9801"),
DEEPLINK_LEARN_MORE_LABEL: g._("\u77ad\u89e3\u5982\u4f55\u8a2d\u5b9a\u6df1\u5c64\u9023\u7d50"),
SELECTOR_OPTION_WEBSITE: g._("\u7db2\u7ad9"),
SELECTOR_OPTION_APP: g._("\u61c9\u7528\u7a0b\u5f0f"),
LEGEND_KEY_ORGANIC: g._("\u81ea\u4e3b"),
LEGEND_KEY_PAID: g._("\u5df2\u4ed8\u8cbb"),
THIS_WEEK_CLICK_LABEL: g._("\u672c\u9031\u9ede\u64ca\u6b21\u6578")
};
e.exports = j;
}, null);
__d("CustomCTALogger", ["Banzai"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
var h = {
logVital: function(i) {
g.post('page_custom_cta_logger', i, g.VITAL);
},
log: function(i) {
g.post('page_custom_cta_logger', i);
}
};
e.exports = h;
}, null);
__d("PageContentTabLoadingDialog", ["React", "DOM", "XUIDialog.react", "XUIDialogBody.react", "XUISpinner.react", "cx"], function(a, b, c, d, e, f, g, h, i, j, k, l) {
b.__markCompiled && b.__markCompiled();
var m = g.createClass({
displayName: "PageContentTabLoadingDialogComponent",
getInitialState: function() {
return {
shown: false
};
},
render: function() {
return (g.createElement(i, {
width: 300,
shown: this.state.shown,
layerHideOnBlur: false
}, g.createElement(j, {
className: "_5xp9"
}, g.createElement(k, {
background: "light",
className: "_5xpe",
size: "large"
}))));
},
show: function() {
this.setState({
shown: true
});
},
hide: function() {
this.setState({
shown: false
});
}
}),
n = {
show: function() {
if (!this._dialog) this._dialog = g.render(g.createElement(m, null), h.create('div'));
this._dialog.show();
},
hide: function() {
this._dialog && this._dialog.hide();
}
};
e.exports = n;
}, null);
__d("CustomCTAUtils", ["fbt", "AdsCallToActionTypes", "AsyncRequest", "CctaTestIDs", "CustomCTAConstants", "Image.react", "PageContentTabLoadingDialog", "React", "XUISelector.react", "CustomCallToActionTypes"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) {
b.__markCompiled && b.__markCompiled();
var p = b('CustomCallToActionTypes').ICONS,
q = b('CustomCallToActionTypes').LABELS,
r = b('CustomCallToActionTypes').MOBILE_ICONS,
s = b('CustomCallToActionTypes').TYPES,
t = b('CustomCallToActionTypes').TYPES,
u = o.Option,
v = {
executeCallToAction: function(w, x) {
if (w === t.CHARITY_DONATE) {
m.show();
new i(x).setFinallyHandler(function(y) {
m.hide();
}).send();
} else window.open(x);
},
getFallbackSelectorOptions: function() {
var w = [];
w.push(n.createElement(u, {
value: k.FALLBACK_GO_TO_WEBSITE
}, v.getFallbackLabel(k.FALLBACK_GO_TO_WEBSITE)));
w.push(n.createElement(u, {
value: k.FALLBACK_INSTALL_APP
}, v.getFallbackLabel(k.FALLBACK_INSTALL_APP)));
return w;
},
getCallToActionSelectorOptions: function(w) {
var x = [];
w.forEach(function(y) {
x.push(n.createElement(u, {
"data-testid": j.CCTA_TYPE_SELECTOR_OPTION_TESTID_PREFIX + y,
key: y,
value: y,
icon: n.createElement(l, {
src: v.getCallToActionIcon(y)
})
}, v.getCallToActionLabel(y)));
});
return x;
},
getFallbackLabel: function(w) {
switch (w) {
case k.FALLBACK_INSTALL_APP:
return (g._("\u7acb\u5373\u5b89\u88dd"));
case k.FALLBACK_GO_TO_WEBSITE:
return (g._("\u524d\u5f80\u7db2\u7ad9"));
}
return null;
},
getCallToActionLabel: function(w) {
return q[w];
},
getCallToActionMobileIcon: function(w) {
return r[w];
},
getCallToActionIcon: function(w) {
return p[w];
},
getTruncatedURI: function(w) {
if (!w || w.length < k.URI_TRUNCATE_LENGTH) return w;
return w.substr(0, k.URI_TRUNCATE_LENGTH) + '...';
},
getAdsCallToActionType: function(w) {
switch (w) {
case s.BOOK_NOW:
return h.TYPES.BOOK_TRAVEL.name;
case s.OPEN_APP:
return h.TYPES.USE_APP.name;
case s.PLAY_NOW:
return h.TYPES.PLAY_GAME.name;
case s.SHOP_NOW:
return h.TYPES.SHOP_NOW.name;
case s.SIGN_UP:
return h.TYPES.SIGN_UP.name;
case s.WATCH_NOW:
return h.TYPES.WATCH_VIDEO.name;
default:
return '';
}
}
};
e.exports = v;
}, null);
__d("PageCallToActionOpenTableDialog.react", ["LayerHideOnBlur", "React", "XUIDialog.react", "XUIDialogBody.react", "XUIDialogCancelButton.react", "XUIDialogConfirmButton.react", "XUIDialogFooter.react"], function(a, b, c, d, e, f, g, h, i, j, k, l, m) {
b.__markCompiled && b.__markCompiled();
'use strict';
var n = h.createClass({
displayName: "PageCallToActionOpenTableDialog",
render: function() {
return (h.createElement(i, {
behaviors: {
LayerHideOnBlur: g
},
shown: true,
width: 400
}, h.createElement(j, null), h.createElement(m, null, h.createElement(k, null), h.createElement(l, null))));
}
});
e.exports = n;
}, null);
__d("PageCallToActionViewerUnitMixin", ["AsyncRequest", "DOM", "PageCallToActionDestinationTypes", "PageCallToActionOpenTableDialog.react", "PageContentTabLoadingDialog", "React", "ReactLayeredComponentMixin", "XUIDialog.react", "XUIDialogBody.react", "XUIDialogButton.react", "XUIDialogCancelButton.react", "XUIDialogFooter.react", "XUIDialogTitle.react", "XUIText.react", "fbt", "CustomCallToActionTypes"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) {
b.__markCompiled && b.__markCompiled();
'use strict';
var v = b('CustomCallToActionTypes').CONFIGS,
w = l,
x = w.PropTypes,
y = {
mixins: [m],
propTypes: {
callToActionType: x.string.isRequired,
url: x.string.isRequired
},
getInitialState: function() {
var z = v[this.props.callToActionType];
return {
confirmDialog: z.confirm_dialog,
showConfirmDialog: false,
destinationTypes: z.destination_types
};
},
renderLayers: function() {
if (!this.state.confirmDialog) return {};
return {
confirmDialog: l.createElement(n, {
onToggle: this._onConfirmDialogToggle,
shown: this.state.showConfirmDialog,
width: 400
}, l.createElement(s, null, this.state.confirmDialog.title), l.createElement(o, null, l.createElement("div", null, l.createElement(t, {
size: "xlarge"
}, this.state.confirmDialog.message)), l.createElement("p", null), l.createElement("div", null, l.createElement(t, {
size: "small"
}, this.state.confirmDialog.subMessage))), l.createElement(r, null, l.createElement(q, null), l.createElement(p, {
action: "button",
label: this.state.confirmDialog.confirmButtonLabel ? this.state.confirmDialog.confirmButtonLabel : u._("\u7e7c\u7e8c"),
onClick: this._executeCallToAction,
use: "confirm"
})))
};
},
_onClick: function() {
if (this.state.confirmDialog) {
this.setState({
showConfirmDialog: true
});
} else this._executeCallToAction();
},
_onConfirmDialogToggle: function(z) {
this.setState({
showConfirmDialog: z
});
},
_executeCallToAction: function() {
this.setState({
showConfirmDialog: false
});
if (this.state.destinationTypes.indexOf(i.DONATE) >= 0) {
k.show();
new g(this.props.url).setFinallyHandler(function(z) {
k.hide();
}).send();
return;
}
if (this.state.destinationTypes.indexOf(i.WEBSITE) >= 0) {
window.open(this.props.url);
return;
}
if (!this._dialogAnchor) this._dialogAnchor = h.create('div');
l.render(l.createElement(j, null), this._dialogAnchor);
}
};
e.exports = y;
}, null);
__d("CustomCTAViewerUnit.react", ["CctaTestIDs", "CustomCTALogger", "CustomCTAUtils", "PageCallToActionViewerUnitMixin", "PagesEventType", "React", "Image.react", "XUIButton.react"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n) {
b.__markCompiled && b.__markCompiled();
'use strict';
var o = l,
p = o.PropTypes,
q = l.createClass({
displayName: "CustomCTAViewerUnit",
mixins: [j],
propTypes: {
borderShade: p.string,
cctaID: p.string.isRequired,
depressed: p.bool,
pageID: p.string.isRequired,
size: p.string,
surface: p.string.isRequired,
userID: p.string.isRequired
},
onButtonClick: function() {
this._onClick();
h.log({
ccta_id: this.props.cctaID,
ccta_type: this.props.callToActionType,
event_type: k.CUSTOM_CTA_CLICK_VIEWER_UNIT,
page_id: this.props.pageID,
surface: this.props.surface,
target_url: this.props.url,
user_id: this.props.userID
});
},
getDefaultProps: function() {
return {
size: "large",
borderShade: "dark"
};
},
render: function() {
var r = this.props.callToActionType;
return (l.createElement(n, {
"data-testid": g.CCTA_VIEWER_UNIT_TESTID,
borderShade: this.props.borderShade,
depressed: this.props.depressed,
image: l.createElement(m, {
src: i.getCallToActionIcon(r)
}),
label: i.getCallToActionLabel(r),
onClick: this.onButtonClick,
size: this.props.size
}));
}
});
e.exports = q;
}, null);
/*!CK:4081038614!*/ /*1438149219,*/
if (self.CavalryLogger) {
CavalryLogger.start_js(["X6J3+"]);
}
__d("htmlize", ["htmlSpecialChars"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
function h(i) {
return g(i).replace(/\r\n|[\r\n]/g, '<br/>');
}
e.exports = h;
}, null);
__d("PluginFlyout", ["Arbiter", "Button", "CSS", "DOM", "DOMEvent", "DOMEventListener", "Form", "Plugin", "TextAreaControl", "csx"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
b.__markCompiled && b.__markCompiled();
var q = g.SUBSCRIBE_NEW,
r = g.subscribe,
s = g.inform,
t = function(v, w) {
return l.add(v, 'click', w);
};
function u(v, w, x) {
var y = this,
z = r(n.CONNECT, function(event, aa) {
g.unsubscribe(z);
y.init(v, w, x);
y.connect(event, aa);
}, q);
r(n.DIALOG, function() {
y.init(v, w, x);
y.toggle();
}, q);
}
Object.assign(u.prototype, {
init: function(v, w, x) {
if (this.initialized) return;
this.initialized = true;
j.appendContent(v, JSON.parse(x));
var y = j.find(v, 'form'),
z = j.find(y, "._56zw"),
aa = j.find(y, "._56zx"),
ba = j.find(y, "._42x4"),
ca = o.getInstance(ba);
l.add(ba, 'keyup', function(ga) {
h.setEnabled(z, !!ca.getValue());
});
l.add(y, 'submit', function(ga) {
new k(ga).kill();
m.bootstrap(y);
});
var da = (w === 'tiny') ? j.find(document.body, '.pluginPostFlyoutPrompt') : null;
this.flyout = v;
this.form = y;
this.post_button = z;
this.prompt = da;
var ea = this.hide.bind(this),
fa = this.show.bind(this);
t(aa, function(ga) {
new k(ga).kill();
ea();
});
if (da) t(da, function(ga) {
new k(ga).kill();
fa();
});
r(n.CONNECT, this.connect.bind(this), q);
r(n.DISCONNECT, function() {
ea();
}, q);
r(u.SUCCESS, function() {
ea();
if (da) i.hide(da);
}, q);
r(n.ERROR, function(event, ga) {
if (ga.action !== 'comment') return;
j.setContent(j.find(y, "._56zy"), ga.content);
i.hide(z);
}, q);
},
connect: function(event, v) {
if (v.crossFrame) return;
if (this.prompt) return i.show(this.prompt);
if (!v.story_fbid) this.show();
},
show: function() {
this.shown = true;
i.show(this.flyout);
i.show(this.post_button);
this.form.comment.focus();
s(u.SHOW);
},
hide: function() {
this.shown = false;
i.hide(this.flyout);
s(u.HIDE);
},
toggle: function() {
if (this.shown) {
this.hide();
} else this.show();
}
});
Object.assign(u, {
SUCCESS: 'platform/plugins/flyout/success',
SHOW: 'platform/plugins/flyout/show',
HIDE: 'platform/plugins/flyout/hide',
success: function() {
s(u.SUCCESS);
}
});
e.exports = u;
}, null);
__d("PluginFlyoutDialog", ["Arbiter", "DOMEvent", "DOMEventListener", "PluginFlyout"], function(a, b, c, d, e, f, g, h, i, j) {
b.__markCompiled && b.__markCompiled();
function k(l, m, n) {
this.parent = new j(l, m, n);
this.flyout = l;
g.subscribe(j.SHOW, this.show.bind(this), g.SUBSCRIBE_NEW);
}
Object.assign(k.prototype, {
show: function() {
if (this.subscribed) return;
this.subscribed = 1;
var l = window.ServerJSAsyncLoader;
l && l.ondemandjs && l.run(l.ondemandjs);
i.add(this.flyout.parentNode, 'click', (function(m) {
m = new h(m);
if (m.target === this.flyout.parentNode) {
m.kill();
this.parent.hide();
}
}).bind(this));
}
});
e.exports = k;
}, null);
__d("MentionsInputMatchers", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
var g = ['@', '\\uff20'].join(''),
h = ['#', '\\uFF03'].join(''),
i = '.,+*?$|#{}()\\^\\-\\[\\]\\\\\/!%\'"~=<>_:;\n\r',
j = i.replace('#', '') + '&';
function k(n, o) {
"use strict";
this.$Matchers0 = n;
this.$Matchers1 = o;
this.$Matchers2();
}
k.prototype.$Matchers2 = function() {
"use strict";
var n = this.$Matchers3(this.$Matchers1),
o = this.$Matchers4(this.$Matchers0, this.$Matchers1),
p = this.$Matchers5(this.$Matchers0, o),
q = this.$Matchers6(n, p),
r = this.$Matchers7(n);
this.$Matchers8 = new RegExp('[' + this.$Matchers0 + ']$');
this.$Matchers9 = new RegExp(p + '$');
this.$Matchersa = new RegExp(r + '$');
this.$Matchersb = new RegExp(q + '$');
this.$Matchersc = new RegExp('[' + h + ']');
};
k.prototype.$Matchers3 = function(n) {
"use strict";
return '\\b[A-Z][^ A-Z' + n + ']';
};
k.prototype.$Matchers4 = function(n, o) {
"use strict";
return '(?:[^' + n + o + ']|[' + o + '][^ ' + o + '])';
};
k.prototype.$Matchers5 = function(n, o) {
"use strict";
return '(?:^|\\s)([' + n + '](' + o + '{0,20}))';
};
k.prototype.$Matchers6 = function(n, o) {
"use strict";
return '(?:(?:^|[^#])(' + n + '+)|' + o + ')';
};
k.prototype.$Matchers7 = function(n) {
"use strict";
return '(?:' + n + '{4,})';
};
k.prototype.getMainMatcher = function() {
"use strict";
return this.$Matchers9;
};
k.prototype.getTriggerMatcher = function() {
"use strict";
return this.$Matchers8;
};
k.prototype.getAutoMatcher = function() {
"use strict";
return this.$Matchersb;
};
k.prototype.getHashtagMatcher = function() {
"use strict";
return this.$Matchersc;
};
var l = '\\b[A-Z][^ A-Z' + i + ']',
m = {
mentionsMatchers: new k(g, i),
hashtagMatchers: new k(h, j),
userMatcher: new RegExp('(?:' + l + '{4,})' + '$')
};
e.exports = m;
}, null);
__d("MentionsInput", ["Arbiter", "ArbiterMixin", "Bootloader", "CSS", "DataStore", "DOM", "Event", "FlipDirection", "Input", "InputSelection", "Keys", "MentionsInputMatchers", "Parent", "Style", "TokenizeUtil", "UserAgent_DEPRECATED", "htmlize", "mixin", "removeFromArray", "cx"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) {
b.__markCompiled && b.__markCompiled();
var aa = '\u200B',
ba = new RegExp(aa, 'g'),
ca = function(pa) {
return pa + aa;
},
da = '\uFFFD',
ea = /@+\[[0-9]+\:([^\]]|\\\])*\]+/g,
fa = /[\\\]:]/g,
ga = {
MENTIONS: 'mentions',
HASHTAGS: 'hashtags'
};
function ha(pa, qa) {
return pa.replace(qa, ' '.repeat(qa.length));
}
function ia(pa, qa) {
return pa.substring(0, qa) + pa.substring(qa + 1);
}
function ja(pa) {
var qa = pa.lastIndexOf('>');
if (qa >= 0) {
var ra = pa.indexOf(' ', qa);
return ra >= 0 ? pa.substr(0, ra + 1) : pa;
} else return '';
}
function ka(pa, qa, ra) {
var sa = ra.lastIndexOf('<', qa) > ra.lastIndexOf('>', qa);
return sa ? ' ' : '&nbsp;<wbr />';
}
var la = x(h);
for (var ma in la)
if (la.hasOwnProperty(ma)) oa[ma] = la[ma];
var na = la === null ? null : la.prototype;
oa.prototype = Object.create(na);
oa.prototype.constructor = oa;
oa.__superConstructor__ = la;
function oa(pa, qa, ra, sa, ta, ua) {
"use strict";
la.call(this);
k.set(pa, 'MentionsInput', this);
this._root = pa;
this._typeahead = qa;
this._input = ra;
this._offsets = [];
var va = null,
wa = this.init.bind(this, sa, ta, ua);
try {
va = document.activeElement === this._input;
} catch (xa) {}
if (va) {
setTimeout(wa, 0);
} else var ya = m.listen(this._input, 'focus', function() {
setTimeout(wa, 0);
ya.remove();
});
this._hasHashtags = sa.hashtags;
this._hashtagsDataSource = sa.hashtags_data_source;
this._mentionsDataSource = this._typeahead.getData();
this._currentDataSource = this._mentionsDataSource;
this._autoSuggestPages = sa.autosuggest_pages;
this._lastHighlighterHTML = '';
this._hashtags = [];
this._matchers = r.mentionsMatchers;
this._setMatchersMode(ga.MENTIONS);
}
oa.prototype.init = function(pa, qa, ra) {
"use strict";
if (this._initialized) return;
this._initValue = qa ? qa.value : '';
this._initialized = true;
this._highlighter = l.find(this._root, '.highlighter');
this._highlighterInner = this._highlighter.firstChild;
this._highlighterContent = l.find(this._root, '.highlighterContent');
this._hiddenInput = l.find(this._root, '.mentionsHidden');
this._placeholder = this._input.getAttribute('placeholder') || '';
this._metrics = ra;
if (!this._hiddenInput.name) {
var sa = this._input.name;
this._input.name = sa + '_text';
this._hiddenInput.name = sa;
}
this._initEvents();
this._initTypeahead();
if (qa === null) {
this._setup();
} else this.reset(qa);
if (pa.autoheight) this._typeahead.getCore().updateHeight && this._typeahead.getCore().updateHeight();
this.inform('init', null, g.BEHAVIOR_STATE);
};
oa.prototype._setup = function() {
"use strict";
this._mentioned = {};
this._orderedUIDs = [];
this._numMentioned = 0;
this._filterData = null;
this._highlighterContent && l.empty(this._highlighterContent);
this._highlighterAuxContent && l.remove(this._highlighterAuxContent);
this._highlighterAuxContent = null;
o.setPlaceholder(this._input, this._placeholder);
t.set(this._typeahead.getElement(), 'height', 'auto');
};
oa.prototype.reset = function(pa) {
"use strict";
if (!this._initialized) return;
this._setup();
var qa = pa && pa.value || '';
this._value = qa;
this._hiddenInput && (this._hiddenInput.value = qa);
if (this._input && pa) o.setValue(this._input, pa.value);
var ra = pa && pa.mentions;
if (ra && ra.length) {
var sa = [];
ra.forEach(function(ta) {
sa.push(ta.offset + ta.length);
delete ta.offset;
delete ta.length;
this._addToken(ta);
}, this);
sa.reverse().forEach(function(ta) {
qa = qa.substring(0, ta) + aa + qa.substring(ta);
});
}
o.setValue(this._input, qa);
if (this._value === '') n.setDirection(this._input);
this._update();
};
oa.prototype.getValue = function() {
"use strict";
return o.getValue(this._input).replace(ba, '');
};
oa.prototype._getMarkedValue = function() {
"use strict";
return o.getValueRaw(this._input);
};
oa.prototype.getRawValue = function() {
"use strict";
this._update();
return o.getValue(this._hiddenInput);
};
oa.prototype.checkValue = function() {
"use strict";
var pa = this._typeahead.getCore().getValue();
if (this._matchers.getTriggerMatcher().exec(pa) || pa === '') this.inform('sessionEnd', {});
};
oa.prototype.getTypeahead = function() {
"use strict";
return this._typeahead;
};
oa.prototype.hasChanges = function() {
"use strict";
return !o.isEmpty(this._input) && this._input.value !== this._initValue && this._initialized;
};
oa.prototype.focus = function() {
"use strict";
this._input.focus();
};
oa.prototype._initEvents = function() {
"use strict";
var pa = this._update.bind(this);
m.listen(this._input, {
input: pa,
keyup: pa,
change: pa,
blur: this._handleBlur.bind(this),
focus: this._handleFocus.bind(this),
keydown: this._handleKeydown.bind(this)
});
if (this._metrics) {
this._metrics.init(this._typeahead);
this._metrics._reset();
this._metrics.bindSessionStart(this._typeahead, 'render', true);
this._metrics.bindSessionEnd(this._typeahead.getView(), 'select', true);
this._metrics.bindSessionEnd(this, 'sessionEnd', false);
m.listen(this._input, 'keyup', function(event) {
setTimeout(this.checkValue.bind(this), 0);
}.bind(this));
}
};
oa.prototype._initTypeahead = function() {
"use strict";
this._typeahead.subscribe('select', function(ua, va) {
var wa = va.selected;
this._addToken({
uid: wa.uid,
text: wa.text,
type: wa.type,
weakreference: wa.weak_reference
});
this.updateValue();
}.bind(this));
var pa = this._input,
qa = null;
function ra() {
if (qa === null) {
qa = o.getSubmitOnEnter(pa);
o.setSubmitOnEnter(pa, false);
}
}
function sa() {
if (qa !== null) {
o.setSubmitOnEnter(pa, qa);
qa = null;
}
}
this._typeahead.subscribe('reset', sa);
this._typeahead.subscribe('render', ra);
this._typeahead.subscribe('highlight', function(ua, va) {
va.index >= 0 ? ra() : sa();
});
this._typeahead.subscribe('query', function() {
this._filterData = null;
}.bind(this));
var ta = this._typeahead.getCore();
ta.suffix = aa;
this._handleFocus();
};
oa.prototype._handleBlur = function() {
"use strict";
if (this._filterToken) {
this._filterToken.remove();
this._filterToken = null;
}
};
oa.prototype._handleFocus = function() {
"use strict";
if (!this._filterToken) this._filterToken = this._typeahead.getData().addFilter(this._filterResults.bind(this));
this._updateWidth();
};
oa.prototype._handleKeydown = function(event) {
"use strict";
var pa = event.keyCode;
if (pa == q.BACKSPACE || pa == q.DELETE) this._handleBackspaceAndDelete(event, pa);
if (pa == q.LEFT || pa == q.RIGHT) setTimeout(this._handleLeftAndRight.bind(this, pa), 10);
};
oa.prototype._handleLeftAndRight = function(pa) {
"use strict";
var qa = this._getMarkedValue(),
ra = p.get(this._input),
sa = ra.start,
ta = ra.end,
ua = pa == q.LEFT,
va = pa == q.RIGHT;
if (sa == ta) {
var wa = ua ? -1 : 1;
if (qa.charAt(sa) == aa) p.set(this._input, sa + wa);
} else if (ua && qa.charAt(sa) == aa) {
p.set(this._input, sa - 1, ta);
} else if (ua && qa.charAt(ta) == aa) {
p.set(this._input, sa, ta - 1);
} else if (va && qa.charAt(ta) == aa) {
p.set(this._input, sa, ta + 1);
} else if (va && qa.charAt(sa) == aa) p.set(this._input, sa + 1, ta);
};
oa.prototype._handleBackspaceAndDelete = function(event, pa) {
"use strict";
var qa = p.get(this._input),
ra = false;
if (qa.start !== qa.end)
if (this._offsetIsInsideMention(qa.start + 1) && this._offsetIsInsideMention(qa.end)) {
ra = (pa === q.BACKSPACE);
} else return;
var sa = pa === q.DELETE ? 1 : -1,
ta = sa + (ra ? qa.end : qa.start),
ua = this._getMarkedValue(),
va = ua;
for (var wa = 0; wa < this._orderedUIDs.length; ++wa) {
var xa = this._mentioned[this._orderedUIDs[wa]],
ya = xa.text,
za = ca(ya),
ab = va.indexOf(za),
bb = ab + za.length;
if (ta < ab || ta >= bb) {
va = ha(va, za);
continue;
}
var cb, db;
if (xa.type != 'user') {
cb = 0;
db = [ya];
} else {
cb = za.substring(0, ta - ab).split(' ').length - 1;
db = ya.split(' ');
}
var eb = db.splice(cb, 1)[0],
fb = db.join(' '),
gb = cb === 0 ? ab : bb - eb.length - 1;
if (fb) {
xa.text = fb;
fb = ca(fb);
} else this._removeToken(xa.uid);
var hb = ua.substring(0, ab) + fb + ua.substring(bb);
o.setValue(this._input, hb);
p.set(this._input, gb);
this._update();
event.kill();
break;
}
};
oa.prototype._offsetIsInsideMention = function(pa) {
"use strict";
for (var qa = 0; qa < this._offsets.length; qa++)
if (pa > this._offsets[qa][0] && pa <= this._offsets[qa][1]) return true;
return false;
};
oa.prototype._filterResults = function(pa) {
"use strict";
if (this._filterData === null) {
var qa = p.get(this._input).start;
if (this._offsetIsInsideMention(qa)) {
this._filterData = {
caretIsInsideMention: true
};
return false;
}
var ra = this._typeahead.getCore();
this._filterData = {
value: ra.getValue(),
rawValue: ra.getRawValue()
};
}
if (this._filterData.caretIsInsideMention) return false;
if (this._matchers.getMainMatcher().test(this._filterData.rawValue)) return true;
if (pa.type != 'user' && !pa.connected_page) return false;
if (pa.disable_autosuggest) return false;
if (this._matchersMode === ga.MENTIONS && r.userMatcher.test(this._filterData.value)) return true;
return u.isExactMatch(this._filterData.value, this._typeahead.getData().getTextToIndex(pa));
};
oa.prototype._addToken = function(pa) {
"use strict";
var qa = pa.uid;
if (!this._mentioned.hasOwnProperty(qa)) {
this._mentioned[qa] = pa;
var ra = this._orderedUIDs,
sa = this._getMarkedValue().replace(ea, da),
ta = sa.indexOf(ca(this._mentioned[qa].text)),
ua = false,
va = 0;
for (var wa = 0; wa < ra.length; ++wa) {
var xa = ca(this._mentioned[ra[wa]].text),
ya = sa.indexOf(xa, va);
va = ya + xa.length;
if (ta < ya) {
this._orderedUIDs.splice(wa, 0, qa);
ua = true;
break;
}
}
if (!ua) this._orderedUIDs.push(qa);
this._numMentioned++;
this._update({
ignoreHashtags: true
});
}
};
oa.prototype._removeToken = function(pa) {
"use strict";
if (this._mentioned.hasOwnProperty(pa)) {
delete this._mentioned[pa];
y(this._orderedUIDs, pa);
this._numMentioned--;
this._update();
}
};
oa.prototype._update = function(pa) {
"use strict";
pa = pa || {};
var qa = this._getMarkedValue();
if (!pa.ignoreHashtags) this._checkShouldSwapDataSource(qa);
if (qa == this._value) return;
this._value = qa;
this._updateTypeahead();
this._updateMentions();
this._updateWidth();
setTimeout(this._updateDirection.bind(this), 0);
this.updateValue();
var ra = this.hasAuxContent();
this.inform('valueUpdate', {
value: qa,
hasAuxContent: ra
});
};
oa.prototype._updateMentions = function() {
"use strict";
this._offsets = [];
var pa = this._getMarkedValue(),
qa = pa;
for (var ra = 0; ra < this._orderedUIDs.length; ++ra) {
var sa = this._orderedUIDs[ra],
ta = ca(this._mentioned[sa].text),
ua = qa.indexOf(ta);
if (ua == -1) this._removeToken(sa);
qa = ha(qa, ta);
this._offsets.push([ua, ua + ta.length]);
}
var va = pa;
while ((ua = qa.indexOf(aa)) > -1) {
va = ia(va, ua);
qa = ia(qa, ua);
}
if (pa !== va) {
var wa = p.get(this._input);
o.setValue(this._input, va);
p.set(this._input, wa.start);
this._value = va;
}
};
oa.prototype._renderHashtags = function(pa) {
"use strict";
this._initHashtagParser(pa);
if (!this._hasHashtags || !this._hashtagParser) return w(pa);
this._hashtags = this._hashtagParser.parse(pa);
var qa = [],
ra = 0;
for (var sa = 0; sa < this._hashtags.length; sa++) {
var ta = this._hashtags[sa];
qa.push(w(pa.substring(ra, ta.rawOffset)), '<b>', ta.marker, ta.tag, '</b>');
ra = ta.rawOffset + ta.marker.length + ta.tag.length;
}
qa.push(w(pa.substring(ra)));
return qa.join('');
};
oa.prototype.updateValue = function() {
"use strict";
var pa = this._value = this._getMarkedValue(),
qa = this._orderedUIDs,
ra = pa.replace(ea, da);
for (var sa = 0; sa < qa.length; ++sa) {
var ta = '@[' + qa[sa] + ':]',
ua = ca(this._mentioned[qa[sa]].text);
ra = ra.replace(ua, ta);
pa = pa.replace(ua, ta);
}
var va = this._renderHashtags(pa);
for (var sa = 0; sa < qa.length; ++sa) {
var wa = qa[sa],
xa = this._mentioned[wa],
ya = xa.text,
za = xa.weakreference ? '<b class="weak">' : '<b>';
va = va.replace('@[' + wa + ':]', za + w(ca(ya)) + '</b>');
ya = ya.replace(fa, function(bb) {
return '\\' + bb;
});
ra = ra.replace('@[' + wa + ':]', '@[' + wa + ':' + ya + ']');
}
var ab = ja(va);
if (this._highlighterAuxContent || ab !== this._lastHighlighterHTML) {
if (v.ie() < 9) va = va.replace(/ /g, ka);
this._highlighterContent.innerHTML = va;
this._updateHighlighter();
this._lastHighlighterHTML = ab;
}
this._hiddenInput.value = ra;
this._updateHeight();
};
oa.prototype._updateDirection = function() {
"use strict";
var pa = t.get(this._input, 'direction');
if (pa == this._dir) return;
this._dir = pa;
t.set(this._highlighter, 'direction', pa);
if (pa == 'rtl') {
t.set(this._highlighter, 'text-align', 'right');
} else t.set(this._highlighter, 'text-align', 'left');
};
oa.prototype._updateWidth = function() {
"use strict";
var pa = this._input.offsetWidth;
if (pa === this._lastInputWidth) return;
this._lastInputWidth = pa;
var qa = t.getFloat.bind(null, this._input),
ra = pa - qa('paddingLeft') - qa('paddingRight') - qa('borderLeftWidth') - qa('borderRightWidth');
this._highlighterInner.style.width = Math.max(ra, 0) + 'px';
};
oa.prototype._updateHeight = function() {
"use strict";
if (this._highlighterAuxContent) {
var pa = this._highlighter.offsetHeight,
qa = this._typeahead.getElement();
if (pa > qa.offsetHeight) {
if (this._typeahead.setHeight) {
this._typeahead.setHeight(pa);
} else t.set(qa, 'height', pa + 'px');
g.inform('reflow');
}
}
};
oa.prototype._updateTypeahead = function() {
"use strict";
var pa = this._typeahead.getCore();
pa.matcher = this._matchers.getAutoMatcher();
pa.setExclusions(this._orderedUIDs);
this.inform('update', {
mentioned: this._mentioned
});
};
oa.prototype.setPlaceholder = function(pa) {
"use strict";
this._placeholder = pa;
if (!this.hasAuxContent()) o.setPlaceholder(this._input, pa);
};
oa.prototype._updateHighlighter = function() {
"use strict";
if (this._highlighterContent) j.conditionShow(this._highlighterContent, this._numMentioned > 0 || this.hasAuxContent() || this._hashtags.length);
};
oa.prototype.setAuxContent = function(pa) {
"use strict";
if (this._highlighterContent) {
if (!this._highlighterAuxContent) {
this._highlighterAuxContent = l.create('span', {
className: "highlighterAuxContent"
});
l.insertAfter(this._highlighterContent, this._highlighterAuxContent);
}
l.setContent(this._highlighterAuxContent, pa);
if (pa) {
o.setPlaceholder(this._input, '');
} else o.setPlaceholder(this._input, this._placeholder);
this._value = null;
this._update();
this._updateHighlighter();
this._updateHeight();
}
};
oa.prototype.hasAuxContent = function() {
"use strict";
var pa = this.getAuxContentRoot();
return pa && j.shown(pa) && pa.innerHTML.length > 0;
};
oa.prototype.getAuxContentRoot = function() {
"use strict";
return this._highlighterAuxContent;
};
oa.prototype.addMention = function(pa, qa) {
"use strict";
qa = (typeof qa === 'undefined') ? true : qa;
var ra = qa === false ? '' : ' ',
sa = this._getMarkedValue();
if (sa !== '') sa += ' ';
o.setValue(this._input, sa + ca(pa.text) + ra);
this._addToken(pa);
this._update();
};
oa.prototype.getMentions = function() {
"use strict";
return this._mentioned;
};
oa.prototype.bootloadHashtagParser = function() {
"use strict";
if (!this._hashtagParser) i.loadModules(["HashtagParser"], function(pa) {
this._hashtagParser = pa;
if (this._initialized) {
this._value = null;
this._update();
}
}.bind(this));
};
oa.getInstance = function(pa) {
"use strict";
var qa = s.byClass(pa, 'uiMentionsInput');
return qa ? k.get(qa, 'MentionsInput') : null;
};
oa.prototype._checkShouldSwapDataSource = function(pa) {
"use strict";
this._initHashtagParser(pa);
if (!this._hashtagsDataSource || !this._hashtagParser) return;
var qa = this._isInsideHashtagToken(pa);
if (this._matchersMode === ga.HASHTAGS && !qa) {
this._setMatchersMode(ga.MENTIONS);
this._swapData(this._mentionsDataSource);
} else if (this._matchersMode === ga.MENTIONS && qa) {
this._setMatchersMode(ga.HASHTAGS);
this._swapData(this._hashtagsDataSource);
}
};
oa.prototype._swapData = function(pa) {
"use strict";
this._currentDataSource = pa;
this._typeahead.swapDataNoCoreReset(this._currentDataSource);
};
oa.prototype._isInsideHashtagToken = function(pa) {
"use strict";
this._hashtags = this._hashtagParser.parse(pa);
var qa = p.get(this._input).start;
for (var ra = 0; ra < this._hashtags.length; ra++) {
var sa = this._hashtags[ra],
ta = sa.offset;
if (qa >= ta && qa <= (ta + sa.tag.length + 1)) return true;
}
return false;
};
oa.prototype._initHashtagParser = function(pa) {
"use strict";
if (this._hashtagParser) return;
if (this._matchers.getHashtagMatcher().exec(pa)) this.bootloadHashtagParser();
};
oa.prototype._setMatchersMode = function(pa) {
"use strict";
switch (pa) {
case ga.MENTIONS:
this._matchers = r.mentionsMatchers;
break;
case ga.HASHTAGS:
this._matchers = r.hashtagMatchers;
break;
default:
throw new Error('Invariant Violation: MatchersMode enum is missing constant ' + pa);
}
this._matchersMode = pa;
};
e.exports = oa;
}, null);
__d("legacy:MentionsInput", ["MentionsInput"], function(a, b, c, d) {
b.__markCompiled && b.__markCompiled();
a.MentionsInput = b('MentionsInput');
}, 3);
__d("TypeaheadAreaCore", ["InputSelection", "TextAreaControl", "TypeaheadCore", "emptyFunction"], function(a, b, c, d, e, f, g, h, i, j) {
b.__markCompiled && b.__markCompiled();
for (var k in i)
if (i.hasOwnProperty(k)) m[k] = i[k];
var l = i === null ? null : i.prototype;
m.prototype = Object.create(l);
m.prototype.constructor = m;
m.__superConstructor__ = i;
function m(n) {
"use strict";
i.call(this, n);
this.matcher = new RegExp(this.matcher + '$');
this.preventFocusChangeOnTab = true;
}
m.prototype.select = function(n) {
"use strict";
l.select.call(this, n);
var o = this.element.value,
p = this.prefix + n.text + this.suffix;
this.expandBounds(o, p);
var q = o.substring(0, this.start),
r = o.substring(this.end);
this.element.value = q + p + r;
g.set(this.element, q.length + p.length);
};
m.prototype.expandBounds = function(n, o) {
"use strict";
n = n.toLowerCase();
o = o.toLowerCase();
var p, q, r, s, t = /\s/;
q = n.substring(this.start, this.end);
r = o.indexOf(q);
p = this.start;
while (p >= 0 && r >= 0) {
s = n.charAt(p - 1);
if (!s || t.test(s)) this.start = p;
q = s + q;
r = o.indexOf(q);
p--;
}
q = n.substring(this.start, this.end);
r = o.indexOf(q);
p = this.end;
while (p <= n.length && r >= 0) {
s = n.charAt(p);
if (!s || t.test(s)) this.end = p;
q = q + s;
r = o.indexOf(q);
p++;
}
};
m.prototype.getRawValue = function() {
"use strict";
var n = g.get(this.element).start || 0;
return l.getValue.call(this).substring(0, n);
};
m.prototype.getValue = function() {
"use strict";
var n = this.matcher && this.matcher.exec(this.getRawValue());
if (!n) return '';
var o = n[0],
p = n.index + o.length;
o = o.replace(/^\s/, '');
var q = o.length;
o = o.replace(/\s$/, '');
var r = q - o.length;
this.start = p - q;
this.end = p + r;
if (n[2] && (n[2].charAt(0) === '#' || n[2].charAt(0) === '\\uFF03')) return n[2];
return n[3] || n[1] || n[0];
};
m.prototype.updateHeight = function() {
"use strict";
var n = h.getInstance(this.element);
n.updateHeight();
};
Object.assign(m.prototype, {
prefix: '',
suffix: ', ',
matcher: "\\b[^,]*",
click: j
});
e.exports = m;
}, null);
__d("TypeaheadHoistFriends", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
function g(h) {
"use strict";
this._typeahead = h;
}
g.prototype.enable = function() {
"use strict";
var h = this._typeahead.getView();
this._subscription = h.subscribe('beforeRender', function(i, j) {
var k = [],
l = [],
m = [];
for (var n = 0; n < j.results.length; ++n) {
var o = j.results[n];
if (o.type == 'header') {
m = m.concat(l, k);
m.push(o);
l = [];
k = [];
} else if (o.type == 'user' && o.bootstrapped) {
l.push(o);
} else k.push(o);
}
j.results = m.concat(l, k);
});
};
g.prototype.disable = function() {
"use strict";
this._typeahead.getView().unsubscribe(this._subscription);
this._subscription = null;
};
Object.assign(g.prototype, {
_subscription: null
});
e.exports = g;
}, null);
__d("legacy:HoistFriendsTypeaheadBehavior", ["TypeaheadHoistFriends"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
if (!a.TypeaheadBehaviors) a.TypeaheadBehaviors = {};
a.TypeaheadBehaviors.hoistFriends = function(h) {
h.enableBehavior(g);
};
}, 3);
__d("TypeaheadMetrics", ["AsyncRequest", "Event", "QueriesHistory", "emptyFunction"], function(a, b, c, d, e, f, g, h, i, j) {
b.__markCompiled && b.__markCompiled();
var k = 1000;
function l(m) {
"use strict";
this.extraData = {};
Object.assign(this, m);
}
l.prototype.init = function(m) {
"use strict";
this.init = j;
this._initImpl(m);
};
l.prototype._initImpl = function(m) {
"use strict";
this.core = m.getCore();
this.view = m.getView();
this.data = m.getData();
this.queriesHistory = new i(k);
this.stats = {};
this.sessionActive = false;
this._sessionStartEvents = [];
this._sessionEndEvents = [];
this._reset();
this.initEvents();
};
l.prototype._reset = function() {
"use strict";
this.log = [];
this.stats = {};
this.avgStats = {};
this.sessionActive = false;
this._setSid(Math.floor(Date.now() * Math.random()));
this.request_ids = [];
this.lastNotBackspacedQuery = '';
this.queriesHistory.reset();
this._logEvent('session_started', {});
};
l.prototype._logEvent = function(m, n) {
"use strict";
var o = {
type: m,
data: n,
time: Date.now()
};
this.log.push(o);
};
l.prototype._setSid = function(m) {
"use strict";
this.sid = m;
if (typeof this.data.queryData === 'object' && this.data.queryData !== null) {
this.data.queryData.sid = this.sid;
} else this.data.setQueryData({
sid: this.sid
});
if (typeof this.data.bootstrapData === 'object' && this.data.bootstrapData !== null) {
this.data.bootstrapData.sid = this.sid;
} else this.data.setBootstrapData({
sid: this.sid
});
};
l.prototype.resetWithData = function(m) {
"use strict";
this.init = j;
this._initImpl(m);
};
l.prototype.recordSelect = function(m) {
"use strict";
var n = m.selected;
if (n.uid == null) {
this.recordStat('selected_id', 'SELECT_NULL');
} else this.recordStat('selected_id', n.uid);
this.recordStat('selected_type', n.type);
this.recordStat('selected_score', n.score);
this.recordStat('selected_original_id', n.original_id);
this.recordStat('place_id', n.place_id);
this.recordStat('client_time', n.client_time);
this.recordStat('selected_position', m.index);
this.recordStat('selected_with_mouse', m.clicked ? 1 : 0);
this.recordStat('selected_query', m.query);
this._sessionEnd();
};
l.prototype.bindSessionStart = function(m, event, n) {
"use strict";
if (n)
for (var o = 0; o < this._sessionStartEvents.length; ++o) {
var p = this._sessionStartEvents[o];
p.obj.unsubscribe(p.token);
}
this._sessionStartEvents.push({
obj: m,
token: m.subscribe(event, function(q, r) {
this._sessionStart();
}.bind(this))
});
};
l.prototype.bindSessionEnd = function(m, event, n) {
"use strict";
if (n)
for (var o = 0; o < this._sessionEndEvents.length; ++o) {
var p = this._sessionEndEvents[o];
p.obj.unsubscribe(p.token);
}
this._sessionEndEvents.push({
obj: m,
token: m.subscribe(event, function(q, r) {
this._sessionEnd();
}.bind(this))
});
};
l.prototype.dataSubscribe = function(m, n) {
"use strict";
var o = this.data,
p = this.data.subscribe(m, n);
this._dataSubscriptions.push(function() {
o.unsubscribe(p);
});
};
l.prototype.initEvents = function() {
"use strict";
this._dataSubscriptions = this._dataSubscriptions || [];
this._dataSubscriptions.forEach(function(m) {
m();
});
this._dataSubscriptions = [];
this.bindSessionStart(this.core, 'focus', false);
this.bindSessionEnd(this.core, 'blur', false);
this.view.subscribe('select', function(m, n) {
this.recordSelect(n);
}.bind(this));
this.bindSessionEnd(this.view, 'select', false);
this.view.subscribe('render', function(m, n) {
this.results = n;
}.bind(this));
this.dataSubscribe('beforeQuery', function(m, n) {
this._logEvent('user_typed', {
query: n.value
});
if (!n.value) return;
this.query = n.value;
this.queriesHistory.add(this.query);
if (this.lastNotBackspacedQuery.indexOf(this.query) !== 0) this.lastNotBackspacedQuery = this.query;
this.recordCountStat('num_queries');
}.bind(this));
this.dataSubscribe('beforeFetch', function(m, n) {
if (n.fetch_context.bootstrap) {
this.bootstrapBegin = Date.now();
} else n.fetch_context.queryBegin = Date.now();
this._logEvent('async_query_started', {
query: n.fetch_context.value,
request_id: n.fetch_context.request_id
});
}.bind(this));
this.dataSubscribe('fetchComplete', function(m, n) {
this._logEvent('async_query_completed', {
query: n.fetch_context.value,
request_id: n.fetch_context.request_id
});
if (n.fetch_context.bootstrap) {
this.recordAvgStat('bootstrap_latency', Date.now() - this.bootstrapBegin);
var o = {};
n.response.payload.entries.forEach(function(p) {
if (!o[p.type]) {
o[p.type] = 1;
} else o[p.type]++;
});
this.recordStat('bootstrap_response_types', o);
this.bootstrapped = true;
} else {
if ('filtered_count' in n.response.payload) this.recordStat('filtered_count', n.response.payload.filtered_count);
this.recordAvgStat('avg_query_latency', Date.now() - n.fetch_context.queryBegin);
}
}.bind(this));
this.dataSubscribe('respond', function(m, n) {
this._logEvent('respond', {
query: n.value,
num_results: n.results.length
});
var o = this.data.tokenizeBackend(n.value || '').flatValue,
p = this.data.findBestPreviousQuery(o, this.data.getQueryIDs()) || '',
q = this.data.getQueryIDs()[p];
this.normalized_backend_query = p;
this.request_id = q;
this.request_ids.push(q);
}.bind(this));
this.dataSubscribe('dirty', function(m, n) {
this.bootstrapped = false;
}.bind(this));
};
l.prototype._sessionStart = function() {
"use strict";
if (this.sessionActive) return;
this.sessionActive = true;
};
l.prototype._sessionEnd = function() {
"use strict";
if (!this.sessionActive) return;
this.sessionActive = false;
this.submit();
this._reset();
};
l.prototype.recordStat = function(m, n) {
"use strict";
this.stats[m] = n;
};
l.prototype.recordCountStat = function(m) {
"use strict";
var n = this.stats[m];
this.stats[m] = n ? n + 1 : 1;
};
l.prototype.recordAvgStat = function(m, n) {
"use strict";
if (this.avgStats[m]) {
this.avgStats[m][0] += n;
++this.avgStats[m][1];
} else this.avgStats[m] = [n, 1];
};
l.prototype.hasStats = function() {
"use strict";
return !!Object.keys(this.stats).length;
};
l.prototype.submit = function() {
"use strict";
if ('log_all_sessions' in this.extraData || this.hasStats()) {
Object.assign(this.stats, this.extraData);
if (this.results) {
var m = (this.results).map(function(p, q) {
return p.uid;
});
this.recordStat('candidate_results', JSON.stringify(m));
}
if (this.query) this.recordStat('query', this.query);
if (this.lastNotBackspacedQuery) this.recordStat('last_not_backspaced_query', this.lastNotBackspacedQuery);
this.recordStat('queries_history', JSON.stringify(this.queriesHistory.getQueries()));
if (this.normalized_backend_query) this.recordStat('normalized_backend_query', this.normalized_backend_query);
if (this.request_id) this.recordStat('request_id', this.request_id);
if (this.request_ids.length) this.recordStat('request_ids', this.request_ids);
if (this.sid) this.recordStat('sid', this.sid);
if (this.bootstrapped) this.recordStat('bootstrapped', 1);
for (var n in this.avgStats) {
var o = this.avgStats[n];
this.stats[n] = o[0] / o[1];
}
this.recordStat('log', JSON.stringify(this.log));
new g().setURI(this.endPoint).setMethod('POST').setData({
stats: this.stats
}).setErrorHandler(j).send();
this._reset();
}
};
l.register = function(m, n, o) {
"use strict";
if (document.activeElement === m) {
n.init(o);
} else var p = h.listen(m, 'focus', function() {
n.init(o);
p.remove();
});
};
Object.assign(l.prototype, {
endPoint: '/ajax/typeahead/record_basic_metrics.php'
});
e.exports = l;
}, null);
/*!CK:3006576929!*/ /*1438697692,*/
if (self.CavalryLogger) {
CavalryLogger.start_js(["k9yEQ"]);
}
__d("CenteredContainer.react", ["React", "cx", "joinClasses"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
var j = g,
k = j.PropTypes,
l = g.createClass({
displayName: "CenteredContainer",
propTypes: {
fullHeight: k.bool,
vertical: k.bool,
horizontal: k.bool
},
getDefaultProps: function() {
return {
fullHeight: false,
vertical: false,
horizontal: true
};
},
render: function() {
var m = ((this.props.vertical ? "_3bwv" : '') + (this.props.horizontal ? ' ' + "_3bww" : '')),
n = g.Children.map(this.props.children, function(p) {
return (g.createElement("div", {
className: "_3bwx"
}, p));
}),
o = i(this.props.className, ((this.props.fullHeight ? "_5bpf" : '')));
return (g.createElement("div", g.__spread({}, this.props, {
className: o
}), g.createElement("div", {
className: m
}, g.createElement("div", {
className: "_3bwy"
}, n))));
}
});
e.exports = l;
}, null);
__d("immutable", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
(function(g, h) {
typeof f === 'object' && typeof e !== 'undefined' ? e.exports = h() : typeof define === 'function' && define.amd ? define(h) : g.Immutable = h();
}(this, function() {
'use strict';
var g = Array.prototype.slice;
function h(xh, yh) {
if (yh) xh.prototype = Object.create(yh.prototype);
xh.prototype.constructor = xh;
}
var i = 'delete',
j = 5,
k = 1 << j,
l = k - 1,
m = {},
n = {
value: false
},
o = {
value: false
};
function p(xh) {
xh.value = false;
return xh;
}
function q(xh) {
xh && (xh.value = true);
}
function r() {}
function s(xh, yh) {
yh = yh || 0;
var zh = Math.max(0, xh.length - yh),
ai = new Array(zh);
for (var bi = 0; bi < zh; bi++) ai[bi] = xh[bi + yh];
return ai;
}
function t(xh) {
if (xh.size === (void 0)) xh.size = xh.__iterate(v);
return xh.size;
}
function u(xh, yh) {
return yh >= 0 ? (+yh) : t(xh) + (+yh);
}
function v() {
return true;
}
function w(xh, yh, zh) {
return (xh === 0 || (zh !== (void 0) && xh <= -zh)) && (yh === (void 0) || (zh !== (void 0) && yh >= zh));
}
function x(xh, yh) {
return z(xh, yh, 0);
}
function y(xh, yh) {
return z(xh, yh, yh);
}
function z(xh, yh, zh) {
return xh === (void 0) ? zh : xh < 0 ? Math.max(0, yh + xh) : yh === (void 0) ? xh : Math.min(yh, xh);
}
function aa(xh) {
return ea(xh) ? xh : bb(xh);
}
h(ba, aa);
function ba(xh) {
return fa(xh) ? xh : cb(xh);
}
h(ca, aa);
function ca(xh) {
return ga(xh) ? xh : db(xh);
}
h(da, aa);
function da(xh) {
return ea(xh) && !ha(xh) ? xh : eb(xh);
}
function ea(xh) {
return !!(xh && xh[ja]);
}
function fa(xh) {
return !!(xh && xh[ka]);
}
function ga(xh) {
return !!(xh && xh[la]);
}
function ha(xh) {
return fa(xh) || ga(xh);
}
function ia(xh) {
return !!(xh && xh[ma]);
}
aa.isIterable = ea;
aa.isKeyed = fa;
aa.isIndexed = ga;
aa.isAssociative = ha;
aa.isOrdered = ia;
aa.Keyed = ba;
aa.Indexed = ca;
aa.Set = da;
var ja = '@@__IMMUTABLE_ITERABLE__@@',
ka = '@@__IMMUTABLE_KEYED__@@',
la = '@@__IMMUTABLE_INDEXED__@@',
ma = '@@__IMMUTABLE_ORDERED__@@',
na = 0,
oa = 1,
pa = 2,
qa = typeof Symbol === 'function' && Symbol.iterator,
ra = '@@iterator',
sa = qa || ra;
function ta(xh) {
this.next = xh;
}
ta.prototype.toString = function() {
return '[Iterator]';
};
ta.KEYS = na;
ta.VALUES = oa;
ta.ENTRIES = pa;
ta.prototype.inspect = ta.prototype.toSource = function() {
return this.toString();
};
ta.prototype[sa] = function() {
return this;
};
function ua(xh, yh, zh, ai) {
var bi = xh === 0 ? yh : xh === 1 ? zh : [yh, zh];
ai ? (ai.value = bi) : (ai = {
value: bi,
done: false
});
return ai;
}
function va() {
return {
value: (void 0),
done: true
};
}
function wa(xh) {
return !!za(xh);
}
function xa(xh) {
return xh && typeof xh.next === 'function';
}
function ya(xh) {
var yh = za(xh);
return yh && yh.call(xh);
}
function za(xh) {
var yh = xh && ((qa && xh[qa]) || xh[ra]);
if (typeof yh === 'function') return yh;
}
function ab(xh) {
return xh && typeof xh.length === 'number';
}
h(bb, aa);
function bb(xh) {
return xh === null || xh === (void 0) ? mb() : ea(xh) ? xh.toSeq() : pb(xh);
}
bb.of = function() {
return bb(arguments);
};
bb.prototype.toSeq = function() {
return this;
};
bb.prototype.toString = function() {
return this.__toString('Seq {', '}');
};
bb.prototype.cacheResult = function() {
if (!this._cache && this.__iterateUncached) {
this._cache = this.entrySeq().toArray();
this.size = this._cache.length;
}
return this;
};
bb.prototype.__iterate = function(xh, yh) {
return rb(this, xh, yh, true);
};
bb.prototype.__iterator = function(xh, yh) {
return sb(this, xh, yh, true);
};
h(cb, bb);
function cb(xh) {
return xh === null || xh === (void 0) ? mb().toKeyedSeq() : ea(xh) ? (fa(xh) ? xh.toSeq() : xh.fromEntrySeq()) : nb(xh);
}
cb.prototype.toKeyedSeq = function() {
return this;
};
h(db, bb);
function db(xh) {
return xh === null || xh === (void 0) ? mb() : !ea(xh) ? ob(xh) : fa(xh) ? xh.entrySeq() : xh.toIndexedSeq();
}
db.of = function() {
return db(arguments);
};
db.prototype.toIndexedSeq = function() {
return this;
};
db.prototype.toString = function() {
return this.__toString('Seq [', ']');
};
db.prototype.__iterate = function(xh, yh) {
return rb(this, xh, yh, false);
};
db.prototype.__iterator = function(xh, yh) {
return sb(this, xh, yh, false);
};
h(eb, bb);
function eb(xh) {
return (xh === null || xh === (void 0) ? mb() : !ea(xh) ? ob(xh) : fa(xh) ? xh.entrySeq() : xh).toSetSeq();
}
eb.of = function() {
return eb(arguments);
};
eb.prototype.toSetSeq = function() {
return this;
};
bb.isSeq = kb;
bb.Keyed = cb;
bb.Set = eb;
bb.Indexed = db;
var fb = '@@__IMMUTABLE_SEQ__@@';
bb.prototype[fb] = true;
h(gb, db);
function gb(xh) {
this._array = xh;
this.size = xh.length;
}
gb.prototype.get = function(xh, yh) {
return this.has(xh) ? this._array[u(this, xh)] : yh;
};
gb.prototype.__iterate = function(xh, yh) {
var zh = this._array,
ai = zh.length - 1;
for (var bi = 0; bi <= ai; bi++)
if (xh(zh[yh ? ai - bi : bi], bi, this) === false) return bi + 1;
return bi;
};
gb.prototype.__iterator = function(xh, yh) {
var zh = this._array,
ai = zh.length - 1,
bi = 0;
return new ta(function() {
return bi > ai ? va() : ua(xh, bi, zh[yh ? ai - bi++ : bi++]);
});
};
h(hb, cb);
function hb(xh) {
var yh = Object.keys(xh);
this._object = xh;
this._keys = yh;
this.size = yh.length;
}
hb.prototype.get = function(xh, yh) {
if (yh !== (void 0) && !this.has(xh)) return yh;
return this._object[xh];
};
hb.prototype.has = function(xh) {
return this._object.hasOwnProperty(xh);
};
hb.prototype.__iterate = function(xh, yh) {
var zh = this._object,
ai = this._keys,
bi = ai.length - 1;
for (var ci = 0; ci <= bi; ci++) {
var di = ai[yh ? bi - ci : ci];
if (xh(zh[di], di, this) === false) return ci + 1;
}
return ci;
};
hb.prototype.__iterator = function(xh, yh) {
var zh = this._object,
ai = this._keys,
bi = ai.length - 1,
ci = 0;
return new ta(function() {
var di = ai[yh ? bi - ci : ci];
return ci++ > bi ? va() : ua(xh, di, zh[di]);
});
};
hb.prototype[ma] = true;
h(ib, db);
function ib(xh) {
this._iterable = xh;
this.size = xh.length || xh.size;
}
ib.prototype.__iterateUncached = function(xh, yh) {
if (yh) return this.cacheResult().__iterate(xh, yh);
var zh = this._iterable,
ai = ya(zh),
bi = 0;
if (xa(ai)) {
var ci;
while (!(ci = ai.next()).done)
if (xh(ci.value, bi++, this) === false) break;
}
return bi;
};
ib.prototype.__iteratorUncached = function(xh, yh) {
if (yh) return this.cacheResult().__iterator(xh, yh);
var zh = this._iterable,
ai = ya(zh);
if (!xa(ai)) return new ta(va);
var bi = 0;
return new ta(function() {
var ci = ai.next();
return ci.done ? ci : ua(xh, bi++, ci.value);
});
};
h(jb, db);
function jb(xh) {
this._iterator = xh;
this._iteratorCache = [];
}
jb.prototype.__iterateUncached = function(xh, yh) {
if (yh) return this.cacheResult().__iterate(xh, yh);
var zh = this._iterator,
ai = this._iteratorCache,
bi = 0;
while (bi < ai.length)
if (xh(ai[bi], bi++, this) === false) return bi;
var ci;
while (!(ci = zh.next()).done) {
var di = ci.value;
ai[bi] = di;
if (xh(di, bi++, this) === false) break;
}
return bi;
};
jb.prototype.__iteratorUncached = function(xh, yh) {
if (yh) return this.cacheResult().__iterator(xh, yh);
var zh = this._iterator,
ai = this._iteratorCache,
bi = 0;
return new ta(function() {
if (bi >= ai.length) {
var ci = zh.next();
if (ci.done) return ci;
ai[bi] = ci.value;
}
return ua(xh, bi, ai[bi++]);
});
};
function kb(xh) {
return !!(xh && xh[fb]);
}
var lb;
function mb() {
return lb || (lb = new gb([]));
}
function nb(xh) {
var yh = Array.isArray(xh) ? new gb(xh).fromEntrySeq() : xa(xh) ? new jb(xh).fromEntrySeq() : wa(xh) ? new ib(xh).fromEntrySeq() : typeof xh === 'object' ? new hb(xh) : (void 0);
if (!yh) throw new TypeError('Expected Array or iterable object of [k, v] entries, ' + 'or keyed object: ' + xh);
return yh;
}
function ob(xh) {
var yh = qb(xh);
if (!yh) throw new TypeError('Expected Array or iterable object of values: ' + xh);
return yh;
}
function pb(xh) {
var yh = qb(xh) || (typeof xh === 'object' && new hb(xh));
if (!yh) throw new TypeError('Expected Array or iterable object of values, or keyed object: ' + xh);
return yh;
}
function qb(xh) {
return (ab(xh) ? new gb(xh) : xa(xh) ? new jb(xh) : wa(xh) ? new ib(xh) : (void 0));
}
function rb(xh, yh, zh, ai) {
var bi = xh._cache;
if (bi) {
var ci = bi.length - 1;
for (var di = 0; di <= ci; di++) {
var ei = bi[zh ? ci - di : di];
if (yh(ei[1], ai ? ei[0] : di, xh) === false) return di + 1;
}
return di;
}
return xh.__iterateUncached(yh, zh);
}
function sb(xh, yh, zh, ai) {
var bi = xh._cache;
if (bi) {
var ci = bi.length - 1,
di = 0;
return new ta(function() {
var ei = bi[zh ? ci - di : di];
return di++ > ci ? va() : ua(yh, ai ? ei[0] : di - 1, ei[1]);
});
}
return xh.__iteratorUncached(yh, zh);
}
h(tb, aa);
function tb() {
throw TypeError('Abstract');
}
h(ub, tb);
function ub() {}
h(vb, tb);
function vb() {}
h(wb, tb);
function wb() {}
tb.Keyed = ub;
tb.Indexed = vb;
tb.Set = wb;
function xb(xh, yh) {
if (xh === yh || (xh !== xh && yh !== yh)) return true;
if (!xh || !yh) return false;
if (typeof xh.valueOf === 'function' && typeof yh.valueOf === 'function') {
xh = xh.valueOf();
yh = yh.valueOf();
if (xh === yh || (xh !== xh && yh !== yh)) return true;
if (!xh || !yh) return false;
}
if (typeof xh.equals === 'function' && typeof yh.equals === 'function' && xh.equals(yh)) return true;
return false;
}
function yb(xh, yh) {
return yh ? zb(yh, xh, '', {
'': xh
}) : ac(xh);
}
function zb(xh, yh, zh, ai) {
if (Array.isArray(yh)) return xh.call(ai, zh, db(yh).map(function(bi, ci) {
return zb(xh, bi, ci, yh);
}));
if (bc(yh)) return xh.call(ai, zh, cb(yh).map(function(bi, ci) {
return zb(xh, bi, ci, yh);
}));
return yh;
}
function ac(xh) {
if (Array.isArray(xh)) return db(xh).map(ac).toList();
if (bc(xh)) return cb(xh).map(ac).toMap();
return xh;
}
function bc(xh) {
return xh && (xh.constructor === Object || xh.constructor === (void 0));
}
var cc = typeof Math.imul === 'function' && Math.imul(4294967295, 2) === -2 ? Math.imul : function xh(yh, zh) {
yh = yh | 0;
zh = zh | 0;
var ai = yh & 65535,
bi = zh & 65535;
return (ai * bi) + ((((yh >>> 16) * bi + ai * (zh >>> 16)) << 16) >>> 0) | 0;
};
function dc(xh) {
return ((xh >>> 1) & 1073741824) | (xh & 3221225471);
}
function ec(xh) {
if (xh === false || xh === null || xh === (void 0)) return 0;
if (typeof xh.valueOf === 'function') {
xh = xh.valueOf();
if (xh === false || xh === null || xh === (void 0)) return 0;
}
if (xh === true) return 1;
var yh = typeof xh;
if (yh === 'number') {
var zh = xh | 0;
if (zh !== xh) zh ^= xh * 4294967295;
while (xh > 4294967295) {
xh /= 4294967295;
zh ^= xh;
}
return dc(zh);
}
if (yh === 'string') return xh.length > pc ? fc(xh) : gc(xh);
if (typeof xh.hashCode === 'function') return xh.hashCode();
return hc(xh);
}
function fc(xh) {
var yh = sc[xh];
if (yh === (void 0)) {
yh = gc(xh);
if (rc === qc) {
rc = 0;
sc = {};
}
rc++;
sc[xh] = yh;
}
return yh;
}
function gc(xh) {
var yh = 0;
for (var zh = 0; zh < xh.length; zh++) yh = 31 * yh + xh.charCodeAt(zh) | 0;
return dc(yh);
}
function hc(xh) {
var yh;
if (lc) {
yh = mc.get(xh);
if (yh !== (void 0)) return yh;
}
yh = xh[oc];
if (yh !== (void 0)) return yh;
if (!jc) {
yh = xh.propertyIsEnumerable && xh.propertyIsEnumerable[oc];
if (yh !== (void 0)) return yh;
yh = kc(xh);
if (yh !== (void 0)) return yh;
}
yh = ++nc;
if (nc & 1073741824) nc = 0;
if (lc) {
mc.set(xh, yh);
} else if (ic !== (void 0) && ic(xh) === false) {
throw new Error('Non-extensible objects are not allowed as keys.');
} else if (jc) {
Object.defineProperty(xh, oc, {
enumerable: false,
configurable: false,
writable: false,
value: yh
});
} else if (xh.propertyIsEnumerable !== (void 0) && xh.propertyIsEnumerable === xh.constructor.prototype.propertyIsEnumerable) {
xh.propertyIsEnumerable = function() {
return this.constructor.prototype.propertyIsEnumerable.apply(this, arguments);
};
xh.propertyIsEnumerable[oc] = yh;
} else if (xh.nodeType !== (void 0)) {
xh[oc] = yh;
} else throw new Error('Unable to set a non-enumerable property on object.');
return yh;
}
var ic = Object.isExtensible,
jc = (function() {
try {
Object.defineProperty({}, '@', {});
return true;
} catch (xh) {
return false;
}
}());
function kc(xh) {
if (xh && xh.nodeType > 0) switch (xh.nodeType) {
case 1:
return xh.uniqueID;
case 9:
return xh.documentElement && xh.documentElement.uniqueID;
}
}
var lc = typeof WeakMap === 'function',
mc;
if (lc) mc = new WeakMap();
var nc = 0,
oc = '__immutablehash__';
if (typeof Symbol === 'function') oc = Symbol(oc);
var pc = 16,
qc = 255,
rc = 0,
sc = {};
function tc(xh, yh) {
if (!xh) throw new Error(yh);
}
function uc(xh) {
tc(xh !== Infinity);
}
h(vc, cb);
function vc(xh, yh) {
this._iter = xh;
this._useKeys = yh;
this.size = xh.size;
}
vc.prototype.get = function(xh, yh) {
return this._iter.get(xh, yh);
};
vc.prototype.has = function(xh) {
return this._iter.has(xh);
};
vc.prototype.valueSeq = function() {
return this._iter.valueSeq();
};
vc.prototype.reverse = function() {
var xh = this,
yh = bd(this, true);
if (!this._useKeys) yh.valueSeq = function() {
return xh._iter.toSeq().reverse();
};
return yh;
};
vc.prototype.map = function(xh, yh) {
var zh = this,
ai = ad(this, xh, yh);
if (!this._useKeys) ai.valueSeq = function() {
return zh._iter.toSeq().map(xh, yh);
};
return ai;
};
vc.prototype.__iterate = function(xh, yh) {
var zh = this,
ai;
return this._iter.__iterate(this._useKeys ? function(bi, ci) {
return xh(bi, ci, zh);
} : ((ai = yh ? sd(this) : 0), function(bi) {
return xh(bi, yh ? --ai : ai++, zh);
}), yh);
};
vc.prototype.__iterator = function(xh, yh) {
if (this._useKeys) return this._iter.__iterator(xh, yh);
var zh = this._iter.__iterator(oa, yh),
ai = yh ? sd(this) : 0;
return new ta(function() {
var bi = zh.next();
return bi.done ? bi : ua(xh, yh ? --ai : ai++, bi.value, bi);
});
};
vc.prototype[ma] = true;
h(wc, db);
function wc(xh) {
this._iter = xh;
this.size = xh.size;
}
wc.prototype.includes = function(xh) {
return this._iter.includes(xh);
};
wc.prototype.__iterate = function(xh, yh) {
var zh = this,
ai = 0;
return this._iter.__iterate(function(bi) {
return xh(bi, ai++, zh);
}, yh);
};
wc.prototype.__iterator = function(xh, yh) {
var zh = this._iter.__iterator(oa, yh),
ai = 0;
return new ta(function() {
var bi = zh.next();
return bi.done ? bi : ua(xh, ai++, bi.value, bi);
});
};
h(xc, eb);
function xc(xh) {
this._iter = xh;
this.size = xh.size;
}
xc.prototype.has = function(xh) {
return this._iter.includes(xh);
};
xc.prototype.__iterate = function(xh, yh) {
var zh = this;
return this._iter.__iterate(function(ai) {
return xh(ai, ai, zh);
}, yh);
};
xc.prototype.__iterator = function(xh, yh) {
var zh = this._iter.__iterator(oa, yh);
return new ta(function() {
var ai = zh.next();
return ai.done ? ai : ua(xh, ai.value, ai.value, ai);
});
};
h(yc, cb);
function yc(xh) {
this._iter = xh;
this.size = xh.size;
}
yc.prototype.entrySeq = function() {
return this._iter.toSeq();
};
yc.prototype.__iterate = function(xh, yh) {
var zh = this;
return this._iter.__iterate(function(ai) {
if (ai) {
rd(ai);
var bi = ea(ai);
return xh(bi ? ai.get(1) : ai[1], bi ? ai.get(0) : ai[0], zh);
}
}, yh);
};
yc.prototype.__iterator = function(xh, yh) {
var zh = this._iter.__iterator(oa, yh);
return new ta(function() {
while (true) {
var ai = zh.next();
if (ai.done) return ai;
var bi = ai.value;
if (bi) {
rd(bi);
var ci = ea(bi);
return ua(xh, ci ? bi.get(0) : bi[0], ci ? bi.get(1) : bi[1], ai);
}
}
});
};
wc.prototype.cacheResult = vc.prototype.cacheResult = xc.prototype.cacheResult = yc.prototype.cacheResult = vd;
function zc(xh) {
var yh = ud(xh);
yh._iter = xh;
yh.size = xh.size;
yh.flip = function() {
return xh;
};
yh.reverse = function() {
var zh = xh.reverse.apply(this);
zh.flip = function() {
return xh.reverse();
};
return zh;
};
yh.has = function(zh) {
return xh.includes(zh);
};
yh.includes = function(zh) {
return xh.has(zh);
};
yh.cacheResult = vd;
yh.__iterateUncached = function(zh, ai) {
var bi = this;
return xh.__iterate(function(ci, di) {
return zh(di, ci, bi) !== false;
}, ai);
};
yh.__iteratorUncached = function(zh, ai) {
if (zh === pa) {
var bi = xh.__iterator(zh, ai);
return new ta(function() {
var ci = bi.next();
if (!ci.done) {
var di = ci.value[0];
ci.value[0] = ci.value[1];
ci.value[1] = di;
}
return ci;
});
}
return xh.__iterator(zh === oa ? na : oa, ai);
};
return yh;
}
function ad(xh, yh, zh) {
var ai = ud(xh);
ai.size = xh.size;
ai.has = function(bi) {
return xh.has(bi);
};
ai.get = function(bi, ci) {
var di = xh.get(bi, m);
return di === m ? ci : yh.call(zh, di, bi, xh);
};
ai.__iterateUncached = function(bi, ci) {
var di = this;
return xh.__iterate(function(ei, fi, gi) {
return bi(yh.call(zh, ei, fi, gi), fi, di) !== false;
}, ci);
};
ai.__iteratorUncached = function(bi, ci) {
var di = xh.__iterator(pa, ci);
return new ta(function() {
var ei = di.next();
if (ei.done) return ei;
var fi = ei.value,
gi = fi[0];
return ua(bi, gi, yh.call(zh, fi[1], gi, xh), ei);
});
};
return ai;
}
function bd(xh, yh) {
var zh = ud(xh);
zh._iter = xh;
zh.size = xh.size;
zh.reverse = function() {
return xh;
};
if (xh.flip) zh.flip = function() {
var ai = zc(xh);
ai.reverse = function() {
return xh.flip();
};
return ai;
};
zh.get = function(ai, bi) {
return xh.get(yh ? ai : -1 - ai, bi);
};
zh.has = function(ai) {
return xh.has(yh ? ai : -1 - ai);
};
zh.includes = function(ai) {
return xh.includes(ai);
};
zh.cacheResult = vd;
zh.__iterate = function(ai, bi) {
var ci = this;
return xh.__iterate(function(di, ei) {
return ai(di, ei, ci);
}, !bi);
};
zh.__iterator = function(ai, bi) {
return xh.__iterator(ai, !bi);
};
return zh;
}
function cd(xh, yh, zh, ai) {
var bi = ud(xh);
if (ai) {
bi.has = function(ci) {
var di = xh.get(ci, m);
return di !== m && !!yh.call(zh, di, ci, xh);
};
bi.get = function(ci, di) {
var ei = xh.get(ci, m);
return ei !== m && yh.call(zh, ei, ci, xh) ? ei : di;
};
}
bi.__iterateUncached = function(ci, di) {
var ei = this,
fi = 0;
xh.__iterate(function(gi, hi, ii) {
if (yh.call(zh, gi, hi, ii)) {
fi++;
return ci(gi, ai ? hi : fi - 1, ei);
}
}, di);
return fi;
};
bi.__iteratorUncached = function(ci, di) {
var ei = xh.__iterator(pa, di),
fi = 0;
return new ta(function() {
while (true) {
var gi = ei.next();
if (gi.done) return gi;
var hi = gi.value,
ii = hi[0],
ji = hi[1];
if (yh.call(zh, ji, ii, xh)) return ua(ci, ai ? ii : fi++, ji, gi);
}
});
};
return bi;
}
function dd(xh, yh, zh) {
var ai = yd().asMutable();
xh.__iterate(function(bi, ci) {
ai.update(yh.call(zh, bi, ci, xh), 0, function(di) {
return di + 1;
});
});
return ai.asImmutable();
}
function ed(xh, yh, zh) {
var ai = fa(xh),
bi = (ia(xh) ? xf() : yd()).asMutable();
xh.__iterate(function(di, ei) {
bi.update(yh.call(zh, di, ei, xh), function(fi) {
return (fi = fi || [], fi.push(ai ? [ei, di] : di), fi);
});
});
var ci = td(xh);
return bi.map(function(di) {
return qd(xh, ci(di));
});
}
function fd(xh, yh, zh, ai) {
var bi = xh.size;
if (w(yh, zh, bi)) return xh;
var ci = x(yh, bi),
di = y(zh, bi);
if (ci !== ci || di !== di) return fd(xh.toSeq().cacheResult(), yh, zh, ai);
var ei = di - ci,
fi;
if (ei === ei) fi = ei < 0 ? 0 : ei;
var gi = ud(xh);
gi.size = fi;
if (!ai && kb(xh) && fi >= 0) gi.get = function(hi, ii) {
hi = u(this, hi);
return hi >= 0 && hi < fi ? xh.get(hi + ci, ii) : ii;
};
gi.__iterateUncached = function(hi, ii) {
var ji = this;
if (fi === 0) return 0;
if (ii) return this.cacheResult().__iterate(hi, ii);
var ki = 0,
li = true,
mi = 0;
xh.__iterate(function(ni, oi) {
if (!(li && (li = ki++ < ci))) {
mi++;
return hi(ni, ai ? oi : mi - 1, ji) !== false && mi !== fi;
}
});
return mi;
};
gi.__iteratorUncached = function(hi, ii) {
if (fi !== 0 && ii) return this.cacheResult().__iterator(hi, ii);
var ji = fi !== 0 && xh.__iterator(hi, ii),
ki = 0,
li = 0;
return new ta(function() {
while (ki++ < ci) ji.next();
if (++li > fi) return va();
var mi = ji.next();
if (ai || hi === oa) {
return mi;
} else if (hi === na) {
return ua(hi, li - 1, (void 0), mi);
} else return ua(hi, li - 1, mi.value[1], mi);
});
};
return gi;
}
function gd(xh, yh, zh) {
var ai = ud(xh);
ai.__iterateUncached = function(bi, ci) {
var di = this;
if (ci) return this.cacheResult().__iterate(bi, ci);
var ei = 0;
xh.__iterate(function(fi, gi, hi) {
return yh.call(zh, fi, gi, hi) && ++ei && bi(fi, gi, di);
});
return ei;
};
ai.__iteratorUncached = function(bi, ci) {
var di = this;
if (ci) return this.cacheResult().__iterator(bi, ci);
var ei = xh.__iterator(pa, ci),
fi = true;
return new ta(function() {
if (!fi) return va();
var gi = ei.next();
if (gi.done) return gi;
var hi = gi.value,
ii = hi[0],
ji = hi[1];
if (!yh.call(zh, ji, ii, di)) {
fi = false;
return va();
}
return bi === pa ? gi : ua(bi, ii, ji, gi);
});
};
return ai;
}
function hd(xh, yh, zh, ai) {
var bi = ud(xh);
bi.__iterateUncached = function(ci, di) {
var ei = this;
if (di) return this.cacheResult().__iterate(ci, di);
var fi = true,
gi = 0;
xh.__iterate(function(hi, ii, ji) {
if (!(fi && (fi = yh.call(zh, hi, ii, ji)))) {
gi++;
return ci(hi, ai ? ii : gi - 1, ei);
}
});
return gi;
};
bi.__iteratorUncached = function(ci, di) {
var ei = this;
if (di) return this.cacheResult().__iterator(ci, di);
var fi = xh.__iterator(pa, di),
gi = true,
hi = 0;
return new ta(function() {
var ii, ji, ki;
do {
ii = fi.next();
if (ii.done)
if (ai || ci === oa) {
return ii;
} else if (ci === na) {
return ua(ci, hi++, (void 0), ii);
} else return ua(ci, hi++, ii.value[1], ii);
var li = ii.value;
ji = li[0];
ki = li[1];
gi && (gi = yh.call(zh, ki, ji, ei));
} while (gi);
return ci === pa ? ii : ua(ci, ji, ki, ii);
});
};
return bi;
}
function id(xh, yh) {
var zh = fa(xh),
ai = [xh].concat(yh).map(function(di) {
if (!ea(di)) {
di = zh ? nb(di) : ob(Array.isArray(di) ? di : [di]);
} else if (zh) di = ba(di);
return di;
}).filter(function(di) {
return di.size !== 0;
});
if (ai.length === 0) return xh;
if (ai.length === 1) {
var bi = ai[0];
if (bi === xh || zh && fa(bi) || ga(xh) && ga(bi)) return bi;
}
var ci = new gb(ai);
if (zh) {
ci = ci.toKeyedSeq();
} else if (!ga(xh)) ci = ci.toSetSeq();
ci = ci.flatten(true);
ci.size = ai.reduce(function(di, ei) {
if (di !== (void 0)) {
var fi = ei.size;
if (fi !== (void 0)) return di + fi;
}
}, 0);
return ci;
}
function jd(xh, yh, zh) {
var ai = ud(xh);
ai.__iterateUncached = function(bi, ci) {
var di = 0,
ei = false;
function fi(gi, hi) {
var ii = this;
gi.__iterate(function(ji, ki) {
if ((!yh || hi < yh) && ea(ji)) {
fi(ji, hi + 1);
} else if (bi(ji, zh ? ki : di++, ii) === false) ei = true;
return !ei;
}, ci);
}
fi(xh, 0);
return di;
};
ai.__iteratorUncached = function(bi, ci) {
var di = xh.__iterator(bi, ci),
ei = [],
fi = 0;
return new ta(function() {
while (di) {
var gi = di.next();
if (gi.done !== false) {
di = ei.pop();
continue;
}
var hi = gi.value;
if (bi === pa) hi = hi[1];
if ((!yh || ei.length < yh) && ea(hi)) {
ei.push(di);
di = hi.__iterator(bi, ci);
} else return zh ? gi : ua(bi, fi++, hi, gi);
}
return va();
});
};
return ai;
}
function kd(xh, yh, zh) {
var ai = td(xh);
return xh.toSeq().map(function(bi, ci) {
return ai(yh.call(zh, bi, ci, xh));
}).flatten(true);
}
function ld(xh, yh) {
var zh = ud(xh);
zh.size = xh.size && xh.size * 2 - 1;
zh.__iterateUncached = function(ai, bi) {
var ci = this,
di = 0;
xh.__iterate(function(ei, fi) {
return (!di || ai(yh, di++, ci) !== false) && ai(ei, di++, ci) !== false;
}, bi);
return di;
};
zh.__iteratorUncached = function(ai, bi) {
var ci = xh.__iterator(oa, bi),
di = 0,
ei;
return new ta(function() {
if (!ei || di % 2) {
ei = ci.next();
if (ei.done) return ei;
}
return di % 2 ? ua(ai, di++, yh) : ua(ai, di++, ei.value, ei);
});
};
return zh;
}
function md(xh, yh, zh) {
if (!yh) yh = wd;
var ai = fa(xh),
bi = 0,
ci = xh.toSeq().map(function(di, ei) {
return [ei, di, bi++, zh ? zh(di, ei, xh) : di];
}).toArray();
ci.sort(function(di, ei) {
return yh(di[3], ei[3]) || di[2] - ei[2];
}).forEach(ai ? function(di, ei) {
ci[ei].length = 2;
} : function(di, ei) {
ci[ei] = di[1];
});
return ai ? cb(ci) : ga(xh) ? db(ci) : eb(ci);
}
function nd(xh, yh, zh) {
if (!yh) yh = wd;
if (zh) {
var ai = xh.toSeq().map(function(bi, ci) {
return [bi, zh(bi, ci, xh)];
}).reduce(function(bi, ci) {
return od(yh, bi[1], ci[1]) ? ci : bi;
});
return ai && ai[0];
} else return xh.reduce(function(bi, ci) {
return od(yh, bi, ci) ? ci : bi;
});
}
function od(xh, yh, zh) {
var ai = xh(zh, yh);
return (ai === 0 && zh !== yh && (zh === (void 0) || zh === null || zh !== zh)) || ai > 0;
}
function pd(xh, yh, zh) {
var ai = ud(xh);
ai.size = new gb(zh).map(function(bi) {
return bi.size;
}).min();
ai.__iterate = function(bi, ci) {
var di = this.__iterator(oa, ci),
ei, fi = 0;
while (!(ei = di.next()).done)
if (bi(ei.value, fi++, this) === false) break;
return fi;
};
ai.__iteratorUncached = function(bi, ci) {
var di = zh.map(function(gi) {
return (gi = aa(gi), ya(ci ? gi.reverse() : gi));
}),
ei = 0,
fi = false;
return new ta(function() {
var gi;
if (!fi) {
gi = di.map(function(hi) {
return hi.next();
});
fi = gi.some(function(hi) {
return hi.done;
});
}
if (fi) return va();
return ua(bi, ei++, yh.apply(null, gi.map(function(hi) {
return hi.value;
})));
});
};
return ai;
}
function qd(xh, yh) {
return kb(xh) ? yh : xh.constructor(yh);
}
function rd(xh) {
if (xh !== Object(xh)) throw new TypeError('Expected [K, V] tuple: ' + xh);
}
function sd(xh) {
uc(xh.size);
return t(xh);
}
function td(xh) {
return fa(xh) ? ba : ga(xh) ? ca : da;
}
function ud(xh) {
return Object.create((fa(xh) ? cb : ga(xh) ? db : eb).prototype);
}
function vd() {
if (this._iter.cacheResult) {
this._iter.cacheResult();
this.size = this._iter.size;
return this;
} else return bb.prototype.cacheResult.call(this);
}
function wd(xh, yh) {
return xh > yh ? 1 : xh < yh ? -1 : 0;
}
function xd(xh) {
var yh = ya(xh);
if (!yh) {
if (!ab(xh)) throw new TypeError('Expected iterable or array-like: ' + xh);
yh = ya(aa(xh));
}
return yh;
}
h(yd, ub);
function yd(xh) {
return xh === null || xh === (void 0) ? me() : zd(xh) ? xh : me().withMutations(function(yh) {
var zh = ba(xh);
uc(zh.size);
zh.forEach(function(ai, bi) {
return yh.set(bi, ai);
});
});
}
yd.prototype.toString = function() {
return this.__toString('Map {', '}');
};
yd.prototype.get = function(xh, yh) {
return this._root ? this._root.get(0, (void 0), xh, yh) : yh;
};
yd.prototype.set = function(xh, yh) {
return ne(this, xh, yh);
};
yd.prototype.setIn = function(xh, yh) {
return this.updateIn(xh, m, function() {
return yh;
});
};
yd.prototype.remove = function(xh) {
return ne(this, xh, m);
};
yd.prototype.deleteIn = function(xh) {
return this.updateIn(xh, function() {
return m;
});
};
yd.prototype.update = function(xh, yh, zh) {
return arguments.length === 1 ? xh(this) : this.updateIn([xh], yh, zh);
};
yd.prototype.updateIn = function(xh, yh, zh) {
if (!zh) {
zh = yh;
yh = (void 0);
}
var ai = xe(this, xd(xh), yh, zh);
return ai === m ? (void 0) : ai;
};
yd.prototype.clear = function() {
if (this.size === 0) return this;
if (this.__ownerID) {
this.size = 0;
this._root = null;
this.__hash = (void 0);
this.__altered = true;
return this;
}
return me();
};
yd.prototype.merge = function() {
return ue(this, (void 0), arguments);
};
yd.prototype.mergeWith = function(xh) {
var yh = g.call(arguments, 1);
return ue(this, xh, yh);
};
yd.prototype.mergeIn = function(xh) {
var yh = g.call(arguments, 1);
return this.updateIn(xh, me(), function(zh) {
return typeof zh.merge === 'function' ? zh.merge.apply(zh, yh) : yh[yh.length - 1];
});
};
yd.prototype.mergeDeep = function() {
return ue(this, ve((void 0)), arguments);
};
yd.prototype.mergeDeepWith = function(xh) {
var yh = g.call(arguments, 1);
return ue(this, ve(xh), yh);
};
yd.prototype.mergeDeepIn = function(xh) {
var yh = g.call(arguments, 1);
return this.updateIn(xh, me(), function(zh) {
return typeof zh.mergeDeep === 'function' ? zh.mergeDeep.apply(zh, yh) : yh[yh.length - 1];
});
};
yd.prototype.sort = function(xh) {
return xf(md(this, xh));
};
yd.prototype.sortBy = function(xh, yh) {
return xf(md(this, yh, xh));
};
yd.prototype.withMutations = function(xh) {
var yh = this.asMutable();
xh(yh);
return yh.wasAltered() ? yh.__ensureOwner(this.__ownerID) : this;
};
yd.prototype.asMutable = function() {
return this.__ownerID ? this : this.__ensureOwner(new r());
};
yd.prototype.asImmutable = function() {
return this.__ensureOwner();
};
yd.prototype.wasAltered = function() {
return this.__altered;
};
yd.prototype.__iterator = function(xh, yh) {
return new he(this, xh, yh);
};
yd.prototype.__iterate = function(xh, yh) {
var zh = this,
ai = 0;
this._root && this._root.iterate(function(bi) {
ai++;
return xh(bi[1], bi[0], zh);
}, yh);
return ai;
};
yd.prototype.__ensureOwner = function(xh) {
if (xh === this.__ownerID) return this;
if (!xh) {
this.__ownerID = xh;
this.__altered = false;
return this;
}
return ke(this.size, this._root, xh, this.__hash);
};
function zd(xh) {
return !!(xh && xh[ae]);
}
yd.isMap = zd;
var ae = '@@__IMMUTABLE_MAP__@@',
be = yd.prototype;
be[ae] = true;
be[i] = be.remove;
be.removeIn = be.deleteIn;
function ce(xh, yh) {
this.ownerID = xh;
this.entries = yh;
}
ce.prototype.get = function(xh, yh, zh, ai) {
var bi = this.entries;
for (var ci = 0, di = bi.length; ci < di; ci++)
if (xb(zh, bi[ci][0])) return bi[ci][1];
return ai;
};
ce.prototype.update = function(xh, yh, zh, ai, bi, ci, di) {
var ei = bi === m,
fi = this.entries,
gi = 0;
for (var hi = fi.length; gi < hi; gi++)
if (xb(ai, fi[gi][0])) break;
var ii = gi < hi;
if (ii ? fi[gi][1] === bi : ei) return this;
q(di);
(ei || !ii) && q(ci);
if (ei && fi.length === 1) return;
if (!ii && !ei && fi.length >= cf) return re(xh, fi, ai, bi);
var ji = xh && xh === this.ownerID,
ki = ji ? fi : s(fi);
if (ii) {
if (ei) {
gi === hi - 1 ? ki.pop() : (ki[gi] = ki.pop());
} else ki[gi] = [ai, bi];
} else ki.push([ai, bi]);
if (ji) {
this.entries = ki;
return this;
}
return new ce(xh, ki);
};
function de(xh, yh, zh) {
this.ownerID = xh;
this.bitmap = yh;
this.nodes = zh;
}
de.prototype.get = function(xh, yh, zh, ai) {
if (yh === (void 0)) yh = ec(zh);
var bi = (1 << ((xh === 0 ? yh : yh >>> xh) & l)),
ci = this.bitmap;
return (ci & bi) === 0 ? ai : this.nodes[ye(ci & (bi - 1))].get(xh + j, yh, zh, ai);
};
de.prototype.update = function(xh, yh, zh, ai, bi, ci, di) {
if (zh === (void 0)) zh = ec(ai);
var ei = (yh === 0 ? zh : zh >>> yh) & l,
fi = 1 << ei,
gi = this.bitmap,
hi = (gi & fi) !== 0;
if (!hi && bi === m) return this;
var ii = ye(gi & (fi - 1)),
ji = this.nodes,
ki = hi ? ji[ii] : (void 0),
li = oe(ki, xh, yh + j, zh, ai, bi, ci, di);
if (li === ki) return this;
if (!hi && li && ji.length >= df) return te(xh, ji, gi, ei, li);
if (hi && !li && ji.length === 2 && pe(ji[ii ^ 1])) return ji[ii ^ 1];
if (hi && li && ji.length === 1 && pe(li)) return li;
var mi = xh && xh === this.ownerID,
ni = hi ? li ? gi : gi ^ fi : gi | fi,
oi = hi ? li ? ze(ji, ii, li, mi) : bf(ji, ii, mi) : af(ji, ii, li, mi);
if (mi) {
this.bitmap = ni;
this.nodes = oi;
return this;
}
return new de(xh, ni, oi);
};
function ee(xh, yh, zh) {
this.ownerID = xh;
this.count = yh;
this.nodes = zh;
}
ee.prototype.get = function(xh, yh, zh, ai) {
if (yh === (void 0)) yh = ec(zh);
var bi = (xh === 0 ? yh : yh >>> xh) & l,
ci = this.nodes[bi];
return ci ? ci.get(xh + j, yh, zh, ai) : ai;
};
ee.prototype.update = function(xh, yh, zh, ai, bi, ci, di) {
if (zh === (void 0)) zh = ec(ai);
var ei = (yh === 0 ? zh : zh >>> yh) & l,
fi = bi === m,
gi = this.nodes,
hi = gi[ei];
if (fi && !hi) return this;
var ii = oe(hi, xh, yh + j, zh, ai, bi, ci, di);
if (ii === hi) return this;
var ji = this.count;
if (!hi) {
ji++;
} else if (!ii) {
ji--;
if (ji < ef) return se(xh, gi, ji, ei);
}
var ki = xh && xh === this.ownerID,
li = ze(gi, ei, ii, ki);
if (ki) {
this.count = ji;
this.nodes = li;
return this;
}
return new ee(xh, ji, li);
};
function fe(xh, yh, zh) {
this.ownerID = xh;
this.keyHash = yh;
this.entries = zh;
}
fe.prototype.get = function(xh, yh, zh, ai) {
var bi = this.entries;
for (var ci = 0, di = bi.length; ci < di; ci++)
if (xb(zh, bi[ci][0])) return bi[ci][1];
return ai;
};
fe.prototype.update = function(xh, yh, zh, ai, bi, ci, di) {
if (zh === (void 0)) zh = ec(ai);
var ei = bi === m;
if (zh !== this.keyHash) {
if (ei) return this;
q(di);
q(ci);
return qe(this, xh, yh, zh, [ai, bi]);
}
var fi = this.entries,
gi = 0;
for (var hi = fi.length; gi < hi; gi++)
if (xb(ai, fi[gi][0])) break;
var ii = gi < hi;
if (ii ? fi[gi][1] === bi : ei) return this;
q(di);
(ei || !ii) && q(ci);
if (ei && hi === 2) return new ge(xh, this.keyHash, fi[gi ^ 1]);
var ji = xh && xh === this.ownerID,
ki = ji ? fi : s(fi);
if (ii) {
if (ei) {
gi === hi - 1 ? ki.pop() : (ki[gi] = ki.pop());
} else ki[gi] = [ai, bi];
} else ki.push([ai, bi]);
if (ji) {
this.entries = ki;
return this;
}
return new fe(xh, this.keyHash, ki);
};
function ge(xh, yh, zh) {
this.ownerID = xh;
this.keyHash = yh;
this.entry = zh;
}
ge.prototype.get = function(xh, yh, zh, ai) {
return xb(zh, this.entry[0]) ? this.entry[1] : ai;
};
ge.prototype.update = function(xh, yh, zh, ai, bi, ci, di) {
var ei = bi === m,
fi = xb(ai, this.entry[0]);
if (fi ? bi === this.entry[1] : ei) return this;
q(di);
if (ei) {
q(ci);
return;
}
if (fi) {
if (xh && xh === this.ownerID) {
this.entry[1] = bi;
return this;
}
return new ge(xh, this.keyHash, [ai, bi]);
}
q(ci);
return qe(this, xh, yh, ec(ai), [ai, bi]);
};
ce.prototype.iterate = fe.prototype.iterate = function(xh, yh) {
var zh = this.entries;
for (var ai = 0, bi = zh.length - 1; ai <= bi; ai++)
if (xh(zh[yh ? bi - ai : ai]) === false) return false;
};
de.prototype.iterate = ee.prototype.iterate = function(xh, yh) {
var zh = this.nodes;
for (var ai = 0, bi = zh.length - 1; ai <= bi; ai++) {
var ci = zh[yh ? bi - ai : ai];
if (ci && ci.iterate(xh, yh) === false) return false;
}
};
ge.prototype.iterate = function(xh, yh) {
return xh(this.entry);
};
h(he, ta);
function he(xh, yh, zh) {
this._type = yh;
this._reverse = zh;
this._stack = xh._root && je(xh._root);
}
he.prototype.next = function() {
var xh = this._type,
yh = this._stack;
while (yh) {
var zh = yh.node,
ai = yh.index++,
bi;
if (zh.entry) {
if (ai === 0) return ie(xh, zh.entry);
} else if (zh.entries) {
bi = zh.entries.length - 1;
if (ai <= bi) return ie(xh, zh.entries[this._reverse ? bi - ai : ai]);
} else {
bi = zh.nodes.length - 1;
if (ai <= bi) {
var ci = zh.nodes[this._reverse ? bi - ai : ai];
if (ci) {
if (ci.entry) return ie(xh, ci.entry);
yh = this._stack = je(ci, yh);
}
continue;
}
}
yh = this._stack = this._stack.__prev;
}
return va();
};
function ie(xh, yh) {
return ua(xh, yh[0], yh[1]);
}
function je(xh, yh) {
return {
node: xh,
index: 0,
__prev: yh
};
}
function ke(xh, yh, zh, ai) {
var bi = Object.create(be);
bi.size = xh;
bi._root = yh;
bi.__ownerID = zh;
bi.__hash = ai;
bi.__altered = false;
return bi;
}
var le;
function me() {
return le || (le = ke(0));
}
function ne(xh, yh, zh) {
var ai, bi;
if (!xh._root) {
if (zh === m) return xh;
bi = 1;
ai = new ce(xh.__ownerID, [
[yh, zh]
]);
} else {
var ci = p(n),
di = p(o);
ai = oe(xh._root, xh.__ownerID, 0, (void 0), yh, zh, ci, di);
if (!di.value) return xh;
bi = xh.size + (ci.value ? zh === m ? -1 : 1 : 0);
}
if (xh.__ownerID) {
xh.size = bi;
xh._root = ai;
xh.__hash = (void 0);
xh.__altered = true;
return xh;
}
return ai ? ke(bi, ai) : me();
}
function oe(xh, yh, zh, ai, bi, ci, di, ei) {
if (!xh) {
if (ci === m) return xh;
q(ei);
q(di);
return new ge(yh, ai, [bi, ci]);
}
return xh.update(yh, zh, ai, bi, ci, di, ei);
}
function pe(xh) {
return xh.constructor === ge || xh.constructor === fe;
}
function qe(xh, yh, zh, ai, bi) {
if (xh.keyHash === ai) return new fe(yh, ai, [xh.entry, bi]);
var ci = (zh === 0 ? xh.keyHash : xh.keyHash >>> zh) & l,
di = (zh === 0 ? ai : ai >>> zh) & l,
ei, fi = ci === di ? [qe(xh, yh, zh + j, ai, bi)] : ((ei = new ge(yh, ai, bi)), ci < di ? [xh, ei] : [ei, xh]);
return new de(yh, (1 << ci) | (1 << di), fi);
}
function re(xh, yh, zh, ai) {
if (!xh) xh = new r();
var bi = new ge(xh, ec(zh), [zh, ai]);
for (var ci = 0; ci < yh.length; ci++) {
var di = yh[ci];
bi = bi.update(xh, 0, (void 0), di[0], di[1]);
}
return bi;
}
function se(xh, yh, zh, ai) {
var bi = 0,
ci = 0,
di = new Array(zh);
for (var ei = 0, fi = 1, gi = yh.length; ei < gi; ei++, fi <<= 1) {
var hi = yh[ei];
if (hi !== (void 0) && ei !== ai) {
bi |= fi;
di[ci++] = hi;
}
}
return new de(xh, bi, di);
}
function te(xh, yh, zh, ai, bi) {
var ci = 0,
di = new Array(k);
for (var ei = 0; zh !== 0; ei++, zh >>>= 1) di[ei] = zh & 1 ? yh[ci++] : (void 0);
di[ai] = bi;
return new ee(xh, ci + 1, di);
}
function ue(xh, yh, zh) {
var ai = [];
for (var bi = 0; bi < zh.length; bi++) {
var ci = zh[bi],
di = ba(ci);
if (!ea(ci)) di = di.map(function(ei) {
return yb(ei);
});
ai.push(di);
}
return we(xh, yh, ai);
}
function ve(xh) {
return function(yh, zh, ai) {
return yh && yh.mergeDeepWith && ea(zh) ? yh.mergeDeepWith(xh, zh) : xh ? xh(yh, zh, ai) : zh;
};
}
function we(xh, yh, zh) {
zh = zh.filter(function(ai) {
return ai.size !== 0;
});
if (zh.length === 0) return xh;
if (xh.size === 0 && !xh.__ownerID && zh.length === 1) return xh.constructor(zh[0]);
return xh.withMutations(function(ai) {
var bi = yh ? function(di, ei) {
ai.update(ei, m, function(fi) {
return fi === m ? di : yh(fi, di, ei);
});
} : function(di, ei) {
ai.set(ei, di);
};
for (var ci = 0; ci < zh.length; ci++) zh[ci].forEach(bi);
});
}
function xe(xh, yh, zh, ai) {
var bi = xh === m,
ci = yh.next();
if (ci.done) {
var di = bi ? zh : xh,
ei = ai(di);
return ei === di ? xh : ei;
}
tc(bi || (xh && xh.set));
var fi = ci.value,
gi = bi ? m : xh.get(fi, m),
hi = xe(gi, yh, zh, ai);
return hi === gi ? xh : hi === m ? xh.remove(fi) : (bi ? me() : xh).set(fi, hi);
}
function ye(xh) {
xh = xh - ((xh >> 1) & 1431655765);
xh = (xh & 858993459) + ((xh >> 2) & 858993459);
xh = (xh + (xh >> 4)) & 252645135;
xh = xh + (xh >> 8);
xh = xh + (xh >> 16);
return xh & 127;
}
function ze(xh, yh, zh, ai) {
var bi = ai ? xh : s(xh);
bi[yh] = zh;
return bi;
}
function af(xh, yh, zh, ai) {
var bi = xh.length + 1;
if (ai && yh + 1 === bi) {
xh[yh] = zh;
return xh;
}
var ci = new Array(bi),
di = 0;
for (var ei = 0; ei < bi; ei++)
if (ei === yh) {
ci[ei] = zh;
di = -1;
} else ci[ei] = xh[ei + di];
return ci;
}
function bf(xh, yh, zh) {
var ai = xh.length - 1;
if (zh && yh === ai) {
xh.pop();
return xh;
}
var bi = new Array(ai),
ci = 0;
for (var di = 0; di < ai; di++) {
if (di === yh) ci = 1;
bi[di] = xh[di + ci];
}
return bi;
}
var cf = k / 4,
df = k / 2,
ef = k / 4;
h(ff, vb);
function ff(xh) {
var yh = pf();
if (xh === null || xh === (void 0)) return yh;
if (gf(xh)) return xh;
var zh = ca(xh),
ai = zh.size;
if (ai === 0) return yh;
uc(ai);
if (ai > 0 && ai < k) return nf(0, ai, j, null, new kf(zh.toArray()));
return yh.withMutations(function(bi) {
bi.setSize(ai);
zh.forEach(function(ci, di) {
return bi.set(di, ci);
});
});
}
ff.of = function() {
return this(arguments);
};
ff.prototype.toString = function() {
return this.__toString('List [', ']');
};
ff.prototype.get = function(xh, yh) {
xh = u(this, xh);
if (xh < 0 || xh >= this.size) return yh;
xh += this._origin;
var zh = tf(this, xh);
return zh && zh.array[xh & l];
};
ff.prototype.set = function(xh, yh) {
return qf(this, xh, yh);
};
ff.prototype.remove = function(xh) {
return !this.has(xh) ? this : xh === 0 ? this.shift() : xh === this.size - 1 ? this.pop() : this.splice(xh, 1);
};
ff.prototype.clear = function() {
if (this.size === 0) return this;
if (this.__ownerID) {
this.size = this._origin = this._capacity = 0;
this._level = j;
this._root = this._tail = null;
this.__hash = (void 0);
this.__altered = true;
return this;
}
return pf();
};
ff.prototype.push = function() {
var xh = arguments,
yh = this.size;
return this.withMutations(function(zh) {
uf(zh, 0, yh + xh.length);
for (var ai = 0; ai < xh.length; ai++) zh.set(yh + ai, xh[ai]);
});
};
ff.prototype.pop = function() {
return uf(this, 0, -1);
};
ff.prototype.unshift = function() {
var xh = arguments;
return this.withMutations(function(yh) {
uf(yh, -xh.length);
for (var zh = 0; zh < xh.length; zh++) yh.set(zh, xh[zh]);
});
};
ff.prototype.shift = function() {
return uf(this, 1);
};
ff.prototype.merge = function() {
return vf(this, (void 0), arguments);
};
ff.prototype.mergeWith = function(xh) {
var yh = g.call(arguments, 1);
return vf(this, xh, yh);
};
ff.prototype.mergeDeep = function() {
return vf(this, ve((void 0)), arguments);
};
ff.prototype.mergeDeepWith = function(xh) {
var yh = g.call(arguments, 1);
return vf(this, ve(xh), yh);
};
ff.prototype.setSize = function(xh) {
return uf(this, 0, xh);
};
ff.prototype.slice = function(xh, yh) {
var zh = this.size;
if (w(xh, yh, zh)) return this;
return uf(this, x(xh, zh), y(yh, zh));
};
ff.prototype.__iterator = function(xh, yh) {
var zh = 0,
ai = mf(this, yh);
return new ta(function() {
var bi = ai();
return bi === lf ? va() : ua(xh, zh++, bi);
});
};
ff.prototype.__iterate = function(xh, yh) {
var zh = 0,
ai = mf(this, yh),
bi;
while ((bi = ai()) !== lf)
if (xh(bi, zh++, this) === false) break;
return zh;
};
ff.prototype.__ensureOwner = function(xh) {
if (xh === this.__ownerID) return this;
if (!xh) {
this.__ownerID = xh;
return this;
}
return nf(this._origin, this._capacity, this._level, this._root, this._tail, xh, this.__hash);
};
function gf(xh) {
return !!(xh && xh[hf]);
}
ff.isList = gf;
var hf = '@@__IMMUTABLE_LIST__@@',
jf = ff.prototype;
jf[hf] = true;
jf[i] = jf.remove;
jf.setIn = be.setIn;
jf.deleteIn = jf.removeIn = be.removeIn;
jf.update = be.update;
jf.updateIn = be.updateIn;
jf.mergeIn = be.mergeIn;
jf.mergeDeepIn = be.mergeDeepIn;
jf.withMutations = be.withMutations;
jf.asMutable = be.asMutable;
jf.asImmutable = be.asImmutable;
jf.wasAltered = be.wasAltered;
function kf(xh, yh) {
this.array = xh;
this.ownerID = yh;
}
kf.prototype.removeBefore = function(xh, yh, zh) {
if (zh === yh ? 1 << yh : this.array.length === 0) return this;
var ai = (zh >>> yh) & l;
if (ai >= this.array.length) return new kf([], xh);
var bi = ai === 0,
ci;
if (yh > 0) {
var di = this.array[ai];
ci = di && di.removeBefore(xh, yh - j, zh);
if (ci === di && bi) return this;
}
if (bi && !ci) return this;
var ei = sf(this, xh);
if (!bi)
for (var fi = 0; fi < ai; fi++) ei.array[fi] = (void 0);
if (ci) ei.array[ai] = ci;
return ei;
};
kf.prototype.removeAfter = function(xh, yh, zh) {
if (zh === yh ? 1 << yh : this.array.length === 0) return this;
var ai = ((zh - 1) >>> yh) & l;
if (ai >= this.array.length) return this;
var bi = ai === this.array.length - 1,
ci;
if (yh > 0) {
var di = this.array[ai];
ci = di && di.removeAfter(xh, yh - j, zh);
if (ci === di && bi) return this;
}
if (bi && !ci) return this;
var ei = sf(this, xh);
if (!bi) ei.array.pop();
if (ci) ei.array[ai] = ci;
return ei;
};
var lf = {};
function mf(xh, yh) {
var zh = xh._origin,
ai = xh._capacity,
bi = wf(ai),
ci = xh._tail;
return di(xh._root, xh._level, 0);
function di(gi, hi, ii) {
return hi === 0 ? ei(gi, ii) : fi(gi, hi, ii);
}
function ei(gi, hi) {
var ii = hi === bi ? ci && ci.array : gi && gi.array,
ji = hi > zh ? 0 : zh - hi,
ki = ai - hi;
if (ki > k) ki = k;
return function() {
if (ji === ki) return lf;
var li = yh ? --ki : ji++;
return ii && ii[li];
};
}
function fi(gi, hi, ii) {
var ji, ki = gi && gi.array,
li = ii > zh ? 0 : (zh - ii) >> hi,
mi = ((ai - ii) >> hi) + 1;
if (mi > k) mi = k;
return function() {
do {
if (ji) {
var ni = ji();
if (ni !== lf) return ni;
ji = null;
}
if (li === mi) return lf;
var oi = yh ? --mi : li++;
ji = di(ki && ki[oi], hi - j, ii + (oi << hi));
} while (true);
};
}
}
function nf(xh, yh, zh, ai, bi, ci, di) {
var ei = Object.create(jf);
ei.size = yh - xh;
ei._origin = xh;
ei._capacity = yh;
ei._level = zh;
ei._root = ai;
ei._tail = bi;
ei.__ownerID = ci;
ei.__hash = di;
ei.__altered = false;
return ei;
}
var of;
function pf() {
return of || (of = nf(0, 0, j));
}
function qf(xh, yh, zh) {
yh = u(xh, yh);
if (yh >= xh.size || yh < 0) return xh.withMutations(function(di) {
yh < 0 ? uf(di, yh).set(0, zh) : uf(di, 0, yh + 1).set(yh, zh);
});
yh += xh._origin;
var ai = xh._tail,
bi = xh._root,
ci = p(o);
if (yh >= wf(xh._capacity)) {
ai = rf(ai, xh.__ownerID, 0, yh, zh, ci);
} else bi = rf(bi, xh.__ownerID, xh._level, yh, zh, ci);
if (!ci.value) return xh;
if (xh.__ownerID) {
xh._root = bi;
xh._tail = ai;
xh.__hash = (void 0);
xh.__altered = true;
return xh;
}
return nf(xh._origin, xh._capacity, xh._level, bi, ai);
}
function rf(xh, yh, zh, ai, bi, ci) {
var di = (ai >>> zh) & l,
ei = xh && di < xh.array.length;
if (!ei && bi === (void 0)) return xh;
var fi;
if (zh > 0) {
var gi = xh && xh.array[di],
hi = rf(gi, yh, zh - j, ai, bi, ci);
if (hi === gi) return xh;
fi = sf(xh, yh);
fi.array[di] = hi;
return fi;
}
if (ei && xh.array[di] === bi) return xh;
q(ci);
fi = sf(xh, yh);
if (bi === (void 0) && di === fi.array.length - 1) {
fi.array.pop();
} else fi.array[di] = bi;
return fi;
}
function sf(xh, yh) {
if (yh && xh && yh === xh.ownerID) return xh;
return new kf(xh ? xh.array.slice() : [], yh);
}
function tf(xh, yh) {
if (yh >= wf(xh._capacity)) return xh._tail;
if (yh < 1 << (xh._level + j)) {
var zh = xh._root,
ai = xh._level;
while (zh && ai > 0) {
zh = zh.array[(yh >>> ai) & l];
ai -= j;
}
return zh;
}
}
function uf(xh, yh, zh) {
var ai = xh.__ownerID || new r(),
bi = xh._origin,
ci = xh._capacity,
di = bi + yh,
ei = zh === (void 0) ? ci : zh < 0 ? ci + zh : bi + zh;
if (di === bi && ei === ci) return xh;
if (di >= ei) return xh.clear();
var fi = xh._level,
gi = xh._root,
hi = 0;
while (di + hi < 0) {
gi = new kf(gi && gi.array.length ? [(void 0), gi] : [], ai);
fi += j;
hi += 1 << fi;
}
if (hi) {
di += hi;
bi += hi;
ei += hi;
ci += hi;
}
var ii = wf(ci),
ji = wf(ei);
while (ji >= 1 << (fi + j)) {
gi = new kf(gi && gi.array.length ? [gi] : [], ai);
fi += j;
}
var ki = xh._tail,
li = ji < ii ? tf(xh, ei - 1) : ji > ii ? new kf([], ai) : ki;
if (ki && ji > ii && di < ci && ki.array.length) {
gi = sf(gi, ai);
var mi = gi;
for (var ni = fi; ni > j; ni -= j) {
var oi = (ii >>> ni) & l;
mi = mi.array[oi] = sf(mi.array[oi], ai);
}
mi.array[(ii >>> j) & l] = ki;
}
if (ei < ci) li = li && li.removeAfter(ai, 0, ei);
if (di >= ji) {
di -= ji;
ei -= ji;
fi = j;
gi = null;
li = li && li.removeBefore(ai, 0, di);
} else if (di > bi || ji < ii) {
hi = 0;
while (gi) {
var pi = (di >>> fi) & l;
if (pi !== (ji >>> fi) & l) break;
if (pi) hi += (1 << fi) * pi;
fi -= j;
gi = gi.array[pi];
}
if (gi && di > bi) gi = gi.removeBefore(ai, fi, di - hi);
if (gi && ji < ii) gi = gi.removeAfter(ai, fi, ji - hi);
if (hi) {
di -= hi;
ei -= hi;
}
}
if (xh.__ownerID) {
xh.size = ei - di;
xh._origin = di;
xh._capacity = ei;
xh._level = fi;
xh._root = gi;
xh._tail = li;
xh.__hash = (void 0);
xh.__altered = true;
return xh;
}
return nf(di, ei, fi, gi, li);
}
function vf(xh, yh, zh) {
var ai = [],
bi = 0;
for (var ci = 0; ci < zh.length; ci++) {
var di = zh[ci],
ei = ca(di);
if (ei.size > bi) bi = ei.size;
if (!ea(di)) ei = ei.map(function(fi) {
return yb(fi);
});
ai.push(ei);
}
if (bi > xh.size) xh = xh.setSize(bi);
return we(xh, yh, ai);
}
function wf(xh) {
return xh < k ? 0 : (((xh - 1) >>> j) << j);
}
h(xf, yd);
function xf(xh) {
return xh === null || xh === (void 0) ? bg() : yf(xh) ? xh : bg().withMutations(function(yh) {
var zh = ba(xh);
uc(zh.size);
zh.forEach(function(ai, bi) {
return yh.set(bi, ai);
});
});
}
xf.of = function() {
return this(arguments);
};
xf.prototype.toString = function() {
return this.__toString('OrderedMap {', '}');
};
xf.prototype.get = function(xh, yh) {
var zh = this._map.get(xh);
return zh !== (void 0) ? this._list.get(zh)[1] : yh;
};
xf.prototype.clear = function() {
if (this.size === 0) return this;
if (this.__ownerID) {
this.size = 0;
this._map.clear();
this._list.clear();
return this;
}
return bg();
};
xf.prototype.set = function(xh, yh) {
return cg(this, xh, yh);
};
xf.prototype.remove = function(xh) {
return cg(this, xh, m);
};
xf.prototype.wasAltered = function() {
return this._map.wasAltered() || this._list.wasAltered();
};
xf.prototype.__iterate = function(xh, yh) {
var zh = this;
return this._list.__iterate(function(ai) {
return ai && xh(ai[1], ai[0], zh);
}, yh);
};
xf.prototype.__iterator = function(xh, yh) {
return this._list.fromEntrySeq().__iterator(xh, yh);
};
xf.prototype.__ensureOwner = function(xh) {
if (xh === this.__ownerID) return this;
var yh = this._map.__ensureOwner(xh),
zh = this._list.__ensureOwner(xh);
if (!xh) {
this.__ownerID = xh;
this._map = yh;
this._list = zh;
return this;
}
return zf(yh, zh, xh, this.__hash);
};
function yf(xh) {
return zd(xh) && ia(xh);
}
xf.isOrderedMap = yf;
xf.prototype[ma] = true;
xf.prototype[i] = xf.prototype.remove;
function zf(xh, yh, zh, ai) {
var bi = Object.create(xf.prototype);
bi.size = xh ? xh.size : 0;
bi._map = xh;
bi._list = yh;
bi.__ownerID = zh;
bi.__hash = ai;
return bi;
}
var ag;
function bg() {
return ag || (ag = zf(me(), pf()));
}
function cg(xh, yh, zh) {
var ai = xh._map,
bi = xh._list,
ci = ai.get(yh),
di = ci !== (void 0),
ei, fi;
if (zh === m) {
if (!di) return xh;
if (bi.size >= k && bi.size >= ai.size * 2) {
fi = bi.filter(function(gi, hi) {
return gi !== (void 0) && ci !== hi;
});
ei = fi.toKeyedSeq().map(function(gi) {
return gi[0];
}).flip().toMap();
if (xh.__ownerID) ei.__ownerID = fi.__ownerID = xh.__ownerID;
} else {
ei = ai.remove(yh);
fi = ci === bi.size - 1 ? bi.pop() : bi.set(ci, (void 0));
}
} else if (di) {
if (zh === bi.get(ci)[1]) return xh;
ei = ai;
fi = bi.set(ci, [yh, zh]);
} else {
ei = ai.set(yh, bi.size);
fi = bi.set(bi.size, [yh, zh]);
}
if (xh.__ownerID) {
xh.size = ei.size;
xh._map = ei;
xh._list = fi;
xh.__hash = (void 0);
return xh;
}
return zf(ei, fi);
}
h(dg, vb);
function dg(xh) {
return xh === null || xh === (void 0) ? jg() : eg(xh) ? xh : jg().unshiftAll(xh);
}
dg.of = function() {
return this(arguments);
};
dg.prototype.toString = function() {
return this.__toString('Stack [', ']');
};
dg.prototype.get = function(xh, yh) {
var zh = this._head;
xh = u(this, xh);
while (zh && xh--) zh = zh.next;
return zh ? zh.value : yh;
};
dg.prototype.peek = function() {
return this._head && this._head.value;
};
dg.prototype.push = function() {
if (arguments.length === 0) return this;
var xh = this.size + arguments.length,
yh = this._head;
for (var zh = arguments.length - 1; zh >= 0; zh--) yh = {
value: arguments[zh],
next: yh
};
if (this.__ownerID) {
this.size = xh;
this._head = yh;
this.__hash = (void 0);
this.__altered = true;
return this;
}
return hg(xh, yh);
};
dg.prototype.pushAll = function(xh) {
xh = ca(xh);
if (xh.size === 0) return this;
uc(xh.size);
var yh = this.size,
zh = this._head;
xh.reverse().forEach(function(ai) {
yh++;
zh = {
value: ai,
next: zh
};
});
if (this.__ownerID) {
this.size = yh;
this._head = zh;
this.__hash = (void 0);
this.__altered = true;
return this;
}
return hg(yh, zh);
};
dg.prototype.pop = function() {
return this.slice(1);
};
dg.prototype.unshift = function() {
return this.push.apply(this, arguments);
};
dg.prototype.unshiftAll = function(xh) {
return this.pushAll(xh);
};
dg.prototype.shift = function() {
return this.pop.apply(this, arguments);
};
dg.prototype.clear = function() {
if (this.size === 0) return this;
if (this.__ownerID) {
this.size = 0;
this._head = (void 0);
this.__hash = (void 0);
this.__altered = true;
return this;
}
return jg();
};
dg.prototype.slice = function(xh, yh) {
if (w(xh, yh, this.size)) return this;
var zh = x(xh, this.size),
ai = y(yh, this.size);
if (ai !== this.size) return vb.prototype.slice.call(this, xh, yh);
var bi = this.size - zh,
ci = this._head;
while (zh--) ci = ci.next;
if (this.__ownerID) {
this.size = bi;
this._head = ci;
this.__hash = (void 0);
this.__altered = true;
return this;
}
return hg(bi, ci);
};
dg.prototype.__ensureOwner = function(xh) {
if (xh === this.__ownerID) return this;
if (!xh) {
this.__ownerID = xh;
this.__altered = false;
return this;
}
return hg(this.size, this._head, xh, this.__hash);
};
dg.prototype.__iterate = function(xh, yh) {
if (yh) return this.reverse().__iterate(xh);
var zh = 0,
ai = this._head;
while (ai) {
if (xh(ai.value, zh++, this) === false) break;
ai = ai.next;
}
return zh;
};
dg.prototype.__iterator = function(xh, yh) {
if (yh) return this.reverse().__iterator(xh);
var zh = 0,
ai = this._head;
return new ta(function() {
if (ai) {
var bi = ai.value;
ai = ai.next;
return ua(xh, zh++, bi);
}
return va();
});
};
function eg(xh) {
return !!(xh && xh[fg]);
}
dg.isStack = eg;
var fg = '@@__IMMUTABLE_STACK__@@',
gg = dg.prototype;
gg[fg] = true;
gg.withMutations = be.withMutations;
gg.asMutable = be.asMutable;
gg.asImmutable = be.asImmutable;
gg.wasAltered = be.wasAltered;
function hg(xh, yh, zh, ai) {
var bi = Object.create(gg);
bi.size = xh;
bi._head = yh;
bi.__ownerID = zh;
bi.__hash = ai;
bi.__altered = false;
return bi;
}
var ig;
function jg() {
return ig || (ig = hg(0));
}
h(kg, wb);
function kg(xh) {
return xh === null || xh === (void 0) ? rg() : lg(xh) ? xh : rg().withMutations(function(yh) {
var zh = da(xh);
uc(zh.size);
zh.forEach(function(ai) {
return yh.add(ai);
});
});
}
kg.of = function() {
return this(arguments);
};
kg.fromKeys = function(xh) {
return this(ba(xh).keySeq());
};
kg.prototype.toString = function() {
return this.__toString('Set {', '}');
};
kg.prototype.has = function(xh) {
return this._map.has(xh);
};
kg.prototype.add = function(xh) {
return og(this, this._map.set(xh, true));
};
kg.prototype.remove = function(xh) {
return og(this, this._map.remove(xh));
};
kg.prototype.clear = function() {
return og(this, this._map.clear());
};
kg.prototype.union = function() {
var xh = g.call(arguments, 0);
xh = xh.filter(function(yh) {
return yh.size !== 0;
});
if (xh.length === 0) return this;
if (this.size === 0 && !this.__ownerID && xh.length === 1) return this.constructor(xh[0]);
return this.withMutations(function(yh) {
for (var zh = 0; zh < xh.length; zh++) da(xh[zh]).forEach(function(ai) {
return yh.add(ai);
});
});
};
kg.prototype.intersect = function() {
var xh = g.call(arguments, 0);
if (xh.length === 0) return this;
xh = xh.map(function(zh) {
return da(zh);
});
var yh = this;
return this.withMutations(function(zh) {
yh.forEach(function(ai) {
if (!xh.every(function(bi) {
return bi.includes(ai);
})) zh.remove(ai);
});
});
};
kg.prototype.subtract = function() {
var xh = g.call(arguments, 0);
if (xh.length === 0) return this;
xh = xh.map(function(zh) {
return da(zh);
});
var yh = this;
return this.withMutations(function(zh) {
yh.forEach(function(ai) {
if (xh.some(function(bi) {
return bi.includes(ai);
})) zh.remove(ai);
});
});
};
kg.prototype.merge = function() {
return this.union.apply(this, arguments);
};
kg.prototype.mergeWith = function(xh) {
var yh = g.call(arguments, 1);
return this.union.apply(this, yh);
};
kg.prototype.sort = function(xh) {
return sg(md(this, xh));
};
kg.prototype.sortBy = function(xh, yh) {
return sg(md(this, yh, xh));
};
kg.prototype.wasAltered = function() {
return this._map.wasAltered();
};
kg.prototype.__iterate = function(xh, yh) {
var zh = this;
return this._map.__iterate(function(ai, bi) {
return xh(bi, bi, zh);
}, yh);
};
kg.prototype.__iterator = function(xh, yh) {
return this._map.map(function(zh, ai) {
return ai;
}).__iterator(xh, yh);
};
kg.prototype.__ensureOwner = function(xh) {
if (xh === this.__ownerID) return this;
var yh = this._map.__ensureOwner(xh);
if (!xh) {
this.__ownerID = xh;
this._map = yh;
return this;
}
return this.__make(yh, xh);
};
function lg(xh) {
return !!(xh && xh[mg]);
}
kg.isSet = lg;
var mg = '@@__IMMUTABLE_SET__@@',
ng = kg.prototype;
ng[mg] = true;
ng[i] = ng.remove;
ng.mergeDeep = ng.merge;
ng.mergeDeepWith = ng.mergeWith;
ng.withMutations = be.withMutations;
ng.asMutable = be.asMutable;
ng.asImmutable = be.asImmutable;
ng.__empty = rg;
ng.__make = pg;
function og(xh, yh) {
if (xh.__ownerID) {
xh.size = yh.size;
xh._map = yh;
return xh;
}
return yh === xh._map ? xh : yh.size === 0 ? xh.__empty() : xh.__make(yh);
}
function pg(xh, yh) {
var zh = Object.create(ng);
zh.size = xh ? xh.size : 0;
zh._map = xh;
zh.__ownerID = yh;
return zh;
}
var qg;
function rg() {
return qg || (qg = pg(me()));
}
h(sg, kg);
function sg(xh) {
return xh === null || xh === (void 0) ? xg() : tg(xh) ? xh : xg().withMutations(function(yh) {
var zh = da(xh);
uc(zh.size);
zh.forEach(function(ai) {
return yh.add(ai);
});
});
}
sg.of = function() {
return this(arguments);
};
sg.fromKeys = function(xh) {
return this(ba(xh).keySeq());
};
sg.prototype.toString = function() {
return this.__toString('OrderedSet {', '}');
};
function tg(xh) {
return lg(xh) && ia(xh);
}
sg.isOrderedSet = tg;
var ug = sg.prototype;
ug[ma] = true;
ug.__empty = xg;
ug.__make = vg;
function vg(xh, yh) {
var zh = Object.create(ug);
zh.size = xh ? xh.size : 0;
zh._map = xh;
zh.__ownerID = yh;
return zh;
}
var wg;
function xg() {
return wg || (wg = vg(bg()));
}
h(yg, ub);
function yg(xh, yh) {
var zh, ai = function ci(di) {
if (di instanceof ai) return di;
if (!(this instanceof ai)) return new ai(di);
if (!zh) {
zh = true;
var ei = Object.keys(xh);
ch(bi, ei);
bi.size = ei.length;
bi._name = yh;
bi._keys = ei;
bi._defaultValues = xh;
}
this._map = yd(di);
},
bi = ai.prototype = Object.create(zg);
bi.constructor = ai;
return ai;
}
yg.prototype.toString = function() {
return this.__toString(bh(this) + ' {', '}');
};
yg.prototype.has = function(xh) {
return this._defaultValues.hasOwnProperty(xh);
};
yg.prototype.get = function(xh, yh) {
if (!this.has(xh)) return yh;
var zh = this._defaultValues[xh];
return this._map ? this._map.get(xh, zh) : zh;
};
yg.prototype.clear = function() {
if (this.__ownerID) {
this._map && this._map.clear();
return this;
}
var xh = this.constructor;
return xh._empty || (xh._empty = ah(this, me()));
};
yg.prototype.set = function(xh, yh) {
if (!this.has(xh)) throw new Error('Cannot set unknown key "' + xh + '" on ' + bh(this));
var zh = this._map && this._map.set(xh, yh);
if (this.__ownerID || zh === this._map) return this;
return ah(this, zh);
};
yg.prototype.remove = function(xh) {
if (!this.has(xh)) return this;
var yh = this._map && this._map.remove(xh);
if (this.__ownerID || yh === this._map) return this;
return ah(this, yh);
};
yg.prototype.wasAltered = function() {
return this._map.wasAltered();
};
yg.prototype.__iterator = function(xh, yh) {
var zh = this;
return ba(this._defaultValues).map(function(ai, bi) {
return zh.get(bi);
}).__iterator(xh, yh);
};
yg.prototype.__iterate = function(xh, yh) {
var zh = this;
return ba(this._defaultValues).map(function(ai, bi) {
return zh.get(bi);
}).__iterate(xh, yh);
};
yg.prototype.__ensureOwner = function(xh) {
if (xh === this.__ownerID) return this;
var yh = this._map && this._map.__ensureOwner(xh);
if (!xh) {
this.__ownerID = xh;
this._map = yh;
return this;
}
return ah(this, yh, xh);
};
var zg = yg.prototype;
zg[i] = zg.remove;
zg.deleteIn = zg.removeIn = be.removeIn;
zg.merge = be.merge;
zg.mergeWith = be.mergeWith;
zg.mergeIn = be.mergeIn;
zg.mergeDeep = be.mergeDeep;
zg.mergeDeepWith = be.mergeDeepWith;
zg.mergeDeepIn = be.mergeDeepIn;
zg.setIn = be.setIn;
zg.update = be.update;
zg.updateIn = be.updateIn;
zg.withMutations = be.withMutations;
zg.asMutable = be.asMutable;
zg.asImmutable = be.asImmutable;
function ah(xh, yh, zh) {
var ai = Object.create(Object.getPrototypeOf(xh));
ai._map = yh;
ai.__ownerID = zh;
return ai;
}
function bh(xh) {
return xh._name || xh.constructor.name || 'Record';
}
function ch(xh, yh) {
try {
yh.forEach(dh.bind((void 0), xh));
} catch (zh) {}
}
function dh(xh, yh) {
Object.defineProperty(xh, yh, {
get: function() {
return this.get(yh);
},
set: function(zh) {
tc(this.__ownerID);
this.set(yh, zh);
}
});
}
function eh(xh, yh) {
if (xh === yh) return true;
if (!ea(yh) || xh.size !== (void 0) && yh.size !== (void 0) && xh.size !== yh.size || xh.__hash !== (void 0) && yh.__hash !== (void 0) && xh.__hash !== yh.__hash || fa(xh) !== fa(yh) || ga(xh) !== ga(yh) || ia(xh) !== ia(yh)) return false;
if (xh.size === 0 && yh.size === 0) return true;
var zh = !ha(xh);
if (ia(xh)) {
var ai = xh.entries();
return yh.every(function(fi, gi) {
var hi = ai.next().value;
return hi && xb(hi[1], fi) && (zh || xb(hi[0], gi));
}) && ai.next().done;
}
var bi = false;
if (xh.size === (void 0))
if (yh.size === (void 0)) {
if (typeof xh.cacheResult === 'function') xh.cacheResult();
} else {
bi = true;
var ci = xh;
xh = yh;
yh = ci;
}
var di = true,
ei = yh.__iterate(function(fi, gi) {
if (zh ? !xh.has(fi) : bi ? !xb(fi, xh.get(gi, m)) : !xb(xh.get(gi, m), fi)) {
di = false;
return false;
}
});
return di && xh.size === ei;
}
h(fh, db);
function fh(xh, yh, zh) {
if (!(this instanceof fh)) return new fh(xh, yh, zh);
tc(zh !== 0);
xh = xh || 0;
if (yh === (void 0)) yh = Infinity;
zh = zh === (void 0) ? 1 : Math.abs(zh);
if (yh < xh) zh = -zh;
this._start = xh;
this._end = yh;
this._step = zh;
this.size = Math.max(0, Math.ceil((yh - xh) / zh - 1) + 1);
if (this.size === 0) {
if (gh) return gh;
gh = this;
}
}
fh.prototype.toString = function() {
if (this.size === 0) return 'Range []';
return 'Range [ ' + this._start + '...' + this._end + (this._step > 1 ? ' by ' + this._step : '') + ' ]';
};
fh.prototype.get = function(xh, yh) {
return this.has(xh) ? this._start + u(this, xh) * this._step : yh;
};
fh.prototype.includes = function(xh) {
var yh = (xh - this._start) / this._step;
return yh >= 0 && yh < this.size && yh === Math.floor(yh);
};
fh.prototype.slice = function(xh, yh) {
if (w(xh, yh, this.size)) return this;
xh = x(xh, this.size);
yh = y(yh, this.size);
if (yh <= xh) return new fh(0, 0);
return new fh(this.get(xh, this._end), this.get(yh, this._end), this._step);
};
fh.prototype.indexOf = function(xh) {
var yh = xh - this._start;
if (yh % this._step === 0) {
var zh = yh / this._step;
if (zh >= 0 && zh < this.size) return zh;
}
return -1;
};
fh.prototype.lastIndexOf = function(xh) {
return this.indexOf(xh);
};
fh.prototype.__iterate = function(xh, yh) {
var zh = this.size - 1,
ai = this._step,
bi = yh ? this._start + zh * ai : this._start;
for (var ci = 0; ci <= zh; ci++) {
if (xh(bi, ci, this) === false) return ci + 1;
bi += yh ? -ai : ai;
}
return ci;
};
fh.prototype.__iterator = function(xh, yh) {
var zh = this.size - 1,
ai = this._step,
bi = yh ? this._start + zh * ai : this._start,
ci = 0;
return new ta(function() {
var di = bi;
bi += yh ? -ai : ai;
return ci > zh ? va() : ua(xh, ci++, di);
});
};
fh.prototype.equals = function(xh) {
return xh instanceof fh ? this._start === xh._start && this._end === xh._end && this._step === xh._step : eh(this, xh);
};
var gh;
h(hh, db);
function hh(xh, yh) {
if (!(this instanceof hh)) return new hh(xh, yh);
this._value = xh;
this.size = yh === (void 0) ? Infinity : Math.max(0, yh);
if (this.size === 0) {
if (ih) return ih;
ih = this;
}
}
hh.prototype.toString = function() {
if (this.size === 0) return 'Repeat []';
return 'Repeat [ ' + this._value + ' ' + this.size + ' times ]';
};
hh.prototype.get = function(xh, yh) {
return this.has(xh) ? this._value : yh;
};
hh.prototype.includes = function(xh) {
return xb(this._value, xh);
};
hh.prototype.slice = function(xh, yh) {
var zh = this.size;
return w(xh, yh, zh) ? this : new hh(this._value, y(yh, zh) - x(xh, zh));
};
hh.prototype.reverse = function() {
return this;
};
hh.prototype.indexOf = function(xh) {
if (xb(this._value, xh)) return 0;
return -1;
};
hh.prototype.lastIndexOf = function(xh) {
if (xb(this._value, xh)) return this.size;
return -1;
};
hh.prototype.__iterate = function(xh, yh) {
for (var zh = 0; zh < this.size; zh++)
if (xh(this._value, zh, this) === false) return zh + 1;
return zh;
};
hh.prototype.__iterator = function(xh, yh) {
var zh = this,
ai = 0;
return new ta(function() {
return ai < zh.size ? ua(xh, ai++, zh._value) : va();
});
};
hh.prototype.equals = function(xh) {
return xh instanceof hh ? xb(this._value, xh._value) : eh(xh);
};
var ih;
function jh(xh, yh) {
var zh = function(ai) {
xh.prototype[ai] = yh[ai];
};
Object.keys(yh).forEach(zh);
Object.getOwnPropertySymbols && Object.getOwnPropertySymbols(yh).forEach(zh);
return xh;
}
aa.Iterator = ta;
jh(aa, {
toArray: function() {
uc(this.size);
var xh = new Array(this.size || 0);
this.valueSeq().__iterate(function(yh, zh) {
xh[zh] = yh;
});
return xh;
},
toIndexedSeq: function() {
return new wc(this);
},
toJS: function() {
return this.toSeq().map(function(xh) {
return xh && typeof xh.toJS === 'function' ? xh.toJS() : xh;
}).__toJS();
},
toJSON: function() {
return this.toSeq().map(function(xh) {
return xh && typeof xh.toJSON === 'function' ? xh.toJSON() : xh;
}).__toJS();
},
toKeyedSeq: function() {
return new vc(this, true);
},
toMap: function() {
return yd(this.toKeyedSeq());
},
toObject: function() {
uc(this.size);
var xh = {};
this.__iterate(function(yh, zh) {
xh[zh] = yh;
});
return xh;
},
toOrderedMap: function() {
return xf(this.toKeyedSeq());
},
toOrderedSet: function() {
return sg(fa(this) ? this.valueSeq() : this);
},
toSet: function() {
return kg(fa(this) ? this.valueSeq() : this);
},
toSetSeq: function() {
return new xc(this);
},
toSeq: function() {
return ga(this) ? this.toIndexedSeq() : fa(this) ? this.toKeyedSeq() : this.toSetSeq();
},
toStack: function() {
return dg(fa(this) ? this.valueSeq() : this);
},
toList: function() {
return ff(fa(this) ? this.valueSeq() : this);
},
toString: function() {
return '[Iterable]';
},
__toString: function(xh, yh) {
if (this.size === 0) return xh + yh;
return xh + ' ' + this.toSeq().map(this.__toStringMapper).join(', ') + ' ' + yh;
},
concat: function() {
var xh = g.call(arguments, 0);
return qd(this, id(this, xh));
},
contains: function(xh) {
return this.includes(xh);
},
includes: function(xh) {
return this.some(function(yh) {
return xb(yh, xh);
});
},
entries: function() {
return this.__iterator(pa);
},
every: function(xh, yh) {
uc(this.size);
var zh = true;
this.__iterate(function(ai, bi, ci) {
if (!xh.call(yh, ai, bi, ci)) {
zh = false;
return false;
}
});
return zh;
},
filter: function(xh, yh) {
return qd(this, cd(this, xh, yh, true));
},
find: function(xh, yh, zh) {
var ai = this.findEntry(xh, yh);
return ai ? ai[1] : zh;
},
findEntry: function(xh, yh) {
var zh;
this.__iterate(function(ai, bi, ci) {
if (xh.call(yh, ai, bi, ci)) {
zh = [bi, ai];
return false;
}
});
return zh;
},
findLastEntry: function(xh, yh) {
return this.toSeq().reverse().findEntry(xh, yh);
},
forEach: function(xh, yh) {
uc(this.size);
return this.__iterate(yh ? xh.bind(yh) : xh);
},
join: function(xh) {
uc(this.size);
xh = xh !== (void 0) ? '' + xh : ',';
var yh = '',
zh = true;
this.__iterate(function(ai) {
zh ? (zh = false) : (yh += xh);
yh += ai !== null && ai !== (void 0) ? ai.toString() : '';
});
return yh;
},
keys: function() {
return this.__iterator(na);
},
map: function(xh, yh) {
return qd(this, ad(this, xh, yh));
},
reduce: function(xh, yh, zh) {
uc(this.size);
var ai, bi;
if (arguments.length < 2) {
bi = true;
} else ai = yh;
this.__iterate(function(ci, di, ei) {
if (bi) {
bi = false;
ai = ci;
} else ai = xh.call(zh, ai, ci, di, ei);
});
return ai;
},
reduceRight: function(xh, yh, zh) {
var ai = this.toKeyedSeq().reverse();
return ai.reduce.apply(ai, arguments);
},
reverse: function() {
return qd(this, bd(this, true));
},
slice: function(xh, yh) {
return qd(this, fd(this, xh, yh, true));
},
some: function(xh, yh) {
return !this.every(oh(xh), yh);
},
sort: function(xh) {
return qd(this, md(this, xh));
},
values: function() {
return this.__iterator(oa);
},
butLast: function() {
return this.slice(0, -1);
},
isEmpty: function() {
return this.size !== (void 0) ? this.size === 0 : !this.some(function() {
return true;
});
},
count: function(xh, yh) {
return t(xh ? this.toSeq().filter(xh, yh) : this);
},
countBy: function(xh, yh) {
return dd(this, xh, yh);
},
equals: function(xh) {
return eh(this, xh);
},
entrySeq: function() {
var xh = this;
if (xh._cache) return new gb(xh._cache);
var yh = xh.toSeq().map(nh).toIndexedSeq();
yh.fromEntrySeq = function() {
return xh.toSeq();
};
return yh;
},
filterNot: function(xh, yh) {
return this.filter(oh(xh), yh);
},
findLast: function(xh, yh, zh) {
return this.toKeyedSeq().reverse().find(xh, yh, zh);
},
first: function() {
return this.find(v);
},
flatMap: function(xh, yh) {
return qd(this, kd(this, xh, yh));
},
flatten: function(xh) {
return qd(this, jd(this, xh, true));
},
fromEntrySeq: function() {
return new yc(this);
},
get: function(xh, yh) {
return this.find(function(zh, ai) {
return xb(ai, xh);
}, (void 0), yh);
},
getIn: function(xh, yh) {
var zh = this,
ai = xd(xh),
bi;
while (!(bi = ai.next()).done) {
var ci = bi.value;
zh = zh && zh.get ? zh.get(ci, m) : m;
if (zh === m) return yh;
}
return zh;
},
groupBy: function(xh, yh) {
return ed(this, xh, yh);
},
has: function(xh) {
return this.get(xh, m) !== m;
},
hasIn: function(xh) {
return this.getIn(xh, m) !== m;
},
isSubset: function(xh) {
xh = typeof xh.includes === 'function' ? xh : aa(xh);
return this.every(function(yh) {
return xh.includes(yh);
});
},
isSuperset: function(xh) {
return xh.isSubset(this);
},
keySeq: function() {
return this.toSeq().map(mh).toIndexedSeq();
},
last: function() {
return this.toSeq().reverse().first();
},
max: function(xh) {
return nd(this, xh);
},
maxBy: function(xh, yh) {
return nd(this, yh, xh);
},
min: function(xh) {
return nd(this, xh ? ph(xh) : sh);
},
minBy: function(xh, yh) {
return nd(this, yh ? ph(yh) : sh, xh);
},
rest: function() {
return this.slice(1);
},
skip: function(xh) {
return this.slice(Math.max(0, xh));
},
skipLast: function(xh) {
return qd(this, this.toSeq().reverse().skip(xh).reverse());
},
skipWhile: function(xh, yh) {
return qd(this, hd(this, xh, yh, true));
},
skipUntil: function(xh, yh) {
return this.skipWhile(oh(xh), yh);
},
sortBy: function(xh, yh) {
return qd(this, md(this, yh, xh));
},
take: function(xh) {
return this.slice(0, Math.max(0, xh));
},
takeLast: function(xh) {
return qd(this, this.toSeq().reverse().take(xh).reverse());
},
takeWhile: function(xh, yh) {
return qd(this, gd(this, xh, yh));
},
takeUntil: function(xh, yh) {
return this.takeWhile(oh(xh), yh);
},
valueSeq: function() {
return this.toIndexedSeq();
},
hashCode: function() {
return this.__hash || (this.__hash = th(this));
}
});
var kh = aa.prototype;
kh[ja] = true;
kh[sa] = kh.values;
kh.__toJS = kh.toArray;
kh.__toStringMapper = qh;
kh.inspect = kh.toSource = function() {
return this.toString();
};
kh.chain = kh.flatMap;
(function() {
try {
Object.defineProperty(kh, 'length', {
get: function() {
if (!aa.noLengthWarning) {
var yh;
try {
throw new Error();
} catch (zh) {
yh = zh.stack;
}
if (yh.indexOf('_wrapObject') === -1) {
console && emptyFunction && false;
return this.size;
}
}
}
});
} catch (xh) {}
})();
jh(ba, {
flip: function() {
return qd(this, zc(this));
},
findKey: function(xh, yh) {
var zh = this.findEntry(xh, yh);
return zh && zh[0];
},
findLastKey: function(xh, yh) {
return this.toSeq().reverse().findKey(xh, yh);
},
keyOf: function(xh) {
return this.findKey(function(yh) {
return xb(yh, xh);
});
},
lastKeyOf: function(xh) {
return this.findLastKey(function(yh) {
return xb(yh, xh);
});
},
mapEntries: function(xh, yh) {
var zh = this,
ai = 0;
return qd(this, this.toSeq().map(function(bi, ci) {
return xh.call(yh, [ci, bi], ai++, zh);
}).fromEntrySeq());
},
mapKeys: function(xh, yh) {
var zh = this;
return qd(this, this.toSeq().flip().map(function(ai, bi) {
return xh.call(yh, ai, bi, zh);
}).flip());
}
});
var lh = ba.prototype;
lh[ka] = true;
lh[sa] = kh.entries;
lh.__toJS = kh.toObject;
lh.__toStringMapper = function(xh, yh) {
return JSON.stringify(yh) + ': ' + qh(xh);
};
jh(ca, {
toKeyedSeq: function() {
return new vc(this, false);
},
filter: function(xh, yh) {
return qd(this, cd(this, xh, yh, false));
},
findIndex: function(xh, yh) {
var zh = this.findEntry(xh, yh);
return zh ? zh[0] : -1;
},
indexOf: function(xh) {
var yh = this.toKeyedSeq().keyOf(xh);
return yh === (void 0) ? -1 : yh;
},
lastIndexOf: function(xh) {
return this.toSeq().reverse().indexOf(xh);
},
reverse: function() {
return qd(this, bd(this, false));
},
slice: function(xh, yh) {
return qd(this, fd(this, xh, yh, false));
},
splice: function(xh, yh) {
var zh = arguments.length;
yh = Math.max(yh | 0, 0);
if (zh === 0 || (zh === 2 && !yh)) return this;
xh = x(xh, this.size);
var ai = this.slice(0, xh);
return qd(this, zh === 1 ? ai : ai.concat(s(arguments, 2), this.slice(xh + yh)));
},
findLastIndex: function(xh, yh) {
var zh = this.toKeyedSeq().findLastKey(xh, yh);
return zh === (void 0) ? -1 : zh;
},
first: function() {
return this.get(0);
},
flatten: function(xh) {
return qd(this, jd(this, xh, false));
},
get: function(xh, yh) {
xh = u(this, xh);
return (xh < 0 || (this.size === Infinity || (this.size !== (void 0) && xh > this.size))) ? yh : this.find(function(zh, ai) {
return ai === xh;
}, (void 0), yh);
},
has: function(xh) {
xh = u(this, xh);
return xh >= 0 && (this.size !== (void 0) ? this.size === Infinity || xh < this.size : this.indexOf(xh) !== -1);
},
interpose: function(xh) {
return qd(this, ld(this, xh));
},
interleave: function() {
var xh = [this].concat(s(arguments)),
yh = pd(this.toSeq(), db.of, xh),
zh = yh.flatten(true);
if (yh.size) zh.size = yh.size * xh.length;
return qd(this, zh);
},
last: function() {
return this.get(-1);
},
skipWhile: function(xh, yh) {
return qd(this, hd(this, xh, yh, false));
},
zip: function() {
var xh = [this].concat(s(arguments));
return qd(this, pd(this, rh, xh));
},
zipWith: function(xh) {
var yh = s(arguments);
yh[0] = this;
return qd(this, pd(this, xh, yh));
}
});
ca.prototype[la] = true;
ca.prototype[ma] = true;
jh(da, {
get: function(xh, yh) {
return this.has(xh) ? xh : yh;
},
includes: function(xh) {
return this.has(xh);
},
keySeq: function() {
return this.valueSeq();
}
});
da.prototype.has = kh.includes;
jh(cb, ba.prototype);
jh(db, ca.prototype);
jh(eb, da.prototype);
jh(ub, ba.prototype);
jh(vb, ca.prototype);
jh(wb, da.prototype);
function mh(xh, yh) {
return yh;
}
function nh(xh, yh) {
return [yh, xh];
}
function oh(xh) {
return function() {
return !xh.apply(this, arguments);
};
}
function ph(xh) {
return function() {
return -xh.apply(this, arguments);
};
}
function qh(xh) {
return typeof xh === 'string' ? JSON.stringify(xh) : xh;
}
function rh() {
return s(arguments);
}
function sh(xh, yh) {
return xh < yh ? 1 : xh > yh ? -1 : 0;
}
function th(xh) {
if (xh.size === Infinity) return 0;
var yh = ia(xh),
zh = fa(xh),
ai = yh ? 1 : 0,
bi = xh.__iterate(zh ? yh ? function(ci, di) {
ai = 31 * ai + vh(ec(ci), ec(di)) | 0;
} : function(ci, di) {
ai = ai + vh(ec(ci), ec(di)) | 0;
} : yh ? function(ci) {
ai = 31 * ai + ec(ci) | 0;
} : function(ci) {
ai = ai + ec(ci) | 0;
});
return uh(bi, ai);
}
function uh(xh, yh) {
yh = cc(yh, 3432918353);
yh = cc(yh << 15 | yh >>> -15, 461845907);
yh = cc(yh << 13 | yh >>> -13, 5);
yh = (yh + 3864292196 | 0) ^ xh;
yh = cc(yh ^ yh >>> 16, 2246822507);
yh = cc(yh ^ yh >>> 13, 3266489909);
yh = dc(yh ^ yh >>> 16);
return yh;
}
function vh(xh, yh) {
return xh ^ yh + 2654435769 + (xh << 6) + (xh >> 2) | 0;
}
var wh = {
Iterable: aa,
Seq: bb,
Collection: tb,
Map: yd,
OrderedMap: xf,
List: ff,
Stack: dg,
Set: kg,
OrderedSet: sg,
Record: yg,
Range: fh,
Repeat: hh,
is: xb,
fromJS: yb
};
return wh;
}));
}, null);
__d("mergeDeepInto", ["invariant", "mergeHelpers"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
'use strict';
var i = h.ArrayStrategies,
j = h.checkArrayStrategy,
k = h.checkMergeArrayArgs,
l = h.checkMergeLevel,
m = h.checkMergeObjectArgs,
n = h.isTerminal,
o = h.normalizeMergeArg,
p = function(t, u, v, w) {
m(t, u);
l(w);
var x = u ? Object.keys(u) : [];
for (var y = 0; y < x.length; y++) {
var z = x[y];
r(t, u, z, v, w);
}
},
q = function(t, u, v, w) {
k(t, u);
l(w);
var x = Math.max(t.length, u.length);
for (var y = 0; y < x; y++) r(t, u, y, v, w);
},
r = function(t, u, v, w, x) {
var y = u[v],
z = u.hasOwnProperty(v),
aa = z && n(y),
ba = z && Array.isArray(y),
ca = z && !ba && !ba,
da = t[v],
ea = t.hasOwnProperty(v),
fa = ea && n(da),
ga = ea && Array.isArray(da),
ha = ea && !ga && !ga;
if (fa) {
if (aa) {
t[v] = y;
} else if (ba) {
t[v] = [];
q(t[v], y, w, x + 1);
} else if (ca) {
t[v] = {};
p(t[v], y, w, x + 1);
} else if (!z) t[v] = da;
} else if (ga) {
if (aa) {
t[v] = y;
} else if (ba) {
g(i[w]);
if (w === i.Clobber) da.length = 0;
q(da, y, w, x + 1);
} else if (ca) {
t[v] = {};
p(t[v], y, w, x + 1);
} else !z;
} else if (ha) {
if (aa) {
t[v] = y;
} else if (ba) {
t[v] = [];
q(t[v], y, w, x + 1);
} else if (ca) {
p(da, y, w, x + 1);
} else !z;
} else if (!ea)
if (aa) {
t[v] = y;
} else if (ba) {
t[v] = [];
q(t[v], y, w, x + 1);
} else if (ca) {
t[v] = {};
p(t[v], y, w, x + 1);
} else !z;
},
s = function(t, u, v) {
var w = o(u);
j(v);
p(t, w, v, 0);
};
e.exports = s;
}, null);
/*!CK:685237340!*/ /*1432609985,*/
if (self.CavalryLogger) {
CavalryLogger.start_js(["f8a07"]);
}
__d("XPubcontentInlinePhotoPivotsEventsController", ["XController"], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = b("XController").create("\/pubcontent\/inline_photo_pivots_chaining\/events\/", {});
}, null);
__d("EntstreamAttachmentRelatedShare", ["Arbiter", "AsyncRequest", "AttachmentRelatedShareConstants", "csx", "cx", "CSS", "DOM", "Event", "ge", "tidyEvent", "XPubcontentInlinePhotoPivotsEventsController"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) {
b.__markCompiled && b.__markCompiled();
var r = 2,
s = 3,
t = {
loadRelatedAttachment: function(u, v, w) {
var x = null;
if (typeof u === "string") {
x = o(u);
} else x = u;
if (!x) return;
var y = n.listen(x, 'click', function() {
y.remove();
g.inform(i.ARTICLE_CLICK, {
attachment: x,
global_share_id: v,
is_right_click: false,
share_id: w
});
}),
z = n.listen(x, 'mousedown', function(event) {
if (event.which === s || event.button === r) {
z.remove();
g.inform(i.ARTICLE_CLICK, {
attachment: x,
global_share_id: v,
is_right_click: true
});
}
});
},
loadInlineStoryPivotAttachment: function(u, v) {
var w = o(u);
if (!w) return;
var x = n.listen(w, 'click', function() {
x.remove();
g.inform(i.PHOTO_CLICK, {
attachment: w,
storyid: v
});
});
},
loadRelatedGameAttachment: function(u, v) {
var w = null;
if (typeof u === "string") {
w = o(u);
} else w = u;
if (!w) return;
p(n.listen(w, 'click', function() {
g.inform(i.GAME_CLICK, {
attachment: w,
global_share_id: v
});
}));
p(n.listen(w, 'mousedown', function(event) {
if (event.which === s || event.button === r) g.inform(i.GAME_CLICK, {
attachment: w,
global_share_id: v
});
}));
},
loadRelatedLSCVideoAttachment: function(u, v) {
var w = null;
if (typeof u === 'string') {
w = o(u);
} else w = u;
if (!w) return;
var x = "^div._4-u2",
y = m.scry(w, x),
z = n.listen(w, 'click', function() {
z.remove();
g.inform(i.VIDEO_CLICK, {
attachment: w,
global_share_id: v
});
});
},
loadRelatedLSCInlineVideoAttachment: function(u, v) {
var w = null;
if (typeof u === 'string') {
w = o(u);
} else w = u;
if (!w) return;
n.listen(w, 'click', function() {
var x = "^div._4-u2",
y = "_1d8v",
z = m.scry(w, x),
aa = z.length === 1 ? z[0] : null,
ba = aa.parentNode,
ca = ba.previousSibling;
while (!ca) {
ba = ba.parentNode;
ca = ba.previousSibling;
}
if (!l.hasClass(ca, y)) {
var da = m.create('div', {
className: y
}),
ea = m.insertBefore(aa.parentNode, da),
fa = ea.length >= 1 ? ea[0] : null;
} else fa = ca;
var ga = m.getID(fa);
new h().setURI('/ajax/flash/expand_inline.php').setData({
share_id: v,
target_div: ga,
max_width: 470,
max_height: 264,
replace_target_div: true
}).setMethod('GET').setReadOnly(true).setRelativeTo(w.parentNode).send();
});
},
loadRelatedEventsPivotAttachment: function(u, v) {
var w = null;
if (typeof u === "string") {
w = o(u);
} else w = u;
if (!w) return;
p(n.listen(w, 'click', function() {
g.inform(i.EVENT_JOIN, {
attachment: w,
event_id: v
});
}));
},
closeButton: function(u, v) {
n.listen(u, 'click', function() {
m.remove(v);
});
},
closeButtonPhotoPivots: function(u, v, w, x) {
n.listen(u, 'click', function() {
var y = q.getURIBuilder(),
z = {
story_id: w,
search_query_type: x,
event: 'hide'
};
new h().setMethod('POST').setURI(y.getURI()).setData(z).send();
m.remove(v);
});
},
seeAllLinkPhotoPivots: function(u, v, w) {
n.listen(u, 'click', function() {
var x = q.getURIBuilder(),
y = {
story_id: v,
search_query_type: w,
event: 'see_all'
};
new h().setMethod('POST').setURI(x.getURI()).setData(y).send();
});
},
removeOldSuggestions: function(u) {
var v = o(u);
if (!v) return;
var w = m.scry(v.parentNode, "._5d73");
for (var x = 1; x < w.length; x++) m.remove(w[x]);
setTimeout(function() {
l.show(w[0]);
}, 1000);
},
showHiddenSuggestions: function(u) {
var v = n.listen(u, 'click', function() {
v.remove();
var w = "^._1ui8",
x = m.scry(u, w);
if (!x) return;
l.hide(x[0]);
var y = x[0].previousSibling;
while (y) {
l.show(y);
y = y.previousSibling;
}
});
}
};
e.exports = t;
}, null);
/*!CK:264620257!*/ /*1437417673,*/
if (self.CavalryLogger) {
CavalryLogger.start_js(["xMTrg"]);
}
__d("ScrollColumn.react", ["cx", "invariant", "throttle", "tidyEvent", "Arbiter", "Event", "React", "Vector", "ViewportBounds"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) {
b.__markCompiled && b.__markCompiled();
var p = m,
q = p.PropTypes,
r = 'ScrollColumn/adjust',
s = m.createClass({
displayName: "ScrollColumn",
propTypes: {
topOffset: q.number,
zIndex: q.number
},
getDefaultProps: function() {
return {
topOffset: 0,
zIndex: 0
};
},
_scroll: 0,
_scrollDelta: 0,
getInitialState: function() {
return {
fixed: null,
fixedBottom: 0,
fixedTop: this.props.topOffset,
top: 0
};
},
render: function() {
var t = 'auto',
u = this.state.fixedLeft,
v = 'auto';
if (this.state.fixed === 'bottom') {
t = this.state.fixedBottom;
} else if (this.state.fixed === 'top') {
v = this.state.fixedTop;
} else {
u = 'auto';
v = this.state.top;
}
return (m.createElement("div", {
className: "_5ss7",
ref: "container"
}, m.createElement("div", {
className: (("_5ss8") + (this.state.fixed ? ' ' + "fixed_always" : '')),
ref: "column",
style: {
bottom: t,
left: u,
top: v,
zIndex: this.props.zIndex
}
}, this.props.children)));
},
componentDidMount: function() {
this.setState({
adjustEventListener: j(k.subscribe(r, function() {
this._adjust();
}.bind(this))),
resizeListener: j(l.listen(window, 'resize', i(this._adjust))),
scrollListener: j(l.listen(window, 'scroll', this._onScroll)),
viewportBoundsUpdateListener: j(o.subscribe('change', this._adjust))
});
this._adjust();
},
componentDidUpdate: function(t, u) {
if (u.fixed !== this.state.fixed) k.inform('reflow');
},
componentWillUnmount: function() {
this.state.adjustEventListener.unsubscribe();
this.state.resizeListener.remove();
this.state.scrollListener.remove();
},
_onScroll: function(event) {
var t = n.getScrollPosition().y;
this._scrollDelta = t - this._scroll;
this._scroll = t;
this._adjust();
},
_adjust: function() {
if (!this.isMounted()) return;
this._updateContainerHeight();
this._updateColumnWidth();
if (this._isContainerBelowViewportTop()) {
this._setNotFixed(0);
return;
}
if (!this._isColumnLargerThanViewport()) {
this._setFixedToTop();
return;
}
if (this._scrollDelta > 0)
if (this._isBottomOfColumnVisible()) {
this._setFixedToBottom();
return;
}
if (this._scrollDelta < 0)
if (this._isTopOfColumnVisible()) {
this._setFixedToTop();
return;
}
var t = this._getTopPositionForRef('column'),
u = this._getTopPositionForRef('container'),
v = t - u;
this._setNotFixed(v);
},
_getTopPositionForRef: function(t) {
var u = this.refs[t];
h(u);
var v = n.getElementPosition(m.findDOMNode(u), 'viewport').y;
if (this._scroll < 0) v += this._scroll;
return v;
},
_getTopBoundWithOffset: function() {
return o.getTop() + this.props.topOffset;
},
_isContainerBelowViewportTop: function() {
var t = this._getTopPositionForRef('container');
return t >= this._getTopBoundWithOffset();
},
_isColumnLargerThanViewport: function() {
var t = n.getViewportDimensions().y - o.getBottom() - this._getTopBoundWithOffset();
return m.findDOMNode(this.refs.column).offsetHeight > t;
},
_isBottomOfColumnVisible: function() {
var t = this._getTopPositionForRef('column'),
u = n.getElementDimensions(m.findDOMNode(this.refs.column), 'viewport').y,
v = t + u;
return v <= n.getViewportDimensions().y - o.getBottom();
},
_isTopOfColumnVisible: function() {
var t = this._getTopPositionForRef('column');
return t >= this._getTopBoundWithOffset();
},
_getFixedLeft: function() {
return (n.getElementPosition(m.findDOMNode(this.refs.container), 'viewport').x);
},
_setFixedToBottom: function() {
this.setState({
fixed: 'bottom',
fixedBottom: o.getBottom(),
fixedLeft: this._getFixedLeft()
});
},
_setFixedToTop: function() {
this.setState({
fixed: 'top',
fixedLeft: this._getFixedLeft(),
fixedTop: this._getTopBoundWithOffset()
});
},
_setNotFixed: function(t) {
this.setState({
fixed: false,
top: t
});
},
_updateContainerHeight: function() {
m.findDOMNode(this.refs.container).style.height = m.findDOMNode(this.refs.column).offsetHeight + 'px';
},
_updateColumnWidth: function() {
m.findDOMNode(this.refs.column).style.width = m.findDOMNode(this.refs.container).offsetWidth + 'px';
}
});
s.EVENT_SHOULD_ADJUST = r;
e.exports = s;
}, null);
__d("TabBarItem.react", ["React", "cx", "joinClasses"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
var j = g.createClass({
displayName: "TabBarItem",
getDefaultProps: function() {
return {
wrapper: 'li'
};
},
render: function() {
var k = (("_45hc") + (this.props.selected ? ' ' + "_1hqh" : '')),
l = this.props.wrapper,
m = this.props.href || '#',
n = this.props.ajaxify,
o = this.props.rel;
if (l) return (g.createElement(l, g.__spread({}, this.props, {
className: i(this.props.className, k)
}), g.createElement("a", {
ajaxify: n,
href: m,
rel: o,
target: this.props.target
}, this.props.children)));
return (g.createElement("a", g.__spread({}, this.props, {
ajaxify: n,
className: i(this.props.className, k),
href: m,
rel: o
}), this.props.children));
}
});
e.exports = j;
}, null);
__d("TabBarDropdownItem.react", ["ContextualDialogArrow", "ContextualLayerAutoFlip", "InlineBlock.react", "PopoverMenu.react", "React", "ReactXUIMenu", "TabBarItem.react", "cx", "onlyChild", "joinClasses"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
b.__markCompiled && b.__markCompiled();
var q = k,
r = q.PropTypes,
s = k.createClass({
displayName: "TabBarDropdownItem",
propTypes: {
tabComponent: r.func
},
getDefaultProps: function() {
return {
tabComponent: m
};
},
_renderTab: function() {
var t = this.props.tabComponent,
u = "_45hd _45hc";
return (k.createElement(t, k.__spread({}, this.props, {
wrapper: false,
className: p(this.props.className, u)
}), k.createElement("span", {
className: "_1b0"
}, this.props.label)));
},
render: function() {
if (this.props.children) {
var t = this.props.selected ? l.SelectableMenu : l,
u = k.createElement(t, null, this.props.children.map(this.convertTabItemWrapperToMenuItem)),
v = [h, g];
return (k.createElement("li", {
className: "_45hd"
}, k.createElement(j, {
menu: u,
layerBehaviors: v
}, this._renderTab())));
} else return (k.createElement("li", {
className: "_45hd"
}, k.createElement(i, null, this._renderTab())));
},
convertTabItemWrapperToMenuItem: function(t, u) {
var v = this.props.selected ? l.SelectableItem : l.Item,
w = o(t.type.getComponent(t.props));
return (k.createElement(v, k.__spread({}, w.props, {
key: u,
onclick: w.props.onClick
}), w.props.children));
}
});
e.exports = s;
}, null);
__d("TabBar.react", ["React", "ReactChildren", "TabBarDropdownItem.react", "TabBarItem.react", "cx", "fbt", "joinClasses"], function(a, b, c, d, e, f, g, h, i, j, k, l, m) {
b.__markCompiled && b.__markCompiled();
var n = g,
o = n.PropTypes,
p = l._("\u66f4\u591a"),
q = g.createClass({
displayName: "TabBarItemWrapper",
statics: {
getComponent: function(s) {
return s.component;
}
},
render: function() {
return this.props.component;
}
}),
r = g.createClass({
displayName: "TabBar",
propTypes: {
activeTabKey: o.string,
alwaysShowActive: o.bool,
defaultActiveTabKey: o.string,
maxTabsVisible: o.number,
moreLabel: o.string,
onTabClick: o.func,
dropdownTabComponent: o.func,
onWidthCalculated: o.func,
shouldCalculateVisibleTabs: o.bool
},
getDefaultProps: function() {
return {
alwaysShowActive: true,
dropdownTabComponent: j,
maxTabsVisible: Infinity,
moreLabel: p,
onTabClick: function() {
return true;
},
shouldCalculateVisibleTabs: true
};
},
getInitialState: function() {
return {
activeTabKey: this.props.defaultActiveTabKey,
visibleTabs: 0,
shouldCalculateVisibleTabs: true
};
},
setWidth: function(s) {
g.findDOMNode(this).style.width = s;
this.setState({
shouldCalculateVisibleTabs: true
});
},
render: function() {
var s = [];
h.forEach(this.props.children, function(ba) {
if (ba) s.push(ba);
});
var t = s.length,
u = this.getActiveTabIndex(),
v = s[u];
if (this.state.shouldCalculateVisibleTabs) {
s = s.map(function(ba, ca) {
ba = g.cloneElement(ba, {
selected: ca === u
});
return (g.createElement(q, {
key: ba.key,
component: ba,
ref: ca
}));
});
if (t > 2) s.push(g.createElement(i, {
key: "_dropdown",
ref: "more",
label: this.props.moreLabel,
tabComponent: this.props.dropdownTabComponent
}));
} else {
s = s.map(function(ba, ca) {
ba = g.cloneElement(ba, {
selected: v && v.key === ba.key,
onClick: this.onTabClick.bind(this, ba.key)
});
return (g.createElement(q, {
key: ba.key,
component: ba,
ref: ca
}));
}.bind(this));
var w = this.state.visibleTabs,
x;
if (w > 0) {
var y;
if (!this.props.alwaysShowActive || u < w) {
y = s.splice(w);
if (u >= w) x = true;
} else {
v = s.splice(u, 1)[0];
y = s.splice(w - 1);
s.push(v);
}
if (y.length) s.push(g.createElement(i, {
selected: x,
key: "_dropdown",
label: this.props.moreLabel,
tabComponent: this.props.dropdownTabComponent
}, y));
} else {
var z = v;
if (!v) z = q.getComponent(s[0].props);
var aa = z.props.children;
s = g.createElement(i, {
label: aa,
tabComponent: this.props.dropdownTabComponent,
selected: this.getActiveTabIndex() !== -1
}, s);
}
}
return (g.createElement("ul", g.__spread({}, this.props, {
className: m(this.props.className, "_43o4")
}), s));
},
componentDidMount: function() {
this.calculateVisibleTabs();
this.calculateWidth();
},
componentWillReceiveProps: function(s) {
this.setState({
shouldCalculateVisibleTabs: true
});
},
componentDidUpdate: function() {
if (this.state.shouldCalculateVisibleTabs) this.calculateVisibleTabs();
this.calculateWidth();
},
calculateWidth: function() {
if (this.props.onWidthCalculated) this.props.onWidthCalculated(g.findDOMNode(this).clientWidth);
},
calculateVisibleTabs: function() {
var s = [];
h.forEach(this.props.children, function(ca) {
if (ca) s.push(ca);
});
var t = s.length;
if (!this.props.shouldCalculateVisibleTabs) {
this.setState({
visibleTabs: Math.min(t, this.props.maxTabsVisible),
shouldCalculateVisibleTabs: false
});
return;
}
var u = [];
for (var v = 0; v < t; v++) u.push(g.findDOMNode(this.refs[v]).offsetWidth);
var w = this.getActiveTabIndex();
if (this.props.alwaysShowActive && w !== -1) {
s.unshift(s.splice(w, 1)[0]);
u.unshift(u.splice(w, 1)[0]);
}
var x = g.findDOMNode(this).offsetWidth,
y = 0,
z = 0;
for (v = 0; v < t; v++) {
var aa = u[v];
if (z + aa > x) {
if (y > 0 && t > 2) {
var ba = g.findDOMNode(this.refs.more).offsetWidth;
while (y > 0 && (z + ba > x || t - y < 2)) {
y--;
z -= u[y];
}
} else y = 0;
break;
}
y++;
z += aa;
}
this.setState({
visibleTabs: Math.min(y, this.props.maxTabsVisible),
shouldCalculateVisibleTabs: false
});
},
getActiveTabIndex: function() {
var s = this.props.activeTabKey || this.state.activeTabKey,
t = -1;
if (s) h.forEach(this.props.children, function(u, v) {
if (u && u.key === s) t = v;
});
return t;
},
onTabClick: function(s, event) {
var t = this.props.onTabClick(s, event);
if (t !== false) this.setState({
activeTabKey: s,
shouldCalculateVisibleTabs: true
});
return t;
}
});
r.Tab = j;
r.DropdownItem = i;
e.exports = r;
}, null);
__d("XUIPageNavigationItem.react", ["React", "TabBarItem.react", "cx", "fbt", "joinClasses"], function(a, b, c, d, e, f, g, h, i, j, k) {
b.__markCompiled && b.__markCompiled();
var l = g,
m = l.PropTypes,
n = g.createClass({
displayName: "XUIPageNavigationItem",
statics: {
propsForMenuItem: function(o) {
return Object.assign({}, o, {
className: "_5vwz _5vw-"
});
}
},
propTypes: {
selected: m.bool
},
getDefaultProps: function() {
return {
selected: false
};
},
render: function() {
var o = (("_5vwz") + (this.props.selected ? ' ' + "_5vwy" : '')),
p = null;
if (this.props.selected) p = g.createElement("span", {
className: "accessible_elem"
}, j._("\u5df2\u9078\u64c7"));
return (g.createElement(h, g.__spread({}, this.props, {
className: k(this.props.className, o)
}), this.props.children, p, g.createElement("span", {
className: "_13xf"
})));
}
});
e.exports = n;
}, null);
__d("XUIPageNavigationGroup.react", ["React", "TabBar.react", "XUIPageNavigationItem.react"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
var j = g,
k = j.PropTypes,
l = g.createClass({
displayName: "XUIPageNavigationGroup",
propTypes: {
moreLabel: k.string,
maxTabsVisible: function(m, n, o) {
var p = m[n];
if (p != null && !(typeof p === 'number' && p >= 0)) return new Error(("Invalid `" + n + "` supplied to `" + o + "`, ") + ("expected positive integer."));
},
width: k.string
},
getDefaultProps: function() {
return {
maxTabsVisible: Infinity
};
},
componentDidUpdate: function() {
this.refs.bar.setWidth(this.props.width);
},
componentDidMount: function() {
this.refs.bar.setWidth(this.props.width);
},
render: function() {
return g.createElement(h, g.__spread({}, this.props, {
ref: "bar"
}), this.props.children);
}
});
l.Item = i;
e.exports = l;
}, null);
__d("XUIPageNavigation.react", ["Arbiter", "CSS", "DOMQuery", "Event", "LeftRight.react", "React", "ReactChildren", "ReactComponentWithPureRenderMixin", "SubscriptionsHandler", "UITinyViewportAction", "Vector", "ViewportBounds", "XUIPageNavigationGroup.react", "cloneWithProps", "csx", "cx", "invariant", "joinClasses", "throttle"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) {
b.__markCompiled && b.__markCompiled();
var z = l,
aa = z.PropTypes,
ba = 15,
ca = 'bluebar',
da = 'caret',
ea = l.createClass({
displayName: "XUIPageNavigation",
mixins: [n],
propTypes: {
selectedIndicator: aa.oneOf([da, ca]),
caretColor: aa.oneOf(['bg-blue', 'fbui-desktop-wash', 'fbui-desktop-background-light', 'fbui-red', 'fbui-green', 'fbui-desktop-divider-dark', 'white']),
size: aa.oneOf(['small', 'medium']),
scrollThreshold: aa.number
},
getDefaultProps: function() {
return {
selectedIndicator: ca,
caretColor: 'fbui-desktop-wash',
size: 'medium',
scrollThreshold: 0
};
},
getInitialState: function() {
return {
activeTabKey: undefined,
leftWidth: null
};
},
componentDidMount: function() {
this._subscriptions = new o();
this.resizeNavbarGroups();
this._listenForNavbarResize();
var fa = "^.fixed_elem._5vx1";
this.wrapper = i.scry(l.findDOMNode(this), fa)[0];
if (this.wrapper) {
this._setViewportBounds();
this._subscriptions.addSubscriptions(p.subscribe('change', function() {
if (p.isTiny()) {
this._bound.remove();
} else this._setViewportBounds();
}.bind(this)));
}
if (this.wrapper || i.scry(l.findDOMNode(this), "^._k").length) this._showDropshadowOnScroll();
},
componentWillUnmount: function() {
this._subscriptions.release();
},
onTabClick: function(fa, event) {
if (this.props.onTabClick) {
var ga = this.props.onTabClick(fa, event);
if (!ga) return ga;
}
if (!j.$E(event).isDefaultRequested()) this.setState({
activeTabKey: fa
});
},
onWidthCalculated: function(fa, ga) {
this[fa ? '_rightWidth' : '_leftWidth'] = ga;
},
render: function() {
var fa = this.props.selectedIndicator,
ga = this.props.size,
ha = (("_5vx2") + (ga === 'small' ? ' ' + "_5vx3" : '') + (ga === 'medium' ? ' ' + "_5vx4" : '') + (fa === da ? ' ' + "_5vx5" : '') + (fa === ca ? ' ' + "_5vx6" : '')),
ia = null;
if (fa === da) {
var ja = this.props.caretColor;
ia = ((ja === 'bg-blue' ? "_2d2c" : '') + (ja === 'fbui-desktop-wash' ? ' ' + "_4_np" : '') + (ja === 'fbui-desktop-background-light' ? ' ' + "_4_nr" : '') + (ja === 'fbui-red' ? ' ' + "_4_ns" : '') + (ja === 'fbui-green' ? ' ' + "_4_nv" : '') + (ja === 'fbui-desktop-divider-dark' ? ' ' + "_4_nz" : '') + (ja === 'white' ? ' ' + "_5-f" : ''));
}
var ka = x(ha, ia, this.props.className),
la = [],
ma = this.props.activeTabKey || this.state.activeTabKey || this.props.defaultActiveTabKey;
m.forEach(this.props.children, function(na, oa) {
var pa = {
onTabClick: this.onTabClick,
activeTabKey: ma,
onWidthCalculated: this.onWidthCalculated.bind(this, oa),
ref: oa ? 'right' : 'left',
key: oa
};
if (oa === 0) pa.width = this.state.leftWidth;
la.push(t(na, pa));
}.bind(this));
w(la.length === 1 || la.length === 2);
return (l.createElement("div", {
className: ka
}, l.createElement(k, {
className: "_5vx7"
}, la)));
},
_setViewportBounds: function() {
var fa = this.wrapper.offsetHeight,
ga = r.getTop();
this._bound = r.addTop(ga + fa);
g.subscribe('page_transition', function() {
this._bound.remove();
});
},
_listenForNavbarResize: function() {
this._subscriptions.addSubscriptions(j.listen(window, 'resize', y(this.resizeNavbarGroups, 30)));
},
_showDropshadowOnScroll: function() {
this._subscriptions.addSubscriptions(j.listen(window, 'scroll', function() {
var fa = q.getScrollPosition().y > this.props.scrollThreshold;
if (this._hasDropshadow === fa) return;
this._hasDropshadow = fa;
h.conditionClass(l.findDOMNode(this), "_51j8", fa);
}.bind(this)));
},
resizeNavbarGroups: function() {
if (!this.refs.left) return;
var fa = l.findDOMNode(this).clientWidth,
ga;
if (this.refs.right) {
ga = fa - this._rightWidth - ba;
if (ga < this._rightWidth) ga = this._rightWidth + ba;
} else ga = fa;
this.setState({
leftWidth: ga + 'px'
});
}
});
ea.Group = s;
ea.Item = s.Item;
ea.Indicator = {
BlueBar: ca,
Caret: da
};
e.exports = ea;
}, null);
__d("XComposerActorChangeController", ["XController"], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = b("XController").create("\/composer\/actor\/change\/", {
composer_id: {
type: "String",
required: true
},
entry_point: {
type: "Enum",
required: true,
enumType: 1
},
from_actor_id: {
type: "Int",
required: true
},
target_id: {
type: "Int",
required: true
}
});
}, null);
__d("ComposerXActorSelector.react", ["ActorSelector.react", "ActorSelectorNuxTypes", "ActorURI", "Arbiter", "AsyncRequest", "React", "emptyFunction", "XActorSelectorNuxSeenWriteController", "XComposerActorChangeController", "fbt"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
b.__markCompiled && b.__markCompiled();
var q = l,
r = q.PropTypes,
s = l.createClass({
displayName: "ComposerXActorSelector",
propTypes: {
actorIDs: r.array.isRequired,
composerID: r.string.isRequired,
coverEnabled: r.bool.isRequired,
entryPoint: r.string.isRequired,
nuxEnabledCovered: r.bool,
nuxEnabledUncovered: r.bool,
nuxHoverContext: r.object,
onChange: r.func,
pagePermissions: r.object.isRequired,
selectedActorID: r.string.isRequired,
settingsURI: r.string,
targetID: r.string.isRequired
},
getInitialState: function() {
return {
loading: false
};
},
componentWillMount: function() {
j.subscribe('ComposerXPages/composePostWithActor', function(t, u) {
if (u.actorID) this._updateCurrentActor(u.actorID, function() {
if (u.callback) u.callback();
});
}.bind(this));
},
render: function() {
return (l.createElement(g, {
actorIDs: this.props.actorIDs,
actorPermissions: this.props.pagePermissions,
className: this.props.className,
coverEnabled: this.props.coverEnabled,
loading: this.state.loading,
nuxBody: this._getNUXBody(),
nuxEnabledCovered: this.props.nuxEnabledCovered,
nuxEnabledUncovered: this.props.nuxEnabledUncovered,
nuxHoverContext: this.props.nuxHoverContext,
onChange: this._onChange,
onCompleteNux: this._onCompleteNux,
ref: "selector",
selectedActorID: this.props.selectedActorID,
settingsURI: this.props.settingsURI,
tooltipConstructor: this._getTooltipForActorName,
tooltipConstructorCovered: this._getCoveredTooltip
}));
},
_getNUXBody: function() {
return (p._("\u9078\u64c7\u8981\u4ee5\u81ea\u5df1\u6216\u4f60\u7ba1\u7406\u7684\u5176\u4e2d\u4e00\u500b\u7c89\u7d72\u5c08\u9801\u8eab\u5206\u4f86\u767c\u4f48\u8cbc\u6587\u3002"));
},
_getTooltipForActorName: function(t) {
return (p._("\u4ee5{actorName}\u7684\u8eab\u5206\u767c\u4f48", [p.param("actorName", t)]));
},
_getCoveredTooltip: function() {
return (p._("\u4ee5\u4f60\u7ba1\u7406\u7684\u5176\u4e2d\u4e00\u500b\u7c89\u7d72\u5c08\u9801\u8eab\u5206\u767c\u4f48\u8cbc\u6587\u3002"));
},
_onChange: function(t) {
if (this.props.onChange) {
this.props.onChange(t.value);
} else this._updateCurrentActor(t.value);
},
_updateCurrentActor: function(t, u) {
u = u || m;
if (this.props.selectedActorID === t) {
u();
return;
}
this.setState({
loading: true
});
var v = i.create(o.getURIBuilder().setString('composer_id', this.props.composerID).setEnum('entry_point', this.props.entryPoint).setInt('from_actor_id', this.props.selectedActorID).setInt('target_id', this.props.targetID).getURI(), t),
w = function() {
this.setState({
loading: false
});
}.bind(this);
new k().setURI(v).setErrorHandler(w).setServerDialogCancelHandler(w).setFinallyHandler(u).send();
},
_onCompleteNux: function(t) {
var u = t.isCovered,
v = u ? h.COMPOSER_COVERED : h.COMPOSER,
w = n.getURIBuilder().setEnum('nux_type', v).getURI();
new k().setURI(w).send();
}
});
e.exports = s;
}, null);
__d("SwapButtonDEPRECATED", ["Event", "Arbiter", "CSS", "Focus"], function(a, b, c, d, e, f, g, h, i, j) {
b.__markCompiled && b.__markCompiled();
function k(l, m, n) {
this._swapperButton = l;
this._swappeeButton = m;
g.listen(l, 'click', this.swap.bind(this));
if (n) g.listen(m, 'click', this.unswap.bind(this));
h.subscribe('SwapButtonDEPRECATED/focusOnJoinButton', this.setFocusOnSwapper.bind(this), h.SUBSCRIBE_ALL);
}
Object.assign(k.prototype, {
_swapperButton: null,
_swappeeButton: null,
swap: function(l) {
i.hide(this._swapperButton);
i.show(this._swappeeButton);
l !== false && j.setWithoutOutline(this._swappeeButton);
},
unswap: function(l) {
i.show(this._swapperButton);
i.hide(this._swappeeButton);
l !== false && j.setWithoutOutline(this._swapperButton);
},
toggle: function() {
i.toggle(this._swapperButton);
i.toggle(this._swappeeButton);
},
setFocusOnSwapper: function() {
this._swapperButton.focus();
}
});
e.exports = k;
}, null);
__d("HubbleContext", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
var g = {},
h = {
get: function(i) {
return g[i];
},
getPageID: function() {
return g.page && g.page.id;
},
setContext: function(i) {
g = i;
},
setKey: function(i, j) {
g[i] = j;
},
reset: function() {
g = {};
}
};
e.exports = h;
}, null);
__d("HubbleLogger", ["BanzaiLogger", "ErrorUtils", "HubbleContext", "HubbleSurfaces", "arrayContains"], function(a, b, c, d, e, f, g, h, i, j, k) {
b.__markCompiled && b.__markCompiled();
var l = null,
m = null,
n = null,
o = null,
p = Object.keys(j).map(function(r) {
return j[r];
}),
q = {
getStatefulFields: function() {
return {
pageid: i.getPageID(),
platform: n,
prev_section: o,
section: l,
surface: m
};
},
logAction: function(r) {
g.log('HubbleLoggerConfig', Object.assign({}, this.getStatefulFields(), {
action: r
}));
},
logMetric: function(r, s) {
g.log('HubbleLoggerConfig', Object.assign({}, this.getStatefulFields(), {
metric: r,
metric_value: s
}));
},
reset: function() {
l = null;
m = null;
n = null;
o = null;
},
setActiveSection: function(r) {
o = l;
l = r;
},
setActiveSurface: function(r) {
if (!k(p, r)) {
h.reportError('Hubble: Invalid surface value: ' + r);
return;
}
m = r;
},
setPlatform: function(r) {
n = r;
}
};
e.exports = q;
}, null);
__d("XPageTabsReorderingController", ["XController"], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = b("XController").create("\/pages\/tabs\/reorder\/", {
page_id: {
type: "Int",
required: true
},
__asyncDialog: {
type: "Int"
}
});
}, null);
__d("PagesNavTabs", ["AsyncRequest", "React", "XPageTabsReorderingController", "XUIPageNavigation.react", "XUIPageNavigationGroup.react", "XUIPageNavigationItem.react", "cx", "fbt"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n) {
b.__markCompiled && b.__markCompiled();
var o = 'manage_tabs',
p = {
renderPagesNavTabs: function(q, r, s, t, u, v) {
var w = r.map(function(y) {
return (h.createElement(l, {
href: y.href,
key: y.key
}, y.label));
});
if (u) {
var x = i.getURIBuilder().setInt('page_id', v).getURI();
w.push(h.createElement(l, {
className: "_3ew_",
key: o
}, n._("\u7ba1\u7406\u9801\u7c64")));
}
if (w.length === t + 1) t++;
h.render(h.createElement(j, {
defaultActiveTabKey: s,
onTabClick: function(y) {
if (y === o) {
new g(x).setData({
rel: 'dialog'
}).send();
return false;
}
return true;
}
}, h.createElement(k, {
maxTabsVisible: t
}, w)), q);
}
};
e.exports = p;
}, null);
__d("PagesTimelineController", ["Arbiter"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
var h = {
LOAD_SECTION: 'PagesTimelineController/loadSection',
SECTION_FULLY_LOADED: 'PagesTimelineController/sectionFullyLoaded',
ACTIVATE_SCRUBBER_ITEM: 'PagesTimelineController/activateScrubberItem',
FIRST_POSTS_LOADED: 'PagesTimelineController/firstPostsLoaded',
REMOVE_SECTION: 'PagesTimelineController/removeSection',
RECENT_SECTION_KEY: 'recent',
NAV_BAR_LOADED: 'PagesTimelineController/navBarLoaded',
ADJUST_ADS: 'PagesTimelineController/adjustAds',
BOTTOM_OFFSET: 100,
loadSection: function(i) {
g.inform(this.LOAD_SECTION, {
section_key: i
}, g.BEHAVIOR_STATE);
},
sectionFullyLoaded: function(i) {
g.inform(this.SECTION_FULLY_LOADED, {
section_index: i
}, g.BEHAVIOR_PERSISTENT);
},
activateScrubberItem: function(i) {
g.inform(this.ACTIVATE_SCRUBBER_ITEM, {
section_key: i
}, g.BEHAVIOR_STATE);
},
firstPostsLoaded: function(i) {
g.inform(this.FIRST_POSTS_LOADED, {
section_key: i
}, g.BEHAVIOR_STATE);
},
removeSection: function(i) {
g.inform(this.REMOVE_SECTION, {
section_key: i
}, g.BEHAVIOR_STATE);
},
navBarLoaded: function() {
g.inform(this.NAV_BAR_LOADED, {}, g.BEHAVIOR_STATE);
},
adjustAds: function() {
g.inform(this.ADJUST_ADS, {}, g.BEHAVIOR_STATE);
}
};
e.exports = h;
}, null);
__d("PagesPageletScrollColumn.react", ["Arbiter", "DOMContainer.react", "PagesTimelineController", "React", "ScrollColumn.react"], function(a, b, c, d, e, f, g, h, i, j, k) {
b.__markCompiled && b.__markCompiled();
var l = j,
m = l.PropTypes,
n = 5,
o = j.createClass({
displayName: "PagesPageletScrollColumn",
propTypes: {
pagelets: m.object.isRequired
},
render: function() {
var p = j.createElement(k, {
ref: "scrollColumn",
zIndex: n
}, j.createElement(h, null, this.props.pagelets));
return p;
},
_adjustSize: function() {
g.inform(k.EVENT_SHOULD_ADJUST);
},
componentDidMount: function() {
this._subscribers = [g.subscribe(i.NAV_BAR_LOADED, function() {
g.inform(k.EVENT_SHOULD_ADJUST);
}.bind(this)), g.subscribe('footerLoaded', this._adjustSize), g.subscribe('pagesSidePageletLoaded', this._adjustSize)];
},
componentWillUnmount: function() {
while (this._subscribers && this._subscribers.length) this._subscribers.pop().unsubscribe();
}
});
e.exports = o;
}, null);
/*!CK:1175758259!*/ /*1438578105,*/
if (self.CavalryLogger) {
CavalryLogger.start_js(["nGPnh"]);
}
__d("ChatSidebarSections", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = {
MORE_ONLINE_FRIENDS: "more_online_friends",
MORE_ONLINE_COWORKERS: "more_online_coworkers",
OFFLINE_USERS: "offline_users",
ORDERED_LIST: "ordered_list",
ORDERED_COWORKERS: "ordered_coworkers",
TYPEAHEAD: "typeahead",
NOW_PINNED_LIST: "now_pinned_list"
};
}, null);
__d("CreditCardFormParam", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = {
ACCOUNT_ID: "account_id",
ACCOUNT_COUNTRY_CODE: "account_country_code",
APP_ID: "app_id",
CARD_EXPIRATION: "exp",
CARD_FBID: "cc_fbid",
CARD_ID: "cc_id",
CARD_TYPE: "cardType",
CITY: "city",
CONTEXT_ID: "context_id",
COUNTRY: "country",
CSC_LENGTH: "csc_length",
EMAIL: "email",
FIRST_NAME: "firstName",
TRACKING_ID: "tracking_id",
JSFAIL_SOURCE: "jsfail_source",
KEYPRESS_TIMES: "kpts",
LAST_NAME: "lastName",
MONTH: "month",
STATE: "state",
STREET: "street",
STREET_2: "street2",
VALIDATE_ADDRESS: "validate_address",
VALIDATE_NAME: "validate_name",
VALIDATE_ZIP: "validate_zip",
YEAR: "year",
ZIP: "zip",
VALIDATOR_CHECKS: "checks",
CARD_NUMBER: "creditCardNumber",
CSC: "csc",
CARD_NUMBER_FIRST_6: "creditCardNumber_first6",
CARD_NUMBER_LAST_4: "creditCardNumber_last4",
CARD_NUMBER_TOKEN: "creditCardNumber_token",
CSC_TOKEN: "csc_token",
AUTH_LEVEL_FLAG: "auth_level",
AUTH_AMOUNT: "auth_amount",
AUTH_CURRENCY: "auth_currency",
AUTO_EXPAND_AUTH_LEVEL_FLAG: "auto_expand_auth_level",
PAYMENT_ITEM_TYPE: "payment_item_type",
CREDENTIAL_ID: "credential_id",
IS_STORED_BALANCE: "is_stored_balance"
};
}, null);
__d("StoryAttachmentStyle", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = {
FALLBACK: "fallback",
SHARE: "share",
OG_COMPOSER_SIMPLE: "og_composer_simple",
SPORTS_MATCHUP: "sports_matchup",
SHARE_LARGE_IMAGE: "share_large_image",
PHOTO: "photo",
COVER_PHOTO: "cover_photo",
ALBUM: "album",
NEW_ALBUM: "new_album",
COUPON: "coupon",
QUESTION: "question",
ANSWER: "answer",
OPTION: "option",
GALLERY: "gallery",
STREAM_PUBLISH: "stream_publish",
MUSIC_AGGREGATION: "music_aggregation",
ITEM_LIST: "list",
HIGH_SCORE: "high_score",
SCORE_LEADERBOARD: "score_leaderboard",
FRIEND_LIST: "friend_list",
CHECKIN: "checkin",
POPULAR_OBJECTS: "popular_objects",
AVATAR_LIST: "avatar_list",
AVATAR: "avatar",
AVATAR_WITH_VIDEO: "avatar_with_video",
EVENT: "event",
MINUTIAE_EVENT: "minutiae_event",
EXPERIENCE: "experience",
LIFE_EVENT: "life_event",
TRAVEL_SLIDESHOW_LIFE_EVENT: "travel_slideshow_life_event",
GIFT: "gift",
IMAGE_SHARE: "image_share",
ANIMATED_IMAGE_SHARE: "animated_image_share",
ANIMATED_IMAGE_AUTOPLAY: "animated_image_autoplay",
ANIMATED_IMAGE_VIDEO: "animated_image_video",
ANIMATED_IMAGE_VIDEO_AUTOPLAY: "animated_image_video_autoplay",
NOTE: "note",
TOPIC: "topic",
FILE_UPLOAD: "file_upload",
NOTIFICATION_TARGET: "notification_target",
UNAVAILABLE: "unavailable",
PAGE_RECOMMENDATION: "page_recommendation",
PAGE_VIDEO_PLAYLIST: "page_video_playlist",
VIDEO: "video",
VIDEO_INLINE: "video_inline",
VIDEO_AUTOPLAY: "video_autoplay",
VIDEO_SHARE: "video_share",
VIDEO_SHARE_HIGHLIGHTED: "video_share_highlighted",
VIDEO_SHARE_YOUTUBE: "video_share_youtube",
MAP: "map",
OG_MAP: "og_map",
PRODUCT: "product",
EXTERNAL_PRODUCT: "external_product",
FITNESS_COURSE: "fitness_course",
APPLICATION: "application",
STICKER: "sticker",
EXTERNAL_OG_PRODUCT: "external_og_product",
TRAVEL_LOG: "travel_log",
MULTI_SHARE: "multi_share",
MULTI_SHARE_NO_END_CARD: "multi_share_no_end_card",
MULTI_SHARE_SEARCH_END_CARD: "multi_share_search_end_card",
YEAR_IN_REVIEW: "year_in_review",
AVATAR_LARGE_COVER: "avatar_large_cover",
BROADCAST_REQUEST: "broadcast_request",
COMMERCE_PRODUCT_ITEM: "commerce_product_item",
COMMERCE_STORE: "commerce_store",
THIRD_PARTY_PHOTO: "third_party_photo",
PROMPT: "prompt",
BIRTHDAY: "birthday",
DONATIONS_CAMPAIGN: "donations_campaign",
DONATE_PROMPT: "donate_prompt",
DISCUSSION_CONVERSATION: "discussion_conversation",
DISCUSSION_COMMENT: "discussion_comment",
GROUP_SELL_PRODUCT_ITEM: "group_sell_product_item",
GROUP_SELL_PRODUCT_ITEM_MARK_AS_SOLD: "group_sell_mark_as_sold",
GAMETIME: "gametime",
GROUP_REPORTED_POST_QUEUE: "group_reported_post_queue",
GROUP_PENDING_POST_QUEUE: "group_pending_post_queue",
GROUP_JOIN_REQUEST_QUEUE: "group_join_request_queue",
GREETING_CARD: "greeting_card",
LEAD_GEN: "lead_gen",
ATTACHED_STORY: "attached_story",
SOUVENIR: "souvenir",
SLIDESHOW: "slideshow",
ORION: "orion",
ORION_REQUEST: "orion_request",
INSTANT_ARTICLE: "instant_article",
JOIN_TOPIC_CONVERSATION: "join_topic_conversation",
MOMENTS_APP_INVITATION: "moments_app_invitation",
RETAIL_CANCELLATION: "retail_cancellation",
RETAIL_ITEM: "retail_item",
RETAIL_NOW_IN_STOCK: "retail_now_in_stock",
RETAIL_RECEIPT: "retail_receipt",
RETAIL_SHIPMENT: "retail_shipment",
RETAIL_SHIPMENT_FOR_SUPPORTED_CARRIER: "retail_shipment_for_supported_carrier",
RETAIL_SHIPMENT_FOR_UNSUPPORTED_CARRIER: "retail_shipment_for_unsupported_carrier",
RETAIL_SHIPMENT_TRACKING_EVENT: "retail_shipment_tracking_event",
RETAIL_SHIPMENT_TRACKING_EVENT_ETA: "retail_shipment_tracking_event_eta",
RETAIL_SHIPMENT_TRACKING_EVENT_IN_TRANSIT: "retail_shipment_tracking_event_in_transit",
RETAIL_SHIPMENT_TRACKING_EVENT_OUT_FOR_DELIVERY: "retail_shipment_tracking_event_out_for_delivery",
RETAIL_SHIPMENT_TRACKING_EVENT_DELAYED: "retail_shipment_tracking_event_delayed",
RETAIL_SHIPMENT_TRACKING_EVENT_DELIVERED: "retail_shipment_tracking_event_delivered",
SURVEY: "survey",
MESSAGE_LOCATION: "message_location",
JOB_OFFER: "job_offer",
GROUP_ADD_MEMBERS: "group_add_memebers",
RTC_CALL_LOG: "rtc_call_log",
EVENT_CALENDAR: "event_calendar",
FACEPILE: "facepile",
ATTRIBUTED_SHARE: "attributed_share",
VIDEO_CINEMAGRAPH: "video_cinemagraph",
LOCAL_CONTEXT_SHARE: "local_context_share",
H_SCROLL: "h_scroll",
MEDIA_QUESTION: "media_question",
RICH_MEDIA: "rich_media",
SQUARE_IMAGE_SHARE: "square_image_share",
RETAIL_AGENT_ITEM_SUGGESTION: "retail_agent_item_suggestion",
RETAIL_AGENT_ITEM_RECEIPT: "retail_agent_item_receipt",
NOTE_COMPOSED: "note_composed",
AVATAR_WITH_BIRTHDAY: "avatar_with_birthday",
AIRLINE_FLIGHT_RESCHEDULE_UPDATE_BUBBLE: "airline_flight_reschedule_update_bubble",
LIGHTBOX_VIDEO: "lightbox_video",
GLOBALLY_DELETED_MESSAGE_PLACEHOLDER: "globally_deleted_message_placeholder",
AVATAR_WITH_EGO_ACTION: "avatar_with_ego_action",
EVENT_TICKET: "event_ticket",
VERTICAL_ATTACHMENT_LIST: "vertical_attachment_list",
INSTANT_ARTICLE_LEGACY: "instant_article_legacy",
FUNDRAISER_PAGE: "fundraiser_page"
};
}, null);
__d("ItunesPluginLogging", ["Run", "Bootloader"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
var h = {
logPluginData: function() {
g.onAfterLoad(function() {
var i = b('Bootloader');
i.loadModules(["ItunesDetector", "AsyncRequest"], function(j, k) {
new k().setURI('/ajax/ads/media/log').setData({
status: j.hasItunes()
}).send();
});
});
}
};
e.exports = h;
}, null);
__d("NotificationBeeperModuleLoader", ["BootloadedComponent.react", "JSResource", "React"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
var j = {
load: function(k, l) {
i.render(i.createElement(g, i.__spread({
bootloadPlaceholder: i.createElement("span", null),
bootloadLoader: h('NotificationBeeper.react')
}, k)), l);
}
};
e.exports = j;
}, null);
__d("SyncRequestTitle.react", ["React", "fbt", "cx"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
var j = g,
k = j.PropTypes,
l = g.createClass({
displayName: "SyncRequestTitle",
propTypes: {
appName: k.string.isRequired,
isSender: k.bool.isRequired,
receiverName: k.string.isRequired,
senderName: k.string.isRequired
},
render: function() {
if (this.props.isSender) {
return (g.createElement("div", null, h._("Waiting for {receiver} to accept your invite to play {app_name}.", [h.param("receiver", g.createElement("span", {
className: "_dg4"
}, this.props.receiverName)), h.param("app_name", g.createElement("span", {
className: "_dg5"
}, this.props.appName))])));
} else return (g.createElement("div", null, h._("{sender} wants to play {app_name} with you, right now.", [h.param("sender", g.createElement("span", {
className: "_dg4"
}, this.props.senderName)), h.param("app_name", g.createElement("span", {
className: "_dg5"
}, this.props.appName))])));
}
});
e.exports = l;
}, null);
__d("SyncRequestAcceptedMessage.react", ["React", "fbt", "cx"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
'use strict';
var j = g,
k = j.PropTypes,
l = g.createClass({
displayName: "SyncRequestAcceptedMessage",
propTypes: {
appName: k.string.isRequired,
isSender: k.bool.isRequired,
receiverName: k.string.isRequired,
senderName: k.string.isRequired
},
render: function() {
if (this.props.isSender) {
return (g.createElement("div", null, h._("{receiver} accepted your invite to play {app name}.", [h.param("receiver", g.createElement("span", {
className: "_dg4"
}, this.props.receiverName)), h.param("app name", g.createElement("span", {
className: "_dg5"
}, this.props.appName))])));
} else return (g.createElement("div", null, h._("You accepted an invite from {sender} to play {app name}.", [h.param("sender", g.createElement("span", {
className: "_dg4"
}, this.props.senderName)), h.param("app name", g.createElement("span", {
className: "_dg5"
}, this.props.appName))])));
}
});
e.exports = l;
}, null);
__d("SyncRequestRejectedMessage.react", ["AsyncRequest", "Link.react", "React", "URI", "cx", "fbt"], function(a, b, c, d, e, f, g, h, i, j, k, l) {
b.__markCompiled && b.__markCompiled();
var m = i,
n = m.PropTypes,
o = i.createClass({
displayName: "SyncRequestRejectedMessage",
propTypes: {
requestId: n.string.isRequired,
app: n.object.isRequired,
isSender: n.bool.isRequired,
receiver: n.object.isRequired,
sender: n.object.isRequired
},
render: function() {
if (this.props.isSender) {
return (i.createElement("div", null, l._("{receiver} declined your invite to play {app_name}.", [l.param("receiver", i.createElement("span", {
className: "_dg4"
}, this.props.receiver.name)), l.param("app_name", i.createElement("span", {
className: "_dg5"
}, this.props.app.name))])));
} else return (i.createElement("div", null, l._("You declined an invite from {sender} to play {app_name}.", [l.param("sender", i.createElement("span", {
className: "_dg4"
}, this.props.sender.name)), l.param("app_name", i.createElement("span", {
className: "_dg5"
}, this.props.app.name))]), i.createElement("div", {
className: "_13n7"
}, i.createElement("div", null, i.createElement(h, {
onClick: this._submitBlockApp
}, l._("\u5c01\u9396{app}\uff1f", [l.param("app", this.props.app.name)]))), i.createElement("div", null, i.createElement(h, {
onClick: this._submitBlockUser
}, l._("Block requests from {sender}", [l.param("sender", this.props.sender.name)]))))));
},
_submitBlockApp: function() {
var p = new j('/games/block_app/'),
q = new g().setURI(p);
q.setData({
app_id: this.props.app.id,
source: 'sync_request'
});
q.send();
},
_submitBlockUser: function() {
var p = new j('/games/block_user/'),
q = new g().setURI(p);
q.setData({
app_id: this.props.app.id,
blockee_uid: this.props.sender.id
});
q.send();
}
});
e.exports = o;
}, null);
__d("SyncRequestExpiredMessage.react", ["React", "fbt", "cx"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
var j = g,
k = j.PropTypes,
l = g.createClass({
displayName: "SyncRequestExpiredMessage",
propTypes: {
appName: k.string.isRequired,
isSender: k.bool.isRequired,
receiverName: k.string.isRequired,
senderName: k.string.isRequired
},
render: function() {
if (this.props.isSender) {
return (g.createElement("div", null, h._("{receiver} missed your invite to play {app name}.", [h.param("receiver", g.createElement("span", {
className: "_dg4"
}, this.props.receiverName)), h.param("app name", g.createElement("span", {
className: "_dg5"
}, this.props.appName))])));
} else return (g.createElement("div", null, h._("You missed an invite from {sender} to play {app name}.", [h.param("sender", g.createElement("span", {
className: "_dg4"
}, this.props.senderName)), h.param("app name", g.createElement("span", {
className: "_dg5"
}, this.props.appName))])));
}
});
e.exports = l;
}, null);
__d("SyncRequestCanceledMessage.react", ["React", "cx", "fbt"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
'use strict';
var j = g,
k = j.PropTypes,
l = g.createClass({
displayName: "SyncRequestCanceledMessage",
propTypes: {
appName: k.string.isRequired,
isSender: k.bool.isRequired,
receiverName: k.string.isRequired,
senderName: k.string.isRequired
},
render: function() {
if (this.props.isSender) {
return (g.createElement("div", null, i._("You canceled an invite to {receiver} to play {app name}.", [i.param("receiver", g.createElement("span", {
className: "_dg4"
}, this.props.receiverName)), i.param("app name", g.createElement("span", {
className: "_dg5"
}, this.props.appName))])));
} else return (g.createElement("div", null, i._("{sender} canceled an invitation to play {app name}.", [i.param("sender", g.createElement("span", {
className: "_dg4"
}, this.props.senderName)), i.param("app name", g.createElement("span", {
className: "_dg5"
}, this.props.appName))])));
}
});
e.exports = l;
}, null);
__d("SyncRequestTimer.react", ["React", "fbt"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
var i = g,
j = i.PropTypes;
function k(m) {
if (m) {
m = Math.ceil(m);
var n = m % 60;
if (n < 10) n = '0' + n;
var o = Math.floor(m / 60);
return o + ':' + n;
} else return "0:00";
}
var l = g.createClass({
displayName: "SyncRequestTimer",
propTypes: {
timeRemaining: j.number.isRequired,
isSender: j.bool.isRequired,
receiverName: j.string.isRequired
},
render: function() {
if (this.props.isSender) {
return (g.createElement("div", null, h._("({time_remaining} remaining)", [h.param("time_remaining", k(this.props.timeRemaining))])));
} else return (g.createElement("div", null, h._("You have {time_remaining} to accept.", [h.param("time_remaining", k(this.props.timeRemaining))])));
}
});
e.exports = l;
}, null);
__d("XSyncRequestSubmitController", ["XController"], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = b("XController").create("\/platform\/games\/sync_requests\/submit\/", {
request_id: {
type: "Int",
required: true
},
sender: {
type: "Int",
required: true
},
action: {
type: "Int",
required: true
}
});
}, null);
__d("SyncRequest.react", ["Arbiter", "AsyncRequest", "ChannelConstants", "React", "SyncRequestStatusEnum", "SyncRequestTitle.react", "SyncRequestAcceptedMessage.react", "SyncRequestRejectedMessage.react", "SyncRequestExpiredMessage.react", "SyncRequestCanceledMessage.react", "SyncRequestTimer.react", "XUIButton.react", "XSyncRequestSubmitController", "cx", "fbt", "getObjectValues"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) {
b.__markCompiled && b.__markCompiled();
var w = j,
x = w.PropTypes,
y = j.createClass({
displayName: "SyncRequest",
propTypes: {
app: x.object.isRequired,
creationTime: x.number.isRequired,
requestId: x.string.isRequired,
receiver: x.object.isRequired,
sender: x.object.isRequired,
status: x.oneOf(v(k)).isRequired,
timeout: x.number.isRequired,
timeRemaining: x.number.isRequired,
viewerId: x.number.isRequired,
onStatusUpdate: x.func
},
componentWillMount: function() {
if (this.props.status === k.PENDING) {
var z = g.subscribe(i.getArbiterType('sync_request_updated'), function(ca, da) {
da = da.obj;
if (da.id.toString() !== this.props.requestId) return;
this.setState({
status: da.status
});
}.bind(this));
this.setState({
statusEvent: z
});
}
var aa = null;
if (this.props.status === k.PENDING) {
var ba = function() {
this.setState({
time_remaining: (this.state.time_remaining - 1)
});
if (this.state.time_remaining <= 0) {
clearInterval(this.state.counter);
var ca = {
counter: null,
time_remaining: 0
};
if (this.state.status === k.PENDING) ca.status = k.EXPIRED;
this.setState(ca);
}
};
aa = setInterval(ba.bind(this), 1000);
}
this.setState({
time_remaining: this.props.timeRemaining,
counter: aa
});
},
componentWillUnmount: function() {
if (this.state.counter) clearInterval(this.state.counter);
g.unsubscribe(this.state.statusEvent);
},
getInitialState: function() {
return {
buttonsDisabled: false,
time: Date.now(),
status: this.props.status,
viewerIsSender: this.props.viewerId === this.props.sender.id
};
},
componentDidUpdate: function(z, aa) {
if (this.props.status != k.PENDING) this.state.status = this.props.status;
if (this.props.onStatusUpdate) this.props.onStatusUpdate(this.state.status, aa.status);
},
render: function() {
var z;
switch (this.state.status) {
case k.PENDING:
var aa;
if (!this.state.viewerIsSender) {
aa = [j.createElement(r, {
use: "confirm",
onClick: this._handleAccept,
disabled: this.state.buttonsDisabled,
label: u._("\u63a5\u53d7")
}), j.createElement(r, {
use: "default",
onClick: this._handleReject,
disabled: this.state.buttonsDisabled,
label: u._("\u4e0d\u53c3\u52a0")
})];
} else aa = j.createElement(r, {
use: "default",
onClick: this._handleCancel,
disabled: this.state.buttonsDisabled,
label: u._("\u53d6\u6d88")
});
z = (j.createElement("div", null, j.createElement("div", {
className: "_372m"
}, j.createElement(l, {
appName: this.props.app.name,
isSender: this.state.viewerIsSender,
receiverName: this.props.receiver.name,
senderName: this.props.sender.name
})), j.createElement("div", {
className: "_372n"
}, j.createElement(q, {
isSender: this.state.viewerIsSender,
timeRemaining: this.state.time_remaining,
receiverName: this.props.receiver.name
})), j.createElement("div", {
className: "_372o"
}, aa)));
break;
case k.ACCEPTED:
z = j.createElement("div", {
className: "_372p mvs"
}, j.createElement(m, {
appName: this.props.app.name,
isSender: this.state.viewerIsSender,
receiverName: this.props.receiver.name,
senderName: this.props.sender.name
}));
break;
case k.REJECTED:
z = j.createElement("div", {
className: "_372p mvs"
}, j.createElement(n, {
requestId: this.props.requestId,
app: this.props.app,
isSender: this.state.viewerIsSender,
receiver: this.props.receiver,
sender: this.props.sender
}));
break;
case k.EXPIRED:
z = j.createElement("div", {
className: "_372p mvs"
}, j.createElement(o, {
appName: this.props.app.name,
isSender: this.state.viewerIsSender,
receiverName: this.props.receiver.name,
senderName: this.props.sender.name
}));
break;
case k.CANCELED:
z = j.createElement("div", {
className: "_372p mvs"
}, j.createElement(p, {
appName: this.props.app.name,
isSender: this.state.viewerIsSender,
receiverName: this.props.receiver.name,
senderName: this.props.sender.name
}));
break;
default:
throw new Error('The request status `%s` is unknown.', this.state.status);
}
return (j.createElement("div", {
className: "_372q"
}, z));
},
_handleAccept: function() {
this._handleStatusUpdate(k.ACCEPTED);
var z = window.open(this.props.app.uri);
if (z) z.focus();
},
_handleReject: function() {
this._handleStatusUpdate(k.REJECTED);
},
_handleCancel: function() {
this._handleStatusUpdate(k.CANCELED);
},
_handleStatusUpdate: function(z) {
this.setState({
status: z,
buttonsDisabled: true
});
var aa = s.getURIBuilder().setInt('request_id', this.props.requestId).setInt('sender', this.props.sender.id).setInt('action', z).getURI();
new h().setURI(aa).setHandler(function(ba) {
this.setState({
status: z
});
}.bind(this)).setErrorHandler(function(ba) {
this.setState({
buttonsDisabled: false
});
}.bind(this)).send();
}
});
e.exports = y;
}, null);
__d("AbstractBadge.react", ["React", "cx", "invariant", "joinClasses"], function(a, b, c, d, e, f, g, h, i, j) {
b.__markCompiled && b.__markCompiled();
var k = g,
l = k.PropTypes;
function m(o) {
return parseInt(o, 10) === o;
}
var n = g.createClass({
displayName: "AbstractBadge",
propTypes: {
count: l.number.isRequired,
maxcount: l.number
},
getDefaultProps: function() {
return {
maxcount: 20
};
},
render: function() {
var o = this.props.count,
p = this.props.maxcount;
i(m(o));
i(m(p));
var q = (("_51lp") + (o > p ? ' ' + "_51lr" : '') + (o === 0 ? ' ' + "hidden_elem" : ''));
return (g.createElement("span", g.__spread({}, this.props, {
className: j(this.props.className, q)
}), o > p ? p + '+' : o));
}
});
e.exports = n;
}, null);
__d("XUIBadge.react", ["React", "AbstractBadge.react", "cx", "joinClasses"], function(a, b, c, d, e, f, g, h, i, j) {
b.__markCompiled && b.__markCompiled();
var k = g,
l = k.PropTypes,
m = g.createClass({
displayName: "XUIBadge",
propTypes: {
type: l.oneOf(['regular', 'special'])
},
getDefaultProps: function() {
return {
type: 'regular'
};
},
render: function() {
var n = this.props.type,
o = (("_5ugh") + (n === 'regular' ? ' ' + "_5ugf" : '') + (n === 'special' ? ' ' + "_5ugg" : ''));
return (g.createElement(h, g.__spread({}, this.props, {
className: j(this.props.className, o),
type: null
})));
}
});
e.exports = m;
}, null);
__d("str2rstr", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
function g(h) {
var i = "",
j, k;
for (var l = 0; l < h.length; l++) {
j = h.charCodeAt(l);
k = l + 1 < h.length ? h.charCodeAt(l + 1) : 0;
if (55296 <= j && j <= 56319 && 56320 <= k && k <= 57343) {
j = 65536 + ((j & 1023) << 10) + (k & 1023);
l++;
}
if (j <= 127) {
i += String.fromCharCode(j);
} else if (j <= 2047) {
i += String.fromCharCode(192 | ((j >>> 6) & 31), 128 | (j & 63));
} else if (j <= 65535) {
i += String.fromCharCode(224 | ((j >>> 12) & 15), 128 | ((j >>> 6) & 63), 128 | (j & 63));
} else if (j <= 2097151) i += String.fromCharCode(240 | ((j >>> 18) & 7), 128 | ((j >>> 12) & 63), 128 | ((j >>> 6) & 63), 128 | (j & 63));
}
return i;
}
e.exports = g;
}, null);
__d("md5", ["str2rstr"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
function h(u, v) {
var w = u[0],
x = u[1],
y = u[2],
z = u[3];
w = j(w, x, y, z, v[0], 7, -680876936);
z = j(z, w, x, y, v[1], 12, -389564586);
y = j(y, z, w, x, v[2], 17, 606105819);
x = j(x, y, z, w, v[3], 22, -1044525330);
w = j(w, x, y, z, v[4], 7, -176418897);
z = j(z, w, x, y, v[5], 12, 1200080426);
y = j(y, z, w, x, v[6], 17, -1473231341);
x = j(x, y, z, w, v[7], 22, -45705983);
w = j(w, x, y, z, v[8], 7, 1770035416);
z = j(z, w, x, y, v[9], 12, -1958414417);
y = j(y, z, w, x, v[10], 17, -42063);
x = j(x, y, z, w, v[11], 22, -1990404162);
w = j(w, x, y, z, v[12], 7, 1804603682);
z = j(z, w, x, y, v[13], 12, -40341101);
y = j(y, z, w, x, v[14], 17, -1502002290);
x = j(x, y, z, w, v[15], 22, 1236535329);
w = k(w, x, y, z, v[1], 5, -165796510);
z = k(z, w, x, y, v[6], 9, -1069501632);
y = k(y, z, w, x, v[11], 14, 643717713);
x = k(x, y, z, w, v[0], 20, -373897302);
w = k(w, x, y, z, v[5], 5, -701558691);
z = k(z, w, x, y, v[10], 9, 38016083);
y = k(y, z, w, x, v[15], 14, -660478335);
x = k(x, y, z, w, v[4], 20, -405537848);
w = k(w, x, y, z, v[9], 5, 568446438);
z = k(z, w, x, y, v[14], 9, -1019803690);
y = k(y, z, w, x, v[3], 14, -187363961);
x = k(x, y, z, w, v[8], 20, 1163531501);
w = k(w, x, y, z, v[13], 5, -1444681467);
z = k(z, w, x, y, v[2], 9, -51403784);
y = k(y, z, w, x, v[7], 14, 1735328473);
x = k(x, y, z, w, v[12], 20, -1926607734);
w = l(w, x, y, z, v[5], 4, -378558);
z = l(z, w, x, y, v[8], 11, -2022574463);
y = l(y, z, w, x, v[11], 16, 1839030562);
x = l(x, y, z, w, v[14], 23, -35309556);
w = l(w, x, y, z, v[1], 4, -1530992060);
z = l(z, w, x, y, v[4], 11, 1272893353);
y = l(y, z, w, x, v[7], 16, -155497632);
x = l(x, y, z, w, v[10], 23, -1094730640);
w = l(w, x, y, z, v[13], 4, 681279174);
z = l(z, w, x, y, v[0], 11, -358537222);
y = l(y, z, w, x, v[3], 16, -722521979);
x = l(x, y, z, w, v[6], 23, 76029189);
w = l(w, x, y, z, v[9], 4, -640364487);
z = l(z, w, x, y, v[12], 11, -421815835);
y = l(y, z, w, x, v[15], 16, 530742520);
x = l(x, y, z, w, v[2], 23, -995338651);
w = m(w, x, y, z, v[0], 6, -198630844);
z = m(z, w, x, y, v[7], 10, 1126891415);
y = m(y, z, w, x, v[14], 15, -1416354905);
x = m(x, y, z, w, v[5], 21, -57434055);
w = m(w, x, y, z, v[12], 6, 1700485571);
z = m(z, w, x, y, v[3], 10, -1894986606);
y = m(y, z, w, x, v[10], 15, -1051523);
x = m(x, y, z, w, v[1], 21, -2054922799);
w = m(w, x, y, z, v[8], 6, 1873313359);
z = m(z, w, x, y, v[15], 10, -30611744);
y = m(y, z, w, x, v[6], 15, -1560198380);
x = m(x, y, z, w, v[13], 21, 1309151649);
w = m(w, x, y, z, v[4], 6, -145523070);
z = m(z, w, x, y, v[11], 10, -1120210379);
y = m(y, z, w, x, v[2], 15, 718787259);
x = m(x, y, z, w, v[9], 21, -343485551);
u[0] = s(w, u[0]);
u[1] = s(x, u[1]);
u[2] = s(y, u[2]);
u[3] = s(z, u[3]);
}
function i(u, v, w, x, y, z) {
v = s(s(v, u), s(x, z));
return s((v << y) | (v >>> (32 - y)), w);
}
function j(u, v, w, x, y, z, aa) {
return i((v & w) | ((~v) & x), u, v, y, z, aa);
}
function k(u, v, w, x, y, z, aa) {
return i((v & x) | (w & (~x)), u, v, y, z, aa);
}
function l(u, v, w, x, y, z, aa) {
return i(v ^ w ^ x, u, v, y, z, aa);
}
function m(u, v, w, x, y, z, aa) {
return i(w ^ (v | (~x)), u, v, y, z, aa);
}
function n(u) {
var v = u.length,
w = [1732584193, -271733879, -1732584194, 271733878],
x;
for (x = 64; x <= u.length; x += 64) h(w, o(u.substring(x - 64, x)));
u = u.substring(x - 64);
var y = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
for (x = 0; x < u.length; x++) y[x >> 2] |= u.charCodeAt(x) << ((x & 3) << 3);
y[x >> 2] |= 128 << ((x & 3) << 3);
if (x > 55) {
h(w, y);
for (x = 0; x < 16; x++) y[x] = 0;
}
y[14] = v * 8;
h(w, y);
return w;
}
function o(u) {
var v = [],
w = 0;
while (w < 64) v[w >> 2] = u.charCodeAt(w++) | (u.charCodeAt(w++) << 8) | (u.charCodeAt(w++) << 16) | (u.charCodeAt(w++) << 24);
return v;
}
var p = '0123456789abcdef'.split('');
function q(u) {
var v = '',
w = 0;
for (; w < 4; w++) v += p[(u >> ((w << 3) + 4)) & 15] + p[(u >> (w << 3)) & 15];
return v;
}
function r(u) {
for (var v = 0; v < u.length; v++) u[v] = q(u[v]);
return u.join('');
}
var s = function(u, v) {
return (u + v) & 4294967295;
};
function t(u) {
if (null === u || (void 0) === u) {
return null;
} else {
for (var v = 0; v < u.length; v++)
if (u[v] > "\u007F") {
u = g(u);
break;
}
return r(n(u));
}
}
if (t('hello') != '5d41402abc4b2a76b9719d911017c592') s = function(u, v) {
var w = (u & 65535) + (v & 65535),
x = (u >> 16) + (v >> 16) + (w >> 16);
return (x << 16) | (w & 65535);
};
e.exports = t;
}, null);
__d("LineClamp.react", ["React", "cx", "getVendorPrefixedName", "joinClasses"], function(a, b, c, d, e, f, g, h, i, j) {
b.__markCompiled && b.__markCompiled();
'use strict';
var k = g,
l = k.PropTypes,
m = i('lineClamp'),
n = g.createClass({
displayName: "LineClamp",
propTypes: {
customEllipsis: l.node,
disableNative: l.bool,
lineHeight: l.number,
lines: l.number.isRequired
},
_renderEllipsis: function() {
var o;
if (this.props.lineHeight) o = {
bottom: this.props.lineHeight + 'px'
};
return (g.createElement("div", {
style: o,
className: "_4ik3",
key: "ellipsis"
}, this.props.customEllipsis ? this.props.customEllipsis : '\u2026'));
},
render: function() {
var o = !!m && !this.props.disableNative,
p = j(this.props.className, (("_4ik4") + (o ? ' ' + "_4ik5" : ''))),
q = this.props.children,
r = {};
if (this.props.lineHeight) r = {
height: this.props.lineHeight * this.props.lines,
lineHeight: this.props.lineHeight + 'px'
};
if (o) {
r[m] = this.props.lines;
} else {
p = j(p, 'clearfix');
q = [g.createElement("div", {
className: "_4ik6",
key: "inner"
}, q), this._renderEllipsis()];
}
return (g.createElement("div", {
className: p,
style: r
}, q));
}
});
e.exports = n;
}, null);
__d("PhotoStoreCore", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
var g = {
actions: {
UPDATE: 'update'
},
_photoCache: {},
_postCreateCallbacks: {},
getPhotoCache: function(h) {
if (!this._photoCache[h]) throw new Error('Photo cache requested for unknown set ID');
return this._photoCache[h];
},
hasBeenCreated: function(h) {
return !!this._photoCache[h];
},
clearSetCache: function(h) {
delete this._photoCache[h];
delete this._postCreateCallbacks[h];
},
getByIndex: function(h, i, j) {
this.getPhotoCache(h).getItemAtIndex(i, j);
},
getByIndexImmediate: function(h, i) {
if (this._photoCache[h]) return this._photoCache[h].getItemAtIndexImmediate(i);
return (void 0);
},
getItemsInAvailableRange: function(h) {
var i = this.getAvailableRange(h),
j = [];
for (var k = i.offset; k < i.length; k++) j.push(this.getByIndexImmediate(h, k));
return j;
},
getItemsAfterIndex: function(h, i, j, k) {
var l = this.getCursorByIndexImmediate(h, i);
this.fetchForward(h, l, j, k);
},
getAllByIDImmediate: function(h) {
var i = Object.keys(this._photoCache);
return i.map(function(j) {
return this.getByIndexImmediate(j, this.getIndexForID(j, h));
}.bind(this)).filter(function(j) {
return !!j;
});
},
getIndexForID: function(h, i) {
if (this._photoCache[h]) return this._photoCache[h].getIndexForID(i);
return (void 0);
},
getEndIndex: function(h) {
var i = this.getAvailableRange(h);
return i.offset + i.length - 1;
},
getCursorByIndexImmediate: function(h, i) {
var j = this.getByIndexImmediate(h, i);
if (j) return this._photoCache[h].getCursorForID(j.id);
return (void 0);
},
hasNextPage: function(h) {
var i = this.getCursorByIndexImmediate(h, this.getEndIndex(h));
return this.getPhotoCache(h).hasNextPage(i);
},
getAvailableRange: function(h) {
return this.getPhotoCache(h).getAvailableRange();
},
hasLooped: function(h) {
return this.getPhotoCache(h).hasLooped();
},
fetchForward: function(h, i, j, k) {
this.getPhotoCache(h).getItemsAfterCursor(i, j, k);
},
fetchBackward: function(h, i, j, k) {
this.getPhotoCache(h).getItemsBeforeCursor(i, j, k);
},
executePostCreate: function(h, i) {
if (this._photoCache[h]) {
i && i();
} else this._postCreateCallbacks[h] = i;
},
runPostCreateCallback: function(h) {
var i = this._postCreateCallbacks[h];
if (i) {
i();
delete this._postCreateCallbacks[h];
}
},
setPreFetchCallback: function(h, i) {
this.getPhotoCache(h).setPreFetchCallback(i);
},
updateData: function(h) {
var i = h.set_id;
if (!this._photoCache[i]) {
this._photoCache[i] = new h.cache_class(h);
this.runPostCreateCallback(i);
} else if (h.query_metadata.action == g.actions.UPDATE) {
this._photoCache[i].updateData(h);
} else this._photoCache[i].addData(h);
},
updateFeedbackData: function(h) {
var i = Object.keys(h);
i.forEach(function(j) {
return g.getAllByIDImmediate(j).forEach(function(k) {
k.feedback = h[j].feedback;
});
});
},
reset: function() {
Object.keys(this._photoCache).forEach(function(h) {
return this.clearSetCache(h);
}.bind(this));
}
};
e.exports = g;
}, null);
__d("WaterfallIDGenerator", ["CurrentUser", "md5"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
function i() {
var l = 2147483647;
return Math.random() * l;
}
function j() {
return Math.floor(Date.now() / 1000);
}
var k = {
generate: function() {
return h([g.getID(), j(), i()].join(':'));
}
};
e.exports = k;
}, null);
__d("MessengerButton.react", ["ReactComponentWithPureRenderMixin", "React", "cx", "joinClasses"], function(a, b, c, d, e, f, g, h, i, j) {
b.__markCompiled && b.__markCompiled();
'use strict';
var k = h,
l = k.PropTypes,
m = h.createClass({
displayName: "MessengerButton",
mixins: [g],
propTypes: {
label: l.string.isRequired,
type: l.oneOf(['primary', 'secondary']).isRequired,
use: l.oneOf(['default', 'danger']).isRequired
},
getDefaultProps: function() {
return {
use: 'default'
};
},
handleLinkClick: function(n) {
if (this.props.disabled) {
n.preventDefault();
} else if (this.props.onClick) this.props.onClick(n);
},
render: function() {
var n = this.props,
o = n.className,
p = n.label,
q = (function(r, s) {
var t = {},
u = Object.prototype.hasOwnProperty;
if (r == null) throw new TypeError();
for (var v in r)
if (u.call(r, v) && !u.call(s, v)) t[v] = r[v];
return t;
})(n, {
className: 1,
label: 1
});
return (h.createElement("a", h.__spread({
className: j((("_3quh") + (' ' + "_30yy") + (this.props.type === 'primary' ? ' ' + "_2t_" : '') + (this.props.type === 'secondary' ? ' ' + "_2u0" : '') + (this.props.use === 'danger' ? ' ' + "_3ay_" : '') + (this.props.disabled ? ' ' + "_4zab" : '')), o),
href: "#"
}, q, {
onClick: this.handleLinkClick
}), p));
}
});
e.exports = m;
}, null);
__d("MessengerStateProcessor", ["MercuryAPIArgsSource", "MercuryIDs", "MercuryParticipantTypes", "MercuryParticipants", "MercuryThreadIDMap", "MercuryThreads", "MercuryVanityIDMap", "MessengerURIConstants"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n) {
b.__markCompiled && b.__markCompiled();
'use strict';
var o = {
preprocess: function(q) {
var r = q.activeThreadID;
if (r) {
var s = h.getUserIDFromThreadID(r),
t = s && j.getNow(h.getParticipantIDFromUserID(s));
if (t && t.type !== i.EVENT) {
q.threadKey = t.vanity || s;
} else if (s && !t) {
var u = h.getParticipantIDFromUserID(s);
q.threadKey = m.hasID(u) ? m.getVanity(u) : s;
} else {
var v = k.get(),
w = v.getFBIDFromClientIDNow(r);
q.threadKey = w || r;
}
}
delete q.activeThreadID;
return q;
},
postprocess: function(q) {
var r = k.get(),
s = l.get(),
t = p(q.threadKey),
u;
u = h.isValid(t) ? t : r.getClientIDFromFBIDNow(t);
if (!u) {
var v = j.getIDFromVanityOrFBID(t),
w = v && s.getCanonicalThreadToParticipant(v, null, g.MESSENGER);
if (w) u = w.thread_id;
}
if (u) {
q.activeThreadID = u;
q.serverThreadID = r.getFBIDFromClientIDNow(u);
}
delete q.threadKey;
return q;
}
};
function p(q) {
if (!q) return null;
return q.startsWith(n.GROUP_PREFIX) ? q.substr(n.GROUP_PREFIX.length) : q;
}
e.exports = o;
}, null);
__d("NotificationSettingsDialog", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
var g = {
show: function(h) {
d(['MercuryThreadActions'], function(i) {
i.get().openNotificationSettings(h);
});
}
};
e.exports = g;
}, null);
__d("MercuryShareAttachmentReactShape", ["React"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
'use strict';
var h = g,
i = h.PropTypes,
j = i.shape({
share_id: i.string,
description: i.string,
media: i.shape({
image: i.string,
image_size: i.shape({
height: i.number,
width: i.number
}),
duration: i.number,
playable: i.bool,
source: i.string
}),
source: i.string,
style_list: i.arrayOf(i.string),
subattachments: i.array,
target: i.object,
title: i.string,
properties: i.object,
uri: i.string
}).isRequired;
e.exports = j;
}, null);
__d("EmoticonUtils", ["EmoticonsList", "Parent"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
var i = 'emoticon_',
j = g.symbols,
k = {
getEmoteFromTarget: function(l) {
var m = h.byClass(l, 'emoticon');
if (!m) return null;
var n = null;
m.className.split(' ').forEach(function(o) {
if (o.startsWith(i)) n = o.substring(i.length);
});
return j[n] || null;
},
insertEmoticon: function(l, m, n) {
var o = m.substring(0, n.start),
p = m.substring(n.end);
if (n.start > 0 && !o.endsWith(' ')) l = ' ' + l;
if (!p.startsWith(' ')) l += ' ';
var q = o + l + p;
n.start += l.length;
n.end = n.start;
return {
result: q,
start: n.start,
end: n.end
};
}
};
e.exports = k;
}, null);
__d("URLScraper", ["ArbiterMixin", "DataStore", "Event", "URLMatcher", "mixin"], function(a, b, c, d, e, f, g, h, i, j, k) {
b.__markCompiled && b.__markCompiled();
var l = 'scraperLastPermissiveMatch',
m = k(g);
for (var n in m)
if (m.hasOwnProperty(n)) p[n] = m[n];
var o = m === null ? null : m.prototype;
p.prototype = Object.create(o);
p.prototype.constructor = p;
p.__superConstructor__ = m;
function p(q, r) {
"use strict";
m.call(this);
this.input = q;
this.enable();
this.getValueFn = r;
}
p.prototype.reset = function() {
"use strict";
h.set(this.input, l, null);
};
p.prototype.enable = function() {
"use strict";
if (this.events) return;
var q = function(r) {
setTimeout(this.check.bind(this, r), 30);
};
this.events = i.listen(this.input, {
paste: q.bind(this, false),
keydown: q.bind(this, true)
});
};
p.prototype.disable = function() {
"use strict";
if (!this.events) return;
for (var event in this.events) this.events[event].remove();
this.events = null;
};
p.prototype.check = function(q) {
"use strict";
var r = this.getValueFn ? this.getValueFn() : this.input.value;
if (q && p.trigger(r)) return;
var s = p.match(r),
t = j.permissiveMatch(r);
if (t && (t != h.get(this.input, l))) {
h.set(this.input, l, t);
this.inform('match', {
url: s || t,
alt_url: t
});
}
};
Object.assign(p, j);
e.exports = p;
}, null);
__d("XOfferSetNotificationsController", ["XController"], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = b("XController").create("\/offers\/v2\/notifications\/", {
offer: {
type: "Int",
required: true
},
enable: {
type: "Bool",
defaultValue: false
}
});
}, null);
__d("XOfferSendPlatformNotificationController", ["XController"], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = b("XController").create("\/offers\/v2\/send_platform_notification\/", {});
}, null);
__d("OffersUtil", ["DOM", "DOMQuery", "CSS", "Event", "AsyncRequest", "XOfferSetNotificationsController", "XOfferSendPlatformNotificationController"], function(a, b, c, d, e, f, g, h, i, j, k, l, m) {
b.__markCompiled && b.__markCompiled();
var n = {
attachHideShowClickListener: function(o, p, q) {
j.listen(o, 'click', function() {
var r = h.scry(h.getRootElement(), p),
s = h.scry(h.getRootElement(), q);
for (var t = 0; t < r.length; t++) i.hide(r[t]);
for (var u = 0; u < s.length; u++) i.show(s[u]);
});
},
registerRedirectAfter: function(o, p) {
setTimeout(function() {
window.location.href = o;
}, p);
},
attachDeletelLinkClickListener: function(o, p, q, r, s) {
j.listen(o, 'click', function() {
new k().setURI(q).setHandler(function(t) {
var u = t.getPayload();
if (u) {
p.className = r;
} else p.className = s;
}).send();
});
},
listen: function(o, p) {
j.listen(o, 'click', p.show.bind(p));
},
showRegistered: function(o, p) {
j.listen(o, 'click', function() {
p.show();
});
},
logGoToWebsiteClick: function(o, p) {
j.listen(o, 'click', function() {
new k().setURI(p).send();
});
},
sendPlatformNotification: function() {
var o = m.getURIBuilder().getURI();
new k().setURI(o).send();
}
};
e.exports = n;
}, null);
__d("PhotoStore", ["Arbiter", "PhotoStoreCore"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
g.subscribe('update-photos', function(i, j) {
h.updateData(j);
});
e.exports = h;
}, null);
__d("SyncRequestNotificationBeeperItemContents.react", ["Animation", "CloseButton.react", "ImageBlock.react", "NotificationUserActions", "React", "SyncRequest.react", "SyncRequestStatusEnum", "cx"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n) {
b.__markCompiled && b.__markCompiled();
var o = k.createClass({
displayName: "SyncRequestNotificationBeeperItemContents",
_markAsRead: function() {
j.markNotificationsAsRead([this.props.beep.notificationID]);
this.props.onHide();
},
_onClose: function() {
this._markAsRead();
this.props.onHide();
},
_doFlash: function() {
new g(k.findDOMNode(this.refs.inner)).from('opacity', '0').to('opacity', '1').duration(200).go();
},
componentDidMount: function() {
if (this.props.beep.rendererData.status != m.PENDING) this.props.onReadyToHide(this.props.beep.notificationID);
},
componentDidUpdate: function(p) {
if (this.props.beep.rendererData.status != m.PENDING && p.beep.rendererData.status == m.PENDING) this.props.onReadyToHide(this.props.beep.notificationID);
},
onRequestStatusUpdate: function(p, q) {
if (p != m.PENDING && q == m.PENDING) this.props.onReadyToHide(this.props.beep.notificationID);
},
render: function() {
var p = this.props.beep,
q = p.rendererData;
return (k.createElement("div", {
ref: "inner"
}, k.createElement(h, {
className: "_3soc",
onClick: this._onClose,
size: "medium"
}), k.createElement(i, {
className: "_3soj"
}, k.createElement("img", {
src: p.actors[0].profile_picture.uri,
className: "_3sok"
}), k.createElement("div", {
className: "_3sol"
}, k.createElement(l, {
app: q.app,
creationTime: q.creation_time,
requestId: q.id.toString(),
receiver: q.receiver,
sender: q.sender,
status: q.status,
timeout: q.timeout,
timeRemaining: q.time_remaining,
viewerId: q.receiver.id,
onStatusUpdate: this.onRequestStatusUpdate
})))));
}
});
e.exports = o;
}, null);
__d("LiveMessageReceiver", ["Arbiter", "ChannelConstants", "emptyFunction", "shield"], function(a, b, c, d, e, f, g, h, i, j) {
b.__markCompiled && b.__markCompiled();
function k(l) {
this.eventName = l;
this.subs = null;
this.handler = i;
this.shutdownHandler = null;
this.registered = false;
this.appId = 1;
}
Object.assign(k, {
getAppMessageType: function(l, m) {
return 'live_message/' + l + ':' + m;
},
route: function(l) {
var m = function(n) {
var o = k.getAppMessageType(l.app_id, l.event_name);
g.inform(o, n, g.BEHAVIOR_PERSISTENT);
};
m(l.response);
}
});
Object.assign(k.prototype, {
setAppId: function(l) {
this.appId = l;
return this;
},
setHandler: function(l) {
this.handler = l;
this._dirty();
return this;
},
setRestartHandler: i,
setShutdownHandler: function(l) {
this.shutdownHandler = j(l);
this._dirty();
return this;
},
_dirty: function() {
if (this.registered) {
this.unregister();
this.register();
}
},
register: function() {
var l = function(n, o) {
return this.handler(o);
}.bind(this),
m = k.getAppMessageType(this.appId, this.eventName);
this.subs = {};
this.subs.main = g.subscribe(m, l);
if (this.shutdownHandler) this.subs.shut = g.subscribe(h.ON_SHUTDOWN, this.shutdownHandler);
this.registered = true;
return this;
},
unregister: function() {
if (!this.subs) return this;
for (var l in this.subs)
if (this.subs[l]) this.subs[l].unsubscribe();
this.subs = null;
this.registered = false;
return this;
}
});
e.exports = k;
}, null);
__d("initLiveMessageReceiver", ["Arbiter", "ChannelConstants", "LiveMessageReceiver"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
g.subscribe(h.getArbiterType('app_msg'), function(j, k) {
i.route(k.obj);
});
}, null);
__d("ClearableTypeahead", ["Event"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
var h = {
resetOnCloseButtonClick: function(i, j) {
g.listen(j, 'click', function() {
var k = i.getCore();
k.getElement().focus();
k.reset();
});
}
};
e.exports = h;
}, null);
__d("ContextualLayerAutoFlipHorizontal", ["ContextualLayerAutoFlip"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
for (var h in g)
if (g.hasOwnProperty(h)) j[h] = g[h];
var i = g === null ? null : g.prototype;
j.prototype = Object.create(i);
j.prototype.constructor = j;
j.__superConstructor__ = g;
function j() {
"use strict";
if (g !== null) g.apply(this, arguments);
}
j.prototype.getValidPositions = function(k) {
"use strict";
return [k.getPosition()];
};
e.exports = j;
}, null);
__d("DialogFitHeight", ["AbstractDialogFitHeight"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
for (var h in g)
if (g.hasOwnProperty(h)) j[h] = g[h];
var i = g === null ? null : g.prototype;
j.prototype = Object.create(i);
j.prototype.constructor = j;
j.__superConstructor__ = g;
function j() {
"use strict";
if (g !== null) g.apply(this, arguments);
}
j.prototype.getHeightProperty = function() {
"use strict";
return 'height';
};
e.exports = j;
}, null);
/*!CK:2712167347!*/ /*1438697687,*/
if (self.CavalryLogger) {
CavalryLogger.start_js(["xOlRU"]);
}
__d("ComposerTargetType", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = {
SELF_USER: "feed",
OTHER_USER: "wall",
GROUP: "group",
PAGE: "page",
EVENT: "event",
RECOMMENDATION: "recommendation",
EXAMPLE: "example"
};
}, null);
__d("ComposerType", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = {
INLINE: "inline",
ADVANCED: "advanced",
NORMAL: "normal"
};
}, null);
__d("ComposerWaterfallEvent", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = {
COMPOSER_CANCEL: "composer_cancel",
COMPOSER_CANCEL_INTENT: "intent_composer_cancel",
COMPOSER_ENTRY: "composer_entry",
COMPOSER_NOT_RENDERED: "composer_not_renderer",
COMPOSER_POST: "composer_post",
COMPOSER_POST_CANCEL: "composer_post_cancel",
COMPOSER_POST_FAILURE: "composer_post_failure",
COMPOSER_POST_FAILURE_FATAL: "composer_post_fatal_failure",
COMPOSER_POST_FAILURE_GIVEUP: "composer_post_giveup_failure",
COMPOSER_POST_SUCCESS: "composer_post_success",
COMPOSER_POST_COMPLETED: "composer_post_completed",
COMPOSER_WRITTEN: "composer_written",
ALBUM_ADD: "add_album",
ALBUM_CANCEL: "cancel_album",
ALBUM_INTENT: "intent_album",
ALBUM_REMOVE: "remove_album",
FRIEND_TAG_ADD: "add_friend_tag",
FRIEND_TAG_CANCEL: "cancel_friend_tag",
FRIEND_TAG_INTENT: "intent_friend_tag",
FRIEND_TAG_REMOVE: "remove_friend_tag",
FRIEND_TAG_SEARCH: "search_friend_tag",
FRIEND_SHOW_MORE: "show_more_friend_tag",
LOCATION_ADD: "add_location",
LOCATION_CANCEL: "cancel_location",
LOCATION_INTENT: "intent_location",
LOCATION_REMOVE: "remove_location",
LOCATION_SCROLL: "scroll_location",
LOCATION_SEARCH: "search_location",
EMBEDS_ADD: "add_embed",
EMBEDS_CANCEL: "cancel_embed",
EMBEDS_INTENT: "intent_embed",
MINUTIAE_ADD: "add_minutiae",
MINUTIAE_CANCEL: "cancel_minutiae",
MINUTIAE_CHANGE_ICON: "change_icon_minutiae",
MINUTIAE_CHANGE_ICON_CANCEL: "change_icon_cancel_minutiae",
MINUTIAE_CHANGE_ICON_INTENT: "change_icon_intent_minutiae",
MINUTIAE_INTENT: "intent_minutiae",
MINUTIAE_REMOVE: "remove_minutiae",
MINUTIAE_SCROLL: "scroll_minutiae",
MINUTIAE_SEARCH: "search_minutiae",
MINUTIAE_TYPE_CLICK: "type_click_minutiae",
MINUTIAE_SEE_MORE: "see_more_minutiae",
MINUTIAE_CHAIN_SKIP: "skip_chain_minutiae",
MINUTIAE_CHAIN_SUGGEST: "suggest_chain_minutiae",
MINUTIAE_ICONPICKER_QUERY: "minutiae_iconpicker_query",
MINUTIAE_ICONPICKER_BOOTSTRAP: "minutiae_iconpicker_bootstrap",
MINUTIAE_ICONPICKER_SELECT: "minutiae_iconpicker_select",
MEDIA_INTENT: "intent_media",
MEDIA_CANCEL: "cancel_media",
PHOTO_ADD: "add_photo",
PHOTO_ADD_FAILURE: "add_photo_failure",
PHOTO_ADD_SUCCESS: "add_photo_success",
PHOTO_REMOVE: "remove_photo",
PRIVACY_ADD: "add_privacy",
PRIVACY_CANCEL: "cancel_privacy",
PRIVACY_INTENT: "intent_privacy",
PRIVACY_SCROLL: "scroll_privacy",
PRIVACY_SEE_ALL_LISTS: "see_all_lists_privacy",
SELECT_FRIEND_TIMELINE_INTENT: "intent_select_friend_timeline",
SELECT_FRIEND_TIMELINE_ADD: "add_select_friend_timeline",
SELECT_FRIEND_TIMELINE_CANCEL: "cancel_select_friend_timeline",
SERVER_POST_BEGIN: "server_composer_post_begin",
SERVER_POST_FAILURE: "server_composer_post_failure",
SERVER_POST_SUCCESS: "server_composer_post_succeeded",
POST_POST_WITH_TAG_BEGIN: "post_post_with_tag_begin",
POST_POST_WITH_TAG_FAILURE: "post_post_with_tag_failure",
POST_POST_WITH_TAG_SUCCESS: "post_post_with_tag_success",
TARGET_SELECTOR_INTENT: "intent_target_selector",
TARGET_SELECTOR_CANCEL: "cancel_target_selector",
VIDEO_ADD: "add_video",
VIDEO_ADD_FAILURE: "add_video_failure",
VIDEO_ADD_SUCCESS: "add_video_success",
VIDEO_REMOVE: "remove_video"
};
}, null);
__d("ReactComposerConstants", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = {
ID_PREFIX: "rc.",
GK_VIDEO_COPYRIGHT: "video_copyright_confirmation_dialog",
GK_MULTILINGUAL_COMPOSER: "multilingual_composer_www"
};
}, null);
__d("Cache", ["DateConsts", "Map", "TreeMap"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
'use strict';
function j() {
this.$Cache0 = new h();
}
j.prototype.has = function(k) {
return this.$Cache0.has(k);
};
j.prototype.get = function(k, l) {
var m = this.__getRaw(k);
if (!m) return l;
return m.$Cache1;
};
j.prototype.getAll = function(k, l) {
var m = new h();
k.forEach(function(n) {
return m.set(n, this.get(n, l));
}.bind(this));
return m;
};
j.prototype["delete"] = function(k) {
var l = this.__getRaw(k);
if (l && l.$Cache2) clearTimeout(l.$Cache2);
return this.$Cache0["delete"](k);
};
j.prototype.clear = function() {
this.$Cache0.forEach(function(k) {
if (k && k.$Cache2) clearTimeout(k.$Cache2);
});
this.$Cache0.clear();
};
j.prototype.set = function(k, l, m, n) {
if (!this.shouldUpdate(k, m)) return false;
var o = this.__getRaw(k);
if (!o) o = this.__getNewRawObject();
delete o.$Cache1;
delete o.$Cache3;
if (o.$Cache2) clearTimeout(o.$Cache2);
delete o.$Cache2;
o.$Cache1 = l;
if (m != null) o.$Cache3 = m;
if (n != null && n >= 0) o.$Cache2 = setTimeout(this["delete"].bind(this, k), n * g.MS_PER_SEC * g.SEC_PER_MIN);
this.__setRaw(k, o);
return true;
};
j.prototype.shouldUpdate = function(k, l) {
var m = this.__getRaw(k);
return (m == null || m.$Cache3 == null || l == null || l > m.$Cache3);
};
j.prototype.size = function() {
return this.$Cache0.size;
};
j.prototype.__getRaw = function(k) {
return this.$Cache0.get(k);
};
j.prototype.__setRaw = function(k, l) {
this.$Cache0.set(k, l);
};
j.prototype.__getNewRawObject = function() {
return {
$Cache1: null,
$Cache2: null,
$Cache3: null,
$Cache4: null,
$Cache5: null
};
};
j.prototype.__keys = function() {
return this.$Cache0.keys();
};
e.exports = j;
}, null);
__d("getDOMImageSize", ["URI"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
function h(m) {
m.onload = null;
m.onerror = null;
m.onreadystatechange = null;
m._callback = null;
m._thisObj = null;
m._srcStr = null;
m.parentNode && m.parentNode.removeChild(m);
}
function i() {
var m = this;
if (m._callback) m._callback.call(m._thisObj, m.naturalWidth || m.width, m.naturalHeight || m.height, m._srcStr);
h(m);
}
function j() {
var m = this;
if (m.readyState === 'complete') i.call(m);
}
function k() {
var m = this;
if (m._callback) m._callback.call(m._thisObj, 0, 0, m._srcStr);
h(m);
}
function l(m, n, o) {
o = o || null;
if (!m) {
n.call(o, 0, 0, '');
return;
}
var p = document.body;
if (!p) {
setTimeout(l.bind(this, m, n, o), 500);
return;
}
var q;
if (typeof m === 'string') {
q = m;
} else if (typeof m === 'object')
if (typeof m.width === 'number' && typeof m.height === 'number') {
if (typeof m.src === 'string') {
q = m.src;
if (m.naturalWidth && m.naturalHeight) {
n.call(o, m.naturalWidth, m.naturalHeight, q);
return;
}
}
if (typeof m.uri === 'string') {
q = m.uri;
if (m.width && m.height) {
n.call(o, m.width, m.height, q);
return;
}
}
} else if (m instanceof g) q = m.toString();
if (!q) {
n(0, 0, m);
return;
}
var r = document.createElement('img');
r.onreadystatechange = j;
r.onload = i;
r.onerror = k;
r._callback = n;
r._thisObj = o;
r._srcStr = q;
r.src = q;
r.style.cssText = 'position:absolute;left:0;top:0;width:auto;height:auto;clip:rect(0 0 0 0);';
p.insertBefore(r, p.firstChild);
}
e.exports = l;
}, null);
__d("CachedDOMImageSizePool", ["debounce", "getDOMImageSize"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
function i(j, k) {
"use strict";
this.$CachedDOMImageSizePool0 = {};
this.$CachedDOMImageSizePool1 = k;
this.$CachedDOMImageSizePool2 = 0;
this.$CachedDOMImageSizePool3 = j;
this.$CachedDOMImageSizePool4 = g(this.$CachedDOMImageSizePool5, 5000, this);
this.$CachedDOMImageSizePool6 = {};
this.$CachedDOMImageSizePool7 = {};
}
i.prototype.get = function(j, k, l) {
"use strict";
if (!j) {
k.call(l, 0, 0, j);
return;
}
var m = this.$CachedDOMImageSizePool0[j];
if (m) {
m.lastAccessTime = Date.now();
k.call(l, m.width, m.height, m.src);
} else if (this.$CachedDOMImageSizePool6[j]) {
this.$CachedDOMImageSizePool6[j].push(k);
this.$CachedDOMImageSizePool7[j].push(l);
} else {
this.$CachedDOMImageSizePool6[j] = [k];
this.$CachedDOMImageSizePool7[j] = [l];
h(j, this.$CachedDOMImageSizePool8, this);
}
};
i.prototype.set = function(j, k, l) {
"use strict";
if (this.$CachedDOMImageSizePool2 > this.$CachedDOMImageSizePool3) this.$CachedDOMImageSizePool4();
var m = this.$CachedDOMImageSizePool0;
if (j && !m[j]) {
var n = {
width: k,
height: l,
src: j,
lastAccessTime: Date.now()
};
m[j] = n;
this.$CachedDOMImageSizePool2++;
}
};
i.prototype.$CachedDOMImageSizePool8 = function(j, k, l) {
"use strict";
this.set(l, j, k);
var m = this.$CachedDOMImageSizePool6[l],
n = this.$CachedDOMImageSizePool7[l];
for (var o = 0, p = m.length; o < p; o++) m[o].call(n[o], j, k, l);
delete this.$CachedDOMImageSizePool6[l];
delete this.$CachedDOMImageSizePool7[l];
};
i.prototype.$CachedDOMImageSizePool5 = function() {
"use strict";
var j = Date.now(),
k = this.$CachedDOMImageSizePool0,
l = this.$CachedDOMImageSizePool2,
m = this.$CachedDOMImageSizePool1;
for (var n in k) {
var o = k[n];
if ((j - o.lastAccessTime) > m) {
delete k[n];
l--;
}
}
this.$CachedDOMImageSizePool2 = l;
};
e.exports = i;
}, null);
__d("BackgroundImage.react", ["CachedDOMImageSizePool", "React", "XUISpinner.react", "cx", "invariant", "joinClasses"], function(a, b, c, d, e, f, g, h, i, j, k, l) {
b.__markCompiled && b.__markCompiled();
var m = h,
n = m.PropTypes,
o = '(-?(\\d+\\.)?\\d+(px|\\%))',
p = new RegExp('^' + o + '?(\\s' + o + ')?$', 'g'),
q = new g(50, 10 * 60 * 1000),
r = h.createClass({
displayName: "BackgroundImage",
propTypes: {
src: n.string,
width: n.number.isRequired,
height: n.number.isRequired,
backgroundSize: n.oneOf(['contain', 'cover', 'containinside', 'coverinside']),
loadingIndicatorStyle: n.oneOf(['none', 'large', 'small']),
backgroundPosition: function(s, t, u) {
var v = s[t];
if (v) {
k(typeof v === 'string');
k(v.match(p));
}
},
onImageLoad: n.func,
optimizeResizeSpeed: n.bool,
onContextMenu: n.func
},
getInitialState: function() {
return {
imageWidth: null,
imageHeight: null,
imageSrc: this.props.src,
loading: true
};
},
getDefaultProps: function() {
return {
optimizeResizeSpeed: false,
loadingIndicatorStyle: 'none'
};
},
componentDidMount: function() {
this._resolveImageSize();
},
componentDidUpdate: function(s) {
if (this.props.src !== this.state.imageSrc) this.setState({
imageWidth: 0,
imageHeight: 0,
imageSrc: this.props.src,
loading: true
}, this._resolveImageSize);
},
_resolveImageSize: function() {
var s = this.state.imageSrc;
if (s) q.get(s, this._onImageSizeResolved, this);
},
render: function() {
var s = {
width: this.props.width + 'px',
height: this.props.height + 'px'
},
t = l(this.props.className, "_5f0d");
return (h.createElement("div", h.__spread({}, this.props, {
className: l(this.props.className, t),
style: Object.assign({}, (this.props.style || {}), s),
onContextMenu: this.props.onContextMenu
}), this._renderImage(), this._renderContent(), this._renderLoadingIndicator()));
},
_renderLoadingIndicator: function() {
if (!this.state.loading || this.props.loadingIndicatorStyle === 'none') return null;
return (h.createElement("div", {
className: "_1qe- _5lar"
}, h.createElement("div", {
className: "_1qe_"
}, h.createElement("div", {
className: "_1qf0"
}, h.createElement(i, {
size: this.props.loadingIndicatorStyle
})))));
},
_renderContent: function() {
if (this.props.children) return (h.createElement("div", {
className: "_1qe-"
}, h.createElement("div", {
className: "_1qe_"
}, h.createElement("div", {
className: "_1qf0"
}, this.props.children))));
},
_renderImage: function() {
if (!this.state.imageWidth || !this.state.imageHeight) return;
var s = this.props.width,
t = this.props.height,
u, v;
switch (this.props.backgroundSize) {
case 'cover':
u = 'cover';
v = false;
break;
case 'coverinside':
u = 'cover';
v = true;
break;
case 'contain':
u = 'contain';
v = false;
break;
case 'containinside':
u = 'contain';
v = true;
}
var w = this.state.imageWidth,
x = this.state.imageHeight,
y = s / t,
z = w / x;
if (u === 'contain')
if ((w > s || !v) && z >= y) {
w = s;
x = w / z;
} else if (x > t || !v) {
x = t;
w = x * z;
}
if (u === 'cover')
if ((w > s || !v) && z >= y) {
x = t;
w = x * z;
} else if (x > t || !v) {
w = s;
x = w / z;
}
var aa = this._getImageStyle(w, x);
return (h.createElement("img", {
alt: "",
className: (("_5i4g") + (this.props.optimizeResizeSpeed ? ' ' + "_5sjv" : '')),
style: aa,
src: this.state.imageSrc
}));
},
_getImageStyle: function(s, t) {
var u;
if (this.props.backgroundPosition) {
u = this.props.backgroundPosition.split(' ');
} else u = ['50%', '50%'];
return {
width: Math.round(s) + 'px',
height: Math.round(t) + 'px',
left: this._getBackgroundPositionPxValue('left', u[0], s, t),
top: this._getBackgroundPositionPxValue('top', u[1] || u[0], s, t)
};
},
_getBackgroundPositionPxValue: function(s, t, u, v) {
var w = parseFloat(t),
x = t.substr(w.toString().length);
if (x === 'px') return t;
if (s === 'left') {
return Math.round((this.props.width - u) * (w / 100)) + 'px';
} else return Math.round((this.props.height - v) * (w / 100)) + 'px';
},
_onImageSizeResolved: function(s, t, u) {
if (!this.isMounted() || this.state.imageSrc !== u) return;
var v = this.props.onImageLoad ? this.props.onImageLoad.bind(null, s, t) : null;
this.setState({
imageWidth: s,
imageHeight: t,
loading: false
}, v);
}
});
e.exports = r;
}, null);
__d("TooltipMixin", ["React", "TooltipData", "DOM"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
var j = g,
k = j.PropTypes;
function l(n) {
var o = n.tooltip;
return o != null && typeof o !== 'string';
}
var m = {
propTypes: {
tooltip: k.oneOfType([k.element, k.string]),
position: k.oneOf(['above', 'below', 'left', 'right']),
alignH: k.oneOf(['left', 'center', 'right'])
},
getInitialState: function() {
return {
tooltipContainer: l(this.props) ? i.create('div') : null
};
},
componentWillReceiveProps: function(n) {
var o = l(n),
p = this.state.tooltipContainer;
if (p && !o) {
this.setState({
tooltipContainer: null
});
} else if (!p && o) this.setState({
tooltipContainer: i.create('div')
});
},
componentDidMount: function() {
this._updateTooltip();
},
componentDidUpdate: function(n, o) {
if (o.tooltipContainer && !this.state.tooltipContainer) this._cleanupContainer(o.tooltipContainer);
this._updateTooltip();
},
_updateTooltip: function() {
var n;
if (l(this.props)) {
n = this.state.tooltipContainer;
g.render(this.props.tooltip, n);
} else n = this.props.tooltip;
if (n != null) {
h.set(g.findDOMNode(this), n, this.props.position, this.props.alignH);
} else h.remove(g.findDOMNode(this));
},
componentWillUnmount: function() {
if (this.state.tooltipContainer) this._cleanupContainer(this.state.tooltipContainer);
h.remove(g.findDOMNode(this));
},
_cleanupContainer: function(n) {
g.unmountComponentAtNode(n);
}
};
e.exports = m;
}, null);
__d("TooltipLink.react", ["React", "TooltipMixin"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
var i = g.createClass({
displayName: "TooltipLink",
mixins: [h],
render: function() {
return g.createElement("a", g.__spread({}, this.props), this.props.children);
}
});
e.exports = i;
}, null);
__d("XUIBlock", ["React", "cx"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
var i = g,
j = i.PropTypes,
k = {
propTypes: {
background: j.oneOf(['base-wash', 'light-wash', 'white', 'highlight', 'transparent'])
},
getDefaultProps: function() {
return {
background: 'transparent'
};
},
getBackgroundClass: function(l) {
var m = ((l.background === 'base-wash' ? "_4-u5" : '') + (l.background === 'light-wash' ? ' ' + "_57d8" : '') + (l.background === 'white' ? ' ' + "_4-u8" : '') + (l.background === 'highlight' ? ' ' + "_4-u7" : ''));
return m;
}
};
e.exports = k;
}, null);
__d("XUICard.react", ["React", "XUIBlock", "cx", "joinClasses"], function(a, b, c, d, e, f, g, h, i, j) {
b.__markCompiled && b.__markCompiled();
var k = g.createClass({
displayName: "XUICard",
propTypes: h.propTypes,
getDefaultProps: function() {
return Object.assign({}, h.getDefaultProps(), {
background: 'white'
});
},
render: function() {
var l = j("_4-u2", h.getBackgroundClass(this.props));
return (g.createElement("div", g.__spread({}, this.props, {
className: j(this.props.className, l)
}), this.props.children));
}
});
e.exports = k;
}, null);
__d("XUICardSection.react", ["React", "XUIBlock", "cx", "joinClasses"], function(a, b, c, d, e, f, g, h, i, j) {
b.__markCompiled && b.__markCompiled();
'use strict';
var k = g.createClass({
displayName: "XUICardSection",
propTypes: h.propTypes,
getDefaultProps: h.getDefaultProps,
render: function() {
var l = j("_4-u3", h.getBackgroundClass(this.props));
return (g.createElement("div", g.__spread({}, this.props, {
className: j(this.props.className, l)
}), this.props.children));
}
});
e.exports = k;
}, null);
__d("ComposerXStore", ["Arbiter", "ge"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
var 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.bind(null, l)));
}
};
g.subscribe('page_transition', function() {
for (var l in i)
if (!h(l)) delete i[l];
});
e.exports = k;
}, null);
__d("fileSliceName", ["UserAgent_DEPRECATED"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
var h = 'slice',
i;
if (i = g.chrome()) {
if (i < 21) h = 'webkitSlice';
} else if (i = g.firefox()) {
if (i < 13) h = 'mozSlice';
} else if (!(i = g.safari()))
if (g.webkit()) h = 'webkitSlice';
e.exports = h;
}, null);
__d("fileSlice", ["fileSliceName"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
var h = a.File && a.File.prototype[g];
e.exports = h;
}, null);
__d("VideoUploadFeatureDetector", ["UserAgent_DEPRECATED", "fileSlice"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
var i = {
supportsChunking: function() {
return (typeof h === 'function') && this.supportsXHR();
},
supportsFullProgress: function() {
return !g.firefox();
},
supportsFileAPI: function() {
return ('FileList' in window);
},
supportsFileReading: function() {
return ('FileReader' in window && 'DataView' in window);
},
supportsXHR: function() {
return ('FormData' in window);
}
};
e.exports = i;
}, null);
__d("ComposerXDragDropUtils", ["Arbiter", "CSS", "DOMQuery", "Parent", "VideoUploadFeatureDetector", "csx", "cx"], function(a, b, c, d, e, f, g, h, i, j, k, l, m) {
b.__markCompiled && b.__markCompiled();
var n = {
handleDragEnterAndLeave: function(o) {
var p = i.scry(j.byClass(o, "_119"), "._2wr");
g.subscribe('dragenter', function(q, r) {
if (o == r.element) p.forEach(h.hide);
});
g.subscribe('dragleave', function(q, r) {
if (o == r.element) p.forEach(h.show);
});
},
filterImages: function(o) {
var p = k.supportsFileAPI(),
q = [];
for (var r = 0; r < o.length; r++)
if (o[r].type.match('image/*')) {
q.push(o[r]);
} else if (p && o[r].type.match('video/*')) q.push(o[r]);
return q;
}
};
e.exports = n;
}, null);
__d("uuid", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
function g() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(h) {
var i = Math.random() * 16 | 0,
j = h == 'x' ? i : (i & 3 | 8);
return j.toString(16);
});
}
e.exports = g;
}, null);
__d("ComposerXSessionIDs", ["DOM", "cx", "uuid"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
var j = {},
k = {
getSessionID: function(l) {
return j[l];
},
resetSessionID: function(l) {
j[l] = i();
},
createSessionIDInput: function(l) {
return g.create('input', {
type: 'hidden',
name: 'composer_session_id',
className: "_5r_b",
value: l
});
}
};
e.exports = k;
}, null);
__d("CacheStorage", ["ErrorUtils", "EventListener", "ExecutionEnvironment", "FBJSON", "WebStorage"], function(a, b, c, d, e, f, g, h, i, j, k) {
b.__markCompiled && b.__markCompiled();
var l = {
memory: u,
localstorage: s,
sessionstorage: t
},
m = '_@_',
n = '3b',
o = 'CacheStorageVersion';
function p(w) {
"use strict";
this._store = w;
}
p.prototype.getStore = function() {
"use strict";
return this._store;
};
p.prototype.keys = function() {
"use strict";
var w = [];
for (var x = 0; x < this._store.length; x++) w.push(this._store.key(x));
return w;
};
p.prototype.get = function(w) {
"use strict";
return this._store.getItem(w);
};
p.prototype.set = function(w, x) {
"use strict";
this._store.setItem(w, x);
};
p.prototype.remove = function(w) {
"use strict";
this._store.removeItem(w);
};
p.prototype.clear = function() {
"use strict";
this._store.clear();
};
for (var q in p)
if (p.hasOwnProperty(q)) s[q] = p[q];
var r = p === null ? null : p.prototype;
s.prototype = Object.create(r);
s.prototype.constructor = s;
s.__superConstructor__ = p;
function s() {
"use strict";
p.call(this, k.getLocalStorage());
}
s.available = function() {
"use strict";
return !!k.getLocalStorage();
};
for (q in p)
if (p.hasOwnProperty(q)) t[q] = p[q];
t.prototype = Object.create(r);
t.prototype.constructor = t;
t.__superConstructor__ = p;
function t() {
"use strict";
p.call(this, k.getSessionStorage());
}
t.available = function() {
"use strict";
return !!k.getSessionStorage();
};
function u() {
"use strict";
this._store = {};
}
u.prototype.getStore = function() {
"use strict";
return this._store;
};
u.prototype.keys = function() {
"use strict";
return Object.keys(this._store);
};
u.prototype.get = function(w) {
"use strict";
if (this._store[w] === (void 0)) return null;
return this._store[w];
};
u.prototype.set = function(w, x) {
"use strict";
this._store[w] = x;
};
u.prototype.remove = function(w) {
"use strict";
if (w in this._store) delete this._store[w];
};
u.prototype.clear = function() {
"use strict";
this._store = {};
};
u.available = function() {
"use strict";
return true;
};
function v(w, x) {
"use strict";
this._key_prefix = x || '_cs_';
if (w == 'AUTO' || !w)
for (var y in l) {
var z = l[y];
if (z.available()) {
w = y;
break;
}
}
if (w)
if (!l[w] || !l[w].available()) {
i.canUseDOM;
this._backend = new u();
} else this._backend = new l[w]();
var aa = this.useBrowserStorage();
if (aa) h.listen(window, 'storage', this._onBrowserValueChanged.bind(this));
var ba = aa ? this._backend.getStore().getItem(o) : this._backend.getStore()[o];
if (ba !== n) this.clear();
}
v.prototype.useBrowserStorage = function() {
"use strict";
return this._backend.getStore() === k.getLocalStorage() || this._backend.getStore() === k.getSessionStorage();
};
v.prototype.addValueChangeCallback = function(w) {
"use strict";
this._changeCallbacks = this._changeCallbacks || [];
this._changeCallbacks.push(w);
return {
remove: function() {
this._changeCallbacks.slice(this._changeCallbacks.indexOf(w), 1);
}.bind(this)
};
};
v.prototype._onBrowserValueChanged = function(w) {
"use strict";
if (this._changeCallbacks && String(w.key).startsWith(this._key_prefix)) this._changeCallbacks.forEach(function(x) {
x(w.key, w.oldValue, w.newValue);
});
};
v.prototype.keys = function() {
"use strict";
var w = [];
g.guard(function() {
if (this._backend) {
var x = this._backend.keys(),
y = this._key_prefix.length;
for (var z = 0; z < x.length; z++)
if (x[z].substr(0, y) == this._key_prefix) w.push(x[z].substr(y));
}
}.bind(this), 'CacheStorage')();
return w;
};
v.prototype.set = function(w, x, y) {
"use strict";
if (this._backend) {
var z;
if (typeof x == 'string') {
z = m + x;
} else if (!y) {
z = {
__t: Date.now(),
__v: x
};
z = j.stringify(z);
} else z = j.stringify(x);
var aa = this._backend,
ba = this._key_prefix + w,
ca = true;
while (ca) try {
aa.set(ba, z);
ca = false;
} catch (da) {
var ea = aa.keys().length;
this._evictCacheEntries();
ca = aa.keys().length < ea;
}
}
};
v.prototype._evictCacheEntries = function() {
"use strict";
var w = [],
x = this._backend;
x.keys().forEach(function(z) {
if (z === o) return;
var aa = x.get(z);
if (aa === (void 0)) {
x.remove(z);
return;
}
if (v._hasMagicPrefix(aa)) return;
try {
aa = j.parse(aa, e.id);
} catch (ba) {
x.remove(z);
return;
}
if (aa && aa.__t !== (void 0) && aa.__v !== (void 0)) w.push([z, aa.__t]);
});
w.sort(function(z, aa) {
return z[1] - aa[1];
});
for (var y = 0; y < Math.ceil(w.length / 2); y++) x.remove(w[y][0]);
};
v.prototype.get = function(w, x) {
"use strict";
var y;
if (this._backend) {
g.applyWithGuard(function() {
y = this._backend.get(this._key_prefix + w);
}, this, null, function() {
y = null;
}, 'CacheStorage:get');
if (y !== null) {
if (v._hasMagicPrefix(y)) {
y = y.substr(m.length);
} else try {
y = j.parse(y, e.id);
if (y && y.__t !== (void 0) && y.__v !== (void 0)) y = y.__v;
} catch (z) {
y = (void 0);
}
} else y = (void 0);
}
if (y === (void 0) && x !== (void 0)) {
y = x;
this.set(w, y);
}
return y;
};
v.prototype.remove = function(w) {
"use strict";
if (this._backend) g.applyWithGuard(this._backend.remove, this._backend, [this._key_prefix + w], null, 'CacheStorage:remove');
};
v.prototype.clear = function() {
"use strict";
if (this._backend) {
g.applyWithGuard(this._backend.clear, this._backend, null, null, null, 'CacheStorage:clear');
if (this.useBrowserStorage()) {
this._backend.getStore().setItem(o, n);
} else this._backend.getStore()[o] = n;
}
};
v.getAllStorageTypes = function() {
"use strict";
return Object.keys(l);
};
v._hasMagicPrefix = function(w) {
"use strict";
return w.substr(0, m.length) === m;
};
e.exports = v;
}, null);
__d("MarauderLogger", ["Banzai", "CacheStorage", "MarauderConfig"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
var j = 'client_event',
k = 'navigation',
l = 180000,
m = 'marauder',
n = 'marauder_last_event_time',
o = 'marauder_last_session_id',
p = {},
q = [],
r = false,
s = null,
t = null,
u = null,
v = 0,
w, x, y = false,
z = new h('localstorage', '');
function aa() {
z.set(n, ba());
}
g.subscribe(g.SHUTDOWN, aa);
function ba() {
w = w || z.get(n) || 0;
return w;
}
function ca() {
if (!y) {
x = z.get(o);
y = true;
}
var ra = Date.now();
if (!x || ra - l > ba()) {
x = ra.toString(16) + '-' + (~~(Math.random() * 16777215)).toString(16);
z.set(o, x);
}
return x;
}
function da() {
return {
user_agent: window.navigator.userAgent,
screen_height: window.screen.availHeight,
screen_width: window.screen.availWidth,
density: (window.screen.devicePixelRatio || null),
platform: (window.navigator.platform || null),
locale: (window.navigator.language || null)
};
}
function ea() {
return {
locale: navigator.language
};
}
function fa(ra, sa, ta, ua, va, wa, xa) {
var ya = xa || Date.now();
w = xa ? Date.now() : ya;
sa = sa || s;
return {
name: ra,
time: ya / 1000,
module: sa,
obj_type: ua,
obj_id: va,
uuid: wa,
extra: ta
};
}
function ga(ra, sa, ta) {
return fa('content', null, {
flags: sa
}, null, null, ra, ta);
}
function ha(ra) {
var sa = window.__mrdr;
if (sa)
for (var ta in sa) {
var ua = sa[ta];
if (ua[3] !== 0) {
delete sa[ta];
if (ta === "1")
if (u !== null) {
ta = u;
} else continue;
ra.push(ga(ta, 1, ua[1]));
ra.push(ga(ta, 2, ua[2]));
ra.push(ga(ta, 3, ua[3]));
}
}
}
function ia(ra) {
ha(ra);
if (ra.length === 0) return;
if (r) ra.push(fa('counters', null, p));
var sa = g.BASIC,
ta = i.gk_enabled;
if (v === 0 && ta) {
ra.push(fa('device_status', null, ea()));
sa = {
delay: 5000
};
}
if (ta && Math.random() < .01) ra.push(fa('device_info', null, da()));
if (u !== null)
for (var ua = 0; ua < ra.length; ua++) {
var va = ra[ua];
if (va.uuid === null || va.uuid === (void 0)) va.uuid = u;
}
var wa = {
app_ver: i.app_version,
data: ra,
log_type: j,
seq: v++,
session_id: ca()
},
xa = z.get('device_id');
if (xa) wa.device_id = xa;
p = {};
r = false;
g.post(m, wa, sa);
}
function ja(ra) {
if (!p[ra]) p[ra] = 0;
p[ra]++;
r = true;
}
function ka(ra, sa, ta, ua, va, wa, xa) {
ia([fa(ra, sa, ta, ua, va, wa, xa)]);
}
function la(ra, sa) {
if (s !== sa) {
q.push(fa(k, s, {
dest_module: sa,
source_url: t,
destination_url: ra
}));
s = sa;
t = ra;
}
}
function ma(ra, sa) {
if (s !== sa) {
u = null;
la(ra, sa);
}
}
function na(ra, sa, ta) {
ka(sa ? 'show_module' : 'hide_module', ra, ta);
}
function oa(ra) {
s = ra;
}
function pa() {
return s;
}
function qa(ra) {
if (u === null) {
u = ra;
if (ra !== null) {
ia(q);
q = [];
}
}
}
e.exports = {
count: ja,
log: ka,
navigateTo: ma,
navigateWithinSession: la,
toggleModule: na,
setUUID: qa,
setNavigationModule: oa,
getNavigationModule: pa
};
}, null);
__d("ShareModeConst", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
var g = {
SELF_PAGE: 'selfpage',
PAGE: 'page',
SELF_POST: 'self',
FRIEND: 'friend',
GROUP: 'group',
ALBUM: 'album',
MESSAGE: 'message',
ONE_CLICK: 'oneclick',
EVENT: 'event',
UNKNOWN: 'unknown'
};
e.exports = g;
}, null);
__d("ComposerXMarauderLogger", ["Event", "ComposerTargetType", "ComposerType", "ComposerWaterfallEvent", "ComposerXSessionIDs", "MarauderLogger", "ShareModeConst"], function(a, b, c, d, e, f, g, h, i, j, k, l, m) {
b.__markCompiled && b.__markCompiled();
var n = {},
o = i.NORMAL,
p = {
logEvent: function(q, r, s) {
if (!s) s = {};
var t = n[r],
u = k.getSessionID(r);
if (!t || !u) return;
if (s.logOncePerSession) {
if (!t.loggedEventTypes[u]) t.loggedEventTypes[u] = {};
if (t.loggedEventTypes[u][q]) return;
t.loggedEventTypes[u][q] = true;
}
var v = Object.assign({}, s.extraData, {
composer_type: o,
composer_version: t.composerVersion,
target_type: t.targetType,
target_id: t.targetID,
ref: t.entryPointRef
});
if (s.logDetails) {
v.has_photo = t.hasPhoto;
v.has_video = t.hasVideo;
v.xy_tag_count = t.numXYTags;
v.with_tag_count = t.numWithTags;
v.tags_user = t.numUserTags;
}
l.log(q, 'composer', v, (void 0), (void 0), u);
},
registerComposer: function(q, r, s, t, u) {
n[q.id] = {
targetID: u,
targetType: r,
entryPointRef: s,
composerVersion: t,
loggedEventTypes: {},
hasPhoto: false,
hasVideo: false,
numWithTags: 0,
numXYTags: 0,
numUserTags: 0
};
},
getInstance: function(q) {
return n[q];
},
updateHasPhoto: function(q, r) {
if (!n[q]) return;
n[q].hasPhoto = r;
},
updateHasVideo: function(q, r) {
if (!n[q]) return;
n[q].hasVideo = r;
},
updateNumWithTags: function(q, r) {
if (!n[q]) return;
n[q].numWithTags = r;
},
updateNumXYTags: function(q, r) {
if (!n[q]) return;
n[q].numXYTags = r;
n[q].numWithTags = n[q].numWithTags - r;
},
updateNumUserTags: function(q, r) {
if (!n[q]) return;
n[q].numUserTags = r;
},
listenForPostEvents: function(q, r) {
if (!r) return [];
return [g.listen(r, 'submit', function() {
p.logPost(q);
}), g.listen(r, 'success', function() {
p.logPostSuccess(q);
}), g.listen(r, 'error', function(event) {
p.logPostFailure(q, {
error_info: {
error_code: event.data.response.error,
error_description: event.data.response.errorDescription,
error_summary: event.data.response.errorSummary
}
});
})];
},
setShareMode: function(q, r) {
var s = n[q];
if (!s) return;
switch (r) {
case m.SELF_POST:
s.targetType = h.SELF_USER;
break;
case m.FRIEND:
s.targetType = h.OTHER_USER;
break;
case m.PAGE:
case m.SELF_PAGE:
s.targetType = h.PAGE;
break;
case m.GROUP:
s.targetType = h.GROUP;
break;
default:
s.targetType = h.OTHER;
}
},
logEntry: function(q, r) {
if (typeof r === 'string') return;
p.logEvent(j.COMPOSER_ENTRY, q, {
logOncePerSession: true,
extraData: r
});
},
logCompleted: function(q, r) {
p.logEvent(j.COMPOSER_POST_COMPLETED, q, {
extraData: r
});
},
logPost: function(q, r) {
p.logEvent(j.COMPOSER_POST, q, {
extraData: r
});
},
logPostSuccess: function(q, r) {
p.logEvent(j.COMPOSER_POST_SUCCESS, q, {
extraData: r
});
},
logPostFailure: function(q, r) {
p.logEvent(j.COMPOSER_POST_FAILURE, q, {
extraData: r
});
}
};
e.exports = p;
}, null);
__d("destroyOnUnload", ["Run"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
function h(i) {
g.onLeave(i);
}
e.exports = h;
}, null);
__d("transferTextStyles", ["Style"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
var h = {
fontFamily: null,
fontSize: null,
fontStyle: null,
fontWeight: null,
lineHeight: null,
wordWrap: null
};
function i(j, k) {
for (var l in h)
if (h.hasOwnProperty(l)) h[l] = g.get(j, l);
g.apply(k, h);
}
e.exports = i;
}, null);
__d("TextMetrics", ["DOM", "Style", "UserAgent", "transferTextStyles"], function(a, b, c, d, e, f, g, h, i, j) {
b.__markCompiled && b.__markCompiled();
function k(m) {
var n = m.clientWidth,
o = (h.get(m, '-moz-box-sizing') == 'border-box');
if (o && i.isBrowser('Firefox < 29')) return n;
var p = h.getFloat(m, 'paddingLeft') + h.getFloat(m, 'paddingRight');
return n - p;
}
function l(m, n) {
"use strict";
this.$TextMetrics0 = m;
this.$TextMetrics1 = !!n;
var o = 'textarea',
p = 'textMetrics';
if (this.$TextMetrics1) {
o = 'div';
p += ' textMetricsInline';
}
this.$TextMetrics2 = g.create(o, {
className: p
});
j(m, this.$TextMetrics2);
document.body.appendChild(this.$TextMetrics2);
}
l.prototype.measure = function(m) {
"use strict";
var n = this.$TextMetrics0,
o = this.$TextMetrics2;
m = (m || n.value) + '...';
if (!this.$TextMetrics1) {
var p = k(n);
h.set(o, 'width', Math.max(p, 0) + 'px');
}
if (n.nodeName === 'TEXTAREA') {
o.value = m;
} else g.setContent(o, m);
return {
width: o.scrollWidth,
height: o.scrollHeight
};
};
l.prototype.destroy = function() {
"use strict";
g.remove(this.$TextMetrics2);
};
e.exports = l;
}, null);
__d("filterObject", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
'use strict';
var g = Object.prototype.hasOwnProperty;
function h(i, j, k) {
if (!i) return null;
var l = {};
for (var m in i)
if (g.call(i, m) && j.call(k, i[m], m, i)) l[m] = i[m];
return l;
}
e.exports = h;
}, null);
__d("AbstractTextFieldMixin.react", ["React", "Keys", "cx", "invariant", "joinClasses", "cloneWithProps"], function(a, b, c, d, e, f, g, h, i, j, k, l) {
b.__markCompiled && b.__markCompiled();
var m = g,
n = m.PropTypes,
o = {
propTypes: {
value: n.string,
placeholder: n.string,
tabIndex: n.string,
maxLength: n.number,
autoComplete: n.string,
onBackspace: n.func,
onBackTab: n.func,
onBlur: n.func,
onChange: n.func,
onDownArrow: n.func,
onEnter: n.func,
onEscape: n.func,
onFocus: n.func,
onKeyDown: n.func,
onLeftArrow: n.func,
onNoShiftEnter: n.func,
onRightArrow: n.func,
onShiftEnter: n.func,
onShiftDownArrow: n.func,
onShiftUpArrow: n.func,
onTab: n.func,
onUpArrow: n.func,
required: n.bool,
type: n.string,
autoCapitalize: n.string,
autoCorrect: n.string
},
getInitialState: function() {
return {
focused: false,
value: this.props.defaultValue || ''
};
},
getValue: function() {
return this.props.value != null ? this.props.value : this.state.value;
},
onInputKeyDown: function(p) {
var q = this.props,
r = p.keyCode,
s = p.shiftKey;
if (r === h.BACKSPACE && !s && q.onBackspace) {
q.onBackspace(p);
} else if (r === h.TAB && !s && q.onTab) {
q.onTab(p);
} else if (r === h.TAB && s && q.onBackTab) {
q.onBackTab(p);
} else if (r === h.UP) {
if (s) {
if (q.onShiftUpArrow) q.onShiftUpArrowAttempt(p);
} else if (q.onUpArrow) q.onUpArrow(p);
} else if (r === h.DOWN && q.onDownArrow) {
if (s) {
if (q.onShiftDownArrow) q.onShiftDownArrow(p);
} else if (q.onDownArrow) q.onDownArrow(p);
} else if (r === h.LEFT && q.onLeftArrow) {
q.onLeftArrow(p);
} else if (r === h.RIGHT && q.onRightArrow) {
q.onRightArrow(p);
} else if (r === h.RETURN) {
if (q.onEnter) q.onEnter(p);
if (s) {
if (q.onShiftEnter) q.onShiftEnter(p);
} else if (q.onNoShiftEnter) q.onNoShiftEnter(p);
} else if (r === h.ESC && q.onEscape) q.onEscape(p);
if (q.onKeyDown) q.onKeyDown(p);
},
onInputChange: function(p) {
if (this.props.onChange) this.props.onChange(p);
if (this.props.value == null) this.setState({
value: p.target.value
});
},
focusInput: function() {
this.getTextFieldDOM().focus();
},
blurInput: function() {
this.getTextFieldDOM().blur();
},
onInputBlur: function(event) {
if (this.props.onBlur) this.props.onBlur(event);
if (!event.isDefaultPrevented()) this.setState({
focused: false
});
},
onInputFocus: function(event) {
if (this.props.onFocus) this.props.onFocus(event);
if (!event.isDefaultPrevented()) this.setState({
focused: true
});
},
getTextFieldDOM: function() {
return g.findDOMNode(this.refs[this.getTextFieldRef()]);
},
getTextFieldRef: function() {
return 'textField';
},
setTextFieldPropsOn: function(p) {
return l(p, {
'aria-activedescendant': this.props['aria-activedescendant'],
'aria-autocomplete': this.props['aria-autocomplete'],
'aria-label': this.props['aria-label'],
'aria-expanded': this.props['aria-expanded'],
'aria-owns': this.props['aria-owns'],
'data-testid': this.props['data-testid'],
required: this.props.required,
ref: this.getTextFieldRef(),
role: this.props.role,
placeholder: this.props.placeholder,
autoCapitalize: this.props.autoCapitalize,
autoComplete: this.props.autoComplete,
autoCorrect: this.props.autoCorrect,
onKeyDown: this.onInputKeyDown,
onBlur: this.onInputBlur,
onFocus: this.onInputFocus,
onChange: this.onInputChange,
disabled: this.props.disabled,
defaultValue: this.props.defaultValue,
name: this.props.name,
value: this.getValue(),
id: this.props.id,
maxLength: this.props.maxLength,
min: this.props.min,
max: this.props.max,
title: this.props.title,
type: this.props.type || p.props.type
});
},
render: function() {
var p = k(this.props.className, (("_58ak") + (!this.getValue() ? ' ' + "_3ct8" : '')));
j(this.renderTextField);
return (g.createElement("label", {
className: p
}, this.renderTextField()));
}
};
e.exports = o;
}, null);
__d("AbstractTextInput.react", ["AbstractTextFieldMixin.react", "React", "cx"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
var j = h.createClass({
displayName: "AbstractTextInput",
mixins: [g],
renderTextField: function() {
return this.setTextFieldPropsOn(h.createElement("input", {
type: "text",
className: "_58al",
size: this.props.size,
tabIndex: this.props.tabIndex,
onClick: this.props.onClick,
onKeyUp: this.props.onKeyUp,
onPaste: this.props.onPaste
}));
}
});
e.exports = j;
}, null);
__d("Layout.react", ["React", "cx", "joinClasses"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
var j = g.createClass({
displayName: "Layout",
render: function() {
var k = [],
l = [],
m = null;
g.Children.forEach(this.props.children, function(o, p) {
if (!o) return;
var q = m !== null,
r = g.cloneElement(o, {
className: i(o.props.className, ((q ? "_4bl8" : ''))),
key: p
});
if (m === null) {
if (o.type === j.FillColumn) {
m = r;
} else k.push(r);
} else l.push(r);
});
l.reverse();
var n = k.concat(l);
if (m) n.push(m);
return (g.createElement("div", g.__spread({}, this.props, {
className: i(this.props.className, 'clearfix')
}), n));
}
});
j.Column = g.createClass({
displayName: "Layout.Column",
render: function() {
return (g.createElement("div", g.__spread({}, this.props, {
className: i(this.props.className, "_4bl7")
})));
}
});
j.FillColumn = g.createClass({
displayName: "Layout.FillColumn",
render: function() {
return (g.createElement("div", g.__spread({}, this.props, {
className: i(this.props.className, "_4bl9")
})));
}
});
e.exports = j;
}, null);
__d("PhotosMimeType", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
function g(h) {
"use strict";
if (this instanceof g === false) return new g(h);
this.$PhotosMimeType0 = h.split('/');
}
g.prototype.isImage = function() {
"use strict";
return this.$PhotosMimeType0[0] === 'image';
};
g.prototype.isJpeg = function() {
"use strict";
return this.isImage() && (this.$PhotosMimeType0[1] === 'jpeg' || this.$PhotosMimeType0[1] === 'pjpeg');
};
e.exports = g;
}, null);
__d("DataTransfer", ["PhotosMimeType", "createArrayFromMixed", "emptyFunction"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
var j = new RegExp('\u000D\u000A', 'g'),
k = '\u000A',
l = {
'text/rtf': 1,
'text/html': 1
};
function m(o) {
if (o.kind == 'file') return o.getAsFile();
}
function n(o) {
"use strict";
this.data = o;
this.types = o.types ? h(o.types) : [];
}
n.prototype.isRichText = function() {
"use strict";
return this.types.some(function(o) {
return l[o];
});
};
n.prototype.getText = function() {
"use strict";
var o;
if (this.data.getData)
if (!this.types.length) {
o = this.data.getData('Text');
} else if (this.types.indexOf('text/plain') != -1) o = this.data.getData('text/plain');
return o ? o.replace(j, k) : null;
};
n.prototype.getHTML = function() {
"use strict";
if (this.data.getData)
if (!this.types.length) {
return this.data.getData('Text');
} else if (this.types.indexOf('text/html') != -1) return this.data.getData('text/html');
};
n.prototype.isLink = function() {
"use strict";
return this.types.some(function(o) {
return o.indexOf('url') != -1 || o.indexOf('text/uri-list') != -1;
});
};
n.prototype.isImage = function() {
"use strict";
var o = this.types.some(function(s) {
return s.indexOf('application/x-moz-file') != -1;
});
if (o) return true;
var p = this.getFiles();
for (var q = 0; q < p.length; q++) {
var r = p[q].type;
if (!g(r).isImage()) return false;
}
return true;
};
n.prototype.getCount = function() {
"use strict";
if (this.data.hasOwnProperty('items')) {
return this.data.items.length;
} else if (this.data.hasOwnProperty('mozItemCount')) {
return this.data.mozItemCount;
} else if (this.data.files) return this.data.files.length;
return null;
};
n.prototype.getFiles = function() {
"use strict";
if (this.data.items) {
return Array.prototype.slice.call(this.data.items).map(m).filter(i.thatReturnsArgument);
} else if (this.data.files) {
return Array.prototype.slice.call(this.data.files);
} else return [];
};
n.prototype.hasFiles = function() {
"use strict";
return this.getFiles().length > 0;
};
e.exports = n;
}, null);
__d("DateStrings", ["fbt"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
var h, i, j, k, l, m, n, o, p = {
getWeekdayName: function(q) {
if (!m) m = [g._("\u661f\u671f\u65e5"), g._("\u661f\u671f\u4e00"), g._("\u661f\u671f\u4e8c"), g._("\u661f\u671f\u4e09"), g._("\u661f\u671f\u56db"), g._("\u661f\u671f\u4e94"), g._("\u661f\u671f\u516d")];
return m[q];
},
getUppercaseWeekdayName: function(q) {
if (!o) o = [g._("\u661f\u671f\u65e5"), g._("\u661f\u671f\u4e00"), g._("\u661f\u671f\u4e8c"), g._("\u661f\u671f\u4e09"), g._("\u661f\u671f\u56db"), g._("\u661f\u671f\u4e94"), g._("\u661f\u671f\u516d")];
return o[q];
},
getWeekdayNameShort: function(q) {
if (!n) n = [g._("\u9031\u65e5"), g._("\u9031\u4e00"), g._("\u9031\u4e8c"), g._("\u9031\u4e09"), g._("\u9031\u56db"), g._("\u9031\u4e94"), g._("\u9031\u516d")];
return n[q];
},
getMonthName: function(q) {
if (!h) h = [g._("1 \u6708"), g._("2 \u6708"), g._("3 \u6708"), g._("4 \u6708"), g._("5 \u6708"), g._("6 \u6708"), g._("7 \u6708"), g._("8 \u6708"), g._("9 \u6708"), g._("10 \u6708"), g._("11 \u6708"), g._("12 \u6708")];
return h[q - 1];
},
getUppercaseMonthName: function(q) {
if (!k) k = [g._("1 \u6708"), g._("2 \u6708"), g._("3 \u6708"), g._("4 \u6708"), g._("5 \u6708"), g._("6 \u6708"), g._("7 \u6708"), g._("8 \u6708"), g._("9 \u6708"), g._("10 \u6708"), g._("11 \u6708"), g._("12 \u6708")];
return k[q - 1];
},
getMonthNameShort: function(q) {
if (!i) i = [g._("1 \u6708"), g._("2 \u6708"), g._("3 \u6708"), g._("4 \u6708"), g._("5 \u6708"), g._("6 \u6708"), g._("7 \u6708"), g._("8 \u6708"), g._("9 \u6708"), g._("10 \u6708"), g._("11 \u6708"), g._("12 \u6708")];
return i[q - 1];
},
getUppercaseMonthNameShort: function(q) {
if (!j) j = [g._("1 \u6708"), g._("2 \u6708"), g._("3 \u6708"), g._("4 \u6708"), g._("5 \u6708"), g._("6 \u6708"), g._("7 \u6708"), g._("8 \u6708"), g._("9 \u6708"), g._("10 \u6708"), g._("11 \u6708"), g._("12 \u6708")];
return j[q - 1];
},
getOrdinalSuffix: function(q) {
if (!l) l = ['', g._("\u65e5"), g._("\u65e5"), g._("\u65e5"), g._("\u65e5"), g._("\u65e5"), g._("\u65e5"), g._("\u65e5"), g._("\u65e5"), g._("\u65e5"), g._("\u65e5"), g._("\u65e5"), g._("\u65e5"), g._("\u65e5"), g._("\u65e5"), g._("\u65e5"), g._("\u65e5"), g._("\u65e5"), g._("\u65e5"), g._("\u65e5"), g._("\u65e5"), g._("\u65e5"), g._("\u65e5"), g._("\u65e5"), g._("\u65e5"), g._("\u65e5"), g._("\u65e5"), g._("\u65e5"), g._("\u65e5"), g._("\u65e5"), g._("\u65e5"), g._("\u65e5")];
return l[q];
},
getDayLabel: function() {
return g._("\u65e5\uff1a");
},
getMonthLabel: function() {
return g._("\u6708\uff1a");
},
getYearLabel: function() {
return g._("\u5e74\uff1a");
},
getDayPlaceholder: function() {
return g._("\u65e5");
},
getMonthPlaceholder: function() {
return g._("\u6708");
},
getYearPlaceholder: function() {
return g._("\u5e74");
}
};
e.exports = p;
}, null);
__d("DragDropFileUpload", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
f.isSupported = function() {
return typeof(FileList) !== "undefined";
};
}, null);
__d("DocumentDragDrop", ["Event", "Arbiter", "CSS", "DOM", "DOMQuery", "DragDropFileUpload", "emptyFunction", "getObjectValues"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n) {
b.__markCompiled && b.__markCompiled();
var o = {},
p = 0;
function q() {
p = 0;
n(o).forEach(function(v) {
i.removeClass(v.element, v.className);
h.inform('dragleave', {
element: v.element
});
});
}
var r = null;
function s() {
r && clearTimeout(r);
r = setTimeout(function() {
q();
}, 500);
}
function t() {
if (!l.isSupported()) return;
g.listen(document, 'dragenter', function(v) {
if (p === 0) n(o).forEach(function(w) {
i.addClass(w.element, w.className);
h.inform('dragenter', {
element: w.element,
event: v
});
});
p++;
s();
});
g.listen(document, 'dragleave', function(v) {
p--;
if (p === 0) q();
s();
});
g.listen(document, 'drop', function(v) {
q();
var w = v.getTarget();
if (k.isNodeOfType(v.getTarget(), 'input'))
if (w.type === 'file') return;
v.prevent();
});
g.listen(document, 'dragover', g.prevent);
document.addEventListener('dragover', s, true);
t = m;
}
var u = {
init: function() {
t();
},
registerStatusElement: function(v, w) {
t();
o[j.getID(v)] = {
element: v,
className: w
};
if (p > 0) i.addClass(v, w);
},
removeStatusElement: function(v) {
var w = j.getID(v),
x = o[w];
if (x) {
i.removeClass(x.element, x.className);
delete o[w];
}
}
};
e.exports = u;
}, null);
__d("DragDropTarget", ["Arbiter", "Event", "SubscriptionsHandler", "CSS", "DataTransfer", "DocumentDragDrop", "DragDropFileUpload", "emptyFunction"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n) {
b.__markCompiled && b.__markCompiled();
function o(p) {
this._element = p;
this._listeners = new i();
this._statusElem = p;
this._dragEnterCount = 0;
this._enabled = false;
}
Object.assign(o.prototype, {
_onFilesDropCallback: n,
_onURLDropCallback: n,
_onPlainTextDropCallback: n,
_onDropCallback: n,
_fileFilterFn: n.thatReturnsArgument,
setOnDocumentDragEnterCallback: function(p) {
this._onDocumentDragEnterCallback = p;
return this;
},
setOnDocumentDragLeaveCallback: function(p) {
this._onDocumentDragLeaveCallback = p;
return this;
},
setOnDragEnterCallback: function(p) {
this._onDragEnterCallback = p;
return this;
},
setOnDragLeaveCallback: function(p) {
this._onDragLeaveCallback = p;
return this;
},
setOnFilesDropCallback: function(p) {
this._onFilesDropCallback = p;
return this;
},
setOnURLDropCallback: function(p) {
this._onURLDropCallback = p;
return this;
},
setOnPlainTextDropCallback: function(p) {
this._onPlainTextDropCallback = p;
return this;
},
setOnDropCallback: function(p) {
this._onDropCallback = p;
return this;
},
enable: function() {
if (!m.isSupported()) return this;
this._listeners.engage();
l.registerStatusElement(this._statusElem, 'fbWantsDragDrop');
this._listeners.addSubscriptions(h.listen(this._element, 'dragenter', this._onDragEnter.bind(this)), h.listen(this._element, 'dragleave', this._onDragLeave.bind(this)), h.listen(this._element, 'dragover', this._onDragOver.bind(this)), h.listen(this._element, 'drop', function(p) {
this._dragEnterCount = 0;
j.removeClass(this._statusElem, 'fbDropReady');
j.removeClass(this._statusElem, 'fbDropReadyPhoto');
j.removeClass(this._statusElem, 'fbDropReadyPhotos');
j.removeClass(this._statusElem, 'fbDropReadyLink');
var q = {},
r = false,
s = this._fileFilterFn(p.dataTransfer.files);
if (s.length) {
this._onFilesDropCallback(s, p);
q.files = s;
r = true;
}
var t = p.dataTransfer.getData('url') || p.dataTransfer.getData('text/uri-list');
if (t) {
this._onURLDropCallback(t, p);
q.url = t;
r = true;
}
var u = p.dataTransfer.getData('text/plain');
if (u) {
this._onPlainTextDropCallback(u, p);
q.plainText = u;
r = true;
}
if (r) this._onDropCallback(q, p);
p.kill();
}.bind(this)));
this._listeners.addSubscriptions(g.subscribe('dragenter', this._onDocumentDragEnter.bind(this)), g.subscribe('dragleave', this._onDocumentDragLeave.bind(this)));
this._enabled = true;
return this;
},
disable: function() {
if (!this._enabled) return this;
l.removeStatusElement(this._statusElem, 'fbWantsDragDrop');
j.removeClass(this._statusElem, 'fbDropReady');
j.removeClass(this._statusElem, 'fbDropReadyPhoto');
j.removeClass(this._statusElem, 'fbDropReadyPhotos');
j.removeClass(this._statusElem, 'fbDropReadyLink');
this._listeners.release();
this._enabled = false;
return this;
},
setFileFilter: function(p) {
this._fileFilterFn = p;
return this;
},
setStatusElement: function(p) {
this._statusElem = p;
return this;
},
_onDragEnter: function(p) {
if (this._dragEnterCount === 0) {
var q = new k(p.dataTransfer);
j.addClass(this._statusElem, 'fbDropReady');
if (q.isLink() || !q.isImage()) {
j.addClass(this._statusElem, 'fbDropReadyLink');
} else if (q.getCount() > 1) {
j.addClass(this._statusElem, 'fbDropReadyPhotos');
} else j.addClass(this._statusElem, 'fbDropReadyPhoto');
this._onDragEnterCallback && this._onDragEnterCallback();
}
this._dragEnterCount++;
p.preventDefault();
},
_onDragLeave: function(p) {
this._dragEnterCount = Math.max(this._dragEnterCount - 1, 0);
if (this._dragEnterCount === 0) {
j.removeClass(this._statusElem, 'fbDropReady');
j.removeClass(this._statusElem, 'fbDropReadyPhoto');
j.removeClass(this._statusElem, 'fbDropReadyPhotos');
j.removeClass(this._statusElem, 'fbDropReadyLink');
this._onDragLeaveCallback && this._onDragLeaveCallback();
}
},
_onDragOver: function(p) {
if (!p.dataTransfer) {
h.kill(p);
return;
}
var q = p.dataTransfer.effectAllowed;
p.dataTransfer.dropEffect = (q == 'move' || q == 'linkMove') ? 'move' : 'copy';
h.kill(p);
},
_onDocumentDragEnter: function(event, p) {
if (this._onDocumentDragEnterCallback && p.element == this._element) this._onDocumentDragEnterCallback();
},
_onDocumentDragLeave: function(event, p) {
this._dragEnterCount = 0;
this._onDragLeave(event);
if (this._onDocumentDragLeaveCallback && p.element == this._element) this._onDocumentDragLeaveCallback();
}
});
e.exports = o;
}, null);
__d("ReactComposerIDGenerator", ["ReactComposerConstants", "uniqueID"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
'use strict';
var i = {
getID: function() {
return g.ID_PREFIX + h();
},
isComposerID: function(j) {
return !!j && j.startsWith(g.ID_PREFIX);
}
};
e.exports = i;
}, null);
__d("LitestandComposer", ["Arbiter", "Bootloader", "ReactComposerIDGenerator", "Run", "SubscriptionsHandler"], function(a, b, c, d, e, f, g, h, i, j, k) {
b.__markCompiled && b.__markCompiled();
var l = 600;
function m(o, p) {
h.loadModules(["Animation", "ComposerXController", "ComposerXMarauderLogger", "DOM", "LitestandStream"], function(q, r, s, t, u) {
if (!i.isComposerID(o)) r.reset(o);
if (!u || !p) return;
t.prependContent(u.getStreamRoot(), p);
new q(p).from('opacity', 0).to('opacity', 1).duration(l).go();
s.logCompleted(o);
});
}
var n = {
initComposer: function(o) {
var p = new k();
p.addSubscriptions(g.subscribe('LitestandComposer/publish', function(q, r) {
if (r.composer_id === o) m(o, r.markup);
}.bind(this)));
j.onLeave(function() {
p.release();
});
}
};
e.exports = n;
}, null);
__d("DOMWrapper", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
var g, h, i = {
setRoot: function(j) {
g = j;
},
getRoot: function() {
return g || document.body;
},
setWindow: function(j) {
h = j;
},
getWindow: function() {
return h || self;
}
};
e.exports = i;
}, null);
__d("Flash", ["DOMEventListener", "DOMWrapper", "QueryString", "UserAgent_DEPRECATED", "guid", "htmlSpecialChars"], function(a, b, c, d, e, f, g, h, i, j, k, l) {
b.__markCompiled && b.__markCompiled();
var m = {},
n, o = h.getWindow().document;
function p(u) {
var v = o.getElementById(u);
if (v) v.parentNode.removeChild(v);
delete m[u];
}
function q() {
for (var u in m)
if (m.hasOwnProperty(u)) p(u);
}
function r(u) {
return u.replace(/\d+/g, function(v) {
return '000'.substring(v.length) + v;
});
}
function s(u) {
if (!n) {
if (j.ie() >= 9) g.add(window, 'unload', q);
n = true;
}
m[u] = u;
}
var t = {
embed: function(u, v, w, x) {
var y = k();
u = l(u).replace(/&amp;/g, '&');
w = Object.assign({
allowscriptaccess: 'always',
flashvars: x,
movie: u
}, w);
if (typeof w.flashvars == 'object') w.flashvars = i.encode(w.flashvars);
var z = [];
for (var aa in w)
if (w.hasOwnProperty(aa) && w[aa]) z.push('<param name="' + l(aa) + '" value="' + l(w[aa]) + '">');
var ba = v.appendChild(o.createElement('span')),
ca = '<object ' + (j.ie() ? 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ' : 'type="application/x-shockwave-flash"') + 'data="' + u + '" ' + (w.height ? 'height="' + w.height + '" ' : '') + (w.width ? 'width="' + w.width + '" ' : '') + 'id="' + y + '">' + z.join('') + '</object>';
ba.innerHTML = ca;
var da = ba.firstChild;
s(y);
return da;
},
remove: p,
getVersion: function() {
var u = 'Shockwave Flash',
v = 'application/x-shockwave-flash',
w = 'ShockwaveFlash.ShockwaveFlash',
x;
if (navigator.plugins && typeof navigator.plugins[u] == 'object') {
var y = navigator.plugins[u].description;
if (y && navigator.mimeTypes && navigator.mimeTypes[v] && navigator.mimeTypes[v].enabledPlugin) x = y.match(/\d+/g);
}
if (!x) try {
x = (new ActiveXObject(w)).GetVariable('$version').match(/(\d+),(\d+),(\d+),(\d+)/);
x = Array.prototype.slice.call(x, 1);
} catch (z) {}
return x;
},
getVersionString: function() {
var u = t.getVersion();
return u ? u.join('.') : '';
},
checkMinVersion: function(u) {
var v = t.getVersion();
if (!v) return false;
return r(v.join('.')) >= r(u);
},
isAvailable: function() {
return !!t.getVersion();
}
};
e.exports = t;
}, null);
__d("TextInputControl", ["DOMControl", "Event", "Input", "debounce"], function(a, b, c, d, e, f, g, h, i, j) {
b.__markCompiled && b.__markCompiled();
for (var k in g)
if (g.hasOwnProperty(k)) m[k] = g[k];
var l = g === null ? null : g.prototype;
m.prototype = Object.create(l);
m.prototype.constructor = m;
m.__superConstructor__ = g;
function m(n) {
"use strict";
g.call(this, n);
var o = this.getRoot(),
p = j(this.update.bind(this), 0);
h.listen(o, {
input: p,
keydown: p,
paste: p
});
}
m.prototype.setMaxLength = function(n) {
"use strict";
i.setMaxLength(this.getRoot(), n);
return this;
};
m.prototype.getValue = function() {
"use strict";
return i.getValue(this.getRoot());
};
m.prototype.isEmpty = function() {
"use strict";
return i.isEmpty(this.getRoot());
};
m.prototype.setValue = function(n) {
"use strict";
i.setValue(this.getRoot(), n);
this.update();
return this;
};
m.prototype.clear = function() {
"use strict";
return this.setValue('');
};
m.prototype.setPlaceholderText = function(n) {
"use strict";
i.setPlaceholder(this.getRoot(), n);
return this;
};
e.exports = m;
}, null);
__d("TextAreaControl", ["Arbiter", "ArbiterMixin", "CSS", "DOMControl", "Event", "Style", "TextInputControl", "TextMetrics", "classWithMixins", "mixin"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
b.__markCompiled && b.__markCompiled();
function q(v, w) {
return l.getFloat(v, w) || 0;
}
var r = o(m, p(h));
for (var s in r)
if (r.hasOwnProperty(s)) u[s] = r[s];
var t = r === null ? null : r.prototype;
u.prototype = Object.create(t);
u.prototype.constructor = u;
u.__superConstructor__ = r;
function u(v) {
"use strict";
r.call(this, v);
this.autogrow = i.hasClass(v, 'uiTextareaAutogrow');
this.autogrowWithPlaceholder = i.hasClass(v, 'uiTextareaAutogrowWithPlaceholder');
this.width = null;
k.listen(v, 'focus', this._handleFocus.bind(this));
}
u.prototype.setAutogrow = function(v) {
"use strict";
this.autogrow = v;
return this;
};
u.prototype.onupdate = function() {
"use strict";
t.onupdate.call(this);
this.updateHeight();
};
u.prototype.updateHeight = function() {
"use strict";
if (this.autogrow) {
var v = this.getRoot();
if (!this.metrics) this.metrics = new n(v);
if (typeof this.initialHeight === 'undefined') {
this.isBorderBox = l.get(v, 'box-sizing') === 'border-box' || l.get(v, '-moz-box-sizing') === 'border-box' || l.get(v, '-webkit-box-sizing') === 'border-box';
this.borderBoxOffset = q(v, 'padding-top') + q(v, 'padding-bottom') + q(v, 'border-top-width') + q(v, 'border-bottom-width');
this.initialHeight = v.offsetHeight - this.borderBoxOffset;
}
var w = null;
if ((!v.value || v.value.length === 0) && this.autogrowWithPlaceholder) {
w = this.metrics.measure(v.placeholder);
} else w = this.metrics.measure();
var x = Math.max(this.initialHeight, w.height);
if (this.isBorderBox) x += this.borderBoxOffset;
if (this.maxHeight && x > this.maxHeight) {
x = this.maxHeight;
g.inform('maxHeightExceeded', {
textArea: v
});
}
if (x !== this.height) {
this.height = x;
l.set(v, 'height', x + 'px');
g.inform('reflow');
this.inform('resize');
}
} else if (this.metrics) {
this.metrics.destroy();
this.metrics = null;
}
};
u.prototype.resetHeight = function() {
"use strict";
this.height = -1;
this.update();
};
u.prototype.setMaxHeight = function(v) {
"use strict";
this.maxHeight = v;
};
u.prototype.setAutogrowWithPlaceholder = function(v) {
"use strict";
this.autogrowWithPlacedholder = v;
};
u.prototype._handleFocus = function() {
"use strict";
this.width = null;
};
u.getInstance = function(v) {
"use strict";
return j.getInstance(v) || new u(v);
};
e.exports = u;
}, null);
__d("XUIError", ["ARIA", "Bootloader", "CSS", "DataStore", "DOM", "Event", "JSXDOM", "Parent", "Promise", "cx", "filterObject", "getActiveElement", "getElementText", "invariant", "isNode", "memoize", "nl2br"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) {
b.__markCompiled && b.__markCompiled();
'use strict';
var x = 'data-xui-error-alignh',
y = 'XUIError',
z = 'data-xui-error',
aa = "_1tp7",
ba = 'data-xui-error-position';
l.listen(document.documentElement, 'mouseover', function(event) {
if (n.byClass(r(), aa)) return;
var pa = n.byClass(event.getTarget(), aa);
if (pa) {
la(pa);
} else ma();
});
l.listen(document.documentElement, 'focusin', function(event) {
var pa = n.byClass(event.getTarget(), aa);
if (pa) {
la(pa);
} else ma();
});
l.listen(document.documentElement, 'focusout', function(event) {
ma();
});
var ca = v(function() {
return new o(function(pa, qa) {
h.loadModules(["ContextualDialog", "ContextualLayerAutoFlip", "ContextualLayerUpdateOnScroll", "LayerRefocusOnHide", "React"], function(ra, sa, ta, ua, va) {
var wa = {
ContextualDialog: ra,
ContextualLayerAutoFlip: sa,
ContextualLayerUpdateOnScroll: ta,
LayerRefocusOnHide: ua,
React: va
};
pa(Object.assign({}, wa, da(wa)));
});
});
});
function da(pa) {
var qa = pa.ContextualDialog,
ra = pa.ContextualLayerAutoFlip,
sa = pa.ContextualLayerUpdateOnScroll,
ta = pa.LayerRefocusOnHide,
ua = m.div({
className: "_1tp8"
}),
va = (m.div({
className: "_53ij _1tp9"
}, m.div({
className: "_1tpa"
}), ua)),
wa = new qa({
addedBehaviors: [sa, ra],
theme: {
wrapperClassName: "_1tpb",
arrowDimensions: {
offset: 12,
length: 16
}
}
}, va);
wa.disableBehavior(ta);
wa.shouldSetARIAProperties(false);
return {
dialog: wa,
dialogBodyNode: va,
dialogMessageNode: ua
};
}
var ea = null;
function fa(pa) {
return Object.assign({
message: pa.getAttribute(z),
position: pa.getAttribute(ba),
alignh: pa.getAttribute(x)
}, j.get(pa, y));
}
function ga(pa, qa) {
j.set(pa, y, qa);
}
function ha(pa, qa) {
j.set(pa, y, Object.assign({}, j.get(pa, y), qa));
}
function ia(pa) {
j.remove(pa, y);
}
var ja = false,
ka = false;
function la(pa) {
ca().done(function(qa) {
var ra = qa.React,
sa = qa.dialog,
ta = qa.dialogMessageNode,
ua = fa(pa),
va = ua.message;
if (va == null) return;
var wa = ra.isValidElement(va);
if (ja && !wa) ra.unmountComponentAtNode(ta);
if (wa) {
ra.render(va, ta);
} else {
t(typeof va === 'string' || u(va));
if (typeof va === 'string') va = w(va);
k.setContent(ta, va);
}
ja = wa;
sa.setContext(pa).setPosition(ua.position || 'right').setAlignment(ua.alignh || (ua.position === 'above' || ua.position === 'below' ? 'right' : null)).show();
g.notify(s(ta));
ea = pa;
});
ka = true;
}
function ma() {
if (!ka) return;
ca().done(function(pa) {
var qa = pa.React,
ra = pa.dialog,
sa = pa.dialogMessageNode;
if (!ea) return;
if (ja) {
qa.unmountComponentAtNode(sa);
ja = false;
}
ra.hide();
ea = null;
});
}
function na(pa) {
if (k.contains(pa, r())) la(pa);
}
var oa = {
set: function(pa) {
var qa = pa.target,
ra = pa.message,
sa = pa.position,
ta = pa.alignh;
t(ra !== null);
i.addClass(qa, aa);
ha(qa, q({
message: ra,
position: sa,
alignh: ta
}, function(ua) {
return ua !== (void 0);
}));
na(qa);
},
clear: function(pa) {
i.removeClass(pa, aa);
pa.removeAttribute(z);
ia(pa);
if (pa === ea) ma();
},
updatePosition: function() {
if (!ka) return;
ca().done(function(pa) {
var qa = pa.dialog;
if (ea) qa.updatePosition();
});
},
__setReactError: function(pa, qa) {
var ra = qa.message,
sa = qa.position,
ta = qa.alignh;
t(ra !== null);
ga(pa, {
message: ra,
position: sa,
alignh: ta
});
na(pa);
},
__clearReactError: function(pa) {
ia(pa);
if (pa === ea) ma();
}
};
e.exports = oa;
}, null);
__d("XUIError.react", ["React", "XUIError", "cx", "joinClasses", "onlyChild"], function(a, b, c, d, e, f, g, h, i, j, k) {
b.__markCompiled && b.__markCompiled();
'use strict';
var l = g,
m = l.PropTypes,
n = "_1tp7",
o = g.createClass({
displayName: "ReactXUIError",
propTypes: {
xuiError: m.any,
xuiErrorPosition: m.oneOf(['above', 'below', 'left', 'right']),
xuiErrorAlignh: m.oneOf(['left', 'center', 'right'])
},
componentDidMount: function() {
if (this.props.xuiError != null) h.__setReactError(g.findDOMNode(this), {
message: this.props.xuiError,
position: this.props.xuiErrorPosition,
alignh: this.props.xuiErrorAlignh
});
},
componentDidUpdate: function() {
if (this.props.xuiError == null) {
h.__clearReactError(g.findDOMNode(this));
} else h.__setReactError(g.findDOMNode(this), {
message: this.props.xuiError,
position: this.props.xuiErrorPosition,
alignh: this.props.xuiErrorAlignh
});
},
componentWillUnmount: function() {
h.__clearReactError(g.findDOMNode(this));
},
render: function() {
var p = k(this.props.children);
if (this.props.xuiError != null) p = g.cloneElement(p, {
className: j(p.props.className, n)
});
return p;
}
});
e.exports = o;
}, null);
__d("highlight", ["Animation", "Style"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
function i(j, k, l, m) {
new g(j).from('background', m || '#fff9d7').to('background', l || '#fff').ease(g.ease.both).duration(2000).ondone(function() {
h.set(j, 'background', '');
k && k();
}).go();
}
e.exports = i;
}, null);
__d("ReactComposerEvents", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
var g = {
CHANGE: 'change',
SELECT_ATTACHMENT: 'composer/selectAttachment',
FOCUS: 'composer/focus',
MENTION_INPUT_FOCUS: 'composer/mentionInputFocused',
POST_STARTED: 'composer/postStarted'
};
e.exports = g;
}, null);
__d("ReactComposerMLELazyAttachment.react", ["ReactComposerAttachmentType", "ReactComposerLoadableAttachmentBodyMixin", "Bootloader", "React", "XReactComposerMLEAttachmentBootstrapController", "cx"], function(a, b, c, d, e, f, g, h, i, j, k, l) {
b.__markCompiled && b.__markCompiled();
var m = j.createClass({
displayName: "ReactComposerMLELazyAttachment",
mixins: [h],
statics: {
attachmentID: g.MLE
},
bootload: function(n) {
i.loadModules(["ReactComposerMLEAttachmentContainer.react"], n);
},
getBootstrapURI: function() {
return k.getURIBuilder().setString('composer_id', this.context.composerID).getURI();
}
});
e.exports = m;
}, null);
__d("QueriesHistory", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
function g(h) {
"use strict";
this.$QueriesHistory0 = h;
this.reset();
}
g.prototype.getQueries = function() {
"use strict";
return this.$QueriesHistory1;
};
g.prototype.getCurrentLength = function() {
"use strict";
return this.$QueriesHistory2;
};
g.prototype.add = function(h) {
"use strict";
this.$QueriesHistory1.push(h);
this.$QueriesHistory2 += h.length;
while (this.$QueriesHistory1.length !== 0 && this.$QueriesHistory2 > this.$QueriesHistory0) {
var i = this.$QueriesHistory1.shift();
this.$QueriesHistory2 -= i.length;
}
};
g.prototype.reset = function() {
"use strict";
this.$QueriesHistory2 = 0;
this.$QueriesHistory1 = [];
};
e.exports = g;
}, null);
/*!CK:687634152!*/ /*1438697698,*/
if (self.CavalryLogger) {
CavalryLogger.start_js(["kAYlU"]);
}
__d("CommentsPluginSentryAction", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = {
CONFIRM_POST_TO_PROFILE: "confirm_post_to_profile"
};
}, null);
__d("ComposedBlockType", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = {
UNSTYLED: 0,
PARAGRAPH: 1,
UNORDERED_LIST_ITEM: 2,
ORDERED_LIST_ITEM: 3,
BLOCKQUOTE: 4,
HEADER_ONE: 5,
HEADER_TWO: 6,
CODE: 7,
MEDIA: 8,
PULLQUOTE: 9
};
}, null);
__d("ComposedEntityMutability", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = {
MUTABLE: 0,
IMMUTABLE: 1,
SEGMENTED: 2
};
}, null);
__d("ComposedEntityType", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = {
MENTION: 0,
LINK: 1,
IMAGE: 2,
VIDEO: 3,
EMOTICON: 4,
TOKEN: 5,
HASHTAG: 6,
IMPLICIT_LINK: 7
};
}, null);
__d("ComposedInlineStyle", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = {
NONE: 0,
BOLD: 1,
ITALIC: 2,
UNDERLINE: 4,
CODE: 8,
STRIKETHROUGH: 16,
SUBSCRIPT: 32,
SUPERSCRIPT: 64
};
}, null);
__d("ComposedLinkEntityProperties", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = {
URL: "url",
SHIMMED_URL: "shimmedURL"
};
}, null);
__d("DeveloperCommentsModerationSource", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = {
APP: "app",
URL: "url"
};
}, null);
__d("OpenIDRequest", ["AsyncRequest", "AsyncSignal", "URI", "UserAgent_DEPRECATED", "PHPQuerySerializer", "coalesce", "createArrayFromMixed", "errorCode"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n) {
b.__markCompiled && b.__markCompiled();
function o() {
var p = new g().setReadOnly(true).setHandler(this.asyncResponseHandler.bind(this)).setErrorHandler(this.asyncErrorHandler.bind(this));
Object.assign(this, {
openidUrl: null,
requestId: o.maxRequestId++,
successResponseHandler: null,
cancelHandler: null,
intermediateHandler: null,
immediateMode: false,
useExtensions: true,
thirdPartyLogin: false,
popupWindow: null,
asyncRequest: p,
retryCount: 0
});
o.requests[this.requestId] = this;
}
o.getRequestById = function(p) {
return o.requests[p];
};
o.prototype.setOpenIDUrl = function(p) {
this.openidUrl = p;
return this;
};
o.prototype.setSuccessHandler = function(p) {
this.successResponseHandler = p;
return this;
};
o.prototype.setErrorHandler = function(p) {
this.errorHandler = p;
return this;
};
o.prototype.setCancelHandler = function(p) {
this.cancelHandler = p;
return this;
};
o.prototype.setImmediateMode = function(p) {
this.immediateMode = p;
return this;
};
o.prototype.setUseExtensions = function(p) {
this.useExtensions = p;
return this;
};
o.prototype.setIntermediateHandler = function(p) {
this.intermediateHandler = p;
return this;
};
o.prototype.setThirdPartyLogin = function(p) {
this.thirdPartyLogin = p;
return this;
};
o.prototype.send = function() {
if (!this.openidUrl) throw "openidUrl is a required parameter. Call setOpenIDUrl()";
var p = this.calculateRedirectUrl();
if (!p) {
this.logMetrics('redirectUrlNotFound');
return;
}
if (this.immediateMode) {
this.createHiddenIframe(p);
} else {
if (this.popupWindow) throw "OpenID popup is already in progress";
this.showPopup(p);
}
this.logMetrics('requestSent');
};
o.prototype.calculateRedirectUrl = function(p) {
var q = this.immediateMode ? 'checkid_immediate' : 'checkid_setup',
r = {
'openid.mode': q
},
s;
if (!o.cache[this.openidUrl]) return null;
s = o.cache[this.openidUrl].url;
var t = new i(new i(s).getQueryData()['openid.return_to']);
t.addQueryData({
context: o.context,
request_id: this.requestId
});
r['openid.return_to'] = t.toString();
r.third_party_login = this.thirdPartyLogin;
return new i(s).addQueryData(r).getQualifiedURI();
};
o.prototype.createHiddenIframe = function(p) {
var q = 'openid_request_' + this.requestId,
r = document.body.appendChild(document.createElement('div')),
s = function() {
r.innerHTML = ('<iframe name="' + q + '"' + ' src="' + p.toString() + '"' + ' scrolling="no" ' + ' frameborder="0" class="hidden_elem"></iframe>');
};
if (j.ie()) {
r.innerHTML = '<iframe src="javascript:false"></iframe>';
setTimeout(s, 0);
} else s();
};
o.prototype.showPopup = function(p) {
var q;
if (o.cache[this.openidUrl]) q = o.cache[this.openidUrl].popup_dimensions;
if (!q || !q.height || !q.width) q = {
height: '580',
width: '790'
};
var r = {
x: l(window.screenX, window.screenLeft),
y: l(window.screenY, window.screenTop),
width: l(window.outerWidth, document.body.clientWidth),
height: l(window.outerHeight, document.body.clientHeight)
},
s = r.x + ((r.width - q.width) / 2),
t = r.y + ((r.height - q.height) / 2),
u = ["location=yes", "scrollbars=1", "left=" + s, "top=" + t, "resizable=yes", "height=" + q.height, "width=" + q.width].join(",");
this.popupWindow = window.open(p.toString(), '_blank', u);
this.popupPollInterval = setInterval(this.pollPopupWindow.bind(this), 100);
this.popupWindow.focus();
};
o.prototype.pollPopupWindow = function() {
if (!(this.popupPollInterval && this.popupWindow)) return;
if (this.popupWindow.closed) {
clearInterval(this.popupPollInterval);
this.cancel();
}
};
o.prototype.closePopupIfOpen = function() {
if (this.popupWindow) {
if (this.popupPollInterval) clearInterval(this.popupPollInterval);
this.popupWindow.close();
}
this.popupWindow = null;
};
o.prototype.cancel = function() {
this.closePopupIfOpen();
if (this.cancelHandler) this.cancelHandler();
this.logMetrics('requestCanceled');
};
o.prototype.logMetrics = function(p) {
new h('/ajax/openid/metrics.php', {
metric: p,
immediate: this.immediateMode,
context: o.context,
openid_url: this.openidUrl
}).send();
};
o.prototype.triggerCompleteAuthAsync = function(p) {
if (p.charAt(0) == '?' || p.charAt(0) == '&') p = p.substr(1);
var q = k.deserialize(p);
this.closePopupIfOpen();
if (q['openid.mode'] == 'cancel') {
this.cancel();
return;
}
if (this.intermediateHandler) this.intermediateHandler();
this.asyncRequest.setData({
openid_params: q
}).send();
};
o.prototype.asyncResponseHandler = function(p) {
var q = p.getPayload();
if (this.successResponseHandler) this.successResponseHandler(q);
this.closePopupIfOpen();
};
o.prototype.cleanHandleResponse = function(p) {
if (p.css) p.css = m(p.css);
this.asyncRequest.handleResponse(p);
};
o.prototype.asyncErrorHandler = function(p) {
this.closePopupIfOpen();
if (p.error == 1428010 || p.error == 1428011) {
this.cancel();
return;
}
if (this.errorHandler) this.errorHandler(p);
};
o.prototype.retry = function() {
++this.retryCount;
this.requestId = o.maxRequestId++;
this.send();
};
o.prototype.setProviderCache = function(p) {
o.cache = p;
return this;
};
o.cache = {};
o.requests = [];
o.maxRequestId = 0;
o.context = 'default';
e.exports = o;
}, null);
__d("WidgetArbiter", ["createArrayFromMixed"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
var h = {
_findSiblings: function() {
if (h._siblings) return;
h._siblings = [];
for (var i = parent.frames.length - 1; i >= 0; i--) try {
if (parent.frames[i] && parent.frames[i].Arbiter && parent.frames[i].Arbiter.inform) h._siblings.push(parent.frames[i].Arbiter);
} catch (j) {}
},
inform: function() {
h._findSiblings();
var i = g(arguments);
h._siblings.forEach(function(j) {
j.inform.apply(j, i);
});
}
};
e.exports = h;
}, null);
__d("CommentAdminPanelController", ["Arbiter", "AsyncRequest", "Button", "ChannelConstants", "CSS", "DOM", "Event", "Toggler", "URI", "Vector", "$", "ge", "XD", "MultiLoginPopup"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) {
b.__markCompiled && b.__markCompiled();
var s = b('XD').UnverifiedXD,
t = function(u) {
Object.assign(this, {
locale: u.locale,
channel: u.channel,
controllerID: u.controllerID,
commentIDs: u.commentIDs,
domIDs: u.domIDs,
duplicateComments: [],
fetchMoreCommentsIsPending: {},
blacklistedActors: u.blacklistedActors,
actorToCommentInfoMap: u.actorToCommentIDMap,
commentInfoMap: u.commentInfoMap,
inAggregatedView: u.inAggregatedView,
inModerationQueue: u.inModerationQueue,
inContextualDialog: u.inContextualDialog,
isTopLevelCommentPollingEnabled: false,
loggedIn: u.loggedIn,
newestCommentTimestamp: u.newestCommentTimestamp,
realTimePollingParams: {},
userOwnsPages: u.userOwnsPages,
recentlyBlacklistedActors: u.blacklistedActors
});
g.subscribe(j.getArbiterType('comments_plugin_new_post'), function(v, w) {
if (w.obj.target === this.realTimePollingParams.target) {
if (r(w.obj.comment_element_id)) return;
var x = Object.assign({}, this.realTimePollingParams);
x.post_fbid = w.obj.post_fbid;
var y = w.obj.parent_comment_id;
if (y) {
var z = r(y);
if (!z) return;
var aa = l.scry(z, '.fbFeedbackPager.uiMorePager');
if (aa.length > 0) return;
x.parent_comment_id = y;
x.is_reply_thread = true;
} else {
if (!this.isTopLevelCommentPollingEnabled) return;
x.is_reply_thread = false;
}
this.pollForComments(x);
}
}.bind(this));
this.controlledRegion = q(this.controllerID);
this.attachClickHandlers();
if (this.inModerationQueue) this.registerModeratorQueueHandlers(true);
};
Object.assign(t, {
allControllers: {},
mainController: null,
contextualControllers: {},
initController: function(u) {
var v = new t(u),
w = u.controllerID;
t.allControllers[w] = v;
if (v.inContextualDialog) {
t.contextualControllers[w] = v;
} else t.mainController = v;
},
syncController: function(u, v) {
var w = t.allControllers[u];
w.attachClickHandlers();
if (!w.isControllingModerationQueue()) return;
w.deselectComments(v);
w.registerModeratorQueueHandlers(false);
w.synchronizeModeratorQueueUI();
},
resetController: function(u) {
var v = t.allControllers[u];
v.resetController();
},
appendComments: function(u, v, w) {
var x = t.allControllers[u];
x.appendComments(v, w);
},
prependComments: function(u, v, w) {
var x = t.allControllers[u];
x.prependComments(v, w);
},
updateController: function(u, v, w, x, y, z, aa) {
var ba = t.allControllers[u];
ba.updateController(v, w, x, y, z, aa);
if (!t.mainController.loggedIn) b('MultiLoginPopup').reattachLoginInterceptors();
if (!ba.isControllingModerationQueue()) return;
ba.registerModeratorQueueHandlers(false);
ba.synchronizeModeratorQueueUI();
},
updatePollingParamsCommentas: function(u, v) {
var w = t.allControllers[u];
w.updatePollingParamsCommentas(v);
},
registerMoreCommentsLinkHandler: function(u, v) {
var w = t.allControllers[u];
w.registerMoreCommentsLinkHandler(v);
},
replaceContentMaybe: function(u, v) {
var w = l.scry(document.documentElement, u)[0];
if (w) l.replace(w, v);
},
notifyCommentCreated: function(u) {
if (!t.mainController.channel) return;
s.send({
type: 'commentCreated',
href: u.href,
parentCommentID: u.parentCommentID,
commentID: u.commentID,
message: u.message
});
},
notifyCommentRemoved: function(u) {
if (!t.mainController.channel) return;
s.send({
type: 'commentRemoved',
href: u.href,
commentID: u.commentID
});
},
markAsShowingAllReplies: function(u) {
var v = u + ' a.fbUpDownVoteOption',
w = l.scry(document.documentElement, v),
x = u + ' li.fbUpDownVoteOption a.itemAnchor',
y = l.scry(document.documentElement, x),
z = w.concat(y);
for (var aa = 0; aa < z.length; aa++) {
var ba = z[aa],
ca = new o(ba.getAttribute('ajaxify'));
ca.addQueryData({
show_all_replies: 1
});
ba.setAttribute('ajaxify', ca.toString());
}
},
setLoggedIn: function(u) {
t.mainController.loggedIn = u;
},
blacklistChangeListener: function(u, v, w) {
var x = q(v);
m.listen(u, 'change', function() {
if (u.options[u.selectedIndex].value == w) {
k.show(x);
} else k.hide(x);
});
}
});
Object.assign(t.prototype, {
isControllingModerationQueue: function() {
var u = this == t.mainController && this.inModerationQueue;
return u;
},
resetController: function() {
this.commentIDs = [];
this.domIDs = [];
},
updateController: function(u, v, w, x, y, z) {
u.forEach(function(ba) {
this.commentIDs.push(ba);
}, this);
v.forEach(function(ba) {
this.domIDs.push(ba);
}, this);
Object.assign(this.blacklistedActors, x);
for (var aa in y) {
if (!this.actorToCommentInfoMap[aa]) this.actorToCommentInfoMap[aa] = [];
y[aa].forEach(function(ba) {
this.actorToCommentInfoMap[aa].push(ba);
}, this);
}
this.newestCommentTimestamp = Math.max(this.newestCommentTimestamp, w);
Object.assign(this.commentInfoMap, z);
this.attachClickHandlers();
},
updatePollingParamsCommentas: function(u) {
this.realTimePollingParams.commentas = u;
},
attachClickHandlers: function() {
for (var u = 0; u < this.domIDs.length; u++) {
var v = 'li[id="' + this.domIDs[u] + '"]',
w = l.scry(this.controlledRegion, v);
if (w.length === 0) continue;
var x = w[0],
y = l.scry(x, 'a.uiCloseButton');
m.listen(x, 'mouseleave', this.closeStickyMenuFlyouts.bind(this, y));
var z = l.scry(x, '.fbModerateDropdownContainer');
if (z.length > 0) {
var aa = z[0],
ba = l.find(aa, '.fbModerateDropdownLink');
m.listen(ba, 'mouseover', function(ka, event) {
k.addClass(ka, 'fbUnderlineText');
}.bind(null, ba));
m.listen(ba, 'mouseout', function(ka, event) {
k.removeClass(ka, 'fbUnderlineText');
}.bind(null, ba));
var ca = l.find(aa, '.fbModerationDropdownList');
m.listen(ba, 'click', this.exposeDropDownMenu.bind(this, ba, ca));
m.listen(ca.parentNode, 'mouseleave', this.concealDropDownMenu.bind(this, ba, ca));
this.attachDropDownHandlers(x, this.commentIDs[u], ca);
}
var da = this.commentInfoMap[this.commentIDs[u]].actor,
ea = !!this.recentlyBlacklistedActors[da];
if (ea) {
var fa = l.scry(x, '.fbUndoBlacklistLink');
if (fa.length > 0) {
var ga = fa[0];
m.listen(ga, 'click', this.toggleBlackListAndSync.bind(this, this.commentIDs[u]));
}
}
}
var ha = l.scry(this.controlledRegion, '.fbReplyButton'),
ia = l.scry(this.controlledRegion, '.fbReplyAfterLoginButton');
for (var ja = 0; ja < ha.length; ja++)
if (this.loggedIn) {
k.show(ha[ja]);
k.hide(ia[ja]);
} else {
k.hide(ha[ja]);
k.show(ia[ja]);
}
},
closeStickyMenuFlyouts: function(u, event) {
n.hide();
for (var v = 0; v < u.length; v++) u[v].blur();
},
attachDropDownHandlers: function(u, v, w) {
var x = l.scry(w, '.fbBanUser');
if (x.length > 0) {
var y = x[0],
z = l.find(y, '^.fbFeedbackPost');
if (z.id.startsWith(v)) m.listen(y, 'click', this.toggleBlackListAndSync.bind(this, v));
}
},
exposeDropDownMenu: function(u, v, event) {
if (k.shown(v)) return this.concealDropDownMenu(u, v, event);
m.stop(event);
k.show(v);
v.focus();
u.blur();
var w = l.find(document.documentElement, '.commentContent'),
x = p.getElementPosition(v).y + p.getElementDimensions(v).y - p.getElementDimensions(w).y;
if (x > 0) {
x = x + 2;
this.menuBuffer = l.create('div', {
className: 'menuBuffer',
style: {
height: x + 'px'
}
});
l.appendContent(w, this.menuBuffer);
}
return false;
},
concealDropDownMenu: function(u, v, event) {
m.stop(event);
k.removeClass(u, 'fbUnderlineText');
k.hide(v);
u.blur();
if (this.menuBuffer) {
l.remove(this.menuBuffer);
delete this.menuBuffer;
}
return false;
},
registerMoreCommentsLinkHandler: function(u) {
var v = u.pager_id;
if (!r(v)) return;
var w = q(v);
m.listen(w, 'click', this.fetchMoreComments.bind(this, u, w));
},
deselectComments: function(u) {
for (var v = 0; v < u.length; v++) delete this.selectedCommentsMap[u[v]];
},
registerModeratorQueueHandlers: function(u) {
if (u) this.selectedCommentsMap = {};
this.selectableComments = this.findSelectableComments();
this.selectableCheckboxes = [];
this.selectAllCheckBoxes = l.scry(this.controlledRegion, '.fbSelectAllCheckbox');
this.approveButtons = l.scry(this.controlledRegion, '.fbApproveButton');
this.removeButtons = l.scry(this.controlledRegion, '.fbRemoveButton');
for (var v = 0; v < this.selectableComments.length; v++) {
var w = this.selectableComments[v].id,
x = !!this.selectedCommentsMap[w];
this.setCommentSelection(this.selectableComments[v], x);
var y = l.find(this.selectableComments[v], '.fbCommentCheckbox');
m.listen(y, 'click', this.toggleCommentSelection.bind(this));
m.listen(this.selectableComments[v], 'click', this.toggleCommentSelection.bind(this));
y.checked = x;
this.selectableCheckboxes.push(y);
}
for (var z = 0; z < this.selectAllCheckBoxes.length; z++) {
this.selectAllCheckBoxes[z].checked = false;
this.selectAllCheckBoxes[z].disabled = this.selectableComments.length === 0;
m.listen(this.selectAllCheckBoxes[z], 'click', this.toggleSelectAllCheckbox.bind(this, this.selectAllCheckBoxes[z]));
}
for (var aa = 0; aa < this.approveButtons.length; aa++) m.listen(this.approveButtons[aa], 'click', this.setBulkPrivacy.bind(this, false));
for (var ba = 0; ba < this.removeButtons.length; ba++) m.listen(this.removeButtons[ba], 'click', this.setBulkPrivacy.bind(this, true));
},
findSelectableComments: function() {
var u = l.scry(this.controlledRegion, '.fbTopLevelComment'),
v = [];
for (var w = 0; w < u.length; w++)
if ((l.scry(u[w], '.fbCommentCheckbox').length === 1) && (l.scry(u[w], '.fbCommentOverlay').length === 0)) v.push(u[w]);
return v;
},
toggleCommentSelection: function(event) {
var u = {
a: true
},
v = event.getTarget(),
w = v.tagName.toLowerCase(),
x = v.parentNode.tagName.toLowerCase();
if (u[w] || u[x]) return;
var y = k.hasClass(v, 'fbFeedbackPost') ? v : l.find(v, '^.fbFeedbackPost'),
z = this.commentIsSelected(y),
aa = !z;
this.setCommentSelection(y, aa);
this.synchronizeModeratorQueueUI();
if (k.hasClass(v, 'fbCommentCheckbox')) m.stop(event);
},
commentIsSelected: function(u) {
return k.hasClass(u, 'fbCommentSelected');
},
setCommentSelection: function(u, v) {
if (v) {
this.selectComment(u);
} else this.deselectComment(u);
},
selectComment: function(u) {
k.addClass(u, 'fbCommentSelected');
this.selectedCommentsMap[u.id] = true;
l.find(u, '.fbCommentCheckbox').checked = true;
},
deselectComment: function(u) {
k.removeClass(u, 'fbCommentSelected');
delete this.selectedCommentsMap[u.id];
l.find(u, '.fbCommentCheckbox').checked = false;
},
toggleSelectAllCheckbox: function(u, event) {
m.stop(event);
var v = u.checked;
for (var w = 0; w < this.selectableComments.length; w++) {
this.setCommentSelection(this.selectableComments[w], u.checked);
this.selectableCheckboxes[w].checked = v;
}
this.synchronizeBulkModerationCheckboxes(v);
this.synchronizeBulkModerationButtons(v);
},
synchronizeModeratorQueueUI: function() {
var u = 0;
for (var v = 0; v < this.selectableCheckboxes.length; v++)
if (this.selectableCheckboxes[v].checked) u++;
var w = this.selectableCheckboxes.length > 0 && u == this.selectableCheckboxes.length;
this.synchronizeBulkModerationCheckboxes(w);
this.synchronizeBulkModerationButtons(u > 0);
},
synchronizeBulkModerationCheckboxes: function(u) {
for (var v = 0; v < this.selectAllCheckBoxes.length; v++) this.selectAllCheckBoxes[v].checked = u;
},
synchronizeBulkModerationButtons: function(u) {
for (var v = 0; v < this.approveButtons.length; v++) i.setEnabled(this.approveButtons[v], u);
for (var w = 0; w < this.removeButtons.length; w++) i.setEnabled(this.removeButtons[w], u);
},
setBulkPrivacy: function(u, event) {
m.stop(event);
this.synchronizeBulkModerationButtons(false);
var v = [];
for (var w in this.selectedCommentsMap) v.push(w);
var x = {
is_private: u,
in_moderation_queue: true,
comment_ids: v,
uniqids: v,
controller_id: this.controllerID,
locale: this.locale,
owns_pages: this.userOwnsPages,
in_aggregated_view: this.inAggregatedView,
in_contextual_dialog: this.inContextualDialog
};
new h().setURI('/ajax/connect/comments/set_bulk_private.php').setData(x).send();
return false;
},
toggleBlackListAndSync: function(u, event) {
m.stop(event);
var v = this.commentInfoMap[u].actor,
w = {
blacklist: !this.blacklistedActors[v],
in_moderation_queue: this.inModerationQueue,
comment_id: u,
other_comment_ids: this.getOtherCommentsByActor(v, u),
uniqid: u,
controller_id: this.controllerID,
locale: this.locale,
owns_pages: this.userOwnsPages,
in_aggregated_view: this.inAggregatedView,
in_contextual_dialog: this.inContextualDialog
};
new h().setURI('/ajax/connect/comments/set_blacklist.php').setData(w).setHandler(function(x) {
this.blacklistedActors[v] = !this.blacklistedActors[v];
if (this.blacklistedActors[v]) {
this.recentlyBlacklistedActors[v] = true;
} else delete this.recentlyBlacklistedActors[v];
}.bind(this)).send();
return false;
},
getOtherCommentsByActor: function(u, v) {
return this.actorToCommentInfoMap[u].filter(function(w) {
return w != v;
});
},
fetchMoreComments: function(u, v, event) {
m.kill(event);
k.addClass(v, 'async_saving');
if (this.fetchMoreCommentsIsPending[u.pager_id] === true) return;
this.fetchMoreCommentsIsPending[u.pager_id] = true;
var w = {
is_reply_thread: false,
in_moderation_queue: false,
view_as_moderator: false
};
Object.assign(w, u);
var x = l.scry(q(w.controller_id), this.getCommentsSelector(w));
x = x.concat(l.scry(q(w.controller_id), this.getCollapsedCommentsSelector(w)));
var y = 0,
z = 0;
for (var aa = 0; aa < x.length; aa++)
if (!k.hasClass(x[aa], 'fbCommentIgnored'))
if (k.hasClass(x[aa], 'fbCommentHidden')) {
z++;
} else y++;
if (w.is_reply_thread) w.offset = y;
w.hidden_offset = z;
if (!w.aggregate_view) delete w.aggregate_view;
if (!w.comment_id) delete w.comment_id;
if (!w.is_reply_thread) w.comment_ids = this.commentIDs;
if (!w.commentas) {
var ba = t.allControllers[w.controller_id];
w.commentas = ba.realTimePollingParams.commentas;
}
new h().setURI('/ajax/connect/feedback.php').setReadOnly(true).setData(w).setHandler(function(ca) {
this.fetchMoreCommentsIsPending[u.pager_id] = false;
}.bind(this)).send();
},
getCommentsSelector: function(u) {
var v = u.is_reply_thread ? 'li.fbCommentReply' : 'li.fbTopLevelComment';
if (u.controller_id != u.uniqid) v = 'div[id="' + u.uniqid + '"] ' + v;
return v;
},
getCollapsedCommentsSelector: function(u) {
var v = u.is_reply_thread ? 'div.fbCommentReply' : 'div.fbTopLevelComment';
if (u.controller_id != u.uniqid) v = 'div[id="' + u.uniqid + '"] ' + v;
return v;
},
getRecentlyBlacklistedActors: function() {
var u = [];
for (var v in this.recentlyBlacklistedActors) u.push(v);
return u;
},
appendComments: function(u, v) {
var w = r(u);
if (!w) return;
var x = l.scry(w, '.fbFeedbackReplies')[0];
if (!x) return;
l.appendContent(x, v);
},
prependComments: function(u, v) {
var w = l.scry(document.documentElement, u)[0];
if (!w) return;
var x = v.getNodes(),
y = [];
for (var z = x.length; z-- > 0;) {
var aa = {
id: l.getID(x[z]),
element: x[z]
};
y.push(aa);
var ba = r(aa.id);
if (ba) {
k.hide(aa.element);
this.duplicateComments.push(aa.element);
for (var ca = 0; ca < y.length; ++ca) l.insertAfter(ba, y[ca].element);
y = [];
}
}
for (z = 0; z < y.length; ++z) l.prependContent(w, y[z].element);
setTimeout(this.removeDuplicateComments.bind(this), 0);
},
removeDuplicateComments: function() {
for (var u = 0; u < this.duplicateComments.length; ++u) l.remove(this.duplicateComments[u]);
this.duplicateComments = [];
},
pollForComments: function(u) {
var v = {
locale: this.locale
};
Object.assign(v, u);
if (!v.is_reply_thread) v.comment_ids = this.commentIDs;
v.newest_comment_timestamp = this.newestCommentTimestamp;
var w = this.handlePollResponse.bind(this),
x = this.handlePollError.bind(this),
y = this.handlePollFinally.bind(this);
new h().setURI('/plugins/comments/poll').setReadOnly(true).setData(v).setMethod('GET').setHandler(w).setErrorHandler(x).setFinallyHandler(y).send();
},
handlePollResponse: function(u) {},
handlePollError: function(u) {},
handlePollFinally: function(u) {}
});
e.exports = window.CommentAdminPanelController || t;
}, null);
__d("SelectionState", ["immutable"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
'use strict';
var h = g,
i = h.Record,
j = {
anchorKey: '',
anchorOffset: 0,
focusKey: '',
focusOffset: 0,
isBackward: false,
hasFocus: false
},
k = i(j);
for (var l in k)
if (k.hasOwnProperty(l)) n[l] = k[l];
var m = k === null ? null : k.prototype;
n.prototype = Object.create(m);
n.prototype.constructor = n;
n.__superConstructor__ = k;
function n() {
if (k !== null) k.apply(this, arguments);
}
n.prototype.serialize = function() {
return ('Anchor: ' + this.getAnchorKey() + ':' + this.getAnchorOffset() + ', ' + 'Focus: ' + this.getFocusKey() + ':' + this.getFocusOffset() + ', ' + 'Is Backward: ' + String(this.getIsBackward()) + ', ' + 'Has Focus: ' + String(this.getHasFocus()));
};
n.prototype.getAnchorKey = function() {
return this.anchorKey;
};
n.prototype.getAnchorOffset = function() {
return this.anchorOffset;
};
n.prototype.getFocusKey = function() {
return this.focusKey;
};
n.prototype.getFocusOffset = function() {
return this.focusOffset;
};
n.prototype.getIsBackward = function() {
return this.isBackward;
};
n.prototype.getHasFocus = function() {
return this.hasFocus;
};
n.prototype.hasEdgeWithin = function(o, p, q) {
var r = this.getAnchorKey(),
s = this.getFocusKey();
if (r === s && r === o) {
var t = this.getStartOffset(),
u = this.getEndOffset();
return p <= u && t <= q;
}
if (o !== r && o !== s) return false;
var v = o === r ? this.getAnchorOffset() : this.getFocusOffset();
return p <= v && q >= v;
};
n.prototype.isCollapsed = function() {
return (this.getAnchorKey() === this.getFocusKey() && this.getAnchorOffset() === this.getFocusOffset());
};
n.prototype.getStartKey = function() {
return this.getIsBackward() ? this.getFocusKey() : this.getAnchorKey();
};
n.prototype.getStartOffset = function() {
return this.getIsBackward() ? this.getFocusOffset() : this.getAnchorOffset();
};
n.prototype.getEndKey = function() {
return this.getIsBackward() ? this.getAnchorKey() : this.getFocusKey();
};
n.prototype.getEndOffset = function() {
return this.getIsBackward() ? this.getAnchorOffset() : this.getFocusOffset();
};
e.exports = n;
}, null);
__d("MentionResultsPropTypes", ["React", "SearchableEntry", "SelectionState"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
var j = g,
k = j.PropTypes,
l = {
viewID: k.string.isRequired,
selection: k.instanceOf(i).isRequired,
contextComponent: k.object.isRequired,
mentionableEntries: k.array.isRequired,
highlightedMentionable: k.instanceOf(h),
onMentionSelect: k.func.isRequired,
onMentionHighlight: k.func.isRequired,
onMentionRenderHighlight: k.func.isRequired
};
e.exports = l;
}, null);
__d("MentionsLayer.react", ["Bootloader", "Locale", "MentionResultsPropTypes", "React", "areEqual"], function(a, b, c, d, e, f, g, h, i, j, k) {
b.__markCompiled && b.__markCompiled();
var l = j,
m = l.PropTypes,
n = false,
o = h.isRTL(),
p, q, r, s, t = 5,
u = j.createClass({
displayName: "MentionsLayer",
propTypes: Object.assign({}, i, {
typeaheadView: m.func.isRequired,
typeaheadViewProps: m.object,
autoflip: m.bool,
position: m.oneOf(['above', 'below'])
}),
getInitialState: function() {
return {
bootloaded: n
};
},
componentWillMount: function() {
if (!this.state.bootloaded) v(function() {
this.isMounted() && this.setState({
bootloaded: true
});
}.bind(this));
},
_onMentionSelect: function(w, x) {
x.preventDefault();
this.props.onMentionSelect(w, x);
},
shouldComponentUpdate: function(w, x) {
return (this.state.bootloaded !== x.bootloaded || !k(this.props.mentionableEntries, w.mentionableEntries) || this.props.highlightedMentionable !== w.highlightedMentionable || this.props.characterOffset !== w.characterOffset);
},
render: function() {
if (!this.state.bootloaded) return null;
var w = this.props.mentionableEntries,
x = this.props.selection,
y = (x.isCollapsed() && x.getHasFocus() && w && w.length),
z = null,
aa = this.props.typeaheadViewProps,
ba = false,
ca = false;
if (aa && aa.positionAtContext) {
ba = true;
ca = true;
} else if (y) z = s(this.props.characterOffset, o);
var da = {};
if (this.props.autoflip) {
da.ContextualLayerAutoFlip = q;
da.ContextualLayerUpdateOnScroll = r;
}
var ea = this.props.typeaheadView;
return (j.createElement(p, {
shown: y,
context: this.props.contextComponent,
contextBounds: z,
containerWidthMatchContext: ca,
offsetY: t,
position: this.props.position || 'below',
behaviors: da
}, j.createElement(ea, {
id: this.props.viewID,
viewProps: this.props.typeaheadViewProps,
highlightedEntry: this.props.highlightedMentionable,
entries: w || [],
onSelect: this._onMentionSelect,
onHighlight: this.props.onMentionHighlight,
onRenderHighlight: this.props.onMentionRenderHighlight
})));
}
});
function v(w) {
g.loadModules(["ContextualLayer.react", "ContextualLayerAutoFlip", "ContextualLayerUpdateOnScroll", "getMentionableRect"], function(x, y, z, aa) {
p = x;
q = y;
r = z;
s = aa;
n = true;
w();
});
}
e.exports = u;
}, null);
__d("ActorBio.react", ["React", "fbt"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
'use strict';
var i = g,
j = i.PropTypes,
k = g.createClass({
displayName: "ActorBio",
propTypes: {
stats: j.object.isRequired,
preferredTypes: j.array.isRequired
},
renderLink: function(l) {
return 'url' in l ? g.createElement("a", g.__spread({}, this.props, {
href: l.url
}), l.name) : g.createElement("span", null, l.name);
},
renderItem: function(l, m) {
var n;
switch (l) {
case 'employer':
if ('position' in m) {
n = h._("\u5728{employer}\u7684{position}", [h.param("position", this.renderLink(m.position)), h.param("employer", this.renderLink(m))]);
} else n = h._("{employer}\u54e1\u5de5", [h.param("employer", this.renderLink(m))]);
break;
case 'mutual_friend':
n = h._("{user}\u7684\u670b\u53cb", [h.param("user", this.renderLink(m))]);
break;
default:
return this.renderLink(m);
}
return g.createElement("span", null, n);
},
render: function() {
var l = this.props.stats,
m = this.props.preferredTypes;
for (var n = 0; n < m.length; n++)
for (var o = 0; o < m[n].length; o++) {
var p = m[n][o];
if (p in l) return this.renderItem(p, l[p]);
}
return g.createElement("span", null);
}
});
e.exports = k;
}, null);
__d("fillArray", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
function g(h, i) {
var j = new Array(h);
for (var k = 0; k < h; k++) j[k] = i;
return j;
}
e.exports = g;
}, null);
__d("DocumentCompositeDecorator", ["immutable", "fillArray"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
'use strict';
var i = g,
j = i.List,
k = '.';
function l(o) {
this.$DocumentCompositeDecorator0 = o.slice();
}
l.prototype.getDecorations = function(o) {
var p = h(o.getText().length, null);
this.$DocumentCompositeDecorator0.forEach(function(q, r) {
var s = 0,
t = q.getStrategy();
t(o, function(u, v) {
if (m(p, u, v)) {
n(p, u, v, r + k + s);
s++;
}
});
});
return j(p);
};
l.prototype.getComponentForKey = function(o) {
var p = parseInt(o.split(k)[0], 10);
return this.$DocumentCompositeDecorator0[p].getComponent();
};
l.prototype.getPropsForKey = function(o) {
var p = parseInt(o.split(k)[0], 10);
return this.$DocumentCompositeDecorator0[p].getProps();
};
function m(o, p, q) {
for (var r = p; r < q; r++)
if (o[r] != null) return false;
return true;
}
function n(o, p, q, r) {
for (var s = p; s < q; s++) o[s] = r;
}
e.exports = l;
}, null);
__d("DocumentDecorator", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
function g(h, i, j) {
"use strict";
this.$DocumentDecorator0 = h;
this.$DocumentDecorator1 = i;
this.$DocumentDecorator2 = j || {};
}
g.prototype.getStrategy = function() {
"use strict";
return this.$DocumentDecorator0;
};
g.prototype.getComponent = function() {
"use strict";
return this.$DocumentDecorator1;
};
g.prototype.getProps = function() {
"use strict";
return this.$DocumentDecorator2;
};
e.exports = g;
}, null);
__d("DocumentEntityInstance", ["ComposedEntityMutability", "ComposedEntityType", "arrayContains", "getObjectValues", "invariant"], function(a, b, c, d, e, f, g, h, i, j, k) {
b.__markCompiled && b.__markCompiled();
var l = j(h),
m = j(g);
function n(o, p, q) {
"use strict";
k(i(l, o));
k(i(m, p));
this.$DocumentEntityInstance0 = o;
this.$DocumentEntityInstance1 = p;
this.$DocumentEntityInstance2 = q || {};
}
n.prototype.getType = function() {
"use strict";
return this.$DocumentEntityInstance0;
};
n.prototype.getMutability = function() {
"use strict";
return this.$DocumentEntityInstance1;
};
n.prototype.getData = function() {
"use strict";
return this.$DocumentEntityInstance2;
};
n.prototype.replaceData = function(o) {
"use strict";
this.$DocumentEntityInstance2 = o;
};
e.exports = n;
}, null);
__d("DocumentEntity", ["DocumentEntityInstance", "invariant"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
var i = {},
j = 0,
k = {
create: function(l, m, n) {
return k.add(new g(l, m, n));
},
add: function(l) {
i[++j] = l;
return j.toString();
},
get: function(l) {
var m = i[l];
h(!!m);
return m;
}
};
e.exports = k;
}, null);
__d("EmoticonSpan.react", ["DocumentEntity", "React", "cx", "joinClasses"], function(a, b, c, d, e, f, g, h, i, j) {
b.__markCompiled && b.__markCompiled();
var k = h.createClass({
displayName: "EmoticonSpan",
render: function() {
var l = g.get(this.props.entityKey),
m = l.getData(),
n = m.type,
o = j("_1ty6", 'emoticon_' + n);
return (h.createElement("span", {
className: o,
title: n,
"data-offset-key": this.props.offsetKey
}, h.createElement("span", {
className: "_5ukz"
}, this.props.children)));
}
});
e.exports = k;
}, null);
__d("HashtagSpan.react", ["React", "cx"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
var i = g.createClass({
displayName: "HashtagSpan",
render: function() {
return (g.createElement("span", {
"data-offset-key": this.props.offsetKey,
className: "_5u8n",
spellCheck: false
}, this.props.children));
}
});
e.exports = i;
}, null);
__d("MentionSpan.react", ["React", "cx"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
var i = g.createClass({
displayName: "MentionSpan",
render: function() {
return (g.createElement("span", {
"data-offset-key": this.props.offsetKey,
className: "_5u8u",
spellCheck: false
}, this.props.children));
}
});
e.exports = i;
}, null);
__d("WeakMentionSpan.react", ["React", "cx"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
var i = g.createClass({
displayName: "WeakMentionSpan",
render: function() {
return (g.createElement("span", {
"data-offset-key": this.props.offsetKey,
className: "_whq",
spellCheck: false
}, this.props.children));
}
});
e.exports = i;
}, null);
__d("getEntityMatcher", ["DocumentEntity"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
var h = g.get;
function i(j, k) {
var l = k || h;
return function(m, n) {
m.findEntityRanges(function(o) {
var p = o.getEntity();
return typeof p === 'string' && j(l(p));
}, n);
};
}
e.exports = i;
}, null);
__d("getHashtagMatches", ["getHashtagRegex"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
var h = g();
function i(j, k) {
var l = j.getText(),
m, n, o, p;
while ((m = h.exec(l)) !== null) {
n = m.index + m[1].length;
o = m[2];
p = m[3];
k(n, n + o.length + p.length);
}
}
e.exports = i;
}, null);
__d("getMentionsInputDecorator", ["ComposedEntityType", "DocumentCompositeDecorator", "DocumentDecorator", "EmoticonSpan.react", "HashtagSpan.react", "MentionSpan.react", "WeakMentionSpan.react", "getEntityMatcher", "getHashtagMatches"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) {
b.__markCompiled && b.__markCompiled();
var p = g.EMOTICON,
q = g.MENTION,
r;
function s() {
if (!r) r = new h([new i(n(function(t) {
var u = t.getData();
return t.getType() === q && u && u.isWeak;
}), m), new i(n(function(t) {
return t.getType() === q;
}), l), new i(n(function(t) {
return t.getType() === p;
}), j), new i(o, k)]);
return r;
}
e.exports = s;
}, null);
__d("findRangesImmutable", ["immutable"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
var h = g,
i = h.List;
i;
function j(k, l, m, n) {
if (!k.size) return;
var o = 0;
k.reduce(function(p, q, r) {
if (!l(p, q)) {
if (m(p)) n(o, r);
o = r;
}
return q;
});
m(k.last()) && n(o, k.count());
}
e.exports = j;
}, null);
__d("BlockTree", ["immutable", "emptyFunction", "findRangesImmutable"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
'use strict';
var j = g,
k = j.List,
l = j.Repeat,
m = j.Record,
n = h.thatReturnsTrue,
o = '-',
p = {
start: null,
end: null
},
q = m(p),
r = {
start: null,
end: null,
decoratorKey: null,
leaves: null
},
s = m(r),
t = {
generate: function(w, x) {
var y = w.getLength();
if (!y) return k.of(new s({
start: 0,
end: 0,
decoratorKey: null,
leaves: k.of(new q({
start: 0,
end: 0
}))
}));
var z = [],
aa = x ? x.getDecorations(w) : k(l(null, y)),
ba = w.getCharacterList();
i(aa, v, n, function(ca, da) {
z.push(new s({
start: ca,
end: da,
decoratorKey: aa.get(ca),
leaves: u(ba.slice(ca, da).toList(), ca)
}));
});
return k(z);
},
getFingerprint: function(w) {
return w.map(function(x) {
var y = x.get('decoratorKey'),
z = y !== null ? y + '.' + (x.get('end') - x.get('start')) : '';
return '' + z + '.' + x.get('leaves').size;
}).join(o);
}
};
function u(w, x) {
var y = [],
z = w.map(function(aa) {
return aa.getStyle();
});
i(z, v, n, function(aa, ba) {
y.push(new q({
start: aa + x,
end: ba + x
}));
});
return k(y);
}
function v(w, x) {
return w === x;
}
e.exports = t;
}, null);
__d("UnicodeBidiService", ["UnicodeBidi", "UnicodeBidiDirection", "invariant"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
'use strict';
function j(k) {
if (!k) k = h.getGlobalDir();
i(h.isStrong(k));
this.defaultDir = k;
this.reset();
}
j.prototype.reset = function() {
this.lastDir = this.defaultDir;
};
j.prototype.getDirection = function(k) {
this.lastDir = g.getDirection(k, this.lastDir);
return this.lastDir;
};
e.exports = j;
}, null);
__d("EditorBidiService", ["immutable", "UnicodeBidiService", "nullthrows"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
'use strict';
var j = g,
k = j.OrderedMap,
l, m = {
getDirectionMap: function(n, o) {
if (!l) {
l = new h();
} else l.reset();
var p = n.getBlockMap(),
q = p.valueSeq().map(function(s) {
return i(l).getDirection(s.getText());
}),
r = k(p.keySeq().zip(q));
return g.is(o, r) ? o : r;
}
};
e.exports = m;
}, null);
__d("EditorChangeType", ["keyMirror"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
'use strict';
var h = g({
UNDO: true,
REDO: true,
CHANGE_SELECTION: true,
INSERT_CHARACTERS: true,
BACKSPACE_CHARACTER: true,
DELETE_CHARACTER: true,
REMOVE_RANGE: true,
SPLIT_BLOCK: true,
INSERT_FRAGMENT: true,
CHANGE_INLINE_STYLE: true,
CHANGE_BLOCK_TYPE: true,
APPLY_ENTITY: true,
RESET_BLOCK: true,
ADJUST_DEPTH: true
});
e.exports = h;
}, null);
__d("EditorState", ["BlockTree", "ComposedInlineStyle", "EditorBidiService", "EditorChangeType", "immutable", "SelectionState"], function(a, b, c, d, e, f, g, h, i, j, k, l) {
b.__markCompiled && b.__markCompiled();
'use strict';
var m = k,
n = m.List,
o = m.OrderedMap,
p = m.Record,
q = m.Stack;
n;
o;
p;
var r = {
allowUndo: true,
currentContent: null,
decorator: null,
directionMap: null,
forceSelection: false,
inCompositionMode: false,
inlineStyleOverride: null,
lastChangeType: null,
nativelyRenderedContent: null,
redoStack: q(),
selection: null,
treeMap: null,
undoStack: q()
},
s = k.Record(r);
t.create = function(ca) {
ca.treeMap = v(ca.currentContent, ca.decorator);
ca.directionMap = i.getDirectionMap(ca.currentContent);
return new t(new s(ca));
};
t.set = function(ca, da) {
var ea = ca.getImmutable().withMutations(function(fa) {
var ga = fa.get('decorator'),
ha = ga;
if (da.decorator === null) {
ha = null;
} else if (da.decorator) ha = da.decorator;
var ia = da.currentContent || ca.getCurrentContent();
if (ha !== ga) {
var ja = fa.get('treeMap'),
ka;
if (ha && ga) {
ka = x(ia.getBlockMap(), ja, ha, ga);
} else ka = v(ia, ha);
fa.merge({
decorator: ha,
treeMap: ka,
nativelyRenderedContent: null
});
return;
}
var la = ca.getCurrentContent();
if (ia !== la) fa.set('treeMap', w(ca, ia.getBlockMap(), ha));
fa.merge(da);
});
return new t(ea);
};
t.prototype.toJS = function() {
return this.getImmutable().toJS();
};
t.prototype.getAllowUndo = function() {
return this.getImmutable().get('allowUndo');
};
t.prototype.getCurrentContent = function() {
return this.getImmutable().get('currentContent');
};
t.prototype.getUndoStack = function() {
return this.getImmutable().get('undoStack');
};
t.prototype.getRedoStack = function() {
return this.getImmutable().get('redoStack');
};
t.prototype.getSelection = function() {
return this.getImmutable().get('selection');
};
t.prototype.getDecorator = function() {
return this.getImmutable().get('decorator');
};
t.prototype.isInCompositionMode = function() {
return this.getImmutable().get('inCompositionMode');
};
t.prototype.mustForceSelection = function() {
return this.getImmutable().get('forceSelection');
};
t.prototype.getNativelyRenderedContent = function() {
return this.getImmutable().get('nativelyRenderedContent');
};
t.prototype.getLastChangeType = function() {
return this.getImmutable().get('lastChangeType');
};
t.prototype.getInlineStyleOverride = function() {
return this.getImmutable().get('inlineStyleOverride');
};
t.prototype.getCurrentInlineStyle = function() {
var ca = this.getInlineStyleOverride();
if (ca != null) return ca;
var da = this.getCurrentContent(),
ea = this.getSelection();
if (ea.isCollapsed()) return z(da, ea);
return aa(da, ea);
};
t.prototype.getBlockTree = function(ca) {
return this.getImmutable().getIn(['treeMap', ca]);
};
t.prototype.isAtDocumentStart = function() {
var ca = this.getCurrentContent().getBlockMap().first().getKey();
return this.getSelection().hasEdgeWithin(ca, 0, 0);
};
t.prototype.isAtDocumentEnd = function() {
var ca = this.getCurrentContent(),
da = ca.getBlockMap(),
ea = da.last(),
fa = ea.getLength();
return this.getSelection().hasEdgeWithin(ea.getKey(), fa, fa);
};
t.prototype.getDirectionMap = function() {
return this.getImmutable().get('directionMap');
};
t.acceptSelection = function(ca, da) {
return u(ca, da, false);
};
t.forceSelection = function(ca, da) {
if (!da.getHasFocus()) da = da.set('hasFocus', true);
return u(ca, da, true);
};
t.moveSelectionToEnd = function(ca) {
var da = ca.getCurrentContent(),
ea = da.getLastBlock(),
fa = ea.getKey(),
ga = ea.getLength();
return t.acceptSelection(ca, new l({
anchorKey: fa,
anchorOffset: ga,
focusKey: fa,
focusOffset: ga,
isBackward: false
}));
};
t.moveFocusToEnd = function(ca) {
var da = t.moveSelectionToEnd(ca);
return t.forceSelection(da, da.getSelection());
};
t.push = function(ca, da, ea) {
if (ca.getCurrentContent() === da) return ca;
var fa = ea !== j.INSERT_CHARACTERS,
ga = i.getDirectionMap(da, ca.getDirectionMap());
if (!ca.getAllowUndo()) return t.set(ca, {
currentContent: da,
directionMap: ga,
lastChangeType: ea,
selection: da.getSelectionAfter(),
forceSelection: fa,
inlineStyleOverride: null
});
var ha = ca.getSelection(),
ia = ca.getCurrentContent(),
ja = ca.getUndoStack(),
ka = da;
if (ha !== ia.getSelectionAfter() || y(ca, ea)) {
ja = ja.push(ia);
ka = ka.set('selectionBefore', ha);
} else if (ea === j.INSERT_CHARACTERS || ea === j.BACKSPACE_CHARACTER || ea === j.DELETE_CHARACTER) ka = ka.set('selectionBefore', ia.getSelectionBefore());
return t.set(ca, {
currentContent: ka,
directionMap: ga,
undoStack: ja,
redoStack: k.Stack(),
lastChangeType: ea,
selection: da.getSelectionAfter(),
forceSelection: fa,
inlineStyleOverride: null
});
};
t.undo = function(ca) {
if (!ca.getAllowUndo()) return ca;
var da = ca.getUndoStack(),
ea = da.peek();
if (!ea) return ca;
var fa = ca.getCurrentContent(),
ga = i.getDirectionMap(ea, ca.getDirectionMap());
return t.set(ca, {
currentContent: ea,
directionMap: ga,
undoStack: da.shift(),
redoStack: ca.getRedoStack().push(fa),
forceSelection: true,
inlineStyleOverride: null,
lastChangeType: j.UNDO,
nativelyRenderedContent: null,
selection: fa.getSelectionBefore()
});
};
t.redo = function(ca) {
if (!ca.getAllowUndo()) return ca;
var da = ca.getRedoStack(),
ea = da.peek();
if (!ea) return ca;
var fa = ca.getCurrentContent(),
ga = i.getDirectionMap(ea, ca.getDirectionMap());
return t.set(ca, {
currentContent: ea,
directionMap: ga,
undoStack: ca.getUndoStack().push(fa),
redoStack: da.shift(),
forceSelection: true,
inlineStyleOverride: null,
lastChangeType: j.REDO,
nativelyRenderedContent: null,
selection: ea.getSelectionAfter()
});
};
function t(ca) {
this.$EditorState0 = ca;
}
t.prototype.getImmutable = function() {
return this.$EditorState0;
};
function u(ca, da, ea) {
return t.set(ca, {
selection: da,
forceSelection: ea,
nativelyRenderedContent: null,
inlineStyleOverride: null
});
}
function v(ca, da) {
return ca.getBlockMap().map(function(ea) {
return g.generate(ea, da);
});
}
function w(ca, da, ea) {
var fa = ca.getCurrentContent().getBlockMap(),
ga = ca.getImmutable().get('treeMap');
return ga.merge(da.toSeq().filter(function(ha, ia) {
return ha !== fa.get(ia);
}).map(function(ha) {
return g.generate(ha, ea);
}));
}
function x(ca, da, ea, fa) {
return da.merge(ca.toSeq().filter(function(ga) {
return (ea.getDecorations(ga) !== fa.getDecorations(ga));
}).map(function(ga) {
return g.generate(ga, ea);
}));
}
function y(ca, da) {
var ea = ca.getLastChangeType();
return (da !== ea || (da !== j.INSERT_CHARACTERS && da !== j.BACKSPACE_CHARACTER && da !== j.DELETE_CHARACTER));
}
function z(ca, da) {
var ea = da.getStartKey(),
fa = da.getStartOffset(),
ga = ca.getBlockForKey(ea);
if (fa > 0) return ga.getInlineStyleAt(fa - 1);
if (ga.getLength()) return ga.getInlineStyleAt(0);
return ba(ca, ea);
}
function aa(ca, da) {
var ea = da.getStartKey(),
fa = da.getStartOffset(),
ga = ca.getBlockForKey(ea);
if (fa < ga.getLength()) return ga.getInlineStyleAt(fa);
if (fa > 0) return ga.getInlineStyleAt(fa - 1);
return ba(ca, ea);
}
function ba(ca, da) {
var ea = ca.getBlockBefore(da),
fa;
while (ea) {
fa = ea.getLength();
if (fa) return ea.getInlineStyleAt(fa - 1);
ea = ca.getBlockBefore(ea.getKey());
}
return h.NONE;
}
e.exports = t;
}, null);
__d("AbstractTextEditorPlaceholder.react", ["EditorState", "React", "cx"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
var j = h,
k = j.PropTypes,
l = h.createClass({
displayName: "AbstractTextEditorPlaceholder",
propTypes: {
editorState: k.instanceOf(g).isRequired,
text: k.string.isRequired
},
shouldComponentUpdate: function(m, n) {
if (this.props.text !== m.text) return true;
var o = this.props.editorState,
p = m.editorState,
q = o.getSelection(),
r = p.getSelection();
return (q.getHasFocus() !== r.getHasFocus());
},
render: function() {
var m = this.props.editorState.getSelection().getHasFocus(),
n = (("_5ywb") + (m ? ' ' + "_5ywc" : ''));
return (h.createElement("div", {
className: n
}, h.createElement("div", {
className: "_3br6"
}, this.props.text)));
}
});
e.exports = l;
}, null);
__d("DocumentCommands", ["keyMirror"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
var h = g({
UNDO: true,
REDO: true,
DELETE: true,
DELETE_WORD: true,
BACKSPACE: true,
BACKSPACE_WORD: true,
BACKSPACE_TO_END_OF_BLOCK: true,
BOLD: true,
ITALIC: true,
UNDERLINE: true,
CODE: true,
INSERT_BLOCK_DELIMITER: true,
TRANSPOSE_CHARACTERS: true,
MOVE_SELECTION_TO_START_OF_BLOCK: true,
MOVE_SELECTION_TO_END_OF_BLOCK: true,
SECONDARY_CUT: true,
SECONDARY_PASTE: true
});
e.exports = h;
}, null);
__d("KeyBindingUtil", ["UserAgent"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
var h = g.isPlatform('Mac OS X'),
i = {
isCtrlKeyCommand: function(j) {
return !!j.ctrlKey && !j.altKey;
},
hasCommandModifier: function(j) {
return h ? (!!j.metaKey && !j.altKey) : i.isCtrlKeyCommand(j);
}
};
e.exports = i;
}, null);
__d("getDefaultKeyBinding", ["DocumentCommands", "KeyBindingUtil", "Keys", "UserAgent"], function(a, b, c, d, e, f, g, h, i, j) {
b.__markCompiled && b.__markCompiled();
'use strict';
var k = j.isPlatform('Mac OS X'),
l = j.isPlatform('Windows'),
m = j.isBrowser('Firefox'),
n = k && m && m < 29,
o = h,
p = o.hasCommandModifier,
q = o.isCtrlKeyCommand;
function r(w) {
return (k && !!w.altKey) || q(w);
}
function s(w) {
if (p(w)) return w.shiftKey ? g.REDO : g.UNDO;
}
function t(w) {
if (l && w.shiftKey) return null;
return r(w) ? g.DELETE_WORD : g.DELETE;
}
function u(w) {
if (p(w) && k) return g.BACKSPACE_TO_END_OF_BLOCK;
return r(w) ? g.BACKSPACE_WORD : g.BACKSPACE;
}
function v(w) {
switch (w.keyCode) {
case 66:
return p(w) ? g.BOLD : null;
case 68:
return q(w) ? g.DELETE : null;
case 72:
return q(w) ? g.BACKSPACE : null;
case 73:
return p(w) ? g.ITALIC : null;
case 74:
return p(w) ? g.CODE : null;
case 75:
if (!l && q(w)) return g.SECONDARY_CUT;
return null;
case 79:
return q(w) ? g.INSERT_BLOCK_DELIMITER : null;
case 84:
return k && q(w) ? g.TRANSPOSE_CHARACTERS : null;
case 85:
if (k && q(w)) return g.BACKSPACE_TO_END_OF_BLOCK;
return p(w) ? g.UNDERLINE : null;
case 87:
return k && q(w) ? g.BACKSPACE_WORD : null;
case 89:
if (q(w)) return l ? g.REDO : g.SECONDARY_PASTE;
return null;
case 90:
return s(w) || null;
case i.DELETE:
return t(w);
case i.BACKSPACE:
return u(w);
case i.LEFT:
return (n && p(w) ? g.MOVE_SELECTION_TO_START_OF_BLOCK : null);
case i.RIGHT:
return (n && p(w) ? g.MOVE_SELECTION_TO_END_OF_BLOCK : null);
default:
return null;
}
}
e.exports = v;
}, null);
__d("AbstractTextEditorProps", ["EditorState", "React", "emptyFunction", "getDefaultKeyBinding"], function(a, b, c, d, e, f, g, h, i, j) {
b.__markCompiled && b.__markCompiled();
var k = h,
l = k.PropTypes,
m = i.thatReturns(''),
n = i.thatReturns(null),
o = {
propTypes: {
editorState: l.instanceOf(g).isRequired,
placeholder: l.string,
textAlignment: l.oneOf(['left', 'center', 'right']),
blockRendererFn: l.func,
blockStyleFn: l.func,
inlineStyleFn: l.func,
keyBindingFn: l.func,
readOnly: l.bool,
spellCheck: l.bool,
stripPastedStyles: l.bool,
handleReturn: l.func,
handleKeyCommand: l.func,
handleBeforeInput: l.func,
handlePastedFiles: l.func,
onEscape: l.func,
onTab: l.func,
onUpArrow: l.func,
onDownArrow: l.func,
onPasteRawText: l.func,
onBlur: l.func,
onFocus: l.func
},
getDefaultProps: function() {
return {
blockRendererFn: n,
blockStyleFn: m,
inlineStyleFn: m,
keyBindingFn: j,
readOnly: false,
spellCheck: false,
stripPastedStyles: false
};
}
};
e.exports = o;
}, null);
__d("CharacterMetadata", ["ComposedInlineStyle", "immutable"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
'use strict';
var i = g,
j = i.NONE,
k = h,
l = k.Record,
m = k.is,
n = {
style: j,
entity: null
},
o = l(n);
for (var p in o)
if (o.hasOwnProperty(p)) r[p] = o[p];
var q = o === null ? null : o.prototype;
r.prototype = Object.create(q);
r.prototype.constructor = r;
r.__superConstructor__ = o;
function r() {
if (o !== null) o.apply(this, arguments);
}
r.prototype.getStyle = function() {
return this.get('style');
};
r.prototype.getEntity = function() {
return this.get('entity');
};
r.prototype.hasStyle = function(t) {
return !!(this.getStyle() & t);
};
r.applyStyle = function(t, u) {
return t.set('style', t.getStyle() | u);
};
r.removeStyle = function(t, u) {
var v = t.set('style', t.getStyle() & (~u));
return m(v, s) ? s : v;
};
r.applyEntity = function(t, u) {
var v = t.getEntity() === u ? t : t.set('entity', u);
return m(v, s) ? s : v;
};
var s = new r();
r.EMPTY = s;
e.exports = r;
}, null);
__d("ContentStateInlineStyle", ["CharacterMetadata", "immutable"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
'use strict';
var i = {
add: function(k, l, m) {
return j(k, l, m, true);
},
remove: function(k, l, m) {
return j(k, l, m, false);
}
};
function j(k, l, m, n) {
var o = k.getBlockMap(),
p = l.getStartKey(),
q = l.getStartOffset(),
r = l.getEndKey(),
s = l.getEndOffset(),
t = o.skipUntil(function(u, v) {
return v === p;
}).takeUntil(function(u, v) {
return v === r;
}).concat(h.Map([
[r, o.get(r)]
])).map(function(u, v) {
var w, x;
if (p === r) {
w = q;
x = s;
} else {
w = v === p ? q : 0;
x = v === r ? s : u.getLength();
}
var y = u.getCharacterList(),
z;
while (w < x) {
z = y.get(w);
y = y.set(w, n ? g.applyStyle(z, m) : g.removeStyle(z, m));
w++;
}
return u.set('characterList', y);
});
return k.merge({
blockMap: o.merge(t),
selectionBefore: l,
selectionAfter: l
});
}
e.exports = i;
}, null);
__d("DocumentRemovalDirection", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
var g = {
BACKWARD: 0,
FORWARD: 1
};
e.exports = g;
}, null);
__d("applyEntityToContentBlock", ["CharacterMetadata"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
'use strict';
function h(i, j, k, l) {
var m = i.getCharacterList();
while (j < k) {
m = m.set(j, g.applyEntity(m.get(j), l));
j++;
}
return i.set('characterList', m);
}
e.exports = h;
}, null);
__d("applyEntityToContentState", ["immutable", "applyEntityToContentBlock"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
'use strict';
function i(j, k, l) {
var m = j.getBlockMap(),
n = k.getStartKey(),
o = k.getStartOffset(),
p = k.getEndKey(),
q = k.getEndOffset(),
r = m.skipUntil(function(s, t) {
return t === n;
}).takeUntil(function(s, t) {
return t === p;
}).merge(g.OrderedMap([
[p, m.get(p)]
])).map(function(s, t) {
var u, v;
if (n === p) {
u = o;
v = q;
} else {
u = t === n ? o : 0;
v = t === p ? 0 : s.getLength();
}
return h(s, u, v, l);
});
return j.merge({
blockMap: m.merge(r),
selectionBefore: k,
selectionAfter: k
});
}
e.exports = i;
}, null);
__d("DocumentEntitySegments", ["DocumentRemovalDirection"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
var h = g,
i = h.FORWARD,
j = {
getRemovalRange: function(k, l, m, n, o) {
var p = m.split(' ');
p = p.map(function(z, aa) {
if (o === i) {
if (aa > 0) return ' ' + z;
} else if (aa < p.length - 1) return z + ' ';
return z;
});
var q = n,
r, s, t = null,
u = null;
for (var v = 0; v < p.length; v++) {
s = p[v];
r = q + s.length;
if (k < r && q < l) {
if (t !== null) {
u = r;
} else {
t = q;
u = r;
}
} else if (t !== null) break;
q = r;
}
var w = n + m.length,
x = t === n,
y = u === w;
if ((!x && y) || (x && !y))
if (o === i) {
if (u !== w) u++;
} else if (t !== n) t--;
return {
start: t,
end: u
};
}
};
e.exports = j;
}, null);
__d("checkRangeOverlap", ["invariant"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
function h(i, j, k, l) {
g(i <= j && k <= l);
return (i < l && j > k);
}
e.exports = h;
}, null);
__d("getRangesForDocumentEntity", ["invariant"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
function h(i, j) {
var k = [];
i.findEntityRanges(function(l) {
return l.getEntity() === j;
}, function(l, m) {
k.push({
start: l,
end: m
});
});
g(!!k.length);
return k;
}
e.exports = h;
}, null);
__d("getCharacterRemovalRange", ["ComposedEntityMutability", "DocumentEntity", "DocumentEntitySegments", "checkRangeOverlap", "getRangesForDocumentEntity", "invariant"], function(a, b, c, d, e, f, g, h, i, j, k, l) {
b.__markCompiled && b.__markCompiled();
var m = g,
n = m.MUTABLE,
o = m.IMMUTABLE;
function p(q, r, s) {
var t = r.getStartOffset(),
u = r.getEndOffset(),
v = q.getEntityAt(t);
if (!v) return r;
var w = h.get(v),
x = w.getMutability();
if (x === n) return r;
var y = k(q, v).filter(function(ba) {
return j(t, u, ba.start, ba.end);
});
l(y.length == 1);
var z = y[0];
if (x === o) return r.merge({
anchorOffset: z.start,
focusOffset: z.end,
isBackward: false
});
var aa = i.getRemovalRange(t, u, q.getText().slice(z.start, z.end), z.start, s);
return r.merge({
anchorOffset: aa.start,
focusOffset: aa.end,
isBackward: false
});
}
e.exports = p;
}, null);
__d("generateBlockKey", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
var g = {},
h = Math.pow(2, 24);
function i() {
var j;
while (j === (void 0) || g.hasOwnProperty(j) || !isNaN(+j)) j = Math.floor(Math.random() * h).toString(32);
g[j] = true;
return j;
}
e.exports = i;
}, null);
__d("removeEntitiesAtEdges", ["CharacterMetadata", "ComposedEntityMutability", "DocumentEntity", "immutable", "findRangesImmutable", "invariant"], function(a, b, c, d, e, f, g, h, i, j, k, l) {
b.__markCompiled && b.__markCompiled();
'use strict';
var m = j,
n = m.List,
o = h,
p = o.MUTABLE;
n;
function q(t, u) {
var v = t.getBlockMap(),
w = {},
x = u.getStartKey(),
y = u.getStartOffset(),
z = v.get(x),
aa = s(z, y);
if (aa !== z) w[x] = aa;
var ba = u.getEndKey(),
ca = u.getEndOffset(),
da = v.get(ba);
if (x === ba) da = aa;
var ea = s(da, ca);
if (ea !== da) w[ba] = ea;
if (!Object.keys(w).length) return t.set('selectionAfter', u);
return t.merge({
blockMap: v.merge(w),
selectionAfter: u
});
}
function r(t, u, v) {
var w;
k(t, function(x, y) {
return x.getEntity() === y.getEntity();
}, function(x) {
return x.getEntity() === u;
}, function(x, y) {
if (x <= v && y >= v) w = {
start: x,
end: y
};
});
l(typeof w === 'object');
return w;
}
function s(t, u) {
var v = t.getCharacterList(),
w = u > 0 ? v.get(u - 1) : undefined,
x = u < v.count() ? v.get(u) : undefined,
y = w ? w.getEntity() : undefined,
z = x ? x.getEntity() : undefined;
if (z && z === y) {
var aa = i.get(z);
if (aa.getMutability() !== p) {
var ba = r(v, z, u),
ca = ba.start,
da = ba.end,
ea;
while (ca < da) {
ea = v.get(ca);
v = v.set(ca, g.applyEntity(ea, null));
ca++;
}
return t.set('characterList', v);
}
}
return t;
}
e.exports = q;
}, null);
__d("getContentStateFragment", ["immutable", "generateBlockKey", "removeEntitiesAtEdges"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
'use strict';
var j = g,
k = j.OrderedMap;
k;
function l(m, n) {
var o = n.getStartKey(),
p = n.getStartOffset(),
q = n.getEndKey(),
r = n.getEndOffset(),
s = i(m, n),
t = s.getBlockMap(),
u = t.keySeq(),
v = u.indexOf(o),
w = u.indexOf(q) + 1;
return t.slice(v, w).map(function(x, y) {
var z = h(),
aa = x.getText(),
ba = x.getCharacterList();
if (o === q) return x.merge({
key: z,
text: aa.slice(p, r),
characterList: ba.slice(p, r)
});
if (y === o) return x.merge({
key: z,
text: aa.slice(p),
characterList: ba.slice(p)
});
if (y === q) return x.merge({
key: z,
text: aa.slice(0, r),
characterList: ba.slice(0, r)
});
return x.set('key', z);
});
}
e.exports = l;
}, null);
__d("createOrderedMapFromBlockArray", ["immutable"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
var h = g,
i = h.OrderedMap;
function j(k) {
return i(k.map(function(l) {
return [l.getKey(), l];
}));
}
e.exports = j;
}, null);
__d("insertIntoList", ["immutable"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
'use strict';
var h = g,
i = h.List;
i;
function j(k, l, m) {
if (m === k.count()) {
l.forEach(function(n) {
k = k.push(n);
});
} else if (m === 0) {
l.reverse().forEach(function(n) {
k = k.unshift(n);
});
} else k = k.slice(0, m).concat(l, k.slice(m));
return k;
}
e.exports = j;
}, null);
__d("insertFragmentIntoContentState", ["immutable", "createOrderedMapFromBlockArray", "generateBlockKey", "insertIntoList", "invariant"], function(a, b, c, d, e, f, g, h, i, j, k) {
b.__markCompiled && b.__markCompiled();
'use strict';
var l = g,
m = l.OrderedMap;
m;
function n(o, p, q) {
k(p.isCollapsed());
var r = p.getStartKey(),
s = p.getStartOffset(),
t = o.getBlockMap(),
u = q.size,
v, w;
if (u === 1) {
var x = t.get(r),
y = q.first(),
z = x.getText(),
aa = x.getCharacterList(),
ba = x.merge({
text: (z.slice(0, s) + y.getText() + z.slice(s)),
characterList: j(aa, y.getCharacterList(), s)
});
t = t.set(r, ba);
v = r;
w = s + y.getText().length;
return o.merge({
blockMap: t.set(r, ba),
selectionBefore: p,
selectionAfter: p.merge({
anchorKey: v,
anchorOffset: w,
focusKey: v,
focusOffset: w,
isBackward: false
})
});
}
var ca = [];
o.getBlockMap().forEach(function(da, ea) {
if (ea !== r) {
ca.push(da);
return;
}
var fa = da.getText(),
ga = da.getCharacterList(),
ha = fa.length,
ia = fa.slice(0, s),
ja = ga.slice(0, s),
ka = q.first(),
la = da.merge({
text: ia + ka.getText(),
characterList: ja.concat(ka.getCharacterList())
});
ca.push(la);
q.slice(1, u - 1).forEach(function(qa) {
ca.push(qa.set('key', i()));
});
var ma = fa.slice(s, ha),
na = ga.slice(s, ha),
oa = q.last();
v = i();
var pa = oa.merge({
key: v,
text: oa.getText() + ma,
characterList: oa.getCharacterList().concat(na)
});
ca.push(pa);
});
w = q.last().getLength();
return o.merge({
blockMap: h(ca),
selectionBefore: p,
selectionAfter: p.merge({
anchorKey: v,
anchorOffset: w,
focusKey: v,
focusOffset: w,
isBackward: false
})
});
}
e.exports = n;
}, null);
__d("insertTextIntoContentState", ["immutable", "insertIntoList", "invariant"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
'use strict';
var j = g,
k = j.Repeat;
function l(m, n, o, p) {
i(n.isCollapsed());
var q = o.length;
if (!q) return m;
var r = m.getBlockMap(),
s = n.getStartKey(),
t = n.getStartOffset(),
u = r.get(s),
v = u.getText(),
w = u.merge({
text: (v.slice(0, t) + o + v.slice(t, u.getLength())),
characterList: h(u.getCharacterList(), k(p, q), t)
}),
x = t + q;
return m.merge({
blockMap: r.set(s, w),
selectionAfter: n.merge({
anchorOffset: x,
focusOffset: x
})
});
}
e.exports = l;
}, null);
__d("removeRangeFromContentState", ["immutable"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
'use strict';
var h = g,
i = h.List;
i;
function j(l, m) {
if (m.isCollapsed()) return l;
var n = l.getBlockMap(),
o = m.getStartKey(),
p = m.getStartOffset(),
q = m.getEndKey(),
r = m.getEndOffset(),
s = n.get(o),
t = n.get(q),
u;
if (s === t) {
u = k(s.getCharacterList(), p, r);
} else u = s.getCharacterList().slice(0, p).concat(t.getCharacterList().slice(r));
var v = s.merge({
text: (s.getText().slice(0, p) + t.getText().slice(r)),
characterList: u
}),
w = n.toSeq().skipUntil(function(x, y) {
return y === o;
}).takeUntil(function(x, y) {
return y === q;
}).concat(g.Map([
[q, null]
])).map(function(x, y) {
return y === o ? v : null;
});
n = n.merge(w).filter(function(x) {
return !!x;
});
return l.merge({
blockMap: n,
selectionBefore: m,
selectionAfter: m.merge({
anchorKey: o,
anchorOffset: p,
focusKey: o,
focusOffset: p,
isBackward: false
})
});
}
function k(l, m, n) {
if (m === 0) {
while (m < n) {
l = l.shift();
m++;
}
} else if (n === l.count()) {
while (n > m) {
l = l.pop();
n--;
}
} else l = l.slice(0, m).concat(l.slice(n));
return l;
}
e.exports = j;
}, null);
__d("setBlockTypeForContentState", ["immutable"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
'use strict';
function h(i, j, k) {
var l = j.getStartKey(),
m = j.getEndKey(),
n = i.getBlockMap(),
o = n.toSeq().skipUntil(function(p, q) {
return q === l;
}).takeUntil(function(p, q) {
return q === m;
}).concat(g.Map([
[m, n.get(m)]
])).map(function(p) {
return p.merge({
type: k,
depth: 0
});
});
return i.merge({
blockMap: n.merge(o),
selectionBefore: j,
selectionAfter: j
});
}
e.exports = h;
}, null);
__d("splitBlockInContentState", ["generateBlockKey", "invariant"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
'use strict';
function i(j, k) {
h(k.isCollapsed());
var l = k.getAnchorKey(),
m = k.getAnchorOffset(),
n = j.getBlockMap(),
o = n.get(l),
p = o.getText(),
q = o.getCharacterList(),
r = o.merge({
text: p.slice(0, m),
characterList: q.slice(0, m)
}),
s = g(),
t = r.merge({
key: s,
text: p.slice(m),
characterList: q.slice(m)
}),
u = n.toSeq().takeUntil(function(x) {
return x === o;
}),
v = n.toSeq().skipUntil(function(x) {
return x === o;
}).rest(),
w = u.concat([
[r.getKey(), r],
[t.getKey(), t]
], v).toOrderedMap();
return j.merge({
blockMap: w,
selectionBefore: k,
selectionAfter: k.merge({
anchorKey: s,
anchorOffset: 0,
focusKey: s,
focusOffset: 0,
isBackward: false
})
});
}
e.exports = i;
}, null);
__d("DocumentModifier", ["CharacterMetadata", "ComposedInlineStyle", "ContentStateInlineStyle", "DocumentRemovalDirection", "immutable", "applyEntityToContentState", "getCharacterRemovalRange", "getContentStateFragment", "insertFragmentIntoContentState", "insertTextIntoContentState", "invariant", "removeEntitiesAtEdges", "removeRangeFromContentState", "setBlockTypeForContentState", "splitBlockInContentState"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) {
b.__markCompiled && b.__markCompiled();
'use strict';
var v = k,
w = v.OrderedMap,
x = h,
y = x.NONE;
w;
var z = {
replaceText: function(aa, ba, ca, da, ea) {
if (da === undefined) da = y;
if (ea === undefined) ea = null;
var fa = r(aa, ba),
ga = s(fa, ba),
ha;
if (da === y && ea === null) {
ha = g.EMPTY;
} else ha = new g({
style: da,
entity: ea
});
return p(ga, ga.getSelectionAfter(), ca, ha);
},
insertText: function(aa, ba, ca, da, ea) {
q(ba.isCollapsed());
if (da === undefined) da = y;
if (ea === undefined) ea = null;
var fa;
if (da === y && ea === null) {
fa = g.EMPTY;
} else fa = new g({
style: da,
entity: ea
});
var ga = r(aa, ba);
return p(ga, ga.getSelectionAfter(), ca, fa);
},
moveText: function(aa, ba, ca) {
var da = n(aa, ba),
ea = z.removeRange(aa, ba, j.BACKWARD);
return z.replaceWithFragment(ea, ca, da);
},
replaceWithFragment: function(aa, ba, ca) {
var da = r(aa, ba),
ea = s(da, ba);
return o(ea, ea.getSelectionAfter(), ca);
},
removeRange: function(aa, ba, ca) {
if (ba.getAnchorKey() === ba.getFocusKey()) {
var da = ba.getAnchorKey(),
ea = ba.getStartOffset(),
fa = ba.getEndOffset(),
ga = aa.getBlockForKey(da),
ha = ga.getEntityAt(ea),
ia = ga.getEntityAt(fa - 1);
if (ha && ha === ia) {
var ja = m(ga, ba, ca);
return s(aa, ja);
}
}
var ka = r(aa, ba);
return s(ka, ba);
},
splitBlock: function(aa, ba) {
var ca = r(aa, ba),
da = s(ca, ba);
return u(da, da.getSelectionAfter());
},
applyInlineStyle: function(aa, ba, ca) {
return i.add(aa, ba, ca);
},
removeInlineStyle: function(aa, ba, ca) {
return i.remove(aa, ba, ca);
},
setBlockType: function(aa, ba, ca) {
return t(aa, ba, ca);
},
applyEntity: function(aa, ba, ca) {
var da = r(aa, ba);
return l(da, ba, ca);
}
};
e.exports = z;
}, null);
__d("isSelectionAtLeafStart", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
'use strict';
function g(h) {
var i = h.getSelection(),
j = i.getAnchorKey(),
k = h.getBlockTree(j),
l = i.getStartOffset(),
m = false;
k.some(function(n) {
if (l === n.get('start')) {
m = true;
return true;
}
if (l < n.get('end')) return n.get('leaves').some(function(o) {
var p = o.get('start');
if (l === p) {
m = true;
return true;
}
if (l < p) return false;
});
});
return m;
}
e.exports = g;
}, null);
__d("TextEditorCompositionHandler", ["ComposedInlineStyle", "DocumentModifier", "EditorChangeType", "EditorState", "Keys", "isSelectionAtLeafStart"], function(a, b, c, d, e, f, g, h, i, j, k, l) {
b.__markCompiled && b.__markCompiled();
var m = g.NONE,
n = 20,
o = {
onBeforeInput: function(p) {
this._textInputData = (this._textInputData || '') + p.data;
},
onCompositionStart: function() {
this._stillComposing = true;
},
onCompositionEnd: function(p) {
this._resolved = false;
this._stillComposing = false;
setTimeout(function() {
if (!this._resolved) o.resolveComposition.call(this);
}.bind(this), n);
},
onKeyDown: function(p) {
if (p.which === k.RIGHT || p.which === k.LEFT) p.preventDefault();
},
onKeyPress: function(p) {
if (p.which === k.RETURN) p.preventDefault();
},
resolveComposition: function() {
if (this._stillComposing) return;
this._resolved = true;
var p = this._textInputData;
this._textInputData = '';
var q = j.set(this.props.editorState, {
inCompositionMode: false
}),
r = !p || l(q);
if (r) this.restoreEditorDOM();
this.exitCurrentMode();
this.removeRenderGuard();
if (p) {
var s = h.replaceText(q.getCurrentContent(), q.getSelection(), p, m, null);
this.update(j.push(q, s, i.INSERT_CHARACTERS));
return;
}
if (r) this.update(j.set(q, {
nativelyRenderedContent: null,
forceSelection: true
}));
}
};
e.exports = o;
}, null);
__d("DocumentOffsetKey", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
var g = '-',
h = {
encode: function(i, j, k) {
return i + g + j + g + k;
},
decode: function(i) {
var j = i.split(g),
k = j[0],
l = j[1],
m = j[2];
return {
blockKey: k,
decoratorKey: parseInt(l, 10),
leafKey: parseInt(m, 10)
};
}
};
e.exports = h;
}, null);
__d("ElementForBlockType", ["ComposedBlockType"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
var h = {
getElement: function(i) {
switch (i) {
case g.HEADER_ONE:
return 'h2';
case g.HEADER_TWO:
return 'h3';
case g.UNORDERED_LIST_ITEM:
case g.ORDERED_LIST_ITEM:
return 'li';
case g.BLOCKQUOTE:
return 'blockquote';
case g.MEDIA:
return 'figure';
default:
return 'div';
}
},
getWrapperElement: function(i) {
switch (i) {
case g.UNORDERED_LIST_ITEM:
case g.ORDERED_LIST_ITEM:
return 'ul';
case g.CODE:
return 'pre';
default:
return null;
}
}
};
e.exports = h;
}, null);
__d("ContentBlock", ["ComposedBlockType", "ComposedInlineStyle", "immutable", "findRangesImmutable"], function(a, b, c, d, e, f, g, h, i, j) {
b.__markCompiled && b.__markCompiled();
'use strict';
var k = g,
l = k.UNSTYLED,
m = h,
n = m.NONE,
o = i,
p = o.List,
q = o.Record,
r = {
key: '',
type: l,
text: '',
characterList: p(),
depth: 0
},
s = q(r);
for (var t in s)
if (s.hasOwnProperty(t)) v[t] = s[t];
var u = s === null ? null : s.prototype;
v.prototype = Object.create(u);
v.prototype.constructor = v;
v.__superConstructor__ = s;
function v() {
if (s !== null) s.apply(this, arguments);
}
v.prototype.getKey = function() {
return this.get('key');
};
v.prototype.getType = function() {
return this.get('type');
};
v.prototype.getText = function() {
return this.get('text');
};
v.prototype.getCharacterList = function() {
return this.get('characterList');
};
v.prototype.getLength = function() {
return this.getText().length;
};
v.prototype.getDepth = function() {
return this.get('depth');
};
v.prototype.getInlineStyleAt = function(y) {
var z = this.getCharacterList().get(y);
return z ? z.getStyle() : n;
};
v.prototype.getEntityAt = function(y) {
var z = this.getCharacterList().get(y);
return z ? z.getEntity() : null;
};
v.prototype.findStyleRanges = function(y, z) {
j(this.getCharacterList(), w, y, z);
};
v.prototype.findEntityRanges = function(y, z) {
j(this.getCharacterList(), x, y, z);
};
function w(y, z) {
return y.getStyle() === z.getStyle();
}
function x(y, z) {
return y.getEntity() === z.getEntity();
}
e.exports = v;
}, null);
__d("DocumentCharacters", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
var g = {
BLOCK_DELIMITER: '\u000D',
SOFT_NEWLINE: '\u000A',
PHOTO: '\ud83d\udcf7',
VIDEO: '\ud83d\udcf9'
};
e.exports = g;
}, null);
__d("TextEditorTextNode.react", ["React", "UserAgent", "getTextContentAccessor"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
'use strict';
var j = h.isBrowser('IE <= 11'),
k = i();
function l(p) {
return j ? p[k] === '\n' : p.tagName === 'BR';
}
var m = j ? g.createElement("span", {
key: "A"
}, '\n') : g.createElement("br", {
key: "A"
}),
n = j ? g.createElement("span", {
key: "B"
}, '\n') : g.createElement("br", {
key: "B"
}),
o = g.createClass({
displayName: "TextEditorTextNode",
shouldComponentUpdate: function(p) {
var q = g.findDOMNode(this),
r = p.children === '';
if (r) return !l(q);
return q[k] !== p.children;
},
componentWillUpdate: function() {
this.forceFlag = !this.forceFlag;
},
render: function() {
if (this.props.children === '') return this.forceFlag ? m : n;
return g.createElement("span", {
key: this.forceFlag ? 'A' : 'B'
}, this.props.children);
}
});
e.exports = o;
}, null);
__d("DocumentStringKey", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
'use strict';
var g = {
stringify: function(h) {
return '_' + String(h);
},
unstringify: function(h) {
return h.slice(1);
}
};
e.exports = g;
}, null);
__d("encodeEntityRanges", ["DocumentStringKey", "UnicodeUtils"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
'use strict';
var i = h,
j = i.strlen;
function k(l, m) {
var n = [];
l.findEntityRanges(function(o) {
return !!o.getEntity();
}, function(o, p) {
var q = l.getText(),
r = l.getEntityAt(o);
n.push({
offset: j(q.slice(0, o)),
length: j(q.slice(o, p)),
key: Number(m[g.stringify(r)])
});
});
return n;
}
e.exports = k;
}, null);
__d("encodeInlineStyleRanges", ["ComposedInlineStyle", "immutable", "UnicodeUtils", "findRangesImmutable", "getObjectValues"], function(a, b, c, d, e, f, g, h, i, j, k) {
b.__markCompiled && b.__markCompiled();
'use strict';
var l = h,
m = l.List,
n = function(s, t) {
return s === t;
},
o = function(s) {
return !!s;
},
p = [];
m;
function q(s, t, u) {
var v = [],
w = t.map(function(x) {
return x & u;
});
j(w, n, o, function(x, y) {
var z = s.getText();
v.push({
offset: i.strlen(z.slice(0, x)),
length: i.strlen(z.slice(x, y)),
style: u
});
});
return v;
}
function r(s) {
var t = s.getCharacterList().map(function(v) {
return v.getStyle();
}),
u = k(g).filter(function(v) {
return !!v;
});
return Array.prototype.concat.apply(p, u.map(function(v) {
return q(s, t, v);
}));
}
e.exports = r;
}, null);
__d("encodeBlocks", ["ComposedBlockType", "DocumentEntity", "DocumentStringKey", "encodeEntityRanges", "encodeInlineStyleRanges", "mapObject"], function(a, b, c, d, e, f, g, h, i, j, k, l) {
b.__markCompiled && b.__markCompiled();
'use strict';
var m = g,
n = m.ORDERED_LIST_ITEM,
o = m.UNORDERED_LIST_ITEM;
function p(r) {
var s = r.getBlockMap(),
t = 0,
u = {},
v = [];
s.forEach(function(y, z) {
y.findEntityRanges(function(aa) {
return aa.getEntity() !== null;
}, function(aa, ba) {
var ca = i.stringify(y.getEntityAt(aa));
if (!u.hasOwnProperty(ca)) u[ca] = '' + (t++);
});
v.push({
key: z,
text: y.getText(),
type: y.getType(),
depth: q(y) ? y.getDepth() : 0,
inlineStyleRanges: k(y),
entityRanges: j(y, u)
});
});
var w = Object.keys(u),
x = {};
w.forEach(function(y, z) {
var aa = h.get(i.unstringify(y)),
ba = null,
ca = null,
da = aa.getData();
if (da) {
ba = da.id || null;
ca = l(da, function(ea) {
return '' + ea;
});
delete ca.id;
}
x[z] = {
id: ba,
type: aa.getType(),
data: ca && Object.keys(ca).length ? ca : undefined
};
});
return {
entityMap: x,
blocks: v
};
}
function q(r) {
var s = r.getType();
return s === n || s === o;
}
e.exports = p;
}, null);
__d("TextEditorBanzai", ["BanzaiScuba", "ReactMount", "containsNode", "encodeBlocks", "invariant"], function(a, b, c, d, e, f, g, h, i, j, k) {
b.__markCompiled && b.__markCompiled();
var l = 3,
m = {
logSetSelectionError: function(s, t) {
var u = p();
u.addNormal('error_type', 'setSelection');
var v = t,
w = v[0],
x = v[1],
y = v[2],
z = v[3],
aa = v[4];
u.addNormal('selection_state', w.serialize());
var ba = n(x);
u.addNormal('node_html', ba);
u.addNormal('selection_params', 'Key: ' + y + ', Start: ' + z + ', End: ' + aa);
u.addNormal('error_text', s.message);
u.post();
},
logGetSelectionError: function(s, t) {
var u = p();
u.addNormal('error_type', 'getSelection');
var v = t,
w = v[0],
x = v[1],
y = w.getCurrentContent(),
z = j(y),
aa = z.blocks;
aa = aa.map(function(ea) {
var fa = ea,
ga = fa.text,
ha = (function(ia, ja) {
var ka = {},
la = Object.prototype.hasOwnProperty;
if (ia == null) throw new TypeError();
for (var ma in ia)
if (la.call(ia, ma) && !la.call(ja, ma)) ka[ma] = ia[ma];
return ka;
})(fa, {
text: 1
});
return Object.assign({}, ha, {
length: ga.length
});
});
var ba = w.getSelection();
u.addNormal('content_state', JSON.stringify(aa));
u.addNormal('selection_state', ba.serialize());
u.addNormal('error_text', s.message);
var ca = n(x);
u.addNormal('node_html', ca);
var da = q(x);
u.addNormal('dom_selection', da);
u.post();
}
};
function n(s) {
if (!s) return '[empty]';
var t = o(s);
if (t.nodeType === l) return t.textContent;
k(t instanceof Element);
return t.innerHTML;
}
function o(s) {
if (s.nodeType === l) {
var t = s.textContent.length;
return document.createTextNode('[text ' + t + ']');
}
var u = s.cloneNode(),
v = s.childNodes;
for (var w = 0; w < v.length; w++) u.appendChild(o(v[w]));
return u;
}
function p() {
return new g('text_editor_error_log', null, {
addBrowserFields: true
});
}
function q(s) {
if (!a.getSelection) return '[not available]';
var t = a.getSelection(),
u = t.anchorNode,
v = t.anchorOffset,
w = t.focusNode,
x = t.focusOffset;
u = r(u, s);
w = r(w, s);
return JSON.stringify({
anchorNode: u,
anchorOffset: v,
focusNode: w,
focusOffset: x
});
}
function r(s, t) {
if (!s) return '[none]';
if (s === window) return '[window]';
if (s === document.documentElement) return '[document]';
if (s === document.body) return '[body]';
if (!i(t, s)) {
var u = h.getID(s);
if (u) return '[outside root: ' + u + ']';
var v = s.id;
return v ? '[outside root: ' + v + ']' : '[outside root]';
}
return n(s);
}
e.exports = m;
}, null);
__d("setDocumentSelection", ["ErrorUtils", "TextEditorBanzai", "containsNode"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
'use strict';
function j(n, o, p, q, r) {
var s = [n, o, p, q, r];
return g.applyWithGuard(k, null, s, function(t) {
return h.logSetSelectionError(t, s);
}, 'TextEditor:setSelection');
}
function k(n, o, p, q, r) {
if (!i(document.documentElement, o)) return;
var s = a.getSelection(),
t = n.getAnchorKey(),
u = n.getAnchorOffset(),
v = n.getFocusKey(),
w = n.getFocusOffset(),
x = n.getIsBackward();
if (!s.extend && x) {
var y = t,
z = u;
t = v;
u = w;
v = y;
w = z;
x = false;
}
var aa = (t === p && q <= u && r >= u),
ba = (v === p && q <= w && r >= w);
if (aa && ba) {
s.removeAllRanges();
m(s, o, u - q);
l(s, o, w - q);
return;
}
if (!x) {
if (aa) {
s.removeAllRanges();
m(s, o, u - q);
}
if (ba) l(s, o, w - q);
} else {
if (ba) {
s.removeAllRanges();
m(s, o, w - q);
}
if (aa) {
var ca = s.focusNode,
da = s.focusOffset;
s.removeAllRanges();
m(s, o, u - q);
l(s, ca, da);
}
}
}
function l(n, o, p) {
if (n.extend) {
n.extend(o, p);
} else {
var q = n.getRangeAt(0);
q.setEnd(o, p);
n.addRange(q.cloneRange());
}
}
function m(n, o, p) {
var q = document.createRange();
q.setStart(o, p);
n.addRange(q);
}
e.exports = j;
}, null);
__d("TextEditorLeaf.react", ["DocumentCharacters", "React", "SelectionState", "TextEditorTextNode.react", "setDocumentSelection"], function(a, b, c, d, e, f, g, h, i, j, k) {
b.__markCompiled && b.__markCompiled();
'use strict';
var l = h,
m = l.PropTypes,
n = g.SOFT_NEWLINE,
o = 3,
p = h.createClass({
displayName: "TextEditorLeaf",
propTypes: {
selection: m.instanceOf(i),
start: m.number.isRequired,
blockKey: m.string.isRequired,
text: m.string.isRequired,
style: m.number,
inlineStyleFn: m.func.isRequired,
isLast: m.bool.isRequired
},
_setSelection: function() {
var q = this.props.selection;
if (q == null || !q.getHasFocus()) return;
var r = this.props.start,
s = r + this.props.text.length,
t = this.props.blockKey;
if (!q.hasEdgeWithin(t, r, s)) return;
var u = h.findDOMNode(this),
v = u.firstChild,
w;
if (v.nodeType === o) {
w = v;
} else if (v.tagName === 'BR') {
w = u;
} else w = v.firstChild;
k(q, w, t, r, s);
},
shouldComponentUpdate: function(q) {
return (h.findDOMNode(this.refs.leaf).textContent !== q.text || q.forceSelection);
},
componentDidUpdate: function() {
this._setSelection();
},
componentDidMount: function() {
this._setSelection();
},
render: function() {
var q = this.props.text;
if (q.endsWith(n) && this.props.isLast) q += n;
var r;
if (this.props.style) r = this.props.inlineStyleFn(this.props.style);
return (h.createElement("span", {
"data-offset-key": this.props.offsetKey,
className: r,
ref: "leaf"
}, h.createElement(j, null, q)));
}
});
e.exports = p;
}, null);
__d("TextEditorBlock.react", ["ContentBlock", "DocumentOffsetKey", "ElementForBlockType", "React", "Scroll", "SelectionState", "Style", "TextEditorLeaf.react", "UnicodeBidiDirection", "cx", "getElementPosition", "getScrollPosition", "getViewportDimensions", "joinClasses"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) {
b.__markCompiled && b.__markCompiled();
var u = j,
v = u.PropTypes,
w = o.LTR,
x = o.RTL,
y = 10,
z = j.createClass({
displayName: "TextEditorBlock",
propTypes: {
block: v.instanceOf(g).isRequired,
tree: v.object.isRequired,
selection: v.instanceOf(l).isRequired,
decorator: v.object,
forceSelection: v.bool.isRequired,
direction: v.string.isRequired,
blockProps: v.object,
startIndent: v.bool,
blockStyleFn: v.func.isRequired,
inlineStyleFn: v.func.isRequired
},
shouldComponentUpdate: function(ba) {
return (this.props.block !== ba.block || this.props.tree !== ba.tree || this.props.direction !== ba.direction || (aa(ba.selection, ba.block.getKey()) && ba.forceSelection));
},
componentDidMount: function() {
var ba = this.props.selection,
ca = ba.getEndKey();
if (!ba.getHasFocus() || ca !== this.props.block.getKey()) return;
var da = j.findDOMNode(this),
ea = m.getScrollParent(da),
fa = r(ea),
ga;
if (ea === window) {
var ha = q(da),
ia = ha.y + ha.height,
ja = s().height;
ga = ia - ja;
if (ga > 0) window.scrollTo(fa.x, fa.y + ga + y);
} else {
var ka = da.offsetHeight + da.offsetTop,
la = ea.offsetHeight + fa.y;
ga = ka - la;
if (ga > 0) k.setTop(ea, k.getTop(ea) + ga + y);
}
},
_renderChildren: function() {
var ba = this.props.block,
ca = ba.getKey(),
da = ba.getText(),
ea = this.props.tree.size - 1,
fa = aa(this.props.selection, ca);
return this.props.tree.map(function(ga, ha) {
var ia = ga.get('leaves'),
ja = ia.size - 1,
ka = ia.map(function(pa, qa) {
var ra = h.encode(ca, ha, qa),
sa = pa.get('start'),
ta = pa.get('end');
return (j.createElement(n, {
key: ra,
offsetKey: ra,
blockKey: ca,
start: sa,
selection: fa ? this.props.selection : null,
forceSelection: this.props.forceSelection,
text: da.slice(sa, ta),
style: ba.getInlineStyleAt(sa),
inlineStyleFn: this.props.inlineStyleFn,
isLast: ha === ea && qa === ja
}));
}.bind(this)).toArray(),
la = ga.get('decoratorKey');
if (la == null) return ka;
var ma = this.props.decorator.getComponentForKey(la);
if (!ma) return ka;
var na = this.props.decorator.getPropsForKey(la),
oa = h.encode(ca, ha, 0);
return (j.createElement(ma, j.__spread({}, na, {
key: oa,
entityKey: ba.getEntityAt(ga.get('start')),
offsetKey: oa
}), ka));
}.bind(this)).toArray();
},
render: function() {
var ba = this.props.block,
ca = ba.getKey(),
da = ba.getDepth(),
ea = i.getElement(ba.getType()),
fa = t(this.props.blockStyleFn(ba.getType()), (("_209g") + (this.props.direction === w ? ' ' + "_2vxa" : '') + (this.props.direction === x ? ' ' + "_2vxb" : '')));
if (ea === 'li') {
var ga = this.props.startIndent;
fa = t(fa, ((ga && da === 0 ? "_2yj9" : '') + (ga && da === 1 ? ' ' + "_2yja" : '') + (ga && da === 2 ? ' ' + "_2yjb" : '') + (ga && da === 3 ? ' ' + "_2yje" : '') + (ga && da === 4 ? ' ' + "_2yjf" : '') + (da === 0 ? ' ' + "_2yjg" : '') + (da === 1 ? ' ' + "_2yjh" : '') + (da === 2 ? ' ' + "_2yji" : '') + (da === 3 ? ' ' + "_2yjj" : '') + (da === 4 ? ' ' + "_2yjn" : '')));
}
var ha = Object.assign({
'data-block': true,
'data-offset-key': h.encode(ca, 0, 0),
className: fa
}, this.props.blockProps);
return (j.createElement(ea, j.__spread({}, ha), this._renderChildren()));
}
});
function aa(ba, ca) {
return (ba.getAnchorKey() === ca || ba.getFocusKey() === ca);
}
e.exports = z;
}, null);
__d("TextEditorContents.react", ["DocumentOffsetKey", "EditorState", "ElementForBlockType", "React", "TextEditorBlock.react", "cx"], function(a, b, c, d, e, f, g, h, i, j, k, l) {
b.__markCompiled && b.__markCompiled();
'use strict';
var m = j,
n = m.PropTypes,
o = j.createClass({
displayName: "TextEditorContents",
propTypes: {
blockRendererFn: n.func,
blockStyleFn: n.func.isRequired,
editorState: n.instanceOf(h).isRequired,
inlineStyleFn: n.func.isRequired
},
shouldComponentUpdate: function(q) {
var r = this.props.editorState,
s = q.editorState,
t = r.getDirectionMap(),
u = s.getDirectionMap();
if (t !== u) return true;
var v = r.getSelection().getHasFocus(),
w = s.getSelection().getHasFocus();
if (v !== w) return true;
var x = s.getNativelyRenderedContent(),
y = r.isInCompositionMode(),
z = s.isInCompositionMode();
if (r === s || (x !== null && s.getCurrentContent() === x) || (y && z)) return false;
var aa = r.getCurrentContent(),
ba = s.getCurrentContent(),
ca = r.getDecorator(),
da = s.getDecorator();
return (y !== z || aa !== ba || ca !== da || s.mustForceSelection());
},
render: function() {
var q = this.props.editorState,
r = q.getCurrentContent(),
s = q.getSelection(),
t = q.mustForceSelection(),
u = q.getDirectionMap(),
v = r.getBlocksAsArray(),
w = [],
x = null,
y = null,
z = null,
aa, ba, ca, da, ea, fa, ga, ha;
for (var ia = 0; ia < v.length; ia++) {
ca = v[ia];
da = ca.getKey();
ea = ca.getText();
fa = ca.getType();
var ja = this.props.blockRendererFn(ca) || p,
ka = ja.component,
la = ja.props;
aa = ka;
ga = j.createElement(aa, {
key: da,
tree: q.getBlockTree(da),
decorator: q.getDecorator(),
block: ca,
selection: s,
forceSelection: t,
direction: u.get(da),
blockProps: la,
startIndent: z === null || ca.getDepth() > z,
blockStyleFn: this.props.blockStyleFn,
inlineStyleFn: this.props.inlineStyleFn
});
ha = i.getWrapperElement(fa);
if (ha) {
if (y !== ha) {
ba = [];
x = j.createElement(ha, {
className: "_4noe",
key: da + '-wrap',
"data-offset-key": g.encode(da, 0, 0)
}, ba);
y = ha;
w.push(x);
}
z = ca.getDepth();
ba.push(ga);
} else {
ba = null;
x = null;
y = null;
z = null;
w.push(ga);
}
}
return j.createElement("div", {
"data-contents": "true"
}, w);
}
}),
p = {
component: k,
props: null
};
e.exports = o;
}, null);
__d("DocumentRemovableWord", ["TokenizeUtil"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
'use strict';
var h = g.getPunctuation();
h = h.replace("\'", "").slice(1, -1);
var i = '\\s' + h,
j = '^(' + '[' + i + ']*' + '[^' + i + ']+' + '|[' + i + ']+' + ')',
k = new RegExp(j),
l = '(' + '[^' + i + ']+' + '[' + i + ']*' + '|[' + i + ']+' + ')$',
m = new RegExp(l);
function n(p, q) {
var r = q ? m.exec(p) : k.exec(p);
return r ? r[0] : null;
}
var o = {
getBackward: function(p) {
return n(p, true);
},
getForward: function(p) {
return n(p, false);
}
};
e.exports = o;
}, null);
__d("TextEditorModes", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
var g = {
EDIT: 0,
COMPOSITE: 1,
DRAG: 2,
RENDER: 3,
CUT: 4
};
e.exports = g;
}, null);
__d("TextEditorPasteHandler", ["CharacterMetadata", "ComposedBlockType", "ComposedEntityMutability", "ComposedLinkEntityProperties", "ComposedEntityType", "ComposedInlineStyle", "ContentBlock", "DocumentCharacters", "DocumentEntity", "immutable", "URI", "arrayContains", "fillArray", "generateBlockKey", "getSafeBodyFromHTML"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) {
b.__markCompiled && b.__markCompiled();
var v = h,
w = v.HEADER_ONE,
x = v.HEADER_TWO,
y = v.ORDERED_LIST_ITEM,
z = v.UNORDERED_LIST_ITEM,
aa = v.BLOCKQUOTE,
ba = v.UNSTYLED,
ca = l,
da = ca.BOLD,
ea = ca.ITALIC,
fa = ca.UNDERLINE,
ga = ca.CODE,
ha = ca.STRIKETHROUGH,
ia = ca.NONE,
ja = g,
ka = ja.EMPTY,
la = i,
ma = la.MUTABLE,
na = j,
oa = na.URL,
pa = k,
qa = pa.LINK,
ra = n,
sa = ra.BLOCK_DELIMITER,
ta = ra.SOFT_NEWLINE,
ua = p,
va = ua.List,
wa = ua.Repeat,
xa = '&nbsp;',
ya = ' ',
za = 4,
ab = new RegExp(sa, 'g'),
bb = new RegExp(ta, 'g'),
cb = new RegExp(xa, 'g'),
db = ['p', 'h1', 'h2', 'h3', 'li', 'blockquote', 'pre'],
eb = {
b: da,
code: ga,
del: ha,
em: ea,
i: ea,
s: ha,
strike: ha,
strong: da,
u: fa
};
function fb() {
return {
text: '',
inlines: [],
entities: [],
blocks: []
};
}
function gb(rb) {
var sb = new Array(1);
if (rb) sb[0] = rb;
return {
text: ya,
inlines: [ia],
entities: sb,
blocks: []
};
}
function hb() {
return {
text: ta,
inlines: [ia],
entities: new Array(1),
blocks: []
};
}
function ib(rb, sb) {
return {
text: sa,
inlines: [ia],
entities: new Array(1),
blocks: [{
type: rb,
depth: Math.max(0, Math.min(za, sb))
}]
};
}
function jb(rb, sb) {
switch (rb) {
case 'h1':
return w;
case 'h2':
return x;
case 'li':
if (sb === 'ol') return y;
return z;
case 'blockquote':
return aa;
case 'pre':
return h.CODE;
default:
return ba;
}
}
function kb(rb, sb, tb) {
var ub = eb[rb];
if (ub) {
tb |= ub;
} else if (sb.style) {
tb |= sb.style.fontWeight === 'bold' ? da : 0;
tb |= sb.style.fontStyle === 'italic' ? ea : 0;
tb |= sb.style.textDecoration === 'underline' ? fa : 0;
tb |= (sb.style.textDecoration === 'line-through' ? ha : 0);
}
return tb;
}
function lb(rb, sb) {
if (rb.text.slice(-1) === sa && sb.text.slice(0, 1) === sa) {
rb.text = rb.text.slice(0, -1);
rb.inlines.pop();
rb.entities.pop();
rb.blocks.pop();
}
if (rb.text.slice(-1) === sa && (sb.text === ya || sb.text === ta)) return rb;
return {
text: rb.text + sb.text,
inlines: rb.inlines.concat(sb.inlines),
entities: rb.entities.concat(sb.entities),
blocks: rb.blocks.concat(sb.blocks)
};
}
function mb(rb) {
return db.some(function(sb) {
return rb.indexOf('<' + sb) !== -1;
});
}
function nb(rb) {
var sb = new q(rb),
tb = sb.getProtocol();
return (tb === 'http' || tb === 'https');
}
function ob(rb, sb, tb, ub, vb, wb, xb) {
var yb = rb.nodeName.toLowerCase(),
zb = false,
ac = ba;
if (yb === '#text') {
var bc = rb.textContent;
if (bc.trim() === '' && ub !== 'pre') return gb(xb);
if (ub !== 'pre') bc = bc.replace(bb, ya);
return {
text: bc,
inlines: s(bc.length, sb),
entities: s(bc.length, xb),
blocks: []
};
}
if (yb === 'br') return hb();
var cc = fb(),
dc;
sb = kb(yb, rb, sb);
if (yb === 'ul' || yb === 'ol') {
if (tb) wb += 1;
tb = yb;
}
if (!ub && r(vb, yb)) {
cc = ib(jb(yb, tb), wb);
ub = yb;
zb = true;
} else if (tb && ub === 'li' && yb === 'li') {
cc = ib(jb(yb, tb), wb);
ub = yb;
zb = true;
ac = tb === 'ul' ? z : y;
}
rb = rb.firstChild;
yb = rb && rb.nodeName.toLowerCase();
var ec, fc, gc;
while (rb) {
if (yb === 'a' && rb.href && nb(rb.href)) {
fc = new q(rb.href).toString();
gc = {};
gc[oa] = fc;
ec = o.create(qa, ma, gc);
} else ec = undefined;
dc = ob(rb, sb, tb, ub, vb, wb, ec || xb);
cc = lb(cc, dc);
rb = rb.nextSibling;
if (rb && vb.indexOf(yb) >= 0 && ub) cc = lb(cc, hb());
yb = rb && rb.nodeName.toLowerCase();
}
if (zb) cc = lb(cc, ib(ac, wb));
return cc;
}
function pb(rb) {
rb = rb.trim().replace(ab, '').replace(cb, ya);
var sb = u(rb);
if (!sb) return null;
var tb = mb(rb) ? db : ['div'],
ub = ob(sb, ia, 'ul', null, tb, -1);
if (ub.text.indexOf(sa) === 0) ub = {
text: ub.text.slice(1),
inlines: ub.inlines.slice(1),
entities: ub.entities.slice(1),
blocks: ub.blocks
};
if (ub.text.slice(-1) === sa) {
ub.text = ub.text.slice(0, -1);
ub.inlines = ub.inlines.slice(0, -1);
ub.entities = ub.entities.slice(0, -1);
ub.blocks.pop();
}
if (ub.blocks.length === 0) ub.blocks.push({
type: ba,
depth: 0
});
if (ub.text.split(sa).length === ub.blocks.length + 1) ub.blocks.unshift({
type: ba,
depth: 0
});
return ub;
}
var qb = {
processHTML: function(rb) {
var sb = pb(rb);
if (!sb) return null;
var tb = 0;
return sb.text.split(sa).map(function(ub, vb) {
var wb = tb + ub.length,
xb = sb.inlines.slice(tb, wb),
yb = sb.entities.slice(tb, wb),
zb = va(xb.map(function(ac, bc) {
var cc = {
style: ac
};
if (yb[bc]) cc.entity = yb[bc];
return new g(cc);
}));
tb = wb + 1;
return new m({
key: t(),
type: sb.blocks[vb].type,
depth: sb.blocks[vb].depth,
text: ub,
characterList: zb
});
});
},
processText: function(rb) {
return rb.map(function(sb) {
return new m({
key: t(),
type: ba,
text: sb,
characterList: va(wa(ka, sb.length))
});
});
}
};
e.exports = qb;
}, null);
__d("getSelectionOffsetKeyForNode", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
'use strict';
function g(h) {
return h instanceof Element ? h.getAttribute('data-offset-key') : null;
}
e.exports = g;
}, null);
__d("findAncestorOffsetKey", ["getSelectionOffsetKeyForNode"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
'use strict';
function h(i) {
while (i && i !== document.documentElement) {
var j = g(i);
if (j != null) return j;
i = i.parentNode;
}
return null;
}
e.exports = h;
}, null);
__d("getUpdatedSelectionState", ["DocumentOffsetKey"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
function h(i, j, k, l, m) {
var n = i.getSelection(),
o = g.decode(j),
p = o.blockKey,
q = i.getBlockTree(p).getIn([o.decoratorKey, 'leaves', o.leafKey]),
r = g.decode(l),
s = r.blockKey,
t = i.getBlockTree(s).getIn([r.decoratorKey, 'leaves', r.leafKey]),
u = q.get('start'),
v = t.get('start'),
w = q ? u + k : null,
x = t ? v + m : null,
y = (n.getAnchorKey() === p && n.getAnchorOffset() === w && n.getFocusKey() === s && n.getFocusOffset() === x);
if (y) return n;
var z = false;
if (p === s) {
var aa = q.get('end'),
ba = t.get('end');
if (v === u && ba === aa) {
z = m < k;
} else z = v < u;
} else {
var ca = i.getCurrentContent().getBlockMap().keySeq().skipUntil(function(da) {
return da === p || da === s;
}).first();
z = ca === s;
}
return n.merge({
anchorKey: p,
anchorOffset: w,
focusKey: s,
focusOffset: x,
isBackward: z
});
}
e.exports = h;
}, null);
__d("getDocumentSelection", ["DocumentCharacters", "ErrorUtils", "TextEditorBanzai", "findAncestorOffsetKey", "getSelectionOffsetKeyForNode", "getUpdatedSelectionState", "invariant", "nullthrows"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n) {
b.__markCompiled && b.__markCompiled();
'use strict';
var o = g,
p = o.SOFT_NEWLINE;
function q(w, x) {
var y = [w, x];
return h.applyWithGuard(r, null, y, function(z) {
return i.logGetSelectionError(z, y);
}, 'TextEditor:getSelection');
}
function r(w, x) {
var y = a.getSelection();
if (y.rangeCount === 0) return {
selectionState: w.getSelection().set('hasFocus', false),
needsRecovery: false
};
var z = y.anchorNode,
aa = y.focusNode,
ba = y.anchorOffset,
ca = y.focusOffset,
da = z.nodeType === Node.TEXT_NODE,
ea = aa.nodeType === Node.TEXT_NODE;
if (da && ea) return {
selectionState: l(w, n(j(z)), ba, n(j(aa)), ca),
needsRecovery: false
};
var fa = null,
ga = null;
if (da) {
fa = {
key: n(j(z)),
offset: ba
};
ga = u(x, aa, ca);
} else if (ea) {
ga = {
key: n(j(aa)),
offset: ca
};
fa = u(x, z, ba);
} else {
fa = u(x, z, ba);
ga = u(x, aa, ca);
}
return {
selectionState: l(w, fa.key, fa.offset, ga.key, ga.offset),
needsRecovery: true
};
}
function s(w) {
while (w.firstChild && k(w.firstChild)) w = w.firstChild;
return w;
}
function t(w) {
while (w.lastChild && k(w.lastChild)) w = w.lastChild;
return w;
}
function u(w, x, y) {
var z = j(x);
m(z != null || w === x || w.firstChild === x);
if (w === x) {
x = x.firstChild;
m(x instanceof Element && x.getAttribute('data-contents') === 'true');
if (y > 0) y = x.childNodes.length;
}
if (y === 0) return {
key: z || k(s(x)),
offset: 0
};
var aa = x.childNodes[y - 1],
ba, ca;
if (!k(aa)) {
ba = z;
ca = v(aa);
} else {
var da = t(aa);
ba = k(da);
ca = v(da);
}
return {
key: ba,
offset: ca
};
}
function v(w) {
var x = w.textContent;
return x === p ? 0 : x.length;
}
e.exports = q;
}, null);
__d("getEntityKeyForSelection", ["ComposedEntityMutability", "DocumentEntity"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
var i = g,
j = i.MUTABLE;
function k(m, n) {
var o;
if (n.isCollapsed()) {
var p = n.getAnchorKey(),
q = n.getAnchorOffset();
if (q > 0) {
o = m.getBlockForKey(p).getEntityAt(q - 1);
return l(o);
}
return null;
}
var r = n.getStartKey(),
s = n.getStartOffset(),
t = m.getBlockForKey(r);
o = s === t.getLength() ? null : t.getEntityAt(s);
return l(o);
}
function l(m) {
if (m) {
var n = h.get(m);
return n.getMutability() === j ? m : null;
}
return null;
}
e.exports = k;
}, null);
__d("getTextContentFromFiles", ["DocumentCharacters"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
var h = g.BLOCK_DELIMITER,
i = /\.textClipping$/,
j = {
'text/plain': true,
'text/html': true,
'text/rtf': true
};
function k(m, n) {
var o = 0,
p = [];
m.forEach(function(q) {
l(q, function(r) {
o++;
r && p.push(r);
if (o == m.length) n(p.join(h));
});
});
}
function l(m, n) {
if (!a.FileReader || (m.type && !(m.type in j))) {
n('');
return;
}
if (m.type === '' && i.test(m.name)) {
n(m.name.replace(i, ''));
return;
}
var o = new FileReader();
o.onload = function() {
n(o.result);
};
o.onerror = function() {
n('');
};
o.readAsText(m);
}
e.exports = k;
}, null);
__d("TextEditorEditHandler", ["BlockTree", "DataTransfer", "DocumentCharacters", "DocumentCommands", "DocumentModifier", "DocumentOffsetKey", "DocumentRemovableWord", "DocumentRemovalDirection", "EditorChangeType", "EditorState", "Keys", "React", "TextEditorModes", "TextEditorPasteHandler", "UnicodeUtils", "UserAgent", "areEqual", "createOrderedMapFromBlockArray", "findAncestorOffsetKey", "getActiveElement", "getContentStateFragment", "getDocumentSelection", "getEntityKeyForSelection", "getTextContentFromFiles", "isSelectionAtLeafStart"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, aa, ba, ca, da, ea) {
b.__markCompiled && b.__markCompiled();
'use strict';
var fa = i.SOFT_NEWLINE,
ga = v.isEngine('WebKit'),
ha = null,
ia = {
onFocus: function(jb) {
var kb = this.props.editorState,
lb = kb.getSelection();
if (lb.getHasFocus()) return;
var mb = lb.set('hasFocus', true);
this.props.onFocus && this.props.onFocus(jb);
this.update(p.acceptSelection(kb, mb));
},
onBlur: function(jb) {
if (ga && z() === document.body) a.getSelection().removeAllRanges();
var kb = this.props.editorState,
lb = kb.getSelection();
if (!lb.getHasFocus()) return;
var mb = lb.set('hasFocus', false);
this.props.onBlur && this.props.onBlur(jb);
this.update(p.acceptSelection(kb, mb));
},
onBeforeInput: function(jb) {
var kb = jb.data;
if (!kb) return;
if (this.props.handleBeforeInput && this.props.handleBeforeInput(kb)) {
jb.preventDefault();
return;
}
var lb = this.props.editorState,
mb = lb.getSelection();
if (!mb.isCollapsed()) {
jb.preventDefault();
this.update(ma(lb, kb, lb.getCurrentInlineStyle(), ca(lb.getCurrentContent(), lb.getSelection())));
return;
}
var nb = !ea(lb),
ob = ma(lb, kb, lb.getCurrentInlineStyle(), ca(lb.getCurrentContent(), lb.getSelection()));
if (!nb) {
jb.preventDefault();
this.update(ob);
return;
}
var pb = mb.getAnchorKey(),
qb = lb.getBlockTree(pb),
rb = g.getFingerprint(qb),
sb = g.getFingerprint(ob.getBlockTree(pb));
if (ib(kb) || rb !== sb || (ob.getDirectionMap().get(pb) !== lb.getDirectionMap().get(pb))) {
jb.preventDefault();
} else ob = p.set(ob, {
nativelyRenderedContent: ob.getCurrentContent()
});
this.update(ob);
},
onSelect: function(jb) {
if (this._blockSelectEvents) return;
var kb = this.props.editorState,
lb = ba(kb, r.findDOMNode(this.refs.editorContainer).firstChild),
mb = lb.selectionState;
if (mb !== kb.getSelection()) {
if (!!lb.needsRecovery) {
kb = p.forceSelection(kb, mb);
} else kb = p.acceptSelection(kb, mb);
this.update(kb);
}
},
onKeyDown: function(jb) {
var kb = jb.which,
lb = this.props.editorState;
switch (kb) {
case q.RETURN:
jb.preventDefault();
if (!this.props.handleReturn || !this.props.handleReturn(jb)) this.update(xa(lb));
return;
case q.ESC:
jb.preventDefault();
this.props.onEscape && this.props.onEscape(jb);
return;
case q.TAB:
this.props.onTab && this.props.onTab(jb);
return;
case q.UP:
this.props.onUpArrow && this.props.onUpArrow(jb);
return;
case q.DOWN:
this.props.onDownArrow && this.props.onDownArrow(jb);
return;
}
var mb = this.props.keyBindingFn(jb);
if (!mb) return;
jb.preventDefault();
if (this.props.handleKeyCommand && this.props.handleKeyCommand(mb)) return;
if (mb === j.UNDO) {
ka(lb, this.update);
return;
}
var nb = ja(mb, lb);
if (nb !== lb) this.update(nb);
},
onCharacterData: function(jb) {
var kb = y(jb),
lb = this.props.editorState,
mb = lb.getSelection(),
nb = lb.getCurrentContent(),
ob = l.decode(kb),
pb = ob.blockKey,
qb = lb.getBlockTree(pb),
rb = qb.getIn([ob.decoratorKey, 'leaves', ob.leafKey]),
sb = nb.getBlockForKey(pb);
if (sb.getText().slice(rb.start, rb.end) === jb.textContent) return;
var tb = lb.getSelection().merge({
anchorOffset: rb.start,
focusOffset: rb.end,
isBackward: false
}),
ub = k.replaceText(nb, tb, jb.textContent, sb.getInlineStyleAt(rb.start), null),
vb = ba(this.props.editorState, r.findDOMNode(this.refs.editorContainer).firstChild),
wb = ub.merge({
selectionBefore: mb,
selectionAfter: vb.selectionState
});
this.update(p.push(lb, wb, o.INSERT_FRAGMENT));
},
onDragStart: function(jb) {
this._internalDrag = true;
this.setMode(s.DRAG);
},
onDragOver: function(jb) {
this._internalDrag = false;
this.setMode(s.DRAG);
jb.preventDefault();
},
onCompositionStart: function(jb) {
this.setRenderGuard();
this.setMode(s.COMPOSITE);
this.update(p.set(this.props.editorState, {
inCompositionMode: true
}));
},
onCut: function(jb) {
var kb = this.props.editorState,
lb = kb.getSelection();
if (lb.isCollapsed()) {
jb.preventDefault();
return;
}
this.setRenderGuard();
eb(kb, function(mb) {
this._clipboard = mb;
this.setMode(s.CUT);
setTimeout(function() {
this.restoreEditorDOM();
this.removeRenderGuard();
this.exitCurrentMode();
this.update(db(kb));
}.bind(this), 0);
}.bind(this));
},
onCopy: function() {
eb(this.props.editorState, function(jb) {
this._clipboard = jb;
}.bind(this));
},
onPaste: function(jb) {
jb.preventDefault();
var kb = new h(jb.clipboardData);
if (!kb.isRichText()) {
var lb = kb.getFiles(),
mb = kb.getText();
if (lb.length > 0) {
if (this.props.handlePastedFiles && this.props.handlePastedFiles(lb)) return;
da(lb, function(xb) {
xb = xb || mb;
if (!xb) return;
var yb = xb.split(fa),
zb = t.processText(yb),
ac = this.props.editorState,
bc = x(zb),
cc = k.replaceWithFragment(ac.getCurrentContent(), ac.getSelection(), bc);
this.update(p.push(ac, cc, o.INSERT_FRAGMENT));
}.bind(this));
return;
}
}
var nb, ob = kb.getText();
this.props.onPasteRawText && this.props.onPasteRawText(ob);
if (ob) nb = ob.split(fa);
if (!this.props.stripPastedStyles) {
if (this._clipboard) {
var pb = nb.filter(bb),
qb = this._clipboard.toSeq().map(function(xb) {
return xb.getText();
}).filter(bb).toArray(),
rb = w(pb, qb);
if (rb) {
this.update(cb(this.props.editorState, this._clipboard));
return;
}
}
var sb = kb.getHTML();
if (sb) {
var tb = t.processHTML(sb);
if (tb) {
var ub = x(tb);
this.update(cb(this.props.editorState, ub));
return;
}
}
this._clipboard = null;
}
if (nb) {
var vb = t.processText(nb),
wb = x(vb);
this.update(cb(this.props.editorState, wb));
}
}
};
function ja(jb, kb) {
switch (jb) {
case j.UNDO:
return ka(kb);
case j.REDO:
return la(kb);
case j.DELETE:
return oa(kb);
case j.DELETE_WORD:
return pa(kb);
case j.BACKSPACE:
return sa(kb);
case j.BACKSPACE_WORD:
return va(kb);
case j.BACKSPACE_TO_END_OF_BLOCK:
return wa(kb);
case j.INSERT_BLOCK_DELIMITER:
return xa(kb);
case j.TRANSPOSE_CHARACTERS:
return ya(kb);
case j.MOVE_SELECTION_TO_START_OF_BLOCK:
return za(kb);
case j.MOVE_SELECTION_TO_END_OF_BLOCK:
return ab(kb);
case j.SECONDARY_CUT:
return qa(kb);
case j.SECONDARY_PASTE:
return ra(kb);
default:
return kb;
}
}
function ka(jb, kb) {
var lb = p.undo(jb);
if (!jb.getNativelyRenderedContent()) {
kb(lb);
return;
}
kb(p.set(jb, {
nativelyRenderedContent: null
}));
setTimeout(function() {
kb(lb);
});
}
function la(jb) {
return p.redo(jb);
}
function ma(jb, kb, lb, mb) {
var nb = k.replaceText(jb.getCurrentContent(), jb.getSelection(), kb, lb, mb || null);
return p.push(jb, nb, o.INSERT_CHARACTERS);
}
function na(jb, kb, lb) {
var mb = jb.getSelection(),
nb = jb.getCurrentContent(),
ob = mb;
if (mb.isCollapsed()) {
if (lb === n.FORWARD) {
if (jb.isAtDocumentEnd()) return nb;
} else if (jb.isAtDocumentStart()) return nb;
ob = kb(jb);
if (ob === mb) return nb;
}
return k.removeRange(nb, ob, lb);
}
function oa(jb) {
var kb = na(jb, function(mb) {
var nb = mb.getSelection(),
ob = mb.getCurrentContent(),
pb = nb.getAnchorKey(),
qb = nb.getAnchorOffset(),
rb = ob.getBlockForKey(pb).getText()[qb];
return ua(mb, rb ? u.getUTF16Length(rb, 0) : 1);
}, n.FORWARD);
if (kb === jb.getCurrentContent()) return jb;
kb = kb.set('selectionBefore', jb.getSelection());
var lb = jb.getSelection().isCollapsed() ? o.DELETE_CHARACTER : o.REMOVE_RANGE;
return p.push(jb, kb, lb);
}
function pa(jb) {
var kb = na(jb, function(lb) {
var mb = lb.getSelection(),
nb = mb.getStartOffset(),
ob = mb.getStartKey(),
pb = lb.getCurrentContent(),
qb = pb.getBlockForKey(ob).getText().slice(nb),
rb = m.getForward(qb) || '';
return ua(lb, rb.length || 1);
}, n.FORWARD);
if (kb === jb.getCurrentContent()) return jb;
return p.push(jb, kb, o.REMOVE_RANGE);
}
function qa(jb) {
var kb = jb.getCurrentContent(),
lb = jb.getSelection(),
mb;
if (lb.isCollapsed()) {
var nb = lb.getAnchorKey(),
ob = kb.getBlockForKey(nb).getLength();
if (ob === lb.getAnchorOffset()) return jb;
mb = lb.set('focusOffset', ob);
} else mb = lb;
ha = aa(kb, mb);
var pb = k.removeRange(kb, mb, n.FORWARD);
if (pb === kb) return jb;
return p.push(jb, pb, o.REMOVE_RANGE);
}
function ra(jb) {
return (ha ? cb(jb, ha) : jb);
}
function sa(jb) {
var kb = na(jb, function(mb) {
var nb = mb.getSelection(),
ob = mb.getCurrentContent(),
pb = nb.getAnchorKey(),
qb = nb.getAnchorOffset(),
rb = ob.getBlockForKey(pb).getText()[qb - 1];
return ta(mb, rb ? u.getUTF16Length(rb, 0) : 1);
}, n.BACKWARD);
if (kb === jb.getCurrentContent()) return jb;
kb = kb.set('selectionBefore', jb.getSelection());
var lb = jb.getSelection().isCollapsed() ? o.BACKSPACE_CHARACTER : o.REMOVE_RANGE;
return p.push(jb, kb, lb);
}
function ta(jb, kb) {
var lb = jb.getSelection(),
mb = jb.getCurrentContent(),
nb = lb.getStartKey(),
ob = lb.getStartOffset(),
pb = nb,
qb;
if (kb > ob) {
var rb = mb.getKeyBefore(nb);
pb = rb;
var sb = mb.getBlockForKey(rb);
qb = sb.getText().length;
} else qb = ob - kb;
return lb.merge({
focusKey: pb,
focusOffset: qb,
isBackward: true
});
}
function ua(jb, kb) {
var lb = jb.getSelection(),
mb = lb.getStartKey(),
nb = lb.getStartOffset(),
ob = jb.getCurrentContent(),
pb = mb,
qb, rb = ob.getBlockForKey(mb);
if (kb > (rb.getText().length - nb)) {
pb = ob.getKeyAfter(mb);
qb = 0;
} else qb = nb + kb;
return lb.merge({
focusKey: pb,
focusOffset: qb
});
}
function va(jb) {
var kb = na(jb, function(lb) {
var mb = lb.getSelection(),
nb = mb.getStartOffset();
if (nb === 0) return ta(lb, 1);
var ob = mb.getStartKey(),
pb = lb.getCurrentContent(),
qb = pb.getBlockForKey(ob).getText().slice(0, nb),
rb = m.getBackward(qb) || '';
return ta(lb, rb.length || 1);
}, n.BACKWARD);
if (kb === jb.getCurrentContent()) return jb;
return p.push(jb, kb, o.REMOVE_RANGE);
}
function wa(jb) {
var kb = na(jb, function(lb) {
var mb = lb.getSelection();
if (mb.getStartOffset() === 0) return ta(lb, 1);
return mb.merge({
focusOffset: 0,
isBackward: true
});
}, n.BACKWARD);
if (kb === jb.getCurrentContent()) return jb;
return p.push(jb, kb, o.REMOVE_RANGE);
}
function xa(jb) {
var kb = k.splitBlock(jb.getCurrentContent(), jb.getSelection());
return p.push(jb, kb, o.SPLIT_BLOCK);
}
function ya(jb) {
var kb = jb.getSelection();
if (!kb.isCollapsed()) return jb;
var lb = kb.getAnchorOffset();
if (lb === 0) return jb;
var mb = kb.getAnchorKey(),
nb = jb.getCurrentContent(),
ob = nb.getBlockForKey(mb),
pb = ob.getLength();
if (pb <= 1) return jb;
var qb, rb;
if (lb === pb) {
qb = kb.set('anchorOffset', lb - 1);
rb = kb;
} else {
qb = kb.set('focusOffset', lb + 1);
rb = qb.set('anchorOffset', lb + 1);
}
var sb = aa(nb, qb),
tb = k.removeRange(nb, qb, n.BACKWARD),
ub = tb.getSelectionAfter(),
vb = ub.getAnchorOffset() - 1,
wb = ub.merge({
anchorOffset: vb,
focusOffset: vb
}),
xb = k.replaceWithFragment(tb, wb, sb),
yb = p.push(jb, xb, o.INSERT_FRAGMENT);
return p.acceptSelection(yb, rb);
}
function za(jb) {
var kb = jb.getSelection(),
lb = kb.getStartKey();
return p.set(jb, {
selection: kb.merge({
anchorKey: lb,
anchorOffset: 0,
focusKey: lb,
focusOffset: 0,
isBackward: false
}),
forceSelection: true
});
}
function ab(jb) {
var kb = jb.getSelection(),
lb = kb.getEndKey(),
mb = jb.getCurrentContent(),
nb = mb.getBlockForKey(lb).getLength();
return p.set(jb, {
selection: kb.merge({
anchorKey: lb,
anchorOffset: nb,
focusKey: lb,
focusOffset: nb,
isBackward: false
}),
forceSelection: true
});
}
function bb(jb) {
return jb.length > 0;
}
function cb(jb, kb) {
var lb = k.replaceWithFragment(jb.getCurrentContent(), jb.getSelection(), kb);
return p.push(jb, lb, o.INSERT_FRAGMENT);
}
function db(jb) {
var kb = k.removeRange(jb.getCurrentContent(), jb.getSelection(), n.FORWARD);
return p.push(jb, kb, o.REMOVE_RANGE);
}
function eb(jb, kb) {
var lb = jb.getSelection();
if (!lb.isCollapsed()) kb(aa(jb.getCurrentContent(), lb));
}
var fb = '\'',
gb = '\/',
hb = v.isBrowser('Firefox');
function ib(jb) {
return (hb && (jb == fb || jb == gb));
}
e.exports = ia;
}, null);
__d("TextEditorDragHandler", ["DataTransfer", "DocumentModifier", "EditorState", "EditorChangeType", "ex", "findAncestorOffsetKey", "getTextContentFromFiles", "getUpdatedSelectionState"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n) {
b.__markCompiled && b.__markCompiled();
'use strict';
function o(event, s) {
var t, u;
if (document.caretRangeFromPoint) {
var v = document.caretRangeFromPoint(event.x, event.y);
t = v.startContainer;
u = v.startOffset;
} else if (event.rangeParent) {
t = event.rangeParent;
u = event.rangeOffset;
} else return null;
var w = l(t);
if (w === null) {
var x = '';
if (t.dataset && t.dataset.reactid) x = ' Node ID: ' + t.dataset.reactid;
throw new Error(k('Invalid range for drop event.' + x + ' Offset: ' + u));
}
return n(s, w, u, w, u);
}
var p = {
onDragEnd: function() {
this.exitCurrentMode();
},
onDrop: function(s) {
var t = new g(s.nativeEvent.dataTransfer),
u = this.props.editorState,
v = o(s.nativeEvent, u);
s.preventDefault();
this.exitCurrentMode();
if (v === null) return;
var w = t.getFiles();
if (w.length > 0) {
if (this.props.handleDroppedFiles && this.props.handleDroppedFiles(v, w)) return;
m(w, function(x) {
x && this.update(r(u, v, x));
}.bind(this));
return;
}
if (this._internalDrag) {
this.update(q(u, v));
return;
}
this.update(r(u, v, t.getText()));
}
};
function q(s, t) {
var u = h.moveText(s.getCurrentContent(), s.getSelection(), t);
return i.push(s, u, j.INSERT_FRAGMENT);
}
function r(s, t, u) {
var v = h.insertText(s.getCurrentContent(), t, u, s.getCurrentInlineStyle());
return i.push(s, v, j.INSERT_FRAGMENT);
}
e.exports = p;
}, null);
__d("AbstractTextEditor.react", ["AbstractTextEditorPlaceholder.react", "AbstractTextEditorProps", "DOMVector", "EditorState", "React", "TextEditorCompositionHandler", "TextEditorContents.react", "TextEditorEditHandler", "TextEditorDragHandler", "TextEditorModes", "UserAgent", "cx", "requestAnimationFrame", "setImmediate"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) {
b.__markCompiled && b.__markCompiled();
'use strict';
var u = a.MutationObserver || a.WebKitMutationObserver,
v = (q.isBrowser('Safari') || q.isBrowser('Mobile Safari')),
w = q.isBrowser('IE'),
x = !!u;
function y(ba) {
return function(ca) {
if (!this.props.readOnly) {
var da = this._handler && this._handler[ba];
da && da.call(this, ca);
}
};
}
function z(ba) {
switch (ba) {
case p.EDIT:
return n;
case p.COMPOSITE:
return l;
case p.DRAG:
return o;
case p.CUT:
case p.RENDER:
return null;
}
}
var aa = k.createClass({
displayName: "AbstractTextEditor",
getDefaultProps: h.getDefaultProps,
_onBlur: y('onBlur'),
_onFocus: y('onFocus'),
_onSelect: y('onSelect'),
_onKeyDown: y('onKeyDown'),
_onKeyUp: y('onKeyUp'),
_onKeyPress: y('onKeyPress'),
_onMouseDown: y('onMouseDown'),
_onMouseUp: y('onMouseUp'),
_onCharacterData: y('onCharacterData'),
_onCompositionStart: y('onCompositionStart'),
_onCompositionEnd: y('onCompositionEnd'),
_onDragStart: y('onDragStart'),
_onDragOver: y('onDragOver'),
_onDragEnd: y('onDragEnd'),
_onDrop: y('onDrop'),
_onCut: y('onCut'),
_onCopy: y('onCopy'),
_onPaste: y('onPaste'),
_onBeforeInput: y('onBeforeInput'),
_attachMutationObserver: function() {
if (!u) return;
var ba = [],
ca = function() {
if (ba.length > 1) {
var da = ba[0],
ea = da.target;
t(function() {
if (this.isMounted() && ea.parentNode) this._onCharacterData(ea);
}.bind(this));
}
ba.length = 0;
}.bind(this);
this._mutationObserver = new u(function(da) {
var ea;
if (this._guardAgainstRender) return;
if (v) {
if (ba.length === 0) s(ca);
(ea = ba).push.apply(ea, da);
} else {
ba = da;
ca();
}
}.bind(this));
this._mutationObserver.observe(k.findDOMNode(this.refs.editorContainer), {
characterDataOldValue: true,
characterData: true,
subtree: true
});
},
_disableIELinkDetection: function() {
if (w) document.execCommand('AutoUrlDetect', false, false);
},
_renderPlaceholder: function() {
var ba = this.props.editorState.getCurrentContent(),
ca = (this.props.placeholder && !this.props.editorState.isInCompositionMode() && !ba.hasText());
if (ca) return (k.createElement(g, {
text: this.props.placeholder,
editorState: this.props.editorState,
textAlignment: this.props.textAlignment
}));
},
getInitialState: function() {
return {
containerKey: 0
};
},
render: function() {
var ba = this.props.textAlignment,
ca = (("_5yw9") + (ba === 'left' ? ' ' + "_48yc" : '') + (ba === 'right' ? ' ' + "_48yd" : '') + (ba === 'center' ? ' ' + "_48ye" : '')),
da = this.props.editorState.getCurrentContent().hasText();
return (k.createElement("div", {
className: ca
}, this._renderPlaceholder(), k.createElement("div", {
className: "_5ywa",
ref: "editorContainer",
key: 'editor' + this.state.containerKey
}, k.createElement("div", {
ref: "editor",
title: da ? null : this.props.placeholder,
role: this.props.readOnly ? null : (this.props.role || "textbox"),
"aria-label": this.props.ariaLabel,
"aria-activedescendant": this.props.readOnly ? null : this.props.ariaActiveDescendantID,
"aria-autocomplete": this.props.readOnly ? null : this.props.ariaAutoComplete,
"aria-expanded": this.props.readOnly ? null : this.props.ariaExpanded,
"aria-owns": this.props.readOnly ? null : this.props.ariaOwneeID,
"aria-haspopup": this.props.readOnly ? null : this.props.ariaHasPopup,
className: "_54-z",
"data-testid": this.props.webDriverTestID,
onBlur: this._onBlur,
onFocus: this._onFocus,
onSelect: this._onSelect,
onMouseUp: this._onMouseUp,
onKeyDown: this._onKeyDown,
onKeyUp: this._onKeyUp,
onKeyPress: this._onKeyPress,
onCut: this._onCut,
onCopy: this._onCopy,
onPaste: this._onPaste,
onDragStart: this._onDragStart,
onDragOver: this._onDragOver,
onDragEnd: this._onDragEnd,
onDrop: this._onDrop,
onCompositionStart: this._onCompositionStart,
onCompositionEnd: this._onCompositionEnd,
onBeforeInput: this._onBeforeInput,
spellCheck: x && this.props.spellCheck,
tabIndex: this.props.tabIndex,
contentEditable: !this.props.readOnly
}, k.createElement(m, {
blockRendererFn: this.props.blockRendererFn,
blockStyleFn: this.props.blockStyleFn,
editorState: this.props.editorState,
inlineStyleFn: this.props.inlineStyleFn
})))));
},
focus: function() {
var ba = this.props.editorState,
ca = ba.getSelection().getHasFocus(),
da = i.getScrollPosition();
this.refs.editor.focus();
window.scrollTo(da.x, da.y);
if (ca) return;
this.update(j.forceSelection(ba, ba.getSelection()));
},
blur: function() {
k.findDOMNode(this.refs.editor).blur();
},
componentDidMount: function() {
this._clipboard = null;
this._guardAgainstRender = false;
this._handler = n;
this._attachMutationObserver();
this._disableIELinkDetection();
},
componentWillUpdate: function(ba) {
this._blockSelectEvents = true;
},
componentDidUpdate: function() {
this._blockSelectEvents = false;
},
componentWillUnmount: function() {
if (this._mutationObserver) {
this._mutationObserver.disconnect();
this._mutationObserver = null;
}
},
setMode: function(ba) {
this._handler = z(ba);
},
exitCurrentMode: function() {
this.setMode(p.EDIT);
},
restoreEditorDOM: function() {
this.setState({
containerKey: this.state.containerKey + 1
}, this.focus);
},
setRenderGuard: function() {
this._guardAgainstRender = true;
},
removeRenderGuard: function() {
this._guardAgainstRender = false;
},
update: function(ba) {
this.props.onChange(ba);
}
});
e.exports = aa;
}, null);
__d("AbstractMentionsTextEditor.react", ["AbstractTextEditor.react", "AbstractTextEditorProps", "DocumentModifier", "EditorChangeType", "EditorState", "React", "TypeaheadNavigation", "clearImmediate", "getOrCreateDOMID", "setImmediate", "uniqueID"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) {
b.__markCompiled && b.__markCompiled();
var r = l,
s = r.PropTypes,
t = 5,
u = l.createClass({
displayName: "AbstractMentionsTextEditor",
propTypes: Object.assign({}, h.propTypes, {
mentionsSource: s.object,
mentionCreationFn: s.func.isRequired,
mentionResultsComponent: s.func.isRequired,
mentionResultsProps: s.object,
excludedEntries: s.object,
handleContentReturn: s.func,
onAddMention: s.func,
onShowMentions: s.func,
maxResults: s.number
}),
getDefaultProps: function() {
var w = g.getDefaultProps();
return Object.assign({}, w, {
maxResults: t
});
},
componentWillMount: function() {
this._viewID = q();
this._searchTimeouts = [];
},
componentWillUnmount: function() {
this._searchTimeouts.forEach(function(w) {
return n(w);
});
this._searchTimeouts = null;
},
getInitialState: function() {
return {
highlightedMentionable: null,
ariaActiveDescendantID: null,
mentionableEntries: null,
characterOffset: 0
};
},
_onShowMentions: function(w, x) {
if (!this.isMounted()) return;
var y = w && w.length;
if (!y) {
this.setState({
highlightedMentionable: null,
activeDescendantID: null,
mentionableEntries: null,
characterOffset: 0
});
return;
}
var z = w.slice(0, this.props.maxResults),
aa = this.props.typeaheadViewProps;
if (aa && aa.mentionSortFn) z.sort(aa.mentionSortFn);
this.setState({
highlightedMentionable: w[0],
mentionableEntries: z,
characterOffset: x
});
if (this.props.onShowMentions) this.props.onShowMentions(z, x);
},
_onBlur: function(w) {
this.setState(this.getInitialState());
this.props.onBlur && this.props.onBlur(w);
},
_onFocus: function(w) {
this.props.mentionsSource && this.props.mentionsSource.bootstrap();
this.props.onFocus && this.props.onFocus(w);
},
_handleReturn: function(w) {
if (this.state.highlightedMentionable) {
this._onMentionSelect(this.state.highlightedMentionable, w);
return true;
} else if (this.props.handleContentReturn && this.props.handleContentReturn(w)) return true;
return false;
},
_onTab: function(w) {
if (this.state.highlightedMentionable) {
w.preventDefault();
this._onMentionSelect(this.state.highlightedMentionable, w);
} else if (this.props.onTab) this.props.onTab(w);
},
_onEscape: function(w) {
if (this.props.onEscape) this.props.onEscape(w);
if (this.state.mentionableEntries) {
w.stopPropagation();
this.setState(this.getInitialState());
}
},
_onUpArrow: function(w) {
if (this.state.mentionableEntries) {
w.preventDefault();
m.moveUp(this.state.mentionableEntries, this.state.highlightedMentionable, this._onMentionHighlight);
} else this.props.onUpArrow && this.props.onUpArrow(w);
},
_onDownArrow: function(w) {
if (this.state.mentionableEntries) {
w.preventDefault();
m.moveDown(this.state.mentionableEntries, this.state.highlightedMentionable, this._onMentionHighlight);
} else this.props.onDownArrow && this.props.onDownArrow(w);
},
_onMentionHighlight: function(w) {
this.setState({
highlightedMentionable: w
});
},
_onMentionRenderHighlight: function(w) {
var x = o(w);
this.setState({
ariaActiveDescendantID: x
});
},
_onMentionSelect: function(w, x) {
var y = this.props.editorState,
z = y.getSelection(),
aa = y.getCurrentContent(),
ba = z.getAnchorKey(),
ca = z.getAnchorOffset(),
da = aa.getBlockMap().get(ba),
ea = ca - v(da.getText().substr(0, ca), w.getTitle(), this.state.characterOffset),
fa = i.replaceText(aa, z.set('anchorOffset', ea), w.getTitle(), y.getCurrentInlineStyle(), this.props.mentionCreationFn(w)),
ga = k.push(y, fa, j.INSERT_FRAGMENT);
this.props.onChange(ga);
this.setState(this.getInitialState());
if (this.props.onAddMention) {
var ha = this.state.mentionableEntries.indexOf(w);
this.props.onAddMention(w, ha, x);
}
},
shouldComponentUpdate: function(w, x) {
return (this.props.editorState !== w.editorState || this.props.placeholder !== w.placeholder || this.props.readOnly !== w.readOnly || this.state.mentionableEntries !== x.mentionableEntries || this.state.highlightedMentionable !== x.highlightedMentionable || this.state.ariaActiveDescendantID !== x.ariaActiveDescendantID);
},
componentDidUpdate: function(w) {
var x = this.props.editorState;
if (x === w.editorState) return;
var y = x.getSelection();
if (y.getHasFocus() && y.isCollapsed()) {
var z = x.getCurrentContent();
if (this.props.mentionsSource) this._searchTimeouts.push(p(function() {
this.props.mentionsSource.search(z, y, this._onShowMentions);
}.bind(this)));
}
},
blur: function() {
this.refs.abstractTextEditor.blur();
},
focus: function() {
this.refs.abstractTextEditor.focus();
},
_renderMentionables: function() {
var w = this.state.mentionableEntries;
if (!w || !w.length) return null;
var x = this.props.mentionResultsComponent;
return (l.createElement(x, l.__spread({}, this.props.mentionResultsProps, {
viewID: this._viewID,
selection: this.props.editorState.getSelection(),
contextComponent: this,
characterOffset: this.state.characterOffset,
mentionableEntries: w || [],
highlightedMentionable: this.state.highlightedMentionable,
onMentionSelect: this._onMentionSelect,
onMentionHighlight: this._onMentionHighlight,
onMentionRenderHighlight: this._onMentionRenderHighlight
})));
},
render: function() {
var w = this.state.mentionableEntries,
x = !!(w && w.length),
y = this.props.readOnly ? null : '-2';
return (l.createElement("div", {
ref: "container",
className: this.props.className,
tabIndex: y
}, l.createElement(g, l.__spread({}, this.props, {
ref: "abstractTextEditor",
role: "combobox",
ariaActiveDescendantID: this.state.ariaActiveDescendantID,
ariaAutoComplete: "list",
ariaOwneeID: this._viewID,
ariaExpanded: x,
ariaHasPopup: x,
onBlur: this._onBlur,
onFocus: this._onFocus,
onTab: this._onTab,
onEscape: this._onEscape,
onDownArrow: this._onDownArrow,
onUpArrow: this._onUpArrow,
handleReturn: this._handleReturn
})), this._renderMentionables()));
}
});
function v(w, x, y) {
for (var z = y; z <= x.length; z++)
if (w.substr(-z) == x.substr(0, z)) y = z;
return y;
}
e.exports = u;
}, null);
__d("createMentionEntity", ["ComposedEntityMutability", "ComposedEntityType", "DocumentEntity"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
function j(k) {
if (k.getType().toLowerCase() === 'hashtag') return i.create(h.HASHTAG, g.IMMUTABLE);
var l = k.getType().toLowerCase() === 'user' ? g.SEGMENTED : g.IMMUTABLE,
m = k.getAuxiliaryData();
return i.create(h.MENTION, l, {
id: k.getUniqueID(),
isWeak: m && m.renderType === 'non_member',
type: k.getType()
});
}
e.exports = j;
}, null);
__d("MentionsInput.react", ["AbstractMentionsTextEditor.react", "EditorState", "MentionsLayer.react", "React", "createMentionEntity", "cx", "joinClasses"], function(a, b, c, d, e, f, g, h, i, j, k, l, m) {
b.__markCompiled && b.__markCompiled();
var n = j,
o = n.PropTypes,
p = j.createClass({
displayName: "MentionsInput",
propTypes: {
editorState: o.instanceOf(h).isRequired,
mentionsSource: o.object,
typeaheadView: o.func.isRequired,
typeaheadViewPropTypes: o.object,
spellCheck: o.bool,
placeholder: o.string,
className: o.string,
autoflip: o.bool,
position: o.oneOf(['above', 'below']),
handleContentReturn: o.func,
handleDroppedFiles: o.func,
handlePastedFiles: o.func,
onAddMention: o.func,
onShowMentions: o.func,
onChange: o.func,
onInputFocus: o.func,
onInputBlur: o.func
},
blur: function() {
this.refs.textEditor.blur();
},
focus: function() {
clearTimeout(this._focusTimer);
this._focusTimer = setTimeout(function() {
this.refs.textEditor.focus();
}.bind(this), 0);
},
componentWillUnmount: function() {
clearTimeout(this._focusTimer);
},
render: function() {
var q = m(this.props.className, "_5yk1");
return (j.createElement("div", {
className: q,
onClick: this.focus,
onFocus: this.focus
}, j.createElement(g, j.__spread({}, this.props, {
mentionResultsComponent: i,
mentionResultsProps: {
typeaheadView: this.props.typeaheadView,
typeaheadViewProps: this.props.typeaheadViewProps,
autoflip: this.props.autoflip,
position: this.props.position
},
mentionCreationFn: k,
ref: "textEditor",
className: "_5yk2",
stripPastedStyles: true
}))));
}
});
e.exports = p;
}, null);
__d("DevxFluxDispatcher", ["Dispatcher"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
'use strict';
for (var h in g)
if (g.hasOwnProperty(h)) j[h] = g[h];
var i = g === null ? null : g.prototype;
j.prototype = Object.create(i);
j.prototype.constructor = j;
j.__superConstructor__ = g;
function j() {
if (g !== null) g.apply(this, arguments);
}
j.prototype.handleServerAction = function(k) {
this.$DevxFluxDispatcher0('serverAction', k);
};
j.prototype.handleViewAction = function(k) {
this.$DevxFluxDispatcher0('viewAction', k);
};
j.prototype.$DevxFluxDispatcher0 = function(k, l) {
this.dispatch(Object.assign({
source: k
}, l));
};
e.exports = new j();
}, null);
__d("DevxProxyActions", ["DevxFluxDispatcher"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
'use strict';
function h(i) {
Object.keys(i.ActionHandler).forEach(function(j) {
this[j] = function() {
for (var k = [], l = 0, m = arguments.length; l < m; l++) k.push(arguments[l]);
g.handleViewAction({
action: j,
args: k
});
};
}.bind(this));
}
e.exports = h;
}, null);
__d("ContentState", ["DocumentCharacters", "immutable"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
'use strict';
var i = h,
j = i.OrderedMap,
k = i.Record;
j;
var l = g,
m = l.SOFT_NEWLINE,
n = {
blockMap: null,
selectionBefore: null,
selectionAfter: null
},
o = k(n);
for (var p in o)
if (o.hasOwnProperty(p)) r[p] = o[p];
var q = o === null ? null : o.prototype;
r.prototype = Object.create(q);
r.prototype.constructor = r;
r.__superConstructor__ = o;
function r() {
if (o !== null) o.apply(this, arguments);
}
r.prototype.getBlockMap = function() {
return this.blockMap;
};
r.prototype.getSelectionBefore = function() {
return this.selectionBefore;
};
r.prototype.getSelectionAfter = function() {
return this.selectionAfter;
};
r.prototype.getBlockForKey = function(s) {
var t = this.getBlockMap().get(s);
return t;
};
r.prototype.getKeyBefore = function(s) {
return this.getBlockMap().reverse().keySeq().skipUntil(function(t) {
return t === s;
}).skip(1).first();
};
r.prototype.getKeyAfter = function(s) {
return this.getBlockMap().keySeq().skipUntil(function(t) {
return t === s;
}).skip(1).first();
};
r.prototype.getBlockAfter = function(s) {
return this.getBlockMap().skipUntil(function(t, u) {
return u === s;
}).skip(1).first();
};
r.prototype.getBlockBefore = function(s) {
return this.getBlockMap().reverse().skipUntil(function(t, u) {
return u === s;
}).skip(1).first();
};
r.prototype.getBlocksAsArray = function() {
return this.getBlockMap().toArray();
};
r.prototype.getLastBlock = function() {
return this.getBlockMap().last();
};
r.prototype.getPlainText = function(s) {
return this.getBlockMap().map(function(t) {
return t ? t.getText() : '';
}).join(s || m);
};
r.prototype.hasText = function() {
var s = this.getBlockMap();
return (s.size > 1 || s.first().getLength() > 0);
};
e.exports = r;
}, null);
__d("createEmptySelectionState", ["SelectionState"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
'use strict';
function h(i) {
return new g({
anchorKey: i,
anchorOffset: 0,
focusKey: i,
focusOffset: 0,
isBackward: false,
hasFocus: false
});
}
e.exports = h;
}, null);
__d("createContentStateFromBlocks", ["ContentState", "createEmptySelectionState", "createOrderedMapFromBlockArray"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
'use strict';
function j(k) {
var l = i(k),
m = h(l.first().getKey());
return new g({
blockMap: l,
selectionBefore: m,
selectionAfter: m
});
}
e.exports = j;
}, null);
__d("createInitialEditorState", ["EditorState", "immutable", "createEmptySelectionState"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
'use strict';
var j = h,
k = j.Stack;
function l(m, n) {
var o = m.getBlockMap().first().getKey();
return g.create({
currentContent: m,
undoStack: k(),
redoStack: k(),
decorator: n || null,
selection: i(o)
});
}
e.exports = l;
}, null);
__d("createPlainBlocksFromText", ["CharacterMetadata", "ComposedBlockType", "ContentBlock", "immutable", "generateBlockKey"], function(a, b, c, d, e, f, g, h, i, j, k) {
b.__markCompiled && b.__markCompiled();
var l = j,
m = l.List,
n = l.Repeat,
o = g,
p = o.EMPTY,
q = h,
r = q.UNSTYLED;
function s(t) {
return t.map(function(u) {
var v = u.length;
return new i({
key: k(),
text: u,
type: r,
characterList: m(n(p, v))
});
});
}
e.exports = s;
}, null);
__d("createEditorStateWithEntities", ["DocumentCharacters", "EditorState", "applyEntityToContentBlock", "createContentStateFromBlocks", "createInitialEditorState", "createPlainBlocksFromText"], function(a, b, c, d, e, f, g, h, i, j, k, l) {
b.__markCompiled && b.__markCompiled();
var m = new RegExp(g.SOFT_NEWLINE, 'ig');
function n(o) {
var p = o,
q = p.text,
r = p.ranges,
s = p.decorator,
t = p.entityCreationFn,
u = p.splitIntoBlocks,
v = p.allowUndo,
w, x;
if (u === undefined) u = true;
if (q) {
w = u ? q.split(m) : [q];
x = [];
var y = 0;
w.forEach(function(ba) {
x.push(y);
y += ba.length + 1;
});
} else w = [''];
var z = l(w);
if (r && r.length && t) r.forEach(function(ba) {
var ca = t(ba.entity);
if (ca === null) return;
var da = ba.offset,
ea, fa;
for (var ga = 0; ga < x.length; ga++) {
var ha = x[ga],
ia = x[ga + 1];
if (ia === undefined || (da >= ha && da < ia)) {
ea = z[ga];
fa = da - ha;
break;
}
}
z[ga] = i(ea, fa, fa + ba.length, ca);
});
var aa = k(j(z), s);
if (v === false) aa = h.set(aa, {
allowUndo: false
});
return aa;
}
e.exports = n;
}, null);
__d("createEmptyEditorState", ["createContentStateFromBlocks", "createInitialEditorState", "createPlainBlocksFromText"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
'use strict';
function j(k) {
var l = i(['']),
m = g(l);
return h(m, k);
}
e.exports = j;
}, null);
__d("getVisibleValueForContentState", ["ComposedEntityType", "DocumentCharacters", "DocumentEntity", "emptyFunction"], function(a, b, c, d, e, f, g, h, i, j) {
b.__markCompiled && b.__markCompiled();
var k = g.EMOTICON,
l = h.SOFT_NEWLINE;
function m(n) {
var o = n.getBlockMap().map(function(p) {
var q = p.getText(),
r = '';
p.findEntityRanges(j.thatReturnsTrue, function(s, t) {
var u = p.getEntityAt(s);
if (u === null) {
r += q.slice(s, t);
} else {
var v = i.get(u);
if (v.getType() === k) {
r += v.getData().originalEmoticon;
} else r += q.slice(s, t);
}
});
return r;
});
return o.join(l);
}
e.exports = m;
}, null);
__d("DocumentMentionsRegex", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
'use strict';
var g = '\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\\/!%\'"~=<>_:;',
h = '\\b[A-Z][^\\s' + g + ']',
i = {
PUNCTUATION: g,
NAME: h
};
e.exports = i;
}, null);
__d("AtSignMentionsStrategy", ["DocumentMentionsRegex"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
var h = g.PUNCTUATION,
i = ['@', '\\uff20'].join(''),
j = '[^' + i + h + '\\s]',
k = '(?:' + '\\.[ |$]|' + ' |' + '[' + h + ']|' + ')',
l = new RegExp('(?:^|\\s)(' + '[' + i + ']' + '((?:' + j + k + '){0,20})' + ')$'),
m = {
name: 'AtSignMentionsStrategy',
findMentionableString: function(n) {
var o = l.exec(n);
if (o !== null) {
var p = o[2];
if (p.length) return {
matchingString: p,
leadOffset: o[1].length
};
}
return null;
}
};
e.exports = m;
}, null);
__d("CapitalizedNameMentionsStrategy", ["DocumentMentionsRegex"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
'use strict';
var h = 1,
i = new RegExp('(^|[^#])((?:' + g.NAME + '{' + h + ',})$)'),
j = {
name: 'CapitalizedNameMentionsStrategy',
findMentionableString: function(k) {
var l = i.exec(k);
if (l !== null) return {
matchingString: l[2],
leadOffset: l[2].length
};
return null;
}
};
e.exports = j;
}, null);
__d("DocumentCompositeMentionsSource", ["emptyFunction", "invariant", "nullthrows"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
'use strict';
function j(l, m) {
var n = l.getCharacterList().toSeq().slice(0, m).reverse().takeWhile(function(o) {
return o.getEntity() === null;
}).count();
return l.getText().slice(m - n, m);
}
function k(l) {
h(l.length > 0);
this.$DocumentCompositeMentionsSource0 = l;
this.$DocumentCompositeMentionsSource1 = false;
this.$DocumentCompositeMentionsSource2 = null;
}
k.prototype.bootstrap = function(l) {
if (this.$DocumentCompositeMentionsSource1) return;
this.$DocumentCompositeMentionsSource1 = true;
l = l || g;
var m = this.$DocumentCompositeMentionsSource0.length;
function n() {
m--;
if (!m) l && l();
}
this.$DocumentCompositeMentionsSource0.forEach(function(o) {
o.bootstrap(n);
});
};
k.prototype.search = function(l, m, n) {
var o = m.getAnchorKey(),
p = l.getBlockForKey(o);
this.$DocumentCompositeMentionsSource3(j(p, m.getAnchorOffset()), n);
};
k.prototype.$DocumentCompositeMentionsSource3 = function(l, m) {
var n = this.$DocumentCompositeMentionsSource0.length,
o, p;
for (var q = 0; q < n; q++) {
o = this.$DocumentCompositeMentionsSource0[q];
p = o.findMatch(l);
if (p === null) {
continue;
} else {
var r = i(p).matchingString;
this.$DocumentCompositeMentionsSource2 = r;
o.search(r, function(s, t) {
if (this.$DocumentCompositeMentionsSource2 === t) m(s, p.leadOffset);
}.bind(this));
return;
}
}
this.$DocumentCompositeMentionsSource2 = null;
m(null, null);
};
e.exports = k;
}, null);
__d("DocumentMentionsSource", ["invariant"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
'use strict';
function h(i, j) {
g(typeof i.findMentionableString === 'function');
this.$DocumentMentionsSource0 = i;
this.$DocumentMentionsSource1 = j;
this.$DocumentMentionsSource2 = false;
}
h.prototype.findMatch = function(i) {
return this.$DocumentMentionsSource0.findMentionableString(i);
};
h.prototype.bootstrap = function(i) {
if (!this.$DocumentMentionsSource2) {
this.$DocumentMentionsSource2 = true;
this.$DocumentMentionsSource1.bootstrap(i);
}
};
h.prototype.search = function(i, j) {
this.$DocumentMentionsSource1.search(i, j, {
strategyName: this.$DocumentMentionsSource0.name
});
};
e.exports = h;
}, null);
__d("getMentionsTextForContentState", ["ComposedEntityType", "DocumentCharacters", "DocumentEntity", "emptyFunction"], function(a, b, c, d, e, f, g, h, i, j) {
b.__markCompiled && b.__markCompiled();
'use strict';
var k = g,
l = k.EMOTICON,
m = k.MENTION,
n = h,
o = n.SOFT_NEWLINE,
p = j.thatReturnsTrue,
q = /[\\\]:]/g;
function r(t) {
var u = t.getBlockMap().map(function(v) {
var w = v.getText(),
x = [];
v.findEntityRanges(p, function(y, z) {
x.push(s(w.slice(y, z), v.getEntityAt(y)));
});
return x.join('');
});
return u.join(o);
}
function s(t, u) {
if (u) {
var v = i.get(u);
if (v.getType() === m) {
t = t.replace(q, function(w) {
return '\\' + w;
});
return '@[' + v.getData().id + ':' + t + ']';
} else if (v.getType() === l) return v.getData().originalEmoticon;
}
return t.replace('@[', '@ [');
}
e.exports = r;
}, null);
__d("FilteredSearchSource", ["AbstractSearchSource"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
for (var h in g)
if (g.hasOwnProperty(h)) j[h] = g[h];
var i = g === null ? null : g.prototype;
j.prototype = Object.create(i);
j.prototype.constructor = j;
j.__superConstructor__ = g;
function j(k, l) {
"use strict";
g.call(this);
this.$FilteredSearchSource0 = k;
this.$FilteredSearchSource1 = l;
}
j.prototype.bootstrapImpl = function(k) {
"use strict";
this.$FilteredSearchSource1.bootstrap(k);
};
j.prototype.searchImpl = function(k, l, m) {
"use strict";
var n = function(o, p) {
o = this.$FilteredSearchSource2(o, p);
l(o, p);
}.bind(this);
this.$FilteredSearchSource1.search(k, n, m);
};
j.prototype.$FilteredSearchSource2 = function(k, l) {
"use strict";
var m = this.$FilteredSearchSource0;
return k.filter(function(n) {
return m(n, l);
});
};
e.exports = j;
}, null);
__d("filterCapitalizedNames", ["TokenizeUtil"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
function h(l, m) {
return i(l) && (m.length >= 5 || j(l, m));
}
function i(l) {
var m = l.getAuxiliaryData() || k;
return !m.disableAutosuggest && !!(l.getType() === 'user' || m.connectedPage);
}
function j(l, m) {
return g.isExactMatch(m, l.getTitle());
}
var k = {};
e.exports = h;
}, null);
__d("XPluginCommentsBanAuthorAsyncController", ["XController"], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = b("XController").create("\/plugins\/comments\/moderate\/ban\/{comment_id}\/", {
comment_id: {
type: "String",
required: true
}
});
}, null);
__d("XPluginCommentsCreateCommentAsyncController", ["XController"], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = b("XController").create("\/plugins\/comments\/async\/createComment\/{target_id}\/", {
target_id: {
type: "Int",
required: true
}
});
}, null);
__d("XPluginCommentsCreateReplyAsyncController", ["XController"], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = b("XController").create("\/plugins\/comments\/async\/createReply\/{parent_comment_id}\/", {
parent_comment_id: {
type: "String",
required: true
}
});
}, null);
__d("XPluginCommentsDeleteCommentAsyncController", ["XController"], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = b("XController").create("\/plugins\/comments\/async\/delete\/", {});
}, null);
__d("XPluginCommentsEditCommentAsyncController", ["XController"], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = b("XController").create("\/plugins\/comments\/async\/edit\/", {});
}, null);
__d("XPluginCommentsFlagCommentAsyncController", ["XController"], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = b("XController").create("\/plugins\/comments\/async\/flag\/", {});
}, null);
__d("XPluginCommentsLikeCommentAsyncController", ["XController"], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = b("XController").create("\/plugins\/comments\/async\/like\/", {
action_like: {
type: "Bool",
defaultValue: false
}
});
}, null);
__d("XPluginCommentsHideCommentAsyncController", ["XController"], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = b("XController").create("\/plugins\/comments\/moderate\/hide\/{url_id}\/", {
url_id: {
type: "Int",
required: true
},
action: {
type: "Enum",
required: true,
enumType: 1
},
type: {
type: "Enum",
required: true,
enumType: 1
}
});
}, null);
__d("XPluginCommentsPagerAsyncController", ["XController"], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = b("XController").create("\/plugins\/comments\/async\/{target_id}\/pager\/{ordering}\/", {
target_id: {
type: "Int",
required: true
},
ordering: {
type: "Enum",
required: true,
enumType: 1
}
});
}, null);
__d("XPluginCommentsRepliesPagerAsyncController", ["XController"], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = b("XController").create("\/plugins\/comments\/async\/comment\/{comment_id}\/pager\/", {
comment_id: {
type: "String",
required: true
}
});
}, null);
__d("CommentsPluginStore", ["AsyncRequest", "XPluginCommentsBanAuthorAsyncController", "XPluginCommentsCreateCommentAsyncController", "XPluginCommentsCreateReplyAsyncController", "XPluginCommentsDeleteCommentAsyncController", "DeveloperCommentsModerationAction", "DeveloperCommentsModerationSource", "DeveloperCommentsModerationType", "DevxFluxDispatcher", "DTSG", "XPluginCommentsEditCommentAsyncController", "XPluginCommentsFlagCommentAsyncController", "XPluginCommentsLikeCommentAsyncController", "XPluginCommentsHideCommentAsyncController", "MultiLoginPopup", "XPluginCommentsPagerAsyncController", "XPluginCommentsRepliesPagerAsyncController", "UnverifiedXD", "fbt", "getMentionsTextForContentState", "getVisibleValueForContentState", "invariant", "mixInEventEmitter", "nullthrows", "uniqueID"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, aa, ba, ca, da, ea) {
b.__markCompiled && b.__markCompiled();
'use strict';
var fa = 10,
ga = '__DEVX__',
ha = {
visibleValue: '',
encodedValue: ''
},
ia = {
change: true,
composerChange: true,
composerCommentAdded: true,
login: true,
moreCommentsCompleted: true,
moreRepliesCompleted: true,
postError: true,
sortingCompleted: true,
sentryAction: true
},
ja = {
maxLines: 10,
maxLength: 1000
},
ka = [],
la = {},
ma = {
userID: null,
actors: {},
appID: null,
afterCursor: null,
beforeCursor: null,
channelURL: null,
composerSearchSource: {},
deeplinkedCommentID: null,
href: '',
iframeReferer: null,
isMobile: false,
isModerator: false,
mirroredPage: null,
moderateURL: null,
targetFBID: null,
totalCount: 0,
user: {}
},
na = false,
oa = {
ordering: null
},
pa = {},
qa = {},
ra = {
setPostToFeed: true,
sort: true,
showMoreComments: true,
showMoreReplies: true,
toggleVisibility: true
},
sa = {
addComment: true
};
function ta(bb) {
ba(ab.hasOwnProperty(bb));
}
function ua() {
ba(Array.isArray(ka));
ba(la instanceof Object);
}
function va(bb, cb) {
if (!ra[bb] && !za.isLoggedIn()) {
var db = sa[bb] ? null : cb;
u.login(null, null, y._("\u8acb\u767b\u5165\u4ee5\u4fbf\u56de\u61c9"), {}, wa.bind(null, db));
return;
}
cb.call();
}
function wa(bb, cb) {
ma.user.id = cb.user;
ma.user.uri = cb.profileUrl;
ma.user.thumbSrc = cb.profilePic;
ma.user.actorIDs = cb.actorIDs;
if (cb.fbDtsg) p.setToken(cb.fbDtsg);
bb && bb.call();
za.emit('change');
za.emit('login');
}
function xa(bb, cb, db) {
return db.indexOf(bb) === cb;
}
function ya(bb, cb) {
if (!ma.channelURL) return;
Object.assign(cb, {
type: bb,
href: ma.href
});
x.send(cb, ma.channelURL);
}
var za = {
LOGGED_OUT_USER: "0",
getCommentIDs: function() {
return ka;
},
getByID: function(bb) {
ua();
return da(la)[bb];
},
isOptimisticComment: function(bb) {
return bb.id.startsWith(ga);
},
getCurrentSorting: function() {
return da(oa.ordering);
},
getTargetFBID: function() {
return da(ma.targetFBID);
},
getCommentsCount: function() {
ua();
return ma.totalCount;
},
getUser: function() {
return ma.user;
},
getIframeReferer: function() {
return ma.iframeReferer;
},
getAuthor: function(bb) {
return this.getByID(this.getByID(bb).authorID);
},
getPageSize: function() {
return fa;
},
getCommentBodyTruncationLimits: function() {
return ja;
},
getComposerSearchSource: function() {
return ma.composerSearchSource;
},
getMirroredPage: function() {
return ma.mirroredPage;
},
isMirrored: function() {
return this.getMirroredPage() != null;
},
isReply: function(bb) {
var cb = this.getByID(bb);
return cb.targetID !== this.getTargetFBID();
},
setActor: function(bb) {
ma.user = ma.actors[bb];
},
getPostToFeed: function() {
return na;
},
setPostToFeed: function(bb) {
na = bb;
},
setCreateComposerState: function(bb, cb) {
pa[cb || ga] = bb;
this.emit('composerChange');
},
getCreateComposerState: function(bb) {
return pa[bb || ga];
},
getCreateComposerContent: function(bb) {
return this._editorStateToComposerPayload(this.getCreateComposerState(bb));
},
isEmptyCreateComposer: function(bb) {
return this.getCreateComposerContent(bb).visibleValue.trim() === '';
},
setEditComposerState: function(bb, cb) {
qa[cb] = bb;
this.emit('composerChange');
},
getEditComposerState: function(bb) {
return qa[bb];
},
getEditComposerContent: function(bb) {
return this._editorStateToComposerPayload(this.getEditComposerState(bb));
},
isEmptyEditComposer: function(bb) {
return this.getEditComposerContent(bb).visibleValue.trim() === '';
},
_editorStateToComposerPayload: function(bb) {
if (!bb) return ha;
var cb = bb.getCurrentContent(),
db = aa(cb),
eb = z(cb);
return {
visibleValue: db,
encodedValue: eb
};
},
getActorIDs: function() {
return Object.keys(ma.actors);
},
getModerateURL: function() {
return ma.moderateURL;
},
isLoggedIn: function() {
return ma.user.id !== za.LOGGED_OUT_USER;
},
isMobile: function() {
return ma.isMobile;
},
isViewerModerator: function() {
return ma.isModerator;
},
hasUnloadedComments: function() {
return !!ma.afterCursor;
},
hasUnloadedReplies: function(bb) {
var cb = this.getByID(bb).public_replies;
if (!cb) return false;
if (cb.afterCursor) return true;
if ((!cb.commentIDs || cb.commentIDs.length === 0) && cb.totalCount > 0) return true;
return false;
},
getUnloadedCommentsCount: function() {
return ma.totalCount - ka.length;
},
dispatcherIndex: o.register(function(bb) {
var cb;
ta(bb.action);
va(bb.action, (cb = ab[bb.action]).bind.apply(cb, [ab].concat(bb.args)));
}),
init: function(bb, cb, db) {
ma = cb;
this.updateCommentData(bb, db);
Object.keys(ma.actors).forEach(function(eb) {
return la[eb] = ma.actors[eb];
});
this.setActor(ma.userID);
},
updateCommentData: function(bb, cb) {
ka = bb.commentIDs;
la = this.initComments(ka, bb.idMap);
oa.ordering = cb;
},
initComment: function(bb) {
bb.collapsed = false;
bb.editor = false;
bb.composer = false;
bb.deleted = false;
bb.flagged = false;
return bb;
},
initComments: function(bb, cb) {
bb.forEach(function(db) {
return cb[db] = this.initComment(cb[db]);
}.bind(this));
return cb;
},
emit: ((void 0)),
addListener: ((void 0)),
removeCurrentListener: ((void 0)),
ActionHandler: ((void 0))
};
ca(za, ia);
var ab = {
ban: function(bb) {
var cb = za.getByID(bb);
cb.deleted = true;
za.emit('change');
var db = h.getURIBuilder().setString('comment_id', bb).getURI();
new g(db).setMethod('POST').setData({
ban: true,
source: m.URL
}).send();
},
hide: function(bb) {
var cb = za.getByID(bb);
cb.deleted = true;
za.emit('change');
var db = t.getURIBuilder().setInt('url_id', ma.targetFBID).setEnum('action', l.DELETE).setEnum('type', n.APPROVED).getURI();
new g(db).setData({
comment_ids: [bb]
}).setMethod('POST').send();
},
addComment: function() {
var bb = za.getCreateComposerContent(),
cb = i.getURIBuilder().setInt('target_id', ma.targetFBID).getURI();
new g(cb).setData({
app_id: ma.appID,
av: za.getUser().id,
text: bb.encodedValue,
post_to_feed: za.getPostToFeed(),
iframe_referer: ma.iframeReferer
}).setMethod('POST').setHandler(function(db) {
var eb = db.payload,
fb = eb.commentID;
this._prependComment(eb.idMap[fb]);
delete pa[ga];
za.emit('composerCommentAdded', {});
ya('commentCreated', {
commentID: fb,
message: bb.visibleValue
});
if (eb.sentryAction) za.emit('sentryAction', eb.sentryAction, fb);
}.bind(this)).setErrorHandler(function(db) {
delete la[ga];
ka.shift();
za.emit('change');
za.emit('postError', db);
}).send();
this._prependComment({
authorID: ma.user.id,
targetID: ma.targetFBID,
body: {
text: bb.visibleValue
}
});
},
addReply: function(bb) {
var cb = za.getCreateComposerContent(bb),
db = j.getURIBuilder().setString('parent_comment_id', bb).getURI(),
eb = ga + ea();
new g(db).setData({
app_id: ma.appID,
av: za.getUser().id,
text: cb.encodedValue,
iframe_referer: ma.iframeReferer,
replied_to: za.getByID(bb).replyToCommentID
}).setMethod('POST').setHandler(function(hb) {
var ib = za.getByID(bb),
jb = Object.assign({}, ib.public_replies);
Object.assign(la, hb.payload.idMap);
ib = za.getByID(bb);
ib.public_replies = jb;
delete la[eb];
delete pa[bb];
ka.splice(ka.indexOf(eb), 1);
ib.composer = false;
delete ib.replyToCommentID;
ib.public_replies.commentIDs.pop();
ib.public_replies.commentIDs.push(hb.payload.commentID);
ya('commentCreated', {
commentID: hb.payload.commentID,
parentCommentID: bb,
message: cb.visibleValue
});
za.emit('change');
}).setErrorHandler(function(hb) {
delete la[eb];
ka.splice(ka.indexOf(eb), 1);
fb = za.getByID(bb);
fb.public_replies.commentIDs.pop();
fb.public_replies.totalCount--;
fb.composer = false;
delete fb.replyToCommentID;
za.emit('change');
za.emit('postError', hb);
}).send();
var fb = za.getByID(bb),
gb = Object.assign({}, fb.public_replies);
if (!gb.commentIDs) gb.commentIDs = [];
if (!gb.totalCount) gb.totalCount = 0;
gb.totalCount++;
gb.commentIDs.push(eb);
fb.public_replies = gb;
la[eb] = {
authorID: ma.user.id,
body: {
text: cb.visibleValue
},
targetID: bb,
id: eb
};
ka.push(eb);
za.emit('change');
},
_prependComment: function(bb) {
if (!bb.id) {
bb.id = ga;
} else {
ka.shift();
delete la[ga];
}
ka.unshift(bb.id);
la[bb.id] = za.initComment(bb);
za.emit('change');
},
edit: function(bb) {
za.getByID(bb).editor = true;
za.emit('change');
},
saveEdit: function(bb) {
var cb = JSON.parse(JSON.stringify(za.getByID(bb))),
db = q.getURIBuilder().getURI(),
eb = za.getEditComposerContent(bb);
new g(db).setMethod('POST').setData({
app_id: ma.appID,
text: eb.encodedValue,
comment_id: bb,
av: za.getAuthor(bb).id,
iframe_referer: ma.iframeReferer
}).setHandler(function(gb) {
var hb = gb.payload;
la[hb.commentID] = za.initComment(hb.idMap[hb.commentID]);
delete qa[bb];
za.emit('change');
}).setErrorHandler(function(gb) {
cb.editor = false;
Object.assign(za.getByID(bb), cb);
za.emit('change');
za.emit('postError', gb);
}).send();
var fb = za.getByID(bb);
fb.editor = false;
fb.body.text = eb.visibleValue;
delete fb.ranges;
za.emit('change');
},
cancelEdit: function(bb) {
var cb = za.getByID(bb);
cb.editor = false;
za.emit('change');
},
"delete": function(bb) {
var cb = za.getByID(bb);
cb.deleted = true;
var db = k.getURIBuilder().getURI();
new g(db).setData({
app_id: ma.appID,
comment_id: bb,
av: za.getAuthor(bb).id,
iframe_referer: ma.iframeReferer
}).setMethod('POST').setHandler(function() {
return ya('commentRemoved', {
commentID: bb
});
}).setErrorHandler(function(eb) {
var fb = za.getByID(bb);
fb.deleted = false;
za.emit('change');
}).send();
za.emit('change');
},
like: function(bb) {
var cb = za.getByID(bb),
db = s.getURIBuilder().setBool('action_like', !cb.hasLiked).getURI();
new g(db).setData({
app_id: ma.appID,
comment_id: cb.id,
iframe_referer: ma.iframeReferer
}).setMethod('POST').setHandler(function(eb) {
var fb = eb.payload;
Object.assign(la[fb.commentID], za.initComment(fb.idMap[fb.commentID]));
za.emit('change');
}).setErrorHandler(function(eb) {
cb.likeCount--;
cb.hasLiked = false;
za.emit('postError', eb);
}).send();
cb.hasLiked = !cb.hasLiked;
if (cb.hasLiked) {
cb.likeCount++;
} else if (cb.likeCount > 0) cb.likeCount--;
la[cb.id] = cb;
za.emit('change');
},
sort: function(bb) {
var cb = v.getURIBuilder().setInt('target_id', ma.targetFBID).setEnum('ordering', bb).getURI();
new g(cb).setMethod('POST').setData({
app_id: ma.appID,
limit: za.getPageSize(),
iframe_referer: ma.iframeReferer
}).setHandler(function(db) {
var eb = db.payload;
ma.afterCursor = eb.afterCursor;
za.updateCommentData(eb, bb);
za.emit('sortingCompleted');
za.emit('change');
}).send();
},
showMoreComments: function() {
var bb = v.getURIBuilder().setInt('target_id', ma.targetFBID).setEnum('ordering', za.getCurrentSorting()).getURI();
new g(bb).setMethod('POST').setData({
app_id: ma.appID,
after_cursor: ma.afterCursor,
limit: za.getPageSize(),
deeplinked_comment_id: ma.deeplinkedCommentID,
iframe_referer: ma.iframeReferer
}).setHandler(function(cb) {
var db = cb.payload;
ma.afterCursor = db.afterCursor;
ka = ka.concat(db.commentIDs).filter(xa);
la = Object.assign(la, za.initComments(db.commentIDs, db.idMap));
za.emit('moreCommentsCompleted');
za.emit('change');
}).setErrorHandler(function(cb) {
za.emit('postError', cb);
za.emit('moreCommentsCompleted');
}).send();
},
setUser: function(bb) {
za.setActor(bb);
za.emit('composerChange');
},
setPostToFeed: function(bb) {
za.setPostToFeed(bb);
},
showMoreReplies: function(bb) {
var cb = w.getURIBuilder().setString('comment_id', bb).getURI(),
db = za.getByID(bb).public_replies;
new g(cb).setMethod('POST').setData({
app_id: ma.appID,
after_cursor: db.afterCursor,
limit: za.getPageSize(),
iframe_referer: ma.iframeReferer
}).setHandler(function(eb) {
var fb = eb.payload;
la = Object.assign(za.initComments(fb.commentIDs, fb.idMap), la);
db.afterCursor = fb.afterCursor;
db.commentIDs = db.commentIDs.concat(fb.commentIDs).filter(xa);
za.emit('moreRepliesCompleted', {
commentID: bb
});
za.emit('change');
}).setErrorHandler(function(eb) {
za.emit('postError', eb);
za.emit('moreRepliesCompleted', {
commentID: bb
});
}).send();
},
toggleVisibility: function(bb) {
var cb = za.getByID(bb);
cb.collapsed = !cb.collapsed;
za.emit('change');
},
flag: function(bb) {
la[bb].flagged = true;
this._sendFlagOrUnflagRequest(bb, 'flag');
za.emit('change');
},
unflag: function(bb) {
la[bb].flagged = false;
this._sendFlagOrUnflagRequest(bb, 'unflag');
za.emit('change');
},
_sendFlagOrUnflagRequest: function(bb, cb) {
var db = r.getURIBuilder().getURI();
new g(db).setData({
app_id: ma.appID,
comment_id: bb,
iframe_referer: ma.iframeReferer,
unflag: cb === 'unflag'
}).setMethod('POST').setErrorHandler(function(eb) {
la[bb].flagged = !la[bb].flagged;
za.emit('postError', eb);
}).send();
},
report: function(bb) {
window.open(za.getByID(bb).reportURI, '_blank');
},
showReplyComposer: function(bb) {
var cb = za.getByID(bb);
if (za.isReply(bb)) {
var db = bb;
cb = za.getByID(cb.targetID);
cb.replyToCommentID = db;
}
cb.composer = true;
za.emit('change');
},
cancelReply: function(bb) {
var cb = za.getByID(bb);
cb.composer = false;
delete cb.replyToCommentID;
za.emit('change');
}
};
za.ActionHandler = ab;
e.exports = za;
}, null);
__d("CommentsPluginHeader.react", ["CommentsPluginActions", "CommentsPluginStore", "DeveloperCommentsPluginOrdering", "LeftRight.react", "Link.react", "React", "XUISelector.react", "XUISpinner.react", "XUIText.react", "cx", "fbt"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) {
b.__markCompiled && b.__markCompiled();
'use strict';
var r = m.Option,
s = l.Component;
for (var t in s)
if (s.hasOwnProperty(t)) v[t] = s[t];
var u = s === null ? null : s.prototype;
v.prototype = Object.create(u);
v.prototype.constructor = v;
v.__superConstructor__ = s;
function v(w) {
s.call(this, w);
this.state = {
sorting: false
};
var x = this;
x.$CommentsPluginHeader0 = this.$CommentsPluginHeader0.bind(this);
}
v.prototype.$CommentsPluginHeader0 = function(event) {
this.setState({
sorting: true
});
h.addListener('sortingCompleted', function() {
this.setState({
sorting: false
});
h.removeCurrentListener();
}.bind(this));
g.sort(event.value);
};
v.prototype.render = function() {
var w = null;
if (h.getModerateURL()) w = l.createElement("span", null, l.createElement("span", {
className: "_52bm"
}, "|"), l.createElement(k, {
href: h.getModerateURL(),
target: "_blank"
}, q._("\u5be9\u6838\u5de5\u5177")));
return (l.createElement(j, {
className: "_491z"
}, l.createElement("span", null, l.createElement(o, {
weight: "bold"
}, h.getCommentsCount() !== 1 ? q._("{count}\u5247\u56de\u61c9", [q.param("count", h.getCommentsCount())]) : q._("1 \u5247\u56de\u61c9")), w), l.createElement("div", null, this.state.sorting ? l.createElement(n, {
size: "small",
className: "_3-90"
}) : null, l.createElement("span", {
className: "_pup"
}, q._("\u6392\u5e8f\u4f9d\u64da")), ' ', l.createElement(m, {
alignh: "right",
className: "_3-8_",
initialValue: h.getCurrentSorting(),
onChange: this.$CommentsPluginHeader0
}, i.__types.map(function(x) {
return l.createElement(r, {
value: x,
key: x
}, i.__labels[x]);
})))));
};
e.exports = v;
}, null);
__d("CommentsPluginAction", ["fbt"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
'use strict';
var h = {
EDIT: 'edit',
DELETE: 'delete',
FLAG: 'flag',
UNFLAG: 'unflag',
BAN: 'ban',
HIDE: 'hide',
REPORT: 'report',
COLLAPSE: 'collapse',
SHOW: 'show',
getLabel: function(i) {
switch (i) {
case h.COLLAPSE:
return g._("\u6536\u5408\u56de\u61c9");
case h.SHOW:
return g._("\u986f\u793a\u56de\u61c9");
case h.EDIT:
return g._("\u7de8\u8f2f\u56de\u61c9");
case h.DELETE:
return g._("\u522a\u9664\u7559\u8a00");
case h.FLAG:
return g._("\u6aa2\u8209\u56de\u61c9");
case h.UNFLAG:
return g._("\u53d6\u6d88\u6a19\u793a\u7559\u8a00");
case h.BAN:
return g._("\u5c01\u9396\u7528\u6236");
case h.HIDE:
return g._("\u96b1\u85cf\u56de\u61c9");
case h.REPORT:
return g._("\u5411 Facebook \u63d0\u51fa\u6aa2\u8209");
}
},
getMenuActions: function() {
return [h.COLLAPSE, h.SHOW, h.EDIT, h.DELETE, h.FLAG, h.UNFLAG, h.BAN, h.HIDE, h.REPORT];
}
};
e.exports = h;
}, null);
__d("MixinCommentsPluginConfirmAction", ["CommentsPluginAction", "CommentsPluginActions", "React", "Set", "XUIDialog.react", "XUIDialogBody.react", "XUIDialogButton.react", "XUIDialogCancelButton.react", "XUIDialogFooter.react", "XUIDialogTitle.react", "fbt", "invariant"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) {
b.__markCompiled && b.__markCompiled();
'use strict';
var s = {
requiresConfirmation: function(t) {
var u = new j([g.DELETE, g.BAN, g.HIDE]);
return u.has(t);
},
confirmAction: function(t) {
this.setState({
actionConfirmationShown: true,
action: t
});
},
_onActionConfirmed: function() {
h[this.state.action](this.props.commentID);
this.setState({
actionConfirmationShown: false
});
},
_onActionCancelled: function() {
this.setState({
actionConfirmationShown: false
});
},
_getActionMetadata: function(t) {
switch (t) {
case g.DELETE:
return {
body: q._("\u4f60\u78ba\u5b9a\u8981\u522a\u9664\u6b64\u56de\u61c9\u55ce\uff1f"),
button_label: q._("\u78ba\u8a8d\u522a\u9664")
};
case g.BAN:
return {
body: q._("\u78ba\u5b9a\u8981\u5c01\u9396\u9019\u540d\u7528\u6236\uff1f"),
button_label: q._("\u78ba\u8a8d\u5c01\u9396")
};
case g.HIDE:
return {
body: q._("\u4f60\u78ba\u5b9a\u8981\u96b1\u85cf\u6b64\u56de\u61c9\uff1f"),
button_label: q._("\u78ba\u8a8d\u96b1\u85cf")
};
default:
r(false);
}
},
renderActionConfirmationDialog: function(t) {
var u = this.state.action;
if (!u) return null;
var v = this._getActionMetadata(u);
return (i.createElement(k, {
shown: this.state.actionConfirmationShown,
width: t
}, i.createElement(p, {
showCloseButton: false
}, g.getLabel(u)), i.createElement(l, null, v.body), i.createElement(o, null, i.createElement(n, {
onClick: this._onActionCancelled
}), i.createElement(m, {
use: "confirm",
label: v.button_label,
onClick: this._onActionConfirmed
}))));
}
};
e.exports = s;
}, null);
__d("CommentsPluginCommentActions.react", ["ActionList.react", "CommentsPluginAction", "CommentsPluginActions", "CommentsPluginStore", "Image.react", "Link.react", "MixinCommentsPluginConfirmAction", "React", "UFICommentMetadata.react", "cx", "fbt"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) {
b.__markCompiled && b.__markCompiled();
'use strict';
var r = n,
s = r.PropTypes,
t = n.createClass({
displayName: "CommentsPluginCommentActions",
mixins: [m],
propTypes: {
commentID: s.string.isRequired
},
getInitialState: function() {
return {
deleteConfirmationShown: false,
action: null
};
},
_onLikeAction: function() {
i.like(this.props.commentID);
},
_onReply: function() {
i.showReplyComposer(this.props.commentID);
},
_onFlag: function() {
i.flag(this.props.commentID);
},
_getLikeActionElem: function(u) {
if (!u.canLike && j.isLoggedIn()) return null;
return (n.createElement(l, {
onClick: this._onLikeAction
}, u.hasLiked ? q._("\u6536\u56de\u8b9a") : q._("\u8b9a")));
},
render: function() {
var u = j.getByID(this.props.commentID);
return (n.createElement(g, {
className: "_2vq9"
}, this._getLikeActionElem(u), n.createElement(l, {
onClick: this._onReply
}, q._("\u56de\u8986")), j.isMobile() ? u.canEdit ? n.createElement(l, {
onClick: this.confirmAction.bind(this, h.DELETE)
}, q._("\u522a\u9664")) : n.createElement(l, {
onClick: this._onFlag
}, q._("\u6aa2\u8209")) : null, u.likeCount ? n.createElement("span", null, n.createElement(k, {
src: "/images/ufi/fbfeed/like.png",
className: "_3-8_ _4iy4"
}), u.likeCount) : null, n.createElement(o, {
comment: u,
permalink: u.permalink,
shortenTimestamp: true,
showPermalink: !j.isReply(this.props.commentID),
permalinkTarget: "_parent"
}), j.isMobile() ? this.renderActionConfirmationDialog(320) : null));
}
});
e.exports = t;
}, null);
__d("CommentsPluginComposerMirroringNotice.react", ["CommentsPluginStore", "React", "cx", "fbt"], function(a, b, c, d, e, f, g, h, i, j) {
b.__markCompiled && b.__markCompiled();
'use strict';
var k = h,
l = k.PropTypes,
m = h.Component;
for (var n in m)
if (m.hasOwnProperty(n)) p[n] = m[n];
var o = m === null ? null : m.prototype;
p.prototype = Object.create(o);
p.prototype.constructor = p;
p.__superConstructor__ = m;
function p() {
if (m !== null) m.apply(this, arguments);
}
p.prototype.render = function() {
var q = g.getMirroredPage();
if (!q) return null;
return (h.createElement("div", {
className: "_5sge _2ph-"
}, q.name ? this.props.isReply ? j._("Your reply may also appear on {page name}'s Facebook Page.", [j.param("page name", h.createElement("a", {
href: q.uri,
target: "blank"
}, q.name))]) : j._("Your comment may also appear on {page name}'s Facebook Page.", [j.param("page name", h.createElement("a", {
href: q.uri,
target: "blank"
}, q.name))]) : this.props.isReply ? j._("Your reply may also appear on Facebook.") : j._("Your comment may also appear on Facebook.")));
};
p.propTypes = {
isReply: l.bool
};
e.exports = p;
}, null);
__d("CommentsPluginProfilePicture.react", ["React", "cx"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
'use strict';
var i = g,
j = i.PropTypes,
k = g.Component;
for (var l in k)
if (k.hasOwnProperty(l)) n[l] = k[l];
var m = k === null ? null : k.prototype;
n.prototype = Object.create(m);
n.prototype.constructor = n;
n.__superConstructor__ = k;
function n() {
if (k !== null) k.apply(this, arguments);
}
n.prototype.render = function() {
return (g.createElement("a", g.__spread({}, this.props, {
href: this.props.href
}), g.createElement("img", {
className: ((!this.props.isReply ? "_1ci" : '') + (this.props.isReply ? ' ' + "_1cj" : '')),
src: this.props.src
})));
};
n.propTypes = {
href: j.string.isRequired,
src: j.string.isRequired,
isReply: j.bool
};
e.exports = n;
}, null);
__d("CommentsPluginComposer.react", ["CommentsPluginStore", "CommentsPluginComposerMirroringNotice.react", "CommentsPluginProfilePicture.react", "ComposedEntityMutability", "ComposedEntityType", "DocumentEntity", "EditorState", "MentionsInput.react", "React", "UFIImageBlock.react", "UFICommentUtils.react", "XUITypeaheadView.react", "createEditorStateWithEntities", "createEmptyEditorState", "cx", "fbt", "getMentionsInputDecorator", "joinClasses"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) {
b.__markCompiled && b.__markCompiled();
'use strict';
var y = o,
z = y.PropTypes;
function aa(fa) {
return l.create(k.MENTION, j.IMMUTABLE, {
id: fa.id
});
}
var ba = o.Component;
for (var ca in ba)
if (ba.hasOwnProperty(ca)) ea[ca] = ba[ca];
var da = ba === null ? null : ba.prototype;
ea.prototype = Object.create(da);
ea.prototype.constructor = ea;
ea.__superConstructor__ = ba;
function ea(fa, ga) {
ba.call(this, fa, ga);
this.state = this.$CommentsPluginComposer0();
var ha = this;
ha.$CommentsPluginComposer1 = this.$CommentsPluginComposer1.bind(this);
ha.$CommentsPluginComposer2 = this.$CommentsPluginComposer2.bind(this);
}
ea.prototype.$CommentsPluginComposer0 = function() {
var fa = null,
ga = null;
if (this.props.editCommentID) {
ga = g.getByID(this.props.editCommentID);
fa = s({
text: ga.body.text,
ranges: q.shallowCopyRanges(ga.ranges).filter(function(ja) {
return !ja.entity.external;
}),
decorator: w(),
entityCreationFn: aa
});
} else if (this.props.parentCommentIDOfNewReply) {
ga = g.getByID(this.props.parentCommentIDOfNewReply);
if (ga.replyToCommentID && g.getAuthor(ga.replyToCommentID).id !== g.getUser().id) {
var ha = g.getAuthor(ga.replyToCommentID),
ia = {
id: ha.id,
text: ha.name,
offset: 0,
length: ha.name.length,
entity: {
id: ha.id
}
};
fa = m.moveFocusToEnd(s({
text: ha.name + ' ',
ranges: [ia],
decorator: w(),
entityCreationFn: aa
}));
}
}
if (!fa) fa = t(w());
return {
editorState: fa,
expanded: !!this.props.alwaysExpanded
};
};
ea.prototype.$CommentsPluginComposer3 = function() {
return !this.props.editCommentID && !this.props.parentCommentIDOfNewReply;
};
ea.prototype.componentDidMount = function() {
g.addListener('composerCommentAdded', function(event) {
if (this.$CommentsPluginComposer3()) {
var fa = this.$CommentsPluginComposer0();
fa.expanded = true;
this.setState(fa);
}
}.bind(this));
if (!this.$CommentsPluginComposer3()) this.refs.composer.focus();
};
ea.prototype.$CommentsPluginComposer1 = function(fa) {
this.setState({
editorState: fa
});
if (this.props.editCommentID) {
g.setEditComposerState(fa, this.props.editCommentID);
} else g.setCreateComposerState(fa, this.props.parentCommentIDOfNewReply);
};
ea.prototype.$CommentsPluginComposer4 = function() {
if (this.props.editCommentID) return g.isReply(this.props.editCommentID);
return !!this.props.parentCommentIDOfNewReply;
};
ea.prototype.$CommentsPluginComposer2 = function() {
this.setState({
expanded: true
});
};
ea.prototype.render = function() {
var fa = this.props.editCommentID ? g.getAuthor(this.props.editCommentID) : fa = g.getUser(),
ga = this.props.placeholder || v._("\u65b0\u589e\u56de\u61c9\u22ef\u22ef"),
ha = this.$CommentsPluginComposer4();
return (o.createElement(p, {
spacing: "medium",
className: x((("_4uyl") + (ha ? ' ' + "_1zz6" : '') + (!this.state.expanded ? ' ' + "_1zz7" : '') + (!!this.state.expanded ? ' ' + "_1zz8" : '')), this.props.className)
}, g.isMobile() ? o.createElement("div", null) : o.createElement(i, {
href: fa.uri,
src: fa.thumbSrc,
isReply: ha,
target: "_blank"
}), o.createElement("div", null, o.createElement(n, {
className: (("_1cb") + (this.props.readOnly ? ' ' + "_5pu_" : '')),
editorState: this.state.editorState,
mentionsSource: g.getComposerSearchSource(),
onChange: this.$CommentsPluginComposer1,
onFocus: this.$CommentsPluginComposer2,
placeholder: ga,
readOnly: this.props.readOnly,
typeaheadView: r,
ref: "composer"
}), this.state.expanded ? o.createElement("div", {
className: "_4uym"
}, o.createElement(h, {
isReply: ha
}), this.props.children) : null)));
};
ea.propTypes = {
editCommentID: z.string,
parentCommentIDOfNewReply: z.string,
readOnly: z.bool,
placeholder: z.node,
alwaysExpanded: z.bool
};
e.exports = ea;
}, null);
__d("CommentsPluginComposerEdit.react", ["CommentsPluginActions", "CommentsPluginComposer.react", "CommentsPluginStore", "React", "XUIButton.react", "cx", "fbt"], function(a, b, c, d, e, f, g, h, i, j, k, l, m) {
b.__markCompiled && b.__markCompiled();
'use strict';
var n = j,
o = n.PropTypes,
p = j.Component;
for (var q in p)
if (p.hasOwnProperty(q)) s[q] = p[q];
var r = p === null ? null : p.prototype;
s.prototype = Object.create(r);
s.prototype.constructor = s;
s.__superConstructor__ = p;
function s(t, u) {
p.call(this, t, u);
this.state = {
waitingAsyncResponse: false
};
var v = this;
v.$CommentsPluginComposerEdit0 = this.$CommentsPluginComposerEdit0.bind(this);
v.$CommentsPluginComposerEdit1 = this.$CommentsPluginComposerEdit1.bind(this);
this.$CommentsPluginComposerEdit2 = null;
}
s.prototype.componentDidMount = function() {
this.$CommentsPluginComposerEdit2 = i.addListener('composerChange', function() {
return this.forceUpdate();
}.bind(this));
};
s.prototype.componentWillUnmount = function() {
if (this.$CommentsPluginComposerEdit2) this.$CommentsPluginComposerEdit2.remove();
};
s.prototype.$CommentsPluginComposerEdit0 = function() {
this.setState({
waitingAsyncResponse: true
});
g.saveEdit(this.props.commentID);
};
s.prototype.$CommentsPluginComposerEdit1 = function() {
g.cancelEdit(this.props.commentID);
};
s.prototype.$CommentsPluginComposerEdit3 = function() {
return (this.state.waitingAsyncResponse || i.isEmptyEditComposer(this.props.commentID));
};
s.prototype.render = function() {
return (j.createElement(h, {
alwaysExpanded: true,
readOnly: this.state.waitingAsyncResponse,
editCommentID: this.props.commentID
}, j.createElement("div", {
className: "_5tr6 clearfix _2ph_"
}, j.createElement(k, {
disabled: this.$CommentsPluginComposerEdit3(),
label: m._("\u5132\u5b58"),
use: "confirm",
className: "rfloat _3-99",
onClick: this.$CommentsPluginComposerEdit0
}), j.createElement(k, {
disabled: this.state.waitingAsyncResponse,
label: m._("\u53d6\u6d88"),
use: "default",
className: "rfloat _3-99",
onClick: this.$CommentsPluginComposerEdit1
})), this.props.children));
};
s.propTypes = {
commentID: o.string.isRequired
};
e.exports = s;
}, null);
__d("CommentsPluginMenu.react", ["CommentsPluginAction", "CommentsPluginActions", "CommentsPluginStore", "Image.react", "MixinCommentsPluginConfirmAction", "ReactXUIMenu", "PopoverMenu.react", "React", "Tooltip", "fbt", "ix"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) {
b.__markCompiled && b.__markCompiled();
'use strict';
var r = n,
s = r.PropTypes,
t = l.Item,
u = n.createClass({
displayName: "CommentsPluginMenu",
mixins: [k],
propTypes: {
commentID: s.string.isRequired
},
getInitialState: function() {
return {
opened: false,
actionConfirmationShown: false,
action: null
};
},
_onMenuShow: function() {
this.setState({
opened: true
});
},
_onMenuHide: function() {
this.setState({
opened: false
});
},
_toggleVisibility: function() {
h.toggleVisibility(this.props.commentID);
},
_onAction: function(v, event) {
var w = event.item.getValue();
if (this.requiresConfirmation(w)) {
this.confirmAction(w);
} else if (w === g.SHOW || w === g.COLLAPSE) {
this._toggleVisibility();
} else h[w](this.props.commentID);
},
_getMenuItem: function(v, w) {
var x = i.isReply(w.id);
switch (v) {
case g.DELETE:
case g.EDIT:
if (!w.canEdit) return null;
break;
case g.FLAG:
if (w.canEdit || w.collapsed || w.flagged) return null;
break;
case g.UNFLAG:
if (w.canEdit || !w.flagged) return null;
break;
case g.SHOW:
if (x || !w.collapsed) return null;
break;
case g.COLLAPSE:
if (x || w.collapsed || w.flagged) return null;
break;
case g.BAN:
case g.HIDE:
if (!i.isViewerModerator()) return null;
break;
case g.REPORT:
if (!w.reportURI) return null;
break;
default:
break;
}
return (n.createElement(t, {
value: v,
key: v
}, g.getLabel(v)));
},
render: function() {
var v = i.getByID(this.props.commentID);
return (n.createElement("div", null, n.createElement(m, {
alignh: "right",
onShow: this._onMenuShow,
onHide: this._onMenuHide,
menu: n.createElement(l, {
onItemClick: this._onAction
}, g.getMenuActions().map(function(w) {
return this._getMenuItem(w, v);
}.bind(this)))
}, n.createElement("a", null, n.createElement(j, n.__spread({}, o.propsFor(p._("\u529f\u80fd\u8868")), {
src: q('/images/plugins/comments/chevron-down.png')
})))), this.renderActionConfirmationDialog(400)));
},
isOpen: function() {
return this.state.opened;
}
});
e.exports = u;
}, null);
__d("CommentsPluginAuthorSelector.react", ["ActorSelector.react", "CommentsPluginActions", "CommentsPluginStore", "React", "fbt"], function(a, b, c, d, e, f, g, h, i, j, k) {
b.__markCompiled && b.__markCompiled();
'use strict';
var l = j.Component;
for (var m in l)
if (l.hasOwnProperty(m)) o[m] = l[m];
var n = l === null ? null : l.prototype;
o.prototype = Object.create(n);
o.prototype.constructor = o;
o.__superConstructor__ = l;
function o(p) {
l.call(this, p);
this.state = {
selectedActorID: i.getUser().id
};
var q = this;
q.$CommentsPluginAuthorSelector0 = this.$CommentsPluginAuthorSelector0.bind(this);
}
o.prototype.$CommentsPluginAuthorSelector0 = function(p) {
this.setState({
selectedActorID: p.value
});
h.setUser(p.value);
};
o.prototype.$CommentsPluginAuthorSelector1 = function(p) {
return (k._("\u6b63\u5728\u4ee5{actorName}\u7684\u8eab\u5206\u56de\u61c9", [k.param("actorName", p)]));
};
o.prototype.render = function() {
var p = i.getActorIDs();
return (p.length > 1 ? j.createElement("div", {
className: this.props.className
}, j.createElement(g, {
actorIDs: p,
coverEnabled: false,
selectedActorID: this.state.selectedActorID,
onChange: this.$CommentsPluginAuthorSelector0,
tooltipConstructor: this.$CommentsPluginAuthorSelector1
})) : null);
};
e.exports = o;
}, null);
__d("CommentsPluginComposerReply.react", ["CommentsPluginActions", "CommentsPluginAuthorSelector.react", "CommentsPluginComposer.react", "CommentsPluginStore", "React", "XUIButton.react", "cx", "fbt"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n) {
b.__markCompiled && b.__markCompiled();
'use strict';
var o = k,
p = o.PropTypes,
q = k.Component;
for (var r in q)
if (q.hasOwnProperty(r)) t[r] = q[r];
var s = q === null ? null : q.prototype;
t.prototype = Object.create(s);
t.prototype.constructor = t;
t.__superConstructor__ = q;
function t(u, v) {
q.call(this, u, v);
this.state = {
waitingAsyncResponse: false
};
var w = this;
w.$CommentsPluginComposerReply0 = this.$CommentsPluginComposerReply0.bind(this);
w.$CommentsPluginComposerReply1 = this.$CommentsPluginComposerReply1.bind(this);
this.$CommentsPluginComposerReply2 = null;
}
t.prototype.componentDidMount = function() {
this.$CommentsPluginComposerReply2 = j.addListener('composerChange', function() {
return this.forceUpdate();
}.bind(this));
};
t.prototype.componentWillUnmount = function() {
if (this.$CommentsPluginComposerReply2) this.$CommentsPluginComposerReply2.remove();
};
t.prototype.$CommentsPluginComposerReply0 = function() {
this.setState({
waitingAsyncResponse: true
});
g.addReply(this.props.commentID);
};
t.prototype.$CommentsPluginComposerReply1 = function() {
g.cancelReply(this.props.commentID);
};
t.prototype.$CommentsPluginComposerReply3 = function() {
return (this.state.waitingAsyncResponse || j.isEmptyCreateComposer(this.props.commentID));
};
t.prototype.render = function() {
return (k.createElement(i, {
alwaysExpanded: true,
readOnly: this.state.waitingAsyncResponse,
parentCommentIDOfNewReply: this.props.commentID,
placeholder: n._("\u65b0\u589e\u56de\u8986\u2026\u2026")
}, k.createElement("div", {
className: "_5tr6 clearfix _2ph_"
}, k.createElement(l, {
disabled: this.$CommentsPluginComposerReply3(),
label: n._("\u56de\u8986"),
use: "confirm",
className: "rfloat _3-99",
onClick: this.$CommentsPluginComposerReply0
}), k.createElement(l, {
disabled: this.state.waitingAsyncResponse,
label: n._("\u53d6\u6d88"),
use: "default",
className: "rfloat _3-99",
onClick: this.$CommentsPluginComposerReply1
}), k.createElement(h, {
className: "rfloat"
}))));
};
t.propTypes = {
commentID: p.string.isRequired
};
e.exports = t;
}, null);
__d("CommentsPluginComment.react", ["ActorBio.react", "CenteredContainer.react", "CommentsPluginActions", "CommentsPluginCommentActions.react", "CommentsPluginComposerEdit.react", "CommentsPluginProfilePicture.react", "CommentsPluginMenu.react", "CommentsPluginComposerReply.react", "CommentsPluginStore", "HovercardLinkInterpolator", "Link.react", "Image.react", "React", "TruncatedTextWithEntities.react", "UFIActor.react", "UFICommentUtils.react", "UFIImageBlock.react", "XUIGrayText.react", "XUISpinner.react", "XUIText.react", "cx", "fbt", "joinClasses", "nullthrows", "xuiglyph"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, aa, ba, ca, da, ea) {
b.__markCompiled && b.__markCompiled();
'use strict';
var fa = s,
ga = fa.PropTypes,
ha = s.Component;
for (var ia in ha)
if (ha.hasOwnProperty(ia)) ka[ia] = ha[ia];
var ja = ha === null ? null : ha.prototype;
ka.prototype = Object.create(ja);
ka.prototype.constructor = ka;
ka.__superConstructor__ = ha;
function ka(pa, qa) {
ha.call(this, pa, qa);
this.state = {
showMenu: false
};
var ra = this;
ra.$CommentsPluginComment0 = this.$CommentsPluginComment0.bind(this);
ra.$CommentsPluginComment1 = this.$CommentsPluginComment1.bind(this);
}
ka.prototype.$CommentsPluginComment0 = function() {
this.setState({
showMenu: true
});
};
ka.prototype.$CommentsPluginComment1 = function() {
if (!this.refs.menu || !this.refs.menu.isOpen()) this.setState({
showMenu: false
});
};
ka.prototype.render = function() {
var pa = da(o.getByID(this.props.commentID));
if (pa.deleted) return null;
if (pa.editor) return (s.createElement("div", {
className: "_3-8y"
}, s.createElement(k, {
commentID: this.props.commentID
}), s.createElement(oa, {
commentID: this.props.commentID,
className: "_3j_p"
})));
var qa = v.shallowCopyRanges(pa.ranges),
ra = v.getCommentTextWithTruncatedURIs(qa, pa.body.text),
sa = null;
if (pa.collapsed || pa.flagged) {
sa = s.createElement("div", {
className: "_5mlf"
}, s.createElement(x, {
shade: "light"
}, ba._("\u9019\u5247\u7559\u8a00\u5df2\u7d93{action}", [ba.param("action", pa.collapsed ? 'collapsed' : 'flagged')])));
} else sa = ra ? s.createElement(t, s.__spread({
className: "_5mdd",
text: ra,
ranges: qa,
interpolator: function(xa, ya) {
return p(xa, ya, '_blank');
}
}, o.getCommentBodyTruncationLimits(), {
renderEmoticons: true,
renderEmoji: true
})) : null;
var ta = da(o.getByID(pa.authorID)),
ua = o.isOptimisticComment(pa),
va = o.isReply(this.props.commentID),
wa = o.isMobile();
return (s.createElement(w, {
className: (("_3-8y") + (!va ? ' ' + "_5nz1" : '')),
spacing: "medium",
onMouseEnter: this.$CommentsPluginComment0,
onMouseLeave: this.$CommentsPluginComment1
}, s.createElement(l, {
href: ta.uri,
src: ta.thumbSrc,
isReply: va,
target: "_blank"
}), s.createElement("div", null, s.createElement(u, {
author: ta,
delimiter: wa ? ' ' : undefined,
key: "author",
showHovercard: !wa,
target: "_blank"
}, ta.bio ? s.createElement("div", {
className: "_4q1v"
}, s.createElement(g, {
target: "_blank",
preferredTypes: ta.bio.preferredTypes,
stats: ta.bio.stats
})) : null), s.createElement("div", {
className: "_3-8m"
}, sa), ua || pa.collapsed || pa.flagged ? null : s.createElement(j, {
commentID: this.props.commentID
}), s.createElement(oa, {
commentID: this.props.commentID
})), s.createElement("div", null, this.state.showMenu && !ua && !wa ? s.createElement(m, {
ref: "menu",
commentID: this.props.commentID
}) : null)));
};
ka.propTypes = {
commentID: ga.string.isRequired
};
var la = s.Component;
for (var ma in la)
if (la.hasOwnProperty(ma)) oa[ma] = la[ma];
var na = la === null ? null : la.prototype;
oa.prototype = Object.create(na);
oa.prototype.constructor = oa;
oa.__superConstructor__ = la;
function oa(pa, qa) {
la.call(this, pa, qa);
this.state = {
loading: false
};
var ra = this;
ra.$CommentsPluginCommentReplies0 = this.$CommentsPluginCommentReplies0.bind(this);
}
oa.prototype.$CommentsPluginCommentReplies0 = function() {
this.setState({
loading: true
});
o.addListener('moreRepliesCompleted', function(event) {
if (this.props.commentID === event.commentID) {
this.setState({
loading: false
});
o.removeCurrentListener();
}
}.bind(this));
i.showMoreReplies(this.props.commentID);
};
oa.prototype.render = function() {
var pa = o.getByID(this.props.commentID),
qa = pa.public_replies;
if (qa === undefined || pa.collapsed === true || pa.flagged) return pa.composer ? s.createElement("div", {
className: ca("_44ri _2pis _3-8y", this.props.className)
}, s.createElement(n, {
commentID: this.props.commentID
})) : null;
if (!qa.commentIDs) qa.commentIDs = [];
var ra = qa.totalCount - qa.commentIDs.length,
sa = o.getPageSize(),
ta = ra < sa ? ra : sa;
return (s.createElement("div", {
className: ca("_44ri _2pis", this.props.className)
}, qa.commentIDs.map(function(ua) {
if (ua === this.props.commentID) return null;
return s.createElement(ka, {
commentID: ua,
key: ua
});
}.bind(this)), o.hasUnloadedReplies(this.props.commentID) && ra > 0 ? s.createElement("div", {
className: "_5yct _3-8y _3-96 _2ph-"
}, this.state.loading ? s.createElement(h, null, s.createElement(y, {
size: "small"
})) : s.createElement(q, {
onClick: this.$CommentsPluginCommentReplies0
}, s.createElement(z, {
size: "small",
weight: "bold"
}, ta === 1 ? ba._("\u986f\u793a\u8a0e\u8ad6\u4e32\u7684\u53e6 1 \u5247\u56de\u8986") : ba._("\u986f\u793a\u8a0e\u8ad6\u4e32\u7684\u5176\u4ed6{number of replies}\u5247\u56de\u8986", [ba.param("number of replies", ta)])), s.createElement(r, {
src: ea({
name: 'triangle-down'
})
}))) : null, pa.composer ? s.createElement("div", {
className: "_3-8y"
}, s.createElement(n, {
commentID: this.props.commentID
})) : null));
};
oa.propTypes = {
commentID: ga.string.isRequired
};
e.exports = ka;
}, null);
__d("CommentsPluginLoadMore.react", ["CenteredContainer.react", "CommentsPluginActions", "CommentsPluginStore", "React", "XUIButton.react", "XUISpinner.react", "cx", "fbt"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n) {
b.__markCompiled && b.__markCompiled();
'use strict';
var o = j.Component;
for (var p in o)
if (o.hasOwnProperty(p)) r[p] = o[p];
var q = o === null ? null : o.prototype;
r.prototype = Object.create(q);
r.prototype.constructor = r;
r.__superConstructor__ = o;
function r(s, t) {
o.call(this, s, t);
this.state = {
loading: false
};
var u = this;
u.$CommentsPluginLoadMore0 = this.$CommentsPluginLoadMore0.bind(this);
}
r.prototype.$CommentsPluginLoadMore0 = function() {
h.showMoreComments();
this.setState({
loading: true
});
i.addListener('moreCommentsCompleted', function() {
this.setState({
loading: false
});
i.removeCurrentListener();
}.bind(this));
};
r.prototype.render = function() {
var s = i.getUnloadedCommentsCount();
if (!i.hasUnloadedComments() || s < 1) return null;
if (this.state.loading) return (j.createElement(g, {
className: "_ndl"
}, j.createElement(l, {
size: "large"
})));
var t = i.getPageSize(),
u = s < t ? s : t;
return (j.createElement("div", {
className: "_5o4h"
}, j.createElement(k, {
className: "_1gl3",
role: "button",
onClick: this.$CommentsPluginLoadMore0,
label: u === 1 ? n._("\u8f09\u5165\u53e6 1 \u5247\u7559\u8a00") : n._("\u8f09\u5165\u5176\u4ed6{pagesize}\u5247\u7559\u8a00", [n.param("pagesize", u)])
})));
};
e.exports = r;
}, null);
__d("CommentsPluginListing.react", ["CommentsPluginComment.react", "CommentsPluginLoadMore.react", "CommentsPluginStore", "React", "cx"], function(a, b, c, d, e, f, g, h, i, j, k) {
b.__markCompiled && b.__markCompiled();
'use strict';
var l = j.Component;
for (var m in l)
if (l.hasOwnProperty(m)) o[m] = l[m];
var n = l === null ? null : l.prototype;
o.prototype = Object.create(n);
o.prototype.constructor = o;
o.__superConstructor__ = l;
function o() {
if (l !== null) l.apply(this, arguments);
}
o.prototype.render = function() {
var p = i.getCommentIDs(),
q = p.map(function(r) {
return j.createElement(g, {
commentID: r,
key: r
});
});
return (j.createElement("div", {
className: "_4k-6"
}, q, j.createElement(h, null)));
};
e.exports = o;
}, null);
__d("CommentsPluginComposerComment.react", ["CommentsPluginActions", "CommentsPluginAuthorSelector.react", "CommentsPluginComposer.react", "CommentsPluginStore", "InputLabel.react", "LeftRight.react", "React", "XUIButton.react", "XUICheckboxInput.react", "cx", "fbt"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) {
b.__markCompiled && b.__markCompiled();
'use strict';
var r = m.Component;
for (var s in r)
if (r.hasOwnProperty(s)) u[s] = r[s];
var t = r === null ? null : r.prototype;
u.prototype = Object.create(t);
u.prototype.constructor = u;
u.__superConstructor__ = r;
function u(v) {
r.call(this, v);
this.state = {
selectedActorID: j.getUser().id,
postToFeed: false,
waitingAsyncResponse: false
};
var w = this;
w.$CommentsPluginComposerComment0 = this.$CommentsPluginComposerComment0.bind(this);
w.$CommentsPluginComposerComment1 = this.$CommentsPluginComposerComment1.bind(this);
}
u.prototype.componentDidMount = function() {
j.addListener('composerChange', function() {
return this.forceUpdate();
}.bind(this));
j.addListener('composerCommentAdded', function() {
this.setState({
waitingAsyncResponse: false
});
}.bind(this));
j.addListener('login', function() {
this.setState({
waitingAsyncResponse: false
});
}.bind(this));
};
u.prototype.$CommentsPluginComposerComment1 = function(event) {
var v = !this.state.postToFeed;
this.setState({
postToFeed: v
});
g.setPostToFeed(v);
};
u.prototype.$CommentsPluginComposerComment2 = function() {
var v = this.state.selectedActorID;
if (v !== j.LOGGED_OUT_USER) return v;
return j.getUser().id;
};
u.prototype.$CommentsPluginComposerComment0 = function() {
this.setState({
waitingAsyncResponse: true
});
g.setPostToFeed(this.state.postToFeed);
g.addComment();
};
u.prototype.$CommentsPluginComposerComment3 = function() {
return (this.state.waitingAsyncResponse || j.isEmptyCreateComposer());
};
u.prototype.render = function() {
var v = j.isLoggedIn() ? q._("\u767c\u4f48") : q._("\u767b\u5165\u5373\u53ef\u767c\u4f48\u8cbc\u6587");
return (m.createElement(i, {
className: "_2392",
readOnly: this.state.waitingAsyncResponse
}, m.createElement(l, {
className: "_5tr6 clearfix _2ph-"
}, !j.isMirrored() ? m.createElement(k, {
className: "_1u0n"
}, m.createElement(o, {
checked: this.state.postToFeed,
onChange: this.$CommentsPluginComposerComment1
}), m.createElement("label", {
className: "_3-99 _2ern _50f8 _5kx5"
}, q._("\u540c\u6642\u767c\u4f48\u5230 Facebook"))) : m.createElement("span", null), m.createElement("span", null, m.createElement(n, {
disabled: this.$CommentsPluginComposerComment3(),
label: v,
use: "confirm",
className: "rfloat _3-99",
onClick: this.$CommentsPluginComposerComment0
}), m.createElement(h, {
className: "rfloat"
})))));
};
e.exports = u;
}, null);
__d("XPluginCommentsConfirmPostToFacebookAsyncDialogController", ["XController"], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = b("XController").create("\/plugins\/comments\/{comment_id}\/async\/confirm\/publish\/dialog\/", {
comment_id: {
type: "String",
required: true
},
__asyncDialog: {
type: "Int"
}
});
}, null);
__d("CommentsPlugin.react", ["AsyncDialog", "AsyncRequest", "CommentsPluginFooter.react", "CommentsPluginHeader.react", "CommentsPluginListing.react", "CommentsPluginComposerComment.react", "CommentsPluginStore", "XPluginCommentsConfirmPostToFacebookAsyncDialogController", "DOMQuery", "PluginResize", "React", "CommentsPluginSentryAction", "SimpleXUIDialog", "cx", "fbt", "getElementPosition", "joinClasses"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) {
b.__markCompiled && b.__markCompiled();
'use strict';
var x = q,
y = x.PropTypes,
z = q.Component;
for (var aa in z)
if (z.hasOwnProperty(aa)) ca[aa] = z[aa];
var ba = z === null ? null : z.prototype;
ca.prototype = Object.create(ba);
ca.prototype.constructor = ca;
ca.__superConstructor__ = z;
function ca() {
if (z !== null) z.apply(this, arguments);
}
ca.prototype.componentWillMount = function() {
m.init(this.props.comments, this.props.meta, this.props.initialOrdering);
m.addListener('postError', function(da) {
s.show(!!da.errorSummary ? da.errorSummary : u._("\u5f88\u62b1\u6b49\uff0c\u767c\u751f\u4e86\u932f\u8aa4\u3002\u8acb\u7a0d\u5f8c\u518d\u8a66\u3002"));
});
m.addListener('sentryAction', function(da, ea) {
switch (da) {
case r.CONFIRM_POST_TO_PROFILE:
var fa = n.getURIBuilder().setString('comment_id', ea).getURI();
g.send(new h(fa).setData({
iframe_referer: m.getIframeReferer()
}));
break;
default:
break;
}
});
};
ca.prototype.componentDidMount = function() {
p.auto(q.findDOMNode(this));
var da = q.findDOMNode(this);
new p(function() {
return da.offsetWidth;
}, function() {
var ea = da.offsetHeight;
if (m.getCommentsCount() > 1) return ea;
var fa = o.scry(document.body, '.uiLayer:not(.hidden_elem) .uiContextualLayer');
if (fa.length === 0) return ea;
var ga = v(fa[0]);
return Math.max(ea, ga.y + ga.height + 1);
}, 'resize.iframe', false).resize().auto();
m.addListener('change', function() {
this.forceUpdate();
}.bind(this));
};
ca.prototype.render = function() {
return (q.createElement("div", {
className: w("_56q9", this.props.className)
}, q.createElement("div", {
className: "_2pi8"
}, q.createElement(j, null), q.createElement(l, null), q.createElement(k, null), q.createElement(i, null))));
};
ca.propTypes = {
comments: y.object.isRequired,
meta: y.object.isRequired,
initialOrdering: y.string.isRequired
};
e.exports = ca;
}, null);
/*!CK:3369105415!*/ /*1429023754,*/
if (self.CavalryLogger) {
CavalryLogger.start_js(["qIUhH"]);
}
__d("AYMTHomepagePanelPostViewWrap.react", ["ApiClient", "Event", "HubbleContext", "HubbleDrillDownMixin", "HubblePostDrillDown", "React"], function(a, b, c, d, e, f, g, h, i, j, k, l) {
b.__markCompiled && b.__markCompiled();
var m = l,
n = m.PropTypes,
o = l.createClass({
displayName: "AYMTHomepagePanelPostViewWrap",
mixins: [j],
propTypes: {
drilldown: n.element,
post: n.object,
link: n.object,
context: n.object
},
getDefaultProps: function() {
return {
drilldown: l.createElement(k, null)
};
},
getInitialState: function() {
return {
showDrillDown: false
};
},
handlePost: function() {
if (!this.props.post) return;
this.setState({
drilldownProps: {
postCreatedTime: this.props.post.created_time,
postID: this.props.post.id,
postIdentifier: this.props.post.identifier,
postType: this.props.post.type,
postStatusType: this.props.post.status_type,
ref: 'AYMT_homepage_panel'
},
showDrillDown: true
});
return false;
},
componentWillMount: function() {
h.listen(this.props.link, 'click', function() {
g.setClientID(this.props.context.appID);
g.setAccessToken(this.props.context.accessToken);
i.setContext(this.props.context);
this.handlePost();
}.bind(this));
},
render: function() {
return (l.createElement("div", null));
}
});
e.exports = o;
}, null);
__d("AYMTRefreshElement", ["CSS", "URI", "DOM", "DOMQuery", "csx", "ge"], function(a, b, c, d, e, f, g, h, i, j, k, l) {
b.__markCompiled && b.__markCompiled();
e.exports = {
init: function(m, n) {
m.subscribe('itemclick', function() {
g.addClass(n, 'async_saving');
});
},
initObjectSelector: function(m, n) {
m.subscribe('itemclick', function() {
var o = m.getFocusedItem(),
p = new h(o._data.ajaxify).getQueryData(),
q = p.promoted_object,
r = j.scry(l('aymt_object_section'), "._2eka img")[0],
s = j.scry(l('aymt_object_section'), "._2ekc a")[0],
t;
if (s !== (void 0)) {
t = new h(s.dataset.hovercard);
t.setQueryData({
id: q
});
i.setAttributes(s, {
'data-hovercard': t.toString()
});
i.setAttributes(s, {
href: '#'
});
} else s = j.scry(l('aymt_object_section'), "._2ekc span")[0];
i.setContent(s, o._data.label);
if (r !== (void 0)) {
if (t === (void 0)) {
t = new h(r.parentNode.dataset.hovercard);
t.setQueryData({
id: q
});
}
i.setAttributes(r, {
src: o._data.iconsrc
});
i.setAttributes(r.parentNode, {
'data-hovercard': (t ? t.toString() : '#'),
href: '#'
});
}
g.addClass(n, 'async_saving');
});
},
initTimeRangeSelector: function(m, n) {
m.subscribe('itemclick', function() {
var o = m.getFocusedItem(),
p = j.scry(l('aymt_campaign_section'), "span ._2ekc")[0];
i.setContent(p, o._data.label);
g.addClass(n, 'async_saving');
});
},
fromLink: function(m, n) {
m.onclick = function() {
g.addClass(n, 'async_saving');
};
}
};
}, null);
__d("AYMTHomepagePanelLogger", ["Event", "BanzaiLogger"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
var i = {
init: function(j, k) {
g.listen(j, 'click', function(event) {
h.log('AYMTHomepagePanelLoggerConfig', k);
});
}
};
e.exports = i;
}, null);
/*!CK:757870690!*/ /*1438697692,*/
if (self.CavalryLogger) {
CavalryLogger.start_js(["9pt1q"]);
}
__d("NotificationSeenState", ["NotificationConstants", "NotificationUpdates", "createObjectFrom"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
var j = {},
k = 1,
l = 2,
m = 0,
n = k,
o = k | l,
p = g.PayloadSourceType.INITIAL_LOAD,
q = {
UNSEEN_AND_UNREAD: m,
SEEN_BUT_UNREAD: n,
SEEN_AND_READ: o
};
function r(u) {
var v = [],
w = [];
Object.keys(u).forEach(function(x) {
var y = u[x],
z = j[x];
j[x] = y;
if (z === (void 0)) {
v.push(x);
w.push(x);
return;
}
var aa = z ^ y;
if (aa & k) v.push(x);
if (aa & l) w.push(x);
});
v.length && h.didUpdateSeenState(v);
w.length && h.didUpdateReadState(w);
}
h.subscribe('update-notifications', function(u, v) {
var w = v.nodes;
if (!w || !w.length) return;
var x = v.payloadsource,
y = g.PayloadSourceType,
z = x == y.ENDPOINT,
aa = {};
v.nodes.forEach(function(ba) {
var ca = ba.alert_id;
if (!z || j[ca] === (void 0)) aa[ca] = q[ba.seen_state];
});
r(aa);
});
h.subscribe('update-seen', function(u, v) {
if (!v.seenState) return;
var w = [],
x = {};
Object.keys(v.seenState).forEach(function(z) {
if (!v.seenState[z]) {
w.push(z);
return;
}
var aa = j[z];
if (aa !== (void 0)) x[z] = aa | k;
});
var y = Object.assign({}, i(w, m), x);
r(y);
});
h.subscribe('update-read', function(u, v) {
if (!v.readState) return;
var w = [],
x = {};
Object.keys(v.readState).forEach(function(z) {
if (v.readState[z]) {
w.push(z);
return;
}
var aa = j[z];
if (aa !== (void 0)) {
x[z] = aa & ~l;
} else if (v.payloadsource == p) x[z] = n;
});
var y = Object.assign({}, i(w, o), x);
r(y);
});
function s(u) {
var v = j[u];
return v;
}
var t = {
isRead: function(u) {
return s(u) === o;
},
isSeen: function(u) {
return s(u) !== m;
},
getUnseenCount: function() {
return t.getUnseenIDs().length;
},
getUnseenIDs: function() {
return Object.keys(j).filter(function(u) {
return j[u] === m;
});
},
getUnreadCount: function() {
return t.getUnreadIDs().length;
},
getUnreadIDs: function() {
return Object.keys(j).filter(function(u) {
return j[u] !== o;
});
}
};
e.exports = t;
}, null);
__d("NotificaionJewelControllerModuleLoader", ["JSResource", "NotificationSeenState", "NotificationStore", "NotificationUpdates"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
b('NotificationSeenState');
b('NotificationStore');
b('NotificationUpdates');
e.exports = g('NotificationJewelController');
}, null);
__d("NotificationJewelHeaderController", ["DOM", "Event", "NotificationSeenState", "NotificationUserActions", "NotificationUpdates"], function(a, b, c, d, e, f, g, h, i, j, k) {
b.__markCompiled && b.__markCompiled();
function l(m, n) {
"use strict";
h.listen(m, 'click', function() {
var o = i.getUnreadIDs();
if (o.length) j.markNotificationsAsRead(o);
});
k.subscribe('read-state-updated', function() {
if (n) g.setContent(n, i.getUnreadCount());
});
}
e.exports = l;
}, null);
__d("NotificationGNFState", ["NotificationUpdates", "isEmpty"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
var i = {};
g.subscribe('update-notifications', function(k, l) {
var m = l.nodes;
if (!m || !m.length) return;
var n = {};
l.nodes.forEach(function(o) {
var p = o.alert_id;
if (i[p] !== o.gaveGNF) n[p] = o.gaveGNF;
});
if (!h(n)) {
i = Object.assign(i, n);
g.didUpdateGNFState(Object.keys(n));
}
});
g.subscribe('update-gnf', function(k, l) {
if (l.gnfState) {
i = Object.assign(i, l.gnfState);
g.didUpdateGNFState(Object.keys(l.gnfState));
}
});
var j = {
gaveGNF: function(k) {
return !!i[k];
}
};
e.exports = j;
}, null);
__d("NotificationHiddenState", ["NotificationUpdates", "NotificationConstants", "isEmpty"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
var j = {};
g.subscribe('update-notifications', function(l, m) {
var n = m.nodes,
o = m.payloadsource;
if (o === h.PayloadSourceType.LIVE_SEND && n && n.length) {
var p = {};
n.forEach(function(q) {
var r = q.alert_id;
if (j[r]) p[r] = false;
});
if (!i(p)) {
j = Object.assign(j, p);
g.didUpdateHiddenState(Object.keys(p));
}
}
});
g.subscribe('update-hidden', function(l, m) {
if (m.hiddenState) {
j = Object.assign(j, m.hiddenState);
g.didUpdateHiddenState(Object.keys(m.hiddenState));
}
});
var k = {
isHidden: function(l) {
if (j[l]) return j[l];
return false;
}
};
e.exports = k;
}, null);
__d("NotificationList.react", ["NotificationConstants", "NotificationGNFState", "NotificationHiddenState", "NotificationSeenState", "NotificationStore", "NotificationUpdates", "NotificationUserActions", "React", "getObjectValues", "isEmpty", "mapObject"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) {
b.__markCompiled && b.__markCompiled();
var r = n,
s = r.PropTypes,
t = g.PayloadSourceType.LIVE_SEND,
u = n.createClass({
displayName: "NotificationList",
propTypes: {
businessID: s.string,
hasEverBeenOpened: s.bool,
maxHeight: s.number,
negativeTracking: s.object,
paused: s.bool,
tracking: s.string,
useChevron: s.bool,
numPerPage: s.number.isRequired,
listRenderer: s.func.isRequired,
upsell: s.object
},
getInitialState: function() {
this._currentlyFetching = false;
this._pendingNotifs = {};
this._shouldScroll = false;
var v = q(this.props.staticNotifs, function(w) {
return !!w.gaveGNF;
});
return {
canFetchMore: true,
notifs: {},
hiddenState: {},
readState: {},
gnfState: v || {},
showingChevron: false
};
},
componentWillMount: function() {
k.setBusinessID(this.props.businessID);
this._subscriptions = [l.subscribe('notifications-updated', function(v, w) {
if (w.source == t && !p(w.updates)) {
this._shouldScroll = true;
if (this.props.paused !== false) this._pendingNotifs = Object.assign({}, this._pendingNotifs, w.updates);
return;
}
this._fetchAndUpdate(k.getCount());
}.bind(this)), l.subscribe(['hidden-state-updated', 'read-state-updated', 'gnf-state-updated'], function(v, w) {
if (v == 'hidden-state-updated') {
if (w.source !== t || !this.props.paused) {
var x = {};
Object.keys(w.updates).forEach(function(aa) {
x[aa] = i.isHidden(aa);
});
this.setState({
hiddenState: Object.assign({}, this.state.hiddenState, x)
});
}
} else if (v == 'gnf-state-updated') {
var y = {};
Object.keys(w.updates).forEach(function(aa) {
y[aa] = h.gaveGNF(aa);
});
this.setState({
gnfState: Object.assign({}, this.state.gnfState, y)
});
} else {
var z = {};
Object.keys(w.updates).forEach(function(aa) {
z[aa] = j.isRead(aa);
});
this.setState({
readState: Object.assign({}, this.state.readState, z)
});
}
}.bind(this))];
},
componentWillUnmount: function() {
if (this._subscriptions) {
while (this._subscriptions.length) this._subscriptions.pop().unsubscribe();
this._subscriptions = null;
}
},
_getNotifsWithCurrentOrder: function(v) {
var w = Object.keys(this.state.notifs),
x = Object.keys(v).filter(function(z) {
return !this.state.notifs[z];
}.bind(this));
w = w.concat(x);
var y = {};
w.forEach(function(z) {
if (this._pendingNotifs[z]) {
if (this.state.notifs[z]) y[z] = this.state.notifs[z];
} else y[z] = v[z];
}.bind(this));
return y;
},
_fetchAndUpdate: function(v) {
this._currentlyFetching = true;
k.getNotifications(v, function(w) {
var x = p(this._pendingNotifs) ? w : this._getNotifsWithCurrentOrder(w),
y = {},
z = {},
aa = {};
o(x).forEach(function(ba) {
var ca = ba.alert_id;
if (!this.state || !this.state.readState[ca]) y[ca] = j.isRead(ca);
if (!this.state || !this.state.hiddenState[ca]) z[ca] = i.isHidden(ca);
if (!this.state || !this.state.gnfState[ca]) aa[ca] = h.gaveGNF(ca);
});
this._currentlyFetching = false;
this.setState({
notifs: x,
canFetchMore: k.canFetchMore() || k.getCount() != Object.keys(x).length,
readState: Object.assign({}, this.state.readState, y),
hiddenState: Object.assign({}, this.state.hiddenState, z),
gnfState: Object.assign({}, this.state.gnfState, aa)
});
}.bind(this));
},
_fetchAndUpdateAll: function() {
var v = {};
Object.keys(this._pendingNotifs).forEach(function(w) {
var x = i.isHidden(w);
if (x != this.state.hiddenState[w]) v[w] = i.isHidden(w);
}.bind(this));
if (!p(v)) this.setState({
hiddenState: Object.assign({}, this.state.hiddenState, v)
});
this._pendingNotifs = {};
this._fetchAndUpdate(k.getCount());
},
_fetchNextSet: function() {
if (!this._currentlyFetching) {
var v = Object.keys(this.state.notifs).length;
this._fetchAndUpdate(v + this.props.numPerPage);
}
},
_onScrollAndUpdate: function(v) {
if (this._currentlyFetching || !this.state.canFetchMore) return;
if (v) this._fetchNextSet();
},
_onChevronShow: function() {
this.setState({
showingChevron: true
});
},
_onChevronHide: function() {
this.setState({
showingChevron: false
});
},
_updateNotifInContainer: function(v) {
if (v.length > this.props.numPerPage) {
this._fetchAndUpdate(v.length);
} else this._fetchNextSet();
return;
},
componentDidUpdate: function(v) {
var w = j.getUnseenIDs();
if (!p(this._pendingNotifs)) w = w.filter(function(x) {
return !this._pendingNotifs[x];
}.bind(this));
if (w.length && this.props.paused) m.markNotificationsAsSeen(w);
if (!v.hasEverBeenOpened && this.props.hasEverBeenOpened) this._updateNotifInContainer(w);
if (v.paused && !this.props.paused) {
this._shouldScroll = false;
setTimeout(this._fetchAndUpdateAll, 0);
return;
}
},
render: function() {
var v = this.props.listRenderer;
return (n.createElement(v, {
hasEverBeenOpened: this.props.hasEverBeenOpened,
paused: this.props.paused,
tracking: this.props.tracking,
negativeTracking: this.props.negativeTracking,
shortenTimestamp: this.props.shortenTimestamp,
businessID: this.props.businessID,
maxHeight: this.props.maxHeight,
useChevron: this.props.useChevron,
notifs: this.state.notifs,
afterScroll: this._onScrollAndUpdate,
onChevronShow: this._onChevronShow,
onChevronHide: this._onChevronHide,
canFetchMore: this.state.canFetchMore,
hiddenState: this.state.hiddenState,
readState: this.state.readState,
gnfState: this.state.gnfState,
showingChevron: this.state.showingChevron,
shouldScroll: this._shouldScroll,
upsell: this.props.upsell || null,
isRHC: this.props.isRHC
}));
}
});
e.exports = u;
}, null);
__d("NotificationListPropTypes", ["React"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
'use strict';
var h = g,
i = h.PropTypes,
j = {
negativeTracking: i.object,
tracking: i.string,
useChevron: i.bool,
notifs: i.object,
afterScroll: i.func,
onChevronShow: i.func,
onChevronHide: i.func,
canFetchMore: i.bool,
hiddenState: i.object,
readState: i.object,
gnfState: i.object,
showingChevron: i.bool,
paused: i.bool,
maxHeight: i.number,
shouldScroll: i.bool,
upsell: i.object
};
e.exports = j;
}, null);
__d("FlexibleBlock.react", ["LeftRight.react", "React", "cx", "invariant", "keyMirror"], function(a, b, c, d, e, f, g, h, i, j, k) {
b.__markCompiled && b.__markCompiled();
var l = k({
left: true,
right: true
});
function m(o) {
j(o.flex && o.flex in n.FLEX);
j(o.children && o.children.length === 2);
}
var n = h.createClass({
displayName: "FlexibleBlock",
render: function() {
m(this.props);
var o, p = this.props.children[0],
q = this.props.children[1],
r = this.props.flex == l.left,
s;
if (r) {
s = p;
o = g.DIRECTION.right;
} else {
s = q;
o = g.DIRECTION.left;
}
var t = h.createElement("div", {
className: "_42ef"
}, s);
return (h.createElement(g, h.__spread({}, this.props, {
direction: o
}), r ? t : this.props.children[0], r ? this.props.children[1] : t));
}
});
n.FLEX = l;
e.exports = n;
}, null);
__d("NotificationPhotoThumbnail", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
function g(i) {
if (!i.media || !i.style_list || !i.style_list.length) return null;
switch (i.style_list[0]) {
case 'new_album':
case 'album':
case 'application':
case 'photo':
case 'video':
case 'video_autoplay':
case 'video_inline':
return i.media.image;
default:
return null;
}
}
var h = {
getThumbnail: function(i, j, k) {
var l;
if (i && i.length) {
i.some(function(p) {
l = g(p);
if (l) return true;
return false;
});
if (l) return l;
}
if (k) {
var m = k.relevant_comments;
if (m && m.length) {
var n = m[0].attachments;
if (n && n.length) {
l = g(n[0]);
if (l) return l;
}
}
}
if (j) {
var o = j.attachments;
if (o && o.length) return g(o[0]);
}
return null;
}
};
e.exports = h;
}, null);
__d("NotificationURI", ["BusinessURI.brands", "URI", "isFacebookURI", "VideoPermalinkURI"], function(a, b, c, d, e, f, g, h, i, j) {
b.__markCompiled && b.__markCompiled();
var k = {
localize: function(l) {
l = g(l);
if (!i(l)) return l.toString();
var m = l.getSubdomain();
return l.getUnqualifiedURI().getQualifiedURI().setSubdomain(m).toString();
},
snowliftable: function(l) {
if (!l) return false;
l = new h(l);
var m = l.getQueryData();
return i(l) && (j.isValid(l) || 'fbid' in m);
},
isVaultSetURI: function(l) {
return this._areEquals(l, '/ajax/vault/sharer_preview.php');
},
isAlbumDraftRecoveryDialogURI: function(l) {
return this._areEquals(l, '/ajax/photos/upload/overlay/');
},
_areEquals: function(l, m) {
if (!l) return false;
l = new h(l);
return i(l) && l.getPath() === m;
},
_startsWith: function(l, m) {
if (!l) return false;
l = new h(l);
return i(l) && l.getPath().startsWith(m);
}
};
e.exports = k;
}, null);
__d("NotificationListItem.react", ["AsyncResponse", "BizSiteIdentifier.brands", "BanzaiLogger", "CloseButton.react", "Event", "FlexibleBlock.react", "ImageBlock.react", "Keys", "List.react", "NotificationPhotoThumbnail", "NotificationTokens", "NotificationURI", "NotificationUserActions", "React", "TextWithEntities.react", "ReadToggle.react", "Timestamp.react", "VaultBoxURI", "XUIButton.react", "PopoverMenu.react", "ReactXUIMenu", "cx", "invariant", "fbt"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, aa, ba, ca, da) {
b.__markCompiled && b.__markCompiled();
var ea = aa.Item;
function fa(ia, ja) {
return t.createElement("span", {
className: "fwb"
}, ia);
}
function ga(ia) {
return !!(ia && ia.id && !ia.is_facebook_app);
}
var ha = t.createClass({
displayName: "NotificationListItem",
getInitialState: function() {
return {
showingOptions: false,
negativeFeedbackConfirmation: null,
canReportAsSpam: false,
spamReportConfirmation: null,
sendingFeedback: false,
mayUndoHide: false,
genericNegativeFeedbackConfirmation: null,
isBizSite: h.isBizSite()
};
},
_onKeyDownItem: function(ia) {
if (k.getKeyCode(ia.nativeEvent) == n.RETURN) this._markItemRead();
},
_markItemReadIfUnreadFromReadButton: function() {
if (!this.props.isRead) s.setNextIsFromReadButton(true);
this._markItemReadIfUnread();
},
_markItemReadIfUnread: function() {
!this.props.isRead && this._markItemRead();
},
_markItemRead: function() {
s.markNotificationsAsRead([this.props.alert_id]);
},
_onFeedbackError: function(ia) {
g.defaultErrorHandler(ia);
this.setState({
sendingFeedback: false
});
},
_onHideSuccess: function(ia) {
var ja = ia.getPayload();
ca(ja.confirmation);
this.setState({
negativeFeedbackConfirmation: ja.confirmation,
canReportAsSpam: ja.canReportAsSpam,
sendingFeedback: false,
showingOptions: true
});
},
_onHideAppSuccess: function(ia) {
var ja = ia.getPayload(),
ka = ja.confirmation,
la = ja.canReportAsSpam;
ca(ka);
this.setState({
negativeFeedbackConfirmation: ka,
canReportAsSpam: la,
mayUndoHide: true,
sendingFeedback: false,
showingOptions: true
});
},
_onSpamReportSuccess: function(ia) {
var ja = ia.getPayload().spamReportConfirmation;
this.setState({
negativeFeedbackConfirmation: null,
spamReportConfirmation: ja,
sendingFeedback: false
});
},
_onHide: function() {
s.markNotificationAsHidden(this.props.alert_id, this._onHideSuccess, this._onFeedbackError);
this.setState({
sendingFeedback: true,
mayUndoHide: true
});
},
_onShowSuccess: function() {
this.setState({
genericNegativeFeedbackConfirmation: null,
negativeFeedbackConfirmation: null,
sendingFeedback: false,
showingOptions: false
});
},
_onShow: function() {
var ia = this.props.negative ? this.props.negative.subscription_level : null;
s.markNotificationAsVisible(this.props.alert_id, ia, this._onShowSuccess, this._onFeedbackError);
this.setState({
sendingFeedback: true
});
},
_onReportSpam: function() {
s.markNotificationAsSpam(this.props.alert_id, this._onSpamReportSuccess, this._onFeedbackError);
this.setState({
sendingFeedback: true
});
},
_markAppAsHidden: function() {
s.markAppAsHidden(this.props.alert_id, this.props.application.id, this._onHideAppSuccess, this._onFeedbackError);
this.setState({
sendingFeedback: true
});
},
_markAppAsVisible: function() {
s.markAppAsVisible(this.props.alert_id, this.props.application.id, function() {
this.setState({
negativeFeedbackConfirmation: null,
sendingFeedback: false,
showingOptions: false,
mayUndoHide: false
});
}.bind(this), this._onFeedbackError);
this.setState({
sendingFeedback: true
});
},
_renderAttachedImage: function(ia) {
if (ia) return (t.createElement("img", {
src: ia.uri,
className: "_42td",
"aria-hidden": true
}));
return t.createElement("span", null);
},
_getModifiedTrackingString: function(ia) {
return JSON.stringify(Object.assign({}, JSON.parse(this.props.tracking), ia));
},
_onClickCloseButton: function() {
if (this.props.useChevron) {
this.showCloseOptionOnMenuClose = true;
} else this.setState({
showingOptions: true
});
},
_onCancelNegativeFeedback: function() {
this.setState({
showingOptions: false
});
},
shouldComponentUpdate: function(ia, ja) {
return (this.props.visible !== ia.visible || this.props.isRead !== ia.isRead || this.props.timestamp !== ia.timestamp || this.props.gnfGiven !== ia.gnfGiven || this.props.paused !== ia.paused || this.state.showingOptions !== ja.showingOptions || this.state.sendingFeedback !== ja.sendingFeedback || this.state.canReportAsSpam !== ja.canReportAsSpam || this.state.spamReportConfirmation !== ja.spamReportConfirmation);
},
componentWillReceiveProps: function(ia) {
if (this.props.paused && !ia.paused && !this.props.visible && this.state.mayUndoHide) this.setState({
mayUndoHide: false
});
},
_onChevronHide: function() {
this.props.onChevronHide();
this._logChevronEvent('close');
if (this.showCloseOptionOnMenuClose) {
this.showCloseOptionOnMenuClose = false;
this._turnOff();
}
},
_turnOff: function() {
var ia = ga(this.props.application) ? this._markAppAsHidden : this._onHide;
ia();
},
_onChevronShow: function() {
this.props.onChevronShow();
this._logChevronEvent('open');
},
_logChevronEvent: function(ia) {
var ja = {
event: ia,
notif_type: this.props.notif_type,
notif_id: parseInt(q.untokenizeIDs([this.props.alert_id])[0], 10)
};
i.log('NotifJewelMenuLoggerConfig', ja);
},
_onGenericSuccess: function(ia) {
this.setState({
showingOptions: true,
sendingFeedback: false,
genericNegativeFeedbackConfirmation: ia
});
},
_onClickGenericNegative: function() {
this.setState({
sendingFeedback: true,
mayUndoHide: true
});
s.giveGenericNegativeFeedback(this.props.alert_id, this._onGenericSuccess, this._onFeedbackError);
},
_undoGenericNegative: function() {
this.setState({
sendingFeedback: true
});
s.undoGenericNegativeFeedback(this.props.alert_id, this._onShowSuccess, this._onFeedbackError);
},
render: function() {
if (!this.props.visible && !this.state.mayUndoHide) return t.createElement("li", {
className: "_4_62"
});
var ia = this.props.negative,
ja = this.props.negativeTracking,
ka = (("_33c") + (!this.props.isRead ? ' ' + "_4af" : '') + (this.state.showingOptions ? ' ' + "_4ag" : '') + (this.state.sendingFeedback ? ' ' + "_4m8s" : ''));
if (this.state.negativeFeedbackConfirmation) {
var la = this.state.negativeFeedbackConfirmation,
ma = null,
na = null;
if (this.state.canReportAsSpam)
if (!this.props.useChevron) {
ma = t.createElement("span", null, t.createElement("span", {
className: "mhs"
}, "·"), t.createElement("a", {
href: "#",
onClick: this._onReportSpam
}, da._("\u6aa2\u8209\u5783\u573e\u8a0a\u606f\u7684\u61c9\u7528\u7a0b\u5f0f")));
} else na = t.createElement(o, {
border: "none",
spacing: "small",
className: "_1v4c"
}, t.createElement("li", null, t.createElement("a", {
href: "#",
onClick: this._onReportSpam,
className: "mls"
}, da._("\u6aa2\u8209\u5783\u573e\u8a0a\u606f\u7684\u61c9\u7528\u7a0b\u5f0f"))));
var oa = ga(this.props.application) ? this._markAppAsVisible : this._onShow,
pa = !this.props.useChevron ? t.createElement("a", {
href: "#",
onClick: oa,
className: "mls"
}, da._("\u53d6\u6d88\u522a\u9664")) : null;
return (t.createElement("li", {
className: ka,
"data-gt": this.props.tracking
}, t.createElement("div", {
className: "_4ai"
}, t.createElement(u, {
interpolator: fa,
ranges: la.ranges,
aggregatedranges: la.aggregated_ranges,
text: la.text
}), pa, ma), na));
}
var qa = this.state.spamReportConfirmation;
if (qa) return (t.createElement("li", {
className: ka,
"data-gt": this.props.tracking
}, t.createElement("div", {
className: "_4ai"
}, t.createElement(u, {
interpolator: fa,
ranges: qa.ranges,
aggregatedranges: qa.aggregated_ranges,
text: qa.text
}))));
if (this.state.genericNegativeFeedbackConfirmation) {
la = this.state.genericNegativeFeedbackConfirmation;
var ra = ia ? t.createElement("li", null, t.createElement("a", {
href: "#",
"data-gt": xa,
onClick: this._turnOff,
className: "mls",
ref: "closeButton"
}, ia.menu_option_text)) : null;
return (t.createElement("li", {
className: ka,
"data-gt": this.props.tracking
}, t.createElement("div", {
className: "_4ai"
}, t.createElement(u, {
interpolator: fa,
ranges: la.ranges,
aggregatedranges: la.aggregated_ranges,
text: la.text
}), t.createElement("a", {
href: "#",
onClick: this._undoGenericNegative,
className: "mls"
}, da._("\u53d6\u6d88\u522a\u9664"))), t.createElement(o, {
border: "none",
spacing: "small",
className: "_1v4c"
}, ra)));
}
if (this.state.showingOptions && !this.props.useChevron) {
var sa = ga(this.props.application) ? this._markAppAsHidden : this._onHide;
return (t.createElement("li", {
className: ka,
"data-gt": this.props.tracking
}, t.createElement("div", {
className: "_4ai"
}, t.createElement("div", null, t.createElement(u, {
interpolator: fa,
ranges: ia.confirm_question.ranges,
aggregatedranges: ia.confirm_question.aggregated_ranges,
text: ia.confirm_question.text
})), t.createElement("div", {
className: "mts"
}, t.createElement(y, {
"data-gt": this._getModifiedTrackingString(ja.confirm),
href: {
url: '#'
},
label: ia.turn_off,
use: "confirm",
onClick: sa,
disabled: this.state.sendingFeedback
}), t.createElement(y, {
"data-gt": this._getModifiedTrackingString(ja.cancel),
href: {
url: '#'
},
label: da._("\u4fdd\u6301\u958b\u5553"),
onClick: this._onCancelNegativeFeedback,
disabled: this.state.sendingFeedback
})))));
}
var ta = null;
if (this.props.title) ta = t.createElement(u, {
interpolator: fa,
ranges: this.props.title.ranges,
aggregatedranges: this.props.title.aggregated_ranges,
text: this.props.title.text,
renderEmoji: true,
renderEmoticons: true
});
var ua = null,
va = null;
if (ia) {
var wa = this._onClickCloseButton,
xa;
xa = this._getModifiedTrackingString(ja.click);
var ya = (("_4ah") + (' ' + "_55m9"));
ua = t.createElement(j, {
className: ya,
"data-gt": xa,
size: "medium",
tooltip: ia.button_tooltip,
onClick: wa,
ref: "closeButton"
});
}
var za = r.localize(this.props.url),
ab = null;
if (!this.props.noPhotoPreviews) ab = p.getThumbnail(this.props.attachments, this.props.attached_story, this.props.feedback_context);
var bb = ab && r.snowliftable(za),
cb = r.isVaultSetURI(za),
db = r.isAlbumDraftRecoveryDialogURI(za),
eb = ((this.props.useChevron ? "_55ma" : '') + (' ' + "_55m9")),
fb = t.createElement(v, {
className: eb,
isRead: !!this.props.isRead,
onClick: this._markItemReadIfUnreadFromReadButton,
readLabel: da._("\u5df2\u95b1\u8b80"),
unreadLabel: da._("\u6a19\u793a\u70ba\u5df2\u8b80")
}),
gb = null;
if (this.props.useChevron) {
ua = null;
var hb = (("_1_0c") + (' ' + "_55m9")),
ib = null;
if (ia) ib = t.createElement(ea, {
onclick: this._onClickCloseButton,
"data-gt": xa,
ref: "closeButton"
}, t.createElement("div", {
className: "_3-y-"
}, ia.menu_option_title), t.createElement("div", {
className: "_3-y_"
}, ia.menu_option_text));
var jb = this.props.gnfGiven ? t.createElement(ea, {
onclick: this._undoGenericNegative
}, t.createElement("div", {
className: "_3-y-"
}, da._("\u4f60\u5c0d\u9019\u500b\u4e0d\u611f\u8208\u8da3")), t.createElement("div", {
className: "_3-y_"
}, da._("\u53d6\u6d88"))) : t.createElement(ea, {
onclick: this._onClickGenericNegative
}, t.createElement("div", {
className: "_3-y-"
}, da._("\u5c0d\u9019\u500b\u4e0d\u611f\u8208\u8da3\uff1f")), t.createElement("div", {
className: "_3-y_"
}, da._("\u544a\u8a34\u6211\u5011"))),
kb = t.createElement(aa, null, jb, ib);
gb = t.createElement(z, {
alignh: "right",
menu: kb,
className: hb,
onShow: this._onChevronShow,
onHide: this._onChevronHide
}, t.createElement("div", {
className: "_1_0d"
}));
}
var lb = (bb || cb || db) ? za : this.props.ajaxify_url,
mb = null,
nb = null,
ob = cb ? x.getSyncedTabURI().toString() : za;
if (bb) {
mb = 'theater';
} else if (db) {
mb = 'async-post';
} else if (cb || lb) mb = 'dialog';
var pb = null,
qb = this.props.actors[0];
if (qb) pb = {
backgroundImage: 'url(' + qb.profile_picture.uri + ')'
};
var rb = false;
this.props.attachments.forEach(function(tb) {
if (rb) return;
rb = tb.style_list.indexOf("notification_target") >= 0 || tb.style_list.indexOf("question") >= 0;
if (rb) return;
});
var sb = t.createElement("div", null, fb, ua, gb);
return (t.createElement("li", {
className: ka,
"data-gt": this.props.tracking,
onMouseLeave: va
}, t.createElement("div", {
className: "anchorContainer"
}, t.createElement("a", {
href: ob,
ajaxify: lb,
className: (("_33e") + (this.props.useChevron ? ' ' + "_1_0e" : '')),
rel: mb,
onClick: nb,
onMouseDown: this._markItemRead,
onKeyDown: this._onKeyDownItem
}, t.createElement(m, null, t.createElement("span", {
style: pb,
className: ((!this.props.isNotifsPage ? "_33h" : '') + (this.props.isNotifsPage ? ' ' + "_12u1" : ''))
}), t.createElement(l, {
flex: l.FLEX.left
}, t.createElement("div", {
className: "_4l_v"
}, ta, t.createElement(m, {
className: (("_33f") + (this.state.isBizSite ? ' ' + "_2g48" : ''))
}, t.createElement("img", {
className: "_10cu",
src: this.props.icon.uri
}), t.createElement("span", null, t.createElement(w, {
shorten: this.props.shortenTimestamp,
time: this.props.timestamp.time,
text: this.props.timestamp.text,
verbose: this.props.timestamp.verbose,
className: "_33g"
})))), this._renderAttachedImage(ab)))), sb)));
}
});
e.exports = ha;
}, null);
__d("NotificationJewelList.react", ["Animation", "Event", "LoadingIndicator.react", "NotificationListPropTypes", "NotificationListItem.react", "React", "ScrollableArea.react", "Vector", "cx", "debounce", "fbt", "getObjectValues", "isEmpty"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) {
b.__markCompiled && b.__markCompiled();
var t = 160,
u = 530,
v = 40,
w = 64,
x = 430,
y = l.createClass({
displayName: "NotificationJewelList",
propTypes: j,
_isLoadingIndicatorVisible: function() {
var z = this.refs.loading;
if (!z) return false;
var aa = l.findDOMNode(this.refs.scrollable),
ba = n.getElementDimensions(aa).y;
if (ba === 0) return false;
var ca = n.getElementPosition(aa).y + ba,
da = n.getElementPosition(l.findDOMNode(z)).y;
da -= v;
return da < ca;
},
_calculateHeight: function() {
var z = n.getViewportDimensions().y,
aa = Math.min(this.props.maxHeight || u, z - t);
if (this.props.upsell) return Math.max(aa - w, 0);
return aa;
},
_keepOnLoading: function() {
if (this.isMounted()) this.props.afterScroll(this._isLoadingIndicatorVisible());
},
_renderItems: function() {
return r(this.props.notifs).map(function(z) {
var aa = z.alert_id;
return (l.createElement(k, l.__spread({
key: aa,
visible: !this.props.hiddenState[aa],
isRead: this.props.readState[aa],
gnfGiven: this.props.gnfState[aa],
negativeTracking: this.props.negativeTracking,
shortenTimestamp: this.props.shortenTimestamp,
useChevron: this.props.useChevron,
onChevronShow: this.props.onChevronShow,
onChevronHide: this.props.onChevronHide,
paused: this.props.paused,
parent: this
}, z)));
}.bind(this));
},
componentDidMount: function() {
var z = l.findDOMNode(this.refs.scrollable);
h.listen(window, 'resize', p(function() {
if (!s(this.props.notifs)) new g(z).to('height', this._calculateHeight() + 'px').duration(100).go();
}.bind(this)));
},
componentDidUpdate: function(z) {
if (this.props.paused && !z.paused)
if (this.props.shouldScroll && this.refs.scrollable) this.refs.scrollable.getArea().scrollToTop(false);
setTimeout(this._keepOnLoading, 0);
},
render: function() {
var z = this.props.notifs,
aa = null,
ba = null,
ca = x,
da = null;
if (!s(z)) {
aa = l.createElement("ul", {
"data-gt": this.props.tracking
}, this._renderItems());
ba = this._calculateHeight();
} else if (!this.props.canFetchMore) aa = l.createElement("div", {
className: "_572e"
}, q._("\u6c92\u6709\u65b0\u7684\u901a\u77e5"));
if (this.props.canFetchMore) da = l.createElement(i, {
color: "white",
size: "small",
ref: "loading",
className: "_33i"
});
var ea = null;
if (this.props.upsell) {
var fa = this.props.upsell.module;
ea = l.createElement(fa, l.__spread({}, this.props.upsell.props));
}
var ga = (("_50-t") + (this.props.showingChevron ? ' ' + "_2iy1" : ''));
return (l.createElement("div", {
className: ga
}, l.createElement(m, {
ref: "scrollable",
width: ca,
height: ba,
fade: true,
persistent: true,
onScroll: p(this._keepOnLoading)
}, aa, da), ea));
}
});
e.exports = y;
}, null);
__d("NotificationJewelListController", ["NotificationList.react", "NotificationJewelList.react", "React"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
function j(k, l) {
"use strict";
this.$NotificationJewelListController0 = k;
this.$NotificationJewelListController1 = l;
this.$NotificationJewelListController2 = false;
this.$NotificationJewelListController3 = false;
this.$NotificationJewelListController4();
}
j.prototype.open = function() {
"use strict";
this.$NotificationJewelListController2 = true;
this.$NotificationJewelListController4();
};
j.prototype.pause = function() {
"use strict";
this.$NotificationJewelListController3 = true;
this.$NotificationJewelListController4();
};
j.prototype.unpause = function() {
"use strict";
this.$NotificationJewelListController3 = false;
this.$NotificationJewelListController4();
};
j.prototype.$NotificationJewelListController4 = function() {
"use strict";
i.render(i.createElement(g, {
hasEverBeenOpened: this.$NotificationJewelListController2,
paused: this.$NotificationJewelListController3,
tracking: this.$NotificationJewelListController1.tracking,
negativeTracking: this.$NotificationJewelListController1.negativeTracking,
shortenTimestamp: this.$NotificationJewelListController1.shortenTimestamp,
businessID: this.$NotificationJewelListController1.businessID,
maxHeight: this.$NotificationJewelListController1.maxHeight,
useChevron: this.$NotificationJewelListController1.useChevron,
numPerPage: 5,
listRenderer: h,
upsell: this.$NotificationJewelListController1.upsell || null
}), this.$NotificationJewelListController0);
};
e.exports = j;
}, null);
__d("XQuickPromotionSimpleLoggingController", ["XController"], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = b("XController").create("\/qp\/action\/log\/", {
qp_id: {
type: "Int",
required: true
},
qp_action: {
type: "Enum",
enumType: 1
},
qp_instance_log_data: {
type: "StringToStringMap",
defaultValue: {}
},
qp_event: {
type: "String"
}
});
}, null);
__d("QPRenderer", ["$", "CSS", "XQuickPromotionSimpleLoggingController", "AsyncSignal"], function(a, b, c, d, e, f, g, h, i, j) {
b.__markCompiled && b.__markCompiled();
var k = function(p, event, q) {
var r = i.getURIBuilder().setInt('qp_id', p).setString('qp_event', event).setStringToStringMap('qp_instance_log_data', q).getURI();
new j(r, {}).send();
},
l = function(p, q, r) {
var s = i.getURIBuilder().setInt('qp_id', p).setEnum('qp_action', q).setStringToStringMap('qp_instance_log_data', r).getURI();
new j(s, {}).send();
},
m = function(p, q, r, s, t, u) {
o(p, r, g(s), u, function() {
if (t) h.hide(q);
});
},
n = function(p, q, r) {
q.show();
k(p, 'view', {});
q.subscribe('cancel', function() {
k(p, 'dialog_cancel', {});
});
for (var s = 0; s < r.length; s++) {
var t = r[s],
u = g(t.element_id);
o(p, t.action, u, t.instance_log_data, function() {
if (t.should_close) q.hide();
});
if (t.action == 'primary') u.focus();
}
},
o = function(p, q, r, s, t) {
r.addEventListener('click', function() {
var u = i.getURIBuilder().setInt('qp_id', p).setEnum('qp_action', q).setStringToStringMap('qp_instance_log_data', s).getURI();
new j(u, {}).send();
t();
});
};
f.setAction = m;
f.setDialogActionsAndShow = n;
f.logAction = l;
f.logEvent = k;
}, null);
__d("ContextualHelpSearchController", ["Event", "AsyncRequest", "DOM", "CSS", "Focus", "Input"], function(a, b, c, d, e, f, g, h, i, j, k, l) {
b.__markCompiled && b.__markCompiled();
var m = 400;
function n() {
this._token = null;
this._timerID = 0;
this._lastQuery = null;
this.typing_listener = null;
this.clear_listener = null;
this.async_request = null;
}
Object.assign(n.prototype, {
init: function(o, p, q, r, s, t) {
this.loader = o;
this.search_box = p;
this.topics_area = q;
this.results_area = r;
this.clear_button = s;
this.typing_listener = g.listen(this.search_box, 'keyup', this.setTimer.bind(this));
this.clear_listener = g.listen(this.clear_button, 'click', this.clearResults.bind(this));
if (t == null || t.focusSearchBox == null || t.focusSearchBox) k.set(this.search_box);
},
source: 'contextual_help',
clearResults: function() {
this.show(this.topics_area);
this._lastQuery = '';
l.reset(this.search_box);
k.set(this.search_box);
if (this.async_request !== null) {
this.async_request.abort();
this.async_request = null;
}
j.addClass(this.clear_button, 'hidden_elem');
},
update: function() {
var o = l.getValue(this.search_box);
if (o === this._lastQuery) return;
this._lastQuery = o;
if (o === '') {
this.clearResults();
return;
}
this.show(this.loader);
var p = {
query: o,
width: this._width || m,
source: this.source
};
this.async_request = new h('/help/ajax/search/').setData(p).setHandler(function(q) {
this._update(q);
}.bind(this));
this.async_request.send();
},
_update: function(o) {
this.async_request = null;
var p = o.getPayload().results;
i.setContent(this.results_area, p);
this.show(this.results_area);
if (l.getValue(this.search_box) === '') {
this.clearResults();
} else j.removeClass(this.clear_button, 'hidden_elem');
},
setTimer: function() {
if (this._timerID !== 0) clearTimeout(this._timerID);
this._timerID = setTimeout(this.update.bind(this), 300);
if (this.async_request != null) {
this.async_request.abort();
this.async_request = null;
}
},
show: function(o) {
var p = [this.loader, this.topics_area, this.results_area];
for (var q = 0; q < p.length; q++) j.addClass(p[q], 'hidden_elem');
j.removeClass(o, 'hidden_elem');
}
});
e.exports = n;
}, null);
__d("JewelQPLogging", ["QPRenderer"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
var h = false,
i = null,
j = false;
function k() {
if (j) return;
if (h && i) {
g.logEvent(i.promotion_id, 'view', i.instance_log_data ? i.instance_log_data : {});
j = true;
}
}
var l = {
onJewelOpened: function() {
h = true;
k();
},
updateQPLogData: function(m) {
i = m;
k();
}
};
e.exports = l;
}, null);
__d("RequestsJewel", ["Animation", "AccessibilityLogger", "Arbiter", "AsyncRequest", "AsyncSignal", "ChannelConstants", "CSS", "DOM", "Event", "LinkController", "Parent", "ScrollableArea", "Vector", "$", "debounce", "ge", "shield", "fbt", "JewelQPLogging", "requireWeak"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) {
b.__markCompiled && b.__markCompiled();
var aa = null;
z('FriendBrowserCheckboxController', function(fa) {
return aa = fa;
});
var ba = 530,
ca = 30,
da = 160;
Object.assign(ea, {
instance: null,
getInstance: function() {
return ea.instance;
},
replaceJewelTitle: function(fa, ga) {
n.setContent(t(fa), ga);
},
updateFromDOM: function() {
if (ea.instance) ea.instance.fromDom();
},
setInitialHeight: function() {
if (ea.instance) ea.instance.setHeight();
},
maybeLoadJewel: function() {
if (ea.instance) ea.instance.maybeLoadJewel();
}
});
function ea(fa, ga, ha) {
"use strict";
ea.instance = this;
this.countNew = 0;
this.jewel = fa;
this.jewelFlyoutCase = fa.getRoot();
this.jewelFlyout = v('fbRequestsFlyout');
this.newCountSpan = v('newRequestCount');
this.folder = ga;
this.doNewMarkRead = ha;
this.openTimestamp = 0;
this.$RequestsJewel0 = {};
this.$RequestsJewel1 = 0;
this.shouldClearPredictionAssocOnClick = false;
var ia = v('requestsMarkReadButton');
if (ia) o.listen(ia, 'click', w(this.$RequestsJewel2, this));
this.jewel.subscribe('marked-seen', w(this.$RequestsJewel3, this));
this.jewel.subscribe('closed', w(this.$RequestsJewel4, this));
this.jewel.subscribe('updated', this.$RequestsJewel5.bind(this));
this.jewel.subscribe('opened', this.$RequestsJewel6.bind(this));
p.registerHandler(this.$RequestsJewel7.bind(this));
i.subscribe(l.getArbiterType('jewel_requests_add'), this.$RequestsJewel8.bind(this));
i.subscribe(l.getArbiterType('jewel_friending_notifs'), this.$RequestsJewel9.bind(this));
i.subscribe(l.getArbiterType('jewel_requests_remove_old'), this.$RequestsJewela.bind(this));
i.subscribe(l.getArbiterType('friend_requests_seen'), this.$RequestsJewelb.bind(this));
o.listen(this.jewelFlyout, 'submit', function(ka) {
var la = q.byClass(ka.getTarget(), 'objectListItem');
if (la) {
m.removeClass(la, 'jewelItemNew');
m.addClass(la, 'jewelItemResponded');
}
}.bind(this));
var ja = n.find(v('fbRequestsJewel'), 'a[rel="toggle"]');
o.listen(ja, 'focus', function(ka) {
h.logFocusIn();
}.bind(this));
this.setupScroll();
o.listen(window, 'resize', u(function() {
this.$RequestsJewelc();
}.bind(this)));
}
ea.prototype.setupScroll = function() {
"use strict";
var fa = n.scry(this.jewelFlyout, '.uiScrollableAreaWrap')[0];
if (fa) {
this.$RequestsJeweld = fa;
this.$RequestsJewele = 0;
this.$RequestsJewelf = o.listen(fa, 'scroll', this.$RequestsJewelg.bind(this), o.Priority.$RequestsJewelh);
}
};
ea.prototype.fromDom = function() {
"use strict";
n.scry(this.jewelFlyout, '.jewelItemList li.objectListItem').forEach(function(fa) {
var ga = fa.getAttribute('id');
if (ga) {
var ha = v(ga + '_status'),
ia = this.$RequestsJeweli(ga);
if (ia.requester) this.$RequestsJewel0[ia.requester] = ga;
++this.$RequestsJewel1;
}
}.bind(this));
this.$RequestsJewelj();
};
ea.prototype.$RequestsJewelk = function(fa) {
"use strict";
var ga = fa.match(/^(\d+)_(\d+)/);
return (ga) ? {
requester: ga[1],
type: ga[2]
} : (void 0);
};
ea.prototype.$RequestsJeweli = function(fa) {
"use strict";
var ga = fa ? this.$RequestsJewelk(fa) : (void 0),
ha;
if (ga && ga.requester) {
ha = parseInt(ga.requester, 10);
if (isNaN(ha)) ha = (void 0);
}
var ia;
if (ga && ga.type) {
ia = parseInt(ga.type, 10);
if (isNaN(ia)) ia = (void 0);
}
return {
requester: ha,
type: ia
};
};
ea.prototype.$RequestsJewell = function() {
"use strict";
if (this.countNew > 0) this.countNew -= 1;
};
ea.prototype.$RequestsJewel7 = function(fa, event) {
"use strict";
var ga = q.byClass(fa, 'jewelItemNew');
if (ga && q.byClass(ga, 'fbRequestList') && q.byClass(ga, 'beeperEnabled')) {
var ha = this.$RequestsJewelk(ga.id);
ha && this.$RequestsJewel3(ha.requester, ha.type);
this.$RequestsJewell();
i.inform('jewel/count-updated', {
jewel: 'requests',
count: this.countNew
});
m.removeClass(ga, 'jewelItemNew');
}
return true;
};
ea.prototype.$RequestsJewelm = function() {
"use strict";
return n.scry(this.jewelFlyout, '.uiScrollableArea')[0];
};
ea.prototype.$RequestsJewelg = function() {
"use strict";
var fa = n.scry(this.$RequestsJeweld, '.uiMorePager');
if (!fa) return;
var ga = fa.pop();
if (ga) {
var ha = s.getElementPosition(ga, 'viewport').y;
if (ha > 0) m.addClass(q.byClass(this.$RequestsJeweld, 'uiScrollableArea'), 'contentAfter');
var ia = n.find(ga, 'a');
if (!ia) return;
var ja = s.getElementPosition(ia, 'viewport').y;
if (ja == this.$RequestsJewele) return;
var ka = s.getElementPosition(this.$RequestsJeweld, 'viewport').y + s.getElementDimensions(this.$RequestsJeweld).y;
if (ja - 300 < ka && ja > 0) {
this.$RequestsJewele = ja;
var la = ia.getAttribute('ajaxify');
if (la) {
new j(la).setRelativeTo(ia).setStatusElement(q.byClass(ia, 'stat_elem')).send();
} else aa && aa.getInstance('jewel').showMore();
}
}
};
ea.prototype.$RequestsJewel9 = function(fa, ga) {
"use strict";
if (!ga || this.jewel.isOpen()) return;
if (ga.obj.notif_type !== 'friend_confirmed') return;
if (v('fbRequestsJewelLoading')) {
new j().setURI('/ajax/requests/loader/').send();
return;
}
var ha = {};
ha.reloadcontent = true;
new j().setURI('/ajax/requests/loader/').setData(ha).send();
};
ea.prototype.$RequestsJewel8 = function(fa, ga) {
"use strict";
if (!ga) return;
var ha = ga.obj.from,
ia = ga.obj.suggester,
ja = this.$RequestsJeweli(this.$RequestsJewel0[ha]).type,
ka = ja === 19 && !ia;
if (!ka && (ja || this.jewel.isOpen())) return;
if (v('fbRequestsJewelLoading')) {
new j().setURI('/ajax/requests/loader/').send();
} else {
var la = {};
la.reloadcontent = true;
new j().setURI('/ajax/requests/loader/').setData(la).send();
}
};
ea.prototype.$RequestsJewela = function(fa, ga) {
"use strict";
if (!ga || this.jewel.isOpen() || v('fbRequestsJewelLoading') !== null) return;
var ha = this.$RequestsJewel0[ga.obj.from],
ia = ha && v(ha);
if (ia) {
if (m.hasClass(ia, 'jewelItemNew')) {
this.$RequestsJewell();
i.inform('jewel/count-updated', {
jewel: 'requests',
count: this.countNew
});
}
if (!m.hasClass(ia, 'jewelItemResponded')) {
n.remove(ia);
delete this.$RequestsJewel0[ga.obj.from];
--this.$RequestsJewel1;
this.$RequestsJewelj();
}
}
};
ea.prototype.$RequestsJewel2 = function() {
"use strict";
this.jewel.markSeen();
this.$RequestsJewelo();
};
ea.prototype.$RequestsJewel3 = function(fa, ga) {
"use strict";
var ha = n.scry(this.jewelFlyout, 'li');
new k('/ajax/gigaboxx/endpoint/UpdateLastSeenTime.php', {
folder: this.folder,
first_item: ha[0].id
}).send();
var ia = typeof fa != 'undefined' && typeof ga != 'undefined' ? {
requester: fa,
type: ga
} : {};
this.doNewMarkRead && new k('/ajax/requests/mark_read/', ia).send();
};
ea.prototype.$RequestsJewelb = function(fa, ga) {
"use strict";
i.inform('jewel/count-updated', {
jewel: 'requests',
count: 0
});
};
ea.prototype.$RequestsJewelo = function(fa, ga) {
"use strict";
n.scry(this.jewel.root, 'li.jewelItemNew').forEach(function(ha) {
m.removeClass(ha, 'jewelItemNew');
});
};
ea.prototype.$RequestsJewel5 = function(fa, ga) {
"use strict";
this.countNew = ga.count;
m.conditionClass(this.jewelFlyout, 'beeperUnread', this.countNew > 0);
m.conditionClass(this.jewelFlyoutCase, 'showRequests', this.countNew > 0);
if (this.newCountSpan) {
var ha = this.countNew == 1 ? x._("{num}\u500b\u65b0\u8981\u6c42", [x.param("num", this.countNew)]) : x._({
"*": "{num}\u500b\u65b0\u7684\u8acb\u6c42"
}, [x.param("num", this.countNew, [0])]);
n.setContent(this.newCountSpan, ha);
}
};
ea.prototype.$RequestsJewelj = function() {
"use strict";
n.scry(this.jewelFlyout, 'li.empty').forEach(function(fa) {
m.conditionShow(fa, this.$RequestsJewel1 <= 0);
}.bind(this));
};
ea.prototype.$RequestsJewel6 = function() {
"use strict";
i.inform('requestsJewel/opened');
var fa = v('fbRequestsJewelLoading'),
ga = this.$RequestsJewelm();
if (!fa && !ga) {
this.unhandledRequest = true;
} else if (fa) {
var ha = Date.now();
if (this.openTimestamp + 5000 < ha) {
this.openTimestamp = ha;
new j().setURI('/ajax/requests/loader/').setData({
log_impressions: true
}).send();
}
} else {
var ia = Object.keys(this.$RequestsJewel0);
if (ia.length > 0) new j().setURI('/friends/requests/log_impressions').setData({
ids: ia.join(','),
ref: 'jewel'
}).send();
}
ga && r.poke(ga);
y.onJewelOpened();
};
ea.prototype.$RequestsJewel4 = function() {
"use strict";
i.inform('requestsJewel/closed');
this.$RequestsJewelo();
};
ea.prototype.$RequestsJewelp = function() {
"use strict";
return Math.min(Math.max(s.getViewportDimensions().y - da, ca), ba);
};
ea.prototype.$RequestsJewelc = function() {
"use strict";
if (this.$RequestsJewelm()) new g(this.$RequestsJewelm()).to('height', this.$RequestsJewelp() + 'px').duration(100).go();
};
ea.prototype.setHeight = function() {
"use strict";
this.$RequestsJewelm().style.height = this.$RequestsJewelp() + 'px';
};
ea.prototype.maybeLoadJewel = function() {
"use strict";
if (this.unhandledRequest) {
this.unhandledRequest = false;
this.$RequestsJewel6();
}
};
e.exports = ea;
}, null);
__d("JewelX", ["Event", "Arbiter", "ArbiterMixin", "CSS", "DOM", "HTML", "Keys", "TabIsolation", "Toggler", "Run", "csx", "emptyFunction", "reportData"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) {
b.__markCompiled && b.__markCompiled();
var t = function(u, v) {
u && v && this.init(u, v);
};
Object.assign(t, {
_instancesByName: {}
});
Object.assign(t.prototype, i, {
init: function(u, v) {
this.name = v.name;
this.root = u;
this.badge = v.badge;
this.countNew = 0;
this.initialCount = 0;
this.escHandler = null;
this.bootload_module = v.bootload_module;
this.bootload_args = v.bootload_args;
this.bootload_done = false;
this.togglerInstance = o.createInstance(u).setSticky(false);
p.onAfterLoad(function() {
return this._setupBootload();
}.bind(this));
if (v.keepOpenForSnowlift) this.togglerInstance.setPrePageTransitionCallback(this._onPrePageTransition.bind(this));
t._instancesByName[this.name] = this;
var w = this.getFlyout(),
x = new n(w);
o.createInstance(w).setSticky(false);
o.listen('show', this.root, function(y) {
this._logFirstClick();
this.hasNew() && this.markSeen();
this.reset();
this.inform('opened');
h.inform('layer_shown', {
type: 'Jewel'
});
x.enable();
this.setupEvents();
this._setupBootload();
}.bind(this));
o.listen('hide', this.root, function(y, z) {
this.hasNew() && this.markSeen();
this.reset();
this.inform('closed');
h.inform('layer_hidden', {
type: 'Jewel'
});
x.disable();
this.removeEvents();
}.bind(this));
h.subscribe('jewel/count-updated', function(y, z) {
z.jewel == this.name && this.update(z);
}.bind(this));
h.subscribe('jewel/focus', function(y, z) {
if (this.isOpen()) o.hide(this.root);
}.bind(this));
},
getRoot: function() {
return this.root;
},
getFlyout: function() {
if (typeof this._flyout === 'undefined') this._flyout = k.find(this.root, ".__tw");
return this._flyout;
},
hasNew: function() {
return j.hasClass(this.root, 'hasNew');
},
isOpen: function() {
return j.hasClass(this.root, 'openToggler');
},
reset: function() {
j.removeClass(this.root, 'hasNew');
},
setContent: function(u) {
var v = k.find(this.root, 'ul.jewelItemList');
k.setContent(v, l(u));
},
update: function(u) {
this.countNew = u.count;
if (typeof this.countNew === 'number' && this.countNew < 0) this.countNew = 0;
this.badge.setLegacyContent(this.countNew);
var v = isNaN(this.countNew) || this.countNew > 0;
j.conditionClass(this.root, 'hasNew', v);
this.inform('updated', u);
},
setupEvents: function() {
this.escHandler = g.listen(document.documentElement, 'keydown', function(u) {
if (u.keyCode === m.ESC && this.isOpen()) o.hide(this.root);
}.bind(this));
},
removeEvents: function() {
if (this.escHandler) {
this.escHandler.remove();
this.escHandler = null;
}
},
markSeen: function() {
h.inform('jewel/count-updated', {
jewel: this.name,
count: 0
}, h.BEHAVIOR_STATE);
this.inform('marked-seen');
},
_onPrePageTransition: function(u, v) {
if (!this._isSnowliftURI(v.from) && !this._isSnowliftURI(v.to)) this.togglerInstance && this.togglerInstance.hide();
},
_isSnowliftURI: function(u) {
return u && u.getQueryData().hasOwnProperty('theater');
},
_logFirstClick: function() {
this._logFirstClick = r;
s('jewel_click', {
gt: {
count: this.countNew,
initial: this.initialCount,
jewel: this.name
}
});
},
_setupBootload: function() {
if (this.bootload_done || !this.bootload_module) return;
this.bootload_done = true;
this.bootload_module.load().then(function(u) {
return new u(this, this.bootload_args);
}.bind(this));
}
});
e.exports = t;
}, null);
__d("LitestandNewsfeedCountUpdater", ["Arbiter", "AsyncRequest", "LitestandMessages", "NavigationMessage", "WildWildWestJSGating", "emptyFunction"], function(a, b, c, d, e, f, g, h, i, j, k, l) {
b.__markCompiled && b.__markCompiled();
var m, n, o = 0;
function p() {
n && clearTimeout(n);
if (m) return;
var t = k.badge_update_time;
n = setTimeout(q, t);
}
function q() {
if (m) return;
new h().setURI('/ajax/litestand/newsfeed_count').setHandler(function(t) {
if (m) return;
r(t.getPayload());
p();
}).setAllowCrossPageTransition(true).send();
}
function r(t) {
g.inform(i.UPDATE_HOME_COUNT, {
count: t,
onHome: m
}, g.BEHAVIOR_STATE);
if (k.show_badge_bk) {
g.inform(j.NAVIGATION_COUNT_UPDATE, {
key: 'nf',
count: m ? 0 : t - o
});
o = t;
}
}
var s = {
init: function() {
s.init = l;
g.subscribe(i.NEWSFEED_LOAD, function() {
m = true;
r(0);
});
g.subscribe(i.LEAVE_HOME, function() {
m = false;
p();
});
p();
}
};
e.exports = s;
}, null);
__d("LitestandChromeHomeCount", ["Arbiter", "CSS", "DOM", "Event", "LitestandMessages", "LitestandNewsfeedCountUpdater", "Parent", "UserAgent_DEPRECATED", "csx", "cx"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
b.__markCompiled && b.__markCompiled();
var q = 20,
r, s, t, u, v, w = {
init: function(x) {
v = x;
s = i.find(document, "div._uaw ._5ahz");
r = s.parentNode;
t = m.byClass(r, "_1ayn");
u = false;
g.subscribe(k.UPDATE_HOME_COUNT, function(y, z) {
w.updateBadge(z.onHome ? 0 : z.count);
});
j.listen(t, 'click', function(event) {
var y = event.getModifiers();
if (y.shift || (n.osx() && y.meta) || (n.windows() && y.control)) w.updateBadge(0);
});
l.init();
w.updateBadge(v);
},
updateBadge: function(x) {
v = x;
var y = x > 0;
w.toggleBadge(y);
if (y) {
var z = x > q ? q + '+' : x;
i.setContent(s, z);
}
},
toggleBadge: function(x) {
if (u === x) return;
u = x;
h.conditionClass(r, "_5ahy", !x);
}
};
e.exports = w;
}, null);
__d("MercuryJewelModuleLoader", ["JSResource"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
e.exports = g('MercuryJewel');
}, null);
__d("RenderManager", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
function g(h) {
"use strict";
this._isDirty = false;
this._obj = h;
}
g.prototype.dirty = function() {
"use strict";
if (!this._isDirty) {
this._isDirty = true;
setTimeout(this._doPaint.bind(this), 0);
}
};
g.prototype._doPaint = function() {
"use strict";
this._isDirty = false;
this._obj.paint();
};
e.exports = g;
}, null);
__d("CounterDisplay", ["Arbiter", "CSS", "DOM", "RenderManager", "Run", "$", "removeFromArray"], function(a, b, c, d, e, f, g, h, i, j, k, l, m) {
b.__markCompiled && b.__markCompiled();
function n(o, p, q, r, s, t) {
Object.assign(this, {
_name: o,
_valueNode: l(p),
_wrapperNode: l(q) || null,
_statusClass: s,
_rm: new j(this),
_arbiterSubscription: null,
_count: 0
});
var u = this._valueNode.firstChild;
if (u) {
var v = parseInt(u.nodeValue, 10);
if (!isNaN(v)) this._count = v;
}
this._statusNode = r ? l(r) : null;
this._subscribeAll();
n.instances.push(this);
if (!t) k.onLeave(this._destroy.bind(this), true);
}
Object.assign(n, {
EVENT_TYPE_ADJUST: 'CounterDisplay/adjust',
EVENT_TYPE_UPDATE: 'CounterDisplay/update',
instances: [],
adjustCount: function(o, p) {
g.inform(n.EVENT_TYPE_ADJUST + '/' + o, p);
},
setCount: function(o, p) {
g.inform(n.EVENT_TYPE_UPDATE + '/' + o, p);
}
});
Object.assign(n.prototype, {
_destroy: function() {
delete this._valueNode;
delete this._wrapperNode;
if (this._arbiterSubscription) {
this._arbiterSubscription.unsubscribe();
delete this._arbiterSubscription;
}
m(n.instances, this);
},
adjustCount: function(o) {
this._count = Math.max(0, this._count + o);
this._rm.dirty();
return this;
},
setCount: function(o) {
this._count = Math.max(0, o);
this._rm.dirty();
return this;
},
paint: function() {
i.setContent(this._valueNode, this._count);
this._toggleNodes();
},
_toggleNodes: function() {
if (this._wrapperNode) h.conditionClass(this._wrapperNode, 'hidden_elem', this._count <= 0);
if (this._statusClass && this._statusNode) h.conditionClass(this._statusNode, this._statusClass, this._count > 0);
},
_subscribeAll: function() {
var o = [n.EVENT_TYPE_ADJUST + '/' + this._name, n.EVENT_TYPE_UPDATE + '/' + this._name];
this._arbiterSubscription = g.subscribe(o, this._onInform.bind(this), g.SUBSCRIBE_NEW);
},
_onInform: function(o, p) {
p = parseInt(p);
if (isNaN(p)) return;
if (o.indexOf(n.EVENT_TYPE_ADJUST) != -1) {
this.adjustCount(p);
} else if (o.indexOf(n.EVENT_TYPE_UPDATE) != -1) {
this.setCount(p);
} else return;
return;
}
});
e.exports = n;
}, null);
__d("MessagingEvents", ["Arbiter", "ChannelConstants", "arrayContains", "isEmpty"], function(a, b, c, d, e, f, g, h, i, j) {
b.__markCompiled && b.__markCompiled();
var k = {},
l = new g();
function m(n) {
if (!j(k)) return;
for (var o in n) l.inform('count/' + o, n[o]);
}
l.subscribe('mark-as-read', function(n, o) {
(o.tids || o.chat_ids || []).forEach(function(p) {
p = '' + p;
if (!(p in k)) {
k[p] = true;
var q = function() {
l.unsubscribe(r);
clearTimeout(s);
delete k[p];
},
r = l.subscribe('read', function(t, u) {
if (i((u.tids || []), p) || i((u.chat_ids || []), p)) q();
}),
s = setTimeout(q, 60000);
}
});
});
g.subscribe(h.getArbiterType('messaging'), function(n, o) {
var p = Object.assign({}, o.obj),
event = p.event || '';
delete p.type;
delete p.event;
l.inform(event, p);
if ('unread_counts' in p) {
var q = p.unread_counts;
m({
unread: q.inbox,
other_unseen: q.other
});
}
});
g.subscribe(h.getArbiterType('inbox'), function(n, o) {
var p = Object.assign({}, o.obj);
delete p.type;
m(p);
});
a.MessagingEvents = e.exports = l;
}, 3);
__d("TitanLeftNav", ["CounterDisplay", "MessagingEvents"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
var i = {
initialize: function() {
h.subscribe('count/other_unseen', function(j, k) {
g.setCount('other_unseen', k);
});
}
};
e.exports = i;
}, null);
__d("AccessibilityShortcut", ["AccessibilityLogger", "Event", "Focus", "ge", "onEnclosingPageletDestroy", "warning"], function(a, b, c, d, e, f, g, h, i, j, k, l) {
b.__markCompiled && b.__markCompiled();
var m = {
init: function(n, o) {
var p = h.listen(n, 'click', function(q) {
q.preventDefault();
var r = j(o);
if (r) {
i.set(r);
g.logSRKey();
} else l(r, 'Failed to set focus on element with ID: %s', o);
});
k(n, function() {
return p.remove();
});
}
};
e.exports = m;
}, null);
__d("NotificationJewelReminder", ["Arbiter", "ContextualDialog", "ContextualDialogXUITheme", "DOM", "Event", "ImageBlock.react", "LayerFadeOnHide", "LayerFadeOnShow", "NotificationStore", "NotificationUpdates", "React", "SubscriptionsHandler", "Toggler", "$", "cx", "fbt", "intlList"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) {
b.__markCompiled && b.__markCompiled();
var x = 2,
y = "fbRequestsJewel",
z = "fbNotificationsJewel";
function aa(ba) {
"use strict";
this.$NotificationJewelReminder0 = ba;
if (ba.request.count > 0 && ba.show_request) {
this.$NotificationJewelReminder1(y);
} else this.$NotificationJewelReminder2();
}
aa.prototype.$NotificationJewelReminder2 = function() {
"use strict";
if (!this.$NotificationJewelReminder0.show_notif) {
return;
} else {
this.$NotificationJewelReminder3();
return;
}
};
aa.prototype.$NotificationJewelReminder3 = function() {
"use strict";
this.$NotificationJewelReminder4 = p.subscribe('update-notifications', function(ba, ca) {
if (ca.nodes) this.$NotificationJewelReminder6(ca.nodes);
}.bind(this));
o.getNotifications(Number.isInteger(this.$NotificationJewelReminder0.show_notif) ? this.$NotificationJewelReminder0.show_notif : 0, this.$NotificationJewelReminder6.bind(this));
};
aa.prototype.$NotificationJewelReminder6 = function(ba) {
"use strict";
if (this.$NotificationJewelReminder4) {
this.$NotificationJewelReminder4.unsubscribe();
this.$NotificationJewelReminder4 = null;
}
var ca = s.getInstance(t(z));
if (ca && ca.isShown()) return;
var da = [],
ea, fa = Object.keys(ba);
for (var ga = 0; ga < fa.length; ga++) {
if (!ba[fa[ga]].showBeep) continue;
var ha = ba[fa[ga]].actors;
if (ha.length === 0) continue;
for (var ia = 0; ia < ha.length; ia++) {
ea = ea || ha[ia].profile_picture.uri;
if (da.length < x && ha[ia].name && da.indexOf(ha[ia].name) === -1) da.push(ha[ia].name);
}
if (da.length === x) break;
}
if (da.length === 0 || !ea) return;
var ja = this.$NotificationJewelReminder7(ea, da, fa.length, z);
this.$NotificationJewelReminder8(ja);
};
aa.prototype.$NotificationJewelReminder7 = function(ba, ca, da, ea) {
"use strict";
var fa = q.createElement("div", {
className: "_5bov"
}, q.createElement(l, null, q.createElement("img", {
className: "_5bow",
src: ba
}), q.createElement("div", null, this.$NotificationJewelReminder9(da, ca, ea)))),
ga = j.create('div');
q.render(fa, ga);
var ha = new h({
alignment: 'right',
contextSelector: '#' + ea + ' a.jewelButton',
offsetY: -10,
position: 'below',
theme: i,
width: 210
}, ga);
ha.enableBehaviors([n, m]);
return ha;
};
aa.prototype.$NotificationJewelReminder9 = function(ba, ca, da) {
"use strict";
ca = ca.map(function(ea) {
return q.createElement("b", null, ea);
});
if (da === z) {
return (v._({
"*": {
"notifications": "{notification senders}\u7684{number}\u5247\u901a\u77e5",
"notification": "\u4f86\u81ea{notification senders}\u7684{number}\u5247\u901a\u77e5"
}
}, [v.param("number", ba, [0]), v['enum'](ba > 1 ? 'notifications' : 'notification', {
notifications: "notifications",
notification: "notification"
}), v.param("notification senders", w(ca))]));
} else return (v._({
"*": {
"requests": "{number}\u500b\u4f86\u81ea{request senders}\u7684\u4ea4\u53cb\u9080\u8acb",
"request": "{number}\u500b\u4f86\u81ea{request senders}\u7684\u4ea4\u53cb\u9080\u8acb"
}
}, [v.param("number", ba, [0]), v['enum'](ba > 1 ? 'requests' : 'request', {
requests: "requests",
request: "request"
}), v.param("request senders", w(ca))]));
};
aa.prototype.$NotificationJewelReminder8 = function(ba) {
"use strict";
ba.show();
this.$NotificationJewelRemindera = ba;
var ca = ba.getRoot();
this.$NotificationJewelReminderb = setTimeout(this.$NotificationJewelReminderc.bind(this), this.$NotificationJewelReminder0.show_time);
this.$NotificationJewelReminderd = new r();
this.$NotificationJewelReminderd.addSubscriptions(g.subscribe('layer_shown', function(da, ea) {
if (ea && ea.type === 'Jewel') this.$NotificationJewelReminderc();
}.bind(this)), k.listen(ca, 'mouseenter', function() {
clearTimeout(this.$NotificationJewelReminderb);
}.bind(this)), k.listen(ca, 'mouseleave', this.$NotificationJewelReminderc.bind(this)), k.listen(ca, 'click', function() {
this.$NotificationJewelReminderc();
s.show(t(z));
}.bind(this)));
};
aa.prototype.$NotificationJewelReminderc = function() {
"use strict";
clearTimeout(this.$NotificationJewelReminderb);
this.$NotificationJewelRemindera.hide();
this.$NotificationJewelReminderd.release();
};
aa.prototype.$NotificationJewelReminder1 = function(ba) {
"use strict";
if (!this.$NotificationJewelReminder0.show_request || !this.$NotificationJewelReminder0.request.count) return;
var ca = s.getInstance(t(ba));
if (ca && ca.isShown()) return;
var da = this.$NotificationJewelReminder7(this.$NotificationJewelReminder0.request.pics[0], this.$NotificationJewelReminder0.request.names, this.$NotificationJewelReminder0.request.count, ba);
this.$NotificationJewelRemindere(da);
};
aa.prototype.$NotificationJewelRemindere = function(ba) {
"use strict";
ba.show();
this.$NotificationJewelReminderf = ba;
var ca = ba.getRoot();
this.$NotificationJewelReminderg = setTimeout(this.$NotificationJewelReminderh.bind(this), this.$NotificationJewelReminder0.show_time);
this.$NotificationJewelReminderi = new r();
this.$NotificationJewelReminderi.addSubscriptions(g.subscribe('layer_shown', function(da, ea) {
if (ea && ea.type === 'Jewel') this.$NotificationJewelReminderh();
}.bind(this)), k.listen(ca, 'mouseenter', function() {
clearTimeout(this.$NotificationJewelReminderg);
}.bind(this)), k.listen(ca, 'mouseleave', this.$NotificationJewelReminderh.bind(this)), k.listen(ca, 'click', function() {
this.$NotificationJewelReminderh();
s.show(t(y));
}.bind(this)));
};
aa.prototype.$NotificationJewelReminderh = function() {
"use strict";
clearTimeout(this.$NotificationJewelReminderg);
this.$NotificationJewelReminderf.hide();
this.$NotificationJewelReminderi.release();
this.$NotificationJewelReminder2();
};
e.exports = aa;
}, null);
__d("PagesVoiceBar", ["$", "Arbiter", "AsyncRequest", "BlueBar", "ChannelConstants", "DOM", "URI", "ViewportBounds"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n) {
b.__markCompiled && b.__markCompiled();
var o = 'PagesVoiceBar/initialized',
p = 'PagesVoiceBar/switchVoice',
q = 'page_transition',
r = 'pages_voice_bar_sync',
s = null,
t = null,
u = false,
v = false,
w = n.addTop(0);
function x(da, ea) {
new i('/ajax/pages/switch_voice.php').setData(ea).setHandler(function(fa) {
ba();
}).send();
}
function y() {
s = null;
}
function z(da, ea) {
if (ea.obj.profile_id && ea.obj.profile_id === s) ba();
}
function aa(da) {
h.subscribe(o, da);
}
function ba() {
m.getNextURI().go();
}
var ca = {
initVoiceBar: function() {
if (v) return;
t = g('pagesVoiceBarContent');
h.subscribe(p, x);
h.subscribe(q, y);
h.subscribe(k.getArbiterType(r), z);
v = true;
u = l.contains(j.getBar(), t);
h.inform(o, null, h.BEHAVIOR_STATE);
},
update: function(da, ea) {
aa(function() {
s = ea;
l.setContent(t, da);
var fa = t.offsetHeight;
if (!u && w.getSize() !== fa) {
w.remove();
w = n.addTop(n.getTop() + fa);
}
});
}
};
e.exports = ca;
}, null);
__d("PrivacyLiteFlyout", ["Animation", "Arbiter", "ArbiterMixin", "AsyncDialog", "AsyncRequest", "Banzai", "CSS", "DOM", "Ease", "Event", "PrivacyConst", "Style", "SubscriptionsHandler", "Toggler", "XPrivacyCheckupSpawnDialogController", "XPrivacyRemindersDismissController", "csx", "cx", "ge"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) {
b.__markCompiled && b.__markCompiled();
var z = 'PrivacyLiteFlyout/expandingSection',
aa = {},
ba = {};
function ca(ia, ja, ka) {
var la = ja ? 0 : ia.offsetHeight;
r.set(ia, 'height', la + 'px');
r.set(ia, 'overflow', 'hidden');
m.show(ia);
var ma = ja ? ia.scrollHeight : 0,
na = n.getID(ia);
aa[na] && aa[na].stop();
aa[na] = new g(ia).to('height', ma).ondone(function() {
aa[na] = null;
r.set(ia, 'height', '');
r.set(ia, 'overflow', '');
ma || m.hide(ia);
ka();
}).duration(Math.abs(ma - la) * 1.5).ease(o.sineOut).go();
}
function da(ia) {
var event = 'other_section';
switch (ia) {
case 'who_can_see':
case 'who_can_contact':
case 'how_to_stop':
event = ia;
break;
}
return event;
}
var ea = null,
fa = false,
ga = false,
ha = Object.assign({
loadBody: function() {
this._loadBody(false);
},
loadBodyFromMegaphone: function() {
this._loadBody(true);
},
_loadBody: function(ia) {
if (!fa && y('fbPrivacyLiteFlyoutLoading')) {
fa = true;
new k('/ajax/privacy/privacy_lite/loader').setData({
from_megaphone: ia
}).send();
}
},
_addListener: function(ia, event, ja) {
return p.listen(ia, 'click', function() {
l.post('privacy_lite', {
event: event,
exit_point: ja
});
});
},
addLoggingElem: function(ia, event, ja) {
var ka = this._loggingElements.length,
la = {
elem: ia,
event: event,
exit: ja
};
this._loggingElements[ka] = la;
},
registerSettingsAndBasicsLinkLogging: function(ia, event, ja, ka) {
var la = n.scry(ia, "._5cw0")[0],
ma = n.scry(ia, "._3djx")[0];
if (la) {
this._settingsLinkListener && this._settingsLinkListener.release();
this._settingsLinkListener = this._addListener(la, event, ja);
}
if (ma) {
this._privacyBasicsLinkListener && this._privacyBasicsLinkListener.release();
this._privacyBasicsLinkListener = this._addListener(ma, event, ka);
}
},
_subscribeListeners: function() {
this._loggingElements && this._loggingElements.forEach(function(ia) {
this._subscriptions && this._subscriptions.addSubscriptions(this._addListener(ia.elem, ia.event, ia.exit));
}, this);
},
renderBody: function(ia, ja) {
var ka = y('fbPrivacyLiteFlyoutLoading');
if (ka) {
n.replace(ka, ia);
ha.registerCallback(function() {
ha.inform('load', null, h.BEHAVIOR_STATE);
}, ja);
}
},
hideCleanup: function(ia) {
h.inform(z);
var ja = n.scry(ia, "._2va0").forEach(function(ka) {
m.removeClass(ka, "_2va0");
});
},
registerFlyoutToggler: function(ia, ja, ka) {
this._loggingElements = [];
ea = ja;
var la = t.createInstance(ia);
la.setSticky(false);
t.listen(['show', 'hide'], ja, function(ma) {
ha.inform(ma);
ga = ma === 'show';
if (!ga) {
ha.hideCleanup(ia);
la.hide();
this._subscriptions && this._subscriptions.release();
this._subscriptions = null;
h.inform('layer_hidden', {
type: 'PrivacyShortcutsFlyout'
});
} else {
h.inform('layer_shown', {
type: 'PrivacyShortcutsFlyout'
});
if (ka) {
ka.start(this);
ka = null;
}
h.subscribeOnce(z, function() {
this._subscriptions && this._subscriptions.release();
this._subscriptions = new s();
this._subscribeListeners();
}.bind(this));
l.post('privacy_lite', {
event: 'show_flyout',
exit_point: null
});
}
}.bind(this));
},
isFlyoutVisible: function() {
return ea && t.getActive() === ea;
},
exists: function() {
return !!n.scry(document.body, "._59fc")[0];
},
setFlyoutVisible: function(ia) {
ia ? t.show(ea) : t.hide(ea);
},
showSection: function(ia) {
var ja = ba[ia];
if (!ja) return;
if (!ja.sublist_container) {
ha.inform('expanded', ia, h.BEHAVIOR_STATE);
return;
}
var ka = ja.chevron,
la = ja.sublist_container;
h.inform(z, ka);
if (ha.inform('expand', ia) !== false) {
m.removeClass(ka, "_9or");
m.addClass(ka, "_9os");
ca(la, true, function() {
ha.inform('expanded', ia);
});
}
},
hideSection: function(ia, ja, ka) {
var la = ba[ia],
ma = la.chevron,
na = la.sublist_container;
if (ka === ma) return;
if (ha.inform('collapse', ia) !== false) {
m.addClass(ma, "_9or");
m.removeClass(ma, "_9os");
ca(na, false, function() {
ha.inform('collapsed', ia);
});
}
},
toggleSection: function(ia) {
var ja = ba[ia].chevron;
t.getInstance(ja).hide();
if (m.hasClass(ja, "_9or")) {
ha.showSection(ia);
l.post('privacy_lite', {
event: da(ia) + '_expand',
exit_point: null
});
new k('/ajax/privacy/privacy_lite/log_section_expand').setData({
section: ia
}).send();
} else {
ha.hideSection(ia);
l.post('privacy_lite', {
event: da(ia) + '_collapse',
exit_point: null
});
}
},
registerSection: function(ia, ja) {
ba[ia] = ja;
if (ja.sublist_container) {
h.subscribe(z, ha.hideSection.bind(null, ia));
p.listen(ja.section_block, 'click', ha.toggleSection.bind(null, ia));
}
ha.inform(ia);
},
registerInlineHelpOnAudienceChangeNewSelector: function(ia, ja, ka, la) {
ia = ia.getInstance();
ia.subscribe('changed', function(ma) {
this._registerInlineHelpOnAudienceChange(ja, ka, la, ia.getSelectedBaseValue());
}.bind(this));
},
registerSelectorLogging: function(ia, ja, ka, la) {
ia = ia.getInstance();
ia.subscribe('open', function() {
l.post('privacy_lite', {
event: ja,
exit_point: null
});
});
ia.subscribe('close', function() {
l.post('privacy_lite', {
event: ka,
exit_point: null
});
});
ia.subscribe('changed', function() {
l.post('privacy_lite', {
event: la,
exit_point: null
});
});
},
_registerInlineHelpOnAudienceChange: function(ia, ja, ka, la) {
var ma = n.find(ia, "._9o_"),
na = n.find(ia, "._2v9_");
if (ka) {
var oa = n.find(ia, "._5n9w"),
pa = (la == q.BaseValue.EVERYONE);
m.conditionShow(oa, pa);
m.conditionShow(ma, !pa);
if (oa && pa) {
var qa = (v.getURIBuilder()).setString('type', 'delta_everyone').setBool('log_plite', true).getURI();
new k(qa).send();
}
} else m.show(ma);
m.hide(na);
if (ja) new k('/ajax/privacy/privacy_lite/kill_intro').send();
},
registerInlineHelpXOutOnClick: function(ia, ja, ka) {
p.listen(ia, 'click', function() {
m.addClass(ja, "_9p0");
});
},
registerBlockUnhideOnFocus: function(ia, ja) {
p.listen(ia, 'focus', function(ka) {
m.show(ka);
l.post('privacy_lite', {
event: 'block_user_input_click',
exit_point: null
});
}.bind(this, ja));
},
registerMessageFilterSettingOnClick: function(ia, ja) {
var ka = n.find(ia, "._fv0");
p.listen(ia, 'click', function() {
if (ka.checked) {
new k('/ajax/mercury/change_filtering_type.php').setData({
filtering_type: ja,
source: 'privacy_lite'
}).send();
} else {
var event = 'basic_filtering';
if (ja === 'strict') event = 'strict_filtering';
l.post('privacy_lite', {
event: event,
exit_point: null
});
}
});
},
registerPrivacyCheckupListener: function(ia) {
p.listen(ia, 'click', function() {
this.setFlyoutVisible(false);
j.send(new k((u.getURIBuilder()).setEnum('source', 'plite').getURI()));
l.post('privacy_lite', {
event: 'exit_flyout',
exit_point: 'privacy_checkup'
});
}.bind(this));
},
displayPrivacyCheckup: function(ia) {
ia.show();
}
}, i);
e.exports = ha;
}, null);
__d("PrivacyLiteFlyoutHelp", ["Event", "Arbiter", "AsyncRequest", "Banzai", "ContextualHelpSearchController", "CSS", "DOM", "Parent", "csx", "cx"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
b.__markCompiled && b.__markCompiled();
var q, r;
function s(t, u, v, w, x) {
this._width = 315;
r = m.find(u, 'input');
var y = m.create('div');
this.init(t, r, y, v, w, {
focusSearchBox: false
});
q = n.byClass(u, "_8-a");
g.listen(x, 'click', function() {
this._hideSearch(this);
j.post('privacy_lite', {
event: 'plite_search_collapse',
exit_point: null
});
}.bind(this));
h.subscribe('PrivacyLiteFlyout/expandingSection', this._hideSearch.bind(this));
var z = m.scry(q, "._d1r")[0];
z && g.listen(z, 'click', function() {
l.addClass(q, "_aw6");
r.focus();
j.post('privacy_lite', {
event: 'plite_search_expand',
exit_point: null
});
if (!this.suggestedResults) new i('/ajax/privacy/privacy_lite/help_suggestions').setHandler(function(aa) {
var ba = aa.getPayload().searchSuggestions,
ca = m.find(q, "._4_8m");
m.setContent(ca, ba);
l.addClass(q, "_4_8l");
}.bind(this)).send();
}.bind(this));
}
Object.assign(s.prototype, new k(), k.prototype, {
source: 'privacy_shortcuts',
_hideSearch: function() {
this.clearResults();
l.removeClass(q, "_aw6");
},
show: function(t) {
if (t === this.topics_area) {
l.removeClass(q, "_aw7");
return;
} else if (t === this.loader) {
l.addClass(q, "_aw7");
l.hide(this.results_area);
} else l.hide(this.loader);
l.show(t);
}
});
e.exports = s;
}, null);
__d("ViewasChromeBar", ["Event", "Arbiter", "AsyncRequest", "CSS", "DOM", "Focus", "ModalMask", "PageTransitionsRegistrar", "Parent", "cx", "csx"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) {
b.__markCompiled && b.__markCompiled();
var r = 'ViewasChromeBar/initialized',
s = null,
t = false;
function u(x) {
h.subscribe(r, x);
}
function v(x) {
j.addClass(x, "_7g7");
var y = k.find(x, "._7g0");
l.set(k.find(y, '.textInput'));
}
var w = {
initChromeBar: function(x) {
if (t) return;
s = x;
t = true;
h.inform(r, null, h.BEHAVIOR_STATE);
},
update: function(x, y) {
u(function() {
k.setContent(s, x);
if (y) new i('/ajax/privacy/glasgow/viewas_bar_flyout_open').send();
});
},
registerSpecificModeOnClick: function(x) {
g.listen(x, 'click', v.bind(null, o.byClass(x, "_7f-")));
},
registerFlyoutModalMask: function() {
m.show();
n.registerHandler(m.hide, 10);
}
};
e.exports = w;
}, null);
/*!CK:897646483!*/ /*1438789592,*/
if (self.CavalryLogger) {
CavalryLogger.start_js(["d\/t68"]);
}
__d("AdsHelpTrayCMSDataDispatcher", ["AdsDispatcher", "AdsHelpTrayActionTypes", "AdsLoadState"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
'use strict';
var j = {
dispatchContentList: function(k, l, m) {
g.handleUpdateFromViewAction({
data: {
loadingStatus: i.LOADED,
list: l,
key: k
},
logData: {
search_query: m,
results_count: Object.keys(l).length
},
type: h.CMS_CONTENT_LIST_LOADED
});
},
dispatchLoadedCMS: function(k, l, m, n, o) {
this.dispatchCMSContent(i.LOADED, k, l, m, n, o);
},
dispatchCMSContent: function(k, l, m, n, o, p) {
g.handleUpdateFromViewAction({
data: {
loadingStatus: k,
content: n,
title: m,
cmsID: l,
shareback: o,
adgroupID: p
},
logData: {
cms_id: l
},
type: h.CMS_CONTENT_LOADED
});
}
};
e.exports = j;
}, null);
/*!CK:2985687451!*/ /*1438578499,*/
if (self.CavalryLogger) {
CavalryLogger.start_js(["hQMkV"]);
}
__d("ActorSelectorNuxTypes", [], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = {
COMPOSER: "composer_seen_count",
COMPOSER_COVERED: "composer_covered_seen_count",
M_COMPOSER: "m_composer_seen_count",
M_UFI: "m_ufi_seen_count",
UFI: "ufi_seen_count",
UFI_TIMELINE: "ufi_timeline_seen_count",
UFI_TIMELINE_COVERED: "ufi_timeline_covered_seen_count"
};
}, null);
__d("AbstractPopoverButton.react", ["React", "URI", "cloneWithProps", "cx", "joinClasses"], function(a, b, c, d, e, f, g, h, i, j, k) {
b.__markCompiled && b.__markCompiled();
var l = g,
m = l.PropTypes,
n = g.createClass({
displayName: "AbstractPopoverButton",
propTypes: {
config: m.object.isRequired,
haschevron: m.bool,
maxwidth: m.number
},
getDefaultProps: function() {
return {
haschevron: true
};
},
render: function() {
var o = this.props.config,
p = {},
q = o.defaultMaxWidth;
if (typeof this.props.maxwidth !== 'undefined') q = this.props.maxwidth;
var r = null;
if (q) {
var s = this.props.haschevron ? q - o.chevronWidth : q;
if (this.props.label) r = {
maxWidth: s + 'px'
};
p.style = Object.assign({}, p.style, {
maxWidth: q + 'px'
});
}
p.image = null;
var t = null;
if (this.props.image && this.props.label) {
t = i(this.props.image, {
className: "_3-8_"
});
} else if (this.props.image) t = this.props.image;
if (t || this.props.label) p.label = g.createElement("span", {
className: "_55pe",
style: r
}, t, this.props.label);
if (this.props.haschevron) p.imageRight = o.chevron;
p.className = k(o.button.props.className, "_2agf");
p.href = new h('#');
return i(o.button, p);
}
});
e.exports = n;
}, null);
__d("XUIPopoverButton.react", ["AbstractPopoverButton.react", "Image.react", "React", "XUIButton.react", "cx", "ix", "joinClasses"], function(a, b, c, d, e, f, g, h, i, j, k, l, m) {
b.__markCompiled && b.__markCompiled();
var n = i,
o = n.PropTypes,
p = i.createClass({
displayName: "ReactXUIPopoverButton",
propTypes: {
haschevron: o.bool,
maxwidth: o.number
},
statics: {
getButtonSize: function(q) {
return q.size || 'medium';
}
},
render: function() {
var q = p.getButtonSize(this.props),
r = "_55pi";
if (this.props.theme === 'dark') r = m(r, (("_5vto") + (q === 'small' ? ' ' + "_55_o" : '') + (q === 'medium' ? ' ' + "_55_p" : '') + (q === 'large' ? ' ' + "_55_q" : '') + (q === 'xlarge' ? ' ' + "_55_r" : '') + (q === 'xxlarge' ? ' ' + "_55_s" : '')));
var s = this.props.chevron;
if (!s) {
var t = this.props.theme === 'dark' || this.props.use === 'confirm' || this.props.use === 'special' ? l('/images/ui/x/button/dark/chevron.png') : l('/images/ui/x/button/normal/chevron.png');
s = i.createElement(h, {
src: t
});
}
var u = {
button: i.createElement(j, i.__spread({}, this.props, {
className: m(this.props.className, r),
size: q
})),
chevron: s,
chevronWidth: 14,
defaultMaxWidth: this.props.maxwidth || 200
};
return (i.createElement(g, {
config: u,
haschevron: this.props.haschevron,
image: this.props.image,
label: this.props.label,
maxwidth: this.props.maxwidth
}));
}
});
e.exports = p;
}, null);
__d("ActorSelectorPlaceholder.react", ["Image.react", "React", "TooltipData", "XUIPopoverButton.react", "cx", "fbt", "ix"], function(a, b, c, d, e, f, g, h, i, j, k, l, m) {
b.__markCompiled && b.__markCompiled();
var n = h.createClass({
displayName: "ActorSelectorPlaceholder",
getDefaultProps: function() {
return {
onActivate: function() {}
};
},
componentDidMount: function() {
if (this.props.focusOnInit && this.refs['open-menu-button']) h.findDOMNode(this.refs['open-menu-button']).focus();
var o = l._("\u4ee5\u4f60\u7ba1\u7406\u7684\u5176\u4e2d\u4e00\u500b\u7c89\u7d72\u5c08\u9801\u8eab\u5206\u8aaa\u8b9a\u8aaa\u7559\u8a00\u3002");
i.set(h.findDOMNode(this.refs['open-menu-button']), o, 'above', 'right');
},
render: function() {
return (h.createElement(j, {
className: "_4z8-",
haschevron: false,
image: h.createElement(g, {
width: 16,
height: 16,
src: m('images/pages/voice/flag.png')
}),
onFocus: function() {
return this.props.onActivate(true);
}.bind(this),
onMouseOver: function() {
return this.props.onActivate(false);
}.bind(this),
ref: "open-menu-button",
suppressed: true,
type: "button"
}));
}
});
e.exports = n;
}, null);
__d("HasLayerContextMixin", ["React"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
var h = {
getContextNode: function() {
var i = this.props.context;
if (this.props.contextRef) {
var j = this.props.contextRef();
i = j && g.findDOMNode(j);
}
return i;
}
};
e.exports = h;
}, null);
__d("XUIContextualDialogBody.react", ["React"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
var h = g.createClass({
displayName: "XUIContextualDialogBody",
render: function() {
return (g.createElement("div", {
className: this.props.className
}, this.props.children));
}
});
e.exports = h;
}, null);
__d("XUIOverlayFooter.react", ["React", "cx", "joinClasses"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
var j = g.createClass({
displayName: "XUIOverlayFooter",
render: function() {
return (g.createElement("div", g.__spread({}, this.props, {
className: i(this.props.className, "_5lnf uiOverlayFooter")
}), this.props.children));
}
});
e.exports = j;
}, null);
__d("XUIContextualDialogFooter.react", ["React", "XUIOverlayFooter.react", "cx"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
var j = g.createClass({
displayName: "XUIContextualDialogFooter",
render: function() {
return (g.createElement(h, {
className: "_572u"
}, this.props.children));
}
});
e.exports = j;
}, null);
__d("XUIContextualDialogTitle.react", ["React", "cx", "joinClasses"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
var j = g,
k = j.PropTypes,
l = g.createClass({
displayName: "XUIContextualDialogTitle",
propTypes: {
use: k.oneOf(['primary', 'secondary'])
},
getDefaultProps: function() {
return {
use: 'primary'
};
},
render: function() {
var m = this.props.use,
n = i((("_47lu") + (m === 'primary' ? ' ' + "_47lv" : '') + (m === 'secondary' ? ' ' + "_47mc" : '')), this.props.className);
return (g.createElement("h3", {
className: n
}, this.props.children));
}
});
e.exports = l;
}, null);
__d("XUIContextualDialog.react", ["HasLayerContextMixin", "ContextualDialogXUITheme", "React", "ReactAbstractContextualDialog", "ReactLayer", "XUIContextualDialogBody.react", "XUIContextualDialogFooter.react", "XUIContextualDialogTitle.react", "cx"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) {
b.__markCompiled && b.__markCompiled();
var p = i,
q = p.PropTypes,
r = k.createClass(j.createSpec({
displayName: 'ReactXUIContextualDialog',
theme: h
})),
s = i.createClass({
displayName: "XUIContextualDialog",
mixins: [g],
propTypes: {
position: q.oneOf(['above', 'below', 'left', 'right']),
alignment: q.oneOf(['left', 'center', 'right']),
offsetX: q.number,
offsetY: q.number,
width: q.number,
autoFocus: q.bool,
arrowBehavior: q.func,
behaviors: q.object,
shown: q.bool,
context: q.object,
contextRef: q.func,
hoverContext: q.object,
hoverContextRef: q.func,
hoverShowDelay: q.number,
hoverHideDelay: q.number,
hideOnEscape: q.bool,
onToggle: q.func,
hasActionableContext: q.bool
},
getDefaultProps: function() {
return {
hasActionableContext: false,
hideOnEscape: true
};
},
_getDialogBody: function() {
return this._getChildOfType(l);
},
_getDialogTitle: function() {
return this._getChildOfType(n);
},
_getDialogFooter: function() {
return this._getChildOfType(m);
},
_getChildOfType: function(t) {
var u = null;
i.Children.forEach(this.props.children, function(v) {
if (!u && v.type === t) u = v;
});
return u;
},
updatePosition: function() {
var t = this.refs.dialog;
if (t) t.layer.updatePosition();
},
render: function() {
var t = this.props.children,
u = this._getDialogBody();
if (u) t = i.createElement("div", {
className: "_53iv"
}, this._getDialogTitle(), u);
return (i.createElement(r, i.__spread({}, this.props, {
ref: "dialog",
context: this.getContextNode()
}), t, u ? this._getDialogFooter() : null));
}
});
s.WIDTH = {
NORMAL: 312,
WIDE: 400
};
e.exports = s;
}, null);
__d("XUIDialogFooter.react", ["LeftRight.react", "React", "XUIOverlayFooter.react", "cx", "joinClasses"], function(a, b, c, d, e, f, g, h, i, j, k) {
b.__markCompiled && b.__markCompiled();
var l = h,
m = l.PropTypes,
n = h.createClass({
displayName: "XUIDialogFooter",
propTypes: {
fullBleedBorder: m.bool,
leftContent: m.object
},
render: function() {
var o = (("_5a8u") + (this.props.fullBleedBorder ? ' ' + "_27qq" : ''));
return (h.createElement(i, h.__spread({}, this.props, {
className: k(this.props.className, o)
}), h.createElement("div", {
className: "_50f4"
}, h.createElement(g, null, h.createElement("div", null, this.props.leftContent), h.createElement("div", null, this.props.children)))));
}
});
e.exports = n;
}, null);
__d("XUIDialogButton.react", ["React", "XUIButton.react", "cx", "joinClasses"], function(a, b, c, d, e, f, g, h, i, j) {
b.__markCompiled && b.__markCompiled();
var k = g,
l = k.PropTypes,
m = g.createClass({
displayName: "XUIDialogButton",
propTypes: {
action: l.oneOf(['cancel', 'confirm', 'button'])
},
render: function() {
var n = this.props.action,
o = ((n == 'confirm' ? "layerConfirm" : '') + (n == 'cancel' ? ' ' + "layerCancel" : '') + (n == 'button' ? ' ' + "layerButton" : '')),
p = this.props.href;
if (n == 'cancel') {
p = '#';
} else if (n == 'button') p = p || '#';
return (g.createElement(h, g.__spread({}, this.props, {
className: j(this.props.className, o),
href: p
})));
}
});
e.exports = m;
}, null);
__d("XUIDialogOkayButton.react", ["React", "XUIDialogButton.react", "cx", "fbt", "joinClasses"], function(a, b, c, d, e, f, g, h, i, j, k) {
b.__markCompiled && b.__markCompiled();
var l = g,
m = l.PropTypes,
n = g.createClass({
displayName: "XUIDialogOkayButton",
propTypes: {
action: m.oneOf(['confirm', 'cancel', 'button']).isRequired
},
render: function() {
return (g.createElement(h, g.__spread({}, this.props, {
className: k(this.props.className, "_2z1w"),
action: this.props.action,
label: j._("\u78ba\u5b9a")
})));
}
});
e.exports = n;
}, null);
__d("XUIMenuSeparator.react", ["MenuSeparator.react"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
var h = g;
e.exports = h;
}, null);
__d("ReactSelectorUtils", ["React"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
var h = {
processMenuItems: function(i, j) {
var k, l = g.Children.map(i, function(m) {
if (m) {
var n = m.props.value === j;
m = g.cloneElement(m, {
selected: n
});
if (n) k = m;
return m;
}
});
return {
items: l,
selectedItem: k
};
},
processMultiMenuItems: function(i, j) {
var k = [],
l = i;
if (j) l = g.Children.map(i, function(m) {
if (m) {
var n = j.some(function(o) {
return o === m.props.value;
});
m = g.cloneElement(m, {
selected: n
});
if (n) k.push(m);
return m;
}
});
return {
items: l,
selectedItems: k
};
}
};
e.exports = h;
}, null);
__d("PopoverMenuContextMinWidth", ["CSS", "Style", "cx", "shield"], function(a, b, c, d, e, f, g, h, i, j) {
b.__markCompiled && b.__markCompiled();
function k(l) {
"use strict";
this._popoverMenu = l;
this._popover = l.getPopover();
}
k.prototype.enable = function() {
"use strict";
this._setMenuSubscription = this._popoverMenu.subscribe('setMenu', j(this._onSetMenu, this));
};
k.prototype.disable = function() {
"use strict";
this._setMenuSubscription.unsubscribe();
this._setMenuSubscription = null;
if (this._showSubscription) {
this._showSubscription.unsubscribe();
this._showSubscription = null;
}
if (this._menuSubscription) {
this._menuSubscription.unsubscribe();
this._menuSubscription = null;
}
};
k.prototype._onSetMenu = function() {
"use strict";
this._menu = this._popoverMenu.getMenu();
this._showSubscription = this._popover.subscribe('show', j(this._updateWidth, this));
var l = this._updateWidth.bind(this);
this._menuSubscription = this._menu.subscribe(['change', 'resize'], function() {
setTimeout(l, 0);
});
this._updateWidth();
};
k.prototype._updateWidth = function() {
"use strict";
var l = this._menu.getRoot(),
m = this._popoverMenu.getTriggerElem(),
n = m.offsetWidth;
h.set(l, 'min-width', n + 'px');
g.conditionClass(l, "_575s", n >= l.offsetWidth);
};
Object.assign(k.prototype, {
_setMenuSubscription: null,
_showSubscription: null,
_menuSubscription: null
});
e.exports = k;
}, null);
__d("AbstractSelector.react", ["InlineBlock.react", "React", "PopoverMenu.react", "ReactSelectorUtils", "ContextualLayerAutoFlip", "PopoverMenuContextMinWidth", "PopoverMenuOverlappingBorder", "cloneWithProps", "cx", "invariant", "joinClasses", "intlList"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) {
b.__markCompiled && b.__markCompiled();
var s = h,
t = s.PropTypes;
function u(w, x, y) {
if (w[x] == null) return;
var z = Array.isArray(w[x]);
if (w.multiple) {
if (!z) return new Error('You are trying to set a single value for `' + x + '` ' + 'but the menu has `multiple` set to true, so it should be an ' + 'array of values.');
} else if (z) return new Error('You are trying to set an array of values for `' + x + '` ' + 'but the menu has `multiple` set to false, so it should be a ' + 'single value.');
}
var v = h.createClass({
displayName: "AbstractSelector",
propTypes: {
config: t.object.isRequired,
alignh: t.oneOf(['left', 'center', 'right']),
name: t.string,
overlappingborder: t.bool,
onChange: t.func,
disabled: t.bool,
maxheight: t.number,
multiple: t.bool,
defaultLabel: t.string,
defaultValue: u,
value: u,
initialValue: u
},
getInitialState: function() {
return {
value: (this.props.value != null ? this.props.value : this.props.defaultValue != null ? this.props.defaultValue : this.props.initialValue)
};
},
setMenuValue: function(w) {
p(this.refs && this.refs.popover);
this._internalChange = true;
this.refs.popover.getMenu().setValue(w);
this._internalChange = false;
},
onChange: function(w, x) {
if (this._internalChange) return;
if (this.props.value == null) {
var y = null;
if (this.props.multiple) {
y = x.map(function(z) {
return z.value;
});
} else y = x.value;
this.setState({
value: y
});
} else this.setMenuValue(this.props.value);
if (this.props.onChange) this.props.onChange(x);
},
componentWillReceiveProps: function(w) {
if (w.value != null) {
this.setState({
value: w.value
});
} else if (this.props.multiple !== w.multiple) this.setState({
value: w.multiple ? [this.state.value] : this.state.value[0]
});
},
render: function() {
var w = this.props.config,
x = !this.props.multiple ? j.processMenuItems(this.props.children, this.state.value) : j.processMultiMenuItems(this.props.children, this.state.value),
y = n(w.menu, {
children: x.items,
className: q("_575t", w.menu.props.className),
maxheight: this.props.maxheight,
onChange: this.onChange
}),
z = '',
aa = null;
if (!this.props.multiple) {
var ba = x.selectedItem;
z = ba.props.label || ba.props.children;
if (ba.props.icon) aa = n(ba.props.icon, {});
} else {
var ca = x.selectedItems;
if (!ca.length) {
z = this.props.defaultLabel;
} else z = r(ca.map(function(ka) {
return ka.props.children;
}), r.CONJUNCTIONS.NONE);
}
var da = {
label: z,
disabled: this.props.disabled
};
if (aa) da.image = aa;
var ea = n(w.button, da),
fa = [k];
if (w.layerBehaviors) fa = fa.concat(w.layerBehaviors);
var ga = [l];
if (this.props.overlappingborder) ga.push(m);
var ha = null;
if (this.props.multiple) {
var ia = this.props.name + '[]',
ja;
if (this.state.value) ja = this.state.value.map(function(ka) {
return (h.createElement("input", {
key: ka,
type: "hidden",
name: ia,
value: ka
}));
});
ha = h.createElement("div", null, ja);
} else ha = h.createElement("input", {
type: "hidden",
name: this.props.name,
value: this.state.value
});
return (h.createElement(g, h.__spread({}, this.props, {
alignv: "middle",
name: null
}), h.createElement(i, {
ref: "popover",
menu: y,
alignh: this.props.alignh,
layerBehaviors: fa,
behaviors: ga,
disabled: this.props.disabled
}, ea), ha));
},
showMenu: function() {
p(this.isMounted());
this.refs.popover.showPopover();
},
hideMenu: function() {
p(this.isMounted());
this.refs.popover.hidePopover();
}
});
e.exports = v;
}, null);
__d("XUISelectorButton.react", ["React", "XUIPopoverButton.react", "invariant"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
var j = g.createClass({
displayName: "XUISelectorButton",
render: function() {
i(!this.props.theme);
return (g.createElement(h, g.__spread({}, this.props, {
theme: "dark"
})));
}
});
e.exports = j;
}, null);
__d("XUISelector.react", ["AbstractSelector.react", "ContextualLayerPositionClassOnContext", "React", "ReactChildren", "ReactXUIMenu", "XUISelectorButton.react", "invariant"], function(a, b, c, d, e, f, g, h, i, j, k, l, m) {
b.__markCompiled && b.__markCompiled();
var n = k.SelectableMenu,
o = k.SelectableItem,
p = i,
q = p.PropTypes,
r = i.createClass({
displayName: "ReactXUISelector",
propTypes: {
layerBehaviors: q.array,
maxheight: q.number,
multiple: q.bool,
disabled: q.bool,
haschevron: q.bool,
maxwidth: q.number,
size: q.oneOf(['small', 'medium', 'large', 'xlarge', 'xxlarge']),
suppressed: q.bool,
use: q.oneOf(['default', 'special', 'confirm'])
},
statics: {
getButtonSize: function(s) {
return s.size || 'medium';
}
},
getDefaultProps: function() {
return {
haschevron: true,
layerBehaviors: [],
multiple: false
};
},
render: function() {
var s, t = [];
j.forEach(this.props.children, function(v) {
if (v) t.push(v);
});
if (t[0] && t[0].type === l) {
s = t[0];
t = t.slice(1);
} else s = i.createElement(l, {
haschevron: this.props.haschevron,
disabled: this.props.disabled,
use: this.props.use,
size: this.props.size,
suppressed: this.props.suppressed,
maxwidth: this.props.maxwidth
});
var u = {
button: s,
menu: i.createElement(n, {
maxheight: this.props.maxheight,
multiple: this.props.multiple
}),
layerBehaviors: this.props.layerBehaviors.concat([h])
};
return (i.createElement(g, i.__spread({}, this.props, {
ref: "abstractSelector",
config: u
}), t));
},
showMenu: function() {
m(this.isMounted());
this.refs.abstractSelector.showMenu();
},
hideMenu: function() {
m(this.isMounted());
this.refs.abstractSelector.hideMenu();
}
});
r.Option = o;
e.exports = r;
}, null);
__d("ActorSelector.react", ["ActorSelectorPlaceholder.react", "BizSiteIdentifier.brands", "BootloadedComponent.react", "Bootloader", "CurrentUser", "DOM", "DOMScroll", "Event", "Focus", "Image.react", "JSResource", "LayerFadeOnHide", "LayerFadeOnShow", "ModulePerformanceGating", "React", "ReactLayeredComponentMixin", "ShortProfiles", "TooltipData", "XUIContextualDialog.react", "XUIDialogBody.react", "XUIDialogFooter.react", "XUIDialogOkayButton.react", "XUIMenuSeparator.react", "XUISelector.react", "XUISpinner.react", "cx", "fbt", "getObjectValues", "goURI", "ix", "joinClasses", "mapObject", "tidyEvent", "BrandsAppConfig"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, aa, ba, ca, da, ea, fa, ga, ha, ia, ja, ka, la, ma) {
b.__markCompiled && b.__markCompiled();
var na = da.Option,
oa = b('BrandsAppConfig').gk;
if (!t.bootload_page_voice_dropdown) j.loadModules(["PageVoiceDropdownSelector.react"], function() {});
var pa = u,
qa = pa.PropTypes,
ra = 32,
sa = 195,
ta = 500,
ua = 175,
va = 16,
wa = u.createClass({
displayName: "ActorSelector",
mixins: [v],
propTypes: {
actorIDs: qa.array.isRequired,
actorPermissions: qa.object,
coverEnabled: qa.bool.isRequired,
focusOnInit: qa.bool,
loading: qa.bool,
nuxBody: qa.node,
nuxEnabledCovered: qa.bool,
nuxEnabledUncovered: qa.bool,
nuxHoverContext: qa.object,
onChange: qa.func.isRequired,
onCompleteNux: qa.func,
selectedActorID: qa.string,
settingsURI: qa.string,
showName: qa.bool,
showNameMaxWidth: qa.number,
suppressed: qa.bool,
tooltipConstructor: qa.func,
tooltipConstructorCovered: qa.func
},
getDefaultProps: function() {
return {
suppressed: true
};
},
getInitialState: function() {
return {
actorData: {},
clicked: false,
nuxShown: false
};
},
componentWillMount: function() {
this._fetchActorData();
},
render: function() {
var xa = oa.business_identity_page_voice_selector;
if (!this.props.selectedActorID || !this.state.actorData[this.props.selectedActorID]) return u.createElement(g, {
focusOnInit: this.props.focusOnInit
});
var ya = this._renderSelectorOptions();
if (ya.length < 1) return u.createElement("div", null);
if (xa) {
return this._renderNewComponent();
} else return this._renderOldComponent(ya);
},
_renderOldComponent: function(xa) {
var ya = this._isCovered();
return (u.createElement("span", {
className: ka("_6vh", this.props.className)
}, u.createElement(ea, {
className: ((!this.props.loading ? "hidden_elem" : '') + (!this.props.suppressed ? ' ' + "_3-8_" : ''))
}), u.createElement(da, {
haschevron: !ya,
className: "_6vi",
disabled: this.props.loading,
maxheight: sa,
maxwidth: ya ? va : this.props.showName ? this.props.showNameMaxWidth : ra,
onChange: this.props.onChange,
onClick: this._onClickSelector,
ref: "selector",
suppressed: this.props.suppressed,
value: this.props.selectedActorID
}, xa)));
},
_renderNewComponent: function() {
return (u.createElement("span", {
className: ka("_6vh", this.props.className)
}, u.createElement(ea, {
className: ((!this.props.loading ? "hidden_elem" : '') + (' ' + "_3-8_"))
}), u.createElement("span", {
ref: "selector"
}, u.createElement(i, {
bootloadPlaceholder: u.createElement(g, {
focusOnInit: this.props.focusOnInit
}),
bootloadLoader: q('PageVoiceDropdownSelector.react'),
covered: this._isCovered(),
focusOnInit: this.props.focusOnInit,
permissions: this.props.actorPermissions,
pages: this.state.actorData,
onChange: this.props.onChange,
onClick: this._onClickSelector,
selectedActorID: this.props.selectedActorID,
searchBarVisible: true,
showBusinessPages: false,
showPageName: this.props.showName,
showNameMaxWidth: this.props.showNameMaxWidth,
showPersonalPagesInRoot: !h.isBizSite(),
suppressed: this.props.suppressed,
user: ha(this.state.actorData)[0]
}))));
},
renderLayers: function() {
if (!this.refs.selector) return null;
var xa = null;
if (this.props.settingsURI) xa = u.createElement("a", {
onClick: this._onClickSettings,
style: {
verticalAlign: 'middle'
}
}, ga._("\u8cbc\u6587\u5c6c\u6027\u8a2d\u5b9a"));
if (this.state.nuxShown) m.ensureVisible(u.findDOMNode(this.refs.selector), null, ua);
return {
nux: u.createElement(y, {
alignment: "right",
behaviors: {
LayerFadeOnHide: r,
LayerFadeOnShow: s
},
contextRef: function() {
return this.refs.selector;
}.bind(this),
hasActionableContext: true,
offsetY: -8,
position: "below",
shown: this.state.nuxShown,
width: y.WIDTH.NORMAL
}, u.createElement(z, null, this.props.nuxBody), u.createElement(aa, {
leftContent: xa
}, u.createElement(ba, {
action: "button",
use: "confirm",
onClick: this._onCompleteNux
})))
};
},
_renderSelectorOptions: function() {
var xa = [],
ya = [];
this.props.actorIDs.map(function(db) {
if (this._isBusinessManagedActor(db)) {
ya.push(db);
} else xa.push(db);
}.bind(this));
var za = xa.map(this._renderActorOption);
if (ya && ya.length > 0) {
var ab = [],
bb = (u.createElement(p, {
src: ja('/images/bizsite/busmgr_bookmark_icon_16px.png'),
alt: ""
})),
cb = this._groupActorIDsByBusinessID(ya);
la(cb, function(db, eb) {
ab.push(u.createElement(ca, {
key: 'separator_' + eb
}));
var fb = ha(cb[eb])[0],
gb = fb ? this.state.actorData[fb].businessName : eb;
ab.push(u.createElement(na, {
disabled: true,
icon: bb,
key: 'option_' + eb
}, gb));
la(db, function(hb) {
ab.push(this._renderActorOption(hb));
}.bind(this));
}.bind(this));
}
za = za.concat(ab);
return za;
},
_renderActorOption: function(xa) {
var ya = this._isCovered(),
za = this.state.actorData[xa];
if (!za) return;
var ab = !!za.businessID,
bb = u.createElement(p, {
className: "_6vg",
height: va,
src: ya && k.getID() === xa ? ja('images/pages/voice/flag.png') : za.thumbSrc,
width: va,
alt: ""
});
return (u.createElement(na, {
className: ((ab ? "plm" : '')),
icon: bb,
key: 'actor_' + xa,
value: xa
}, za.name));
},
componentDidMount: function() {
this._setTooltip();
if (this.props.focusOnInit) this._focusSelector();
if (this._canShowNux())
if (this.props.nuxHoverContext) {
var xa = ma(n.listen(this.props.nuxHoverContext, 'mouseenter', function() {
var ya = setTimeout(function() {
xa.remove();
if (this._canShowNux()) this.setState({
nuxShown: true
});
}.bind(this), ta),
za = ma(n.listen(this.props.nuxHoverContext, 'mouseleave', function() {
clearTimeout(ya);
za.remove();
}));
}.bind(this)));
} else this.setState({
nuxShown: true
});
},
componentDidUpdate: function(xa) {
if (this.state.focusOnUpdate) {
this._focusSelector();
this.setState({
focusOnUpdate: false
});
}
if (this.props.actorIDs.toString() !== xa.actorIDs.toString()) this._fetchActorData();
this._setTooltip();
},
_focusSelector: function() {
var xa = this.refs.selector && u.findDOMNode(this.refs.selector);
if (!xa) return;
var ya = l.scry(xa, 'a').pop();
o.set(ya);
},
_canShowNux: function() {
return (this.props.nuxEnabledCovered && this._isCovered()) || (this.props.nuxEnabledUncovered && !this._isCovered());
},
_fetchActorData: function() {
w.getMulti(this.props.actorIDs, function(xa) {
this.setState({
actorData: xa,
focusOnUpdate: this.props.focusOnInit
});
}.bind(this));
},
_isCovered: function() {
return (this.props.coverEnabled && !this.state.clicked && k.getID() === this.props.selectedActorID);
},
_onClickSelector: function() {
this.setState({
clicked: true
});
if (this.state.nuxShown) this._onCompleteNux();
},
_onClickSettings: function() {
this._onCompleteNux();
ia(this.props.settingsURI);
},
_onCompleteNux: function() {
this.setState({
nuxShown: false
});
if (this.props.onCompleteNux) this.props.onCompleteNux({
isCovered: this._isCovered()
});
},
_setTooltip: function() {
if (!this.refs.selector) return;
var xa = this.state.actorData[this.props.selectedActorID];
if (!xa) return;
var ya = this._isCovered() && this.props.tooltipConstructorCovered ? this.props.tooltipConstructorCovered : this.props.tooltipConstructor;
if (!ya) return;
x.set(u.findDOMNode(this.refs.selector), ya(xa.name), 'above', 'right');
},
_isBusinessManagedActor: function(xa) {
return (this.state.actorData[xa] && this.state.actorData[xa].businessID);
},
_groupActorIDsByBusinessID: function(xa) {
var ya = {};
xa.forEach(function(za, ab) {
var bb = this.state.actorData[ab] ? this.state.actorData[ab].businessID : null;
if (bb) {
if (!za[bb]) za[bb] = {};
za[bb][ab] = ab;
}
}.bind(this, ya));
return ya;
}
});
e.exports = wa;
}, null);
__d("XActorSelectorNuxSeenWriteController", ["XController"], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = b("XController").create("\/actor_selector\/nux\/mark_seen\/", {
nux_type: {
type: "Enum",
required: true,
enumType: 1
}
});
}, null);
__d("UFIActorSelector.react", ["ActorSelector.react", "ActorSelectorNuxTypes", "Arbiter", "AsyncRequest", "Parent", "React", "SubscriptionsHandler", "UFICentralUpdates", "UFIFeedbackTargets", "UFIUserActions", "XActorSelectorNuxSeenWriteController", "fbt"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) {
b.__markCompiled && b.__markCompiled();
var s = l,
t = s.PropTypes,
u = 'ufi_actor_selector_nux_disabled_event',
v = l.createClass({
displayName: "UFIActorSelector",
propTypes: {
actorIDs: t.array.isRequired,
coverEnabled: t.bool.isRequired,
ftEntIdentifier: t.string.isRequired,
isTimeline: t.bool,
nuxEnabledCovered: t.bool,
nuxEnabledUncovered: t.bool,
nuxHoverContext: t.object,
settingsURI: t.string
},
getInitialState: function() {
var w = k.byClass(this.props.nuxHoverContext, 'timelineUnitContainer');
return {
loading: false,
nuxEnabledCovered: this.props.nuxEnabledCovered,
nuxEnabledUncovered: this.props.nuxEnabledUncovered,
nuxHoverContext: w ? w : this.props.nuxHoverContext,
selectedActorID: null
};
},
render: function() {
return (l.createElement(g, {
actorIDs: this.props.actorIDs,
coverEnabled: this.props.coverEnabled,
focusOnInit: this.props.focusOnInit,
loading: this.state.loading,
nuxBody: this._getNUXBody(),
nuxEnabledCovered: this.state.nuxEnabledCovered,
nuxEnabledUncovered: this.state.nuxEnabledUncovered,
nuxHoverContext: this.state.nuxHoverContext,
onChange: this._onChange,
onCompleteNux: this._onCompleteNux,
selectedActorID: this.state.selectedActorID,
settingsURI: this.props.settingsURI,
tooltipConstructor: this._getTooltipForActorName,
tooltipConstructorCovered: this._getCoveredTooltip
}));
},
componentDidMount: function() {
this._updateSelectedActorIDFromFeedbackTarget();
this._subscriptions = new m();
this._subscriptions.addSubscriptions(n.subscribe('feedback-updated', function(w, x) {
if (this.props.ftEntIdentifier in x.updates) this._updateSelectedActorIDFromFeedbackTarget();
}.bind(this)), i.subscribe(u, function() {
this.setState({
nuxEnabledCovered: false,
nuxEnabledUncovered: false
});
}.bind(this)));
},
componentWillUnmount: function() {
this._subscriptions.release();
},
_updateSelectedActorIDFromFeedbackTarget: function() {
o.getFeedbackTarget(this.props.ftEntIdentifier, function(w) {
this.setState({
loading: false,
selectedActorID: w.actorforpost
});
}.bind(this));
},
_getNUXBody: function() {
return (r._("\u9078\u64c7\u8981\u4ee5\u672c\u4eba\u6216\u4f60\u7ba1\u7406\u7684\u5176\u4e2d\u4e00\u500b\u7c89\u7d72\u5c08\u9801\u7684\u8eab\u5206\u4f86\u6309\u8b9a\u548c\u7559\u8a00\u3002"));
},
_getTooltipForActorName: function(w) {
return (r._("\u4ee5{actorName}\u7684\u8eab\u5206\u8aaa\u8b9a\u548c\u7559\u8a00", [r.param("actorName", w)]));
},
_getCoveredTooltip: function() {
return (r._("\u4ee5\u4f60\u7ba1\u7406\u7684\u5176\u4e2d\u4e00\u500b\u7c89\u7d72\u5c08\u9801\u8eab\u5206\u8aaa\u8b9a\u8aaa\u7559\u8a00\u3002"));
},
_onChange: function(w) {
this.setState({
loading: true
});
p.changeActor(this.props.ftEntIdentifier, w.value);
},
_onCompleteNux: function(w) {
var x = w.isCovered,
y = null;
if (this.props.isTimeline) {
if (x) {
y = h.UFI_TIMELINE_COVERED;
} else y = h.UFI_TIMELINE;
} else y = h.UFI;
var z = q.getURIBuilder().setEnum('nux_type', y).getURI();
new j().setURI(z).send();
i.inform(u);
}
});
e.exports = v;
}, null);
__d("XUIDialogCancelButton.react", ["React", "XUIDialogButton.react", "fbt"], function(a, b, c, d, e, f, g, h, i) {
b.__markCompiled && b.__markCompiled();
var j = g.createClass({
displayName: "XUIDialogCancelButton",
render: function() {
return (g.createElement(h, g.__spread({}, this.props, {
action: "cancel",
label: i._("\u53d6\u6d88")
})));
}
});
e.exports = j;
}, null);
/*!CK:3801886264!*/ /*1438697732,*/
if (self.CavalryLogger) {
CavalryLogger.start_js(["MDrp8"]);
}
__d("legacy:EmployeePrefs", ["EmployeePrefs"], function(a, b, c, d) {
b.__markCompiled && b.__markCompiled();
a.EmployeePrefs = b('EmployeePrefs');
}, 3);
__d("ArticleAuthorEngagementBlock", ["CSS", "csx", "DOMQuery", "Event", "Style"], function(a, b, c, d, e, f, g, h, i, j, k) {
b.__markCompiled && b.__markCompiled();
var l = {
registerClickHandler: function(m, n, o) {
j.listen(m, 'click', function(p) {
if (n !== (void 0) && g.shown(n) === false) {
if (o) {
var q = i.scry(m, "._3c21"),
r = i.scry(m, "._6m3");
if (q.length === 0 || r.length === 0) return;
var s = q[0],
t = r[0];
k.set(s, 'height', '237px');
k.set(t, 'height', '179px');
}
g.show(n);
}
});
}
};
e.exports = l;
}, null);
/*!CK:3755121466!*/ /*1438058446,*/
if (self.CavalryLogger) {
CavalryLogger.start_js(["8jZry"]);
}
__d("AttachmentCTA", ["Style"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
var h = 10,
i = {
init: function(j) {
var k = j.parentNode,
l = Math.max(k.scrollHeight - j.scrollHeight - h * 2, 0);
g.set(j, 'margin-top', l + 'px');
}
};
e.exports = i;
}, null);
__d("CanvasRHCHeightController.react", ["React", "DOMQuery"], function(a, b, c, d, e, f, g, h) {
b.__markCompiled && b.__markCompiled();
var i = g,
j = i.PropTypes,
k = g.createClass({
displayName: "CanvasRHCHeightController",
propTypes: {
rhc: j.object
},
render: function() {
var l = h.find(document, '#contentArea'),
m = 0;
if (this.props.rhc.scrollHeight < l.scrollHeight) m = l.scrollHeight - this.props.rhc.scrollHeight;
var n = {
height: m + 'px'
};
return (g.createElement("div", {
style: n
}));
}
});
e.exports = k;
}, null);
__d("getNormalizedClientRect", ["getDocumentScrollElement"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
'use strict';
function h(i) {
var j = i.getBoundingClientRect(),
k = 0,
l = 0,
m = g(i.ownerDocument),
n = m.getBoundingClientRect();
if (n.left > 0) {
k = -n.left;
} else {
var o = m.scrollWidth + n.left,
p = n.width;
if (p > o) k = p - o;
}
if (n.top > 0) l = -n.top;
return {
bottom: j.bottom + l,
height: j.height,
left: j.left + k,
right: j.right + k,
top: j.top + l,
width: j.width
};
}
e.exports = h;
}, null);
__d("FansJewel", ["AsyncRequest"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
function h(i) {
"use strict";
i.subscribe('marked-seen', function() {
new g('/ajax/pages/fans_seen.php').setMethod('POST').send();
});
}
e.exports = h;
}, null);
__d("CanvasInteractionTracker", ["Banzai"], function(a, b, c, d, e, f, g) {
b.__markCompiled && b.__markCompiled();
var h = 'canvas_sustained_interaction',
i;
function j(l, m, n) {
l.onmouseover = function(event) {
i = window.setTimeout(function() {
g.post(h, {
app_id: m
});
}, n);
};
l.onmouseout = function(event) {
window.clearTimeout(i);
};
}
var k = {
setup: j
};
e.exports = k;
}, null);
__d("StickyArea", ["CSS", "DOM", "DOMQuery", "Event", "Run", "Style", "ViewportBounds", "cx", "getNormalizedClientRect", "getOverlayZIndex", "removeFromArray", "throttle"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) {
b.__markCompiled && b.__markCompiled();
var s = [],
t = null,
u = null,
v = null,
w = r.acrossTransitions(x, 1000);
function x() {
s.sort(function(da, ea) {
var fa = da.getNode(),
ga = ea.getNode();
if (fa.compareDocumentPosition) {
return 3 - (fa.compareDocumentPosition(ga) & 6);
} else return fa.sourceIndex - ga.sourceIndex;
});
}
function y(da, ea, fa) {
var ga = da.getPlaceholder(),
ha = da.getNode(),
ia = l.get(ha, 'float'),
ja = da.getData();
if (ja.placeholderWidth !== ea || ja.placeholderHeight !== fa || ja.placeholderFloat !== ia) {
l.apply(ga, {
'float': ia,
height: fa + 'px',
width: ea + 'px'
});
ja.placeholderHeight = fa;
ja.placeholderWidth = ea;
}
if (ha.nextSibling !== ga) h.insertAfter(ha, ga);
}
function z(da, ea) {
var fa = da.getData();
if (fa.fixed !== ea) {
l.apply(da.getNode(), fa.styles);
g.conditionShow(da.getPlaceholder(), ea);
fa.fixed = ea;
}
}
function aa(da, ea) {
if (!da) {
return 0;
} else if (ea.right <= da.rect.left || ea.left >= da.rect.right) {
return aa(da.prev, ea);
} else return da.bottom;
}
function ba() {
var da = 0,
ea = s.length,
fa = 100;
function ga(ha, ia) {
var ja = fa;
while (da < ea) {
var ka = s[da],
la = ka.getNode();
if (ia && !i.contains(ia, la)) break;
fa = Math.max(ja, ka.getZIndex());
var ma = ka.getData(),
na = la.parentNode,
oa = ma.styles;
for (var pa in oa) oa[pa] = '';
z(ka, false);
var qa = la.offsetHeight,
ra = la.offsetWidth,
sa = o(la),
ta = aa(ha, sa) + ka.getOffset();
if (sa.top <= ta) {
oa.width = ra + 'px';
var ua = parseInt(l.get(na, 'padding-bottom'), 10),
va = o(na);
if (va.bottom - ua > ta + qa) {
var wa = parseInt(l.get(la, 'margin-left'), 10);
oa.position = 'fixed';
oa.bottom = 'auto';
oa.top = ta + 'px';
oa.left = sa.left - wa + 'px';
} else {
if (!ma.parent || na !== ma.parent) {
if (l.get(na, 'position') === 'static') l.set(na, 'position', 'relative');
ma.parent = na;
}
oa.position = 'absolute';
oa.top = 'auto';
oa.bottom = ua + 'px';
var xa = parseInt(l.get(na, 'border-left-width'), 10);
oa.left = (sa.left - va.left - xa) + 'px';
}
y(ka, ra, qa);
z(ka, true);
}
da++;
ga({
bottom: ta + qa,
prev: ha,
rect: sa
}, na);
l.set(la, 'z-index', fa++);
}
}
ga(null, null);
}
function ca(da, ea, fa) {
"use strict";
this._node = da;
this._data = {
fixed: false,
placeholderFloat: null,
placeholderHeight: null,
placeholderWidth: null,
styles: {}
};
this._offset = fa;
g.addClass(da, "_k");
if (!ea) k.onLeave(this.destroy.bind(this));
if (!s.length) {
t = j.listen(window, 'scroll', function() {
w();
ba();
});
u = j.listen(window, 'resize', function() {
w();
ba();
});
v = m.subscribe('change', function() {
w();
ba();
});
}
s.push(this);
ca.reflow();
}
ca.prototype.destroy = function() {
"use strict";
q(s, this);
if (!s.length) {
t.remove();
t = null;
u.remove();
u = null;
}
if (this._placeholder) h.remove(this._placeholder);
var da = 0;
for (var ea in this._data.styles) {
this._data.styles[ea] = '';
da++;
}
if (da) l.apply(this._node, this._data.styles);
};
ca.prototype.getData = function() {
"use strict";
return this._data;
};
ca.prototype.getNode = function() {
"use strict";
return this._node;
};
ca.prototype.getOffset = function() {
"use strict";
return this._offset || 0;
};
ca.prototype.getPlaceholder = function() {
"use strict";
if (!this._placeholder) this._placeholder = h.create('div');
return this._placeholder;
};
ca.prototype.getZIndex = function() {
"use strict";
if (!this._zIndex) this._zIndex = p(this._node);
return this._zIndex;
};
ca.prototype.setOffset = function(da) {
"use strict";
this._offset = da;
};
ca.reflow = r.acrossTransitions(function() {
x();
ba();
}, 100);
e.exports = ca;
}, null);
This file has been truncated, but you can view the full file.
/*!CK:998514971!*/ /*1438811940,*/
if (self.CavalryLogger) {
CavalryLogger.start_js(["jndCB"]);
}
__d("XAdPreferencesCategoryInfoController", ["XController"], function(a, b, c, d, e, f) {
b.__markCompiled && b.__markCompiled();
e.exports = b("XController").create("\/ads\/preferences\/category_info\/", {
ad_id: {
type: "Int",
required: true
},
category_fbid: {
type: "Int",
required: true
}
});
}, null);
__d("AdsPreferencesInterestListItem.react", ["AdPreferencesDesktopStrings", "AsyncRequest", "Image.react", "Layout.react", "xuiglyph", "React", "ReactLayeredComponentMixin", "XAdPreferencesCategoryInfoController", "XUIContextualDialog.react", "XUIContextualDialogTitle.react", "XUIContextualDialogBody.react", "XUIText.react", "cx", "fbt"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) {
b.__markCompiled && b.__markCompiled();
var u = j.Column,
v = j.FillColumn,
w = l,
x = w.PropTypes,
y = l.createClass({
displayName: "AdsPreferencesInterestListItem",
mixins: [m],
propTypes: {
adID: x.number.isRequired,
interest: x.object.isRequired,
isListItem: x.bool.isRequired,
onInterestClick: x.func.isRequired,
removed: x.bool.isRequired,
setDialog: x.func,
setReportDialog: x.func
},
getInitialState: function() {
return {
xHover: false,
iHover: false,
interestHover: false,
enterTimeout: -1,
suggestions: {}
};
},
_xHover: function(event) {
this.setState({
xHover: !this.state.xHover
});
},
_xOver: function(event) {
this.setState({
xHover: true
});
},
_iHover: function(event) {
this.setState({
iHover: !this.state.iHover
});
},
_interestHover: function(z) {
this.setState({
interestHover: z
});
},
_interestEnter: function(event, z, aa) {
if (aa) {
this._interestHover(true);
} else {
var ba = setTimeout(this._interestEnter.bind(this, true, true, true), 250);
this.setState({
enterTimeout: ba
});
}
},
_interestLeave: function(event) {
this._interestHover(false);
clearTimeout(this.state.enterTimeout);
},
_handleInterestClick: function(event) {
var z = this.refs['toggle_' + this.props.interest.id];
this.props.onInterestClick(this.props.interest, this.props.removed, z);
},
_onInterestTextClick: function(event) {
if (this.state.suggestions > 0 && this.props.setDialog) {
this.props.setDialog(this.props.interest, this.state.suggestions);
} else {
var z = n.getURIBuilder().setInt('ad_id', this.props.adID).setInt('category_fbid', this.props.interest.id).getURI();
new h(z).setHandler(function(aa) {
var ba = aa.payload,
ca = ba.suggestions,
da = this.props.interest;
if (!da.description) da.description = t._("\u9019\u662f\u4f60\u65b0\u589e\u7684\u504f\u597d\u3002");
this.setState({
suggestions: ca
});
if (this.props.setDialog) this.props.setDialog(da, ba.suggestions);
}.bind(this)).send();
}
},
_onReportPreferenceClick: function(event) {
View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment