1"use strict";(self.webpackChunknodebb=self.webpackChunknodebb||[]).push([[844,1091,2067,2441,3602,4271,6159,7212,8314,9127,9897],{9897(D,w,c){c.r(w),c.d(w,{del:()=>y,get:()=>r,head:()=>t,patch:()=>m,post:()=>o,put:()=>E});var d=c(1749),g=c.n(d),i=c(5303),h=c(7459),l=c.n(h),b=c(8636),A=c.n(b);const e=config.relative_path+"/api/v3";async function a(n,f){if(n.url=n.url.startsWith("/api")?config.relative_path+n.url:e+n.url,n.headers=n.headers||{},n.headers["x-return-to"]||(n.headers["x-return-to"]=`${window.location.pathname.slice(config.relative_path.length)}${window.location.search}`),typeof f=="function"){s(n).then(u=>f(null,u),u=>f(u));return}try{return await s(n)}catch(u){if(u.status===401){const{url:p}=await(0,d.fire)("filter:admin.reauth",{url:"login"}),_=await h.translate("[[error:api.reauth-required]]",config.userLang);(0,i.confirm)(_,v=>{v&&(b.setItem("location-hash",window.location.hash),ajaxify.go(p))})}throw u}}async function s(n){const{url:f}=n;delete n.url,n.data&&!(n.data instanceof FormData)&&(n.data=JSON.stringify(n.data||{}),n.headers["content-type"]="application/json; charset=utf-8"),{options:n}=await(0,d.fire)("filter:api.options",{options:n}),n.data&&(n.body=n.data,delete n.data);const u=await fetch(f,n),{headers:p}=u;if(p.get("x-redirect"))return s({url:p.get("x-redirect"),...n});const _=p.get("content-type"),v=_&&_.startsWith("application/json");let P;if(n.method!=="HEAD"&&(v?P=await u.json():P=await u.text()),!u.ok){let S=u.statusText;if(P){const T=v&&(P.status?.message||P.error||""),C=typeof P=="string"?P:u.statusText||`[[error:api.${u.status}]]`;S=v&&T?T:C}const I=new Error(S);throw I.status=u.status,I}return v&&P&&P.hasOwnProperty("status")&&P.hasOwnProperty("response")?P.response:P}function r(n,f,u){return a({url:n+(f&&Object.keys(f).length?"?"+$.param(f):"")},u)}function t(n,f,u){return a({url:n+(f&&Object.keys(f).length?"?"+$.param(f):""),method:"HEAD"},u)}function o(n,f,u,p){return O("POST",n,f,u,p)}function m(n,f,u,p){return O("PATCH",n,f,u,p)}function E(n,f,u,p){return O("PUT",n,f,u,p)}function y(n,f,u,p){return O("DELETE",n,f,u,p)}function O(n,f,u,p,_){return typeof p=="function"&&(_=p,p={}),a({url:f,method:n,data:u,headers:{"x-csrf-token":config.csrf_token,...p}},_)}},5303(D,w,c){c.r(w),c.d(w,{alert:()=>b,confirm:()=>A,dialog:()=>l,prompt:()=>e,promptPassword:()=>a});var d=c(3530),g=c.n(d),i=c(7459),h=c.n(i);d.setDefaults({locale:config.userLang}),i.translateKeys(["modules:bootbox.ok","modules:bootbox.cancel","modules:bootbox.confirm"]).then(t=>{d.addLocale(config.userLang,{OK:t[0],CANCEL:t[1],CONFIRM:t[2]}),d.setLocale(config.userLang)});async function l(t){const[o,m,E]=await Promise.all([i.translate(t.title||""),s(t)||"",r(t.buttons)]);return d.dialog({...t,title:o,message:m,buttons:E})}async function b(t,o){const[m,E]=await Promise.all([t&&t.title?i.translate(t.title):null,s(t)]);return o=typeof o=="function"?o:t.callback,d.alert({...t,title:m,message:E,callback:o})}async function A(t,o){const[m,E]=await Promise.all([t&&t.title?i.translate(t.title):null,s(t)]);return o=typeof o=="function"?o:t.callback,d.confirm({...t,title:m,message:E,callback:o})}async function e(t,o){const[m,E]=await Promise.all([i.translate(typeof t=="string"?t:t.title),t&&t.message?s(t):null]);return o=typeof o=="function"?o:t.callback,d.prompt({...t,title:m,message:E,callback:o})}async function a(t){return typeof t=="string"&&(t={title:t}),t=t||{title:"[[user:current-password]]",message:"[[user:emailUpdate.password-challenge]]"},await new Promise(o=>{e({...t,inputType:"password",required:!0,value:"",callback:o})})}function s(t){const o=t&&t.message?t.message:t;return o instanceof jQuery?o:i.translate(o||"")}async function r(t){if(!Object.keys(t||{}).length)return;const o=Object.values(t);return await Promise.all(o.map(async m=>({...m,label:await i.translateKey(m.label)})))}},8636(D,w,c){var d;d=(function(){function g(){this._store={},this._keys=[]}g.prototype.isMock=!0,g.prototype.setItem=function(l,b){l=String(l),this._keys.indexOf(l)===-1&&this._keys.push(l),this._store[l]=b},g.prototype.getItem=function(l){return l=String(l),this._keys.indexOf(l)===-1?null:this._store[l]},g.prototype.removeItem=function(l){l=String(l),this._keys=this._keys.filter(function(b){return b!==l}),this._store[l]=null},g.prototype.clear=function(){this._keys=[],this._store={}},g.prototype.key=function(l){return l=parseInt(l,10)||0,this._keys[l]},Object.defineProperty&&Object.defineProperty(g.prototype,"length",{get:function(){return this._keys.length}});let i;const h=Date.now().toString();try{if(i=window.localStorage,i.setItem(h,h),i.getItem(h)!==h)throw Error("localStorage behaved unexpectedly");return i.removeItem(h),i}catch(l){console.warn(l),console.warn("localStorage failed, falling back on sessionStorage");try{if(i=window.sessionStorage,i.setItem(h,h),i.getItem(h)!==h)throw Error("sessionStorage behaved unexpectedly");return i.removeItem(h),i}catch(b){return console.warn(b),console.warn("sessionStorage failed, falling back on memory storage"),new g}}}).call(w,c,w,D),d!==void 0&&(D.exports=d)},6159(D,w,c){var d,g;d=[c(9897),c(5303),c(9930),c(4187),c(1335),c(7459),c(5285)],g=(function(i,h,l,b,A,e){const a={};return a.get=s=>i.get(`/topics/${s}/thumbs`,{thumbsOnly:1}),a.delete=(s,r)=>i.del(`/topics/${s}/thumbs`,{path:r}),a.updateTopicThumbs=async s=>{const r=await a.get(s),t=await app.parseAndTranslate("partials/topic/thumbs",{thumbs:r});$('[component="topic/thumb/list"]').html(t)},a.deleteAll=s=>{a.get(s).then(r=>{Promise.all(r.map(t=>a.delete(s,t.url)))})},a.upload=()=>new Promise(s=>{b.show({title:"[[topic:composer.thumb-title]]",method:"put",route:config.relative_path+"/api/topic/thumb/upload"},function(r){s(r)})}),a.modal={},a.modal.open=function(s){const{id:r,postData:t}=s;let{modal:o}=s;const m=t.thumbs||[];return new Promise(E=>{A.render("modals/topic-thumbs",{thumbs:m}).then(async y=>{o?e.translate(y,function(O){o.find(".bootbox-body").html(O),a.modal.handleSort({modal:o,thumbs:m})}):(o=await h.dialog({title:"[[modules:thumbs.modal.title]]",message:y,onEscape:!0,backdrop:!0,buttons:{add:{label:"[[modules:thumbs.modal.add]]",className:"btn-success",callback:()=>(a.upload().then(O=>{const n=O.replace(new RegExp(`^${config.relative_path}`),"").replace(new RegExp(`^${config.upload_url}`),"");t.thumbs.push(n),a.modal.open({...s,modal:o}),$(window).trigger("action:composer.thumbs.updateCount",{uuid:r}),E()}),!1)},close:{label:"[[global:close]]",className:"btn-primary"}}}),a.modal.handleDelete({...s,modal:o}),a.modal.handleSort({modal:o,thumbs:m}))})})},a.modal.handleDelete=s=>{const r=s.modal.get(0),{id:t}=s;r.addEventListener("click",o=>
1{o.target.closest('button[data-action="remove"]')&&h.confirm("[[modules:thumbs.modal.confirm-remove]]",m=>{if(!m)return;const E=o.target.closest("[data-path]").getAttribute("data-path"),y=s.postData;y&&y.thumbs&&y.thumbs.includes(E)&&(y.thumbs=y.thumbs.filter(O=>O!==E),a.modal.open(s),$(window).trigger("action:composer.thumbs.updateCount",{uuid:t}))})})},a.modal.handleSort=({modal:s,thumbs:r})=>{if(r.length>1){const t=s.find(".topic-thumbs-modal");t.sortable({items:"[data-path]"}),t.on("sortupdate",function(){if(!r)return;const o=[];t.find("[data-path]").each(function(){const m=$(this).attr("data-path"),E=r.find(y=>y===m);E&&o.push(E)}),r.length=0,Array.prototype.push.apply(r,o)})}},a}).apply(w,d),g!==void 0&&(D.exports=g)},4187(D,w,c){var d,g;d=[c(4061)],g=(function(){const i={};i.show=function(e,a){const s=e.hasOwnProperty("fileSize")&&e.fileSize!==void 0?parseInt(e.fileSize,10):!1;app.parseAndTranslate("modals/upload-file",{showHelp:e.hasOwnProperty("showHelp")&&e.showHelp!==void 0?e.showHelp:!0,fileSize:s,title:e.title||"[[global:upload-file]]",description:e.description||"",button:e.button||"[[global:upload]]",accept:e.accept?e.accept.replace(/,/g,", "):""},function(r){r.modal("show"),r.on("hidden.bs.modal",function(){r.remove()});const t=r.find("#uploadForm");t.attr("action",e.route),t.find("#params").val(JSON.stringify(e.params)),r.find("#fileUploadSubmitBtn").on("click",function(){$(this).addClass("disabled"),t.submit()}),t.submit(function(){return h(r,s,a),!1})})},i.hideAlerts=function(e){$(e).find("#alert-status, #alert-success, #alert-error, #upload-progress-box").addClass("hide")};function h(e,a,s){l(e,"status","[[uploads:uploading-file]]"),e.find("#upload-progress-bar").css("width","0%"),e.find("#upload-progress-box").show().removeClass("hide");const r=e.find("#fileInput");if(!r.val())return l(e,"error","[[uploads:select-file-to-upload]]");if(!A(r[0],a))return l(e,"error","[[error:file-too-big, "+a+"]]");i.ajaxSubmit(e,s)}function l(e,a,s){i.hideAlerts(e),a==="error"&&e.find("#fileUploadSubmitBtn").removeClass("disabled"),s=s.replace(/&#44/g,","),e.find("#alert-"+a).translateText(s).removeClass("hide")}i.ajaxSubmit=function(e,a){e.find("#uploadForm").ajaxSubmit({headers:{"x-csrf-token":config.csrf_token},error:function(r){r=b(r),l(e,"error",r.responseJSON?.status?.message||r.responseJSON?.error||`[[error:upload-error-fallback, ${r.status} ${r.statusText}]]`)},uploadProgress:function(r,t,o,m){e.find("#upload-progress-bar").css("width",m+"%")},success:function(r){let t=b(r);r.hasOwnProperty("response")&&r.hasOwnProperty("status")&&r.status.code==="ok"&&(t=r.response.images),a(t[0].url),l(e,"success","[[uploads:upload-success]]"),setTimeout(function(){i.hideAlerts(e),e.modal("hide")},750)}})};function b(e){if(typeof e=="string")try{return JSON.parse(e)}catch(a){return console.error(a),{error:"[[error:parse-error]]"}}return e}function A(e,a){return window.FileReader&&a?e.files[0].size<=a*1e3:!0}return i}).apply(w,d),g!==void 0&&(D.exports=g)}}]);
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.