1"use strict";(self.webpackChunknodebb=self.webpackChunknodebb||[]).push([[1091,3097,13417,17205,34271,34405,38395,49897,99127],{17205(w,x,s){var m,h;m=[s(16227),s(34405),s(29930),s(49897)],h=(function(l,c,A,d){const E={};let i,y,P=0;E.init=function(e){i||app.parseAndTranslate("modals/change-owner",{},function(p){i=p,y=i.find("#change_owner_commit"),$("body").append(i),i.find("#change_owner_cancel").on("click",n),i.find("#username").on("keyup",o),l.init(r,{allowMainPostSelect:!0}),a(),e&&l.togglePostSelection(e,e.attr("data-pid")),y.on("click",function(){t()}),c.user(i.find("#username"),{filters:["notbanned"]},function(g,u){P=u.item.user.uid,o()})})};function a(){l.pids.length?i.find("#pids").translateHtml("[[topic:fork-pid-count, "+l.pids.length+"]]"):i.find("#pids").translateHtml("[[topic:fork-no-pids]]")}function o(){P&&i.find("#username").length&&i.find("#username").val().length&&l.pids.length?y.removeAttr("disabled"):y.attr("disabled",!0)}function r(){o(),a()}function t(){P&&d.post("/posts/owner",{pids:l.pids,uid:P}).then(()=>{ajaxify.go(`/post/${l.pids[0]}`),n()}).catch(A.error)}function n(){i&&(i.remove(),i=null,l.disable())}return E}).apply(x,m),h!==void 0&&(w.exports=h)},49897(w,x,s){s.r(x),s.d(x,{del:()=>r,get:()=>i,head:()=>y,patch:()=>a,post:()=>P,put:()=>o});var m=s(91749),h=s.n(m),l=s(33530),c=s.n(l);const A=config.relative_path+"/api/v3";async function d(t,n){if(t.url=t.url.startsWith("/api")?config.relative_path+t.url:A+t.url,typeof n=="function"){E(t).then(e=>n(null,e),e=>n(e));return}try{return await E(t)}catch(e){if(e.message==="A valid login session was not found. Please log in and try again."){const{url:p}=await(0,m.fire)("filter:admin.reauth",{url:"login"});return(0,l.confirm)("[[error:api.reauth-required]]",g=>{g&&ajaxify.go(p)})}throw e}}async function E(t){const{url:n}=t;delete t.url,t.data&&!(t.data instanceof FormData)&&(t.data=JSON.stringify(t.data||{}),t.headers["content-type"]="application/json; charset=utf-8"),{options:t}=await(0,m.fire)("filter:api.options",{options:t}),t.data&&(t.body=t.data,delete t.data);const e=await fetch(n,t),{headers:p}=e;if(p.get("x-redirect"))return E({url:p.get("x-redirect"),...t});const g=p.get("content-type"),u=g&&g.startsWith("application/json");let f;if(t.method!=="HEAD"&&(u?f=await e.json():f=await e.text()),!e.ok){if(f){const C=u&&(f.status?.message||f.error||"");throw new Error(u&&C?C:f)}throw new Error(e.statusText)}return u&&f&&f.hasOwnProperty("status")&&f.hasOwnProperty("response")?f.response:f}function i(t,n,e){return d({url:t+(n&&Object.keys(n).length?"?"+$.param(n):"")},e)}function y(t,n,e){return d({url:t+(n&&Object.keys(n).length?"?"+$.param(n):""),method:"HEAD"},e)}function P(t,n,e){return d({url:t,method:"POST",data:n,headers:{"x-csrf-token":config.csrf_token}},e)}function a(t,n,e){return d({url:t,method:"PATCH",data:n,headers:{"x-csrf-token":config.csrf_token}},e)}function o(t,n,e){return d({url:t,method:"PUT",data:n,headers:{"x-csrf-token":config.csrf_token}},e)}function r(t,n,e){return d({url:t,method:"DELETE",data:n,headers:{"x-csrf-token":config.csrf_token}},e)}},34405(w,x,s){var m,h;m=[s(49897),s(29930),s(36e3),s(9787),s(35786)],h=(function(l,c,{Textcomplete:A},{TextareaEditor:d},{ContenteditableEditor:E}){const i={},y={delay:200,appendTo:null};i.init=a=>{const o={...y,...a},{input:r,onSelect:t}=o;app.loadJQueryUI(function(){r.autocomplete({...o,open:function(){$(this).autocomplete("widget").css("z-index",100005)},select:function(n,e){P(r,t,n,e)}})})},i.user=function(a,o,r){typeof o=="function"&&(r=o,o={}),o=o||{},i.init({input:a,onSelect:r,source:(t,n)=>{o.query=t.term,l.get("/api/users",o,function(e,p){if(e)return c.error(e);if(p&&p.users){const g=p.users.map(function(u){const f=$("<div></div>").html(u.username).text();return u&&{label:f,value:f,user:{uid:u.uid,name:u.username,slug:u.userslug,username:u.username,userslug:u.userslug,displayname:u.displayname,picture:u.picture,banned:u.banned,"icon:text":u["icon:text"],"icon:bgColor":u["icon:bgColor"]}}});n(g)}$(".ui-autocomplete a").attr("data-ajaxify","false")})}})},i.group=function(a,o){i.init({input:a,onSelect:o,source:(r,t)=>{socket.emit("groups.search",{query:r.term},function(n,e){if(n)return c.error(n);if(e&&e.length){const p=e.map(function(g){return g&&{label:g.name,value:g.name,group:g}});t(p)}$(".ui-autocomplete a").attr("data-ajaxify","false")})}})},i.tag=function(a,o){i.init({input:a,onSelect:o,delay:100,source:(r,t)=>{socket.emit("topics.autocompleteTags",{query:r.term,cid:ajaxify.data.cid||0},function(n,e){if(n)return c.error(n);e&&t(e),$(".ui-autocomplete a").attr("data-ajaxify","false")})}})};function P(a,o,r,t){o=o||function(){};const n=jQuery.Event("keypress");n.which=13,n.keyCode=13,setTimeout(function(){a.trigger(n)},100),o(r,t)}return i.setup=function({element:a,strategies:o,options:r}){const t=a.get(0);if(!t)return;let n;
1if(t.nodeName==="TEXTAREA"||t.nodeName==="INPUT"?n=new d(t):t.nodeName==="DIV"&&t.getAttribute("contenteditable")==="true"&&(n=new E(t)),!n)throw new Error("unknown target element type");t.setAttribute("dir",document.querySelector("html").getAttribute("data-dir"));const e=new A(n,o,{dropdown:r});return e.on("rendered",function(){e.dropdown.items.length&&e.dropdown.items[0].activate()}),e},i}).apply(x,m),h!==void 0&&(w.exports=h)},16227(w,x,s){var m,h;m=[s(52473)],h=(function(l){const c={};let A;c.pids=[];let d=!1;c.init=function(a,o){c.pids.length=0,A=a,o=o||{},d=o.allowMainPostSelect||!1,$("#content").on("click",'[component="topic"] [component="post"]',E),y()};function E(a){a.stopPropagation();const o=$(this).attr("data-pid"),r=$('[component="topic"] [data-pid="'+o+'"]');!d&&parseInt($(this).attr("data-index"),10)===0||c.togglePostSelection(r,o)}c.disable=function(){c.pids.forEach(function(a){l.get("post","pid",a).toggleClass("selected",!1)}),$("#content").off("click",'[component="topic"] [component="post"]',E),P()},c.togglePostSelection=function(a,o){if(o){const r=c.pids.indexOf(o);r===-1?(c.pids.push(o),a.toggleClass("selected",!0)):(c.pids.splice(r,1),a.toggleClass("selected",!1)),c.pids.length&&c.pids.sort(function(t,n){return t-n}),typeof A=="function"&&A()}};function i(){return!1}function y(){$("#content").on("click",'[component="post"] button, [component="post"] a',i)}function P(){$("#content").off("click",'[component="post"] button, [component="post"] a',i)}return c}).apply(x,m),h!==void 0&&(w.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.