// WoltLabSmiley.js
$.Redactor.prototype.WoltLabSmiley=function(){"use strict";var t=0;return{init:function(){require(["EventHandler"],function(t){t.add("com.woltlab.wcf.redactor2","insertSmiley_"+this.$element[0].id,this.WoltLabSmiley._insert.bind(this))}.bind(this))},_insert:function(i){if(!this.WoltLabSource.isActive()){this.buffer.set();var e="wscSmiley_"+this.uuid+"_"+t++,r=i.img.cloneNode();r.id=e,this.insert.html(r.outerHTML),r=elById(e),r.outerHTML=r.outerHTML}}}};
// WoltLabSource.js
-$.Redactor.prototype.WoltLabSource=function(){"use strict";return{init:function(){this.source.setCaretOnShow=function(){},this.source.setCaretOnHide=function(e){return e};var e=this.source.hide;this.source.hide=function(){e.call(this),setTimeout(this.focus.end.bind(this),100),this.placeholder.enable()}.bind(this);var t=this.source.$textarea[0];this.$element[0].parentNode.insertBefore(t,this.$element[0]);var i=this.source.show;this.source.show=function(){var e=this.$editor[0].offsetHeight;i.call(this),t.style.setProperty("height",Math.ceil(e)+"px",""),t.style.setProperty("display","block",""),t.value=this.WoltLabSource.format(t.value),t.selectionStart=t.selectionEnd=t.value.length}.bind(this),WCF.System.Event.addListener("com.woltlab.wcf.redactor2","validate_"+this.$element[0].id,function(e){t.clientHeight&&(e.api.throwError(this.$element[0],WCF.Language.get("wcf.editor.source.error.active")),e.valid=!1)}.bind(this))},isActive:function(){return"none"===this.$editor[0].style.getPropertyValue("display")},format:function(e){var t=this.block.tags.join("|").toLowerCase();return t+="|ul|ol|li",e=e.replace(new RegExp("<("+t+")([^>]*)>s*","g"),"<$1$2>\n "),e=e.replace(new RegExp("s*</("+t+")>","g"),"\n</$1>"),e=e.replace(/\s*<li>/g,"\n<li>"),e=e.replace(/<\/li>\s*/g,"</li>\n"),e=e.replace(/<li>([\s\S]*?)<\/li>/g,function(e,t){var i=t.trim().split("\n");return"<li>\n "+i.join("\n ")+"\n</li>"}),e=e.replace(/\s*<\/p>\s*/g,"\n</p>\n"),e=e.replace(/<p>\s*<br>\s*<\/p>/g,"<p><br></p>"),e.replace(/^\s+/,"")}}};
+$.Redactor.prototype.WoltLabSource=function(){"use strict";return{init:function(){this.source.setCaretOnShow=function(){},this.source.setCaretOnHide=function(e){return e};var e=this.source.hide;this.source.hide=function(){e.call(this),setTimeout(this.focus.end.bind(this),100),this.placeholder.enable()}.bind(this);var t=this.source.$textarea[0];this.$element[0].parentNode.insertBefore(t,this.$element[0]);var r=this.source.show;this.source.show=function(){var e=this.$editor[0].offsetHeight;r.call(this),t.style.setProperty("height",Math.ceil(e)+"px",""),t.style.setProperty("display","block",""),t.value=this.WoltLabSource.format(t.value),t.selectionStart=t.selectionEnd=t.value.length}.bind(this),WCF.System.Event.addListener("com.woltlab.wcf.redactor2","validate_"+this.$element[0].id,function(e){t.clientHeight&&(e.api.throwError(this.$element[0],WCF.Language.get("wcf.editor.source.error.active")),e.valid=!1)}.bind(this))},isActive:function(){return"none"===this.$editor[0].style.getPropertyValue("display")},format:function(e){var t=this.block.tags.join("|").toLowerCase();t+="|ul|ol|li";var r="[^'\">]*(?:(?:\"[^\"]*\"|'[^']*')[^'\">]*)*",i=[];e=e.replace(new RegExp("<pre"+r+">[sS]*?</pre>","g"),function(e){return i.push(e),"@@@WCF_PRE_BACKUP_"+(i.length-1)+"@@@"}),e=e.replace(new RegExp("\\s*</("+t+")("+r+")>\\s*","g"),"\n</$1$2>"),e=e.replace(new RegExp("\\s*<("+t+")("+r+")>\\s*","g"),"\n<$1$2>\n"),e=e.replace(new RegExp("<(ol|ul)("+r+")>\\s*","g"),"<$1$2>\n");var n,s,o,a=e.split(/\n/),l=0,c=new RegExp("^<(?:"+t+")"),h=new RegExp("^</(?:"+t+")>$"),u=!1;for(n=0,s=a.length;s>n;n++){if(o=a[n],u=!1,o.match(c)?u=!0:o.match(h)&&l--,l>0){var p=l;for(a[n]="";p--;)a[n]+=" ";a[n]+=o}u&&l++}for(e=a.join("\n"),n=0,s=i.length;s>n;n++)e=e.replace("@@@WCF_PRE_BACKUP_"+n+"@@@",i[n]);return e.trim()}}};
// WoltLabSpoiler.js
$.Redactor.prototype.WoltLabSpoiler=function(){"use strict";return{init:function(){this.WoltLabBlock.register("woltlab-spoiler",!0),this.opts.activeButtonsStates["woltlab-spoiler"]="woltlabSpoiler",require(["WoltLabSuite/Core/Ui/Redactor/Spoiler"],function(t){new t(this)}.bind(this))}}};
// WoltLabUtils.js