Updating minified JavaScript files
authorwoltlab.com <woltlab@woltlab.com>
Wed, 25 May 2016 08:31:14 +0000 (10:31 +0200)
committerwoltlab.com <woltlab@woltlab.com>
Wed, 25 May 2016 08:31:14 +0000 (10:31 +0200)
wcfsetup/install/files/js/WCF.Combined.min.js
wcfsetup/install/files/js/WCF.Core.min.js

index 6789a7b3c7a0e9ed13c945f09101ceeb9799bbd7..1cbe889c83df6cfd883629d5577be18b497ffd07 100755 (executable)
@@ -76,7 +76,7 @@ for(var e=this._fileUpload.prop("files"),t=0,i=e.length;i>t;t++){var n=e[t],a=ne
 (function (window, undefined) {"use strict";WCF.ACL={},WCF.ACL.List=Class.extend({_categoryName:"",_container:null,_containerElements:{},_objectID:0,_objectTypeID:null,_options:{},_proxy:null,_search:null,_values:{group:{},user:{}},init:function(e,t,n,i,a,s){this._objectID=i||0,this._objectTypeID=t,this._categoryName=n,void 0===a&&(a=!0),this._values={group:{},user:{}},this._proxy=new WCF.Action.Proxy({showLoadingOverlay:!1,success:$.proxy(this._success,this)}),this._container=$(e).hide().addClass("aclContainer");var r=this._container.children("dd"),c=$('<ul class="aclList containerList" />').appendTo(r),l=$('<input type="text" class="long" placeholder="'+WCF.Language.get("wcf.acl.search."+(a?"":"user.")+"description")+'" />').appendTo(r),o=$('<ul class="aclPermissionList containerList" />').hide().appendTo(r);this._containerElements={aclList:c,denyAll:null,grantAll:null,permissionList:o,searchInput:l},this._search=new WCF.Search.User(l,$.proxy(this.addObject,this),a);var h=this._container.parents("form:eq(0)");h.submit($.proxy(this.submit,this));var p=h.find("input[type=reset]:eq(0)");p.length&&p.click($.proxy(this._reset,this)),s?this._success(s):this._loadACL()},_reset:function(){this._values={group:{},user:{}},this._containerElements.aclList.empty(),this._containerElements.searchInput.val(""),this._containerElements.permissionList.hide().find("input[type=checkbox]").prop("checked",!1)},_loadACL:function(){this._proxy.setOption("data",{actionName:"loadAll",className:"wcf\\data\\acl\\option\\ACLOptionAction",parameters:{categoryName:this._categoryName,objectID:this._objectID,objectTypeID:this._objectTypeID}}),this._proxy.sendRequest()},addObject:function(e){var t=this._createListItem(e.objectID,e.label,e.type);this._savePermissions(),this._containerElements.aclList.children("li").removeClass("active"),t.addClass("active"),this._search.addExcludedSearchValue(e.label),this._containerElements.permissionList.find("input[type=checkbox]").prop("checked",!1),this._containerElements.searchInput.val(""),this._containerElements.permissionList.show(),WCF.DOMNodeInsertedHandler.execute()},_createListItem:function(e,t,n){var i=$('<li><span class="icon icon16 fa-user'+("group"===n?"s":"")+'" /> <span class="aclLabel">'+t+"</span></li>").appendTo(this._containerElements.aclList);return i.data("objectID",e).data("type",n).data("label",t).click($.proxy(this._click,this)),$('<span class="icon icon16 fa-times jsTooltip pointer" title="'+WCF.Language.get("wcf.global.button.delete")+'" />').click($.proxy(this._removeItem,this)).appendTo(i),i},_removeItem:function(e){var t=$(e.currentTarget).parent(),n=t.data("type"),i=t.data("objectID");this._search.removeExcludedSearchValue(t.data("label")),t.remove(),this._values[n][i]&&delete this._values[n][i],this._selectFirstEntry()},_selectFirstEntry:function(){var e=this._containerElements.aclList.children("li:eq(0)");e.length?this._select(e,!1):this._reset()},_success:function(e){if($.getLength(e.returnValues.options)){var t=0,n={};for(var i in e.returnValues.options){var a=e.returnValues.options[i],s=$("<li><span>"+a.label+"</span></li>").data("optionID",i).data("optionName",a.optionName),r=$('<input type="checkbox" id="grant'+i+'" />').appendTo(s).wrap('<label for="grant'+i+'" class="jsTooltip" title="'+WCF.Language.get("wcf.acl.option.grant")+'" />'),c=$('<input type="checkbox" id="deny'+i+'" />').appendTo(s).wrap('<label for="deny'+i+'" class="jsTooltip" title="'+WCF.Language.get("wcf.acl.option.deny")+'" />');r.data("type","grant").data("optionID",i).change($.proxy(this._change,this)),c.data("type","deny").data("optionID",i).change($.proxy(this._change,this)),n[a.categoryName]||(n[a.categoryName]=[]),""===a.categoryName?s.appendTo(this._containerElements.permissionList):n[a.categoryName].push(s),t++}if(t>1){var s=$('<li class="aclFullAccess"><span>'+WCF.Language.get("wcf.acl.option.fullAccess")+"</span></li>").prependTo(this._containerElements.permissionList);this._containerElements.grantAll=$('<input type="checkbox" id="grantAll_'+this._container.attr("id")+'" />').appendTo(s).wrap('<label class="jsTooltip" title="'+WCF.Language.get("wcf.acl.option.grant")+'" />'),this._containerElements.denyAll=$('<input type="checkbox" id="denyAll_'+this._container.attr("id")+'" />').appendTo(s).wrap('<label class="jsTooltip" title="'+WCF.Language.get("wcf.acl.option.deny")+'" />'),this._containerElements.grantAll.data("type","grant").change($.proxy(this._changeAll,this)),this._containerElements.denyAll.data("type","deny").change($.proxy(this._changeAll,this))}if($.getLength(n))for(var l in n){var o=n[l];e.returnValues.categories[l]&&$('<li class="aclCategory">'+e.returnValues.categories[l]+"</li>").appendTo(this._containerElements.permissionList);for(var h=0,p=o.length;p>h;h++)o[h].appendTo(this._containerElements.permissionList)}this._parseData(e,"group"),this._parseData(e,"user"),this._container.show(),this._selectFirstEntry()}},_parseData:function(e,t){if($.getLength(e.returnValues[t].option)){for(var n in e.returnValues[t].label)this._createListItem(n,e.returnValues[t].label[n],t),this._search.addExcludedSearchValue(e.returnValues[t].label[n]);this._values[t]=e.returnValues[t].option,WCF.DOMNodeInsertedHandler.execute()}},_click:function(e){var t=$(e.currentTarget);t.hasClass("active")||this._select(t,!0)},_select:function(e,t){t&&this._savePermissions(),this._containerElements.aclList.children("li").removeClass("active"),e.addClass("active"),this._setupPermissions(e.data("type"),e.data("objectID"))},_change:function(e){var t=$(e.currentTarget),n=t.data("optionID"),i=t.data("type");t.is(":checked")?"deny"===i?($("#grant"+n).prop("checked",!1),null!==this._containerElements.grantAll&&this._containerElements.grantAll.prop("checked",!1)):($("#deny"+n).prop("checked",!1),null!==this._containerElements.denyAll&&this._containerElements.denyAll.prop("checked",!1)):"deny"===i&&null!==this._containerElements.denyAll?this._containerElements.denyAll.prop("checked",!1):"grant"===i&&null!==this._containerElements.grantAll&&this._containerElements.grantAll.prop("checked",!1);var a=!0;this._containerElements.permissionList.find("input[type=checkbox]").each($.proxy(function(e,t){var n=$(t);return n.data("type")!==i||n.attr("id")===i+"All_"+this._container.attr("id")||n.is(":checked")?void 0:(a=!1,!1)},this)),"deny"==i?null!==this._containerElements.denyAll&&(a?this._containerElements.denyAll.prop("checked",!0):this._containerElements.denyAll.prop("checked",!1)):null!==this._containerElements.grantAll&&(a?this._containerElements.grantAll.prop("checked",!0):this._containerElements.grantAll.prop("checked",!1))},_changeAll:function(e){var t=$(e.currentTarget),n=t.data("type");t.is(":checked")?"deny"===n?(this._containerElements.grantAll.prop("checked",!1),this._containerElements.permissionList.find("input[type=checkbox]").each($.proxy(function(e,t){var n=$(t);"deny"===n.data("type")&&n.attr("id")!=="denyAll_"+this._container.attr("id")&&n.prop("checked",!0).trigger("change")},this))):(this._containerElements.denyAll.prop("checked",!1),this._containerElements.permissionList.find("input[type=checkbox]").each($.proxy(function(e,t){var n=$(t);"grant"===n.data("type")&&n.attr("id")!=="grantAll_"+this._container.attr("id")&&n.prop("checked",!0).trigger("change")},this))):"deny"===n?(this._containerElements.grantAll.prop("checked",!1),this._containerElements.permissionList.find("input[type=checkbox]").each($.proxy(function(e,t){var n=$(t);"deny"===n.data("type")&&n.attr("id")!=="denyAll_"+this._container.attr("id")&&n.prop("checked",!1).trigger("change")},this))):(this._containerElements.denyAll.prop("checked",!1),this._containerElements.permissionList.find("input[type=checkbox]").each($.proxy(function(e,t){var n=$(t);"grant"===n.data("type")&&n.attr("id")!=="grantAll_"+this._container.attr("id")&&n.prop("checked",!1).trigger("change")},this)))},_setupPermissions:function(e,t){if(this._containerElements.permissionList.find("input[type='checkbox']").prop("checked",!1),this._values[e]&&this._values[e][t])for(var n in this._values[e][t])1==this._values[e][t][n]?$("#grant"+n).prop("checked",!0).trigger("change"):$("#deny"+n).prop("checked",!0).trigger("change");this._containerElements.permissionList.show()},_savePermissions:function(){var e=this._containerElements.aclList.find("li.active");if(e.length){var t=e.data("objectID"),n=e.data("type");this._values[n][t]={},this._containerElements.permissionList.find("input[type='checkbox']").each(function(e,i){var a=$(i);if(a.attr("id")!="grantAll_"+this._container.attr("id")&&a.attr("id")!="denyAll_"+this._container.attr("id")){var s="deny"===a.data("type")?0:1,r=a.data("optionID");a.is(":checked")?(this._values[n][t][r]=s,a.prop("checked",!1)):this._values[n]&&this._values[n][t]&&this._values[n][t][r]&&this._values[n][t][r]==s&&delete this._values[n][t][r]}}.bind(this))}},submit:function(){this._savePermissions(),this._save("group"),this._save("user")},_save:function(e){if($.getLength(this._values[e])){var t=this._container.parents("form:eq(0)");for(var n in this._values[e]){var i=this._values[e][n];for(var a in i)$('<input type="hidden" name="aclValues['+e+"]["+n+"]["+a+']" value="'+i[a]+'" />').appendTo(t)}}}}); })(this);
 
 // WCF.Attachment.js
-(function (window, undefined) {"use strict";WCF.Attachment={},WCF.Attachment.Upload=WCF.Upload.extend({_autoInsert:[],_insertAllButton:null,_objectType:"",_objectID:0,_tmpHash:"",_parentObjectID:0,_wysiwygContainerID:"",init:function(t,e,a,i,s,n,r,l){this._super(t,e,"wcf\\data\\attachment\\AttachmentAction",{multiple:!0,maxUploads:r}),this._autoInsert=[],this._objectType=a,this._objectID=parseInt(i),this._tmpHash=s,this._parentObjectID=parseInt(n),this._wysiwygContainerID=l,this._buttonSelector.children("p.button").click($.proxy(this._validateLimit,this)),this._fileListSelector.find(".jsButtonInsertAttachment").click($.proxy(this._insert,this)),this._fileListSelector.find(".jsButtonAttachmentInsertThumbnail").click($.proxy(this._insert,this)),this._fileListSelector.find(".jsButtonAttachmentInsertFull").click($.proxy(this._insert,this)),WCF.System.Event.addListener("com.woltlab.wcf.action.delete","attachment_"+this._wysiwygContainerID,$.proxy(this._removeLimitError,this)),this._makeSortable(),this._insertAllButton=$('<p class="button jsButtonAttachmentInsertAll">'+WCF.Language.get("wcf.attachment.insertAll")+"</p>").hide().appendTo(this._buttonSelector),this._insertAllButton.click($.proxy(this._insertAll,this)),this._fileListSelector.children("li:not(.uploadFailed)").length&&this._insertAllButton.show(),this._wysiwygContainerID&&(WCF.System.Event.addListener("com.woltlab.wcf.messageOptionsInline","submit_"+this._wysiwygContainerID,$.proxy(this._submitInline,this)),WCF.System.Event.addListener("com.woltlab.wcf.messageOptionsInline","prepareExtended_"+this._wysiwygContainerID,$.proxy(this._prepareExtended,this)),WCF.System.Event.addListener("com.woltlab.wcf.redactor","reset",$.proxy(this._reset,this)),WCF.System.Event.addListener("com.woltlab.wcf.redactor","upload_"+this._wysiwygContainerID,$.proxy(this._editorUpload,this)),WCF.System.Event.addListener("com.woltlab.wcf.redactor","getImageAttachments_"+this._wysiwygContainerID,$.proxy(this._getImageAttachments,this)))},_editorUpload:function(t){var e;this._fileListSelector.closest(".messageTabMenu").messageTabMenu("showTab","attachments",!0),e=t.file?this._upload(void 0,t.file):this._upload(void 0,void 0,t.blob),this._autoInsert.push(e),t.uploadID=e},_getImageAttachments:function(t){this._fileListSelector.children("li").each(function(e,a){var i=$(a);i.children("img.attachmentTinyThumbnail").length&&(t.imageAttachments[parseInt(i.data("objectID"))]={height:parseInt(i.data("height")),width:parseInt(i.data("width"))})})},_submitInline:function(t){this._tmpHash&&(t.tmpHash=this._tmpHash)},_prepareExtended:function(t){!this._objectID&&this._tmpHash&&this._fileListSelector.children("li:not(.uploadFailed)").length&&(t.tmpHash=this._tmpHash)},_reset:function(){this._fileListSelector.hide().empty(),this._insertAllButton.hide(),this._validateLimit()},_validateLimit:function(){var t=this._buttonSelector.next("small.innerError"),e=this._options.maxUploads-this._fileListSelector.children("li:not(.uploadFailed)").length,a=this._fileUpload?this._fileUpload.prop("files").length:0;if(0>=e||a>e){var i=0>=e?WCF.Language.get("wcf.attachment.upload.error.reachedLimit"):WCF.Language.get("wcf.attachment.upload.error.reachedRemainingLimit").replace(/#remaining#/,e);return t.length||(t=$('<small class="innerError" />').insertAfter(this._buttonSelector)),t.html(i),!1}return t.remove(),!0},_removeLimitError:function(t){var e=this._fileListSelector.children("li");e.filter(":not(.uploadFailed)").length||this._insertAllButton.hide(),e.length||setTimeout(function(){this._fileListSelector.wcfBlindOut()}.bind(this),250),this._wysiwygContainerID&&$("#"+this._wysiwygContainerID).redactor("wbbcode.removeAttachment",t.button.data("objectID"))},_upload:function(t,e,a){var i=void 0;return this._validateLimit()&&(i=this._super(t,e,a)),this._fileUpload&&(this._removeButton(),this._createButton()),i},_createUploadMatrix:function(t){return this._fileListSelector.children("li.uploadFailed").remove(),this._super(t)},_getParameters:function(){return{objectType:this._objectType,objectID:this._objectID,tmpHash:this._tmpHash,parentObjectID:this._parentObjectID}},_initFile:function(t){var e=$('<li class="box64"><span class="icon icon48 fa-spinner" /><div><div><p>'+t.name+'</p><small><progress max="100"></progress></small></div><ul></ul></div></li>').data("filename",t.name);return this._fileListSelector.append(e),this._fileListSelector.show(),this._buttonSelector.data("maxSize")<t.size&&(e.find("progress").remove(),e.children(".fa-spinner").removeClass("fa-spinner").addClass("fa-ban"),e.find("div > div").append($('<small class="innerError">'+WCF.Language.get("wcf.attachment.upload.error.tooLarge")+"</small>")),e.addClass("uploadFailed")),e},_success:function(t,e){for(var a in this._uploadMatrix[t]){var i=this._uploadMatrix[t][a];i.find("progress").remove();var s=i.data("filename"),n=i.data("internalFileID");if(e.returnValues&&e.returnValues.attachments[n]){e.returnValues.attachments[n].tinyURL?(i.children(".fa-spinner").replaceWith($('<img src="'+e.returnValues.attachments[n].tinyURL+'" alt="" class="attachmentTinyThumbnail" />')),i.data("height",e.returnValues.attachments[n].height),i.data("width",e.returnValues.attachments[n].width)):i.children(".fa-spinner").removeClass("fa-spinner").addClass("fa-paperclip");var r=$('<a href=""></a>');r.text(s).attr("href",e.returnValues.attachments[n].url),0!=e.returnValues.attachments[n].isImage&&r.addClass("jsImageViewer").attr("title",s),i.find("p").empty().append(r),i.find("small").append(e.returnValues.attachments[n].formattedFilesize);var l=i.find("ul").addClass("buttonGroup"),o=$('<li><span class="button small jsDeleteButton" data-object-id="'+e.returnValues.attachments[n].attachmentID+'" data-confirm-message="'+WCF.Language.get("wcf.attachment.delete.sure")+'" data-event-name="attachment_'+this._wysiwygContainerID+'">'+WCF.Language.get("wcf.global.button.delete")+"</span></li>");if(l.append(o),i.data("objectID",e.returnValues.attachments[n].attachmentID),this._wysiwygContainerID)if(e.returnValues.attachments[n].tinyURL){var h=$('<li><span class="button small jsButtonAttachmentInsertThumbnail" data-object-id="'+e.returnValues.attachments[n].attachmentID+'">'+WCF.Language.get("wcf.attachment.insertThumbnail")+"</span></li>").appendTo(l),c=$('<li><span class="button small jsButtonAttachmentInsertFull" data-object-id="'+e.returnValues.attachments[n].attachmentID+'">'+WCF.Language.get("wcf.attachment.insertFull")+"</span></li>").appendTo(l);h.children("span.button").click($.proxy(this._insert,this)),c.children("span.button").click($.proxy(this._insert,this))}else{var d=$('<li><span class="button small jsButtonAttachmentInsertPlain" data-object-id="'+e.returnValues.attachments[n].attachmentID+'">'+WCF.Language.get("wcf.attachment.insert")+"</span></li>");d.appendTo(l).children("span.button").click($.proxy(this._insert,this))}}else{i.children(".fa-spinner").removeClass("fa-spinner").addClass("fa-ban");var u="";u=e.returnValues&&e.returnValues.errors[n]?e.returnValues.errors[n].errorType:"uploadFailed",i.find("div > div").append($('<small class="innerError">'+WCF.Language.get("wcf.attachment.upload.error."+u)+"</small>")),i.addClass("uploadFailed")}i.css("display","block"),WCF.inArray(t,this._autoInsert)&&(this._autoInsert.splice(this._autoInsert.indexOf(t),1),i.hasClass("uploadFailed")||WCF.System.Event.fireEvent("com.woltlab.wcf.attachment","autoInsert_"+this._wysiwygContainerID,{attachment:"[attach="+e.returnValues.attachments[n].attachmentID+"][/attach]",uploadID:t}))}this._makeSortable(),this._fileListSelector.children("li:not(.uploadFailed)").length?this._insertAllButton.show():this._insertAllButton.hide(),WCF.DOMNodeInsertedHandler.execute()},_insert:function(t,e){var a=null===t?e:$(t.currentTarget).data("objectID"),i=null!==t?$(t.currentTarget).hasClass("jsButtonAttachmentInsertFull"):!1;$.browser.redactor&&$("#"+this._wysiwygContainerID).redactor("wbbcode.insertAttachment",a,i)},_insertAll:function(){this._fileListSelector.children("li:not(.uploadFailed)").each($.proxy(function(t,e){this._insert(null,$(e).data("objectID"))},this))},_error:function(t){this._fileListSelector.find("li").each(function(e,a){var i=$(a);i.children(".fa-spinner").length&&(i.addClass("uploadFailed").children(".fa-spinner").removeClass("fa-spinner").addClass("fa-ban"),i.find("div > div").append($('<small class="innerError">'+(t.responseJSON&&t.responseJSON.message?t.responseJSON.message:WCF.Language.get("wcf.attachment.upload.error.uploadFailed"))+"</small>")))})},_makeSortable:function(){var t=this._fileListSelector.children("li:not(.uploadFailed)");if(t.length&&(t.addClass("sortableAttachment").children("img").addClass("sortableNode"),!this._fileListSelector.hasClass("sortableList"))){this._fileListSelector.addClass("sortableList");var e=this;new WCF.Sortable.List(this._fileListSelector.parent().wcfIdentify(),"",0,{axis:!1,items:"li.sortableAttachment",toleranceElement:null,update:function(){var t=[];e._fileListSelector.children("li:not(.uploadFailed)").each(function(e,a){t.push($(a).data("objectID"))}),t.length&&new WCF.Action.Proxy({autoSend:!0,data:{actionName:"updatePosition",className:"wcf\\data\\attachment\\AttachmentAction",parameters:{attachmentIDs:t,objectID:e._objectID,objectType:e._objectType,tmpHash:e._tmpHash}}})}},!0)}}}); })(this);
+(function (window, undefined) {"use strict";WCF.Attachment={},WCF.Attachment.Upload=WCF.Upload.extend({_autoInsert:[],_insertAllButton:null,_objectType:"",_objectID:0,_tmpHash:"",_parentObjectID:0,_wysiwygContainerID:"",init:function(t,e,a,i,s,n,r,l){this._super(t,e,"wcf\\data\\attachment\\AttachmentAction",{multiple:!0,maxUploads:r}),this._autoInsert=[],this._objectType=a,this._objectID=parseInt(i),this._tmpHash=s,this._parentObjectID=parseInt(n),this._wysiwygContainerID=l,this._buttonSelector.children("p.button").click($.proxy(this._validateLimit,this)),this._fileListSelector.find(".jsButtonInsertAttachment").click($.proxy(this._insert,this)),this._fileListSelector.find(".jsButtonAttachmentInsertThumbnail").click($.proxy(this._insert,this)),this._fileListSelector.find(".jsButtonAttachmentInsertFull").click($.proxy(this._insert,this)),WCF.System.Event.addListener("com.woltlab.wcf.action.delete","attachment_"+this._wysiwygContainerID,$.proxy(this._removeLimitError,this)),this._makeSortable(),this._insertAllButton=$('<p class="button jsButtonAttachmentInsertAll">'+WCF.Language.get("wcf.attachment.insertAll")+"</p>").hide().appendTo(this._buttonSelector),this._insertAllButton.click($.proxy(this._insertAll,this)),this._fileListSelector.children("li:not(.uploadFailed)").length&&this._insertAllButton.show(),this._wysiwygContainerID&&(WCF.System.Event.addListener("com.woltlab.wcf.redactor2","submit_"+this._wysiwygContainerID,$.proxy(this._submitInline,this)),WCF.System.Event.addListener("com.woltlab.wcf.messageOptionsInline","prepareExtended_"+this._wysiwygContainerID,$.proxy(this._prepareExtended,this)),WCF.System.Event.addListener("com.woltlab.wcf.redactor2","reset",$.proxy(this._reset,this)),WCF.System.Event.addListener("com.woltlab.wcf.redactor","upload_"+this._wysiwygContainerID,$.proxy(this._editorUpload,this)),WCF.System.Event.addListener("com.woltlab.wcf.redactor","getImageAttachments_"+this._wysiwygContainerID,$.proxy(this._getImageAttachments,this)))},_editorUpload:function(t){var e;this._fileListSelector.closest(".messageTabMenu").messageTabMenu("showTab","attachments",!0),e=t.file?this._upload(void 0,t.file):this._upload(void 0,void 0,t.blob),this._autoInsert.push(e),t.uploadID=e},_getImageAttachments:function(t){this._fileListSelector.children("li").each(function(e,a){var i=$(a);i.children("img.attachmentTinyThumbnail").length&&(t.imageAttachments[parseInt(i.data("objectID"))]={height:parseInt(i.data("height")),width:parseInt(i.data("width"))})})},_submitInline:function(t){this._tmpHash&&(t.tmpHash=this._tmpHash)},_prepareExtended:function(t){!this._objectID&&this._tmpHash&&this._fileListSelector.children("li:not(.uploadFailed)").length&&(t.tmpHash=this._tmpHash)},_reset:function(){this._fileListSelector.hide().empty(),this._insertAllButton.hide(),this._validateLimit()},_validateLimit:function(){var t=this._buttonSelector.next("small.innerError"),e=this._options.maxUploads-this._fileListSelector.children("li:not(.uploadFailed)").length,a=this._fileUpload?this._fileUpload.prop("files").length:0;if(0>=e||a>e){var i=0>=e?WCF.Language.get("wcf.attachment.upload.error.reachedLimit"):WCF.Language.get("wcf.attachment.upload.error.reachedRemainingLimit").replace(/#remaining#/,e);return t.length||(t=$('<small class="innerError" />').insertAfter(this._buttonSelector)),t.html(i),!1}return t.remove(),!0},_removeLimitError:function(t){var e=this._fileListSelector.children("li");e.filter(":not(.uploadFailed)").length||this._insertAllButton.hide(),e.length||setTimeout(function(){this._fileListSelector.wcfBlindOut()}.bind(this),250),this._wysiwygContainerID&&$("#"+this._wysiwygContainerID).redactor("wbbcode.removeAttachment",t.button.data("objectID"))},_upload:function(t,e,a){var i=void 0;return this._validateLimit()&&(i=this._super(t,e,a)),this._fileUpload&&(this._removeButton(),this._createButton()),i},_createUploadMatrix:function(t){return this._fileListSelector.children("li.uploadFailed").remove(),this._super(t)},_getParameters:function(){return{objectType:this._objectType,objectID:this._objectID,tmpHash:this._tmpHash,parentObjectID:this._parentObjectID}},_initFile:function(t){var e=$('<li class="box64"><span class="icon icon48 fa-spinner" /><div><div><p>'+t.name+'</p><small><progress max="100"></progress></small></div><ul></ul></div></li>').data("filename",t.name);return this._fileListSelector.append(e),this._fileListSelector.show(),this._buttonSelector.data("maxSize")<t.size&&(e.find("progress").remove(),e.children(".fa-spinner").removeClass("fa-spinner").addClass("fa-ban"),e.find("div > div").append($('<small class="innerError">'+WCF.Language.get("wcf.attachment.upload.error.tooLarge")+"</small>")),e.addClass("uploadFailed")),e},_success:function(t,e){for(var a in this._uploadMatrix[t]){var i=this._uploadMatrix[t][a];i.find("progress").remove();var s=i.data("filename"),n=i.data("internalFileID");if(e.returnValues&&e.returnValues.attachments[n]){e.returnValues.attachments[n].tinyURL?(i.children(".fa-spinner").replaceWith($('<img src="'+e.returnValues.attachments[n].tinyURL+'" alt="" class="attachmentTinyThumbnail" />')),i.data("height",e.returnValues.attachments[n].height),i.data("width",e.returnValues.attachments[n].width)):i.children(".fa-spinner").removeClass("fa-spinner").addClass("fa-paperclip");var r=$('<a href=""></a>');r.text(s).attr("href",e.returnValues.attachments[n].url),0!=e.returnValues.attachments[n].isImage&&r.addClass("jsImageViewer").attr("title",s),i.find("p").empty().append(r),i.find("small").append(e.returnValues.attachments[n].formattedFilesize);var l=i.find("ul").addClass("buttonGroup"),o=$('<li><span class="button small jsDeleteButton" data-object-id="'+e.returnValues.attachments[n].attachmentID+'" data-confirm-message="'+WCF.Language.get("wcf.attachment.delete.sure")+'" data-event-name="attachment_'+this._wysiwygContainerID+'">'+WCF.Language.get("wcf.global.button.delete")+"</span></li>");if(l.append(o),i.data("objectID",e.returnValues.attachments[n].attachmentID),this._wysiwygContainerID)if(e.returnValues.attachments[n].tinyURL){var h=$('<li><span class="button small jsButtonAttachmentInsertThumbnail" data-object-id="'+e.returnValues.attachments[n].attachmentID+'">'+WCF.Language.get("wcf.attachment.insertThumbnail")+"</span></li>").appendTo(l),c=$('<li><span class="button small jsButtonAttachmentInsertFull" data-object-id="'+e.returnValues.attachments[n].attachmentID+'">'+WCF.Language.get("wcf.attachment.insertFull")+"</span></li>").appendTo(l);h.children("span.button").click($.proxy(this._insert,this)),c.children("span.button").click($.proxy(this._insert,this))}else{var d=$('<li><span class="button small jsButtonAttachmentInsertPlain" data-object-id="'+e.returnValues.attachments[n].attachmentID+'">'+WCF.Language.get("wcf.attachment.insert")+"</span></li>");d.appendTo(l).children("span.button").click($.proxy(this._insert,this))}}else{i.children(".fa-spinner").removeClass("fa-spinner").addClass("fa-ban");var u="";u=e.returnValues&&e.returnValues.errors[n]?e.returnValues.errors[n].errorType:"uploadFailed",i.find("div > div").append($('<small class="innerError">'+WCF.Language.get("wcf.attachment.upload.error."+u)+"</small>")),i.addClass("uploadFailed")}i.css("display","block"),WCF.inArray(t,this._autoInsert)&&(this._autoInsert.splice(this._autoInsert.indexOf(t),1),i.hasClass("uploadFailed")||WCF.System.Event.fireEvent("com.woltlab.wcf.attachment","autoInsert_"+this._wysiwygContainerID,{attachment:"[attach="+e.returnValues.attachments[n].attachmentID+"][/attach]",uploadID:t}))}this._makeSortable(),this._fileListSelector.children("li:not(.uploadFailed)").length?this._insertAllButton.show():this._insertAllButton.hide(),WCF.DOMNodeInsertedHandler.execute()},_insert:function(t,e){var a=null===t?e:$(t.currentTarget).data("objectID"),i=null!==t?$(t.currentTarget).hasClass("jsButtonAttachmentInsertFull"):!1;$.browser.redactor&&$("#"+this._wysiwygContainerID).redactor("wbbcode.insertAttachment",a,i)},_insertAll:function(){this._fileListSelector.children("li:not(.uploadFailed)").each($.proxy(function(t,e){this._insert(null,$(e).data("objectID"))},this))},_error:function(t){this._fileListSelector.find("li").each(function(e,a){var i=$(a);i.children(".fa-spinner").length&&(i.addClass("uploadFailed").children(".fa-spinner").removeClass("fa-spinner").addClass("fa-ban"),i.find("div > div").append($('<small class="innerError">'+(t.responseJSON&&t.responseJSON.message?t.responseJSON.message:WCF.Language.get("wcf.attachment.upload.error.uploadFailed"))+"</small>")))})},_makeSortable:function(){var t=this._fileListSelector.children("li:not(.uploadFailed)");if(t.length&&(t.addClass("sortableAttachment").children("img").addClass("sortableNode"),!this._fileListSelector.hasClass("sortableList"))){this._fileListSelector.addClass("sortableList");var e=this;new WCF.Sortable.List(this._fileListSelector.parent().wcfIdentify(),"",0,{axis:!1,items:"li.sortableAttachment",toleranceElement:null,update:function(){var t=[];e._fileListSelector.children("li:not(.uploadFailed)").each(function(e,a){t.push($(a).data("objectID"))}),t.length&&new WCF.Action.Proxy({autoSend:!0,data:{actionName:"updatePosition",className:"wcf\\data\\attachment\\AttachmentAction",parameters:{attachmentIDs:t,objectID:e._objectID,objectType:e._objectType,tmpHash:e._tmpHash}}})}},!0)}}}); })(this);
 
 // WCF.ColorPicker.js
 (function (window, undefined) {"use strict";WCF.ColorPicker=Class.extend({_bar:null,_barActive:!1,_barSelector:null,_dialog:null,_didInit:!1,_elementID:"",_gradient:null,_gradientActive:!1,_gradientSelector:null,_hex:null,_hsv:{},_newColor:null,_oldColor:null,_rgba:{},_rgbaRegExp:null,init:function(t){this._elementID="",this._hsv={h:0,s:100,v:100},this._position={};var a=$(t);return a.length?void a.click($.proxy(this._open,this)):void console.debug("[WCF.ColorPicker] Selector does not match any element, aborting.")},_open:function(t){this._didInit||(this._initColorPicker(),this._didInit=!0);var a=$(t.currentTarget);this._elementID=a.wcfIdentify(),this._parseColor(a);var s=this.hsvToRgb(this._hsv.h,this._hsv.s,this._hsv.v);this._oldColor.css({backgroundColor:"rgba("+s.r+", "+s.g+", "+s.b+", "+this._rgba.a.val()/100+")"}),this._dialog.wcfDialog({title:WCF.Language.get("wcf.style.colorPicker")}),this._hex.focus()},_parseColor:function(t){if(t.data("hsv")&&t.data("rgb")){var a=t.data("hsv");for(var s in a)this._hsv[s]=a[s];this._updateValues(t.data("rgb"),!0,!0),this._rgba.a.val(parseInt(t.data("alpha")))}else{null===this._rgbaRegExp&&(this._rgbaRegExp=new RegExp("^rgba\\((\\d{1,3}), ?(\\d{1,3}), ?(\\d{1,3}), ?(1|1\\.00?|0|0?\\.[0-9]{1,2})\\)$")),this._rgbaRegExp.exec(t.data("color"));var i=RegExp.$4;0===i.indexOf(".")&&(i="0"+i),i*=100,this._updateValues({r:RegExp.$1,g:RegExp.$2,b:RegExp.$3,a:Math.round(i)},!0,!0)}},_initColorPicker:function(){this._dialog=$('<div id="colorPickerContainer" />').hide().appendTo(document.body),this._gradient=$('<div id="colorPickerGradient" />').appendTo(this._dialog),this._gradientSelector=$('<span id="colorPickerGradientSelector"><span></span></span>').appendTo(this._gradient),this._bar=$('<div id="colorPickerBar" />').appendTo(this._dialog),this._barSelector=$('<span id="colorPickerBarSelector" />').appendTo(this._bar),this._gradient.mousedown($.proxy(this._mouseDownGradient,this)),this._bar.mousedown($.proxy(this._mouseDownBar,this));var t=this;$(document).mouseup(function(a){t._barActive?(t._barActive=!1,t._mouseBar(a)):t._gradientActive&&(t._gradientActive=!1,t._mouseGradient(a))}).mousemove(function(a){t._barActive?t._mouseBar(a):t._gradientActive&&t._mouseGradient(a)}),this._initColorPickerForm()},_initColorPickerForm:function(){var t=$('<div id="colorPickerForm" />').appendTo(this._dialog);$("<small>"+WCF.Language.get("wcf.style.colorPicker.new")+"</small>").appendTo(t);var a=$('<ul class="colors" />').appendTo(t);this._newColor=$('<li class="new"><span /></li>').appendTo(a).children("span"),this._oldColor=$('<li class="old"><span /></li>').appendTo(a).children("span"),$("<small>"+WCF.Language.get("wcf.style.colorPicker.current")+"</small>").appendTo(t);var s=$('<ul class="rgba" />').appendTo(t);this._createInputElement("r","R",0,255).appendTo(s),this._createInputElement("g","G",0,255).appendTo(s),this._createInputElement("b","B",0,255).appendTo(s),this._createInputElement("a","a",0,100).appendTo(s);var i=$('<ul class="hex"><li><label><span>#</span></label></li></ul>').appendTo(t);this._hex=$('<input type="text" maxlength="6" />').appendTo(i.find("label")),this._rgba.r.blur($.proxy(this._blurRgba,this)).keyup($.proxy(this._keyUpRGBA,this)),this._rgba.g.blur($.proxy(this._blurRgba,this)).keyup($.proxy(this._keyUpRGBA,this)),this._rgba.b.blur($.proxy(this._blurRgba,this)).keyup($.proxy(this._keyUpRGBA,this)),this._rgba.a.blur($.proxy(this._blurRgba,this)).keyup($.proxy(this._keyUpRGBA,this)),this._hex.blur($.proxy(this._blurHex,this)).keyup($.proxy(this._keyUpHex,this));var e=$('<div class="formSubmit" />').appendTo(this._dialog);$('<button class="buttonPrimary">'+WCF.Language.get("wcf.style.colorPicker.button.apply")+"</button>").appendTo(e).click($.proxy(this._submit,this));var r=this;this._hex.on("paste",function(){r._hex.attr("maxlength","7"),setTimeout(function(){var t=r._hex.val();"#"==t.substring(0,1)&&(t=t.substr(1)),t.length>6&&(t=t.substring(0,6)),r._hex.attr("maxlength","6").val(t)},50)}),t.find("input").focus(function(){this.select()})},_keyUpRGBA:function(t){13==t.which&&(this._blurRgba(),this._submit())},_keyUpHex:function(t){13==t.which&&(this._blurHex(),this._submit())},_submit:function(){var t=this.hsvToRgb(this._hsv.h,this._hsv.s,this._hsv.v),a={};for(var s in this._hsv)a[s]=this._hsv[s];var i=$("#"+this._elementID);i.data("hsv",a).css({backgroundColor:"rgba("+t.r+", "+t.g+", "+t.b+", "+this._rgba.a.val()/100+")"}).data("alpha",parseInt(this._rgba.a.val())),i.data("rgb",{r:this._rgba.r.val(),g:this._rgba.g.val(),b:this._rgba.b.val()}),$("#"+i.data("store")).val("rgba("+this._rgba.r.val()+", "+this._rgba.g.val()+", "+this._rgba.b.val()+", "+this._rgba.a.val()/100+")").trigger("change"),this._dialog.wcfDialog("close")},_createInputElement:function(t,a,s,i){var e=$('<li class="'+t+'" />'),r=$("<label />").appendTo(e);return $("<span>"+a+"</span>").appendTo(r),this._rgba[t]=$('<input type="number" value="0" min="'+s+'" max="'+i+'" step="1" />').appendTo(r),e},_mouseDownGradient:function(t){this._gradientActive=!0,this._mouseGradient(t)},_mouseGradient:function(t){var a=this._gradient.getOffsets("offset"),s=Math.max(Math.min(t.pageX-a.left,255),0),i=Math.max(Math.min(t.pageY-a.top,255),0);this._hsv.s=100*Math.max(0,Math.min(1,s/255)),this._hsv.v=100*Math.max(0,Math.min(1,(255-i)/255)),this._updateValues(null)},_mouseDownBar:function(t){this._barActive=!0,this._mouseBar(t)},_mouseBar:function(t){var a=this._bar.getOffsets("offset"),s=Math.max(Math.min(t.pageY-a.top,255),0);this._barSelector.css({top:s+"px"}),this._hsv.h=Math.max(0,Math.min(359,Math.round((255-s)/255*360))),this._updateValues(null)},_blurRgba:function(){for(var t in this._rgba){var a=parseInt(this._rgba[t].val())||0;this._rgba[t].val("a"===t?Math.max(0,Math.min(100,a)):Math.max(0,Math.min(255,a)))}this._updateValues({r:this._rgba.r.val(),g:this._rgba.g.val(),b:this._rgba.b.val()},!0,!0)},_blurHex:function(){var t=this.hexToRgb(this._hex.val());t!==Number.NaN&&this._updateValues(t,!0,!0)},_updateValues:function(t,a,s){a=a===!0?!0:!1,s=s===!0?!0:!1,null===t&&(t=this.hsvToRgb(this._hsv.h,this._hsv.s,this._hsv.v),0==this._rgba.a.val()&&(t.a=100)),void 0===t.a&&(t.a=this._rgba.a.val());for(var i in t)this._rgba[i].val(t[i]);if(this._hex.val(this.rgbToHex(t.r,t.g,t.b)),a||s){var e=this.rgbToHsv(t.r,t.g,t.b);a&&(this._hsv.h=e.h),s&&(this._hsv.s=e.s,this._hsv.v=e.v)}var r=Math.max(0,Math.min(255,255-this._hsv.h/360*255));this._barSelector.css({top:r+"px"});var h=Math.max(0,Math.min(255,this._hsv.s/100*255)),r=Math.max(0,Math.min(255,255-this._hsv.v/100*255));this._gradientSelector.css({left:h-6+"px",top:r-6+"px"}),this._newColor.css({backgroundColor:"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a/100+")"});var n=this.hsvToRgb(this._hsv.h,100,100);this._gradient.css({backgroundColor:"rgb("+n.r+", "+n.g+", "+n.b+")"})},hsvToRgb:function(t,a,s){var i,e,r,h,n,o={r:0,g:0,b:0};if(i=Math.floor(t/60),e=t/60-i,a/=100,s/=100,r=s*(1-a),h=s*(1-a*e),n=s*(1-a*(1-e)),0==a)o.r=o.g=o.b=s;else switch(i){case 1:o.r=h,o.g=s,o.b=r;break;case 2:o.r=r,o.g=s,o.b=n;break;case 3:o.r=r,o.g=h,o.b=s;break;case 4:o.r=n,o.g=r,o.b=s;break;case 5:o.r=s,o.g=r,o.b=h;break;case 0:case 6:o.r=s,o.g=n,o.b=r}return{r:Math.round(255*o.r),g:Math.round(255*o.g),b:Math.round(255*o.b)}},rgbToHsv:function(t,a,s){var i,e,r,h,n,o;if(t/=255,a/=255,s/=255,h=Math.max(Math.max(t,a),s),n=Math.min(Math.min(t,a),s),o=h-n,i=0,h!==n){switch(h){case t:i=60*(0+(a-s)/o);break;case a:i=60*(2+(s-t)/o);break;case s:i=60*(4+(t-a)/o)}0>i&&(i+=360)}return e=0===h?0:o/h,r=h,{h:Math.round(i),s:Math.round(100*e),v:Math.round(100*r)}},hexToRgb:function(t){return/^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(t)?(t=t.split(""),"#"===t[0]&&t.shift(),3===t.length?{r:parseInt(t[0]+""+t[0],16),g:parseInt(t[1]+""+t[1],16),b:parseInt(t[2]+""+t[2],16)}:{r:parseInt(t[0]+""+t[1],16),g:parseInt(t[2]+""+t[3],16),b:parseInt(t[4]+""+t[5],16)}):Number.NaN},rgbToHex:function(t,a,s){return"0123456789ABCDEF".charAt((t-t%16)/16)+""+"0123456789ABCDEF".charAt(t%16)+("0123456789ABCDEF".charAt((a-a%16)/16)+""+"0123456789ABCDEF".charAt(a%16))+("0123456789ABCDEF".charAt((s-s%16)/16)+""+"0123456789ABCDEF".charAt(s%16))}}); })(this);
index 2ed59246ed9f5ba1bfb0bcb80a19d70634deb21c..65823f7763e6fab1d87e840e8725cea8eb14fb65 100644 (file)
@@ -5,5 +5,5 @@ n.css(t.scrollbarXRail,"display","none"),n.css(t.scrollbarYRail,"display","none"
 init:function(){this._setup();for(var t=elBySelAll('input[type="date"]:not(.inputDatePicker), input[type="datetime"]:not(.inputDatePicker)'),i=new Date,n=0,a=t.length;a>n;n++){var r=t[n];r.classList.add("inputDatePicker"),r.readOnly=!0;var o="datetime"===elAttr(r,"type");elData(r,"is-date-time",o);var s=null,c=elAttr(r,"value");elAttr(r,"value")&&(s=new Date(c),elData(r,"value",s.getTime()),c=e["formatDate"+(o?"Time":"")](s));var d=0===c.length;if(r.classList.contains("birthday")&&(elData(r,"min-date","100"),elData(r,"max-date","now")),this._initDateRange(r,i,!0),this._initDateRange(r,i,!1),elData(r,"min-date")===elData(r,"max-date"))throw new Error("Minimum and maximum date cannot be the same (element id '"+r.id+"').");r.type="text",r.value=c,elData(r,"empty",d),elData(r,"placeholder")&&elAttr(r,"placeholder",elData(r,"placeholder"));var u=elCreate("input");u.id=r.id+"DatePicker",u.name=r.name,u.type="hidden",null!==s&&(u.value=e.format(s,o?"c":"Y-m-d")),r.parentNode.insertBefore(u,r),r.removeAttribute("name"),r.addEventListener("click",C);var h=elCreate("div");h.className="inputAddon";var p=elCreate("a");p.className="inputSuffix button",p.addEventListener("click",C),h.appendChild(p);var f=elCreate("span");f.className="icon icon16 fa-calendar",p.appendChild(f),r.parentNode.insertBefore(h,r),h.insertBefore(r,p);for(var m=!1,g=["tiny","short","medium","long"],v=0;4>v;v++)r.classList.contains(g[v])&&(m=!0);m||r.classList.add("short"),l.set(r,{shadow:u,isDateTime:o,isEmpty:d,onClose:null})}},_initDateRange:function(e,t,i){var n="data-"+(i?"min":"max")+"-date",a=e.hasAttribute(n)?elAttr(e,n).trim():"";if(a.match(/^(\d{4})-(\d{2})-(\d{2})$/))a=new Date(a).getTime();else if("now"===a)a=t.getTime();else if(a.match(/^\d{1,3}$/)){var r=new Date(t.getTime());r.setFullYear(r.getFullYear()+~~a*(i?-1:1)),a=r.getTime()}else if(a.match(/^datePicker-(.+)$/)){if(a=RegExp.$1,null===elById(a))throw new Error("Reference date picker identified by '"+a+"' does not exists (element id: '"+e.id+"').")}else a=new Date(i?1970:2038,0,1).getTime();elAttr(e,n,a)},_setup:function(){o||(o=!0,s=~~t.get("wcf.date.firstDayOfTheWeek"),C=this._open.bind(this),n.add("WoltLab/WCF/Date/Picker",this.init.bind(this)),r.add("WoltLab/WCF/Date/Picker",this._close.bind(this)))},_open:function(e){e.preventDefault(),e.stopPropagation(),this._createPicker();var t="INPUT"===e.currentTarget.nodeName?e.currentTarget:e.currentTarget.previousElementSibling;if(t!==c){c=t;var i,n=l.get(c),r=elData(c,"value");r?(i=new Date(+r),"Invalid Date"===i.toString()&&(i=new Date)):i=new Date,u=elData(c,"min-date"),u.match(/^datePicker-(.+)$/)&&(u=elData(elById(RegExp.$1),"value")),u=new Date(+u),d=elData(c,"max-date"),d.match(/^datePicker-(.+)$/)&&(d=elData(elById(RegExp.$1),"value")),d=new Date(+d),n.isDateTime&&(f.value=i.getHours(),m.value=i.getMinutes()),this._renderPicker(i.getDate(),i.getMonth(),i.getFullYear()),a.set(w,c,{pointer:!0})}},_close:function(){if(null!==w&&w.classList.contains("active")){w.classList.remove("active");var e=l.get(c);"function"==typeof e.onClose&&e.onClose(),c=null,u=0,d=0}},_renderPicker:function(e,t,i){this._renderGrid(e,t,i);for(var n="",a=u.getFullYear(),r=d.getFullYear();r>=a;a++)n+='<option value="'+a+'">'+a+"</option>";y.innerHTML=n,y.value=i,g.value=t,w.classList.add("active")},_renderGrid:function(e,t,i){var n,a=void 0!==e,r=void 0!==t;if(e=~~e||~~elData(p,"day"),t=~~t,i=~~i,r||i){var o=0!==i,l=document.createDocumentFragment();l.appendChild(p),r||(t=~~elData(p,"month")),i=i||~~elData(p,"year");var c=new Date(i+"-"+("0"+(t+1).toString()).slice(-2)+"-"+("0"+e.toString()).slice(-2));for(u>c?(i=u.getFullYear(),t=u.getMonth(),e=u.getDate(),g.value=t,y.value=i,o=!0):c>d&&(i=d.getFullYear(),t=d.getMonth(),e=d.getDate(),g.value=t,y.value=i,o=!0),c=new Date(i+"-"+("0"+(t+1).toString()).slice(-2)+"-01");c.getDay()!==s;)c.setDate(c.getDate()-1);for(var f,m=0;35>m;m++)n=h[m],n.textContent=c.getDate(),f=c.getMonth()===t,f&&(u>c?f=!1:c>d&&(f=!1)),n.classList[f?"remove":"add"]("otherMonth"),c.setDate(c.getDate()+1);if(elData(p,"month",t),elData(p,"year",i),w.insertBefore(l,_),!a&&(c=new Date(i,t,e),c.getDate()!==e)){for(;c.getMonth()!==t;)c.setDate(c.getDate()-1);e=c.getDate()}if(o){for(var m=0;12>m;m++){var C=g.children[m];C.disabled=i===u.getFullYear()&&C.value<u.getMonth()||i===d.getFullYear()&&C.value>d.getMonth()}var L=new Date(i+"-"+("0"+(t+1).toString()).slice(-2)+"-01");L.setMonth(L.getMonth()+1),v.classList[d>L?"add":"remove"]("active");var E=new Date(i+"-"+("0"+(t+1).toString()).slice(-2)+"-01");E.setDate(E.getDate()-1),b.classList[E>u?"add":"remove"]("active")}}if(e){for(var m=0;35>m;m++)n=h[m],n.classList[n.classList.contains("otherMonth")||~~n.textContent!==e?"remove":"add"]("active");elData(p,"day",e)}this._formatValue()},_formatValue:function(){var t,i,n,a=l.get(c);"true"!==elData(c,"empty")&&(a.isDateTime?(t=new Date(elData(p,"year"),elData(p,"month"),elData(p,"day"),f.value,m.value),i=e.formatDateTime(t),n=e.format(t,"c")):(t=new Date(elData(p,"year"),elData(p,"month"),elData(p,"day")),i=e.formatDate(t),n=e.format(t,"Y-m-d")),c.value=i,elData(c,"value",t.getTime()),a.shadow.value=n)},_createPicker:function(){if(null===w){w=elCreate("div"),w.className="datePicker",w.addEventListener("click",function(e){e.stopPropagation()});var i=elCreate("span");i.className="elementPointer",i.innerHTML="<span></span>",w.appendChild(i);var n=elCreate("header");w.appendChild(n),b=elCreate("a"),b.className="icon icon16 fa-arrow-left previous",b.addEventListener("click",this.previousMonth.bind(this)),n.appendChild(b);var a=elCreate("span");n.appendChild(a),g=elCreate("select"),g.className="month",g.addEventListener("change",this._changeMonth.bind(this));var r=elCreate("label");r.className="selectDropdown",r.appendChild(g),a.appendChild(r);for(var o="",l=t.get("__monthsShort"),c=0;12>c;c++)o+='<option value="'+c+'">'+l[c]+"</option>";g.innerHTML=o,y=elCreate("select"),y.className="year",y.addEventListener("change",this._changeYear.bind(this)),r=elCreate("label"),r.className="selectDropdown",r.appendChild(y),a.appendChild(r),v=elCreate("a"),v.className="icon icon16 fa-arrow-right next",v.addEventListener("click",this.nextMonth.bind(this)),n.appendChild(v),p=elCreate("ul"),w.appendChild(p);var d=elCreate("li");d.className="weekdays",p.appendChild(d);for(var u,C=t.get("__daysShort"),c=0;7>c;c++){var L=c+s;L>6&&(L-=7),u=elCreate("span"),u.textContent=C[L],d.appendChild(u)}for(var E,x,D=this._click.bind(this),c=0;5>c;c++){x=elCreate("li"),p.appendChild(x);for(var T=0;7>T;T++)E=elCreate("a"),E.addEventListener("click",D),h.push(E),x.appendChild(E)}_=elCreate("footer"),w.appendChild(_),f=elCreate("select"),f.className="hour",f.addEventListener("change",this._formatValue.bind(this));for(var S="",k=new Date(2e3,0,1),M=t.get("wcf.date.timeFormat").replace(/:/,"").replace(/[isu]/g,""),c=0;24>c;c++)k.setHours(c),S+='<option value="'+c+'">'+e.format(k,M)+"</option>";f.innerHTML=S,_.appendChild(f),_.appendChild(document.createTextNode(" : ")),m=elCreate("select"),m.className="minute",m.addEventListener("change",this._formatValue.bind(this));for(var S="",c=0;60>c;c++)S+='<option value="'+c+'">'+(10>c?"0"+c.toString():c)+"</option>";m.innerHTML=S,_.appendChild(m),document.body.appendChild(w)}},previousMonth:function(){"0"===g.value?(g.value=11,y.value=~~y.value-1):g.value=~~g.value-1,this._renderGrid(void 0,g.value,y.value)},nextMonth:function(){"11"===g.value?(g.value=0,y.value=~~y.value+1):g.value=~~g.value+1,this._renderGrid(void 0,g.value,y.value)},_changeMonth:function(e){this._renderGrid(void 0,e.currentTarget.value)},_changeYear:function(e){this._renderGrid(void 0,void 0,e.currentTarget.value)},_click:function(e){e.currentTarget.classList.contains("otherMonth")||(elData(c,"empty",!1),this._renderGrid(e.currentTarget.textContent),this._close())},getDate:function(e){return e=this._getElement(e),e.hasAttribute("data-value")?new Date(+elData(e,"value")):null},setDate:function(t,i){t=this._getElement(t);var n=l.get(t);elData(t,"value",i.getTime()),t.value=e["formatDate"+(n.isDateTime?"Time":"")](i),n.shadow.value=e.format(i,n.isDateTime?"c":"Y-m-d")},clear:function(e){e=this._getElement(e);var t=l.get(e);e.removeAttribute("data-value"),e.value="",t.isEmpty=!0,t.shadow.value=""},destroy:function(e){e=this._getElement(e);var t=l.get(e),i=e.parentNode;i.parentNode.insertBefore(e,i),elRemove(i),elAttr(e,"type","date"+(t.isDateTime?"time":"")),e.value=t.shadow.value,e.removeAttribute("data-value"),e.removeEventListener("click",C),elRemove(t.shadow),e.classList.remove("inputDatePicker"),e.readOnly=!1,l["delete"](e)},setCloseCallback:function(e,t){e=this._getElement(e),l.get(e).onClose=t},_getElement:function(e){if("string"==typeof e&&(e=elById(e)),!(e instanceof Element&&e.classList.contains("inputDatePicker")&&l.has(e)))throw new Error("Expected a valid date picker input element or id.");return e}};return window.__wcf_bc_datePicker=L,L}),define("WoltLab/WCF/Ui/Page/Action",["Dictionary","Dom/Util"],function(e,t){"use strict";var i=new e,n=null,a=!1;return{setup:function(){a=!0,n=elCreate("ul"),n.className="pageAction",document.body.appendChild(n)},add:function(e,r,o){a===!1&&this.setup();var s=elCreate("li");if(s.appendChild(r),elAttr(s,"aria-hidden","toTop"===e?"true":"false"),elData(s,"name",e),"toTop"===e)s.className="toTop initiallyHidden",n.appendChild(s);else{var l=null;o&&(l=i.get(o),void 0!==l&&(l=l.parentNode)),null===l&&n.childElementCount&&(l=n.children[0]),null===l?t.prepend(s,n):n.insertBefore(s,l)}i.set(e,r),this._renderContainer()},remove:function(e){var t=i.get(e);if(void 0!==t){var a=t.parentNode;a.addEventListener("animationend",function(){n.removeChild(a),i["delete"](e)}),this.hide(e)}},hide:function(e){var t=i.get(e);t&&(elAttr(t.parentNode,"aria-hidden","true"),this._renderContainer())},show:function(e){var t=i.get(e);t&&(t.parentNode.classList.contains("initiallyHidden")&&t.parentNode.classList.remove("initiallyHidden"),elAttr(t.parentNode,"aria-hidden","false"),this._renderContainer())},_renderContainer:function(){var e=!1;if(n.childElementCount)for(var t=0,i=n.childElementCount;i>t;t++)if("false"===elAttr(n.children[t],"aria-hidden")){e=!0;break}n.classList[e?"add":"remove"]("active")}}}),define("WoltLab/WCF/Ui/Page/JumpToTop",["Environment","Language","./Action"],function(e,t,i){"use strict";function n(){this.init()}return n.prototype={init:function(){if("desktop"===e.platform()){this._callbackScrollEnd=this._afterScroll.bind(this),this._timeoutScroll=null;var n=elCreate("a");n.className="jsTooltip",n.href="#",elAttr(n,"title",t.get("wcf.global.scrollUp")),n.innerHTML='<span class="icon icon16 fa-arrow-up"></span>',n.addEventListener("click",this._jump.bind(this)),i.add("toTop",n),window.addEventListener("scroll",this._scroll.bind(this)),this._afterScroll()}},_jump:function(e){e.preventDefault(),elById("top").scrollIntoView({behavior:"smooth"})},_scroll:function(){null!==this._timeoutScroll&&window.clearTimeout(this._timeoutScroll),this._timeoutScroll=window.setTimeout(this._callbackScrollEnd,100)},_afterScroll:function(){this._timeoutScroll=null,i[window.scrollY>=window.innerHeight/2?"show":"hide"]("toTop")}},n}),define("WoltLab/WCF/Bootstrap",["favico","enquire","perfect-scrollbar","WoltLab/WCF/Date/Time/Relative","Ui/SimpleDropdown","WoltLab/WCF/Ui/Mobile","WoltLab/WCF/Ui/TabMenu","WoltLab/WCF/Ui/FlexibleMenu","Ui/Dialog","WoltLab/WCF/Ui/Tooltip","WoltLab/WCF/Language","WoltLab/WCF/Environment","WoltLab/WCF/Date/Picker","EventHandler","Core","WoltLab/WCF/Ui/Page/JumpToTop"],function(e,t,i,n,a,r,o,s,l,c,d,u,h,p,f,m){"use strict";return window.Favico=e,window.enquire=t,null==window.WCF&&(window.WCF={}),null==window.WCF.Language&&(window.WCF.Language={}),window.WCF.Language.get=d.get,window.WCF.Language.add=d.add,window.WCF.Language.addObject=d.addObject,window.__wcf_bc_eventHandler=p,{setup:function(e){e=f.extend({enableMobileMenu:!0},e),u.setup(),n.setup(),h.init(),a.setup(),r.setup({enableMobileMenu:e.enableMobileMenu}),o.setup(),l.setup(),c.setup(),new m;for(var t=elBySelAll("form[method=get]"),i=0,s=t.length;s>i;i++)t[i].setAttribute("method","post");"microsoft"===u.browser()&&(window.onbeforeunload=function(){});var d=0;d=window.setInterval(function(){"function"==typeof window.jQuery&&(window.clearInterval(d),window.jQuery.holdReady(!1))},20)}}}),define("WoltLab/WCF/Controller/Sitemap",["Ajax","EventHandler","Language","Dom/Util","Ui/Dialog","Ui/TabMenu"],function(e,t,i,n,a,r){"use strict";var o=[];return{setup:function(){elBySel("#sitemap > a").addEventListener(WCF_CLICK_EVENT,this.open.bind(this))},open:function(e){e.preventDefault(),a.open(this)},_ajaxSetup:function(){return{data:{actionName:"getSitemap",className:"wcf\\data\\sitemap\\SitemapAction"}}},_ajaxSuccess:function(e){o.push(e.returnValues.sitemapName),elById("sitemap_"+e.returnValues.sitemapName).children[0].innerHTML=e.returnValues.template},_dialogSetup:function(){return{id:"sitemapDialog",options:{title:i.get("wcf.page.sitemap")},source:{data:{actionName:"getSitemap",className:"wcf\\data\\sitemap\\SitemapAction"},after:function(e,i){o.push(i.returnValues.sitemapName);var a=elBySel(".tabMenuContainer",e),s=n.identify(a);r.getTabMenu(s).select("sitemap_"+i.returnValues.sitemapName),t.add("com.woltlab.wcf.simpleTabMenu_"+s,"select",this.showTab.bind(this))}.bind(this)}}},showTab:function(t){var i=elAttr(t.active,"data-name").replace(/^sitemap_/,"");-1===o.indexOf(i)&&e.api(this,{parameters:{sitemapName:i}})}}}),define("WoltLab/WCF/Controller/Style/Changer",["Ajax","Language","Ui/Dialog"],function(e,t,i){"use strict";var n={setup:function(){var e=elBySel("#footerNavigation > ul.navigationItems");if(null!==e){var i=elCreate("li");i.classList.add("styleChanger"),i.addEventListener("click",this.showDialog.bind(this));var n=elCreate("a");elAttr(n,"href","#"),n.textContent=t.get("wcf.style.changeStyle"),i.appendChild(n),e.appendChild(i)}},showDialog:function(e){e.preventDefault(),i.open(this)},_dialogSetup:function(){return{id:"styleChanger",options:{disableContentPadding:!0,title:t.get("wcf.style.changeStyle")},source:{data:{actionName:"getStyleChooser",className:"wcf\\data\\style\\StyleAction"},after:function(e){for(var t=elBySelAll(".styleList > li",e),i=0,n=t.length;n>i;i++){var a=t[i];a.classList.add("pointer"),a.addEventListener("click",this._click.bind(this))}}.bind(this)}}},_click:function(t){t.preventDefault(),e.apiOnce({data:{actionName:"changeStyle",className:"wcf\\data\\style\\StyleAction",objectIDs:[elData(t.currentTarget,"style-id")]},success:function(){window.location.reload()}})}};return n}),define("WoltLab/WCF/Controller/Popover",["Ajax","Dictionary","Environment","Dom/ChangeListener","Dom/Util","Ui/Alignment"],function(e,t,i,n,a,r){"use strict";var o=null,s=new t,l=new t,c=new t,d=null,u=!1,h=null,p=null,f=null,m=null,g=null,v=null,b=null,_=null,y=0,w=1,C=2,L=500,E=300;return{_setup:function(){if(null===f){f=elCreate("div"),f.className="popover forceHide",m=elCreate("div"),m.className="popoverContent",f.appendChild(m);var e=elCreate("span");e.className="elementPointer",e.appendChild(elCreate("span")),f.appendChild(e),document.body.appendChild(f),g=this._hide.bind(this),b=this._mouseEnter.bind(this),_=this._mouseLeave.bind(this),f.addEventListener("mouseenter",this._popoverMouseEnter.bind(this)),f.addEventListener("mouseleave",_),f.addEventListener("animationend",this._clearContent.bind(this)),window.addEventListener("beforeunload",function(){u=!0,null!==h&&window.clearTimeout(h),this._hide(!0)}.bind(this)),n.add("WoltLab/WCF/Controller/Popover",this._init.bind(this))}},init:function(e){"desktop"===i.platform()&&(e.attributeName=e.attributeName||"data-object-id",e.legacy=e.legacy===!0,this._setup(),c.has(e.identifier)||(c.set(e.identifier,{attributeName:e.attributeName,elements:e.legacy?e.className:elByClass(e.className),legacy:e.legacy,loadCallback:e.loadCallback}),this._init(e.identifier)))},_init:function(e){"string"==typeof e&&e.length?this._initElements(c.get(e),e):c.forEach(this._initElements.bind(this))},_initElements:function(e,t){for(var i=e.legacy?elBySelAll(e.elements):e.elements,n=0,r=i.length;r>n;n++){var o=i[n],c=a.identify(o);if(s.has(c))return;var d=e.legacy?c:~~o.getAttribute(e.attributeName);if(0!==d){o.addEventListener("mouseenter",b),o.addEventListener("mouseleave",_),"A"===o.nodeName&&elAttr(o,"href")&&o.addEventListener("click",g);var u=t+"-"+d;elData(o,"cache-id",u),l.set(c,{element:o,identifier:t,objectId:d}),s.has(u)||s.set(t+"-"+d,{content:null,state:y})}}},setContent:function(e,t,i){var n=e+"-"+t,r=s.get(n);if(void 0===r)throw new Error("Unable to find element for object id '"+t+"' (identifier: '"+e+"').");if(r.content=a.createFragmentFromHtml(i),r.state=C,o){var c=l.get(o).element;elData(c,"cache-id")===n&&this._show()}},_mouseEnter:function(e){if(!u){null!==h&&(window.clearTimeout(h),h=null);var t=a.identify(e.currentTarget);o===t&&null!==p&&(window.clearTimeout(p),p=null),d=t,h=window.setTimeout(function(){h=null,d===t&&this._show()}.bind(this),E)}},_mouseLeave:function(){d=null,null===p&&(null===v&&(v=this._hide.bind(this)),null!==p&&window.clearTimeout(p),p=window.setTimeout(v,L))},_popoverMouseEnter:function(){null!==p&&(window.clearTimeout(p),p=null)},_show:function(){null!==p&&(window.clearTimeout(p),p=null);var e=!1;f.classList.contains("active")?(this._hide(),e=!0):m.childElementCount&&(e=!0),e&&(f.classList.add("forceHide"),f.offsetTop,this._clearContent(),f.classList.remove("forceHide")),o=d;var t=l.get(o),i=s.get(elData(t.element,"cache-id"));i.state===C?(m.appendChild(i.content),this._rebuild(o)):i.state===y&&(i.state=w,c.get(t.identifier).loadCallback(t.objectId,this))},_hide:function(){null!==p&&(window.clearTimeout(p),p=null),f.classList.remove("active")},_clearContent:function(){if(o&&m.childElementCount&&!f.classList.contains("active"))for(var e=s.get(elData(l.get(o).element,"cache-id"));m.childNodes.length;)e.content.appendChild(m.childNodes[0])},_rebuild:function(){f.classList.contains("active")||(f.classList.remove("forceHide"),f.classList.add("active"),r.set(f,l.get(o).element,{pointer:!0,vertical:"top"}))},_ajaxSetup:function(){return{}},ajaxApi:function(t,i,n){if("function"!=typeof i)throw new TypeError("Expected a valid callback for parameter 'success'.");e.api(this,t,i,n)}}}),define("WoltLab/WCF/List",[],function(){"use strict";function e(){this._set=t?new Set:[]}var t=objOwns(window,"Set")&&"function"==typeof window.Set;return e.prototype={add:function(e){t?this._set.add(e):this.has(e)||this._set.push(e)},clear:function(){t?this._set.clear():this._set=[]},"delete":function(e){if(t)return this._set["delete"](e);var i=this._set.indexOf(e);return-1===i?!1:(this._set.splice(i,1),!0)},forEach:function(e){if(t)this._set.forEach(e);else for(var i=0,n=this._set.length;n>i;i++)e(this._set[i])},has:function(e){return t?this._set.has(e):-1!==this._set.indexOf(e)}},Object.defineProperty(e.prototype,"size",{enumerable:!1,configurable:!0,get:function(){return t?this._set.size:this._set.length}}),e}),define("WoltLab/WCF/Ui/User/Ignore",["List","Dom/ChangeListener"],function(e,t){"use strict";var i=elByClass("ignoredUserMessage"),n=null,a=new e;return{init:function(){n=this._removeClass.bind(this),this._rebuild(),t.add("WoltLab/WCF/Ui/User/Ignore",this._rebuild.bind(this))},_rebuild:function(){for(var e,t=0,r=i.length;r>t;t++)e=i[t],a.has(e)||(e.addEventListener(WCF_CLICK_EVENT,n),a.add(e))},_removeClass:function(e){e.preventDefault();var t=e.currentTarget;t.classList.remove("ignoredUserMessage"),t.removeEventListener(WCF_CLICK_EVENT,n),a["delete"](t)}}}),define("WoltLab/WCF/BootstrapFrontend",["Ajax","WoltLab/WCF/Bootstrap","WoltLab/WCF/Controller/Sitemap","WoltLab/WCF/Controller/Style/Changer","WoltLab/WCF/Controller/Popover","WoltLab/WCF/Ui/User/Ignore"],function(e,t,i,n,a,r){"use strict";var o=0;return{setup:function(e){t.setup(),i.setup(),e.styleChanger,this._initUserPopover(),this._invokeBackgroundQueue(e.backgroundQueue.url,e.backgroundQueue.force),r.init()},_initUserPopover:function(){a.init({attributeName:"data-user-id",className:"userLink",identifier:"com.woltlab.wcf.user",loadCallback:function(e,t){var i=function(i){t.setContent("com.woltlab.wcf.user",e,i.returnValues.template)};t.ajaxApi({actionName:"getUserProfile",className:"wcf\\data\\user\\UserProfileAction",objectIDs:[e]},i,i)}})},_invokeBackgroundQueue:function(t,i){var n=this._invokeBackgroundQueue.bind(this,t,!0);(Math.random()<.1||i)&&e.apiOnce({url:t,ignoreError:!0,silent:!0,success:function(e){o++,e>0&&5>o&&setTimeout(n,1e3)}.bind(this)})}}}),define("WoltLab/WCF/ColorUtil",[],function(){"use strict";var e={hexToRgb:function(e){return e=e.replace(/^#/,""),/^([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(e)?(e=e.split(""),3===e.length?{r:parseInt(e[0]+""+e[0],16),g:parseInt(e[1]+""+e[1],16),b:parseInt(e[2]+""+e[2],16)}:{r:parseInt(e[0]+""+e[1],16),g:parseInt(e[2]+""+e[3],16),b:parseInt(e[4]+""+e[5],16)}):Number.NaN},rgbToHex:function(e,t,i){var n="0123456789ABCDEF";return void 0===t&&e.match(/^rgba?\((\d+), ?(\d+), ?(d\+)(?:, ?[0-9.]+)?\)$/)&&(e=RegExp.$1,t=RegExp.$2,i=RegExp.$3),n.charAt((e-e%16)/16)+""+n.charAt(e%16)+(n.charAt((t-t%16)/16)+""+n.charAt(t%16))+(n.charAt((i-i%16)/16)+""+n.charAt(i%16))}};return e}),define("WoltLab/WCF/Permission",["Dictionary"],function(e){"use strict";var t=new e,i={add:function(e,i){if("boolean"!=typeof i)throw new TypeError("Permission value has to be boolean.");t.set(e,i)},addObject:function(e){for(var t in e)objOwns(e,t)&&this.addPermission(t,e[t])},get:function(e){return t.has(e)?t.get(e):!1}};return i}),define("WoltLab/WCF/Upload",["AjaxRequest","Core","Dom/ChangeListener","Language","Dom/Util","Dom/Traverse"],function(e,t,i,n,a,r){"use strict";function o(e,i,n){if(n=n||{},void 0===n.className)throw new Error("Missing class name.");if(this._options=t.extend({action:"upload",multiple:!1,name:"__files[]",singleFileRequests:!1,url:"index.php/AJAXUpload/?t="+SECURITY_TOKEN},n),this._options.url=WCF.convertLegacyURL(this._options.url),this._buttonContainer=elById(e),null===this._buttonContainer)throw new Error("Element id '"+e+"' is unknown.");if(this._target=elById(i),null===i)throw new Error("Element id '"+i+"' is unknown.");if(n.multiple&&"UL"!==this._target.nodeName&&"OL"!==this._target.nodeName)throw new Error("Target element has to be list when allowing upload of multiple files.");this._fileElements=[],this._internalFileId=0,this._createButton()}return o.prototype={_createButton:function(){this._fileUpload=elCreate("input"),elAttr(this._fileUpload,"type","file"),elAttr(this._fileUpload,"name",this._options.name),this._options.multiple&&elAttr(this._fileUpload,"multiple","true"),this._fileUpload.addEventListener("change",this._upload.bind(this)),this._button=elCreate("p"),this._button.classList.add("button"),this._button.classList.add("uploadButton");var e=elCreate("span");e.textContent=n.get("wcf.global.button.upload"),this._button.appendChild(e),a.prepend(this._fileUpload,this._button),this._insertButton(),i.trigger()},_createFileElement:function(e){var t=elCreate("progress");if(elAttr(t,"max",100),"OL"===this._target.nodeName||"UL"===this._target.nodeName){var i=elCreate("li");return i.innerText=e.name,i.appendChild(t),this._target.appendChild(i),i}var n=elCreate("p");return n.appendChild(t),this._target.appendChild(n),n},_createFileElements:function(e){if(e.length){var t=this._fileElements.length;this._fileElements[t]=[];for(var n=0,a=e.length;a>n;n++){var r=e[n],o=this._createFileElement(r);o.classList.contains("uploadFailed")||(elData(o,"filename",r.name),elData(o,"internal-file-id",this._internalFileId++),this._fileElements[t][n]=o)}return i.trigger(),t}return null},_failure:function(e,t,i,n,a){return!0},_getParameters:function(){return{}},_insertButton:function(){a.prepend(this._button,this._buttonContainer)},_progress:function(e,t){var i=Math.round(t.loaded/t.total*100);for(var n in this._fileElements[e]){var a=elByTag("PROGRESS",this._fileElements[e][n]);1===a.length&&elAttr(a[0],"value",i)}},_removeButton:function(){elRemove(this._button),i.trigger()},_success:function(e,t,i,n,a){},_upload:function(e,t,i){for(var n=r.childrenByClass(this._target,"uploadFailed"),a=0,o=n.length;o>a;a++)elRemove(n[a]);var s=null,l=[];if(t)l.push(t);else if(i){var c="";switch(i.type){case"image/jpeg":c=".jpg";break;case"image/gif":c=".gif";break;case"image/png":c=".png"}l.push({name:"pasted-from-clipboard"+c})}else l=this._fileUpload.files;if(l.length)if(this._options.singleFileRequests){s=[];for(var a=0,o=l.length;o>a;a++)s.push(this._uploadFiles([l[a]],i))}else s=this._uploadFiles(l,i);return this._removeButton(),this._createButton(),s},_uploadFiles:function(t,i){var n=this._createFileElements(t);if(!this._fileElements[n].length)return null;for(var a=new FormData,r=0,o=t.length;o>r;r++)if(this._fileElements[n][r]){var s=elData(this._fileElements[n][r],"internal-file-id");i?a.append("__files["+s+"]",i,t[r].name):a.append("__files["+s+"]",t[r])}a.append("actionName",this._options.action),a.append("className",this._options.className),a.append("interfaceName","wcf\\data\\IUploadAction");var l=function(e,t){t=t||"";for(var i in e)"object"==typeof e[i]?l(e[i],t+"["+i+"]"):a.append("parameters"+t+"["+i+"]",e[i])};l(this._getParameters());var c=new e({data:a,contentType:!1,failure:this._failure.bind(this,n),silent:!0,success:this._success.bind(this,n),uploadProgress:this._progress.bind(this,n),url:this._options.url});return c.sendRequest(),n}},o}),define("WoltLab/WCF/Ajax/Jsonp",["Core"],function(e){"use strict";var t={send:function(t,i,n,a){if(t="string"==typeof t?t.trim():"",0===t.length)throw new Error("Expected a non-empty string for parameter 'url'.");if("function"!=typeof i)throw new TypeError("Expected a valid callback function for parameter 'success'.");a=e.extend({parameterName:"callback",timeout:10},a||{});var r="wcf_jsonp_"+e.getUuid().replace(/-/g,"").substr(0,8),o=window.setTimeout(function(){window[r]=function(){},"function"==typeof n&&n()},1e3*(~~a.timeout||10));window[r]=function(){window.clearTimeout(o),i.apply(null,arguments)},t+=-1===t.indexOf("?")?"?":"&",t+=a.parameterName+"="+r;var s=elCreate("script");s.async=!0,elAttr(s,"src",t),document.head.appendChild(s)}};return t}),define("WoltLab/WCF/Attachment/Upload",["Core","Dom/ChangeListener","Dom/Traverse","Language","List","Upload"],function(e,t,i,n,a,r){"use strict";function o(e,t,o,s,l,c,d,u,h){this._tmpHash=o,this._objectType=s,this._objectId=~~l,this._parentObjectId=~~parentObjectID,this._wysiwygContainerId=h,this._autoInsert=new a,r.call(this,"uploadImage","styleImage",{className:"wcf\\data\\attachment\\AttachmentAction",maxSize:~~u,maxUploads:~~d,multiple:!0}),i.childByClass(this._button,".button").addEventListener("click",this._validateLimit.bind(this)),elByClass(this._target,"jsButtonInsertAttachment").addEventListener("click",this._insert.bind(this)),elByClass(this._target,"jsButtonAttachmentInsertThumbnail").addEventListener("click",this._insert.bind(this)),elByClass(this._target,"jsButtonAttachmentInsertFull").addEventListener("click",this._insert.bind(this)),this._insertAllButton=elCreate("p"),this._insertAllButton.className="button jsButtonAttachmentInsertAll",this._insertAllButton.textContent=n.get("wcf.attachment.insertAll"),i.childBySel(this._target,"li:not(.uploadFailed)")&&elHide(this._insertAllButton),this._insertAllButton.addEventListener("click",this._insertAll.bind(this)),this._button.appendChild(this._insertAllButton),this._wysiwygContainerId}e.inherit(o,r,{_createFileElement:function(e){var t=elCreate("li");t.className="box64",elData(t,"filename",filename),this._target.appendChild(t),elShow(this._target);var i=elCreate("span");this._options.maxSize>=e.size?i.className="icon icon48 fa-spinnner":i.className="icon icon48 fa-ban-circle",t.appendChild(i);var a=elCreate("div");t.appendChild(a);var r=elCreate("div");a.appendChild(r);var o=elCreate("p");o.textContent=e.name,r.appendChild(o);var s=elCreate("small");if(r.appendChild(s),this._options.maxSize>=e.size){var l=elCreate("progress");elAttr(l,"max",100)}a.appendChild(elCreate("ul")),this._options.maxSize<e.size&&(s=elCreate("small"),s.className="innerError",s.textContent=n.get("wcf.attachment.upload.error.tooLarge"),r.appendChild(s),t.classList.add("uploadFailed"))},_createFileElements:function(e){for(var t=i.childrenBySel(this._target,"li.uploadFailed"),n=0,a=t.length;a>n;n++)this._target.removeChild(t[n]);return r.prototype._createFileElements.call(this,e)},_getParameters:function(){return{objectID:this._objectId,objectType:this._objectType,parentObjectID:this._parentObjectId,tmpHash:this._tmpHash}},_success:function(e,a){for(var r=0,o=this._fileElements[e].length;o>r;r++){var s=this._fileElements[e][r],l=elByTag(s,"PROGRESS");elRemove(l);var c=elData(s,"filename"),d=elData(s,"internal-file-id"),u=i.childByClass(s,"fa-spinner");if(a.returnValues&&a.returnValues.attachments[d]){var h=a.returnValues.attachments[d];if(h.tinyURL){var p=elCreate("img");p.className="attachmentTinyThumbnail",elAttr(p,"src",h.tinyURL),elAttr(p,"alt",""),u.parentNode.replaceChild(u,p),elData(s,"height",h.height),elData(s,"width",h.width)}else u.classList.remove("fa-spinner"),u.classList.add("fa-paper-clip");var f=elByTag(s,"P");f.innerHtml="";var m=elCreate("a");m.textContent=c,elAttr(m,"href",h.url),h.isImage&&(m.className="jsImageViewer",elAttr(m,"title",c)),f.appendChild(m),elByTag(s,"SMALL").textContent=h.formattedFilesize;var g=elByTag(s,"UL");g.classList.add("buttonGroup");var v=elCreate("li");g.appendChild(v);var b=elCreate("span");if(b.className="button small jsDeleteButton",b.textContent=n.get("wcf.global.button.delete"),elData(b,"object-id",h.attachmentID),elData(b,"confirm-message",n.get("wcf.attachment.delete.sure")),this._wysiwygContainerId&&elData(b,"event-name","attachment_"+this._wysiwygContainerId),v.appendChild(b),elData(b,"object-id",h.attachmentID),this._wysiwygContainerId)if(h.tinyURL){var _=elCreate("li");g.appendChild(_),b=elCreate("span"),b.className="button small jsButtonAttachmentInsertThumbnail",b.textContent=n.get("wcf.global.button.insertThumbnail"),elData(b,"object-id",h.attachmentID),b.addEventListener("click",this._insert.bind(this)),_.appendChild(b);var y=elCreate("li");g.appendChild(y),b=elCreate("span"),b.className="button small jsButtonAttachmentInsertFull",b.textContent=n.get("wcf.global.button.insertFull"),elData(b,"object-id",h.attachmentID),b.addEventListener("click",this._insert.bind(this)),y.appendChild(b)}else{var w=elCreate("li");g.appendChild(w),b=elCreate("span"),b.className="button small jsButtonAttachmentInsertPlain",b.textContent=n.get("wcf.global.button.insert"),elData(b,"object-id",h.attachmentID),b.addEventListener("click",this._insert.bind(this)),w.appendChild(b)}}else{u.classList.removeClass("fa-spinner"),u.classList.addClass("fa-ban-circle");var C="uploadFailed";a.returnValues&&a.returnValues.errors[d]&&(C=a.returnValues.errors[d].errorType);var L=elCreate("small");L.className="innerError",L.textContent=n.get("wcf.attachment.upload.error."+C),elBySel(s,"div > div").appendChild(L),s.classList.add("uploadFailed")}s.style.setProperty("display","block"),this._autoInsert.has(e)&&(this._autoInsert["delete"](e),s.classList.contains("uploadFailed"))}i.childrenBySel(this._target,"li:not(.uploadFailed)").length?elShow(this._insertAllButton):elHide(this._insertAllButton),t.trigger()},_upload:function(e,t,i){this._validateLimit()&&r.prototype._upload.call(this,e,t,i)},_validateLimit:function(){var e=i.nextBySel(this._button,"small.innerError"),t=this._options.maxUploads-i.childrenBySel(this._target,"li:not(.uploadFailed)").length;return 0>=t||t<this._fileUpload.files.length?(e||(e=elCreate("small"),e.className="innerError",DomUtil.insertAfter(e,this._button)),0>=t?e.textContent=n.get("wcf.attachment.upload.error.reachedLimit"):e.textContent=n.get("wcf.attachment.upload.error.reachedRemainingLimit",{remaining:t}),!1):(e&&elRemove(e),!0)}})}),define("WoltLab/WCF/Bbcode/Collapsible",[],function(){
 "use strict";var e=elByClass("jsCollapsibleBbcode"),t={observe:function(){for(var t,i;e.length;)t=e[0],t.classList.remove("jsCollapsibleBbcode"),i=elBySel(".toggleButton"),null!==i&&!function(e,t){var i=function(){var i=e.classList.contains("collapsed");e.classList[i?"remove":"add"]("collapsed"),t.textContent=elData(t,"title-"+(i?"collapse":"expand"))};t.addEventListener("click",i),e.addEventListener("scroll",i),0!==e.scrollTop&&i()}(t,i)}};return t}),define("WoltLab/WCF/Bbcode/FromHtml",["EventHandler","StringUtil","Dom/Traverse"],function(e,t,i){"use strict";function n(e,t){var i=e[t?"previousSibling":"nextSibling"];return null!==i&&i.nodeType===Node.TEXT_NODE&&/\s$/.test(i.textContent)?!1:!0}var a=[],r={},o=[],s={convert:function(t){t.length&&this._setup();var i=elCreate("div");i.innerHTML=t;for(var n=elByTag("P",i);n.length;)n[0].outerHTML=n[0].innerHTML;for(n=elByTag("BR",i);n.length;)n[0].outerHTML="\n";var r=this._preserveSourceElements(i);e.fire("com.woltlab.wcf.bbcode.fromHtml","beforeConvert",{container:i});for(var o=0,s=a.length;s>o;o++)this._convert(i,a[o]);for(e.fire("com.woltlab.wcf.bbcode.fromHtml","afterConvert",{container:i}),this._restoreSourceElements(i,r),n=elByTag("*",i);n.length;)n[0].outerHTML=n[0].innerHTML;return t=this._convertSpecials(i.innerHTML)},_preserveSourceElements:function(e){for(var t,i,n=[],a=0,r=o.length;r>a;a++){t=elBySelAll(o[a].selector,e),i=[];for(var s=0,l=t.length;l>s;s++)this._preserveSourceElement(t[s],i);n.push(i)}return n},_preserveSourceElement:function(e,t){var i=elCreate("var");elData(i,"source","wcf"),e.parentNode.insertBefore(i,e);var n=document.createDocumentFragment();n.appendChild(e),t.push({fragment:n,placeholder:i})},_restoreSourceElements:function(e,t){for(var i,n,a,r=0,s=t.length;s>r;r++)if(n=t[r],0!==n.length)for(var l=0,c=n.length;c>l;l++)i=n[l],a=i.placeholder,a.parentNode.insertBefore(i.fragment,a),o[r].callback(a.previousElementSibling),elRemove(a)},_convertSpecials:function(e){return e=e.replace(/&amp;/g,"&"),e=e.replace(/&lt;/g,"<"),e=e.replace(/&gt;/g,">")},_setup:function(){a.length||(a=[{tagName:"STRONG",bbcode:"b"},{tagName:"DEL",bbcode:"s"},{tagName:"EM",bbcode:"i"},{tagName:"SUB",bbcode:"sub"},{tagName:"SUP",bbcode:"sup"},{tagName:"U",bbcode:"u"},{tagName:"KBD",bbcode:"tt"},{tagName:"A",callback:this._convertUrl.bind(this)},{tagName:"IMG",callback:this._convertImage.bind(this)},{tagName:"LI",callback:this._convertListItem.bind(this)},{tagName:"OL",callback:this._convertList.bind(this)},{tagName:"TABLE",callback:this._convertTable.bind(this)},{tagName:"UL",callback:this._convertList.bind(this)},{tagName:"BLOCKQUOTE",callback:this._convertBlockquote.bind(this)},{tagName:"SPAN",callback:this._convertSpan.bind(this)},{tagName:"DIV",callback:this._convertDiv.bind(this)}],r={span:[{style:"color",callback:this._convertInlineColor.bind(this)},{style:"font-size",callback:this._convertInlineFontSize.bind(this)},{style:"font-family",callback:this._convertInlineFontFamily.bind(this)}],div:[{style:"text-align",callback:this._convertInlineTextAlign.bind(this)}]},o=[{selector:"div.codeBox",callback:this._convertSourceCodeBox.bind(this)}],e.fire("com.woltlab.wcf.bbcode.fromHtml","init",{converter:a,inlineConverter:r,sourceConverter:o}))},_convert:function(e,t){if("function"==typeof t)return void t(e);for(var i,n=elByTag(t.tagName,e);n.length;)i=n[0],t.bbcode?i.outerHTML="["+t.bbcode+"]"+i.innerHTML+"[/"+t.bbcode+"]":t.callback(i)},_convertBlockquote:function(e){var n=elData(e,"author"),a=elAttr(e,"cite"),r="[quote]";n&&(n=t.escapeHTML(n).replace(/(\\)?'/g,function(e,t){return t?e:"\\'"}),r=a?"[quote='"+n+"','"+t.escapeHTML(a)+"']":"[quote='"+n+"']");var o=i.childByTag(e,"HEADER");null!==o&&e.removeChild(o);for(var s=i.childrenByTag(e,"DIV"),l=0,c=s.length;c>l;l++)s[l].outerHTML=s[l].innerHTML+"\n";e.outerHTML=r+e.innerHTML.replace(/^\n*/,"").replace(/\n*$/,"")+"[/quote]\n"},_convertImage:function(e){if(e.classList.contains("smiley"))return void(e.outerHTML=(n(e,!0)?" ":"")+elAttr(e,"alt")+(n(e,!1)?" ":""));var t=e.style.getPropertyValue("float")||"none",i=e.style.getPropertyValue("width");if(i="string"==typeof i?~~i.replace(/px$/,""):0,e.classList.contains("redactorEmbeddedAttachment")){var a=elData(e,"attachment-id");i>0?e.outerHTML="[attach="+a+","+t+","+i+"][/attach]":"none"!==t?e.outerHTML="[attach="+a+","+t+"][/attach]":e.outerHTML="[attach="+a+"][/attach]"}else{var r=e.src.trim();i>0?e.outerHTML="[img='"+r+"',"+t+","+i+"][/img]":"none"!==t?e.outerHTML="[img='"+r+"',"+t+"][/img]":e.outerHTML="[img]"+r+"[/img]"}},_convertList:function(e){var t;if("OL"===e.nodeName)t="[list=1]";else{var i=e.style.getPropertyValue("list-style-type")||"";t=""===i?"[list]":"[list="+("lower-latin"===i?"a":i)+"]"}e.outerHTML=t+e.innerHTML+"[/list]"},_convertListItem:function(e){"UL"!==e.parentNode.nodeName&&"OL"!==e.parentNode.nodeName?e.outerHTML=e.innerHTML:e.outerHTML="[*]"+e.innerHTML},_convertSpan:function(e){if(e.style.length||e.className)for(var t,i,n=0,a=r.span.length;a>n;n++)t=r.span[n],t.style?(i=e.style.getPropertyValue(t.style)||"",i&&t.callback(e,i)):e.classList.contains(t.className)&&t.callback(e);e.outerHTML=e.innerHTML},_convertDiv:function(e){if(e.className.length||e.style.length)for(var t,i,n=0,a=r.div.length;a>n;n++)t=r.div[n],t.className&&e.classList.contains(t.className)?t.callback(e):t.style&&(i=e.style.getPropertyValue(t.style)||"",i&&t.callback(e,i));e.outerHTML=e.innerHTML},_convertInlineColor:function(e,t){if(t.match(/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/i)){var i=RegExp.$1,n=RegExp.$2,a=RegExp.$3,r="0123456789ABCDEF";t="#"+(r.charAt((i-i%16)/16)+""+r.charAt(i%16))+(r.charAt((n-n%16)/16)+""+r.charAt(n%16))+(r.charAt((a-a%16)/16)+""+r.charAt(a%16))}e.innerHTML="[color="+t+"]"+e.innerHTML+"[/color]"},_convertInlineFontSize:function(e,t){t.match(/^(\d+)pt$/)?t=RegExp.$1:t.match(/^(\d+)(px|em|rem|%)$/)?(t=window.getComputedStyle(t).fontSize.replace(/^(\d+).*$/,"$1"),t=Math.round(t)):t="",t&&(t=Math.min(Math.max(t,8),36),e.innerHTML="[size="+t+"]"+e.innerHTML+"[/size]")},_convertInlineFontFamily:function(e,t){e.innerHTML="[font="+t.replace(/'/g,"")+"]"+e.innerHTML+"[/font]"},_convertInlineTextAlign:function(e,t){-1!==["center","justify","left","right"].indexOf(t)&&(e.innerHTML="[align="+t+"]"+e.innerHTML+"[/align]")},_convertTable:function(e){for(var t=elByTag("TD",e);t.length;)t[0].outerHTML="[td]"+t[0].innerHTML+"[/td]\n";for(t=elByTag("TR",e);t.length;)t[0].outerHTML="\n[tr]\n"+t[0].innerHTML+"[/tr]";var n=i.childByTag(e,"TBODY"),a=null===n?e.innerHTML:n.innerHTML;e.outerHTML="\n[table]"+a+"\n[/table]\n"},_convertUrl:function(e){var t=e.textContent.trim(),i=e.href.trim(),n="url";return""===i||""===t?void(e.outerHTML=e.innerHTML):(0===i.indexOf("mailto:")&&(i=i.substr(7),n="email"),void(i===t?e.outerHTML="["+n+"]"+i+"[/"+n+"]":e.outerHTML="["+n+"='"+i+"']"+e.innerHTML+"[/"+n+"]"))},_convertSourceCodeBox:function(e){var t=elData(e,"filename").trim()||"",n=elData(e,"highlighter");window.dtdesign=e;for(var a=i.childByTag(e.children[0],"OL"),r=~~elAttr(a,"start")||1,o="",s=0,l=a.childElementCount;l>s;s++)o&&(o+="\n"),o+=a.children[s].textContent;var c="[code='"+n+"',"+r+",'"+t+"']";e.outerHTML=c+o+"[/code]"}};return s}),define("WoltLab/WCF/Bbcode/Parser",[],function(){"use strict";var e={parse:function(e){var t=this._splitTags(e);return this._buildLinearTree(t),t},_splitTags:function(e){for(var t,i,n=__REDACTOR_BBCODES.join("|"),a="(\\[(?:/(?:"+n+")|(?:"+n+")(?:=(?:\\'[^\\'\\\\]*(?:\\\\.[^\\'\\\\]*)*\\'|[^,\\]]*)(?:,(?:\\'[^\\'\\\\]*(?:\\\\.[^\\'\\\\]*)*'|[^,\\]]*))*)?)\\])",r=new RegExp("^"+a+"$","i"),o=e.split(new RegExp(a,"i")),s=[],l=0,c=o.length;c>l;l++)t=o[l],""!==t&&(t.match(r)?(i={name:"",closing:!1,attributes:[],source:t},"/"===t[1]?(i.name=t.substring(2,t.length-1),i.closing=!0):t.match(/^\[([a-z0-9]+)=?(.*)\]$/i)&&(i.name=RegExp.$1,RegExp.$2&&(i.attributes=this._parseAttributes(RegExp.$2))),s.push(i)):s.push(t));return s},_buildLinearTree:function(e){for(var t,i,n=[],a="",r=0;r<e.length;r++)if(t=e[r],"object"==typeof t){if(a.length&&(t.name!==a||!t.closing)){e[r]=t.source;continue}if(t.closing){if(this._hasOpenTag(n,t.name)){i=this._closeUnclosedTags(e,n,t.name);for(var o=0,s=i.length;s>o;o++)e.splice(r,i[o]),r++;n.pop().pair=r}else e[r]=t.source;a===t.name&&(a="")}else n.push(t),-1!==__REDACTOR_SOURCE_BBCODES.indexOf(t.name)&&(a=t.name)}this._closeUnclosedTags(e,n,"")},_closeUnclosedTags:function(e,t,i){for(var n,a,r=[],o=t.length-1;o>=0&&(n=t[o],n.name!==i);o--)a={name:n.name,closing:!0,attributes:n.attributes.slice(),source:"[/"+n.name+"]"},n.pair=e.length,e.push(a),t.pop(),r.push({name:n.name,closing:!1,attributes:n.attributes.slice(),source:n.source});return r.reverse()},_hasOpenTag:function(e,t){for(var i=e.length-1;i>=0;i--)if(e[i].name===t)return!0;return!1},_parseAttributes:function(e){for(var t,i=e.split(/(?:^|,)('[^'\\\\]*(?:\\\\.[^'\\\\]*)*'|[^,]*)/g),n=[],a=0,r=i.length;r>a;a++)t=i[a],""!==t&&("'"===t.charAt(0)&&"'"===t.substr(-1)?n.push(t.substring(1,t.length-1).trim()):n.push(t.trim()));return n}};return e}),define("WoltLab/WCF/Bbcode/ToHtml",["Core","EventHandler","Language","StringUtil","WoltLab/WCF/Bbcode/Parser"],function(e,t,i,n,a){"use strict";function r(e){return e&&e==~~e}function o(e){return-1!==e.indexOf(".")||!r(e)&&!s(e)}function s(e){return objOwns(__REDACTOR_CODE_HIGHLIGHTERS,e)}var l=null,c={},d=[],u=[],h={convert:function(i,n){c=e.extend({attachments:{images:{},thumbnailUrl:"",url:""}},n),this._convertSpecials(i);var r=a.parse(i);r.length&&this._initBBCodes(),t.fire("com.woltlab.wcf.bbcode.toHtml","beforeConvert",{stack:r});for(var o,s,l=0,d=r.length;d>l;l++)o=r[l],"object"==typeof o&&(s=this._convert(r,o,l),Array.isArray(s)?(r[l]=null===s[0]?o.source:s[0],r[o.pair]=null===s[1]?r[o.pair].source:s[1]):r[l]=s);return t.fire("com.woltlab.wcf.bbcode.toHtml","afterConvert",{stack:r}),i=r.join(""),i=i.replace(/\n/g,"<br>")},_convertSpecials:function(e){return e=e.replace(/&/g,"&amp;"),e=e.replace(/</g,"&lt;"),e=e.replace(/>/g,"&gt;")},_initBBCodes:function(){null===l&&(l={b:"strong",i:"em",u:"u",s:"del",sub:"sub",sup:"sup",table:"table",td:"td",tr:"tr",tt:"kbd",align:this._convertAlignment.bind(this),attach:this._convertAttachment.bind(this),color:this._convertColor.bind(this),code:this._convertCode.bind(this),email:this._convertEmail.bind(this),list:this._convertList.bind(this),quote:this._convertQuote.bind(this),size:this._convertSize.bind(this),url:this._convertUrl.bind(this),img:this._convertImage.bind(this)},d=["quote","table","td","tr"],u=["table","td","tr"],t.fire("com.woltlab.wcf.bbcode.toHtml","init",{bbcodes:l,removeNewlineAfter:d,removeNewlineBefore:u}))},_convert:function(e,t,i){var n,a=l[t.name];return void 0===a?[null,null]:(-1!==d.indexOf(t.name)&&(n=e[i+1],"string"==typeof n&&(e[i+1]=n.replace(/^\n/,"")),e.length>t.pair+1&&(n=e[t.pair+1],"string"==typeof n&&(e[t.pair+1]=n.replace(/^\n/,"")))),-1!==u.indexOf(t.name)&&(i-1>=0&&(n=e[i-1],"string"==typeof n&&(e[i-1]=n.replace(/\n$/,""))),n=e[t.pair-1],"string"==typeof n&&(e[t.pair-1]=n.replace(/\n$/,""))),this._convertSmilies(e),"string"==typeof a?["<"+a+">","</"+a+">"]:a(e,t,i))},_convertAlignment:function(e,t,i){var n=t.attributes.length?t.attributes[0]:"";return-1===["center","justify","left","right"].indexOf(n)?[null,null]:['<div style="text-align: '+n+'">',"</div>"]},_convertAttachment:function(e,t,i){var n=0,a=t.attributes,r=a.length;if(c.attachments.url?r>0&&(n=~~a[0],objOwns(c.attachments.images,n)||(r=0)):r=0,0===r)return[null,null];var o=~~c.attachments.images[n].height,s=~~c.attachments.images[n].width,l=["max-height: "+o+"px","max-width: "+s+"px"];r>1&&("left"===t.attributes[1]||"right"===a[1])&&(l.push("float: "+a[1]),l.push("margin: "+("left"===a[1]?"0 15px 7px 0":"0 0 7px 15px")));var d,u=c.attachments.thumbnailUrl;return r>2&&(d=~~a[2]||0,d&&(d>s&&(d=s),l.push("width: "+d+"px"),u=c.attachments.url)),['<img src="'+u.replace(/987654321/,n)+'" class="redactorEmbeddedAttachment redactorDisableResize" data-attachment-id="'+n+'"'+(l.length?' style="'+l.join(";")+'"':"")+">",""]},_convertCode:function(e,t,i){var a=t.attributes,l="",c="auto",d=0;switch(a.length){case 1:r(a[0])?d=~~a[0]:o(a[0])?l=a[0]:s(a[0])&&(c=a[0]);break;case 2:r(a[0])?(d=~~a[0],s(a[1])?c=a[1]:o(a[1])&&(l=a[1])):(s(a[0])&&(c=a[0]),o(a[1])&&(l=a[1]));break;case 3:s(a[0])&&(c=a[0]),r(a[1])&&(d=~~a[1]),o(a[2])&&(l=a[2])}for(var u,h,p=!0,f=-1,m=i+1;m<t.pair;m++){if(h=e[m],""===h.trim()){if(p){e[m]="";continue}-1===f&&(f=m)}else p=!1,f=-1;u=h.split("\n");for(var g=0,v=u.length;v>g;g++)u[g]="<li>"+(u[g]?n.escapeHTML(u[g]):"​")+"</li>";e[m]=u.join("")}if(!p&&-1!==f)for(var m=t.pair-1;m>=f;m--)e[m]="";return['<div class="codeBox container" contenteditable="false" data-highlighter="'+c+'" data-filename="'+(l?n.escapeHTML(l):"")+'"><div><div><h3>'+__REDACTOR_CODE_HIGHLIGHTERS[c]+(l?": "+n.escapeHTML(l):"")+'</h3></div><ol start="'+(d>1?d:1)+'">',"</ol></div></div>"]},_convertColor:function(e,t,i){return t.attributes.length&&t.attributes[0].match(/^[a-z0-9#]+$/i)?['<span style="color: '+n.escapeHTML(t.attributes[0])+'">',"</span>"]:[null,null]},_convertEmail:function(e,t,i){var a="";if(t.attributes.length)a=t.attributes[0];else{for(var r,o=i+1;o<t.pair;o++){if(r=e[o],"object"==typeof r){a="";break}a+=r}if(""===a.trim())return[null,null]}return['<a href="mailto:'+n.escapeHTML(a)+'">',"</a>"]},_convertImage:function(e,t,i){var a="none",r="",o=0;switch(t.attributes.length){case 0:if(!(i+1<t.pair&&"string"==typeof e[i+1]))return"";r=e[i+1],e[i+1]="";break;case 1:r=t.attributes[0];break;case 2:r=t.attributes[0],a=t.attributes[1];break;case 3:r=t.attributes[0],a=t.attributes[1],o=~~t.attributes[2]}"left"!==a&&"right"!==a&&(a="none");var s=[];return o>0&&s.push("width: "+o+"px"),"none"!==a&&(s.push("float: "+a),s.push("margin: "+("left"===a?"0 15px 7px 0":"0 0 7px 15px"))),['<img src="'+n.escapeHTML(r)+'"'+(s.length?' style="'+s.join(";")+'"':"")+">",""]},_convertList:function(e,t,i){for(var n=t.attributes.length?t.attributes[0]:"",a=i+1;a<t.pair;a++)"string"==typeof e[a]&&(e[a]=e[a].replace(/\[\*\]/g,"<li>"));return"1"==n||"decimal"===n?["<ol>","</ol>"]:n.length&&n.match(/^(?:none|circle|square|disc|decimal|lower-roman|upper-roman|decimal-leading-zero|lower-greek|lower-latin|upper-latin|armenian|georgian)$/)?['<ul style="list-style-type: '+n+'">',"</ul>"]:["<ul>","</ul>"]},_convertQuote:function(e,t,a){var r="",o="";t.attributes.length>1?(r=t.attributes[0],o=t.attributes[1]):1===t.attributes.length&&(r=t.attributes[0]);for(var s=t.pair-1;s>a;s--)if("string"==typeof e[s]){e[s]=e[s].replace(/\n$/,"");break}var l="";return r?(o&&(l='<a href="'+n.escapeHTML(o)+'" tabindex="-1">'),l+=i.get("wcf.bbcode.quote.title.javascript",{quoteAuthor:r.replace(/\\'/g,"'")}),o&&(l+="</a>")):l="<small>"+i.get("wcf.bbcode.quote.title.clickToSet")+"</small>",['<blockquote class="quoteBox container containerPadding quoteBoxSimple" cite="'+n.escapeHTML(o)+'" data-author="'+n.escapeHTML(r)+'"><header contenteditable="false"><h3>'+l+'</h3><a class="redactorQuoteEdit"></a></header><div>​',"</div></blockquote>"]},_convertSmilies:function(e){for(var t,i,a,r=0,o=e.length;o>r;r++)if(i=e[r],"string"==typeof i){for(var s in __REDACTOR_SMILIES)objOwns(__REDACTOR_SMILIES,s)&&(t=s.replace(/</g,"&lt;").replace(/>/g,"&gt;"),a=new RegExp("(\\s|^)"+n.escapeRegExp(s)+"(?=\\s|$)","gi"),i=i.replace(a,'$1<img src="'+__REDACTOR_SMILIES[s]+'" class="smiley" alt="'+t+'">'));e[r]=i}else-1!==__REDACTOR_SOURCE_BBCODES.indexOf(i.name)&&(r=i.pair)},_convertSize:function(e,t,i){return t.attributes.length&&0!==~~t.attributes[0]?['<span style="font-size: '+~~t.attributes[0]+'pt">',"</span>"]:[null,null]},_convertUrl:function(e,t,i){return t.attributes.length?['<a href="'+n.escapeHTML(t.attributes[0])+'">',"</a>"]:[null,null]}};return h}),define("WoltLab/WCF/Controller/Clipboard",["Ajax","Core","Dictionary","EventHandler","Language","List","ObjectMap","Dom/ChangeListener","Dom/Traverse","Dom/Util","Ui/Confirmation","Ui/SimpleDropdown","WoltLab/WCF/Ui/Page/Action"],function(e,t,i,n,a,r,o,s,l,c,d,u,h){"use strict";var p=new i,f=new i,m=new i,g=elByClass("jsClipboardContainer"),v=new o,b=new r,_={},y=null,w=null,C=null;return{setup:function(e){if(y=this._mark.bind(this),w=this._executeAction.bind(this),C=this._unmarkAll.bind(this),_=t.extend({hasMarkedItems:!1,pageClassName:"",pageObjectId:0},e),!_.pageClassName)throw new Error("Expected a non-empty string for parameter 'pageClassName'.");this._initContainers(),_.hasMarkedItems&&g.length&&this._loadMarkedItems(),s.add("WoltLab/WCF/Controller/Clipboard",this._initContainers.bind(this))},reload:function(){p.size&&this._loadMarkedItems()},_initContainers:function(){for(var e=0,t=g.length;t>e;e++){var i=g[e],n=c.identify(i),a=p.get(n);if(void 0===a){var o=elBySel(".jsClipboardMarkAll",i);null!==o&&(elData(o,"container-id",n),o.addEventListener("click",this._markAll.bind(this))),a={checkboxes:elByClass("jsClipboardItem",i),element:i,markAll:o,markedObjectIds:new r},p.set(n,a)}for(var s=0,l=a.checkboxes.length;l>s;s++){var d=a.checkboxes[s];b.has(d)||(elData(d,"container-id",n),d.addEventListener("click",y),b.add(d))}}},_loadMarkedItems:function(){e.api(this,{actionName:"getMarkedItems",parameters:{pageClassName:_.pageClassName,pageObjectID:_.pageObjectId}})},_markAll:function(e){for(var t=e.currentTarget,i="INPUT"!==t.nodeName||t.checked,n=[],a=elData(t,"container-id"),r=p.get(a),o=elData(r.element,"type"),s=0,c=r.checkboxes.length;c>s;s++){var d=r.checkboxes[s],u=~~elData(d,"object-id");i?d.checked||(d.checked=!0,r.markedObjectIds.add(u),n.push(u)):d.checked&&(d.checked=!1,r.markedObjectIds["delete"](u),n.push(u));var h=l.parentByClass(t,"jsClipboardObject");null!==h&&h.classList[i?"addClass":"removeClass"]("jsMarked")}this._saveState(o,n,i)},_mark:function(e){var t=e.currentTarget,i=~~elData(t,"object-id"),n=t.checked,a=elData(t,"container-id"),r=p.get(a),o=elData(r.element,"type"),s=l.parentByClass(t,"jsClipboardObject");if(r.markedObjectIds[n?"add":"delete"](i),s.classList[n?"add":"remove"]("jsMarked"),null!==r.markAll){for(var c=!0,d=0,u=r.checkboxes.length;u>d;d++)if(!r.checkboxes[d].checked){c=!1;break}r.markAll.checked=c}this._saveState(o,[i],n)},_saveState:function(t,i,n){e.api(this,{actionName:n?"mark":"unmark",parameters:{pageClassName:_.pageClassName,pageObjectID:_.pageObjectId,objectIDs:i,objectType:t}})},_executeAction:function(e){var t=e.currentTarget,i=v.get(t);if(i.url)return void(window.location.href=i.url);var a=function(){var e=elData(t,"type");n.fire("com.woltlab.wcf.clipboard",e,{data:i,listItem:t,responseData:null})},r="string"==typeof i.internalData.confirmMessage?i.internalData.confirmMessage:"",o=!0;if("object"==typeof i.parameters&&i.parameters.actionName&&i.parameters.className){if("unmarkAll"===i.parameters.actionName||Array.isArray(i.parameters.objectIDs))if(r.length){var s="string"==typeof i.internalData.template?i.internalData.template:"";d.show({confirm:function(){var e={};if(s.length)for(var n=elBySelAll("input, select, textarea",d.getContentElement()),a=0,r=n.length;r>a;a++){var o=n[a],l=elAttr(o,"name");switch(o.nodeName){case"INPUT":o.checked&&(e[l]=elAttr(o,"value"));break;case"SELECT":e[l]=o.value;break;case"TEXTAREA":e[l]=o.value.trim()}}this._executeProxyAction(t,i,e)}.bind(this),message:r,template:s})}else this._executeProxyAction(t,i)}else r.length&&(o=!1,d.show({confirm:a,message:r}));o&&a()},_executeProxyAction:function(t,i,a){a=a||{};var r="unmarkAll"!==i.parameters.actionName?i.parameters.objectIDs:[],o={data:a};if("object"==typeof i.internalData.parameters)for(var s in i.internalData.parameters)objOwns(i.internalData.parameters,s)&&(o[s]=i.internalData.parameters[s]);e.api(this,{actionName:i.parameters.actionName,className:i.parameters.className,objectIDs:r,parameters:o},function(e){if("unmarkAll"!==i.actionName){var a=elData(t,"type");n.fire("com.woltlab.wcf.clipboard",a,{data:i,listItem:t,responseData:e})}this._loadMarkedItems()}.bind(this))},_unmarkAll:function(t){var i=elData(t.currentTarget,"type");e.api(this,{actionName:"unmarkAll",parameters:{objectType:i}})},_ajaxSetup:function(){return{data:{className:"wcf\\data\\clipboard\\item\\ClipboardItemAction"}}},_ajaxSuccess:function(e){if("unmarkAll"===e.actionName)return void p.forEach(function(t){if(elData(t.element,"type")===e.returnValues.objectType){for(var i=elByClass("jsMarked",t.element);i.length;)i[0].classList.remove("jsMarked");null!==t.markAll&&(t.markAll.checked=!1);for(var n=0,a=t.checkboxes.length;a>n;n++)t.checkboxes[n].checked=!1;h.remove("wcfClipboard-"+e.returnValues.objectType)}}.bind(this));v=new o,p.forEach(function(t){var i=elData(t.element,"type"),n=e.returnValues.markedItems&&objOwns(e.returnValues.markedItems,i)?e.returnValues.markedItems[i]:[];this._rebuildMarkings(t,n)}.bind(this));var t,i=[];if(e.returnValues&&e.returnValues.items)for(t in e.returnValues.items)objOwns(e.returnValues.items,t)&&i.push(t);if(f.forEach(function(e,t){-1===i.indexOf(t)&&(h.remove("wcfClipboard-"+t),m.get(t).innerHTML="")}),e.returnValues&&e.returnValues.items){var n,r,s,l,c,d,g,b,_,y;for(t in e.returnValues.items)if(objOwns(e.returnValues.items,t)){l=e.returnValues.items[t],n=!1,s=f.get(t),r=m.get(t),void 0===s?(n=!0,s=elCreate("a"),s.className="dropdownToggle",s.textContent=l.label,f.set(t,s),r=elCreate("ol"),r.className="dropdownMenu",m.set(t,r)):(s.textContent=l.label,r.innerHTML="");for(b in l.items)objOwns(l.items,b)&&(g=l.items[b],d=elCreate("li"),_=elCreate("span"),_.textContent=g.label,d.appendChild(_),r.appendChild(d),elData(d,"type",t),d.addEventListener("click",w),v.set(d,g));c=elCreate("li"),c.classList.add("dropdownDivider"),r.appendChild(c),y=elCreate("li"),elData(y,"type",t),_=elCreate("span"),_.textContent=a.get("wcf.clipboard.item.unmarkAll"),y.appendChild(_),y.addEventListener("click",C),r.appendChild(y),-1!==i.indexOf(t)&&h.add("wcfClipboard-"+t,s),n&&(s.parentNode.classList.add("dropdown"),s.parentNode.appendChild(r),u.init(s))}}},_rebuildMarkings:function(e,t){for(var i=!0,n=0,a=e.checkboxes.length;a>n;n++){var r=e.checkboxes[n],o=l.parentByClass(r,"jsClipboardObject"),s=-1!==t.indexOf(~~elData(r,"object-id"));s||(i=!1),r.checked=s,o.classList[s?"add":"remove"]("jsMarked")}null!==e.markAll&&(e.markAll.checked=i)}}}),define("WoltLab/WCF/Event/Key",[],function(){"use strict";function e(e,t,i){if(!(e instanceof Event))throw new TypeError("Expected a valid event when testing for key '"+t+"'.");return e.key===t||e.which===i}return{ArrowDown:function(t){return e(t,"ArrowDown",40)},ArrowLeft:function(t){return e(t,"ArrowLeft",37)},ArrowRight:function(t){return e(t,"ArrowRight",39)},ArrowUp:function(t){return e(t,"ArrowUp",38)},Enter:function(t){return e(t,"Enter",13)},Escape:function(t){return e(t,"Escape",27)}}}),define("WoltLab/WCF/File/Util",[],function(){var e={getIconClassByMimeType:function(e){if("image/"==e.substr(0,6))return"fa-file-image-o";if("video/"==e.substr(0,6))return"fa-file-video-o";if("audio/"==e.substr(0,6))return"fa-file-sound-o";if("text/"==e.substr(0,5))return"fa-file-text-o";switch(e){case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return"fa-file-word-o";case"application/pdf":return"fa-file-pdf-o";case"application/vnd.ms-powerpoint":case"application/vnd.openxmlformats-officedocument.presentationml.presentation":return"fa-file-powerpoint-o";case"application/vnd.ms-excel":case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return"fa-file-excel-o";case"application/zip":case"application/x-tar":case"application/x-gzip":return"fa-file-archive-o";case"application/xml":return"fa-file-text-o"}return"fa-file-o"}};return e}),define("WoltLab/WCF/Language/Chooser",["Dictionary","Language","Dom/Traverse","Dom/Util","ObjectMap","Ui/SimpleDropdown"],function(e,t,i,n,a,r){"use strict";var o=new e,s=!1,l=new a,c=null;return{init:function(e,t,i,n,a,r){if(!o.has(t)){var s=elById(e);if(null===s)throw new Error("Expected a valid container id, cannot find '"+t+"'.");var l=elById(t);null===l&&(l=elCreate("input"),elAttr(l,"type","hidden"),elAttr(l,"id",t),elAttr(l,"name",t),elAttr(l,"value",i),s.appendChild(l)),this._initElement(t,l,i,n,a,r)}},_setup:function(){s||(s=!0,c=this._submit.bind(this))},_initElement:function(e,n,a,s,d,u){var h;"DD"===n.parentNode.nodeName?(h=elCreate("div"),h.className="dropdown",n.parentNode.insertBefore(h,n)):(h=n.parentNode,h.classList.add("dropdown")),elHide(n);var p=elCreate("a");p.className="dropdownToggle boxFlag box24 inputPrefix"+("DD"===n.parentNode.nodeName?" button":""),h.appendChild(p);var f=elCreate("ul");f.className="dropdownMenu",h.appendChild(f);var m,g,v,b,_,y=function(t){var n=~~elData(t.currentTarget,"language-id"),a=i.childByClass(f,"active");null!==a&&a.classList.remove("active"),n&&t.currentTarget.classList.add("active"),this._select(e,n,t.currentTarget)}.bind(this);for(var w in s)if(objOwns(s,w)){var C=s[w];_=elCreate("li"),_.className="boxFlag",_.addEventListener("click",y),elData(_,"language-id",w),f.appendChild(_),m=elCreate("a"),m.className="box24",_.appendChild(m),g=elCreate("div"),m.appendChild(g),b=elCreate("img"),elAttr(b,"src",C.iconPath),elAttr(b,"alt",""),b.className="iconFlag",g.appendChild(b),g=elCreate("div"),m.appendChild(g),v=elCreate("h3"),v.textContent=C.languageName,g.appendChild(v),w==a&&(p.innerHTML=_.firstChild.innerHTML)}if(u)_=elCreate("li"),_.className="dropdownDivider",f.appendChild(_),_=elCreate("li"),elData(_,"language-id",w),_.addEventListener("click",y),f.appendChild(_),m=elCreate("a"),m.textContent=t.get("wcf.global.language.noSelection"),_.appendChild(m),0===a&&(p.innerHTML=_.firstChild.innerHTML),_.addEventListener("click",y);else if(0===a){p.innerHTML=null,g=elCreate("div"),p.appendChild(g);var L=elCreate("span");L.className="icon icon24 fa-question",g.appendChild(L),g=elCreate("div"),p.appendChild(g),v=elCreate("h3"),v.textContent=t.get("wcf.global.language.noSelection"),g.appendChild(v)}r.init(p),o.set(e,{callback:d,dropdownMenu:f,dropdownToggle:p,element:n});var E=i.parentByTag(n,"FORM");if(null!==E){E.addEventListener("submit",c);var x=l.get(E);void 0===x&&(x=[],l.set(E,x)),x.push(e)}},_select:function(e,t,i){var n=o.get(e);if(void 0===i){for(var a=n.dropdownMenu.childNodes,r=0,s=a.length;s>r;r++){var l=a[r];if(~~elData(l,"language-id")===t){i=l;break}}if(void 0===i)throw new Error("Cannot select unknown language id '"+t+"'")}n.element.value=t,n.dropdownToggle.innerHTML=i.firstChild.innerHTML,o.set(e,n),"function"==typeof n.callback&&n.callback(i)},_submit:function(e){for(var t,i=l.get(e.currentTarget),n=0,a=i.length;a>n;n++)t=elCreate("input"),t.type="hidden",t.name=i[n],t.value=this.getLanguageId(i[n]),e.currentTarget.appendChild(t)},getChooser:function(e){var t=o.get(e);if(void 0===t)throw new Error("Expected a valid language chooser input element, '"+e+"' is not i18n input field.");return t},getLanguageId:function(e){return~~this.getChooser(e).element.value},setLanguageId:function(e,t){if(void 0===o.get(e))throw new Error("Expected a valid  input element, '"+e+"' is not i18n input field.");this._select(e,t)}}}),define("WoltLab/WCF/Language/Input",["Core","Dictionary","Language","ObjectMap","StringUtil","Dom/Traverse","Dom/Util","Ui/SimpleDropdown"],function(e,t,i,n,a,r,o,s){"use strict";var l=new t,c=!1,d=new n,u=new t,h=null,p=null,f={init:function(e,i,n,r){if(!u.has(e)){var o=elById(e);if(null===o)throw new Error("Expected a valid element id, cannot find '"+e+"'.");this._setup();var s=new t;for(var l in i)objOwns(i,l)&&s.set(~~l,a.unescapeHTML(i[l]));u.set(e,s),this._initElement(e,o,s,n,r)}},_setup:function(){c||(c=!0,h=this._dropdownToggle.bind(this),p=this._submit.bind(this))},_initElement:function(e,t,n,a,c){var u=t.parentNode;u.classList.contains("inputAddon")||(u=elCreate("div"),u.className="inputAddon"+("TEXTAREA"===t.nodeName?" inputAddonTextarea":""),elData(u,"input-id",e),t.parentNode.insertBefore(u,t),u.appendChild(t)),u.classList.add("dropdown");var f=elCreate("span");f.className="button dropdownToggle inputPrefix";var m=elCreate("span");m.textContent=i.get("wcf.global.button.disabledI18n"),f.appendChild(m),u.insertBefore(f,t);var g=elCreate("ul");g.className="dropdownMenu",o.insertAfter(g,f);var v=function(t,i){var n=~~elData(t.currentTarget,"language-id"),a=r.childByClass(g,"active");null!==a&&a.classList.remove("active"),n&&t.currentTarget.classList.add("active"),this._select(e,n,i||!1)}.bind(this);for(var b in a)if(objOwns(a,b)){var _=elCreate("li");elData(_,"language-id",b),m=elCreate("span"),m.textContent=a[b],_.appendChild(m),_.addEventListener("click",v),g.appendChild(_)}if(c!==!0){var _=elCreate("li");_.className="dropdownDivider",g.appendChild(_),_=elCreate("li"),elData(_,"language-id",0),m=elCreate("span"),m.textContent=i.get("wcf.global.button.disabledI18n"),_.appendChild(m),_.addEventListener("click",v),g.appendChild(_)}var y=null;if(c===!0||n.size)for(var w=0,C=g.childElementCount;C>w;w++)if(~~elData(g.children[w],"language-id")===LANGUAGE_ID){y=g.children[w];break}s.init(f),s.registerCallback(u.id,h),l.set(e,{buttonLabel:f.children[0],element:t,languageId:0,isEnabled:!0,forceSelection:c});var L=r.parentByTag(t,"FORM");if(null!==L){L.addEventListener("submit",p);var E=d.get(L);void 0===E&&(E=[],d.set(L,E)),E.push(e)}null!==y&&v({currentTarget:y},!0)},_select:function(e,i,n){for(var a,r=l.get(e),o=s.getDropdownMenu(r.element.parentNode.id),c="",d=0,h=o.childElementCount;h>d;d++){a=o.children[d];var p=elData(a,"language-id");p.length&&i===~~p&&(c=a.children[0].textContent)}if(r.languageId!==i){var f=u.get(e);r.languageId&&f.set(r.languageId,r.element.value),0===i?u.set(e,new t):(r.buttonLabel.classList.contains("active")||n===!0)&&(r.element.value=f.has(i)?f.get(i):""),r.buttonLabel.textContent=c,r.buttonLabel.classList[i?"add":"remove"]("active"),r.languageId=i}r.element.blur(),r.element.focus()},_dropdownToggle:function(e,t){if("open"===t)for(var i,n,a=s.getDropdownMenu(e),r=elData(elById(e),"input-id"),o=u.get(r),l=0,c=a.childElementCount;c>l;l++)i=a.children[l],n=~~elData(i,"language-id"),n&&i.classList[o.has(n)||!o.size?"remove":"add"]("missingValue")},_submit:function(e){for(var t,i,n,a,r=d.get(e.currentTarget),o=0,s=r.length;s>o;o++)i=r[o],t=l.get(i),t.isEnabled&&(a=u.get(i),t.languageId&&a.set(t.languageId,t.element.value),a.size&&(a.forEach(function(t,a){n=elCreate("input"),n.type="hidden",n.name=i+"_i18n["+a+"]",n.value=t,e.currentTarget.appendChild(n)}),t.element.removeAttribute("name")))},getValues:function(e){var t=l.get(e);if(void 0===t)throw new Error("Expected a valid i18n input element, '"+e+"' is not i18n input field.");var i=u.get(e);return i.set(t.languageId,t.element.value),i},setValues:function(i,n){var a=l.get(i);if(void 0===a)throw new Error("Expected a valid i18n input element, '"+i+"' is not i18n input field.");e.isPlainObject(n)&&(n=t.fromObject(n)),a.element.value="",n.has(0)&&(a.element.value=n.get(0),n["delete"](0)),u.set(i,n),a.languageId=0,this._select(i,LANGUAGE_ID,!0)},disable:function(e){var t=l.get(e);if(void 0===t)throw new Error("Expected a valid i18n input element, '"+e+"' is not i18n input field.");if(t.isEnabled){t.isEnabled=!1,elHide(t.buttonLabel.parentNode);var i=t.buttonLabel.parentNode.parentNode;i.classList.remove("inputAddon"),i.classList.remove("dropdown")}},enable:function(e){var t=l.get(e);if(void 0===t)throw new Error("Expected a valid i18n input element, '"+e+"' is not i18n input field.");if(!t.isEnabled){t.isEnabled=!0,elShow(t.buttonLabel.parentNode);var i=t.buttonLabel.parentNode.parentNode;i.classList.add("inputAddon"),i.classList.add("dropdown")}},isEnabled:function(e){var t=l.get(e);if(void 0===t)throw new Error("Expected a valid i18n input element, '"+e+"' is not i18n input field.");return t.isEnabled},validate:function(e,t){var i=l.get(e);if(void 0===i)throw new Error("Expected a valid i18n input element, '"+e+"' is not i18n input field.");if(!i.isEnabled)return!0;var n=u.get(e),a=s.getDropdownMenu(i.element.parentNode.id);
 i.languageId&&n.set(i.languageId,i.element.value);for(var r,o,c=!1,d=!1,h=0,p=a.childElementCount;p>h;h++)if(r=a.children[h],o=~~elData(r,"language-id"))if(n.has(o)&&0!==n.get(o).length){if(c)return!1;d=!0}else{if(d)return!1;c=!0}return c&&!t?!1:!0}};return f}),define("WoltLab/WCF/Ui/Notification",["Language"],function(e){"use strict";var t=!1,i=null,n=null,a=null,r=null,o=null,s={show:function(s,l,c){t||(this._init(),i="function"==typeof l?l:null,n.className=c||"success",n.textContent=e.get(s||"wcf.global.success"),t=!0,a.classList.add("active"),r=setTimeout(o,2e3))},_init:function(){null===a&&(o=this._hide.bind(this),a=elCreate("div"),a.id="systemNotification",n=elCreate("p"),n.addEventListener("click",o),a.appendChild(n),document.body.appendChild(a))},_hide:function(){clearTimeout(r),a.classList.remove("active"),null!==i&&i(),t=!1}};return s}),define("WoltLab/WCF/Media/Editor",["Ajax","Core","Dictionary","Dom/ChangeListener","Dom/Traverse","Language","Ui/Dialog","Ui/Notification","WoltLab/WCF/Language/Chooser","WoltLab/WCF/Language/Input","WoltLab/WCF/File/Util"],function(e,t,i,n,a,r,o,s,l,c,d){"use strict";function u(e){if("object"!=typeof e)throw new TypeError("Parameter 'callbackObject' has to be an object, "+typeof e+" given.");if("function"!=typeof e._editorClose)throw new TypeError("Callback object has no function '_editorClose'.");if("function"!=typeof e._editorSuccess)throw new TypeError("Callback object has no function '_editorSuccess'.");this._callbackObject=e,this._media=null,this._elements={}}return u.prototype={_ajaxSetup:function(){return{data:{actionName:"update",className:"wcf\\data\\media\\MediaAction"}}},_ajaxSuccess:function(e){s.show(),this._callbackObject._editorSuccess(this._media),o.close("mediaEditor"),this._media=null},_close:function(){this._media=null,this._callbackObject._editorClose()},_dialogSetup:function(){return{id:"mediaEditor",options:{backdropCloseOnClick:!1,onClose:this._close.bind(this),title:r.get("wcf.media.edit")},source:{after:function(e,t){var i=o.getDialog("mediaEditor").content;this._elements.thumbnail=elById("mediaThumbnail"),this._elements.filename=elById("mediaFilename"),this._elements.filesize=elById("mediaFilesize"),this._elements.imageDimensions=elById("mediaImageDimensions"),this._elements.fileIcon=elById("mediaFileIcon"),this._elements.uploader=elById("mediaUploader"),this._elements.altText=elById("altText"),this._elements.caption=elById("caption"),this._elements.isMultilingual=elById("isMultilingual"),this._elements.isMultilingual.addEventListener("change",this._updateLanguageFields.bind(this)),this._elements.title=elById("title"),this._elements.languageIdContainer=elById("languageIDContainer");var n=this._keyPress.bind(this);this._elements.altText.addEventListener("keypress",n),this._elements.title.addEventListener("keypress",n),setTimeout(this._setData.bind(this),100),elBySel('button[data-type="submit"]',i).addEventListener("click",this._saveData.bind(this))}.bind(this),data:{actionName:"getEditorDialog",className:"wcf\\data\\media\\MediaAction"}}}},_keyPress:function(e){13===e.charCode&&(e.preventDefault(),this._saveData())},_saveData:function(){var t=!1,i=a.childByClass(this._elements.altText.parentNode.parentNode,"innerError"),n=a.childByClass(this._elements.caption.parentNode.parentNode,"innerError"),o=a.childByClass(this._elements.title.parentNode.parentNode,"innerError");if(this._media.isMultilingual=~~this._elements.isMultilingual.checked,this._media.languageID=this._media.isMultilingual?null:l.getLanguageId("languageID"),this._media.altText={},this._media.caption={},this._media.title={},this._media.isMultilingual){if(!c.validate("altText",!0)&&(t=!0,!i)){var s=elCreate("small");s.className="innerError",s.textContent=r.get("wcf.global.form.error.multilingual"),this._elements.altText.parentNode.parentNode.appendChild(s)}if(!c.validate("caption",!0)&&(t=!0,!n)){var s=elCreate("small");s.className="innerError",s.textContent=r.get("wcf.global.form.error.multilingual"),this._elements.caption.parentNode.parentNode.appendChild(s)}if(!c.validate("title",!0)&&(t=!0,!o)){var s=elCreate("small");s.className="innerError",s.textContent=r.get("wcf.global.form.error.multilingual"),this._elements.title.parentNode.parentNode.appendChild(s)}this._media.altText=c.getValues("altText").toObject(),this._media.caption=c.getValues("caption").toObject(),this._media.title=c.getValues("title").toObject()}else this._media.altText[this._media.languageID]=this._elements.altText.value,this._media.caption[this._media.languageID]=this._elements.caption.value,this._media.title[this._media.languageID]=this._elements.title.value;t||(i&&elRemove(i),n&&elRemove(n),o&&elRemove(o),e.api(this,{actionName:"update",objectIDs:[this._media.mediaID],parameters:{altText:this._media.altText,caption:this._media.caption,data:{isMultilingual:this._media.isMultilingual,languageID:this._media.languageID},title:this._media.title}}))},_setData:function(){if(this._elements.thumbnail.innerHTML="",this._elements.filename.textContent=this._media.filename,this._elements.filesize.textContent=this._media.formattedFilesize,this._elements.uploader.innerHTML="",this._media.userLink){var e=elCreate("a");e.className="userLink",elAttr(e,"href",this._media.userLink),elData(e,"user-id",this._media.userID),e.textContent=this._media.username,this._elements.uploader.appendChild(e)}else this._elements.uploader.textContent=this._media.username;if(this._media.isImage){if(this._media.smallThumbnailLink){var t=elCreate("img");elAttr(t,"src",this._media.smallThumbnailLink),elAttr(t,"alt",""),this._elements.thumbnail.appendChild(t)}this._elements.imageDimensions.textContent=r.get("wcf.media.imageDimensions.value",{height:this._media.height,width:this._media.width}),elShow(this._elements.imageDimensions),elShow(this._elements.imageDimensions.previousElementSibling),this._elements.fileIcon.className="icon icon48 fa-file-image-o"}else elHide(this._elements.imageDimensions),elHide(this._elements.imageDimensions.previousElementSibling),this._elements.fileIcon.className="icon icon48 "+d.getIconClassByMimeType(this._media.fileType);this._elements.isMultilingual.checked=this._media.isMultilingual,l.setLanguageId("languageID",this._media.languageID||LANGUAGE_ID),this._media.isMultilingual?(c.setValues("altText",i.fromObject(this._media.altText||{})),c.setValues("caption",i.fromObject(this._media.caption||{})),c.setValues("title",i.fromObject(this._media.title||{}))):(this._elements.altText.value=this._media.altText?this._media.altText[this._media.languageID]:"",this._elements.caption.value=this._media.caption?this._media.caption[this._media.languageID]:"",this._elements.title.value=this._media.title?this._media.title[this._media.languageID]:""),this._updateLanguageFields(),n.trigger()},_updateLanguageFields:function(){this._elements.isMultilingual.checked?(c.enable("title"),c.enable("caption"),c.enable("altText"),elHide(this._elements.languageIdContainer.parentNode)):(c.disable("title"),c.disable("caption"),c.disable("altText"),elShow(this._elements.languageIdContainer.parentNode))},edit:function(e){if(null!==this._media)throw new Error("Cannot edit media with id '"+e.mediaID+"' while editing media with id '"+this._media.mediaID+"'");this._media=e,void 0!==o.getDialog("mediaEditor")&&this._setData(),o.open(this)}},u}),define("WoltLab/WCF/Media/Search",["Ajax","Dom/Traverse","Dom/Util","Language","Ui/SimpleDropdown"],function(e,t,i,n,a){"use strict";function r(e){this._fileType="all";var i=a.getDropdownMenu(this._getIdPrefix()+"Search");if(i){this._fileTypes=t.childrenBySel(i,"li:not(.dropdownDivider)");for(var n=this._selectFileType.bind(this),r=0,o=this._fileTypes.length;o>r;r++){var s=this._fileTypes[r];e&&elData(s,"file-type")==e&&(this._fileType=e),this._fileTypes[r].addEventListener("click",n)}e&&e.length&&this._updateDropdownButtonLabel(),a.registerCallback(this._getIdPrefix()+"Search",this._updateFileTypeDropdown.bind(this));var l=t.parentByTag(elById(this._getIdPrefix()+"Search"),"FORM");l&&l.addEventListener("submit",function(){var e=elCreate("input");elAttr(e,"type","hidden"),elAttr(e,"name","fileType"),elAttr(e,"value",this._fileType),l.appendChild(e)}.bind(this))}else this._fileType=null}return r.prototype={_getIdPrefix:function(){return"media"},_selectFileType:function(e){this._fileType=elData(e.currentTarget,"file-type"),this._updateDropdownButtonLabel(e)},_updateDropdownButtonLabel:function(e){var i=a.getDropdown(this._getIdPrefix()+"Search"),r=t.childBySel(t.childByClass(i,"dropdownToggle"),"SPAN");if("all"!==this._fileType){var o;if(e)o=e.currentTarget;else for(var s=0,l=this._fileTypes.length;l>s;s++){var c=this._fileTypes[s];if(elData(c,"file-type")==this._fileType){o=c;break}}r.textContent=t.childBySel(o,"SPAN").textContent}else r.textContent=n.get("wcf.media.search.filetype")},_updateFileTypeDropdown:function(){for(var e=0,t=this._fileTypes.length;t>e;e++){var i=this._fileTypes[e];i.classList[elData(i,"file-type")===this._fileType?"add":"remove"]("active")}}},r}),define("WoltLab/WCF/Media/Upload",["Core","Dom/ChangeListener","Dom/Traverse","Dom/Util","EventHandler","Language","Permission","Upload","WoltLab/WCF/File/Util"],function(e,t,i,n,a,r,o,s,l){"use strict";function c(t,i,n){n=n||{},this._mediaManager=null,n.mediaManager&&(this._mediaManager=n.mediaManager,delete n.mediaManager),s.call(this,t,i,e.extend({className:"wcf\\data\\media\\MediaAction",multiple:this._mediaManager?!0:!1,singleFileRequests:!0},n))}return e.inherit(c,s,{_createFileElement:function(e){var i;i="OL"===this._target.nodeName||"UL"===this._target.nodeName?elCreate("li"):elCreate("p");var a=elCreate("div");a.className="mediaThumbnail",i.appendChild(a);var r=elCreate("span");r.className="icon icon144 fa-spinner",a.appendChild(r);var o=elCreate("div");o.className="mediaInformation",i.appendChild(o);var s=elCreate("p");s.className="mediaTitle",s.textContent=e.name,o.appendChild(s);var l=elCreate("progress");return elAttr(l,"max",100),o.appendChild(l),n.prepend(i,this._target),t.trigger(),i},_getParameters:function(){return this._mediaManager?e.extend(c._super.prototype._getParameters.call(this),{fileTypeFilters:this._mediaManager.getOption("fileTypeFilters")}):c._super.prototype._getParameters.call(this)},_success:function(e,n){for(var o=this._fileElements[e],s=0,c=o.length;c>s;s++){var d=o[s],u=elData(d,"internal-file-id"),h=n.returnValues.media[u];if(elRemove(i.childByTag(i.childByClass(d,"mediaInformation"),"PROGRESS")),h){var p=i.childByTag(i.childByClass(d,"mediaThumbnail"),"SPAN");if(h.tinyThumbnailType){var f=p.parentNode;elRemove(p);var m=elCreate("img");elAttr(m,"src",h.tinyThumbnailLink),elAttr(m,"alt",""),m.style.setProperty("width","144px"),m.style.setProperty("height","144px"),f.appendChild(m)}else p.classList.remove("fa-spinner"),p.classList.add(l.getIconClassByMimeType(h.fileType));d.className="jsClipboardObject",elData(d,"object-id",h.mediaID),this._mediaManager&&(this._mediaManager.setupMediaElement(h,d),this._mediaManager.resetMedia(),this._mediaManager.addMedia(h,d))}else{var g=n.returnValues.errors[u];g||(g={errorType:"uploadFailed",filename:elData(d,"filename")});var p=i.childByTag(i.childByClass(d,"mediaThumbnail"),"SPAN");p.classList.remove("fa-spinner"),p.classList.add("fa-remove"),p.classList.add("pointer"),d.classList.add("uploadFailed"),d.addEventListener("click",function(){elRemove(this)});var v=i.childByClass(i.childByClass(d,"mediaInformation"),"mediaTitle");v.innerText=r.get("wcf.media.upload.error."+g.errorType,{filename:g.filename})}t.trigger()}a.fire("com.woltlab.wcf.media.upload","success",{files:o,media:n.returnValues.media,upload:this})}}),c}),define("WoltLab/WCF/Ui/Suggestion",["Ajax","Core","Ui/SimpleDropdown"],function(e,t,i){"use strict";function n(e,t){this.init(e,t)}return n.prototype={init:function(e,i){if(this._dropdownMenu=null,this._value="",this._element=elById(e),null===this._element)throw new Error("Expected a valid element id.");if(this._options=t.extend({ajax:{actionName:"getSearchResultList",className:"",interfaceName:"wcf\\data\\ISearchAction",parameters:{data:{}}},callbackSelect:null,excludedSearchValues:[],treshold:3},i),"function"!=typeof this._options.callbackSelect)throw new Error("Expected a valid callback for option 'callbackSelect'.");this._element.addEventListener("click",function(e){e.stopPropagation()}),this._element.addEventListener("keydown",this._keyDown.bind(this)),this._element.addEventListener("keyup",this._keyUp.bind(this))},addExcludedValue:function(e){-1===this._options.excludedSearchValues.indexOf(e)&&this._options.excludedSearchValues.push(e)},removeExcludedValue:function(e){var t=this._options.excludedSearchValues.indexOf(e);-1!==t&&this._options.excludedSearchValues.splice(t,1)},_keyDown:function(e){if(null===this._dropdownMenu||!i.isOpen(this._element.id))return!0;if(13!==e.keyCode&&27!==e.keyCode&&38!==e.keyCode&&40!==e.keyCode)return!0;for(var t,n=0,a=this._dropdownMenu.childElementCount;a>n&&(t=this._dropdownMenu.children[n],!t.classList.contains("active"));)n++;if(13===e.keyCode)i.close(this._element.id),this._select(t);else if(27===e.keyCode){if(!i.isOpen(this._element.id))return!0;i.close(this._element.id)}else{var r=0;38===e.keyCode?r=(0===n?a:n)-1:40===e.keyCode&&(r=n+1,r===a&&(r=0)),r!==n&&(t.classList.remove("active"),this._dropdownMenu.children[r].classList.add("active"))}return e.preventDefault(),!1},_select:function(e){var t=e instanceof Event;t&&(e=e.currentTarget.parentNode),this._options.callbackSelect(this._element.id,{objectId:elData(e.children[0],"object-id"),value:e.textContent}),t&&this._element.focus()},_keyUp:function(t){var n=t.currentTarget.value.trim();if(this._value!==n){if(n.length<this._options.treshold)return null!==this._dropdownMenu&&i.close(this._element.id),void(this._value=n);this._value=n,e.api(this,{parameters:{data:{excludedSearchValues:this._options.excludedSearchValues,searchString:n}}})}},_ajaxSetup:function(){return{data:this._options.ajax}},_ajaxSuccess:function(e){if(null===this._dropdownMenu?(this._dropdownMenu=elCreate("div"),this._dropdownMenu.className="dropdownMenu",i.initFragment(this._element,this._dropdownMenu)):this._dropdownMenu.innerHTML="",e.returnValues.length){for(var t,n,a,r=0,o=e.returnValues.length;o>r;r++)n=e.returnValues[r],t=elCreate("a"),t.textContent=n.label,elData(t,"object-id",n.objectID),t.addEventListener("click",this._select.bind(this)),a=elCreate("li"),0===r&&(a.className="active"),a.appendChild(t),this._dropdownMenu.appendChild(a);i.open(this._element.id)}else i.close(this._element.id)}},n}),define("WoltLab/WCF/Ui/ItemList",["Core","Dictionary","Language","Dom/Traverse","WoltLab/WCF/Ui/Suggestion"],function(e,t,i,n,a){"use strict";var r="",o=new t,s=!1,l=null,c=null,d=null,u=null,h={init:function(t,i,r){var s=elById(t);if(null===s)throw new Error("Expected a valid element id.");r=e.extend({ajax:{actionName:"getSearchResultList",className:"",data:{}},excludedSearchValues:[],maxItems:-1,maxLength:-1,restricted:!1,isCSV:!1,callbackChange:null,callbackSubmit:null,submitFieldName:""},r);var l=n.parentByTag(s,"FORM");if(null!==l&&r.isCSV===!1){if(!r.submitFieldName.length&&"function"!=typeof r.callbackSubmit)throw new Error("Expected a valid function for option 'callbackSubmit', a non-empty value for option 'submitFieldName' or enabling the option 'submitFieldCSV'.");l.addEventListener("submit",function(){var e=this.getValues(t);if(r.submitFieldName.length)for(var i,n=0,a=e.length;a>n;n++)i=elCreate("input"),i.type="hidden",i.name=r.submitFieldName.replace(/{$objectId}/,e[n].objectId),i.value=e[n].value,l.appendChild(i);else r.callbackSubmit(l,e)}.bind(this))}this._setup();var c=this._createUI(s,r,i),d=new a(t,{ajax:r.ajax,callbackSelect:this._addItem.bind(this),excludedSearchValues:r.excludedSearchValues});if(o.set(t,{dropdownMenu:null,element:c.element,list:c.list,listItem:c.element.parentNode,options:r,shadow:c.shadow,suggestion:d}),i=c.values.length?c.values:i,Array.isArray(i))for(var u,h=0,p=i.length;p>h;h++)u=i[h],"string"==typeof u&&(u={objectId:0,value:u}),this._addItem(t,u)},getValues:function(e){if(!o.has(e))throw new Error("Element id '"+e+"' is unknown.");for(var t,i,a=o.get(e),r=n.childrenByClass(a.list,"item"),s=[],l=0,c=r.length;c>l;l++)i=r[l],t={objectId:elData(i,"object-id"),value:n.childByTag(i,"SPAN").textContent},s.push(t);return s},_setup:function(){s||(s=!0,l=this._keyDown.bind(this),c=this._keyPress.bind(this),d=this._keyUp.bind(this),u=this._removeItem.bind(this))},_createUI:function(e,t){var i=elCreate("ol");i.className="inputItemList",elData(i,"element-id",e.id),i.addEventListener("click",function(t){t.target===i&&e.focus()});var n=elCreate("li");n.className="input",i.appendChild(n),e.addEventListener("keydown",l),e.addEventListener("keypress",c),e.addEventListener("keyup",d),e.parentNode.insertBefore(i,e),n.appendChild(e),-1!==t.maxLength&&elAttr(e,"maxLength",t.maxLength);var a=null,r=[];if(t.isCSV&&(a=elCreate("input"),a.className="itemListInputShadow",a.type="hidden",a.name=e.name,e.removeAttribute("name"),i.parentNode.insertBefore(a,i),"TEXTAREA"===e.nodeName)){for(var o,s=e.value.split(","),u=0,h=s.length;h>u;u++)o=s[u].trim(),o.length&&r.push(o);var p=elCreate("input");e.parentNode.insertBefore(p,e),p.id=e.id,elRemove(e),e=p}return{element:e,list:i,shadow:a,values:r}},_handleLimit:function(e){var t=o.get(e);-1!==t.options.maxItems&&(t.list.childElementCount-1<t.options.maxItems?t.element.disabled&&(t.element.disabled=!1,t.element.removeAttribute("placeholder")):t.element.disabled||(t.element.disabled=!0,elAttr(t.element,"placeholder",i.get("wcf.global.form.input.maxItems"))))},_keyDown:function(e){var t=e.currentTarget,i=t.parentNode.previousElementSibling;r=t.id,8===e.keyCode?0===t.value.length&&null!==i&&(i.classList.contains("active")?this._removeItem(null,i):i.classList.add("active")):27===e.keyCode&&null!==i&&i.classList.contains("active")&&i.classList.remove("active")},_keyPress:function(e){if(13===e.charCode||44===e.charCode){if(e.preventDefault(),o.get(e.currentTarget.id).options.restricted)return;var t=e.currentTarget.value.trim();t.length&&this._addItem(e.currentTarget.id,{objectId:0,value:t})}},_keyUp:function(e){var t=e.currentTarget;if(t.value.length>0){var i=t.parentNode.previousElementSibling;null!==i&&i.classList.remove("active")}},_addItem:function(e,t){var i=o.get(e),n=elCreate("li");n.className="item";var a=elCreate("span");a.className="content",elData(a,"object-id",t.objectId),a.textContent=t.value;var r=elCreate("a");r.className="icon icon16 fa-times",r.addEventListener("click",u),n.appendChild(a),n.appendChild(r),i.list.insertBefore(n,i.listItem),i.suggestion.addExcludedValue(t.value),i.element.value="",this._handleLimit(e);var s=this._syncShadow(i);"function"==typeof i.options.callbackChange&&(null===s&&(s=this.getValues(e)),i.options.callbackChange(e,s))},_removeItem:function(e,t){t=null===e?t:e.currentTarget.parentNode;var i=t.parentNode,n=elData(i,"element-id"),a=o.get(n);a.suggestion.removeExcludedValue(t.children[0].textContent),i.removeChild(t),a.element.focus(),this._handleLimit(n);var r=this._syncShadow(a);"function"==typeof a.options.callbackChange&&(null===r&&(r=this.getValues(n)),a.options.callbackChange(n,r))},_syncShadow:function(e){if(!e.options.isCSV)return null;for(var t="",i=this.getValues(e.element.id),n=0,a=i.length;a>n;n++)t+=(t.length?",":"")+i[n].value;return e.shadow.value=t,i}};return h}),define("WoltLab/WCF/Ui/Page/JumpTo",["Language","ObjectMap","Ui/Dialog"],function(e,t,i){"use strict";var n=null,a=null,r=null,o=new t,s=null,l={init:function(e,t){if(t=t||null,null===t){var i=elData(e,"link");t=i?function(e){window.location=i.replace(/pageNo=%d/,"pageNo="+e)}:function(){}}else if("function"!=typeof t)throw new TypeError("Expected a valid function for parameter 'callback'.");if(!o.has(e)){var n=elBySel(".jumpTo",e);null!==n&&(n.addEventListener("click",this._click.bind(this,e)),o.set(e,{callback:t}))}},_click:function(t,a){n=t,"object"==typeof a&&a.preventDefault(),i.open(this);var o=elData(t,"pages");s.value=o,s.setAttribute("max",o),r.textContent=e.get("wcf.global.page.jumpTo.description").replace(/#pages#/,o)},_keyUp:function(e){if(13===e.which&&a.disabled===!1)return void this._submit();var t=~~s.value;1>t||t>~~elAttr(s,"max")?a.disabled=!0:a.disabled=!1},_submit:function(e){o.get(n).callback(~~s.value),i.close(this)},_dialogSetup:function(){var t='<dl><dt><label for="jsPaginationPageNo">'+e.get("wcf.global.page.jumpTo")+'</label></dt><dd><input type="number" id="jsPaginationPageNo" value="1" min="1" max="1" class="tiny"><small></small></dd></dl><div class="formSubmit"><button class="buttonPrimary">'+e.get("wcf.global.button.submit")+"</button></div>";return{id:"paginationOverlay",options:{onSetup:function(e){s=elByTag("input",e)[0],s.addEventListener("keyup",this._keyUp.bind(this)),r=elByTag("small",e)[0],a=elByTag("button",e)[0],a.addEventListener("click",this._submit.bind(this))}.bind(this),title:e.get("wcf.global.page.pagination")},source:t}}};return l}),define("WoltLab/WCF/Ui/Pagination",["Core","Language","ObjectMap","StringUtil","WoltLab/WCF/Ui/Page/JumpTo"],function(e,t,i,n,a){"use strict";function r(e,t){this.init(e,t)}return r.prototype={SHOW_LINKS:11,init:function(t,i){this._element=t,this._options=e.extend({activePage:1,maxPage:1,callbackShouldSwitch:null,callbackSwitch:null},i),"function"!=typeof this._options.callbackShouldSwitch&&(this._options.callbackShouldSwitch=null),"function"!=typeof this._options.callbackSwitch&&(this._options.callbackSwitch=null),this._element.classList.add("pagination"),this._element.classList.add("small"),this._rebuild(this._element)},_rebuild:function(){var e=!1;this._element.innerHTML="";var i,n=elCreate("ul"),r=elCreate("li");r.className="skip",n.appendChild(r);var o="icon icon16 fa-angle-double-left";this._options.activePage>1?(i=elCreate("a"),i.className=o+" jsTooltip",i.href="#",i.title=t.get("wcf.global.page.previous"),r.appendChild(i),i.addEventListener("click",this.switchPage.bind(this,this._options.activePage-1))):(r.innerHTML='<span class="'+o+'"></span>',r.classList.add("disabled")),n.appendChild(this._createLink(1,this._options));var s=this.SHOW_LINKS-4,l=this._options.activePage-2;0>l&&(l=0);var c=this._options.maxPage-(this._options.activePage+1);0>c&&(c=0),this._options.activePage>1&&this._options.activePage<this._options.maxPage&&s--;var d=s/2,u=this._options.activePage,h=this._options.activePage;1>u&&(u=1),1>h&&(h=1),h>this._options.maxPage-1&&(h=this._options.maxPage-1),l>=d?u-=d:(u-=l,h+=d-l),c>=d?h+=d:(h+=c,u-=d-c),h=Math.ceil(h),u=Math.ceil(u),1>u&&(u=1),h>this._options.maxPage&&(h=this._options.maxPage);var p='<a class="jsTooltip" title="'+t.get("wcf.global.page.jumpTo")+'">&hellip;</a>';if(u>1)if(2>u-1)n.appendChild(this._createLink(2,this._options));else{var r=elCreate("li");r.className="jumpTo",r.innerHTML=p,n.appendChild(r),e=!0}for(var f=u+1;h>f;f++)n.appendChild(this._createLink(f,this._options));if(h<this._options.maxPage)if(this._options.maxPage-h<2)n.appendChild(this._createLink(this._options.maxPage-1,this._options));else{var r=elCreate("li");r.className="jumpTo",r.innerHTML=p,n.appendChild(r),e=!0}n.appendChild(this._createLink(this._options.maxPage,this._options)),r=elCreate("li"),r.className="skip",n.appendChild(r),o="icon icon16 fa-angle-double-right",this._options.activePage<this._options.maxPage?(i=elCreate("a"),i.className=o+" jsTooltip",i.href="#",i.title=t.get("wcf.global.page.next"),r.appendChild(i),i.addEventListener("click",this.switchPage.bind(this,this._options.activePage+1))):(r.innerHTML='<span class="'+o+'"></span>',r.classList.add("disabled")),e&&(elData(n,"pages",this._options.maxPage),a.init(n,this.switchPage.bind(this))),this._element.appendChild(n)},_createLink:function(e){var i=elCreate("li");if(e!==this._options.activePage){var a=elCreate("a");a.textContent=n.addThousandsSeparator(e),a.addEventListener("click",this.switchPage.bind(this,e)),i.appendChild(a)}else i.classList.add("active"),i.innerHTML="<span>"+n.addThousandsSeparator(e)+'</span><span class="invisible">'+t.get("wcf.page.pagePosition",{pageNo:e,pages:this._options.maxPage})+"</span>";return i},switchPage:function(e,t){if("object"==typeof t&&t.preventDefault(),e=~~e,e>0&&this._options.activePage!==e&&e<=this._options.maxPage){if(null!==this._options.callbackShouldSwitch&&this._options.callbackShouldSwitch(e)!==!0)return;this._options.activePage=e,this._rebuild(),null!==this._options.callbackSwitch&&this._options.callbackSwitch(e)}}},r}),define("WoltLab/WCF/Ui/Scroll",["Dom/Util"],function(e){"use strict";var t=null,i=null,n=null;return{element:function(n,a){if(!(n instanceof Element))throw new TypeError("Expected a valid DOM element.");if(void 0!==a&&"function"!=typeof a)throw new TypeError("Expected a valid callback function.");if(!document.body.contains(n))throw new Error("Element must be part of the visible DOM.");if(null!==t)throw new Error("Cannot scroll to element, a concurrent request is running.");a&&(t=a,null===i&&(i=this._onScroll.bind(this)),window.addEventListener("scroll",i));var r=e.offset(n).top;50>=r?r=0:r-=50,window.scrollTo({left:0,top:r,behavior:"smooth"})},_onScroll:function(){null!==n&&window.clearTimeout(n),n=window.setTimeout(function(){t(),window.removeEventListener("scroll",i),t=null,n=null},100)}}}),define("WoltLab/WCF/Controller/Notice/Dismiss",["Ajax"],function(e){"use strict";var t={setup:function(){var e=elByClass("jsDismissNoticeButton");if(e.length)for(var t=this._click.bind(this),i=0,n=e.length;n>i;i++)e[i].addEventListener("click",t)},_click:function(t){var i=t.currentTarget;e.apiOnce({data:{actionName:"dismiss",className:"wcf\\data\\notice\\NoticeAction",objectIDs:[elData(i,"object-id")]},success:function(){var e=i.parentNode;e.addEventListener("transitionend",function(){elRemove(e)}),e.classList.remove("active")}})}};return t}),define("WoltLab/WCF/Media/Manager/Search",["Ajax","Core","Dom/Traverse","Dom/Util","Language","WoltLab/WCF/Media/Search","Ui/SimpleDropdown"],function(e,t,i,n,a,r,o){"use strict";function s(e){r.call(this),this._mediaManager=e,this._searchMode=!1,this._input=elById(this._getIdPrefix()+"SearchField"),this._input.addEventListener("keypress",this._keyPress.bind(this)),this._cancelButton=elById(this._getIdPrefix()+"SearchCancelButton"),this._cancelButton.addEventListener("click",this._cancelSearch.bind(this))}return t.inherit(s,r,{_ajaxSetup:function(){return{data:{actionName:"getSearchResultList",className:"wcf\\data\\media\\MediaAction",interfaceName:"wcf\\data\\ISearchAction"}}},_ajaxSuccess:function(e){this._mediaManager.setMedia(e.returnValues.media||{},e.returnValues.template||"")},_cancelSearch:function(){this._searchMode&&(this._searchMode=!1,this._mediaManager.resetMedia(),this.resetSearch())},_getIdPrefix:function(){return"mediaManager"},_keyPress:function(e){if(13===e.charCode){e.preventDefault();var t=i.childByClass(this._input.parentNode.parentNode,"innerInfo");this._input.value.length>=3?(t&&elHide(t),this._search()):t?elShow(t):(t=elCreate("p"),t.className="innerInfo",t.textContent=a.get("wcf.media.search.info.searchStringTreshold"),n.insertAfter(t,this._input.parentNode))}},_search:function(){this._searchMode=!0,e.api(this,{parameters:{fileType:this._fileType,fileTypeFilters:this._mediaManager.getOption("fileTypeFilters"),mode:this._mediaManager.getMode(),searchString:this._input.value}})},_selectFileType:function(e){s._super.prototype._selectFileType.call(this,e),this._search()},hideSearch:function(){elHide(elById(this._getIdPrefix()+"Search"))},resetSearch:function(){this._input.value="",this._fileType="all",this._updateDropdownButtonLabel()},showSearch:function(){elShow(elById(this._getIdPrefix()+"Search"))}}),s}),define("WoltLab/WCF/Media/Manager/Base",["Core","Dictionary","Dom/ChangeListener","Dom/Traverse","Dom/Util","EventHandler","Language","List","Permission","Ui/Dialog","Ui/Notification","WoltLab/WCF/Controller/Clipboard","WoltLab/WCF/Media/Editor","WoltLab/WCF/Media/Upload","WoltLab/WCF/Media/Manager/Search"],function(e,t,i,n,a,r,o,s,l,c,d,u,h,p,f){"use strict";function m(n){this._options=e.extend({dialogTitle:o.get("wcf.media.manager"),fileTypeFilters:{}},n),this._media=new t,this._mediaData=new t,this._mediaCache=null,this._mediaManagerMediaList=null,this._search=null,l.get("admin.content.cms.canManageMedia")&&(this._mediaEditor=new h(this)),i.add("WoltLab/WCF/Media/Manager",this._addButtonEventListeners.bind(this))}return m.prototype={_addButtonEventListeners:function(){if(this._mediaManagerMediaList)for(var e=n.childrenByTag(this._mediaManagerMediaList,"LI"),t=0,i=e.length;i>t;t++){var a=e[t];if(l.get("admin.content.cms.canManageMedia")){var r=elByClass("jsMediaEditIcon",a)[0];r&&(r.classList.remove("jsMediaEditIcon"),r.addEventListener("click",this._editMedia.bind(this)))}}},_click:function(e){e.preventDefault(),c.open(this)},_clipboardAction:function(e){if(null!==e.responseData)switch(e.data.actionName){case"com.woltlab.wcf.media.delete":for(var t=e.responseData.objectIDs,i=0,n=t.length;n>i;i++)this.removeMedia(~~t[i],!0);d.show()}},_dialogSetup:function(){return{id:"mediaManager",options:{title:this._options.dialogTitle},source:{after:this._initDialog.bind(this),data:{actionName:"getManagementDialog",className:"wcf\\data\\media\\MediaAction",parameters:{mode:this.getMode(),fileTypeFilters:this._options.fileTypeFilters}}}}},_editMedia:function(e){if(!l.get("admin.content.cms.canManageMedia"))throw new Error("You are not allowed to edit media files.");c.close("mediaManager"),this._mediaEditor.edit(this._mediaData.get(~~elData(e.currentTarget,"object-id")))},_editorClose:function(){c.open(this)},_editorSuccess:function(e){c.open(this),this._mediaData.set(~~e.mediaID,e);var t=this._media.get(~~e.mediaID),i=elByClass("mediaTitle",t)[0];e.isMultilingual?i.textContent=e.title[LANGUAGE_ID]||e.filename:i.textContent=e.title[e.languageID]||e.filename},_initDialog:function(e,t){var i=t.returnValues.media||{};for(var a in i)objOwns(i,a)&&this._mediaData.set(~~a,i[a]);this._mediaManagerMediaList=elById("mediaManagerMediaList");for(var o=n.childrenByTag(this._mediaManagerMediaList,"LI"),s=0,c=o.length;c>s;s++){var d=o[s];this._media.set(~~elData(d,"object-id"),d)}l.get("admin.content.cms.canManageMedia")&&(new p("mediaManagerMediaUploadButton","mediaManagerMediaList",{mediaManager:this}),u.setup({hasMarkedItems:t.returnValues.hasMarkedItems?!0:!1,pageClassName:"menuManagerDialog-"+this.getMode()}),r.add("com.woltlab.wcf.clipboard","com.woltlab.wcf.media",this._clipboardAction.bind(this))),this._search=new f(this),o.length||this._search.hideSearch()},_setMedia:function(r){e.isPlainObject(r)?this._media=t.fromObject(r):this._media=r;var s=n.nextByClass(this._mediaManagerMediaList,"info");this._media.size?s&&elHide(s):(null===s&&(s=elCreate("p"),s.className="info",s.textContent=o.get("wcf.media.search.noResults")),elShow(s),a.insertAfter(s,this._mediaManagerMediaList));for(var l=n.childrenByTag(this._mediaManagerMediaList,"LI"),c=0,d=l.length;d>c;c++){var h=l[c];this._media.has(elData(h,"object-id"))?elShow(h):elHide(h)}i.trigger(),u.reload()},addMedia:function(e,t){e.languageID||(e.isMultilingual=1),this._mediaData.set(~~e.mediaID,e),this._media.set(~~e.mediaID,t),1===this._media.size&&this._search.showSearch()},getMode:function(){return""},getOption:function(e){return this._options[e]?this._options[e]:null},removeMedia:function(e,t){this._media.has(e)&&(elRemove(this._media.get(e)),this._media["delete"](e),this._mediaData["delete"](e)),t&&this._mediaCache&&this._mediaCache.has(e)&&this._mediaCache["delete"](e)},resetMedia:function(){null!==this._mediaCache&&(this._setMedia(this._mediaCache),this._mediaCache=null,this._search.resetSearch())},setMedia:function(e,t){this._mediaCache||(this._mediaCache=this._media);var i=!1;for(var a in e)objOwns(e,a)&&(i=!0);if(i){var r=elCreate("ul");r.innerHTML=t;for(var o=n.childrenByTag(r,"LI"),s=0,l=o.length;l>s;s++){var c=o[s];
-this._mediaData.has(~~elData(c,"object-id"))||(this._mediaData.set(elData(c,"object-id"),c),this._mediaManagerMediaList.appendChild(c))}}this._setMedia(e)},setupMediaElement:function(e,t){var i=n.childByClass(t,"mediaInformation"),a=elCreate("nav");a.className="buttonGroupNavigation",i.parentNode.appendChild(a);var r=elCreate("ul");r.className="smallButtons buttonGroup",a.appendChild(r);var s=elCreate("li");r.appendChild(s);var c=elCreate("input");if(c.className="jsClipboardItem jsMediaCheckbox",elAttr(c,"type","checkbox"),elData(c,"object-id",e.mediaID),s.appendChild(c),l.get("admin.content.cms.canManageMedia")){s=elCreate("li"),r.appendChild(s);var d=elCreate("a");s.appendChild(d);var u=elCreate("span");u.className="icon icon16 fa-pencil jsTooltip jsMediaEditIcon",elData(u,"object-id",e.mediaID),elAttr(u,"title",o.get("wcf.global.button.edit")),d.appendChild(u),s=elCreate("li"),r.appendChild(s),d=elCreate("a"),s.appendChild(d),u=elCreate("span"),u.className="icon icon16 fa-times jsTooltip jsMediaDeleteIcon",elData(u,"object-id",e.mediaID),elAttr(u,"title",o.get("wcf.global.button.delete")),d.appendChild(u)}}},m}),define("WoltLab/WCF/Media/Manager/Editor",["Core","Dom/Traverse","Language","Ui/Dialog","WoltLab/WCF/Media/Manager/Base"],function(e,t,i,n,a){"use strict";function r(e){a.call(this,e),this._activeButton=null,this._buttons=elByClass(this._options.buttonClass||"jsMediaEditorButton");for(var t=0,i=this._buttons.length;i>t;t++)this._buttons[t].addEventListener("click",this._click.bind(this));this._activeButton=null}return e.inherit(r,a,{_addButtonEventListeners:function(){if(r._super.prototype._addButtonEventListeners.call(this),this._mediaManagerMediaList)for(var e=t.childrenByTag(this._mediaManagerMediaList,"LI"),i=0,n=e.length;n>i;i++){var a=e[i],o=elByClass("jsMediaInsertIcon",a)[0];o&&(o.classList.remove("jsMediaInsertIcon"),o.addEventListener("click",this._openInsertDialog.bind(this)))}},_click:function(e){this._activeButton=e.currentTarget,r._super.prototype._click.call(this,e)},_insertMedia:function(){},_openInsertDialog:function(e){var t=this._mediaData.get(~~elData(e.currentTarget,"object-id"));if(t.isImage&&t.smallThumbnailType){n.close(this);var a="mediaInsert"+t.mediaID;if(n.getDialog(a))n.openStatic(a);else{var r=elCreate("div"),o=elCreate("fieldset");r.appendChild(o);var s=elCreate("dl");o.appendChild(s);var l=elCreate("dt");l.textContent=i.get("wcf.media.insert.imageSize"),s.appendChild(l);var c=elCreate("dd");s.appendChild(c);var d=elCreate("select");c.appendChild(d);for(var u,h,p=["small","medium","large"],f=0,m=p.length;m>f;f++)u=p[f],t[u+"ThumbnailType"]&&(h=elCreate("option"),elAttr(h,"value",u),h.textContent=i.get("wcf.media.insert.imageSize."+u,{height:t[u+"ThumbnailHeight"],width:t[u+"ThumbnailWidth"]}),d.appendChild(h));h=elCreate("option"),elAttr(h,"value","original"),h.textContent=i.get("wcf.media.insert.imageSize.original",{height:t.height,width:t.width}),d.appendChild(h);var g=elCreate("div");g.className="formSubmit",r.appendChild(g);var v=elCreate("button");v.className="buttonPrimary",v.textContent=i.get("wcf.global.button.insert"),elData(v,"object-id",t.mediaID),v.addEventListener("click",this._insertMedia.bind(this)),g.appendChild(v),n.open({_dialogSetup:function(){return{id:a,options:{onClose:this._editorClose.bind(this),title:i.get("wcf.media.insert")},source:r.outerHTML}}.bind(this)})}}},getMode:function(){return"editor"},setupMediaElement:function(e,t){r._super.prototype.setupMediaElement.call(this,e,t);var n=elBySel("> nav.buttonGroupNavigation > ul.smallButtons",t),a=elCreate("li");n.appendChild(a);var o=elCreate("a");a.appendChild(o);var s=elCreate("span");s.className="icon icon16 fa-plus jsTooltip jsMediaInsertIcon",elData(s,"object-id",e.mediaID),elAttr(s,"title",i.get("wcf.media.button.insert")),o.appendChild(s)}}),r}),define("WoltLab/WCF/Media/Manager/Select",["Core","Dom/Traverse","Language","ObjectMap","Ui/Dialog","WoltLab/WCF/Media/Manager/Base"],function(e,t,i,n,a,r){"use strict";function o(e){r.call(this,e),this._activeButton=null,this._buttons=elByClass(this._options.buttonClass||"jsMediaSelectButton"),this._storeElements=new n;for(var t=0,i=this._buttons.length;i>t;t++){var a=this._buttons[t],o=elData(a,"store");if(o){var s=elById(o);s&&"INPUT"===s.tagName&&(this._buttons[t].addEventListener("click",this._click.bind(this)),this._storeElements.set(a,s))}}}return e.inherit(o,r,{_addButtonEventListeners:function(){if(o._super.prototype._addButtonEventListeners.call(this),this._mediaManagerMediaList)for(var e=t.childrenByTag(this._mediaManagerMediaList,"LI"),i=0,n=e.length;n>i;i++){var a=e[i],r=elByClass("jsMediaSelectIcon",a)[0];r&&(r.classList.remove("jsMediaSelectIcon"),r.addEventListener("click",this._chooseMedia.bind(this)))}},_chooseMedia:function(e){if(null===this._activeButton)throw new Error("Media cannot be chosen if no button is active.");var t=this._mediaData.get(~~elData(e.currentTarget,"object-id"));elById(elData(this._activeButton,"store")).value=t.mediaID;var i=elData(this._activeButton,"display");if(i){var n=elById(i);n&&t.isImage&&(n.innerHTML='<img src="'+t.smallThumbnailLink+'" alt="'+t.altText+'" />')}a.close("mediaManager")},_click:function(e){if(this._activeButton=e.currentTarget,o._super.prototype._click.call(this,e),this._mediaManagerMediaList)for(var i,n=this._storeElements.get(this._activeButton),a=t.childrenByTag(this._mediaManagerMediaList,"LI"),r=0,s=a.length;s>r;r++)i=a[r],n.value&&n.value==elData(i,"object-id")?i.classList.add("jsSelected"):i.classList.remove("jsSelected")},getMode:function(){return"select"},setupMediaElement:function(e,t){o._super.prototype.setupMediaElement.call(this,e,t);var n=elBySel("nav.buttonGroupNavigation > ul.smallButtons",t),a=elCreate("li");n.appendChild(a);var r=elCreate("a");a.appendChild(r);var s=elCreate("span");s.className="icon icon16 fa-check jsTooltip jsMediaSelectIcon",elData(s,"object-id",e.mediaID),elAttr(s,"title",i.get("wcf.media.button.choose")),r.appendChild(s)}}),o}),define("WoltLab/WCF/Ui/Dropdown/Reusable",["Dictionary","Ui/SimpleDropdown"],function(e,t){"use strict";function i(e){if(!n.has(e))throw new Error("Unknown dropdown identifier '"+e+"'");return n.get(e)}var n=new e,a=0;return{init:function(e,i){if(!n.has(e)){var r=elCreate("div");r.id="reusableDropdownGhost"+a++,t.initFragment(r,i),n.set(e,r.id)}},getDropdownMenu:function(e){return t.getDropdownMenu(i(e))},registerCallback:function(e,n){t.registerCallback(i(e),n)},toggleDropdown:function(e,n){t.toggleDropdown(i(e),n)}}}),define("WoltLab/WCF/Ui/ItemList/User",["WoltLab/WCF/Ui/ItemList"],function(e){"use strict";var t={init:function(t,i){e.init(t,[],{ajax:{className:"wcf\\data\\user\\UserAction",parameters:{data:{includeUserGroups:~~i.includeUserGroups}}},callbackChange:"function"==typeof i.callbackChange?i.callbackChange:null,excludedSearchValues:Array.isArray(i.excludedSearchValues)?i.excludedSearchValues:[],isCSV:!0,maxItems:~~i.maxItems||-1,restricted:!0})},getValues:function(t){return e.getValues(t)}};return t}),define("WoltLab/WCF/Ui/User/List",["Ajax","Core","Dictionary","Dom/Util","Ui/Dialog","WoltLab/WCF/Ui/Pagination"],function(e,t,i,n,a,r){"use strict";function o(e){this.init(e)}return o.prototype={init:function(e){this._cache=new i,this._pageCount=0,this._pageNo=1,this._options=t.extend({className:"",dialogTitle:"",parameters:{}},e)},open:function(){this._pageNo=1,this._showPage()},_showPage:function(t){if("number"==typeof t&&(this._pageNo=~~t),0!==this._pageCount&&(this._pageNo<1||this._pageNo>this._pageCount))throw new RangeError("pageNo must be between 1 and "+this._pageCount+" ("+this._pageNo+" given).");if(this._cache.has(this._pageNo)){var i=a.open(this,this._cache.get(this._pageNo));if(this._pageCount>1){var n=elBySel(".jsPagination",i.content);null!==n&&new r(n,{activePage:this._pageNo,maxPage:this._pageCount,callbackSwitch:this._showPage.bind(this)})}}else this._options.parameters.pageNo=this._pageNo,e.api(this,{parameters:this._options.parameters})},_ajaxSuccess:function(e){void 0!==e.returnValues.pageCount&&(this._pageCount=~~e.returnValues.pageCount),this._cache.set(this._pageNo,e.returnValues.template),this._showPage()},_ajaxSetup:function(){return{data:{actionName:"getGroupedUserList",className:this._options.className,interfaceName:"wcf\\data\\IGroupedUserListAction"}}},_dialogSetup:function(){return{id:n.getUniqueId(),options:{title:this._options.dialogTitle},source:null}}},o}),define("WoltLab/WCF/Ui/Like/Handler",["Ajax","Core","Dictionary","Language","ObjectMap","StringUtil","Dom/ChangeListener","Dom/Util","Ui/Dialog","WoltLab/WCF/Ui/User/List"],function(e,t,i,n,a,r,o,s,l,c){"use strict";function d(e,t){this.init(e,t)}var u=!1;return d.prototype={init:function(e,i){if(""===i.containerSelector)throw new Error("[WoltLab/WCF/Ui/Like/Handler] Expected a non-emtpy string for option 'containerSelector'.");this._containers=new a,this._details=new a,this._objectType=e,this._options=t.extend({badgeClassNames:"",isSingleItem:!1,markListItemAsActive:!1,renderAsButton:!0,summaryPrepend:!0,summaryUseIcon:!0,canDislike:!1,canLike:!1,canLikeOwnContent:!1,canViewSummary:!1,badgeContainerSelector:".messageHeader .messageStatus",buttonAppendToSelector:".messageFooter .messageFooterButtons",buttonBeforeSelector:"",containerSelector:"",summarySelector:".messageFooterGroup"},i),this.initContainers(i,e),o.add("WoltLab/WCF/Ui/Like/Handler-"+e,this.initContainers.bind(this))},initContainers:function(){for(var e,t,i=elBySelAll(this._options.containerSelector),n=!1,a=0,r=i.length;r>a;a++)e=i[a],this._containers.has(e)||(t={badge:null,dislikeButton:null,likeButton:null,summary:null,dislikes:~~elData(e,"like-dislikes"),liked:~~elData(e,"like-liked"),likes:~~elData(e,"like-likes"),objectId:~~elData(e,"object-id"),users:JSON.parse(elData(e,"like-users"))},this._containers.set(e,t),this._buildWidget(e,t),n=!0);n&&o.trigger()},_buildWidget:function(e,t){if(this._options.canViewSummary){var i,n,a,r=elBySel(this._options.summarySelector,e);null!==r&&(i=elCreate("div"),i.className="likesSummary",this._options.summaryUseIcon&&(a=elCreate("span"),a.className="icon icon16 fa-thumbs-o-up",i.appendChild(a)),n=elCreate("span"),n.className="likesSummaryContent",n.addEventListener("click",this._showSummary.bind(this,e)),i.appendChild(n),this._options.summaryPrepend?s.prepend(i,r):r.appendChild(i),t.summary=n,this._updateSummary(e))}var o,l,c=elBySel(this._options.badgeContainerSelector,e);if(null!==c&&(o=elCreate("a"),o.href="#",o.className="wcfLikeCounter jsTooltip"+(this._options.badgeClassNames?" "+this._options.badgeClassNames:""),o.addEventListener("click",this._showSummary.bind(this,e)),"OL"===c.nodeName||"UL"===c.nodeName?(l=elCreate("li"),l.appendChild(o),c.appendChild(l)):c.appendChild(o),t.badge=o,this._updateBadge(e)),WCF.User.userID!=elData(e,"user-id")||this._options.canLikeOwnContent){var d=this._options.buttonAppendToSelector?elBySel(this._options.buttonAppendToSelector,e):null,u=this._options.buttonBeforeSelector?elBySel(this._options.buttonBeforeSelector,e):null;if(null===u&&null===d)throw new Error("Unable to find insert location for like/dislike buttons.");t.likeButton=this._createButton(e,!0,u,d),this._options.canDislike&&(t.dislikeButton=this._createButton(e,!1,u,d)),this._updateActiveState(e)}},_createButton:function(e,t,i,a){var r=n.get("wcf.like.button."+(t?"like":"dislike")),o=elCreate("li");o.className="wcf"+(t?"Like":"Dislike")+"Button";var s=elCreate("a");return s.className="jsTooltip"+(this._options.renderAsButton?" button":""),s.href="#",s.title=r,s.innerHTML='<span class="icon icon16 fa-thumbs-o-'+(t?"up":"down")+'" /> <span class="invisible">'+r+"</span>",s.addEventListener("click",this._like.bind(this,e)),elData(s,"type",t?"like":"dislike"),o.appendChild(s),i?i.parentNode.insertBefore(o,i):a.appendChild(o),s},_showSummary:function(e,t){t.preventDefault(),this._details.has(e)||this._details.set(e,new c({className:"wcf\\data\\like\\LikeAction",dialogTitle:n.get("wcf.like.details"),parameters:{data:{containerID:s.identify(e),objectID:this._containers.get(e).objectId,objectType:this._objectType}}})),this._details.get(e).open()},_updateBadge:function(e){var t=this._containers.get(e);if(0===t.likes&&0===t.dislikes)elHide(t.badge);else{elShow(t.badge);var i=t.likes-t.dislikes,a='<span class="icon icon16 fa-thumbs-o-'+(0>i?"down":"up")+'"></span><span class="wcfLikeValue">';a+=i>0?"+"+r.addThousandsSeparator(i):0>i?"−"+r.addThousandsSeparator(Math.abs(i)):"±0",t.badge.innerHTML=a+"</span>",t.badge.setAttribute("data-tooltip",n.get("wcf.like.tooltip",{dislikes:t.dislikes,likes:t.likes}))}},_updateSummary:function(e){var t=this._containers.get(e);if(t.likes){elShow(t.summary.parentNode);for(var i=[],a=Object.keys(t.users),r=0,o=a.length;o>r;r++)i.push(t.users[a[r]]);var s=t.likes-i.length;t.summary.innerHTML=n.get("wcf.like.summary",{users:i,others:s})}else elHide(t.summary.parentNode)},_updateActiveState:function(e){var t=this._containers.get(e),i=this._options.markListItemAsActive?t.dislikeButton.parentNode:t.dislikeButton,n=this._options.markListItemAsActive?t.likeButton.parentNode:t.likeButton;null!==t.dislikeButton&&i.classList.remove("active"),n.classList.remove("active"),1===t.liked?n.classList.add("active"):-1===t.liked&&null!==t.dislikeButton&&i.classList.add("active")},_like:function(t,i){i.preventDefault(),u||(u=!0,e.api(this,{actionName:elData(i.currentTarget,"type"),parameters:{data:{containerID:s.identify(t),objectID:this._containers.get(t).objectId,objectType:this._objectType}}}))},_ajaxSuccess:function(e){var t=elById(e.returnValues.containerID),i=this._containers.get(t);if(void 0!==i){i.dislikes=~~e.returnValues.dislikes,i.likes=~~e.returnValues.likes;var n=e.returnValues.users;i.users=[];for(var a=Object.keys(n),o=0,s=a.length;s>o;o++)i.users.push(r.escapeHTML(n[a[o]].username));1==e.returnValues.isLiked?i.liked=1:1==e.returnValues.isDisliked?i.liked=-1:i.liked=0,this._updateBadge(t),this._options.canViewSummary&&this._updateSummary(t),this._updateActiveState(t),this._details["delete"](t),u=!1}},_ajaxSetup:function(){return{data:{className:"wcf\\data\\like\\LikeAction"}}}},d}),define("WoltLab/WCF/Ui/Message/InlineEditor",["Ajax","Core","Dictionary","Environment","EventHandler","Language","ObjectMap","Dom/Traverse","Dom/Util","Ui/Notification","Ui/ReusableDropdown"],function(e,t,i,n,a,r,o,s,l,c,d){"use strict";function u(e){this.init(e)}return u.prototype={init:function(e){this._activeDropdownElement=null,this._activeElement=null,this._dropdownMenu=null,this._elements=new o,this._options=t.extend({canEditInline:!1,extendedForm:!0,className:"",containerId:0,dropdownIdentifier:"",editorPrefix:"messageEditor",messageSelector:".jsMessage"},e),this._initElements()},_initElements:function(){for(var e,t,i,n=elBySelAll(this._options.messageSelector),a=0,r=n.length;r>a;a++)if(i=n[a],!this._elements.has(i)){e=elBySel(".jsMessageEditButton",i),null!==e&&(t=elDataBool(i,"can-edit"),this._options.canEditInline?(e.addEventListener("click",this._clickDropdown.bind(this,i)),e.classList.add("jsDropdownEnabled"),t&&e.addEventListener("dblclick",this._click.bind(this,i))):t&&e.addEventListener("click",this._click.bind(this,i)));var o=elBySel(".messageBody",i),s=elBySel(".messageFooter",i);this._elements.set(i,{button:e,messageBody:o,messageBodyEditor:null,messageFooter:s,messageFooterButtons:elBySel(".messageFooterButtons",s),messageText:elBySel(".messageText",o)})}},_click:function(t,i){null===t&&(t=this._activeDropdownElement),i&&i.preventDefault(),null===this._activeElement?(this._activeElement=t,this._prepare(),e.api(this,{actionName:"beginEdit",parameters:{containerID:this._options.containerId,objectID:this._getObjectId(t)}})):c.show("wcf.message.error.editorAlreadyInUse",null,"warning")},_clickDropdown:function(e,i){i.preventDefault();var n=i.currentTarget;if(!n.classList.contains("dropdownToggle")){if(n.classList.add("dropdownToggle"),n.parentNode.classList.add("dropdown"),function(e,t){e.addEventListener("click",function(i){i.preventDefault(),i.stopPropagation(),this._activeDropdownElement=t,d.toggleDropdown(this._options.dropdownIdentifier,e)}.bind(this))}.bind(this)(n,e),null===this._dropdownMenu){this._dropdownMenu=elCreate("ul"),this._dropdownMenu.className="dropdownMenu";var r=this._dropdownGetItems();a.fire("com.woltlab.wcf.inlineEditor","dropdownInit_"+this._options.dropdownIdentifier,{items:r}),this._dropdownBuild(r),d.init(this._options.dropdownIdentifier,this._dropdownMenu),d.registerCallback(this._options.dropdownIdentifier,this._dropdownToggle.bind(this))}setTimeout(function(){t.triggerEvent(n,"click")},10)}},_dropdownBuild:function(e){for(var t,i,n,a=this._clickDropdownItem.bind(this),o=0,s=e.length;s>o;o++)t=e[o],n=elCreate("li"),elData(n,"item",t.item),"divider"===t.item?n.className="dropdownDivider":(i=elCreate("span"),i.textContent=r.get(t.label),n.appendChild(i),"editItem"===t.item?n.addEventListener("click",this._click.bind(this,null)):n.addEventListener("click",a)),this._dropdownMenu.appendChild(n)},_dropdownToggle:function(e,t){var i=this._elements.get(this._activeDropdownElement);if(i.button.parentNode.classList["open"===t?"add":"remove"]("dropdownOpen"),i.messageFooterButtons.classList["open"===t?"add":"remove"]("forceVisible"),"open"===t){var n=this._dropdownOpen();a.fire("com.woltlab.wcf.inlineEditor","dropdownOpen_"+this._options.dropdownIdentifier,{element:this._activeDropdownElement,visibility:n});for(var r,o,s=!1,l=0;l<this._dropdownMenu.childElementCount;l++)o=this._dropdownMenu.children[l],r=elData(o,"item"),"divider"===r?s?(elShow(o),s=!1):elHide(o):objOwns(n,r)&&n[r]===!1?elHide(o):(elShow(o),s=!0)}},_dropdownGetItems:function(){},_dropdownOpen:function(){},_dropdownSelect:function(e){},_clickDropdownItem:function(e){e.preventDefault(),this._dropdownSelect(elData(e.currentTarget,"item"))},_prepare:function(){var e=this._elements.get(this._activeElement),t=elCreate("div");t.className="messageBody editor",e.messageBodyEditor=t;var i=elCreate("span");i.className="icon icon48 fa-spinner",t.appendChild(i),l.insertAfter(t,e.messageBody),elHide(e.messageBody)},_showEditor:function(e){var t=this._getEditorId(),i=this._elements.get(this._activeElement);this._activeElement.classList.add("jsInvalidQuoteTarget");var r=s.childByClass(i.messageBodyEditor,"icon");elRemove(r);var o=i.messageBodyEditor,c=elCreate("div");c.className="editorContainer",l.setInnerHtml(c,e.returnValues.template),o.appendChild(c);var d=elBySel(".formSubmit",c),u=elBySel('button[data-type="save"]',d);if(u.addEventListener("click",this._save.bind(this)),this._options.extendedForm){var h=elBySel('button[data-type="extended"]',d);h.addEventListener("click",this._prepareExtended.bind(this))}var p=elBySel('button[data-type="cancel"]',d);p.addEventListener("click",this._restoreMessage.bind(this)),a.add("com.woltlab.wcf.redactor","submitEditor_"+t,function(e){e.cancel=!0,this._save()}.bind(this)),elHide(i.messageFooter);var f=elById(t);"redactor"===n.editor()?window.setTimeout(function(){this._quoteManager&&this._quoteManager.setAlternativeEditor($element),(new WCF.Effect.Scroll).scrollTo(this._activeElement,!0)}.bind(this),250):f.focus()},_restoreMessage:function(){var e=this._elements.get(this._activeElement);this._destroyEditor(),elRemove(e.messageBodyEditor),e.messageBodyEditor=null,elShow(e.messageBody),elShow(e.messageFooter),this._activeElement.classList.remove("jsInvalidQuoteTarget"),this._activeElement=null,this._quoteManager&&this._quoteManager.clearAlternativeEditor()},_save:function(){var t={containerID:this._options.containerId,data:{message:""},objectID:this._getObjectId(this._activeElement),removeQuoteIDs:[]},i=this._getEditorId();a.fire("com.woltlab.wcf.redactor2","getText_"+i,t.data),a.fire("com.woltlab.wcf.messageOptionsInline","submit_"+i,t),e.api(this,{actionName:"save",parameters:t}),this._hideEditor()},_showMessage:function(e){var t=this._elements.get(this._activeElement),i=elBySelAll(".attachmentThumbnailList, .attachmentFileList",t.messageBody);if(l.setInnerHtml(t.messageBody,e.returnValues.message),"string"==typeof e.returnValues.attachmentList){for(var n=0,a=i.length;a>n;n++)elRemove(i[n]);var r=elCreate("div");for(l.setInnerHtml(r,e.returnValues.attachmentList);r.childNodes.length;)t.messageBody.appendChild(r.childNodes[0])}this._restoreMessage(),this._updateHistory(this._getHash(this._getObjectId(this._activeElement))),c.show()},_prepareExtended:function(){var t={actionName:"jumpToExtended",parameters:{containerID:this._options.containerId,message:"",messageID:this._getObjectId(this._activeElement)}},i=this._getEditorId();a.fire("com.woltlab.wcf.redactor","getText_"+i,t.parameters),e.api(this,t)},_hideEditor:function(){var e=this._elements.get(this._activeElement);elHide(s.childByClass(e.messageBodyEditor,"editorContainer"));var t=elCreate("span");t.className="icon icon48 fa-spinner",e.messageBodyEditor.appendChild(t)},_restoreEditor:function(){var e=this._elements.get(this._activeElement),t=elBySel(".fa-spinner",e.messageBodyEditor);elRemove(t);var i=s.childByClass(e.messageBodyEditor,"editorContainer");null!==i&&elShow(i)},_destroyEditor:function(){a.fire("com.woltlab.wcf.redactor","destroy_"+this._getEditorId())},_getHash:function(e){return"#message"+e},_updateHistory:function(e){window.location.hash=e},_getEditorId:function(){return this._options.editorPrefix+this._getObjectId(this._activeElement)},_getObjectId:function(e){return~~elData(e,"object-id")},_ajaxFailure:function(e){var t=this._elements.get(this._activeElement),i=elBySel(".redactor-editor",t.messageBodyEditor);if(null===i)return this._restoreMessage(),!0;if(this._restoreEditor(),!e||void 0===e.returnValues||void 0===e.returnValues.errorType)return!0;var n=elBySel(".innerError",t.messageBodyEditor);return null===n&&(n=elCreate("small"),n.className="innerError",l.insertAfter(n,i)),n.textContent=e.returnValues.errorType,!1},_ajaxSuccess:function(e){switch(e.actionName){case"beginEdit":this._showEditor(e);break;case"jumpToExtended":window.location=e.returnValues.url;break;case"save":this._showMessage(e)}},_ajaxSetup:function(){return{data:{className:this._options.className,interfaceName:"wcf\\data\\IMessageInlineEditorAction"}}},legacyGetDropdownMenus:function(){return this._dropdownMenus},legacyGetElements:function(){return this._elements},legacyEdit:function(e){this._click(elById(e),null)}},u}),define("WoltLab/WCF/Ui/Message/Manager",["Ajax","Core","Dictionary"],function(e,t,i){"use strict";function n(e){this.init(e)}return n.prototype={init:function(e){this._elements=null,this._options=t.extend({className:"",selector:""},e),this.rebuild()},rebuild:function(){this._elements=new i;for(var e,t=elBySelAll(this._options.selector),n=0,a=t.length;a>n;n++)e=t[n],this._elements.set(elData(e,"object-id"),e)},getPermission:function(e,t){t="can-"+this._getAttributeName(t);var i=this._elements.get(e);if(void 0===i)throw new Error("Unknown object id '"+e+"' for selector '"+this._options.selector+"'");return elDataBool(i,t)},getPropertyValue:function(e,t,i){var n=this._elements.get(e);if(void 0===n)throw new Error("Unknown object id '"+e+"' for selector '"+this._options.selector+"'");return window[i?"elDataBool":"elData"](n,this._getAttributeName(t))},update:function(t,i,n){e.api(this,{actionName:i,parameters:n||{},objectIDs:[t]})},updateItems:function(e,t){Array.isArray(e)||(e=[e]);for(var i,n=0,a=e.length;a>n;n++)if(i=this._elements.get(e[n]),void 0!==i)for(var r in t)objOwns(t,r)&&this._update(i,r,t[r])},updateAllItems:function(e){var t=[];this._elements.forEach(function(e,i){t.push(i)}.bind(this)),this.update(t,e)},_update:function(e,t,i){elData(e,this._getAttributeName(t),i);var n=1==i||i===!0||"true"===i;this._updateState(e,t,i,n)},_updateState:function(e,t,i,n){switch(t){case"isDeleted":e.classList[n?"add":"remove"]("messageDeleted");break;case"isDisabled":e.classList[n?"add":"remove"]("messageDisabled")}},_getAttributeName:function(e){if(-1!==e.indexOf("-"))return e;for(var t,i="",n=e.split(/([A-Z][a-z]+)/),a=0,r=n.length;r>a;a++)t=n[a],t.length&&(i.length&&(i+="-"),i+=t.toLowerCase());return i},_ajaxSuccess:function(e){throw new Error("Method _ajaxSuccess() must be implemented by deriving functions.")},_ajaxSetup:function(){return{data:{className:this._options.className}}}},n}),define("WoltLab/WCF/Ui/Message/Reply",["Ajax","Core","EventHandler","Language","Dom/Util","Ui/Notification","../Scroll"],function(e,t,i,n,a,r,o){"use strict";function s(e){this.init(e)}return s.prototype={init:function(e){this._options=t.extend({ajax:{className:""},successMessage:"wcf.global.success.add"},e),this._container=elById("messageQuickReply"),this._content=elBySel(".messageContent",this._container),this._textarea=elById("text"),this._editor=null,this._loadingOverlay=null,elBySel(".message",this._container).classList.add("jsInvalidQuoteTarget");var i=this._submit.bind(this),n=elBySel('button[data-type="save"]');n.addEventListener(WCF_CLICK_EVENT,i);for(var a=elBySelAll(".jsQuickReply"),r=0,s=a.length;s>r;r++)a[r].addEventListener(WCF_CLICK_EVENT,function(e){e.preventDefault(),o.element(this._container,function(){this._getEditor().focus.end()}.bind(this))}.bind(this))},_submit:function(t){if(t.preventDefault(),this._validate()){this._showLoadingOverlay();var n=a.getDataAttributes(this._container,"data-",!0,!0);n.data={message:this._getEditor().code.get()},i.fire("com.woltlab.wcf.redactor2","submit_text",n),e.api(this,{parameters:n})}},_validate:function(){for(var e=elByClass("innerError",this._container);e.length;)e[0].parentNode.removeChild(e[0]);if(this._getEditor().utils.isEmpty())return this.throwError(this._textarea,n.get("wcf.global.form.error.empty")),!1;var t={api:this,editor:this._getEditor(),message:this._getEditor().code.get(),valid:!0};return i.fire("com.woltlab.wcf.redactor2","validate_text",t),t.valid!==!1},throwError:function(e,t){var i=elCreate("small");i.className="innerError",i.textContent=t,a.insertAfter(i,e)},_showLoadingOverlay:function(){null===this._loadingOverlay&&(this._loadingOverlay=elCreate("div"),this._loadingOverlay.className="messageContentLoadingOverlay",this._loadingOverlay.innerHTML='<span class="icon icon96 fa-spinner"></span>'),this._content.classList.add("loading"),this._content.appendChild(this._loadingOverlay)},_hideLoadingOverlay:function(){this._content.classList.remove("loading");var e=elBySel(".messageContentLoadingOverlay",this._content);null!==e&&e.parentNode.removeChild(e)},_reset:function(){this._getEditor().code.set("<p>​</p>"),i.fire("com.woltlab.wcf.redactor2","reset_text")},_handleError:function(e){this.throwError(this._textarea,e.returnValues.errorType)},_getEditor:function(){if(null===this._editor){if("function"!=typeof window.jQuery)throw new Error("Unable to access editor, jQuery has not been loaded yet.");this._editor=window.jQuery(this._textarea).data("redactor")}return this._editor},_insertMessage:function(e){if(e.returnValues.url)window.location=e.returnValues.url;else{if(e.returnValues.template){var t;"DESC"===elData(this._container,"sort-order")?(a.insertHtml(e.returnValues.template,this._container,"after"),t=a.identify(this._container.nextElementSibling)):(a.insertHtml(e.returnValues.template,this._container,"before"),t=a.identify(this._container.previousElementSibling)),elData(this._container,"last-post-time",e.returnValues.lastPostTime),window.location.hash=t,o.element(elById(t))}r.show(n.get(this._options.successMessage))}},_ajaxSuccess:function(e){this._insertMessage(e),this._reset(),this._hideLoadingOverlay()},_ajaxFailure:function(e){return this._hideLoadingOverlay(),null===e||void 0===e.returnValues||void 0===e.returnValues.errorType?!0:(this._handleError(e),!1)},_ajaxSetup:function(){return{data:{actionName:"quickReply",className:this._options.ajax.className,interfaceName:"wcf\\data\\IMessageQuickReplyAction"}}}},s}),define("WoltLab/WCF/Ui/Redactor/Format",["Dom/Util"],function(e){"use strict";return{format:function(t,i,n,a){document.execCommand("strikethrough");for(var r,o,s,l=elBySelAll("strike",t),c=0,d=l.length;d>c;c++){if(s=l[c],r=elCreate(i),n&&(r.className=n),"object"==typeof a)for(o in a)a.hasOwnProperty(o)&&elAttr(r,key,a[key]);e.replaceElement(s,r)}},removeFormat:function(t,i){i=i.toUpperCase();for(var n=elByTag("strike",t);n.length;)e.unwrapChildNodes(n[0]);document.execCommand("strikethrough");for(var a,r,o;n.length;){for(o=n[0],r=this._getLastMatchingParent(o,t,i),null!==r&&this._handleParentNodes(o,r,i),a=elByTag(i.toLowerCase(),o);a.length;)e.unwrapChildNodes(a[0]);e.unwrapChildNodes(o)}},_handleParentNodes:function(t,i,n){var a;if(!e.isAtNodeStart(t,i)){a=document.createRange(),a.setStartBefore(i),a.setEndBefore(t);var r=a.extractContents();i.parentNode.insertBefore(r,i)}e.isAtNodeEnd(t,i)||(a=document.createRange(),a.setStartAfter(t),a.setEndAfter(i),r=a.extractContents(),i.parentNode.insertBefore(r,i.nextSibling));for(var o=elByTag(n,i);o.length;)e.unwrapChildNodes(o[0]);e.unwrapChildNodes(i)},_getLastMatchingParent:function(e,t,i){for(var n=e.parentNode,a=null;n!==t;)n.nodeName===i&&(a=n),n=n.parentNode;return a}}}),define("WoltLab/WCF/Ui/Redactor/Link",["Language","Ui/Dialog"],function(e,t){"use strict";var i=!1,n=null;return{showDialog:function(a){t.open(this),t.setTitle(this,e.get("wcf.redactor.link."+(a.insert?"add":"edit")));var r=elById("redactor-modal-button-action");r.textContent=e.get("wcf.global.button."+(a.insert?"insert":"save")),n=a.submitCallback,i||(i=!0,r.addEventListener(WCF_CLICK_EVENT,this._submit.bind(this)))},_submit:function(){if(n())t.close(this);else{var i=elById("redactor-link-url"),a=i.nextElementSibling&&"SMALL"===i.nextElementSibling.nodeName?i.nextElementSibling:null;null===a&&(a=elCreate("small"),a.className="innerError",a.textContent=e.get("wcf.global.form.error.empty"),i.parentNode.appendChild(a))}},_dialogSetup:function(){return{id:"redactorDialogLink",options:{onClose:function(){var e=elById("redactor-link-url"),t=e.nextElementSibling&&"SMALL"===e.nextElementSibling.nodeName?e.nextElementSibling:null;null!==t&&elRemove(t)}},source:'<dl><dt><label for="redactor-link-url">'+e.get("wcf.redactor.link.url")+'</label></dt><dd><input type="url" id="redactor-link-url" class="long"></dd></dl><dl><dt><label for="redactor-link-url-text">'+e.get("wcf.redactor.link.text")+'</label></dt><dd><input type="text" id="redactor-link-url-text" class="long"></dd></dl><div class="formSubmit"><button id="redactor-modal-button-action" class="buttonPrimary"></button></div>'}}}}),define("WoltLab/WCF/Ui/Redactor/Mention",["Ajax","Environment","EventHandler","Ui/Alignment"],function(e,t,i,n){"use strict";function a(e){this.init(e)}return a.prototype={init:function(e){this._active=!1,this._caret=null,this._dropdownActive=!1,this._dropdownMenu=null,this._itemIndex=0,this._lineHeight=null,this._mentionStart="",this._redactor=e,this._timer=null,e.WoltLabEvent.register("keydown",this._keyDown.bind(this)),e.WoltLabEvent.register("keyup",this._keyUp.bind(this))},_keyDown:function(e){if(this._dropdownActive){var t=e.event;switch(t.which){case 13:this._setUsername(null,this._dropdownMenu.children[this._itemIndex].children[0]);break;case 38:this._selectItem(-1);break;case 40:this._selectItem(1);break;default:return}t.preventDefault(),e.cancel=!0}},_keyUp:function(t){var i=t.event;if(13===i.which)return void(this._active=!1);var n=this._getTextLineInFrontOfCaret();if(n.length){var a=n.match(/@([^,]{3,})$/);a?(!a.index||n[a.index-1].match(/\s/))&&(this._mentionStart=a[1],null!==this._timer&&(window.clearTimeout(this._timer),this._timer=null),this._timer=window.setTimeout(function(){e.api(this,{parameters:{data:{searchString:this._mentionStart}}}),this._timer=null}.bind(this),500)):this._hideDropdown()}else this._hideDropdown()},_setUsername:function(e,t){e&&(e.preventDefault(),t=e.currentTarget);var i=window.getSelection();i.removeAllRanges(),i.addRange(this._caret);var n=i.getRangeAt(0).cloneRange();this._redactor.buffer.set();var a=n.startContainer,r=n.startOffset-(this._mentionStart.length+1);
+this._mediaData.has(~~elData(c,"object-id"))||(this._mediaData.set(elData(c,"object-id"),c),this._mediaManagerMediaList.appendChild(c))}}this._setMedia(e)},setupMediaElement:function(e,t){var i=n.childByClass(t,"mediaInformation"),a=elCreate("nav");a.className="buttonGroupNavigation",i.parentNode.appendChild(a);var r=elCreate("ul");r.className="smallButtons buttonGroup",a.appendChild(r);var s=elCreate("li");r.appendChild(s);var c=elCreate("input");if(c.className="jsClipboardItem jsMediaCheckbox",elAttr(c,"type","checkbox"),elData(c,"object-id",e.mediaID),s.appendChild(c),l.get("admin.content.cms.canManageMedia")){s=elCreate("li"),r.appendChild(s);var d=elCreate("a");s.appendChild(d);var u=elCreate("span");u.className="icon icon16 fa-pencil jsTooltip jsMediaEditIcon",elData(u,"object-id",e.mediaID),elAttr(u,"title",o.get("wcf.global.button.edit")),d.appendChild(u),s=elCreate("li"),r.appendChild(s),d=elCreate("a"),s.appendChild(d),u=elCreate("span"),u.className="icon icon16 fa-times jsTooltip jsMediaDeleteIcon",elData(u,"object-id",e.mediaID),elAttr(u,"title",o.get("wcf.global.button.delete")),d.appendChild(u)}}},m}),define("WoltLab/WCF/Media/Manager/Editor",["Core","Dom/Traverse","Language","Ui/Dialog","WoltLab/WCF/Media/Manager/Base"],function(e,t,i,n,a){"use strict";function r(e){a.call(this,e),this._activeButton=null,this._buttons=elByClass(this._options.buttonClass||"jsMediaEditorButton");for(var t=0,i=this._buttons.length;i>t;t++)this._buttons[t].addEventListener("click",this._click.bind(this));this._activeButton=null}return e.inherit(r,a,{_addButtonEventListeners:function(){if(r._super.prototype._addButtonEventListeners.call(this),this._mediaManagerMediaList)for(var e=t.childrenByTag(this._mediaManagerMediaList,"LI"),i=0,n=e.length;n>i;i++){var a=e[i],o=elByClass("jsMediaInsertIcon",a)[0];o&&(o.classList.remove("jsMediaInsertIcon"),o.addEventListener("click",this._openInsertDialog.bind(this)))}},_click:function(e){this._activeButton=e.currentTarget,r._super.prototype._click.call(this,e)},_insertMedia:function(){},_openInsertDialog:function(e){var t=this._mediaData.get(~~elData(e.currentTarget,"object-id"));if(t.isImage&&t.smallThumbnailType){n.close(this);var a="mediaInsert"+t.mediaID;if(n.getDialog(a))n.openStatic(a);else{var r=elCreate("div"),o=elCreate("fieldset");r.appendChild(o);var s=elCreate("dl");o.appendChild(s);var l=elCreate("dt");l.textContent=i.get("wcf.media.insert.imageSize"),s.appendChild(l);var c=elCreate("dd");s.appendChild(c);var d=elCreate("select");c.appendChild(d);for(var u,h,p=["small","medium","large"],f=0,m=p.length;m>f;f++)u=p[f],t[u+"ThumbnailType"]&&(h=elCreate("option"),elAttr(h,"value",u),h.textContent=i.get("wcf.media.insert.imageSize."+u,{height:t[u+"ThumbnailHeight"],width:t[u+"ThumbnailWidth"]}),d.appendChild(h));h=elCreate("option"),elAttr(h,"value","original"),h.textContent=i.get("wcf.media.insert.imageSize.original",{height:t.height,width:t.width}),d.appendChild(h);var g=elCreate("div");g.className="formSubmit",r.appendChild(g);var v=elCreate("button");v.className="buttonPrimary",v.textContent=i.get("wcf.global.button.insert"),elData(v,"object-id",t.mediaID),v.addEventListener("click",this._insertMedia.bind(this)),g.appendChild(v),n.open({_dialogSetup:function(){return{id:a,options:{onClose:this._editorClose.bind(this),title:i.get("wcf.media.insert")},source:r.outerHTML}}.bind(this)})}}},getMode:function(){return"editor"},setupMediaElement:function(e,t){r._super.prototype.setupMediaElement.call(this,e,t);var n=elBySel("> nav.buttonGroupNavigation > ul.smallButtons",t),a=elCreate("li");n.appendChild(a);var o=elCreate("a");a.appendChild(o);var s=elCreate("span");s.className="icon icon16 fa-plus jsTooltip jsMediaInsertIcon",elData(s,"object-id",e.mediaID),elAttr(s,"title",i.get("wcf.media.button.insert")),o.appendChild(s)}}),r}),define("WoltLab/WCF/Media/Manager/Select",["Core","Dom/Traverse","Language","ObjectMap","Ui/Dialog","WoltLab/WCF/Media/Manager/Base"],function(e,t,i,n,a,r){"use strict";function o(e){r.call(this,e),this._activeButton=null,this._buttons=elByClass(this._options.buttonClass||"jsMediaSelectButton"),this._storeElements=new n;for(var t=0,i=this._buttons.length;i>t;t++){var a=this._buttons[t],o=elData(a,"store");if(o){var s=elById(o);s&&"INPUT"===s.tagName&&(this._buttons[t].addEventListener("click",this._click.bind(this)),this._storeElements.set(a,s))}}}return e.inherit(o,r,{_addButtonEventListeners:function(){if(o._super.prototype._addButtonEventListeners.call(this),this._mediaManagerMediaList)for(var e=t.childrenByTag(this._mediaManagerMediaList,"LI"),i=0,n=e.length;n>i;i++){var a=e[i],r=elByClass("jsMediaSelectIcon",a)[0];r&&(r.classList.remove("jsMediaSelectIcon"),r.addEventListener("click",this._chooseMedia.bind(this)))}},_chooseMedia:function(e){if(null===this._activeButton)throw new Error("Media cannot be chosen if no button is active.");var t=this._mediaData.get(~~elData(e.currentTarget,"object-id"));elById(elData(this._activeButton,"store")).value=t.mediaID;var i=elData(this._activeButton,"display");if(i){var n=elById(i);n&&t.isImage&&(n.innerHTML='<img src="'+t.smallThumbnailLink+'" alt="'+t.altText+'" />')}a.close("mediaManager")},_click:function(e){if(this._activeButton=e.currentTarget,o._super.prototype._click.call(this,e),this._mediaManagerMediaList)for(var i,n=this._storeElements.get(this._activeButton),a=t.childrenByTag(this._mediaManagerMediaList,"LI"),r=0,s=a.length;s>r;r++)i=a[r],n.value&&n.value==elData(i,"object-id")?i.classList.add("jsSelected"):i.classList.remove("jsSelected")},getMode:function(){return"select"},setupMediaElement:function(e,t){o._super.prototype.setupMediaElement.call(this,e,t);var n=elBySel("nav.buttonGroupNavigation > ul.smallButtons",t),a=elCreate("li");n.appendChild(a);var r=elCreate("a");a.appendChild(r);var s=elCreate("span");s.className="icon icon16 fa-check jsTooltip jsMediaSelectIcon",elData(s,"object-id",e.mediaID),elAttr(s,"title",i.get("wcf.media.button.choose")),r.appendChild(s)}}),o}),define("WoltLab/WCF/Ui/Dropdown/Reusable",["Dictionary","Ui/SimpleDropdown"],function(e,t){"use strict";function i(e){if(!n.has(e))throw new Error("Unknown dropdown identifier '"+e+"'");return n.get(e)}var n=new e,a=0;return{init:function(e,i){if(!n.has(e)){var r=elCreate("div");r.id="reusableDropdownGhost"+a++,t.initFragment(r,i),n.set(e,r.id)}},getDropdownMenu:function(e){return t.getDropdownMenu(i(e))},registerCallback:function(e,n){t.registerCallback(i(e),n)},toggleDropdown:function(e,n){t.toggleDropdown(i(e),n)}}}),define("WoltLab/WCF/Ui/ItemList/User",["WoltLab/WCF/Ui/ItemList"],function(e){"use strict";var t={init:function(t,i){e.init(t,[],{ajax:{className:"wcf\\data\\user\\UserAction",parameters:{data:{includeUserGroups:~~i.includeUserGroups}}},callbackChange:"function"==typeof i.callbackChange?i.callbackChange:null,excludedSearchValues:Array.isArray(i.excludedSearchValues)?i.excludedSearchValues:[],isCSV:!0,maxItems:~~i.maxItems||-1,restricted:!0})},getValues:function(t){return e.getValues(t)}};return t}),define("WoltLab/WCF/Ui/User/List",["Ajax","Core","Dictionary","Dom/Util","Ui/Dialog","WoltLab/WCF/Ui/Pagination"],function(e,t,i,n,a,r){"use strict";function o(e){this.init(e)}return o.prototype={init:function(e){this._cache=new i,this._pageCount=0,this._pageNo=1,this._options=t.extend({className:"",dialogTitle:"",parameters:{}},e)},open:function(){this._pageNo=1,this._showPage()},_showPage:function(t){if("number"==typeof t&&(this._pageNo=~~t),0!==this._pageCount&&(this._pageNo<1||this._pageNo>this._pageCount))throw new RangeError("pageNo must be between 1 and "+this._pageCount+" ("+this._pageNo+" given).");if(this._cache.has(this._pageNo)){var i=a.open(this,this._cache.get(this._pageNo));if(this._pageCount>1){var n=elBySel(".jsPagination",i.content);null!==n&&new r(n,{activePage:this._pageNo,maxPage:this._pageCount,callbackSwitch:this._showPage.bind(this)})}}else this._options.parameters.pageNo=this._pageNo,e.api(this,{parameters:this._options.parameters})},_ajaxSuccess:function(e){void 0!==e.returnValues.pageCount&&(this._pageCount=~~e.returnValues.pageCount),this._cache.set(this._pageNo,e.returnValues.template),this._showPage()},_ajaxSetup:function(){return{data:{actionName:"getGroupedUserList",className:this._options.className,interfaceName:"wcf\\data\\IGroupedUserListAction"}}},_dialogSetup:function(){return{id:n.getUniqueId(),options:{title:this._options.dialogTitle},source:null}}},o}),define("WoltLab/WCF/Ui/Like/Handler",["Ajax","Core","Dictionary","Language","ObjectMap","StringUtil","Dom/ChangeListener","Dom/Util","Ui/Dialog","WoltLab/WCF/Ui/User/List"],function(e,t,i,n,a,r,o,s,l,c){"use strict";function d(e,t){this.init(e,t)}var u=!1;return d.prototype={init:function(e,i){if(""===i.containerSelector)throw new Error("[WoltLab/WCF/Ui/Like/Handler] Expected a non-emtpy string for option 'containerSelector'.");this._containers=new a,this._details=new a,this._objectType=e,this._options=t.extend({badgeClassNames:"",isSingleItem:!1,markListItemAsActive:!1,renderAsButton:!0,summaryPrepend:!0,summaryUseIcon:!0,canDislike:!1,canLike:!1,canLikeOwnContent:!1,canViewSummary:!1,badgeContainerSelector:".messageHeader .messageStatus",buttonAppendToSelector:".messageFooter .messageFooterButtons",buttonBeforeSelector:"",containerSelector:"",summarySelector:".messageFooterGroup"},i),this.initContainers(i,e),o.add("WoltLab/WCF/Ui/Like/Handler-"+e,this.initContainers.bind(this))},initContainers:function(){for(var e,t,i=elBySelAll(this._options.containerSelector),n=!1,a=0,r=i.length;r>a;a++)e=i[a],this._containers.has(e)||(t={badge:null,dislikeButton:null,likeButton:null,summary:null,dislikes:~~elData(e,"like-dislikes"),liked:~~elData(e,"like-liked"),likes:~~elData(e,"like-likes"),objectId:~~elData(e,"object-id"),users:JSON.parse(elData(e,"like-users"))},this._containers.set(e,t),this._buildWidget(e,t),n=!0);n&&o.trigger()},_buildWidget:function(e,t){if(this._options.canViewSummary){var i,n,a,r=elBySel(this._options.summarySelector,e);null!==r&&(i=elCreate("div"),i.className="likesSummary",this._options.summaryUseIcon&&(a=elCreate("span"),a.className="icon icon16 fa-thumbs-o-up",i.appendChild(a)),n=elCreate("span"),n.className="likesSummaryContent",n.addEventListener("click",this._showSummary.bind(this,e)),i.appendChild(n),this._options.summaryPrepend?s.prepend(i,r):r.appendChild(i),t.summary=n,this._updateSummary(e))}var o,l,c=elBySel(this._options.badgeContainerSelector,e);if(null!==c&&(o=elCreate("a"),o.href="#",o.className="wcfLikeCounter jsTooltip"+(this._options.badgeClassNames?" "+this._options.badgeClassNames:""),o.addEventListener("click",this._showSummary.bind(this,e)),"OL"===c.nodeName||"UL"===c.nodeName?(l=elCreate("li"),l.appendChild(o),c.appendChild(l)):c.appendChild(o),t.badge=o,this._updateBadge(e)),WCF.User.userID!=elData(e,"user-id")||this._options.canLikeOwnContent){var d=this._options.buttonAppendToSelector?elBySel(this._options.buttonAppendToSelector,e):null,u=this._options.buttonBeforeSelector?elBySel(this._options.buttonBeforeSelector,e):null;if(null===u&&null===d)throw new Error("Unable to find insert location for like/dislike buttons.");t.likeButton=this._createButton(e,!0,u,d),this._options.canDislike&&(t.dislikeButton=this._createButton(e,!1,u,d)),this._updateActiveState(e)}},_createButton:function(e,t,i,a){var r=n.get("wcf.like.button."+(t?"like":"dislike")),o=elCreate("li");o.className="wcf"+(t?"Like":"Dislike")+"Button";var s=elCreate("a");return s.className="jsTooltip"+(this._options.renderAsButton?" button":""),s.href="#",s.title=r,s.innerHTML='<span class="icon icon16 fa-thumbs-o-'+(t?"up":"down")+'" /> <span class="invisible">'+r+"</span>",s.addEventListener("click",this._like.bind(this,e)),elData(s,"type",t?"like":"dislike"),o.appendChild(s),i?i.parentNode.insertBefore(o,i):a.appendChild(o),s},_showSummary:function(e,t){t.preventDefault(),this._details.has(e)||this._details.set(e,new c({className:"wcf\\data\\like\\LikeAction",dialogTitle:n.get("wcf.like.details"),parameters:{data:{containerID:s.identify(e),objectID:this._containers.get(e).objectId,objectType:this._objectType}}})),this._details.get(e).open()},_updateBadge:function(e){var t=this._containers.get(e);if(0===t.likes&&0===t.dislikes)elHide(t.badge);else{elShow(t.badge);var i=t.likes-t.dislikes,a='<span class="icon icon16 fa-thumbs-o-'+(0>i?"down":"up")+'"></span><span class="wcfLikeValue">';a+=i>0?"+"+r.addThousandsSeparator(i):0>i?"−"+r.addThousandsSeparator(Math.abs(i)):"±0",t.badge.innerHTML=a+"</span>",t.badge.setAttribute("data-tooltip",n.get("wcf.like.tooltip",{dislikes:t.dislikes,likes:t.likes}))}},_updateSummary:function(e){var t=this._containers.get(e);if(t.likes){elShow(t.summary.parentNode);for(var i=[],a=Object.keys(t.users),r=0,o=a.length;o>r;r++)i.push(t.users[a[r]]);var s=t.likes-i.length;t.summary.innerHTML=n.get("wcf.like.summary",{users:i,others:s})}else elHide(t.summary.parentNode)},_updateActiveState:function(e){var t=this._containers.get(e),i=this._options.markListItemAsActive?t.dislikeButton.parentNode:t.dislikeButton,n=this._options.markListItemAsActive?t.likeButton.parentNode:t.likeButton;null!==t.dislikeButton&&i.classList.remove("active"),n.classList.remove("active"),1===t.liked?n.classList.add("active"):-1===t.liked&&null!==t.dislikeButton&&i.classList.add("active")},_like:function(t,i){i.preventDefault(),u||(u=!0,e.api(this,{actionName:elData(i.currentTarget,"type"),parameters:{data:{containerID:s.identify(t),objectID:this._containers.get(t).objectId,objectType:this._objectType}}}))},_ajaxSuccess:function(e){var t=elById(e.returnValues.containerID),i=this._containers.get(t);if(void 0!==i){i.dislikes=~~e.returnValues.dislikes,i.likes=~~e.returnValues.likes;var n=e.returnValues.users;i.users=[];for(var a=Object.keys(n),o=0,s=a.length;s>o;o++)i.users.push(r.escapeHTML(n[a[o]].username));1==e.returnValues.isLiked?i.liked=1:1==e.returnValues.isDisliked?i.liked=-1:i.liked=0,this._updateBadge(t),this._options.canViewSummary&&this._updateSummary(t),this._updateActiveState(t),this._details["delete"](t),u=!1}},_ajaxSetup:function(){return{data:{className:"wcf\\data\\like\\LikeAction"}}}},d}),define("WoltLab/WCF/Ui/Message/InlineEditor",["Ajax","Core","Dictionary","Environment","EventHandler","Language","ObjectMap","Dom/Traverse","Dom/Util","Ui/Notification","Ui/ReusableDropdown"],function(e,t,i,n,a,r,o,s,l,c,d){"use strict";function u(e){this.init(e)}return u.prototype={init:function(e){this._activeDropdownElement=null,this._activeElement=null,this._dropdownMenu=null,this._elements=new o,this._options=t.extend({canEditInline:!1,extendedForm:!0,className:"",containerId:0,dropdownIdentifier:"",editorPrefix:"messageEditor",messageSelector:".jsMessage"},e),this._initElements()},_initElements:function(){for(var e,t,i,n=elBySelAll(this._options.messageSelector),a=0,r=n.length;r>a;a++)if(i=n[a],!this._elements.has(i)){e=elBySel(".jsMessageEditButton",i),null!==e&&(t=elDataBool(i,"can-edit"),this._options.canEditInline?(e.addEventListener("click",this._clickDropdown.bind(this,i)),e.classList.add("jsDropdownEnabled"),t&&e.addEventListener("dblclick",this._click.bind(this,i))):t&&e.addEventListener("click",this._click.bind(this,i)));var o=elBySel(".messageBody",i),s=elBySel(".messageFooter",i);this._elements.set(i,{button:e,messageBody:o,messageBodyEditor:null,messageFooter:s,messageFooterButtons:elBySel(".messageFooterButtons",s),messageText:elBySel(".messageText",o)})}},_click:function(t,i){null===t&&(t=this._activeDropdownElement),i&&i.preventDefault(),null===this._activeElement?(this._activeElement=t,this._prepare(),e.api(this,{actionName:"beginEdit",parameters:{containerID:this._options.containerId,objectID:this._getObjectId(t)}})):c.show("wcf.message.error.editorAlreadyInUse",null,"warning")},_clickDropdown:function(e,i){i.preventDefault();var n=i.currentTarget;if(!n.classList.contains("dropdownToggle")){if(n.classList.add("dropdownToggle"),n.parentNode.classList.add("dropdown"),function(e,t){e.addEventListener("click",function(i){i.preventDefault(),i.stopPropagation(),this._activeDropdownElement=t,d.toggleDropdown(this._options.dropdownIdentifier,e)}.bind(this))}.bind(this)(n,e),null===this._dropdownMenu){this._dropdownMenu=elCreate("ul"),this._dropdownMenu.className="dropdownMenu";var r=this._dropdownGetItems();a.fire("com.woltlab.wcf.inlineEditor","dropdownInit_"+this._options.dropdownIdentifier,{items:r}),this._dropdownBuild(r),d.init(this._options.dropdownIdentifier,this._dropdownMenu),d.registerCallback(this._options.dropdownIdentifier,this._dropdownToggle.bind(this))}setTimeout(function(){t.triggerEvent(n,"click")},10)}},_dropdownBuild:function(e){for(var t,i,n,a=this._clickDropdownItem.bind(this),o=0,s=e.length;s>o;o++)t=e[o],n=elCreate("li"),elData(n,"item",t.item),"divider"===t.item?n.className="dropdownDivider":(i=elCreate("span"),i.textContent=r.get(t.label),n.appendChild(i),"editItem"===t.item?n.addEventListener("click",this._click.bind(this,null)):n.addEventListener("click",a)),this._dropdownMenu.appendChild(n)},_dropdownToggle:function(e,t){var i=this._elements.get(this._activeDropdownElement);if(i.button.parentNode.classList["open"===t?"add":"remove"]("dropdownOpen"),i.messageFooterButtons.classList["open"===t?"add":"remove"]("forceVisible"),"open"===t){var n=this._dropdownOpen();a.fire("com.woltlab.wcf.inlineEditor","dropdownOpen_"+this._options.dropdownIdentifier,{element:this._activeDropdownElement,visibility:n});for(var r,o,s=!1,l=0;l<this._dropdownMenu.childElementCount;l++)o=this._dropdownMenu.children[l],r=elData(o,"item"),"divider"===r?s?(elShow(o),s=!1):elHide(o):objOwns(n,r)&&n[r]===!1?elHide(o):(elShow(o),s=!0)}},_dropdownGetItems:function(){},_dropdownOpen:function(){},_dropdownSelect:function(e){},_clickDropdownItem:function(e){e.preventDefault(),this._dropdownSelect(elData(e.currentTarget,"item"))},_prepare:function(){var e=this._elements.get(this._activeElement),t=elCreate("div");t.className="messageBody editor",e.messageBodyEditor=t;var i=elCreate("span");i.className="icon icon48 fa-spinner",t.appendChild(i),l.insertAfter(t,e.messageBody),elHide(e.messageBody)},_showEditor:function(e){var t=this._getEditorId(),i=this._elements.get(this._activeElement);this._activeElement.classList.add("jsInvalidQuoteTarget");var r=s.childByClass(i.messageBodyEditor,"icon");elRemove(r);var o=i.messageBodyEditor,c=elCreate("div");c.className="editorContainer",l.setInnerHtml(c,e.returnValues.template),o.appendChild(c);var d=elBySel(".formSubmit",c),u=elBySel('button[data-type="save"]',d);if(u.addEventListener("click",this._save.bind(this)),this._options.extendedForm){var h=elBySel('button[data-type="extended"]',d);h.addEventListener("click",this._prepareExtended.bind(this))}var p=elBySel('button[data-type="cancel"]',d);p.addEventListener("click",this._restoreMessage.bind(this)),a.add("com.woltlab.wcf.redactor","submitEditor_"+t,function(e){e.cancel=!0,this._save()}.bind(this)),elHide(i.messageFooter);var f=elById(t);"redactor"===n.editor()?window.setTimeout(function(){this._quoteManager&&this._quoteManager.setAlternativeEditor($element),(new WCF.Effect.Scroll).scrollTo(this._activeElement,!0)}.bind(this),250):f.focus()},_restoreMessage:function(){var e=this._elements.get(this._activeElement);this._destroyEditor(),elRemove(e.messageBodyEditor),e.messageBodyEditor=null,elShow(e.messageBody),elShow(e.messageFooter),this._activeElement.classList.remove("jsInvalidQuoteTarget"),this._activeElement=null,this._quoteManager&&this._quoteManager.clearAlternativeEditor()},_save:function(){var t={containerID:this._options.containerId,data:{message:""},objectID:this._getObjectId(this._activeElement),removeQuoteIDs:[]},i=this._getEditorId();a.fire("com.woltlab.wcf.redactor2","getText_"+i,t.data),a.fire("com.woltlab.wcf.messageOptionsInline","submit_"+i,t),e.api(this,{actionName:"save",parameters:t}),this._hideEditor()},_showMessage:function(e){var t=this._elements.get(this._activeElement),i=elBySelAll(".attachmentThumbnailList, .attachmentFileList",t.messageBody);if(l.setInnerHtml(t.messageBody,e.returnValues.message),"string"==typeof e.returnValues.attachmentList){for(var n=0,a=i.length;a>n;n++)elRemove(i[n]);var r=elCreate("div");for(l.setInnerHtml(r,e.returnValues.attachmentList);r.childNodes.length;)t.messageBody.appendChild(r.childNodes[0])}this._restoreMessage(),this._updateHistory(this._getHash(this._getObjectId(this._activeElement))),c.show()},_prepareExtended:function(){var t={actionName:"jumpToExtended",parameters:{containerID:this._options.containerId,message:"",messageID:this._getObjectId(this._activeElement)}},i=this._getEditorId();a.fire("com.woltlab.wcf.redactor","getText_"+i,t.parameters),e.api(this,t)},_hideEditor:function(){var e=this._elements.get(this._activeElement);elHide(s.childByClass(e.messageBodyEditor,"editorContainer"));var t=elCreate("span");t.className="icon icon48 fa-spinner",e.messageBodyEditor.appendChild(t)},_restoreEditor:function(){var e=this._elements.get(this._activeElement),t=elBySel(".fa-spinner",e.messageBodyEditor);elRemove(t);var i=s.childByClass(e.messageBodyEditor,"editorContainer");null!==i&&elShow(i)},_destroyEditor:function(){a.fire("com.woltlab.wcf.redactor","destroy_"+this._getEditorId())},_getHash:function(e){return"#message"+e},_updateHistory:function(e){window.location.hash=e},_getEditorId:function(){return this._options.editorPrefix+this._getObjectId(this._activeElement)},_getObjectId:function(e){return~~elData(e,"object-id")},_ajaxFailure:function(e){var t=this._elements.get(this._activeElement),i=elBySel(".redactor-editor",t.messageBodyEditor);if(null===i)return this._restoreMessage(),!0;if(this._restoreEditor(),!e||void 0===e.returnValues||void 0===e.returnValues.errorType)return!0;var n=elBySel(".innerError",t.messageBodyEditor);return null===n&&(n=elCreate("small"),n.className="innerError",l.insertAfter(n,i)),n.textContent=e.returnValues.errorType,!1},_ajaxSuccess:function(e){switch(e.actionName){case"beginEdit":this._showEditor(e);break;case"jumpToExtended":window.location=e.returnValues.url;break;case"save":this._showMessage(e)}},_ajaxSetup:function(){return{data:{className:this._options.className,interfaceName:"wcf\\data\\IMessageInlineEditorAction"}}},legacyGetDropdownMenus:function(){return this._dropdownMenus},legacyGetElements:function(){return this._elements},legacyEdit:function(e){this._click(elById(e),null)}},u}),define("WoltLab/WCF/Ui/Message/Manager",["Ajax","Core","Dictionary"],function(e,t,i){"use strict";function n(e){this.init(e)}return n.prototype={init:function(e){this._elements=null,this._options=t.extend({className:"",selector:""},e),this.rebuild()},rebuild:function(){this._elements=new i;for(var e,t=elBySelAll(this._options.selector),n=0,a=t.length;a>n;n++)e=t[n],this._elements.set(elData(e,"object-id"),e)},getPermission:function(e,t){t="can-"+this._getAttributeName(t);var i=this._elements.get(e);if(void 0===i)throw new Error("Unknown object id '"+e+"' for selector '"+this._options.selector+"'");return elDataBool(i,t)},getPropertyValue:function(e,t,i){var n=this._elements.get(e);if(void 0===n)throw new Error("Unknown object id '"+e+"' for selector '"+this._options.selector+"'");return window[i?"elDataBool":"elData"](n,this._getAttributeName(t))},update:function(t,i,n){e.api(this,{actionName:i,parameters:n||{},objectIDs:[t]})},updateItems:function(e,t){Array.isArray(e)||(e=[e]);for(var i,n=0,a=e.length;a>n;n++)if(i=this._elements.get(e[n]),void 0!==i)for(var r in t)objOwns(t,r)&&this._update(i,r,t[r])},updateAllItems:function(e){var t=[];this._elements.forEach(function(e,i){t.push(i)}.bind(this)),this.update(t,e)},_update:function(e,t,i){elData(e,this._getAttributeName(t),i);var n=1==i||i===!0||"true"===i;this._updateState(e,t,i,n)},_updateState:function(e,t,i,n){switch(t){case"isDeleted":e.classList[n?"add":"remove"]("messageDeleted");break;case"isDisabled":e.classList[n?"add":"remove"]("messageDisabled")}},_getAttributeName:function(e){if(-1!==e.indexOf("-"))return e;for(var t,i="",n=e.split(/([A-Z][a-z]+)/),a=0,r=n.length;r>a;a++)t=n[a],t.length&&(i.length&&(i+="-"),i+=t.toLowerCase());return i},_ajaxSuccess:function(e){throw new Error("Method _ajaxSuccess() must be implemented by deriving functions.")},_ajaxSetup:function(){return{data:{className:this._options.className}}}},n}),define("WoltLab/WCF/Ui/Message/Reply",["Ajax","Core","EventHandler","Language","Dom/Util","Ui/Notification","../Scroll"],function(e,t,i,n,a,r,o){"use strict";function s(e){this.init(e)}return s.prototype={init:function(e){this._options=t.extend({ajax:{className:""},successMessage:"wcf.global.success.add"},e),this._container=elById("messageQuickReply"),this._content=elBySel(".messageContent",this._container),this._textarea=elById("text"),this._editor=null,this._loadingOverlay=null,elBySel(".message",this._container).classList.add("jsInvalidQuoteTarget");var i=this._submit.bind(this),n=elBySel('button[data-type="save"]');n.addEventListener(WCF_CLICK_EVENT,i);for(var a=elBySelAll(".jsQuickReply"),r=0,s=a.length;s>r;r++)a[r].addEventListener(WCF_CLICK_EVENT,function(e){e.preventDefault(),o.element(this._container,function(){this._getEditor().focus.end()}.bind(this))}.bind(this))},_submit:function(t){if(t.preventDefault(),this._validate()){this._showLoadingOverlay();var n=a.getDataAttributes(this._container,"data-",!0,!0);n.data={message:this._getEditor().code.get()},i.fire("com.woltlab.wcf.redactor2","submit_text",n.data),e.api(this,{parameters:n})}},_validate:function(){for(var e=elByClass("innerError",this._container);e.length;)e[0].parentNode.removeChild(e[0]);if(this._getEditor().utils.isEmpty())return this.throwError(this._textarea,n.get("wcf.global.form.error.empty")),!1;var t={api:this,editor:this._getEditor(),message:this._getEditor().code.get(),valid:!0};return i.fire("com.woltlab.wcf.redactor2","validate_text",t),t.valid!==!1},throwError:function(e,t){var i=elCreate("small");i.className="innerError",i.textContent=t,a.insertAfter(i,e)},_showLoadingOverlay:function(){null===this._loadingOverlay&&(this._loadingOverlay=elCreate("div"),this._loadingOverlay.className="messageContentLoadingOverlay",this._loadingOverlay.innerHTML='<span class="icon icon96 fa-spinner"></span>'),this._content.classList.add("loading"),this._content.appendChild(this._loadingOverlay)},_hideLoadingOverlay:function(){this._content.classList.remove("loading");var e=elBySel(".messageContentLoadingOverlay",this._content);null!==e&&e.parentNode.removeChild(e)},_reset:function(){this._getEditor().code.set("<p>​</p>"),i.fire("com.woltlab.wcf.redactor2","reset_text")},_handleError:function(e){this.throwError(this._textarea,e.returnValues.errorType)},_getEditor:function(){if(null===this._editor){if("function"!=typeof window.jQuery)throw new Error("Unable to access editor, jQuery has not been loaded yet.");this._editor=window.jQuery(this._textarea).data("redactor")}return this._editor},_insertMessage:function(e){if(e.returnValues.url)window.location=e.returnValues.url;else{if(e.returnValues.template){var t;"DESC"===elData(this._container,"sort-order")?(a.insertHtml(e.returnValues.template,this._container,"after"),t=a.identify(this._container.nextElementSibling)):(a.insertHtml(e.returnValues.template,this._container,"before"),t=a.identify(this._container.previousElementSibling)),elData(this._container,"last-post-time",e.returnValues.lastPostTime),window.location.hash=t,o.element(elById(t))}r.show(n.get(this._options.successMessage))}},_ajaxSuccess:function(e){this._insertMessage(e),this._reset(),this._hideLoadingOverlay()},_ajaxFailure:function(e){return this._hideLoadingOverlay(),null===e||void 0===e.returnValues||void 0===e.returnValues.errorType?!0:(this._handleError(e),!1)},_ajaxSetup:function(){return{data:{actionName:"quickReply",className:this._options.ajax.className,interfaceName:"wcf\\data\\IMessageQuickReplyAction"}}}},s}),define("WoltLab/WCF/Ui/Redactor/Format",["Dom/Util"],function(e){"use strict";return{format:function(t,i,n,a){document.execCommand("strikethrough");for(var r,o,s,l=elBySelAll("strike",t),c=0,d=l.length;d>c;c++){if(s=l[c],r=elCreate(i),n&&(r.className=n),"object"==typeof a)for(o in a)a.hasOwnProperty(o)&&elAttr(r,key,a[key]);e.replaceElement(s,r)}},removeFormat:function(t,i){i=i.toUpperCase();for(var n=elByTag("strike",t);n.length;)e.unwrapChildNodes(n[0]);document.execCommand("strikethrough");for(var a,r,o;n.length;){for(o=n[0],r=this._getLastMatchingParent(o,t,i),null!==r&&this._handleParentNodes(o,r,i),a=elByTag(i.toLowerCase(),o);a.length;)e.unwrapChildNodes(a[0]);e.unwrapChildNodes(o)}},_handleParentNodes:function(t,i,n){var a;if(!e.isAtNodeStart(t,i)){a=document.createRange(),a.setStartBefore(i),a.setEndBefore(t);var r=a.extractContents();i.parentNode.insertBefore(r,i)}e.isAtNodeEnd(t,i)||(a=document.createRange(),a.setStartAfter(t),a.setEndAfter(i),r=a.extractContents(),i.parentNode.insertBefore(r,i.nextSibling));for(var o=elByTag(n,i);o.length;)e.unwrapChildNodes(o[0]);e.unwrapChildNodes(i)},_getLastMatchingParent:function(e,t,i){for(var n=e.parentNode,a=null;n!==t;)n.nodeName===i&&(a=n),n=n.parentNode;return a}}}),define("WoltLab/WCF/Ui/Redactor/Link",["Language","Ui/Dialog"],function(e,t){"use strict";var i=!1,n=null;return{showDialog:function(a){t.open(this),t.setTitle(this,e.get("wcf.redactor.link."+(a.insert?"add":"edit")));var r=elById("redactor-modal-button-action");r.textContent=e.get("wcf.global.button."+(a.insert?"insert":"save")),n=a.submitCallback,i||(i=!0,r.addEventListener(WCF_CLICK_EVENT,this._submit.bind(this)))},_submit:function(){if(n())t.close(this);else{var i=elById("redactor-link-url"),a=i.nextElementSibling&&"SMALL"===i.nextElementSibling.nodeName?i.nextElementSibling:null;null===a&&(a=elCreate("small"),a.className="innerError",a.textContent=e.get("wcf.global.form.error.empty"),i.parentNode.appendChild(a))}},_dialogSetup:function(){return{id:"redactorDialogLink",options:{onClose:function(){var e=elById("redactor-link-url"),t=e.nextElementSibling&&"SMALL"===e.nextElementSibling.nodeName?e.nextElementSibling:null;null!==t&&elRemove(t)}},source:'<dl><dt><label for="redactor-link-url">'+e.get("wcf.redactor.link.url")+'</label></dt><dd><input type="url" id="redactor-link-url" class="long"></dd></dl><dl><dt><label for="redactor-link-url-text">'+e.get("wcf.redactor.link.text")+'</label></dt><dd><input type="text" id="redactor-link-url-text" class="long"></dd></dl><div class="formSubmit"><button id="redactor-modal-button-action" class="buttonPrimary"></button></div>'}}}}),define("WoltLab/WCF/Ui/Redactor/Mention",["Ajax","Environment","EventHandler","Ui/Alignment"],function(e,t,i,n){"use strict";function a(e){this.init(e)}return a.prototype={init:function(e){this._active=!1,this._caret=null,this._dropdownActive=!1,this._dropdownMenu=null,this._itemIndex=0,this._lineHeight=null,this._mentionStart="",this._redactor=e,this._timer=null,e.WoltLabEvent.register("keydown",this._keyDown.bind(this)),e.WoltLabEvent.register("keyup",this._keyUp.bind(this))},_keyDown:function(e){if(this._dropdownActive){var t=e.event;switch(t.which){case 13:this._setUsername(null,this._dropdownMenu.children[this._itemIndex].children[0]);break;case 38:this._selectItem(-1);break;case 40:this._selectItem(1);break;default:return}t.preventDefault(),e.cancel=!0}},_keyUp:function(t){var i=t.event;if(13===i.which)return void(this._active=!1);var n=this._getTextLineInFrontOfCaret();if(n.length){var a=n.match(/@([^,]{3,})$/);a?(!a.index||n[a.index-1].match(/\s/))&&(this._mentionStart=a[1],null!==this._timer&&(window.clearTimeout(this._timer),this._timer=null),this._timer=window.setTimeout(function(){e.api(this,{parameters:{data:{searchString:this._mentionStart}}}),this._timer=null}.bind(this),500)):this._hideDropdown()}else this._hideDropdown()},_setUsername:function(e,t){e&&(e.preventDefault(),t=e.currentTarget);var i=window.getSelection();i.removeAllRanges(),i.addRange(this._caret);var n=i.getRangeAt(0).cloneRange();this._redactor.buffer.set();var a=n.startContainer,r=n.startOffset-(this._mentionStart.length+1);
 0>r&&(a=a.previousSibling,r=a.length-(this._mentionStart.length+1)-(n.startOffset-1));var o=document.createRange();o.setStart(a,r),o.setEnd(n.startContainer,n.startOffset),i.removeAllRanges(),i.addRange(o);var s=getSelection().getRangeAt(0);s.deleteContents(),s.collapse(!0);var l=elCreate("woltlab-mention");elAttr(l,"contenteditable","false"),elData(l,"user-id",elData(t,"user-id")),elData(l,"username",elData(t,"username")),l.textContent=elData(t,"username");var c=document.createTextNode("‌");s.insertNode(c),s.insertNode(l),o=document.createRange(),o.selectNode(c),o.collapse(!1),i.removeAllRanges(),i.addRange(o),this._redactor.selection.save(),this._hideDropdown()},_getTextLineInFrontOfCaret:function(){var e=window.getSelection().getRangeAt(0);if(!e.collapsed)return"";"firefox"===t.browser()&&e.startContainer.nodeType===Node.TEXT_NODE&&e.startContainer.parentNode.normalize();var i=e.startContainer.textContent.substr(0,e.startOffset),n=i;i="";for(var a=!1,r=0;r<n.length;r++){var o=n.charCodeAt(r).toString(16);"200b"===o||/\s/.test(n[r])&&("a0"!==o&&"20"!==o||a)?(a=!1,i=""):(("a0"===o||"20"===o)&&(a=!0),"@"===n[r]&&r&&/\s/.test(n[r-1])&&(a=!1,i=""),i+=n[r])}return i},_ajaxSetup:function(){return{data:{actionName:"getSearchResultList",className:"wcf\\data\\user\\UserAction",interfaceName:"wcf\\data\\ISearchAction",parameters:{data:{includeUserGroups:!1}}}}},_ajaxSuccess:function(e){if(!Array.isArray(e.returnValues)||!e.returnValues.length)return void this._hideDropdown();null===this._dropdownMenu&&(this._dropdownMenu=elCreate("ol"),this._dropdownMenu.className="dropdownMenu",elById("dropdownMenuContainer").appendChild(this._dropdownMenu)),this._dropdownMenu.innerHTML="";for(var t,i,n,a=this._setUsername.bind(this),r=0,o=e.returnValues.length;o>r;r++)n=e.returnValues[r],i=elCreate("li"),t=elCreate("a"),t.addEventListener("click",a),t.className="box16",t.innerHTML="<span>"+n.icon+"</span> <span>"+n.label+"</span>",elData(t,"user-id",n.objectID),elData(t,"username",n.label),i.appendChild(t),this._dropdownMenu.appendChild(i);this._dropdownMenu.classList.add("dropdownOpen"),this._dropdownActive=!0,this._updateDropdownPosition()},_getDropdownMenuPosition:function(){this._redactor.selection.save();var e=window.getSelection(),t=e.getRangeAt(0).cloneRange(),i=document.createRange();i.setStart(t.startContainer,t.startOffset-(this._mentionStart.length+1)),i.setEnd(t.startContainer,t.startOffset),e.removeAllRanges(),e.addRange(i);var n=e.getRangeAt(0).getBoundingClientRect(),a={top:Math.round(n.bottom)+window.scrollY,left:Math.round(n.left)+document.body.scrollLeft};return null===this._lineHeight&&(this._lineHeight=Math.round(n.bottom-n.top-window.scrollY)),this._redactor.selection.restore(),this._caret=t,a},_updateDropdownPosition:function(){try{var e=this._getDropdownMenuPosition();e.top+=7,this._dropdownMenu.style.setProperty("left",e.left+"px",""),this._dropdownMenu.style.setProperty("top",e.top+"px",""),this._selectItem(0),e.top+this._dropdownMenu.offsetHeight+10>window.innerHeight+window.scrollY?(this._dropdownMenu.classList.add("dropdownArrowBottom"),this._dropdownMenu.style.setProperty("top",e.top-this._dropdownMenu.offsetHeight-2*this._lineHeight+7+"px","")):this._dropdownMenu.classList.remove("dropdownArrowBottom")}catch(t){console.debug(t)}},_selectItem:function(e){var t=elBySel(".active",this._dropdownMenu);null!==t&&t.classList.remove("active"),this._itemIndex+=e,-1===this._itemIndex?this._itemIndex=this._dropdownMenu.childElementCount-1:this._itemIndex===this._dropdownMenu.childElementCount&&(this._itemIndex=0),this._dropdownMenu.children[this._itemIndex].classList.add("active")},_hideDropdown:function(){null!==this._dropdownMenu&&this._dropdownMenu.classList.remove("dropdownOpen"),this._dropdownActive=!1}},a}),define("WoltLab/WCF/Ui/Redactor/Quote",["EventHandler","Language","Dom/Util","Ui/Dialog"],function(e,t,i,n){"use strict";var a=null,r=null,o=null,s=0,l=0,c=null,d=null,u=null;return{initEditor:function(t,i){e.add("com.woltlab.wcf.redactor","observe_load_"+t,function(e){this.observeAll(e.editor)}.bind(this)),this.observeAll(i)},insert:function(e){o=e,n.open(this),n.setTitle(this,t.get("wcf.wysiwyg.quote.insert")),c.textContent=t.get("wcf.global.button.submit"),d.value="",u.value=""},edit:function(e,a){if(e instanceof Event&&(a=e.currentTarget),0===l){var o=window.getComputedStyle(a,"::before");l=i.styleAsInt(o,"height"),o=window.getComputedStyle(a),s=i.styleAsInt(o,"padding-top")}if(e instanceof Event){var h=i.offset(a);if(e.clientY+window.scrollY>h.top+s+l)return;e.preventDefault()}r=a,n.open(this),n.setTitle(this,t.get("wcf.wysiwyg.quote.edit")),c.textContent=t.get("wcf.global.button.save"),d.value=elData(r,"quote-title"),u.value=elData(r,"quote-url")},observeAll:function(e){for(var t=elByTag("BLOCKQUOTE",e),i=0,n=t.length;n>i;i++)this._observe(t[i],!0)},_observe:function(e,t){null===a&&(a=this.edit.bind(this)),e.removeEventListener(WCF_CLICK_EVENT,a),e.addEventListener(WCF_CLICK_EVENT,a),t&&this._updateHeader(e)},_updateHeader:function(e){var i=t.get("wcf.wysiwyg.quote.header",{title:elData(e,"quote-title")||elData(e,"quote-url")||""});elData(e,"quote-header")!==i&&elData(e,"quote-header",i)},_dialogSubmit:function(){if(null!==o){var e=elCreate("blockquote");e.className="quoteBox",e.id="quote-"+i.getUniqueId(),o(e),r=elById(e.id),r.id="",this._observe(r,!1)}elData(r,"quote-title",d.value.trim()),elData(r,"quote-url",u.value.trim()),this._updateHeader(r),n.close(this)},_dialogOnSetup:function(){d=elById("wysiwygQuoteTitle"),u=elById("wysiwygQuoteUrl");var e=function(e){13===e.which&&this._dialogSubmit(e)}.bind(this);d.addEventListener("keyup",e),u.addEventListener("keyup",e),c=elById("wysiwygQuoteSubmit"),c.addEventListener(WCF_CLICK_EVENT,this._dialogSubmit.bind(this))},_dialogOnClose:function(){r=null,o=null},_dialogSetup:function(){return{id:"wysiwygQuoteDialog",options:{onClose:this._dialogOnClose.bind(this),onSetup:this._dialogOnSetup.bind(this)},source:'<dl><dt><label for="wysiwygQuoteTitle">'+t.get("wcf.wysiwyg.quote.title")+'</label></dt><dd><input type="text" id="wysiwygQuoteTitle" class="long"></dd></dl><dl><dt><label for="wysiwygQuoteUrl">'+t.get("wcf.wysiwyg.quote.url")+'</label></dt><dd><input type="text" id="wysiwygQuoteUrl" class="long"></dd></dl><div class="formSubmit"><button class="buttonPrimary" id="wysiwygQuoteSubmit"></button></div>'}}}}),define("WoltLab/WCF/Ui/Search/Input",["Ajax","Core","EventKey","Dom/Util","Ui/SimpleDropdown"],function(e,t,i,n,a){"use strict";function r(e,t){this.init(e,t)}return r.prototype={init:function(e,i){if(this._element=e,!(this._element instanceof Element))throw new TypeError("Expected a valid DOM element.");if("INPUT"!==this._element.nodeName||"search"!==this._element.type&&"text"!==this._element.type)throw new Error('Expected an input[type="text"].');this._activeItem=null,this._dropdownContainerId="",this._lastValue="",this._list=null,this._request=null,this._timerDelay=null,this._options=t.extend({ajax:{actionName:"getSearchResultList",className:"",interfaceName:"wcf\\data\\ISearchAction"},callbackDropdownInit:null,callbackSelect:null,delay:500,minLength:3,noResultPlaceholder:"",preventSubmit:!1},i),elAttr(this._element,"autocomplete","off"),this._element.addEventListener("keydown",this._keydown.bind(this)),this._element.addEventListener("keyup",this._keyup.bind(this))},_keydown:function(e){(null!==this._activeItem&&a.isOpen(this._dropdownContainerId)||this._options.preventSubmit)&&i.Enter(e)&&e.preventDefault(),(i.ArrowUp(e)||i.ArrowDown(e)||i.Escape(e))&&e.preventDefault()},_keyup:function(e){if(null!==this._activeItem){if(!a.isOpen(this._dropdownContainerId))return;if(i.ArrowUp(e))return e.preventDefault(),this._keyboardPreviousItem();if(i.ArrowDown(e))return e.preventDefault(),this._keyboardNextItem();if(i.Enter(e))return e.preventDefault(),this._keyboardSelectItem()}if(i.Escape(e))return void a.close(this._dropdownContainerId);var t=this._element.value.trim();if(this._lastValue!==t)return this._lastValue=t,t.length<this._options.minLength?void(this._dropdownContainerId&&a.close(this._dropdownContainerId)):void(this._options.delay?(null!==this._timerDelay&&window.clearTimeout(this._timerDelay),this._timerDelay=window.setTimeout(function(){this._search(t)}.bind(this),this._options.delay)):this._search(t))},_search:function(t){this._request&&this._request.abortPrevious(),this._request=e.api(this,this._getParameters(t))},_getParameters:function(e){return{parameters:{data:{searchString:e}}}},_keyboardNextItem:function(){this._activeItem.classList.remove("active"),this._activeItem.nextElementSibling?this._activeItem=this._activeItem.nextElementSibling:this._activeItem=this._list.children[0],this._activeItem.classList.add("active")},_keyboardPreviousItem:function(){this._activeItem.classList.remove("active"),this._activeItem.previousElementSibling?this._activeItem=this._activeItem.previousElementSibling:this._activeItem=this._list.children[this._list.childElementCount-1],this._activeItem.classList.add("active")},_keyboardSelectItem:function(){this._selectItem(this._activeItem)},_clickSelectItem:function(e){this._selectItem(e.currentTarget)},_selectItem:function(e){this._options.callbackSelect&&this._options.callbackSelect(e)===!1?this._element.value="":this._element.value=elData(e,"label"),this._activeItem=null,a.close(this._dropdownContainerId)},_ajaxSuccess:function(e){var t=!1;if(null===this._list?(this._list=elCreate("ul"),this._list.className="dropdownMenu",t=!0,"function"==typeof this._options.callbackDropdownInit&&this._options.callbackDropdownInit(this._list)):this._list.innerHTML="","object"==typeof e.returnValues){var i,r=this._clickSelectItem.bind(this);for(var o in e.returnValues)e.returnValues.hasOwnProperty(o)&&(i=this._createListItem(e.returnValues[o]),i.addEventListener(WCF_CLICK_EVENT,r),this._list.appendChild(i))}t&&(n.insertAfter(this._list,this._element),a.initFragment(this._element.parentNode,this._list),this._dropdownContainerId=n.identify(this._element.parentNode)),this._dropdownContainerId&&(this._activeItem=null,this._list.childElementCount||this._handleEmptyResult()!==!1?(a.open(this._dropdownContainerId),this._list.childElementCount&&~~elData(this._list.children[0],"object-id")&&(this._activeItem=this._list.children[0],this._activeItem.classList.add("active"))):a.close(this._dropdownContainerId))},_handleEmptyResult:function(){if(!this._options.noResultPlaceholder)return!1;var e=elCreate("li");e.className="dropdownText";var t=elCreate("span");return t.textContent=this._options.noResultPlaceholder,e.appendChild(t),this._list.appendChild(e),!0},_createListItem:function(e){var t=elCreate("li");elData(t,"object-id",e.objectID),elData(t,"label",e.label);var i=elCreate("span");return i.textContent=e.label,t.appendChild(i),t},_ajaxSetup:function(){return{data:this._options.ajax}}},r}),define("WoltLab/WCF/Ui/Search/Page",["Core","Dom/Util","Ui/SimpleDropdown","./Input"],function(e,t,i,n){"use strict";return{init:function(a){var r=elById("pageHeaderSearchInput");new n(r,{ajax:{className:"wcf\\data\\search\\keyword\\SearchKeywordAction"},callbackDropdownInit:function(e){e.classList.add("dropdownMenuPageSearch"),elData(e,"dropdown-alignment-horizontal","right");var i=r.clientWidth;e.style.setProperty("min-width",i+"px","");var n=r.parentNode,a=t.offset(n).left+n.clientWidth-(t.offset(r).left+i),o=t.styleAsInt(window.getComputedStyle(n),"padding-bottom");e.style.setProperty("transform","translateX(-"+Math.ceil(a)+"px) translateY(-"+o+"px)","")}});var o=i.getDropdownMenu(t.identify(elBySel(".pageHeaderSearchType"))),s=this._click.bind(this);elBySelAll("a[data-object-type]",o,function(e){e.addEventListener(WCF_CLICK_EVENT,s)});var l=elBySel('a[data-object-type="'+a+'"]',o);e.triggerEvent(l,WCF_CLICK_EVENT)},_click:function(e){e.preventDefault();var t=elData(e.currentTarget,"object-type"),i=elById("pageHeaderSearchParameters");i.innerHTML="";var n=elData(e.currentTarget,"parameters");n=n?JSON.parse(n):{},t&&(n["types[]"]=t);for(var a in n)if(n.hasOwnProperty(a)){var r=elCreate("input");r.type="hidden",r.name=a,r.value=n[a],i.appendChild(r)}var o=elBySel(".pageHeaderSearchType > .button",elById("pageHeaderSearchInputContainer"));o.textContent=e.currentTarget.textContent}}}),define("WoltLab/WCF/Ui/Toggle/Input",["Core"],function(e){"use strict";function t(e,t){this.init(e,t)}return t.prototype={init:function(t,i){if(this._element=elBySel(t),null===this._element)throw new Error("Unable to find element by selector '"+t+"'.");var n="INPUT"===this._element.nodeName?elAttr(this._element,"type"):"";if("checkbox"!==n&&"radio"!==n)throw new Error("Illegal element, expected input[type='checkbox'] or input[type='radio'].");this._options=e.extend({hide:[],show:[]},i),["hide","show"].forEach(function(e){var t,i,n;for(i=0,n=this._options[e].length;n>i;i++)if(t=this._options[e][i],"string"!=typeof t&&!(t instanceof Element))throw new TypeError("The array '"+e+"' may only contain string selectors or DOM elements.")}.bind(this)),this._element.addEventListener("change",this._change.bind(this))},_change:function(e){var t=e.currentTarget.checked;this._handleElements(this._options.show,t),this._handleElements(this._options.hide,!t)},_handleElements:function(e,t){for(var i,n,a=0,r=e.length;r>a;a++){if(i=e[a],"string"==typeof i){if(n=elBySel(i),null===n)throw new Error("Unable to find element by selector '"+i+"'.");e[a]=i=n}window[t?"elShow":"elHide"](i)}}},t}),define("WoltLab/WCF/Controller/Condition/Page/Dependence",["Dom/Traverse"],function(e){"use strict";function t(t,n){this._dependentElement=t,this._pageIds=n;for(var a=0,r=i.length;r>a;a++)i[a].addEventListener("change",this._checkVisibility.bind(this));e.parentByTag(this._dependentElement,"FORM").addEventListener("submit",function(){"none"===this._dependentElement.style.getPropertyValue("display")&&this._dependentElement.remove()}.bind(this)),this._checkVisibility()}var i=elBySelAll('input[name="pageIDs[]"]');return t.prototype={_checkVisibility:function(){for(var e,t=0,n=i.length;n>t;t++)if(e=i[t],e.checked&&-1!==this._pageIds.indexOf(~~e.value))return void elShow(this._dependentElement);elHide(this._dependentElement)}},t}),define("WoltLab/WCF/Controller/User/Notification/Settings",["Dictionary","Language","Dom/Traverse","Ui/SimpleDropdown"],function(e,t,i,n){"use strict";var a=new e,r=null,o=null,s={setup:function(){r=this._click.bind(this),o=this._selectType.bind(this);for(var e,t,i=elBySelAll("#notificationSettings .flexibleButtonGroup"),n=0,a=i.length;a>n;n++)e=i[n],t=elBySel(".notificationSettingsEmail",e),null!==t&&this._initGroup(e,t)},_initGroup:function(e,t){var n=~~elData(e,"object-id"),o=elById("settings_"+n+"_disabled");o.addEventListener("click",function(){t.classList.remove("active")});var s=elById("settings_"+n+"_enabled");s.addEventListener("click",function(){t.classList.add("active")});var l=i.childByTag(t,"INPUT"),c=i.childByTag(t,"A");elData(c,"object-id",n),c.addEventListener("click",r),a.set(n,{button:c,dropdownMenu:null,mailSetting:t,mailValue:l})},_click:function(e){e.preventDefault();var t=e.currentTarget,r=~~elData(t,"object-id"),o=a.get(r);if(null===o.dropdownMenu)o.dropdownMenu=this._createDropdown(r,o.mailValue.value),t.parentNode.classList.add("dropdown"),t.parentNode.appendChild(o.dropdownMenu),n.init(t,!0);else for(var s=i.childrenByTag(o.dropdownMenu,"LI"),l=o.mailValue.value,c=0;4>c;c++)s[c].classList[elData(s[c],"value")===l?"add":"remove"]("active")},_createDropdown:function(e,i){var n=elCreate("ul");n.className="dropdownMenu",elData(n,"object-id",e);for(var a,r,s,l=["instant","daily","divider","none"],c=0;4>c;c++)s=l[c],r=elCreate("li"),"divider"===s?r.className="dropdownDivider":(a=elCreate("a"),a.textContent=t.get("wcf.user.notification.mailNotificationType."+s),r.appendChild(a),elData(r,"value",s),r.addEventListener("click",o),i===s&&(r.className="active")),n.appendChild(r);return n},_selectType:function(e){var i=elData(e.currentTarget,"value"),n=~~elData(e.currentTarget.parentNode,"object-id"),r=a.get(n);r.mailValue.value=i,elBySel("span.title",r.mailSetting).textContent=t.get("wcf.user.notification.mailNotificationType."+i),r.button.classList["none"===i?"remove":"add"]("yellow"),r.button.classList["none"===i?"remove":"add"]("active")}};return s}),define("WoltLab/WCF/Ui/Page/Header/Fixed",["Core","EventHandler","Ui/Alignment","Ui/CloseOverlay","Ui/Screen","Ui/SimpleDropdown"],function(e,t,i,n,a,r){"use strict";var o,s,l,c,d=!1,u=!1;return{init:function(){o=elById("pageHeader"),s=elById("pageHeaderContainer"),this._initStickyPageHeader(),this._initSearchBar(),a.on("screen-md-down",{match:function(){u=!0},unmatch:function(){u=!1},setup:function(){u=!0}})},_initStickyPageHeader:function(){o.style.setProperty("min-height",o.clientHeight+"px"),c=o.clientHeight-elBySel(".mainMenu",o).clientHeight,this._scroll(),window.addEventListener("scroll",this._scroll.bind(this))},_initSearchBar:function(){var a=elById("pageHeaderSearch");a.addEventListener(WCF_CLICK_EVENT,function(e){e.stopPropagation()});var r=elById("pageHeaderSearchInput"),s=elBySel(".pageHeaderSearchLabel");l=elById("pageHeaderSearchInputContainer");var c=elById("topMenu");s.addEventListener(WCF_CLICK_EVENT,function(){!d&&!u||o.classList.contains("searchBarOpen")||(i.set(l,c,{horizontal:"right"}),o.classList.add("searchBarOpen"),r.focus())}),n.add("WoltLab/WCF/Ui/Page/Header/Fixed",function(){o.classList.remove("searchBarOpen")}),t.add("com.woltlab.wcf.MainMenuMobile","more",function(t){"com.woltlab.wcf.search"===t.identifier&&(t.handler.close(!0),e.triggerEvent(elById("pageHeaderSearchInput"),WCF_CLICK_EVENT))}.bind(this))},_scroll:function(){var e=d;d=window.scrollY>c,o.classList[d?"add":"remove"]("sticky"),s.classList[d?"add":"remove"]("stickyPageHeader"),!d&&e&&(o.classList.remove("searchBarOpen"),["bottom","left","right","top"].forEach(function(e){l.style.removeProperty(e)}))}}}),define("WoltLab/WCF/Ui/Page/Search/Input",["Core","WoltLab/WCF/Ui/Search/Input"],function(e,t){"use strict";function i(e,t){this.init(e,t)}return e.inherit(i,t,{init:function(t,n){if(n=e.extend({ajax:{className:"wcf\\data\\page\\PageAction"},callbackSuccess:null},n),"function"!=typeof n.callbackSuccess)throw new Error("Expected a valid callback function for 'callbackSuccess'.");i._super.prototype.init.call(this,t,n),this._pageId=0},setPageId:function(e){this._pageId=e},_getParameters:function(e){var t=i._super.prototype._getParameters.call(this,e);return t.objectIDs=[this._pageId],t},_ajaxSuccess:function(e){this._options.callbackSuccess(e)}}),i}),define("WoltLab/WCF/Ui/Page/Search/Handler",["Language","StringUtil","Dom/Util","Ui/Dialog","./Input"],function(e,t,i,n,a){"use strict";var r=null,o=null,s=null,l=null,c=null;return{open:function(e,t,i){r=i,n.open(this),n.setTitle(this,t),this._getSearchInputHandler().setPageId(e)},_buildList:function(n){if(this._resetList(),!Array.isArray(n.returnValues)||0===n.returnValues.length){var a=elCreate("small");return a.className="innerError",a.textContent=e.get("wcf.page.pageObjectID.search.noResults"),void i.insertAfter(a,o)}for(var r,s,d,u=0,h=n.returnValues.length;h>u;u++)s=n.returnValues[u],r=s.image,/^fa-/.test(r)&&(r='<span class="icon icon48 '+r+'"></span>'),d=elCreate("li"),elData(d,"object-id",s.objectID),d.innerHTML='<div class="box48">'+r+'<div><div class="containerHeadline"><h3><a href="'+t.escapeHTML(s.link)+'">'+t.escapeHTML(s.title)+"</a></h3>"+(s.description?"<p>"+s.description+"</p>":"")+"</div></div></div>",d.addEventListener(WCF_CLICK_EVENT,this._click.bind(this)),l.appendChild(d);elShow(c)},_resetList:function(){var e=o.nextElementSibling;e&&e.classList.contains("innerError")&&elRemove(e),l.innerHTML="",elHide(c)},_getSearchInputHandler:function(){if(null===s){var e=this._buildList.bind(this);s=new a(elById("wcfUiPageSearchInput"),{callbackSuccess:e})}return s},_click:function(e){"A"!==e.target.nodeName&&(e.stopPropagation(),r(elData(e.currentTarget,"object-id")),n.close(this))},_dialogSetup:function(){return{id:"wcfUiPageSearchHandler",options:{onShow:function(){null===o&&(o=elById("wcfUiPageSearchInput"),l=elById("wcfUiPageSearchResultList"),c=elById("wcfUiPageSearchResultListContainer")),o.value="",elHide(c),l.innerHTML="",o.focus()},title:""},source:'<div class="section"><dl><dt><label for="wcfUiPageSearchInput">'+e.get("wcf.page.pageObjectID.search.terms")+'</label></dt><dd><input type="text" id="wcfUiPageSearchInput" class="long"><small>'+e.get("wcf.page.pageObjectID.search.terms.description")+'</small></dd></dl></div><section id="wcfUiPageSearchResultListContainer" class="section sectionContainerList"><header class="sectionHeader"><h2 class="sectionTitle">'+e.get("wcf.page.pageObjectID.search.results")+'</h2><small class="sectionDescription">'+e.get("wcf.page.pageObjectID.search.results.description")+'</small></header><ul id="wcfUiPageSearchResultList" class="containerList wcfUiPageSearchResultList"></ul></section>'}}}}),define("WoltLab/WCF/Ui/User/Search/Input",["Core","WoltLab/WCF/Ui/Search/Input"],function(e,t){"use strict";function i(e,t){this.init(e,t)}return e.inherit(i,t,{init:function(t,n){var a=e.isPlainObject(n)&&n.includeUserGroups===!0;n=e.extend({ajax:{className:"wcf\\data\\user\\UserAction",parameters:{data:{includeUserGroups:a?1:0}}}},n),i._super.prototype.init.call(this,t,n)},_createListItem:function(e){var t=i._super.prototype._createListItem.call(this,e),n=elCreate("div");return n.className="box16",n.innerHTML="group"===e.type?'<span class="icon icon16 fa-users"></span>':e.icon,n.appendChild(t.children[0]),t.appendChild(n),t}}),i}),define("WoltLab/WCF/Ui/User/Profile/Menu/Item/Abstract",["Ajax","Dom/Util"],function(e,t){"use strict";function i(e,t){}return i.prototype={init:function(e,t){this._userId=e,this._isActive=t!==!1,this._initButton(),this._updateButton()},_initButton:function(){var e=elCreate("a");e.href="#",e.addEventListener(WCF_CLICK_EVENT,this._toggle.bind(this));var i=elCreate("li");i.appendChild(e);var n=elBySel('.userProfileButtonMenu[data-menu="interaction"]');t.prepend(i,n),this._button=e,this._listItem=i},_toggle:function(t){t.preventDefault(),e.api(this,{actionName:this._getAjaxActionName(),parameters:{data:{userID:this._userId}}})},_updateButton:function(){this._button.textContent=this._getLabel(),this._listItem.classList[this._isActive?"add":"remove"]("active")},_getLabel:function(){throw new Error("Implement me!")},_getAjaxActionName:function(){throw new Error("Implement me!")},_ajaxSuccess:function(){throw new Error("Implement me!")},_ajaxSetup:function(){throw new Error("Implement me!")}},i}),define("WoltLab/WCF/Ui/User/Profile/Menu/Item/Follow",["Core","Language","Ui/Notification","./Abstract"],function(e,t,i,n){"use strict";function a(e,t){this.init(e,t)}return e.inherit(a,n,{_getLabel:function(){return t.get("wcf.user.button."+(this._isActive?"un":"")+"follow")},_getAjaxActionName:function(){return this._isActive?"unfollow":"follow"},_ajaxSuccess:function(e){this._isActive=e.returnValues.following?!0:!1,this._updateButton(),i.show()},_ajaxSetup:function(){return{data:{className:"wcf\\data\\user\\follow\\UserFollowAction"}}}}),a}),define("WoltLab/WCF/Ui/User/Profile/Menu/Item/Ignore",["Core","Language","Ui/Notification","./Abstract"],function(e,t,i,n){"use strict";function a(e,t){this.init(e,t)}return e.inherit(a,n,{_getLabel:function(){return t.get("wcf.user.button."+(this._isActive?"un":"")+"ignore")},_getAjaxActionName:function(){return this._isActive?"unignore":"ignore"},_ajaxSuccess:function(e){this._isActive=e.returnValues.isIgnoredUser?!0:!1,this._updateButton(),i.show()},_ajaxSetup:function(){return{data:{className:"wcf\\data\\user\\ignore\\UserIgnoreAction"}}}}),a}),function(e){function t(){for(;n.length&&"function"==typeof n[0];)n.shift()()}var i=e.require,n=[],a=0;e.require=function(r,o){if(!Array.isArray(r))return i.apply(e,arguments);var s=a++;n.push(s),i(r,function(){var i=arguments;n[n.indexOf(s)]=function(){o.apply(e,i)},t()})},e.require.config=i.config}(window),define("require.linearExecution",function(){});
\ No newline at end of file