1"use strict";(self.webpackChunknodebb=self.webpackChunknodebb||[]).push([[30792,53375,16922,82586,21352],{25142:(M,D,p)=>{var E,h;E=[p(85233),p(7927)],h=function(S,A){const u={};let y,T=0,e=!1,f,x=0;u.init=function(s,c){const a=$("body");typeof s=="function"?(y=s,f=a):(y=c,f=s||a),T=$(window).scrollTop(),$(window).off("scroll",m).on("scroll",m),a.height()<=$(window).height()&&y(1)};function m(){x&&clearTimeout(x),x=setTimeout(function(){x=0,i()},60)}function i(){const s=utils.findBootstrapEnvironment(),c=(s==="xs"||s==="sm")&&$("html").hasClass("composing");if(e||c||app.flags._glance)return;const a=$(window).scrollTop(),g=$(window).height(),r=f.height()-g,v=f.offset()?f.offset().top:0,R=100*(a-v)/(r<=0?g:r),F=15,b=85,B=a>T?1:-1;(R<F&&a<T||R>b&&a>T||R<0&&B>0&&r<0)&&y(B),T=a}return u.loadMore=function(s,c,a){if(e)return;e=!0;const g={method:s,data:c};S.fire("action:infinitescroll.loadmore",g),socket.emit(g.method,g.data,function(r,v){if(r)return e=!1,A.error(r);a(v,function(){e=!1})})},u.loadMoreXhr=function(s,c){if(e)return;e=!0;const a=config.relative_path+"/api"+location.pathname.replace(new RegExp("^"+config.relative_path),""),g={url:a,data:s};S.fire("action:infinitescroll.loadmore.xhr",g),$.get(a,s,function(r){c(r,function(){e=!1})}).fail(function(r){e=!1,A.error(String(r.responseJSON||"[[error:no-connection]]"))})},u.removeExtra=function(s,c,a){let g=$();if(s.length<=a)return g;const r=s.length-a;if(c>0){const v=$(document).height(),R=$(window).scrollTop();g=s.slice(0,r).remove(),$(window).scrollTop(R+($(document).height()-v))}else g=s.slice(s.length-r).remove();return g},u}.apply(D,E),h!==void 0&&(M.exports=h)},47720:(M,D)=>{var p,E;p=[],E=function(){const h={},S=/-resized(\.[\w]+)?$/;return h.wrapImagesInLinks=function(A){A.find('[component="post/content"] img:not(.emoji)').each(function(){h.wrapImageInLink($(this))})},h.wrapImageInLink=function(A){let u=A.attr("src")||"";if(u!=="about:blank"&&!A.parent().is("a")){utils.isRelativeUrl(u)&&S.test(u)&&(u=u.replace(S,"$1"));const y=A.attr("alt")||"",T=u.split(".").slice(1).pop(),e=y.split("/").pop(),f=e.split(".").slice(1).pop();A.wrap('<a href="'+u+'" '+(!T&&f?' download="'+utils.escapeHTML(e)+'" ':"")+' target="_blank" rel="noopener">')}},h}.apply(D,p),E!==void 0&&(M.exports=E)},60447:(M,D,p)=>{var E,h;E=[p(78989),p(25142),p(54939),p(47720),p(42840),p(7237),p(32230),p(85233),p(59265)],h=function(S,A,u,y,T,e,f,x,m){const i={};i.signaturesShown={};const s=$(window);i.onNewPost=function(t){!t||!t.posts||!t.posts.length||parseInt(t.posts[0].tid,10)!==parseInt(ajaxify.data.tid,10)||(t.loggedIn=!!app.user.uid,t.privileges=ajaxify.data.privileges,t.posts[0].timestamp=t.posts[0].topic.scheduled?t.posts[0].timestamp:Date.now()-1e3,t.posts[0].timestampISO=utils.toISOString(t.posts[0].timestamp),i.modifyPostsByPrivileges(t.posts),a(t.posts),c(t.posts[0]),g(t.posts),ajaxify.data.postcount+=1,u.updatePostCount(ajaxify.data.postcount),config.usePagination?r(t):R(t),p.e(21352).then(function(){var o=[p(21352)];(function(n){n.onNewPost(t)}).apply(null,o)}).catch(p.oe))};function c(t){$(".pagination-block .pagebottom .timeago").timeago("update",t.timestampISO)}i.modifyPostsByPrivileges=function(t){t.forEach(function(o){o.selfPost=!!app.user.uid&&parseInt(o.uid,10)===parseInt(app.user.uid,10),o.topicOwnerPost=parseInt(o.uid,10)===parseInt(ajaxify.data.uid,10),o.display_edit_tools=ajaxify.data.privileges["posts:edit"]&&o.selfPost||ajaxify.data.privileges.isAdminOrMod,o.display_delete_tools=ajaxify.data.privileges["posts:delete"]&&o.selfPost||ajaxify.data.privileges.isAdminOrMod,o.display_moderator_tools=o.display_edit_tools||o.display_delete_tools,o.display_move_tools=ajaxify.data.privileges.isAdminOrMod,o.display_post_menu=ajaxify.data.privileges.isAdminOrMod||o.selfPost&&!ajaxify.data.locked&&!o.deleted||o.selfPost&&o.deleted&&parseInt(o.deleterUid,10)===parseInt(app.user.uid,10)||(app.user.uid||ajaxify.data.postSharing.length)&&!o.deleted})};function a(t){for(let o=0;o<t.length;o+=1){const n=e.get("user/postcount",t[o].uid);n.html(m.formattedNumber(parseInt(n.attr("data-postcount"),10)+1))}}function g(t){config.topicPostSort==="newest_to_oldest"&&(t[0].index=1,e.get("post").not("[data-index=0]").each(function(){const o=parseInt($(this).attr("data-index"),10)+1;$(this).attr("data-index",o)}))}function r(t){function o(){F(t.posts[0])}const n=t.posts;ajaxify.data.pagination.pageCount=Math.max(1,Math.ceil(n[0].topic.postcount/config.postsPerPage));const l=config.topicPostSort==="oldest_to_newest"||config.topicPostSort==="most_votes"?1:-1;if(ajaxify.data.pagination.currentPage===ajaxify.data.pagination.pageCount&&l===1||ajaxify.data.pagination.currentPage===1&&l===-1){const I=$('[component="post"]:not([data-index=0]), [component="topic/event"]');b(t,I,l,!1,o)}else ajaxify.data.scrollToMyPost&&parseInt(n[0].uid,10)===parseInt(app.user.uid,10)?setTimeout(function(){S.loadPage(ajaxify.data.pagination.pageCount,o)},250):v()}function v(){$.get(config.relative_path+"/api/topic/pagination/"+ajaxify.data.tid,{page:ajaxify.data.pagination.currentPage},function(t){app.parseAndTranslate("partials/paginator",t,function(o){$('[component="pagination"]').after(o).remove()})})}function R(t){const o=config.topicPostSort==="oldest_to_newest"||config.topicPostSort==="most_votes"?1:-1,n=$('[component="post"][data-index="'+(t.posts[0].index-1)+'"]').length;if(!n&&(!t.posts[0].selfPost||!ajaxify.data.scrollToMyPost))return;if(!n&&t.posts[0].selfPost)return ajaxify.go("post/"+t.posts[0].pid);const l=$('[component="topic"]>[component="post"]:not([data-index=0]), [component="topic"]>[component="topic/event"]');b(t,l,o,!1,function(d){d&&d.addClass("new"),F(t.posts[0])})}function F(t){t.selfPost&&ajaxify.data.scrollToMyPost&&T.scrollBottom(t.index)}function b(t,o,n,l,d){if(d=d||function(){},!t||t.posts&&!t.posts.length)return d();function I(){const w=$('[component="post"].new');if(w.length===t.posts.length){let N=!0;if(w.each(function(_,C){parseInt($(C).attr("data-pid"),10)!==parseInt(t.posts[_].pid,10)&&(N=!1)}),N){w.each(function(){$(this).removeClass("new")}),t.posts.length=0;return}}w.length&&t.posts.length>
11&&t.posts.forEach(function(N){const _=e.get("post","pid",N.pid);_.hasClass("new")&&_.remove()}),t.posts=t.posts.filter(function(N){return N.allowDupe||$('[component="post"][data-pid="'+N.pid+'"]').length===0})}if(I(),!t.posts.length)return d();let P,j;n>0&&o.length?P=o.last():n<0&&o.length&&(j=o.first()),x.fire("action:posts.loading",{posts:t.posts,after:P,before:j}),app.parseAndTranslate("topic","posts",Object.assign({},ajaxify.data,t),async function(w){w=w.filter(function(){const _=$(this),C=_.attr("data-pid"),K=_.attr("data-allow-dupe");return!_.is('[component="post"]')||K||C&&$('[component="post"][data-pid="'+C+'"]').length===0});const N=A.removeExtra($('[component="post"]'),n,Math.max(20,config.postsPerPage*2));if(P)w.insertAfter(P);else if(j){const _=$(document).height(),C=s.scrollTop();w.insertBefore(j),(l||C>0)&&s.scrollTop(C+($(document).height()-_))}else e.get("topic").append(w);await i.onNewPostsAddedToDom(w),L(N),x.fire("action:posts.loaded",{posts:t.posts}),d(w)})}i.loadMorePosts=function(t){if(!e.get("topic").length||T.scrollActive)return;const o=e.get("topic").find(e.get("post").not("[data-index=0]").not(".new")),n=t>0?o.last():o.first(),l=parseInt(n.attr("data-index"),10)||0,d=ajaxify.data.tid;if(!utils.isNumber(d)||!utils.isNumber(l)||t<0&&e.get("post","index",0).length)return;const I=$(".loading-indicator");I.is(":animated")||I.fadeIn(),A.loadMore("topics.loadMore",{tid:d,after:l+(t>0?1:0),count:config.postsPerPage,direction:t,topicPostSort:utils.params().sort||config.topicPostSort},function(P,j){if(I.fadeOut(),P&&P.posts&&P.posts.length){const w=$('[component="post"]:not([data-index=0]):not(.new), [component="topic/event"]');b(P,w,t,!0,j)}else T.update(),j()})},i.onTopicPageLoad=async function(t){W(t),y.wrapImagesInLinks(t),O(t),i.showBottomPostBar(),t.find('[component="post/content"] img:not(.not-responsive)').addClass("img-fluid"),i.addBlockquoteEllipses(t),U(t),await B()},i.addTopicEvents=async function(t){if(config.topicPostSort==="most_votes")return;const o=await Promise.all(t.map(n=>app.parseAndTranslate("partials/topic/event",{...n,privileges:ajaxify.data.privileges})));if(config.topicPostSort==="oldest_to_newest")$('[component="topic"]').append(o);else if(config.topicPostSort==="newest_to_oldest"){const n=$('[component="topic"] [component="post"][data-index="0"]');n.length?n.after(o.reverse()):$('[component="topic"]').prepend(o.reverse())}$('[component="topic/event"] .timeago').timeago()};async function B(){const t=ajaxify.data.necroThreshold*24*60*60*1e3;if(!t||config.topicPostSort!=="newest_to_oldest"&&config.topicPostSort!=="oldest_to_newest")return;const o=s.scrollTop(),n=$('[component="post"]').toArray();await Promise.all(n.map(async function(l){l=$(l);const d=l.prev('[component="post"]');if(l.is(":has(.necro-post)")||!d.length||config.topicPostSort==="newest_to_oldest"&&parseInt(d.attr("data-index"),10)===0)return;const I=l.attr("data-timestamp")-d.attr("data-timestamp");if(Math.abs(I)>=t){const P=$.timeago.settings.strings.suffixAgo,j=$.timeago.settings.strings.prefixAgo,w=$.timeago.settings.strings.suffixFromNow,N=$.timeago.settings.strings.prefixFromNow;$.timeago.settings.strings.suffixAgo="",$.timeago.settings.strings.prefixAgo="",$.timeago.settings.strings.suffixFromNow="",$.timeago.settings.strings.prefixFromNow="";const _=(I>0?"[[topic:timeago_later,":"[[topic:timeago_earlier,")+$.timeago.inWords(I)+"]]";$.timeago.settings.strings.suffixAgo=P,$.timeago.settings.strings.prefixAgo=j,$.timeago.settings.strings.suffixFromNow=w,$.timeago.settings.strings.prefixFromNow=N;const C=await app.parseAndTranslate("partials/topic/necro-post",{text:_});C.attr("data-necro-post-index",d.attr("data-index")),C.insertBefore(l)}})),o>0&&s.scrollTop()<o&&s.scrollTop(o)}function O(t){ajaxify.data["signatures:hideDuplicates"]&&t.each((o,n)=>{const l=$(n).find('[component="post/signature"]'),d=l.attr("data-uid");i.signaturesShown[d]?l.addClass("hidden"):i.signaturesShown[d]=!0})}function L(t){t.each((o,n)=>{$(`[data-necro-post-index="${$(n).attr("data-index")}"]`).remove()})}function W(t){if(app.user.uid||!ajaxify.data.privateUploads)return;const o=document.createElement("a");o.className="login-required",o.href=config.relative_path+"/login",f.translate("[[topic:login-to-view]]",function(n){o.appendChild(document.createTextNode(n)),t.each(function(l,d){$(d).find('[component="post/content"] img').each(function(I,P){P=$(P),P.attr("src").startsWith(config.relative_path+config.upload_url)&&P.replaceWith(o.cloneNode(!0))})})})}i.onNewPostsAddedToDom=async function(t){await i.onTopicPageLoad(t),t.find(".timeago").timeago()},i.showBottomPostBar=function(){const t=e.get("post","index",0),o=$(".post-bar-placeholder"),n=$('[component="post"]');t.length&&n.length>1&&$(".post-bar").length<2&&o.length?($(".post-bar").clone().insertAfter(o),o.remove()):t.length&&n.length<2&&t.find(".post-bar").remove()};function U(t){t.each(function(){$(this).hasClass("deleted")&&u.toggle($(this).attr("data-pid"),!0)})}return i.addBlockquoteEllipses=function(t){t.find('[component="post/content"] > blockquote > blockquote').each(function(){const n=$(this);n.find(":hidden:not(br)").length&&!n.find(".toggle").length&&n.append('<i class="d-inline-block fa fa-angle-down pointer toggle py-1 px-3 border text-bg-light"></i>')})},i}
1.apply(D,E),h!==void 0&&(M.exports=h)},21352:(M,D,p)=>{var E,h;E=[p(60447),p(85233),p(7927)],h=function(S,A,u){const y={};y.init=function(e){const f=e.closest("[data-pid]"),x=f.data("pid"),m=e.find('[component="post/replies/open"]'),i=e.find('[component="post/replies/loading"]'),s=e.find('[component="post/replies/close"]');m.is(":not(.hidden)")&&i.is(".hidden")?(m.addClass("hidden"),i.removeClass("hidden"),socket.emit("posts.getReplies",x,function(c,a){if(i.addClass("hidden"),c)return m.removeClass("hidden"),u.error(c);s.removeClass("hidden"),a.forEach((r,v)=>{r&&(r.index=v)}),S.modifyPostsByPrivileges(a);const g={posts:a,privileges:ajaxify.data.privileges,"downvote:disabled":ajaxify.data["downvote:disabled"],"reputation:disabled":ajaxify.data["reputation:disabled"],loggedIn:!!app.user.uid,hideReplies:config.hasOwnProperty("showNestedReplies")?!config.showNestedReplies:!0};app.parseAndTranslate("topic","posts",g,async function(r){const v=$("<ul>",{component:"post/replies",class:"list-unstyled"}).html(r).hide();e.attr("data-target-component")?f.find('[component="'+e.attr("data-target-component")+'"]').html(v):v.insertAfter(e),v.slideDown("fast"),await S.onNewPostsAddedToDom(r),A.fire("action:posts.loaded",{posts:a})})})):s.is(":not(.hidden)")&&(s.addClass("hidden"),m.removeClass("hidden"),i.addClass("hidden"),f.find('[component="post/replies"]').slideUp("fast",function(){$(this).remove()}))},y.onNewPost=function(e){const f=e.posts[0];f&&(T(f,1),e.hideReplies=config.hasOwnProperty("showNestedReplies")?!config.showNestedReplies:!0,app.parseAndTranslate("topic","posts",e,async function(x){const m=$('[component="post"][data-pid="'+f.toPid+'"] [component="post/replies"]').first();m.length&&(config.topicPostSort==="newest_to_oldest"?m.prepend(x):m.append(x),await S.onNewPostsAddedToDom(x))}))},y.onPostPurged=function(e){T(e,-1)};function T(e,f){const x=document.querySelector(`[component="post"][data-pid="${e.toPid}"]`);if(!x)return;const m=$('[component="post"][data-pid="'+e.toPid+'"]').find('[component="post/reply-count"]').first(),i=m.find('[component="post/reply-count/text"]'),s=m.find('[component="post/reply-count/avatars"]'),c=Math.max(0,(parseInt(i.attr("data-replies"),10)||0)+f),a=m.find(".timeago").attr("title",e.timestampISO),g=x.getAttribute("data-index"),r=c===1&&Math.abs(e.index-g)===1;i.attr("data-replies",c),m.toggleClass("hidden",c<=0||r),c>1?i.translateText("[[topic:replies_to_this_post, "+c+"]]"):i.translateText("[[topic:one_reply_to_this_post]]"),!s.find('[data-uid="'+e.uid+'"]').length&&c<7&&app.parseAndTranslate("topic","posts",{posts:[{replies:{count:c,hasMore:!1,users:[e.user]}}]},function(v){s.prepend(v.find('[component="post/reply-count/avatars"]').html())}),s.addClass("hasMore"),a.data("timeago",null).timeago()}return y}.apply(D,E),h!==void 0&&(M.exports=h)}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.