/*
 =======================================================================*\
|| ###################################################################### ||
|| # vBulletin 6.2.3
|| # ------------------------------------------------------------------ # ||
|| # Copyright 2000-2026 MH Sub I, LLC dba vBulletin. All Rights Reserved.  # ||
|| # This file may not be redistributed in whole or significant part.   # ||
|| # ----------------- VBULLETIN IS NOT FREE SOFTWARE ----------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html   # ||
|| ###################################################################### ||
\*========================================================================*/
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(g,q,x){if(g==Array.prototype||g==Object.prototype)return g;g[q]=x.value;return g};
$jscomp.getGlobal=function(g){g=["object"==typeof globalThis&&globalThis,g,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var q=0;q<g.length;++q){var x=g[q];if(x&&x.Math==Math)return x}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};
$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(g,q){var x=$jscomp.propertyToPolyfillSymbol[q];if(null==x)return g[q];x=g[x];return void 0!==x?x:g[q]};$jscomp.polyfill=function(g,q,x,A){q&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(g,q,x,A):$jscomp.polyfillUnisolated(g,q,x,A))};
$jscomp.polyfillUnisolated=function(g,q,x,A){x=$jscomp.global;g=g.split(".");for(A=0;A<g.length-1;A++){var C=g[A];if(!(C in x))return;x=x[C]}g=g[g.length-1];A=x[g];q=q(A);q!=A&&null!=q&&$jscomp.defineProperty(x,g,{configurable:!0,writable:!0,value:q})};
$jscomp.polyfillIsolated=function(g,q,x,A){var C=g.split(".");g=1===C.length;A=C[0];A=!g&&A in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var W=0;W<C.length-1;W++){var da=C[W];if(!(da in A))return;A=A[da]}C=C[C.length-1];x=$jscomp.IS_SYMBOL_NATIVE&&"es6"===x?A[C]:null;q=q(x);null!=q&&(g?$jscomp.defineProperty($jscomp.polyfills,C,{configurable:!0,writable:!0,value:q}):q!==x&&(void 0===$jscomp.propertyToPolyfillSymbol[C]&&(x=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[C]=$jscomp.IS_SYMBOL_NATIVE?
$jscomp.global.Symbol(C):$jscomp.POLYFILL_PREFIX+x+"$"+C),$jscomp.defineProperty(A,$jscomp.propertyToPolyfillSymbol[C],{configurable:!0,writable:!0,value:q})))};$jscomp.arrayIteratorImpl=function(g){var q=0;return function(){return q<g.length?{done:!1,value:g[q++]}:{done:!0}}};$jscomp.arrayIterator=function(g){return{next:$jscomp.arrayIteratorImpl(g)}};$jscomp.makeIterator=function(g){var q="undefined"!=typeof Symbol&&Symbol.iterator&&g[Symbol.iterator];return q?q.call(g):$jscomp.arrayIterator(g)};
$jscomp.polyfill("Promise.allSettled",function(g){function q(A){return{status:"fulfilled",value:A}}function x(A){return{status:"rejected",reason:A}}return g?g:function(A){var C=this;A=Array.from(A,function(W){return C.resolve(W).then(q,x)});return C.all(A)}},"es_2020","es3");vBulletin.precache("error_fetching_avatar insert_video retrieve_remote_file_and_ref_local insert_page_break insert_preview_break wrap_x_tags".split(" "),"maxuserlength minuserlength threadpreview useemoji userbbcodeavatar allowedbbcodes".split(" "));
(function(g,q,x,A,C,W){function da(a,b){var c=$("#"+a);if(c.is(".js-ckeditor-init-on-focus")||c.is(".js-ckeditor-focus-editor-after-init"))b.focus(),console.log("Ckeditor: Focus on editor for editor: {0}".format(a))}function qa(a){a+="";if(1E3<a.length||a.match(/<(table|ol|ul|li|img|hr)/)||a.match(/<(div|ol|ul|li|img) style="(margin-left|margin-right|text-align)/)||a.match(/<h3\s+class="wysiwyg_pagebreak">/))return!1;a=$("<div />").append(a).text();a=$.trim(a).replace(/&nbsp;|\s|\n|\t/g,"");return!a}
function Ba(a,b){function c(){setTimeout(function(){var d=b.document?b.document.getBody():null;var n=f;var m=n.closest(".b-editor").find(".cke_contents"),e=m.find(".b-editor__placeholder");0==e.length&&(e=$("<div />").text(n.attr("placeholder")).addClass("b-editor__placeholder h-hide placeholder").appendTo(m));n=e;d&&d.$&&(d&&d.$&&!d.hasClass("js-vbulletin-has-placeholder-events")&&(d.on("keydown",c),d.on("drop",c),d.addClass("js-vbulletin-has-placeholder-events")),d=qa(d.getHtml()),n.toggleClass("h-hide",
!d),h&&!d&&(C.showButtons(f.closest(".js-content-entry")),h=!1))},10)}var f=$("#"+a),h=!0;b=b||T(a);f.attr("placeholder")&&(b.on("saveSnapshot",c),b.on("afterCommandExec",c),b.on("afterSetData",c),b.on("mode",function(d){"source"!=d.editor.mode&&c()}),$(b.editable().$).on("keydown",d=>{if(![8,13,37,38,39,40,46].includes(d.which)&&(d=b.getSelection())){var n=d.getRanges();if(n&&n[0]){n=n[0];var m=n.getEnclosedNode();d.isFake&&m&&m.hasClass("cke_widget_image")&&(n.setEndAfter(m),n.collapse(),n.select())}}}),
c())}function Ca(a,b){a=$("#"+a).closest(".b-editor");b=$("<button />").attr("type","button").addClass("b-button b-button--close-btn js-contententry-panel-x js-ckeditor-toolbar-close ").attr("tabindex","0");$("<span />").addClass("b-icon-fa fa-xmark b-icon-fa--24 fa-solid").appendTo(b);b.appendTo(a)}function Da(a,b){a=T(a);b=c=>{q.togglePageScrolling(c)};a.on("dialogShow",b.bind(null,!1));a.on("dialogHide",b.bind(null,!0))}function Ea(a,b,c,f,h,d){function n(k,v){if(!k)return-1;var F,D,G=!1;for(F=
0;F<k.styleSheets.length;++F)try{$.each(H.contentsCss,function(K,M){(k.styleSheets[F].href+"").replace(/&amp;/g,"&")==(M+"").replace(/&amp;/g,"&")&&(G=!0)});var y=k.styleSheets[F].cssRules;for(D=0;D<y.length;++D)if(y[D].selectorText==v)return 1}catch(K){}return G?0:-1}function m(){++r;0<c&&0==n(e,h)?(--c,setTimeout(m,f)):(d.apply(b,[a,b]),console.log("Ckeditor: Init: verifyEditorCss: checkCss called {0} times".format(r)))}var e=function(k){return k&&k.document&&k.document.$&&k.document.$.defaultView&&
k.document.$.defaultView.frameElement?(k=k.document.$.defaultView.frameElement,k.contentDocument||k.contentWindow.document):!1}(b),r=0;m()}function Fa(a,b){b.on("mode",function(c){X(a).find(".js-smilie-container .js-smilie-button").toggleClass("b-smilie__button--disabled","source"==c.editor.mode)})}function Ga(a,b){b.on("focus",function(c){C.showButtons(X(a))});b.on("blur",function(c){c=X(a);var f=ra(a);C.populateMetaDescription(f,c)})}function ia(a,b){a=$(a);var c=a.closest(".b-editor"),f=b;"undefined"!=
typeof f&&(f=!b);c.toggleClass("b-editor--cke-toolbar-is-hidden",f);b=!c.hasClass("b-editor--cke-toolbar-is-hidden");a.closest(".js-content-entry").find(".js-toolbar-secondary .b-toolbar__item").filter(function(){return"b-content-entry-panel__content--toggle-editor"==$(this).data("panel")}).toggleClass("b-toolbar__item--active",b)}function ea(a){a=S(a);return a in aa&&aa[a]}function T(a){a=S(a);return ea(a)?aa[a]:null}function sa(a){a=a.closest(".js-contententry-form");return T(a.attr("ck-editorid")||
$(".js-editor",a).attr("id"))}function ja(a){var b=Math.floor(1E3*Math.random()),c=Date.now();return"temp_"+a+"_"+c+"_"+b}function ta(a){a.editor.on("langLoaded",function(b){b=1==$("#debug-information").length;var c="ckeditorPhrases"in vBulletin;g.vBulletin=g.vBulletin||{};if("langInit"in g.vBulletin||!c)!c&&b&&console.warn("Ckeditor phrases not loaded.");else{g.vBulletin.langInit=!0;if(b){function f(h,d){d=d||"";$.each(h,function(n,m){"object"==typeof m?f(h[n],d+n+"."):h[n]="~~"+m+"~~ ("+d+n+")"})}
f(g.lang.en)}$.each(q.ckeditorPhrases,function(f,h){for(var d=g.lang.en,n=f.split("."),m=0;m<n.length;m++){var e=n[m];if(m==n.length-1)d[e]=null===h?"Undefined: "+f:h;else{if("object"!=typeof d[e]||null===d[e])d[e]={};d=d[e]}}});g.lang.en.dir=pageData.textdirection}});g.removeListener("instanceCreated",ta)}function ua(a,b){$("#"+(b||a.editor).id+"_top .cke_button__table").hide()}function va(a,b){var c=new Image;c.onload=function(){b.execCommand("autogrow_ifallowed")};c.src=a}function ka(a){var b=
pageData.baseurl+"/js/ckeditor/images/"+U.ckeditor_image_path+"/",c=la.hidpi?"icons_hidpi.png":"icons.png";$.each([[".cke_dialog_close_button","close.png"],[".cke_notification_close","close.png"],[".cke_btn_reset","refresh.png"],[".cke_btn_locked","lock.png"],[".cke_btn_unlocked","lock-open.png"],[".cke_menuarrow","arrow.png"]],function(){a.find(this[0]).css("backgroundImage","url("+b+this[1]+")")});a.find(".cke_button_icon").each(function(){var f=$(this),h=f.attr("style"),d=f.css("background-image");
"none"==d||d.match(/js\/ckeditor\/plugins\/icons.png/)||d.match(/js\/ckeditor\/skins\/.*\/icons/)?f.attr("style",h+"background-image:url("+b+c+") !important;"):d.match(/js\/ckeditor\/images\/default\/vbulletin/)?(d=d.replace("js/ckeditor/images/default/vbulletin","js/ckeditor/images/"+U.ckeditor_image_path+"/vbulletin"),f.attr("style",h+"background-image:"+d+" !important;")):d.match(/js\/ckeditor\/images\/default\/icons/)?(h=h.replace("js/ckeditor/images/default/","js/ckeditor/images/"+U.ckeditor_image_path+
"/"),f.attr("style",h)):d.match(/js\/ckeplugins\/image2\/icons\/image_default.png/)&&(h=h.replace("default",U.ckeditor_image_path),f.attr("style",h))})}function ma(a,b){function c(){++f;f==H.contentsCss.length&&q.ensureFun(b)(a)}var f=0;setTimeout(()=>{var h=a.contents().find("head");if(!h.is(".js-added-extra-css")){for(var d of H.contentsCss){var n=$("<link />",{rel:"stylesheet",type:"text/css",href:d.replace(/&amp;/g,"&")});n.on("load",c);h.append(n)}h.addClass("js-added-extra-css")}},0)}function wa(a){function b(m){var e=
m.find(".js-vb-toolbar-more");1>e.length&&(e=$("<a />").addClass("js-vb-toolbar-more cke_button").css({borderRadius:"3px"}).on("click",function(r){$(r.target).closest(".js-vb-toolbar-more").toggleClass("cke_button_on");f()}),$("<span />").addClass("b-icon b-icon__ellipsis").appendTo(e),$("<div />").addClass("cke_toolgroup js-vb-toolbar-more-container").css({borderColor:"transparent",background:"transparent",marginRight:0,marginLeft:0}).append(e).appendTo(m));return e}function c(m){var e=b(h);e.is(".cke_button_on")&&
(m=0);d.addClass("h-hide-imp");$.each([0,1,2],function(r,k){n.filter(".js-button-priority-"+k).toggleClass("h-hide-imp",k<m)});n.not(".h-hide-imp").closest(".cke_toolbar").removeClass("h-hide-imp");e.toggleClass("h-hide-imp",!$("body").is(".l-small"))}function f(){var m=$("body"),e=m.is(".l-small");m=m.is(".l-xsmall");c(m?2:e?1:0)}var h=$("#cke_"+a+" .cke_toolbox"),d=h.find(".cke_toolbar"),n=h.find(".cke_button, .cke_combo");(function(m){function e(k){var v=0;$.each(r,function(F,D){if(k.is("."+F))return v=
D,!1});return v}if(!(0<m.filter(".js-button-priority-0").length)){var r={cke_button__source:0,cke_button__removeformat:0,cke_button__pastetext:0,cke_button__pastefromword:0,cke_combo__font:0,cke_combo__fontsize:0,cke_button__textcolor:1,cke_button__undo:1,cke_button__redo:1,cke_button__bold:2,cke_button__italic:2,cke_button__underline:2,cke_button__justifyleft:2,cke_button__justifycenter:2,cke_button__justifyright:2,cke_button__numberedlist:2,cke_button__bulletedlist:2,cke_button__outdent:1,cke_button__indent:1,
cke_button__link:0,cke_button__unlink:0,cke_button__image:2,cke_button__video:0,cke_button__emojipanel:2,cke_button__quote:0,cke_button__code:0,cke_button__html:0,cke_button__php:0,cke_button__table:0,cke_button__vbtable:0,cke_button__subscript:0,cke_button__superscript:0,cke_button__horizontalrule:0,cke_button__pagebreak:0,cke_button__previewbreak:0};m.each(function(){var k=$(this),v=e(k);k.addClass("js-button-priority-"+v)})}})(n);f();(function(m){function e(r){function k(G){return G.find(".cke_toolbar, .js-vb-toolbar-more-container").filter(":visible")}
var v=k(r);if(0<v.length){if(b(r).is(":visible")&&$("body").is(".l-small"))for(var F=10;0<--F&&0<v.length&&!q.Responsive.Debounce.areElementsOnOneRow(v);){v=r.find(".cke_button, .cke_combo").not(".js-vb-toolbar-more").filter(":visible").last().addClass("h-hide-imp").closest(".cke_toolbar");var D=0==v.find(".cke_button:visible, .cke_combo:visible").length;v.toggleClass("h-hide-imp",D);v=k(r)}return!0}return!1}e(m)||setTimeout(function(){e(m)},0)})(h)}function Ha(a,b){b=b||T(a);b.fire("disableResize")}
const X=a=>$("#"+a).closest(".js-content-entry"),na=a=>a&&"0"!==a&&"false"!==a.toLowerCase(),U=q.data("contententry-data");let Y=g.dom.element,H=g.config,la=g.env,aa={},S=x.verifyEditorId,xa=x.hideLoadingDialog,ra=x.getEditorContent;H.allowedContent=!0;H.baseHref=pageData.baseurl+"/";var O=JSON.parse(U.ckeditorCss);if("undefined"!=typeof O){"string"==typeof O&&(O=[O]);$.isArray(H.contentsCss)||(H.contentsCss=[]);for(var ba of O)H.contentsCss.push((q.isAbsoluteUrl(ba)?"":H.baseHref)+ba)}O=A.get("allowedbbcodes");
var Ia=O&1024,Ja=O&8192,oa="UTF-8"==document.characterSet.toUpperCase()&&A.get("useemoji");H.toolbar_vBulletinFull=(()=>{let a=[["EnhancedSource","Source","RemoveFormat"],["Font","FontSize"],["TextColor","-","Undo","Redo"],["Bold","Italic","Underline"],["JustifyLeft","JustifyCenter","JustifyRight"],["NumberedList","BulletedList","Outdent","Indent"],["Link","Email","Unlink"],["Quote"],["Code","Html","Php"],["Table","vBTable"],["Subscript","Superscript","HorizontalRule"]];"article"==U.channeltype&&
a.push(["PageBreak","PreviewBreak"]);if("customBbcode"in q){var b=[],c;for(c in q.customBbcode)c&&b.push(q.customBbcode[c].title);0<b.length&&(a[a.length]=b)}b=a[6];Ia&&b.push("Image");Ja&&b.push("Video");oa&&b.push("EmojiPanel");return a})();var ya={Font:"font",FontSize:"size",TextColor:"color",Bold:"b",Italic:"i",Underline:"u",Subscript:"sub",Superscript:"sup",HorizontalRule:"hr",Table:"table",TableProperties:"table",DeleteTable:"table",InsertRowBefore:"table",InsertRowAfter:"table",DeleteRow:"table",
InsertColumnBefore:"table",InsertColumnAfter:"table",DeleteColumn:"table",JustifyLeft:"left",JustifyCenter:"center",JustifyRight:"right",NumberedList:"list",BulletedList:"list",Outdent:"indent",Indent:"indent",Link:"url",Email:"email",Unlink:"url",Image:"img",Quote:"quote",Code:"code",Html:"html",Php:"php"};H.smiley_path=pageData.baseurl_core+"/";H.enterMode=g.ENTER_BR;H.entities=!1;H.height=70;H.width="100%";H.autoGrow_minHeight=70;H.autoGrow_maxHeight=800;H.autoGrow_viewportLimit=!0;H.image2_alignClasses=
["align_left","align_center","align_right"];O=na(U.image2_showuploadcheckbox);H.image2_showuploadcheckbox=O;H.image2_checkuploadbydefault=O;H.contentsLangDirection=pageData.textdirection;H.language="en";H.defaultLanguage="en";H.language_list=["en"];H.skin="moono-lisa";var V={toolbar:"vBulletinFull",customConfig:"",toolbarCanCollapse:!1,resize_dir:"vertical",removePlugins:"about,contextmenu,elementspath,link,smiley,liststyle,sourcearea,scayt",extraPlugins:"vblink,vbwrapbuttons,vbsource,videotag,autosave,autogrow,vbtable,resize,image2",
pluginPath:pageData.baseurl+"/js/ckeplugins/",tabIndex:0,disableNativeSpellChecker:!1,filebrowserImageUploadUrl:pageData.baseurl+"/uploader/CKEditorInsertImage",filebrowserUploadMethod:"form"};oa||(V.removePlugins+=",emoji");for(var ca of V.extraPlugins.split(",")){O=V.pluginPath+ca+"/";ba=O+"plugin.js";try{g.plugins.get(ca)||(console.log("Ckeditor: Plugin Loaded: "+ba),g.plugins.addExternal(ca,O,"plugin.js"))}catch(a){console.warn("Ckeditor: Plugin failed to load: "+ba)}}(()=>{var a=Y.createFromHtml;
Y.createFromHtml=function(){function c(n,m){return n&&n.tagName&&n.tagName.toUpperCase()==m.toUpperCase()}var f=a.apply(this,arguments),h=f&&f.$?f.$:f,d=!1;c(h,"IFRAME")?d=h:h&&h.firstChild&&c(h.firstChild,"IFRAME")&&(d=h.firstChild);if(d)$(d).on("load",function(n){var m=$(n.target);m.is(".cke_pasteframe")&&ma(m);if(m.is(".cke_panel_frame")&&m.parent().is(".cke_emoji-panel")){m.parent().css("visibility","hidden");function e(k){var v=$(k.target||k.srcElement);if(v.data("cke-emoji-name")){k.preventDefault();
let F=sa($(".cke_button__emojipanel.cke_button_on"));k.stopPropagation();k=F.focus;F.focus=function(){};F.insertHtml(v.data("cke-emoji-symbol"));F.focus=k}}function r(){m.parent().css("visibility","");var k=m.contents().find("body").get(0);k.removeEventListener("click",e,!0);k.addEventListener("click",e,!0)}ma(m,r);setTimeout(r,2E3)}});return f};var b=Y.prototype.setHtml;Y.prototype.setHtml=function(c){var f=c.indexOf("cke_emoji-search");if(-1<f&&(f=c.indexOf("<input",f),-1<f&&(f=c.indexOf('type="search"',
f),-1<f))){var h=c.substring(0,f);c=c.substring(f);c=h+'class="b-form-input__input" '+c}return b.call(this,c)}})();var za="imgAlignment imgSize imgTitle imgDescription imgStyles imgLink imgLinkURL imgLinkTarget".split(" ");g.on("instanceCreated",ta);ca=[function(a){var b=a.editor;a=$("#"+b.id+"_contents").children().filter((c,f)=>"IFRAME"==f.tagName);310>parseInt(b.config.width)&&(a.hide(),a.show());"ontouchstart"in document.documentElement&&a.get(0).contentWindow.scrollTo(0,10);b.dataProcessor.dataFilter.addRules({elements:{img:function(c){if(c.attributes["class"]&&
-1!==c.attributes["class"].indexOf("js-need-data-att-update")){var f=c.attributes["data-tempid"],h=$("#"+b.element.getId()).closest("form");if(f&&h)for(var d=0;d<za.length;d++)if(cleanId=za[d].substring(3).toLowerCase(),inputName="setting["+f+"]["+cleanId+"]",inputValue=($inputElement=h.find('input[name="'+inputName+'"]'))&&$inputElement.is(":enabled")&&$inputElement.val())switch(c.attributes["data-"+cleanId]=inputValue,cleanId){case "size":newImgSrc=c.attributes.src.replace(/&type=[A-Za-z]+/,"")+
"&type="+inputValue;c.attributes.src=newImgSrc;break;case "alignment":c.attributes["class"]=c.attributes["class"].replace("align_left","").replace("align_center","").replace("align_right",""),"none"!==inputValue&&(c.attributes["class"]=c.attributes["class"]+" align_"+inputValue)}c.attributes["class"]=c.attributes["class"].replace("js-need-data-att-update","")}}}})},ua,function(a){function b(l){if(Aa.includes(l.data.keyCode))return G&&(clearTimeout(G),G=0),c(l);G||(G=setTimeout(()=>{c(l)},300))}function c(l){if(!l.data.keyCode)return!0;
var p=l.data.keyCode,t=f(l.editor),u=!0;if(Aa.includes(p))if(p=l.data.keyCode,u=P.autocomplete("widget"),u.is(":visible")){switch(p){case 27:M=!0;k();break;case 13:u.menu("select");break;case 38:u.menu("previous");break;case 40:u.menu("next")}l.cancel();l.stop();u=!1}else u=!0;M&&!t&&(M=!1);G=0;return u}function f(l){if(l.mode&&"source"==l.mode)return!1;var p=d(l),t="";p&&(t=p.tokentext);if(""!=t&&3<=t.length&&t.length<=Z[Q].max){if(t!=P.val())try{n(l,p)}catch(u){return!1}return!0}k();return!1}function h(l,
p,t){var u=-1,I;for(I of p)u=Math.max(u,l.lastIndexOf(I,t));return u}function d(l){var p=l.getSelection();if(!p)return!1;p=p.getRanges();if(0==p.length)return!1;p=p[0];p.collapse(!0);p.setStartAt(l.editable(),g.POSITION_AFTER_START);var t=p.endOffset,u=t,I=new g.dom.walker(p),w=0,z=I.previous();--w;var L=z;if(!z||z.type===g.NODE_COMMENT||z.equals(l.editable()))return!1;l=z.getText();var B=h(l,fa,u);if(-1==B)for(;;){var E=I.previous();--w;if(E&&E.type==g.NODE_TEXT){var N=E.getText();B=h(N,fa);l=N+
l;u+=N.length;if(-1!=B){L=E;break}}else break}if(-1==B||B==l.length-1)return!1;N="[\\s"+String.fromCharCode(8203)+"]";if(0==B&&(E=I.previous(),--w,E)){var J=E.getText();if(""!=J&&!(new RegExp(N+$)).test(J))return!1;E=E.$.tagName.toUpperCase();if("BR"!=E&&"HR"!=E)return!1}if(0<B&&!(new RegExp(N)).test(l[B-1]))return!1;Q=l[B];N=B;for(E=l;;)if(J=I.previous(),--w,J)J&&J.type==g.NODE_TEXT&&(J=J.getText(),E=J+E,N+=J.length);else break;E=E.substr(0,N);N=!1;J={CODE_TAG:0,PHP_TAG:0,HTML_TAG:0};for(var Ka=
/\[(\/?)(noparse|code|php|html)\]/gi,R,ha;R=Ka.exec(E);)if(ha="/"==R[1],R=R[2].toUpperCase(),N)"NOPARSE"==R&&ha&&(N=!1);else switch(R){case "NOPARSE":ha||(N=!0);break;case "CODE":case "PHP":case "HTML":R+="_TAG",ha?0<J[R]&&--J[R]:++J[R]}if(N||0<J.CODE_TAG||0<J.PHP_TAG||0<J.HTML_TAG)return!1;for(;0>w;)I.next(),++w;for(w=z;;)if((z=I.next())&&z.type==g.NODE_TEXT)E=z.getText(),w=z,t=E.length,""!=E&&(l+=E,u+=E.length);else break;p.setStart(L,B);p.setEnd(w,t);t=l.substr(B+1);t=t.substr(0,u-B-1);t=$.trim(t);
return{tokentext:t,range:p}}function n(l,p){function t(E,N){for(var J of E.childNodes){if(J.isEqualNode(N))return J;if(E=t(J,N))return E}return null}if(M)k();else{var u=p.tokentext;p=p.range;var I=p.startContainer,w=p.endContainer;l=X(S(l));var z=I.getParent(),L=z.$.cloneNode(!0);z=z.getDocumentPosition();var B=document.createRange();B.setStart(t(L,I.$),p.startOffset);B.setEnd(t(L,w.$),p.endOffset);B.insertNode($('<span id="vb-get-pos">x</span>').get(0));B=l.find(".cke_wysiwyg_frame").offset();w=
l.offset();I=w.top;w=w.left;L=$("<div />").css({position:"absolute",top:B.top-I+z.y,left:B.left-w.left+z.x,border:"1px solid red",background:"#CCC",zIndex:"999"}).appendTo(l).append(...L.childNodes);z=$("#vb-get-pos",l);l=z.offset();z=z.outerHeight();L.remove();P.css({top:l.top-I+z,left:l.left-w});P.val(u);P.autocomplete("search",u);P.data("range",p)}}function m(l,p){function t(w){p(w);setTimeout(function(){$(".ui-autocomplete",I).find(".ui-menu-item").on("mouseout",()=>!1)},10)}var u=l.term,I=P.closest(".js-content-entry");
K[Q].some(w=>0==u.indexOf(w))?k():u in y[Q]?t(y[Q][u]):q.AJAX({call:Z[Q].fetch,data:{searchStr:u,limitnumber:15},success:function(w){if(Array.isArray(w.suggestions)){var z=[];$.each(w.suggestions,function(L,B){L={label:B.title,value:B.title,userid:B.id};B.hasOwnProperty("id")&&B.id&&(L.id=B.id);B.hasOwnProperty("htmllabel")&&(L.htmllabel=B.htmllabel);z.push(L)});0<z.length?(t(z),y[Q][u]=z):(K[Q].push(u),k())}},error_phrase:"error_getting_suggestions"})}function e(l,p,t){p=t.item.value;t=P.data("range");
l.insertHtml("","html",P.data("range"));var u=Z[Q],I=u.render;a:{for(z in y[Q])for(var w of y[Q][z])if(w.value==p){var z=w.userid;break a}z=!1}I.call(u,l,t,p,z);G=0;k()}function r(l){G=0}function k(){P.val("").autocomplete("close")}function v(l,p,t){t=Y.createFromHtml(t);var u=Y.createFromHtml("&nbsp;");p.insertNode(u);p.insertNode(t);p.moveToElementEditEnd(u);l.getSelection().selectRanges([p]);return t}function F(l,p,t,u){u="c"==u[0]?'data-nodeid="'+u.substring(1)+'"':"";v(l,p,'<a href="#" '+u+'class="b-bbcode__hashtag">'+
t+"</a>&nbsp;")}function D(l,p,t,u){var I=v(l,p,'<a href="#" class="b-bbcode-user js-bbcode-user">'+q.htmlEntities(t)+"</a>");if(A.get("userbbcodeavatar")){function z(L,B,E){B.addClass("b-bbcode-user--has-avatar");$(B.$).css("background-image","url('"+pageData.baseurl_core+"/"+E+"')")}var w="userid_"+u;w in pa?z(l,I,pa[w]):q.AJAX({call:"/ajax/api/user/fetchAvatar",data:{userid:u,thumb:!0},success:function(L){if(L=L.avatarpath)z(l,I,L),pa[w]=L},error_phrase:"error_fetching_avatar"})}}var G=0,y={},
K=[],M=!1,pa={},Z={},fa=[],Q="",Aa=[13,27,38,40],P;(function(l){if(l){var p=JSON.parse(U.bbcode_enabled),t=na(p.user);p=na(p.hashtag);if(t||p){t&&(Z["@"]={fetch:"/ajax/api/user/getAutocomplete",render:D,max:A.get("maxuserlength")});p&&(Z["#"]={fetch:"/create-content/hashtag-autocomplete",render:F,max:256});fa=Object.keys(Z);for(var u of fa)y[u]={},K[u]=[];l.on("key",b,null,null,1);l.document.on("click",function(I){f(l)});t=X(S(l)).css("position","relative");P=$('<input type="text" style="position:absolute;top:0px;left:0px;visibility:hidden;width:1px;height:1px;" />');
P.appendTo(t).autocomplete({appendTo:t,autoFocus:!0,delay:0,minLength:3,source:m,select:e.bind(null,l),close:r}).autocomplete("instance")._renderItem=function(I,w){w=w.hasOwnProperty("htmllabel")?$("<div>").html(w.htmllabel):$("<div>").text(w.label);return $("<li>").append(w).appendTo(I)};l.on("blur",k)}}else console.log("Editor instance in empty")})(a.editor)},function(a){async function b(e,r){try{let {panelitem:k,upload:{filedataid:v,name:F}}=await W.uploadFile(e[1],r),D=ja(v),G='<img class="bbcode-attachment" title="{3}" src="{0}" {1}="{2}" /> '.format(pageData.baseurl+
"/filedata/fetch?filedataid="+v+"&type=full","data-tempid",D,F);k.data("first-insert-id",D);C.updatePanelItemData(k,D,v,F);C.openAttachmentPanel(r);replaceElement(e[0],G)}catch(k){throw replaceElement(e[0],""),k;}}function c(e,r){var k=$(e.editable().$),v=k.clone(!0).removeAttr("id");k.css("opacity",0);e.execCommand("autogrow_disable");k.after(v);var F="zz"+Math.random().toString(36)+"zz";e.insertHtml(r+" "+F);r=e.getData();var D=()=>{v.remove();k.css("opacity","");e.execCommand("autogrow_enable");
e.execCommand("autogrow_ifallowed");n=!1};q.AJAX({call:"/create-content/cleanpastedhtml",data:{nodeid:pageData.nodeid,data:r},success:G=>{var y=e.createRange();y.selectNodeContents(e.editable());y.select();e.insertHtml(G.data);if(G=f(e.editable(),F)){var K=G[0],M=G[1];G=G[2];y=e.createRange();y.setStart(K,M);y.setEnd(K,M+G);y.select();e.insertHtml("&ZeroWidthSpace;")}D()},after_error:D})}function f(e,r){if(3==e.type){var k=e.getText(),v=k.indexOf(r);if(-1==v)return!1;r=r.length;0!=v&&" "==k.charAt(v-
1)&&(v--,r++);return-1!=v?[e,v,r]:!1}if(e.getChildren)for(k of e.getChildren().toArray())if(e=f(k,r))return e;return!1}var h=a.editor,d=g.htmlParser,n=!1,m=e=>{var r=new d.basicWriter;e.writeHtml(r);return r.getHtml()};replaceElement=(e,r)=>e.replaceWith(new d.text(r));wrapElement=(e,r,k)=>replaceElement(e,r+e.getHtml()+k);h.on("paste",e=>{var r=e.data;if(n)r.dataValue="",e.cancel();else{n=!0;var k=r.dataTransfer,v=k.getFilesCount(),F=[];for(var D=0;D<v;D++)k.getFile(D).type.match(RegExp("^image/"))&&
(r.dataValue+='<img style="display:none" src="" data-index="'+D+'" />');D=new d.filter({elements:{pre:y=>{replaceElement(y,y.getHtml().replace(/\r?\n/g,"$&<br>"))},p:y=>{var K="<br>",M="<br>";previous=y.previous;next=y.next;previous&&previous.type==g.NODE_TEXT?K="<br><br>":previous&&previous.type==g.NODE_ELEMENT&&"p"==previous.name||null===previous&&(K="");next&&next.type==g.NODE_TEXT?M="<br><br>":next&&next.type==g.NODE_ELEMENT&&"p"==next.name?M="":null===y.next&&(M="");wrapElement(y,K,M)},div:y=>
{wrapElement(y,"<br>","<br>")},img:y=>{let K=y.attributes.src;if(""==K){let M=y.attributes["data-index"];if(M){F.push([y,k.getFile(M)]);return}}0<v?replaceElement(y,""):K.match(/^data:/)&&F.push([y,K])}}});var G=d.fragment.fromHtml(r.dataValue);G.filter(D);if(0==F.length)D=m(G),D.match(/<[a-z]/i)?(r.dataValue="",e.cancel(),c(h,D)):(r.dataValue=D,n=!1);else{r.dataValue="";e.cancel();let y=X(S(h));Promise.allSettled(F.map(K=>b(K,y))).then(()=>{var K=m(G);c(h,K)})}}})},function(a){ka($(a.editor.container.$))},
function(a){function b(c){var f=null;try{f=c.element.$.children[0]}catch(h){}ma($(f))}a.editor.on("menuShow",function(c){b(c.data[0])});g.ui.on("ready",function(c){b(c.data._.panel)})},function(a){var b=S(a.editor);wa(b);q.Responsive.Debounce.registerCallback(function(){wa(b)})},function(a){if(oa){var b=a.editor;a=S(b);$("#cke_"+a).find(".cke_button__emojipanel").one("click",()=>{b.focus()})}}];for(var La of ca)g.on("instanceReady",La);g.on("dialogDefinition",function(a){var b=a.data;a=b.definition;
switch(b.name){case "table":case "tableProperties":b=a.contents;var c=a.getContents("info");for(f of["txtCaption","txtSummary","selHeaders","txtCellSpace"])c.remove(f);var f=b[0].elements;delete f[1];delete f[2];a.minHeight=200;delete b[1]}a.dialog.on("load",function(){var h=$(this.definition.dialog.parts.dialog.$);h.addClass("ckeditor-dialog");h.find('input[type="text"]').addClass("b-form-input__input b-form-input__input--border-box");h.find(".cke_dialog_ui_button").each((d,n)=>{d=$(n);d.parent().closest(".cke_dialog_ui_button").length||
d.addClass("b-button").addClass(d.is(".cke_dialog_ui_button_ok")?"b-button--primary":"b-button--secondary")});ka(h)});a.dialog.on("show",function(){var h=$(this.definition.dialog.parts.dialog.$);setTimeout(function(){h.find(".cke_pasteframe").addClass("b-editor__pasteframe")},0)})});$.extend(x,{config:V,fixTableFunctionality:ua,autogrowEditorOnImageLoad:va,isEditorEmpty:function(a){a=ra(a);return!1===a||""===a?!0:qa(a)},resetEditor:function(a,b){a=S(a);b=b||function(){};a=T(a);if(!a)return!1;a.setData("",
b)},toggleToolbar:ia,doInitEditor:function(a,b){if(la.mobile&&!la.isCompatible)console.log("Ckeditor: Not supported on this mobile device"),xa(a);else{console.log("Ckeditor: Initializing editor: {0}".format(a));var c=$("#"+a);c.trigger("beforeInit",[a]);if(ea(a))console.log("The editor ({0}) already exists.".format(a));else{var f=c.data("disable-features");if(f)if("all"==f)console.log("Ckeditor: Disabling features: All"),V.toolbar=[];else{f=f.split(",");var h=H["toolbar_"+V.toolbar],d,n;for(d=0;d<
h.length;d++)for(n=0;n<h[d].length;n++){var m=h[d][n];0!=m.length&&"-"!=m&&ya[m]&&0<=jQuery.inArray(ya[m],f)&&(console.log("Ckeditor: Disabling feature: "+m),delete h[d][n])}for(d=0;d<h.length;d++)h[d]=h[d].filter(function(e){return e})}ia(c,!1);c.ckeditor(function(){xa(a);aa[a]=this;Ba(a,this);Ga(a,this);da(a,this);Ca(a,this);Fa(a,this);Da(a,this);try{this._.magiclineBackdoor.that.triggers.h3=1,console.log("Ckeditor: Added h3 to ckeditor magicline triggers.")}catch(e){console.warn("Ckeditor: Unable to add h3 to ckeditor magicline triggers. Error: {0}".format(e))}console.log("Ckeditor: Editor initialized: {0}".format(a));
c.closest("form").attr("ck-editorid",a);c.data("disable-resize")&&Ha(a,this);C.restoreEditorState(a);Ea(a,this,10,100,"hr.previewbreak",function(e,r){c.trigger("afterInit",[e]);x.fireCallbacks(e,b,"success",this)})},V)}}},editorExists:ea,getEditor:T,getContainingEditor:sa,closeFileDialog:function(a,b){var c=T(a);if(c){var f=g.dialog.getCurrent();if("image2"==f.getName())for(var h=0;h<b.length;h++){var d=b[h].url,n=b[h].filedataid,m=b[h].name,e=ja(n);n&&d&&e&&(va(d,c),f.widget.setData("tempid",e),
""!=m&&""==f.getValueOf("info","title")&&(f.widget.setData("title",m),f.setValueOf("info","title",m)),"function"==typeof f.checkUrlSrcAndRemoteCheckbox&&f.checkUrlSrcAndRemoteCheckbox(),d=n,n=$("#"+a).closest("form"),filedataObj={filedataid:d,filename:m||""},C.addAttachmentItemPanel(n,e||"",filedataObj))}}},destroyEditor:function(a){console.log("Ckeditor: Destroying editor: {0}".format(a));a=S(a);if(ea(a)){try{T(a).destroy()}catch(b){}aa[a]=null;ia($("#"+a),!1);return!0}console.warn("Ckeditor: Not destroyed, because editor {0} does not exist.".format(a));
return!1},generateTempAttachmentId:ja,modifyImagePaths:ka})})(CKEDITOR,vBulletin,vBulletin.ckeditor,vBulletin.options,vBulletin.contentEntryBox,vBulletin.upload);
