/* >>> file start: js/jquery/jquery.lj.repostbutton.js */
LJ.UI.registerTemplate('templates-CleanHtml-PaidRepost', "{{if !$data.owner}}+{{html $data.cost}}{{else $data.budget}}{{html $data.budget}}{{/if}}{{html $data.count}} ", 'JQuery.stat');
LJ.UI.registerTemplate('templates-CleanHtml-Repost', "{{if !$data.owner}}+{{html $data.cost}}{{else $data.budget}}{{html $data.budget}}{{/if}}{{html $data.count}} ", 'JQuery.stat');
LJ.UI.registerTemplate('templates-CleanHtml-reposted', "{{if $data.content}} {{each ($value.users || $data.users)}}{{if !((!$index) && !($value.dropComma || $data.dropComma))}}, {{/if}}{{html ($value.user || $data.user)}}{{/each}} {{else}}
{{/if}} ", 'JQuery.stat');
!function(t){return t}(),function(t){"use strict";t.widget("lj.repostbutton",t.lj.basicWidget,{options:{classNames:{active:"repost-button-active",inactive:"repost-button-inactive",popupLoad:"b-reposted-popup-load",popupNomore:"b-reposted-popup-footer-hide",repostError:"repost-error"},selectors:{counterParent:".lj-button-c",button:".lj-button-b",counter:".lj-like-item-count",buttonLink:".lj-button-link",popupContent:".b-reposted-popup-content",popupFooter:".b-reposted-popup-footer",popupMore:".b-reposted-popup-footer > a"},templates:{popup:"templates-CleanHtml-reposted"},url:"",reposted:!1,cost:0,budget:0,paid:!1},_create:function(){this.options.classNames={active:"b-flatrepost-reposted",inactive:"b-flatrepost-disabled",popupLoad:"b-reposted-popup-load",popupNomore:"b-reposted-popup-footer-hide",repostError:"repost-error"},this.options.selectors={counterParent:".b-flatrepost-counter",button:".b-flatrepost-name",counter:".b-flatrepost-counter",buttonLink:".b-flatrepost-name",popupContent:".b-reposted-popup-content",popupFooter:".b-reposted-popup-footer",popupMore:".b-reposted-popup-footer > a"},t.lj.basicWidget.prototype._create.apply(this),this.options.url||console.warn(this.widgetName,": no url in options, initialization won't continue"),this._journal=LJ.get("currentJournal"),this._count=null,this._remote=LJ.get("remoteUser"),this._reposted=this.options.reposted,this._el("buttonLink"),this._href=this.element.find(this._s("button")).data("href"),this._href=LJ.Util.Journal.parseLink(this._href)||{},this._canRepost()||(this.element.addClass(this._cl("inactive")),this._buttonLink.removeAttr("title"),this._lock()),this._popup=null,this._popupContent=null,this._popupLocked=!1,this._lastUser=null,this._el("counterParent"),this._el("counter"),Number(this._counter.html())||this._hideCounter(),this._bindControls()},_hideCounter:function(){this._counterParent.addClass("empty")},_showCounter:function(){this._counterParent.removeClass("empty")},_bindControls:function(){var e=this;this.element.on("click",this._s("button"),this._onUpdateButton.bind(this)),this._counterParent.one("click",function(){Number(e._counter.html())&&(e._popup=e._tmpl("popup"),e._el("popupFooter",e._popup),e._popupContent=e._popup.find(e._s("popupContent")),e._popup.bubble({showOn:"click",align:"side",alwaysShowUnderTarget:!0,target:e._counterParent}).on("bubblehide",function(){e._lastUser=null,e._popupContent.empty(),e._popupFooter.removeClass(e._cl("popupNomore"))}).on("bubbleshow",function(){e._loadRepostedList()}).on("click",e._s("popupMore"),e._loadRepostedList.bind(e)),Function.defer(function(){e._popup.bubble("show")}))}),t.lj.basicWidget.prototype._bindControls.apply(e)},_loadRepostedList:function(t){var e=this;t&&t.preventDefault(),this._popupLocked||(this._popupLocked=!0,this._popupContent.addClass(this._cl("popupLoad")),LJ.Api.call("repost.get_list",{url:this.options.url,last:this._lastUser},function(t){e._popupContent.removeClass(e._cl("popupLoad")),e._popupLocked=!1,t.error?e._handleAnswer(t):(e._render(t.users,t.nomore,t.count),e._lastUser=t.last)}))},_render:function(t,e,o){var s=this;t.length>0&&s._tmpl("popup",{content:!0,dropComma:!!s._lastUser,users:t}).appendTo(s._popupContent),this._updateCounter(o),e&&s._popupFooter.addClass(s._cl("popupNomore"))},_onUpdateButton:function(t){this.locked()||this.toggleRepost(),t.preventDefault()},_handleAnswer:function(t){if(t.hasOwnProperty("delete")&&(t.message&&this._showMessage(t.message),this.paid!==Boolean(t.paid)||this.paid&&this.cost!==t.cost))return void this.element.replaceWith(LJ.Social.renderRepostButton(this.options.url,t));if(t.error){if(t.error.message&&this._showMessage(t.error.message),t.error.data)return void this.element.replaceWith(LJ.Social.renderRepostButton(this.options.url,t.error.data))}else this._updateButton(!this._reposted);!t.hasOwnProperty("count")&&t.hasOwnProperty("delete")&&(t.count=this._count-1),this._updateCounter(t.count),this._unlock()},_showMessage:function(e){var o=t("",{"class":this._cl("repostError"),text:e}).bubble({target:this.element,align:"center",hide:function(){o.remove()}}).bubble("show")},_updateButton:function(t){this._reposted=t,this.element.toggleClass(this._cl("active"),this._reposted)},_updateCounter:function(t){"undefined"!=typeof t&&(this._count=Number(t),this._counter.html(this._count)),Number(this._counter.html())?this._showCounter():this._hideCounter()},_canRepost:function(){return LJ.get("preview")?!1:this._remote?LJ.get("remote_is_identity")?!1:this._remote!==this._href.journal:!1},toggleRepost:function(){var t=this,e={url:this.options.url};this._canRepost()&&(null===this._count&&(this._count=parseInt(this._el("counter").html(),10)||0),this._lock(),this._reposted?LJ.Api.call("repost.delete",e,function(e){e.error||e.reposted||t._journal!==t._remote||location.href.match(/\/(friends|times|feed)\b/)?t._handleAnswer(e):location.reload()}):(e.timezone=LJ.Util.Date.timezone(),this.options.paid&&(e.cost=this.options.cost),LJ.Api.call("repost.create",e,this._handleAnswer.bind(this))))}})}(jQuery);
/* <<< file end: js/jquery/jquery.lj.repostbutton.js */
//# map link was there [jquery.lj.repostbutton.js.map]
/* >>> file start: js/threeposts.js */
!function(t){return t}(),function(t){"use strict";t(function(){function e(){var t=3,e={7:4,8:4,9:3};return t=e[v]>0?e[v]:v}function i(){var t=1;if(M>H)return t=1;if(v>=2){t=Math.floor(H/M),t>v&&(t=v);var e=v%t;if(e>0)if(v%(t-1)===0)t--;else if(v%(t+1)===0)t++;else if(1===e){var i=H/(t+1);i>=E&&t++}}return t}function n(){H=u.width(),b=O>H?i():e(),s(H/b)}function s(t){var e=[150,300,330,400,500,600,800],i=["xxs","xs","s","m","l","xl","xxl"];e.forEach(function(n){t>n&&(F=i[e.indexOf(n)])})}function r(){u.find("."+w).removeClass(w),"xs"===F&&z.each(function(){var e=t(this).find("."+_),i=e.get(0).getClientRects().length;2>i&&t(this).addClass(w)})}function o(t){return p.get(t).scrollHeight}function a(){if(0===C&&g.height()>0){p.height("auto");var t=p.map(o),e=Math.max.apply(Math,t);p.height(e)}}function h(){H=u.width();var t=[400,600,800,1e3,1200,1400],e=["xs","s","m","l","xl","xxl"];t.forEach(function(i){H>i&&(j=e[t.indexOf(i)])}),n(),f()}function f(){var t=c+"--size-"+j,e=c+"--items-in-row-"+b,i=c+"--item-size-"+F,n=l+"\n"+t+"\n"+e+"\n"+i;u.attr("class",n),u.attr("data-item-layout",F),x.hide(),d.show(),a(),r()}var c="threeposts",u=t("."+c),l=u.attr("class"),x=t(".placeholder-threeposts"),d=t(".threeposts__items"),m="threeposts__item",p=t("."+m),g=t(p.get(0)),v=p.length,_="threeposts__title-inner",w="threeposts__item--short-title",y="threeposts__item--pic",z=t("."+y),C=z.length,M=235,E=200,O=1200,b=3,j="xxs",F="xxs",H=u.width();h(),t(window).resize(LJ.Function.debounce(h,50))})}(jQuery);
/* <<< file end: js/threeposts.js */
//# map link was there [threeposts.js.map]
/* >>> file start: js/recommended-entries.js */
!function(t){return t}(),function(t){"use strict";t(function(){function e(){return a=t("."+c),0==a.length?void setTimeout(e,1e3):(u=a.attr("class"),M=a.width(),d=t(".recommended-entries__list"),x=t("."+l),f=t(x.get(0)),m=x.length,void o())}function n(){var t=1;return _>M?t:(m>=2&&(t=Math.floor(M/_),6>t&&(t=Math.floor(M/v)),t>2&&6>t&&(t=3)),t)}function i(){M=a.width(),y>M&&(z=n()),g=M/z,r(g)}function r(){var t=[150,250,330,400,500,600,800],e=["xxs","xs","s","m","l","xl","xxl"];t.forEach(function(n){g>n&&(E=e[t.indexOf(n)])})}function o(){M=a.width();var t=[280,300,400,800,1e3,1200,1400],e=["xxs","xs","s","m","l","xl","xxl"];t.forEach(function(n){M>n&&(p=e[t.indexOf(n)])}),i(),s()}function s(){var t=c+"--size-"+p,e=c+"--items-in-row-"+z,n=c+"--item-size-"+E,i=u+"\n"+t+"\n"+e+"\n"+n;a.attr("class",i),a.attr("data-layout",M+"/"+p+"|"+z),a.attr("data-item-layout",g+"/"+E),d.show()}var c="recommended-entries",a=t("."+c),u=a.attr("class"),d=t(".recommended-entries__list"),l="recommended-entries__item",x=t("."+l),f=t(x.get(0)),m=x.length,h="threeposts__item--pic",w=t("."+h),_=(w.length,220),v=155,g=0,y=1044,z=6,p="xxs",E="xxs",M=a.width();e(),t(window).resize(LJ.Function.debounce(o,50))})}(jQuery);
/* <<< file end: js/recommended-entries.js */
//# map link was there [recommended-entries.js.map]
/* >>> file start: js/jquery/jquery.lj.ljcut.js */
!function(t){return t}(),function(t){"use strict";var e=[];t.widget("lj.ljcut",t.lj.basicWidget,{options:{journalid:null,ditemid:null,cutid:null,placeholders:0,sticky:!1,selectors:{expand:".ljcut-link-expand",collapse:".ljcut-link-collapse",collapseLink:".ljcut-pseudolink-collapse",stickyLink:".b-sticky-cut-link"},classNames:{preloader:"ljcut-link-expanding",expanded:"ljcut-expanded","sticky-cut-visible":"b-sticky-cut-visible",cut:".b-sticky-cut"}},_create:function(){t.lj.basicWidget.prototype._create.apply(this),this._window=t(window),this.cut=t(this._cl("cut")),this._stickyCollapseHandler=this._collapse.bind(this),this.content=null,this._isMac=/Mac/.test(navigator.userAgent),this._isOpera=/Opera/.test(navigator.userAgent),this._collapseNode=t('{close}'.supplant({close:this._ml("collapse")})),this._bindControls(),this._id=e.length,e[this._id]=!1},_bindControls:function(){var e=!1,i=[this._s("expand"),this._s("collapse")].join(", ");t.lj.basicWidget.prototype._bindControls.apply(this),this.element.on("click",this._s("expand"),this._expand.bind(this)),this.element.on("click",this._s("collapse"),this._collapse.bind(this)),this.element.on("touchstart",i,function(){e=!0}),this.element.on("touchmove",i,function(){e=!1}),this.element.on("touchend",i,function(i){e&&(t(i.target).trigger("click"),i.preventDefault())}),t(document).on("keydown",this._shortcuts.bind(this)),this._window.on("scroll",this._scrolling.bind(this))},_shortcuts:function(t){var e=this._isMac&&this._isOpera?t.metaKey:t.ctrlKey,i=t.altKey;if(e&&i){switch(t.which){case 61:case 187:this.expand();break;case 173:case 31:case 109:case 189:this.collapse()}t.preventDefault()}},_togglePreloader:function(t){this.element.toggleClass(this._cl("preloader"),t)},_toggleContent:function(e,i){var s,n=this;!this.locked()&&this.content&&(this._lock(),"function"!=typeof i&&(i=t.noop),this.element.toggleClass(n._cl("expanded"),e),e?this._showContent(i):(s=this.element.offset().top-30,this.element.is(":screenable")?this._hideContent(i):t("body,html").animate({scrollTop:s},300,function(){setTimeout(n._hideContent.bind(n,i),50)})))},_showContent:function(t){var e=this;this.content.show(50,function(){e._trigger("show",null,e),t(),e._unlock()})},_hideContent:function(t){var e=this;this.content.slideUp(50,function(){e._trigger("hide",null,e),t(),e._unlock()})},_requestContent:function(e){var i=this;this._lock(),this._togglePreloader(!0),LJ.Api.call("event.get_lj_cut",e,function(e){i.content=t("",{html:e.text}).hide(),i.content.find("a:not([target])").attr("target","_self"),i.element.after(i.content),setTimeout(function(){LJ.Event.trigger("ljcut:appendContent",{$content:i.content})},0),i._unlock(),i._togglePreloader(!1),i._toggleContent(!0,i._addHandlers.bind(i)),e.counter_image_url&&LJ.Stat.addCounter(e.counter_image_url)})},_addHandlers:function(){this.content.ljLikes(),LJ.Event.trigger("social:widgets:parse"),LJ.Event.trigger("social:newinsta:parse")},expand:function(){this.locked()||(this.content?this._toggleContent(!0):this._requestContent({journalid:this.options.journalid,ditemid:this.options.ditemid,cutid:this.options.cutid,placeholders:this.options.placeholders}))},collapse:function(){this.locked()||(this._toggleContent(!1),this._toggleStickyClass(!1))},_expand:function(t){return t.metaKey||t.ctrlKey?!0:(t.preventDefault(),void this.expand())},_collapse:function(t){return t.metaKey||t.ctrlKey?!0:(t.preventDefault(),e[this._id]=!1,void this.collapse())},_scrolling:function(){this._updateStickyCutState()},_updateStickyCutState:function(){var i,s,n,o,l,c,a;this._isExpanded()&&this.options.sticky&&this.content&&(i=this._window.height(),s=t(document).scrollTop(),n=this.content.height(),o=this.content.offset().top,l=o+n,a=this.element.find(this._s("collapse")),c=s>o&&l-i>s,e[this._id]=c,this._toggleStickyClass(c))},_toggleStickyClass:function(i){this.cut.toggleClass(this._cl("sticky-cut-visible"),e.indexOf(!0)>-1),i?t(document).on("click",this._s("stickyLink"),this._stickyCollapseHandler):t(document).off("click",this._s("stickyLink"),this._stickyCollapseHandler)},_addBottomCollapser:function(){return!this._bottomCloser&&this.options.sticky&&(this._bottomCloser=this._collapseNode.appendTo(this.content),this._bottomCloser.find(this._s("collapseLink")).on("click",this._bottomCloserClickHandler.bind(this))),this._bottomCloser},_bottomCloserClickHandler:function(){event.preventDefault(),this.collapse()},_isExpanded:function(){return this.element.hasClass(this._cl("expanded"))},_isCollapsed:function(){return!this._isExpanded()}})}(jQuery);
/* <<< file end: js/jquery/jquery.lj.ljcut.js */
//# map link was there [jquery.lj.ljcut.js.map]
/* >>> file start: js/core/string.js */
var _extends=Object.assign||function(t){for(var e=1;e=e)return t;for(;t.length":">",'"':""","'":"'"};return t.replace(/([<>&\"\'])/g,function(t,n){return e[n]?e[n]:n})},LJ.String.limit=function(){var t=arguments.length<=0||void 0===arguments[0]?"":arguments[0],e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=e.maxLength||150;return t.split(" ").reduce(function(t,e){if(t.limitReached)return t;var r=(t.limitedString+" "+e).trim();return r.length>n?_extends({},t,{limitReached:!0}):_extends({},t,{limitedString:r})},{limitedString:"",limitReached:!1}).limitedString}}();
/* <<< file end: js/core/string.js */
//# map link was there [string.js.map]
/* >>> file start: js/core/angular/activity.js */
!function(){"use strict";function t(t,n){function c(){return u}function e(t){u=t}function i(){n.cancel(o),e(!0),o=n(e.bind(this,!1),9e5)}var u,o;return i(),t.on("click touchstart touchend keydown mousemove mousewheel",LJ.Function.debounce(i,100,!0)),{isActive:c}}angular.module("LJ.Activity",[]),angular.module("LJ.Activity").factory("Activity",t),t.$inject=["$document","$timeout"]}();
/* <<< file end: js/core/angular/activity.js */
//# map link was there [activity.js.map]
/* >>> file start: js/core/angular/api.js */
//!= require js/core/angular/messages.js
//= require js/core/angular/activity.js
!function(){"use strict";function e(e,n,t,r,a,c){function i(e,n){return"undefined"==typeof n?e:e+angular.toJson(s(n))}function s(e){var n;return angular.isObject(e)?(n={},Object.keys(e).sort().forEach(function(t){n[t]=s(e[t])}),n):e}function o(e,n){f.remove(i(e,n))}function u(n,s,o,u){var g,l,p=r.defer(),d={cache:!1,silent:!1,meta:!1},m=!1;return c.isActive()?(angular.isObject(s)&&null!==s||(s={}),angular.isObject(o)&&(u=o,o=null),u=angular.extend(d,u||{}),l=i(n,s),u.cache&&(g=f.get(l),g&&(m=!0)),m||(g=p.promise,LJ.Api.call(n,s,function(n){e(function(){n.error?p.reject(n.error):p.resolve(n),t.$apply()},0)}),u.cache&&f.put(l,g)),LJ.Event.trigger("api:request:change",n,!0),g.then(function(){LJ.Event.trigger("api:request:change",n,!1)}),u.silent||g.then(function(e){var n={};"undefined"!=typeof e.message&&(angular.isString(e.message)?(n.body=e.message,n.type="success"):(n.body=e.message.content,n.type="success"),a.add(n))},function(e){"undefined"!=typeof e.message&&1!==e.code&&a.error({body:e.message})}),u.meta&&(g=g.then(function(e){return{response:e,fromCache:m}})),angular.isFunction(o)&&g.then(o),g):(p.reject(),p.promise)}var g={call:u,invalidate:o},f=n("LJApiPromises");return g}angular.module("LJ.Api",["LJ.Messages","LJ.Activity"]).factory("Api",e),e.$inject=["$timeout","$cacheFactory","$rootScope","$q","Messages","Activity"]}();
/* <<< file end: js/core/angular/api.js */
//# map link was there [api.js.map]
/* >>> file start: js/lib/jquery-ui/jquery.ui.position.min.js */
!function(t,o){t.ui=t.ui||{};var e=/left|center|right/,i=/top|center|bottom/,n="center",s={},f=t.fn.position,l=t.fn.offset;t.fn.position=function(o){if(!o||!o.of)return f.apply(this,arguments);o=t.extend({},o);var l,r,h,a=t(o.of),c=a[0],p=(o.collision||"flip").split(" "),u=o.offset?o.offset.split(" "):[0,0];return 9===c.nodeType?(l=a.width(),r=a.height(),h={top:0,left:0}):c.setTimeout?(l=a.width(),r=a.height(),h={top:a.scrollTop(),left:a.scrollLeft()}):c.preventDefault?(o.at="left top",l=r=0,h={top:o.of.pageY,left:o.of.pageX}):(l=a.outerWidth(),r=a.outerHeight(),h=a.offset()),t.each(["my","at"],function(){var t=(o[this]||"").split(" ");1===t.length&&(t=e.test(t[0])?t.concat([n]):i.test(t[0])?[n].concat(t):[n,n]),t[0]=e.test(t[0])?t[0]:n,t[1]=i.test(t[1])?t[1]:n,o[this]=t}),1===p.length&&(p[1]=p[0]),u[0]=parseInt(u[0],10)||0,1===u.length&&(u[1]=u[0]),u[1]=parseInt(u[1],10)||0,"right"===o.at[0]?h.left+=l:o.at[0]===n&&(h.left+=l/2),"bottom"===o.at[1]?h.top+=r:o.at[1]===n&&(h.top+=r/2),h.left+=u[0],h.top+=u[1],this.each(function(){var e,i=t(this),f=i.outerWidth(),a=i.outerHeight(),c=parseInt(t.curCSS(this,"marginLeft",!0))||0,g=parseInt(t.curCSS(this,"marginTop",!0))||0,d=f+c+(parseInt(t.curCSS(this,"marginRight",!0))||0),m=a+g+(parseInt(t.curCSS(this,"marginBottom",!0))||0),y=t.extend({},h);"right"===o.my[0]?y.left-=f:o.my[0]===n&&(y.left-=f/2),"bottom"===o.my[1]?y.top-=a:o.my[1]===n&&(y.top-=a/2),s.fractions||(y.left=Math.round(y.left),y.top=Math.round(y.top)),e={left:y.left-c,top:y.top-g},t.each(["left","top"],function(i,n){t.ui.position[p[i]]&&t.ui.position[p[i]][n](y,{targetWidth:l,targetHeight:r,elemWidth:f,elemHeight:a,collisionPosition:e,collisionWidth:d,collisionHeight:m,offset:u,my:o.my,at:o.at})}),t.fn.bgiframe&&i.bgiframe(),i.offset(t.extend(y,{using:o.using}))})},t.ui.position={fit:{left:function(o,e){var i=t(window),n=e.collisionPosition.left+e.collisionWidth-i.width()-i.scrollLeft();o.left=n>0?o.left-n:Math.max(o.left-e.collisionPosition.left,o.left)},top:function(o,e){var i=t(window),n=e.collisionPosition.top+e.collisionHeight-i.height()-i.scrollTop();o.top=n>0?o.top-n:Math.max(o.top-e.collisionPosition.top,o.top)}},flip:{left:function(o,e){if(e.at[0]!==n){var i=t(window),s=e.collisionPosition.left+e.collisionWidth-i.width()-i.scrollLeft(),f="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,l="left"===e.at[0]?e.targetWidth:-e.targetWidth,r=-2*e.offset[0];o.left+=e.collisionPosition.left<0?f+l+r:s>0?f+l+r:0}},top:function(o,e){if(e.at[1]!==n){var i=t(window),s=e.collisionPosition.top+e.collisionHeight-i.height()-i.scrollTop(),f="top"===e.my[1]?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,l="top"===e.at[1]?e.targetHeight:-e.targetHeight,r=-2*e.offset[1];o.top+=e.collisionPosition.top<0?f+l+r:s>0?f+l+r:0}}}},t.offset.setOffset||(t.offset.setOffset=function(o,e){/static/.test(t.curCSS(o,"position"))&&(o.style.position="relative");var i=t(o),n=i.offset(),s=parseInt(t.curCSS(o,"top",!0),10)||0,f=parseInt(t.curCSS(o,"left",!0),10)||0,l={top:e.top-n.top+s,left:e.left-n.left+f};"using"in e?e.using.call(o,l):i.css(l)},t.fn.offset=function(o){var e=this[0];return e&&e.ownerDocument?o?t.isFunction(o)?this.each(function(e){t(this).offset(o.call(this,e,t(this).offset()))}):this.each(function(){t.offset.setOffset(this,o)}):l.call(this):null}),t.curCSS||(t.curCSS=t.css),function(){var o,e,i,n,f,l=document.getElementsByTagName("body")[0],r=document.createElement("div");o=document.createElement(l?"div":"body"),i={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},l&&t.extend(i,{position:"absolute",left:"-1000px",top:"-1000px"});for(var h in i)o.style[h]=i[h];o.appendChild(r),e=l||document.documentElement,e.insertBefore(o,e.firstChild),r.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",n=t(r).offset(function(t,o){return o}).offset(),o.innerHTML="",e.removeChild(o),f=n.top+n.left+(l?2e3:0),s.fractions=f>21&&22>f}()}(jQuery);
/* <<< file end: js/lib/jquery-ui/jquery.ui.position.min.js */
//# map link was there [jquery.ui.position.min.js.map]
/* >>> file start: js/lib/jquery-ui/jquery.ui.autocomplete.min.js */
!function(e,t){var i=0;e.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var t,i=this,n=this.element[0].ownerDocument;this.isMultiLine=this.element.is("textarea"),this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(n){if(!i.options.disabled&&!i.element.propAttr("readOnly")){t=!1;var s=e.ui.keyCode;switch(n.keyCode){case s.PAGE_UP:i._move("previousPage",n);break;case s.PAGE_DOWN:i._move("nextPage",n);break;case s.UP:i._keyEvent("previous",n);break;case s.DOWN:i._keyEvent("next",n);break;case s.ENTER:case s.NUMPAD_ENTER:i.menu.active&&(t=!0,n.preventDefault());case s.TAB:if(!i.menu.active)return;i.menu.select(n);break;case s.ESCAPE:i.element.val(i.term),i.close(n);break;default:clearTimeout(i.searching),i.searching=setTimeout(function(){i.term!=i.element.val()&&(i.selectedItem=null,i.search(null,n))},i.options.delay)}}}).bind("keypress.autocomplete",function(e){t&&(t=!1,e.preventDefault())}).bind("focus.autocomplete",function(){i.options.disabled||(i.selectedItem=null,i.previous=i.element.val())}).bind("blur.autocomplete",function(e){i.options.disabled||(clearTimeout(i.searching),i.closing=setTimeout(function(){i.close(e),i._change(e)},150))}),this._initSource(),this.menu=e("").addClass("ui-autocomplete").appendTo(e(this.options.appendTo||"body",n)[0]).mousedown(function(t){var n=i.menu.element[0];e(t.target).closest(".ui-menu-item").length||setTimeout(function(){e(document).one("mousedown",function(t){t.target!==i.element[0]&&t.target!==n&&!e.ui.contains(n,t.target)&&i.close()})},1),setTimeout(function(){clearTimeout(i.closing)},13)}).menu({focus:function(e,t){var n=t.item.data("item.autocomplete");!1!==i._trigger("focus",e,{item:n})&&/^key/.test(e.originalEvent.type)&&i.element.val(n.value)},selected:function(e,t){var s=t.item.data("item.autocomplete"),o=i.previous;i.element[0]!==n.activeElement&&(i.element.focus(),i.previous=o,setTimeout(function(){i.previous=o,i.selectedItem=s},1)),!1!==i._trigger("select",e,{item:s})&&i.element.val(s.value),i.term=i.element.val(),i.close(e),i.selectedItem=s},blur:function(e,t){i.menu.element.is(":visible")&&i.element.val()!==i.term&&i.element.val(i.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"),e.fn.bgiframe&&this.menu.element.bgiframe(),i.beforeunloadHandler=function(){i.element.removeAttr("autocomplete")},e(window).bind("beforeunload",i.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"),this.menu.element.remove(),e(window).unbind("beforeunload",this.beforeunloadHandler),e.Widget.prototype.destroy.call(this)},_setOption:function(t,i){e.Widget.prototype._setOption.apply(this,arguments),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(e(i||"body",this.element[0].ownerDocument)[0]),"disabled"===t&&i&&this.xhr&&this.xhr.abort()},_initSource:function(){var t,i,n=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,n){n(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,s){n.xhr&&n.xhr.abort(),n.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e,t){s(e)},error:function(){s([])}})}):this.source=this.options.source},search:function(e,t){return e=null!=e?e:this.element.val(),this.term=this.element.val(),e.length").data("item.autocomplete",i).append(e("").text(i.label)).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.first()&&/^previous/.test(e)||this.menu.last()&&/^next/.test(e)?(this.element.val(this.term),void this.menu.deactivate()):void this.menu[e](t):void this.search(null,t)},widget:function(){return this.menu.element},_keyEvent:function(e,t){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(t,i){var n=new RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return n.test(e.label||e.value||e)})}})}(jQuery),function(e){e.widget("ui.menu",{_create:function(){var t=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(i){e(i.target).closest(".ui-menu-item a").length&&(i.preventDefault(),t.select(i))}),this.refresh()},refresh:function(){var t=this,i=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");i.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(i){t.activate(i,e(this).parent())}).mouseleave(function(){t.deactivate()})},activate:function(e,t){if(this.deactivate(),this.hasScroll()){var i=t.offset().top-this.element.offset().top,n=this.element.scrollTop(),s=this.element.height();0>i?this.element.scrollTop(n+i):i>=s&&this.element.scrollTop(n+i-s+t.height())}this.active=t.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end(),this._trigger("focus",e,{item:t})},deactivate:function(){this.active&&(this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null)},next:function(e){this.move("next",".ui-menu-item:first",e)},previous:function(e){this.move("prev",".ui-menu-item:last",e)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(e,t,i){if(!this.active)return void this.activate(i,this.element.children(t));var n=this.active[e+"All"](".ui-menu-item").eq(0);n.length?this.activate(i,n):this.activate(i,this.element.children(t))},nextPage:function(t){if(this.hasScroll()){if(!this.active||this.last())return void this.activate(t,this.element.children(".ui-menu-item:first"));var i=this.active.offset().top,n=this.element.height(),s=this.element.children(".ui-menu-item").filter(function(){var t=e(this).offset().top-i-n+e(this).height();return 10>t&&t>-10});s.length||(s=this.element.children(".ui-menu-item:last")),this.activate(t,s)}else this.activate(t,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(t){if(this.hasScroll()){if(!this.active||this.first())return void this.activate(t,this.element.children(".ui-menu-item:last"));var i=this.active.offset().top,n=this.element.height(),s=this.element.children(".ui-menu-item").filter(function(){var t=e(this).offset().top-i+n-e(this).height();return 10>t&&t>-10});s.length||(s=this.element.children(".ui-menu-item:first")),this.activate(t,s)}else this.activate(t,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()>> file start: js/core/angular/autocomplete.js */
//= require js/lib/jquery-ui/jquery.ui.position.min.js
//= require js/lib/jquery-ui/jquery.ui.autocomplete.min.js
angular.module("LJ.Autocomplete",[]).directive("ljAutocomplete",["$parse","$window",function(e,t){return{restrict:"A",link:function(o,l,n){function u(e,t){var o,u,c,r,a,d=e.term,v=LJ.DOM.getSelection(l).start,A=d.slice(0,v),j=d.slice(v);return j.length&&","!==j.charAt(0)?void t():(A=A.trim(),u=A.lastIndexOf(","),-1===u?(r=A,p=[]):(r=A.slice(u+1).trim(),p=A.slice(0,u).split(/\,\s*/)),j.length?(j=j.slice(1).trim(),m=j.split(/\,\s*/),""===m[m.length-1]&&m.pop()):m=[],o=p.concat(m),r.length>> file start: js/core/angular/ref.js */
!function(e){return e}(),function(){"use strict";angular.module("LJ.Ref",[]).factory("Ref",function(){function e(e,n){return f[e]?void console.error("Ref element with id `%s` has been registered before.",e):void(f[e]=n)}function n(e){f[e]&&delete f[e]}function o(e){var n=f[e];return n||console.error("Ref `%s` not found.",e),n}function r(e,n){"undefined"==typeof n&&(n={});var r=o(e),f=angular.element("html, body");if(!r)return void console.error("Could not scroll to the ref `%s` that has not been already defined.",e);var l=r.offset().top;n.onlyUp&&angular.element(window).scrollTop()<=l||n.onlyOutOfScreen&&!t(r)||(n.toParent&&(f=r.parent(),l=0),f.animate({scrollTop:l}))}function t(e){var n=angular.element(window),o=n.scrollTop(),r=o+n.height(),t=e.offset().top;return t>r-100||o>t}var f={};return{add:e,remove:n,get:o,scrollTo:r}}).directive("ljRef",["Ref",function(e){return{restrict:"A",scope:!0,link:function(n,o,r){var t=r.ljRef;e.add(t,o),n.$on("$destroy",function(){e.remove(t)})}}}])}();
/* <<< file end: js/core/angular/ref.js */
//# map link was there [ref.js.map]
/* >>> file start: js/core/angular/bubble.js */
//= require js/core/angular/ref.js
Site.page.template['Widgets/ljBubble.tmpl'] = '\n \n
\n';
Site.page.template['angular/confirm.bubble.ng.tmpl'] = '\n';
//= require_ml confirm.bubble.yes
//= require_ml confirm.bubble.no
!function(){"use strict";function e(e,o,t,n,r){return{scope:!0,link:function(i,l,a){function u(){var e=i.arrow.vertical,o=i.arrow.horizontal,t=W.aside,r=H.innerWidth<=650;i.visibility="hidden",W.keepInitialWidth&&!W.widthSaved&&(W.widthSaved=!0,L.width(L.width())),b(),p()&&!r&&(i.arrow.vertical="b"===e?f("alwaysTop")?"b":"t":f("alwaysBottom")?"t":"b",b(),h()&&!f("alwaysTop")&&(i.arrow.vertical="t",b())),w()&&!r&&(i.arrow.horizontal="l"===o?f("alwaysRight")||v()?"l":"r":f("alwaysLeft")||g()?"r":"l"),!r&&w()&&i.arrow.horizontal===o&&c()&&(W.aside=!0),r||i.arrow.horizontal===o&&i.arrow.vertical===e&&W.aside===t?i.visibility="visible":n(s)}function s(){return b(),w()&&c()?(W.aside=!0,i.$apply(),void s()):w()&&!f("aside")&&i.arrow.horizontal?(i.arrow.horizontal="",void s()):void(i.visibility="visible")}function c(){return!f("aside")&&f("tryAsideIfNoHorizSpace")}function f(e){return i.bubble.options[e]||W[e]}function b(){var o=e.node||l,t=o.offset().left+Math.floor(o.outerWidth()/2),n=i.bubble.options.forceX||0,r=i.bubble.options.forceY||0;if(f("aside"))i.position.x="r"===i.arrow.horizontal?o.offset().left-L.outerWidth()-x.outerWidth()+n:o.offset().left+o.outerWidth()+x.outerWidth()+n,i.position.y=o.offset().top-x.position().top+(o.outerHeight()-x.outerHeight())/2+r;else{if("center"===i.arrow.horizontal){var a=void 0;a=x.is(":visible")?x.position().left:L.outerWidth()/2,i.position.x=t-a+n}else i.position.x=i.arrow.horizontal?t-x.position().left-Math.floor(x.outerWidth()/2)-2+n:t-L.outerWidth()/2-Math.floor(x.outerWidth()/4)-2+n;i.position.y="t"===i.arrow.vertical?o.offset().top+o.outerHeight()+x.outerHeight()+r:o.offset().top-x.outerHeight()-L.outerHeight()+r}}function d(){i.position.x=-9999}function p(){return h()?!0:i.position.y+L.outerHeight()>H.scrollTop()+H.outerHeight()}function h(){return i.position.yH.scrollLeft()+H.outerWidth()}function m(o){o.preventDefault(),e.current!==W.name&&n(function(){e.open(W.name)})}function y(){$(),J&&(B=n(e.close,J))}function $(){n.cancel(B)}function z(){var o=W.name,t=e.current;o===t&&($(),e.close(),i.$apply())}function C(){i.show&&n(j)}var B,W=o(a.ljBubble)(i),S=W.name,L=t(r.get("ljBubble.tmpl"))(i),j=LJ.Function.throttle(u,50),x=L.find(".i-popup-arr"),H=angular.element(window),O=W.eventType||"click",J=Number(W.autoClose||0);i.show=!1,e._register(S,W),i.template=W.template||S+".html",i.bubble={name:S,close:e.close,options:e.options(S)},i.clear=function(){i.arrow={vertical:W.arrowInitialVertical||"t",horizontal:W.arrowInitialHorizontal||"l"}},i.position={x:-9999,y:-9999},i.visibility="hidden",i.arrowClass=function(){var e=i.bubble.options,o=i.arrow.vertical,t=void 0;return t="center"===i.arrow.horizontal?"":i.arrow.horizontal,e.aside||W.aside?"i-popup-arr"+t+o:"i-popup-arr"+o+t},i.getShouldShowArrow=function(){return angular.isDefined(i.bubble.options.showArrow)?i.bubble.options.showArrow:angular.isDefined(W.showArrow)?W.showArrow:!0},i.getShowCloseBtn=function(){return angular.isDefined(i.bubble.options.showCloseBtn)?i.bubble.options.showCloseBtn:angular.isDefined(W.showCloseBtn)?W.showCloseBtn:!0},i.$on("bubble:reposition:"+S,function(){n(j)}),i.$watch(function(){return e.current},function(e){d(),n(function(){i.show=e===S,e&&i.show&&(i.clear(),n(j))})},!0),W.disableClick||l.on(O,m),W.disableResizeListener||H.on("resize",C),W.recalculateOnOrientationChange&&H.on("orientationchange",function(){C(),H.on("resize",C),n(function(){H.off("resize",C)},1e3)}),W.recalculateOnScroll&&H.on("scroll",C),W.closeOnScroll&&H.on("scroll",z),angular.element("body").append(L),l.on("mouseleave",y),L.on("mouseenter",$),L.on("mouseleave",y),i.clear(),i.$on("$destroy",function(){l.off(O,m),H.off("resize",C),H.off("scroll",C),H.off("scroll",e.close),l.off("mouseleave",y),L.off("mouseenter",$),L.off("mouseleave",y),e._unregister(S),L.remove()})}}}function o(e,o,n,r,i,l){var a={},u={};return a.current=null,a.node=null,a.register=function(){function t(t,i){var a,u,s;return t&&t.name&&t.template?(a=t.name,t.disableClick=!0,r[a]?(r[a].count+=1,n.bind(null,a)):(u=angular.element("").attr("lj-bubble",angular.toJson(t)),s="undefined"==typeof i,s&&(i=e.$new(!0)),u.appendTo("body"),o(u)(i),r[a]={count:1,node:u,scope:i,isScopeCreated:s},n.bind(null,a))):void l.error("Incorrect bubble options. You should provide name and template.",t)}function n(e){var o=r[e];o&&(o.count-=1,0===o.count&&(o.isScopeCreated||o.scope.$destroy(),o.node.remove(),delete r[e]))}var r={};return t}(),a.exists=function(e){return u.hasOwnProperty(e)},a._register=function(e,o){var t;if(u.hasOwnProperty(e))throw"Warning: bubble with name "+e+" has been registered before!";t=angular.isDefined(o)?angular.copy(o):{},t=angular.extend({closeControl:!0},t),u[e]=Object.create(t)},a._unregister=function(e){delete u[e],a.current===e&&(a.current=null)},a.confirm=function(e){function o(){i.scrollBy(0,1),i.scrollBy(0,-1)}var t=LJ.ml("confirm.bubble.yes"),n=LJ.ml("confirm.bubble.no"),l={closeControl:!1,confirm:e.confirm,header:e.header,text:e.text,yes:e.yes||t,no:e.no||n};a.open(e.id,l),r(o),r(o,100),r(o,200),r(o,300)},a.open=function(o,r,i){return u.hasOwnProperty(o)?(r instanceof jQuery&&(i=r,r={}),angular.isString(r)&&(i=n.get(r),r={}),angular.isObject(r)&&a.options(o,r),i instanceof jQuery&&(a.node instanceof jQuery&&!a.node.is(i)&&e.$broadcast("bubble:reposition:"+o),a.node=i),angular.isString(i)&&(a.node=n.get(i)),a.current=o,e.$broadcast("bubble:open",o,r,i),e.$broadcast("bubble:open:"+o,o,r,i),void angular.element("body").addClass(t)):void l.error("Bubble `"+o+"` can't be opened, it has not been registered yet.")},a.close=function(){var o,n=a.current,r=u[n];e.$broadcast("bubble:close",n,r,a.node),e.$broadcast("bubble:close:"+n,n,r,a.node);for(o in r)r.hasOwnProperty(o)&&delete r[o];a.current=null,a.node=null,angular.element("body").removeClass(t)},a.options=function(e,o){return"undefined"==typeof o||o===u[e]?u[e]:void angular.copy(o,u[e])},a}angular.module("LJ.Bubble",["LJ.Templates","LJ.Directives","LJ.Ref"]),angular.module("LJ.Bubble").factory("Bubble",o).directive("ljBubble",e);var t="p-openpopup";e.$inject=["Bubble","$parse","$compile","$timeout","$templateCache"],o.$inject=["$rootScope","$compile","Ref","$timeout","$window","$log"]}();
/* <<< file end: js/core/angular/bubble.js */
//# map link was there [bubble.js.map]
/* >>> file start: js/core/angular/options.js */
var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};angular.module("LJ.Options",[]).factory("Options",[function(){return{create:function(t){function n(n,o){"undefined"==typeof o?angular.extend(t,n):t[n]=o}function o(n){return t[n]}function e(){return t}if("undefined"==typeof t&&(t={}),"object"!==("undefined"==typeof t?"undefined":_typeof(t)))throw new TypeError("Options should be an object.");return{set:n,get:o,raw:e}}}}]);
/* <<< file end: js/core/angular/options.js */
//# map link was there [options.js.map]
/* >>> file start: js/core/angular/users.js */
//= require js/core/angular/api.js
//= require js/core/angular/options.js
!function(e){return e}(),function(){"use strict";angular.module("Users",["LJ.Api","LJ.Options"]).factory("Relations",["$q","$timeout","UsersCache",function(e,n,r){function t(t,i,u){var a=e.defer(),s={addFriend:{is_invite_sent:!0},removeFriend:{is_friend:!1},subscribe:{is_subscribedon:!0},unsubscribe:{is_subscribedon:!1},join:{is_invite_sent:!0},leave:{is_member:!1},setBan:{is_banned:!0},setUnban:{is_banned:!1}},o={addFriend:{is_invite_sent:!1},removeFriend:{is_friend:!0},subscribe:{is_subscribedon:!1},unsubscribe:{is_subscribedon:!0},join:{is_invite_sent:!1},leave:{is_member:!0},setBan:{is_banned:!1},setUnban:{is_banned:!0}},c=angular.copy(r.get(t)||{});return angular.isUndefined(u)&&(u={}),u.wait||r.update(t,s[i]||{}),LJ.Event.trigger("relations.change",{username:t,action:i,callback:function(e){n(function(){if(e.error)return u.wait||r.update(t,angular.extend(o[i],c)),void a.reject(e.error.message);var n=LJ.Object.pick(e,"is_banned","is_friend","is_member","is_subscriber","is_subscribedon","is_friend_of","is_invite_sent");r.update(t,n),a.resolve(e)})}}),a.promise}function i(e,n,i){var u=t(e,n?"subscribe":"unsubscribe",i);return n||u.then(function(){r.update(e,{filtermask:0})}),u}function u(e,n,r){return t(e,n?"addFriend":"removeFriend",r)}function a(e,n,r){return t(e,n?"join":"leave",r)}function s(e,n,r){return t(e,n?"setBan":"setUnban",r)}function o(e,n,r){return t(e,n?"banEverywhere":"unbanEverywhere",r)}return{toggleFriend:u,toggleSubscription:i,toggleMember:a,toggleBan:s,toggleBanEverywhere:o}}]).factory("Mask",function(){function e(e){return e>>>0}var n={};return n.change=function(n,r){var t=r.add,i=r.remove;return angular.isDefined(t)&&(angular.isArray(t)||(t=[t]),n=t.reduce(function(n,r){return e(n|Math.pow(2,r))},n)),angular.isDefined(i)&&(angular.isArray(i)||(i=[i]),n=i.reduce(function(n,r){var t=Math.pow(2,32)-1-Math.pow(2,r);return e(n&t)},n)),n},n.check=function(e,n){var r=Math.pow(2,n);return Boolean(e&r)},n}).factory("UsersCache",["$q","$cacheFactory","Options",function(e,n,r){function t(e){if(!angular.isUndefined(e)){var n=l.get(f.get("journal"))||{},r=e;return angular.isArray(e)||(e=[e]),e.forEach(function(e){if(e&&angular.isObject(e)&&!angular.isUndefined(e.username)){var r=e.display_username||e.username,t=n[r];n[r]=t?angular.extend(t,e):e}}),l.put(f.get("journal"),n),r}}function i(e){var n=l.get(f.get("journal"));return Boolean(n[e])}function u(e){var n;if(angular.isString(e))return n=l.get(f.get("journal")),n&&n[e]?n[e]:null;if(angular.isFunction(e))return s(e);if(angular.isUndefined(e))return s();throw new TypeError("Incorrect argument passed.")}function a(e){var n=l.get(f.get("journal"));return n||angular.isObject(n)?Object.keys(n).reduce(function(r,t){return String(n[t].id)===String(e)?n[t]:r},null):null}function s(e){var n,r=l.get(f.get("journal")),t=[];for(n in r)if(r.hasOwnProperty(n)){if(e&&!e(r[n]))continue;t.push(r[n])}return t}function o(e,n){var r=u(e)||{username:e};return angular.extend(r,n),t(r),r}var c,l=n("users"),f=r.create({journal:LJ.get("remoteUser")});return c={add:t,update:o,set:f.set,get:u,getById:a,exists:i}}]).factory("Users",["$q","$timeout","Api","Mask","UsersCache","Options",function(e,n,r,t,i,u){function a(e){return k[C.get("type")][e]}function s(e){return"subscriptions"===C.get("type")?Boolean(e.is_subscribedon):!0}function o(e,n){return angular.isUndefined(n)?e[c()]||1:void(e[c()]=n)}function c(){return"subscriptions"===C.get("type")?"filtermask":"groupmask"}function l(e,n,t){return r.call("user.get",{target:e,fields:n},t).then(function(e){var n=e.user;return i.add(n),n})}function f(e,n,t){return r.call("user.get",{targetid:e,fields:n},t).then(function(e){var n=e.user;return i.add(n),n})}function d(e,n){return r.call("relations.list_friends",{journal:C.get("journal"),fields:e},n).then(_("is_friend"))}function g(e){return r.call("groups.list_users",{journal:C.get("journal"),fields:e}).then(function(e){return i.add(e.users),e})}function p(e){return r.call("relations.list_subscriptions",{journal:C.get("journal"),fields:e}).then(_("is_subscribedon"))}function b(e){return r.call("relations.list_banned",{journal:C.get("journal"),fields:e}).then(_("is_banned"))}function _(e){return function(n){var r=n.users;return r.forEach(LJ.Function.set(e,!0)),i.add(r),r}}function v(e){return r.call("relations."+e+"_count").then(function(e){return e.count})}function h(n){return angular.isArray(n)||(n=[n]),0===n.length?e.reject("You should provide users to sync."):r.call(a("update"),{users:n,journal:C.get("journal")}).then(function(e){return i.add(e.users),e})}function m(e,n){var r=i.get(e);return r?t.check(o(r),n):!1}function j(e){return e.filter(i.exists).map(i.get).filter(s)}function y(e){var n=(e.filter||"").toLowerCase(),r=i.get(function(r){return s(r)&&t.check(o(r),e.id)?!n||-1!==r.display_username.toLowerCase().indexOf(n):!1});return e.limit&&(r=r.slice(0,e.limit)),r}function U(e){var n=(e.filter||"").toLowerCase(),r=i.get(function(r){return s(r)?t.check(o(r),e.id)?!1:!n||-1!==r.display_username.toLowerCase().indexOf(n):!1});return e.limit&&(r=r.slice(0,e.limit)),r}function w(e,n){angular.isArray(n)||(n=[n]);var r;return r="subscriptions"===C.get("type")?j(n):n.map(function(e){return i.get(e)||{username:e}}),r.forEach(function(n){o(n,t.change(o(n),{add:e}))}),h(r)}function L(e,n,r){angular.isArray(n)||(n=[n]);var i=j(n);return i.forEach(function(n){o(n,t.change(o(n),{remove:e}))}),r&&r.silent?void 0:h(i)}function E(e,n){return i.update(e,{alias:n}),r.call("user.alias_set",{target:e,alias:n})}function F(e){return function(n,r){return n[e].toLowerCase().localeCompare(r[e].toLowerCase())}}function O(){var e,n=C.get("journal");C.set.apply(null,arguments),e=C.get("journal"),e!==n&&i.set("journal",e)}var k={friends:{read:"relations.list_friends",readOne:"relations.get_friend",update:"groups.update_users"},subscriptions:{read:"relations.list_subscriptions",readOne:"relations.get_subscription",update:"filters.update_users"}},C=u.create({type:"friends",journal:LJ.get("remoteUser")});return{USERHEAD_FIELDS:{alias:1,journal_url:1,profile_url:1,userhead_url:1,is_invisible:1,journaltype:1},set:O,get:C.get,Cache:i,fetchUser:l,fetchUserById:f,fetchBanned:b,fetchFriends:d,fetchGroupUsers:g,fetchSubscriptions:p,fetchCount:v,sync:h,alias:E,isUserInGroup:m,getExisting:j,fromGroup:y,outOfGroup:U,addToGroup:w,removeFromGroup:L,comparator:F}}])}();
/* <<< file end: js/core/angular/users.js */
//# map link was there [users.js.map]
/* >>> file start: js/lib/textinputs_jquery.js */
var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(e){function t(e,t){var n=_typeof(e[t]);return"function"===n||!("object"!=n||!e[t])||"unknown"==n}function n(e,t){return _typeof(e[t])!=g}function o(e,t){return!("object"!=_typeof(e[t])||!e[t])}function r(e){window.console&&window.console.log&&window.console.log("RangyInputs not supported in your browser. Reason: "+e)}function a(e,t,n){return 0>t&&(t+=e.value.length),("undefined"==typeof n?"undefined":_typeof(n))==g&&(n=t),0>n&&(n+=e.value.length),{start:t,end:n}}function c(e,t,n){return{start:t,end:n,length:n-t,text:e.value.slice(t,n)}}function l(){return o(document,"body")?document.body:document.getElementsByTagName("body")[0]}var i,s,u,d,f,p,v,y,m,g="undefined";e(document).ready(function(){function h(e,t){return function(){var n=this.jquery?this[0]:this,o=n.nodeName.toLowerCase();if(1==n.nodeType&&("textarea"==o||"input"==o&&"text"==n.type)){var r=[n].concat(Array.prototype.slice.call(arguments)),a=e.apply(this,r);if(!t)return a}return t?this:void 0}}var x=document.createElement("textarea");if(l().appendChild(x),n(x,"selectionStart")&&n(x,"selectionEnd"))i=function T(e){var t=e.selectionStart,T=e.selectionEnd;return c(e,t,T)},s=function b(e,t,n){var b=a(e,t,n);e.selectionStart=b.start,e.selectionEnd=b.end},m=function(e,t){t?e.selectionEnd=e.selectionStart:e.selectionStart=e.selectionEnd};else{if(!(t(x,"createTextRange")&&o(document,"selection")&&t(document.selection,"createRange")))return l().removeChild(x),void r("No means of finding text input caret position");i=function w(e){var t,n,o,r,a=0,w=0,l=document.selection.createRange();return l&&l.parentElement()==e&&(o=e.value.length,t=e.value.replace(/\r\n/g,"\n"),n=e.createTextRange(),n.moveToBookmark(l.getBookmark()),r=e.createTextRange(),r.collapse(!1),n.compareEndPoints("StartToEnd",r)>-1?a=w=o:(a=-n.moveStart("character",-o),a+=t.slice(0,a).split("\n").length-1,n.compareEndPoints("EndToEnd",r)>-1?w=o:(w=-n.moveEnd("character",-o),w+=t.slice(0,w).split("\n").length-1))),c(e,a,w)};var S=function(e,t){return t-(e.value.slice(0,t).split("\r\n").length-1)};s=function R(e,t,n){var R=a(e,t,n),o=e.createTextRange(),r=S(e,R.start);o.collapse(!0),R.start==R.end?o.move("character",r):(o.moveEnd("character",S(e,R.end)),o.moveStart("character",r)),o.select()},m=function(e,t){var n=document.selection.createRange();n.collapse(t),n.select()}}l().removeChild(x),d=function k(e,t,n,o){var k;t!=n&&(k=e.value,e.value=k.slice(0,t)+k.slice(n)),o&&s(e,t,t)},u=function(e){var t=i(e);d(e,t.start,t.end,!0)},y=function(e){var t,n=i(e);return n.start!=n.end&&(t=e.value,e.value=t.slice(0,n.start)+t.slice(n.end)),s(e,n.start,n.start),n.text};var E=function(e,t,n,o){var r=t+n.length;switch(o="string"==typeof o?o.toLowerCase():""){case"collapsetostart":s(e,t,t);break;case"collapsetoend":s(e,r,r);break;case"select":s(e,t,r)}};f=function(e,t,n,o){var r=e.value;e.value=r.slice(0,n)+t+r.slice(n),"boolean"==typeof o&&(o=o?"collapseToEnd":""),E(e,n,t,o)},p=function(e,t,n){var o=i(e),r=e.value;e.value=r.slice(0,o.start)+t+r.slice(o.end),E(e,o.start,t,n||"collapseToEnd")},v=function _(e,t,n,o){("undefined"==typeof n?"undefined":_typeof(n))==g&&(n=t);var r=i(e),a=e.value;e.value=a.slice(0,r.start)+t+r.text+n+a.slice(r.end);var _=r.start+t.length;E(e,_,r.text,o||"select")},e.fn.extend({getSelection:h(i,!1),setSelection:h(s,!0),collapseSelection:h(m,!0),deleteSelectedText:h(u,!0),deleteText:h(d,!0),extractSelectedText:h(y,!1),insertText:h(f,!0),replaceSelectedText:h(p,!0),surroundSelectedText:h(v,!0)})})}(jQuery);
/* <<< file end: js/lib/textinputs_jquery.js */
//# map link was there [textinputs_jquery.js.map]
/* >>> file start: js/core/angular/ljTour.js */
//= require js/core/angular/bubble.js
//= require js/core/angular/api.js
//= require js/core/angular/ref.js
Site.page.template['angular/bubbletour.ng.tmpl'] = '\n';
LJ.injectStyle('/* >>> file start: stc/tour/ljtour.css */\n.b-bubble-tour{z-index:5001}.b-bubble-tour .b-popup-inner{padding:0}.b-helptour{width:350px}.b-helptour-header{margin:0 0 .3em;padding:10px 16px 0}.b-helptour-footer:after,.b-helptour-header:after{display:table;width:100%;clear:both;content:\"\"}.b-helptour-stage-title{margin-right:10px}.b-helptour P:first-child{margin:0 0 .3em}.b-helptour-content{margin:10px 0 .6em;padding:0 16px}.b-helptour-content P{margin:.3em 0}.b-helptour-content LI,.b-helptour-content UL{margin:0;padding:0;list-style:none}.b-helptour-footer{padding:6px 15px;border-radius:0 0 5px 5px;background-color:#DAE3E6}.b-helptour-controls{margin:0;padding:0}.b-helptour-state{float:left}.b-helptour-step{float:right}.b-helptour-control{display:inline;margin-right:4px;cursor:pointer}.b-helptour-control-done:after{display:inline-block;content:\"\";width:14px;height:12px;background-image:url(/img/icons/unit_v3.png?v=42878);background-repeat:no-repeat;background-position:0 -223px}.b-helptour-control-done A{padding-left:8px}.b-helptour-control-done A:link,.b-helptour-control-done A:visited,.b-helptour-control-next A:link,.b-helptour-control-prev A:link{color:#00A3D9}.b-helptour-control-skip A:link,.b-helptour-control-skip A:visited{color:#7A9199}.b-helptour-control A{font-size:13px}.b-helptour-control A:active,.b-helptour-control A:focus,.b-helptour-control A:hover{color:#0086b3}.p-ljtour .b-lenta .l-flatslide-container{position:static}.p-ljtour .l-flatslide-menu-controls{position:absolute;top:auto!important}.p-ljtour.p-openpopup .w-cs{overflow:visible}@media all and (max-width:650px){.p-ljtour.p-openpopup .b-fader{display:none!important}.b-bubble-tour{display:none}}\n/* <<< file end: stc/tour/ljtour.css */\n\n/*# sourceMappingURL=ljtour.css.map */\n');
//= require_ml tour.steps.prev
//= require_ml tour.steps.next
//= require_ml tour.steps.skip
//= require_ml tour.steps.done
!function(e){return e}(),function(e){"use strict";angular.module("LJ.Tour",["LJ.Bubble","LJ.Templates","LJ.Directives","LJ.Api"]).factory("Tour",["Api",function(e){var t={};return t.queue={},t.checkAvailable=function(){var n=Object.keys(t.queue);return e.call("tour.is_available",{tours:n}).then(function(e){n.forEach(function(n){0===e.states[n]&&delete t.queue[n]})})},t.setDone=function(t){return e.call("tour.set_done",{tour:t})},t}]).directive("ljTour",["$timeout","$document","Bubble","Ref","Tour",function(t,n,r,u,o){return{scope:!0,link:function(i){function c(){e("body").find("[data-tour]").each(function(){var t=e(this),n=angular.extend({element:t},t.data());Array.isArray(L[n.tour])||(L[n.tour]=[]),n.tourStepDiscardDuplicates&&L[n.tour].some(function(e){return e.tourStep===n.tourStep})||L[n.tour].push(n)})}function a(){var e=Object.keys(L)[0],t=L[e];i.current=t.filter(function(e){return b(e)&&v(e)}).sort(function(e,t){return e.tourStep>t.tourStep?1:e.tourStep0&&(i.step=i.current[--e],i.index=++e,h())}function b(e){return e.hasOwnProperty("tourOwner")?LJ.get("remote.username")===LJ.get("journal.username"):!0}function v(e){return e.hasOwnProperty("tourSkipIf")?e.tourSkipIf.split(",").every(function(e){return e=e.trim(),"!"===e.charAt(0)?LJ.get(e.slice(1)):!LJ.get(e)}):!0}function m(e){return e.is(":visible")&&0!==e.css("opacity")&&"hidden"!==e.css("visibility")}function g(e){return e?e.hasOwnProperty("tourStartPage")?new RegExp(e.tourStartPage,"i").test(location.pathname):1===e.tourStep:!1}function y(){angular.element(window).trigger("resize"),S()}function h(){if(i.step){if(!i.step.element.is(":visible"))return p();r.current&&r.close(),t(function(){var e=r.options("tour")||{};r.open("tour",angular.extend(e,i.step.tourBubble),i.step.element),S()}),LJ.Event.once("visual_editor_ready",function(){t(y)})}}function S(){u.scrollTo(i.step.tour+i.step.tourStep,{onlyOutOfScreen:!0})}function k(e){if(i.current&&i.current.length){switch(e.which){case 27:s();break;case 37:d();break;case 39:p()}i.$apply()}}var J,L=o.queue,O=angular.element(document.querySelector(".b-fader")),w=!1;J=r.register({name:"tour",template:"bubbletour.ng.tmpl",closeControl:!1},i),!LJ.Flags.isEnabled("friendsfeed_tour")||LJ.Support.isMobile()||w||(w=!0,t(function(){c(),o.checkAvailable().then(l)})),i.next=p,i.prev=d,i.end=s,n.on("keydown",k),i.$on("$destroy",function(){n.off("keydown",k),J()})}}}])}(jQuery);
/* <<< file end: js/core/angular/ljTour.js */
//# map link was there [ljTour.js.map]
/* >>> file start: js/editor/editor.js */
//= require js/lib/textinputs_jquery.js
//= require js/core/angular/ljTour.js
!function(e){"use strict";angular.module("Editor",["LJ.Tour"]).factory("Editor",function(){var t={};return t.getSelectedText=function(){var t=e("#body");return t.getSelection().text},t.htmlMode=function(){return e("#body").is(":visible")},t.insertContent=function(r,n,o,i){var l,u=e("#body");if(LJ.Event.trigger("contentInsert"),t.htmlMode()){var c=n.split("{caret}");return u.surroundSelectedText(c[0],c.length>1?c[c.length-1]||"":"").trigger("input"),l=u.getSelection(),3===c.length&&0===l.length&&u.replaceSelectedText(c[1],"collapseToEnd").setSelection(l.start+c[1].length+c[c.length-1].length),LJ.Event.trigger(r+"_htmlMode_response",n,o,i),void u.focus()}return LJ.Editor.RTEReadyPromise.then(function(){if("color"===r)return LJ.Event.trigger("selectedColor",o);if("video"===r&&"string"==typeof n){var e=void 0;return e=Array.isArray(i)&&i.length>1?n.split("\n"):[n],LJ.Event.trigger("video_response",e,i)}LJ.Event.trigger(r+"_response",o||n,i)})},t}).controller("EditorCtrl",["$scope","Editor","Bubble","$timeout",function(e,t,r,n){var o={bold:"{caret}",italic:"{caret}",underline:"{caret}",strikethrough:"{caret}"};e.formattingAction=function(e,r){e.preventDefault(),o[r]&&t.insertContent(r,o[r])},e.userClick=function(e,o){var i=t.getSelectedText(),l=/^[A-Za-z0-9_\-]+$/;e.preventDefault(),l.test(i)?t.insertContent(o,''):n(function(){r.open("user")})}}])}(jQuery);
/* <<< file end: js/editor/editor.js */
//# map link was there [editor.js.map]
/* >>> file start: js/editor/media.js */
var _extends=Object.assign||function(e){for(var t=1;t'):new RegExp("^"+r)}var n=LJ.get("siteroot").split(/https?:\/\/www\./)[1].replace(/\./g,"\\.");LJ.Media.Provider=t;t.prototype.parse=function(e,t){var r,i=this,a=this,n=this.params(e,t);if(!n)return null;var o=void 0;return o=n.then?new Promise(function(e,t){n.then(e),n.fail?n.fail(t):n["catch"]&&n["catch"](t)}):Promise.resolve(n),o.then(function(e){var n="";"function"==typeof a.link?n=a.link(e):"string"==typeof a.link&&(n=a.link.supplant(e)),r=[];var o=_extends({},e,{link:n});return r.push("string"==typeof i.embed?i.toPromise(i.embed.supplant(o)):i.embed(o)),t.thumbnail&&i.thumbnail&&r.push("string"==typeof i.thumbnail?i.toPromise(i.thumbnail.supplant(e)):i.thumbnail(e)),Promise.all(r).then(function(t){var r=t[0],i=t[1];return{provider:a.provider,site:a.provider,embed:r,thumb:i,customTag:!!e.custom,id:e.id,link:n}})})["catch"](function(){return null})},t.prototype.cache=function(e,t){return"undefined"==typeof t?this._cache[e]:void(this._cache[e]=t)},t.prototype.toPromise=function(t){var r=e.Deferred();return r.resolve(t),r.promise()};var o=t.prototype.toPromise,s={ljVideo:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r=/.*livejournal\.com\/.*\?[\w=&]*record_id=(\d+).*$/,i=("string"==typeof e?e:t.url).match(r);return i}};LJ.Media.embedMatchers=s;var u=function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=["ljVideo","coub","youtube","vimeo","vine","rutube"];return t.indexOf(e.site)>-1};LJ.Media.isVideoEmbedData=u;var d={coub:new t("coub",{link:"//coub.com/embed/{id}?muted=false&autostart=false&originalSize=false",embed:' ',thumbnail:function(e){var t=this.cache(e.id);return t?this.toPromise(t):this.toPromise(null)},params:function(e){var t=/\/\/[w\.]*coub\.com\/embed\/(\w+)/,r=e.match(t);return r&&{id:r[1]}}}),youtube:new t("youtube",{link:"https://youtube.com/watch?v={id}",thumbnail:"https://img.youtube.com/vi/{id}/0.jpg",embed:'',params:function(e){var t=/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\??v?=?))([^#\&\?]*).*/,r=e.match(t);return r&&-1===r[0].indexOf("youtu")?null:r&&{id:r[7]}}}),vimeo:new t("vimeo",{link:"https://vimeo.com/{id}",embed:'',params:function(e){var t=/^(https?:\/\/)?(www\.)?(player\.)?vimeo.com\/(video\/|channels\/\w+\/)?(\d+)*/,r=e.match(t);return r&&{id:r[5]}},thumbnail:function(t){var r=this,i=this.cache(t.id);return i?this.toPromise(i):e.ajax({url:"../https@vimeo.com/api/v2/video/"+t.id+".json",dataType:"jsonp"}).then(function(e){if(e&&e[0]){var i=e[0].thumbnail_large;if(i)return r.cache(t.id,i),i}else console.error("Data error",e)})}}),vine:new t("vine",{link:"https://vine.co/v/{id}",embed:'',params:function(e){var t=/vine.co\/v\/([^\/]*)/,r=e.match(t);return r&&{id:r[1]}}}),gist:new t("gist",{link:"https://gist.github.com/{id}",embed:'',params:function(e){var t=/.*(?:gist\.github\.com\/)([^\/]+\/{1}[^\/]+)\/{0,1}$/,r=e.match(t);return r&&{id:r[1]}}}),rutube:new t("rutube",{link:"https://rutube.ru/video/{id}/",embed:'',params:function(e){var t=/^.*rutube.ru\/video(\/embed\/|\/private\/|\/)(\w{32}).*/,r=e.match(t);return r&&{id:r[2]}},thumbnail:function(t){var r=this,i=this.cache(t.id);return i?this.toPromise(i):e.ajax({url:"../https@rutube.ru/api/video/"+t.id+"/?format=jsonp",dataType:"jsonp"}).done(function(e){if(e&&e.thumbnail_url){var i=e.thumbnail_url;if(i)return r.cache(t.id,i),i}else console.error("Data error",e)})}}),ramblerKassa:new t("ramblerKassa",{link:"https://kassa.rambler.ru/movie/{id}",embed:'',params:function(e){var t=/kassa\.rambler\.ru\/movie\/(\d+)$/,r=e.match(t);return r&&{id:r[1]}}}),ljEmbed:new t("ljEmbed",{link:"{link}",embed:function(e){return e.embedCode?e.embedCode:''},params:function(e){var t=a(!0),r=e.match(t),i=LJ.Util.parseStringForLJPostLinks(e),n="";try{n=i[0].link}catch(o){}if(!n)return null;var s=n.replace(/#.*$/,"").replace(/\?.*$/,"");if(r)return{embedCode:r[0],link:s};var u=/^\s*$/.test(e.replace(n,""));return u?{link:s}:null}}),playbuzz:new t("playbuzz",{link:"../https@www.playbuzz.com/default.htm",embed:"{embed}",params:function(e){var t=void 0,r=void 0;try{var i=(new DOMParser).parseFromString(e,"text/html");r=i.querySelector(".playbuzz"),t=r.attributes["data-id"].value,r.innerHTML="[Playbuzz Embed]"}catch(a){}return t?{id:t,embed:r.outerHTML}:null}})},c={facebook:{config:{link:function(e){return e.link},params:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r=/(^.*facebook.com\/.*)/,i=e.match(r);if(!i)return null;var a={link:i[1]};t.embedCode&&(a.embedCode=t.embedCode);var n=e.match(/post.php\?href=([^&]*)/);return n&&n[1]&&(a.postLink=decodeURIComponent(n[1])),a},embed:function(t){var r=this,i=/(^.*facebook.com\/)(\d*)(\/.*)/,a=t.link.match(i),n=t.link.match(/video\.php/),s=e.Deferred(),u=a&&a[2],d=this.cache(t.link),c=void 0,l=t.embedCode&&t.link.match(/comment_embed.php/),m=function(e){var t=e.link,r=e.postLink;if(l)return e.embedCode;if(n)return"';var i=r||t;return'"};return d?(o||this.toPromise)(d):(u?LJ.Social.load("facebook").then(function(){FB.api(u,function(e){t.link.replace(i,"$1"+e.username+"$3");c=m(t),r.cache(t.link,c),s.resolve(c)})}):(c=m(t),this.cache(t.link,c),s.resolve(c)),s.promise())}}},twitter:{config:{link:function(e){return"../https@twitter.com/"+e.username+"/status/"+e.id},params:function(e){var t=/^.*twitter.com\/(\w*)\/status\/(\w*).*/,r=e.match(t);return r&&{id:r[2],username:r[1]}},embed:function(t){var r=this,i=this.cache(t.id);return i?(o||this.toPromise)(i):e.ajax({url:"../https@api.twitter.com/1/statuses/oembed.json@id="+t.id,dataType:"jsonp"}).then(function(e){var i=e.html.replace(/