"use strict";(self.webpackChunknodebb=self.webpackChunknodebb||[]).push([[1091,15794,21374,25432,34271,49897,57490,63154,99127],{8454:(B,T,o)=>{var R,I;R=[o(24962),o(96352),o(52473),o(17459),o(34342),o(49897),o(40027),o(29930),o(91749),o(30076)],I=function(b,k,D,A,C,x,E,c,u,U){const M={};let r=!1;M.init=function(i){r=!1,y(),m(i),b.addShareHandlers(ajaxify.data.titleRaw),C.addVoteHandler(),M.updatePostCount(ajaxify.data.postcount)};function y(){document.querySelector('[component="topic"]')&&$('[component="topic"]').on("show.bs.dropdown",'[component="post/tools"]',function(){const a=$(this),s=a.find(".dropdown-menu"),{top:t}=this.getBoundingClientRect();if(a.toggleClass("dropup",t>window.innerHeight/2),s.attr("data-loaded"))return;s.html(U.generatePlaceholderWave([3,5,9,7,10,"divider",10]));const n=a.parents("[data-pid]"),e=n.attr("data-pid"),h=parseInt(n.attr("data-index"),10);socket.emit("posts.loadPostTools",{pid:e},async(v,f)=>{if(v)return c.error(v);f.posts.display_move_tools=f.posts.display_move_tools&&h!==0;const S=await app.parseAndTranslate("partials/topic/post-menu-list",f),P=o(57576);s.attr("data-loaded","true").html(S),new P("[data-clipboard-text]"),u.fire("action:post.tools.load",{element:s})})})}M.toggle=function(i,a){const s=D.get("post","pid",i);s.find('[component="post/quote"], [component="post/bookmark"], [component="post/reply"], [component="post/flag"], [component="user/chat"]').toggleClass("hidden",a),s.find('[component="post/delete"]').toggleClass("hidden",a).parent().attr("hidden",a?"":null),s.find('[component="post/restore"]').toggleClass("hidden",!a).parent().attr("hidden",a?null:""),s.find('[component="post/purge"]').toggleClass("hidden",!a).parent().attr("hidden",a?null:""),M.removeMenu(s)},M.removeMenu=function(i){i.find('[component="post/tools"] .dropdown-menu').removeAttr("data-loaded").html("")},M.updatePostCount=function(i){D.get("topic/post-count").attr("title",i).html(U.humanReadableNumber(i)),k.setCount(i)};function m(i){const a=D.get("topic");G(),a.on("click",'[component="post/quote"]',function(){g($(this),i)}),a.on("click",'[component="post/reply"]',function(){d($(this),i)}),$(".topic").on("click",'[component="topic/reply"]',function(t){t.preventDefault(),d($(this),i)}),$(".topic").on("click",'[component="topic/reply-as-topic"]',function(){A.translate(`[[topic:link-back, ${ajaxify.data.titleRaw}, ${config.relative_path}/topic/${ajaxify.data.slug}]]`,function(t){u.fire("action:composer.topic.new",{cid:ajaxify.data.cid,body:t})})}),a.on("click",'[component="post/bookmark"]',function(){return l($(this),p($(this),"data-pid"))}),a.on("click",'[component="post/upvote"]',function(){return C.toggleVote($(this),".upvoted",1)}),a.on("click",'[component="post/downvote"]',function(){return C.toggleVote($(this),".downvoted",-1)}),a.on("click",'[component="post/vote-count"]',function(){C.showVotes(p($(this),"data-pid"))}),a.on("click",'[component="post/announce-count"]',function(){C.showAnnouncers(p($(this),"data-pid"))}),a.on("click",'[component="post/flag"]',function(){const t=p($(this),"data-pid");o.e(6574).then(function(){var n=[o(6574)];(function(e){e.showFlagModal({type:"post",id:t})}).apply(null,n)}).catch(o.oe)}),a.on("click",'[component="post/already-flagged"]',function(){const t=$(this).data("flag-id");o.e(6574).then(function(){var n=[o(6574)];(function(e){E.confirm("[[flags:modal-confirm-rescind]]",function(h){h&&e.rescind(t)})}).apply(null,n)}).catch(o.oe)}),a.on("click",'[component="post/flagUser"]',function(){const t=p($(this),"data-uid");o.e(6574).then(function(){var n=[o(6574)];(function(e){e.showFlagModal({type:"user",id:t})}).apply(null,n)}).catch(o.oe)}),a.on("click",'[component="post/flagResolve"]',function(){const t=$(this).attr("data-flagId");o.e(6574).then(function(){var n=[o(6574)];(function(e){e.resolve(t)}).apply(null,n)}).catch(o.oe)}),a.on("click",'[component="post/edit"]',function(){const t=$(this),n=parseInt(p(t,"data-timestamp"),10),e=parseInt(ajaxify.data.postEditDuration,10);s(e,n,"post-edit-duration-expired")&&u.fire("action:composer.post.edit",{pid:p(t,"data-pid")})}),config.enablePostHistory&&ajaxify.data.privileges["posts:history"]&&a.on("click",'[component="post/view-history"], [component="post/edit-indicator"]',function(){const t=$(this);o.e(92747).then(function(){var n=[o(92747)];(function(e){e.open(p(t,"data-pid"))}).apply(null,n)}).catch(o.oe)}),a.on("click",'[component="post/delete"]',function(){const t=$(this),n=parseInt(p(t,"data-timestamp"),10),e=parseInt(ajaxify.data.postDeleteDuration,10);s(e,n,"post-delete-duration-expired")&&N($(this))});function s(t,n,e){if(!ajaxify.data.privileges.isAdminOrMod&&t&&Date.now()-n>t*1e3){const h=Math.floor(t/86400),v=Math.floor(t%86400/3600),f=Math.floor(t%86400%3600/60),S=t%86400%3600%60;let P="[[error:"+e+", "+t+"]]";return h?v?P="[[error:"+e+"-days-hours, "+h+", "+v+"]]":P="[[error:"+e+"-days, "+h+"]]":v?f?P="[[error:"+e+"-hours-minutes, "+v+", "+f+"]]":P="[[error:"+e+"-hours, "+v+"]]":f&&(S?P="[[error:"+e+"-minutes-seconds, "+f+", "+S+"]]":P="[[error:"+e+"-minutes, "+f+"]]"),c.error(P),!1}return!0}a.on("click",'[component="post/restore"]',function(){N($(this))}),a.on("click",'[component="post/purge"]',function(){K($(this))}),a.on("click",'[component="post/move"]',function(){const t=$(this);o.e(90677).then(function(){var n=[o(90677)];(function(e){e.init(t.parents("[data-pid]"))}).apply(null,n)}).catch(o.oe)}),a.on("click",'[component="post/change-owner"]',function(){const t=$(this);Promise.all([o.e(20056),o.e(17205)]).then(function(){var n=[o(17205)];(function(e){e.init(t.parents("[data-pid]"))}).apply(null,n)}).catch(o.oe)}),a.on("click",'[component="post/manage-editors"]',function(){const t=$(this);Promise.all([o.e(20056),o.e(24459)]).then(function(){var n=[o(24459)];(function(e){e.init(t.parents("[data-pid]"))}).apply(null,n)}).catch(o.oe)}),a.on("click",'[component="post/ban-ip"]',function(){const t=$(this).attr("data-ip");socket.emit("blacklist.addRule",t,function(n){if(n)return c.error(n);c.success("[[admin/manage/blacklist:ban-ip]]")})}),a.on("click",'[component="post/chat"]',function(){V($(this))})}async function d(i,a){const s=await w();Y(async function(){let t=await W(i);(p(i,"data-uid")==="0"||!p(i,"data-userslug"))&&(t="");const n=i.is('[component="post/reply"]')?p(i,"data-pid"):null,e=!n||!s.pid||n===s.pid;s.text&&e?(t=t||s.username,u.fire("action:composer.addQuote",{tid:a,pid:n,title:ajaxify.data.titleRaw,username:t,body:s.text,selectedPid:s.pid})):u.fire("action:composer.post.new",{tid:a,pid:n,title:ajaxify.data.titleRaw,body:t?t+" ":$('[component="topic/quickreply/text"]').val()||""})})}async function g(i,a){const s=await w();Y(async function(){const t=await W(i),n=p(i,"data-pid");function e(v){u.fire("action:composer.addQuote",{tid:a,pid:n,username:t,title:ajaxify.data.titleRaw,text:v})}if(s.text&&n&&n===s.pid)return e(s.text);const{content:h}=await x.get(`/posts/${encodeURIComponent(n)}/raw`);e(h)})}async function w(){let i="",a,s="";const t=window.getSelection?window.getSelection():document.selection.createRange(),n=$('[component="post"] [component="post/content"]');let e;return n.each(function(h,v){t&&t.containsNode&&v&&t.containsNode(v,!0)&&(e=v)}),e&&t&&(i=t.toString(),a=$(e).parents('[component="post"]').attr("data-pid"),s=await W($(e))),{text:i,pid:a,username:s}}function l(i,a){const s=i.attr("data-bookmarked")==="false"?"put":"del";return x[s](`/posts/${encodeURIComponent(a)}/bookmark`,void 0,function(t){if(t)return c.error(t);const n=s==="put"?"bookmark":"unbookmark";u.fire(`action:post.${n}`,{pid:a})}),!1}function p(i,a){return i.parents("[data-pid]").attr(a)}function W(i){return new Promise(a=>{let s="";if(i.attr("component")==="topic/reply"){a(s);return}const t=i.parents("[data-pid]");if(t.length){Promise.all([o.e(53050),o.e(26174)]).then(function(){var n=[o(13230)];(function(e){s=e(t.attr("data-username"),!0),s||(t.attr("data-uid")!=="0"?s="[[global:former-user]]":s="[[global:guest]]"),s&&s!=="[[global:former-user]]"&&s!=="[[global:guest]]"&&(s="@"+s),a(s)}).apply(null,n)}).catch(o.oe);return}a(s)})}function N(i){const a=p(i,"data-pid"),t=D.get("post","pid",a).hasClass("deleted")?"restore":"delete";Q(t,a)}function K(i){Q("purge",p(i,"data-pid"))}async function Q(i,a){({action:i}=await u.fire(`static:post.${i}`,{action:i,pid:a})),i&&E.confirm("[[topic:post-"+i+"-confirm]]",function(s){if(!s)return;const t=i==="purge"?"":"/state";x[i==="restore"?"put":"del"](`/posts/${encodeURIComponent(a)}${t}`).catch(c.error)})}function V(i){const a=i.parents("[data-pid]");return o.e(92619).then(function(){var s=[o(92619)];(function(t){t.newChat(a.attr("data-uid"))}).apply(null,s)}).catch(o.oe),i.parents(".btn-group").find(".dropdown-toggle").click(),!1}function Y(i){if(!parseInt(ajaxify.data.topicStaleDays,10))return i();const s=Math.min(Date.now()-1e3*60*60*24*ajaxify.data.topicStaleDays,864e13);if(r||ajaxify.data.lastposttime>=s)return i();E.dialog({title:"[[topic:stale.title]]",message:"[[topic:stale.warning]]",buttons:{reply:{label:"[[topic:stale.reply-anyway]]",className:"btn-link",callback:function(){r=!0,i()}},create:{label:"[[topic:stale.create]]",className:"btn-primary",callback:function(){A.translate(`[[topic:link-back, ${ajaxify.data.title}, ${config.relative_path}/topic/${ajaxify.data.slug}]]`,function(n){u.fire("action:composer.topic.new",{cid:ajaxify.data.cid,body:n,fromStaleTopic:!0})})}}}}).modal()}const F=utils.debounce(J,250);function G(){ajaxify.data.privileges["topics:reply"]&&(u.onPage("action:posts.loaded",z),$(document).off("selectionchange"),$(document).on("selectionchange",function(){window.getSelection().toString()===""&&$('[component="selection/tooltip"]').addClass("hidden")}),$(document).on("selectionchange",F))}function J(){window.getSelection().toString()===""||z()}async function z(){let i=$('[component="selection/tooltip"]');if(i.addClass("hidden"),i.attr("data-ajaxify")==="1"){i.remove();return}const a=window.getSelection();if(a.focusNode&&a.type==="Range"&&ajaxify.data.template.topic){const s=$(a.focusNode),t=$(a.anchorNode),n=t.parents("[data-pid]").attr("data-pid"),e=s.parents("[data-pid]").attr("data-pid");if(n!==e||!s.parents('[component="post/content"]').length||!t.parents('[component="post/content"]').length)return;const h=s.parents("[data-pid]"),v=a.getRangeAt(0);if(!h.length||v.collapsed)return;const f=v.getClientRects(),S=f[f.length-1];i.length||(i=await app.parseAndTranslate("partials/topic/selection-tooltip",ajaxify.data),$('[component="selection/tooltip"]').remove(),i.addClass("hidden").appendTo("body")),i.off("click").on("click",'[component="selection/tooltip/quote"]',function(){i.addClass("hidden"),g(h.find('[component="post/quote"]'),ajaxify.data.tid)}),i.removeClass("hidden"),$(window).one("action:ajaxify.start",function(){i.attr("data-ajaxify",1).addClass("hidden"),$(document).off("selectionchange",F)});const P=i.outerWidth(!0);i.css({top:S.bottom+$(window).scrollTop(),left:P>S.width?S.left:S.left+S.width-P})}}return M}.apply(T,R),I!==void 0&&(B.exports=I)},24962:(B,T,o)=>{var R,I;R=[o(91749)],I=function(b){const k={},D=window.location.protocol+"//"+window.location.host;k.addShareHandlers=function(x){function E(c,u,U,M){return window.open(c,"_blank","width="+U+",height="+M+",scrollbars=no,status=no"),b.fire("action:share.open",{url:c,urlToPost:u}),!1}$("#content").off("shown.bs.dropdown",".share-dropdown").on("shown.bs.dropdown",".share-dropdown",function(){const c=$(this).find(".post-link");c.val(D+C($(this))),setTimeout(function(){c.putCursorAtEnd().select()},50)}),A(".post-link",function(c){return c.preventDefault(),!1}),A('[component="share/twitter"]',function(){const c=C($(this)),u=`https://twitter.com/intent/tweet?text=${encodeURIComponent(x)}&url=${encodeURIComponent(c)}`;return E(u,c,550,420)}),A('[component="share/facebook"]',function(){const c=C($(this)),u=`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(c)}`;return E(u,c,626,436)}),A('[component="share/whatsapp"]',function(){const c=C($(this)),u=encodeURIComponent(x)+" - "+encodeURIComponent(c),U=config.useragent.isMobile?`whatsapp://send?text=${u}`:`https://wa.me/?text=${u}`;return E(U,c,626,436)}),A('[component="share/telegram"]',function(){const c=C($(this)),u=`https://t.me/share/url?text=${encodeURIComponent(x)}&url=${encodeURIComponent(c)}`;return E(u,c,626,436)}),A('[component="share/linkedin"]',function(){const c=C($(this)),u=`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(c)}`;return E(u,c,626,436)}),b.fire("action:share.addHandlers",{openShare:E})};function A(x,E){$("#content").off("click",x).on("click",x,E)}function C(x){const E=parseInt(x.parents("[data-pid]").attr("data-pid"),10),c="/post"+(E?"/"+E:"");return D+config.relative_path+c}return k}.apply(T,R),I!==void 0&&(B.exports=I)},29869:B=>{B.exports=function(T,o,R){o.setGlobal("true",!0),o.setGlobal("false",!1);const I=24*60*60*1e3,b={displayMenuItem:D,buildMetaTag:A,buildLinkTag:C,stringify:x,escape:E,stripTags:c,buildCategoryIcon:u,buildCategoryLabel:U,generateCategoryBackground:M,generateChildrenCategories:r,generateTopicClass:y,membershipBtn:m,spawnPrivilegeStates:d,localeToHTML:g,renderTopicImage:w,renderDigestAvatar:l,userAgentIcons:p,buildAvatar:W,increment:N,generateWroteReplied:K,generateRepliedTo:Q,generateWrote:V,encodeURIComponent:Y,isoTimeToLocaleString:F,shouldHideReplyContainer:G,humanReadableNumber:J,formattedNumber:z,txEscape:i,generatePlaceholderWave:a,register:s,__escape:k};function k(t){return t}function D(t,n){const e=t.navigation[n];return!(!e||e.route.match("/users")&&t.user&&!t.user.privileges["view:users"]||e.route.match("/tags")&&t.user&&!t.user.privileges["view:tags"]||e.route.match("/groups")&&t.user&&!t.user.privileges["view:groups"])}function A(t){const n=t.name?'name="'+t.name+'" ':"",e=t.property?'property="'+t.property+'" ':"",h=t.content?'content="'+t.content.replace(/\n/g," ")+'" ':"";return" `}function C(t){const n=["link","rel","as","type","href","sizes","title","crossorigin"],[e,h,v,f,S,P,H,L]=n.map(j=>t[j]?`${j}="${t[j]}" `:"");return" `}function x(t){return JSON.stringify(t).replace(/&/gm,"&").replace(//gm,">").replace(/"/g,""")}function E(t){return T.escapeHTML(t)}function c(t){return T.stripHTMLTags(t)}function u(t,n,e){return t?`${t.icon?``:""}`:""}function U(t,n="a",e=""){if(!t)return"";const h=n==="a"?`href="${R}/category/${t.slug}"`:"";return`<${n} ${h} class="badge px-1 text-truncate text-decoration-none ${e}" style="color: ${t.color};background-color: ${t.bgColor};border-color: ${t.bgColor}!important; max-width: 70vw;"> ${t.icon&&t.icon!=="fa-nbb-none"?``:""} ${t.name} `}function M(t){if(!t)return"";const n=[];return t.bgColor&&(n.push("background-color: "+t.bgColor),n.push(`border-color: ${t.bgColor}!important`)),t.color&&n.push("color: "+t.color),t.backgroundImage&&(n.push("background-image: url("+t.backgroundImage+")"),t.imageClass&&n.push("background-size: "+t.imageClass)),n.join("; ")+";"}function r(t){let n="";return!t||!t.children||!t.children.length||(t.children.forEach(function(e){if(e&&!e.isSection){const h=e.link?e.link:R+"/category/"+e.slug;n+=''+e.name+""}}),n=n&&''+n+""),n}function y(t){return["locked","pinned","deleted","unread","scheduled"].filter(e=>!!t[e]).join(" ")}function m(t,n=""){return t.isMember&&t.name!=="administrators"?``:t.isPending&&t.name!=="administrators"?``:t.isInvited?``:!t.disableJoinRequests&&t.name!=="administrators"?``:""}function d(t,n,e,h){const v=[];for(const f in e)e.hasOwnProperty(f)&&v.push({name:f,state:e[f],type:h[f]});return v.map(function(f){const S=["groups:moderate","groups:posts:upvote","groups:posts:downvote","groups:local:login","groups:group:create"],P=["groups:find","groups:read","groups:topics:read","groups:view:users","groups:view:tags","groups:view:groups"],H=["groups:moderate"];let L=["groups:view:users","groups:find","groups:read","groups:topics:read","groups:topics:create","groups:topics:reply","groups:topics:tag","groups:posts:edit","groups:posts:history","groups:posts:delete","groups:posts:upvote","groups:posts:downvote","groups:topics:delete"];t===-1&&(L=L.slice(3));const j=n==="guests"&&(S.includes(f.name)||f.name.startsWith("groups:admin:"))||n==="spiders"&&!P.includes(f.name)||n==="fediverse"&&!L.includes(f.name)||n==="Global Moderators"&&H.includes(f.name);return`
`}).join("")}function g(t,n){return t=t||n||"en-GB",t.replace("_","-")}function w(t){return t.thumb?'':''}function l(t){return t.teaser?t.teaser.user.picture?'':'
'+t.teaser.user["icon:text"]+"
":t.user.picture?'':'
'+t.user["icon:text"]+"
"}function p(t){let n="";switch(t.platform){case"Linux":n+='';break;case"Microsoft Windows":n+='';break;case"Apple Mac":n+='';break;case"Android":n+='';break;case"iPad":n+='';break;case"iPod":case"iPhone":n+='';break;default:n+='';break}switch(t.browser){case"Chrome":n+='';break;case"Firefox":n+='';break;case"Safari":n+='';break;case"IE":n+='';break;case"Edge":n+='';break;default:n+='';break}return n}function W(t,n,e,h,v){t||(t=this),h=h||"";const f=new Map([["title",t.displayname],["data-uid",t.uid],["class",`avatar ${h}${e?" avatar-rounded":""}`]]),S=[`--avatar-size: ${n};`],P=L=>Array.from(L).reduce((j,[X,Z])=>(j+=` ${X}="${Z}"`,j),"");let H="";return t.picture&&(H+=``),H+=`${t["icon:text"]}`,H}function N(t,n){return String(t+parseInt(n,10))}function K(t,n){return t.toPid?Q(t,n):V(t,n)}function Q(t,n){const e=t.parent&&t.parent.displayname?t.parent.displayname:"[[global:guest]]";return`[[topic:replied-to-user-${t.timestampe==="divider"?'':` `).join("")}function s(){Object.keys(b).forEach(function(t){o.registerHelper(t,b[t])})}return b}},30076:(B,T,o)=>{var R,I;const b=o(29869);R=[o(77918),o(81335)],I=function(k,D){return b(k,D,config.relative_path)}.apply(T,R),I!==void 0&&(B.exports=I)},34342:(B,T,o)=>{var R,I;R=[o(52473),o(17459),o(49897),o(91749),o(40027),o(29930),o(89336)],I=function(b,k,D,A,C,x,E){const c={};let u={};c.addVoteHandler=function(){u={},U()&&(b.get("topic").on("mouseenter",'[data-pid] [component="post/vote-count"]',y),b.get("topic").on("mouseleave",'[data-pid] [component="post/vote-count"]',r)),b.get("topic").on("mouseenter",'[data-pid] [component="post/announce-count"]',y),b.get("topic").on("mouseleave",'[data-pid] [component="post/announce-count"]',r)};function U(){const{upvoteVisibility:d,privileges:g}=ajaxify.data;return g.isAdminOrMod||d==="all"||d==="loggedin"&&config.loggedIn}function M(){const{upvoteVisibility:d,downvoteVisibility:g,privileges:w}=ajaxify.data;return w.isAdminOrMod||d==="all"||g==="all"||(d==="loggedin"||g==="loggedin")&&config.loggedIn}function r(){const d=$(this),g=d.parents("[data-pid]").attr("data-pid"),w=E.Tooltip.getInstance(this);w&&(w.dispose(),d.attr("title","")),u[g]=!1}function y(){const d=$(this),w=d.parent().parents("[data-pid]").attr("data-pid");u[w]=!0;const l=E.Tooltip.getInstance(this);l&&(l.dispose(),d.attr("title",""));const p=d.attr("component")==="post/vote-count"?`/posts/${encodeURIComponent(w)}/upvoters`:`/posts/${encodeURIComponent(w)}/announcers/tooltip`;D.get(p,{},function(W,N){if(W)return x.error(W);u[w]&&N&&m(d,N)})}function m(d,g){function w(p){d.attr("title",p),new E.Tooltip(d,{container:"#content",html:!0}).show()}let l=g.usernames.filter(p=>p!=="[[global:former-user]]");l.length&&(l.length+g.otherCount>g.cutoff?(l=l.join(", ").replace(/,/g,"|"),k.translate("[[topic:users-and-others, "+l+", "+g.otherCount+"]]",function(p){p=p.replace(/\|/g,","),w(p)})):(l=l.join(", "),w(l)))}return c.toggleVote=function(d,g,w){const l=d.closest("[data-pid]"),W=l.find(g).length?"del":"put",N=l.attr("data-pid");return D[W](`/posts/${encodeURIComponent(N)}/vote`,{delta:w},function(K){if(K){if(!app.user.uid){ajaxify.go("login");return}return x.error(K)}A.fire("action:post.toggleVote",{pid:N,delta:w,unvote:W==="del"})}),!1},c.showVotes=function(d){M()&&D.get(`/posts/${encodeURIComponent(d)}/voters`,{},function(g,w){if(g)return x.error(g);app.parseAndTranslate("modals/votes",w,function(l){const p=C.dialog({title:"[[global:voters]]",message:l,className:"vote-modal",show:!0,onEscape:!0,backdrop:!0});p.on("click",function(){p.modal("hide")})})})},c.showAnnouncers=async function(d){const g=await D.get(`/posts/${encodeURIComponent(d)}/announcers`,{}).catch(p=>x.error(p)),w=await app.parseAndTranslate("modals/announcers",g),l=C.dialog({title:`[[topic:announcers-x, ${g.announceCount}]]`,message:w,className:"announce-modal",show:!0,onEscape:!0,backdrop:!0});l.on("click",function(){l.modal("hide")})},c}.apply(T,R),I!==void 0&&(B.exports=I)},49897:(B,T,o)=>{o.r(T),o.d(T,{del:()=>M,get:()=>x,head:()=>E,patch:()=>u,post:()=>c,put:()=>U});var R=o(91749),I=o.n(R),b=o(40027),k=o.n(b);const D=config.relative_path+"/api/v3";async function A(r,y){if(r.url=r.url.startsWith("/api")?config.relative_path+r.url:D+r.url,typeof y=="function"){C(r).then(m=>y(null,m),m=>y(m));return}try{return await C(r)}catch(m){if(m.message==="A valid login session was not found. Please log in and try again."){const{url:d}=await(0,R.fire)("filter:admin.reauth",{url:"login"});return(0,b.confirm)("[[error:api.reauth-required]]",g=>{g&&ajaxify.go(d)})}throw m}}async function C(r){const{url:y}=r;delete r.url,r.data&&!(r.data instanceof FormData)&&(r.data=JSON.stringify(r.data||{}),r.headers["content-type"]="application/json; charset=utf-8"),{options:r}=await(0,R.fire)("filter:api.options",{options:r}),r.data&&(r.body=r.data,delete r.data);const m=await fetch(y,r),{headers:d}=m;if(d.get("x-redirect"))return C({url:d.get("x-redirect"),...r});const g=d.get("content-type"),w=g&&g.startsWith("application/json");let l;if(r.method!=="HEAD"&&(w?l=await m.json():l=await m.text()),!m.ok)throw l?new Error(w?l.status.message:l):new Error(m.statusText);return w&&l&&l.hasOwnProperty("status")&&l.hasOwnProperty("response")?l.response:l}function x(r,y,m){return A({url:r+(y&&Object.keys(y).length?"?"+$.param(y):"")},m)}function E(r,y,m){return A({url:r+(y&&Object.keys(y).length?"?"+$.param(y):""),method:"HEAD"},m)}function c(r,y,m){return A({url:r,method:"POST",data:y,headers:{"x-csrf-token":config.csrf_token}},m)}function u(r,y,m){return A({url:r,method:"PATCH",data:y,headers:{"x-csrf-token":config.csrf_token}},m)}function U(r,y,m){return A({url:r,method:"PUT",data:y,headers:{"x-csrf-token":config.csrf_token}},m)}function M(r,y,m){return A({url:r,method:"DELETE",data:y,headers:{"x-csrf-token":config.csrf_token}},m)}}}]);